]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20201114
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.78 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20200802.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 runstatedir='${localstatedir}/run'
180 libdir='${exec_prefix}/lib'
181 includedir='${prefix}/include'
182 oldincludedir='/usr/include'
183 infodir='${datarootdir}/info'
184 mandir='${datarootdir}/man'
185
186 # Identity of this package.
187 PACKAGE_NAME=
188 PACKAGE_TARNAME=
189 PACKAGE_VERSION=
190 PACKAGE_STRING=
191 PACKAGE_BUGREPORT=
192
193 ac_prev=
194 for ac_option
195 do
196   # If the previous option needs an argument, assign it.
197   if test -n "$ac_prev"; then
198     eval "$ac_prev=\$ac_option"
199     ac_prev=
200     continue
201   fi
202
203   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
204
205   # Accept the important Cygnus configure options, so we can diagnose typos.
206
207   case $ac_option in
208
209   -bindir | --bindir | --bindi | --bind | --bin | --bi)
210     ac_prev=bindir ;;
211   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
212     bindir=$ac_optarg ;;
213
214   -build | --build | --buil | --bui | --bu)
215     ac_prev=build_alias ;;
216   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
217     build_alias=$ac_optarg ;;
218
219   -cache-file | --cache-file | --cache-fil | --cache-fi \
220   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
221     ac_prev=cache_file ;;
222   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
223   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
224     cache_file=$ac_optarg ;;
225
226   --config-cache | -C)
227     cache_file=config.cache ;;
228
229   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
230     ac_prev=datadir ;;
231   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
232   | --da=*)
233     datadir=$ac_optarg ;;
234
235   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
236   | --dataroo | --dataro | --datar)
237     ac_prev=datarootdir ;;
238   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
239   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
240     datarootdir=$ac_optarg ;;
241
242   -disable-* | --disable-*)
243     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
244     # Reject names that are not valid shell variable names.
245     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
246       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
247    { (exit 1); exit 1; }; }
248     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
249     eval "enable_$ac_feature=no" ;;
250
251   -enable-* | --enable-*)
252     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
253     # Reject names that are not valid shell variable names.
254     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
255       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
256    { (exit 1); exit 1; }; }
257     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
258     case $ac_option in
259       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
260       *) ac_optarg=yes ;;
261     esac
262     eval "enable_$ac_feature='$ac_optarg'" ;;
263
264   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
265   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
266   | --exec | --exe | --ex)
267     ac_prev=exec_prefix ;;
268   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
269   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
270   | --exec=* | --exe=* | --ex=*)
271     exec_prefix=$ac_optarg ;;
272
273   -gas | --gas | --ga | --g)
274     # Obsolete; use --with-gas.
275     with_gas=yes ;;
276
277   -help | --help | --hel | --he | -h)
278     ac_init_help=long ;;
279   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
280     ac_init_help=recursive ;;
281   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
282     ac_init_help=short ;;
283
284   -host | --host | --hos | --ho)
285     ac_prev=host_alias ;;
286   -host=* | --host=* | --hos=* | --ho=*)
287     host_alias=$ac_optarg ;;
288
289   -includedir | --includedir | --includedi | --included | --include \
290   | --includ | --inclu | --incl | --inc)
291     ac_prev=includedir ;;
292   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
293   | --includ=* | --inclu=* | --incl=* | --inc=*)
294     includedir=$ac_optarg ;;
295
296   -infodir | --infodir | --infodi | --infod | --info | --inf)
297     ac_prev=infodir ;;
298   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
299     infodir=$ac_optarg ;;
300
301   -libdir | --libdir | --libdi | --libd)
302     ac_prev=libdir ;;
303   -libdir=* | --libdir=* | --libdi=* | --libd=*)
304     libdir=$ac_optarg ;;
305
306   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
307   | --libexe | --libex | --libe)
308     ac_prev=libexecdir ;;
309   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
310   | --libexe=* | --libex=* | --libe=*)
311     libexecdir=$ac_optarg ;;
312
313   -localstatedir | --localstatedir | --localstatedi | --localstated \
314   | --localstate | --localstat | --localsta | --localst \
315   | --locals | --local | --loca | --loc | --lo)
316     ac_prev=localstatedir ;;
317   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
318   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
319   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
320     localstatedir=$ac_optarg ;;
321
322   -runstatedir | --runstatedir | --runstatedi | --runstated \
323   | --runstate | --runstat | --runsta | --runst \
324   | --runs | --run | --ru)
325     ac_prev=runstatedir ;;
326   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
327   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
328   | --runs=* | --run=* | --ru=*)
329     runstatedir=$ac_optarg ;;
330
331   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
332     ac_prev=mandir ;;
333   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
334     mandir=$ac_optarg ;;
335
336   -nfp | --nfp | --nf)
337     # Obsolete; use --without-fp.
338     with_fp=no ;;
339
340   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
341   | --no-cr | --no-c)
342     no_create=yes ;;
343
344   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
345   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
346     no_recursion=yes ;;
347
348   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
349   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
350   | --oldin | --oldi | --old | --ol | --o)
351     ac_prev=oldincludedir ;;
352   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
353   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
354   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
355     oldincludedir=$ac_optarg ;;
356
357   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
358     ac_prev=prefix ;;
359   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
360     prefix=$ac_optarg ;;
361
362   -program-prefix | --program-prefix | --program-prefi | --program-pref \
363   | --program-pre | --program-pr | --program-p)
364     ac_prev=program_prefix ;;
365   -program-prefix=* | --program-prefix=* | --program-prefi=* \
366   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
367     program_prefix=$ac_optarg ;;
368
369   -program-suffix | --program-suffix | --program-suffi | --program-suff \
370   | --program-suf | --program-su | --program-s)
371     ac_prev=program_suffix ;;
372   -program-suffix=* | --program-suffix=* | --program-suffi=* \
373   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
374     program_suffix=$ac_optarg ;;
375
376   -program-transform-name | --program-transform-name \
377   | --program-transform-nam | --program-transform-na \
378   | --program-transform-n | --program-transform- \
379   | --program-transform | --program-transfor \
380   | --program-transfo | --program-transf \
381   | --program-trans | --program-tran \
382   | --progr-tra | --program-tr | --program-t)
383     ac_prev=program_transform_name ;;
384   -program-transform-name=* | --program-transform-name=* \
385   | --program-transform-nam=* | --program-transform-na=* \
386   | --program-transform-n=* | --program-transform-=* \
387   | --program-transform=* | --program-transfor=* \
388   | --program-transfo=* | --program-transf=* \
389   | --program-trans=* | --program-tran=* \
390   | --progr-tra=* | --program-tr=* | --program-t=*)
391     program_transform_name=$ac_optarg ;;
392
393   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
394   | -silent | --silent | --silen | --sile | --sil)
395     silent=yes ;;
396
397   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
398     ac_prev=sbindir ;;
399   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
400   | --sbi=* | --sb=*)
401     sbindir=$ac_optarg ;;
402
403   -sharedstatedir | --sharedstatedir | --sharedstatedi \
404   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
405   | --sharedst | --shareds | --shared | --share | --shar \
406   | --sha | --sh)
407     ac_prev=sharedstatedir ;;
408   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
409   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
410   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
411   | --sha=* | --sh=*)
412     sharedstatedir=$ac_optarg ;;
413
414   -site | --site | --sit)
415     ac_prev=site ;;
416   -site=* | --site=* | --sit=*)
417     site=$ac_optarg ;;
418
419   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
420     ac_prev=srcdir ;;
421   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
422     srcdir=$ac_optarg ;;
423
424   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
425   | --syscon | --sysco | --sysc | --sys | --sy)
426     ac_prev=sysconfdir ;;
427   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
428   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
429     sysconfdir=$ac_optarg ;;
430
431   -target | --target | --targe | --targ | --tar | --ta | --t)
432     ac_prev=target_alias ;;
433   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
434     target_alias=$ac_optarg ;;
435
436   -v | -verbose | --verbose | --verbos | --verbo | --verb)
437     verbose=yes ;;
438
439   -version | --version | --versio | --versi | --vers | -V)
440     ac_init_version=: ;;
441
442   -with-* | --with-*)
443     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
444     # Reject names that are not valid shell variable names.
445     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
446       { echo "$as_me: error: invalid package name: $ac_package" >&2
447    { (exit 1); exit 1; }; }
448     ac_package=`echo $ac_package| sed 's/-/_/g'`
449     case $ac_option in
450       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
451       *) ac_optarg=yes ;;
452     esac
453     eval "with_$ac_package='$ac_optarg'" ;;
454
455   -without-* | --without-*)
456     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
457     # Reject names that are not valid shell variable names.
458     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
459       { echo "$as_me: error: invalid package name: $ac_package" >&2
460    { (exit 1); exit 1; }; }
461     ac_package=`echo $ac_package | sed 's/-/_/g'`
462     eval "with_$ac_package=no" ;;
463
464   --x)
465     # Obsolete; use --with-x.
466     with_x=yes ;;
467
468   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
469   | --x-incl | --x-inc | --x-in | --x-i)
470     ac_prev=x_includes ;;
471   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
472   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
473     x_includes=$ac_optarg ;;
474
475   -x-libraries | --x-libraries | --x-librarie | --x-librari \
476   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
477     ac_prev=x_libraries ;;
478   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
479   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
480     x_libraries=$ac_optarg ;;
481
482   -*) { echo "$as_me: error: unrecognized option: $ac_option
483 Try \`$0 --help' for more information." >&2
484    { (exit 1); exit 1; }; }
485     ;;
486
487   *=*)
488     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
489     # Reject names that are not valid shell variable names.
490     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
491       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
492    { (exit 1); exit 1; }; }
493     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
494     eval "$ac_envvar='$ac_optarg'"
495     export $ac_envvar ;;
496
497   *)
498     # FIXME: should be removed in autoconf 3.0.
499     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
500     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
501       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
502     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
503     ;;
504
505   esac
506 done
507
508 if test -n "$ac_prev"; then
509   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
510   { echo "$as_me: error: missing argument to $ac_option" >&2
511    { (exit 1); exit 1; }; }
512 fi
513
514 # Be sure to have absolute paths.
515 for ac_var in exec_prefix prefix
516 do
517   eval ac_val=$`echo $ac_var`
518   case $ac_val in
519     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
520     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
521    { (exit 1); exit 1; }; };;
522   esac
523 done
524
525 # Be sure to have absolute paths.
526 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
527               localstatedir libdir includedir oldincludedir infodir mandir
528 do
529   eval ac_val=$`echo $ac_var`
530   case $ac_val in
531     [\\/$]* | ?:[\\/]* ) ;;
532     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
533    { (exit 1); exit 1; }; };;
534   esac
535 done
536
537 # There might be people who depend on the old broken behavior: `$host'
538 # used to hold the argument of --host etc.
539 build=$build_alias
540 host=$host_alias
541 target=$target_alias
542
543 # FIXME: should be removed in autoconf 3.0.
544 if test "x$host_alias" != x; then
545   if test "x$build_alias" = x; then
546     cross_compiling=maybe
547     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
548     If a cross compiler is detected then cross compile mode will be used." >&2
549   elif test "x$build_alias" != "x$host_alias"; then
550     cross_compiling=yes
551   fi
552 fi
553
554 ac_tool_prefix=
555 test -n "$host_alias" && ac_tool_prefix=$host_alias-
556
557 test "$silent" = yes && exec 6>/dev/null
558
559 # Find the source files, if location was not specified.
560 if test -z "$srcdir"; then
561   ac_srcdir_defaulted=yes
562   # Try the directory containing this script, then its parent.
563   ac_prog=$0
564   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
565   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
566   srcdir=$ac_confdir
567   if test ! -r $srcdir/$ac_unique_file; then
568     srcdir=..
569   fi
570 else
571   ac_srcdir_defaulted=no
572 fi
573 if test ! -r $srcdir/$ac_unique_file; then
574   if test "$ac_srcdir_defaulted" = yes; then
575     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
576    { (exit 1); exit 1; }; }
577   else
578     { echo "$as_me: error: cannot find sources in $srcdir" >&2
579    { (exit 1); exit 1; }; }
580   fi
581 fi
582 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
583 ac_env_build_alias_set=${build_alias+set}
584 ac_env_build_alias_value=$build_alias
585 ac_cv_env_build_alias_set=${build_alias+set}
586 ac_cv_env_build_alias_value=$build_alias
587 ac_env_host_alias_set=${host_alias+set}
588 ac_env_host_alias_value=$host_alias
589 ac_cv_env_host_alias_set=${host_alias+set}
590 ac_cv_env_host_alias_value=$host_alias
591 ac_env_target_alias_set=${target_alias+set}
592 ac_env_target_alias_value=$target_alias
593 ac_cv_env_target_alias_set=${target_alias+set}
594 ac_cv_env_target_alias_value=$target_alias
595 ac_env_CC_set=${CC+set}
596 ac_env_CC_value=$CC
597 ac_cv_env_CC_set=${CC+set}
598 ac_cv_env_CC_value=$CC
599 ac_env_CFLAGS_set=${CFLAGS+set}
600 ac_env_CFLAGS_value=$CFLAGS
601 ac_cv_env_CFLAGS_set=${CFLAGS+set}
602 ac_cv_env_CFLAGS_value=$CFLAGS
603 ac_env_LDFLAGS_set=${LDFLAGS+set}
604 ac_env_LDFLAGS_value=$LDFLAGS
605 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_cv_env_LDFLAGS_value=$LDFLAGS
607 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
608 ac_env_CPPFLAGS_value=$CPPFLAGS
609 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
611 ac_env_CPP_set=${CPP+set}
612 ac_env_CPP_value=$CPP
613 ac_cv_env_CPP_set=${CPP+set}
614 ac_cv_env_CPP_value=$CPP
615
616 #
617 # Report the --help message.
618 #
619 if test "$ac_init_help" = "long"; then
620   # Omit some internal or obsolete options to make the list less imposing.
621   # This message is too long to be a string in the A/UX 3.1 sh.
622   cat <<EOF
623 \`configure' configures this package to adapt to many kinds of systems.
624
625 Usage: $0 [OPTION]... [VAR=VALUE]...
626
627 To assign environment variables (e.g., CC, CFLAGS...), specify them as
628 VAR=VALUE.  See below for descriptions of some of the useful variables.
629
630 Defaults for the options are specified in brackets.
631
632 Configuration:
633   -h, --help              display this help and exit
634       --help=short        display options specific to this package
635       --help=recursive    display the short help of all the included packages
636   -V, --version           display version information and exit
637   -q, --quiet, --silent   do not print \`checking...' messages
638       --cache-file=FILE   cache test results in FILE [disabled]
639   -C, --config-cache      alias for \`--cache-file=config.cache'
640   -n, --no-create         do not create output files
641       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
642
643 EOF
644
645   cat <<EOF
646 Installation directories:
647   --prefix=PREFIX         install architecture-independent files in PREFIX
648                           [$ac_default_prefix]
649   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
650                           [PREFIX]
651
652 By default, \`make install' will install all the files in
653 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
654 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
655 for instance \`--prefix=\$HOME'.
656
657 For better control, use the options below.
658
659 Fine tuning of the installation directories:
660   --bindir=DIR            user executables [EPREFIX/bin]
661   --sbindir=DIR           system admin executables [EPREFIX/sbin]
662   --libexecdir=DIR        program executables [EPREFIX/libexec]
663   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
664   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
665   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
666   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
667   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
668   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
669   --libdir=DIR            object code libraries [EPREFIX/lib]
670   --includedir=DIR        C header files [PREFIX/include]
671   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
672   --infodir=DIR           info documentation [DATAROOTDIR/info]
673   --mandir=DIR            man documentation [DATAROOTDIR/man]
674 EOF
675
676   cat <<\EOF
677
678 Program names:
679   --program-prefix=PREFIX            prepend PREFIX to installed program names
680   --program-suffix=SUFFIX            append SUFFIX to installed program names
681   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
682
683 System types:
684   --build=BUILD           configure for building on BUILD [guessed]
685   --host=HOST       build programs to run on HOST [BUILD]
686   --target=TARGET   configure for building compilers for TARGET [HOST]
687 EOF
688 fi
689
690 if test -n "$ac_init_help"; then
691
692   cat <<\EOF
693
694 Optional Packages:
695   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
696   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
697
698 Optional Features:
699   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
700   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
701
702 General Options:
703   --with-system-type=XXX  test: override derived host system-type
704   --disable-stripping     do not strip (debug info) installed executables
705   --with-pkg-config{=path} enable/disable use of pkg-config
706   --with-pkg-config-libdir=XXX use given directory for installing pc-files
707   --without-tests         suppress build with test-programs
708   --enable-mixed-case     tic should assume mixed-case filenames
709   --with-install-prefix   prefixes actual install-location ($DESTDIR)
710 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
711   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
712   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
713   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
714   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
715   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
716   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
717 Options to Specify the Libraries Built/Used:
718   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
719   --with-curses-dir=DIR   directory in which (n)curses is installed
720   --enable-widec          compile with wide-char/UTF-8 code
721   --with-lib-prefix       override library-prefix
722   --with-shlib-version=X  Specify rel or abi version for shared libs
723   --enable-rpath-link     link sample programs with rpath option
724 Fine-Tuning Your Configuration:
725   --enable-broken_linker  compile with broken-linker support code
726   --disable-largefile     omit support for large files
727   --with-rcs-ids          compile-in RCS identifiers
728 Extensions:
729   --disable-ext-funcs     disable function-extensions
730   --enable-const          compile with extra/non-standard const
731 Development Code:
732   --without-develop       disable development options
733 Experimental Code:
734   --with-pthread          use POSIX thread library
735   --enable-weak-symbols   enable weak-symbols for pthreads
736   --enable-reentrant      compile with experimental reentrant code
737   --with-wrap-prefix=XXX  override prefix used for public variables
738 Testing/development Options:
739   --disable-echo          do not display "compiling" commands
740   --enable-warnings       build: turn on GCC compiler warnings
741   --enable-warnings       test: turn on gcc compiler warnings
742   --enable-assertions     test: turn on generation of assertion code
743   --enable-expanded       test: generate functions for certain macros
744   --disable-macros        test: use functions rather than macros
745   --with-trace            test: add trace() function to all models of ncurses
746   --disable-gnat-projects test: disable GNAT projects even if usable
747 Ada95 Binding Options:
748   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
749   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
750   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
751   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
752   --with-ada-libname=XXX  override default Ada library-name
753
754 Some influential environment variables:
755   CC          C compiler command
756   CFLAGS      C compiler flags
757   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
758               nonstandard directory <lib dir>
759   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
760               headers in a nonstandard directory <include dir>
761   CPP         C preprocessor
762
763 Use these variables to override the choices made by `configure' or to help
764 it to find libraries and programs with nonstandard names/locations.
765
766 EOF
767 fi
768
769 if test "$ac_init_help" = "recursive"; then
770   # If there are subdirs, report their specific --help.
771   ac_popdir=`pwd`
772   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
773     cd $ac_subdir
774     # A "../" for each directory in /$ac_subdir.
775     ac_dots=`echo $ac_subdir |
776              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
777
778     case $srcdir in
779     .) # No --srcdir option.  We are building in place.
780       ac_sub_srcdir=$srcdir ;;
781     [\\/]* | ?:[\\/]* ) # Absolute path.
782       ac_sub_srcdir=$srcdir/$ac_subdir ;;
783     *) # Relative path.
784       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
785     esac
786
787     # Check for guested configure; otherwise get Cygnus style configure.
788     if test -f $ac_sub_srcdir/configure.gnu; then
789       echo
790       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
791     elif test -f $ac_sub_srcdir/configure; then
792       echo
793       $SHELL $ac_sub_srcdir/configure  --help=recursive
794     elif test -f $ac_sub_srcdir/configure.ac ||
795            test -f $ac_sub_srcdir/configure.in; then
796       echo
797       $ac_configure --help
798     else
799       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
800     fi
801     cd $ac_popdir
802   done
803 fi
804
805 test -n "$ac_init_help" && exit 0
806 if $ac_init_version; then
807   cat <<\EOF
808
809 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
810 Free Software Foundation, Inc.
811 This configure script is free software; the Free Software Foundation
812 gives unlimited permission to copy, distribute and modify it.
813 EOF
814   exit 0
815 fi
816 exec 5>config.log
817 cat >&5 <<EOF
818 This file contains any messages produced by compilers while
819 running configure, to aid debugging if configure makes a mistake.
820
821 It was created by $as_me, which was
822 generated by GNU Autoconf 2.52.20200802.  Invocation command line was
823
824   $ $0 $@
825
826 EOF
827 {
828 cat <<_ASUNAME
829 ## ---------- ##
830 ## Platform.  ##
831 ## ---------- ##
832
833 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
834 uname -m = `(uname -m) 2>/dev/null || echo unknown`
835 uname -r = `(uname -r) 2>/dev/null || echo unknown`
836 uname -s = `(uname -s) 2>/dev/null || echo unknown`
837 uname -v = `(uname -v) 2>/dev/null || echo unknown`
838
839 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
840 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
841
842 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
843 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
844 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
845 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
846 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
847 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
848 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
849
850 PATH = $PATH
851
852 _ASUNAME
853 } >&5
854
855 cat >&5 <<EOF
856 ## ------------ ##
857 ## Core tests.  ##
858 ## ------------ ##
859
860 EOF
861
862 # Keep a trace of the command line.
863 # Strip out --no-create and --no-recursion so they do not pile up.
864 # Also quote any args containing shell meta-characters.
865 ac_configure_args=
866 ac_sep=
867 for ac_arg
868 do
869   case $ac_arg in
870   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
871   | --no-cr | --no-c) ;;
872   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
873   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
874   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
875     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
876     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
877     ac_sep=" " ;;
878   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
879      ac_sep=" " ;;
880   esac
881   # Get rid of the leading space.
882 done
883
884 # When interrupted or exit'd, cleanup temporary files, and complete
885 # config.log.  We remove comments because anyway the quotes in there
886 # would cause problems or look ugly.
887 trap 'exit_status=$?
888   # Save into config.log some information that might help in debugging.
889   echo >&5
890   echo "## ----------------- ##" >&5
891   echo "## Cache variables.  ##" >&5
892   echo "## ----------------- ##" >&5
893   echo >&5
894   # The following way of writing the cache mishandles newlines in values,
895 {
896   (set) 2>&1 |
897     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
898     *ac_space=\ *)
899       sed -n \
900         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
901           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
902       ;;
903     *)
904       sed -n \
905         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
906       ;;
907     esac;
908 } >&5
909   sed "/^$/d" confdefs.h >conftest.log
910   if test -s conftest.log; then
911     echo >&5
912     echo "## ------------ ##" >&5
913     echo "## confdefs.h.  ##" >&5
914     echo "## ------------ ##" >&5
915     echo >&5
916     cat conftest.log >&5
917   fi
918   (echo; echo) >&5
919   test "$ac_signal" != 0 &&
920     echo "$as_me: caught signal $ac_signal" >&5
921   echo "$as_me: exit $exit_status" >&5
922   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
923     exit $exit_status
924      ' 0
925 for ac_signal in 1 2 13 15; do
926   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
927 done
928 ac_signal=0
929
930 # confdefs.h avoids OS command line length limits that DEFS can exceed.
931 rm -rf conftest* confdefs.h
932 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
933 echo >confdefs.h
934
935 # Let the site file select an alternate cache file if it wants to.
936 # Prefer explicitly selected file to automatically selected ones.
937 if test -z "$CONFIG_SITE"; then
938   if test "x$prefix" != xNONE; then
939     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
940   else
941     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
942   fi
943 fi
944 for ac_site_file in $CONFIG_SITE; do
945   if test -r "$ac_site_file"; then
946     { echo "$as_me:946: loading site script $ac_site_file" >&5
947 echo "$as_me: loading site script $ac_site_file" >&6;}
948     cat "$ac_site_file" >&5
949     . "$ac_site_file"
950   fi
951 done
952
953 if test -r "$cache_file"; then
954   # Some versions of bash will fail to source /dev/null (special
955   # files actually), so we avoid doing that.
956   if test -f "$cache_file"; then
957     { echo "$as_me:957: loading cache $cache_file" >&5
958 echo "$as_me: loading cache $cache_file" >&6;}
959     case $cache_file in
960       [\\/]* | ?:[\\/]* ) . $cache_file;;
961       *)                      . ./$cache_file;;
962     esac
963   fi
964 else
965   { echo "$as_me:965: creating cache $cache_file" >&5
966 echo "$as_me: creating cache $cache_file" >&6;}
967   >$cache_file
968 fi
969
970 # Check that the precious variables saved in the cache have kept the same
971 # value.
972 ac_cache_corrupted=false
973 for ac_var in `(set) 2>&1 |
974                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
975   eval ac_old_set=\$ac_cv_env_${ac_var}_set
976   eval ac_new_set=\$ac_env_${ac_var}_set
977   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
978   eval ac_new_val="\$ac_env_${ac_var}_value"
979   case $ac_old_set,$ac_new_set in
980     set,)
981       { echo "$as_me:981: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
982 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
983       ac_cache_corrupted=: ;;
984     ,set)
985       { echo "$as_me:985: error: \`$ac_var' was not set in the previous run" >&5
986 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
987       ac_cache_corrupted=: ;;
988     ,);;
989     *)
990       if test "x$ac_old_val" != "x$ac_new_val"; then
991         { echo "$as_me:991: error: \`$ac_var' has changed since the previous run:" >&5
992 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
993         { echo "$as_me:993:   former value:  $ac_old_val" >&5
994 echo "$as_me:   former value:  $ac_old_val" >&2;}
995         { echo "$as_me:995:   current value: $ac_new_val" >&5
996 echo "$as_me:   current value: $ac_new_val" >&2;}
997         ac_cache_corrupted=:
998       fi;;
999   esac
1000   # Pass precious variables to config.status.  It doesn't matter if
1001   # we pass some twice (in addition to the command line arguments).
1002   if test "$ac_new_set" = set; then
1003     case $ac_new_val in
1004     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1005       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1006       ac_configure_args="$ac_configure_args '$ac_arg'"
1007       ;;
1008     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1009        ;;
1010     esac
1011   fi
1012 done
1013 if $ac_cache_corrupted; then
1014   { echo "$as_me:1014: error: changes in the environment can compromise the build" >&5
1015 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1016   { { echo "$as_me:1016: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1017 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1018    { (exit 1); exit 1; }; }
1019 fi
1020
1021 ac_ext=c
1022 ac_cpp='$CPP $CPPFLAGS'
1023 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1024 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1025 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1026 ac_main_return=return
1027
1028 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1029   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1030                    ECHO_T='     ' ;;
1031   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1032   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1033 esac
1034 echo "#! $SHELL" >conftest.sh
1035 echo  "exit 0"   >>conftest.sh
1036 chmod +x conftest.sh
1037 if { (echo "$as_me:1037: PATH=\".;.\"; conftest.sh") >&5
1038   (PATH=".;."; conftest.sh) 2>&5
1039   ac_status=$?
1040   echo "$as_me:1040: \$? = $ac_status" >&5
1041   (exit $ac_status); }; then
1042   ac_path_separator=';'
1043 else
1044   ac_path_separator=:
1045 fi
1046 PATH_SEPARATOR="$ac_path_separator"
1047 rm -f conftest.sh
1048
1049 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1050
1051 top_builddir=`pwd`
1052
1053 ac_aux_dir=
1054 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1055   if test -f $ac_dir/install-sh; then
1056     ac_aux_dir=$ac_dir
1057     ac_install_sh="$ac_aux_dir/install-sh -c"
1058     break
1059   elif test -f $ac_dir/install.sh; then
1060     ac_aux_dir=$ac_dir
1061     ac_install_sh="$ac_aux_dir/install.sh -c"
1062     break
1063   elif test -f $ac_dir/shtool; then
1064     ac_aux_dir=$ac_dir
1065     ac_install_sh="$ac_aux_dir/shtool install -c"
1066     break
1067   fi
1068 done
1069 if test -z "$ac_aux_dir"; then
1070   { { echo "$as_me:1070: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1071 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1072    { (exit 1); exit 1; }; }
1073 fi
1074 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1075 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1076 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1077
1078 # Make sure we can run config.sub.
1079 $ac_config_sub sun4 >/dev/null 2>&1 ||
1080   { { echo "$as_me:1080: error: cannot run $ac_config_sub" >&5
1081 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1082    { (exit 1); exit 1; }; }
1083
1084 echo "$as_me:1084: checking build system type" >&5
1085 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1086 if test "${ac_cv_build+set}" = set; then
1087   echo $ECHO_N "(cached) $ECHO_C" >&6
1088 else
1089   ac_cv_build_alias=$build_alias
1090 test -z "$ac_cv_build_alias" &&
1091   ac_cv_build_alias=`$ac_config_guess`
1092 test -z "$ac_cv_build_alias" &&
1093   { { echo "$as_me:1093: error: cannot guess build type; you must specify one" >&5
1094 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1095    { (exit 1); exit 1; }; }
1096 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1097   { { echo "$as_me:1097: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1098 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1099    { (exit 1); exit 1; }; }
1100
1101 fi
1102 echo "$as_me:1102: result: $ac_cv_build" >&5
1103 echo "${ECHO_T}$ac_cv_build" >&6
1104 build=$ac_cv_build
1105 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1106 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1107 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1108
1109 echo "$as_me:1109: checking host system type" >&5
1110 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1111 if test "${ac_cv_host+set}" = set; then
1112   echo $ECHO_N "(cached) $ECHO_C" >&6
1113 else
1114   ac_cv_host_alias=$host_alias
1115 test -z "$ac_cv_host_alias" &&
1116   ac_cv_host_alias=$ac_cv_build_alias
1117 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1118   { { echo "$as_me:1118: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1119 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1120    { (exit 1); exit 1; }; }
1121
1122 fi
1123 echo "$as_me:1123: result: $ac_cv_host" >&5
1124 echo "${ECHO_T}$ac_cv_host" >&6
1125 host=$ac_cv_host
1126 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1127 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1128 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1129
1130 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1131         echo "$as_me:1131: checking target system type" >&5
1132 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1133 if test "${ac_cv_target+set}" = set; then
1134   echo $ECHO_N "(cached) $ECHO_C" >&6
1135 else
1136   ac_cv_target_alias=$target_alias
1137 test "x$ac_cv_target_alias" = "x" &&
1138   ac_cv_target_alias=$ac_cv_host_alias
1139 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1140   { { echo "$as_me:1140: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1141 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1142    { (exit 1); exit 1; }; }
1143
1144 fi
1145 echo "$as_me:1145: result: $ac_cv_target" >&5
1146 echo "${ECHO_T}$ac_cv_target" >&6
1147 target=$ac_cv_target
1148 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1149 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1150 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1151
1152 # The aliases save the names the user supplied, while $host etc.
1153 # will get canonicalized.
1154 test -n "$target_alias" &&
1155   test "$program_prefix$program_suffix$program_transform_name" = \
1156     NONENONEs,x,x, &&
1157   program_prefix=${target_alias}-
1158         system_name="$host_os"
1159 else
1160         system_name="`(uname -s -r) 2>/dev/null`"
1161         if test -z "$system_name" ; then
1162                 system_name="`(hostname) 2>/dev/null`"
1163         fi
1164 fi
1165 test -n "$system_name" &&
1166 cat >>confdefs.h <<EOF
1167 #define SYSTEM_NAME "$system_name"
1168 EOF
1169
1170 if test "${cf_cv_system_name+set}" = set; then
1171   echo $ECHO_N "(cached) $ECHO_C" >&6
1172 else
1173   cf_cv_system_name="$system_name"
1174 fi
1175
1176 test -z "$system_name" && system_name="$cf_cv_system_name"
1177 test -n "$cf_cv_system_name" && echo "$as_me:1177: result: Configuring for $cf_cv_system_name" >&5
1178 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1179
1180 if test ".$system_name" != ".$cf_cv_system_name" ; then
1181         echo "$as_me:1181: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1182 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1183         { { echo "$as_me:1183: error: \"Please remove config.cache and try again.\"" >&5
1184 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1185    { (exit 1); exit 1; }; }
1186 fi
1187
1188 # Check whether --with-system-type or --without-system-type was given.
1189 if test "${with_system_type+set}" = set; then
1190   withval="$with_system_type"
1191   { echo "$as_me:1191: WARNING: overriding system type to $withval" >&5
1192 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1193         cf_cv_system_name=$withval
1194         host_os=$withval
1195
1196 fi;
1197
1198 ###     Save the given $CFLAGS to allow user-override.
1199 cf_user_CFLAGS="$CFLAGS"
1200
1201 ###     Default install-location
1202
1203 echo "$as_me:1203: checking for prefix" >&5
1204 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1205 if test "x$prefix" = "xNONE" ; then
1206         case "$cf_cv_system_name" in
1207                 # non-vendor systems don't have a conflict
1208         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1209                 prefix=/usr
1210                 ;;
1211         (*)     prefix=$ac_default_prefix
1212                 ;;
1213         esac
1214 fi
1215 echo "$as_me:1215: result: $prefix" >&5
1216 echo "${ECHO_T}$prefix" >&6
1217
1218 if test "x$prefix" = "xNONE" ; then
1219 echo "$as_me:1219: checking for default include-directory" >&5
1220 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1221 test -n "$verbose" && echo 1>&6
1222 for cf_symbol in \
1223         $includedir \
1224         $includedir/ncurses \
1225         $prefix/include \
1226         $prefix/include/ncurses \
1227         /usr/local/include \
1228         /usr/local/include/ncurses \
1229         /usr/include \
1230         /usr/include/ncurses
1231 do
1232         cf_dir=`eval echo $cf_symbol`
1233         if test -f $cf_dir/curses.h ; then
1234         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1235                 includedir="$cf_symbol"
1236                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1237                 break
1238         fi
1239         fi
1240         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1241 done
1242 echo "$as_me:1242: result: $includedir" >&5
1243 echo "${ECHO_T}$includedir" >&6
1244 fi
1245
1246 ###     Checks for programs.
1247
1248 ac_ext=c
1249 ac_cpp='$CPP $CPPFLAGS'
1250 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1251 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1252 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1253 ac_main_return=return
1254 if test -n "$ac_tool_prefix"; then
1255   for ac_prog in gnatgcc gcc cc
1256   do
1257     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1258 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1259 echo "$as_me:1259: checking for $ac_word" >&5
1260 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1261 if test "${ac_cv_prog_CC+set}" = set; then
1262   echo $ECHO_N "(cached) $ECHO_C" >&6
1263 else
1264   if test -n "$CC"; then
1265   ac_cv_prog_CC="$CC" # Let the user override the test.
1266 else
1267   ac_save_IFS=$IFS; IFS=$ac_path_separator
1268 ac_dummy="$PATH"
1269 for ac_dir in $ac_dummy; do
1270   IFS=$ac_save_IFS
1271   test -z "$ac_dir" && ac_dir=.
1272   $as_executable_p "$ac_dir/$ac_word" || continue
1273 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1274 echo "$as_me:1274: found $ac_dir/$ac_word" >&5
1275 break
1276 done
1277
1278 fi
1279 fi
1280 CC=$ac_cv_prog_CC
1281 if test -n "$CC"; then
1282   echo "$as_me:1282: result: $CC" >&5
1283 echo "${ECHO_T}$CC" >&6
1284 else
1285   echo "$as_me:1285: result: no" >&5
1286 echo "${ECHO_T}no" >&6
1287 fi
1288
1289     test -n "$CC" && break
1290   done
1291 fi
1292 if test -z "$CC"; then
1293   ac_ct_CC=$CC
1294   for ac_prog in gnatgcc gcc cc
1295 do
1296   # Extract the first word of "$ac_prog", so it can be a program name with args.
1297 set dummy $ac_prog; ac_word=$2
1298 echo "$as_me:1298: checking for $ac_word" >&5
1299 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1300 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1301   echo $ECHO_N "(cached) $ECHO_C" >&6
1302 else
1303   if test -n "$ac_ct_CC"; then
1304   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1305 else
1306   ac_save_IFS=$IFS; IFS=$ac_path_separator
1307 ac_dummy="$PATH"
1308 for ac_dir in $ac_dummy; do
1309   IFS=$ac_save_IFS
1310   test -z "$ac_dir" && ac_dir=.
1311   $as_executable_p "$ac_dir/$ac_word" || continue
1312 ac_cv_prog_ac_ct_CC="$ac_prog"
1313 echo "$as_me:1313: found $ac_dir/$ac_word" >&5
1314 break
1315 done
1316
1317 fi
1318 fi
1319 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1320 if test -n "$ac_ct_CC"; then
1321   echo "$as_me:1321: result: $ac_ct_CC" >&5
1322 echo "${ECHO_T}$ac_ct_CC" >&6
1323 else
1324   echo "$as_me:1324: result: no" >&5
1325 echo "${ECHO_T}no" >&6
1326 fi
1327
1328   test -n "$ac_ct_CC" && break
1329 done
1330
1331   CC=$ac_ct_CC
1332 fi
1333
1334 test -z "$CC" && { { echo "$as_me:1334: error: no acceptable cc found in \$PATH" >&5
1335 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1336    { (exit 1); exit 1; }; }
1337
1338 # Provide some information about the compiler.
1339 echo "$as_me:1339:" \
1340      "checking for C compiler version" >&5
1341 ac_compiler=`set X $ac_compile; echo $2`
1342 { (eval echo "$as_me:1342: \"$ac_compiler --version </dev/null >&5\"") >&5
1343   (eval $ac_compiler --version </dev/null >&5) 2>&5
1344   ac_status=$?
1345   echo "$as_me:1345: \$? = $ac_status" >&5
1346   (exit $ac_status); }
1347 { (eval echo "$as_me:1347: \"$ac_compiler -v </dev/null >&5\"") >&5
1348   (eval $ac_compiler -v </dev/null >&5) 2>&5
1349   ac_status=$?
1350   echo "$as_me:1350: \$? = $ac_status" >&5
1351   (exit $ac_status); }
1352 { (eval echo "$as_me:1352: \"$ac_compiler -V </dev/null >&5\"") >&5
1353   (eval $ac_compiler -V </dev/null >&5) 2>&5
1354   ac_status=$?
1355   echo "$as_me:1355: \$? = $ac_status" >&5
1356   (exit $ac_status); }
1357
1358 cat >conftest.$ac_ext <<_ACEOF
1359 #line 1359 "configure"
1360 #include "confdefs.h"
1361
1362 int
1363 main (void)
1364 {
1365
1366   ;
1367   return 0;
1368 }
1369 _ACEOF
1370 ac_clean_files_save=$ac_clean_files
1371 ac_clean_files="$ac_clean_files a.out a.exe"
1372 # Try to create an executable without -o first, disregard a.out.
1373 # It will help us diagnose broken compilers, and finding out an intuition
1374 # of exeext.
1375 echo "$as_me:1375: checking for C compiler default output" >&5
1376 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1377 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1378 if { (eval echo "$as_me:1378: \"$ac_link_default\"") >&5
1379   (eval $ac_link_default) 2>&5
1380   ac_status=$?
1381   echo "$as_me:1381: \$? = $ac_status" >&5
1382   (exit $ac_status); }; then
1383   # Find the output, starting from the most likely.  This scheme is
1384 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1385 # resort.
1386 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1387                 ls a.out conftest 2>/dev/null;
1388                 ls a.* conftest.* 2>/dev/null`; do
1389   case $ac_file in
1390     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1391     a.out ) # We found the default executable, but exeext='' is most
1392             # certainly right.
1393             break;;
1394     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1395           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1396           export ac_cv_exeext
1397           break;;
1398     * ) break;;
1399   esac
1400 done
1401 else
1402   echo "$as_me: failed program was:" >&5
1403 cat conftest.$ac_ext >&5
1404 { { echo "$as_me:1404: error: C compiler cannot create executables" >&5
1405 echo "$as_me: error: C compiler cannot create executables" >&2;}
1406    { (exit 77); exit 77; }; }
1407 fi
1408
1409 ac_exeext=$ac_cv_exeext
1410 echo "$as_me:1410: result: $ac_file" >&5
1411 echo "${ECHO_T}$ac_file" >&6
1412
1413 # Check the compiler produces executables we can run.  If not, either
1414 # the compiler is broken, or we cross compile.
1415 echo "$as_me:1415: checking whether the C compiler works" >&5
1416 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1417 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1418 # If not cross compiling, check that we can run a simple program.
1419 if test "$cross_compiling" != yes; then
1420   if { ac_try='./$ac_file'
1421   { (eval echo "$as_me:1421: \"$ac_try\"") >&5
1422   (eval $ac_try) 2>&5
1423   ac_status=$?
1424   echo "$as_me:1424: \$? = $ac_status" >&5
1425   (exit $ac_status); }; }; then
1426     cross_compiling=no
1427   else
1428     if test "$cross_compiling" = maybe; then
1429         cross_compiling=yes
1430     else
1431         { { echo "$as_me:1431: error: cannot run C compiled programs.
1432 If you meant to cross compile, use \`--host'." >&5
1433 echo "$as_me: error: cannot run C compiled programs.
1434 If you meant to cross compile, use \`--host'." >&2;}
1435    { (exit 1); exit 1; }; }
1436     fi
1437   fi
1438 fi
1439 echo "$as_me:1439: result: yes" >&5
1440 echo "${ECHO_T}yes" >&6
1441
1442 rm -f a.out a.exe conftest$ac_cv_exeext
1443 ac_clean_files=$ac_clean_files_save
1444 # Check the compiler produces executables we can run.  If not, either
1445 # the compiler is broken, or we cross compile.
1446 echo "$as_me:1446: checking whether we are cross compiling" >&5
1447 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1448 echo "$as_me:1448: result: $cross_compiling" >&5
1449 echo "${ECHO_T}$cross_compiling" >&6
1450
1451 echo "$as_me:1451: checking for executable suffix" >&5
1452 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1453 if { (eval echo "$as_me:1453: \"$ac_link\"") >&5
1454   (eval $ac_link) 2>&5
1455   ac_status=$?
1456   echo "$as_me:1456: \$? = $ac_status" >&5
1457   (exit $ac_status); }; then
1458   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1459 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1460 # work properly (i.e., refer to `conftest.exe'), while it won't with
1461 # `rm'.
1462 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1463   case $ac_file in
1464     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1465     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1466           export ac_cv_exeext
1467           break;;
1468     * ) break;;
1469   esac
1470 done
1471 else
1472   { { echo "$as_me:1472: error: cannot compute EXEEXT: cannot compile and link" >&5
1473 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1474    { (exit 1); exit 1; }; }
1475 fi
1476
1477 rm -f conftest$ac_cv_exeext
1478 echo "$as_me:1478: result: $ac_cv_exeext" >&5
1479 echo "${ECHO_T}$ac_cv_exeext" >&6
1480
1481 rm -f conftest.$ac_ext
1482 EXEEXT=$ac_cv_exeext
1483 ac_exeext=$EXEEXT
1484 echo "$as_me:1484: checking for object suffix" >&5
1485 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1486 if test "${ac_cv_objext+set}" = set; then
1487   echo $ECHO_N "(cached) $ECHO_C" >&6
1488 else
1489   cat >conftest.$ac_ext <<_ACEOF
1490 #line 1490 "configure"
1491 #include "confdefs.h"
1492
1493 int
1494 main (void)
1495 {
1496
1497   ;
1498   return 0;
1499 }
1500 _ACEOF
1501 rm -f conftest.o conftest.obj
1502 if { (eval echo "$as_me:1502: \"$ac_compile\"") >&5
1503   (eval $ac_compile) 2>&5
1504   ac_status=$?
1505   echo "$as_me:1505: \$? = $ac_status" >&5
1506   (exit $ac_status); }; then
1507   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1508   case $ac_file in
1509     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1510     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1511        break;;
1512   esac
1513 done
1514 else
1515   echo "$as_me: failed program was:" >&5
1516 cat conftest.$ac_ext >&5
1517 { { echo "$as_me:1517: error: cannot compute OBJEXT: cannot compile" >&5
1518 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1519    { (exit 1); exit 1; }; }
1520 fi
1521
1522 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1523 fi
1524 echo "$as_me:1524: result: $ac_cv_objext" >&5
1525 echo "${ECHO_T}$ac_cv_objext" >&6
1526 OBJEXT=$ac_cv_objext
1527 ac_objext=$OBJEXT
1528 echo "$as_me:1528: checking whether we are using the GNU C compiler" >&5
1529 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1530 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1531   echo $ECHO_N "(cached) $ECHO_C" >&6
1532 else
1533   cat >conftest.$ac_ext <<_ACEOF
1534 #line 1534 "configure"
1535 #include "confdefs.h"
1536
1537 int
1538 main (void)
1539 {
1540 #ifndef __GNUC__
1541        choke me
1542 #endif
1543
1544   ;
1545   return 0;
1546 }
1547 _ACEOF
1548 rm -f conftest.$ac_objext
1549 if { (eval echo "$as_me:1549: \"$ac_compile\"") >&5
1550   (eval $ac_compile) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); } &&
1554          { ac_try='test -s conftest.$ac_objext'
1555   { (eval echo "$as_me:1555: \"$ac_try\"") >&5
1556   (eval $ac_try) 2>&5
1557   ac_status=$?
1558   echo "$as_me:1558: \$? = $ac_status" >&5
1559   (exit $ac_status); }; }; then
1560   ac_compiler_gnu=yes
1561 else
1562   echo "$as_me: failed program was:" >&5
1563 cat conftest.$ac_ext >&5
1564 ac_compiler_gnu=no
1565 fi
1566 rm -f conftest.$ac_objext conftest.$ac_ext
1567 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1568
1569 fi
1570 echo "$as_me:1570: result: $ac_cv_c_compiler_gnu" >&5
1571 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1572 GCC=`test $ac_compiler_gnu = yes && echo yes`
1573 ac_test_CFLAGS=${CFLAGS+set}
1574 ac_save_CFLAGS=$CFLAGS
1575 CFLAGS="-g"
1576 echo "$as_me:1576: checking whether $CC accepts -g" >&5
1577 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1578 if test "${ac_cv_prog_cc_g+set}" = set; then
1579   echo $ECHO_N "(cached) $ECHO_C" >&6
1580 else
1581   cat >conftest.$ac_ext <<_ACEOF
1582 #line 1582 "configure"
1583 #include "confdefs.h"
1584
1585 int
1586 main (void)
1587 {
1588
1589   ;
1590   return 0;
1591 }
1592 _ACEOF
1593 rm -f conftest.$ac_objext
1594 if { (eval echo "$as_me:1594: \"$ac_compile\"") >&5
1595   (eval $ac_compile) 2>&5
1596   ac_status=$?
1597   echo "$as_me:1597: \$? = $ac_status" >&5
1598   (exit $ac_status); } &&
1599          { ac_try='test -s conftest.$ac_objext'
1600   { (eval echo "$as_me:1600: \"$ac_try\"") >&5
1601   (eval $ac_try) 2>&5
1602   ac_status=$?
1603   echo "$as_me:1603: \$? = $ac_status" >&5
1604   (exit $ac_status); }; }; then
1605   ac_cv_prog_cc_g=yes
1606 else
1607   echo "$as_me: failed program was:" >&5
1608 cat conftest.$ac_ext >&5
1609 ac_cv_prog_cc_g=no
1610 fi
1611 rm -f conftest.$ac_objext conftest.$ac_ext
1612 fi
1613 echo "$as_me:1613: result: $ac_cv_prog_cc_g" >&5
1614 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1615 if test "$ac_test_CFLAGS" = set; then
1616   CFLAGS=$ac_save_CFLAGS
1617 elif test $ac_cv_prog_cc_g = yes; then
1618   if test "$GCC" = yes; then
1619     CFLAGS="-g -O2"
1620   else
1621     CFLAGS="-g"
1622   fi
1623 else
1624   if test "$GCC" = yes; then
1625     CFLAGS="-O2"
1626   else
1627     CFLAGS=
1628   fi
1629 fi
1630 # Some people use a C++ compiler to compile C.  Since we use `exit',
1631 # in C++ we need to declare it.  In case someone uses the same compiler
1632 # for both compiling C and C++ we need to have the C++ compiler decide
1633 # the declaration of exit, since it's the most demanding environment.
1634 cat >conftest.$ac_ext <<_ACEOF
1635 #ifndef __cplusplus
1636   choke me
1637 #endif
1638 _ACEOF
1639 rm -f conftest.$ac_objext
1640 if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
1641   (eval $ac_compile) 2>&5
1642   ac_status=$?
1643   echo "$as_me:1643: \$? = $ac_status" >&5
1644   (exit $ac_status); } &&
1645          { ac_try='test -s conftest.$ac_objext'
1646   { (eval echo "$as_me:1646: \"$ac_try\"") >&5
1647   (eval $ac_try) 2>&5
1648   ac_status=$?
1649   echo "$as_me:1649: \$? = $ac_status" >&5
1650   (exit $ac_status); }; }; then
1651   for ac_declaration in \
1652    ''\
1653    '#include <stdlib.h>' \
1654    'extern "C" void std::exit (int) throw (); using std::exit;' \
1655    'extern "C" void std::exit (int); using std::exit;' \
1656    'extern "C" void exit (int) throw ();' \
1657    'extern "C" void exit (int);' \
1658    'void exit (int);'
1659 do
1660   cat >conftest.$ac_ext <<_ACEOF
1661 #line 1661 "configure"
1662 #include "confdefs.h"
1663 #include <stdlib.h>
1664 $ac_declaration
1665 int
1666 main (void)
1667 {
1668 exit (42);
1669   ;
1670   return 0;
1671 }
1672 _ACEOF
1673 rm -f conftest.$ac_objext
1674 if { (eval echo "$as_me:1674: \"$ac_compile\"") >&5
1675   (eval $ac_compile) 2>&5
1676   ac_status=$?
1677   echo "$as_me:1677: \$? = $ac_status" >&5
1678   (exit $ac_status); } &&
1679          { ac_try='test -s conftest.$ac_objext'
1680   { (eval echo "$as_me:1680: \"$ac_try\"") >&5
1681   (eval $ac_try) 2>&5
1682   ac_status=$?
1683   echo "$as_me:1683: \$? = $ac_status" >&5
1684   (exit $ac_status); }; }; then
1685   :
1686 else
1687   echo "$as_me: failed program was:" >&5
1688 cat conftest.$ac_ext >&5
1689 continue
1690 fi
1691 rm -f conftest.$ac_objext conftest.$ac_ext
1692   cat >conftest.$ac_ext <<_ACEOF
1693 #line 1693 "configure"
1694 #include "confdefs.h"
1695 $ac_declaration
1696 int
1697 main (void)
1698 {
1699 exit (42);
1700   ;
1701   return 0;
1702 }
1703 _ACEOF
1704 rm -f conftest.$ac_objext
1705 if { (eval echo "$as_me:1705: \"$ac_compile\"") >&5
1706   (eval $ac_compile) 2>&5
1707   ac_status=$?
1708   echo "$as_me:1708: \$? = $ac_status" >&5
1709   (exit $ac_status); } &&
1710          { ac_try='test -s conftest.$ac_objext'
1711   { (eval echo "$as_me:1711: \"$ac_try\"") >&5
1712   (eval $ac_try) 2>&5
1713   ac_status=$?
1714   echo "$as_me:1714: \$? = $ac_status" >&5
1715   (exit $ac_status); }; }; then
1716   break
1717 else
1718   echo "$as_me: failed program was:" >&5
1719 cat conftest.$ac_ext >&5
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 done
1723 rm -rf conftest*
1724 if test -n "$ac_declaration"; then
1725   echo '#ifdef __cplusplus' >>confdefs.h
1726   echo $ac_declaration      >>confdefs.h
1727   echo '#endif'             >>confdefs.h
1728 fi
1729
1730 else
1731   echo "$as_me: failed program was:" >&5
1732 cat conftest.$ac_ext >&5
1733 fi
1734 rm -f conftest.$ac_objext conftest.$ac_ext
1735 ac_ext=c
1736 ac_cpp='$CPP $CPPFLAGS'
1737 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1738 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1739 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1740 ac_main_return=return
1741
1742 GCC_VERSION=none
1743 if test "$GCC" = yes ; then
1744         echo "$as_me:1744: checking version of $CC" >&5
1745 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1746         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1747         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1748         echo "$as_me:1748: result: $GCC_VERSION" >&5
1749 echo "${ECHO_T}$GCC_VERSION" >&6
1750 fi
1751
1752 INTEL_COMPILER=no
1753
1754 if test "$GCC" = yes ; then
1755         case $host_os in
1756         (linux*|gnu*)
1757                 echo "$as_me:1757: checking if this is really Intel C compiler" >&5
1758 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1759                 cf_save_CFLAGS="$CFLAGS"
1760                 CFLAGS="$CFLAGS -no-gcc"
1761                 cat >conftest.$ac_ext <<_ACEOF
1762 #line 1762 "configure"
1763 #include "confdefs.h"
1764
1765 int
1766 main (void)
1767 {
1768
1769 #ifdef __INTEL_COMPILER
1770 #else
1771 make an error
1772 #endif
1773
1774   ;
1775   return 0;
1776 }
1777 _ACEOF
1778 rm -f conftest.$ac_objext
1779 if { (eval echo "$as_me:1779: \"$ac_compile\"") >&5
1780   (eval $ac_compile) 2>&5
1781   ac_status=$?
1782   echo "$as_me:1782: \$? = $ac_status" >&5
1783   (exit $ac_status); } &&
1784          { ac_try='test -s conftest.$ac_objext'
1785   { (eval echo "$as_me:1785: \"$ac_try\"") >&5
1786   (eval $ac_try) 2>&5
1787   ac_status=$?
1788   echo "$as_me:1788: \$? = $ac_status" >&5
1789   (exit $ac_status); }; }; then
1790   INTEL_COMPILER=yes
1791 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1792
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 fi
1797 rm -f conftest.$ac_objext conftest.$ac_ext
1798                 CFLAGS="$cf_save_CFLAGS"
1799                 echo "$as_me:1799: result: $INTEL_COMPILER" >&5
1800 echo "${ECHO_T}$INTEL_COMPILER" >&6
1801                 ;;
1802         esac
1803 fi
1804
1805 CLANG_COMPILER=no
1806
1807 if test "$GCC" = yes ; then
1808         echo "$as_me:1808: checking if this is really Clang C compiler" >&5
1809 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1810         cf_save_CFLAGS="$CFLAGS"
1811         cat >conftest.$ac_ext <<_ACEOF
1812 #line 1812 "configure"
1813 #include "confdefs.h"
1814
1815 int
1816 main (void)
1817 {
1818
1819 #ifdef __clang__
1820 #else
1821 make an error
1822 #endif
1823
1824   ;
1825   return 0;
1826 }
1827 _ACEOF
1828 rm -f conftest.$ac_objext
1829 if { (eval echo "$as_me:1829: \"$ac_compile\"") >&5
1830   (eval $ac_compile) 2>&5
1831   ac_status=$?
1832   echo "$as_me:1832: \$? = $ac_status" >&5
1833   (exit $ac_status); } &&
1834          { ac_try='test -s conftest.$ac_objext'
1835   { (eval echo "$as_me:1835: \"$ac_try\"") >&5
1836   (eval $ac_try) 2>&5
1837   ac_status=$?
1838   echo "$as_me:1838: \$? = $ac_status" >&5
1839   (exit $ac_status); }; }; then
1840   CLANG_COMPILER=yes
1841
1842 else
1843   echo "$as_me: failed program was:" >&5
1844 cat conftest.$ac_ext >&5
1845 fi
1846 rm -f conftest.$ac_objext conftest.$ac_ext
1847         CFLAGS="$cf_save_CFLAGS"
1848         echo "$as_me:1848: result: $CLANG_COMPILER" >&5
1849 echo "${ECHO_T}$CLANG_COMPILER" >&6
1850 fi
1851
1852 if test "x$CLANG_COMPILER" = "xyes" ; then
1853         for cf_clang_opt in \
1854                 -Qunused-arguments \
1855                 -Wno-error=implicit-function-declaration
1856         do
1857                 echo "$as_me:1857: checking if option $cf_clang_opt works" >&5
1858 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1859                 cat >conftest.$ac_ext <<_ACEOF
1860 #line 1860 "configure"
1861 #include "confdefs.h"
1862
1863                         #include <stdio.h>
1864 int
1865 main (void)
1866 {
1867
1868                         printf("hello!\n");
1869   ;
1870   return 0;
1871 }
1872 _ACEOF
1873 rm -f conftest.$ac_objext conftest$ac_exeext
1874 if { (eval echo "$as_me:1874: \"$ac_link\"") >&5
1875   (eval $ac_link) 2>&5
1876   ac_status=$?
1877   echo "$as_me:1877: \$? = $ac_status" >&5
1878   (exit $ac_status); } &&
1879          { ac_try='test -s conftest$ac_exeext'
1880   { (eval echo "$as_me:1880: \"$ac_try\"") >&5
1881   (eval $ac_try) 2>&5
1882   ac_status=$?
1883   echo "$as_me:1883: \$? = $ac_status" >&5
1884   (exit $ac_status); }; }; then
1885
1886                         cf_clang_optok=yes
1887 else
1888   echo "$as_me: failed program was:" >&5
1889 cat conftest.$ac_ext >&5
1890
1891                         cf_clang_optok=no
1892 fi
1893 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
1894                 echo "$as_me:1894: result: $cf_clang_optok" >&5
1895 echo "${ECHO_T}$cf_clang_optok" >&6
1896                 if test $cf_clang_optok = yes; then
1897                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
1898
1899 echo "${as_me:-configure}:1899: testing adding option $cf_clang_opt ..." 1>&5
1900
1901         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1902         CFLAGS="${CFLAGS}$cf_clang_opt"
1903
1904                 fi
1905         done
1906 fi
1907
1908 echo "$as_me:1908: checking for $CC option to accept ANSI C" >&5
1909 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1910 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1911   echo $ECHO_N "(cached) $ECHO_C" >&6
1912 else
1913   ac_cv_prog_cc_stdc=no
1914 ac_save_CC=$CC
1915 cat >conftest.$ac_ext <<_ACEOF
1916 #line 1916 "configure"
1917 #include "confdefs.h"
1918 #include <stdarg.h>
1919 #include <stdio.h>
1920 #include <sys/types.h>
1921 #include <sys/stat.h>
1922 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1923 struct buf { int x; };
1924 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1925 static char *e (p, i)
1926      char **p;
1927      int i;
1928 {
1929   return p[i];
1930 }
1931 static char *f (char * (*g) (char **, int), char **p, ...)
1932 {
1933   char *s;
1934   va_list v;
1935   va_start (v,p);
1936   s = g (p, va_arg (v,int));
1937   va_end (v);
1938   return s;
1939 }
1940 int test (int i, double x);
1941 struct s1 {int (*f) (int a);};
1942 struct s2 {int (*f) (double a);};
1943 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1944 int argc;
1945 char **argv;
1946 int
1947 main (void)
1948 {
1949 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1950   ;
1951   return 0;
1952 }
1953 _ACEOF
1954 # Don't try gcc -ansi; that turns off useful extensions and
1955 # breaks some systems' header files.
1956 # AIX                   -qlanglvl=ansi
1957 # Ultrix and OSF/1      -std1
1958 # HP-UX 10.20 and later -Ae
1959 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1960 # SVR4                  -Xc -D__EXTENSIONS__
1961 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1962 do
1963   CC="$ac_save_CC $ac_arg"
1964   rm -f conftest.$ac_objext
1965 if { (eval echo "$as_me:1965: \"$ac_compile\"") >&5
1966   (eval $ac_compile) 2>&5
1967   ac_status=$?
1968   echo "$as_me:1968: \$? = $ac_status" >&5
1969   (exit $ac_status); } &&
1970          { ac_try='test -s conftest.$ac_objext'
1971   { (eval echo "$as_me:1971: \"$ac_try\"") >&5
1972   (eval $ac_try) 2>&5
1973   ac_status=$?
1974   echo "$as_me:1974: \$? = $ac_status" >&5
1975   (exit $ac_status); }; }; then
1976   ac_cv_prog_cc_stdc=$ac_arg
1977 break
1978 else
1979   echo "$as_me: failed program was:" >&5
1980 cat conftest.$ac_ext >&5
1981 fi
1982 rm -f conftest.$ac_objext
1983 done
1984 rm -f conftest.$ac_ext conftest.$ac_objext
1985 CC=$ac_save_CC
1986
1987 fi
1988
1989 case "x$ac_cv_prog_cc_stdc" in
1990   x|xno)
1991     echo "$as_me:1991: result: none needed" >&5
1992 echo "${ECHO_T}none needed" >&6 ;;
1993   *)
1994     echo "$as_me:1994: result: $ac_cv_prog_cc_stdc" >&5
1995 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1996     CC="$CC $ac_cv_prog_cc_stdc" ;;
1997 esac
1998
1999 # This should have been defined by AC_PROG_CC
2000 : ${CC:=cc}
2001
2002 echo "$as_me:2002: checking \$CFLAGS variable" >&5
2003 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2004 case "x$CFLAGS" in
2005 (*-[IUD]*)
2006         echo "$as_me:2006: result: broken" >&5
2007 echo "${ECHO_T}broken" >&6
2008         { echo "$as_me:2008: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2009 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2010         cf_flags="$CFLAGS"
2011         CFLAGS=
2012         for cf_arg in $cf_flags
2013         do
2014
2015 cf_fix_cppflags=no
2016 cf_new_cflags=
2017 cf_new_cppflags=
2018 cf_new_extra_cppflags=
2019
2020 for cf_add_cflags in $cf_arg
2021 do
2022 case $cf_fix_cppflags in
2023 (no)
2024         case $cf_add_cflags in
2025         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2026                 case $cf_add_cflags in
2027                 (-D*)
2028                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2029
2030                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2031                                 && test -z "${cf_tst_cflags}" \
2032                                 && cf_fix_cppflags=yes
2033
2034                         if test $cf_fix_cppflags = yes ; then
2035
2036         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2037         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2038
2039                                 continue
2040                         elif test "${cf_tst_cflags}" = "\"'" ; then
2041
2042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2044
2045                                 continue
2046                         fi
2047                         ;;
2048                 esac
2049                 case "$CPPFLAGS" in
2050                 (*$cf_add_cflags)
2051                         ;;
2052                 (*)
2053                         case $cf_add_cflags in
2054                         (-D*)
2055                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2056
2057 CPPFLAGS=`echo "$CPPFLAGS" | \
2058         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2059                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2060
2061                                 ;;
2062                         esac
2063
2064         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2065         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2066
2067                         ;;
2068                 esac
2069                 ;;
2070         (*)
2071
2072         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2073         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2074
2075                 ;;
2076         esac
2077         ;;
2078 (yes)
2079
2080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2082
2083         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2084
2085         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2086                 && test -z "${cf_tst_cflags}" \
2087                 && cf_fix_cppflags=no
2088         ;;
2089 esac
2090 done
2091
2092 if test -n "$cf_new_cflags" ; then
2093
2094         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2095         CFLAGS="${CFLAGS}$cf_new_cflags"
2096
2097 fi
2098
2099 if test -n "$cf_new_cppflags" ; then
2100
2101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2102         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2103
2104 fi
2105
2106 if test -n "$cf_new_extra_cppflags" ; then
2107
2108         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2109         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2110
2111 fi
2112
2113         done
2114         ;;
2115 (*)
2116         echo "$as_me:2116: result: ok" >&5
2117 echo "${ECHO_T}ok" >&6
2118         ;;
2119 esac
2120
2121 echo "$as_me:2121: checking \$CC variable" >&5
2122 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2123 case "$CC" in
2124 (*[\ \  ]-*)
2125         echo "$as_me:2125: result: broken" >&5
2126 echo "${ECHO_T}broken" >&6
2127         { echo "$as_me:2127: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2128 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2129         # humor him...
2130         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2131         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2132         CC="$cf_prog"
2133         for cf_arg in $cf_flags
2134         do
2135                 case "x$cf_arg" in
2136                 (x-[IUDfgOW]*)
2137
2138 cf_fix_cppflags=no
2139 cf_new_cflags=
2140 cf_new_cppflags=
2141 cf_new_extra_cppflags=
2142
2143 for cf_add_cflags in $cf_arg
2144 do
2145 case $cf_fix_cppflags in
2146 (no)
2147         case $cf_add_cflags in
2148         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2149                 case $cf_add_cflags in
2150                 (-D*)
2151                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2152
2153                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2154                                 && test -z "${cf_tst_cflags}" \
2155                                 && cf_fix_cppflags=yes
2156
2157                         if test $cf_fix_cppflags = yes ; then
2158
2159         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2160         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2161
2162                                 continue
2163                         elif test "${cf_tst_cflags}" = "\"'" ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         fi
2170                         ;;
2171                 esac
2172                 case "$CPPFLAGS" in
2173                 (*$cf_add_cflags)
2174                         ;;
2175                 (*)
2176                         case $cf_add_cflags in
2177                         (-D*)
2178                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2179
2180 CPPFLAGS=`echo "$CPPFLAGS" | \
2181         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2182                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2183
2184                                 ;;
2185                         esac
2186
2187         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2188         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2189
2190                         ;;
2191                 esac
2192                 ;;
2193         (*)
2194
2195         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2196         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2197
2198                 ;;
2199         esac
2200         ;;
2201 (yes)
2202
2203         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2204         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2205
2206         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2207
2208         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2209                 && test -z "${cf_tst_cflags}" \
2210                 && cf_fix_cppflags=no
2211         ;;
2212 esac
2213 done
2214
2215 if test -n "$cf_new_cflags" ; then
2216
2217         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2218         CFLAGS="${CFLAGS}$cf_new_cflags"
2219
2220 fi
2221
2222 if test -n "$cf_new_cppflags" ; then
2223
2224         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2225         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2226
2227 fi
2228
2229 if test -n "$cf_new_extra_cppflags" ; then
2230
2231         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2232         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2233
2234 fi
2235
2236                         ;;
2237                 (*)
2238                         CC="$CC $cf_arg"
2239                         ;;
2240                 esac
2241         done
2242         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2243
2244 echo "${as_me:-configure}:2244: testing resulting CC: '$CC' ..." 1>&5
2245
2246         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2247
2248 echo "${as_me:-configure}:2248: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2249
2250         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2251
2252 echo "${as_me:-configure}:2252: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2253
2254         ;;
2255 (*)
2256         echo "$as_me:2256: result: ok" >&5
2257 echo "${ECHO_T}ok" >&6
2258         ;;
2259 esac
2260
2261 ac_ext=c
2262 ac_cpp='$CPP $CPPFLAGS'
2263 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2264 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2265 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2266 ac_main_return=return
2267 echo "$as_me:2267: checking how to run the C preprocessor" >&5
2268 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2269 # On Suns, sometimes $CPP names a directory.
2270 if test -n "$CPP" && test -d "$CPP"; then
2271   CPP=
2272 fi
2273 if test -z "$CPP"; then
2274   if test "${ac_cv_prog_CPP+set}" = set; then
2275   echo $ECHO_N "(cached) $ECHO_C" >&6
2276 else
2277       # Double quotes because CPP needs to be expanded
2278     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2279     do
2280       ac_preproc_ok=false
2281 for ac_c_preproc_warn_flag in '' yes
2282 do
2283   # Use a header file that comes with gcc, so configuring glibc
2284   # with a fresh cross-compiler works.
2285   # On the NeXT, cc -E runs the code through the compiler's parser,
2286   # not just through cpp. "Syntax error" is here to catch this case.
2287   cat >conftest.$ac_ext <<_ACEOF
2288 #line 2288 "configure"
2289 #include "confdefs.h"
2290 #include <assert.h>
2291                      Syntax error
2292 _ACEOF
2293 if { (eval echo "$as_me:2293: \"$ac_cpp conftest.$ac_ext\"") >&5
2294   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2295   ac_status=$?
2296   egrep -v '^ *\+' conftest.er1 >conftest.err
2297   rm -f conftest.er1
2298   cat conftest.err >&5
2299   echo "$as_me:2299: \$? = $ac_status" >&5
2300   (exit $ac_status); } >/dev/null; then
2301   if test -s conftest.err; then
2302     ac_cpp_err=$ac_c_preproc_warn_flag
2303   else
2304     ac_cpp_err=
2305   fi
2306 else
2307   ac_cpp_err=yes
2308 fi
2309 if test -z "$ac_cpp_err"; then
2310   :
2311 else
2312   echo "$as_me: failed program was:" >&5
2313   cat conftest.$ac_ext >&5
2314   # Broken: fails on valid input.
2315 continue
2316 fi
2317 rm -f conftest.err conftest.$ac_ext
2318
2319   # OK, works on sane cases.  Now check whether non-existent headers
2320   # can be detected and how.
2321   cat >conftest.$ac_ext <<_ACEOF
2322 #line 2322 "configure"
2323 #include "confdefs.h"
2324 #include <ac_nonexistent.h>
2325 _ACEOF
2326 if { (eval echo "$as_me:2326: \"$ac_cpp conftest.$ac_ext\"") >&5
2327   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2328   ac_status=$?
2329   egrep -v '^ *\+' conftest.er1 >conftest.err
2330   rm -f conftest.er1
2331   cat conftest.err >&5
2332   echo "$as_me:2332: \$? = $ac_status" >&5
2333   (exit $ac_status); } >/dev/null; then
2334   if test -s conftest.err; then
2335     ac_cpp_err=$ac_c_preproc_warn_flag
2336   else
2337     ac_cpp_err=
2338   fi
2339 else
2340   ac_cpp_err=yes
2341 fi
2342 if test -z "$ac_cpp_err"; then
2343   # Broken: success on invalid input.
2344 continue
2345 else
2346   echo "$as_me: failed program was:" >&5
2347   cat conftest.$ac_ext >&5
2348   # Passes both tests.
2349 ac_preproc_ok=:
2350 break
2351 fi
2352 rm -f conftest.err conftest.$ac_ext
2353
2354 done
2355 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2356 rm -f conftest.err conftest.$ac_ext
2357 if $ac_preproc_ok; then
2358   break
2359 fi
2360
2361     done
2362     ac_cv_prog_CPP=$CPP
2363
2364 fi
2365   CPP=$ac_cv_prog_CPP
2366 else
2367   ac_cv_prog_CPP=$CPP
2368 fi
2369 echo "$as_me:2369: result: $CPP" >&5
2370 echo "${ECHO_T}$CPP" >&6
2371 ac_preproc_ok=false
2372 for ac_c_preproc_warn_flag in '' yes
2373 do
2374   # Use a header file that comes with gcc, so configuring glibc
2375   # with a fresh cross-compiler works.
2376   # On the NeXT, cc -E runs the code through the compiler's parser,
2377   # not just through cpp. "Syntax error" is here to catch this case.
2378   cat >conftest.$ac_ext <<_ACEOF
2379 #line 2379 "configure"
2380 #include "confdefs.h"
2381 #include <assert.h>
2382                      Syntax error
2383 _ACEOF
2384 if { (eval echo "$as_me:2384: \"$ac_cpp conftest.$ac_ext\"") >&5
2385   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2386   ac_status=$?
2387   egrep -v '^ *\+' conftest.er1 >conftest.err
2388   rm -f conftest.er1
2389   cat conftest.err >&5
2390   echo "$as_me:2390: \$? = $ac_status" >&5
2391   (exit $ac_status); } >/dev/null; then
2392   if test -s conftest.err; then
2393     ac_cpp_err=$ac_c_preproc_warn_flag
2394   else
2395     ac_cpp_err=
2396   fi
2397 else
2398   ac_cpp_err=yes
2399 fi
2400 if test -z "$ac_cpp_err"; then
2401   :
2402 else
2403   echo "$as_me: failed program was:" >&5
2404   cat conftest.$ac_ext >&5
2405   # Broken: fails on valid input.
2406 continue
2407 fi
2408 rm -f conftest.err conftest.$ac_ext
2409
2410   # OK, works on sane cases.  Now check whether non-existent headers
2411   # can be detected and how.
2412   cat >conftest.$ac_ext <<_ACEOF
2413 #line 2413 "configure"
2414 #include "confdefs.h"
2415 #include <ac_nonexistent.h>
2416 _ACEOF
2417 if { (eval echo "$as_me:2417: \"$ac_cpp conftest.$ac_ext\"") >&5
2418   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2419   ac_status=$?
2420   egrep -v '^ *\+' conftest.er1 >conftest.err
2421   rm -f conftest.er1
2422   cat conftest.err >&5
2423   echo "$as_me:2423: \$? = $ac_status" >&5
2424   (exit $ac_status); } >/dev/null; then
2425   if test -s conftest.err; then
2426     ac_cpp_err=$ac_c_preproc_warn_flag
2427   else
2428     ac_cpp_err=
2429   fi
2430 else
2431   ac_cpp_err=yes
2432 fi
2433 if test -z "$ac_cpp_err"; then
2434   # Broken: success on invalid input.
2435 continue
2436 else
2437   echo "$as_me: failed program was:" >&5
2438   cat conftest.$ac_ext >&5
2439   # Passes both tests.
2440 ac_preproc_ok=:
2441 break
2442 fi
2443 rm -f conftest.err conftest.$ac_ext
2444
2445 done
2446 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2447 rm -f conftest.err conftest.$ac_ext
2448 if $ac_preproc_ok; then
2449   :
2450 else
2451   { { echo "$as_me:2451: error: C preprocessor \"$CPP\" fails sanity check" >&5
2452 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2453    { (exit 1); exit 1; }; }
2454 fi
2455
2456 ac_ext=c
2457 ac_cpp='$CPP $CPPFLAGS'
2458 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2459 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2460 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2461 ac_main_return=return
2462
2463 if test $ac_cv_c_compiler_gnu = yes; then
2464     echo "$as_me:2464: checking whether $CC needs -traditional" >&5
2465 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2466 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2467   echo $ECHO_N "(cached) $ECHO_C" >&6
2468 else
2469     ac_pattern="Autoconf.*'x'"
2470   cat >conftest.$ac_ext <<_ACEOF
2471 #line 2471 "configure"
2472 #include "confdefs.h"
2473 #include <sgtty.h>
2474 int Autoconf = TIOCGETP;
2475 _ACEOF
2476 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2477   egrep "$ac_pattern" >/dev/null 2>&1; then
2478   ac_cv_prog_gcc_traditional=yes
2479 else
2480   ac_cv_prog_gcc_traditional=no
2481 fi
2482 rm -rf conftest*
2483
2484   if test $ac_cv_prog_gcc_traditional = no; then
2485     cat >conftest.$ac_ext <<_ACEOF
2486 #line 2486 "configure"
2487 #include "confdefs.h"
2488 #include <termio.h>
2489 int Autoconf = TCGETA;
2490 _ACEOF
2491 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2492   egrep "$ac_pattern" >/dev/null 2>&1; then
2493   ac_cv_prog_gcc_traditional=yes
2494 fi
2495 rm -rf conftest*
2496
2497   fi
2498 fi
2499 echo "$as_me:2499: result: $ac_cv_prog_gcc_traditional" >&5
2500 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2501   if test $ac_cv_prog_gcc_traditional = yes; then
2502     CC="$CC -traditional"
2503   fi
2504 fi
2505
2506 echo "$as_me:2506: checking whether $CC understands -c and -o together" >&5
2507 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2508 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511
2512 cat > conftest.$ac_ext <<CF_EOF
2513 int main(void)
2514 {
2515         ${cf_cv_main_return:-return}(0);
2516 }
2517 CF_EOF
2518 # We do the test twice because some compilers refuse to overwrite an
2519 # existing .o file with -o, though they will create one.
2520 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2521 if { (eval echo "$as_me:2521: \"$ac_try\"") >&5
2522   (eval $ac_try) 2>&5
2523   ac_status=$?
2524   echo "$as_me:2524: \$? = $ac_status" >&5
2525   (exit $ac_status); } &&
2526   test -f conftest2.$ac_objext && { (eval echo "$as_me:2526: \"$ac_try\"") >&5
2527   (eval $ac_try) 2>&5
2528   ac_status=$?
2529   echo "$as_me:2529: \$? = $ac_status" >&5
2530   (exit $ac_status); };
2531 then
2532   eval cf_cv_prog_CC_c_o=yes
2533 else
2534   eval cf_cv_prog_CC_c_o=no
2535 fi
2536 rm -rf conftest*
2537
2538 fi
2539 if test $cf_cv_prog_CC_c_o = yes; then
2540   echo "$as_me:2540: result: yes" >&5
2541 echo "${ECHO_T}yes" >&6
2542 else
2543   echo "$as_me:2543: result: no" >&5
2544 echo "${ECHO_T}no" >&6
2545 fi
2546
2547 test "$program_prefix" != NONE &&
2548   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2549 # Use a double $ so make ignores it.
2550 test "$program_suffix" != NONE &&
2551   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2552 # Double any \ or $.  echo might interpret backslashes.
2553 # By default was `s,x,x', remove it if useless.
2554 cat <<\_ACEOF >conftest.sed
2555 s/[\\$]/&&/g;s/;s,x,x,$//
2556 _ACEOF
2557 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2558 rm conftest.sed
2559
2560 for ac_prog in mawk gawk nawk awk
2561 do
2562   # Extract the first word of "$ac_prog", so it can be a program name with args.
2563 set dummy $ac_prog; ac_word=$2
2564 echo "$as_me:2564: checking for $ac_word" >&5
2565 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2566 if test "${ac_cv_prog_AWK+set}" = set; then
2567   echo $ECHO_N "(cached) $ECHO_C" >&6
2568 else
2569   if test -n "$AWK"; then
2570   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2571 else
2572   ac_save_IFS=$IFS; IFS=$ac_path_separator
2573 ac_dummy="$PATH"
2574 for ac_dir in $ac_dummy; do
2575   IFS=$ac_save_IFS
2576   test -z "$ac_dir" && ac_dir=.
2577   $as_executable_p "$ac_dir/$ac_word" || continue
2578 ac_cv_prog_AWK="$ac_prog"
2579 echo "$as_me:2579: found $ac_dir/$ac_word" >&5
2580 break
2581 done
2582
2583 fi
2584 fi
2585 AWK=$ac_cv_prog_AWK
2586 if test -n "$AWK"; then
2587   echo "$as_me:2587: result: $AWK" >&5
2588 echo "${ECHO_T}$AWK" >&6
2589 else
2590   echo "$as_me:2590: result: no" >&5
2591 echo "${ECHO_T}no" >&6
2592 fi
2593
2594   test -n "$AWK" && break
2595 done
2596
2597 test -z "$AWK" && { { echo "$as_me:2597: error: No awk program found" >&5
2598 echo "$as_me: error: No awk program found" >&2;}
2599    { (exit 1); exit 1; }; }
2600
2601 echo "$as_me:2601: checking for egrep" >&5
2602 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2603 if test "${ac_cv_prog_egrep+set}" = set; then
2604   echo $ECHO_N "(cached) $ECHO_C" >&6
2605 else
2606   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2607                 then ac_cv_prog_egrep='grep -E'
2608                 else ac_cv_prog_egrep='egrep'
2609         fi
2610 fi
2611 echo "$as_me:2611: result: $ac_cv_prog_egrep" >&5
2612 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2613         EGREP=$ac_cv_prog_egrep
2614
2615         test -z "$EGREP" && { { echo "$as_me:2615: error: No egrep program found" >&5
2616 echo "$as_me: error: No egrep program found" >&2;}
2617    { (exit 1); exit 1; }; }
2618
2619 # Find a good install program.  We prefer a C program (faster),
2620 # so one script is as good as another.  But avoid the broken or
2621 # incompatible versions:
2622 # SysV /etc/install, /usr/sbin/install
2623 # SunOS /usr/etc/install
2624 # IRIX /sbin/install
2625 # AIX /bin/install
2626 # AmigaOS /C/install, which installs bootblocks on floppy discs
2627 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2628 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2629 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2630 # ./install, which can be erroneously created by make from ./install.sh.
2631 echo "$as_me:2631: checking for a BSD compatible install" >&5
2632 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2633 if test -z "$INSTALL"; then
2634 if test "${ac_cv_path_install+set}" = set; then
2635   echo $ECHO_N "(cached) $ECHO_C" >&6
2636 else
2637     ac_save_IFS=$IFS; IFS=$ac_path_separator
2638   for ac_dir in $PATH; do
2639     IFS=$ac_save_IFS
2640     # Account for people who put trailing slashes in PATH elements.
2641     case $ac_dir/ in
2642     / | ./ | .// | /cC/* \
2643     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2644     | /usr/ucb/* ) ;;
2645     *)
2646       # OSF1 and SCO ODT 3.0 have their own names for install.
2647       # Don't use installbsd from OSF since it installs stuff as root
2648       # by default.
2649       for ac_prog in ginstall scoinst install; do
2650         if $as_executable_p "$ac_dir/$ac_prog"; then
2651           if test $ac_prog = install &&
2652             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2653             # AIX install.  It has an incompatible calling convention.
2654             :
2655           elif test $ac_prog = install &&
2656             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2657             # program-specific install script used by HP pwplus--don't use.
2658             :
2659           else
2660             ac_cv_path_install="$ac_dir/$ac_prog -c"
2661             break 2
2662           fi
2663         fi
2664       done
2665       ;;
2666     esac
2667   done
2668
2669 fi
2670   if test "${ac_cv_path_install+set}" = set; then
2671     INSTALL=$ac_cv_path_install
2672   else
2673     # As a last resort, use the slow shell script.  We don't cache a
2674     # path for INSTALL within a source directory, because that will
2675     # break other packages using the cache if that directory is
2676     # removed, or if the path is relative.
2677     INSTALL=$ac_install_sh
2678   fi
2679 fi
2680 echo "$as_me:2680: result: $INSTALL" >&5
2681 echo "${ECHO_T}$INSTALL" >&6
2682
2683 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2684 # It thinks the first close brace ends the variable substitution.
2685 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2686
2687 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2688
2689 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2690
2691 echo "$as_me:2691: checking whether ln -s works" >&5
2692 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2693 LN_S=$as_ln_s
2694 if test "$LN_S" = "ln -s"; then
2695   echo "$as_me:2695: result: yes" >&5
2696 echo "${ECHO_T}yes" >&6
2697 else
2698   echo "$as_me:2698: result: no, using $LN_S" >&5
2699 echo "${ECHO_T}no, using $LN_S" >&6
2700 fi
2701
2702 echo "$as_me:2702: checking if $LN_S -f options work" >&5
2703 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2704
2705 rm -f conf$$.src conf$$dst
2706 echo >conf$$.dst
2707 echo first >conf$$.src
2708 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2709         cf_prog_ln_sf=yes
2710 else
2711         cf_prog_ln_sf=no
2712 fi
2713 rm -f conf$$.dst conf$$src
2714 echo "$as_me:2714: result: $cf_prog_ln_sf" >&5
2715 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2716
2717 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2718
2719 # Find a good install program.  We prefer a C program (faster),
2720 # so one script is as good as another.  But avoid the broken or
2721 # incompatible versions:
2722 # SysV /etc/install, /usr/sbin/install
2723 # SunOS /usr/etc/install
2724 # IRIX /sbin/install
2725 # AIX /bin/install
2726 # AmigaOS /C/install, which installs bootblocks on floppy discs
2727 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2728 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2729 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2730 # ./install, which can be erroneously created by make from ./install.sh.
2731 echo "$as_me:2731: checking for a BSD compatible install" >&5
2732 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2733 if test -z "$INSTALL"; then
2734 if test "${ac_cv_path_install+set}" = set; then
2735   echo $ECHO_N "(cached) $ECHO_C" >&6
2736 else
2737     ac_save_IFS=$IFS; IFS=$ac_path_separator
2738   for ac_dir in $PATH; do
2739     IFS=$ac_save_IFS
2740     # Account for people who put trailing slashes in PATH elements.
2741     case $ac_dir/ in
2742     / | ./ | .// | /cC/* \
2743     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2744     | /usr/ucb/* ) ;;
2745     *)
2746       # OSF1 and SCO ODT 3.0 have their own names for install.
2747       # Don't use installbsd from OSF since it installs stuff as root
2748       # by default.
2749       for ac_prog in ginstall scoinst install; do
2750         if $as_executable_p "$ac_dir/$ac_prog"; then
2751           if test $ac_prog = install &&
2752             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2753             # AIX install.  It has an incompatible calling convention.
2754             :
2755           elif test $ac_prog = install &&
2756             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2757             # program-specific install script used by HP pwplus--don't use.
2758             :
2759           else
2760             ac_cv_path_install="$ac_dir/$ac_prog -c"
2761             break 2
2762           fi
2763         fi
2764       done
2765       ;;
2766     esac
2767   done
2768
2769 fi
2770   if test "${ac_cv_path_install+set}" = set; then
2771     INSTALL=$ac_cv_path_install
2772   else
2773     # As a last resort, use the slow shell script.  We don't cache a
2774     # path for INSTALL within a source directory, because that will
2775     # break other packages using the cache if that directory is
2776     # removed, or if the path is relative.
2777     INSTALL=$ac_install_sh
2778   fi
2779 fi
2780 echo "$as_me:2780: result: $INSTALL" >&5
2781 echo "${ECHO_T}$INSTALL" >&6
2782
2783 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2784 # It thinks the first close brace ends the variable substitution.
2785 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2786
2787 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2788
2789 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2790
2791 case $INSTALL in
2792 (/*)
2793         ;;
2794 (*)
2795         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2796         test -z "$cf_dir" && cf_dir=.
2797         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2798         ;;
2799 esac
2800
2801 echo "$as_me:2801: checking if you want to install stripped executables" >&5
2802 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2803
2804 # Check whether --enable-stripping or --disable-stripping was given.
2805 if test "${enable_stripping+set}" = set; then
2806   enableval="$enable_stripping"
2807   test "$enableval" != no && enableval=yes
2808         if test "$enableval" != "yes" ; then
2809     with_stripping=no
2810         else
2811                 with_stripping=yes
2812         fi
2813 else
2814   enableval=yes
2815         with_stripping=yes
2816
2817 fi;
2818 echo "$as_me:2818: result: $with_stripping" >&5
2819 echo "${ECHO_T}$with_stripping" >&6
2820
2821 if test "$with_stripping" = yes
2822 then
2823         INSTALL_OPT_S="-s"
2824 else
2825         INSTALL_OPT_S=
2826 fi
2827
2828 : ${INSTALL:=install}
2829 echo "$as_me:2829: checking if install accepts -p option" >&5
2830 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2831 if test "${cf_cv_install_p+set}" = set; then
2832   echo $ECHO_N "(cached) $ECHO_C" >&6
2833 else
2834
2835         rm -rf conftest*
2836         date >conftest.in
2837         mkdir conftest.out
2838         sleep 3
2839         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2840         then
2841                 if test -f conftest.out/conftest.in
2842                 then
2843                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2844                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2845                         if test -s conftest.err
2846                         then
2847                                 cf_cv_install_p=no
2848                         else
2849                                 cf_cv_install_p=yes
2850                         fi
2851                 else
2852                         cf_cv_install_p=no
2853                 fi
2854         else
2855                 cf_cv_install_p=no
2856         fi
2857         rm -rf conftest*
2858
2859 fi
2860 echo "$as_me:2860: result: $cf_cv_install_p" >&5
2861 echo "${ECHO_T}$cf_cv_install_p" >&6
2862
2863 echo "$as_me:2863: checking if install needs to be told about ownership" >&5
2864 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2865 case `$ac_config_guess` in
2866 (*minix)
2867         with_install_o=yes
2868         ;;
2869 (*)
2870         with_install_o=no
2871         ;;
2872 esac
2873
2874 echo "$as_me:2874: result: $with_install_o" >&5
2875 echo "${ECHO_T}$with_install_o" >&6
2876 if test "x$with_install_o" = xyes
2877 then
2878         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2879 else
2880         INSTALL_OPT_O=
2881 fi
2882
2883 echo "$as_me:2883: checking for long file names" >&5
2884 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2885 if test "${ac_cv_sys_long_file_names+set}" = set; then
2886   echo $ECHO_N "(cached) $ECHO_C" >&6
2887 else
2888   ac_cv_sys_long_file_names=yes
2889 # Test for long file names in all the places we know might matter:
2890 #      .                the current directory, where building will happen
2891 #      $prefix/lib      where we will be installing things
2892 #      $exec_prefix/lib likewise
2893 # eval it to expand exec_prefix.
2894 #      $TMPDIR          if set, where it might want to write temporary files
2895 # if $TMPDIR is not set:
2896 #      /tmp             where it might want to write temporary files
2897 #      /var/tmp         likewise
2898 #      /usr/tmp         likewise
2899 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2900   ac_tmpdirs=$TMPDIR
2901 else
2902   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2903 fi
2904 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2905   test -d $ac_dir || continue
2906   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2907   ac_xdir=$ac_dir/cf$$
2908   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2909   ac_tf1=$ac_xdir/conftest9012345
2910   ac_tf2=$ac_xdir/conftest9012346
2911   (echo 1 >$ac_tf1) 2>/dev/null
2912   (echo 2 >$ac_tf2) 2>/dev/null
2913   ac_val=`cat $ac_tf1 2>/dev/null`
2914   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2915     ac_cv_sys_long_file_names=no
2916     rm -rf $ac_xdir 2>/dev/null
2917     break
2918   fi
2919   rm -rf $ac_xdir 2>/dev/null
2920 done
2921 fi
2922 echo "$as_me:2922: result: $ac_cv_sys_long_file_names" >&5
2923 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2924 if test $ac_cv_sys_long_file_names = yes; then
2925
2926 cat >>confdefs.h <<\EOF
2927 #define HAVE_LONG_FILE_NAMES 1
2928 EOF
2929
2930 fi
2931
2932 # if we find pkg-config, check if we should install the ".pc" files.
2933
2934 echo "$as_me:2934: checking if you want to use pkg-config" >&5
2935 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2936
2937 # Check whether --with-pkg-config or --without-pkg-config was given.
2938 if test "${with_pkg_config+set}" = set; then
2939   withval="$with_pkg_config"
2940   cf_pkg_config=$withval
2941 else
2942   cf_pkg_config=yes
2943 fi;
2944 echo "$as_me:2944: result: $cf_pkg_config" >&5
2945 echo "${ECHO_T}$cf_pkg_config" >&6
2946
2947 case $cf_pkg_config in
2948 (no)
2949         PKG_CONFIG=none
2950         ;;
2951 (yes)
2952
2953 if test -n "$ac_tool_prefix"; then
2954   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2955 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2956 echo "$as_me:2956: checking for $ac_word" >&5
2957 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2958 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2959   echo $ECHO_N "(cached) $ECHO_C" >&6
2960 else
2961   case $PKG_CONFIG in
2962   [\\/]* | ?:[\\/]*)
2963   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2964   ;;
2965   *)
2966   ac_save_IFS=$IFS; IFS=$ac_path_separator
2967 ac_dummy="$PATH"
2968 for ac_dir in $ac_dummy; do
2969   IFS=$ac_save_IFS
2970   test -z "$ac_dir" && ac_dir=.
2971   if $as_executable_p "$ac_dir/$ac_word"; then
2972    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2973    echo "$as_me:2973: found $ac_dir/$ac_word" >&5
2974    break
2975 fi
2976 done
2977
2978   ;;
2979 esac
2980 fi
2981 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2982
2983 if test -n "$PKG_CONFIG"; then
2984   echo "$as_me:2984: result: $PKG_CONFIG" >&5
2985 echo "${ECHO_T}$PKG_CONFIG" >&6
2986 else
2987   echo "$as_me:2987: result: no" >&5
2988 echo "${ECHO_T}no" >&6
2989 fi
2990
2991 fi
2992 if test -z "$ac_cv_path_PKG_CONFIG"; then
2993   ac_pt_PKG_CONFIG=$PKG_CONFIG
2994   # Extract the first word of "pkg-config", so it can be a program name with args.
2995 set dummy pkg-config; ac_word=$2
2996 echo "$as_me:2996: checking for $ac_word" >&5
2997 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2998 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2999   echo $ECHO_N "(cached) $ECHO_C" >&6
3000 else
3001   case $ac_pt_PKG_CONFIG in
3002   [\\/]* | ?:[\\/]*)
3003   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3004   ;;
3005   *)
3006   ac_save_IFS=$IFS; IFS=$ac_path_separator
3007 ac_dummy="$PATH"
3008 for ac_dir in $ac_dummy; do
3009   IFS=$ac_save_IFS
3010   test -z "$ac_dir" && ac_dir=.
3011   if $as_executable_p "$ac_dir/$ac_word"; then
3012    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3013    echo "$as_me:3013: found $ac_dir/$ac_word" >&5
3014    break
3015 fi
3016 done
3017
3018   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3019   ;;
3020 esac
3021 fi
3022 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3023
3024 if test -n "$ac_pt_PKG_CONFIG"; then
3025   echo "$as_me:3025: result: $ac_pt_PKG_CONFIG" >&5
3026 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3027 else
3028   echo "$as_me:3028: result: no" >&5
3029 echo "${ECHO_T}no" >&6
3030 fi
3031
3032   PKG_CONFIG=$ac_pt_PKG_CONFIG
3033 else
3034   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3035 fi
3036
3037         ;;
3038 (*)
3039         PKG_CONFIG=$withval
3040         ;;
3041 esac
3042
3043 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3044 if test "$PKG_CONFIG" != none ; then
3045
3046 if test "x$prefix" != xNONE; then
3047         cf_path_syntax="$prefix"
3048 else
3049         cf_path_syntax="$ac_default_prefix"
3050 fi
3051
3052 case ".$PKG_CONFIG" in
3053 (.\$\(*\)*|.\'*\'*)
3054         ;;
3055 (..|./*|.\\*)
3056         ;;
3057 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3058         ;;
3059 (.\${*prefix}*|.\${*dir}*)
3060         eval PKG_CONFIG="$PKG_CONFIG"
3061         case ".$PKG_CONFIG" in
3062         (.NONE/*)
3063                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3064                 ;;
3065         esac
3066         ;;
3067 (.no|.NONE/*)
3068         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3069         ;;
3070 (*)
3071         { { echo "$as_me:3071: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3072 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3073    { (exit 1); exit 1; }; }
3074         ;;
3075 esac
3076
3077 elif test "x$cf_pkg_config" != xno ; then
3078         { echo "$as_me:3078: WARNING: pkg-config is not installed" >&5
3079 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3080 fi
3081
3082 case $PKG_CONFIG in
3083 (no|none|yes)
3084         echo "$as_me:3084: checking for pkg-config library directory" >&5
3085 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3086         ;;
3087 (*)
3088         echo "$as_me:3088: checking for $PKG_CONFIG library directory" >&5
3089 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3090         ;;
3091 esac
3092
3093 PKG_CONFIG_LIBDIR=no
3094
3095 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3096 if test "${with_pkg_config_libdir+set}" = set; then
3097   withval="$with_pkg_config_libdir"
3098   PKG_CONFIG_LIBDIR=$withval
3099 else
3100   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3101 fi;
3102
3103 case x$PKG_CONFIG_LIBDIR in
3104 (x/*)
3105         ;;
3106 (xyes)
3107         # Look for the library directory using the same prefix as the executable
3108         if test "x$PKG_CONFIG" = xnone
3109         then
3110                 cf_path=$prefix
3111         else
3112                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3113         fi
3114
3115         # If you don't like using the default architecture, you have to specify the
3116         # intended library directory and corresponding compiler/linker options.
3117         #
3118         # This case allows for Debian's 2014-flavor of multiarch, along with the
3119         # most common variations before that point.  Some other variants spell the
3120         # directory differently, e.g., "pkg-config", and put it in unusual places.
3121         # pkg-config has always been poorly standardized, which is ironic...
3122         case x`(arch) 2>/dev/null` in
3123         (*64)
3124                 cf_search_path="\
3125                         $cf_path/lib/*64-linux-gnu \
3126                         $cf_path/share \
3127                         $cf_path/lib64 \
3128                         $cf_path/lib32 \
3129                         $cf_path/lib"
3130                 ;;
3131         (*)
3132                 cf_search_path="\
3133                         $cf_path/lib/*-linux-gnu \
3134                         $cf_path/share \
3135                         $cf_path/lib32 \
3136                         $cf_path/lib \
3137                         $cf_path/libdata"
3138                 ;;
3139         esac
3140
3141         test -n "$verbose" && echo "    list..." 1>&6
3142
3143 echo "${as_me:-configure}:3143: testing list... ..." 1>&5
3144
3145         for cf_config in $cf_search_path
3146         do
3147                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3148
3149 echo "${as_me:-configure}:3149: testing checking $cf_config/pkgconfig ..." 1>&5
3150
3151                 if test -d $cf_config/pkgconfig
3152                 then
3153                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3154                         echo "$as_me:3154: checking done" >&5
3155 echo $ECHO_N "checking done... $ECHO_C" >&6
3156                         break
3157                 fi
3158         done
3159         ;;
3160 (*)
3161         ;;
3162 esac
3163
3164 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3165         echo "$as_me:3165: result: $PKG_CONFIG_LIBDIR" >&5
3166 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3167 fi
3168
3169 echo "$as_me:3169: checking if you want to build test-programs" >&5
3170 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3171
3172 # Check whether --with-tests or --without-tests was given.
3173 if test "${with_tests+set}" = set; then
3174   withval="$with_tests"
3175   cf_with_tests=$withval
3176 else
3177   cf_with_tests=yes
3178 fi;
3179 echo "$as_me:3179: result: $cf_with_tests" >&5
3180 echo "${ECHO_T}$cf_with_tests" >&6
3181
3182 echo "$as_me:3182: checking if we should assume mixed-case filenames" >&5
3183 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3184
3185 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3186 if test "${enable_mixed_case+set}" = set; then
3187   enableval="$enable_mixed_case"
3188   enable_mixedcase=$enableval
3189 else
3190   enable_mixedcase=auto
3191 fi;
3192 echo "$as_me:3192: result: $enable_mixedcase" >&5
3193 echo "${ECHO_T}$enable_mixedcase" >&6
3194 if test "$enable_mixedcase" = "auto" ; then
3195
3196 echo "$as_me:3196: checking if filesystem supports mixed-case filenames" >&5
3197 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3198 if test "${cf_cv_mixedcase+set}" = set; then
3199   echo $ECHO_N "(cached) $ECHO_C" >&6
3200 else
3201
3202 if test "$cross_compiling" = yes ; then
3203         case $target_alias in
3204         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3205                 cf_cv_mixedcase=no
3206                 ;;
3207         (*)
3208                 cf_cv_mixedcase=yes
3209                 ;;
3210         esac
3211 else
3212         rm -f conftest CONFTEST
3213         echo test >conftest
3214         if test -f CONFTEST ; then
3215                 cf_cv_mixedcase=no
3216         else
3217                 cf_cv_mixedcase=yes
3218         fi
3219         rm -f conftest CONFTEST
3220 fi
3221
3222 fi
3223 echo "$as_me:3223: result: $cf_cv_mixedcase" >&5
3224 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3225 test "$cf_cv_mixedcase" = yes &&
3226 cat >>confdefs.h <<\EOF
3227 #define MIXEDCASE_FILENAMES 1
3228 EOF
3229
3230 else
3231         cf_cv_mixedcase=$enable_mixedcase
3232         if test "$enable_mixedcase" = "yes" ; then
3233                 cat >>confdefs.h <<\EOF
3234 #define MIXEDCASE_FILENAMES 1
3235 EOF
3236
3237         fi
3238 fi
3239
3240 # do this after mixed-case option (tags/TAGS is not as important as tic).
3241 echo "$as_me:3241: checking whether ${MAKE-make} sets \${MAKE}" >&5
3242 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3243 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3244 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3245   echo $ECHO_N "(cached) $ECHO_C" >&6
3246 else
3247   cat >conftest.make <<\EOF
3248 all:
3249         @echo 'ac_maketemp="${MAKE}"'
3250 EOF
3251 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3252 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3253 if test -n "$ac_maketemp"; then
3254   eval ac_cv_prog_make_${ac_make}_set=yes
3255 else
3256   eval ac_cv_prog_make_${ac_make}_set=no
3257 fi
3258 rm -f conftest.make
3259 fi
3260 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3261   echo "$as_me:3261: result: yes" >&5
3262 echo "${ECHO_T}yes" >&6
3263   SET_MAKE=
3264 else
3265   echo "$as_me:3265: result: no" >&5
3266 echo "${ECHO_T}no" >&6
3267   SET_MAKE="MAKE=${MAKE-make}"
3268 fi
3269
3270 for ac_prog in exctags ctags
3271 do
3272   # Extract the first word of "$ac_prog", so it can be a program name with args.
3273 set dummy $ac_prog; ac_word=$2
3274 echo "$as_me:3274: checking for $ac_word" >&5
3275 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3276 if test "${ac_cv_prog_CTAGS+set}" = set; then
3277   echo $ECHO_N "(cached) $ECHO_C" >&6
3278 else
3279   if test -n "$CTAGS"; then
3280   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3281 else
3282   ac_save_IFS=$IFS; IFS=$ac_path_separator
3283 ac_dummy="$PATH"
3284 for ac_dir in $ac_dummy; do
3285   IFS=$ac_save_IFS
3286   test -z "$ac_dir" && ac_dir=.
3287   $as_executable_p "$ac_dir/$ac_word" || continue
3288 ac_cv_prog_CTAGS="$ac_prog"
3289 echo "$as_me:3289: found $ac_dir/$ac_word" >&5
3290 break
3291 done
3292
3293 fi
3294 fi
3295 CTAGS=$ac_cv_prog_CTAGS
3296 if test -n "$CTAGS"; then
3297   echo "$as_me:3297: result: $CTAGS" >&5
3298 echo "${ECHO_T}$CTAGS" >&6
3299 else
3300   echo "$as_me:3300: result: no" >&5
3301 echo "${ECHO_T}no" >&6
3302 fi
3303
3304   test -n "$CTAGS" && break
3305 done
3306
3307 for ac_prog in exetags etags
3308 do
3309   # Extract the first word of "$ac_prog", so it can be a program name with args.
3310 set dummy $ac_prog; ac_word=$2
3311 echo "$as_me:3311: checking for $ac_word" >&5
3312 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3313 if test "${ac_cv_prog_ETAGS+set}" = set; then
3314   echo $ECHO_N "(cached) $ECHO_C" >&6
3315 else
3316   if test -n "$ETAGS"; then
3317   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3318 else
3319   ac_save_IFS=$IFS; IFS=$ac_path_separator
3320 ac_dummy="$PATH"
3321 for ac_dir in $ac_dummy; do
3322   IFS=$ac_save_IFS
3323   test -z "$ac_dir" && ac_dir=.
3324   $as_executable_p "$ac_dir/$ac_word" || continue
3325 ac_cv_prog_ETAGS="$ac_prog"
3326 echo "$as_me:3326: found $ac_dir/$ac_word" >&5
3327 break
3328 done
3329
3330 fi
3331 fi
3332 ETAGS=$ac_cv_prog_ETAGS
3333 if test -n "$ETAGS"; then
3334   echo "$as_me:3334: result: $ETAGS" >&5
3335 echo "${ECHO_T}$ETAGS" >&6
3336 else
3337   echo "$as_me:3337: result: no" >&5
3338 echo "${ECHO_T}no" >&6
3339 fi
3340
3341   test -n "$ETAGS" && break
3342 done
3343
3344 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3345 set dummy ${CTAGS:-ctags}; ac_word=$2
3346 echo "$as_me:3346: checking for $ac_word" >&5
3347 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3348 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3349   echo $ECHO_N "(cached) $ECHO_C" >&6
3350 else
3351   if test -n "$MAKE_LOWER_TAGS"; then
3352   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3353 else
3354   ac_save_IFS=$IFS; IFS=$ac_path_separator
3355 ac_dummy="$PATH"
3356 for ac_dir in $ac_dummy; do
3357   IFS=$ac_save_IFS
3358   test -z "$ac_dir" && ac_dir=.
3359   $as_executable_p "$ac_dir/$ac_word" || continue
3360 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3361 echo "$as_me:3361: found $ac_dir/$ac_word" >&5
3362 break
3363 done
3364
3365   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3366 fi
3367 fi
3368 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3369 if test -n "$MAKE_LOWER_TAGS"; then
3370   echo "$as_me:3370: result: $MAKE_LOWER_TAGS" >&5
3371 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3372 else
3373   echo "$as_me:3373: result: no" >&5
3374 echo "${ECHO_T}no" >&6
3375 fi
3376
3377 if test "$cf_cv_mixedcase" = yes ; then
3378         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3379 set dummy ${ETAGS:-etags}; ac_word=$2
3380 echo "$as_me:3380: checking for $ac_word" >&5
3381 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3382 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3383   echo $ECHO_N "(cached) $ECHO_C" >&6
3384 else
3385   if test -n "$MAKE_UPPER_TAGS"; then
3386   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3387 else
3388   ac_save_IFS=$IFS; IFS=$ac_path_separator
3389 ac_dummy="$PATH"
3390 for ac_dir in $ac_dummy; do
3391   IFS=$ac_save_IFS
3392   test -z "$ac_dir" && ac_dir=.
3393   $as_executable_p "$ac_dir/$ac_word" || continue
3394 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3395 echo "$as_me:3395: found $ac_dir/$ac_word" >&5
3396 break
3397 done
3398
3399   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3400 fi
3401 fi
3402 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3403 if test -n "$MAKE_UPPER_TAGS"; then
3404   echo "$as_me:3404: result: $MAKE_UPPER_TAGS" >&5
3405 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3406 else
3407   echo "$as_me:3407: result: no" >&5
3408 echo "${ECHO_T}no" >&6
3409 fi
3410
3411 else
3412         MAKE_UPPER_TAGS=no
3413 fi
3414
3415 if test "$MAKE_UPPER_TAGS" = yes ; then
3416         MAKE_UPPER_TAGS=
3417 else
3418         MAKE_UPPER_TAGS="#"
3419 fi
3420
3421 if test "$MAKE_LOWER_TAGS" = yes ; then
3422         MAKE_LOWER_TAGS=
3423 else
3424         MAKE_LOWER_TAGS="#"
3425 fi
3426
3427 echo "$as_me:3427: checking for makeflags variable" >&5
3428 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3429 if test "${cf_cv_makeflags+set}" = set; then
3430   echo $ECHO_N "(cached) $ECHO_C" >&6
3431 else
3432
3433         cf_cv_makeflags=''
3434         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3435         do
3436                 cat >cf_makeflags.tmp <<CF_EOF
3437 SHELL = $SHELL
3438 all :
3439         @ echo '.$cf_option'
3440 CF_EOF
3441                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3442                 case "$cf_result" in
3443                 (.*k|.*kw)
3444                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3445                         case "$cf_result" in
3446                         (.*CC=*)        cf_cv_makeflags=
3447                                 ;;
3448                         (*)     cf_cv_makeflags=$cf_option
3449                                 ;;
3450                         esac
3451                         break
3452                         ;;
3453                 (.-)
3454                         ;;
3455                 (*)
3456
3457 echo "${as_me:-configure}:3457: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3458
3459                         ;;
3460                 esac
3461         done
3462         rm -f cf_makeflags.tmp
3463
3464 fi
3465 echo "$as_me:3465: result: $cf_cv_makeflags" >&5
3466 echo "${ECHO_T}$cf_cv_makeflags" >&6
3467
3468 if test -n "$ac_tool_prefix"; then
3469   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3470 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3471 echo "$as_me:3471: checking for $ac_word" >&5
3472 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3473 if test "${ac_cv_prog_RANLIB+set}" = set; then
3474   echo $ECHO_N "(cached) $ECHO_C" >&6
3475 else
3476   if test -n "$RANLIB"; then
3477   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3478 else
3479   ac_save_IFS=$IFS; IFS=$ac_path_separator
3480 ac_dummy="$PATH"
3481 for ac_dir in $ac_dummy; do
3482   IFS=$ac_save_IFS
3483   test -z "$ac_dir" && ac_dir=.
3484   $as_executable_p "$ac_dir/$ac_word" || continue
3485 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3486 echo "$as_me:3486: found $ac_dir/$ac_word" >&5
3487 break
3488 done
3489
3490 fi
3491 fi
3492 RANLIB=$ac_cv_prog_RANLIB
3493 if test -n "$RANLIB"; then
3494   echo "$as_me:3494: result: $RANLIB" >&5
3495 echo "${ECHO_T}$RANLIB" >&6
3496 else
3497   echo "$as_me:3497: result: no" >&5
3498 echo "${ECHO_T}no" >&6
3499 fi
3500
3501 fi
3502 if test -z "$ac_cv_prog_RANLIB"; then
3503   ac_ct_RANLIB=$RANLIB
3504   # Extract the first word of "ranlib", so it can be a program name with args.
3505 set dummy ranlib; ac_word=$2
3506 echo "$as_me:3506: checking for $ac_word" >&5
3507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3508 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3509   echo $ECHO_N "(cached) $ECHO_C" >&6
3510 else
3511   if test -n "$ac_ct_RANLIB"; then
3512   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3513 else
3514   ac_save_IFS=$IFS; IFS=$ac_path_separator
3515 ac_dummy="$PATH"
3516 for ac_dir in $ac_dummy; do
3517   IFS=$ac_save_IFS
3518   test -z "$ac_dir" && ac_dir=.
3519   $as_executable_p "$ac_dir/$ac_word" || continue
3520 ac_cv_prog_ac_ct_RANLIB="ranlib"
3521 echo "$as_me:3521: found $ac_dir/$ac_word" >&5
3522 break
3523 done
3524
3525   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3526 fi
3527 fi
3528 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3529 if test -n "$ac_ct_RANLIB"; then
3530   echo "$as_me:3530: result: $ac_ct_RANLIB" >&5
3531 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3532 else
3533   echo "$as_me:3533: result: no" >&5
3534 echo "${ECHO_T}no" >&6
3535 fi
3536
3537   RANLIB=$ac_ct_RANLIB
3538 else
3539   RANLIB="$ac_cv_prog_RANLIB"
3540 fi
3541
3542 if test -n "$ac_tool_prefix"; then
3543   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3544 set dummy ${ac_tool_prefix}ld; ac_word=$2
3545 echo "$as_me:3545: checking for $ac_word" >&5
3546 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3547 if test "${ac_cv_prog_LD+set}" = set; then
3548   echo $ECHO_N "(cached) $ECHO_C" >&6
3549 else
3550   if test -n "$LD"; then
3551   ac_cv_prog_LD="$LD" # Let the user override the test.
3552 else
3553   ac_save_IFS=$IFS; IFS=$ac_path_separator
3554 ac_dummy="$PATH"
3555 for ac_dir in $ac_dummy; do
3556   IFS=$ac_save_IFS
3557   test -z "$ac_dir" && ac_dir=.
3558   $as_executable_p "$ac_dir/$ac_word" || continue
3559 ac_cv_prog_LD="${ac_tool_prefix}ld"
3560 echo "$as_me:3560: found $ac_dir/$ac_word" >&5
3561 break
3562 done
3563
3564 fi
3565 fi
3566 LD=$ac_cv_prog_LD
3567 if test -n "$LD"; then
3568   echo "$as_me:3568: result: $LD" >&5
3569 echo "${ECHO_T}$LD" >&6
3570 else
3571   echo "$as_me:3571: result: no" >&5
3572 echo "${ECHO_T}no" >&6
3573 fi
3574
3575 fi
3576 if test -z "$ac_cv_prog_LD"; then
3577   ac_ct_LD=$LD
3578   # Extract the first word of "ld", so it can be a program name with args.
3579 set dummy ld; ac_word=$2
3580 echo "$as_me:3580: checking for $ac_word" >&5
3581 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3582 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3583   echo $ECHO_N "(cached) $ECHO_C" >&6
3584 else
3585   if test -n "$ac_ct_LD"; then
3586   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3587 else
3588   ac_save_IFS=$IFS; IFS=$ac_path_separator
3589 ac_dummy="$PATH"
3590 for ac_dir in $ac_dummy; do
3591   IFS=$ac_save_IFS
3592   test -z "$ac_dir" && ac_dir=.
3593   $as_executable_p "$ac_dir/$ac_word" || continue
3594 ac_cv_prog_ac_ct_LD="ld"
3595 echo "$as_me:3595: found $ac_dir/$ac_word" >&5
3596 break
3597 done
3598
3599   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3600 fi
3601 fi
3602 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3603 if test -n "$ac_ct_LD"; then
3604   echo "$as_me:3604: result: $ac_ct_LD" >&5
3605 echo "${ECHO_T}$ac_ct_LD" >&6
3606 else
3607   echo "$as_me:3607: result: no" >&5
3608 echo "${ECHO_T}no" >&6
3609 fi
3610
3611   LD=$ac_ct_LD
3612 else
3613   LD="$ac_cv_prog_LD"
3614 fi
3615
3616 if test -n "$ac_tool_prefix"; then
3617   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3618 set dummy ${ac_tool_prefix}ar; ac_word=$2
3619 echo "$as_me:3619: checking for $ac_word" >&5
3620 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3621 if test "${ac_cv_prog_AR+set}" = set; then
3622   echo $ECHO_N "(cached) $ECHO_C" >&6
3623 else
3624   if test -n "$AR"; then
3625   ac_cv_prog_AR="$AR" # Let the user override the test.
3626 else
3627   ac_save_IFS=$IFS; IFS=$ac_path_separator
3628 ac_dummy="$PATH"
3629 for ac_dir in $ac_dummy; do
3630   IFS=$ac_save_IFS
3631   test -z "$ac_dir" && ac_dir=.
3632   $as_executable_p "$ac_dir/$ac_word" || continue
3633 ac_cv_prog_AR="${ac_tool_prefix}ar"
3634 echo "$as_me:3634: found $ac_dir/$ac_word" >&5
3635 break
3636 done
3637
3638 fi
3639 fi
3640 AR=$ac_cv_prog_AR
3641 if test -n "$AR"; then
3642   echo "$as_me:3642: result: $AR" >&5
3643 echo "${ECHO_T}$AR" >&6
3644 else
3645   echo "$as_me:3645: result: no" >&5
3646 echo "${ECHO_T}no" >&6
3647 fi
3648
3649 fi
3650 if test -z "$ac_cv_prog_AR"; then
3651   ac_ct_AR=$AR
3652   # Extract the first word of "ar", so it can be a program name with args.
3653 set dummy ar; ac_word=$2
3654 echo "$as_me:3654: checking for $ac_word" >&5
3655 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3656 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3657   echo $ECHO_N "(cached) $ECHO_C" >&6
3658 else
3659   if test -n "$ac_ct_AR"; then
3660   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3661 else
3662   ac_save_IFS=$IFS; IFS=$ac_path_separator
3663 ac_dummy="$PATH"
3664 for ac_dir in $ac_dummy; do
3665   IFS=$ac_save_IFS
3666   test -z "$ac_dir" && ac_dir=.
3667   $as_executable_p "$ac_dir/$ac_word" || continue
3668 ac_cv_prog_ac_ct_AR="ar"
3669 echo "$as_me:3669: found $ac_dir/$ac_word" >&5
3670 break
3671 done
3672
3673   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3674 fi
3675 fi
3676 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3677 if test -n "$ac_ct_AR"; then
3678   echo "$as_me:3678: result: $ac_ct_AR" >&5
3679 echo "${ECHO_T}$ac_ct_AR" >&6
3680 else
3681   echo "$as_me:3681: result: no" >&5
3682 echo "${ECHO_T}no" >&6
3683 fi
3684
3685   AR=$ac_ct_AR
3686 else
3687   AR="$ac_cv_prog_AR"
3688 fi
3689
3690 if test -n "$ac_tool_prefix"; then
3691   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3692 set dummy ${ac_tool_prefix}ar; ac_word=$2
3693 echo "$as_me:3693: checking for $ac_word" >&5
3694 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3695 if test "${ac_cv_prog_AR+set}" = set; then
3696   echo $ECHO_N "(cached) $ECHO_C" >&6
3697 else
3698   if test -n "$AR"; then
3699   ac_cv_prog_AR="$AR" # Let the user override the test.
3700 else
3701   ac_save_IFS=$IFS; IFS=$ac_path_separator
3702 ac_dummy="$PATH"
3703 for ac_dir in $ac_dummy; do
3704   IFS=$ac_save_IFS
3705   test -z "$ac_dir" && ac_dir=.
3706   $as_executable_p "$ac_dir/$ac_word" || continue
3707 ac_cv_prog_AR="${ac_tool_prefix}ar"
3708 echo "$as_me:3708: found $ac_dir/$ac_word" >&5
3709 break
3710 done
3711
3712 fi
3713 fi
3714 AR=$ac_cv_prog_AR
3715 if test -n "$AR"; then
3716   echo "$as_me:3716: result: $AR" >&5
3717 echo "${ECHO_T}$AR" >&6
3718 else
3719   echo "$as_me:3719: result: no" >&5
3720 echo "${ECHO_T}no" >&6
3721 fi
3722
3723 fi
3724 if test -z "$ac_cv_prog_AR"; then
3725   ac_ct_AR=$AR
3726   # Extract the first word of "ar", so it can be a program name with args.
3727 set dummy ar; ac_word=$2
3728 echo "$as_me:3728: checking for $ac_word" >&5
3729 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3730 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3731   echo $ECHO_N "(cached) $ECHO_C" >&6
3732 else
3733   if test -n "$ac_ct_AR"; then
3734   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3735 else
3736   ac_save_IFS=$IFS; IFS=$ac_path_separator
3737 ac_dummy="$PATH"
3738 for ac_dir in $ac_dummy; do
3739   IFS=$ac_save_IFS
3740   test -z "$ac_dir" && ac_dir=.
3741   $as_executable_p "$ac_dir/$ac_word" || continue
3742 ac_cv_prog_ac_ct_AR="ar"
3743 echo "$as_me:3743: found $ac_dir/$ac_word" >&5
3744 break
3745 done
3746
3747   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3748 fi
3749 fi
3750 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3751 if test -n "$ac_ct_AR"; then
3752   echo "$as_me:3752: result: $ac_ct_AR" >&5
3753 echo "${ECHO_T}$ac_ct_AR" >&6
3754 else
3755   echo "$as_me:3755: result: no" >&5
3756 echo "${ECHO_T}no" >&6
3757 fi
3758
3759   AR=$ac_ct_AR
3760 else
3761   AR="$ac_cv_prog_AR"
3762 fi
3763
3764 echo "$as_me:3764: checking for options to update archives" >&5
3765 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3766 if test "${cf_cv_ar_flags+set}" = set; then
3767   echo $ECHO_N "(cached) $ECHO_C" >&6
3768 else
3769
3770         case $cf_cv_system_name in
3771         (*-msvc*)
3772                 cf_cv_ar_flags=''
3773                 cat >mk_static_lib.sh <<-EOF
3774                 #!$SHELL
3775                 MSVC_BIN="$AR"
3776                 out="\$1"
3777                 shift
3778                 exec \$MSVC_BIN -out:"\$out" \$@
3779                 EOF
3780                 chmod +x mk_static_lib.sh
3781                 AR=`pwd`/mk_static_lib.sh
3782                 ;;
3783         (*)
3784                 cf_cv_ar_flags=unknown
3785                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3786                 do
3787
3788                         # check if $ARFLAGS already contains this choice
3789                         if test "x$ARFLAGS" != "x" ; then
3790                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3791                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3792                                         cf_cv_ar_flags=
3793                                         break
3794                                 fi
3795                         fi
3796
3797                         rm -f conftest.$ac_cv_objext
3798                         rm -f conftest.a
3799
3800                         cat >conftest.$ac_ext <<EOF
3801 #line 3801 "configure"
3802 int     testdata[3] = { 123, 456, 789 };
3803 EOF
3804                         if { (eval echo "$as_me:3804: \"$ac_compile\"") >&5
3805   (eval $ac_compile) 2>&5
3806   ac_status=$?
3807   echo "$as_me:3807: \$? = $ac_status" >&5
3808   (exit $ac_status); } ; then
3809                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3810                                 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3811                                 if test -f conftest.a ; then
3812                                         cf_cv_ar_flags=$cf_ar_flags
3813                                         break
3814                                 fi
3815                         else
3816                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3817
3818 echo "${as_me:-configure}:3818: testing cannot compile test-program ..." 1>&5
3819
3820                                 break
3821                         fi
3822                 done
3823                 rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3824                 ;;
3825         esac
3826
3827 fi
3828 echo "$as_me:3828: result: $cf_cv_ar_flags" >&5
3829 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3830
3831 if test -n "$ARFLAGS" ; then
3832         if test -n "$cf_cv_ar_flags" ; then
3833                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3834         fi
3835 else
3836         ARFLAGS=$cf_cv_ar_flags
3837 fi
3838
3839         echo "$as_me:3839: checking for PATH separator" >&5
3840 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3841         case $cf_cv_system_name in
3842         (os2*)  PATH_SEPARATOR=';'  ;;
3843         (*)     ${PATH_SEPARATOR:=':'}  ;;
3844         esac
3845
3846         echo "$as_me:3846: result: $PATH_SEPARATOR" >&5
3847 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3848
3849 echo "$as_me:3849: checking if you have specified an install-prefix" >&5
3850 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3851
3852 # Check whether --with-install-prefix or --without-install-prefix was given.
3853 if test "${with_install_prefix+set}" = set; then
3854   withval="$with_install_prefix"
3855   case "$withval" in
3856         (yes|no)
3857                 ;;
3858         (*)     DESTDIR="$withval"
3859                 ;;
3860         esac
3861 fi;
3862 echo "$as_me:3862: result: $DESTDIR" >&5
3863 echo "${ECHO_T}$DESTDIR" >&6
3864
3865 ###############################################################################
3866
3867 # If we're cross-compiling, allow the user to override the tools and their
3868 # options.  The configure script is oriented toward identifying the host
3869 # compiler, etc., but we need a build compiler to generate parts of the source.
3870
3871 if test "$cross_compiling" = yes ; then
3872
3873         # defaults that we might want to override
3874         : ${BUILD_CFLAGS:=''}
3875         : ${BUILD_CPPFLAGS:=''}
3876         : ${BUILD_LDFLAGS:=''}
3877         : ${BUILD_LIBS:=''}
3878         : ${BUILD_EXEEXT:='$x'}
3879         : ${BUILD_OBJEXT:='o'}
3880
3881 # Check whether --with-build-cc or --without-build-cc was given.
3882 if test "${with_build_cc+set}" = set; then
3883   withval="$with_build_cc"
3884   BUILD_CC="$withval"
3885 else
3886   for ac_prog in gcc clang c99 c89 cc cl
3887 do
3888   # Extract the first word of "$ac_prog", so it can be a program name with args.
3889 set dummy $ac_prog; ac_word=$2
3890 echo "$as_me:3890: checking for $ac_word" >&5
3891 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3892 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3893   echo $ECHO_N "(cached) $ECHO_C" >&6
3894 else
3895   if test -n "$BUILD_CC"; then
3896   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3897 else
3898   ac_save_IFS=$IFS; IFS=$ac_path_separator
3899 ac_dummy="$PATH"
3900 for ac_dir in $ac_dummy; do
3901   IFS=$ac_save_IFS
3902   test -z "$ac_dir" && ac_dir=.
3903   $as_executable_p "$ac_dir/$ac_word" || continue
3904 ac_cv_prog_BUILD_CC="$ac_prog"
3905 echo "$as_me:3905: found $ac_dir/$ac_word" >&5
3906 break
3907 done
3908
3909 fi
3910 fi
3911 BUILD_CC=$ac_cv_prog_BUILD_CC
3912 if test -n "$BUILD_CC"; then
3913   echo "$as_me:3913: result: $BUILD_CC" >&5
3914 echo "${ECHO_T}$BUILD_CC" >&6
3915 else
3916   echo "$as_me:3916: result: no" >&5
3917 echo "${ECHO_T}no" >&6
3918 fi
3919
3920   test -n "$BUILD_CC" && break
3921 done
3922 test -n "$BUILD_CC" || BUILD_CC="none"
3923
3924 fi;
3925         echo "$as_me:3925: checking for native build C compiler" >&5
3926 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3927         echo "$as_me:3927: result: $BUILD_CC" >&5
3928 echo "${ECHO_T}$BUILD_CC" >&6
3929
3930         echo "$as_me:3930: checking for native build C preprocessor" >&5
3931 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3932
3933 # Check whether --with-build-cpp or --without-build-cpp was given.
3934 if test "${with_build_cpp+set}" = set; then
3935   withval="$with_build_cpp"
3936   BUILD_CPP="$withval"
3937 else
3938   BUILD_CPP='${BUILD_CC} -E'
3939 fi;
3940         echo "$as_me:3940: result: $BUILD_CPP" >&5
3941 echo "${ECHO_T}$BUILD_CPP" >&6
3942
3943         echo "$as_me:3943: checking for native build C flags" >&5
3944 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3945
3946 # Check whether --with-build-cflags or --without-build-cflags was given.
3947 if test "${with_build_cflags+set}" = set; then
3948   withval="$with_build_cflags"
3949   BUILD_CFLAGS="$withval"
3950 fi;
3951         echo "$as_me:3951: result: $BUILD_CFLAGS" >&5
3952 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3953
3954         echo "$as_me:3954: checking for native build C preprocessor-flags" >&5
3955 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3956
3957 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3958 if test "${with_build_cppflags+set}" = set; then
3959   withval="$with_build_cppflags"
3960   BUILD_CPPFLAGS="$withval"
3961 fi;
3962         echo "$as_me:3962: result: $BUILD_CPPFLAGS" >&5
3963 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3964
3965         echo "$as_me:3965: checking for native build linker-flags" >&5
3966 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3967
3968 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3969 if test "${with_build_ldflags+set}" = set; then
3970   withval="$with_build_ldflags"
3971   BUILD_LDFLAGS="$withval"
3972 fi;
3973         echo "$as_me:3973: result: $BUILD_LDFLAGS" >&5
3974 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3975
3976         echo "$as_me:3976: checking for native build linker-libraries" >&5
3977 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3978
3979 # Check whether --with-build-libs or --without-build-libs was given.
3980 if test "${with_build_libs+set}" = set; then
3981   withval="$with_build_libs"
3982   BUILD_LIBS="$withval"
3983 fi;
3984         echo "$as_me:3984: result: $BUILD_LIBS" >&5
3985 echo "${ECHO_T}$BUILD_LIBS" >&6
3986
3987         # this assumes we're on Unix.
3988         BUILD_EXEEXT=
3989         BUILD_OBJEXT=o
3990
3991         : ${BUILD_CC:='${CC}'}
3992
3993         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3994                 { { echo "$as_me:3994: error: Cross-build requires two compilers.
3995 Use --with-build-cc to specify the native compiler." >&5
3996 echo "$as_me: error: Cross-build requires two compilers.
3997 Use --with-build-cc to specify the native compiler." >&2;}
3998    { (exit 1); exit 1; }; }
3999         fi
4000
4001 else
4002         : ${BUILD_CC:='${CC}'}
4003         : ${BUILD_CPP:='${CPP}'}
4004         : ${BUILD_CFLAGS:='${CFLAGS}'}
4005         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4006         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4007         : ${BUILD_LIBS:='${LIBS}'}
4008         : ${BUILD_EXEEXT:='$x'}
4009         : ${BUILD_OBJEXT:='o'}
4010 fi
4011
4012 ###############################################################################
4013
4014 ### Options to allow the user to specify the set of libraries which are used.
4015 ### Use "--without-normal --with-shared" to allow the default model to be
4016 ### shared, for example.
4017 cf_list_models=""
4018
4019 echo "$as_me:4019: checking if you want to build shared C-objects" >&5
4020 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4021
4022 # Check whether --with-shared or --without-shared was given.
4023 if test "${with_shared+set}" = set; then
4024   withval="$with_shared"
4025   with_shared=$withval
4026 else
4027   with_shared=no
4028 fi;
4029 echo "$as_me:4029: result: $with_shared" >&5
4030 echo "${ECHO_T}$with_shared" >&6
4031 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4032
4033 echo "$as_me:4033: checking for specified models" >&5
4034 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4035 test -z "$cf_list_models" && cf_list_models=normal
4036 echo "$as_me:4036: result: $cf_list_models" >&5
4037 echo "${ECHO_T}$cf_list_models" >&6
4038
4039 ### Use the first model as the default, and save its suffix for use in building
4040 ### up test-applications.
4041 echo "$as_me:4041: checking for default model" >&5
4042 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4043 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4044 echo "$as_me:4044: result: $DFT_LWR_MODEL" >&5
4045 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4046
4047 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4048
4049 echo "$as_me:4049: checking for specific curses-directory" >&5
4050 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4051
4052 # Check whether --with-curses-dir or --without-curses-dir was given.
4053 if test "${with_curses_dir+set}" = set; then
4054   withval="$with_curses_dir"
4055   cf_cv_curses_dir=$withval
4056 else
4057   cf_cv_curses_dir=no
4058 fi;
4059 echo "$as_me:4059: result: $cf_cv_curses_dir" >&5
4060 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4061
4062 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4063 then
4064
4065 if test "x$prefix" != xNONE; then
4066         cf_path_syntax="$prefix"
4067 else
4068         cf_path_syntax="$ac_default_prefix"
4069 fi
4070
4071 case ".$withval" in
4072 (.\$\(*\)*|.\'*\'*)
4073         ;;
4074 (..|./*|.\\*)
4075         ;;
4076 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4077         ;;
4078 (.\${*prefix}*|.\${*dir}*)
4079         eval withval="$withval"
4080         case ".$withval" in
4081         (.NONE/*)
4082                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4083                 ;;
4084         esac
4085         ;;
4086 (.no|.NONE/*)
4087         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4088         ;;
4089 (*)
4090         { { echo "$as_me:4090: error: expected a pathname, not \"$withval\"" >&5
4091 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4092    { (exit 1); exit 1; }; }
4093         ;;
4094 esac
4095
4096         if test -d "$cf_cv_curses_dir"
4097         then
4098
4099 if test -n "$cf_cv_curses_dir/include" ; then
4100   for cf_add_incdir in $cf_cv_curses_dir/include
4101   do
4102         while test $cf_add_incdir != /usr/include
4103         do
4104           if test -d $cf_add_incdir
4105           then
4106                 cf_have_incdir=no
4107                 if test -n "$CFLAGS$CPPFLAGS" ; then
4108                   # a loop is needed to ensure we can add subdirs of existing dirs
4109                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4110                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4111                           cf_have_incdir=yes; break
4112                         fi
4113                   done
4114                 fi
4115
4116                 if test "$cf_have_incdir" = no ; then
4117                   if test "$cf_add_incdir" = /usr/local/include ; then
4118                         if test "$GCC" = yes
4119                         then
4120                           cf_save_CPPFLAGS=$CPPFLAGS
4121
4122         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4123         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4124
4125                           cat >conftest.$ac_ext <<_ACEOF
4126 #line 4126 "configure"
4127 #include "confdefs.h"
4128 #include <stdio.h>
4129 int
4130 main (void)
4131 {
4132 printf("Hello")
4133   ;
4134   return 0;
4135 }
4136 _ACEOF
4137 rm -f conftest.$ac_objext
4138 if { (eval echo "$as_me:4138: \"$ac_compile\"") >&5
4139   (eval $ac_compile) 2>&5
4140   ac_status=$?
4141   echo "$as_me:4141: \$? = $ac_status" >&5
4142   (exit $ac_status); } &&
4143          { ac_try='test -s conftest.$ac_objext'
4144   { (eval echo "$as_me:4144: \"$ac_try\"") >&5
4145   (eval $ac_try) 2>&5
4146   ac_status=$?
4147   echo "$as_me:4147: \$? = $ac_status" >&5
4148   (exit $ac_status); }; }; then
4149   :
4150 else
4151   echo "$as_me: failed program was:" >&5
4152 cat conftest.$ac_ext >&5
4153 cf_have_incdir=yes
4154 fi
4155 rm -f conftest.$ac_objext conftest.$ac_ext
4156                           CPPFLAGS=$cf_save_CPPFLAGS
4157                         fi
4158                   fi
4159                 fi
4160
4161                 if test "$cf_have_incdir" = no ; then
4162                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4163
4164 echo "${as_me:-configure}:4164: testing adding $cf_add_incdir to include-path ..." 1>&5
4165
4166                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4167
4168                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4169                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4170                   cf_add_incdir="$cf_top_incdir"
4171                 else
4172                   break
4173                 fi
4174           else
4175                 break
4176           fi
4177         done
4178   done
4179 fi
4180
4181 if test -n "$cf_cv_curses_dir/lib" ; then
4182         for cf_add_libdir in $cf_cv_curses_dir/lib
4183         do
4184                 if test $cf_add_libdir = /usr/lib ; then
4185                         :
4186                 elif test -d $cf_add_libdir
4187                 then
4188                         cf_have_libdir=no
4189                         if test -n "$LDFLAGS$LIBS" ; then
4190                                 # a loop is needed to ensure we can add subdirs of existing dirs
4191                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4192                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4193                                                 cf_have_libdir=yes; break
4194                                         fi
4195                                 done
4196                         fi
4197                         if test "$cf_have_libdir" = no ; then
4198                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4199
4200 echo "${as_me:-configure}:4200: testing adding $cf_add_libdir to library-path ..." 1>&5
4201
4202                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4203                         fi
4204                 fi
4205         done
4206 fi
4207
4208         fi
4209 fi
4210
4211 cf_ncuconfig_root=ncurses
4212 cf_have_ncuconfig=no
4213
4214 if test "x${PKG_CONFIG:=none}" != xnone; then
4215         echo "$as_me:4215: checking pkg-config for $cf_ncuconfig_root" >&5
4216 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4217         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4218                 echo "$as_me:4218: result: yes" >&5
4219 echo "${ECHO_T}yes" >&6
4220
4221                 echo "$as_me:4221: checking if the $cf_ncuconfig_root package files work" >&5
4222 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4223                 cf_have_ncuconfig=unknown
4224
4225                 cf_save_CFLAGS="$CFLAGS"
4226                 cf_save_CPPFLAGS="$CPPFLAGS"
4227                 cf_save_LIBS="$LIBS"
4228
4229                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
4230                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
4231
4232                 # while -W for passing linker flags is prevalent, it is not "standard".
4233                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4234                 # incompatible _and_ non-standard -W option which gives an error.  Work
4235                 # around that pitfall.
4236                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4237                 (x*c[89]9@@*-W*)
4238
4239 cf_fix_cppflags=no
4240 cf_new_cflags=
4241 cf_new_cppflags=
4242 cf_new_extra_cppflags=
4243
4244 for cf_add_cflags in $cf_pkg_cflags
4245 do
4246 case $cf_fix_cppflags in
4247 (no)
4248         case $cf_add_cflags in
4249         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4250                 case $cf_add_cflags in
4251                 (-D*)
4252                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4253
4254                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4255                                 && test -z "${cf_tst_cflags}" \
4256                                 && cf_fix_cppflags=yes
4257
4258                         if test $cf_fix_cppflags = yes ; then
4259
4260         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4261         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4262
4263                                 continue
4264                         elif test "${cf_tst_cflags}" = "\"'" ; then
4265
4266         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4267         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4268
4269                                 continue
4270                         fi
4271                         ;;
4272                 esac
4273                 case "$CPPFLAGS" in
4274                 (*$cf_add_cflags)
4275                         ;;
4276                 (*)
4277                         case $cf_add_cflags in
4278                         (-D*)
4279                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4280
4281 CPPFLAGS=`echo "$CPPFLAGS" | \
4282         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4283                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4284
4285                                 ;;
4286                         esac
4287
4288         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4289         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4290
4291                         ;;
4292                 esac
4293                 ;;
4294         (*)
4295
4296         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4297         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4298
4299                 ;;
4300         esac
4301         ;;
4302 (yes)
4303
4304         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4305         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4306
4307         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4308
4309         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4310                 && test -z "${cf_tst_cflags}" \
4311                 && cf_fix_cppflags=no
4312         ;;
4313 esac
4314 done
4315
4316 if test -n "$cf_new_cflags" ; then
4317
4318         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4319         CFLAGS="${CFLAGS}$cf_new_cflags"
4320
4321 fi
4322
4323 if test -n "$cf_new_cppflags" ; then
4324
4325         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4326         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4327
4328 fi
4329
4330 if test -n "$cf_new_extra_cppflags" ; then
4331
4332         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4333         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4334
4335 fi
4336
4337 cf_add_libs="$LIBS"
4338 # reverse order
4339 cf_add_0lib=
4340 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4341 # filter duplicates
4342 for cf_add_1lib in $cf_add_0lib; do
4343         for cf_add_2lib in $cf_add_libs; do
4344                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4345                         cf_add_1lib=
4346                         break
4347                 fi
4348         done
4349         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4350 done
4351 LIBS="$cf_add_libs"
4352
4353                         cat >conftest.$ac_ext <<_ACEOF
4354 #line 4354 "configure"
4355 #include "confdefs.h"
4356 #include <${cf_cv_ncurses_header:-curses.h}>
4357 int
4358 main (void)
4359 {
4360 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4361   ;
4362   return 0;
4363 }
4364 _ACEOF
4365 rm -f conftest.$ac_objext conftest$ac_exeext
4366 if { (eval echo "$as_me:4366: \"$ac_link\"") >&5
4367   (eval $ac_link) 2>&5
4368   ac_status=$?
4369   echo "$as_me:4369: \$? = $ac_status" >&5
4370   (exit $ac_status); } &&
4371          { ac_try='test -s conftest$ac_exeext'
4372   { (eval echo "$as_me:4372: \"$ac_try\"") >&5
4373   (eval $ac_try) 2>&5
4374   ac_status=$?
4375   echo "$as_me:4375: \$? = $ac_status" >&5
4376   (exit $ac_status); }; }; then
4377   if test "$cross_compiling" = yes; then
4378   cf_test_ncuconfig=maybe
4379 else
4380   cat >conftest.$ac_ext <<_ACEOF
4381 #line 4381 "configure"
4382 #include "confdefs.h"
4383 #include <${cf_cv_ncurses_header:-curses.h}>
4384                                         int main(void)
4385                                         { char *xx = curses_version(); return (xx == 0); }
4386 _ACEOF
4387 rm -f conftest$ac_exeext
4388 if { (eval echo "$as_me:4388: \"$ac_link\"") >&5
4389   (eval $ac_link) 2>&5
4390   ac_status=$?
4391   echo "$as_me:4391: \$? = $ac_status" >&5
4392   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4393   { (eval echo "$as_me:4393: \"$ac_try\"") >&5
4394   (eval $ac_try) 2>&5
4395   ac_status=$?
4396   echo "$as_me:4396: \$? = $ac_status" >&5
4397   (exit $ac_status); }; }; then
4398   cf_test_ncuconfig=yes
4399 else
4400   echo "$as_me: program exited with status $ac_status" >&5
4401 echo "$as_me: failed program was:" >&5
4402 cat conftest.$ac_ext >&5
4403 cf_test_ncuconfig=no
4404 fi
4405 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4406 fi
4407 else
4408   echo "$as_me: failed program was:" >&5
4409 cat conftest.$ac_ext >&5
4410 cf_test_ncuconfig=no
4411 fi
4412 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4413
4414                         CFLAGS="$cf_save_CFLAGS"
4415                         CPPFLAGS="$cf_save_CPPFLAGS"
4416                         LIBS="$cf_save_LIBS"
4417
4418                         if test "x$cf_test_ncuconfig" != xyes; then
4419                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4420                                 cf_pkg_cflags="$cf_temp"
4421                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4422                                 cf_pkg_libs="$cf_temp"
4423                         fi
4424                         ;;
4425                 esac
4426
4427 cf_fix_cppflags=no
4428 cf_new_cflags=
4429 cf_new_cppflags=
4430 cf_new_extra_cppflags=
4431
4432 for cf_add_cflags in $cf_pkg_cflags
4433 do
4434 case $cf_fix_cppflags in
4435 (no)
4436         case $cf_add_cflags in
4437         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4438                 case $cf_add_cflags in
4439                 (-D*)
4440                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4441
4442                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4443                                 && test -z "${cf_tst_cflags}" \
4444                                 && cf_fix_cppflags=yes
4445
4446                         if test $cf_fix_cppflags = yes ; then
4447
4448         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4449         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4450
4451                                 continue
4452                         elif test "${cf_tst_cflags}" = "\"'" ; then
4453
4454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4456
4457                                 continue
4458                         fi
4459                         ;;
4460                 esac
4461                 case "$CPPFLAGS" in
4462                 (*$cf_add_cflags)
4463                         ;;
4464                 (*)
4465                         case $cf_add_cflags in
4466                         (-D*)
4467                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4468
4469 CPPFLAGS=`echo "$CPPFLAGS" | \
4470         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4471                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4472
4473                                 ;;
4474                         esac
4475
4476         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4477         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4478
4479                         ;;
4480                 esac
4481                 ;;
4482         (*)
4483
4484         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4485         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4486
4487                 ;;
4488         esac
4489         ;;
4490 (yes)
4491
4492         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4493         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4494
4495         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4496
4497         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4498                 && test -z "${cf_tst_cflags}" \
4499                 && cf_fix_cppflags=no
4500         ;;
4501 esac
4502 done
4503
4504 if test -n "$cf_new_cflags" ; then
4505
4506         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4507         CFLAGS="${CFLAGS}$cf_new_cflags"
4508
4509 fi
4510
4511 if test -n "$cf_new_cppflags" ; then
4512
4513         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4514         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4515
4516 fi
4517
4518 if test -n "$cf_new_extra_cppflags" ; then
4519
4520         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4521         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4522
4523 fi
4524
4525 cf_add_libs="$LIBS"
4526 # reverse order
4527 cf_add_0lib=
4528 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4529 # filter duplicates
4530 for cf_add_1lib in $cf_add_0lib; do
4531         for cf_add_2lib in $cf_add_libs; do
4532                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4533                         cf_add_1lib=
4534                         break
4535                 fi
4536         done
4537         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4538 done
4539 LIBS="$cf_add_libs"
4540
4541                 cat >conftest.$ac_ext <<_ACEOF
4542 #line 4542 "configure"
4543 #include "confdefs.h"
4544 #include <${cf_cv_ncurses_header:-curses.h}>
4545 int
4546 main (void)
4547 {
4548 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4549   ;
4550   return 0;
4551 }
4552 _ACEOF
4553 rm -f conftest.$ac_objext conftest$ac_exeext
4554 if { (eval echo "$as_me:4554: \"$ac_link\"") >&5
4555   (eval $ac_link) 2>&5
4556   ac_status=$?
4557   echo "$as_me:4557: \$? = $ac_status" >&5
4558   (exit $ac_status); } &&
4559          { ac_try='test -s conftest$ac_exeext'
4560   { (eval echo "$as_me:4560: \"$ac_try\"") >&5
4561   (eval $ac_try) 2>&5
4562   ac_status=$?
4563   echo "$as_me:4563: \$? = $ac_status" >&5
4564   (exit $ac_status); }; }; then
4565   if test "$cross_compiling" = yes; then
4566   cf_have_ncuconfig=maybe
4567 else
4568   cat >conftest.$ac_ext <<_ACEOF
4569 #line 4569 "configure"
4570 #include "confdefs.h"
4571 #include <${cf_cv_ncurses_header:-curses.h}>
4572                                 int main(void)
4573                                 { char *xx = curses_version(); return (xx == 0); }
4574 _ACEOF
4575 rm -f conftest$ac_exeext
4576 if { (eval echo "$as_me:4576: \"$ac_link\"") >&5
4577   (eval $ac_link) 2>&5
4578   ac_status=$?
4579   echo "$as_me:4579: \$? = $ac_status" >&5
4580   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4581   { (eval echo "$as_me:4581: \"$ac_try\"") >&5
4582   (eval $ac_try) 2>&5
4583   ac_status=$?
4584   echo "$as_me:4584: \$? = $ac_status" >&5
4585   (exit $ac_status); }; }; then
4586   cf_have_ncuconfig=yes
4587 else
4588   echo "$as_me: program exited with status $ac_status" >&5
4589 echo "$as_me: failed program was:" >&5
4590 cat conftest.$ac_ext >&5
4591 cf_have_ncuconfig=no
4592 fi
4593 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4594 fi
4595 else
4596   echo "$as_me: failed program was:" >&5
4597 cat conftest.$ac_ext >&5
4598 cf_have_ncuconfig=no
4599 fi
4600 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4601                 echo "$as_me:4601: result: $cf_have_ncuconfig" >&5
4602 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4603                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4604                 if test "$cf_have_ncuconfig" != "yes"
4605                 then
4606                         CPPFLAGS="$cf_save_CPPFLAGS"
4607                         LIBS="$cf_save_LIBS"
4608                         NCURSES_CONFIG_PKG=none
4609                 else
4610
4611 cat >>confdefs.h <<\EOF
4612 #define NCURSES 1
4613 EOF
4614
4615                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4616
4617 echo "$as_me:4617: checking for terminfo header" >&5
4618 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4619 if test "${cf_cv_term_header+set}" = set; then
4620   echo $ECHO_N "(cached) $ECHO_C" >&6
4621 else
4622
4623 case ${cf_cv_ncurses_header} in
4624 (*/ncurses.h|*/ncursesw.h)
4625         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4626         ;;
4627 (*)
4628         cf_term_header=term.h
4629         ;;
4630 esac
4631
4632 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4633 do
4634 cat >conftest.$ac_ext <<_ACEOF
4635 #line 4635 "configure"
4636 #include "confdefs.h"
4637 #include <stdio.h>
4638 #include <${cf_cv_ncurses_header:-curses.h}>
4639 #include <$cf_test>
4640
4641 int
4642 main (void)
4643 {
4644 int x = auto_left_margin; (void)x
4645   ;
4646   return 0;
4647 }
4648 _ACEOF
4649 rm -f conftest.$ac_objext
4650 if { (eval echo "$as_me:4650: \"$ac_compile\"") >&5
4651   (eval $ac_compile) 2>&5
4652   ac_status=$?
4653   echo "$as_me:4653: \$? = $ac_status" >&5
4654   (exit $ac_status); } &&
4655          { ac_try='test -s conftest.$ac_objext'
4656   { (eval echo "$as_me:4656: \"$ac_try\"") >&5
4657   (eval $ac_try) 2>&5
4658   ac_status=$?
4659   echo "$as_me:4659: \$? = $ac_status" >&5
4660   (exit $ac_status); }; }; then
4661
4662         cf_cv_term_header="$cf_test"
4663 else
4664   echo "$as_me: failed program was:" >&5
4665 cat conftest.$ac_ext >&5
4666
4667         cf_cv_term_header=unknown
4668
4669 fi
4670 rm -f conftest.$ac_objext conftest.$ac_ext
4671         test "$cf_cv_term_header" != unknown && break
4672 done
4673
4674 fi
4675 echo "$as_me:4675: result: $cf_cv_term_header" >&5
4676 echo "${ECHO_T}$cf_cv_term_header" >&6
4677
4678 # Set definitions to allow ifdef'ing to accommodate subdirectories
4679
4680 case $cf_cv_term_header in
4681 (*term.h)
4682
4683 cat >>confdefs.h <<\EOF
4684 #define HAVE_TERM_H 1
4685 EOF
4686
4687         ;;
4688 esac
4689
4690 case $cf_cv_term_header in
4691 (ncurses/term.h)
4692
4693 cat >>confdefs.h <<\EOF
4694 #define HAVE_NCURSES_TERM_H 1
4695 EOF
4696
4697         ;;
4698 (ncursesw/term.h)
4699
4700 cat >>confdefs.h <<\EOF
4701 #define HAVE_NCURSESW_TERM_H 1
4702 EOF
4703
4704         ;;
4705 esac
4706
4707                 fi
4708
4709         else
4710                 echo "$as_me:4710: result: no" >&5
4711 echo "${ECHO_T}no" >&6
4712                 NCURSES_CONFIG_PKG=none
4713         fi
4714 else
4715         NCURSES_CONFIG_PKG=none
4716 fi
4717
4718 if test "x$cf_have_ncuconfig" = "xno"; then
4719         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4720
4721 if test -n "$ac_tool_prefix"; then
4722   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4723   do
4724     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4725 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4726 echo "$as_me:4726: checking for $ac_word" >&5
4727 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4728 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4729   echo $ECHO_N "(cached) $ECHO_C" >&6
4730 else
4731   if test -n "$NCURSES_CONFIG"; then
4732   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4733 else
4734   ac_save_IFS=$IFS; IFS=$ac_path_separator
4735 ac_dummy="$PATH"
4736 for ac_dir in $ac_dummy; do
4737   IFS=$ac_save_IFS
4738   test -z "$ac_dir" && ac_dir=.
4739   $as_executable_p "$ac_dir/$ac_word" || continue
4740 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4741 echo "$as_me:4741: found $ac_dir/$ac_word" >&5
4742 break
4743 done
4744
4745 fi
4746 fi
4747 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4748 if test -n "$NCURSES_CONFIG"; then
4749   echo "$as_me:4749: result: $NCURSES_CONFIG" >&5
4750 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4751 else
4752   echo "$as_me:4752: result: no" >&5
4753 echo "${ECHO_T}no" >&6
4754 fi
4755
4756     test -n "$NCURSES_CONFIG" && break
4757   done
4758 fi
4759 if test -z "$NCURSES_CONFIG"; then
4760   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4761   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4762 do
4763   # Extract the first word of "$ac_prog", so it can be a program name with args.
4764 set dummy $ac_prog; ac_word=$2
4765 echo "$as_me:4765: checking for $ac_word" >&5
4766 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4767 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4768   echo $ECHO_N "(cached) $ECHO_C" >&6
4769 else
4770   if test -n "$ac_ct_NCURSES_CONFIG"; then
4771   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4772 else
4773   ac_save_IFS=$IFS; IFS=$ac_path_separator
4774 ac_dummy="$PATH"
4775 for ac_dir in $ac_dummy; do
4776   IFS=$ac_save_IFS
4777   test -z "$ac_dir" && ac_dir=.
4778   $as_executable_p "$ac_dir/$ac_word" || continue
4779 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4780 echo "$as_me:4780: found $ac_dir/$ac_word" >&5
4781 break
4782 done
4783
4784 fi
4785 fi
4786 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4787 if test -n "$ac_ct_NCURSES_CONFIG"; then
4788   echo "$as_me:4788: result: $ac_ct_NCURSES_CONFIG" >&5
4789 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4790 else
4791   echo "$as_me:4791: result: no" >&5
4792 echo "${ECHO_T}no" >&6
4793 fi
4794
4795   test -n "$ac_ct_NCURSES_CONFIG" && break
4796 done
4797 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4798
4799   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4800 fi
4801
4802         if test "$NCURSES_CONFIG" != none ; then
4803
4804 cf_fix_cppflags=no
4805 cf_new_cflags=
4806 cf_new_cppflags=
4807 cf_new_extra_cppflags=
4808
4809 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4810 do
4811 case $cf_fix_cppflags in
4812 (no)
4813         case $cf_add_cflags in
4814         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4815                 case $cf_add_cflags in
4816                 (-D*)
4817                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4818
4819                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4820                                 && test -z "${cf_tst_cflags}" \
4821                                 && cf_fix_cppflags=yes
4822
4823                         if test $cf_fix_cppflags = yes ; then
4824
4825         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4826         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4827
4828                                 continue
4829                         elif test "${cf_tst_cflags}" = "\"'" ; then
4830
4831         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4832         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4833
4834                                 continue
4835                         fi
4836                         ;;
4837                 esac
4838                 case "$CPPFLAGS" in
4839                 (*$cf_add_cflags)
4840                         ;;
4841                 (*)
4842                         case $cf_add_cflags in
4843                         (-D*)
4844                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4845
4846 CPPFLAGS=`echo "$CPPFLAGS" | \
4847         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4848                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4849
4850                                 ;;
4851                         esac
4852
4853         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4854         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4855
4856                         ;;
4857                 esac
4858                 ;;
4859         (*)
4860
4861         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4862         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4863
4864                 ;;
4865         esac
4866         ;;
4867 (yes)
4868
4869         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4870         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4871
4872         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4873
4874         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4875                 && test -z "${cf_tst_cflags}" \
4876                 && cf_fix_cppflags=no
4877         ;;
4878 esac
4879 done
4880
4881 if test -n "$cf_new_cflags" ; then
4882
4883         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4884         CFLAGS="${CFLAGS}$cf_new_cflags"
4885
4886 fi
4887
4888 if test -n "$cf_new_cppflags" ; then
4889
4890         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4891         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4892
4893 fi
4894
4895 if test -n "$cf_new_extra_cppflags" ; then
4896
4897         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4898         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4899
4900 fi
4901
4902 cf_add_libs="$LIBS"
4903 # reverse order
4904 cf_add_0lib=
4905 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4906 # filter duplicates
4907 for cf_add_1lib in $cf_add_0lib; do
4908         for cf_add_2lib in $cf_add_libs; do
4909                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4910                         cf_add_1lib=
4911                         break
4912                 fi
4913         done
4914         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4915 done
4916 LIBS="$cf_add_libs"
4917
4918                 # even with config script, some packages use no-override for curses.h
4919
4920 echo "$as_me:4920: checking if we have identified curses headers" >&5
4921 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4922 if test "${cf_cv_ncurses_header+set}" = set; then
4923   echo $ECHO_N "(cached) $ECHO_C" >&6
4924 else
4925
4926 cf_cv_ncurses_header=none
4927 for cf_header in \
4928         ncurses.h ncurses/ncurses.h \
4929         curses.h ncurses/curses.h
4930 do
4931 cat >conftest.$ac_ext <<_ACEOF
4932 #line 4932 "configure"
4933 #include "confdefs.h"
4934 #include <${cf_header}>
4935 int
4936 main (void)
4937 {
4938 initscr(); tgoto("?", 0,0)
4939   ;
4940   return 0;
4941 }
4942 _ACEOF
4943 rm -f conftest.$ac_objext
4944 if { (eval echo "$as_me:4944: \"$ac_compile\"") >&5
4945   (eval $ac_compile) 2>&5
4946   ac_status=$?
4947   echo "$as_me:4947: \$? = $ac_status" >&5
4948   (exit $ac_status); } &&
4949          { ac_try='test -s conftest.$ac_objext'
4950   { (eval echo "$as_me:4950: \"$ac_try\"") >&5
4951   (eval $ac_try) 2>&5
4952   ac_status=$?
4953   echo "$as_me:4953: \$? = $ac_status" >&5
4954   (exit $ac_status); }; }; then
4955   cf_cv_ncurses_header=$cf_header; break
4956 else
4957   echo "$as_me: failed program was:" >&5
4958 cat conftest.$ac_ext >&5
4959 fi
4960 rm -f conftest.$ac_objext conftest.$ac_ext
4961 done
4962
4963 fi
4964 echo "$as_me:4964: result: $cf_cv_ncurses_header" >&5
4965 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4966
4967 if test "$cf_cv_ncurses_header" = none ; then
4968         { { echo "$as_me:4968: error: No curses header-files found" >&5
4969 echo "$as_me: error: No curses header-files found" >&2;}
4970    { (exit 1); exit 1; }; }
4971 fi
4972
4973 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4974
4975 for ac_header in $cf_cv_ncurses_header
4976 do
4977 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4978 echo "$as_me:4978: checking for $ac_header" >&5
4979 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4980 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4981   echo $ECHO_N "(cached) $ECHO_C" >&6
4982 else
4983   cat >conftest.$ac_ext <<_ACEOF
4984 #line 4984 "configure"
4985 #include "confdefs.h"
4986 #include <$ac_header>
4987 _ACEOF
4988 if { (eval echo "$as_me:4988: \"$ac_cpp conftest.$ac_ext\"") >&5
4989   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4990   ac_status=$?
4991   egrep -v '^ *\+' conftest.er1 >conftest.err
4992   rm -f conftest.er1
4993   cat conftest.err >&5
4994   echo "$as_me:4994: \$? = $ac_status" >&5
4995   (exit $ac_status); } >/dev/null; then
4996   if test -s conftest.err; then
4997     ac_cpp_err=$ac_c_preproc_warn_flag
4998   else
4999     ac_cpp_err=
5000   fi
5001 else
5002   ac_cpp_err=yes
5003 fi
5004 if test -z "$ac_cpp_err"; then
5005   eval "$as_ac_Header=yes"
5006 else
5007   echo "$as_me: failed program was:" >&5
5008   cat conftest.$ac_ext >&5
5009   eval "$as_ac_Header=no"
5010 fi
5011 rm -f conftest.err conftest.$ac_ext
5012 fi
5013 echo "$as_me:5013: result: `eval echo '${'$as_ac_Header'}'`" >&5
5014 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5015 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5016   cat >>confdefs.h <<EOF
5017 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5018 EOF
5019
5020 fi
5021 done
5022
5023 cat >>confdefs.h <<\EOF
5024 #define NCURSES 1
5025 EOF
5026
5027 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5028
5029                 cat >>confdefs.h <<EOF
5030 #define $cf_nculib_ROOT 1
5031 EOF
5032
5033                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5034
5035         else
5036
5037 cf_ncuhdr_root=ncurses
5038
5039 test -n "$cf_cv_curses_dir" && \
5040 test "$cf_cv_curses_dir" != "no" && { \
5041
5042 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5043   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5044   do
5045         while test $cf_add_incdir != /usr/include
5046         do
5047           if test -d $cf_add_incdir
5048           then
5049                 cf_have_incdir=no
5050                 if test -n "$CFLAGS$CPPFLAGS" ; then
5051                   # a loop is needed to ensure we can add subdirs of existing dirs
5052                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5053                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5054                           cf_have_incdir=yes; break
5055                         fi
5056                   done
5057                 fi
5058
5059                 if test "$cf_have_incdir" = no ; then
5060                   if test "$cf_add_incdir" = /usr/local/include ; then
5061                         if test "$GCC" = yes
5062                         then
5063                           cf_save_CPPFLAGS=$CPPFLAGS
5064
5065         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5066         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5067
5068                           cat >conftest.$ac_ext <<_ACEOF
5069 #line 5069 "configure"
5070 #include "confdefs.h"
5071 #include <stdio.h>
5072 int
5073 main (void)
5074 {
5075 printf("Hello")
5076   ;
5077   return 0;
5078 }
5079 _ACEOF
5080 rm -f conftest.$ac_objext
5081 if { (eval echo "$as_me:5081: \"$ac_compile\"") >&5
5082   (eval $ac_compile) 2>&5
5083   ac_status=$?
5084   echo "$as_me:5084: \$? = $ac_status" >&5
5085   (exit $ac_status); } &&
5086          { ac_try='test -s conftest.$ac_objext'
5087   { (eval echo "$as_me:5087: \"$ac_try\"") >&5
5088   (eval $ac_try) 2>&5
5089   ac_status=$?
5090   echo "$as_me:5090: \$? = $ac_status" >&5
5091   (exit $ac_status); }; }; then
5092   :
5093 else
5094   echo "$as_me: failed program was:" >&5
5095 cat conftest.$ac_ext >&5
5096 cf_have_incdir=yes
5097 fi
5098 rm -f conftest.$ac_objext conftest.$ac_ext
5099                           CPPFLAGS=$cf_save_CPPFLAGS
5100                         fi
5101                   fi
5102                 fi
5103
5104                 if test "$cf_have_incdir" = no ; then
5105                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5106
5107 echo "${as_me:-configure}:5107: testing adding $cf_add_incdir to include-path ..." 1>&5
5108
5109                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5110
5111                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5112                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5113                   cf_add_incdir="$cf_top_incdir"
5114                 else
5115                   break
5116                 fi
5117           else
5118                 break
5119           fi
5120         done
5121   done
5122 fi
5123
5124 }
5125
5126 echo "$as_me:5126: checking for $cf_ncuhdr_root header in include-path" >&5
5127 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5128 if test "${cf_cv_ncurses_h+set}" = set; then
5129   echo $ECHO_N "(cached) $ECHO_C" >&6
5130 else
5131
5132         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5133         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5134         for cf_header in $cf_header_list
5135         do
5136
5137         cat >conftest.$ac_ext <<_ACEOF
5138 #line 5138 "configure"
5139 #include "confdefs.h"
5140
5141 #include <$cf_header>
5142 int
5143 main (void)
5144 {
5145
5146 #ifdef NCURSES_VERSION
5147
5148 printf("%s\n", NCURSES_VERSION);
5149 #else
5150 #ifdef __NCURSES_H
5151 printf("old\n");
5152 #else
5153         make an error
5154 #endif
5155 #endif
5156
5157   ;
5158   return 0;
5159 }
5160 _ACEOF
5161 rm -f conftest.$ac_objext
5162 if { (eval echo "$as_me:5162: \"$ac_compile\"") >&5
5163   (eval $ac_compile) 2>&5
5164   ac_status=$?
5165   echo "$as_me:5165: \$? = $ac_status" >&5
5166   (exit $ac_status); } &&
5167          { ac_try='test -s conftest.$ac_objext'
5168   { (eval echo "$as_me:5168: \"$ac_try\"") >&5
5169   (eval $ac_try) 2>&5
5170   ac_status=$?
5171   echo "$as_me:5171: \$? = $ac_status" >&5
5172   (exit $ac_status); }; }; then
5173   cf_cv_ncurses_h=$cf_header
5174
5175 else
5176   echo "$as_me: failed program was:" >&5
5177 cat conftest.$ac_ext >&5
5178 cf_cv_ncurses_h=no
5179 fi
5180 rm -f conftest.$ac_objext conftest.$ac_ext
5181
5182                 test "$cf_cv_ncurses_h" != no && break
5183         done
5184
5185 fi
5186 echo "$as_me:5186: result: $cf_cv_ncurses_h" >&5
5187 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5188
5189 if test "$cf_cv_ncurses_h" != no ; then
5190         cf_cv_ncurses_header=$cf_cv_ncurses_h
5191 else
5192
5193 echo "$as_me:5193: checking for $cf_ncuhdr_root include-path" >&5
5194 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5195 if test "${cf_cv_ncurses_h2+set}" = set; then
5196   echo $ECHO_N "(cached) $ECHO_C" >&6
5197 else
5198
5199         test -n "$verbose" && echo
5200
5201 cf_search=
5202
5203 # collect the current set of include-directories from compiler flags
5204 cf_header_path_list=""
5205 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5206         for cf_header_path in $CPPFLAGS $CFLAGS
5207         do
5208                 case $cf_header_path in
5209                 (-I*)
5210                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5211
5212 test "x$cf_header_path" != "xNONE" && \
5213 test -d "$cf_header_path" && \
5214  {
5215         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5216         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5217         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5218         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5219         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5220         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5221 }
5222
5223                         cf_header_path_list="$cf_header_path_list $cf_search"
5224                         ;;
5225                 esac
5226         done
5227 fi
5228
5229 # add the variations for the package we are looking for
5230
5231 cf_search=
5232
5233 test "x$prefix" != "xNONE" && \
5234 test -d "$prefix" && \
5235  {
5236         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5237         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5238         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5239         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5240         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5241         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5242 }
5243
5244 for cf_subdir_prefix in \
5245         /usr \
5246         /usr/local \
5247         /usr/pkg \
5248         /opt \
5249         /opt/local \
5250         $HOME
5251 do
5252
5253 test "x$cf_subdir_prefix" != "x$prefix" && \
5254 test -d "$cf_subdir_prefix" && \
5255 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5256         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5257         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5258         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5259         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5260         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5261         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5262 }
5263
5264 done
5265
5266 test "$includedir" != NONE && \
5267 test "$includedir" != "/usr/include" && \
5268 test -d "$includedir" && {
5269         test -d $includedir &&    cf_search="$cf_search $includedir"
5270         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5271 }
5272
5273 test "$oldincludedir" != NONE && \
5274 test "$oldincludedir" != "/usr/include" && \
5275 test -d "$oldincludedir" && {
5276         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5277         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5278 }
5279
5280 cf_search="$cf_search $cf_header_path_list"
5281
5282         test -n "$verbose" && echo search path $cf_search
5283         cf_save2_CPPFLAGS="$CPPFLAGS"
5284         for cf_incdir in $cf_search
5285         do
5286
5287 if test -n "$cf_incdir" ; then
5288   for cf_add_incdir in $cf_incdir
5289   do
5290         while test $cf_add_incdir != /usr/include
5291         do
5292           if test -d $cf_add_incdir
5293           then
5294                 cf_have_incdir=no
5295                 if test -n "$CFLAGS$CPPFLAGS" ; then
5296                   # a loop is needed to ensure we can add subdirs of existing dirs
5297                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5298                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5299                           cf_have_incdir=yes; break
5300                         fi
5301                   done
5302                 fi
5303
5304                 if test "$cf_have_incdir" = no ; then
5305                   if test "$cf_add_incdir" = /usr/local/include ; then
5306                         if test "$GCC" = yes
5307                         then
5308                           cf_save_CPPFLAGS=$CPPFLAGS
5309
5310         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5311         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5312
5313                           cat >conftest.$ac_ext <<_ACEOF
5314 #line 5314 "configure"
5315 #include "confdefs.h"
5316 #include <stdio.h>
5317 int
5318 main (void)
5319 {
5320 printf("Hello")
5321   ;
5322   return 0;
5323 }
5324 _ACEOF
5325 rm -f conftest.$ac_objext
5326 if { (eval echo "$as_me:5326: \"$ac_compile\"") >&5
5327   (eval $ac_compile) 2>&5
5328   ac_status=$?
5329   echo "$as_me:5329: \$? = $ac_status" >&5
5330   (exit $ac_status); } &&
5331          { ac_try='test -s conftest.$ac_objext'
5332   { (eval echo "$as_me:5332: \"$ac_try\"") >&5
5333   (eval $ac_try) 2>&5
5334   ac_status=$?
5335   echo "$as_me:5335: \$? = $ac_status" >&5
5336   (exit $ac_status); }; }; then
5337   :
5338 else
5339   echo "$as_me: failed program was:" >&5
5340 cat conftest.$ac_ext >&5
5341 cf_have_incdir=yes
5342 fi
5343 rm -f conftest.$ac_objext conftest.$ac_ext
5344                           CPPFLAGS=$cf_save_CPPFLAGS
5345                         fi
5346                   fi
5347                 fi
5348
5349                 if test "$cf_have_incdir" = no ; then
5350                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5351
5352 echo "${as_me:-configure}:5352: testing adding $cf_add_incdir to include-path ..." 1>&5
5353
5354                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5355
5356                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5357                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5358                   cf_add_incdir="$cf_top_incdir"
5359                 else
5360                   break
5361                 fi
5362           else
5363                 break
5364           fi
5365         done
5366   done
5367 fi
5368
5369                 for cf_header in \
5370                         ncurses.h \
5371                         curses.h
5372                 do
5373
5374         cat >conftest.$ac_ext <<_ACEOF
5375 #line 5375 "configure"
5376 #include "confdefs.h"
5377
5378 #include <$cf_header>
5379 int
5380 main (void)
5381 {
5382
5383 #ifdef NCURSES_VERSION
5384
5385 printf("%s\n", NCURSES_VERSION);
5386 #else
5387 #ifdef __NCURSES_H
5388 printf("old\n");
5389 #else
5390         make an error
5391 #endif
5392 #endif
5393
5394   ;
5395   return 0;
5396 }
5397 _ACEOF
5398 rm -f conftest.$ac_objext
5399 if { (eval echo "$as_me:5399: \"$ac_compile\"") >&5
5400   (eval $ac_compile) 2>&5
5401   ac_status=$?
5402   echo "$as_me:5402: \$? = $ac_status" >&5
5403   (exit $ac_status); } &&
5404          { ac_try='test -s conftest.$ac_objext'
5405   { (eval echo "$as_me:5405: \"$ac_try\"") >&5
5406   (eval $ac_try) 2>&5
5407   ac_status=$?
5408   echo "$as_me:5408: \$? = $ac_status" >&5
5409   (exit $ac_status); }; }; then
5410   cf_cv_ncurses_h2=$cf_header
5411
5412 else
5413   echo "$as_me: failed program was:" >&5
5414 cat conftest.$ac_ext >&5
5415 cf_cv_ncurses_h2=no
5416 fi
5417 rm -f conftest.$ac_objext conftest.$ac_ext
5418
5419                         if test "$cf_cv_ncurses_h2" != no ; then
5420                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5421                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5422                                 break
5423                         fi
5424                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5425                 done
5426                 CPPFLAGS="$cf_save2_CPPFLAGS"
5427                 test "$cf_cv_ncurses_h2" != no && break
5428         done
5429         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5429: error: not found" >&5
5430 echo "$as_me: error: not found" >&2;}
5431    { (exit 1); exit 1; }; }
5432
5433 fi
5434 echo "$as_me:5434: result: $cf_cv_ncurses_h2" >&5
5435 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5436
5437         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5438         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5439         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5440                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5441         fi
5442
5443 if test -n "$cf_1st_incdir" ; then
5444   for cf_add_incdir in $cf_1st_incdir
5445   do
5446         while test $cf_add_incdir != /usr/include
5447         do
5448           if test -d $cf_add_incdir
5449           then
5450                 cf_have_incdir=no
5451                 if test -n "$CFLAGS$CPPFLAGS" ; then
5452                   # a loop is needed to ensure we can add subdirs of existing dirs
5453                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5454                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5455                           cf_have_incdir=yes; break
5456                         fi
5457                   done
5458                 fi
5459
5460                 if test "$cf_have_incdir" = no ; then
5461                   if test "$cf_add_incdir" = /usr/local/include ; then
5462                         if test "$GCC" = yes
5463                         then
5464                           cf_save_CPPFLAGS=$CPPFLAGS
5465
5466         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5467         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5468
5469                           cat >conftest.$ac_ext <<_ACEOF
5470 #line 5470 "configure"
5471 #include "confdefs.h"
5472 #include <stdio.h>
5473 int
5474 main (void)
5475 {
5476 printf("Hello")
5477   ;
5478   return 0;
5479 }
5480 _ACEOF
5481 rm -f conftest.$ac_objext
5482 if { (eval echo "$as_me:5482: \"$ac_compile\"") >&5
5483   (eval $ac_compile) 2>&5
5484   ac_status=$?
5485   echo "$as_me:5485: \$? = $ac_status" >&5
5486   (exit $ac_status); } &&
5487          { ac_try='test -s conftest.$ac_objext'
5488   { (eval echo "$as_me:5488: \"$ac_try\"") >&5
5489   (eval $ac_try) 2>&5
5490   ac_status=$?
5491   echo "$as_me:5491: \$? = $ac_status" >&5
5492   (exit $ac_status); }; }; then
5493   :
5494 else
5495   echo "$as_me: failed program was:" >&5
5496 cat conftest.$ac_ext >&5
5497 cf_have_incdir=yes
5498 fi
5499 rm -f conftest.$ac_objext conftest.$ac_ext
5500                           CPPFLAGS=$cf_save_CPPFLAGS
5501                         fi
5502                   fi
5503                 fi
5504
5505                 if test "$cf_have_incdir" = no ; then
5506                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5507
5508 echo "${as_me:-configure}:5508: testing adding $cf_add_incdir to include-path ..." 1>&5
5509
5510                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5511
5512                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5513                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5514                   cf_add_incdir="$cf_top_incdir"
5515                 else
5516                   break
5517                 fi
5518           else
5519                 break
5520           fi
5521         done
5522   done
5523 fi
5524
5525 fi
5526
5527 # Set definitions to allow ifdef'ing for ncurses.h
5528
5529 case $cf_cv_ncurses_header in
5530 (*ncurses.h)
5531
5532 cat >>confdefs.h <<\EOF
5533 #define HAVE_NCURSES_H 1
5534 EOF
5535
5536         ;;
5537 esac
5538
5539 case $cf_cv_ncurses_header in
5540 (ncurses/curses.h|ncurses/ncurses.h)
5541
5542 cat >>confdefs.h <<\EOF
5543 #define HAVE_NCURSES_NCURSES_H 1
5544 EOF
5545
5546         ;;
5547 (ncursesw/curses.h|ncursesw/ncurses.h)
5548
5549 cat >>confdefs.h <<\EOF
5550 #define HAVE_NCURSESW_NCURSES_H 1
5551 EOF
5552
5553         ;;
5554 esac
5555
5556 echo "$as_me:5556: checking for terminfo header" >&5
5557 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5558 if test "${cf_cv_term_header+set}" = set; then
5559   echo $ECHO_N "(cached) $ECHO_C" >&6
5560 else
5561
5562 case ${cf_cv_ncurses_header} in
5563 (*/ncurses.h|*/ncursesw.h)
5564         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5565         ;;
5566 (*)
5567         cf_term_header=term.h
5568         ;;
5569 esac
5570
5571 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5572 do
5573 cat >conftest.$ac_ext <<_ACEOF
5574 #line 5574 "configure"
5575 #include "confdefs.h"
5576 #include <stdio.h>
5577 #include <${cf_cv_ncurses_header:-curses.h}>
5578 #include <$cf_test>
5579
5580 int
5581 main (void)
5582 {
5583 int x = auto_left_margin; (void)x
5584   ;
5585   return 0;
5586 }
5587 _ACEOF
5588 rm -f conftest.$ac_objext
5589 if { (eval echo "$as_me:5589: \"$ac_compile\"") >&5
5590   (eval $ac_compile) 2>&5
5591   ac_status=$?
5592   echo "$as_me:5592: \$? = $ac_status" >&5
5593   (exit $ac_status); } &&
5594          { ac_try='test -s conftest.$ac_objext'
5595   { (eval echo "$as_me:5595: \"$ac_try\"") >&5
5596   (eval $ac_try) 2>&5
5597   ac_status=$?
5598   echo "$as_me:5598: \$? = $ac_status" >&5
5599   (exit $ac_status); }; }; then
5600
5601         cf_cv_term_header="$cf_test"
5602 else
5603   echo "$as_me: failed program was:" >&5
5604 cat conftest.$ac_ext >&5
5605
5606         cf_cv_term_header=unknown
5607
5608 fi
5609 rm -f conftest.$ac_objext conftest.$ac_ext
5610         test "$cf_cv_term_header" != unknown && break
5611 done
5612
5613 fi
5614 echo "$as_me:5614: result: $cf_cv_term_header" >&5
5615 echo "${ECHO_T}$cf_cv_term_header" >&6
5616
5617 # Set definitions to allow ifdef'ing to accommodate subdirectories
5618
5619 case $cf_cv_term_header in
5620 (*term.h)
5621
5622 cat >>confdefs.h <<\EOF
5623 #define HAVE_TERM_H 1
5624 EOF
5625
5626         ;;
5627 esac
5628
5629 case $cf_cv_term_header in
5630 (ncurses/term.h)
5631
5632 cat >>confdefs.h <<\EOF
5633 #define HAVE_NCURSES_TERM_H 1
5634 EOF
5635
5636         ;;
5637 (ncursesw/term.h)
5638
5639 cat >>confdefs.h <<\EOF
5640 #define HAVE_NCURSESW_TERM_H 1
5641 EOF
5642
5643         ;;
5644 esac
5645
5646 # some applications need this, but should check for NCURSES_VERSION
5647
5648 cat >>confdefs.h <<\EOF
5649 #define NCURSES 1
5650 EOF
5651
5652 echo "$as_me:5652: checking for ncurses version" >&5
5653 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5654 if test "${cf_cv_ncurses_version+set}" = set; then
5655   echo $ECHO_N "(cached) $ECHO_C" >&6
5656 else
5657
5658         cf_cv_ncurses_version=no
5659         cf_tempfile=out$$
5660         rm -f $cf_tempfile
5661         if test "$cross_compiling" = yes; then
5662
5663         # This will not work if the preprocessor splits the line after the
5664         # Autoconf token.  The 'unproto' program does that.
5665         cat > conftest.$ac_ext <<EOF
5666 #include <${cf_cv_ncurses_header:-curses.h}>
5667 #undef Autoconf
5668 #ifdef NCURSES_VERSION
5669 Autoconf NCURSES_VERSION
5670 #else
5671 #ifdef __NCURSES_H
5672 Autoconf "old"
5673 #endif
5674 ;
5675 #endif
5676 EOF
5677         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5678         { (eval echo "$as_me:5678: \"$cf_try\"") >&5
5679   (eval $cf_try) 2>&5
5680   ac_status=$?
5681   echo "$as_me:5681: \$? = $ac_status" >&5
5682   (exit $ac_status); }
5683         if test -f conftest.out ; then
5684                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5685                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5686                 rm -f conftest.out
5687         fi
5688
5689 else
5690   cat >conftest.$ac_ext <<_ACEOF
5691 #line 5691 "configure"
5692 #include "confdefs.h"
5693
5694 #include <${cf_cv_ncurses_header:-curses.h}>
5695 #include <stdio.h>
5696 int main(void)
5697 {
5698         FILE *fp = fopen("$cf_tempfile", "w");
5699 #ifdef NCURSES_VERSION
5700 # ifdef NCURSES_VERSION_PATCH
5701         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5702 # else
5703         fprintf(fp, "%s\n", NCURSES_VERSION);
5704 # endif
5705 #else
5706 # ifdef __NCURSES_H
5707         fprintf(fp, "old\n");
5708 # else
5709         make an error
5710 # endif
5711 #endif
5712         ${cf_cv_main_return:-return}(0);
5713 }
5714 _ACEOF
5715 rm -f conftest$ac_exeext
5716 if { (eval echo "$as_me:5716: \"$ac_link\"") >&5
5717   (eval $ac_link) 2>&5
5718   ac_status=$?
5719   echo "$as_me:5719: \$? = $ac_status" >&5
5720   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5721   { (eval echo "$as_me:5721: \"$ac_try\"") >&5
5722   (eval $ac_try) 2>&5
5723   ac_status=$?
5724   echo "$as_me:5724: \$? = $ac_status" >&5
5725   (exit $ac_status); }; }; then
5726
5727         cf_cv_ncurses_version=`cat $cf_tempfile`
5728 else
5729   echo "$as_me: program exited with status $ac_status" >&5
5730 echo "$as_me: failed program was:" >&5
5731 cat conftest.$ac_ext >&5
5732 fi
5733 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5734 fi
5735         rm -f $cf_tempfile
5736
5737 fi
5738 echo "$as_me:5738: result: $cf_cv_ncurses_version" >&5
5739 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5740 test "$cf_cv_ncurses_version" = no ||
5741 cat >>confdefs.h <<\EOF
5742 #define NCURSES 1
5743 EOF
5744
5745 cf_nculib_root=ncurses
5746         # This works, except for the special case where we find gpm, but
5747         # ncurses is in a nonstandard location via $LIBS, and we really want
5748         # to link gpm.
5749 cf_ncurses_LIBS=""
5750 cf_ncurses_SAVE="$LIBS"
5751 echo "$as_me:5751: checking for Gpm_Open in -lgpm" >&5
5752 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5753 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5754   echo $ECHO_N "(cached) $ECHO_C" >&6
5755 else
5756   ac_check_lib_save_LIBS=$LIBS
5757 LIBS="-lgpm  $LIBS"
5758 cat >conftest.$ac_ext <<_ACEOF
5759 #line 5759 "configure"
5760 #include "confdefs.h"
5761
5762 /* Override any gcc2 internal prototype to avoid an error.  */
5763 #ifdef __cplusplus
5764 extern "C"
5765 #endif
5766 /* We use char because int might match the return type of a gcc2
5767    builtin and then its argument prototype would still apply.  */
5768 char Gpm_Open ();
5769 int
5770 main (void)
5771 {
5772 Gpm_Open ();
5773   ;
5774   return 0;
5775 }
5776 _ACEOF
5777 rm -f conftest.$ac_objext conftest$ac_exeext
5778 if { (eval echo "$as_me:5778: \"$ac_link\"") >&5
5779   (eval $ac_link) 2>&5
5780   ac_status=$?
5781   echo "$as_me:5781: \$? = $ac_status" >&5
5782   (exit $ac_status); } &&
5783          { ac_try='test -s conftest$ac_exeext'
5784   { (eval echo "$as_me:5784: \"$ac_try\"") >&5
5785   (eval $ac_try) 2>&5
5786   ac_status=$?
5787   echo "$as_me:5787: \$? = $ac_status" >&5
5788   (exit $ac_status); }; }; then
5789   ac_cv_lib_gpm_Gpm_Open=yes
5790 else
5791   echo "$as_me: failed program was:" >&5
5792 cat conftest.$ac_ext >&5
5793 ac_cv_lib_gpm_Gpm_Open=no
5794 fi
5795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5796 LIBS=$ac_check_lib_save_LIBS
5797 fi
5798 echo "$as_me:5798: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5799 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5800 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5801   echo "$as_me:5801: checking for initscr in -lgpm" >&5
5802 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5803 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5804   echo $ECHO_N "(cached) $ECHO_C" >&6
5805 else
5806   ac_check_lib_save_LIBS=$LIBS
5807 LIBS="-lgpm  $LIBS"
5808 cat >conftest.$ac_ext <<_ACEOF
5809 #line 5809 "configure"
5810 #include "confdefs.h"
5811
5812 /* Override any gcc2 internal prototype to avoid an error.  */
5813 #ifdef __cplusplus
5814 extern "C"
5815 #endif
5816 /* We use char because int might match the return type of a gcc2
5817    builtin and then its argument prototype would still apply.  */
5818 char initscr ();
5819 int
5820 main (void)
5821 {
5822 initscr ();
5823   ;
5824   return 0;
5825 }
5826 _ACEOF
5827 rm -f conftest.$ac_objext conftest$ac_exeext
5828 if { (eval echo "$as_me:5828: \"$ac_link\"") >&5
5829   (eval $ac_link) 2>&5
5830   ac_status=$?
5831   echo "$as_me:5831: \$? = $ac_status" >&5
5832   (exit $ac_status); } &&
5833          { ac_try='test -s conftest$ac_exeext'
5834   { (eval echo "$as_me:5834: \"$ac_try\"") >&5
5835   (eval $ac_try) 2>&5
5836   ac_status=$?
5837   echo "$as_me:5837: \$? = $ac_status" >&5
5838   (exit $ac_status); }; }; then
5839   ac_cv_lib_gpm_initscr=yes
5840 else
5841   echo "$as_me: failed program was:" >&5
5842 cat conftest.$ac_ext >&5
5843 ac_cv_lib_gpm_initscr=no
5844 fi
5845 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5846 LIBS=$ac_check_lib_save_LIBS
5847 fi
5848 echo "$as_me:5848: result: $ac_cv_lib_gpm_initscr" >&5
5849 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5850 if test $ac_cv_lib_gpm_initscr = yes; then
5851   LIBS="$cf_ncurses_SAVE"
5852 else
5853   cf_ncurses_LIBS="-lgpm"
5854 fi
5855
5856 fi
5857
5858 case $host_os in
5859 (freebsd*)
5860         # This is only necessary if you are linking against an obsolete
5861         # version of ncurses (but it should do no harm, since it's static).
5862         if test "$cf_nculib_root" = ncurses ; then
5863                 echo "$as_me:5863: checking for tgoto in -lmytinfo" >&5
5864 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5865 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5866   echo $ECHO_N "(cached) $ECHO_C" >&6
5867 else
5868   ac_check_lib_save_LIBS=$LIBS
5869 LIBS="-lmytinfo  $LIBS"
5870 cat >conftest.$ac_ext <<_ACEOF
5871 #line 5871 "configure"
5872 #include "confdefs.h"
5873
5874 /* Override any gcc2 internal prototype to avoid an error.  */
5875 #ifdef __cplusplus
5876 extern "C"
5877 #endif
5878 /* We use char because int might match the return type of a gcc2
5879    builtin and then its argument prototype would still apply.  */
5880 char tgoto ();
5881 int
5882 main (void)
5883 {
5884 tgoto ();
5885   ;
5886   return 0;
5887 }
5888 _ACEOF
5889 rm -f conftest.$ac_objext conftest$ac_exeext
5890 if { (eval echo "$as_me:5890: \"$ac_link\"") >&5
5891   (eval $ac_link) 2>&5
5892   ac_status=$?
5893   echo "$as_me:5893: \$? = $ac_status" >&5
5894   (exit $ac_status); } &&
5895          { ac_try='test -s conftest$ac_exeext'
5896   { (eval echo "$as_me:5896: \"$ac_try\"") >&5
5897   (eval $ac_try) 2>&5
5898   ac_status=$?
5899   echo "$as_me:5899: \$? = $ac_status" >&5
5900   (exit $ac_status); }; }; then
5901   ac_cv_lib_mytinfo_tgoto=yes
5902 else
5903   echo "$as_me: failed program was:" >&5
5904 cat conftest.$ac_ext >&5
5905 ac_cv_lib_mytinfo_tgoto=no
5906 fi
5907 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5908 LIBS=$ac_check_lib_save_LIBS
5909 fi
5910 echo "$as_me:5910: result: $ac_cv_lib_mytinfo_tgoto" >&5
5911 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5912 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5913   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5914 fi
5915
5916         fi
5917         ;;
5918 esac
5919
5920 cf_add_libs="$LIBS"
5921 # reverse order
5922 cf_add_0lib=
5923 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5924 # filter duplicates
5925 for cf_add_1lib in $cf_add_0lib; do
5926         for cf_add_2lib in $cf_add_libs; do
5927                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5928                         cf_add_1lib=
5929                         break
5930                 fi
5931         done
5932         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5933 done
5934 LIBS="$cf_add_libs"
5935
5936 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5937 then
5938
5939 cf_add_libs="$LIBS"
5940 # reverse order
5941 cf_add_0lib=
5942 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5943 # filter duplicates
5944 for cf_add_1lib in $cf_add_0lib; do
5945         for cf_add_2lib in $cf_add_libs; do
5946                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5947                         cf_add_1lib=
5948                         break
5949                 fi
5950         done
5951         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5952 done
5953 LIBS="$cf_add_libs"
5954
5955 else
5956
5957         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5958         cf_libdir=""
5959         echo "$as_me:5959: checking for initscr" >&5
5960 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5961 if test "${ac_cv_func_initscr+set}" = set; then
5962   echo $ECHO_N "(cached) $ECHO_C" >&6
5963 else
5964   cat >conftest.$ac_ext <<_ACEOF
5965 #line 5965 "configure"
5966 #include "confdefs.h"
5967 #define initscr autoconf_temporary
5968 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5969 #undef initscr
5970
5971 #ifdef __cplusplus
5972 extern "C"
5973 #endif
5974
5975 /* We use char because int might match the return type of a gcc2
5976    builtin and then its argument prototype would still apply.  */
5977 char initscr (void);
5978
5979 int
5980 main (void)
5981 {
5982
5983 /* The GNU C library defines stubs for functions which it implements
5984     to always fail with ENOSYS.  Some functions are actually named
5985     something starting with __ and the normal name is an alias.  */
5986 #if defined (__stub_initscr) || defined (__stub___initscr)
5987 #error found stub for initscr
5988 #endif
5989
5990         return initscr ();
5991   ;
5992   return 0;
5993 }
5994 _ACEOF
5995 rm -f conftest.$ac_objext conftest$ac_exeext
5996 if { (eval echo "$as_me:5996: \"$ac_link\"") >&5
5997   (eval $ac_link) 2>&5
5998   ac_status=$?
5999   echo "$as_me:5999: \$? = $ac_status" >&5
6000   (exit $ac_status); } &&
6001          { ac_try='test -s conftest$ac_exeext'
6002   { (eval echo "$as_me:6002: \"$ac_try\"") >&5
6003   (eval $ac_try) 2>&5
6004   ac_status=$?
6005   echo "$as_me:6005: \$? = $ac_status" >&5
6006   (exit $ac_status); }; }; then
6007   ac_cv_func_initscr=yes
6008 else
6009   echo "$as_me: failed program was:" >&5
6010 cat conftest.$ac_ext >&5
6011 ac_cv_func_initscr=no
6012 fi
6013 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6014 fi
6015 echo "$as_me:6015: result: $ac_cv_func_initscr" >&5
6016 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6017 if test $ac_cv_func_initscr = yes; then
6018   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6019 else
6020
6021                 cf_save_LIBS="$LIBS"
6022                 echo "$as_me:6022: checking for initscr in -l$cf_nculib_root" >&5
6023 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6024                 LIBS="-l$cf_nculib_root $LIBS"
6025                 cat >conftest.$ac_ext <<_ACEOF
6026 #line 6026 "configure"
6027 #include "confdefs.h"
6028 #include <${cf_cv_ncurses_header:-curses.h}>
6029 int
6030 main (void)
6031 {
6032 initscr()
6033   ;
6034   return 0;
6035 }
6036 _ACEOF
6037 rm -f conftest.$ac_objext conftest$ac_exeext
6038 if { (eval echo "$as_me:6038: \"$ac_link\"") >&5
6039   (eval $ac_link) 2>&5
6040   ac_status=$?
6041   echo "$as_me:6041: \$? = $ac_status" >&5
6042   (exit $ac_status); } &&
6043          { ac_try='test -s conftest$ac_exeext'
6044   { (eval echo "$as_me:6044: \"$ac_try\"") >&5
6045   (eval $ac_try) 2>&5
6046   ac_status=$?
6047   echo "$as_me:6047: \$? = $ac_status" >&5
6048   (exit $ac_status); }; }; then
6049   echo "$as_me:6049: result: yes" >&5
6050 echo "${ECHO_T}yes" >&6
6051                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6052
6053 else
6054   echo "$as_me: failed program was:" >&5
6055 cat conftest.$ac_ext >&5
6056 echo "$as_me:6056: result: no" >&5
6057 echo "${ECHO_T}no" >&6
6058
6059 cf_search=
6060 cf_library_path_list=""
6061 if test -n "${LDFLAGS}${LIBS}" ; then
6062         for cf_library_path in $LDFLAGS $LIBS
6063         do
6064                 case $cf_library_path in
6065                 (-L*)
6066                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6067
6068 test "x$cf_library_path" != "xNONE" && \
6069 test -d "$cf_library_path" && \
6070  {
6071         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6072         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6073         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6074         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6075         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6076         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
6077 }
6078
6079                         cf_library_path_list="$cf_library_path_list $cf_search"
6080                         ;;
6081                 esac
6082         done
6083 fi
6084
6085 cf_search=
6086
6087 test "x$prefix" != "xNONE" && \
6088 test -d "$prefix" && \
6089  {
6090         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6091         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6092         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6093         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6094         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6095         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6096 }
6097
6098 for cf_subdir_prefix in \
6099         /usr \
6100         /usr/local \
6101         /usr/pkg \
6102         /opt \
6103         /opt/local \
6104         $HOME
6105 do
6106
6107 test "x$cf_subdir_prefix" != "x$prefix" && \
6108 test -d "$cf_subdir_prefix" && \
6109 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6110         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6111         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6112         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6113         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6114         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6115         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
6116 }
6117
6118 done
6119
6120 cf_search="$cf_library_path_list $cf_search"
6121
6122                         for cf_libdir in $cf_search
6123                         do
6124                                 echo "$as_me:6124: checking for -l$cf_nculib_root in $cf_libdir" >&5
6125 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6126                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6127                                 cat >conftest.$ac_ext <<_ACEOF
6128 #line 6128 "configure"
6129 #include "confdefs.h"
6130 #include <${cf_cv_ncurses_header:-curses.h}>
6131 int
6132 main (void)
6133 {
6134 initscr()
6135   ;
6136   return 0;
6137 }
6138 _ACEOF
6139 rm -f conftest.$ac_objext conftest$ac_exeext
6140 if { (eval echo "$as_me:6140: \"$ac_link\"") >&5
6141   (eval $ac_link) 2>&5
6142   ac_status=$?
6143   echo "$as_me:6143: \$? = $ac_status" >&5
6144   (exit $ac_status); } &&
6145          { ac_try='test -s conftest$ac_exeext'
6146   { (eval echo "$as_me:6146: \"$ac_try\"") >&5
6147   (eval $ac_try) 2>&5
6148   ac_status=$?
6149   echo "$as_me:6149: \$? = $ac_status" >&5
6150   (exit $ac_status); }; }; then
6151   echo "$as_me:6151: result: yes" >&5
6152 echo "${ECHO_T}yes" >&6
6153                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6154                                          break
6155 else
6156   echo "$as_me: failed program was:" >&5
6157 cat conftest.$ac_ext >&5
6158 echo "$as_me:6158: result: no" >&5
6159 echo "${ECHO_T}no" >&6
6160                                          LIBS="$cf_save_LIBS"
6161 fi
6162 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6163                         done
6164
6165 fi
6166 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6167
6168 fi
6169
6170 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6171
6172 if test $cf_found_library = no ; then
6173         { { echo "$as_me:6173: error: Cannot link $cf_nculib_root library" >&5
6174 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6175    { (exit 1); exit 1; }; }
6176 fi
6177
6178 fi
6179
6180 if test -n "$cf_ncurses_LIBS" ; then
6181         echo "$as_me:6181: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6182 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6183         cf_ncurses_SAVE="$LIBS"
6184         for p in $cf_ncurses_LIBS ; do
6185                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6186                 if test "$q" != "$LIBS" ; then
6187                         LIBS="$q"
6188                 fi
6189         done
6190         cat >conftest.$ac_ext <<_ACEOF
6191 #line 6191 "configure"
6192 #include "confdefs.h"
6193 #include <${cf_cv_ncurses_header:-curses.h}>
6194 int
6195 main (void)
6196 {
6197 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6198   ;
6199   return 0;
6200 }
6201 _ACEOF
6202 rm -f conftest.$ac_objext conftest$ac_exeext
6203 if { (eval echo "$as_me:6203: \"$ac_link\"") >&5
6204   (eval $ac_link) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); } &&
6208          { ac_try='test -s conftest$ac_exeext'
6209   { (eval echo "$as_me:6209: \"$ac_try\"") >&5
6210   (eval $ac_try) 2>&5
6211   ac_status=$?
6212   echo "$as_me:6212: \$? = $ac_status" >&5
6213   (exit $ac_status); }; }; then
6214   echo "$as_me:6214: result: yes" >&5
6215 echo "${ECHO_T}yes" >&6
6216 else
6217   echo "$as_me: failed program was:" >&5
6218 cat conftest.$ac_ext >&5
6219 echo "$as_me:6219: result: no" >&5
6220 echo "${ECHO_T}no" >&6
6221                  LIBS="$cf_ncurses_SAVE"
6222 fi
6223 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6224 fi
6225
6226 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6227
6228 cat >>confdefs.h <<EOF
6229 #define $cf_nculib_ROOT 1
6230 EOF
6231
6232         fi
6233 else
6234         NCURSES_CONFIG=none
6235 fi
6236
6237 echo "$as_me:6237: checking if you want wide-character code" >&5
6238 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6239
6240 # Check whether --enable-widec or --disable-widec was given.
6241 if test "${enable_widec+set}" = set; then
6242   enableval="$enable_widec"
6243   with_widec=$enableval
6244 else
6245   with_widec=no
6246 fi;
6247 echo "$as_me:6247: result: $with_widec" >&5
6248 echo "${ECHO_T}$with_widec" >&6
6249 if test "$with_widec" = yes ; then
6250
6251 echo "$as_me:6251: checking for multibyte character support" >&5
6252 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6253 if test "${cf_cv_utf8_lib+set}" = set; then
6254   echo $ECHO_N "(cached) $ECHO_C" >&6
6255 else
6256
6257         cf_save_LIBS="$LIBS"
6258         cat >conftest.$ac_ext <<_ACEOF
6259 #line 6259 "configure"
6260 #include "confdefs.h"
6261
6262 #include <stdlib.h>
6263 int
6264 main (void)
6265 {
6266 putwc(0,0);
6267   ;
6268   return 0;
6269 }
6270 _ACEOF
6271 rm -f conftest.$ac_objext conftest$ac_exeext
6272 if { (eval echo "$as_me:6272: \"$ac_link\"") >&5
6273   (eval $ac_link) 2>&5
6274   ac_status=$?
6275   echo "$as_me:6275: \$? = $ac_status" >&5
6276   (exit $ac_status); } &&
6277          { ac_try='test -s conftest$ac_exeext'
6278   { (eval echo "$as_me:6278: \"$ac_try\"") >&5
6279   (eval $ac_try) 2>&5
6280   ac_status=$?
6281   echo "$as_me:6281: \$? = $ac_status" >&5
6282   (exit $ac_status); }; }; then
6283   cf_cv_utf8_lib=yes
6284 else
6285   echo "$as_me: failed program was:" >&5
6286 cat conftest.$ac_ext >&5
6287
6288 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6289 # will be set on completion of the AC_TRY_LINK below.
6290 cf_cv_header_path_utf8=
6291 cf_cv_library_path_utf8=
6292
6293 echo "${as_me:-configure}:6293: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6294
6295 cf_save_LIBS="$LIBS"
6296
6297 cat >conftest.$ac_ext <<_ACEOF
6298 #line 6298 "configure"
6299 #include "confdefs.h"
6300
6301 #include <libutf8.h>
6302 int
6303 main (void)
6304 {
6305 putwc(0,0);
6306   ;
6307   return 0;
6308 }
6309 _ACEOF
6310 rm -f conftest.$ac_objext conftest$ac_exeext
6311 if { (eval echo "$as_me:6311: \"$ac_link\"") >&5
6312   (eval $ac_link) 2>&5
6313   ac_status=$?
6314   echo "$as_me:6314: \$? = $ac_status" >&5
6315   (exit $ac_status); } &&
6316          { ac_try='test -s conftest$ac_exeext'
6317   { (eval echo "$as_me:6317: \"$ac_try\"") >&5
6318   (eval $ac_try) 2>&5
6319   ac_status=$?
6320   echo "$as_me:6320: \$? = $ac_status" >&5
6321   (exit $ac_status); }; }; then
6322
6323         cf_cv_find_linkage_utf8=yes
6324         cf_cv_header_path_utf8=/usr/include
6325         cf_cv_library_path_utf8=/usr/lib
6326
6327 else
6328   echo "$as_me: failed program was:" >&5
6329 cat conftest.$ac_ext >&5
6330
6331 LIBS="-lutf8  $cf_save_LIBS"
6332
6333 cat >conftest.$ac_ext <<_ACEOF
6334 #line 6334 "configure"
6335 #include "confdefs.h"
6336
6337 #include <libutf8.h>
6338 int
6339 main (void)
6340 {
6341 putwc(0,0);
6342   ;
6343   return 0;
6344 }
6345 _ACEOF
6346 rm -f conftest.$ac_objext conftest$ac_exeext
6347 if { (eval echo "$as_me:6347: \"$ac_link\"") >&5
6348   (eval $ac_link) 2>&5
6349   ac_status=$?
6350   echo "$as_me:6350: \$? = $ac_status" >&5
6351   (exit $ac_status); } &&
6352          { ac_try='test -s conftest$ac_exeext'
6353   { (eval echo "$as_me:6353: \"$ac_try\"") >&5
6354   (eval $ac_try) 2>&5
6355   ac_status=$?
6356   echo "$as_me:6356: \$? = $ac_status" >&5
6357   (exit $ac_status); }; }; then
6358
6359         cf_cv_find_linkage_utf8=yes
6360         cf_cv_header_path_utf8=/usr/include
6361         cf_cv_library_path_utf8=/usr/lib
6362         cf_cv_library_file_utf8="-lutf8"
6363
6364 else
6365   echo "$as_me: failed program was:" >&5
6366 cat conftest.$ac_ext >&5
6367
6368         cf_cv_find_linkage_utf8=no
6369         LIBS="$cf_save_LIBS"
6370
6371         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6372
6373 echo "${as_me:-configure}:6373: testing find linkage for utf8 library ..." 1>&5
6374
6375 echo "${as_me:-configure}:6375: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6376
6377         cf_save_CPPFLAGS="$CPPFLAGS"
6378         cf_test_CPPFLAGS="$CPPFLAGS"
6379
6380 cf_search=
6381
6382 # collect the current set of include-directories from compiler flags
6383 cf_header_path_list=""
6384 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6385         for cf_header_path in $CPPFLAGS $CFLAGS
6386         do
6387                 case $cf_header_path in
6388                 (-I*)
6389                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6390
6391 test "x$cf_header_path" != "xNONE" && \
6392 test -d "$cf_header_path" && \
6393  {
6394         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6395         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6396         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6397         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6398         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6399         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6400 }
6401
6402                         cf_header_path_list="$cf_header_path_list $cf_search"
6403                         ;;
6404                 esac
6405         done
6406 fi
6407
6408 # add the variations for the package we are looking for
6409
6410 cf_search=
6411
6412 test "x$prefix" != "xNONE" && \
6413 test -d "$prefix" && \
6414  {
6415         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6416         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6417         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6418         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6419         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6420         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6421 }
6422
6423 for cf_subdir_prefix in \
6424         /usr \
6425         /usr/local \
6426         /usr/pkg \
6427         /opt \
6428         /opt/local \
6429         $HOME
6430 do
6431
6432 test "x$cf_subdir_prefix" != "x$prefix" && \
6433 test -d "$cf_subdir_prefix" && \
6434 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6435         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6436         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6437         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6438         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6439         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6440         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6441 }
6442
6443 done
6444
6445 test "$includedir" != NONE && \
6446 test "$includedir" != "/usr/include" && \
6447 test -d "$includedir" && {
6448         test -d $includedir &&    cf_search="$cf_search $includedir"
6449         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6450 }
6451
6452 test "$oldincludedir" != NONE && \
6453 test "$oldincludedir" != "/usr/include" && \
6454 test -d "$oldincludedir" && {
6455         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6456         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6457 }
6458
6459 cf_search="$cf_search $cf_header_path_list"
6460
6461         for cf_cv_header_path_utf8 in $cf_search
6462         do
6463                 if test -d $cf_cv_header_path_utf8 ; then
6464                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6465
6466 echo "${as_me:-configure}:6466: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6467
6468                         CPPFLAGS="$cf_save_CPPFLAGS"
6469
6470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6471         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6472
6473                         cat >conftest.$ac_ext <<_ACEOF
6474 #line 6474 "configure"
6475 #include "confdefs.h"
6476
6477 #include <libutf8.h>
6478 int
6479 main (void)
6480 {
6481 putwc(0,0);
6482   ;
6483   return 0;
6484 }
6485 _ACEOF
6486 rm -f conftest.$ac_objext
6487 if { (eval echo "$as_me:6487: \"$ac_compile\"") >&5
6488   (eval $ac_compile) 2>&5
6489   ac_status=$?
6490   echo "$as_me:6490: \$? = $ac_status" >&5
6491   (exit $ac_status); } &&
6492          { ac_try='test -s conftest.$ac_objext'
6493   { (eval echo "$as_me:6493: \"$ac_try\"") >&5
6494   (eval $ac_try) 2>&5
6495   ac_status=$?
6496   echo "$as_me:6496: \$? = $ac_status" >&5
6497   (exit $ac_status); }; }; then
6498
6499                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6500
6501 echo "${as_me:-configure}:6501: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6502
6503                                 cf_cv_find_linkage_utf8=maybe
6504                                 cf_test_CPPFLAGS="$CPPFLAGS"
6505                                 break
6506 else
6507   echo "$as_me: failed program was:" >&5
6508 cat conftest.$ac_ext >&5
6509
6510                                 CPPFLAGS="$cf_save_CPPFLAGS"
6511
6512 fi
6513 rm -f conftest.$ac_objext conftest.$ac_ext
6514                 fi
6515         done
6516
6517         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6518
6519 echo "${as_me:-configure}:6519: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6520
6521                 cf_save_LIBS="$LIBS"
6522                 cf_save_LDFLAGS="$LDFLAGS"
6523
6524                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6525
6526 cf_search=
6527 cf_library_path_list=""
6528 if test -n "${LDFLAGS}${LIBS}" ; then
6529         for cf_library_path in $LDFLAGS $LIBS
6530         do
6531                 case $cf_library_path in
6532                 (-L*)
6533                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6534
6535 test "x$cf_library_path" != "xNONE" && \
6536 test -d "$cf_library_path" && \
6537  {
6538         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6539         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6540         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6541         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6542         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6543         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6544 }
6545
6546                         cf_library_path_list="$cf_library_path_list $cf_search"
6547                         ;;
6548                 esac
6549         done
6550 fi
6551
6552 cf_search=
6553
6554 test "x$prefix" != "xNONE" && \
6555 test -d "$prefix" && \
6556  {
6557         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6558         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6559         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6560         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6561         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6562         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6563 }
6564
6565 for cf_subdir_prefix in \
6566         /usr \
6567         /usr/local \
6568         /usr/pkg \
6569         /opt \
6570         /opt/local \
6571         $HOME
6572 do
6573
6574 test "x$cf_subdir_prefix" != "x$prefix" && \
6575 test -d "$cf_subdir_prefix" && \
6576 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6577         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6578         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6579         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6580         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6581         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6582         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6583 }
6584
6585 done
6586
6587 cf_search="$cf_library_path_list $cf_search"
6588
6589                         for cf_cv_library_path_utf8 in $cf_search
6590                         do
6591                                 if test -d $cf_cv_library_path_utf8 ; then
6592                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6593
6594 echo "${as_me:-configure}:6594: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6595
6596                                         CPPFLAGS="$cf_test_CPPFLAGS"
6597                                         LIBS="-lutf8  $cf_save_LIBS"
6598                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6599                                         cat >conftest.$ac_ext <<_ACEOF
6600 #line 6600 "configure"
6601 #include "confdefs.h"
6602
6603 #include <libutf8.h>
6604 int
6605 main (void)
6606 {
6607 putwc(0,0);
6608   ;
6609   return 0;
6610 }
6611 _ACEOF
6612 rm -f conftest.$ac_objext conftest$ac_exeext
6613 if { (eval echo "$as_me:6613: \"$ac_link\"") >&5
6614   (eval $ac_link) 2>&5
6615   ac_status=$?
6616   echo "$as_me:6616: \$? = $ac_status" >&5
6617   (exit $ac_status); } &&
6618          { ac_try='test -s conftest$ac_exeext'
6619   { (eval echo "$as_me:6619: \"$ac_try\"") >&5
6620   (eval $ac_try) 2>&5
6621   ac_status=$?
6622   echo "$as_me:6622: \$? = $ac_status" >&5
6623   (exit $ac_status); }; }; then
6624
6625                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6626
6627 echo "${as_me:-configure}:6627: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6628
6629                                         cf_cv_find_linkage_utf8=yes
6630                                         cf_cv_library_file_utf8="-lutf8"
6631                                         break
6632 else
6633   echo "$as_me: failed program was:" >&5
6634 cat conftest.$ac_ext >&5
6635
6636                                         CPPFLAGS="$cf_save_CPPFLAGS"
6637                                         LIBS="$cf_save_LIBS"
6638                                         LDFLAGS="$cf_save_LDFLAGS"
6639
6640 fi
6641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6642                                 fi
6643                         done
6644                         CPPFLAGS="$cf_save_CPPFLAGS"
6645                         LDFLAGS="$cf_save_LDFLAGS"
6646                 fi
6647
6648         else
6649                 cf_cv_find_linkage_utf8=no
6650         fi
6651
6652 fi
6653 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6654
6655 fi
6656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6657
6658 LIBS="$cf_save_LIBS"
6659
6660 if test "$cf_cv_find_linkage_utf8" = yes ; then
6661 cf_cv_utf8_lib=add-on
6662 else
6663 cf_cv_utf8_lib=no
6664 fi
6665
6666 fi
6667 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6668 fi
6669 echo "$as_me:6669: result: $cf_cv_utf8_lib" >&5
6670 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6671
6672 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6673 # ncurses/ncursesw:
6674 if test "$cf_cv_utf8_lib" = "add-on" ; then
6675
6676 cat >>confdefs.h <<\EOF
6677 #define HAVE_LIBUTF8_H 1
6678 EOF
6679
6680 if test -n "$cf_cv_header_path_utf8" ; then
6681   for cf_add_incdir in $cf_cv_header_path_utf8
6682   do
6683         while test $cf_add_incdir != /usr/include
6684         do
6685           if test -d $cf_add_incdir
6686           then
6687                 cf_have_incdir=no
6688                 if test -n "$CFLAGS$CPPFLAGS" ; then
6689                   # a loop is needed to ensure we can add subdirs of existing dirs
6690                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6691                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6692                           cf_have_incdir=yes; break
6693                         fi
6694                   done
6695                 fi
6696
6697                 if test "$cf_have_incdir" = no ; then
6698                   if test "$cf_add_incdir" = /usr/local/include ; then
6699                         if test "$GCC" = yes
6700                         then
6701                           cf_save_CPPFLAGS=$CPPFLAGS
6702
6703         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6704         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6705
6706                           cat >conftest.$ac_ext <<_ACEOF
6707 #line 6707 "configure"
6708 #include "confdefs.h"
6709 #include <stdio.h>
6710 int
6711 main (void)
6712 {
6713 printf("Hello")
6714   ;
6715   return 0;
6716 }
6717 _ACEOF
6718 rm -f conftest.$ac_objext
6719 if { (eval echo "$as_me:6719: \"$ac_compile\"") >&5
6720   (eval $ac_compile) 2>&5
6721   ac_status=$?
6722   echo "$as_me:6722: \$? = $ac_status" >&5
6723   (exit $ac_status); } &&
6724          { ac_try='test -s conftest.$ac_objext'
6725   { (eval echo "$as_me:6725: \"$ac_try\"") >&5
6726   (eval $ac_try) 2>&5
6727   ac_status=$?
6728   echo "$as_me:6728: \$? = $ac_status" >&5
6729   (exit $ac_status); }; }; then
6730   :
6731 else
6732   echo "$as_me: failed program was:" >&5
6733 cat conftest.$ac_ext >&5
6734 cf_have_incdir=yes
6735 fi
6736 rm -f conftest.$ac_objext conftest.$ac_ext
6737                           CPPFLAGS=$cf_save_CPPFLAGS
6738                         fi
6739                   fi
6740                 fi
6741
6742                 if test "$cf_have_incdir" = no ; then
6743                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6744
6745 echo "${as_me:-configure}:6745: testing adding $cf_add_incdir to include-path ..." 1>&5
6746
6747                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6748
6749                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6750                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6751                   cf_add_incdir="$cf_top_incdir"
6752                 else
6753                   break
6754                 fi
6755           else
6756                 break
6757           fi
6758         done
6759   done
6760 fi
6761
6762 if test -n "$cf_cv_library_path_utf8" ; then
6763         for cf_add_libdir in $cf_cv_library_path_utf8
6764         do
6765                 if test $cf_add_libdir = /usr/lib ; then
6766                         :
6767                 elif test -d $cf_add_libdir
6768                 then
6769                         cf_have_libdir=no
6770                         if test -n "$LDFLAGS$LIBS" ; then
6771                                 # a loop is needed to ensure we can add subdirs of existing dirs
6772                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6773                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6774                                                 cf_have_libdir=yes; break
6775                                         fi
6776                                 done
6777                         fi
6778                         if test "$cf_have_libdir" = no ; then
6779                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6780
6781 echo "${as_me:-configure}:6781: testing adding $cf_add_libdir to library-path ..." 1>&5
6782
6783                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6784                         fi
6785                 fi
6786         done
6787 fi
6788
6789 cf_add_libs="$LIBS"
6790 # reverse order
6791 cf_add_0lib=
6792 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6793 # filter duplicates
6794 for cf_add_1lib in $cf_add_0lib; do
6795         for cf_add_2lib in $cf_add_libs; do
6796                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6797                         cf_add_1lib=
6798                         break
6799                 fi
6800         done
6801         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6802 done
6803 LIBS="$cf_add_libs"
6804
6805 fi
6806
6807 cf_ncuconfig_root=ncursesw
6808 cf_have_ncuconfig=no
6809
6810 if test "x${PKG_CONFIG:=none}" != xnone; then
6811         echo "$as_me:6811: checking pkg-config for $cf_ncuconfig_root" >&5
6812 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6813         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6814                 echo "$as_me:6814: result: yes" >&5
6815 echo "${ECHO_T}yes" >&6
6816
6817                 echo "$as_me:6817: checking if the $cf_ncuconfig_root package files work" >&5
6818 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6819                 cf_have_ncuconfig=unknown
6820
6821                 cf_save_CFLAGS="$CFLAGS"
6822                 cf_save_CPPFLAGS="$CPPFLAGS"
6823                 cf_save_LIBS="$LIBS"
6824
6825                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
6826                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
6827
6828                 # while -W for passing linker flags is prevalent, it is not "standard".
6829                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
6830                 # incompatible _and_ non-standard -W option which gives an error.  Work
6831                 # around that pitfall.
6832                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
6833                 (x*c[89]9@@*-W*)
6834
6835 cf_fix_cppflags=no
6836 cf_new_cflags=
6837 cf_new_cppflags=
6838 cf_new_extra_cppflags=
6839
6840 for cf_add_cflags in $cf_pkg_cflags
6841 do
6842 case $cf_fix_cppflags in
6843 (no)
6844         case $cf_add_cflags in
6845         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6846                 case $cf_add_cflags in
6847                 (-D*)
6848                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6849
6850                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6851                                 && test -z "${cf_tst_cflags}" \
6852                                 && cf_fix_cppflags=yes
6853
6854                         if test $cf_fix_cppflags = yes ; then
6855
6856         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6857         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6858
6859                                 continue
6860                         elif test "${cf_tst_cflags}" = "\"'" ; then
6861
6862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6864
6865                                 continue
6866                         fi
6867                         ;;
6868                 esac
6869                 case "$CPPFLAGS" in
6870                 (*$cf_add_cflags)
6871                         ;;
6872                 (*)
6873                         case $cf_add_cflags in
6874                         (-D*)
6875                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6876
6877 CPPFLAGS=`echo "$CPPFLAGS" | \
6878         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6879                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6880
6881                                 ;;
6882                         esac
6883
6884         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6885         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6886
6887                         ;;
6888                 esac
6889                 ;;
6890         (*)
6891
6892         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6893         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6894
6895                 ;;
6896         esac
6897         ;;
6898 (yes)
6899
6900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6902
6903         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6904
6905         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6906                 && test -z "${cf_tst_cflags}" \
6907                 && cf_fix_cppflags=no
6908         ;;
6909 esac
6910 done
6911
6912 if test -n "$cf_new_cflags" ; then
6913
6914         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6915         CFLAGS="${CFLAGS}$cf_new_cflags"
6916
6917 fi
6918
6919 if test -n "$cf_new_cppflags" ; then
6920
6921         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6922         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6923
6924 fi
6925
6926 if test -n "$cf_new_extra_cppflags" ; then
6927
6928         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6929         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6930
6931 fi
6932
6933 cf_add_libs="$LIBS"
6934 # reverse order
6935 cf_add_0lib=
6936 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6937 # filter duplicates
6938 for cf_add_1lib in $cf_add_0lib; do
6939         for cf_add_2lib in $cf_add_libs; do
6940                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6941                         cf_add_1lib=
6942                         break
6943                 fi
6944         done
6945         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6946 done
6947 LIBS="$cf_add_libs"
6948
6949                         cat >conftest.$ac_ext <<_ACEOF
6950 #line 6950 "configure"
6951 #include "confdefs.h"
6952 #include <${cf_cv_ncurses_header:-curses.h}>
6953 int
6954 main (void)
6955 {
6956 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6957   ;
6958   return 0;
6959 }
6960 _ACEOF
6961 rm -f conftest.$ac_objext conftest$ac_exeext
6962 if { (eval echo "$as_me:6962: \"$ac_link\"") >&5
6963   (eval $ac_link) 2>&5
6964   ac_status=$?
6965   echo "$as_me:6965: \$? = $ac_status" >&5
6966   (exit $ac_status); } &&
6967          { ac_try='test -s conftest$ac_exeext'
6968   { (eval echo "$as_me:6968: \"$ac_try\"") >&5
6969   (eval $ac_try) 2>&5
6970   ac_status=$?
6971   echo "$as_me:6971: \$? = $ac_status" >&5
6972   (exit $ac_status); }; }; then
6973   if test "$cross_compiling" = yes; then
6974   cf_test_ncuconfig=maybe
6975 else
6976   cat >conftest.$ac_ext <<_ACEOF
6977 #line 6977 "configure"
6978 #include "confdefs.h"
6979 #include <${cf_cv_ncurses_header:-curses.h}>
6980                                         int main(void)
6981                                         { char *xx = curses_version(); return (xx == 0); }
6982 _ACEOF
6983 rm -f conftest$ac_exeext
6984 if { (eval echo "$as_me:6984: \"$ac_link\"") >&5
6985   (eval $ac_link) 2>&5
6986   ac_status=$?
6987   echo "$as_me:6987: \$? = $ac_status" >&5
6988   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6989   { (eval echo "$as_me:6989: \"$ac_try\"") >&5
6990   (eval $ac_try) 2>&5
6991   ac_status=$?
6992   echo "$as_me:6992: \$? = $ac_status" >&5
6993   (exit $ac_status); }; }; then
6994   cf_test_ncuconfig=yes
6995 else
6996   echo "$as_me: program exited with status $ac_status" >&5
6997 echo "$as_me: failed program was:" >&5
6998 cat conftest.$ac_ext >&5
6999 cf_test_ncuconfig=no
7000 fi
7001 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7002 fi
7003 else
7004   echo "$as_me: failed program was:" >&5
7005 cat conftest.$ac_ext >&5
7006 cf_test_ncuconfig=no
7007 fi
7008 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7009
7010                         CFLAGS="$cf_save_CFLAGS"
7011                         CPPFLAGS="$cf_save_CPPFLAGS"
7012                         LIBS="$cf_save_LIBS"
7013
7014                         if test "x$cf_test_ncuconfig" != xyes; then
7015                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7016                                 cf_pkg_cflags="$cf_temp"
7017                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7018                                 cf_pkg_libs="$cf_temp"
7019                         fi
7020                         ;;
7021                 esac
7022
7023 cf_fix_cppflags=no
7024 cf_new_cflags=
7025 cf_new_cppflags=
7026 cf_new_extra_cppflags=
7027
7028 for cf_add_cflags in $cf_pkg_cflags
7029 do
7030 case $cf_fix_cppflags in
7031 (no)
7032         case $cf_add_cflags in
7033         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7034                 case $cf_add_cflags in
7035                 (-D*)
7036                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7037
7038                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7039                                 && test -z "${cf_tst_cflags}" \
7040                                 && cf_fix_cppflags=yes
7041
7042                         if test $cf_fix_cppflags = yes ; then
7043
7044         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7045         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7046
7047                                 continue
7048                         elif test "${cf_tst_cflags}" = "\"'" ; then
7049
7050         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7051         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7052
7053                                 continue
7054                         fi
7055                         ;;
7056                 esac
7057                 case "$CPPFLAGS" in
7058                 (*$cf_add_cflags)
7059                         ;;
7060                 (*)
7061                         case $cf_add_cflags in
7062                         (-D*)
7063                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7064
7065 CPPFLAGS=`echo "$CPPFLAGS" | \
7066         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7067                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7068
7069                                 ;;
7070                         esac
7071
7072         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7073         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7074
7075                         ;;
7076                 esac
7077                 ;;
7078         (*)
7079
7080         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7081         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7082
7083                 ;;
7084         esac
7085         ;;
7086 (yes)
7087
7088         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7089         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7090
7091         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7092
7093         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7094                 && test -z "${cf_tst_cflags}" \
7095                 && cf_fix_cppflags=no
7096         ;;
7097 esac
7098 done
7099
7100 if test -n "$cf_new_cflags" ; then
7101
7102         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7103         CFLAGS="${CFLAGS}$cf_new_cflags"
7104
7105 fi
7106
7107 if test -n "$cf_new_cppflags" ; then
7108
7109         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7110         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7111
7112 fi
7113
7114 if test -n "$cf_new_extra_cppflags" ; then
7115
7116         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7117         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7118
7119 fi
7120
7121 cf_add_libs="$LIBS"
7122 # reverse order
7123 cf_add_0lib=
7124 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7125 # filter duplicates
7126 for cf_add_1lib in $cf_add_0lib; do
7127         for cf_add_2lib in $cf_add_libs; do
7128                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7129                         cf_add_1lib=
7130                         break
7131                 fi
7132         done
7133         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7134 done
7135 LIBS="$cf_add_libs"
7136
7137                 cat >conftest.$ac_ext <<_ACEOF
7138 #line 7138 "configure"
7139 #include "confdefs.h"
7140 #include <${cf_cv_ncurses_header:-curses.h}>
7141 int
7142 main (void)
7143 {
7144 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7145   ;
7146   return 0;
7147 }
7148 _ACEOF
7149 rm -f conftest.$ac_objext conftest$ac_exeext
7150 if { (eval echo "$as_me:7150: \"$ac_link\"") >&5
7151   (eval $ac_link) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit $ac_status); } &&
7155          { ac_try='test -s conftest$ac_exeext'
7156   { (eval echo "$as_me:7156: \"$ac_try\"") >&5
7157   (eval $ac_try) 2>&5
7158   ac_status=$?
7159   echo "$as_me:7159: \$? = $ac_status" >&5
7160   (exit $ac_status); }; }; then
7161   if test "$cross_compiling" = yes; then
7162   cf_have_ncuconfig=maybe
7163 else
7164   cat >conftest.$ac_ext <<_ACEOF
7165 #line 7165 "configure"
7166 #include "confdefs.h"
7167 #include <${cf_cv_ncurses_header:-curses.h}>
7168                                 int main(void)
7169                                 { char *xx = curses_version(); return (xx == 0); }
7170 _ACEOF
7171 rm -f conftest$ac_exeext
7172 if { (eval echo "$as_me:7172: \"$ac_link\"") >&5
7173   (eval $ac_link) 2>&5
7174   ac_status=$?
7175   echo "$as_me:7175: \$? = $ac_status" >&5
7176   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7177   { (eval echo "$as_me:7177: \"$ac_try\"") >&5
7178   (eval $ac_try) 2>&5
7179   ac_status=$?
7180   echo "$as_me:7180: \$? = $ac_status" >&5
7181   (exit $ac_status); }; }; then
7182   cf_have_ncuconfig=yes
7183 else
7184   echo "$as_me: program exited with status $ac_status" >&5
7185 echo "$as_me: failed program was:" >&5
7186 cat conftest.$ac_ext >&5
7187 cf_have_ncuconfig=no
7188 fi
7189 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7190 fi
7191 else
7192   echo "$as_me: failed program was:" >&5
7193 cat conftest.$ac_ext >&5
7194 cf_have_ncuconfig=no
7195 fi
7196 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7197                 echo "$as_me:7197: result: $cf_have_ncuconfig" >&5
7198 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7199                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7200                 if test "$cf_have_ncuconfig" != "yes"
7201                 then
7202                         CPPFLAGS="$cf_save_CPPFLAGS"
7203                         LIBS="$cf_save_LIBS"
7204                         NCURSES_CONFIG_PKG=none
7205                 else
7206
7207 cat >>confdefs.h <<\EOF
7208 #define NCURSES 1
7209 EOF
7210
7211                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7212
7213 echo "$as_me:7213: checking for terminfo header" >&5
7214 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7215 if test "${cf_cv_term_header+set}" = set; then
7216   echo $ECHO_N "(cached) $ECHO_C" >&6
7217 else
7218
7219 case ${cf_cv_ncurses_header} in
7220 (*/ncurses.h|*/ncursesw.h)
7221         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7222         ;;
7223 (*)
7224         cf_term_header=term.h
7225         ;;
7226 esac
7227
7228 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7229 do
7230 cat >conftest.$ac_ext <<_ACEOF
7231 #line 7231 "configure"
7232 #include "confdefs.h"
7233 #include <stdio.h>
7234 #include <${cf_cv_ncurses_header:-curses.h}>
7235 #include <$cf_test>
7236
7237 int
7238 main (void)
7239 {
7240 int x = auto_left_margin; (void)x
7241   ;
7242   return 0;
7243 }
7244 _ACEOF
7245 rm -f conftest.$ac_objext
7246 if { (eval echo "$as_me:7246: \"$ac_compile\"") >&5
7247   (eval $ac_compile) 2>&5
7248   ac_status=$?
7249   echo "$as_me:7249: \$? = $ac_status" >&5
7250   (exit $ac_status); } &&
7251          { ac_try='test -s conftest.$ac_objext'
7252   { (eval echo "$as_me:7252: \"$ac_try\"") >&5
7253   (eval $ac_try) 2>&5
7254   ac_status=$?
7255   echo "$as_me:7255: \$? = $ac_status" >&5
7256   (exit $ac_status); }; }; then
7257
7258         cf_cv_term_header="$cf_test"
7259 else
7260   echo "$as_me: failed program was:" >&5
7261 cat conftest.$ac_ext >&5
7262
7263         cf_cv_term_header=unknown
7264
7265 fi
7266 rm -f conftest.$ac_objext conftest.$ac_ext
7267         test "$cf_cv_term_header" != unknown && break
7268 done
7269
7270 fi
7271 echo "$as_me:7271: result: $cf_cv_term_header" >&5
7272 echo "${ECHO_T}$cf_cv_term_header" >&6
7273
7274 # Set definitions to allow ifdef'ing to accommodate subdirectories
7275
7276 case $cf_cv_term_header in
7277 (*term.h)
7278
7279 cat >>confdefs.h <<\EOF
7280 #define HAVE_TERM_H 1
7281 EOF
7282
7283         ;;
7284 esac
7285
7286 case $cf_cv_term_header in
7287 (ncurses/term.h)
7288
7289 cat >>confdefs.h <<\EOF
7290 #define HAVE_NCURSES_TERM_H 1
7291 EOF
7292
7293         ;;
7294 (ncursesw/term.h)
7295
7296 cat >>confdefs.h <<\EOF
7297 #define HAVE_NCURSESW_TERM_H 1
7298 EOF
7299
7300         ;;
7301 esac
7302
7303                 fi
7304
7305         else
7306                 echo "$as_me:7306: result: no" >&5
7307 echo "${ECHO_T}no" >&6
7308                 NCURSES_CONFIG_PKG=none
7309         fi
7310 else
7311         NCURSES_CONFIG_PKG=none
7312 fi
7313
7314 if test "x$cf_have_ncuconfig" = "xno"; then
7315         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7316
7317 if test -n "$ac_tool_prefix"; then
7318   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7319   do
7320     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7321 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7322 echo "$as_me:7322: checking for $ac_word" >&5
7323 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7324 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7325   echo $ECHO_N "(cached) $ECHO_C" >&6
7326 else
7327   if test -n "$NCURSES_CONFIG"; then
7328   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7329 else
7330   ac_save_IFS=$IFS; IFS=$ac_path_separator
7331 ac_dummy="$PATH"
7332 for ac_dir in $ac_dummy; do
7333   IFS=$ac_save_IFS
7334   test -z "$ac_dir" && ac_dir=.
7335   $as_executable_p "$ac_dir/$ac_word" || continue
7336 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7337 echo "$as_me:7337: found $ac_dir/$ac_word" >&5
7338 break
7339 done
7340
7341 fi
7342 fi
7343 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7344 if test -n "$NCURSES_CONFIG"; then
7345   echo "$as_me:7345: result: $NCURSES_CONFIG" >&5
7346 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7347 else
7348   echo "$as_me:7348: result: no" >&5
7349 echo "${ECHO_T}no" >&6
7350 fi
7351
7352     test -n "$NCURSES_CONFIG" && break
7353   done
7354 fi
7355 if test -z "$NCURSES_CONFIG"; then
7356   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7357   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7358 do
7359   # Extract the first word of "$ac_prog", so it can be a program name with args.
7360 set dummy $ac_prog; ac_word=$2
7361 echo "$as_me:7361: checking for $ac_word" >&5
7362 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7363 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7364   echo $ECHO_N "(cached) $ECHO_C" >&6
7365 else
7366   if test -n "$ac_ct_NCURSES_CONFIG"; then
7367   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7368 else
7369   ac_save_IFS=$IFS; IFS=$ac_path_separator
7370 ac_dummy="$PATH"
7371 for ac_dir in $ac_dummy; do
7372   IFS=$ac_save_IFS
7373   test -z "$ac_dir" && ac_dir=.
7374   $as_executable_p "$ac_dir/$ac_word" || continue
7375 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7376 echo "$as_me:7376: found $ac_dir/$ac_word" >&5
7377 break
7378 done
7379
7380 fi
7381 fi
7382 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7383 if test -n "$ac_ct_NCURSES_CONFIG"; then
7384   echo "$as_me:7384: result: $ac_ct_NCURSES_CONFIG" >&5
7385 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7386 else
7387   echo "$as_me:7387: result: no" >&5
7388 echo "${ECHO_T}no" >&6
7389 fi
7390
7391   test -n "$ac_ct_NCURSES_CONFIG" && break
7392 done
7393 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7394
7395   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7396 fi
7397
7398         if test "$NCURSES_CONFIG" != none ; then
7399
7400 cf_fix_cppflags=no
7401 cf_new_cflags=
7402 cf_new_cppflags=
7403 cf_new_extra_cppflags=
7404
7405 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7406 do
7407 case $cf_fix_cppflags in
7408 (no)
7409         case $cf_add_cflags in
7410         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7411                 case $cf_add_cflags in
7412                 (-D*)
7413                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7414
7415                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7416                                 && test -z "${cf_tst_cflags}" \
7417                                 && cf_fix_cppflags=yes
7418
7419                         if test $cf_fix_cppflags = yes ; then
7420
7421         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7422         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7423
7424                                 continue
7425                         elif test "${cf_tst_cflags}" = "\"'" ; then
7426
7427         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7428         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7429
7430                                 continue
7431                         fi
7432                         ;;
7433                 esac
7434                 case "$CPPFLAGS" in
7435                 (*$cf_add_cflags)
7436                         ;;
7437                 (*)
7438                         case $cf_add_cflags in
7439                         (-D*)
7440                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7441
7442 CPPFLAGS=`echo "$CPPFLAGS" | \
7443         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7444                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7445
7446                                 ;;
7447                         esac
7448
7449         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7450         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7451
7452                         ;;
7453                 esac
7454                 ;;
7455         (*)
7456
7457         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7458         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7459
7460                 ;;
7461         esac
7462         ;;
7463 (yes)
7464
7465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7467
7468         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7469
7470         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7471                 && test -z "${cf_tst_cflags}" \
7472                 && cf_fix_cppflags=no
7473         ;;
7474 esac
7475 done
7476
7477 if test -n "$cf_new_cflags" ; then
7478
7479         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7480         CFLAGS="${CFLAGS}$cf_new_cflags"
7481
7482 fi
7483
7484 if test -n "$cf_new_cppflags" ; then
7485
7486         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7487         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7488
7489 fi
7490
7491 if test -n "$cf_new_extra_cppflags" ; then
7492
7493         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7494         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7495
7496 fi
7497
7498 cf_add_libs="$LIBS"
7499 # reverse order
7500 cf_add_0lib=
7501 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7502 # filter duplicates
7503 for cf_add_1lib in $cf_add_0lib; do
7504         for cf_add_2lib in $cf_add_libs; do
7505                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7506                         cf_add_1lib=
7507                         break
7508                 fi
7509         done
7510         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7511 done
7512 LIBS="$cf_add_libs"
7513
7514                 # even with config script, some packages use no-override for curses.h
7515
7516 echo "$as_me:7516: checking if we have identified curses headers" >&5
7517 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7518 if test "${cf_cv_ncurses_header+set}" = set; then
7519   echo $ECHO_N "(cached) $ECHO_C" >&6
7520 else
7521
7522 cf_cv_ncurses_header=none
7523 for cf_header in \
7524         ncurses.h ncursesw/ncurses.h \
7525         curses.h ncursesw/curses.h
7526 do
7527 cat >conftest.$ac_ext <<_ACEOF
7528 #line 7528 "configure"
7529 #include "confdefs.h"
7530 #include <${cf_header}>
7531 int
7532 main (void)
7533 {
7534 initscr(); tgoto("?", 0,0)
7535   ;
7536   return 0;
7537 }
7538 _ACEOF
7539 rm -f conftest.$ac_objext
7540 if { (eval echo "$as_me:7540: \"$ac_compile\"") >&5
7541   (eval $ac_compile) 2>&5
7542   ac_status=$?
7543   echo "$as_me:7543: \$? = $ac_status" >&5
7544   (exit $ac_status); } &&
7545          { ac_try='test -s conftest.$ac_objext'
7546   { (eval echo "$as_me:7546: \"$ac_try\"") >&5
7547   (eval $ac_try) 2>&5
7548   ac_status=$?
7549   echo "$as_me:7549: \$? = $ac_status" >&5
7550   (exit $ac_status); }; }; then
7551   cf_cv_ncurses_header=$cf_header; break
7552 else
7553   echo "$as_me: failed program was:" >&5
7554 cat conftest.$ac_ext >&5
7555 fi
7556 rm -f conftest.$ac_objext conftest.$ac_ext
7557 done
7558
7559 fi
7560 echo "$as_me:7560: result: $cf_cv_ncurses_header" >&5
7561 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7562
7563 if test "$cf_cv_ncurses_header" = none ; then
7564         { { echo "$as_me:7564: error: No curses header-files found" >&5
7565 echo "$as_me: error: No curses header-files found" >&2;}
7566    { (exit 1); exit 1; }; }
7567 fi
7568
7569 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7570
7571 for ac_header in $cf_cv_ncurses_header
7572 do
7573 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7574 echo "$as_me:7574: checking for $ac_header" >&5
7575 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7576 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7577   echo $ECHO_N "(cached) $ECHO_C" >&6
7578 else
7579   cat >conftest.$ac_ext <<_ACEOF
7580 #line 7580 "configure"
7581 #include "confdefs.h"
7582 #include <$ac_header>
7583 _ACEOF
7584 if { (eval echo "$as_me:7584: \"$ac_cpp conftest.$ac_ext\"") >&5
7585   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7586   ac_status=$?
7587   egrep -v '^ *\+' conftest.er1 >conftest.err
7588   rm -f conftest.er1
7589   cat conftest.err >&5
7590   echo "$as_me:7590: \$? = $ac_status" >&5
7591   (exit $ac_status); } >/dev/null; then
7592   if test -s conftest.err; then
7593     ac_cpp_err=$ac_c_preproc_warn_flag
7594   else
7595     ac_cpp_err=
7596   fi
7597 else
7598   ac_cpp_err=yes
7599 fi
7600 if test -z "$ac_cpp_err"; then
7601   eval "$as_ac_Header=yes"
7602 else
7603   echo "$as_me: failed program was:" >&5
7604   cat conftest.$ac_ext >&5
7605   eval "$as_ac_Header=no"
7606 fi
7607 rm -f conftest.err conftest.$ac_ext
7608 fi
7609 echo "$as_me:7609: result: `eval echo '${'$as_ac_Header'}'`" >&5
7610 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7611 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7612   cat >>confdefs.h <<EOF
7613 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7614 EOF
7615
7616 fi
7617 done
7618
7619 cat >>confdefs.h <<\EOF
7620 #define NCURSES 1
7621 EOF
7622
7623 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7624
7625                 cat >>confdefs.h <<EOF
7626 #define $cf_nculib_ROOT 1
7627 EOF
7628
7629                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7630
7631         else
7632
7633 cf_ncuhdr_root=ncursesw
7634
7635 test -n "$cf_cv_curses_dir" && \
7636 test "$cf_cv_curses_dir" != "no" && { \
7637
7638 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7639   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7640   do
7641         while test $cf_add_incdir != /usr/include
7642         do
7643           if test -d $cf_add_incdir
7644           then
7645                 cf_have_incdir=no
7646                 if test -n "$CFLAGS$CPPFLAGS" ; then
7647                   # a loop is needed to ensure we can add subdirs of existing dirs
7648                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7649                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7650                           cf_have_incdir=yes; break
7651                         fi
7652                   done
7653                 fi
7654
7655                 if test "$cf_have_incdir" = no ; then
7656                   if test "$cf_add_incdir" = /usr/local/include ; then
7657                         if test "$GCC" = yes
7658                         then
7659                           cf_save_CPPFLAGS=$CPPFLAGS
7660
7661         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7662         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7663
7664                           cat >conftest.$ac_ext <<_ACEOF
7665 #line 7665 "configure"
7666 #include "confdefs.h"
7667 #include <stdio.h>
7668 int
7669 main (void)
7670 {
7671 printf("Hello")
7672   ;
7673   return 0;
7674 }
7675 _ACEOF
7676 rm -f conftest.$ac_objext
7677 if { (eval echo "$as_me:7677: \"$ac_compile\"") >&5
7678   (eval $ac_compile) 2>&5
7679   ac_status=$?
7680   echo "$as_me:7680: \$? = $ac_status" >&5
7681   (exit $ac_status); } &&
7682          { ac_try='test -s conftest.$ac_objext'
7683   { (eval echo "$as_me:7683: \"$ac_try\"") >&5
7684   (eval $ac_try) 2>&5
7685   ac_status=$?
7686   echo "$as_me:7686: \$? = $ac_status" >&5
7687   (exit $ac_status); }; }; then
7688   :
7689 else
7690   echo "$as_me: failed program was:" >&5
7691 cat conftest.$ac_ext >&5
7692 cf_have_incdir=yes
7693 fi
7694 rm -f conftest.$ac_objext conftest.$ac_ext
7695                           CPPFLAGS=$cf_save_CPPFLAGS
7696                         fi
7697                   fi
7698                 fi
7699
7700                 if test "$cf_have_incdir" = no ; then
7701                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7702
7703 echo "${as_me:-configure}:7703: testing adding $cf_add_incdir to include-path ..." 1>&5
7704
7705                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7706
7707                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7708                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7709                   cf_add_incdir="$cf_top_incdir"
7710                 else
7711                   break
7712                 fi
7713           else
7714                 break
7715           fi
7716         done
7717   done
7718 fi
7719
7720 }
7721
7722 echo "$as_me:7722: checking for $cf_ncuhdr_root header in include-path" >&5
7723 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7724 if test "${cf_cv_ncurses_h+set}" = set; then
7725   echo $ECHO_N "(cached) $ECHO_C" >&6
7726 else
7727
7728         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7729         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7730         for cf_header in $cf_header_list
7731         do
7732
7733         cat >conftest.$ac_ext <<_ACEOF
7734 #line 7734 "configure"
7735 #include "confdefs.h"
7736
7737 #define _XOPEN_SOURCE_EXTENDED
7738 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7739 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7740
7741 #include <$cf_header>
7742 int
7743 main (void)
7744 {
7745
7746 #ifdef NCURSES_VERSION
7747
7748 #ifndef WACS_BSSB
7749         make an error
7750 #endif
7751
7752 printf("%s\n", NCURSES_VERSION);
7753 #else
7754 #ifdef __NCURSES_H
7755 printf("old\n");
7756 #else
7757         make an error
7758 #endif
7759 #endif
7760
7761   ;
7762   return 0;
7763 }
7764 _ACEOF
7765 rm -f conftest.$ac_objext
7766 if { (eval echo "$as_me:7766: \"$ac_compile\"") >&5
7767   (eval $ac_compile) 2>&5
7768   ac_status=$?
7769   echo "$as_me:7769: \$? = $ac_status" >&5
7770   (exit $ac_status); } &&
7771          { ac_try='test -s conftest.$ac_objext'
7772   { (eval echo "$as_me:7772: \"$ac_try\"") >&5
7773   (eval $ac_try) 2>&5
7774   ac_status=$?
7775   echo "$as_me:7775: \$? = $ac_status" >&5
7776   (exit $ac_status); }; }; then
7777   cf_cv_ncurses_h=$cf_header
7778
7779 else
7780   echo "$as_me: failed program was:" >&5
7781 cat conftest.$ac_ext >&5
7782 cf_cv_ncurses_h=no
7783 fi
7784 rm -f conftest.$ac_objext conftest.$ac_ext
7785
7786                 test "$cf_cv_ncurses_h" != no && break
7787         done
7788
7789 fi
7790 echo "$as_me:7790: result: $cf_cv_ncurses_h" >&5
7791 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7792
7793 if test "$cf_cv_ncurses_h" != no ; then
7794         cf_cv_ncurses_header=$cf_cv_ncurses_h
7795 else
7796
7797 echo "$as_me:7797: checking for $cf_ncuhdr_root include-path" >&5
7798 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7799 if test "${cf_cv_ncurses_h2+set}" = set; then
7800   echo $ECHO_N "(cached) $ECHO_C" >&6
7801 else
7802
7803         test -n "$verbose" && echo
7804
7805 cf_search=
7806
7807 # collect the current set of include-directories from compiler flags
7808 cf_header_path_list=""
7809 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7810         for cf_header_path in $CPPFLAGS $CFLAGS
7811         do
7812                 case $cf_header_path in
7813                 (-I*)
7814                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7815
7816 test "x$cf_header_path" != "xNONE" && \
7817 test -d "$cf_header_path" && \
7818  {
7819         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7820         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7821         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7822         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7823         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7824         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7825 }
7826
7827                         cf_header_path_list="$cf_header_path_list $cf_search"
7828                         ;;
7829                 esac
7830         done
7831 fi
7832
7833 # add the variations for the package we are looking for
7834
7835 cf_search=
7836
7837 test "x$prefix" != "xNONE" && \
7838 test -d "$prefix" && \
7839  {
7840         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7841         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7842         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7843         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7844         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7845         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7846 }
7847
7848 for cf_subdir_prefix in \
7849         /usr \
7850         /usr/local \
7851         /usr/pkg \
7852         /opt \
7853         /opt/local \
7854         $HOME
7855 do
7856
7857 test "x$cf_subdir_prefix" != "x$prefix" && \
7858 test -d "$cf_subdir_prefix" && \
7859 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7860         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7861         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7862         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7863         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7864         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7865         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7866 }
7867
7868 done
7869
7870 test "$includedir" != NONE && \
7871 test "$includedir" != "/usr/include" && \
7872 test -d "$includedir" && {
7873         test -d $includedir &&    cf_search="$cf_search $includedir"
7874         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7875 }
7876
7877 test "$oldincludedir" != NONE && \
7878 test "$oldincludedir" != "/usr/include" && \
7879 test -d "$oldincludedir" && {
7880         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7881         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7882 }
7883
7884 cf_search="$cf_search $cf_header_path_list"
7885
7886         test -n "$verbose" && echo search path $cf_search
7887         cf_save2_CPPFLAGS="$CPPFLAGS"
7888         for cf_incdir in $cf_search
7889         do
7890
7891 if test -n "$cf_incdir" ; then
7892   for cf_add_incdir in $cf_incdir
7893   do
7894         while test $cf_add_incdir != /usr/include
7895         do
7896           if test -d $cf_add_incdir
7897           then
7898                 cf_have_incdir=no
7899                 if test -n "$CFLAGS$CPPFLAGS" ; then
7900                   # a loop is needed to ensure we can add subdirs of existing dirs
7901                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7902                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7903                           cf_have_incdir=yes; break
7904                         fi
7905                   done
7906                 fi
7907
7908                 if test "$cf_have_incdir" = no ; then
7909                   if test "$cf_add_incdir" = /usr/local/include ; then
7910                         if test "$GCC" = yes
7911                         then
7912                           cf_save_CPPFLAGS=$CPPFLAGS
7913
7914         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7915         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7916
7917                           cat >conftest.$ac_ext <<_ACEOF
7918 #line 7918 "configure"
7919 #include "confdefs.h"
7920 #include <stdio.h>
7921 int
7922 main (void)
7923 {
7924 printf("Hello")
7925   ;
7926   return 0;
7927 }
7928 _ACEOF
7929 rm -f conftest.$ac_objext
7930 if { (eval echo "$as_me:7930: \"$ac_compile\"") >&5
7931   (eval $ac_compile) 2>&5
7932   ac_status=$?
7933   echo "$as_me:7933: \$? = $ac_status" >&5
7934   (exit $ac_status); } &&
7935          { ac_try='test -s conftest.$ac_objext'
7936   { (eval echo "$as_me:7936: \"$ac_try\"") >&5
7937   (eval $ac_try) 2>&5
7938   ac_status=$?
7939   echo "$as_me:7939: \$? = $ac_status" >&5
7940   (exit $ac_status); }; }; then
7941   :
7942 else
7943   echo "$as_me: failed program was:" >&5
7944 cat conftest.$ac_ext >&5
7945 cf_have_incdir=yes
7946 fi
7947 rm -f conftest.$ac_objext conftest.$ac_ext
7948                           CPPFLAGS=$cf_save_CPPFLAGS
7949                         fi
7950                   fi
7951                 fi
7952
7953                 if test "$cf_have_incdir" = no ; then
7954                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7955
7956 echo "${as_me:-configure}:7956: testing adding $cf_add_incdir to include-path ..." 1>&5
7957
7958                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7959
7960                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7961                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7962                   cf_add_incdir="$cf_top_incdir"
7963                 else
7964                   break
7965                 fi
7966           else
7967                 break
7968           fi
7969         done
7970   done
7971 fi
7972
7973                 for cf_header in \
7974                         ncurses.h \
7975                         curses.h
7976                 do
7977
7978         cat >conftest.$ac_ext <<_ACEOF
7979 #line 7979 "configure"
7980 #include "confdefs.h"
7981
7982 #include <$cf_header>
7983 int
7984 main (void)
7985 {
7986
7987 #ifdef NCURSES_VERSION
7988
7989 printf("%s\n", NCURSES_VERSION);
7990 #else
7991 #ifdef __NCURSES_H
7992 printf("old\n");
7993 #else
7994         make an error
7995 #endif
7996 #endif
7997
7998   ;
7999   return 0;
8000 }
8001 _ACEOF
8002 rm -f conftest.$ac_objext
8003 if { (eval echo "$as_me:8003: \"$ac_compile\"") >&5
8004   (eval $ac_compile) 2>&5
8005   ac_status=$?
8006   echo "$as_me:8006: \$? = $ac_status" >&5
8007   (exit $ac_status); } &&
8008          { ac_try='test -s conftest.$ac_objext'
8009   { (eval echo "$as_me:8009: \"$ac_try\"") >&5
8010   (eval $ac_try) 2>&5
8011   ac_status=$?
8012   echo "$as_me:8012: \$? = $ac_status" >&5
8013   (exit $ac_status); }; }; then
8014   cf_cv_ncurses_h2=$cf_header
8015
8016 else
8017   echo "$as_me: failed program was:" >&5
8018 cat conftest.$ac_ext >&5
8019 cf_cv_ncurses_h2=no
8020 fi
8021 rm -f conftest.$ac_objext conftest.$ac_ext
8022
8023                         if test "$cf_cv_ncurses_h2" != no ; then
8024                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8025                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8026                                 break
8027                         fi
8028                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8029                 done
8030                 CPPFLAGS="$cf_save2_CPPFLAGS"
8031                 test "$cf_cv_ncurses_h2" != no && break
8032         done
8033         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8033: error: not found" >&5
8034 echo "$as_me: error: not found" >&2;}
8035    { (exit 1); exit 1; }; }
8036
8037 fi
8038 echo "$as_me:8038: result: $cf_cv_ncurses_h2" >&5
8039 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8040
8041         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8042         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8043         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8044                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8045         fi
8046
8047 if test -n "$cf_1st_incdir" ; then
8048   for cf_add_incdir in $cf_1st_incdir
8049   do
8050         while test $cf_add_incdir != /usr/include
8051         do
8052           if test -d $cf_add_incdir
8053           then
8054                 cf_have_incdir=no
8055                 if test -n "$CFLAGS$CPPFLAGS" ; then
8056                   # a loop is needed to ensure we can add subdirs of existing dirs
8057                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8058                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8059                           cf_have_incdir=yes; break
8060                         fi
8061                   done
8062                 fi
8063
8064                 if test "$cf_have_incdir" = no ; then
8065                   if test "$cf_add_incdir" = /usr/local/include ; then
8066                         if test "$GCC" = yes
8067                         then
8068                           cf_save_CPPFLAGS=$CPPFLAGS
8069
8070         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8071         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8072
8073                           cat >conftest.$ac_ext <<_ACEOF
8074 #line 8074 "configure"
8075 #include "confdefs.h"
8076 #include <stdio.h>
8077 int
8078 main (void)
8079 {
8080 printf("Hello")
8081   ;
8082   return 0;
8083 }
8084 _ACEOF
8085 rm -f conftest.$ac_objext
8086 if { (eval echo "$as_me:8086: \"$ac_compile\"") >&5
8087   (eval $ac_compile) 2>&5
8088   ac_status=$?
8089   echo "$as_me:8089: \$? = $ac_status" >&5
8090   (exit $ac_status); } &&
8091          { ac_try='test -s conftest.$ac_objext'
8092   { (eval echo "$as_me:8092: \"$ac_try\"") >&5
8093   (eval $ac_try) 2>&5
8094   ac_status=$?
8095   echo "$as_me:8095: \$? = $ac_status" >&5
8096   (exit $ac_status); }; }; then
8097   :
8098 else
8099   echo "$as_me: failed program was:" >&5
8100 cat conftest.$ac_ext >&5
8101 cf_have_incdir=yes
8102 fi
8103 rm -f conftest.$ac_objext conftest.$ac_ext
8104                           CPPFLAGS=$cf_save_CPPFLAGS
8105                         fi
8106                   fi
8107                 fi
8108
8109                 if test "$cf_have_incdir" = no ; then
8110                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8111
8112 echo "${as_me:-configure}:8112: testing adding $cf_add_incdir to include-path ..." 1>&5
8113
8114                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8115
8116                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8117                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8118                   cf_add_incdir="$cf_top_incdir"
8119                 else
8120                   break
8121                 fi
8122           else
8123                 break
8124           fi
8125         done
8126   done
8127 fi
8128
8129 fi
8130
8131 # Set definitions to allow ifdef'ing for ncurses.h
8132
8133 case $cf_cv_ncurses_header in
8134 (*ncurses.h)
8135
8136 cat >>confdefs.h <<\EOF
8137 #define HAVE_NCURSES_H 1
8138 EOF
8139
8140         ;;
8141 esac
8142
8143 case $cf_cv_ncurses_header in
8144 (ncurses/curses.h|ncurses/ncurses.h)
8145
8146 cat >>confdefs.h <<\EOF
8147 #define HAVE_NCURSES_NCURSES_H 1
8148 EOF
8149
8150         ;;
8151 (ncursesw/curses.h|ncursesw/ncurses.h)
8152
8153 cat >>confdefs.h <<\EOF
8154 #define HAVE_NCURSESW_NCURSES_H 1
8155 EOF
8156
8157         ;;
8158 esac
8159
8160 echo "$as_me:8160: checking for terminfo header" >&5
8161 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8162 if test "${cf_cv_term_header+set}" = set; then
8163   echo $ECHO_N "(cached) $ECHO_C" >&6
8164 else
8165
8166 case ${cf_cv_ncurses_header} in
8167 (*/ncurses.h|*/ncursesw.h)
8168         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8169         ;;
8170 (*)
8171         cf_term_header=term.h
8172         ;;
8173 esac
8174
8175 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8176 do
8177 cat >conftest.$ac_ext <<_ACEOF
8178 #line 8178 "configure"
8179 #include "confdefs.h"
8180 #include <stdio.h>
8181 #include <${cf_cv_ncurses_header:-curses.h}>
8182 #include <$cf_test>
8183
8184 int
8185 main (void)
8186 {
8187 int x = auto_left_margin; (void)x
8188   ;
8189   return 0;
8190 }
8191 _ACEOF
8192 rm -f conftest.$ac_objext
8193 if { (eval echo "$as_me:8193: \"$ac_compile\"") >&5
8194   (eval $ac_compile) 2>&5
8195   ac_status=$?
8196   echo "$as_me:8196: \$? = $ac_status" >&5
8197   (exit $ac_status); } &&
8198          { ac_try='test -s conftest.$ac_objext'
8199   { (eval echo "$as_me:8199: \"$ac_try\"") >&5
8200   (eval $ac_try) 2>&5
8201   ac_status=$?
8202   echo "$as_me:8202: \$? = $ac_status" >&5
8203   (exit $ac_status); }; }; then
8204
8205         cf_cv_term_header="$cf_test"
8206 else
8207   echo "$as_me: failed program was:" >&5
8208 cat conftest.$ac_ext >&5
8209
8210         cf_cv_term_header=unknown
8211
8212 fi
8213 rm -f conftest.$ac_objext conftest.$ac_ext
8214         test "$cf_cv_term_header" != unknown && break
8215 done
8216
8217 fi
8218 echo "$as_me:8218: result: $cf_cv_term_header" >&5
8219 echo "${ECHO_T}$cf_cv_term_header" >&6
8220
8221 # Set definitions to allow ifdef'ing to accommodate subdirectories
8222
8223 case $cf_cv_term_header in
8224 (*term.h)
8225
8226 cat >>confdefs.h <<\EOF
8227 #define HAVE_TERM_H 1
8228 EOF
8229
8230         ;;
8231 esac
8232
8233 case $cf_cv_term_header in
8234 (ncurses/term.h)
8235
8236 cat >>confdefs.h <<\EOF
8237 #define HAVE_NCURSES_TERM_H 1
8238 EOF
8239
8240         ;;
8241 (ncursesw/term.h)
8242
8243 cat >>confdefs.h <<\EOF
8244 #define HAVE_NCURSESW_TERM_H 1
8245 EOF
8246
8247         ;;
8248 esac
8249
8250 # some applications need this, but should check for NCURSES_VERSION
8251
8252 cat >>confdefs.h <<\EOF
8253 #define NCURSES 1
8254 EOF
8255
8256 echo "$as_me:8256: checking for ncurses version" >&5
8257 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8258 if test "${cf_cv_ncurses_version+set}" = set; then
8259   echo $ECHO_N "(cached) $ECHO_C" >&6
8260 else
8261
8262         cf_cv_ncurses_version=no
8263         cf_tempfile=out$$
8264         rm -f $cf_tempfile
8265         if test "$cross_compiling" = yes; then
8266
8267         # This will not work if the preprocessor splits the line after the
8268         # Autoconf token.  The 'unproto' program does that.
8269         cat > conftest.$ac_ext <<EOF
8270 #include <${cf_cv_ncurses_header:-curses.h}>
8271 #undef Autoconf
8272 #ifdef NCURSES_VERSION
8273 Autoconf NCURSES_VERSION
8274 #else
8275 #ifdef __NCURSES_H
8276 Autoconf "old"
8277 #endif
8278 ;
8279 #endif
8280 EOF
8281         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8282         { (eval echo "$as_me:8282: \"$cf_try\"") >&5
8283   (eval $cf_try) 2>&5
8284   ac_status=$?
8285   echo "$as_me:8285: \$? = $ac_status" >&5
8286   (exit $ac_status); }
8287         if test -f conftest.out ; then
8288                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8289                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8290                 rm -f conftest.out
8291         fi
8292
8293 else
8294   cat >conftest.$ac_ext <<_ACEOF
8295 #line 8295 "configure"
8296 #include "confdefs.h"
8297
8298 #include <${cf_cv_ncurses_header:-curses.h}>
8299 #include <stdio.h>
8300 int main(void)
8301 {
8302         FILE *fp = fopen("$cf_tempfile", "w");
8303 #ifdef NCURSES_VERSION
8304 # ifdef NCURSES_VERSION_PATCH
8305         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8306 # else
8307         fprintf(fp, "%s\n", NCURSES_VERSION);
8308 # endif
8309 #else
8310 # ifdef __NCURSES_H
8311         fprintf(fp, "old\n");
8312 # else
8313         make an error
8314 # endif
8315 #endif
8316         ${cf_cv_main_return:-return}(0);
8317 }
8318 _ACEOF
8319 rm -f conftest$ac_exeext
8320 if { (eval echo "$as_me:8320: \"$ac_link\"") >&5
8321   (eval $ac_link) 2>&5
8322   ac_status=$?
8323   echo "$as_me:8323: \$? = $ac_status" >&5
8324   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8325   { (eval echo "$as_me:8325: \"$ac_try\"") >&5
8326   (eval $ac_try) 2>&5
8327   ac_status=$?
8328   echo "$as_me:8328: \$? = $ac_status" >&5
8329   (exit $ac_status); }; }; then
8330
8331         cf_cv_ncurses_version=`cat $cf_tempfile`
8332 else
8333   echo "$as_me: program exited with status $ac_status" >&5
8334 echo "$as_me: failed program was:" >&5
8335 cat conftest.$ac_ext >&5
8336 fi
8337 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8338 fi
8339         rm -f $cf_tempfile
8340
8341 fi
8342 echo "$as_me:8342: result: $cf_cv_ncurses_version" >&5
8343 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8344 test "$cf_cv_ncurses_version" = no ||
8345 cat >>confdefs.h <<\EOF
8346 #define NCURSES 1
8347 EOF
8348
8349 cf_nculib_root=ncursesw
8350         # This works, except for the special case where we find gpm, but
8351         # ncurses is in a nonstandard location via $LIBS, and we really want
8352         # to link gpm.
8353 cf_ncurses_LIBS=""
8354 cf_ncurses_SAVE="$LIBS"
8355 echo "$as_me:8355: checking for Gpm_Open in -lgpm" >&5
8356 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8357 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8358   echo $ECHO_N "(cached) $ECHO_C" >&6
8359 else
8360   ac_check_lib_save_LIBS=$LIBS
8361 LIBS="-lgpm  $LIBS"
8362 cat >conftest.$ac_ext <<_ACEOF
8363 #line 8363 "configure"
8364 #include "confdefs.h"
8365
8366 /* Override any gcc2 internal prototype to avoid an error.  */
8367 #ifdef __cplusplus
8368 extern "C"
8369 #endif
8370 /* We use char because int might match the return type of a gcc2
8371    builtin and then its argument prototype would still apply.  */
8372 char Gpm_Open ();
8373 int
8374 main (void)
8375 {
8376 Gpm_Open ();
8377   ;
8378   return 0;
8379 }
8380 _ACEOF
8381 rm -f conftest.$ac_objext conftest$ac_exeext
8382 if { (eval echo "$as_me:8382: \"$ac_link\"") >&5
8383   (eval $ac_link) 2>&5
8384   ac_status=$?
8385   echo "$as_me:8385: \$? = $ac_status" >&5
8386   (exit $ac_status); } &&
8387          { ac_try='test -s conftest$ac_exeext'
8388   { (eval echo "$as_me:8388: \"$ac_try\"") >&5
8389   (eval $ac_try) 2>&5
8390   ac_status=$?
8391   echo "$as_me:8391: \$? = $ac_status" >&5
8392   (exit $ac_status); }; }; then
8393   ac_cv_lib_gpm_Gpm_Open=yes
8394 else
8395   echo "$as_me: failed program was:" >&5
8396 cat conftest.$ac_ext >&5
8397 ac_cv_lib_gpm_Gpm_Open=no
8398 fi
8399 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8400 LIBS=$ac_check_lib_save_LIBS
8401 fi
8402 echo "$as_me:8402: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8403 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8404 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8405   echo "$as_me:8405: checking for initscr in -lgpm" >&5
8406 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8407 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8408   echo $ECHO_N "(cached) $ECHO_C" >&6
8409 else
8410   ac_check_lib_save_LIBS=$LIBS
8411 LIBS="-lgpm  $LIBS"
8412 cat >conftest.$ac_ext <<_ACEOF
8413 #line 8413 "configure"
8414 #include "confdefs.h"
8415
8416 /* Override any gcc2 internal prototype to avoid an error.  */
8417 #ifdef __cplusplus
8418 extern "C"
8419 #endif
8420 /* We use char because int might match the return type of a gcc2
8421    builtin and then its argument prototype would still apply.  */
8422 char initscr ();
8423 int
8424 main (void)
8425 {
8426 initscr ();
8427   ;
8428   return 0;
8429 }
8430 _ACEOF
8431 rm -f conftest.$ac_objext conftest$ac_exeext
8432 if { (eval echo "$as_me:8432: \"$ac_link\"") >&5
8433   (eval $ac_link) 2>&5
8434   ac_status=$?
8435   echo "$as_me:8435: \$? = $ac_status" >&5
8436   (exit $ac_status); } &&
8437          { ac_try='test -s conftest$ac_exeext'
8438   { (eval echo "$as_me:8438: \"$ac_try\"") >&5
8439   (eval $ac_try) 2>&5
8440   ac_status=$?
8441   echo "$as_me:8441: \$? = $ac_status" >&5
8442   (exit $ac_status); }; }; then
8443   ac_cv_lib_gpm_initscr=yes
8444 else
8445   echo "$as_me: failed program was:" >&5
8446 cat conftest.$ac_ext >&5
8447 ac_cv_lib_gpm_initscr=no
8448 fi
8449 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8450 LIBS=$ac_check_lib_save_LIBS
8451 fi
8452 echo "$as_me:8452: result: $ac_cv_lib_gpm_initscr" >&5
8453 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8454 if test $ac_cv_lib_gpm_initscr = yes; then
8455   LIBS="$cf_ncurses_SAVE"
8456 else
8457   cf_ncurses_LIBS="-lgpm"
8458 fi
8459
8460 fi
8461
8462 case $host_os in
8463 (freebsd*)
8464         # This is only necessary if you are linking against an obsolete
8465         # version of ncurses (but it should do no harm, since it's static).
8466         if test "$cf_nculib_root" = ncurses ; then
8467                 echo "$as_me:8467: checking for tgoto in -lmytinfo" >&5
8468 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8469 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8470   echo $ECHO_N "(cached) $ECHO_C" >&6
8471 else
8472   ac_check_lib_save_LIBS=$LIBS
8473 LIBS="-lmytinfo  $LIBS"
8474 cat >conftest.$ac_ext <<_ACEOF
8475 #line 8475 "configure"
8476 #include "confdefs.h"
8477
8478 /* Override any gcc2 internal prototype to avoid an error.  */
8479 #ifdef __cplusplus
8480 extern "C"
8481 #endif
8482 /* We use char because int might match the return type of a gcc2
8483    builtin and then its argument prototype would still apply.  */
8484 char tgoto ();
8485 int
8486 main (void)
8487 {
8488 tgoto ();
8489   ;
8490   return 0;
8491 }
8492 _ACEOF
8493 rm -f conftest.$ac_objext conftest$ac_exeext
8494 if { (eval echo "$as_me:8494: \"$ac_link\"") >&5
8495   (eval $ac_link) 2>&5
8496   ac_status=$?
8497   echo "$as_me:8497: \$? = $ac_status" >&5
8498   (exit $ac_status); } &&
8499          { ac_try='test -s conftest$ac_exeext'
8500   { (eval echo "$as_me:8500: \"$ac_try\"") >&5
8501   (eval $ac_try) 2>&5
8502   ac_status=$?
8503   echo "$as_me:8503: \$? = $ac_status" >&5
8504   (exit $ac_status); }; }; then
8505   ac_cv_lib_mytinfo_tgoto=yes
8506 else
8507   echo "$as_me: failed program was:" >&5
8508 cat conftest.$ac_ext >&5
8509 ac_cv_lib_mytinfo_tgoto=no
8510 fi
8511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8512 LIBS=$ac_check_lib_save_LIBS
8513 fi
8514 echo "$as_me:8514: result: $ac_cv_lib_mytinfo_tgoto" >&5
8515 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8516 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8517   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8518 fi
8519
8520         fi
8521         ;;
8522 esac
8523
8524 cf_add_libs="$LIBS"
8525 # reverse order
8526 cf_add_0lib=
8527 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8528 # filter duplicates
8529 for cf_add_1lib in $cf_add_0lib; do
8530         for cf_add_2lib in $cf_add_libs; do
8531                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8532                         cf_add_1lib=
8533                         break
8534                 fi
8535         done
8536         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8537 done
8538 LIBS="$cf_add_libs"
8539
8540 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8541 then
8542
8543 cf_add_libs="$LIBS"
8544 # reverse order
8545 cf_add_0lib=
8546 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8547 # filter duplicates
8548 for cf_add_1lib in $cf_add_0lib; do
8549         for cf_add_2lib in $cf_add_libs; do
8550                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8551                         cf_add_1lib=
8552                         break
8553                 fi
8554         done
8555         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8556 done
8557 LIBS="$cf_add_libs"
8558
8559 else
8560
8561         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8562         cf_libdir=""
8563         echo "$as_me:8563: checking for initscr" >&5
8564 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8565 if test "${ac_cv_func_initscr+set}" = set; then
8566   echo $ECHO_N "(cached) $ECHO_C" >&6
8567 else
8568   cat >conftest.$ac_ext <<_ACEOF
8569 #line 8569 "configure"
8570 #include "confdefs.h"
8571 #define initscr autoconf_temporary
8572 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8573 #undef initscr
8574
8575 #ifdef __cplusplus
8576 extern "C"
8577 #endif
8578
8579 /* We use char because int might match the return type of a gcc2
8580    builtin and then its argument prototype would still apply.  */
8581 char initscr (void);
8582
8583 int
8584 main (void)
8585 {
8586
8587 /* The GNU C library defines stubs for functions which it implements
8588     to always fail with ENOSYS.  Some functions are actually named
8589     something starting with __ and the normal name is an alias.  */
8590 #if defined (__stub_initscr) || defined (__stub___initscr)
8591 #error found stub for initscr
8592 #endif
8593
8594         return initscr ();
8595   ;
8596   return 0;
8597 }
8598 _ACEOF
8599 rm -f conftest.$ac_objext conftest$ac_exeext
8600 if { (eval echo "$as_me:8600: \"$ac_link\"") >&5
8601   (eval $ac_link) 2>&5
8602   ac_status=$?
8603   echo "$as_me:8603: \$? = $ac_status" >&5
8604   (exit $ac_status); } &&
8605          { ac_try='test -s conftest$ac_exeext'
8606   { (eval echo "$as_me:8606: \"$ac_try\"") >&5
8607   (eval $ac_try) 2>&5
8608   ac_status=$?
8609   echo "$as_me:8609: \$? = $ac_status" >&5
8610   (exit $ac_status); }; }; then
8611   ac_cv_func_initscr=yes
8612 else
8613   echo "$as_me: failed program was:" >&5
8614 cat conftest.$ac_ext >&5
8615 ac_cv_func_initscr=no
8616 fi
8617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8618 fi
8619 echo "$as_me:8619: result: $ac_cv_func_initscr" >&5
8620 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8621 if test $ac_cv_func_initscr = yes; then
8622   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8623 else
8624
8625                 cf_save_LIBS="$LIBS"
8626                 echo "$as_me:8626: checking for initscr in -l$cf_nculib_root" >&5
8627 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8628                 LIBS="-l$cf_nculib_root $LIBS"
8629                 cat >conftest.$ac_ext <<_ACEOF
8630 #line 8630 "configure"
8631 #include "confdefs.h"
8632 #include <${cf_cv_ncurses_header:-curses.h}>
8633 int
8634 main (void)
8635 {
8636 initscr()
8637   ;
8638   return 0;
8639 }
8640 _ACEOF
8641 rm -f conftest.$ac_objext conftest$ac_exeext
8642 if { (eval echo "$as_me:8642: \"$ac_link\"") >&5
8643   (eval $ac_link) 2>&5
8644   ac_status=$?
8645   echo "$as_me:8645: \$? = $ac_status" >&5
8646   (exit $ac_status); } &&
8647          { ac_try='test -s conftest$ac_exeext'
8648   { (eval echo "$as_me:8648: \"$ac_try\"") >&5
8649   (eval $ac_try) 2>&5
8650   ac_status=$?
8651   echo "$as_me:8651: \$? = $ac_status" >&5
8652   (exit $ac_status); }; }; then
8653   echo "$as_me:8653: result: yes" >&5
8654 echo "${ECHO_T}yes" >&6
8655                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8656
8657 else
8658   echo "$as_me: failed program was:" >&5
8659 cat conftest.$ac_ext >&5
8660 echo "$as_me:8660: result: no" >&5
8661 echo "${ECHO_T}no" >&6
8662
8663 cf_search=
8664 cf_library_path_list=""
8665 if test -n "${LDFLAGS}${LIBS}" ; then
8666         for cf_library_path in $LDFLAGS $LIBS
8667         do
8668                 case $cf_library_path in
8669                 (-L*)
8670                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8671
8672 test "x$cf_library_path" != "xNONE" && \
8673 test -d "$cf_library_path" && \
8674  {
8675         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8676         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8677         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8678         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8679         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8680         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
8681 }
8682
8683                         cf_library_path_list="$cf_library_path_list $cf_search"
8684                         ;;
8685                 esac
8686         done
8687 fi
8688
8689 cf_search=
8690
8691 test "x$prefix" != "xNONE" && \
8692 test -d "$prefix" && \
8693  {
8694         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8695         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8696         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8697         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8698         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8699         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8700 }
8701
8702 for cf_subdir_prefix in \
8703         /usr \
8704         /usr/local \
8705         /usr/pkg \
8706         /opt \
8707         /opt/local \
8708         $HOME
8709 do
8710
8711 test "x$cf_subdir_prefix" != "x$prefix" && \
8712 test -d "$cf_subdir_prefix" && \
8713 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8714         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8715         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8716         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8717         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8718         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8719         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
8720 }
8721
8722 done
8723
8724 cf_search="$cf_library_path_list $cf_search"
8725
8726                         for cf_libdir in $cf_search
8727                         do
8728                                 echo "$as_me:8728: checking for -l$cf_nculib_root in $cf_libdir" >&5
8729 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8730                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8731                                 cat >conftest.$ac_ext <<_ACEOF
8732 #line 8732 "configure"
8733 #include "confdefs.h"
8734 #include <${cf_cv_ncurses_header:-curses.h}>
8735 int
8736 main (void)
8737 {
8738 initscr()
8739   ;
8740   return 0;
8741 }
8742 _ACEOF
8743 rm -f conftest.$ac_objext conftest$ac_exeext
8744 if { (eval echo "$as_me:8744: \"$ac_link\"") >&5
8745   (eval $ac_link) 2>&5
8746   ac_status=$?
8747   echo "$as_me:8747: \$? = $ac_status" >&5
8748   (exit $ac_status); } &&
8749          { ac_try='test -s conftest$ac_exeext'
8750   { (eval echo "$as_me:8750: \"$ac_try\"") >&5
8751   (eval $ac_try) 2>&5
8752   ac_status=$?
8753   echo "$as_me:8753: \$? = $ac_status" >&5
8754   (exit $ac_status); }; }; then
8755   echo "$as_me:8755: result: yes" >&5
8756 echo "${ECHO_T}yes" >&6
8757                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8758                                          break
8759 else
8760   echo "$as_me: failed program was:" >&5
8761 cat conftest.$ac_ext >&5
8762 echo "$as_me:8762: result: no" >&5
8763 echo "${ECHO_T}no" >&6
8764                                          LIBS="$cf_save_LIBS"
8765 fi
8766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8767                         done
8768
8769 fi
8770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8771
8772 fi
8773
8774 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8775
8776 if test $cf_found_library = no ; then
8777         { { echo "$as_me:8777: error: Cannot link $cf_nculib_root library" >&5
8778 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8779    { (exit 1); exit 1; }; }
8780 fi
8781
8782 fi
8783
8784 if test -n "$cf_ncurses_LIBS" ; then
8785         echo "$as_me:8785: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8786 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8787         cf_ncurses_SAVE="$LIBS"
8788         for p in $cf_ncurses_LIBS ; do
8789                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8790                 if test "$q" != "$LIBS" ; then
8791                         LIBS="$q"
8792                 fi
8793         done
8794         cat >conftest.$ac_ext <<_ACEOF
8795 #line 8795 "configure"
8796 #include "confdefs.h"
8797 #include <${cf_cv_ncurses_header:-curses.h}>
8798 int
8799 main (void)
8800 {
8801 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8802   ;
8803   return 0;
8804 }
8805 _ACEOF
8806 rm -f conftest.$ac_objext conftest$ac_exeext
8807 if { (eval echo "$as_me:8807: \"$ac_link\"") >&5
8808   (eval $ac_link) 2>&5
8809   ac_status=$?
8810   echo "$as_me:8810: \$? = $ac_status" >&5
8811   (exit $ac_status); } &&
8812          { ac_try='test -s conftest$ac_exeext'
8813   { (eval echo "$as_me:8813: \"$ac_try\"") >&5
8814   (eval $ac_try) 2>&5
8815   ac_status=$?
8816   echo "$as_me:8816: \$? = $ac_status" >&5
8817   (exit $ac_status); }; }; then
8818   echo "$as_me:8818: result: yes" >&5
8819 echo "${ECHO_T}yes" >&6
8820 else
8821   echo "$as_me: failed program was:" >&5
8822 cat conftest.$ac_ext >&5
8823 echo "$as_me:8823: result: no" >&5
8824 echo "${ECHO_T}no" >&6
8825                  LIBS="$cf_ncurses_SAVE"
8826 fi
8827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8828 fi
8829
8830 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8831
8832 cat >>confdefs.h <<EOF
8833 #define $cf_nculib_ROOT 1
8834 EOF
8835
8836         fi
8837 else
8838         NCURSES_CONFIG=none
8839 fi
8840
8841 else
8842
8843 cf_ncuconfig_root=ncurses
8844 cf_have_ncuconfig=no
8845
8846 if test "x${PKG_CONFIG:=none}" != xnone; then
8847         echo "$as_me:8847: checking pkg-config for $cf_ncuconfig_root" >&5
8848 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8849         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8850                 echo "$as_me:8850: result: yes" >&5
8851 echo "${ECHO_T}yes" >&6
8852
8853                 echo "$as_me:8853: checking if the $cf_ncuconfig_root package files work" >&5
8854 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8855                 cf_have_ncuconfig=unknown
8856
8857                 cf_save_CFLAGS="$CFLAGS"
8858                 cf_save_CPPFLAGS="$CPPFLAGS"
8859                 cf_save_LIBS="$LIBS"
8860
8861                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
8862                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
8863
8864                 # while -W for passing linker flags is prevalent, it is not "standard".
8865                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8866                 # incompatible _and_ non-standard -W option which gives an error.  Work
8867                 # around that pitfall.
8868                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8869                 (x*c[89]9@@*-W*)
8870
8871 cf_fix_cppflags=no
8872 cf_new_cflags=
8873 cf_new_cppflags=
8874 cf_new_extra_cppflags=
8875
8876 for cf_add_cflags in $cf_pkg_cflags
8877 do
8878 case $cf_fix_cppflags in
8879 (no)
8880         case $cf_add_cflags in
8881         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8882                 case $cf_add_cflags in
8883                 (-D*)
8884                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8885
8886                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8887                                 && test -z "${cf_tst_cflags}" \
8888                                 && cf_fix_cppflags=yes
8889
8890                         if test $cf_fix_cppflags = yes ; then
8891
8892         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8893         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8894
8895                                 continue
8896                         elif test "${cf_tst_cflags}" = "\"'" ; then
8897
8898         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8899         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8900
8901                                 continue
8902                         fi
8903                         ;;
8904                 esac
8905                 case "$CPPFLAGS" in
8906                 (*$cf_add_cflags)
8907                         ;;
8908                 (*)
8909                         case $cf_add_cflags in
8910                         (-D*)
8911                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8912
8913 CPPFLAGS=`echo "$CPPFLAGS" | \
8914         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8915                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8916
8917                                 ;;
8918                         esac
8919
8920         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8921         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8922
8923                         ;;
8924                 esac
8925                 ;;
8926         (*)
8927
8928         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8929         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8930
8931                 ;;
8932         esac
8933         ;;
8934 (yes)
8935
8936         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8937         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8938
8939         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8940
8941         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8942                 && test -z "${cf_tst_cflags}" \
8943                 && cf_fix_cppflags=no
8944         ;;
8945 esac
8946 done
8947
8948 if test -n "$cf_new_cflags" ; then
8949
8950         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8951         CFLAGS="${CFLAGS}$cf_new_cflags"
8952
8953 fi
8954
8955 if test -n "$cf_new_cppflags" ; then
8956
8957         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8958         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8959
8960 fi
8961
8962 if test -n "$cf_new_extra_cppflags" ; then
8963
8964         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8965         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8966
8967 fi
8968
8969 cf_add_libs="$LIBS"
8970 # reverse order
8971 cf_add_0lib=
8972 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8973 # filter duplicates
8974 for cf_add_1lib in $cf_add_0lib; do
8975         for cf_add_2lib in $cf_add_libs; do
8976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8977                         cf_add_1lib=
8978                         break
8979                 fi
8980         done
8981         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8982 done
8983 LIBS="$cf_add_libs"
8984
8985                         cat >conftest.$ac_ext <<_ACEOF
8986 #line 8986 "configure"
8987 #include "confdefs.h"
8988 #include <${cf_cv_ncurses_header:-curses.h}>
8989 int
8990 main (void)
8991 {
8992 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8993   ;
8994   return 0;
8995 }
8996 _ACEOF
8997 rm -f conftest.$ac_objext conftest$ac_exeext
8998 if { (eval echo "$as_me:8998: \"$ac_link\"") >&5
8999   (eval $ac_link) 2>&5
9000   ac_status=$?
9001   echo "$as_me:9001: \$? = $ac_status" >&5
9002   (exit $ac_status); } &&
9003          { ac_try='test -s conftest$ac_exeext'
9004   { (eval echo "$as_me:9004: \"$ac_try\"") >&5
9005   (eval $ac_try) 2>&5
9006   ac_status=$?
9007   echo "$as_me:9007: \$? = $ac_status" >&5
9008   (exit $ac_status); }; }; then
9009   if test "$cross_compiling" = yes; then
9010   cf_test_ncuconfig=maybe
9011 else
9012   cat >conftest.$ac_ext <<_ACEOF
9013 #line 9013 "configure"
9014 #include "confdefs.h"
9015 #include <${cf_cv_ncurses_header:-curses.h}>
9016                                         int main(void)
9017                                         { char *xx = curses_version(); return (xx == 0); }
9018 _ACEOF
9019 rm -f conftest$ac_exeext
9020 if { (eval echo "$as_me:9020: \"$ac_link\"") >&5
9021   (eval $ac_link) 2>&5
9022   ac_status=$?
9023   echo "$as_me:9023: \$? = $ac_status" >&5
9024   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9025   { (eval echo "$as_me:9025: \"$ac_try\"") >&5
9026   (eval $ac_try) 2>&5
9027   ac_status=$?
9028   echo "$as_me:9028: \$? = $ac_status" >&5
9029   (exit $ac_status); }; }; then
9030   cf_test_ncuconfig=yes
9031 else
9032   echo "$as_me: program exited with status $ac_status" >&5
9033 echo "$as_me: failed program was:" >&5
9034 cat conftest.$ac_ext >&5
9035 cf_test_ncuconfig=no
9036 fi
9037 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9038 fi
9039 else
9040   echo "$as_me: failed program was:" >&5
9041 cat conftest.$ac_ext >&5
9042 cf_test_ncuconfig=no
9043 fi
9044 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9045
9046                         CFLAGS="$cf_save_CFLAGS"
9047                         CPPFLAGS="$cf_save_CPPFLAGS"
9048                         LIBS="$cf_save_LIBS"
9049
9050                         if test "x$cf_test_ncuconfig" != xyes; then
9051                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9052                                 cf_pkg_cflags="$cf_temp"
9053                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9054                                 cf_pkg_libs="$cf_temp"
9055                         fi
9056                         ;;
9057                 esac
9058
9059 cf_fix_cppflags=no
9060 cf_new_cflags=
9061 cf_new_cppflags=
9062 cf_new_extra_cppflags=
9063
9064 for cf_add_cflags in $cf_pkg_cflags
9065 do
9066 case $cf_fix_cppflags in
9067 (no)
9068         case $cf_add_cflags in
9069         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9070                 case $cf_add_cflags in
9071                 (-D*)
9072                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9073
9074                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9075                                 && test -z "${cf_tst_cflags}" \
9076                                 && cf_fix_cppflags=yes
9077
9078                         if test $cf_fix_cppflags = yes ; then
9079
9080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9082
9083                                 continue
9084                         elif test "${cf_tst_cflags}" = "\"'" ; then
9085
9086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9088
9089                                 continue
9090                         fi
9091                         ;;
9092                 esac
9093                 case "$CPPFLAGS" in
9094                 (*$cf_add_cflags)
9095                         ;;
9096                 (*)
9097                         case $cf_add_cflags in
9098                         (-D*)
9099                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9100
9101 CPPFLAGS=`echo "$CPPFLAGS" | \
9102         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9103                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9104
9105                                 ;;
9106                         esac
9107
9108         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9109         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9110
9111                         ;;
9112                 esac
9113                 ;;
9114         (*)
9115
9116         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9117         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9118
9119                 ;;
9120         esac
9121         ;;
9122 (yes)
9123
9124         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9125         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9126
9127         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9128
9129         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9130                 && test -z "${cf_tst_cflags}" \
9131                 && cf_fix_cppflags=no
9132         ;;
9133 esac
9134 done
9135
9136 if test -n "$cf_new_cflags" ; then
9137
9138         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9139         CFLAGS="${CFLAGS}$cf_new_cflags"
9140
9141 fi
9142
9143 if test -n "$cf_new_cppflags" ; then
9144
9145         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9146         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9147
9148 fi
9149
9150 if test -n "$cf_new_extra_cppflags" ; then
9151
9152         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9153         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9154
9155 fi
9156
9157 cf_add_libs="$LIBS"
9158 # reverse order
9159 cf_add_0lib=
9160 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9161 # filter duplicates
9162 for cf_add_1lib in $cf_add_0lib; do
9163         for cf_add_2lib in $cf_add_libs; do
9164                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9165                         cf_add_1lib=
9166                         break
9167                 fi
9168         done
9169         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9170 done
9171 LIBS="$cf_add_libs"
9172
9173                 cat >conftest.$ac_ext <<_ACEOF
9174 #line 9174 "configure"
9175 #include "confdefs.h"
9176 #include <${cf_cv_ncurses_header:-curses.h}>
9177 int
9178 main (void)
9179 {
9180 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9181   ;
9182   return 0;
9183 }
9184 _ACEOF
9185 rm -f conftest.$ac_objext conftest$ac_exeext
9186 if { (eval echo "$as_me:9186: \"$ac_link\"") >&5
9187   (eval $ac_link) 2>&5
9188   ac_status=$?
9189   echo "$as_me:9189: \$? = $ac_status" >&5
9190   (exit $ac_status); } &&
9191          { ac_try='test -s conftest$ac_exeext'
9192   { (eval echo "$as_me:9192: \"$ac_try\"") >&5
9193   (eval $ac_try) 2>&5
9194   ac_status=$?
9195   echo "$as_me:9195: \$? = $ac_status" >&5
9196   (exit $ac_status); }; }; then
9197   if test "$cross_compiling" = yes; then
9198   cf_have_ncuconfig=maybe
9199 else
9200   cat >conftest.$ac_ext <<_ACEOF
9201 #line 9201 "configure"
9202 #include "confdefs.h"
9203 #include <${cf_cv_ncurses_header:-curses.h}>
9204                                 int main(void)
9205                                 { char *xx = curses_version(); return (xx == 0); }
9206 _ACEOF
9207 rm -f conftest$ac_exeext
9208 if { (eval echo "$as_me:9208: \"$ac_link\"") >&5
9209   (eval $ac_link) 2>&5
9210   ac_status=$?
9211   echo "$as_me:9211: \$? = $ac_status" >&5
9212   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9213   { (eval echo "$as_me:9213: \"$ac_try\"") >&5
9214   (eval $ac_try) 2>&5
9215   ac_status=$?
9216   echo "$as_me:9216: \$? = $ac_status" >&5
9217   (exit $ac_status); }; }; then
9218   cf_have_ncuconfig=yes
9219 else
9220   echo "$as_me: program exited with status $ac_status" >&5
9221 echo "$as_me: failed program was:" >&5
9222 cat conftest.$ac_ext >&5
9223 cf_have_ncuconfig=no
9224 fi
9225 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9226 fi
9227 else
9228   echo "$as_me: failed program was:" >&5
9229 cat conftest.$ac_ext >&5
9230 cf_have_ncuconfig=no
9231 fi
9232 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9233                 echo "$as_me:9233: result: $cf_have_ncuconfig" >&5
9234 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9235                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9236                 if test "$cf_have_ncuconfig" != "yes"
9237                 then
9238                         CPPFLAGS="$cf_save_CPPFLAGS"
9239                         LIBS="$cf_save_LIBS"
9240                         NCURSES_CONFIG_PKG=none
9241                 else
9242
9243 cat >>confdefs.h <<\EOF
9244 #define NCURSES 1
9245 EOF
9246
9247                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9248
9249 echo "$as_me:9249: checking for terminfo header" >&5
9250 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9251 if test "${cf_cv_term_header+set}" = set; then
9252   echo $ECHO_N "(cached) $ECHO_C" >&6
9253 else
9254
9255 case ${cf_cv_ncurses_header} in
9256 (*/ncurses.h|*/ncursesw.h)
9257         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9258         ;;
9259 (*)
9260         cf_term_header=term.h
9261         ;;
9262 esac
9263
9264 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9265 do
9266 cat >conftest.$ac_ext <<_ACEOF
9267 #line 9267 "configure"
9268 #include "confdefs.h"
9269 #include <stdio.h>
9270 #include <${cf_cv_ncurses_header:-curses.h}>
9271 #include <$cf_test>
9272
9273 int
9274 main (void)
9275 {
9276 int x = auto_left_margin; (void)x
9277   ;
9278   return 0;
9279 }
9280 _ACEOF
9281 rm -f conftest.$ac_objext
9282 if { (eval echo "$as_me:9282: \"$ac_compile\"") >&5
9283   (eval $ac_compile) 2>&5
9284   ac_status=$?
9285   echo "$as_me:9285: \$? = $ac_status" >&5
9286   (exit $ac_status); } &&
9287          { ac_try='test -s conftest.$ac_objext'
9288   { (eval echo "$as_me:9288: \"$ac_try\"") >&5
9289   (eval $ac_try) 2>&5
9290   ac_status=$?
9291   echo "$as_me:9291: \$? = $ac_status" >&5
9292   (exit $ac_status); }; }; then
9293
9294         cf_cv_term_header="$cf_test"
9295 else
9296   echo "$as_me: failed program was:" >&5
9297 cat conftest.$ac_ext >&5
9298
9299         cf_cv_term_header=unknown
9300
9301 fi
9302 rm -f conftest.$ac_objext conftest.$ac_ext
9303         test "$cf_cv_term_header" != unknown && break
9304 done
9305
9306 fi
9307 echo "$as_me:9307: result: $cf_cv_term_header" >&5
9308 echo "${ECHO_T}$cf_cv_term_header" >&6
9309
9310 # Set definitions to allow ifdef'ing to accommodate subdirectories
9311
9312 case $cf_cv_term_header in
9313 (*term.h)
9314
9315 cat >>confdefs.h <<\EOF
9316 #define HAVE_TERM_H 1
9317 EOF
9318
9319         ;;
9320 esac
9321
9322 case $cf_cv_term_header in
9323 (ncurses/term.h)
9324
9325 cat >>confdefs.h <<\EOF
9326 #define HAVE_NCURSES_TERM_H 1
9327 EOF
9328
9329         ;;
9330 (ncursesw/term.h)
9331
9332 cat >>confdefs.h <<\EOF
9333 #define HAVE_NCURSESW_TERM_H 1
9334 EOF
9335
9336         ;;
9337 esac
9338
9339                 fi
9340
9341         else
9342                 echo "$as_me:9342: result: no" >&5
9343 echo "${ECHO_T}no" >&6
9344                 NCURSES_CONFIG_PKG=none
9345         fi
9346 else
9347         NCURSES_CONFIG_PKG=none
9348 fi
9349
9350 if test "x$cf_have_ncuconfig" = "xno"; then
9351         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9352
9353 if test -n "$ac_tool_prefix"; then
9354   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9355   do
9356     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9357 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9358 echo "$as_me:9358: checking for $ac_word" >&5
9359 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9360 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9361   echo $ECHO_N "(cached) $ECHO_C" >&6
9362 else
9363   if test -n "$NCURSES_CONFIG"; then
9364   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9365 else
9366   ac_save_IFS=$IFS; IFS=$ac_path_separator
9367 ac_dummy="$PATH"
9368 for ac_dir in $ac_dummy; do
9369   IFS=$ac_save_IFS
9370   test -z "$ac_dir" && ac_dir=.
9371   $as_executable_p "$ac_dir/$ac_word" || continue
9372 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9373 echo "$as_me:9373: found $ac_dir/$ac_word" >&5
9374 break
9375 done
9376
9377 fi
9378 fi
9379 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9380 if test -n "$NCURSES_CONFIG"; then
9381   echo "$as_me:9381: result: $NCURSES_CONFIG" >&5
9382 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9383 else
9384   echo "$as_me:9384: result: no" >&5
9385 echo "${ECHO_T}no" >&6
9386 fi
9387
9388     test -n "$NCURSES_CONFIG" && break
9389   done
9390 fi
9391 if test -z "$NCURSES_CONFIG"; then
9392   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9393   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9394 do
9395   # Extract the first word of "$ac_prog", so it can be a program name with args.
9396 set dummy $ac_prog; ac_word=$2
9397 echo "$as_me:9397: checking for $ac_word" >&5
9398 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9399 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9400   echo $ECHO_N "(cached) $ECHO_C" >&6
9401 else
9402   if test -n "$ac_ct_NCURSES_CONFIG"; then
9403   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9404 else
9405   ac_save_IFS=$IFS; IFS=$ac_path_separator
9406 ac_dummy="$PATH"
9407 for ac_dir in $ac_dummy; do
9408   IFS=$ac_save_IFS
9409   test -z "$ac_dir" && ac_dir=.
9410   $as_executable_p "$ac_dir/$ac_word" || continue
9411 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9412 echo "$as_me:9412: found $ac_dir/$ac_word" >&5
9413 break
9414 done
9415
9416 fi
9417 fi
9418 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9419 if test -n "$ac_ct_NCURSES_CONFIG"; then
9420   echo "$as_me:9420: result: $ac_ct_NCURSES_CONFIG" >&5
9421 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9422 else
9423   echo "$as_me:9423: result: no" >&5
9424 echo "${ECHO_T}no" >&6
9425 fi
9426
9427   test -n "$ac_ct_NCURSES_CONFIG" && break
9428 done
9429 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9430
9431   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9432 fi
9433
9434         if test "$NCURSES_CONFIG" != none ; then
9435
9436 cf_fix_cppflags=no
9437 cf_new_cflags=
9438 cf_new_cppflags=
9439 cf_new_extra_cppflags=
9440
9441 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9442 do
9443 case $cf_fix_cppflags in
9444 (no)
9445         case $cf_add_cflags in
9446         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9447                 case $cf_add_cflags in
9448                 (-D*)
9449                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9450
9451                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9452                                 && test -z "${cf_tst_cflags}" \
9453                                 && cf_fix_cppflags=yes
9454
9455                         if test $cf_fix_cppflags = yes ; then
9456
9457         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9458         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9459
9460                                 continue
9461                         elif test "${cf_tst_cflags}" = "\"'" ; then
9462
9463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9465
9466                                 continue
9467                         fi
9468                         ;;
9469                 esac
9470                 case "$CPPFLAGS" in
9471                 (*$cf_add_cflags)
9472                         ;;
9473                 (*)
9474                         case $cf_add_cflags in
9475                         (-D*)
9476                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9477
9478 CPPFLAGS=`echo "$CPPFLAGS" | \
9479         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9480                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9481
9482                                 ;;
9483                         esac
9484
9485         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9486         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9487
9488                         ;;
9489                 esac
9490                 ;;
9491         (*)
9492
9493         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9494         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9495
9496                 ;;
9497         esac
9498         ;;
9499 (yes)
9500
9501         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9502         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9503
9504         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9505
9506         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9507                 && test -z "${cf_tst_cflags}" \
9508                 && cf_fix_cppflags=no
9509         ;;
9510 esac
9511 done
9512
9513 if test -n "$cf_new_cflags" ; then
9514
9515         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9516         CFLAGS="${CFLAGS}$cf_new_cflags"
9517
9518 fi
9519
9520 if test -n "$cf_new_cppflags" ; then
9521
9522         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9523         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9524
9525 fi
9526
9527 if test -n "$cf_new_extra_cppflags" ; then
9528
9529         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9530         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9531
9532 fi
9533
9534 cf_add_libs="$LIBS"
9535 # reverse order
9536 cf_add_0lib=
9537 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9538 # filter duplicates
9539 for cf_add_1lib in $cf_add_0lib; do
9540         for cf_add_2lib in $cf_add_libs; do
9541                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9542                         cf_add_1lib=
9543                         break
9544                 fi
9545         done
9546         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9547 done
9548 LIBS="$cf_add_libs"
9549
9550                 # even with config script, some packages use no-override for curses.h
9551
9552 echo "$as_me:9552: checking if we have identified curses headers" >&5
9553 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9554 if test "${cf_cv_ncurses_header+set}" = set; then
9555   echo $ECHO_N "(cached) $ECHO_C" >&6
9556 else
9557
9558 cf_cv_ncurses_header=none
9559 for cf_header in \
9560         ncurses.h ncurses/ncurses.h \
9561         curses.h ncurses/curses.h
9562 do
9563 cat >conftest.$ac_ext <<_ACEOF
9564 #line 9564 "configure"
9565 #include "confdefs.h"
9566 #include <${cf_header}>
9567 int
9568 main (void)
9569 {
9570 initscr(); tgoto("?", 0,0)
9571   ;
9572   return 0;
9573 }
9574 _ACEOF
9575 rm -f conftest.$ac_objext
9576 if { (eval echo "$as_me:9576: \"$ac_compile\"") >&5
9577   (eval $ac_compile) 2>&5
9578   ac_status=$?
9579   echo "$as_me:9579: \$? = $ac_status" >&5
9580   (exit $ac_status); } &&
9581          { ac_try='test -s conftest.$ac_objext'
9582   { (eval echo "$as_me:9582: \"$ac_try\"") >&5
9583   (eval $ac_try) 2>&5
9584   ac_status=$?
9585   echo "$as_me:9585: \$? = $ac_status" >&5
9586   (exit $ac_status); }; }; then
9587   cf_cv_ncurses_header=$cf_header; break
9588 else
9589   echo "$as_me: failed program was:" >&5
9590 cat conftest.$ac_ext >&5
9591 fi
9592 rm -f conftest.$ac_objext conftest.$ac_ext
9593 done
9594
9595 fi
9596 echo "$as_me:9596: result: $cf_cv_ncurses_header" >&5
9597 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9598
9599 if test "$cf_cv_ncurses_header" = none ; then
9600         { { echo "$as_me:9600: error: No curses header-files found" >&5
9601 echo "$as_me: error: No curses header-files found" >&2;}
9602    { (exit 1); exit 1; }; }
9603 fi
9604
9605 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9606
9607 for ac_header in $cf_cv_ncurses_header
9608 do
9609 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9610 echo "$as_me:9610: checking for $ac_header" >&5
9611 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9612 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9613   echo $ECHO_N "(cached) $ECHO_C" >&6
9614 else
9615   cat >conftest.$ac_ext <<_ACEOF
9616 #line 9616 "configure"
9617 #include "confdefs.h"
9618 #include <$ac_header>
9619 _ACEOF
9620 if { (eval echo "$as_me:9620: \"$ac_cpp conftest.$ac_ext\"") >&5
9621   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9622   ac_status=$?
9623   egrep -v '^ *\+' conftest.er1 >conftest.err
9624   rm -f conftest.er1
9625   cat conftest.err >&5
9626   echo "$as_me:9626: \$? = $ac_status" >&5
9627   (exit $ac_status); } >/dev/null; then
9628   if test -s conftest.err; then
9629     ac_cpp_err=$ac_c_preproc_warn_flag
9630   else
9631     ac_cpp_err=
9632   fi
9633 else
9634   ac_cpp_err=yes
9635 fi
9636 if test -z "$ac_cpp_err"; then
9637   eval "$as_ac_Header=yes"
9638 else
9639   echo "$as_me: failed program was:" >&5
9640   cat conftest.$ac_ext >&5
9641   eval "$as_ac_Header=no"
9642 fi
9643 rm -f conftest.err conftest.$ac_ext
9644 fi
9645 echo "$as_me:9645: result: `eval echo '${'$as_ac_Header'}'`" >&5
9646 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9647 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9648   cat >>confdefs.h <<EOF
9649 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9650 EOF
9651
9652 fi
9653 done
9654
9655 cat >>confdefs.h <<\EOF
9656 #define NCURSES 1
9657 EOF
9658
9659 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9660
9661                 cat >>confdefs.h <<EOF
9662 #define $cf_nculib_ROOT 1
9663 EOF
9664
9665                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9666
9667         else
9668
9669 cf_ncuhdr_root=ncurses
9670
9671 test -n "$cf_cv_curses_dir" && \
9672 test "$cf_cv_curses_dir" != "no" && { \
9673
9674 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9675   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9676   do
9677         while test $cf_add_incdir != /usr/include
9678         do
9679           if test -d $cf_add_incdir
9680           then
9681                 cf_have_incdir=no
9682                 if test -n "$CFLAGS$CPPFLAGS" ; then
9683                   # a loop is needed to ensure we can add subdirs of existing dirs
9684                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9685                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9686                           cf_have_incdir=yes; break
9687                         fi
9688                   done
9689                 fi
9690
9691                 if test "$cf_have_incdir" = no ; then
9692                   if test "$cf_add_incdir" = /usr/local/include ; then
9693                         if test "$GCC" = yes
9694                         then
9695                           cf_save_CPPFLAGS=$CPPFLAGS
9696
9697         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9698         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9699
9700                           cat >conftest.$ac_ext <<_ACEOF
9701 #line 9701 "configure"
9702 #include "confdefs.h"
9703 #include <stdio.h>
9704 int
9705 main (void)
9706 {
9707 printf("Hello")
9708   ;
9709   return 0;
9710 }
9711 _ACEOF
9712 rm -f conftest.$ac_objext
9713 if { (eval echo "$as_me:9713: \"$ac_compile\"") >&5
9714   (eval $ac_compile) 2>&5
9715   ac_status=$?
9716   echo "$as_me:9716: \$? = $ac_status" >&5
9717   (exit $ac_status); } &&
9718          { ac_try='test -s conftest.$ac_objext'
9719   { (eval echo "$as_me:9719: \"$ac_try\"") >&5
9720   (eval $ac_try) 2>&5
9721   ac_status=$?
9722   echo "$as_me:9722: \$? = $ac_status" >&5
9723   (exit $ac_status); }; }; then
9724   :
9725 else
9726   echo "$as_me: failed program was:" >&5
9727 cat conftest.$ac_ext >&5
9728 cf_have_incdir=yes
9729 fi
9730 rm -f conftest.$ac_objext conftest.$ac_ext
9731                           CPPFLAGS=$cf_save_CPPFLAGS
9732                         fi
9733                   fi
9734                 fi
9735
9736                 if test "$cf_have_incdir" = no ; then
9737                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9738
9739 echo "${as_me:-configure}:9739: testing adding $cf_add_incdir to include-path ..." 1>&5
9740
9741                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9742
9743                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9744                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9745                   cf_add_incdir="$cf_top_incdir"
9746                 else
9747                   break
9748                 fi
9749           else
9750                 break
9751           fi
9752         done
9753   done
9754 fi
9755
9756 }
9757
9758 echo "$as_me:9758: checking for $cf_ncuhdr_root header in include-path" >&5
9759 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9760 if test "${cf_cv_ncurses_h+set}" = set; then
9761   echo $ECHO_N "(cached) $ECHO_C" >&6
9762 else
9763
9764         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9765         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9766         for cf_header in $cf_header_list
9767         do
9768
9769         cat >conftest.$ac_ext <<_ACEOF
9770 #line 9770 "configure"
9771 #include "confdefs.h"
9772
9773 #include <$cf_header>
9774 int
9775 main (void)
9776 {
9777
9778 #ifdef NCURSES_VERSION
9779
9780 printf("%s\n", NCURSES_VERSION);
9781 #else
9782 #ifdef __NCURSES_H
9783 printf("old\n");
9784 #else
9785         make an error
9786 #endif
9787 #endif
9788
9789   ;
9790   return 0;
9791 }
9792 _ACEOF
9793 rm -f conftest.$ac_objext
9794 if { (eval echo "$as_me:9794: \"$ac_compile\"") >&5
9795   (eval $ac_compile) 2>&5
9796   ac_status=$?
9797   echo "$as_me:9797: \$? = $ac_status" >&5
9798   (exit $ac_status); } &&
9799          { ac_try='test -s conftest.$ac_objext'
9800   { (eval echo "$as_me:9800: \"$ac_try\"") >&5
9801   (eval $ac_try) 2>&5
9802   ac_status=$?
9803   echo "$as_me:9803: \$? = $ac_status" >&5
9804   (exit $ac_status); }; }; then
9805   cf_cv_ncurses_h=$cf_header
9806
9807 else
9808   echo "$as_me: failed program was:" >&5
9809 cat conftest.$ac_ext >&5
9810 cf_cv_ncurses_h=no
9811 fi
9812 rm -f conftest.$ac_objext conftest.$ac_ext
9813
9814                 test "$cf_cv_ncurses_h" != no && break
9815         done
9816
9817 fi
9818 echo "$as_me:9818: result: $cf_cv_ncurses_h" >&5
9819 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9820
9821 if test "$cf_cv_ncurses_h" != no ; then
9822         cf_cv_ncurses_header=$cf_cv_ncurses_h
9823 else
9824
9825 echo "$as_me:9825: checking for $cf_ncuhdr_root include-path" >&5
9826 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9827 if test "${cf_cv_ncurses_h2+set}" = set; then
9828   echo $ECHO_N "(cached) $ECHO_C" >&6
9829 else
9830
9831         test -n "$verbose" && echo
9832
9833 cf_search=
9834
9835 # collect the current set of include-directories from compiler flags
9836 cf_header_path_list=""
9837 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9838         for cf_header_path in $CPPFLAGS $CFLAGS
9839         do
9840                 case $cf_header_path in
9841                 (-I*)
9842                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9843
9844 test "x$cf_header_path" != "xNONE" && \
9845 test -d "$cf_header_path" && \
9846  {
9847         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9848         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9849         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9850         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9851         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9852         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9853 }
9854
9855                         cf_header_path_list="$cf_header_path_list $cf_search"
9856                         ;;
9857                 esac
9858         done
9859 fi
9860
9861 # add the variations for the package we are looking for
9862
9863 cf_search=
9864
9865 test "x$prefix" != "xNONE" && \
9866 test -d "$prefix" && \
9867  {
9868         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9869         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9870         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9871         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9872         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9873         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9874 }
9875
9876 for cf_subdir_prefix in \
9877         /usr \
9878         /usr/local \
9879         /usr/pkg \
9880         /opt \
9881         /opt/local \
9882         $HOME
9883 do
9884
9885 test "x$cf_subdir_prefix" != "x$prefix" && \
9886 test -d "$cf_subdir_prefix" && \
9887 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9888         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9889         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9890         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9891         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9892         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9893         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9894 }
9895
9896 done
9897
9898 test "$includedir" != NONE && \
9899 test "$includedir" != "/usr/include" && \
9900 test -d "$includedir" && {
9901         test -d $includedir &&    cf_search="$cf_search $includedir"
9902         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9903 }
9904
9905 test "$oldincludedir" != NONE && \
9906 test "$oldincludedir" != "/usr/include" && \
9907 test -d "$oldincludedir" && {
9908         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9909         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9910 }
9911
9912 cf_search="$cf_search $cf_header_path_list"
9913
9914         test -n "$verbose" && echo search path $cf_search
9915         cf_save2_CPPFLAGS="$CPPFLAGS"
9916         for cf_incdir in $cf_search
9917         do
9918
9919 if test -n "$cf_incdir" ; then
9920   for cf_add_incdir in $cf_incdir
9921   do
9922         while test $cf_add_incdir != /usr/include
9923         do
9924           if test -d $cf_add_incdir
9925           then
9926                 cf_have_incdir=no
9927                 if test -n "$CFLAGS$CPPFLAGS" ; then
9928                   # a loop is needed to ensure we can add subdirs of existing dirs
9929                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9930                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9931                           cf_have_incdir=yes; break
9932                         fi
9933                   done
9934                 fi
9935
9936                 if test "$cf_have_incdir" = no ; then
9937                   if test "$cf_add_incdir" = /usr/local/include ; then
9938                         if test "$GCC" = yes
9939                         then
9940                           cf_save_CPPFLAGS=$CPPFLAGS
9941
9942         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9943         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9944
9945                           cat >conftest.$ac_ext <<_ACEOF
9946 #line 9946 "configure"
9947 #include "confdefs.h"
9948 #include <stdio.h>
9949 int
9950 main (void)
9951 {
9952 printf("Hello")
9953   ;
9954   return 0;
9955 }
9956 _ACEOF
9957 rm -f conftest.$ac_objext
9958 if { (eval echo "$as_me:9958: \"$ac_compile\"") >&5
9959   (eval $ac_compile) 2>&5
9960   ac_status=$?
9961   echo "$as_me:9961: \$? = $ac_status" >&5
9962   (exit $ac_status); } &&
9963          { ac_try='test -s conftest.$ac_objext'
9964   { (eval echo "$as_me:9964: \"$ac_try\"") >&5
9965   (eval $ac_try) 2>&5
9966   ac_status=$?
9967   echo "$as_me:9967: \$? = $ac_status" >&5
9968   (exit $ac_status); }; }; then
9969   :
9970 else
9971   echo "$as_me: failed program was:" >&5
9972 cat conftest.$ac_ext >&5
9973 cf_have_incdir=yes
9974 fi
9975 rm -f conftest.$ac_objext conftest.$ac_ext
9976                           CPPFLAGS=$cf_save_CPPFLAGS
9977                         fi
9978                   fi
9979                 fi
9980
9981                 if test "$cf_have_incdir" = no ; then
9982                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9983
9984 echo "${as_me:-configure}:9984: testing adding $cf_add_incdir to include-path ..." 1>&5
9985
9986                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9987
9988                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9989                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9990                   cf_add_incdir="$cf_top_incdir"
9991                 else
9992                   break
9993                 fi
9994           else
9995                 break
9996           fi
9997         done
9998   done
9999 fi
10000
10001                 for cf_header in \
10002                         ncurses.h \
10003                         curses.h
10004                 do
10005
10006         cat >conftest.$ac_ext <<_ACEOF
10007 #line 10007 "configure"
10008 #include "confdefs.h"
10009
10010 #include <$cf_header>
10011 int
10012 main (void)
10013 {
10014
10015 #ifdef NCURSES_VERSION
10016
10017 printf("%s\n", NCURSES_VERSION);
10018 #else
10019 #ifdef __NCURSES_H
10020 printf("old\n");
10021 #else
10022         make an error
10023 #endif
10024 #endif
10025
10026   ;
10027   return 0;
10028 }
10029 _ACEOF
10030 rm -f conftest.$ac_objext
10031 if { (eval echo "$as_me:10031: \"$ac_compile\"") >&5
10032   (eval $ac_compile) 2>&5
10033   ac_status=$?
10034   echo "$as_me:10034: \$? = $ac_status" >&5
10035   (exit $ac_status); } &&
10036          { ac_try='test -s conftest.$ac_objext'
10037   { (eval echo "$as_me:10037: \"$ac_try\"") >&5
10038   (eval $ac_try) 2>&5
10039   ac_status=$?
10040   echo "$as_me:10040: \$? = $ac_status" >&5
10041   (exit $ac_status); }; }; then
10042   cf_cv_ncurses_h2=$cf_header
10043
10044 else
10045   echo "$as_me: failed program was:" >&5
10046 cat conftest.$ac_ext >&5
10047 cf_cv_ncurses_h2=no
10048 fi
10049 rm -f conftest.$ac_objext conftest.$ac_ext
10050
10051                         if test "$cf_cv_ncurses_h2" != no ; then
10052                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10053                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10054                                 break
10055                         fi
10056                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10057                 done
10058                 CPPFLAGS="$cf_save2_CPPFLAGS"
10059                 test "$cf_cv_ncurses_h2" != no && break
10060         done
10061         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10061: error: not found" >&5
10062 echo "$as_me: error: not found" >&2;}
10063    { (exit 1); exit 1; }; }
10064
10065 fi
10066 echo "$as_me:10066: result: $cf_cv_ncurses_h2" >&5
10067 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10068
10069         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10070         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10071         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10072                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10073         fi
10074
10075 if test -n "$cf_1st_incdir" ; then
10076   for cf_add_incdir in $cf_1st_incdir
10077   do
10078         while test $cf_add_incdir != /usr/include
10079         do
10080           if test -d $cf_add_incdir
10081           then
10082                 cf_have_incdir=no
10083                 if test -n "$CFLAGS$CPPFLAGS" ; then
10084                   # a loop is needed to ensure we can add subdirs of existing dirs
10085                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10086                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10087                           cf_have_incdir=yes; break
10088                         fi
10089                   done
10090                 fi
10091
10092                 if test "$cf_have_incdir" = no ; then
10093                   if test "$cf_add_incdir" = /usr/local/include ; then
10094                         if test "$GCC" = yes
10095                         then
10096                           cf_save_CPPFLAGS=$CPPFLAGS
10097
10098         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10099         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10100
10101                           cat >conftest.$ac_ext <<_ACEOF
10102 #line 10102 "configure"
10103 #include "confdefs.h"
10104 #include <stdio.h>
10105 int
10106 main (void)
10107 {
10108 printf("Hello")
10109   ;
10110   return 0;
10111 }
10112 _ACEOF
10113 rm -f conftest.$ac_objext
10114 if { (eval echo "$as_me:10114: \"$ac_compile\"") >&5
10115   (eval $ac_compile) 2>&5
10116   ac_status=$?
10117   echo "$as_me:10117: \$? = $ac_status" >&5
10118   (exit $ac_status); } &&
10119          { ac_try='test -s conftest.$ac_objext'
10120   { (eval echo "$as_me:10120: \"$ac_try\"") >&5
10121   (eval $ac_try) 2>&5
10122   ac_status=$?
10123   echo "$as_me:10123: \$? = $ac_status" >&5
10124   (exit $ac_status); }; }; then
10125   :
10126 else
10127   echo "$as_me: failed program was:" >&5
10128 cat conftest.$ac_ext >&5
10129 cf_have_incdir=yes
10130 fi
10131 rm -f conftest.$ac_objext conftest.$ac_ext
10132                           CPPFLAGS=$cf_save_CPPFLAGS
10133                         fi
10134                   fi
10135                 fi
10136
10137                 if test "$cf_have_incdir" = no ; then
10138                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10139
10140 echo "${as_me:-configure}:10140: testing adding $cf_add_incdir to include-path ..." 1>&5
10141
10142                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10143
10144                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10145                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10146                   cf_add_incdir="$cf_top_incdir"
10147                 else
10148                   break
10149                 fi
10150           else
10151                 break
10152           fi
10153         done
10154   done
10155 fi
10156
10157 fi
10158
10159 # Set definitions to allow ifdef'ing for ncurses.h
10160
10161 case $cf_cv_ncurses_header in
10162 (*ncurses.h)
10163
10164 cat >>confdefs.h <<\EOF
10165 #define HAVE_NCURSES_H 1
10166 EOF
10167
10168         ;;
10169 esac
10170
10171 case $cf_cv_ncurses_header in
10172 (ncurses/curses.h|ncurses/ncurses.h)
10173
10174 cat >>confdefs.h <<\EOF
10175 #define HAVE_NCURSES_NCURSES_H 1
10176 EOF
10177
10178         ;;
10179 (ncursesw/curses.h|ncursesw/ncurses.h)
10180
10181 cat >>confdefs.h <<\EOF
10182 #define HAVE_NCURSESW_NCURSES_H 1
10183 EOF
10184
10185         ;;
10186 esac
10187
10188 echo "$as_me:10188: checking for terminfo header" >&5
10189 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10190 if test "${cf_cv_term_header+set}" = set; then
10191   echo $ECHO_N "(cached) $ECHO_C" >&6
10192 else
10193
10194 case ${cf_cv_ncurses_header} in
10195 (*/ncurses.h|*/ncursesw.h)
10196         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10197         ;;
10198 (*)
10199         cf_term_header=term.h
10200         ;;
10201 esac
10202
10203 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10204 do
10205 cat >conftest.$ac_ext <<_ACEOF
10206 #line 10206 "configure"
10207 #include "confdefs.h"
10208 #include <stdio.h>
10209 #include <${cf_cv_ncurses_header:-curses.h}>
10210 #include <$cf_test>
10211
10212 int
10213 main (void)
10214 {
10215 int x = auto_left_margin; (void)x
10216   ;
10217   return 0;
10218 }
10219 _ACEOF
10220 rm -f conftest.$ac_objext
10221 if { (eval echo "$as_me:10221: \"$ac_compile\"") >&5
10222   (eval $ac_compile) 2>&5
10223   ac_status=$?
10224   echo "$as_me:10224: \$? = $ac_status" >&5
10225   (exit $ac_status); } &&
10226          { ac_try='test -s conftest.$ac_objext'
10227   { (eval echo "$as_me:10227: \"$ac_try\"") >&5
10228   (eval $ac_try) 2>&5
10229   ac_status=$?
10230   echo "$as_me:10230: \$? = $ac_status" >&5
10231   (exit $ac_status); }; }; then
10232
10233         cf_cv_term_header="$cf_test"
10234 else
10235   echo "$as_me: failed program was:" >&5
10236 cat conftest.$ac_ext >&5
10237
10238         cf_cv_term_header=unknown
10239
10240 fi
10241 rm -f conftest.$ac_objext conftest.$ac_ext
10242         test "$cf_cv_term_header" != unknown && break
10243 done
10244
10245 fi
10246 echo "$as_me:10246: result: $cf_cv_term_header" >&5
10247 echo "${ECHO_T}$cf_cv_term_header" >&6
10248
10249 # Set definitions to allow ifdef'ing to accommodate subdirectories
10250
10251 case $cf_cv_term_header in
10252 (*term.h)
10253
10254 cat >>confdefs.h <<\EOF
10255 #define HAVE_TERM_H 1
10256 EOF
10257
10258         ;;
10259 esac
10260
10261 case $cf_cv_term_header in
10262 (ncurses/term.h)
10263
10264 cat >>confdefs.h <<\EOF
10265 #define HAVE_NCURSES_TERM_H 1
10266 EOF
10267
10268         ;;
10269 (ncursesw/term.h)
10270
10271 cat >>confdefs.h <<\EOF
10272 #define HAVE_NCURSESW_TERM_H 1
10273 EOF
10274
10275         ;;
10276 esac
10277
10278 # some applications need this, but should check for NCURSES_VERSION
10279
10280 cat >>confdefs.h <<\EOF
10281 #define NCURSES 1
10282 EOF
10283
10284 echo "$as_me:10284: checking for ncurses version" >&5
10285 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10286 if test "${cf_cv_ncurses_version+set}" = set; then
10287   echo $ECHO_N "(cached) $ECHO_C" >&6
10288 else
10289
10290         cf_cv_ncurses_version=no
10291         cf_tempfile=out$$
10292         rm -f $cf_tempfile
10293         if test "$cross_compiling" = yes; then
10294
10295         # This will not work if the preprocessor splits the line after the
10296         # Autoconf token.  The 'unproto' program does that.
10297         cat > conftest.$ac_ext <<EOF
10298 #include <${cf_cv_ncurses_header:-curses.h}>
10299 #undef Autoconf
10300 #ifdef NCURSES_VERSION
10301 Autoconf NCURSES_VERSION
10302 #else
10303 #ifdef __NCURSES_H
10304 Autoconf "old"
10305 #endif
10306 ;
10307 #endif
10308 EOF
10309         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10310         { (eval echo "$as_me:10310: \"$cf_try\"") >&5
10311   (eval $cf_try) 2>&5
10312   ac_status=$?
10313   echo "$as_me:10313: \$? = $ac_status" >&5
10314   (exit $ac_status); }
10315         if test -f conftest.out ; then
10316                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10317                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10318                 rm -f conftest.out
10319         fi
10320
10321 else
10322   cat >conftest.$ac_ext <<_ACEOF
10323 #line 10323 "configure"
10324 #include "confdefs.h"
10325
10326 #include <${cf_cv_ncurses_header:-curses.h}>
10327 #include <stdio.h>
10328 int main(void)
10329 {
10330         FILE *fp = fopen("$cf_tempfile", "w");
10331 #ifdef NCURSES_VERSION
10332 # ifdef NCURSES_VERSION_PATCH
10333         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10334 # else
10335         fprintf(fp, "%s\n", NCURSES_VERSION);
10336 # endif
10337 #else
10338 # ifdef __NCURSES_H
10339         fprintf(fp, "old\n");
10340 # else
10341         make an error
10342 # endif
10343 #endif
10344         ${cf_cv_main_return:-return}(0);
10345 }
10346 _ACEOF
10347 rm -f conftest$ac_exeext
10348 if { (eval echo "$as_me:10348: \"$ac_link\"") >&5
10349   (eval $ac_link) 2>&5
10350   ac_status=$?
10351   echo "$as_me:10351: \$? = $ac_status" >&5
10352   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10353   { (eval echo "$as_me:10353: \"$ac_try\"") >&5
10354   (eval $ac_try) 2>&5
10355   ac_status=$?
10356   echo "$as_me:10356: \$? = $ac_status" >&5
10357   (exit $ac_status); }; }; then
10358
10359         cf_cv_ncurses_version=`cat $cf_tempfile`
10360 else
10361   echo "$as_me: program exited with status $ac_status" >&5
10362 echo "$as_me: failed program was:" >&5
10363 cat conftest.$ac_ext >&5
10364 fi
10365 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10366 fi
10367         rm -f $cf_tempfile
10368
10369 fi
10370 echo "$as_me:10370: result: $cf_cv_ncurses_version" >&5
10371 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10372 test "$cf_cv_ncurses_version" = no ||
10373 cat >>confdefs.h <<\EOF
10374 #define NCURSES 1
10375 EOF
10376
10377 cf_nculib_root=ncurses
10378         # This works, except for the special case where we find gpm, but
10379         # ncurses is in a nonstandard location via $LIBS, and we really want
10380         # to link gpm.
10381 cf_ncurses_LIBS=""
10382 cf_ncurses_SAVE="$LIBS"
10383 echo "$as_me:10383: checking for Gpm_Open in -lgpm" >&5
10384 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10385 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10386   echo $ECHO_N "(cached) $ECHO_C" >&6
10387 else
10388   ac_check_lib_save_LIBS=$LIBS
10389 LIBS="-lgpm  $LIBS"
10390 cat >conftest.$ac_ext <<_ACEOF
10391 #line 10391 "configure"
10392 #include "confdefs.h"
10393
10394 /* Override any gcc2 internal prototype to avoid an error.  */
10395 #ifdef __cplusplus
10396 extern "C"
10397 #endif
10398 /* We use char because int might match the return type of a gcc2
10399    builtin and then its argument prototype would still apply.  */
10400 char Gpm_Open ();
10401 int
10402 main (void)
10403 {
10404 Gpm_Open ();
10405   ;
10406   return 0;
10407 }
10408 _ACEOF
10409 rm -f conftest.$ac_objext conftest$ac_exeext
10410 if { (eval echo "$as_me:10410: \"$ac_link\"") >&5
10411   (eval $ac_link) 2>&5
10412   ac_status=$?
10413   echo "$as_me:10413: \$? = $ac_status" >&5
10414   (exit $ac_status); } &&
10415          { ac_try='test -s conftest$ac_exeext'
10416   { (eval echo "$as_me:10416: \"$ac_try\"") >&5
10417   (eval $ac_try) 2>&5
10418   ac_status=$?
10419   echo "$as_me:10419: \$? = $ac_status" >&5
10420   (exit $ac_status); }; }; then
10421   ac_cv_lib_gpm_Gpm_Open=yes
10422 else
10423   echo "$as_me: failed program was:" >&5
10424 cat conftest.$ac_ext >&5
10425 ac_cv_lib_gpm_Gpm_Open=no
10426 fi
10427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10428 LIBS=$ac_check_lib_save_LIBS
10429 fi
10430 echo "$as_me:10430: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10431 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10432 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10433   echo "$as_me:10433: checking for initscr in -lgpm" >&5
10434 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10435 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10436   echo $ECHO_N "(cached) $ECHO_C" >&6
10437 else
10438   ac_check_lib_save_LIBS=$LIBS
10439 LIBS="-lgpm  $LIBS"
10440 cat >conftest.$ac_ext <<_ACEOF
10441 #line 10441 "configure"
10442 #include "confdefs.h"
10443
10444 /* Override any gcc2 internal prototype to avoid an error.  */
10445 #ifdef __cplusplus
10446 extern "C"
10447 #endif
10448 /* We use char because int might match the return type of a gcc2
10449    builtin and then its argument prototype would still apply.  */
10450 char initscr ();
10451 int
10452 main (void)
10453 {
10454 initscr ();
10455   ;
10456   return 0;
10457 }
10458 _ACEOF
10459 rm -f conftest.$ac_objext conftest$ac_exeext
10460 if { (eval echo "$as_me:10460: \"$ac_link\"") >&5
10461   (eval $ac_link) 2>&5
10462   ac_status=$?
10463   echo "$as_me:10463: \$? = $ac_status" >&5
10464   (exit $ac_status); } &&
10465          { ac_try='test -s conftest$ac_exeext'
10466   { (eval echo "$as_me:10466: \"$ac_try\"") >&5
10467   (eval $ac_try) 2>&5
10468   ac_status=$?
10469   echo "$as_me:10469: \$? = $ac_status" >&5
10470   (exit $ac_status); }; }; then
10471   ac_cv_lib_gpm_initscr=yes
10472 else
10473   echo "$as_me: failed program was:" >&5
10474 cat conftest.$ac_ext >&5
10475 ac_cv_lib_gpm_initscr=no
10476 fi
10477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10478 LIBS=$ac_check_lib_save_LIBS
10479 fi
10480 echo "$as_me:10480: result: $ac_cv_lib_gpm_initscr" >&5
10481 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10482 if test $ac_cv_lib_gpm_initscr = yes; then
10483   LIBS="$cf_ncurses_SAVE"
10484 else
10485   cf_ncurses_LIBS="-lgpm"
10486 fi
10487
10488 fi
10489
10490 case $host_os in
10491 (freebsd*)
10492         # This is only necessary if you are linking against an obsolete
10493         # version of ncurses (but it should do no harm, since it's static).
10494         if test "$cf_nculib_root" = ncurses ; then
10495                 echo "$as_me:10495: checking for tgoto in -lmytinfo" >&5
10496 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10497 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10498   echo $ECHO_N "(cached) $ECHO_C" >&6
10499 else
10500   ac_check_lib_save_LIBS=$LIBS
10501 LIBS="-lmytinfo  $LIBS"
10502 cat >conftest.$ac_ext <<_ACEOF
10503 #line 10503 "configure"
10504 #include "confdefs.h"
10505
10506 /* Override any gcc2 internal prototype to avoid an error.  */
10507 #ifdef __cplusplus
10508 extern "C"
10509 #endif
10510 /* We use char because int might match the return type of a gcc2
10511    builtin and then its argument prototype would still apply.  */
10512 char tgoto ();
10513 int
10514 main (void)
10515 {
10516 tgoto ();
10517   ;
10518   return 0;
10519 }
10520 _ACEOF
10521 rm -f conftest.$ac_objext conftest$ac_exeext
10522 if { (eval echo "$as_me:10522: \"$ac_link\"") >&5
10523   (eval $ac_link) 2>&5
10524   ac_status=$?
10525   echo "$as_me:10525: \$? = $ac_status" >&5
10526   (exit $ac_status); } &&
10527          { ac_try='test -s conftest$ac_exeext'
10528   { (eval echo "$as_me:10528: \"$ac_try\"") >&5
10529   (eval $ac_try) 2>&5
10530   ac_status=$?
10531   echo "$as_me:10531: \$? = $ac_status" >&5
10532   (exit $ac_status); }; }; then
10533   ac_cv_lib_mytinfo_tgoto=yes
10534 else
10535   echo "$as_me: failed program was:" >&5
10536 cat conftest.$ac_ext >&5
10537 ac_cv_lib_mytinfo_tgoto=no
10538 fi
10539 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10540 LIBS=$ac_check_lib_save_LIBS
10541 fi
10542 echo "$as_me:10542: result: $ac_cv_lib_mytinfo_tgoto" >&5
10543 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10544 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10545   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10546 fi
10547
10548         fi
10549         ;;
10550 esac
10551
10552 cf_add_libs="$LIBS"
10553 # reverse order
10554 cf_add_0lib=
10555 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10556 # filter duplicates
10557 for cf_add_1lib in $cf_add_0lib; do
10558         for cf_add_2lib in $cf_add_libs; do
10559                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10560                         cf_add_1lib=
10561                         break
10562                 fi
10563         done
10564         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10565 done
10566 LIBS="$cf_add_libs"
10567
10568 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10569 then
10570
10571 cf_add_libs="$LIBS"
10572 # reverse order
10573 cf_add_0lib=
10574 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10575 # filter duplicates
10576 for cf_add_1lib in $cf_add_0lib; do
10577         for cf_add_2lib in $cf_add_libs; do
10578                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10579                         cf_add_1lib=
10580                         break
10581                 fi
10582         done
10583         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10584 done
10585 LIBS="$cf_add_libs"
10586
10587 else
10588
10589         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10590         cf_libdir=""
10591         echo "$as_me:10591: checking for initscr" >&5
10592 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10593 if test "${ac_cv_func_initscr+set}" = set; then
10594   echo $ECHO_N "(cached) $ECHO_C" >&6
10595 else
10596   cat >conftest.$ac_ext <<_ACEOF
10597 #line 10597 "configure"
10598 #include "confdefs.h"
10599 #define initscr autoconf_temporary
10600 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10601 #undef initscr
10602
10603 #ifdef __cplusplus
10604 extern "C"
10605 #endif
10606
10607 /* We use char because int might match the return type of a gcc2
10608    builtin and then its argument prototype would still apply.  */
10609 char initscr (void);
10610
10611 int
10612 main (void)
10613 {
10614
10615 /* The GNU C library defines stubs for functions which it implements
10616     to always fail with ENOSYS.  Some functions are actually named
10617     something starting with __ and the normal name is an alias.  */
10618 #if defined (__stub_initscr) || defined (__stub___initscr)
10619 #error found stub for initscr
10620 #endif
10621
10622         return initscr ();
10623   ;
10624   return 0;
10625 }
10626 _ACEOF
10627 rm -f conftest.$ac_objext conftest$ac_exeext
10628 if { (eval echo "$as_me:10628: \"$ac_link\"") >&5
10629   (eval $ac_link) 2>&5
10630   ac_status=$?
10631   echo "$as_me:10631: \$? = $ac_status" >&5
10632   (exit $ac_status); } &&
10633          { ac_try='test -s conftest$ac_exeext'
10634   { (eval echo "$as_me:10634: \"$ac_try\"") >&5
10635   (eval $ac_try) 2>&5
10636   ac_status=$?
10637   echo "$as_me:10637: \$? = $ac_status" >&5
10638   (exit $ac_status); }; }; then
10639   ac_cv_func_initscr=yes
10640 else
10641   echo "$as_me: failed program was:" >&5
10642 cat conftest.$ac_ext >&5
10643 ac_cv_func_initscr=no
10644 fi
10645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10646 fi
10647 echo "$as_me:10647: result: $ac_cv_func_initscr" >&5
10648 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10649 if test $ac_cv_func_initscr = yes; then
10650   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10651 else
10652
10653                 cf_save_LIBS="$LIBS"
10654                 echo "$as_me:10654: checking for initscr in -l$cf_nculib_root" >&5
10655 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10656                 LIBS="-l$cf_nculib_root $LIBS"
10657                 cat >conftest.$ac_ext <<_ACEOF
10658 #line 10658 "configure"
10659 #include "confdefs.h"
10660 #include <${cf_cv_ncurses_header:-curses.h}>
10661 int
10662 main (void)
10663 {
10664 initscr()
10665   ;
10666   return 0;
10667 }
10668 _ACEOF
10669 rm -f conftest.$ac_objext conftest$ac_exeext
10670 if { (eval echo "$as_me:10670: \"$ac_link\"") >&5
10671   (eval $ac_link) 2>&5
10672   ac_status=$?
10673   echo "$as_me:10673: \$? = $ac_status" >&5
10674   (exit $ac_status); } &&
10675          { ac_try='test -s conftest$ac_exeext'
10676   { (eval echo "$as_me:10676: \"$ac_try\"") >&5
10677   (eval $ac_try) 2>&5
10678   ac_status=$?
10679   echo "$as_me:10679: \$? = $ac_status" >&5
10680   (exit $ac_status); }; }; then
10681   echo "$as_me:10681: result: yes" >&5
10682 echo "${ECHO_T}yes" >&6
10683                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10684
10685 else
10686   echo "$as_me: failed program was:" >&5
10687 cat conftest.$ac_ext >&5
10688 echo "$as_me:10688: result: no" >&5
10689 echo "${ECHO_T}no" >&6
10690
10691 cf_search=
10692 cf_library_path_list=""
10693 if test -n "${LDFLAGS}${LIBS}" ; then
10694         for cf_library_path in $LDFLAGS $LIBS
10695         do
10696                 case $cf_library_path in
10697                 (-L*)
10698                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10699
10700 test "x$cf_library_path" != "xNONE" && \
10701 test -d "$cf_library_path" && \
10702  {
10703         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10704         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10705         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10706         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10707         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10708         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
10709 }
10710
10711                         cf_library_path_list="$cf_library_path_list $cf_search"
10712                         ;;
10713                 esac
10714         done
10715 fi
10716
10717 cf_search=
10718
10719 test "x$prefix" != "xNONE" && \
10720 test -d "$prefix" && \
10721  {
10722         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10723         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10724         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10725         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10726         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10727         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10728 }
10729
10730 for cf_subdir_prefix in \
10731         /usr \
10732         /usr/local \
10733         /usr/pkg \
10734         /opt \
10735         /opt/local \
10736         $HOME
10737 do
10738
10739 test "x$cf_subdir_prefix" != "x$prefix" && \
10740 test -d "$cf_subdir_prefix" && \
10741 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10742         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10743         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10744         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10745         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10746         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10747         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
10748 }
10749
10750 done
10751
10752 cf_search="$cf_library_path_list $cf_search"
10753
10754                         for cf_libdir in $cf_search
10755                         do
10756                                 echo "$as_me:10756: checking for -l$cf_nculib_root in $cf_libdir" >&5
10757 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10758                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10759                                 cat >conftest.$ac_ext <<_ACEOF
10760 #line 10760 "configure"
10761 #include "confdefs.h"
10762 #include <${cf_cv_ncurses_header:-curses.h}>
10763 int
10764 main (void)
10765 {
10766 initscr()
10767   ;
10768   return 0;
10769 }
10770 _ACEOF
10771 rm -f conftest.$ac_objext conftest$ac_exeext
10772 if { (eval echo "$as_me:10772: \"$ac_link\"") >&5
10773   (eval $ac_link) 2>&5
10774   ac_status=$?
10775   echo "$as_me:10775: \$? = $ac_status" >&5
10776   (exit $ac_status); } &&
10777          { ac_try='test -s conftest$ac_exeext'
10778   { (eval echo "$as_me:10778: \"$ac_try\"") >&5
10779   (eval $ac_try) 2>&5
10780   ac_status=$?
10781   echo "$as_me:10781: \$? = $ac_status" >&5
10782   (exit $ac_status); }; }; then
10783   echo "$as_me:10783: result: yes" >&5
10784 echo "${ECHO_T}yes" >&6
10785                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10786                                          break
10787 else
10788   echo "$as_me: failed program was:" >&5
10789 cat conftest.$ac_ext >&5
10790 echo "$as_me:10790: result: no" >&5
10791 echo "${ECHO_T}no" >&6
10792                                          LIBS="$cf_save_LIBS"
10793 fi
10794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10795                         done
10796
10797 fi
10798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10799
10800 fi
10801
10802 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10803
10804 if test $cf_found_library = no ; then
10805         { { echo "$as_me:10805: error: Cannot link $cf_nculib_root library" >&5
10806 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10807    { (exit 1); exit 1; }; }
10808 fi
10809
10810 fi
10811
10812 if test -n "$cf_ncurses_LIBS" ; then
10813         echo "$as_me:10813: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10814 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10815         cf_ncurses_SAVE="$LIBS"
10816         for p in $cf_ncurses_LIBS ; do
10817                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10818                 if test "$q" != "$LIBS" ; then
10819                         LIBS="$q"
10820                 fi
10821         done
10822         cat >conftest.$ac_ext <<_ACEOF
10823 #line 10823 "configure"
10824 #include "confdefs.h"
10825 #include <${cf_cv_ncurses_header:-curses.h}>
10826 int
10827 main (void)
10828 {
10829 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10830   ;
10831   return 0;
10832 }
10833 _ACEOF
10834 rm -f conftest.$ac_objext conftest$ac_exeext
10835 if { (eval echo "$as_me:10835: \"$ac_link\"") >&5
10836   (eval $ac_link) 2>&5
10837   ac_status=$?
10838   echo "$as_me:10838: \$? = $ac_status" >&5
10839   (exit $ac_status); } &&
10840          { ac_try='test -s conftest$ac_exeext'
10841   { (eval echo "$as_me:10841: \"$ac_try\"") >&5
10842   (eval $ac_try) 2>&5
10843   ac_status=$?
10844   echo "$as_me:10844: \$? = $ac_status" >&5
10845   (exit $ac_status); }; }; then
10846   echo "$as_me:10846: result: yes" >&5
10847 echo "${ECHO_T}yes" >&6
10848 else
10849   echo "$as_me: failed program was:" >&5
10850 cat conftest.$ac_ext >&5
10851 echo "$as_me:10851: result: no" >&5
10852 echo "${ECHO_T}no" >&6
10853                  LIBS="$cf_ncurses_SAVE"
10854 fi
10855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10856 fi
10857
10858 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10859
10860 cat >>confdefs.h <<EOF
10861 #define $cf_nculib_ROOT 1
10862 EOF
10863
10864         fi
10865 else
10866         NCURSES_CONFIG=none
10867 fi
10868
10869 fi
10870
10871 if test "$NCURSES_CONFIG_PKG" != none ; then
10872         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10873
10874         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10875         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10876         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10877
10878         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10879         if test -z "$cf_cv_abi_version"
10880         then
10881                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10882         fi
10883
10884 elif test "$NCURSES_CONFIG" != none ; then
10885
10886         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10887
10888         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10889         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10890         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10891
10892         # ABI version is not available from headers
10893         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10894
10895 else
10896
10897         for cf_name in MAJOR MINOR PATCH
10898         do
10899         cat >conftest.$ac_ext <<CF_EOF
10900         #include <${cf_cv_ncurses_header:-curses.h}>
10901         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10902 CF_EOF
10903                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10904                 { (eval echo "$as_me:10904: \"$cf_try\"") >&5
10905   (eval $cf_try) 2>&5
10906   ac_status=$?
10907   echo "$as_me:10907: \$? = $ac_status" >&5
10908   (exit $ac_status); }
10909                 if test -f conftest.out ; then
10910                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10911                         eval NCURSES_$cf_name=\"$cf_result\"
10912                         # cat conftest.$ac_ext
10913                         # cat conftest.out
10914                 fi
10915         done
10916
10917         cf_cv_abi_version=${NCURSES_MAJOR}
10918
10919 fi
10920
10921 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10922
10923 cf_cv_timestamp=`date`
10924
10925 echo "$as_me:10925: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10926 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10927
10928 echo "$as_me:10928: checking if you want to have a library-prefix" >&5
10929 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10930
10931 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10932 if test "${with_lib_prefix+set}" = set; then
10933   withval="$with_lib_prefix"
10934   with_lib_prefix=$withval
10935 else
10936   with_lib_prefix=auto
10937 fi;
10938 echo "$as_me:10938: result: $with_lib_prefix" >&5
10939 echo "${ECHO_T}$with_lib_prefix" >&6
10940
10941 if test $with_lib_prefix = auto
10942 then
10943
10944         case $cf_cv_system_name in
10945         (OS/2*|os2*)
10946                 if test "$DFT_LWR_MODEL" = libtool; then
10947                         LIB_PREFIX='lib'
10948                 else
10949                         LIB_PREFIX=''
10950                 fi
10951                 ;;
10952         (*-msvc*)
10953                 LIB_PREFIX=''
10954                 ;;
10955         (*)     LIB_PREFIX='lib'
10956                 ;;
10957         esac
10958 cf_prefix=$LIB_PREFIX
10959
10960 elif test $with_lib_prefix = no
10961 then
10962         LIB_PREFIX=
10963 else
10964         LIB_PREFIX=$with_lib_prefix
10965 fi
10966
10967 LIB_SUFFIX=
10968
10969 ###############################################################################
10970
10971 if test X"$CC_G_OPT" = X"" ; then
10972         CC_G_OPT='-g'
10973         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10974 fi
10975
10976 echo "$as_me:10976: checking for default loader flags" >&5
10977 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10978 case $DFT_LWR_MODEL in
10979 (normal)  LD_MODEL=''   ;;
10980 (debug)   LD_MODEL=$CC_G_OPT ;;
10981 (profile) LD_MODEL='-pg';;
10982 (shared)  LD_MODEL=''   ;;
10983 esac
10984 echo "$as_me:10984: result: $LD_MODEL" >&5
10985 echo "${ECHO_T}$LD_MODEL" >&6
10986
10987 LD_RPATH_OPT=
10988 if test "x$cf_cv_enable_rpath" != xno
10989 then
10990         echo "$as_me:10990: checking for an rpath option" >&5
10991 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10992         case $cf_cv_system_name in
10993         (irix*)
10994                 if test "$GCC" = yes; then
10995                         LD_RPATH_OPT="-Wl,-rpath,"
10996                 else
10997                         LD_RPATH_OPT="-rpath "
10998                 fi
10999                 ;;
11000         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11001                 LD_RPATH_OPT="-Wl,-rpath,"
11002                 ;;
11003         (openbsd[2-9].*|mirbsd*)
11004                 LD_RPATH_OPT="-Wl,-rpath,"
11005                 ;;
11006         (dragonfly*)
11007                 LD_RPATH_OPT="-rpath "
11008                 ;;
11009         (netbsd*)
11010                 LD_RPATH_OPT="-Wl,-rpath,"
11011                 ;;
11012         (osf*|mls+*)
11013                 LD_RPATH_OPT="-rpath "
11014                 ;;
11015         (solaris2*)
11016                 LD_RPATH_OPT="-R"
11017                 ;;
11018         (*)
11019                 ;;
11020         esac
11021         echo "$as_me:11021: result: $LD_RPATH_OPT" >&5
11022 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11023
11024         case "x$LD_RPATH_OPT" in
11025         (x-R*)
11026                 echo "$as_me:11026: checking if we need a space after rpath option" >&5
11027 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11028                 cf_save_LIBS="$LIBS"
11029
11030 cf_add_libs="$LIBS"
11031 # reverse order
11032 cf_add_0lib=
11033 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11034 # filter duplicates
11035 for cf_add_1lib in $cf_add_0lib; do
11036         for cf_add_2lib in $cf_add_libs; do
11037                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11038                         cf_add_1lib=
11039                         break
11040                 fi
11041         done
11042         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11043 done
11044 LIBS="$cf_add_libs"
11045
11046                 cat >conftest.$ac_ext <<_ACEOF
11047 #line 11047 "configure"
11048 #include "confdefs.h"
11049
11050 int
11051 main (void)
11052 {
11053
11054   ;
11055   return 0;
11056 }
11057 _ACEOF
11058 rm -f conftest.$ac_objext conftest$ac_exeext
11059 if { (eval echo "$as_me:11059: \"$ac_link\"") >&5
11060   (eval $ac_link) 2>&5
11061   ac_status=$?
11062   echo "$as_me:11062: \$? = $ac_status" >&5
11063   (exit $ac_status); } &&
11064          { ac_try='test -s conftest$ac_exeext'
11065   { (eval echo "$as_me:11065: \"$ac_try\"") >&5
11066   (eval $ac_try) 2>&5
11067   ac_status=$?
11068   echo "$as_me:11068: \$? = $ac_status" >&5
11069   (exit $ac_status); }; }; then
11070   cf_rpath_space=no
11071 else
11072   echo "$as_me: failed program was:" >&5
11073 cat conftest.$ac_ext >&5
11074 cf_rpath_space=yes
11075 fi
11076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11077                 LIBS="$cf_save_LIBS"
11078                 echo "$as_me:11078: result: $cf_rpath_space" >&5
11079 echo "${ECHO_T}$cf_rpath_space" >&6
11080                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11081                 ;;
11082         esac
11083 fi
11084
11085         RM_SHARED_OPTS=
11086         LOCAL_LDFLAGS=
11087         LOCAL_LDFLAGS2=
11088         LD_SHARED_OPTS=
11089         INSTALL_LIB="-m 644"
11090         : ${rel_builddir:=.}
11091
11092         shlibdir=$libdir
11093
11094         MAKE_DLLS="#"
11095
11096         cf_cv_do_symlinks=no
11097         cf_ld_rpath_opt=
11098         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11099
11100         echo "$as_me:11100: checking if release/abi version should be used for shared libs" >&5
11101 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11102
11103 # Check whether --with-shlib-version or --without-shlib-version was given.
11104 if test "${with_shlib_version+set}" = set; then
11105   withval="$with_shlib_version"
11106   test -z "$withval" && withval=auto
11107         case $withval in
11108         (yes)
11109                 cf_cv_shlib_version=auto
11110                 ;;
11111         (rel|abi|auto)
11112                 cf_cv_shlib_version=$withval
11113                 ;;
11114         (*)
11115                 echo "$as_me:11115: result: $withval" >&5
11116 echo "${ECHO_T}$withval" >&6
11117                 { { echo "$as_me:11117: error: option value must be one of: rel, abi, or auto" >&5
11118 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11119    { (exit 1); exit 1; }; }
11120                 ;;
11121         esac
11122
11123 else
11124   cf_cv_shlib_version=auto
11125 fi;
11126         echo "$as_me:11126: result: $cf_cv_shlib_version" >&5
11127 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11128
11129         cf_cv_rm_so_locs=no
11130         cf_try_cflags=
11131
11132         # Some less-capable ports of gcc support only -fpic
11133         CC_SHARED_OPTS=
11134
11135         cf_try_fPIC=no
11136         if test "$GCC" = yes
11137         then
11138                 cf_try_fPIC=yes
11139         else
11140                 case $cf_cv_system_name in
11141                 (*linux*)       # e.g., PGI compiler
11142                         cf_try_fPIC=yes
11143                         ;;
11144                 esac
11145         fi
11146
11147         if test "$cf_try_fPIC" = yes
11148         then
11149                 echo "$as_me:11149: checking which $CC option to use" >&5
11150 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11151                 cf_save_CFLAGS="$CFLAGS"
11152                 for CC_SHARED_OPTS in -fPIC -fpic ''
11153                 do
11154                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11155                         cat >conftest.$ac_ext <<_ACEOF
11156 #line 11156 "configure"
11157 #include "confdefs.h"
11158 #include <stdio.h>
11159 int
11160 main (void)
11161 {
11162 int x = 1
11163   ;
11164   return 0;
11165 }
11166 _ACEOF
11167 rm -f conftest.$ac_objext
11168 if { (eval echo "$as_me:11168: \"$ac_compile\"") >&5
11169   (eval $ac_compile) 2>&5
11170   ac_status=$?
11171   echo "$as_me:11171: \$? = $ac_status" >&5
11172   (exit $ac_status); } &&
11173          { ac_try='test -s conftest.$ac_objext'
11174   { (eval echo "$as_me:11174: \"$ac_try\"") >&5
11175   (eval $ac_try) 2>&5
11176   ac_status=$?
11177   echo "$as_me:11177: \$? = $ac_status" >&5
11178   (exit $ac_status); }; }; then
11179   break
11180 else
11181   echo "$as_me: failed program was:" >&5
11182 cat conftest.$ac_ext >&5
11183 fi
11184 rm -f conftest.$ac_objext conftest.$ac_ext
11185                 done
11186                 echo "$as_me:11186: result: $CC_SHARED_OPTS" >&5
11187 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11188                 CFLAGS="$cf_save_CFLAGS"
11189         fi
11190
11191         cf_cv_shlib_version_infix=no
11192
11193         case $cf_cv_system_name in
11194         (aix4.3-9*|aix[5-7]*)
11195                 if test "$GCC" = yes; then
11196                         CC_SHARED_OPTS='-Wl,-brtl'
11197                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11198                 else
11199                         CC_SHARED_OPTS='-brtl'
11200                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11201                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11202                 fi
11203                 ;;
11204         (beos*)
11205                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11206                 ;;
11207         (cygwin*)
11208                 CC_SHARED_OPTS=
11209                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11210                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11211                 cf_cv_shlib_version=cygdll
11212                 cf_cv_shlib_version_infix=cygdll
11213                 shlibdir=$bindir
11214                 MAKE_DLLS=
11215                 cat >mk_shared_lib.sh <<-CF_EOF
11216                 #!$SHELL
11217                 SHARED_LIB=\$1
11218                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11219                 shift
11220                 cat <<-EOF
11221                 Linking shared library
11222                 ** SHARED_LIB \$SHARED_LIB
11223                 ** IMPORT_LIB \$IMPORT_LIB
11224 EOF
11225                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11226 CF_EOF
11227                 chmod +x mk_shared_lib.sh
11228                 ;;
11229         (msys*)
11230                 CC_SHARED_OPTS=
11231                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11232                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11233                 cf_cv_shlib_version=msysdll
11234                 cf_cv_shlib_version_infix=msysdll
11235                 shlibdir=$bindir
11236                 MAKE_DLLS=
11237                 cat >mk_shared_lib.sh <<-CF_EOF
11238                 #!$SHELL
11239                 SHARED_LIB=\$1
11240                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11241                 shift
11242                 cat <<-EOF
11243                 Linking shared library
11244                 ** SHARED_LIB \$SHARED_LIB
11245                 ** IMPORT_LIB \$IMPORT_LIB
11246 EOF
11247                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11248 CF_EOF
11249                 chmod +x mk_shared_lib.sh
11250                 ;;
11251         (darwin*)
11252                 cf_try_cflags="no-cpp-precomp"
11253                 CC_SHARED_OPTS="-dynamic"
11254                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11255                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11256                 cf_cv_shlib_version_infix=yes
11257                 echo "$as_me:11257: checking if ld -search_paths_first works" >&5
11258 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11259 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11260   echo $ECHO_N "(cached) $ECHO_C" >&6
11261 else
11262
11263                         cf_save_LDFLAGS=$LDFLAGS
11264                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11265                         cat >conftest.$ac_ext <<_ACEOF
11266 #line 11266 "configure"
11267 #include "confdefs.h"
11268
11269 int
11270 main (void)
11271 {
11272 int i;
11273   ;
11274   return 0;
11275 }
11276 _ACEOF
11277 rm -f conftest.$ac_objext conftest$ac_exeext
11278 if { (eval echo "$as_me:11278: \"$ac_link\"") >&5
11279   (eval $ac_link) 2>&5
11280   ac_status=$?
11281   echo "$as_me:11281: \$? = $ac_status" >&5
11282   (exit $ac_status); } &&
11283          { ac_try='test -s conftest$ac_exeext'
11284   { (eval echo "$as_me:11284: \"$ac_try\"") >&5
11285   (eval $ac_try) 2>&5
11286   ac_status=$?
11287   echo "$as_me:11287: \$? = $ac_status" >&5
11288   (exit $ac_status); }; }; then
11289   cf_cv_ldflags_search_paths_first=yes
11290 else
11291   echo "$as_me: failed program was:" >&5
11292 cat conftest.$ac_ext >&5
11293 cf_cv_ldflags_search_paths_first=no
11294 fi
11295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11296                                 LDFLAGS=$cf_save_LDFLAGS
11297 fi
11298 echo "$as_me:11298: result: $cf_cv_ldflags_search_paths_first" >&5
11299 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11300                 if test $cf_cv_ldflags_search_paths_first = yes; then
11301                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11302                 fi
11303                 ;;
11304         (hpux[7-8]*)
11305                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11306                 if test "$GCC" != yes; then
11307                         CC_SHARED_OPTS='+Z'
11308                 fi
11309                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11310                 INSTALL_LIB="-m 555"
11311                 ;;
11312         (hpux*)
11313                 # (tested with gcc 2.7.2 -- I don't have c89)
11314                 if test "$GCC" = yes; then
11315                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11316                 else
11317                         CC_SHARED_OPTS='+Z'
11318                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11319                 fi
11320                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11321                 # HP-UX shared libraries must be executable, and should be
11322                 # readonly to exploit a quirk in the memory manager.
11323                 INSTALL_LIB="-m 555"
11324                 ;;
11325         (interix*)
11326                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11327                 if test "$cf_cv_shlib_version" = rel; then
11328                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11329                 else
11330                         cf_shared_soname='`basename $@`'
11331                 fi
11332                 CC_SHARED_OPTS=
11333                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11334                 ;;
11335         (irix*)
11336                 if test "$cf_cv_enable_rpath" = yes ; then
11337                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11338                 fi
11339                 # tested with IRIX 5.2 and 'cc'.
11340                 if test "$GCC" != yes; then
11341                         CC_SHARED_OPTS='-KPIC'
11342                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11343                 else
11344                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11345                 fi
11346                 cf_cv_rm_so_locs=yes
11347                 ;;
11348         (linux*|gnu*|k*bsd*-gnu)
11349                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11350                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11351                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11352                 fi
11353                 if test "$cf_cv_enable_rpath" = yes ; then
11354                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11355                 fi
11356
11357         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11358         if test "$cf_cv_shlib_version" = rel; then
11359                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11360         else
11361                 cf_cv_shared_soname='`basename $@`'
11362         fi
11363
11364                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11365                 ;;
11366         (mingw*msvc*)
11367                 cf_cv_shlib_version=msvcdll
11368                 cf_cv_shlib_version_infix=msvcdll
11369                 shlibdir=$bindir
11370                 MAKE_DLLS=
11371                 if test "$DFT_LWR_MODEL" = "shared" ; then
11372                         LOCAL_LDFLAGS="-link -dll"
11373                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11374                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11375                 fi
11376                 CC_SHARED_OPTS=
11377                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11378                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11379                 cat >mk_shared_lib.sh <<-CF_EOF
11380                 #!$SHELL
11381                 SHARED_LIB=\$1
11382                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11383                 shift
11384                 my_ld=\$1
11385                 shift
11386                 cat <<-EOF
11387                 Linking shared library
11388                 ** SHARED LIB \$SHARED_LIB
11389                 ** IMPORT_LIB \$IMPORT_LIB
11390 EOF
11391                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11392                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11393                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11394 CF_EOF
11395                 chmod +x mk_shared_lib.sh
11396                 cat >mk_prog.sh <<-CF_EOF
11397                 #!$SHELL
11398                 shift
11399                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11400                 LD="$LD"
11401                 clopts=()
11402                 ldopts=("/subsystem:console")
11403                 libs=()
11404                 isdll=0
11405                 while test \$# -gt 0; do
11406                         case "\$1" in
11407                                 -link)
11408                                         # ignore -link argument
11409                                         ;;
11410                                 -M[TD] | -M[TD]d)
11411                                         # ignore runtime-library option
11412                                         ;;
11413                                 -dll)
11414                                         isdll=1
11415                                         ;;
11416                                 -W* | -w*)
11417                                         # ignore warnings
11418                                         ;;
11419                                 -D*)
11420                                         clopts+=("\$1")
11421                                         ;;
11422                                 -I*)
11423                                         clopts+=("\$1")
11424                                         ;;
11425                                 -l*)
11426                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11427                                         ;;
11428                                 -L*)
11429                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11430                                         ;;
11431                                 *.obj | *.o)
11432                                         ldopts+=("\$1")
11433                                         ;;
11434                                 -Wl,*)
11435                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11436                                                 ldopts+=("\${linkarg}")
11437                                         done
11438                                         ;;
11439                                 *.lib)
11440                                         ldopts+=("\$1")
11441                                         ;;
11442                                 -o)
11443                                         shift
11444                                         ldopts+=("-out:\$1")
11445                                         ;;
11446                                 *)
11447                                         clopts+=("\$1")
11448                                         ldopts+=("\$1")
11449                                         ;;
11450                         esac
11451                         shift
11452                 done
11453                 if [ "\$isdll" -ne 0 ]; then
11454                         for lib in \${libs[*]}; do
11455                                 ldopts+=("\$lib.dll.lib")
11456                         done
11457                 else
11458                         for lib in \${libs[*]}; do
11459                                 ldopts+=("\$lib.lib")
11460                         done
11461                 fi
11462                 cat <<-EOF
11463                 Creating program
11464                 ** ld options:   "\${ldopts[@]}"
11465 EOF
11466                 exec \$LD \${ldopts[@]}
11467 CF_EOF
11468                 chmod +x mk_prog.sh
11469                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11470                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11471                 ;;
11472         (mingw*)
11473                 cf_cv_shlib_version=mingw
11474                 cf_cv_shlib_version_infix=mingw
11475                 shlibdir=$bindir
11476                 MAKE_DLLS=
11477                 if test "$DFT_LWR_MODEL" = "shared" ; then
11478                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11479                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11480                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11481                 fi
11482                 CC_SHARED_OPTS=
11483                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11484                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11485                 cat >mk_shared_lib.sh <<-CF_EOF
11486                 #!$SHELL
11487                 SHARED_LIB=\$1
11488                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11489                 shift
11490                 cat <<-EOF
11491                 Linking shared library
11492                 ** SHARED_LIB \$SHARED_LIB
11493                 ** IMPORT_LIB \$IMPORT_LIB
11494 EOF
11495                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11496 CF_EOF
11497                 chmod +x mk_shared_lib.sh
11498                 ;;
11499         (openbsd[2-9].*|mirbsd*)
11500                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11501                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11502                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11503                 fi
11504                 if test "$cf_cv_enable_rpath" = yes ; then
11505                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11506                 fi
11507                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11508
11509         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11510         if test "$cf_cv_shlib_version" = rel; then
11511                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11512         else
11513                 cf_cv_shared_soname='`basename $@`'
11514         fi
11515
11516                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11517                 ;;
11518         (nskJ*)
11519                 CC_SHARED_OPTS=
11520                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11521                 ;;
11522         (nskL*)
11523                 CC_SHARED_OPTS=
11524                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11525                 ;;
11526         (nto-qnx*|openbsd*|freebsd[12].*)
11527                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11528                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11529                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11530                 ;;
11531         (dragonfly*|freebsd*)
11532                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11533                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11534                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11535                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11536                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11537                 fi
11538
11539         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11540         if test "$cf_cv_shlib_version" = rel; then
11541                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11542         else
11543                 cf_cv_shared_soname='`basename $@`'
11544         fi
11545
11546                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11547                 ;;
11548         (netbsd*)
11549                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11550                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11551                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11552                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11553                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11554                         if test "$cf_cv_shlib_version" = auto; then
11555                         if test -f /usr/libexec/ld.elf_so; then
11556                                 cf_cv_shlib_version=abi
11557                         else
11558                                 cf_cv_shlib_version=rel
11559                         fi
11560                         fi
11561
11562         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11563         if test "$cf_cv_shlib_version" = rel; then
11564                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11565         else
11566                 cf_cv_shared_soname='`basename $@`'
11567         fi
11568
11569                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11570                 else
11571                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11572                 fi
11573                 ;;
11574         (osf*|mls+*)
11575                 # tested with OSF/1 V3.2 and 'cc'
11576                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11577                 # link with shared libs).
11578                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11579                 case $host_os in
11580                 (osf4*)
11581                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11582                         ;;
11583                 esac
11584                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11585                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11586                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11587                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11588                 fi
11589                 cf_cv_rm_so_locs=yes
11590                 ;;
11591         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11592                 # tested with osr5.0.5
11593                 if test "$GCC" != yes; then
11594                         CC_SHARED_OPTS='-belf -KPIC'
11595                 fi
11596                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11597                 if test "$cf_cv_enable_rpath" = yes ; then
11598                         # only way is to set LD_RUN_PATH but no switch for it
11599                         RUN_PATH=$libdir
11600                 fi
11601                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11602                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11603                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11604                 ;;
11605         (sunos4*)
11606                 # tested with SunOS 4.1.1 and gcc 2.7.0
11607                 if test "$GCC" != yes; then
11608                         CC_SHARED_OPTS='-KPIC'
11609                 fi
11610                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11611                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11612                 ;;
11613         (solaris2*)
11614                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11615                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11616                 if test "$DFT_LWR_MODEL" = "shared" ; then
11617                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11618                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11619                 fi
11620                 if test "$cf_cv_enable_rpath" = yes ; then
11621                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11622                 fi
11623
11624         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11625         if test "$cf_cv_shlib_version" = rel; then
11626                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11627         else
11628                 cf_cv_shared_soname='`basename $@`'
11629         fi
11630
11631                 if test "$GCC" != yes; then
11632                         cf_save_CFLAGS="$CFLAGS"
11633                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11634                         do
11635                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11636                                 cat >conftest.$ac_ext <<_ACEOF
11637 #line 11637 "configure"
11638 #include "confdefs.h"
11639 #include <stdio.h>
11640 int
11641 main (void)
11642 {
11643 printf("Hello\n");
11644   ;
11645   return 0;
11646 }
11647 _ACEOF
11648 rm -f conftest.$ac_objext
11649 if { (eval echo "$as_me:11649: \"$ac_compile\"") >&5
11650   (eval $ac_compile) 2>&5
11651   ac_status=$?
11652   echo "$as_me:11652: \$? = $ac_status" >&5
11653   (exit $ac_status); } &&
11654          { ac_try='test -s conftest.$ac_objext'
11655   { (eval echo "$as_me:11655: \"$ac_try\"") >&5
11656   (eval $ac_try) 2>&5
11657   ac_status=$?
11658   echo "$as_me:11658: \$? = $ac_status" >&5
11659   (exit $ac_status); }; }; then
11660   break
11661 else
11662   echo "$as_me: failed program was:" >&5
11663 cat conftest.$ac_ext >&5
11664 fi
11665 rm -f conftest.$ac_objext conftest.$ac_ext
11666                         done
11667                         CFLAGS="$cf_save_CFLAGS"
11668                         CC_SHARED_OPTS=$cf_shared_opts
11669                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11670                 else
11671                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11672                 fi
11673                 ;;
11674         (sysv5uw7*|unix_sv*)
11675                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11676                 if test "$GCC" != yes; then
11677                         CC_SHARED_OPTS='-KPIC'
11678                 fi
11679                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11680                 ;;
11681         (*)
11682                 CC_SHARED_OPTS='unknown'
11683                 MK_SHARED_LIB='echo unknown'
11684                 ;;
11685         esac
11686
11687         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11688         case "$cf_cv_shlib_version" in
11689         (rel|abi)
11690                 case "$MK_SHARED_LIB" in
11691                 (*'-o $@')
11692                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11693                         ;;
11694                 (*)
11695                         { echo "$as_me:11695: WARNING: ignored --with-shlib-version" >&5
11696 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11697                         ;;
11698                 esac
11699                 ;;
11700         esac
11701
11702         if test -n "$cf_try_cflags"
11703         then
11704 cat > conftest.$ac_ext <<EOF
11705 #line 11705 "${as_me:-configure}"
11706 #include <stdio.h>
11707 int main(int argc, char *argv[])
11708 {
11709         printf("hello\n");
11710         return (argv[argc-1] == 0) ;
11711 }
11712 EOF
11713                 cf_save_CFLAGS="$CFLAGS"
11714                 for cf_opt in $cf_try_cflags
11715                 do
11716                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11717                         echo "$as_me:11717: checking if CFLAGS option -$cf_opt works" >&5
11718 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11719                         if { (eval echo "$as_me:11719: \"$ac_compile\"") >&5
11720   (eval $ac_compile) 2>&5
11721   ac_status=$?
11722   echo "$as_me:11722: \$? = $ac_status" >&5
11723   (exit $ac_status); }; then
11724                                 echo "$as_me:11724: result: yes" >&5
11725 echo "${ECHO_T}yes" >&6
11726                                 cf_save_CFLAGS="$CFLAGS"
11727                         else
11728                                 echo "$as_me:11728: result: no" >&5
11729 echo "${ECHO_T}no" >&6
11730                         fi
11731                 done
11732                 CFLAGS="$cf_save_CFLAGS"
11733         fi
11734
11735         # RPATH_LIST is a colon-separated list of directories
11736         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11737         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11738
11739         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11740
11741         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11742
11743 echo "${as_me:-configure}:11743: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11744
11745         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11746
11747 echo "${as_me:-configure}:11747: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11748
11749 # The test/sample programs in the original tree link using rpath option.
11750 # Make it optional for packagers.
11751 if test -n "$LOCAL_LDFLAGS"
11752 then
11753         echo "$as_me:11753: checking if you want to link sample programs with rpath option" >&5
11754 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11755
11756 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11757 if test "${enable_rpath_link+set}" = set; then
11758   enableval="$enable_rpath_link"
11759   with_rpath_link=$enableval
11760 else
11761   with_rpath_link=yes
11762 fi;
11763         echo "$as_me:11763: result: $with_rpath_link" >&5
11764 echo "${ECHO_T}$with_rpath_link" >&6
11765         if test "$with_rpath_link" = no
11766         then
11767                 LOCAL_LDFLAGS=
11768                 LOCAL_LDFLAGS2=
11769         fi
11770 fi
11771
11772 ###############################################################################
11773
11774 ###   use option --enable-broken-linker to force on use of broken-linker support
11775
11776 echo "$as_me:11776: checking if you want broken-linker support code" >&5
11777 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11778
11779 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11780 if test "${enable_broken_linker+set}" = set; then
11781   enableval="$enable_broken_linker"
11782   with_broken_linker=$enableval
11783 else
11784   with_broken_linker=no
11785 fi;
11786 echo "$as_me:11786: result: $with_broken_linker" >&5
11787 echo "${ECHO_T}$with_broken_linker" >&6
11788
11789 : ${BROKEN_LINKER:=0}
11790 if test "x$with_broken_linker" = xyes ; then
11791
11792 cat >>confdefs.h <<\EOF
11793 #define BROKEN_LINKER 1
11794 EOF
11795
11796         BROKEN_LINKER=1
11797 fi
11798
11799 # Check to define _XOPEN_SOURCE "automatically"
11800
11801 echo "$as_me:11801: checking if the POSIX test-macros are already defined" >&5
11802 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11803 if test "${cf_cv_posix_visible+set}" = set; then
11804   echo $ECHO_N "(cached) $ECHO_C" >&6
11805 else
11806
11807 cat >conftest.$ac_ext <<_ACEOF
11808 #line 11808 "configure"
11809 #include "confdefs.h"
11810 #include <stdio.h>
11811 int
11812 main (void)
11813 {
11814
11815 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11816         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11817         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11818         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11819 #error conflicting symbols found
11820 #endif
11821
11822   ;
11823   return 0;
11824 }
11825 _ACEOF
11826 rm -f conftest.$ac_objext
11827 if { (eval echo "$as_me:11827: \"$ac_compile\"") >&5
11828   (eval $ac_compile) 2>&5
11829   ac_status=$?
11830   echo "$as_me:11830: \$? = $ac_status" >&5
11831   (exit $ac_status); } &&
11832          { ac_try='test -s conftest.$ac_objext'
11833   { (eval echo "$as_me:11833: \"$ac_try\"") >&5
11834   (eval $ac_try) 2>&5
11835   ac_status=$?
11836   echo "$as_me:11836: \$? = $ac_status" >&5
11837   (exit $ac_status); }; }; then
11838   cf_cv_posix_visible=no
11839 else
11840   echo "$as_me: failed program was:" >&5
11841 cat conftest.$ac_ext >&5
11842 cf_cv_posix_visible=yes
11843 fi
11844 rm -f conftest.$ac_objext conftest.$ac_ext
11845
11846 fi
11847 echo "$as_me:11847: result: $cf_cv_posix_visible" >&5
11848 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11849
11850 if test "$cf_cv_posix_visible" = no; then
11851
11852 cf_XOPEN_SOURCE=600
11853 cf_POSIX_C_SOURCE=199506L
11854 cf_xopen_source=
11855
11856 case $host_os in
11857 (aix[4-7]*)
11858         cf_xopen_source="-D_ALL_SOURCE"
11859         ;;
11860 (msys)
11861         cf_XOPEN_SOURCE=600
11862         ;;
11863 (darwin[0-8].*)
11864         cf_xopen_source="-D_APPLE_C_SOURCE"
11865         ;;
11866 (darwin*)
11867         cf_xopen_source="-D_DARWIN_C_SOURCE"
11868         cf_XOPEN_SOURCE=
11869         ;;
11870 (freebsd*|dragonfly*|midnightbsd*)
11871         # 5.x headers associate
11872         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11873         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11874         cf_POSIX_C_SOURCE=200112L
11875         cf_XOPEN_SOURCE=600
11876         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11877         ;;
11878 (hpux11*)
11879         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11880         ;;
11881 (hpux*)
11882         cf_xopen_source="-D_HPUX_SOURCE"
11883         ;;
11884 (irix[56].*)
11885         cf_xopen_source="-D_SGI_SOURCE"
11886         cf_XOPEN_SOURCE=
11887         ;;
11888 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11889
11890 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11891
11892 echo "$as_me:11892: checking if this is the GNU C library" >&5
11893 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11894 if test "${cf_cv_gnu_library+set}" = set; then
11895   echo $ECHO_N "(cached) $ECHO_C" >&6
11896 else
11897
11898 cat >conftest.$ac_ext <<_ACEOF
11899 #line 11899 "configure"
11900 #include "confdefs.h"
11901 #include <sys/types.h>
11902 int
11903 main (void)
11904 {
11905
11906         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11907                 return 0;
11908         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11909                 return 0;
11910         #else
11911         #       error not GNU C library
11912         #endif
11913   ;
11914   return 0;
11915 }
11916 _ACEOF
11917 rm -f conftest.$ac_objext
11918 if { (eval echo "$as_me:11918: \"$ac_compile\"") >&5
11919   (eval $ac_compile) 2>&5
11920   ac_status=$?
11921   echo "$as_me:11921: \$? = $ac_status" >&5
11922   (exit $ac_status); } &&
11923          { ac_try='test -s conftest.$ac_objext'
11924   { (eval echo "$as_me:11924: \"$ac_try\"") >&5
11925   (eval $ac_try) 2>&5
11926   ac_status=$?
11927   echo "$as_me:11927: \$? = $ac_status" >&5
11928   (exit $ac_status); }; }; then
11929   cf_cv_gnu_library=yes
11930 else
11931   echo "$as_me: failed program was:" >&5
11932 cat conftest.$ac_ext >&5
11933 cf_cv_gnu_library=no
11934 fi
11935 rm -f conftest.$ac_objext conftest.$ac_ext
11936
11937 fi
11938 echo "$as_me:11938: result: $cf_cv_gnu_library" >&5
11939 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11940
11941 if test x$cf_cv_gnu_library = xyes; then
11942
11943         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11944         # was changed to help a little.  newlib incorporated the change about 4
11945         # years later.
11946         echo "$as_me:11946: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11947 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11948 if test "${cf_cv_gnu_library_219+set}" = set; then
11949   echo $ECHO_N "(cached) $ECHO_C" >&6
11950 else
11951
11952                 cf_save="$CPPFLAGS"
11953
11954         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11955         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11956
11957                 cat >conftest.$ac_ext <<_ACEOF
11958 #line 11958 "configure"
11959 #include "confdefs.h"
11960 #include <sys/types.h>
11961 int
11962 main (void)
11963 {
11964
11965                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11966                                 return 0;
11967                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11968                                 return 0;
11969                         #else
11970                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11971                         #endif
11972   ;
11973   return 0;
11974 }
11975 _ACEOF
11976 rm -f conftest.$ac_objext
11977 if { (eval echo "$as_me:11977: \"$ac_compile\"") >&5
11978   (eval $ac_compile) 2>&5
11979   ac_status=$?
11980   echo "$as_me:11980: \$? = $ac_status" >&5
11981   (exit $ac_status); } &&
11982          { ac_try='test -s conftest.$ac_objext'
11983   { (eval echo "$as_me:11983: \"$ac_try\"") >&5
11984   (eval $ac_try) 2>&5
11985   ac_status=$?
11986   echo "$as_me:11986: \$? = $ac_status" >&5
11987   (exit $ac_status); }; }; then
11988   cf_cv_gnu_library_219=yes
11989 else
11990   echo "$as_me: failed program was:" >&5
11991 cat conftest.$ac_ext >&5
11992 cf_cv_gnu_library_219=no
11993 fi
11994 rm -f conftest.$ac_objext conftest.$ac_ext
11995                 CPPFLAGS="$cf_save"
11996
11997 fi
11998 echo "$as_me:11998: result: $cf_cv_gnu_library_219" >&5
11999 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12000
12001         if test "x$cf_cv_gnu_library_219" = xyes; then
12002                 cf_save="$CPPFLAGS"
12003                 echo "$as_me:12003: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12004 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12005 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12006   echo $ECHO_N "(cached) $ECHO_C" >&6
12007 else
12008
12009 cf_fix_cppflags=no
12010 cf_new_cflags=
12011 cf_new_cppflags=
12012 cf_new_extra_cppflags=
12013
12014 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12015 do
12016 case $cf_fix_cppflags in
12017 (no)
12018         case $cf_add_cflags in
12019         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12020                 case $cf_add_cflags in
12021                 (-D*)
12022                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12023
12024                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12025                                 && test -z "${cf_tst_cflags}" \
12026                                 && cf_fix_cppflags=yes
12027
12028                         if test $cf_fix_cppflags = yes ; then
12029
12030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12032
12033                                 continue
12034                         elif test "${cf_tst_cflags}" = "\"'" ; then
12035
12036         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12037         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12038
12039                                 continue
12040                         fi
12041                         ;;
12042                 esac
12043                 case "$CPPFLAGS" in
12044                 (*$cf_add_cflags)
12045                         ;;
12046                 (*)
12047                         case $cf_add_cflags in
12048                         (-D*)
12049                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12050
12051 CPPFLAGS=`echo "$CPPFLAGS" | \
12052         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12053                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12054
12055                                 ;;
12056                         esac
12057
12058         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12059         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12060
12061                         ;;
12062                 esac
12063                 ;;
12064         (*)
12065
12066         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12067         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12068
12069                 ;;
12070         esac
12071         ;;
12072 (yes)
12073
12074         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12075         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12076
12077         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12078
12079         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12080                 && test -z "${cf_tst_cflags}" \
12081                 && cf_fix_cppflags=no
12082         ;;
12083 esac
12084 done
12085
12086 if test -n "$cf_new_cflags" ; then
12087
12088         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12089         CFLAGS="${CFLAGS}$cf_new_cflags"
12090
12091 fi
12092
12093 if test -n "$cf_new_cppflags" ; then
12094
12095         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12096         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12097
12098 fi
12099
12100 if test -n "$cf_new_extra_cppflags" ; then
12101
12102         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12103         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12104
12105 fi
12106
12107                         cat >conftest.$ac_ext <<_ACEOF
12108 #line 12108 "configure"
12109 #include "confdefs.h"
12110
12111                                 #include <limits.h>
12112                                 #include <sys/types.h>
12113
12114 int
12115 main (void)
12116 {
12117
12118                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12119                                         return 0;
12120                                 #else
12121                                 #       error GNU C library is too old
12122                                 #endif
12123   ;
12124   return 0;
12125 }
12126 _ACEOF
12127 rm -f conftest.$ac_objext
12128 if { (eval echo "$as_me:12128: \"$ac_compile\"") >&5
12129   (eval $ac_compile) 2>&5
12130   ac_status=$?
12131   echo "$as_me:12131: \$? = $ac_status" >&5
12132   (exit $ac_status); } &&
12133          { ac_try='test -s conftest.$ac_objext'
12134   { (eval echo "$as_me:12134: \"$ac_try\"") >&5
12135   (eval $ac_try) 2>&5
12136   ac_status=$?
12137   echo "$as_me:12137: \$? = $ac_status" >&5
12138   (exit $ac_status); }; }; then
12139   cf_cv_gnu_dftsrc_219=yes
12140 else
12141   echo "$as_me: failed program was:" >&5
12142 cat conftest.$ac_ext >&5
12143 cf_cv_gnu_dftsrc_219=no
12144 fi
12145 rm -f conftest.$ac_objext conftest.$ac_ext
12146
12147 fi
12148 echo "$as_me:12148: result: $cf_cv_gnu_dftsrc_219" >&5
12149 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12150                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12151         else
12152                 cf_cv_gnu_dftsrc_219=maybe
12153         fi
12154
12155         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12156
12157                 echo "$as_me:12157: checking if we must define _GNU_SOURCE" >&5
12158 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12159 if test "${cf_cv_gnu_source+set}" = set; then
12160   echo $ECHO_N "(cached) $ECHO_C" >&6
12161 else
12162
12163                 cat >conftest.$ac_ext <<_ACEOF
12164 #line 12164 "configure"
12165 #include "confdefs.h"
12166 #include <sys/types.h>
12167 int
12168 main (void)
12169 {
12170
12171                         #ifndef _XOPEN_SOURCE
12172                         #error  expected _XOPEN_SOURCE to be defined
12173                         #endif
12174   ;
12175   return 0;
12176 }
12177 _ACEOF
12178 rm -f conftest.$ac_objext
12179 if { (eval echo "$as_me:12179: \"$ac_compile\"") >&5
12180   (eval $ac_compile) 2>&5
12181   ac_status=$?
12182   echo "$as_me:12182: \$? = $ac_status" >&5
12183   (exit $ac_status); } &&
12184          { ac_try='test -s conftest.$ac_objext'
12185   { (eval echo "$as_me:12185: \"$ac_try\"") >&5
12186   (eval $ac_try) 2>&5
12187   ac_status=$?
12188   echo "$as_me:12188: \$? = $ac_status" >&5
12189   (exit $ac_status); }; }; then
12190   cf_cv_gnu_source=no
12191 else
12192   echo "$as_me: failed program was:" >&5
12193 cat conftest.$ac_ext >&5
12194 cf_save="$CPPFLAGS"
12195
12196 cf_fix_cppflags=no
12197 cf_new_cflags=
12198 cf_new_cppflags=
12199 cf_new_extra_cppflags=
12200
12201 for cf_add_cflags in -D_GNU_SOURCE
12202 do
12203 case $cf_fix_cppflags in
12204 (no)
12205         case $cf_add_cflags in
12206         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12207                 case $cf_add_cflags in
12208                 (-D*)
12209                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12210
12211                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12212                                 && test -z "${cf_tst_cflags}" \
12213                                 && cf_fix_cppflags=yes
12214
12215                         if test $cf_fix_cppflags = yes ; then
12216
12217         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12218         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12219
12220                                 continue
12221                         elif test "${cf_tst_cflags}" = "\"'" ; then
12222
12223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12225
12226                                 continue
12227                         fi
12228                         ;;
12229                 esac
12230                 case "$CPPFLAGS" in
12231                 (*$cf_add_cflags)
12232                         ;;
12233                 (*)
12234                         case $cf_add_cflags in
12235                         (-D*)
12236                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12237
12238 CPPFLAGS=`echo "$CPPFLAGS" | \
12239         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12240                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12241
12242                                 ;;
12243                         esac
12244
12245         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12246         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12247
12248                         ;;
12249                 esac
12250                 ;;
12251         (*)
12252
12253         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12254         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12255
12256                 ;;
12257         esac
12258         ;;
12259 (yes)
12260
12261         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12262         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12263
12264         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12265
12266         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12267                 && test -z "${cf_tst_cflags}" \
12268                 && cf_fix_cppflags=no
12269         ;;
12270 esac
12271 done
12272
12273 if test -n "$cf_new_cflags" ; then
12274
12275         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12276         CFLAGS="${CFLAGS}$cf_new_cflags"
12277
12278 fi
12279
12280 if test -n "$cf_new_cppflags" ; then
12281
12282         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12283         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12284
12285 fi
12286
12287 if test -n "$cf_new_extra_cppflags" ; then
12288
12289         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12290         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12291
12292 fi
12293
12294                          cat >conftest.$ac_ext <<_ACEOF
12295 #line 12295 "configure"
12296 #include "confdefs.h"
12297 #include <sys/types.h>
12298 int
12299 main (void)
12300 {
12301
12302                                 #ifdef _XOPEN_SOURCE
12303                                 #error  expected _XOPEN_SOURCE to be undefined
12304                                 #endif
12305   ;
12306   return 0;
12307 }
12308 _ACEOF
12309 rm -f conftest.$ac_objext
12310 if { (eval echo "$as_me:12310: \"$ac_compile\"") >&5
12311   (eval $ac_compile) 2>&5
12312   ac_status=$?
12313   echo "$as_me:12313: \$? = $ac_status" >&5
12314   (exit $ac_status); } &&
12315          { ac_try='test -s conftest.$ac_objext'
12316   { (eval echo "$as_me:12316: \"$ac_try\"") >&5
12317   (eval $ac_try) 2>&5
12318   ac_status=$?
12319   echo "$as_me:12319: \$? = $ac_status" >&5
12320   (exit $ac_status); }; }; then
12321   cf_cv_gnu_source=no
12322 else
12323   echo "$as_me: failed program was:" >&5
12324 cat conftest.$ac_ext >&5
12325 cf_cv_gnu_source=yes
12326 fi
12327 rm -f conftest.$ac_objext conftest.$ac_ext
12328                         CPPFLAGS="$cf_save"
12329
12330 fi
12331 rm -f conftest.$ac_objext conftest.$ac_ext
12332
12333 fi
12334 echo "$as_me:12334: result: $cf_cv_gnu_source" >&5
12335 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12336
12337                 if test "$cf_cv_gnu_source" = yes
12338                 then
12339                 echo "$as_me:12339: checking if we should also define _DEFAULT_SOURCE" >&5
12340 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12341 if test "${cf_cv_default_source+set}" = set; then
12342   echo $ECHO_N "(cached) $ECHO_C" >&6
12343 else
12344
12345         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12346         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12347
12348                         cat >conftest.$ac_ext <<_ACEOF
12349 #line 12349 "configure"
12350 #include "confdefs.h"
12351 #include <sys/types.h>
12352 int
12353 main (void)
12354 {
12355
12356                                 #ifdef _DEFAULT_SOURCE
12357                                 #error  expected _DEFAULT_SOURCE to be undefined
12358                                 #endif
12359   ;
12360   return 0;
12361 }
12362 _ACEOF
12363 rm -f conftest.$ac_objext
12364 if { (eval echo "$as_me:12364: \"$ac_compile\"") >&5
12365   (eval $ac_compile) 2>&5
12366   ac_status=$?
12367   echo "$as_me:12367: \$? = $ac_status" >&5
12368   (exit $ac_status); } &&
12369          { ac_try='test -s conftest.$ac_objext'
12370   { (eval echo "$as_me:12370: \"$ac_try\"") >&5
12371   (eval $ac_try) 2>&5
12372   ac_status=$?
12373   echo "$as_me:12373: \$? = $ac_status" >&5
12374   (exit $ac_status); }; }; then
12375   cf_cv_default_source=no
12376 else
12377   echo "$as_me: failed program was:" >&5
12378 cat conftest.$ac_ext >&5
12379 cf_cv_default_source=yes
12380 fi
12381 rm -f conftest.$ac_objext conftest.$ac_ext
12382
12383 fi
12384 echo "$as_me:12384: result: $cf_cv_default_source" >&5
12385 echo "${ECHO_T}$cf_cv_default_source" >&6
12386                         if test "$cf_cv_default_source" = yes
12387                         then
12388
12389         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12390         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12391
12392                         fi
12393                 fi
12394         fi
12395
12396 fi
12397
12398         ;;
12399 (minix*)
12400         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12401         ;;
12402 (mirbsd*)
12403         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12404         cf_XOPEN_SOURCE=
12405
12406 if test "$cf_cv_posix_visible" = no; then
12407
12408 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12409
12410 cf_save_CFLAGS="$CFLAGS"
12411 cf_save_CPPFLAGS="$CPPFLAGS"
12412
12413 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12414         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12415                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12416
12417 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12418         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12419                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12420
12421 echo "$as_me:12421: checking if we should define _POSIX_C_SOURCE" >&5
12422 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12423 if test "${cf_cv_posix_c_source+set}" = set; then
12424   echo $ECHO_N "(cached) $ECHO_C" >&6
12425 else
12426
12427 echo "${as_me:-configure}:12427: testing if the symbol is already defined go no further ..." 1>&5
12428
12429         cat >conftest.$ac_ext <<_ACEOF
12430 #line 12430 "configure"
12431 #include "confdefs.h"
12432 #include <sys/types.h>
12433 int
12434 main (void)
12435 {
12436
12437 #ifndef _POSIX_C_SOURCE
12438 make an error
12439 #endif
12440   ;
12441   return 0;
12442 }
12443 _ACEOF
12444 rm -f conftest.$ac_objext
12445 if { (eval echo "$as_me:12445: \"$ac_compile\"") >&5
12446   (eval $ac_compile) 2>&5
12447   ac_status=$?
12448   echo "$as_me:12448: \$? = $ac_status" >&5
12449   (exit $ac_status); } &&
12450          { ac_try='test -s conftest.$ac_objext'
12451   { (eval echo "$as_me:12451: \"$ac_try\"") >&5
12452   (eval $ac_try) 2>&5
12453   ac_status=$?
12454   echo "$as_me:12454: \$? = $ac_status" >&5
12455   (exit $ac_status); }; }; then
12456   cf_cv_posix_c_source=no
12457 else
12458   echo "$as_me: failed program was:" >&5
12459 cat conftest.$ac_ext >&5
12460 cf_want_posix_source=no
12461          case .$cf_POSIX_C_SOURCE in
12462          (.[12]??*)
12463                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12464                 ;;
12465          (.2)
12466                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12467                 cf_want_posix_source=yes
12468                 ;;
12469          (.*)
12470                 cf_want_posix_source=yes
12471                 ;;
12472          esac
12473          if test "$cf_want_posix_source" = yes ; then
12474                 cat >conftest.$ac_ext <<_ACEOF
12475 #line 12475 "configure"
12476 #include "confdefs.h"
12477 #include <sys/types.h>
12478 int
12479 main (void)
12480 {
12481
12482 #ifdef _POSIX_SOURCE
12483 make an error
12484 #endif
12485   ;
12486   return 0;
12487 }
12488 _ACEOF
12489 rm -f conftest.$ac_objext
12490 if { (eval echo "$as_me:12490: \"$ac_compile\"") >&5
12491   (eval $ac_compile) 2>&5
12492   ac_status=$?
12493   echo "$as_me:12493: \$? = $ac_status" >&5
12494   (exit $ac_status); } &&
12495          { ac_try='test -s conftest.$ac_objext'
12496   { (eval echo "$as_me:12496: \"$ac_try\"") >&5
12497   (eval $ac_try) 2>&5
12498   ac_status=$?
12499   echo "$as_me:12499: \$? = $ac_status" >&5
12500   (exit $ac_status); }; }; then
12501   :
12502 else
12503   echo "$as_me: failed program was:" >&5
12504 cat conftest.$ac_ext >&5
12505 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12506 fi
12507 rm -f conftest.$ac_objext conftest.$ac_ext
12508          fi
12509
12510 echo "${as_me:-configure}:12510: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12511
12512          CFLAGS="$cf_trim_CFLAGS"
12513          CPPFLAGS="$cf_trim_CPPFLAGS"
12514
12515         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12516         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12517
12518 echo "${as_me:-configure}:12518: testing if the second compile does not leave our definition intact error ..." 1>&5
12519
12520          cat >conftest.$ac_ext <<_ACEOF
12521 #line 12521 "configure"
12522 #include "confdefs.h"
12523 #include <sys/types.h>
12524 int
12525 main (void)
12526 {
12527
12528 #ifndef _POSIX_C_SOURCE
12529 make an error
12530 #endif
12531   ;
12532   return 0;
12533 }
12534 _ACEOF
12535 rm -f conftest.$ac_objext
12536 if { (eval echo "$as_me:12536: \"$ac_compile\"") >&5
12537   (eval $ac_compile) 2>&5
12538   ac_status=$?
12539   echo "$as_me:12539: \$? = $ac_status" >&5
12540   (exit $ac_status); } &&
12541          { ac_try='test -s conftest.$ac_objext'
12542   { (eval echo "$as_me:12542: \"$ac_try\"") >&5
12543   (eval $ac_try) 2>&5
12544   ac_status=$?
12545   echo "$as_me:12545: \$? = $ac_status" >&5
12546   (exit $ac_status); }; }; then
12547   :
12548 else
12549   echo "$as_me: failed program was:" >&5
12550 cat conftest.$ac_ext >&5
12551 cf_cv_posix_c_source=no
12552 fi
12553 rm -f conftest.$ac_objext conftest.$ac_ext
12554          CFLAGS="$cf_save_CFLAGS"
12555          CPPFLAGS="$cf_save_CPPFLAGS"
12556
12557 fi
12558 rm -f conftest.$ac_objext conftest.$ac_ext
12559
12560 fi
12561 echo "$as_me:12561: result: $cf_cv_posix_c_source" >&5
12562 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12563
12564 if test "$cf_cv_posix_c_source" != no ; then
12565         CFLAGS="$cf_trim_CFLAGS"
12566         CPPFLAGS="$cf_trim_CPPFLAGS"
12567
12568 cf_fix_cppflags=no
12569 cf_new_cflags=
12570 cf_new_cppflags=
12571 cf_new_extra_cppflags=
12572
12573 for cf_add_cflags in $cf_cv_posix_c_source
12574 do
12575 case $cf_fix_cppflags in
12576 (no)
12577         case $cf_add_cflags in
12578         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12579                 case $cf_add_cflags in
12580                 (-D*)
12581                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12582
12583                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12584                                 && test -z "${cf_tst_cflags}" \
12585                                 && cf_fix_cppflags=yes
12586
12587                         if test $cf_fix_cppflags = yes ; then
12588
12589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12591
12592                                 continue
12593                         elif test "${cf_tst_cflags}" = "\"'" ; then
12594
12595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12597
12598                                 continue
12599                         fi
12600                         ;;
12601                 esac
12602                 case "$CPPFLAGS" in
12603                 (*$cf_add_cflags)
12604                         ;;
12605                 (*)
12606                         case $cf_add_cflags in
12607                         (-D*)
12608                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12609
12610 CPPFLAGS=`echo "$CPPFLAGS" | \
12611         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12612                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12613
12614                                 ;;
12615                         esac
12616
12617         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12618         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12619
12620                         ;;
12621                 esac
12622                 ;;
12623         (*)
12624
12625         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12626         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12627
12628                 ;;
12629         esac
12630         ;;
12631 (yes)
12632
12633         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12634         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12635
12636         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12637
12638         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12639                 && test -z "${cf_tst_cflags}" \
12640                 && cf_fix_cppflags=no
12641         ;;
12642 esac
12643 done
12644
12645 if test -n "$cf_new_cflags" ; then
12646
12647         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12648         CFLAGS="${CFLAGS}$cf_new_cflags"
12649
12650 fi
12651
12652 if test -n "$cf_new_cppflags" ; then
12653
12654         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12655         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12656
12657 fi
12658
12659 if test -n "$cf_new_extra_cppflags" ; then
12660
12661         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12662         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12663
12664 fi
12665
12666 fi
12667
12668 fi # cf_cv_posix_visible
12669
12670         ;;
12671 (netbsd*)
12672         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12673         ;;
12674 (openbsd[4-9]*)
12675         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12676         cf_xopen_source="-D_BSD_SOURCE"
12677         cf_XOPEN_SOURCE=600
12678         ;;
12679 (openbsd*)
12680         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12681         ;;
12682 (osf[45]*)
12683         cf_xopen_source="-D_OSF_SOURCE"
12684         ;;
12685 (nto-qnx*)
12686         cf_xopen_source="-D_QNX_SOURCE"
12687         ;;
12688 (sco*)
12689         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12690         ;;
12691 (solaris2.*)
12692         cf_xopen_source="-D__EXTENSIONS__"
12693         cf_cv_xopen_source=broken
12694         ;;
12695 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12696         cf_XOPEN_SOURCE=
12697         cf_POSIX_C_SOURCE=
12698         ;;
12699 (*)
12700
12701 echo "$as_me:12701: checking if we should define _XOPEN_SOURCE" >&5
12702 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12703 if test "${cf_cv_xopen_source+set}" = set; then
12704   echo $ECHO_N "(cached) $ECHO_C" >&6
12705 else
12706
12707         cat >conftest.$ac_ext <<_ACEOF
12708 #line 12708 "configure"
12709 #include "confdefs.h"
12710
12711 #include <stdlib.h>
12712 #include <string.h>
12713 #include <sys/types.h>
12714
12715 int
12716 main (void)
12717 {
12718
12719 #ifndef _XOPEN_SOURCE
12720 make an error
12721 #endif
12722   ;
12723   return 0;
12724 }
12725 _ACEOF
12726 rm -f conftest.$ac_objext
12727 if { (eval echo "$as_me:12727: \"$ac_compile\"") >&5
12728   (eval $ac_compile) 2>&5
12729   ac_status=$?
12730   echo "$as_me:12730: \$? = $ac_status" >&5
12731   (exit $ac_status); } &&
12732          { ac_try='test -s conftest.$ac_objext'
12733   { (eval echo "$as_me:12733: \"$ac_try\"") >&5
12734   (eval $ac_try) 2>&5
12735   ac_status=$?
12736   echo "$as_me:12736: \$? = $ac_status" >&5
12737   (exit $ac_status); }; }; then
12738   cf_cv_xopen_source=no
12739 else
12740   echo "$as_me: failed program was:" >&5
12741 cat conftest.$ac_ext >&5
12742 cf_save="$CPPFLAGS"
12743
12744         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12745         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12746
12747          cat >conftest.$ac_ext <<_ACEOF
12748 #line 12748 "configure"
12749 #include "confdefs.h"
12750
12751 #include <stdlib.h>
12752 #include <string.h>
12753 #include <sys/types.h>
12754
12755 int
12756 main (void)
12757 {
12758
12759 #ifdef _XOPEN_SOURCE
12760 make an error
12761 #endif
12762   ;
12763   return 0;
12764 }
12765 _ACEOF
12766 rm -f conftest.$ac_objext
12767 if { (eval echo "$as_me:12767: \"$ac_compile\"") >&5
12768   (eval $ac_compile) 2>&5
12769   ac_status=$?
12770   echo "$as_me:12770: \$? = $ac_status" >&5
12771   (exit $ac_status); } &&
12772          { ac_try='test -s conftest.$ac_objext'
12773   { (eval echo "$as_me:12773: \"$ac_try\"") >&5
12774   (eval $ac_try) 2>&5
12775   ac_status=$?
12776   echo "$as_me:12776: \$? = $ac_status" >&5
12777   (exit $ac_status); }; }; then
12778   cf_cv_xopen_source=no
12779 else
12780   echo "$as_me: failed program was:" >&5
12781 cat conftest.$ac_ext >&5
12782 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12783 fi
12784 rm -f conftest.$ac_objext conftest.$ac_ext
12785         CPPFLAGS="$cf_save"
12786
12787 fi
12788 rm -f conftest.$ac_objext conftest.$ac_ext
12789
12790 fi
12791 echo "$as_me:12791: result: $cf_cv_xopen_source" >&5
12792 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12793
12794 if test "$cf_cv_xopen_source" != no ; then
12795
12796 CFLAGS=`echo "$CFLAGS" | \
12797         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12798                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12799
12800 CPPFLAGS=`echo "$CPPFLAGS" | \
12801         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12802                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12803
12804         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12805
12806 cf_fix_cppflags=no
12807 cf_new_cflags=
12808 cf_new_cppflags=
12809 cf_new_extra_cppflags=
12810
12811 for cf_add_cflags in $cf_temp_xopen_source
12812 do
12813 case $cf_fix_cppflags in
12814 (no)
12815         case $cf_add_cflags in
12816         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12817                 case $cf_add_cflags in
12818                 (-D*)
12819                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12820
12821                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12822                                 && test -z "${cf_tst_cflags}" \
12823                                 && cf_fix_cppflags=yes
12824
12825                         if test $cf_fix_cppflags = yes ; then
12826
12827         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12828         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12829
12830                                 continue
12831                         elif test "${cf_tst_cflags}" = "\"'" ; then
12832
12833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12835
12836                                 continue
12837                         fi
12838                         ;;
12839                 esac
12840                 case "$CPPFLAGS" in
12841                 (*$cf_add_cflags)
12842                         ;;
12843                 (*)
12844                         case $cf_add_cflags in
12845                         (-D*)
12846                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12847
12848 CPPFLAGS=`echo "$CPPFLAGS" | \
12849         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12850                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12851
12852                                 ;;
12853                         esac
12854
12855         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12856         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12857
12858                         ;;
12859                 esac
12860                 ;;
12861         (*)
12862
12863         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12864         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12865
12866                 ;;
12867         esac
12868         ;;
12869 (yes)
12870
12871         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12872         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12873
12874         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12875
12876         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12877                 && test -z "${cf_tst_cflags}" \
12878                 && cf_fix_cppflags=no
12879         ;;
12880 esac
12881 done
12882
12883 if test -n "$cf_new_cflags" ; then
12884
12885         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12886         CFLAGS="${CFLAGS}$cf_new_cflags"
12887
12888 fi
12889
12890 if test -n "$cf_new_cppflags" ; then
12891
12892         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12893         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12894
12895 fi
12896
12897 if test -n "$cf_new_extra_cppflags" ; then
12898
12899         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12900         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12901
12902 fi
12903
12904 fi
12905
12906 if test "$cf_cv_posix_visible" = no; then
12907
12908 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12909
12910 cf_save_CFLAGS="$CFLAGS"
12911 cf_save_CPPFLAGS="$CPPFLAGS"
12912
12913 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12914         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12915                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12916
12917 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12918         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12919                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12920
12921 echo "$as_me:12921: checking if we should define _POSIX_C_SOURCE" >&5
12922 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12923 if test "${cf_cv_posix_c_source+set}" = set; then
12924   echo $ECHO_N "(cached) $ECHO_C" >&6
12925 else
12926
12927 echo "${as_me:-configure}:12927: testing if the symbol is already defined go no further ..." 1>&5
12928
12929         cat >conftest.$ac_ext <<_ACEOF
12930 #line 12930 "configure"
12931 #include "confdefs.h"
12932 #include <sys/types.h>
12933 int
12934 main (void)
12935 {
12936
12937 #ifndef _POSIX_C_SOURCE
12938 make an error
12939 #endif
12940   ;
12941   return 0;
12942 }
12943 _ACEOF
12944 rm -f conftest.$ac_objext
12945 if { (eval echo "$as_me:12945: \"$ac_compile\"") >&5
12946   (eval $ac_compile) 2>&5
12947   ac_status=$?
12948   echo "$as_me:12948: \$? = $ac_status" >&5
12949   (exit $ac_status); } &&
12950          { ac_try='test -s conftest.$ac_objext'
12951   { (eval echo "$as_me:12951: \"$ac_try\"") >&5
12952   (eval $ac_try) 2>&5
12953   ac_status=$?
12954   echo "$as_me:12954: \$? = $ac_status" >&5
12955   (exit $ac_status); }; }; then
12956   cf_cv_posix_c_source=no
12957 else
12958   echo "$as_me: failed program was:" >&5
12959 cat conftest.$ac_ext >&5
12960 cf_want_posix_source=no
12961          case .$cf_POSIX_C_SOURCE in
12962          (.[12]??*)
12963                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12964                 ;;
12965          (.2)
12966                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12967                 cf_want_posix_source=yes
12968                 ;;
12969          (.*)
12970                 cf_want_posix_source=yes
12971                 ;;
12972          esac
12973          if test "$cf_want_posix_source" = yes ; then
12974                 cat >conftest.$ac_ext <<_ACEOF
12975 #line 12975 "configure"
12976 #include "confdefs.h"
12977 #include <sys/types.h>
12978 int
12979 main (void)
12980 {
12981
12982 #ifdef _POSIX_SOURCE
12983 make an error
12984 #endif
12985   ;
12986   return 0;
12987 }
12988 _ACEOF
12989 rm -f conftest.$ac_objext
12990 if { (eval echo "$as_me:12990: \"$ac_compile\"") >&5
12991   (eval $ac_compile) 2>&5
12992   ac_status=$?
12993   echo "$as_me:12993: \$? = $ac_status" >&5
12994   (exit $ac_status); } &&
12995          { ac_try='test -s conftest.$ac_objext'
12996   { (eval echo "$as_me:12996: \"$ac_try\"") >&5
12997   (eval $ac_try) 2>&5
12998   ac_status=$?
12999   echo "$as_me:12999: \$? = $ac_status" >&5
13000   (exit $ac_status); }; }; then
13001   :
13002 else
13003   echo "$as_me: failed program was:" >&5
13004 cat conftest.$ac_ext >&5
13005 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13006 fi
13007 rm -f conftest.$ac_objext conftest.$ac_ext
13008          fi
13009
13010 echo "${as_me:-configure}:13010: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13011
13012          CFLAGS="$cf_trim_CFLAGS"
13013          CPPFLAGS="$cf_trim_CPPFLAGS"
13014
13015         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13016         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13017
13018 echo "${as_me:-configure}:13018: testing if the second compile does not leave our definition intact error ..." 1>&5
13019
13020          cat >conftest.$ac_ext <<_ACEOF
13021 #line 13021 "configure"
13022 #include "confdefs.h"
13023 #include <sys/types.h>
13024 int
13025 main (void)
13026 {
13027
13028 #ifndef _POSIX_C_SOURCE
13029 make an error
13030 #endif
13031   ;
13032   return 0;
13033 }
13034 _ACEOF
13035 rm -f conftest.$ac_objext
13036 if { (eval echo "$as_me:13036: \"$ac_compile\"") >&5
13037   (eval $ac_compile) 2>&5
13038   ac_status=$?
13039   echo "$as_me:13039: \$? = $ac_status" >&5
13040   (exit $ac_status); } &&
13041          { ac_try='test -s conftest.$ac_objext'
13042   { (eval echo "$as_me:13042: \"$ac_try\"") >&5
13043   (eval $ac_try) 2>&5
13044   ac_status=$?
13045   echo "$as_me:13045: \$? = $ac_status" >&5
13046   (exit $ac_status); }; }; then
13047   :
13048 else
13049   echo "$as_me: failed program was:" >&5
13050 cat conftest.$ac_ext >&5
13051 cf_cv_posix_c_source=no
13052 fi
13053 rm -f conftest.$ac_objext conftest.$ac_ext
13054          CFLAGS="$cf_save_CFLAGS"
13055          CPPFLAGS="$cf_save_CPPFLAGS"
13056
13057 fi
13058 rm -f conftest.$ac_objext conftest.$ac_ext
13059
13060 fi
13061 echo "$as_me:13061: result: $cf_cv_posix_c_source" >&5
13062 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13063
13064 if test "$cf_cv_posix_c_source" != no ; then
13065         CFLAGS="$cf_trim_CFLAGS"
13066         CPPFLAGS="$cf_trim_CPPFLAGS"
13067
13068 cf_fix_cppflags=no
13069 cf_new_cflags=
13070 cf_new_cppflags=
13071 cf_new_extra_cppflags=
13072
13073 for cf_add_cflags in $cf_cv_posix_c_source
13074 do
13075 case $cf_fix_cppflags in
13076 (no)
13077         case $cf_add_cflags in
13078         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13079                 case $cf_add_cflags in
13080                 (-D*)
13081                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13082
13083                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13084                                 && test -z "${cf_tst_cflags}" \
13085                                 && cf_fix_cppflags=yes
13086
13087                         if test $cf_fix_cppflags = yes ; then
13088
13089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13091
13092                                 continue
13093                         elif test "${cf_tst_cflags}" = "\"'" ; then
13094
13095         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13096         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13097
13098                                 continue
13099                         fi
13100                         ;;
13101                 esac
13102                 case "$CPPFLAGS" in
13103                 (*$cf_add_cflags)
13104                         ;;
13105                 (*)
13106                         case $cf_add_cflags in
13107                         (-D*)
13108                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13109
13110 CPPFLAGS=`echo "$CPPFLAGS" | \
13111         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13112                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13113
13114                                 ;;
13115                         esac
13116
13117         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13118         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13119
13120                         ;;
13121                 esac
13122                 ;;
13123         (*)
13124
13125         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13126         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13127
13128                 ;;
13129         esac
13130         ;;
13131 (yes)
13132
13133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13135
13136         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13137
13138         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13139                 && test -z "${cf_tst_cflags}" \
13140                 && cf_fix_cppflags=no
13141         ;;
13142 esac
13143 done
13144
13145 if test -n "$cf_new_cflags" ; then
13146
13147         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13148         CFLAGS="${CFLAGS}$cf_new_cflags"
13149
13150 fi
13151
13152 if test -n "$cf_new_cppflags" ; then
13153
13154         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13155         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13156
13157 fi
13158
13159 if test -n "$cf_new_extra_cppflags" ; then
13160
13161         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13162         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13163
13164 fi
13165
13166 fi
13167
13168 fi # cf_cv_posix_visible
13169
13170         ;;
13171 esac
13172
13173 if test -n "$cf_xopen_source" ; then
13174
13175 cf_fix_cppflags=no
13176 cf_new_cflags=
13177 cf_new_cppflags=
13178 cf_new_extra_cppflags=
13179
13180 for cf_add_cflags in $cf_xopen_source
13181 do
13182 case $cf_fix_cppflags in
13183 (no)
13184         case $cf_add_cflags in
13185         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13186                 case $cf_add_cflags in
13187                 (-D*)
13188                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13189
13190                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13191                                 && test -z "${cf_tst_cflags}" \
13192                                 && cf_fix_cppflags=yes
13193
13194                         if test $cf_fix_cppflags = yes ; then
13195
13196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13198
13199                                 continue
13200                         elif test "${cf_tst_cflags}" = "\"'" ; then
13201
13202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13204
13205                                 continue
13206                         fi
13207                         ;;
13208                 esac
13209                 case "$CPPFLAGS" in
13210                 (*$cf_add_cflags)
13211                         ;;
13212                 (*)
13213                         case $cf_add_cflags in
13214                         (-D*)
13215                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13216
13217 CPPFLAGS=`echo "$CPPFLAGS" | \
13218         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13219                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13220
13221                                 ;;
13222                         esac
13223
13224         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13225         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13226
13227                         ;;
13228                 esac
13229                 ;;
13230         (*)
13231
13232         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13233         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13234
13235                 ;;
13236         esac
13237         ;;
13238 (yes)
13239
13240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13242
13243         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13244
13245         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13246                 && test -z "${cf_tst_cflags}" \
13247                 && cf_fix_cppflags=no
13248         ;;
13249 esac
13250 done
13251
13252 if test -n "$cf_new_cflags" ; then
13253         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13254
13255 echo "${as_me:-configure}:13255: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13256
13257         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13258         CFLAGS="${CFLAGS}$cf_new_cflags"
13259
13260 fi
13261
13262 if test -n "$cf_new_cppflags" ; then
13263         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13264
13265 echo "${as_me:-configure}:13265: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13266
13267         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13268         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13269
13270 fi
13271
13272 if test -n "$cf_new_extra_cppflags" ; then
13273         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13274
13275 echo "${as_me:-configure}:13275: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13276
13277         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13278         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13279
13280 fi
13281
13282 fi
13283
13284 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13285         echo "$as_me:13285: checking if _XOPEN_SOURCE really is set" >&5
13286 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13287         cat >conftest.$ac_ext <<_ACEOF
13288 #line 13288 "configure"
13289 #include "confdefs.h"
13290 #include <stdlib.h>
13291 int
13292 main (void)
13293 {
13294
13295 #ifndef _XOPEN_SOURCE
13296 make an error
13297 #endif
13298   ;
13299   return 0;
13300 }
13301 _ACEOF
13302 rm -f conftest.$ac_objext
13303 if { (eval echo "$as_me:13303: \"$ac_compile\"") >&5
13304   (eval $ac_compile) 2>&5
13305   ac_status=$?
13306   echo "$as_me:13306: \$? = $ac_status" >&5
13307   (exit $ac_status); } &&
13308          { ac_try='test -s conftest.$ac_objext'
13309   { (eval echo "$as_me:13309: \"$ac_try\"") >&5
13310   (eval $ac_try) 2>&5
13311   ac_status=$?
13312   echo "$as_me:13312: \$? = $ac_status" >&5
13313   (exit $ac_status); }; }; then
13314   cf_XOPEN_SOURCE_set=yes
13315 else
13316   echo "$as_me: failed program was:" >&5
13317 cat conftest.$ac_ext >&5
13318 cf_XOPEN_SOURCE_set=no
13319 fi
13320 rm -f conftest.$ac_objext conftest.$ac_ext
13321         echo "$as_me:13321: result: $cf_XOPEN_SOURCE_set" >&5
13322 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13323         if test $cf_XOPEN_SOURCE_set = yes
13324         then
13325                 cat >conftest.$ac_ext <<_ACEOF
13326 #line 13326 "configure"
13327 #include "confdefs.h"
13328 #include <stdlib.h>
13329 int
13330 main (void)
13331 {
13332
13333 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13334 make an error
13335 #endif
13336   ;
13337   return 0;
13338 }
13339 _ACEOF
13340 rm -f conftest.$ac_objext
13341 if { (eval echo "$as_me:13341: \"$ac_compile\"") >&5
13342   (eval $ac_compile) 2>&5
13343   ac_status=$?
13344   echo "$as_me:13344: \$? = $ac_status" >&5
13345   (exit $ac_status); } &&
13346          { ac_try='test -s conftest.$ac_objext'
13347   { (eval echo "$as_me:13347: \"$ac_try\"") >&5
13348   (eval $ac_try) 2>&5
13349   ac_status=$?
13350   echo "$as_me:13350: \$? = $ac_status" >&5
13351   (exit $ac_status); }; }; then
13352   cf_XOPEN_SOURCE_set_ok=yes
13353 else
13354   echo "$as_me: failed program was:" >&5
13355 cat conftest.$ac_ext >&5
13356 cf_XOPEN_SOURCE_set_ok=no
13357 fi
13358 rm -f conftest.$ac_objext conftest.$ac_ext
13359                 if test $cf_XOPEN_SOURCE_set_ok = no
13360                 then
13361                         { echo "$as_me:13361: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13362 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13363                 fi
13364         else
13365
13366 echo "$as_me:13366: checking if we should define _XOPEN_SOURCE" >&5
13367 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13368 if test "${cf_cv_xopen_source+set}" = set; then
13369   echo $ECHO_N "(cached) $ECHO_C" >&6
13370 else
13371
13372         cat >conftest.$ac_ext <<_ACEOF
13373 #line 13373 "configure"
13374 #include "confdefs.h"
13375
13376 #include <stdlib.h>
13377 #include <string.h>
13378 #include <sys/types.h>
13379
13380 int
13381 main (void)
13382 {
13383
13384 #ifndef _XOPEN_SOURCE
13385 make an error
13386 #endif
13387   ;
13388   return 0;
13389 }
13390 _ACEOF
13391 rm -f conftest.$ac_objext
13392 if { (eval echo "$as_me:13392: \"$ac_compile\"") >&5
13393   (eval $ac_compile) 2>&5
13394   ac_status=$?
13395   echo "$as_me:13395: \$? = $ac_status" >&5
13396   (exit $ac_status); } &&
13397          { ac_try='test -s conftest.$ac_objext'
13398   { (eval echo "$as_me:13398: \"$ac_try\"") >&5
13399   (eval $ac_try) 2>&5
13400   ac_status=$?
13401   echo "$as_me:13401: \$? = $ac_status" >&5
13402   (exit $ac_status); }; }; then
13403   cf_cv_xopen_source=no
13404 else
13405   echo "$as_me: failed program was:" >&5
13406 cat conftest.$ac_ext >&5
13407 cf_save="$CPPFLAGS"
13408
13409         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13410         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13411
13412          cat >conftest.$ac_ext <<_ACEOF
13413 #line 13413 "configure"
13414 #include "confdefs.h"
13415
13416 #include <stdlib.h>
13417 #include <string.h>
13418 #include <sys/types.h>
13419
13420 int
13421 main (void)
13422 {
13423
13424 #ifdef _XOPEN_SOURCE
13425 make an error
13426 #endif
13427   ;
13428   return 0;
13429 }
13430 _ACEOF
13431 rm -f conftest.$ac_objext
13432 if { (eval echo "$as_me:13432: \"$ac_compile\"") >&5
13433   (eval $ac_compile) 2>&5
13434   ac_status=$?
13435   echo "$as_me:13435: \$? = $ac_status" >&5
13436   (exit $ac_status); } &&
13437          { ac_try='test -s conftest.$ac_objext'
13438   { (eval echo "$as_me:13438: \"$ac_try\"") >&5
13439   (eval $ac_try) 2>&5
13440   ac_status=$?
13441   echo "$as_me:13441: \$? = $ac_status" >&5
13442   (exit $ac_status); }; }; then
13443   cf_cv_xopen_source=no
13444 else
13445   echo "$as_me: failed program was:" >&5
13446 cat conftest.$ac_ext >&5
13447 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13448 fi
13449 rm -f conftest.$ac_objext conftest.$ac_ext
13450         CPPFLAGS="$cf_save"
13451
13452 fi
13453 rm -f conftest.$ac_objext conftest.$ac_ext
13454
13455 fi
13456 echo "$as_me:13456: result: $cf_cv_xopen_source" >&5
13457 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13458
13459 if test "$cf_cv_xopen_source" != no ; then
13460
13461 CFLAGS=`echo "$CFLAGS" | \
13462         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13463                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13464
13465 CPPFLAGS=`echo "$CPPFLAGS" | \
13466         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13467                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13468
13469         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13470
13471 cf_fix_cppflags=no
13472 cf_new_cflags=
13473 cf_new_cppflags=
13474 cf_new_extra_cppflags=
13475
13476 for cf_add_cflags in $cf_temp_xopen_source
13477 do
13478 case $cf_fix_cppflags in
13479 (no)
13480         case $cf_add_cflags in
13481         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13482                 case $cf_add_cflags in
13483                 (-D*)
13484                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13485
13486                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13487                                 && test -z "${cf_tst_cflags}" \
13488                                 && cf_fix_cppflags=yes
13489
13490                         if test $cf_fix_cppflags = yes ; then
13491
13492         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13493         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13494
13495                                 continue
13496                         elif test "${cf_tst_cflags}" = "\"'" ; then
13497
13498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13500
13501                                 continue
13502                         fi
13503                         ;;
13504                 esac
13505                 case "$CPPFLAGS" in
13506                 (*$cf_add_cflags)
13507                         ;;
13508                 (*)
13509                         case $cf_add_cflags in
13510                         (-D*)
13511                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13512
13513 CPPFLAGS=`echo "$CPPFLAGS" | \
13514         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13515                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13516
13517                                 ;;
13518                         esac
13519
13520         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13521         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13522
13523                         ;;
13524                 esac
13525                 ;;
13526         (*)
13527
13528         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13529         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13530
13531                 ;;
13532         esac
13533         ;;
13534 (yes)
13535
13536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13538
13539         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13540
13541         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13542                 && test -z "${cf_tst_cflags}" \
13543                 && cf_fix_cppflags=no
13544         ;;
13545 esac
13546 done
13547
13548 if test -n "$cf_new_cflags" ; then
13549
13550         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13551         CFLAGS="${CFLAGS}$cf_new_cflags"
13552
13553 fi
13554
13555 if test -n "$cf_new_cppflags" ; then
13556
13557         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13558         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13559
13560 fi
13561
13562 if test -n "$cf_new_extra_cppflags" ; then
13563
13564         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13565         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13566
13567 fi
13568
13569 fi
13570
13571         fi
13572 fi
13573 fi # cf_cv_posix_visible
13574
13575 # Check whether --enable-largefile or --disable-largefile was given.
13576 if test "${enable_largefile+set}" = set; then
13577   enableval="$enable_largefile"
13578
13579 fi;
13580 if test "$enable_largefile" != no; then
13581
13582   echo "$as_me:13582: checking for special C compiler options needed for large files" >&5
13583 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13584 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13585   echo $ECHO_N "(cached) $ECHO_C" >&6
13586 else
13587   ac_cv_sys_largefile_CC=no
13588      if test "$GCC" != yes; then
13589        ac_save_CC=$CC
13590        while :; do
13591          # IRIX 6.2 and later do not support large files by default,
13592          # so use the C compiler's -n32 option if that helps.
13593          cat >conftest.$ac_ext <<_ACEOF
13594 #line 13594 "configure"
13595 #include "confdefs.h"
13596 #include <sys/types.h>
13597  /* Check that off_t can represent 2**63 - 1 correctly.
13598     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13599     since some C++ compilers masquerading as C compilers
13600     incorrectly reject 9223372036854775807.  */
13601 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13602   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13603                        && LARGE_OFF_T % 2147483647 == 1)
13604                       ? 1 : -1];
13605 int
13606 main (void)
13607 {
13608
13609   ;
13610   return 0;
13611 }
13612 _ACEOF
13613          rm -f conftest.$ac_objext
13614 if { (eval echo "$as_me:13614: \"$ac_compile\"") >&5
13615   (eval $ac_compile) 2>&5
13616   ac_status=$?
13617   echo "$as_me:13617: \$? = $ac_status" >&5
13618   (exit $ac_status); } &&
13619          { ac_try='test -s conftest.$ac_objext'
13620   { (eval echo "$as_me:13620: \"$ac_try\"") >&5
13621   (eval $ac_try) 2>&5
13622   ac_status=$?
13623   echo "$as_me:13623: \$? = $ac_status" >&5
13624   (exit $ac_status); }; }; then
13625   break
13626 else
13627   echo "$as_me: failed program was:" >&5
13628 cat conftest.$ac_ext >&5
13629 fi
13630 rm -f conftest.$ac_objext
13631          CC="$CC -n32"
13632          rm -f conftest.$ac_objext
13633 if { (eval echo "$as_me:13633: \"$ac_compile\"") >&5
13634   (eval $ac_compile) 2>&5
13635   ac_status=$?
13636   echo "$as_me:13636: \$? = $ac_status" >&5
13637   (exit $ac_status); } &&
13638          { ac_try='test -s conftest.$ac_objext'
13639   { (eval echo "$as_me:13639: \"$ac_try\"") >&5
13640   (eval $ac_try) 2>&5
13641   ac_status=$?
13642   echo "$as_me:13642: \$? = $ac_status" >&5
13643   (exit $ac_status); }; }; then
13644   ac_cv_sys_largefile_CC=' -n32'; break
13645 else
13646   echo "$as_me: failed program was:" >&5
13647 cat conftest.$ac_ext >&5
13648 fi
13649 rm -f conftest.$ac_objext
13650          break
13651        done
13652        CC=$ac_save_CC
13653        rm -f conftest.$ac_ext
13654     fi
13655 fi
13656 echo "$as_me:13656: result: $ac_cv_sys_largefile_CC" >&5
13657 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13658   if test "$ac_cv_sys_largefile_CC" != no; then
13659     CC=$CC$ac_cv_sys_largefile_CC
13660   fi
13661
13662   echo "$as_me:13662: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13663 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13664 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13665   echo $ECHO_N "(cached) $ECHO_C" >&6
13666 else
13667   while :; do
13668   ac_cv_sys_file_offset_bits=no
13669   cat >conftest.$ac_ext <<_ACEOF
13670 #line 13670 "configure"
13671 #include "confdefs.h"
13672 #include <sys/types.h>
13673  /* Check that off_t can represent 2**63 - 1 correctly.
13674     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13675     since some C++ compilers masquerading as C compilers
13676     incorrectly reject 9223372036854775807.  */
13677 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13678   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13679                        && LARGE_OFF_T % 2147483647 == 1)
13680                       ? 1 : -1];
13681 int
13682 main (void)
13683 {
13684
13685   ;
13686   return 0;
13687 }
13688 _ACEOF
13689 rm -f conftest.$ac_objext
13690 if { (eval echo "$as_me:13690: \"$ac_compile\"") >&5
13691   (eval $ac_compile) 2>&5
13692   ac_status=$?
13693   echo "$as_me:13693: \$? = $ac_status" >&5
13694   (exit $ac_status); } &&
13695          { ac_try='test -s conftest.$ac_objext'
13696   { (eval echo "$as_me:13696: \"$ac_try\"") >&5
13697   (eval $ac_try) 2>&5
13698   ac_status=$?
13699   echo "$as_me:13699: \$? = $ac_status" >&5
13700   (exit $ac_status); }; }; then
13701   break
13702 else
13703   echo "$as_me: failed program was:" >&5
13704 cat conftest.$ac_ext >&5
13705 fi
13706 rm -f conftest.$ac_objext conftest.$ac_ext
13707   cat >conftest.$ac_ext <<_ACEOF
13708 #line 13708 "configure"
13709 #include "confdefs.h"
13710 #define _FILE_OFFSET_BITS 64
13711 #include <sys/types.h>
13712  /* Check that off_t can represent 2**63 - 1 correctly.
13713     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13714     since some C++ compilers masquerading as C compilers
13715     incorrectly reject 9223372036854775807.  */
13716 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13717   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13718                        && LARGE_OFF_T % 2147483647 == 1)
13719                       ? 1 : -1];
13720 int
13721 main (void)
13722 {
13723
13724   ;
13725   return 0;
13726 }
13727 _ACEOF
13728 rm -f conftest.$ac_objext
13729 if { (eval echo "$as_me:13729: \"$ac_compile\"") >&5
13730   (eval $ac_compile) 2>&5
13731   ac_status=$?
13732   echo "$as_me:13732: \$? = $ac_status" >&5
13733   (exit $ac_status); } &&
13734          { ac_try='test -s conftest.$ac_objext'
13735   { (eval echo "$as_me:13735: \"$ac_try\"") >&5
13736   (eval $ac_try) 2>&5
13737   ac_status=$?
13738   echo "$as_me:13738: \$? = $ac_status" >&5
13739   (exit $ac_status); }; }; then
13740   ac_cv_sys_file_offset_bits=64; break
13741 else
13742   echo "$as_me: failed program was:" >&5
13743 cat conftest.$ac_ext >&5
13744 fi
13745 rm -f conftest.$ac_objext conftest.$ac_ext
13746   break
13747 done
13748 fi
13749 echo "$as_me:13749: result: $ac_cv_sys_file_offset_bits" >&5
13750 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13751 if test "$ac_cv_sys_file_offset_bits" != no; then
13752
13753 cat >>confdefs.h <<EOF
13754 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13755 EOF
13756
13757 fi
13758 rm -rf conftest*
13759   echo "$as_me:13759: checking for _LARGE_FILES value needed for large files" >&5
13760 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13761 if test "${ac_cv_sys_large_files+set}" = set; then
13762   echo $ECHO_N "(cached) $ECHO_C" >&6
13763 else
13764   while :; do
13765   ac_cv_sys_large_files=no
13766   cat >conftest.$ac_ext <<_ACEOF
13767 #line 13767 "configure"
13768 #include "confdefs.h"
13769 #include <sys/types.h>
13770  /* Check that off_t can represent 2**63 - 1 correctly.
13771     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13772     since some C++ compilers masquerading as C compilers
13773     incorrectly reject 9223372036854775807.  */
13774 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13775   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13776                        && LARGE_OFF_T % 2147483647 == 1)
13777                       ? 1 : -1];
13778 int
13779 main (void)
13780 {
13781
13782   ;
13783   return 0;
13784 }
13785 _ACEOF
13786 rm -f conftest.$ac_objext
13787 if { (eval echo "$as_me:13787: \"$ac_compile\"") >&5
13788   (eval $ac_compile) 2>&5
13789   ac_status=$?
13790   echo "$as_me:13790: \$? = $ac_status" >&5
13791   (exit $ac_status); } &&
13792          { ac_try='test -s conftest.$ac_objext'
13793   { (eval echo "$as_me:13793: \"$ac_try\"") >&5
13794   (eval $ac_try) 2>&5
13795   ac_status=$?
13796   echo "$as_me:13796: \$? = $ac_status" >&5
13797   (exit $ac_status); }; }; then
13798   break
13799 else
13800   echo "$as_me: failed program was:" >&5
13801 cat conftest.$ac_ext >&5
13802 fi
13803 rm -f conftest.$ac_objext conftest.$ac_ext
13804   cat >conftest.$ac_ext <<_ACEOF
13805 #line 13805 "configure"
13806 #include "confdefs.h"
13807 #define _LARGE_FILES 1
13808 #include <sys/types.h>
13809  /* Check that off_t can represent 2**63 - 1 correctly.
13810     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13811     since some C++ compilers masquerading as C compilers
13812     incorrectly reject 9223372036854775807.  */
13813 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13814   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13815                        && LARGE_OFF_T % 2147483647 == 1)
13816                       ? 1 : -1];
13817 int
13818 main (void)
13819 {
13820
13821   ;
13822   return 0;
13823 }
13824 _ACEOF
13825 rm -f conftest.$ac_objext
13826 if { (eval echo "$as_me:13826: \"$ac_compile\"") >&5
13827   (eval $ac_compile) 2>&5
13828   ac_status=$?
13829   echo "$as_me:13829: \$? = $ac_status" >&5
13830   (exit $ac_status); } &&
13831          { ac_try='test -s conftest.$ac_objext'
13832   { (eval echo "$as_me:13832: \"$ac_try\"") >&5
13833   (eval $ac_try) 2>&5
13834   ac_status=$?
13835   echo "$as_me:13835: \$? = $ac_status" >&5
13836   (exit $ac_status); }; }; then
13837   ac_cv_sys_large_files=1; break
13838 else
13839   echo "$as_me: failed program was:" >&5
13840 cat conftest.$ac_ext >&5
13841 fi
13842 rm -f conftest.$ac_objext conftest.$ac_ext
13843   break
13844 done
13845 fi
13846 echo "$as_me:13846: result: $ac_cv_sys_large_files" >&5
13847 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13848 if test "$ac_cv_sys_large_files" != no; then
13849
13850 cat >>confdefs.h <<EOF
13851 #define _LARGE_FILES $ac_cv_sys_large_files
13852 EOF
13853
13854 fi
13855 rm -rf conftest*
13856 fi
13857
13858         if test "$enable_largefile" != no ; then
13859         echo "$as_me:13859: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13860 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13861 if test "${ac_cv_sys_largefile_source+set}" = set; then
13862   echo $ECHO_N "(cached) $ECHO_C" >&6
13863 else
13864   while :; do
13865   ac_cv_sys_largefile_source=no
13866   cat >conftest.$ac_ext <<_ACEOF
13867 #line 13867 "configure"
13868 #include "confdefs.h"
13869 #include <stdio.h>
13870 int
13871 main (void)
13872 {
13873 return !fseeko;
13874   ;
13875   return 0;
13876 }
13877 _ACEOF
13878 rm -f conftest.$ac_objext
13879 if { (eval echo "$as_me:13879: \"$ac_compile\"") >&5
13880   (eval $ac_compile) 2>&5
13881   ac_status=$?
13882   echo "$as_me:13882: \$? = $ac_status" >&5
13883   (exit $ac_status); } &&
13884          { ac_try='test -s conftest.$ac_objext'
13885   { (eval echo "$as_me:13885: \"$ac_try\"") >&5
13886   (eval $ac_try) 2>&5
13887   ac_status=$?
13888   echo "$as_me:13888: \$? = $ac_status" >&5
13889   (exit $ac_status); }; }; then
13890   break
13891 else
13892   echo "$as_me: failed program was:" >&5
13893 cat conftest.$ac_ext >&5
13894 fi
13895 rm -f conftest.$ac_objext conftest.$ac_ext
13896   cat >conftest.$ac_ext <<_ACEOF
13897 #line 13897 "configure"
13898 #include "confdefs.h"
13899 #define _LARGEFILE_SOURCE 1
13900 #include <stdio.h>
13901 int
13902 main (void)
13903 {
13904 return !fseeko;
13905   ;
13906   return 0;
13907 }
13908 _ACEOF
13909 rm -f conftest.$ac_objext
13910 if { (eval echo "$as_me:13910: \"$ac_compile\"") >&5
13911   (eval $ac_compile) 2>&5
13912   ac_status=$?
13913   echo "$as_me:13913: \$? = $ac_status" >&5
13914   (exit $ac_status); } &&
13915          { ac_try='test -s conftest.$ac_objext'
13916   { (eval echo "$as_me:13916: \"$ac_try\"") >&5
13917   (eval $ac_try) 2>&5
13918   ac_status=$?
13919   echo "$as_me:13919: \$? = $ac_status" >&5
13920   (exit $ac_status); }; }; then
13921   ac_cv_sys_largefile_source=1; break
13922 else
13923   echo "$as_me: failed program was:" >&5
13924 cat conftest.$ac_ext >&5
13925 fi
13926 rm -f conftest.$ac_objext conftest.$ac_ext
13927   break
13928 done
13929 fi
13930 echo "$as_me:13930: result: $ac_cv_sys_largefile_source" >&5
13931 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13932 if test "$ac_cv_sys_largefile_source" != no; then
13933
13934 cat >>confdefs.h <<EOF
13935 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13936 EOF
13937
13938 fi
13939 rm -rf conftest*
13940
13941 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13942 # in glibc 2.1.3, but that breaks too many other things.
13943 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13944 echo "$as_me:13944: checking for fseeko" >&5
13945 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13946 if test "${ac_cv_func_fseeko+set}" = set; then
13947   echo $ECHO_N "(cached) $ECHO_C" >&6
13948 else
13949   cat >conftest.$ac_ext <<_ACEOF
13950 #line 13950 "configure"
13951 #include "confdefs.h"
13952 #include <stdio.h>
13953 int
13954 main (void)
13955 {
13956 return fseeko && fseeko (stdin, 0, 0);
13957   ;
13958   return 0;
13959 }
13960 _ACEOF
13961 rm -f conftest.$ac_objext conftest$ac_exeext
13962 if { (eval echo "$as_me:13962: \"$ac_link\"") >&5
13963   (eval $ac_link) 2>&5
13964   ac_status=$?
13965   echo "$as_me:13965: \$? = $ac_status" >&5
13966   (exit $ac_status); } &&
13967          { ac_try='test -s conftest$ac_exeext'
13968   { (eval echo "$as_me:13968: \"$ac_try\"") >&5
13969   (eval $ac_try) 2>&5
13970   ac_status=$?
13971   echo "$as_me:13971: \$? = $ac_status" >&5
13972   (exit $ac_status); }; }; then
13973   ac_cv_func_fseeko=yes
13974 else
13975   echo "$as_me: failed program was:" >&5
13976 cat conftest.$ac_ext >&5
13977 ac_cv_func_fseeko=no
13978 fi
13979 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13980 fi
13981 echo "$as_me:13981: result: $ac_cv_func_fseeko" >&5
13982 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13983 if test $ac_cv_func_fseeko = yes; then
13984
13985 cat >>confdefs.h <<\EOF
13986 #define HAVE_FSEEKO 1
13987 EOF
13988
13989 fi
13990
13991         # Normally we would collect these definitions in the config.h,
13992         # but (like _XOPEN_SOURCE), some environments rely on having these
13993         # defined before any of the system headers are included.  Another
13994         # case comes up with C++, e.g., on AIX the compiler compiles the
13995         # header files by themselves before looking at the body files it is
13996         # told to compile.  For ncurses, those header files do not include
13997         # the config.h
13998         if test "$ac_cv_sys_large_files" != no
13999         then
14000
14001         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14002         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14003
14004         fi
14005         if test "$ac_cv_sys_largefile_source" != no
14006         then
14007
14008         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14009         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14010
14011         fi
14012         if test "$ac_cv_sys_file_offset_bits" != no
14013         then
14014
14015         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14016         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14017
14018         fi
14019
14020         echo "$as_me:14020: checking whether to use struct dirent64" >&5
14021 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14022 if test "${cf_cv_struct_dirent64+set}" = set; then
14023   echo $ECHO_N "(cached) $ECHO_C" >&6
14024 else
14025
14026                 cat >conftest.$ac_ext <<_ACEOF
14027 #line 14027 "configure"
14028 #include "confdefs.h"
14029
14030 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14031 #include <sys/types.h>
14032 #include <dirent.h>
14033
14034 int
14035 main (void)
14036 {
14037
14038                 /* if transitional largefile support is setup, this is true */
14039                 extern struct dirent64 * readdir(DIR *);
14040                 struct dirent64 *x = readdir((DIR *)0);
14041                 struct dirent *y = readdir((DIR *)0);
14042                 int z = x - y;
14043                 (void)z;
14044
14045   ;
14046   return 0;
14047 }
14048 _ACEOF
14049 rm -f conftest.$ac_objext
14050 if { (eval echo "$as_me:14050: \"$ac_compile\"") >&5
14051   (eval $ac_compile) 2>&5
14052   ac_status=$?
14053   echo "$as_me:14053: \$? = $ac_status" >&5
14054   (exit $ac_status); } &&
14055          { ac_try='test -s conftest.$ac_objext'
14056   { (eval echo "$as_me:14056: \"$ac_try\"") >&5
14057   (eval $ac_try) 2>&5
14058   ac_status=$?
14059   echo "$as_me:14059: \$? = $ac_status" >&5
14060   (exit $ac_status); }; }; then
14061   cf_cv_struct_dirent64=yes
14062 else
14063   echo "$as_me: failed program was:" >&5
14064 cat conftest.$ac_ext >&5
14065 cf_cv_struct_dirent64=no
14066 fi
14067 rm -f conftest.$ac_objext conftest.$ac_ext
14068
14069 fi
14070 echo "$as_me:14070: result: $cf_cv_struct_dirent64" >&5
14071 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14072         test "$cf_cv_struct_dirent64" = yes &&
14073 cat >>confdefs.h <<\EOF
14074 #define HAVE_STRUCT_DIRENT64 1
14075 EOF
14076
14077         fi
14078
14079 ### Enable compiling-in rcs id's
14080 echo "$as_me:14080: checking if RCS identifiers should be compiled-in" >&5
14081 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14082
14083 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14084 if test "${with_rcs_ids+set}" = set; then
14085   withval="$with_rcs_ids"
14086   with_rcs_ids=$withval
14087 else
14088   with_rcs_ids=no
14089 fi;
14090 echo "$as_me:14090: result: $with_rcs_ids" >&5
14091 echo "${ECHO_T}$with_rcs_ids" >&6
14092 test "$with_rcs_ids" = yes &&
14093 cat >>confdefs.h <<\EOF
14094 #define USE_RCS_IDS 1
14095 EOF
14096
14097 ###############################################################################
14098
14099 ### Note that some functions (such as const) are normally disabled anyway.
14100 echo "$as_me:14100: checking if you want to build with function extensions" >&5
14101 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14102
14103 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14104 if test "${enable_ext_funcs+set}" = set; then
14105   enableval="$enable_ext_funcs"
14106   with_ext_funcs=$enableval
14107 else
14108   with_ext_funcs=yes
14109 fi;
14110 echo "$as_me:14110: result: $with_ext_funcs" >&5
14111 echo "${ECHO_T}$with_ext_funcs" >&6
14112 if test "$with_ext_funcs" = yes ; then
14113         NCURSES_EXT_FUNCS=1
14114
14115 cat >>confdefs.h <<\EOF
14116 #define HAVE_USE_DEFAULT_COLORS 1
14117 EOF
14118
14119 cat >>confdefs.h <<\EOF
14120 #define NCURSES_EXT_FUNCS 1
14121 EOF
14122
14123 else
14124         NCURSES_EXT_FUNCS=0
14125 fi
14126
14127 ###   use option --enable-const to turn on use of const beyond that in XSI.
14128 echo "$as_me:14128: checking for extended use of const keyword" >&5
14129 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14130
14131 # Check whether --enable-const or --disable-const was given.
14132 if test "${enable_const+set}" = set; then
14133   enableval="$enable_const"
14134   with_ext_const=$enableval
14135 else
14136   with_ext_const=no
14137 fi;
14138 echo "$as_me:14138: result: $with_ext_const" >&5
14139 echo "${ECHO_T}$with_ext_const" >&6
14140 NCURSES_CONST='/*nothing*/'
14141 if test "$with_ext_const" = yes ; then
14142         NCURSES_CONST=const
14143 fi
14144
14145 ###############################################################################
14146 # These options are relatively safe to experiment with.
14147
14148 echo "$as_me:14148: checking if you want all development code" >&5
14149 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14150
14151 # Check whether --with-develop or --without-develop was given.
14152 if test "${with_develop+set}" = set; then
14153   withval="$with_develop"
14154   with_develop=$withval
14155 else
14156   with_develop=no
14157 fi;
14158 echo "$as_me:14158: result: $with_develop" >&5
14159 echo "${ECHO_T}$with_develop" >&6
14160
14161 ###############################################################################
14162 # These are just experimental, probably should not be in a package:
14163
14164 # This is still experimental (20080329), but should ultimately be moved to
14165 # the script-block --with-normal, etc.
14166
14167 echo "$as_me:14167: checking if you want to link with the pthread library" >&5
14168 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14169
14170 # Check whether --with-pthread or --without-pthread was given.
14171 if test "${with_pthread+set}" = set; then
14172   withval="$with_pthread"
14173   with_pthread=$withval
14174 else
14175   with_pthread=no
14176 fi;
14177 echo "$as_me:14177: result: $with_pthread" >&5
14178 echo "${ECHO_T}$with_pthread" >&6
14179
14180 if test "$with_pthread" != no ; then
14181         echo "$as_me:14181: checking for pthread.h" >&5
14182 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14183 if test "${ac_cv_header_pthread_h+set}" = set; then
14184   echo $ECHO_N "(cached) $ECHO_C" >&6
14185 else
14186   cat >conftest.$ac_ext <<_ACEOF
14187 #line 14187 "configure"
14188 #include "confdefs.h"
14189 #include <pthread.h>
14190 _ACEOF
14191 if { (eval echo "$as_me:14191: \"$ac_cpp conftest.$ac_ext\"") >&5
14192   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14193   ac_status=$?
14194   egrep -v '^ *\+' conftest.er1 >conftest.err
14195   rm -f conftest.er1
14196   cat conftest.err >&5
14197   echo "$as_me:14197: \$? = $ac_status" >&5
14198   (exit $ac_status); } >/dev/null; then
14199   if test -s conftest.err; then
14200     ac_cpp_err=$ac_c_preproc_warn_flag
14201   else
14202     ac_cpp_err=
14203   fi
14204 else
14205   ac_cpp_err=yes
14206 fi
14207 if test -z "$ac_cpp_err"; then
14208   ac_cv_header_pthread_h=yes
14209 else
14210   echo "$as_me: failed program was:" >&5
14211   cat conftest.$ac_ext >&5
14212   ac_cv_header_pthread_h=no
14213 fi
14214 rm -f conftest.err conftest.$ac_ext
14215 fi
14216 echo "$as_me:14216: result: $ac_cv_header_pthread_h" >&5
14217 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14218 if test $ac_cv_header_pthread_h = yes; then
14219
14220 cat >>confdefs.h <<\EOF
14221 #define HAVE_PTHREADS_H 1
14222 EOF
14223
14224         for cf_lib_pthread in pthread c_r
14225         do
14226             echo "$as_me:14226: checking if we can link with the $cf_lib_pthread library" >&5
14227 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14228             cf_save_LIBS="$LIBS"
14229
14230 cf_add_libs="$LIBS"
14231 # reverse order
14232 cf_add_0lib=
14233 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14234 # filter duplicates
14235 for cf_add_1lib in $cf_add_0lib; do
14236         for cf_add_2lib in $cf_add_libs; do
14237                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14238                         cf_add_1lib=
14239                         break
14240                 fi
14241         done
14242         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14243 done
14244 LIBS="$cf_add_libs"
14245
14246             cat >conftest.$ac_ext <<_ACEOF
14247 #line 14247 "configure"
14248 #include "confdefs.h"
14249
14250 #include <pthread.h>
14251
14252 int
14253 main (void)
14254 {
14255
14256                 int rc = pthread_create(0,0,0,0);
14257                 int r2 = pthread_mutexattr_settype(0, 0);
14258
14259   ;
14260   return 0;
14261 }
14262 _ACEOF
14263 rm -f conftest.$ac_objext conftest$ac_exeext
14264 if { (eval echo "$as_me:14264: \"$ac_link\"") >&5
14265   (eval $ac_link) 2>&5
14266   ac_status=$?
14267   echo "$as_me:14267: \$? = $ac_status" >&5
14268   (exit $ac_status); } &&
14269          { ac_try='test -s conftest$ac_exeext'
14270   { (eval echo "$as_me:14270: \"$ac_try\"") >&5
14271   (eval $ac_try) 2>&5
14272   ac_status=$?
14273   echo "$as_me:14273: \$? = $ac_status" >&5
14274   (exit $ac_status); }; }; then
14275   with_pthread=yes
14276 else
14277   echo "$as_me: failed program was:" >&5
14278 cat conftest.$ac_ext >&5
14279 with_pthread=no
14280 fi
14281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14282             LIBS="$cf_save_LIBS"
14283             echo "$as_me:14283: result: $with_pthread" >&5
14284 echo "${ECHO_T}$with_pthread" >&6
14285             test "$with_pthread" = yes && break
14286         done
14287
14288         if test "$with_pthread" = yes ; then
14289
14290 cf_add_libs="$LIBS"
14291 # reverse order
14292 cf_add_0lib=
14293 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14294 # filter duplicates
14295 for cf_add_1lib in $cf_add_0lib; do
14296         for cf_add_2lib in $cf_add_libs; do
14297                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14298                         cf_add_1lib=
14299                         break
14300                 fi
14301         done
14302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14303 done
14304 LIBS="$cf_add_libs"
14305
14306 cat >>confdefs.h <<\EOF
14307 #define HAVE_LIBPTHREADS 1
14308 EOF
14309
14310         else
14311             { { echo "$as_me:14311: error: Cannot link with pthread library" >&5
14312 echo "$as_me: error: Cannot link with pthread library" >&2;}
14313    { (exit 1); exit 1; }; }
14314         fi
14315
14316 fi
14317
14318 fi
14319
14320 echo "$as_me:14320: checking if you want to use weak-symbols for pthreads" >&5
14321 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14322
14323 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14324 if test "${enable_weak_symbols+set}" = set; then
14325   enableval="$enable_weak_symbols"
14326   use_weak_symbols=$withval
14327 else
14328   use_weak_symbols=no
14329 fi;
14330 echo "$as_me:14330: result: $use_weak_symbols" >&5
14331 echo "${ECHO_T}$use_weak_symbols" >&6
14332 if test "$use_weak_symbols" = yes ; then
14333
14334 echo "$as_me:14334: checking if $CC supports weak symbols" >&5
14335 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14336 if test "${cf_cv_weak_symbols+set}" = set; then
14337   echo $ECHO_N "(cached) $ECHO_C" >&6
14338 else
14339
14340 cat >conftest.$ac_ext <<_ACEOF
14341 #line 14341 "configure"
14342 #include "confdefs.h"
14343
14344 #include <stdio.h>
14345 int
14346 main (void)
14347 {
14348
14349 #if defined(__GNUC__)
14350 #  if defined __USE_ISOC99
14351 #    define _cat_pragma(exp)    _Pragma(#exp)
14352 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14353 #  else
14354 #    define _weak_pragma(exp)
14355 #  endif
14356 #  define _declare(name)        __extension__ extern __typeof__(name) name
14357 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14358 #endif
14359
14360 weak_symbol(fopen);
14361
14362   ;
14363   return 0;
14364 }
14365 _ACEOF
14366 rm -f conftest.$ac_objext
14367 if { (eval echo "$as_me:14367: \"$ac_compile\"") >&5
14368   (eval $ac_compile) 2>&5
14369   ac_status=$?
14370   echo "$as_me:14370: \$? = $ac_status" >&5
14371   (exit $ac_status); } &&
14372          { ac_try='test -s conftest.$ac_objext'
14373   { (eval echo "$as_me:14373: \"$ac_try\"") >&5
14374   (eval $ac_try) 2>&5
14375   ac_status=$?
14376   echo "$as_me:14376: \$? = $ac_status" >&5
14377   (exit $ac_status); }; }; then
14378   cf_cv_weak_symbols=yes
14379 else
14380   echo "$as_me: failed program was:" >&5
14381 cat conftest.$ac_ext >&5
14382 cf_cv_weak_symbols=no
14383 fi
14384 rm -f conftest.$ac_objext conftest.$ac_ext
14385
14386 fi
14387 echo "$as_me:14387: result: $cf_cv_weak_symbols" >&5
14388 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14389
14390 else
14391         cf_cv_weak_symbols=no
14392 fi
14393
14394 if test $cf_cv_weak_symbols = yes ; then
14395
14396 cat >>confdefs.h <<\EOF
14397 #define USE_WEAK_SYMBOLS 1
14398 EOF
14399
14400 fi
14401
14402 PTHREAD=
14403 if test "$with_pthread" = "yes" ; then
14404
14405 cat >>confdefs.h <<\EOF
14406 #define USE_PTHREADS 1
14407 EOF
14408
14409         enable_reentrant=yes
14410         if test $cf_cv_weak_symbols = yes ; then
14411                 PTHREAD=-lpthread
14412         fi
14413 fi
14414
14415 # OpenSUSE is installing ncurses6, using reentrant option.
14416 echo "$as_me:14416: checking for _nc_TABSIZE" >&5
14417 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14418 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14419   echo $ECHO_N "(cached) $ECHO_C" >&6
14420 else
14421   cat >conftest.$ac_ext <<_ACEOF
14422 #line 14422 "configure"
14423 #include "confdefs.h"
14424 #define _nc_TABSIZE autoconf_temporary
14425 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14426 #undef _nc_TABSIZE
14427
14428 #ifdef __cplusplus
14429 extern "C"
14430 #endif
14431
14432 /* We use char because int might match the return type of a gcc2
14433    builtin and then its argument prototype would still apply.  */
14434 char _nc_TABSIZE (void);
14435
14436 int
14437 main (void)
14438 {
14439
14440 /* The GNU C library defines stubs for functions which it implements
14441     to always fail with ENOSYS.  Some functions are actually named
14442     something starting with __ and the normal name is an alias.  */
14443 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14444 #error found stub for _nc_TABSIZE
14445 #endif
14446
14447         return _nc_TABSIZE ();
14448   ;
14449   return 0;
14450 }
14451 _ACEOF
14452 rm -f conftest.$ac_objext conftest$ac_exeext
14453 if { (eval echo "$as_me:14453: \"$ac_link\"") >&5
14454   (eval $ac_link) 2>&5
14455   ac_status=$?
14456   echo "$as_me:14456: \$? = $ac_status" >&5
14457   (exit $ac_status); } &&
14458          { ac_try='test -s conftest$ac_exeext'
14459   { (eval echo "$as_me:14459: \"$ac_try\"") >&5
14460   (eval $ac_try) 2>&5
14461   ac_status=$?
14462   echo "$as_me:14462: \$? = $ac_status" >&5
14463   (exit $ac_status); }; }; then
14464   ac_cv_func__nc_TABSIZE=yes
14465 else
14466   echo "$as_me: failed program was:" >&5
14467 cat conftest.$ac_ext >&5
14468 ac_cv_func__nc_TABSIZE=no
14469 fi
14470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14471 fi
14472 echo "$as_me:14472: result: $ac_cv_func__nc_TABSIZE" >&5
14473 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14474 if test $ac_cv_func__nc_TABSIZE = yes; then
14475   assume_reentrant=yes
14476 else
14477   assume_reentrant=no
14478 fi
14479
14480 # Reentrant code has to be opaque; there's little advantage to making ncurses
14481 # opaque outside of that, so there is no --enable-opaque option.  We can use
14482 # this option without --with-pthreads, but this will be always set for
14483 # pthreads.
14484 echo "$as_me:14484: checking if you want experimental reentrant code" >&5
14485 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14486
14487 # Check whether --enable-reentrant or --disable-reentrant was given.
14488 if test "${enable_reentrant+set}" = set; then
14489   enableval="$enable_reentrant"
14490   with_reentrant=$enableval
14491 else
14492   with_reentrant=$assume_reentrant
14493 fi;
14494 echo "$as_me:14494: result: $with_reentrant" >&5
14495 echo "${ECHO_T}$with_reentrant" >&6
14496 if test "$with_reentrant" = yes ; then
14497         cf_cv_enable_reentrant=1
14498         if test $cf_cv_weak_symbols = yes ; then
14499
14500 # remove pthread library from $LIBS
14501 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14502
14503         elif test "$assume_reentrant" = no ; then
14504                 LIB_SUFFIX="t${LIB_SUFFIX}"
14505         fi
14506
14507 cat >>confdefs.h <<\EOF
14508 #define USE_REENTRANT 1
14509 EOF
14510
14511 else
14512         cf_cv_enable_reentrant=0
14513 fi
14514
14515 ### Allow using a different wrap-prefix
14516 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14517         echo "$as_me:14517: checking for prefix used to wrap public variables" >&5
14518 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14519
14520 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14521 if test "${with_wrap_prefix+set}" = set; then
14522   withval="$with_wrap_prefix"
14523   NCURSES_WRAP_PREFIX=$withval
14524 else
14525   NCURSES_WRAP_PREFIX=_nc_
14526 fi;
14527         echo "$as_me:14527: result: $NCURSES_WRAP_PREFIX" >&5
14528 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14529 else
14530         NCURSES_WRAP_PREFIX=_nc_
14531 fi
14532
14533 cat >>confdefs.h <<EOF
14534 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14535 EOF
14536
14537 ###############################################################################
14538
14539 ###     use option --disable-echo to suppress full display compiling commands
14540
14541 echo "$as_me:14541: checking if you want to see long compiling messages" >&5
14542 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14543
14544 # Check whether --enable-echo or --disable-echo was given.
14545 if test "${enable_echo+set}" = set; then
14546   enableval="$enable_echo"
14547   test "$enableval" != no && enableval=yes
14548         if test "$enableval" != "yes" ; then
14549
14550         ECHO_LT='--silent'
14551         ECHO_LD='@echo linking $@;'
14552         RULE_CC='@echo compiling $<'
14553         SHOW_CC='@echo compiling $@'
14554         ECHO_CC='@'
14555
14556         else
14557
14558         ECHO_LT=''
14559         ECHO_LD=''
14560         RULE_CC=''
14561         SHOW_CC=''
14562         ECHO_CC=''
14563
14564         fi
14565 else
14566   enableval=yes
14567
14568         ECHO_LT=''
14569         ECHO_LD=''
14570         RULE_CC=''
14571         SHOW_CC=''
14572         ECHO_CC=''
14573
14574 fi;
14575 echo "$as_me:14575: result: $enableval" >&5
14576 echo "${ECHO_T}$enableval" >&6
14577
14578 ###     use option --enable-warnings to turn on all gcc warnings
14579 echo "$as_me:14579: checking if you want to see compiler warnings" >&5
14580 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
14581
14582 # Check whether --enable-warnings or --disable-warnings was given.
14583 if test "${enable_warnings+set}" = set; then
14584   enableval="$enable_warnings"
14585   with_warnings=$enableval
14586 fi;
14587 echo "$as_me:14587: result: $with_warnings" >&5
14588 echo "${ECHO_T}$with_warnings" >&6
14589
14590 if ( test "$GCC" = yes || test "$GXX" = yes )
14591 then
14592
14593 if ( test "$GCC" = yes || test "$GXX" = yes )
14594 then
14595         case $CFLAGS in
14596         (*-Werror=*)
14597                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14598
14599 echo "${as_me:-configure}:14599: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14600
14601                 cf_temp_flags=
14602                 for cf_temp_scan in $CFLAGS
14603                 do
14604                         case "x$cf_temp_scan" in
14605                         (x-Werror=*)
14606
14607         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14608         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14609
14610                                 ;;
14611                         (*)
14612
14613         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14614         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14615
14616                                 ;;
14617                         esac
14618                 done
14619                 CFLAGS="$cf_temp_flags"
14620                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
14621
14622 echo "${as_me:-configure}:14622: testing ... fixed $CFLAGS ..." 1>&5
14623
14624                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14625
14626 echo "${as_me:-configure}:14626: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14627
14628                 ;;
14629         esac
14630 fi
14631
14632 if ( test "$GCC" = yes || test "$GXX" = yes )
14633 then
14634         case $CPPFLAGS in
14635         (*-Werror=*)
14636                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
14637
14638 echo "${as_me:-configure}:14638: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
14639
14640                 cf_temp_flags=
14641                 for cf_temp_scan in $CPPFLAGS
14642                 do
14643                         case "x$cf_temp_scan" in
14644                         (x-Werror=*)
14645
14646         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14647         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14648
14649                                 ;;
14650                         (*)
14651
14652         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14653         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14654
14655                                 ;;
14656                         esac
14657                 done
14658                 CPPFLAGS="$cf_temp_flags"
14659                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
14660
14661 echo "${as_me:-configure}:14661: testing ... fixed $CPPFLAGS ..." 1>&5
14662
14663                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14664
14665 echo "${as_me:-configure}:14665: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14666
14667                 ;;
14668         esac
14669 fi
14670
14671 if ( test "$GCC" = yes || test "$GXX" = yes )
14672 then
14673         case $LDFLAGS in
14674         (*-Werror=*)
14675                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
14676
14677 echo "${as_me:-configure}:14677: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
14678
14679                 cf_temp_flags=
14680                 for cf_temp_scan in $LDFLAGS
14681                 do
14682                         case "x$cf_temp_scan" in
14683                         (x-Werror=*)
14684
14685         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14686         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14687
14688                                 ;;
14689                         (*)
14690
14691         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14692         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14693
14694                                 ;;
14695                         esac
14696                 done
14697                 LDFLAGS="$cf_temp_flags"
14698                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
14699
14700 echo "${as_me:-configure}:14700: testing ... fixed $LDFLAGS ..." 1>&5
14701
14702                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14703
14704 echo "${as_me:-configure}:14704: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14705
14706                 ;;
14707         esac
14708 fi
14709
14710 echo "$as_me:14710: checking if you want to turn on gcc warnings" >&5
14711 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14712
14713 # Check whether --enable-warnings or --disable-warnings was given.
14714 if test "${enable_warnings+set}" = set; then
14715   enableval="$enable_warnings"
14716   test "$enableval" != yes && enableval=no
14717         if test "$enableval" != "no" ; then
14718     with_warnings=yes
14719         else
14720                 with_warnings=no
14721         fi
14722 else
14723   enableval=no
14724         with_warnings=no
14725
14726 fi;
14727 echo "$as_me:14727: result: $with_warnings" >&5
14728 echo "${ECHO_T}$with_warnings" >&6
14729 if test "$with_warnings" = "yes"
14730 then
14731
14732 if test "x$have_x" = xyes; then
14733
14734 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14735 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14736 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14737 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14738 for cf_X_CFLAGS in $X_CFLAGS
14739 do
14740         case "x$cf_X_CFLAGS" in
14741         x-[IUD]*)
14742                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14743                 ;;
14744         *)
14745                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14746                 ;;
14747         esac
14748 done
14749
14750 cat >conftest.$ac_ext <<_ACEOF
14751 #line 14751 "configure"
14752 #include "confdefs.h"
14753
14754 #include <stdlib.h>
14755 #include <X11/Intrinsic.h>
14756
14757 int
14758 main (void)
14759 {
14760 String foo = malloc(1); (void)foo
14761   ;
14762   return 0;
14763 }
14764 _ACEOF
14765 rm -f conftest.$ac_objext
14766 if { (eval echo "$as_me:14766: \"$ac_compile\"") >&5
14767   (eval $ac_compile) 2>&5
14768   ac_status=$?
14769   echo "$as_me:14769: \$? = $ac_status" >&5
14770   (exit $ac_status); } &&
14771          { ac_try='test -s conftest.$ac_objext'
14772   { (eval echo "$as_me:14772: \"$ac_try\"") >&5
14773   (eval $ac_try) 2>&5
14774   ac_status=$?
14775   echo "$as_me:14775: \$? = $ac_status" >&5
14776   (exit $ac_status); }; }; then
14777
14778 echo "$as_me:14778: checking for X11/Xt const-feature" >&5
14779 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
14780 if test "${cf_cv_const_x_string+set}" = set; then
14781   echo $ECHO_N "(cached) $ECHO_C" >&6
14782 else
14783
14784         cat >conftest.$ac_ext <<_ACEOF
14785 #line 14785 "configure"
14786 #include "confdefs.h"
14787
14788 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
14789 #undef  XTSTRINGDEFINES /* X11R5 and later */
14790 #include <stdlib.h>
14791 #include <X11/Intrinsic.h>
14792
14793 int
14794 main (void)
14795 {
14796 String foo = malloc(1); *foo = 0
14797   ;
14798   return 0;
14799 }
14800 _ACEOF
14801 rm -f conftest.$ac_objext
14802 if { (eval echo "$as_me:14802: \"$ac_compile\"") >&5
14803   (eval $ac_compile) 2>&5
14804   ac_status=$?
14805   echo "$as_me:14805: \$? = $ac_status" >&5
14806   (exit $ac_status); } &&
14807          { ac_try='test -s conftest.$ac_objext'
14808   { (eval echo "$as_me:14808: \"$ac_try\"") >&5
14809   (eval $ac_try) 2>&5
14810   ac_status=$?
14811   echo "$as_me:14811: \$? = $ac_status" >&5
14812   (exit $ac_status); }; }; then
14813
14814                         cf_cv_const_x_string=no
14815
14816 else
14817   echo "$as_me: failed program was:" >&5
14818 cat conftest.$ac_ext >&5
14819
14820                         cf_cv_const_x_string=yes
14821
14822 fi
14823 rm -f conftest.$ac_objext conftest.$ac_ext
14824
14825 fi
14826 echo "$as_me:14826: result: $cf_cv_const_x_string" >&5
14827 echo "${ECHO_T}$cf_cv_const_x_string" >&6
14828
14829 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
14830 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
14831 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
14832
14833 case $cf_cv_const_x_string in
14834 (no)
14835
14836         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14837         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
14838
14839         ;;
14840 (*)
14841
14842         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14843         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
14844
14845         ;;
14846 esac
14847
14848 else
14849   echo "$as_me: failed program was:" >&5
14850 cat conftest.$ac_ext >&5
14851 fi
14852 rm -f conftest.$ac_objext conftest.$ac_ext
14853  fi
14854 cat > conftest.$ac_ext <<EOF
14855 #line 14855 "${as_me:-configure}"
14856 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
14857 EOF
14858 if test "$INTEL_COMPILER" = yes
14859 then
14860 # The "-wdXXX" options suppress warnings:
14861 # remark #1419: external declaration in primary source file
14862 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
14863 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
14864 # remark #193: zero used for undefined preprocessing identifier
14865 # remark #593: variable "curs_sb_left_arrow" was set but never used
14866 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
14867 # remark #869: parameter "tw" was never referenced
14868 # remark #981: operands are evaluated in unspecified order
14869 # warning #279: controlling expression is constant
14870
14871         { echo "$as_me:14871: checking for $CC warning options..." >&5
14872 echo "$as_me: checking for $CC warning options..." >&6;}
14873         cf_save_CFLAGS="$CFLAGS"
14874         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
14875         for cf_opt in \
14876                 wd1419 \
14877                 wd1683 \
14878                 wd1684 \
14879                 wd193 \
14880                 wd593 \
14881                 wd279 \
14882                 wd810 \
14883                 wd869 \
14884                 wd981
14885         do
14886                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14887                 if { (eval echo "$as_me:14887: \"$ac_compile\"") >&5
14888   (eval $ac_compile) 2>&5
14889   ac_status=$?
14890   echo "$as_me:14890: \$? = $ac_status" >&5
14891   (exit $ac_status); }; then
14892                         test -n "$verbose" && echo "$as_me:14892: result: ... -$cf_opt" >&5
14893 echo "${ECHO_T}... -$cf_opt" >&6
14894                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14895                 fi
14896         done
14897         CFLAGS="$cf_save_CFLAGS"
14898 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
14899 then
14900         { echo "$as_me:14900: checking for $CC warning options..." >&5
14901 echo "$as_me: checking for $CC warning options..." >&6;}
14902         cf_save_CFLAGS="$CFLAGS"
14903         cf_warn_CONST=""
14904         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
14905         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
14906         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
14907         for cf_opt in W Wall \
14908                 Wbad-function-cast \
14909                 Wcast-align \
14910                 Wcast-qual \
14911                 Wdeclaration-after-statement \
14912                 Wextra \
14913                 Winline \
14914                 Wmissing-declarations \
14915                 Wmissing-prototypes \
14916                 Wnested-externs \
14917                 Wpointer-arith \
14918                 Wshadow \
14919                 Wstrict-prototypes \
14920                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
14921         do
14922                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14923                 if { (eval echo "$as_me:14923: \"$ac_compile\"") >&5
14924   (eval $ac_compile) 2>&5
14925   ac_status=$?
14926   echo "$as_me:14926: \$? = $ac_status" >&5
14927   (exit $ac_status); }; then
14928                         test -n "$verbose" && echo "$as_me:14928: result: ... -$cf_opt" >&5
14929 echo "${ECHO_T}... -$cf_opt" >&6
14930                         case $cf_opt in
14931                         (Winline)
14932                                 case $GCC_VERSION in
14933                                 ([34].*)
14934                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14935
14936 echo "${as_me:-configure}:14936: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14937
14938                                         continue;;
14939                                 esac
14940                                 ;;
14941                         (Wpointer-arith)
14942                                 case $GCC_VERSION in
14943                                 ([12].*)
14944                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14945
14946 echo "${as_me:-configure}:14946: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14947
14948                                         continue;;
14949                                 esac
14950                                 ;;
14951                         esac
14952                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14953                 fi
14954         done
14955         CFLAGS="$cf_save_CFLAGS"
14956 fi
14957 rm -rf conftest*
14958
14959 fi
14960
14961 if ( test "$GCC" = yes || test "$GXX" = yes )
14962 then
14963 cat > conftest.i <<EOF
14964 #ifndef GCC_PRINTF
14965 #define GCC_PRINTF 0
14966 #endif
14967 #ifndef GCC_SCANF
14968 #define GCC_SCANF 0
14969 #endif
14970 #ifndef GCC_NORETURN
14971 #define GCC_NORETURN /* nothing */
14972 #endif
14973 #ifndef GCC_UNUSED
14974 #define GCC_UNUSED /* nothing */
14975 #endif
14976 EOF
14977 if test "$GCC" = yes
14978 then
14979         { echo "$as_me:14979: checking for $CC __attribute__ directives..." >&5
14980 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
14981 cat > conftest.$ac_ext <<EOF
14982 #line 14982 "${as_me:-configure}"
14983 #include "confdefs.h"
14984 #include "conftest.h"
14985 #include "conftest.i"
14986 #if     GCC_PRINTF
14987 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
14988 #else
14989 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
14990 #endif
14991 #if     GCC_SCANF
14992 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
14993 #else
14994 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
14995 #endif
14996 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
14997 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
14998 extern void foo(void) GCC_NORETURN;
14999 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15000 EOF
15001         cf_printf_attribute=no
15002         cf_scanf_attribute=no
15003         for cf_attribute in scanf printf unused noreturn
15004         do
15005
15006 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15007
15008                 cf_directive="__attribute__(($cf_attribute))"
15009                 echo "checking for $CC $cf_directive" 1>&5
15010
15011                 case $cf_attribute in
15012                 (printf)
15013                         cf_printf_attribute=yes
15014                         cat >conftest.h <<EOF
15015 #define GCC_$cf_ATTRIBUTE 1
15016 EOF
15017                         ;;
15018                 (scanf)
15019                         cf_scanf_attribute=yes
15020                         cat >conftest.h <<EOF
15021 #define GCC_$cf_ATTRIBUTE 1
15022 EOF
15023                         ;;
15024                 (*)
15025                         cat >conftest.h <<EOF
15026 #define GCC_$cf_ATTRIBUTE $cf_directive
15027 EOF
15028                         ;;
15029                 esac
15030
15031                 if { (eval echo "$as_me:15031: \"$ac_compile\"") >&5
15032   (eval $ac_compile) 2>&5
15033   ac_status=$?
15034   echo "$as_me:15034: \$? = $ac_status" >&5
15035   (exit $ac_status); }; then
15036                         test -n "$verbose" && echo "$as_me:15036: result: ... $cf_attribute" >&5
15037 echo "${ECHO_T}... $cf_attribute" >&6
15038                         cat conftest.h >>confdefs.h
15039                         case $cf_attribute in
15040                         (noreturn)
15041
15042 cat >>confdefs.h <<EOF
15043 #define GCC_NORETURN $cf_directive
15044 EOF
15045
15046                                 ;;
15047                         (printf)
15048                                 cf_value='/* nothing */'
15049                                 if test "$cf_printf_attribute" != no ; then
15050                                         cf_value='__attribute__((format(printf,fmt,var)))'
15051
15052 cat >>confdefs.h <<\EOF
15053 #define GCC_PRINTF 1
15054 EOF
15055
15056                                 fi
15057
15058 cat >>confdefs.h <<EOF
15059 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15060 EOF
15061
15062                                 ;;
15063                         (scanf)
15064                                 cf_value='/* nothing */'
15065                                 if test "$cf_scanf_attribute" != no ; then
15066                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15067
15068 cat >>confdefs.h <<\EOF
15069 #define GCC_SCANF 1
15070 EOF
15071
15072                                 fi
15073
15074 cat >>confdefs.h <<EOF
15075 #define GCC_SCANFLIKE(fmt,var) $cf_value
15076 EOF
15077
15078                                 ;;
15079                         (unused)
15080
15081 cat >>confdefs.h <<EOF
15082 #define GCC_UNUSED $cf_directive
15083 EOF
15084
15085                                 ;;
15086                         esac
15087                 fi
15088         done
15089 else
15090         fgrep define conftest.i >>confdefs.h
15091 fi
15092 rm -rf conftest*
15093 fi
15094
15095 fi
15096
15097 if test "x$with_warnings" = "xyes"; then
15098
15099         ADAFLAGS="$ADAFLAGS -gnatg"
15100
15101 fi
15102
15103 ###     use option --enable-assertions to turn on generation of assertion code
15104 echo "$as_me:15104: checking if you want to enable runtime assertions" >&5
15105 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15106
15107 # Check whether --enable-assertions or --disable-assertions was given.
15108 if test "${enable_assertions+set}" = set; then
15109   enableval="$enable_assertions"
15110   with_assertions=$enableval
15111 else
15112   with_assertions=no
15113 fi;
15114 echo "$as_me:15114: result: $with_assertions" >&5
15115 echo "${ECHO_T}$with_assertions" >&6
15116 if test -n "$GCC"
15117 then
15118         if test "$with_assertions" = no
15119         then
15120                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15121         else
15122
15123         ADAFLAGS="$ADAFLAGS -gnata"
15124
15125         fi
15126 fi
15127
15128 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15129
15130 cat >>confdefs.h <<\EOF
15131 #define HAVE_NC_ALLOC_H 1
15132 EOF
15133
15134 ###     use option --enable-expanded to generate certain macros as functions
15135
15136 # Check whether --enable-expanded or --disable-expanded was given.
15137 if test "${enable_expanded+set}" = set; then
15138   enableval="$enable_expanded"
15139   test "$enableval" = yes &&
15140 cat >>confdefs.h <<\EOF
15141 #define NCURSES_EXPANDED 1
15142 EOF
15143
15144 fi;
15145
15146 ###     use option --disable-macros to suppress macros in favor of functions
15147
15148 # Check whether --enable-macros or --disable-macros was given.
15149 if test "${enable_macros+set}" = set; then
15150   enableval="$enable_macros"
15151   test "$enableval" = no &&
15152 cat >>confdefs.h <<\EOF
15153 #define NCURSES_NOMACROS 1
15154 EOF
15155
15156 fi;
15157
15158 # Normally we only add trace() to the debug-library.  Allow this to be
15159 # extended to all models of the ncurses library:
15160 cf_all_traces=no
15161 case "$CFLAGS $CPPFLAGS" in
15162 (*-DTRACE*)
15163         cf_all_traces=yes
15164         ;;
15165 esac
15166
15167 echo "$as_me:15167: checking whether to add trace feature to all models" >&5
15168 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15169
15170 # Check whether --with-trace or --without-trace was given.
15171 if test "${with_trace+set}" = set; then
15172   withval="$with_trace"
15173   cf_with_trace=$withval
15174 else
15175   cf_with_trace=$cf_all_traces
15176 fi;
15177 echo "$as_me:15177: result: $cf_with_trace" >&5
15178 echo "${ECHO_T}$cf_with_trace" >&6
15179
15180 if test "$cf_with_trace" = yes ; then
15181         ADA_TRACE=TRUE
15182
15183 cf_fix_cppflags=no
15184 cf_new_cflags=
15185 cf_new_cppflags=
15186 cf_new_extra_cppflags=
15187
15188 for cf_add_cflags in -DTRACE
15189 do
15190 case $cf_fix_cppflags in
15191 (no)
15192         case $cf_add_cflags in
15193         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15194                 case $cf_add_cflags in
15195                 (-D*)
15196                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15197
15198                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15199                                 && test -z "${cf_tst_cflags}" \
15200                                 && cf_fix_cppflags=yes
15201
15202                         if test $cf_fix_cppflags = yes ; then
15203
15204         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15205         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15206
15207                                 continue
15208                         elif test "${cf_tst_cflags}" = "\"'" ; then
15209
15210         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15211         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15212
15213                                 continue
15214                         fi
15215                         ;;
15216                 esac
15217                 case "$CPPFLAGS" in
15218                 (*$cf_add_cflags)
15219                         ;;
15220                 (*)
15221                         case $cf_add_cflags in
15222                         (-D*)
15223                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15224
15225 CPPFLAGS=`echo "$CPPFLAGS" | \
15226         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15227                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15228
15229                                 ;;
15230                         esac
15231
15232         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15233         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15234
15235                         ;;
15236                 esac
15237                 ;;
15238         (*)
15239
15240         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15241         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15242
15243                 ;;
15244         esac
15245         ;;
15246 (yes)
15247
15248         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15249         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15250
15251         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15252
15253         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15254                 && test -z "${cf_tst_cflags}" \
15255                 && cf_fix_cppflags=no
15256         ;;
15257 esac
15258 done
15259
15260 if test -n "$cf_new_cflags" ; then
15261
15262         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15263         CFLAGS="${CFLAGS}$cf_new_cflags"
15264
15265 fi
15266
15267 if test -n "$cf_new_cppflags" ; then
15268
15269         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15270         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15271
15272 fi
15273
15274 if test -n "$cf_new_extra_cppflags" ; then
15275
15276         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15277         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15278
15279 fi
15280
15281 else
15282         ADA_TRACE=FALSE
15283 fi
15284
15285 echo "$as_me:15285: checking if we want to use GNAT projects" >&5
15286 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15287
15288 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15289 if test "${enable_gnat_projects+set}" = set; then
15290   enableval="$enable_gnat_projects"
15291   test "$enableval" != no && enableval=yes
15292         if test "$enableval" != "yes" ; then
15293     enable_gnat_projects=no
15294         else
15295                 enable_gnat_projects=yes
15296         fi
15297 else
15298   enableval=yes
15299         enable_gnat_projects=yes
15300
15301 fi;
15302 echo "$as_me:15302: result: $enable_gnat_projects" >&5
15303 echo "${ECHO_T}$enable_gnat_projects" >&6
15304
15305 ###     Checks for libraries.
15306 case $cf_cv_system_name in
15307 (*mingw32*)
15308         ;;
15309 (*)
15310 echo "$as_me:15310: checking for gettimeofday" >&5
15311 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15312 if test "${ac_cv_func_gettimeofday+set}" = set; then
15313   echo $ECHO_N "(cached) $ECHO_C" >&6
15314 else
15315   cat >conftest.$ac_ext <<_ACEOF
15316 #line 15316 "configure"
15317 #include "confdefs.h"
15318 #define gettimeofday autoconf_temporary
15319 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15320 #undef gettimeofday
15321
15322 #ifdef __cplusplus
15323 extern "C"
15324 #endif
15325
15326 /* We use char because int might match the return type of a gcc2
15327    builtin and then its argument prototype would still apply.  */
15328 char gettimeofday (void);
15329
15330 int
15331 main (void)
15332 {
15333
15334 /* The GNU C library defines stubs for functions which it implements
15335     to always fail with ENOSYS.  Some functions are actually named
15336     something starting with __ and the normal name is an alias.  */
15337 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15338 #error found stub for gettimeofday
15339 #endif
15340
15341         return gettimeofday ();
15342   ;
15343   return 0;
15344 }
15345 _ACEOF
15346 rm -f conftest.$ac_objext conftest$ac_exeext
15347 if { (eval echo "$as_me:15347: \"$ac_link\"") >&5
15348   (eval $ac_link) 2>&5
15349   ac_status=$?
15350   echo "$as_me:15350: \$? = $ac_status" >&5
15351   (exit $ac_status); } &&
15352          { ac_try='test -s conftest$ac_exeext'
15353   { (eval echo "$as_me:15353: \"$ac_try\"") >&5
15354   (eval $ac_try) 2>&5
15355   ac_status=$?
15356   echo "$as_me:15356: \$? = $ac_status" >&5
15357   (exit $ac_status); }; }; then
15358   ac_cv_func_gettimeofday=yes
15359 else
15360   echo "$as_me: failed program was:" >&5
15361 cat conftest.$ac_ext >&5
15362 ac_cv_func_gettimeofday=no
15363 fi
15364 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15365 fi
15366 echo "$as_me:15366: result: $ac_cv_func_gettimeofday" >&5
15367 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15368 if test $ac_cv_func_gettimeofday = yes; then
15369   cat >>confdefs.h <<\EOF
15370 #define HAVE_GETTIMEOFDAY 1
15371 EOF
15372
15373 else
15374
15375 echo "$as_me:15375: checking for gettimeofday in -lbsd" >&5
15376 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15377 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15378   echo $ECHO_N "(cached) $ECHO_C" >&6
15379 else
15380   ac_check_lib_save_LIBS=$LIBS
15381 LIBS="-lbsd  $LIBS"
15382 cat >conftest.$ac_ext <<_ACEOF
15383 #line 15383 "configure"
15384 #include "confdefs.h"
15385
15386 /* Override any gcc2 internal prototype to avoid an error.  */
15387 #ifdef __cplusplus
15388 extern "C"
15389 #endif
15390 /* We use char because int might match the return type of a gcc2
15391    builtin and then its argument prototype would still apply.  */
15392 char gettimeofday ();
15393 int
15394 main (void)
15395 {
15396 gettimeofday ();
15397   ;
15398   return 0;
15399 }
15400 _ACEOF
15401 rm -f conftest.$ac_objext conftest$ac_exeext
15402 if { (eval echo "$as_me:15402: \"$ac_link\"") >&5
15403   (eval $ac_link) 2>&5
15404   ac_status=$?
15405   echo "$as_me:15405: \$? = $ac_status" >&5
15406   (exit $ac_status); } &&
15407          { ac_try='test -s conftest$ac_exeext'
15408   { (eval echo "$as_me:15408: \"$ac_try\"") >&5
15409   (eval $ac_try) 2>&5
15410   ac_status=$?
15411   echo "$as_me:15411: \$? = $ac_status" >&5
15412   (exit $ac_status); }; }; then
15413   ac_cv_lib_bsd_gettimeofday=yes
15414 else
15415   echo "$as_me: failed program was:" >&5
15416 cat conftest.$ac_ext >&5
15417 ac_cv_lib_bsd_gettimeofday=no
15418 fi
15419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15420 LIBS=$ac_check_lib_save_LIBS
15421 fi
15422 echo "$as_me:15422: result: $ac_cv_lib_bsd_gettimeofday" >&5
15423 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15424 if test $ac_cv_lib_bsd_gettimeofday = yes; then
15425
15426 cat >>confdefs.h <<\EOF
15427 #define HAVE_GETTIMEOFDAY 1
15428 EOF
15429
15430         LIBS="$LIBS -lbsd"
15431 fi
15432
15433 fi
15434         ;;
15435 esac
15436
15437 ###     Checks for header files.
15438 echo "$as_me:15438: checking for ANSI C header files" >&5
15439 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15440 if test "${ac_cv_header_stdc+set}" = set; then
15441   echo $ECHO_N "(cached) $ECHO_C" >&6
15442 else
15443   cat >conftest.$ac_ext <<_ACEOF
15444 #line 15444 "configure"
15445 #include "confdefs.h"
15446 #include <stdlib.h>
15447 #include <stdarg.h>
15448 #include <string.h>
15449 #include <float.h>
15450
15451 _ACEOF
15452 if { (eval echo "$as_me:15452: \"$ac_cpp conftest.$ac_ext\"") >&5
15453   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15454   ac_status=$?
15455   egrep -v '^ *\+' conftest.er1 >conftest.err
15456   rm -f conftest.er1
15457   cat conftest.err >&5
15458   echo "$as_me:15458: \$? = $ac_status" >&5
15459   (exit $ac_status); } >/dev/null; then
15460   if test -s conftest.err; then
15461     ac_cpp_err=$ac_c_preproc_warn_flag
15462   else
15463     ac_cpp_err=
15464   fi
15465 else
15466   ac_cpp_err=yes
15467 fi
15468 if test -z "$ac_cpp_err"; then
15469   ac_cv_header_stdc=yes
15470 else
15471   echo "$as_me: failed program was:" >&5
15472   cat conftest.$ac_ext >&5
15473   ac_cv_header_stdc=no
15474 fi
15475 rm -f conftest.err conftest.$ac_ext
15476
15477 if test $ac_cv_header_stdc = yes; then
15478   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15479   cat >conftest.$ac_ext <<_ACEOF
15480 #line 15480 "configure"
15481 #include "confdefs.h"
15482 #include <string.h>
15483
15484 _ACEOF
15485 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15486   egrep "memchr" >/dev/null 2>&1; then
15487   :
15488 else
15489   ac_cv_header_stdc=no
15490 fi
15491 rm -rf conftest*
15492
15493 fi
15494
15495 if test $ac_cv_header_stdc = yes; then
15496   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15497   cat >conftest.$ac_ext <<_ACEOF
15498 #line 15498 "configure"
15499 #include "confdefs.h"
15500 #include <stdlib.h>
15501
15502 _ACEOF
15503 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15504   egrep "free" >/dev/null 2>&1; then
15505   :
15506 else
15507   ac_cv_header_stdc=no
15508 fi
15509 rm -rf conftest*
15510
15511 fi
15512
15513 if test $ac_cv_header_stdc = yes; then
15514   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15515   if test "$cross_compiling" = yes; then
15516   :
15517 else
15518   cat >conftest.$ac_ext <<_ACEOF
15519 #line 15519 "configure"
15520 #include "confdefs.h"
15521 #include <ctype.h>
15522 #if ((' ' & 0x0FF) == 0x020)
15523 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15524 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15525 #else
15526 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15527                      || ('j' <= (c) && (c) <= 'r') \
15528                      || ('s' <= (c) && (c) <= 'z'))
15529 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15530 #endif
15531
15532 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15533 int
15534 main (void)
15535 {
15536   int i;
15537   for (i = 0; i < 256; i++)
15538     if (XOR (islower (i), ISLOWER (i))
15539         || toupper (i) != TOUPPER (i))
15540       $ac_main_return(2);
15541   $ac_main_return (0);
15542 }
15543 _ACEOF
15544 rm -f conftest$ac_exeext
15545 if { (eval echo "$as_me:15545: \"$ac_link\"") >&5
15546   (eval $ac_link) 2>&5
15547   ac_status=$?
15548   echo "$as_me:15548: \$? = $ac_status" >&5
15549   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15550   { (eval echo "$as_me:15550: \"$ac_try\"") >&5
15551   (eval $ac_try) 2>&5
15552   ac_status=$?
15553   echo "$as_me:15553: \$? = $ac_status" >&5
15554   (exit $ac_status); }; }; then
15555   :
15556 else
15557   echo "$as_me: program exited with status $ac_status" >&5
15558 echo "$as_me: failed program was:" >&5
15559 cat conftest.$ac_ext >&5
15560 ac_cv_header_stdc=no
15561 fi
15562 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15563 fi
15564 fi
15565 fi
15566 echo "$as_me:15566: result: $ac_cv_header_stdc" >&5
15567 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15568 if test $ac_cv_header_stdc = yes; then
15569
15570 cat >>confdefs.h <<\EOF
15571 #define STDC_HEADERS 1
15572 EOF
15573
15574 fi
15575
15576 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15577
15578 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15579                   inttypes.h stdint.h unistd.h
15580 do
15581 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15582 echo "$as_me:15582: checking for $ac_header" >&5
15583 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15584 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15585   echo $ECHO_N "(cached) $ECHO_C" >&6
15586 else
15587   cat >conftest.$ac_ext <<_ACEOF
15588 #line 15588 "configure"
15589 #include "confdefs.h"
15590 $ac_includes_default
15591 #include <$ac_header>
15592 _ACEOF
15593 rm -f conftest.$ac_objext
15594 if { (eval echo "$as_me:15594: \"$ac_compile\"") >&5
15595   (eval $ac_compile) 2>&5
15596   ac_status=$?
15597   echo "$as_me:15597: \$? = $ac_status" >&5
15598   (exit $ac_status); } &&
15599          { ac_try='test -s conftest.$ac_objext'
15600   { (eval echo "$as_me:15600: \"$ac_try\"") >&5
15601   (eval $ac_try) 2>&5
15602   ac_status=$?
15603   echo "$as_me:15603: \$? = $ac_status" >&5
15604   (exit $ac_status); }; }; then
15605   eval "$as_ac_Header=yes"
15606 else
15607   echo "$as_me: failed program was:" >&5
15608 cat conftest.$ac_ext >&5
15609 eval "$as_ac_Header=no"
15610 fi
15611 rm -f conftest.$ac_objext conftest.$ac_ext
15612 fi
15613 echo "$as_me:15613: result: `eval echo '${'$as_ac_Header'}'`" >&5
15614 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15615 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15616   cat >>confdefs.h <<EOF
15617 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15618 EOF
15619
15620 fi
15621 done
15622
15623 echo "$as_me:15623: checking for signed char" >&5
15624 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15625 if test "${ac_cv_type_signed_char+set}" = set; then
15626   echo $ECHO_N "(cached) $ECHO_C" >&6
15627 else
15628   cat >conftest.$ac_ext <<_ACEOF
15629 #line 15629 "configure"
15630 #include "confdefs.h"
15631 $ac_includes_default
15632 int
15633 main (void)
15634 {
15635 if ((signed char *) 0)
15636   return 0;
15637 if (sizeof (signed char))
15638   return 0;
15639   ;
15640   return 0;
15641 }
15642 _ACEOF
15643 rm -f conftest.$ac_objext
15644 if { (eval echo "$as_me:15644: \"$ac_compile\"") >&5
15645   (eval $ac_compile) 2>&5
15646   ac_status=$?
15647   echo "$as_me:15647: \$? = $ac_status" >&5
15648   (exit $ac_status); } &&
15649          { ac_try='test -s conftest.$ac_objext'
15650   { (eval echo "$as_me:15650: \"$ac_try\"") >&5
15651   (eval $ac_try) 2>&5
15652   ac_status=$?
15653   echo "$as_me:15653: \$? = $ac_status" >&5
15654   (exit $ac_status); }; }; then
15655   ac_cv_type_signed_char=yes
15656 else
15657   echo "$as_me: failed program was:" >&5
15658 cat conftest.$ac_ext >&5
15659 ac_cv_type_signed_char=no
15660 fi
15661 rm -f conftest.$ac_objext conftest.$ac_ext
15662 fi
15663 echo "$as_me:15663: result: $ac_cv_type_signed_char" >&5
15664 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15665
15666 echo "$as_me:15666: checking size of signed char" >&5
15667 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15668 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15669   echo $ECHO_N "(cached) $ECHO_C" >&6
15670 else
15671   if test "$ac_cv_type_signed_char" = yes; then
15672   if test "$cross_compiling" = yes; then
15673   # Depending upon the size, compute the lo and hi bounds.
15674 cat >conftest.$ac_ext <<_ACEOF
15675 #line 15675 "configure"
15676 #include "confdefs.h"
15677 $ac_includes_default
15678 int
15679 main (void)
15680 {
15681 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15682   ;
15683   return 0;
15684 }
15685 _ACEOF
15686 rm -f conftest.$ac_objext
15687 if { (eval echo "$as_me:15687: \"$ac_compile\"") >&5
15688   (eval $ac_compile) 2>&5
15689   ac_status=$?
15690   echo "$as_me:15690: \$? = $ac_status" >&5
15691   (exit $ac_status); } &&
15692          { ac_try='test -s conftest.$ac_objext'
15693   { (eval echo "$as_me:15693: \"$ac_try\"") >&5
15694   (eval $ac_try) 2>&5
15695   ac_status=$?
15696   echo "$as_me:15696: \$? = $ac_status" >&5
15697   (exit $ac_status); }; }; then
15698   ac_lo=0 ac_mid=0
15699   while :; do
15700     cat >conftest.$ac_ext <<_ACEOF
15701 #line 15701 "configure"
15702 #include "confdefs.h"
15703 $ac_includes_default
15704 int
15705 main (void)
15706 {
15707 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15708   ;
15709   return 0;
15710 }
15711 _ACEOF
15712 rm -f conftest.$ac_objext
15713 if { (eval echo "$as_me:15713: \"$ac_compile\"") >&5
15714   (eval $ac_compile) 2>&5
15715   ac_status=$?
15716   echo "$as_me:15716: \$? = $ac_status" >&5
15717   (exit $ac_status); } &&
15718          { ac_try='test -s conftest.$ac_objext'
15719   { (eval echo "$as_me:15719: \"$ac_try\"") >&5
15720   (eval $ac_try) 2>&5
15721   ac_status=$?
15722   echo "$as_me:15722: \$? = $ac_status" >&5
15723   (exit $ac_status); }; }; then
15724   ac_hi=$ac_mid; break
15725 else
15726   echo "$as_me: failed program was:" >&5
15727 cat conftest.$ac_ext >&5
15728 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
15729 fi
15730 rm -f conftest.$ac_objext conftest.$ac_ext
15731   done
15732 else
15733   echo "$as_me: failed program was:" >&5
15734 cat conftest.$ac_ext >&5
15735 ac_hi=-1 ac_mid=-1
15736   while :; do
15737     cat >conftest.$ac_ext <<_ACEOF
15738 #line 15738 "configure"
15739 #include "confdefs.h"
15740 $ac_includes_default
15741 int
15742 main (void)
15743 {
15744 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
15745   ;
15746   return 0;
15747 }
15748 _ACEOF
15749 rm -f conftest.$ac_objext
15750 if { (eval echo "$as_me:15750: \"$ac_compile\"") >&5
15751   (eval $ac_compile) 2>&5
15752   ac_status=$?
15753   echo "$as_me:15753: \$? = $ac_status" >&5
15754   (exit $ac_status); } &&
15755          { ac_try='test -s conftest.$ac_objext'
15756   { (eval echo "$as_me:15756: \"$ac_try\"") >&5
15757   (eval $ac_try) 2>&5
15758   ac_status=$?
15759   echo "$as_me:15759: \$? = $ac_status" >&5
15760   (exit $ac_status); }; }; then
15761   ac_lo=$ac_mid; break
15762 else
15763   echo "$as_me: failed program was:" >&5
15764 cat conftest.$ac_ext >&5
15765 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
15766 fi
15767 rm -f conftest.$ac_objext conftest.$ac_ext
15768   done
15769 fi
15770 rm -f conftest.$ac_objext conftest.$ac_ext
15771 # Binary search between lo and hi bounds.
15772 while test "x$ac_lo" != "x$ac_hi"; do
15773   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
15774   cat >conftest.$ac_ext <<_ACEOF
15775 #line 15775 "configure"
15776 #include "confdefs.h"
15777 $ac_includes_default
15778 int
15779 main (void)
15780 {
15781 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15782   ;
15783   return 0;
15784 }
15785 _ACEOF
15786 rm -f conftest.$ac_objext
15787 if { (eval echo "$as_me:15787: \"$ac_compile\"") >&5
15788   (eval $ac_compile) 2>&5
15789   ac_status=$?
15790   echo "$as_me:15790: \$? = $ac_status" >&5
15791   (exit $ac_status); } &&
15792          { ac_try='test -s conftest.$ac_objext'
15793   { (eval echo "$as_me:15793: \"$ac_try\"") >&5
15794   (eval $ac_try) 2>&5
15795   ac_status=$?
15796   echo "$as_me:15796: \$? = $ac_status" >&5
15797   (exit $ac_status); }; }; then
15798   ac_hi=$ac_mid
15799 else
15800   echo "$as_me: failed program was:" >&5
15801 cat conftest.$ac_ext >&5
15802 ac_lo=`expr $ac_mid + 1`
15803 fi
15804 rm -f conftest.$ac_objext conftest.$ac_ext
15805 done
15806 ac_cv_sizeof_signed_char=$ac_lo
15807 else
15808   if test "$cross_compiling" = yes; then
15809   { { echo "$as_me:15809: error: cannot run test program while cross compiling" >&5
15810 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15811    { (exit 1); exit 1; }; }
15812 else
15813   cat >conftest.$ac_ext <<_ACEOF
15814 #line 15814 "configure"
15815 #include "confdefs.h"
15816 $ac_includes_default
15817 int
15818 main (void)
15819 {
15820 FILE *f = fopen ("conftest.val", "w");
15821 if (!f)
15822   $ac_main_return (1);
15823 fprintf (f, "%d", (sizeof (signed char)));
15824 fclose (f);
15825   ;
15826   return 0;
15827 }
15828 _ACEOF
15829 rm -f conftest$ac_exeext
15830 if { (eval echo "$as_me:15830: \"$ac_link\"") >&5
15831   (eval $ac_link) 2>&5
15832   ac_status=$?
15833   echo "$as_me:15833: \$? = $ac_status" >&5
15834   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15835   { (eval echo "$as_me:15835: \"$ac_try\"") >&5
15836   (eval $ac_try) 2>&5
15837   ac_status=$?
15838   echo "$as_me:15838: \$? = $ac_status" >&5
15839   (exit $ac_status); }; }; then
15840   ac_cv_sizeof_signed_char=`cat conftest.val`
15841 else
15842   echo "$as_me: program exited with status $ac_status" >&5
15843 echo "$as_me: failed program was:" >&5
15844 cat conftest.$ac_ext >&5
15845 fi
15846 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15847 fi
15848 fi
15849 rm -f conftest.val
15850 else
15851   ac_cv_sizeof_signed_char=0
15852 fi
15853 fi
15854 echo "$as_me:15854: result: $ac_cv_sizeof_signed_char" >&5
15855 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
15856 cat >>confdefs.h <<EOF
15857 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
15858 EOF
15859
15860 echo "$as_me:15860: checking for ANSI C header files" >&5
15861 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15862 if test "${ac_cv_header_stdc+set}" = set; then
15863   echo $ECHO_N "(cached) $ECHO_C" >&6
15864 else
15865   cat >conftest.$ac_ext <<_ACEOF
15866 #line 15866 "configure"
15867 #include "confdefs.h"
15868 #include <stdlib.h>
15869 #include <stdarg.h>
15870 #include <string.h>
15871 #include <float.h>
15872
15873 _ACEOF
15874 if { (eval echo "$as_me:15874: \"$ac_cpp conftest.$ac_ext\"") >&5
15875   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15876   ac_status=$?
15877   egrep -v '^ *\+' conftest.er1 >conftest.err
15878   rm -f conftest.er1
15879   cat conftest.err >&5
15880   echo "$as_me:15880: \$? = $ac_status" >&5
15881   (exit $ac_status); } >/dev/null; then
15882   if test -s conftest.err; then
15883     ac_cpp_err=$ac_c_preproc_warn_flag
15884   else
15885     ac_cpp_err=
15886   fi
15887 else
15888   ac_cpp_err=yes
15889 fi
15890 if test -z "$ac_cpp_err"; then
15891   ac_cv_header_stdc=yes
15892 else
15893   echo "$as_me: failed program was:" >&5
15894   cat conftest.$ac_ext >&5
15895   ac_cv_header_stdc=no
15896 fi
15897 rm -f conftest.err conftest.$ac_ext
15898
15899 if test $ac_cv_header_stdc = yes; then
15900   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15901   cat >conftest.$ac_ext <<_ACEOF
15902 #line 15902 "configure"
15903 #include "confdefs.h"
15904 #include <string.h>
15905
15906 _ACEOF
15907 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15908   egrep "memchr" >/dev/null 2>&1; then
15909   :
15910 else
15911   ac_cv_header_stdc=no
15912 fi
15913 rm -rf conftest*
15914
15915 fi
15916
15917 if test $ac_cv_header_stdc = yes; then
15918   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15919   cat >conftest.$ac_ext <<_ACEOF
15920 #line 15920 "configure"
15921 #include "confdefs.h"
15922 #include <stdlib.h>
15923
15924 _ACEOF
15925 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15926   egrep "free" >/dev/null 2>&1; then
15927   :
15928 else
15929   ac_cv_header_stdc=no
15930 fi
15931 rm -rf conftest*
15932
15933 fi
15934
15935 if test $ac_cv_header_stdc = yes; then
15936   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15937   if test "$cross_compiling" = yes; then
15938   :
15939 else
15940   cat >conftest.$ac_ext <<_ACEOF
15941 #line 15941 "configure"
15942 #include "confdefs.h"
15943 #include <ctype.h>
15944 #if ((' ' & 0x0FF) == 0x020)
15945 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15946 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15947 #else
15948 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15949                      || ('j' <= (c) && (c) <= 'r') \
15950                      || ('s' <= (c) && (c) <= 'z'))
15951 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15952 #endif
15953
15954 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15955 int
15956 main (void)
15957 {
15958   int i;
15959   for (i = 0; i < 256; i++)
15960     if (XOR (islower (i), ISLOWER (i))
15961         || toupper (i) != TOUPPER (i))
15962       $ac_main_return(2);
15963   $ac_main_return (0);
15964 }
15965 _ACEOF
15966 rm -f conftest$ac_exeext
15967 if { (eval echo "$as_me:15967: \"$ac_link\"") >&5
15968   (eval $ac_link) 2>&5
15969   ac_status=$?
15970   echo "$as_me:15970: \$? = $ac_status" >&5
15971   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15972   { (eval echo "$as_me:15972: \"$ac_try\"") >&5
15973   (eval $ac_try) 2>&5
15974   ac_status=$?
15975   echo "$as_me:15975: \$? = $ac_status" >&5
15976   (exit $ac_status); }; }; then
15977   :
15978 else
15979   echo "$as_me: program exited with status $ac_status" >&5
15980 echo "$as_me: failed program was:" >&5
15981 cat conftest.$ac_ext >&5
15982 ac_cv_header_stdc=no
15983 fi
15984 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15985 fi
15986 fi
15987 fi
15988 echo "$as_me:15988: result: $ac_cv_header_stdc" >&5
15989 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15990 if test $ac_cv_header_stdc = yes; then
15991
15992 cat >>confdefs.h <<\EOF
15993 #define STDC_HEADERS 1
15994 EOF
15995
15996 fi
15997
15998 ac_header_dirent=no
15999 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16000   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16001 echo "$as_me:16001: checking for $ac_hdr that defines DIR" >&5
16002 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16003 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16004   echo $ECHO_N "(cached) $ECHO_C" >&6
16005 else
16006   cat >conftest.$ac_ext <<_ACEOF
16007 #line 16007 "configure"
16008 #include "confdefs.h"
16009 #include <sys/types.h>
16010 #include <$ac_hdr>
16011
16012 int
16013 main (void)
16014 {
16015 if ((DIR *) 0)
16016 return 0;
16017   ;
16018   return 0;
16019 }
16020 _ACEOF
16021 rm -f conftest.$ac_objext
16022 if { (eval echo "$as_me:16022: \"$ac_compile\"") >&5
16023   (eval $ac_compile) 2>&5
16024   ac_status=$?
16025   echo "$as_me:16025: \$? = $ac_status" >&5
16026   (exit $ac_status); } &&
16027          { ac_try='test -s conftest.$ac_objext'
16028   { (eval echo "$as_me:16028: \"$ac_try\"") >&5
16029   (eval $ac_try) 2>&5
16030   ac_status=$?
16031   echo "$as_me:16031: \$? = $ac_status" >&5
16032   (exit $ac_status); }; }; then
16033   eval "$as_ac_Header=yes"
16034 else
16035   echo "$as_me: failed program was:" >&5
16036 cat conftest.$ac_ext >&5
16037 eval "$as_ac_Header=no"
16038 fi
16039 rm -f conftest.$ac_objext conftest.$ac_ext
16040 fi
16041 echo "$as_me:16041: result: `eval echo '${'$as_ac_Header'}'`" >&5
16042 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16043 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16044   cat >>confdefs.h <<EOF
16045 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16046 EOF
16047
16048 ac_header_dirent=$ac_hdr; break
16049 fi
16050
16051 done
16052 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16053 if test $ac_header_dirent = dirent.h; then
16054   echo "$as_me:16054: checking for opendir in -ldir" >&5
16055 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16056 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16057   echo $ECHO_N "(cached) $ECHO_C" >&6
16058 else
16059   ac_check_lib_save_LIBS=$LIBS
16060 LIBS="-ldir  $LIBS"
16061 cat >conftest.$ac_ext <<_ACEOF
16062 #line 16062 "configure"
16063 #include "confdefs.h"
16064
16065 /* Override any gcc2 internal prototype to avoid an error.  */
16066 #ifdef __cplusplus
16067 extern "C"
16068 #endif
16069 /* We use char because int might match the return type of a gcc2
16070    builtin and then its argument prototype would still apply.  */
16071 char opendir ();
16072 int
16073 main (void)
16074 {
16075 opendir ();
16076   ;
16077   return 0;
16078 }
16079 _ACEOF
16080 rm -f conftest.$ac_objext conftest$ac_exeext
16081 if { (eval echo "$as_me:16081: \"$ac_link\"") >&5
16082   (eval $ac_link) 2>&5
16083   ac_status=$?
16084   echo "$as_me:16084: \$? = $ac_status" >&5
16085   (exit $ac_status); } &&
16086          { ac_try='test -s conftest$ac_exeext'
16087   { (eval echo "$as_me:16087: \"$ac_try\"") >&5
16088   (eval $ac_try) 2>&5
16089   ac_status=$?
16090   echo "$as_me:16090: \$? = $ac_status" >&5
16091   (exit $ac_status); }; }; then
16092   ac_cv_lib_dir_opendir=yes
16093 else
16094   echo "$as_me: failed program was:" >&5
16095 cat conftest.$ac_ext >&5
16096 ac_cv_lib_dir_opendir=no
16097 fi
16098 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16099 LIBS=$ac_check_lib_save_LIBS
16100 fi
16101 echo "$as_me:16101: result: $ac_cv_lib_dir_opendir" >&5
16102 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16103 if test $ac_cv_lib_dir_opendir = yes; then
16104   LIBS="$LIBS -ldir"
16105 fi
16106
16107 else
16108   echo "$as_me:16108: checking for opendir in -lx" >&5
16109 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16110 if test "${ac_cv_lib_x_opendir+set}" = set; then
16111   echo $ECHO_N "(cached) $ECHO_C" >&6
16112 else
16113   ac_check_lib_save_LIBS=$LIBS
16114 LIBS="-lx  $LIBS"
16115 cat >conftest.$ac_ext <<_ACEOF
16116 #line 16116 "configure"
16117 #include "confdefs.h"
16118
16119 /* Override any gcc2 internal prototype to avoid an error.  */
16120 #ifdef __cplusplus
16121 extern "C"
16122 #endif
16123 /* We use char because int might match the return type of a gcc2
16124    builtin and then its argument prototype would still apply.  */
16125 char opendir ();
16126 int
16127 main (void)
16128 {
16129 opendir ();
16130   ;
16131   return 0;
16132 }
16133 _ACEOF
16134 rm -f conftest.$ac_objext conftest$ac_exeext
16135 if { (eval echo "$as_me:16135: \"$ac_link\"") >&5
16136   (eval $ac_link) 2>&5
16137   ac_status=$?
16138   echo "$as_me:16138: \$? = $ac_status" >&5
16139   (exit $ac_status); } &&
16140          { ac_try='test -s conftest$ac_exeext'
16141   { (eval echo "$as_me:16141: \"$ac_try\"") >&5
16142   (eval $ac_try) 2>&5
16143   ac_status=$?
16144   echo "$as_me:16144: \$? = $ac_status" >&5
16145   (exit $ac_status); }; }; then
16146   ac_cv_lib_x_opendir=yes
16147 else
16148   echo "$as_me: failed program was:" >&5
16149 cat conftest.$ac_ext >&5
16150 ac_cv_lib_x_opendir=no
16151 fi
16152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16153 LIBS=$ac_check_lib_save_LIBS
16154 fi
16155 echo "$as_me:16155: result: $ac_cv_lib_x_opendir" >&5
16156 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16157 if test $ac_cv_lib_x_opendir = yes; then
16158   LIBS="$LIBS -lx"
16159 fi
16160
16161 fi
16162
16163 echo "$as_me:16163: checking whether time.h and sys/time.h may both be included" >&5
16164 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16165 if test "${ac_cv_header_time+set}" = set; then
16166   echo $ECHO_N "(cached) $ECHO_C" >&6
16167 else
16168   cat >conftest.$ac_ext <<_ACEOF
16169 #line 16169 "configure"
16170 #include "confdefs.h"
16171 #include <sys/types.h>
16172 #include <sys/time.h>
16173 #include <time.h>
16174
16175 int
16176 main (void)
16177 {
16178 if ((struct tm *) 0)
16179 return 0;
16180   ;
16181   return 0;
16182 }
16183 _ACEOF
16184 rm -f conftest.$ac_objext
16185 if { (eval echo "$as_me:16185: \"$ac_compile\"") >&5
16186   (eval $ac_compile) 2>&5
16187   ac_status=$?
16188   echo "$as_me:16188: \$? = $ac_status" >&5
16189   (exit $ac_status); } &&
16190          { ac_try='test -s conftest.$ac_objext'
16191   { (eval echo "$as_me:16191: \"$ac_try\"") >&5
16192   (eval $ac_try) 2>&5
16193   ac_status=$?
16194   echo "$as_me:16194: \$? = $ac_status" >&5
16195   (exit $ac_status); }; }; then
16196   ac_cv_header_time=yes
16197 else
16198   echo "$as_me: failed program was:" >&5
16199 cat conftest.$ac_ext >&5
16200 ac_cv_header_time=no
16201 fi
16202 rm -f conftest.$ac_objext conftest.$ac_ext
16203 fi
16204 echo "$as_me:16204: result: $ac_cv_header_time" >&5
16205 echo "${ECHO_T}$ac_cv_header_time" >&6
16206 if test $ac_cv_header_time = yes; then
16207
16208 cat >>confdefs.h <<\EOF
16209 #define TIME_WITH_SYS_TIME 1
16210 EOF
16211
16212 fi
16213
16214 ###     checks for compiler characteristics
16215 ac_ext=c
16216 ac_cpp='$CPP $CPPFLAGS'
16217 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16218 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16219 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16220 ac_main_return=return
16221
16222 echo "$as_me:16222: checking for an ANSI C-conforming const" >&5
16223 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16224 if test "${ac_cv_c_const+set}" = set; then
16225   echo $ECHO_N "(cached) $ECHO_C" >&6
16226 else
16227   cat >conftest.$ac_ext <<_ACEOF
16228 #line 16228 "configure"
16229 #include "confdefs.h"
16230
16231 int
16232 main (void)
16233 {
16234 /* FIXME: Include the comments suggested by Paul. */
16235 #ifndef __cplusplus
16236   /* Ultrix mips cc rejects this.  */
16237   typedef int charset[2];
16238   const charset x;
16239   /* SunOS 4.1.1 cc rejects this.  */
16240   char const *const *ccp;
16241   char **p;
16242   /* NEC SVR4.0.2 mips cc rejects this.  */
16243   struct point {int x, y;};
16244   static struct point const zero = {0,0};
16245   /* AIX XL C 1.02.0.0 rejects this.
16246      It does not let you subtract one const X* pointer from another in
16247      an arm of an if-expression whose if-part is not a constant
16248      expression */
16249   const char *g = "string";
16250   ccp = &g + (g ? g-g : 0);
16251   /* HPUX 7.0 cc rejects these. */
16252   ++ccp;
16253   p = (char**) ccp;
16254   ccp = (char const *const *) p;
16255   { /* SCO 3.2v4 cc rejects this.  */
16256     char *t;
16257     char const *s = 0 ? (char *) 0 : (char const *) 0;
16258
16259     *t++ = 0;
16260   }
16261   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16262     int x[] = {25, 17};
16263     const int *foo = &x[0];
16264     ++foo;
16265   }
16266   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16267     typedef const int *iptr;
16268     iptr p = 0;
16269     ++p;
16270   }
16271   { /* AIX XL C 1.02.0.0 rejects this saying
16272        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16273     struct s { int j; const int *ap[3]; };
16274     struct s *b; b->j = 5;
16275   }
16276   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16277     const int foo = 10;
16278   }
16279 #endif
16280
16281   ;
16282   return 0;
16283 }
16284 _ACEOF
16285 rm -f conftest.$ac_objext
16286 if { (eval echo "$as_me:16286: \"$ac_compile\"") >&5
16287   (eval $ac_compile) 2>&5
16288   ac_status=$?
16289   echo "$as_me:16289: \$? = $ac_status" >&5
16290   (exit $ac_status); } &&
16291          { ac_try='test -s conftest.$ac_objext'
16292   { (eval echo "$as_me:16292: \"$ac_try\"") >&5
16293   (eval $ac_try) 2>&5
16294   ac_status=$?
16295   echo "$as_me:16295: \$? = $ac_status" >&5
16296   (exit $ac_status); }; }; then
16297   ac_cv_c_const=yes
16298 else
16299   echo "$as_me: failed program was:" >&5
16300 cat conftest.$ac_ext >&5
16301 ac_cv_c_const=no
16302 fi
16303 rm -f conftest.$ac_objext conftest.$ac_ext
16304 fi
16305 echo "$as_me:16305: result: $ac_cv_c_const" >&5
16306 echo "${ECHO_T}$ac_cv_c_const" >&6
16307 if test $ac_cv_c_const = no; then
16308
16309 cat >>confdefs.h <<\EOF
16310 #define const
16311 EOF
16312
16313 fi
16314
16315 ###     Checks for external-data
16316
16317 echo "$as_me:16317: checking if data-only library module links" >&5
16318 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16319 if test "${cf_cv_link_dataonly+set}" = set; then
16320   echo $ECHO_N "(cached) $ECHO_C" >&6
16321 else
16322
16323         rm -f conftest.a
16324         cat >conftest.$ac_ext <<EOF
16325 #line 16325 "configure"
16326 int     testdata[3] = { 123, 456, 789 };
16327 EOF
16328         if { (eval echo "$as_me:16328: \"$ac_compile\"") >&5
16329   (eval $ac_compile) 2>&5
16330   ac_status=$?
16331   echo "$as_me:16331: \$? = $ac_status" >&5
16332   (exit $ac_status); } ; then
16333                 mv conftest.o data.o && \
16334                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16335         fi
16336         rm -f conftest.$ac_ext data.o
16337         cat >conftest.$ac_ext <<EOF
16338 #line 16338 "configure"
16339 int     testfunc(void)
16340 {
16341 #if defined(NeXT)
16342         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16343 #else
16344         extern int testdata[3];
16345         return testdata[0] == 123
16346            &&  testdata[1] == 456
16347            &&  testdata[2] == 789;
16348 #endif
16349 }
16350 EOF
16351         if { (eval echo "$as_me:16351: \"$ac_compile\"") >&5
16352   (eval $ac_compile) 2>&5
16353   ac_status=$?
16354   echo "$as_me:16354: \$? = $ac_status" >&5
16355   (exit $ac_status); }; then
16356                 mv conftest.o func.o && \
16357                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16358         fi
16359         rm -f conftest.$ac_ext func.o
16360         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16361         cf_saveLIBS="$LIBS"
16362         LIBS="conftest.a $LIBS"
16363         if test "$cross_compiling" = yes; then
16364   cf_cv_link_dataonly=unknown
16365 else
16366   cat >conftest.$ac_ext <<_ACEOF
16367 #line 16367 "configure"
16368 #include "confdefs.h"
16369
16370         int main(void)
16371         {
16372                 extern int testfunc();
16373                 ${cf_cv_main_return:-return} (!testfunc());
16374         }
16375
16376 _ACEOF
16377 rm -f conftest$ac_exeext
16378 if { (eval echo "$as_me:16378: \"$ac_link\"") >&5
16379   (eval $ac_link) 2>&5
16380   ac_status=$?
16381   echo "$as_me:16381: \$? = $ac_status" >&5
16382   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16383   { (eval echo "$as_me:16383: \"$ac_try\"") >&5
16384   (eval $ac_try) 2>&5
16385   ac_status=$?
16386   echo "$as_me:16386: \$? = $ac_status" >&5
16387   (exit $ac_status); }; }; then
16388   cf_cv_link_dataonly=yes
16389 else
16390   echo "$as_me: program exited with status $ac_status" >&5
16391 echo "$as_me: failed program was:" >&5
16392 cat conftest.$ac_ext >&5
16393 cf_cv_link_dataonly=no
16394 fi
16395 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16396 fi
16397         LIBS="$cf_saveLIBS"
16398
16399 fi
16400
16401 echo "$as_me:16401: result: $cf_cv_link_dataonly" >&5
16402 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16403
16404 if test "$cf_cv_link_dataonly" = no ; then
16405
16406 cat >>confdefs.h <<\EOF
16407 #define BROKEN_LINKER 1
16408 EOF
16409
16410         BROKEN_LINKER=1
16411 fi
16412
16413 ###     Checks for library functions.
16414
16415 for ac_header in \
16416 unistd.h \
16417
16418 do
16419 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16420 echo "$as_me:16420: checking for $ac_header" >&5
16421 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16422 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16423   echo $ECHO_N "(cached) $ECHO_C" >&6
16424 else
16425   cat >conftest.$ac_ext <<_ACEOF
16426 #line 16426 "configure"
16427 #include "confdefs.h"
16428 #include <$ac_header>
16429 _ACEOF
16430 if { (eval echo "$as_me:16430: \"$ac_cpp conftest.$ac_ext\"") >&5
16431   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16432   ac_status=$?
16433   egrep -v '^ *\+' conftest.er1 >conftest.err
16434   rm -f conftest.er1
16435   cat conftest.err >&5
16436   echo "$as_me:16436: \$? = $ac_status" >&5
16437   (exit $ac_status); } >/dev/null; then
16438   if test -s conftest.err; then
16439     ac_cpp_err=$ac_c_preproc_warn_flag
16440   else
16441     ac_cpp_err=
16442   fi
16443 else
16444   ac_cpp_err=yes
16445 fi
16446 if test -z "$ac_cpp_err"; then
16447   eval "$as_ac_Header=yes"
16448 else
16449   echo "$as_me: failed program was:" >&5
16450   cat conftest.$ac_ext >&5
16451   eval "$as_ac_Header=no"
16452 fi
16453 rm -f conftest.err conftest.$ac_ext
16454 fi
16455 echo "$as_me:16455: result: `eval echo '${'$as_ac_Header'}'`" >&5
16456 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16457 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16458   cat >>confdefs.h <<EOF
16459 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16460 EOF
16461
16462 fi
16463 done
16464
16465 echo "$as_me:16465: checking for working mkstemp" >&5
16466 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16467 if test "${cf_cv_func_mkstemp+set}" = set; then
16468   echo $ECHO_N "(cached) $ECHO_C" >&6
16469 else
16470
16471 rm -rf conftest*
16472 if test "$cross_compiling" = yes; then
16473   cf_cv_func_mkstemp=maybe
16474 else
16475   cat >conftest.$ac_ext <<_ACEOF
16476 #line 16476 "configure"
16477 #include "confdefs.h"
16478
16479 #include <sys/types.h>
16480 #ifdef HAVE_UNISTD_H
16481 #include <unistd.h>
16482 #endif
16483 #include <stdlib.h>
16484 #include <stdio.h>
16485 #include <string.h>
16486 #include <sys/stat.h>
16487 int main(void)
16488 {
16489         char *tmpl = "conftestXXXXXX";
16490         char name[2][80];
16491         int n;
16492         int result = 0;
16493         int fd;
16494         struct stat sb;
16495
16496         umask(077);
16497         for (n = 0; n < 2; ++n) {
16498                 strcpy(name[n], tmpl);
16499                 if ((fd = mkstemp(name[n])) >= 0) {
16500                         if (!strcmp(name[n], tmpl)
16501                          || stat(name[n], &sb) != 0
16502                          || (sb.st_mode & S_IFMT) != S_IFREG
16503                          || (sb.st_mode & 077) != 0) {
16504                                 result = 1;
16505                         }
16506                         close(fd);
16507                 }
16508         }
16509         if (result == 0
16510          && !strcmp(name[0], name[1]))
16511                 result = 1;
16512         ${cf_cv_main_return:-return}(result);
16513 }
16514
16515 _ACEOF
16516 rm -f conftest$ac_exeext
16517 if { (eval echo "$as_me:16517: \"$ac_link\"") >&5
16518   (eval $ac_link) 2>&5
16519   ac_status=$?
16520   echo "$as_me:16520: \$? = $ac_status" >&5
16521   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16522   { (eval echo "$as_me:16522: \"$ac_try\"") >&5
16523   (eval $ac_try) 2>&5
16524   ac_status=$?
16525   echo "$as_me:16525: \$? = $ac_status" >&5
16526   (exit $ac_status); }; }; then
16527   cf_cv_func_mkstemp=yes
16528
16529 else
16530   echo "$as_me: program exited with status $ac_status" >&5
16531 echo "$as_me: failed program was:" >&5
16532 cat conftest.$ac_ext >&5
16533 cf_cv_func_mkstemp=no
16534
16535 fi
16536 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16537 fi
16538
16539 fi
16540 echo "$as_me:16540: result: $cf_cv_func_mkstemp" >&5
16541 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16542 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16543         echo "$as_me:16543: checking for mkstemp" >&5
16544 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16545 if test "${ac_cv_func_mkstemp+set}" = set; then
16546   echo $ECHO_N "(cached) $ECHO_C" >&6
16547 else
16548   cat >conftest.$ac_ext <<_ACEOF
16549 #line 16549 "configure"
16550 #include "confdefs.h"
16551 #define mkstemp autoconf_temporary
16552 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16553 #undef mkstemp
16554
16555 #ifdef __cplusplus
16556 extern "C"
16557 #endif
16558
16559 /* We use char because int might match the return type of a gcc2
16560    builtin and then its argument prototype would still apply.  */
16561 char mkstemp (void);
16562
16563 int
16564 main (void)
16565 {
16566
16567 /* The GNU C library defines stubs for functions which it implements
16568     to always fail with ENOSYS.  Some functions are actually named
16569     something starting with __ and the normal name is an alias.  */
16570 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16571 #error found stub for mkstemp
16572 #endif
16573
16574         return mkstemp ();
16575   ;
16576   return 0;
16577 }
16578 _ACEOF
16579 rm -f conftest.$ac_objext conftest$ac_exeext
16580 if { (eval echo "$as_me:16580: \"$ac_link\"") >&5
16581   (eval $ac_link) 2>&5
16582   ac_status=$?
16583   echo "$as_me:16583: \$? = $ac_status" >&5
16584   (exit $ac_status); } &&
16585          { ac_try='test -s conftest$ac_exeext'
16586   { (eval echo "$as_me:16586: \"$ac_try\"") >&5
16587   (eval $ac_try) 2>&5
16588   ac_status=$?
16589   echo "$as_me:16589: \$? = $ac_status" >&5
16590   (exit $ac_status); }; }; then
16591   ac_cv_func_mkstemp=yes
16592 else
16593   echo "$as_me: failed program was:" >&5
16594 cat conftest.$ac_ext >&5
16595 ac_cv_func_mkstemp=no
16596 fi
16597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16598 fi
16599 echo "$as_me:16599: result: $ac_cv_func_mkstemp" >&5
16600 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16601
16602 fi
16603 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16604
16605 cat >>confdefs.h <<\EOF
16606 #define HAVE_MKSTEMP 1
16607 EOF
16608
16609 fi
16610
16611 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16612         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16613         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16614 fi
16615
16616 cf_with_ada=yes
16617 if test "$cf_with_ada" != "no" ; then
16618
16619 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16620 do
16621
16622 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16623
16624         unset ac_cv_path_cf_TEMP_gnat
16625         unset cf_TEMP_gnat
16626         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16627 set dummy $cf_prog_gnat; ac_word=$2
16628 echo "$as_me:16628: checking for $ac_word" >&5
16629 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16630 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16631   echo $ECHO_N "(cached) $ECHO_C" >&6
16632 else
16633   case $cf_TEMP_gnat in
16634   [\\/]* | ?:[\\/]*)
16635   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16636   ;;
16637   *)
16638   ac_save_IFS=$IFS; IFS=$ac_path_separator
16639 ac_dummy="$PATH"
16640 for ac_dir in $ac_dummy; do
16641   IFS=$ac_save_IFS
16642   test -z "$ac_dir" && ac_dir=.
16643   if $as_executable_p "$ac_dir/$ac_word"; then
16644    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16645    echo "$as_me:16645: found $ac_dir/$ac_word" >&5
16646    break
16647 fi
16648 done
16649
16650   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16651   ;;
16652 esac
16653 fi
16654 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16655
16656 if test -n "$cf_TEMP_gnat"; then
16657   echo "$as_me:16657: result: $cf_TEMP_gnat" >&5
16658 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16659 else
16660   echo "$as_me:16660: result: no" >&5
16661 echo "${ECHO_T}no" >&6
16662 fi
16663
16664         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
16665
16666         if test "x$cf_TEMP_gnat" != xno; then
16667                 unset cf_cv_gnat_version
16668                 unset cf_TEMP_gnat
16669
16670 echo "$as_me:16670: checking for $cf_prog_gnat version" >&5
16671 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16672 if test "${cf_cv_gnat_version+set}" = set; then
16673   echo $ECHO_N "(cached) $ECHO_C" >&6
16674 else
16675
16676 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16677         grep '[0-9].[0-9][0-9]*' |\
16678         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16679
16680 fi
16681 echo "$as_me:16681: result: $cf_cv_gnat_version" >&5
16682 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16683 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16684 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16685
16686         fi
16687         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
16688
16689         unset cf_TEMP_gnat
16690         unset cf_cv_gnat_version
16691         unset ac_cv_path_cf_TEMP_gnat
16692 done
16693
16694 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16695         cf_ada_make=
16696         cf_cv_prog_gnat_correct=no
16697 else
16698         cf_ada_make=gnatmake
16699         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16700                 # gprconfig is newer than gnatmake; we can continue...
16701                 cf_ada_config="##"
16702         else
16703                 rm -rf conftest* *~conftest*
16704                 if mkdir conftest.src
16705                 then
16706                         cf_ada_config=""
16707                         cd conftest.src
16708                         for cf_gprconfig in Ada C
16709                         do
16710                                 echo "$as_me:16710: checking for gprconfig name for $cf_gprconfig" >&5
16711 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16712                                 if test $cf_gprconfig = C
16713                                 then
16714                                         for cf_gprconfig_param in \
16715                                                 $cf_gprconfig,,,,GNATGCC \
16716                                                 $cf_gprconfig,,,,GCC \
16717                                                 $cf_gprconfig
16718                                         do
16719                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16720                                                 test -n "$cf_gprconfig_value" && break
16721                                         done
16722                                 else
16723                                         cf_gprconfig_param=$cf_gprconfig
16724                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16725                                 fi
16726                                 if test -n "$cf_gprconfig_value"
16727                                 then
16728                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
16729                                         echo "$as_me:16729: result: $cf_gprconfig_value" >&5
16730 echo "${ECHO_T}$cf_gprconfig_value" >&6
16731                                 else
16732                                         echo "$as_me:16732: result: missing" >&5
16733 echo "${ECHO_T}missing" >&6
16734                                         cf_ada_config="#"
16735                                         break
16736                                 fi
16737                         done
16738                         cd ..
16739                         rm -rf conftest* *~conftest*
16740                 fi
16741         fi
16742         if test "x$cf_ada_config" != "x#"
16743         then
16744
16745 echo "$as_me:16745: checking for gnat version" >&5
16746 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
16747 if test "${cf_cv_gnat_version+set}" = set; then
16748   echo $ECHO_N "(cached) $ECHO_C" >&6
16749 else
16750
16751 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
16752         grep '[0-9].[0-9][0-9]*' |\
16753         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16754
16755 fi
16756 echo "$as_me:16756: result: $cf_cv_gnat_version" >&5
16757 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16758 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16759
16760 case $cf_cv_gnat_version in
16761 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16762         cf_cv_prog_gnat_correct=yes
16763         ;;
16764 (*)
16765         { echo "$as_me:16765: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
16766 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
16767         cf_cv_prog_gnat_correct=no
16768         ;;
16769 esac
16770
16771                 # Extract the first word of "m4", so it can be a program name with args.
16772 set dummy m4; ac_word=$2
16773 echo "$as_me:16773: checking for $ac_word" >&5
16774 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16775 if test "${ac_cv_prog_M4_exists+set}" = set; then
16776   echo $ECHO_N "(cached) $ECHO_C" >&6
16777 else
16778   if test -n "$M4_exists"; then
16779   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
16780 else
16781   ac_save_IFS=$IFS; IFS=$ac_path_separator
16782 ac_dummy="$PATH"
16783 for ac_dir in $ac_dummy; do
16784   IFS=$ac_save_IFS
16785   test -z "$ac_dir" && ac_dir=.
16786   $as_executable_p "$ac_dir/$ac_word" || continue
16787 ac_cv_prog_M4_exists="yes"
16788 echo "$as_me:16788: found $ac_dir/$ac_word" >&5
16789 break
16790 done
16791
16792   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
16793 fi
16794 fi
16795 M4_exists=$ac_cv_prog_M4_exists
16796 if test -n "$M4_exists"; then
16797   echo "$as_me:16797: result: $M4_exists" >&5
16798 echo "${ECHO_T}$M4_exists" >&6
16799 else
16800   echo "$as_me:16800: result: no" >&5
16801 echo "${ECHO_T}no" >&6
16802 fi
16803
16804                 if test "$ac_cv_prog_M4_exists" = no; then
16805                         cf_cv_prog_gnat_correct=no
16806                         { echo "$as_me:16806: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
16807 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
16808                 fi
16809                 if test "$cf_cv_prog_gnat_correct" = yes; then
16810                         echo "$as_me:16810: checking if GNAT works" >&5
16811 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
16812
16813 rm -rf conftest* *~conftest*
16814 cat >>conftest.ads <<CF_EOF
16815 procedure conftest;
16816 CF_EOF
16817 cat >>conftest.adb <<CF_EOF
16818 with Text_IO;
16819 with GNAT.OS_Lib;
16820 procedure conftest is
16821 begin
16822    Text_IO.Put ("Hello World");
16823    Text_IO.New_Line;
16824    GNAT.OS_Lib.OS_Exit (0);
16825 end conftest;
16826 CF_EOF
16827 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16828    if ( ./conftest 1>&5 2>&1 ) ; then
16829       cf_cv_prog_gnat_correct=yes
16830    else
16831       cf_cv_prog_gnat_correct=no
16832    fi
16833 else
16834    cf_cv_prog_gnat_correct=no
16835 fi
16836 rm -rf conftest* *~conftest*
16837
16838                         echo "$as_me:16838: result: $cf_cv_prog_gnat_correct" >&5
16839 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
16840                 fi
16841         else
16842                 cf_cv_prog_gnat_correct=no
16843         fi
16844 fi
16845
16846         if test "$cf_cv_prog_gnat_correct" = yes; then
16847
16848         echo "$as_me:16848: checking optimization options for ADAFLAGS" >&5
16849 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
16850         case "$CFLAGS" in
16851         (*-g*)
16852
16853         ADAFLAGS="$ADAFLAGS -g"
16854
16855                 ;;
16856         esac
16857         case "$CFLAGS" in
16858         (*-O*)
16859                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
16860
16861         ADAFLAGS="$ADAFLAGS $cf_O_flag"
16862
16863                 ;;
16864         esac
16865         echo "$as_me:16865: result: $ADAFLAGS" >&5
16866 echo "${ECHO_T}$ADAFLAGS" >&6
16867
16868 echo "$as_me:16868: checking if GNATPREP supports -T option" >&5
16869 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
16870 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
16871   echo $ECHO_N "(cached) $ECHO_C" >&6
16872 else
16873
16874 cf_cv_gnatprep_opt_t=no
16875 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
16876
16877 fi
16878 echo "$as_me:16878: result: $cf_cv_gnatprep_opt_t" >&5
16879 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
16880 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
16881
16882 echo "$as_me:16882: checking if GNAT supports generics" >&5
16883 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
16884 case $cf_cv_gnat_version in
16885 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16886         cf_gnat_generics=yes
16887         ;;
16888 (*)
16889         cf_gnat_generics=no
16890         ;;
16891 esac
16892 echo "$as_me:16892: result: $cf_gnat_generics" >&5
16893 echo "${ECHO_T}$cf_gnat_generics" >&6
16894
16895 if test "$cf_gnat_generics" = yes
16896 then
16897         cf_compile_generics=generics
16898         cf_generic_objects="\${GENOBJS}"
16899 else
16900         cf_compile_generics=
16901         cf_generic_objects=
16902 fi
16903
16904 echo "$as_me:16904: checking if GNAT supports SIGINT" >&5
16905 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
16906 if test "${cf_cv_gnat_sigint+set}" = set; then
16907   echo $ECHO_N "(cached) $ECHO_C" >&6
16908 else
16909
16910 rm -rf conftest* *~conftest*
16911 cat >>conftest.ads <<CF_EOF
16912 with Ada.Interrupts.Names;
16913
16914 package ConfTest is
16915
16916    pragma Warnings (Off);  --  the next pragma exists since 3.11p
16917    pragma Unreserve_All_Interrupts;
16918    pragma Warnings (On);
16919
16920    protected Process is
16921       procedure Stop;
16922       function Continue return Boolean;
16923       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
16924    private
16925       Done : Boolean := False;
16926    end Process;
16927
16928 end ConfTest;
16929 CF_EOF
16930 cat >>conftest.adb <<CF_EOF
16931 package body ConfTest is
16932    protected body Process is
16933       procedure Stop is
16934       begin
16935          Done := True;
16936       end Stop;
16937       function Continue return Boolean is
16938       begin
16939          return not Done;
16940       end Continue;
16941    end Process;
16942 end ConfTest;
16943 CF_EOF
16944 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16945       cf_cv_gnat_sigint=yes
16946 else
16947    cf_cv_gnat_sigint=no
16948 fi
16949 rm -rf conftest* *~conftest*
16950
16951 fi
16952 echo "$as_me:16952: result: $cf_cv_gnat_sigint" >&5
16953 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16954
16955 if test $cf_cv_gnat_sigint = yes ; then
16956         USE_GNAT_SIGINT=""
16957 else
16958         USE_GNAT_SIGINT="#"
16959 fi
16960
16961 cf_gnat_libraries=no
16962 cf_gnat_projects=no
16963
16964 if test "$enable_gnat_projects" != no ; then
16965 echo "$as_me:16965: checking if GNAT supports project files" >&5
16966 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16967 case $cf_cv_gnat_version in
16968 (3.[0-9]*)
16969         ;;
16970 (*)
16971         case $cf_cv_system_name in
16972         (cygwin*|msys*)
16973                 ;;
16974         (*)
16975                 rm -rf conftest* *~conftest*
16976                 if mkdir conftest.src conftest.bin conftest.lib
16977                 then
16978                         cd conftest.src
16979                         rm -rf conftest* *~conftest*
16980                         cat >>library.gpr <<CF_EOF
16981 project Library is
16982   Kind := External ("LIB_KIND");
16983   for Library_Name use "ConfTest";
16984   for Object_Dir use ".";
16985   for Library_ALI_Dir use External("LIBRARY_DIR");
16986   for Library_Version use External ("SONAME");
16987   for Library_Kind use Kind;
16988   for Library_Dir use External("BUILD_DIR");
16989   Source_Dir := External ("SOURCE_DIR");
16990   for Source_Dirs use (Source_Dir);
16991 end Library;
16992 CF_EOF
16993                         cat >>confpackage.ads <<CF_EOF
16994 package ConfPackage is
16995    procedure conftest;
16996 end ConfPackage;
16997 CF_EOF
16998                         cat >>confpackage.adb <<CF_EOF
16999 with Text_IO;
17000 package body ConfPackage is
17001    procedure conftest is
17002    begin
17003       Text_IO.Put ("Hello World");
17004       Text_IO.New_Line;
17005    end conftest;
17006 end ConfPackage;
17007 CF_EOF
17008                         if ( $cf_ada_make $ADAFLAGS \
17009                                         -Plibrary.gpr \
17010                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
17011                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
17012                                         -XSOURCE_DIR=`pwd` \
17013                                         -XSONAME=libConfTest.so.1 \
17014                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17015                                 cf_gnat_projects=yes
17016                         fi
17017                         cd ..
17018                 fi
17019                 if test -f conftest.lib/confpackage.ali
17020                 then
17021                         cf_gnat_libraries=yes
17022                 fi
17023                 rm -rf conftest* *~conftest*
17024                 ;;
17025         esac
17026         ;;
17027 esac
17028 echo "$as_me:17028: result: $cf_gnat_projects" >&5
17029 echo "${ECHO_T}$cf_gnat_projects" >&6
17030 fi # enable_gnat_projects
17031
17032 if test $cf_gnat_projects = yes
17033 then
17034         echo "$as_me:17034: checking if GNAT supports libraries" >&5
17035 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17036         echo "$as_me:17036: result: $cf_gnat_libraries" >&5
17037 echo "${ECHO_T}$cf_gnat_libraries" >&6
17038 fi
17039
17040 if test "$cf_gnat_projects" = yes
17041 then
17042         USE_OLD_MAKERULES="#"
17043         USE_GNAT_PROJECTS=""
17044 else
17045         USE_OLD_MAKERULES=""
17046         USE_GNAT_PROJECTS="#"
17047 fi
17048
17049 if test "$cf_gnat_libraries" = yes
17050 then
17051         USE_GNAT_LIBRARIES=""
17052 else
17053         USE_GNAT_LIBRARIES="#"
17054 fi
17055
17056 echo "$as_me:17056: checking for ada-compiler" >&5
17057 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17058
17059 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17060 if test "${with_ada_compiler+set}" = set; then
17061   withval="$with_ada_compiler"
17062   cf_ada_compiler=$withval
17063 else
17064   cf_ada_compiler=gnatmake
17065 fi;
17066
17067 echo "$as_me:17067: result: $cf_ada_compiler" >&5
17068 echo "${ECHO_T}$cf_ada_compiler" >&6
17069
17070                 cf_ada_package=terminal_interface
17071
17072 echo "$as_me:17072: checking for ada-include" >&5
17073 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17074
17075 # Check whether --with-ada-include or --without-ada-include was given.
17076 if test "${with_ada_include+set}" = set; then
17077   withval="$with_ada_include"
17078
17079 else
17080   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17081 fi; if test -n "$prefix/share/ada/adainclude" ; then
17082
17083 if test "x$prefix" != xNONE; then
17084         cf_path_syntax="$prefix"
17085 else
17086         cf_path_syntax="$ac_default_prefix"
17087 fi
17088
17089 case ".$withval" in
17090 (.\$\(*\)*|.\'*\'*)
17091         ;;
17092 (..|./*|.\\*)
17093         ;;
17094 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17095         ;;
17096 (.\${*prefix}*|.\${*dir}*)
17097         eval withval="$withval"
17098         case ".$withval" in
17099         (.NONE/*)
17100                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17101                 ;;
17102         esac
17103         ;;
17104 (.no|.NONE/*)
17105         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17106         ;;
17107 (*)
17108         { { echo "$as_me:17108: error: expected a pathname, not \"$withval\"" >&5
17109 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17110    { (exit 1); exit 1; }; }
17111         ;;
17112 esac
17113
17114 fi
17115 eval ADA_INCLUDE="$withval"
17116
17117 echo "$as_me:17117: result: $ADA_INCLUDE" >&5
17118 echo "${ECHO_T}$ADA_INCLUDE" >&6
17119
17120 echo "$as_me:17120: checking for ada-objects" >&5
17121 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17122
17123 # Check whether --with-ada-objects or --without-ada-objects was given.
17124 if test "${with_ada_objects+set}" = set; then
17125   withval="$with_ada_objects"
17126
17127 else
17128   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17129 fi; if test -n "$prefix/lib/ada/adalib" ; then
17130
17131 if test "x$prefix" != xNONE; then
17132         cf_path_syntax="$prefix"
17133 else
17134         cf_path_syntax="$ac_default_prefix"
17135 fi
17136
17137 case ".$withval" in
17138 (.\$\(*\)*|.\'*\'*)
17139         ;;
17140 (..|./*|.\\*)
17141         ;;
17142 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17143         ;;
17144 (.\${*prefix}*|.\${*dir}*)
17145         eval withval="$withval"
17146         case ".$withval" in
17147         (.NONE/*)
17148                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17149                 ;;
17150         esac
17151         ;;
17152 (.no|.NONE/*)
17153         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17154         ;;
17155 (*)
17156         { { echo "$as_me:17156: error: expected a pathname, not \"$withval\"" >&5
17157 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17158    { (exit 1); exit 1; }; }
17159         ;;
17160 esac
17161
17162 fi
17163 eval ADA_OBJECTS="$withval"
17164
17165 echo "$as_me:17165: result: $ADA_OBJECTS" >&5
17166 echo "${ECHO_T}$ADA_OBJECTS" >&6
17167
17168 echo "$as_me:17168: checking if an Ada95 shared-library should be built" >&5
17169 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17170
17171 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17172 if test "${with_ada_sharedlib+set}" = set; then
17173   withval="$with_ada_sharedlib"
17174   with_ada_sharedlib=$withval
17175 else
17176   with_ada_sharedlib=no
17177 fi;
17178 echo "$as_me:17178: result: $with_ada_sharedlib" >&5
17179 echo "${ECHO_T}$with_ada_sharedlib" >&6
17180
17181 if test "x$with_ada_sharedlib" != xno
17182 then
17183         if test "x$cf_gnat_projects" != xyes
17184         then
17185                 { echo "$as_me:17185: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17186 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17187                 with_ada_sharedlib=no
17188         fi
17189 fi
17190
17191 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17192 MAKE_ADA_SHAREDLIB="#"
17193
17194 if test "x$with_ada_sharedlib" != xno
17195 then
17196         MAKE_ADA_SHAREDLIB=
17197         if test "x$with_ada_sharedlib" != xyes
17198         then
17199                 ADA_SHAREDLIB="$with_ada_sharedlib"
17200         fi
17201 fi
17202
17203                 # allow the Ada binding to be renamed
17204
17205 echo "$as_me:17205: checking for ada-libname" >&5
17206 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17207
17208 # Check whether --with-ada-libname or --without-ada-libname was given.
17209 if test "${with_ada_libname+set}" = set; then
17210   withval="$with_ada_libname"
17211   ADA_LIBNAME=$withval
17212 else
17213   ADA_LIBNAME=AdaCurses
17214 fi;
17215 case "x$ADA_LIBNAME" in
17216 (x|xyes|xno)
17217         ADA_LIBNAME=AdaCurses
17218         ;;
17219 esac
17220
17221 echo "$as_me:17221: result: $ADA_LIBNAME" >&5
17222 echo "${ECHO_T}$ADA_LIBNAME" >&6
17223
17224         else
17225                 { { echo "$as_me:17225: error: No usable Ada compiler found" >&5
17226 echo "$as_me: error: No usable Ada compiler found" >&2;}
17227    { (exit 1); exit 1; }; }
17228         fi
17229 else
17230         { { echo "$as_me:17230: error: The Ada compiler is needed for this package" >&5
17231 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17232    { (exit 1); exit 1; }; }
17233 fi
17234
17235 ################################################################################
17236
17237 # not needed
17238 TINFO_LDFLAGS2=
17239
17240 TINFO_LIBS=
17241
17242 ### Construct the list of include-directories to be generated
17243
17244 if test "$srcdir" != "."; then
17245         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17246 fi
17247 CPPFLAGS="-I../include $CPPFLAGS"
17248 if test "$srcdir" != "."; then
17249         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17250 fi
17251 CPPFLAGS="-I. $CPPFLAGS"
17252
17253 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17254 if test "$srcdir" != "."; then
17255         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17256 fi
17257 if test "$GCC" != yes; then
17258         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17259 elif test "$includedir" != "/usr/include"; then
17260         if test "$includedir" = '${prefix}/include' ; then
17261                 if test x$prefix != x/usr ; then
17262                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17263                 fi
17264         else
17265                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17266         fi
17267 fi
17268
17269 ### Build up pieces for makefile rules
17270 echo "$as_me:17270: checking default library suffix" >&5
17271 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17272
17273         case $DFT_LWR_MODEL in
17274         (libtool) DFT_ARG_SUFFIX=''   ;;
17275         (normal)  DFT_ARG_SUFFIX=''   ;;
17276         (debug)   DFT_ARG_SUFFIX='_g' ;;
17277         (profile) DFT_ARG_SUFFIX='_p' ;;
17278         (shared)  DFT_ARG_SUFFIX=''   ;;
17279         esac
17280         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17281 echo "$as_me:17281: result: $DFT_ARG_SUFFIX" >&5
17282 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17283
17284 echo "$as_me:17284: checking default library-dependency suffix" >&5
17285 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17286
17287         case X$DFT_LWR_MODEL in
17288         (Xlibtool)
17289                 DFT_LIB_SUFFIX='.la'
17290                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17291                 ;;
17292         (Xdebug)
17293                 case $cf_cv_system_name in
17294                 (*-msvc*)
17295                         DFT_LIB_SUFFIX='_g.lib'
17296                         ;;
17297                 (*)
17298                         DFT_LIB_SUFFIX='_g.a'
17299                         ;;
17300                 esac
17301                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17302                 ;;
17303         (Xprofile)
17304                 case $cf_cv_system_name in
17305                 (*-msvc*)
17306                         DFT_LIB_SUFFIX='_p.lib'
17307                         ;;
17308                 (*)
17309                         DFT_LIB_SUFFIX='_p.a'
17310                         ;;
17311                 esac
17312                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17313                 ;;
17314         (Xshared)
17315                 case $cf_cv_system_name in
17316                 (aix[5-7]*)
17317                         DFT_LIB_SUFFIX='.so'
17318                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17319                         ;;
17320                 (*-msvc*)
17321                         DFT_LIB_SUFFIX='.dll'
17322                         DFT_DEP_SUFFIX='.dll.lib'
17323                         ;;
17324                 (cygwin*|msys*|mingw*)
17325                         DFT_LIB_SUFFIX='.dll'
17326                         DFT_DEP_SUFFIX='.dll.a'
17327                         ;;
17328                 (darwin*)
17329                         DFT_LIB_SUFFIX='.dylib'
17330                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17331                         ;;
17332                 (hpux*)
17333                         case $target in
17334                         (ia64*)
17335                                 DFT_LIB_SUFFIX='.so'
17336                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17337                                 ;;
17338                         (*)
17339                                 DFT_LIB_SUFFIX='.sl'
17340                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17341                                 ;;
17342                         esac
17343                         ;;
17344                 (*)
17345                         DFT_LIB_SUFFIX='.so'
17346                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17347                         ;;
17348                 esac
17349                 ;;
17350         (*)
17351                 case $target in
17352                 (*-msvc*)
17353                         DFT_LIB_SUFFIX='.lib'
17354                         ;;
17355                 (*)
17356                         DFT_LIB_SUFFIX='.a'
17357                         ;;
17358                 esac
17359                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17360                 ;;
17361         esac
17362         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17363         then
17364                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17365                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17366         fi
17367 echo "$as_me:17367: result: $DFT_DEP_SUFFIX" >&5
17368 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17369
17370 echo "$as_me:17370: checking default object directory" >&5
17371 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17372
17373         case $DFT_LWR_MODEL in
17374         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17375         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17376         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17377         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17378         (shared)
17379                 case $cf_cv_system_name in
17380                 (cygwin|msys)
17381                         DFT_OBJ_SUBDIR='objects' ;;
17382                 (*)
17383                         DFT_OBJ_SUBDIR='obj_s' ;;
17384                 esac
17385         esac
17386 echo "$as_me:17386: result: $DFT_OBJ_SUBDIR" >&5
17387 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17388
17389 ### Set up low-level terminfo dependencies for makefiles.
17390
17391 if test "$DFT_LWR_MODEL" = shared ; then
17392         case $cf_cv_system_name in
17393         (cygwin*)
17394                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17395                 ;;
17396         (msys*)
17397                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17398                 ;;
17399         esac
17400 fi
17401
17402 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17403
17404 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17405
17406 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17407
17408 ### Construct the list of subdirectories for which we'll customize makefiles
17409 ### with the appropriate compile-rules.
17410
17411 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17412
17413 cat >>confdefs.h <<EOF
17414 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17415 EOF
17416
17417 ################################################################################
17418
17419 TEST_ARG2=
17420
17421 TEST_LIBS2=
17422
17423 NCURSES_SHLIB2="sh -c"
17424
17425 ADA_SUBDIRS="include gen src doc"
17426 if test "x$cf_with_tests" != "xno" ; then
17427         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17428 fi
17429 for cf_dir in $ADA_SUBDIRS
17430 do
17431         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17432 done
17433
17434 NCURSES_TREE="#"
17435
17436 EXTERNAL_TREE=
17437
17438 # match layout used by make-tar.sh
17439 ADAHTML_DIR=../doc/ada
17440
17441 if test "x$cross_compiling" = xyes ; then
17442         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17443 else
17444         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17445 fi
17446
17447 ac_config_files="$ac_config_files $SUB_MAKEFILES src/library.gpr:src/library.gpr.in doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
17448 ac_config_commands="$ac_config_commands default"
17449 cat >confcache <<\_ACEOF
17450 # This file is a shell script that caches the results of configure
17451 # tests run on this system so they can be shared between configure
17452 # scripts and configure runs, see configure's option --config-cache.
17453 # It is not useful on other systems.  If it contains results you don't
17454 # want to keep, you may remove or edit it.
17455 #
17456 # config.status only pays attention to the cache file if you give it
17457 # the --recheck option to rerun configure.
17458 #
17459 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17460 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17461 # following values.
17462
17463 _ACEOF
17464
17465 # The following way of writing the cache mishandles newlines in values,
17466 # but we know of no workaround that is simple, portable, and efficient.
17467 # So, don't put newlines in cache variables' values.
17468 # Ultrix sh set writes to stderr and can't be redirected directly,
17469 # and sets the high bit in the cache file unless we assign to the vars.
17470 {
17471   (set) 2>&1 |
17472     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17473     *ac_space=\ *)
17474       # `set' does not quote correctly, so add quotes (double-quote
17475       # substitution turns \\\\ into \\, and sed turns \\ into \).
17476       sed -n \
17477         "s/'/'\\\\''/g;
17478           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17479       ;;
17480     *)
17481       # `set' quotes correctly as required by POSIX, so do not add quotes.
17482       sed -n \
17483         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17484       ;;
17485     esac;
17486 } |
17487   sed '
17488      t clear
17489      : clear
17490      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17491      t end
17492      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17493      : end' >>confcache
17494 if cmp -s $cache_file confcache; then :; else
17495   if test -w $cache_file; then
17496     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17497     cat confcache >$cache_file
17498   else
17499     echo "not updating unwritable cache $cache_file"
17500   fi
17501 fi
17502 rm -f confcache
17503
17504 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17505 # Let make expand exec_prefix.
17506 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17507
17508 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17509 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17510 # trailing colons and then remove the whole line if VPATH becomes empty
17511 # (actually we leave an empty line to preserve line numbers).
17512 if test "x$srcdir" = x.; then
17513   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17514 s/:*\$(srcdir):*/:/;
17515 s/:*\${srcdir}:*/:/;
17516 s/:*@srcdir@:*/:/;
17517 s/^\([^=]*=[    ]*\):*/\1/;
17518 s/:*$//;
17519 s/^[^=]*=[      ]*$//;
17520 }'
17521 fi
17522
17523 DEFS=-DHAVE_CONFIG_H
17524
17525 : ${CONFIG_STATUS=./config.status}
17526 ac_clean_files_save=$ac_clean_files
17527 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17528 { echo "$as_me:17528: creating $CONFIG_STATUS" >&5
17529 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17530 cat >$CONFIG_STATUS <<_ACEOF
17531 #! $SHELL
17532 # Generated automatically by configure.
17533 # Run this file to recreate the current configuration.
17534 # Compiler output produced by configure, useful for debugging
17535 # configure, is in config.log if it exists.
17536
17537 debug=false
17538 SHELL=\${CONFIG_SHELL-$SHELL}
17539 ac_cs_invocation="\$0 \$@"
17540
17541 CLICOLOR_FORCE= GREP_OPTIONS=
17542 unset CLICOLOR_FORCE GREP_OPTIONS
17543 _ACEOF
17544
17545 cat >>$CONFIG_STATUS <<\_ACEOF
17546 # Be Bourne compatible
17547 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17548   emulate sh
17549   NULLCMD=:
17550 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17551   set -o posix
17552 fi
17553
17554 # Name of the executable.
17555 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17556
17557 if expr a : '\(a\)' >/dev/null 2>&1; then
17558   as_expr=expr
17559 else
17560   as_expr=false
17561 fi
17562
17563 rm -f conf$$ conf$$.exe conf$$.file
17564 echo >conf$$.file
17565 if ln -s conf$$.file conf$$ 2>/dev/null; then
17566   # We could just check for DJGPP; but this test a) works b) is more generic
17567   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17568   if test -f conf$$.exe; then
17569     # Don't use ln at all; we don't have any links
17570     as_ln_s='cp -p'
17571   else
17572     as_ln_s='ln -s'
17573   fi
17574 elif ln conf$$.file conf$$ 2>/dev/null; then
17575   as_ln_s=ln
17576 else
17577   as_ln_s='cp -p'
17578 fi
17579 rm -f conf$$ conf$$.exe conf$$.file
17580
17581 as_executable_p="test -f"
17582
17583 # Support unset when possible.
17584 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17585   as_unset=unset
17586 else
17587   as_unset=false
17588 fi
17589
17590 # NLS nuisances.
17591 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17592 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17593 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17594 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17595 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17596 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17597 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17598 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17599
17600 # IFS
17601 # We need space, tab and new line, in precisely that order.
17602 as_nl='
17603 '
17604 IFS="   $as_nl"
17605
17606 # CDPATH.
17607 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17608
17609 exec 6>&1
17610
17611 _ACEOF
17612
17613 # Files that config.status was made for.
17614 if test -n "$ac_config_files"; then
17615   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17616 fi
17617
17618 if test -n "$ac_config_headers"; then
17619   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17620 fi
17621
17622 if test -n "$ac_config_links"; then
17623   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17624 fi
17625
17626 if test -n "$ac_config_commands"; then
17627   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17628 fi
17629
17630 cat >>$CONFIG_STATUS <<\EOF
17631
17632 ac_cs_usage="\
17633 \`$as_me' instantiates files from templates according to the
17634 current configuration.
17635
17636 Usage: $0 [OPTIONS] [FILE]...
17637
17638   -h, --help       print this help, then exit
17639   -V, --version    print version number, then exit
17640   -d, --debug      don't remove temporary files
17641       --recheck    update $as_me by reconfiguring in the same conditions
17642   --file=FILE[:TEMPLATE]
17643                    instantiate the configuration file FILE
17644   --header=FILE[:TEMPLATE]
17645                    instantiate the configuration header FILE
17646
17647 Configuration files:
17648 $config_files
17649
17650 Configuration headers:
17651 $config_headers
17652
17653 Configuration commands:
17654 $config_commands
17655
17656 Report bugs to <dickey@invisible-island.net>."
17657 EOF
17658
17659 cat >>$CONFIG_STATUS <<EOF
17660 ac_cs_version="\\
17661 config.status
17662 configured by $0, generated by GNU Autoconf 2.52.20200802,
17663   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17664
17665 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17666 Free Software Foundation, Inc.
17667 This config.status script is free software; the Free Software Foundation
17668 gives unlimited permission to copy, distribute and modify it."
17669 srcdir=$srcdir
17670 INSTALL="$INSTALL"
17671 EOF
17672
17673 cat >>$CONFIG_STATUS <<\EOF
17674 # If no file are specified by the user, then we need to provide default
17675 # value.  By we need to know if files were specified by the user.
17676 ac_need_defaults=:
17677 while test $# != 0
17678 do
17679   case $1 in
17680   --*=*)
17681     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17682     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17683     shift
17684     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17685     shift
17686     ;;
17687   -*);;
17688   *) # This is not an option, so the user has probably given explicit
17689      # arguments.
17690      ac_need_defaults=false;;
17691   esac
17692
17693   case $1 in
17694   # Handling of the options.
17695 EOF
17696 cat >>$CONFIG_STATUS <<EOF
17697   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17698     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17699     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17700 EOF
17701 cat >>$CONFIG_STATUS <<\EOF
17702   --version | --vers* | -V )
17703     echo "$ac_cs_version"; exit 0 ;;
17704   --he | --h)
17705     # Conflict between --help and --header
17706     { { echo "$as_me:17706: error: ambiguous option: $1
17707 Try \`$0 --help' for more information." >&5
17708 echo "$as_me: error: ambiguous option: $1
17709 Try \`$0 --help' for more information." >&2;}
17710    { (exit 1); exit 1; }; };;
17711   --help | --hel | -h )
17712     echo "$ac_cs_usage"; exit 0 ;;
17713   --debug | --d* | -d )
17714     debug=: ;;
17715   --file | --fil | --fi | --f )
17716     shift
17717     CONFIG_FILES="$CONFIG_FILES $1"
17718     ac_need_defaults=false;;
17719   --header | --heade | --head | --hea )
17720     shift
17721     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17722     ac_need_defaults=false;;
17723
17724   # This is an error.
17725   -*) { { echo "$as_me:17725: error: unrecognized option: $1
17726 Try \`$0 --help' for more information." >&5
17727 echo "$as_me: error: unrecognized option: $1
17728 Try \`$0 --help' for more information." >&2;}
17729    { (exit 1); exit 1; }; } ;;
17730
17731   *) ac_config_targets="$ac_config_targets $1" ;;
17732
17733   esac
17734   shift
17735 done
17736
17737 exec 5>>config.log
17738 cat >&5 << _ACEOF
17739
17740 ## ----------------------- ##
17741 ## Running config.status.  ##
17742 ## ----------------------- ##
17743
17744 This file was extended by $as_me 2.52.20200802, executed with
17745   CONFIG_FILES    = $CONFIG_FILES
17746   CONFIG_HEADERS  = $CONFIG_HEADERS
17747   CONFIG_LINKS    = $CONFIG_LINKS
17748   CONFIG_COMMANDS = $CONFIG_COMMANDS
17749   > $ac_cs_invocation
17750 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17751
17752 _ACEOF
17753 EOF
17754
17755 cat >>$CONFIG_STATUS <<EOF
17756 #
17757 # INIT-COMMANDS section.
17758 #
17759
17760 ### Special initialization commands, used to pass information from the
17761 ### configuration-run into config.status
17762
17763 AWK="$AWK"
17764 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
17765 DFT_LWR_MODEL="$DFT_LWR_MODEL"
17766 LIB_NAME="$LIB_NAME"
17767 LIB_PREFIX="$LIB_PREFIX"
17768 LIB_SUFFIX="$LIB_SUFFIX"
17769 LN_S="$LN_S"
17770 NCURSES_MAJOR="$NCURSES_MAJOR"
17771 NCURSES_MINOR="$NCURSES_MINOR"
17772 NCURSES_PATCH="$NCURSES_PATCH"
17773 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
17774 cf_cv_abi_version="$cf_cv_abi_version"
17775 cf_cv_rel_version="$cf_cv_rel_version"
17776 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
17777 cf_cv_shared_soname='$cf_cv_shared_soname'
17778 cf_cv_shlib_version="$cf_cv_shlib_version"
17779 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
17780 cf_cv_system_name="$cf_cv_system_name"
17781 host="$host"
17782 target="$target"
17783
17784 EOF
17785
17786 cat >>$CONFIG_STATUS <<\EOF
17787 for ac_config_target in $ac_config_targets
17788 do
17789   case "$ac_config_target" in
17790   # Handling of arguments.
17791   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
17792   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
17793   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
17794   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17795   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17796   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
17797   *) { { echo "$as_me:17797: error: invalid argument: $ac_config_target" >&5
17798 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17799    { (exit 1); exit 1; }; };;
17800   esac
17801 done
17802
17803 # If the user did not use the arguments to specify the items to instantiate,
17804 # then the envvar interface is used.  Set only those that are not.
17805 # We use the long form for the default assignment because of an extremely
17806 # bizarre bug on SunOS 4.1.3.
17807 if $ac_need_defaults; then
17808   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17809   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17810   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17811 fi
17812
17813 # Create a temporary directory, and hook for its removal unless debugging.
17814 $debug ||
17815 {
17816   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17817   trap '{ (exit 1); exit 1; }' 1 2 13 15
17818 }
17819
17820 # Create a (secure) tmp directory for tmp files.
17821 : ${TMPDIR=/tmp}
17822 {
17823   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17824   test -n "$tmp" && test -d "$tmp"
17825 }  ||
17826 {
17827   tmp=$TMPDIR/cs$$-$RANDOM
17828   (umask 077 && mkdir $tmp)
17829 } ||
17830 {
17831    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17832    { (exit 1); exit 1; }
17833 }
17834
17835 EOF
17836
17837 cat >>$CONFIG_STATUS <<EOF
17838
17839 #
17840 # CONFIG_FILES section.
17841 #
17842
17843 # No need to generate the scripts if there are no CONFIG_FILES.
17844 # This happens for instance when ./config.status config.h
17845 if test -n "\$CONFIG_FILES"; then
17846   # Protect against being on the right side of a sed subst in config.status.
17847   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17848    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17849 s,@SHELL@,$SHELL,;t t
17850 s,@exec_prefix@,$exec_prefix,;t t
17851 s,@prefix@,$prefix,;t t
17852 s,@program_transform_name@,$program_transform_name,;t t
17853 s,@bindir@,$bindir,;t t
17854 s,@sbindir@,$sbindir,;t t
17855 s,@libexecdir@,$libexecdir,;t t
17856 s,@datarootdir@,$datarootdir,;t t
17857 s,@datadir@,$datadir,;t t
17858 s,@sysconfdir@,$sysconfdir,;t t
17859 s,@sharedstatedir@,$sharedstatedir,;t t
17860 s,@localstatedir@,$localstatedir,;t t
17861 s,@runstatedir@,$runstatedir,;t t
17862 s,@libdir@,$libdir,;t t
17863 s,@includedir@,$includedir,;t t
17864 s,@oldincludedir@,$oldincludedir,;t t
17865 s,@infodir@,$infodir,;t t
17866 s,@mandir@,$mandir,;t t
17867 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17868 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17869 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17870 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17871 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17872 s,@build_alias@,$build_alias,;t t
17873 s,@host_alias@,$host_alias,;t t
17874 s,@target_alias@,$target_alias,;t t
17875 s,@ECHO_C@,$ECHO_C,;t t
17876 s,@ECHO_N@,$ECHO_N,;t t
17877 s,@ECHO_T@,$ECHO_T,;t t
17878 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17879 s,@DEFS@,$DEFS,;t t
17880 s,@LIBS@,$LIBS,;t t
17881 s,@top_builddir@,$top_builddir,;t t
17882 s,@build@,$build,;t t
17883 s,@build_cpu@,$build_cpu,;t t
17884 s,@build_vendor@,$build_vendor,;t t
17885 s,@build_os@,$build_os,;t t
17886 s,@host@,$host,;t t
17887 s,@host_cpu@,$host_cpu,;t t
17888 s,@host_vendor@,$host_vendor,;t t
17889 s,@host_os@,$host_os,;t t
17890 s,@target@,$target,;t t
17891 s,@target_cpu@,$target_cpu,;t t
17892 s,@target_vendor@,$target_vendor,;t t
17893 s,@target_os@,$target_os,;t t
17894 s,@CC@,$CC,;t t
17895 s,@CFLAGS@,$CFLAGS,;t t
17896 s,@LDFLAGS@,$LDFLAGS,;t t
17897 s,@CPPFLAGS@,$CPPFLAGS,;t t
17898 s,@ac_ct_CC@,$ac_ct_CC,;t t
17899 s,@EXEEXT@,$EXEEXT,;t t
17900 s,@OBJEXT@,$OBJEXT,;t t
17901 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17902 s,@CPP@,$CPP,;t t
17903 s,@AWK@,$AWK,;t t
17904 s,@EGREP@,$EGREP,;t t
17905 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17906 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17907 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17908 s,@LN_S@,$LN_S,;t t
17909 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17910 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17911 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17912 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17913 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17914 s,@SET_MAKE@,$SET_MAKE,;t t
17915 s,@CTAGS@,$CTAGS,;t t
17916 s,@ETAGS@,$ETAGS,;t t
17917 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17918 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17919 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17920 s,@RANLIB@,$RANLIB,;t t
17921 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17922 s,@LD@,$LD,;t t
17923 s,@ac_ct_LD@,$ac_ct_LD,;t t
17924 s,@AR@,$AR,;t t
17925 s,@ac_ct_AR@,$ac_ct_AR,;t t
17926 s,@ARFLAGS@,$ARFLAGS,;t t
17927 s,@DESTDIR@,$DESTDIR,;t t
17928 s,@BUILD_CC@,$BUILD_CC,;t t
17929 s,@BUILD_CPP@,$BUILD_CPP,;t t
17930 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17931 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17932 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17933 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17934 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17935 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17936 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17937 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17938 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17939 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17940 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17941 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17942 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17943 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17944 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17945 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17946 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17947 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17948 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17949 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17950 s,@CC_G_OPT@,$CC_G_OPT,;t t
17951 s,@LD_MODEL@,$LD_MODEL,;t t
17952 s,@shlibdir@,$shlibdir,;t t
17953 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17954 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17955 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17956 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17957 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17958 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17959 s,@LINK_PROGS@,$LINK_PROGS,;t t
17960 s,@LINK_TESTS@,$LINK_TESTS,;t t
17961 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17962 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17963 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17964 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17965 s,@RPATH_LIST@,$RPATH_LIST,;t t
17966 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17967 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17968 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17969 s,@PTHREAD@,$PTHREAD,;t t
17970 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17971 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17972 s,@ECHO_LT@,$ECHO_LT,;t t
17973 s,@ECHO_LD@,$ECHO_LD,;t t
17974 s,@RULE_CC@,$RULE_CC,;t t
17975 s,@SHOW_CC@,$SHOW_CC,;t t
17976 s,@ECHO_CC@,$ECHO_CC,;t t
17977 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17978 s,@ADAFLAGS@,$ADAFLAGS,;t t
17979 s,@ADA_TRACE@,$ADA_TRACE,;t t
17980 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
17981 s,@M4_exists@,$M4_exists,;t t
17982 s,@cf_ada_make@,$cf_ada_make,;t t
17983 s,@cf_ada_config@,$cf_ada_config,;t t
17984 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
17985 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
17986 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
17987 s,@cf_compile_generics@,$cf_compile_generics,;t t
17988 s,@cf_generic_objects@,$cf_generic_objects,;t t
17989 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
17990 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
17991 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
17992 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
17993 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
17994 s,@cf_ada_package@,$cf_ada_package,;t t
17995 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
17996 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
17997 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
17998 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
17999 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18000 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18001 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18002 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18003 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18004 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18005 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18006 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18007 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18008 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18009 s,@TEST_ARG2@,$TEST_ARG2,;t t
18010 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18011 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18012 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18013 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18014 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18015 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18016 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18017 CEOF
18018
18019 EOF
18020
18021   cat >>$CONFIG_STATUS <<\EOF
18022   # Split the substitutions into bite-sized pieces for seds with
18023   # small command number limits, like on Digital OSF/1 and HP-UX.
18024   ac_max_sed_lines=48
18025   ac_sed_frag=1 # Number of current file.
18026   ac_beg=1 # First line for current file.
18027   ac_end=$ac_max_sed_lines # Line after last line for current file.
18028   ac_more_lines=:
18029   ac_sed_cmds=
18030   while $ac_more_lines; do
18031     if test $ac_beg -gt 1; then
18032       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18033     else
18034       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18035     fi
18036     if test ! -s $tmp/subs.frag; then
18037       ac_more_lines=false
18038     else
18039       # The purpose of the label and of the branching condition is to
18040       # speed up the sed processing (if there are no `@' at all, there
18041       # is no need to browse any of the substitutions).
18042       # These are the two extra sed commands mentioned above.
18043       (echo ':t
18044   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18045       # It is possible to make a multiline substitution using escaped newlines.
18046       # Ensure that we do not split the substitution between script fragments.
18047       ac_BEG=$ac_end
18048       ac_END=`expr $ac_end + $ac_max_sed_lines`
18049       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18050       if test -s $tmp/subs.next; then
18051         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18052         if test ! -s $tmp/subs.edit; then
18053           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18054           if test ! -s $tmp/subs.edit; then
18055             if test $ac_beg -gt 1; then
18056               ac_end=`expr $ac_end - 1`
18057               continue
18058             fi
18059           fi
18060         fi
18061       fi
18062
18063       if test -z "$ac_sed_cmds"; then
18064         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18065       else
18066         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18067       fi
18068       ac_sed_frag=`expr $ac_sed_frag + 1`
18069       ac_beg=$ac_end
18070       ac_end=`expr $ac_end + $ac_max_sed_lines`
18071     fi
18072   done
18073   if test -z "$ac_sed_cmds"; then
18074     ac_sed_cmds=cat
18075   fi
18076 fi # test -n "$CONFIG_FILES"
18077
18078 EOF
18079 cat >>$CONFIG_STATUS <<\EOF
18080 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18081   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18082   case $ac_file in
18083   - | *:- | *:-:* ) # input from stdin
18084         cat >$tmp/stdin
18085         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18086         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18087   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18088         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18089   * )   ac_file_in=$ac_file.in ;;
18090   esac
18091
18092   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18093   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18094          X"$ac_file" : 'X\(//\)[^/]' \| \
18095          X"$ac_file" : 'X\(//\)$' \| \
18096          X"$ac_file" : 'X\(/\)' \| \
18097          .     : '\(.\)' 2>/dev/null ||
18098 echo X"$ac_file" |
18099     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18100           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18101           /^X\(\/\/\)$/{ s//\1/; q; }
18102           /^X\(\/\).*/{ s//\1/; q; }
18103           s/.*/./; q'`
18104   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18105     { case "$ac_dir" in
18106   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18107   *)                      as_incr_dir=.;;
18108 esac
18109 as_dummy="$ac_dir"
18110 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18111   case $as_mkdir_dir in
18112     # Skip DOS drivespec
18113     ?:) as_incr_dir=$as_mkdir_dir ;;
18114     *)
18115       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18116       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18117     ;;
18118   esac
18119 done; }
18120
18121     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18122     # A "../" for each directory in $ac_dir_suffix.
18123     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18124   else
18125     ac_dir_suffix= ac_dots=
18126   fi
18127
18128   case $srcdir in
18129   .)  ac_srcdir=.
18130       if test -z "$ac_dots"; then
18131          ac_top_srcdir=.
18132       else
18133          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18134       fi ;;
18135   [\\/]* | ?:[\\/]* )
18136       ac_srcdir=$srcdir$ac_dir_suffix;
18137       ac_top_srcdir=$srcdir ;;
18138   *) # Relative path.
18139     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18140     ac_top_srcdir=$ac_dots$srcdir ;;
18141   esac
18142
18143   case $INSTALL in
18144   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18145   *) ac_INSTALL=$ac_dots$INSTALL ;;
18146   esac
18147
18148   if test x"$ac_file" != x-; then
18149     { echo "$as_me:18149: creating $ac_file" >&5
18150 echo "$as_me: creating $ac_file" >&6;}
18151     rm -f "$ac_file"
18152   fi
18153   # Let's still pretend it is `configure' which instantiates (i.e., don't
18154   # use $as_me), people would be surprised to read:
18155   #    /* config.h.  Generated automatically by config.status.  */
18156   configure_input="Generated automatically from `echo $ac_file_in |
18157                                                  sed 's,.*/,,'` by configure."
18158
18159   # First look for the input files in the build tree, otherwise in the
18160   # src tree.
18161   ac_file_inputs=`IFS=:
18162     for f in $ac_file_in; do
18163       case $f in
18164       -) echo $tmp/stdin ;;
18165       [\\/$]*)
18166          # Absolute (can't be DOS-style, as IFS=:)
18167          test -f "$f" || { { echo "$as_me:18167: error: cannot find input file: $f" >&5
18168 echo "$as_me: error: cannot find input file: $f" >&2;}
18169    { (exit 1); exit 1; }; }
18170          echo $f;;
18171       *) # Relative
18172          if test -f "$f"; then
18173            # Build tree
18174            echo $f
18175          elif test -f "$srcdir/$f"; then
18176            # Source tree
18177            echo $srcdir/$f
18178          else
18179            # /dev/null tree
18180            { { echo "$as_me:18180: error: cannot find input file: $f" >&5
18181 echo "$as_me: error: cannot find input file: $f" >&2;}
18182    { (exit 1); exit 1; }; }
18183          fi;;
18184       esac
18185     done` || { (exit 1); exit 1; }
18186 EOF
18187 cat >>$CONFIG_STATUS <<\EOF
18188   ac_warn_datarootdir=no
18189   if test x"$ac_file" != x-; then
18190     for ac_item in $ac_file_inputs
18191     do
18192       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18193       if test -n "$ac_seen"; then
18194         ac_used=`grep '@datarootdir@' $ac_item`
18195         if test -z "$ac_used"; then
18196           { echo "$as_me:18196: WARNING: datarootdir was used implicitly but not set:
18197 $ac_seen" >&5
18198 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18199 $ac_seen" >&2;}
18200           ac_warn_datarootdir=yes
18201         fi
18202       fi
18203       ac_seen=`grep '${datarootdir}' $ac_item`
18204       if test -n "$ac_seen"; then
18205         { echo "$as_me:18205: WARNING: datarootdir was used explicitly but not set:
18206 $ac_seen" >&5
18207 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18208 $ac_seen" >&2;}
18209         ac_warn_datarootdir=yes
18210       fi
18211     done
18212   fi
18213
18214 if test "x$ac_warn_datarootdir" = xyes; then
18215   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18216 fi
18217
18218 EOF
18219 cat >>$CONFIG_STATUS <<EOF
18220   sed "$ac_vpsub
18221 $extrasub
18222 EOF
18223 cat >>$CONFIG_STATUS <<\EOF
18224 :t
18225 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18226 s,@configure_input@,$configure_input,;t t
18227 s,@srcdir@,$ac_srcdir,;t t
18228 s,@top_srcdir@,$ac_top_srcdir,;t t
18229 s,@INSTALL@,$ac_INSTALL,;t t
18230 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18231   rm -f $tmp/stdin
18232   if test x"$ac_file" != x-; then
18233     cp $tmp/out $ac_file
18234
18235     for ac_name in prefix exec_prefix datarootdir
18236     do
18237         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18238         if test -n "$ac_seen"; then
18239             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18240             if test -z "$ac_init"; then
18241               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18242               { echo "$as_me:18242: WARNING: Variable $ac_name is used but was not set:
18243 $ac_seen" >&5
18244 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18245 $ac_seen" >&2;}
18246             fi
18247         fi
18248     done
18249     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18250     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18251     if test -s $tmp/out; then
18252       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18253       { echo "$as_me:18253: WARNING: Some variables may not be substituted:
18254 $ac_seen" >&5
18255 echo "$as_me: WARNING: Some variables may not be substituted:
18256 $ac_seen" >&2;}
18257     fi
18258   else
18259     cat $tmp/out
18260   fi
18261   rm -f $tmp/out
18262
18263 done
18264 EOF
18265 cat >>$CONFIG_STATUS <<\EOF
18266
18267 #
18268 # CONFIG_HEADER section.
18269 #
18270
18271 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18272 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18273 #
18274 # ac_d sets the value in "#define NAME VALUE" lines.
18275 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18276 ac_dB='[        ].*$,\1#\2'
18277 ac_dC=' '
18278 ac_dD=',;t'
18279 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18280 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18281 ac_iB='\([      ]\),\1#\2define\3'
18282 ac_iC=' '
18283 ac_iD='\4,;t'
18284 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18285 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18286 ac_uB='$,\1#\2define\3'
18287 ac_uC=' '
18288 ac_uD=',;t'
18289
18290 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18291   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18292   case $ac_file in
18293   - | *:- | *:-:* ) # input from stdin
18294         cat >$tmp/stdin
18295         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18296         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18297   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18298         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18299   * )   ac_file_in=$ac_file.in ;;
18300   esac
18301
18302   test x"$ac_file" != x- && { echo "$as_me:18302: creating $ac_file" >&5
18303 echo "$as_me: creating $ac_file" >&6;}
18304
18305   # First look for the input files in the build tree, otherwise in the
18306   # src tree.
18307   ac_file_inputs=`IFS=:
18308     for f in $ac_file_in; do
18309       case $f in
18310       -) echo $tmp/stdin ;;
18311       [\\/$]*)
18312          # Absolute (can't be DOS-style, as IFS=:)
18313          test -f "$f" || { { echo "$as_me:18313: error: cannot find input file: $f" >&5
18314 echo "$as_me: error: cannot find input file: $f" >&2;}
18315    { (exit 1); exit 1; }; }
18316          echo $f;;
18317       *) # Relative
18318          if test -f "$f"; then
18319            # Build tree
18320            echo $f
18321          elif test -f "$srcdir/$f"; then
18322            # Source tree
18323            echo $srcdir/$f
18324          else
18325            # /dev/null tree
18326            { { echo "$as_me:18326: error: cannot find input file: $f" >&5
18327 echo "$as_me: error: cannot find input file: $f" >&2;}
18328    { (exit 1); exit 1; }; }
18329          fi;;
18330       esac
18331     done` || { (exit 1); exit 1; }
18332   # Remove the trailing spaces.
18333   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18334
18335 EOF
18336
18337 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18338 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18339 # be either 'cat' or 'sort'.
18340 cat confdefs.h | uniq >conftest.vals
18341
18342 # Break up conftest.vals because some shells have a limit on
18343 # the size of here documents, and old seds have small limits too.
18344
18345 rm -f conftest.tail
18346 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18347 while grep . conftest.vals >/dev/null
18348 do
18349   # Write chunks of a limited-size here document to conftest.frag.
18350   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18351   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18352   echo 'CEOF' >> $CONFIG_STATUS
18353   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18354   rm -f conftest.vals
18355   mv conftest.tail conftest.vals
18356 done
18357 rm -f conftest.vals
18358
18359 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18360 # marker @DEFS@.
18361 echo '  cat >> conftest.edit <<CEOF
18362 /@DEFS@/r conftest.frag
18363 /@DEFS@/d
18364 CEOF
18365 sed -f conftest.edit $tmp/in > $tmp/out
18366 rm -f $tmp/in
18367 mv $tmp/out $tmp/in
18368 rm -f conftest.edit conftest.frag
18369 ' >> $CONFIG_STATUS
18370
18371 cat >>$CONFIG_STATUS <<\EOF
18372   # Let's still pretend it is `configure' which instantiates (i.e., don't
18373   # use $as_me), people would be surprised to read:
18374   #    /* config.h.  Generated automatically by config.status.  */
18375   if test x"$ac_file" = x-; then
18376     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18377   else
18378     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18379   fi
18380   cat $tmp/in >>$tmp/config.h
18381   rm -f $tmp/in
18382   if test x"$ac_file" != x-; then
18383     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18384       { echo "$as_me:18384: $ac_file is unchanged" >&5
18385 echo "$as_me: $ac_file is unchanged" >&6;}
18386     else
18387       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18388          X"$ac_file" : 'X\(//\)[^/]' \| \
18389          X"$ac_file" : 'X\(//\)$' \| \
18390          X"$ac_file" : 'X\(/\)' \| \
18391          .     : '\(.\)' 2>/dev/null ||
18392 echo X"$ac_file" |
18393     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18394           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18395           /^X\(\/\/\)$/{ s//\1/; q; }
18396           /^X\(\/\).*/{ s//\1/; q; }
18397           s/.*/./; q'`
18398       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18399         { case "$ac_dir" in
18400   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18401   *)                      as_incr_dir=.;;
18402 esac
18403 as_dummy="$ac_dir"
18404 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18405   case $as_mkdir_dir in
18406     # Skip DOS drivespec
18407     ?:) as_incr_dir=$as_mkdir_dir ;;
18408     *)
18409       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18410       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18411     ;;
18412   esac
18413 done; }
18414
18415       fi
18416       rm -f $ac_file
18417       mv $tmp/config.h $ac_file
18418     fi
18419   else
18420     cat $tmp/config.h
18421     rm -f $tmp/config.h
18422   fi
18423 done
18424 EOF
18425 cat >>$CONFIG_STATUS <<\EOF
18426 #
18427 # CONFIG_COMMANDS section.
18428 #
18429 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18430   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18431   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18432
18433   case $ac_dest in
18434     default )
18435 if test -z "$USE_OLD_MAKERULES" ; then
18436         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18437 fi
18438  ;;
18439   esac
18440 done
18441 EOF
18442
18443 cat >>$CONFIG_STATUS <<\EOF
18444
18445 { (exit 0); exit 0; }
18446 EOF
18447 chmod +x $CONFIG_STATUS
18448 ac_clean_files=$ac_clean_files_save
18449
18450 # configure is writing to config.log, and then calls config.status.
18451 # config.status does its own redirection, appending to config.log.
18452 # Unfortunately, on DOS this fails, as config.log is still kept open
18453 # by configure, so config.status won't be able to write to it; its
18454 # output is simply discarded.  So we exec the FD to /dev/null,
18455 # effectively closing config.log, so it can be properly (re)opened and
18456 # appended to by config.status.  When coming back to configure, we
18457 # need to make the FD available again.
18458 if test "$no_create" != yes; then
18459   ac_cs_success=:
18460   exec 5>/dev/null
18461   $SHELL $CONFIG_STATUS || ac_cs_success=false
18462   exec 5>>config.log
18463   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18464   # would make configure fail if this is the last instruction.
18465   $ac_cs_success || { (exit 1); exit 1; }
18466 fi
18467 ${MAKE:-make} preinstall