]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
c1c92548485d96bc59d99793261fe4fcc8d2bae7
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.88 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20230114.
5 #
6 # Copyright 2003-2022,2023      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr="expr"
38 else
39   as_expr="false"
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s='ln'
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2022,2023        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20230114.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 PACKAGE="AdaCurses"
1063
1064 top_builddir=`pwd`
1065
1066 ac_aux_dir=
1067 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1068   if test -f "$ac_dir/install-sh"; then
1069     ac_aux_dir=$ac_dir
1070     ac_install_sh="$ac_aux_dir/install-sh -c"
1071     break
1072   elif test -f "$ac_dir/install.sh"; then
1073     ac_aux_dir=$ac_dir
1074     ac_install_sh="$ac_aux_dir/install.sh -c"
1075     break
1076   elif test -f "$ac_dir/shtool"; then
1077     ac_aux_dir=$ac_dir
1078     ac_install_sh="$ac_aux_dir/shtool install -c"
1079     break
1080   fi
1081 done
1082 if test -z "$ac_aux_dir"; then
1083   { { echo "$as_me:1083: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1084 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1085    { (exit 1); exit 1; }; }
1086 fi
1087 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1088 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1089 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1090
1091 # Make sure we can run config.sub.
1092 $ac_config_sub sun4 >/dev/null 2>&1 ||
1093   { { echo "$as_me:1093: error: cannot run $ac_config_sub" >&5
1094 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1095    { (exit 1); exit 1; }; }
1096
1097 echo "$as_me:1097: checking build system type" >&5
1098 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1099 if test "${ac_cv_build+set}" = set; then
1100   echo $ECHO_N "(cached) $ECHO_C" >&6
1101 else
1102   ac_cv_build_alias=$build_alias
1103 test -z "$ac_cv_build_alias" &&
1104   ac_cv_build_alias=`$ac_config_guess`
1105 test -z "$ac_cv_build_alias" &&
1106   { { echo "$as_me:1106: error: cannot guess build type; you must specify one" >&5
1107 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1108    { (exit 1); exit 1; }; }
1109 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1110   { { echo "$as_me:1110: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1111 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1112    { (exit 1); exit 1; }; }
1113
1114 fi
1115 echo "$as_me:1115: result: $ac_cv_build" >&5
1116 echo "${ECHO_T}$ac_cv_build" >&6
1117 build=$ac_cv_build
1118 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1119 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1120 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1121
1122 echo "$as_me:1122: checking host system type" >&5
1123 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1124 if test "${ac_cv_host+set}" = set; then
1125   echo $ECHO_N "(cached) $ECHO_C" >&6
1126 else
1127   ac_cv_host_alias=$host_alias
1128 test -z "$ac_cv_host_alias" &&
1129   ac_cv_host_alias=$ac_cv_build_alias
1130 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1131   { { echo "$as_me:1131: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1132 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1133    { (exit 1); exit 1; }; }
1134
1135 fi
1136 echo "$as_me:1136: result: $ac_cv_host" >&5
1137 echo "${ECHO_T}$ac_cv_host" >&6
1138 host=$ac_cv_host
1139 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1140 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1141 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1142
1143 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1144         echo "$as_me:1144: checking target system type" >&5
1145 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1146 if test "${ac_cv_target+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   ac_cv_target_alias=$target_alias
1150 test "x$ac_cv_target_alias" = "x" &&
1151   ac_cv_target_alias=$ac_cv_host_alias
1152 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1153   { { echo "$as_me:1153: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1154 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1155    { (exit 1); exit 1; }; }
1156
1157 fi
1158 echo "$as_me:1158: result: $ac_cv_target" >&5
1159 echo "${ECHO_T}$ac_cv_target" >&6
1160 target=$ac_cv_target
1161 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1162 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1163 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1164
1165 # The aliases save the names the user supplied, while $host etc.
1166 # will get canonicalized.
1167 test -n "$target_alias" &&
1168   test "$program_prefix$program_suffix$program_transform_name" = \
1169     NONENONEs,x,x, &&
1170   program_prefix=${target_alias}-
1171         system_name="$host_os"
1172 else
1173         system_name="`(uname -s -r) 2>/dev/null`"
1174         if test -z "$system_name" ; then
1175                 system_name="`(hostname) 2>/dev/null`"
1176         fi
1177 fi
1178 test -n "$system_name" &&
1179 cat >>confdefs.h <<EOF
1180 #define SYSTEM_NAME "$system_name"
1181 EOF
1182
1183 if test "${cf_cv_system_name+set}" = set; then
1184   echo $ECHO_N "(cached) $ECHO_C" >&6
1185 else
1186   cf_cv_system_name="$system_name"
1187 fi
1188
1189 test -z "$system_name" && system_name="$cf_cv_system_name"
1190 test -n "$cf_cv_system_name" && echo "$as_me:1190: result: Configuring for $cf_cv_system_name" >&5
1191 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1192
1193 if test ".$system_name" != ".$cf_cv_system_name" ; then
1194         echo "$as_me:1194: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1195 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1196         { { echo "$as_me:1196: error: \"Please remove config.cache and try again.\"" >&5
1197 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1198    { (exit 1); exit 1; }; }
1199 fi
1200
1201 # Check whether --with-system-type or --without-system-type was given.
1202 if test "${with_system_type+set}" = set; then
1203   withval="$with_system_type"
1204   { echo "$as_me:1204: WARNING: overriding system type to $withval" >&5
1205 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1206         cf_cv_system_name=$withval
1207         host_os=$withval
1208
1209 fi;
1210
1211 ###     Save the given $CFLAGS to allow user-override.
1212 cf_user_CFLAGS="$CFLAGS"
1213
1214 ###     Default install-location
1215 for ac_prog in ggrep grep
1216 do
1217   # Extract the first word of "$ac_prog", so it can be a program name with args.
1218 set dummy $ac_prog; ac_word=$2
1219 echo "$as_me:1219: checking for $ac_word" >&5
1220 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1221 if test "${ac_cv_prog_GREP+set}" = set; then
1222   echo $ECHO_N "(cached) $ECHO_C" >&6
1223 else
1224   if test -n "$GREP"; then
1225   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1226 else
1227   ac_save_IFS=$IFS; IFS=$ac_path_separator
1228 ac_dummy="$PATH"
1229 for ac_dir in $ac_dummy; do
1230   IFS=$ac_save_IFS
1231   test -z "$ac_dir" && ac_dir=.
1232   $as_executable_p "$ac_dir/$ac_word" || continue
1233 ac_cv_prog_GREP="$ac_prog"
1234 echo "$as_me:1234: found $ac_dir/$ac_word" >&5
1235 break
1236 done
1237
1238 fi
1239 fi
1240 GREP=$ac_cv_prog_GREP
1241 if test -n "$GREP"; then
1242   echo "$as_me:1242: result: $GREP" >&5
1243 echo "${ECHO_T}$GREP" >&6
1244 else
1245   echo "$as_me:1245: result: no" >&5
1246 echo "${ECHO_T}no" >&6
1247 fi
1248
1249   test -n "$GREP" && break
1250 done
1251 test -n "$GREP" || GREP=": "
1252
1253 echo "$as_me:1253: checking for fgrep" >&5
1254 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1255 if test "${ac_cv_path_FGREP+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1259    then ac_cv_path_FGREP="$GREP -F"
1260    else
1261      for ac_prog in gfgrep fgrep
1262 do
1263   # Extract the first word of "$ac_prog", so it can be a program name with args.
1264 set dummy $ac_prog; ac_word=$2
1265 echo "$as_me:1265: checking for $ac_word" >&5
1266 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1267 if test "${ac_cv_path_FGREP+set}" = set; then
1268   echo $ECHO_N "(cached) $ECHO_C" >&6
1269 else
1270   case $FGREP in
1271   [\\/]* | ?:[\\/]*)
1272   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1273   ;;
1274   *)
1275   ac_save_IFS=$IFS; IFS=$ac_path_separator
1276 ac_dummy="$PATH"
1277 for ac_dir in $ac_dummy; do
1278   IFS=$ac_save_IFS
1279   test -z "$ac_dir" && ac_dir=.
1280   if $as_executable_p "$ac_dir/$ac_word"; then
1281    ac_cv_path_FGREP="$ac_dir/$ac_word"
1282    echo "$as_me:1282: found $ac_dir/$ac_word" >&5
1283    break
1284 fi
1285 done
1286
1287   ;;
1288 esac
1289 fi
1290 FGREP=$ac_cv_path_FGREP
1291
1292 if test -n "$FGREP"; then
1293   echo "$as_me:1293: result: $FGREP" >&5
1294 echo "${ECHO_T}$FGREP" >&6
1295 else
1296   echo "$as_me:1296: result: no" >&5
1297 echo "${ECHO_T}no" >&6
1298 fi
1299
1300   test -n "$FGREP" && break
1301 done
1302 test -n "$FGREP" || FGREP=": "
1303
1304      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1304: error: cannot find workable fgrep" >&5
1305 echo "$as_me: error: cannot find workable fgrep" >&2;}
1306    { (exit 1); exit 1; }; }
1307    fi
1308 fi
1309 echo "$as_me:1309: result: $ac_cv_path_FGREP" >&5
1310 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1311  FGREP="$ac_cv_path_FGREP"
1312
1313 echo "$as_me:1313: checking for prefix" >&5
1314 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1315 if test "x$prefix" = "xNONE" ; then
1316         case "$cf_cv_system_name" in
1317                 # non-vendor systems don't have a conflict
1318         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1319                 prefix=/usr
1320                 ;;
1321         (*)     prefix=$ac_default_prefix
1322                 ;;
1323         esac
1324 fi
1325 echo "$as_me:1325: result: $prefix" >&5
1326 echo "${ECHO_T}$prefix" >&6
1327
1328 if test "x$prefix" = "xNONE" ; then
1329 echo "$as_me:1329: checking for default include-directory" >&5
1330 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1331 test -n "$verbose" && echo 1>&6
1332 for cf_symbol in \
1333         "$includedir" \
1334         "$includedir/ncurses" \
1335         "$prefix/include" \
1336         "$prefix/include/ncurses" \
1337         /usr/local/include \
1338         /usr/local/include/ncurses \
1339         /usr/include \
1340         /usr/include/ncurses
1341 do
1342         cf_dir=`eval echo "$cf_symbol"`
1343         if test -f "$cf_dir/curses.h" ; then
1344         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1345                 includedir="$cf_symbol"
1346                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1347                 break
1348         fi
1349         fi
1350         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1351 done
1352 echo "$as_me:1352: result: $includedir" >&5
1353 echo "${ECHO_T}$includedir" >&6
1354 fi
1355
1356 ###     Checks for programs.
1357
1358 ac_ext=c
1359 ac_cpp='$CPP $CPPFLAGS'
1360 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1361 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1362 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1363 ac_main_return="return"
1364 if test -n "$ac_tool_prefix"; then
1365   for ac_prog in gnatgcc gcc cc
1366   do
1367     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1368 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1369 echo "$as_me:1369: checking for $ac_word" >&5
1370 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1371 if test "${ac_cv_prog_CC+set}" = set; then
1372   echo $ECHO_N "(cached) $ECHO_C" >&6
1373 else
1374   if test -n "$CC"; then
1375   ac_cv_prog_CC="$CC" # Let the user override the test.
1376 else
1377   ac_save_IFS=$IFS; IFS=$ac_path_separator
1378 ac_dummy="$PATH"
1379 for ac_dir in $ac_dummy; do
1380   IFS=$ac_save_IFS
1381   test -z "$ac_dir" && ac_dir=.
1382   $as_executable_p "$ac_dir/$ac_word" || continue
1383 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1384 echo "$as_me:1384: found $ac_dir/$ac_word" >&5
1385 break
1386 done
1387
1388 fi
1389 fi
1390 CC=$ac_cv_prog_CC
1391 if test -n "$CC"; then
1392   echo "$as_me:1392: result: $CC" >&5
1393 echo "${ECHO_T}$CC" >&6
1394 else
1395   echo "$as_me:1395: result: no" >&5
1396 echo "${ECHO_T}no" >&6
1397 fi
1398
1399     test -n "$CC" && break
1400   done
1401 fi
1402 if test -z "$CC"; then
1403   ac_ct_CC=$CC
1404   for ac_prog in gnatgcc gcc cc
1405 do
1406   # Extract the first word of "$ac_prog", so it can be a program name with args.
1407 set dummy $ac_prog; ac_word=$2
1408 echo "$as_me:1408: checking for $ac_word" >&5
1409 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1410 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1411   echo $ECHO_N "(cached) $ECHO_C" >&6
1412 else
1413   if test -n "$ac_ct_CC"; then
1414   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1415 else
1416   ac_save_IFS=$IFS; IFS=$ac_path_separator
1417 ac_dummy="$PATH"
1418 for ac_dir in $ac_dummy; do
1419   IFS=$ac_save_IFS
1420   test -z "$ac_dir" && ac_dir=.
1421   $as_executable_p "$ac_dir/$ac_word" || continue
1422 ac_cv_prog_ac_ct_CC="$ac_prog"
1423 echo "$as_me:1423: found $ac_dir/$ac_word" >&5
1424 break
1425 done
1426
1427 fi
1428 fi
1429 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1430 if test -n "$ac_ct_CC"; then
1431   echo "$as_me:1431: result: $ac_ct_CC" >&5
1432 echo "${ECHO_T}$ac_ct_CC" >&6
1433 else
1434   echo "$as_me:1434: result: no" >&5
1435 echo "${ECHO_T}no" >&6
1436 fi
1437
1438   test -n "$ac_ct_CC" && break
1439 done
1440
1441   CC=$ac_ct_CC
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo "$2"`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit "$ac_status"); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit "$ac_status"); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit "$ac_status"); }
1467
1468 cat >"conftest.$ac_ext" <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit "$ac_status"); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat "conftest.$ac_ext" >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit "$ac_status"); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe "conftest$ac_cv_exeext"
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit "$ac_status"); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f "conftest$ac_cv_exeext"
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f "conftest.$ac_ext"
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >"conftest.$ac_ext" <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit "$ac_status"); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat "conftest.$ac_ext" >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >"conftest.$ac_ext" <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f "conftest.$ac_objext"
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit "$ac_status"); } &&
1664          { ac_try='test -s "conftest.$ac_objext"'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit "$ac_status"); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat "conftest.$ac_ext" >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >"conftest.$ac_ext" <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f "conftest.$ac_objext"
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit "$ac_status"); } &&
1709          { ac_try='test -s "conftest.$ac_objext"'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit "$ac_status"); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat "conftest.$ac_ext" >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >"conftest.$ac_ext" <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f "conftest.$ac_objext"
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit "$ac_status"); } &&
1755          { ac_try='test -s "conftest.$ac_objext"'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit "$ac_status"); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >"conftest.$ac_ext" <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f "conftest.$ac_objext"
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit "$ac_status"); } &&
1789          { ac_try='test -s "conftest.$ac_objext"'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit "$ac_status"); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat "conftest.$ac_ext" >&5
1799 continue
1800 fi
1801 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1802   cat >"conftest.$ac_ext" <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f "conftest.$ac_objext"
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit "$ac_status"); } &&
1820          { ac_try='test -s "conftest.$ac_objext"'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit "$ac_status"); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat "conftest.$ac_ext" >&5
1830 fi
1831 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo "$ac_declaration"    >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat "conftest.$ac_ext" >&5
1843 fi
1844 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1848 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return="return"
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         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.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case "$host_os" in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >"conftest.$ac_ext" <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f "conftest.$ac_objext"
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit "$ac_status"); } &&
1894          { ac_try='test -s "conftest.$ac_objext"'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit "$ac_status"); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat "conftest.$ac_ext" >&5
1906 fi
1907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         cat >"conftest.$ac_ext" <<_ACEOF
1922 #line 1922 "configure"
1923 #include "confdefs.h"
1924
1925 int
1926 main (void)
1927 {
1928
1929 #ifdef __clang__
1930 #else
1931 make an error
1932 #endif
1933
1934   ;
1935   return 0;
1936 }
1937 _ACEOF
1938 rm -f "conftest.$ac_objext"
1939 if { (eval echo "$as_me:1939: \"$ac_compile\"") >&5
1940   (eval $ac_compile) 2>&5
1941   ac_status=$?
1942   echo "$as_me:1942: \$? = $ac_status" >&5
1943   (exit "$ac_status"); } &&
1944          { ac_try='test -s "conftest.$ac_objext"'
1945   { (eval echo "$as_me:1945: \"$ac_try\"") >&5
1946   (eval $ac_try) 2>&5
1947   ac_status=$?
1948   echo "$as_me:1948: \$? = $ac_status" >&5
1949   (exit "$ac_status"); }; }; then
1950   CLANG_COMPILER=yes
1951
1952 else
1953   echo "$as_me: failed program was:" >&5
1954 cat "conftest.$ac_ext" >&5
1955 fi
1956 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1957         CFLAGS="$cf_save_CFLAGS"
1958         echo "$as_me:1958: result: $CLANG_COMPILER" >&5
1959 echo "${ECHO_T}$CLANG_COMPILER" >&6
1960 fi
1961
1962 CLANG_VERSION=none
1963
1964 if test "x$CLANG_COMPILER" = "xyes" ; then
1965         case "$CC" in
1966         (c[1-9][0-9]|*/c[1-9][0-9])
1967                 { echo "$as_me:1967: WARNING: replacing broken compiler alias $CC" >&5
1968 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1969                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1970                 CC=clang
1971                 ;;
1972         esac
1973
1974         echo "$as_me:1974: checking version of $CC" >&5
1975 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1976         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1977         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1978         echo "$as_me:1978: result: $CLANG_VERSION" >&5
1979 echo "${ECHO_T}$CLANG_VERSION" >&6
1980
1981         for cf_clang_opt in \
1982                 -Qunused-arguments \
1983                 -Wno-error=implicit-function-declaration
1984         do
1985                 echo "$as_me:1985: checking if option $cf_clang_opt works" >&5
1986 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1987                 cf_save_CFLAGS="$CFLAGS"
1988                 CFLAGS="$CFLAGS $cf_clang_opt"
1989                 cat >"conftest.$ac_ext" <<_ACEOF
1990 #line 1990 "configure"
1991 #include "confdefs.h"
1992
1993                         #include <stdio.h>
1994 int
1995 main (void)
1996 {
1997
1998                         printf("hello!\\n");
1999   ;
2000   return 0;
2001 }
2002 _ACEOF
2003 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2004 if { (eval echo "$as_me:2004: \"$ac_link\"") >&5
2005   (eval $ac_link) 2>&5
2006   ac_status=$?
2007   echo "$as_me:2007: \$? = $ac_status" >&5
2008   (exit "$ac_status"); } &&
2009          { ac_try='test -s "conftest$ac_exeext"'
2010   { (eval echo "$as_me:2010: \"$ac_try\"") >&5
2011   (eval $ac_try) 2>&5
2012   ac_status=$?
2013   echo "$as_me:2013: \$? = $ac_status" >&5
2014   (exit "$ac_status"); }; }; then
2015
2016                         cf_clang_optok=yes
2017 else
2018   echo "$as_me: failed program was:" >&5
2019 cat "conftest.$ac_ext" >&5
2020
2021                         cf_clang_optok=no
2022 fi
2023 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2024                 echo "$as_me:2024: result: $cf_clang_optok" >&5
2025 echo "${ECHO_T}$cf_clang_optok" >&6
2026                 CFLAGS="$cf_save_CFLAGS"
2027                 if test "$cf_clang_optok" = yes; then
2028                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2029
2030 echo "${as_me:-configure}:2030: testing adding option $cf_clang_opt ..." 1>&5
2031
2032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2033         CFLAGS="${CFLAGS}$cf_clang_opt"
2034
2035                 fi
2036         done
2037 fi
2038
2039 echo "$as_me:2039: checking for $CC option to accept ANSI C" >&5
2040 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2041 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2042   echo $ECHO_N "(cached) $ECHO_C" >&6
2043 else
2044   ac_cv_prog_cc_stdc=no
2045 ac_save_CC=$CC
2046 cat >"conftest.$ac_ext" <<_ACEOF
2047 #line 2047 "configure"
2048 #include "confdefs.h"
2049 #include <stdarg.h>
2050 #include <stdio.h>
2051 #include <sys/types.h>
2052 #include <sys/stat.h>
2053 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2054 struct buf { int x; };
2055 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2056 static char *e (char **p, int i)
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         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'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 # if $PKG_CONFIG_LIBDIR is set, try to use that
3283 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,'`
3284
3285 # if the option is used, let that override.  otherwise default to "libdir"
3286
3287 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3288 if test "${with_pkg_config_libdir+set}" = set; then
3289   withval="$with_pkg_config_libdir"
3290   cf_search_path=$withval
3291 else
3292   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3293 fi;
3294
3295 case "x$cf_search_path" in
3296 (xlibdir)
3297         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3298         echo "$as_me:3298: result: $PKG_CONFIG_LIBDIR" >&5
3299 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3300         cf_search_path=
3301         ;;
3302 (x)
3303         ;;
3304 (x/*\ *)
3305         PKG_CONFIG_LIBDIR=
3306         ;;
3307 (x/*)
3308         PKG_CONFIG_LIBDIR="$cf_search_path"
3309         echo "$as_me:3309: result: $PKG_CONFIG_LIBDIR" >&5
3310 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3311         cf_search_path=
3312         ;;
3313 (xyes|xauto)
3314         echo "$as_me:3314: result: auto" >&5
3315 echo "${ECHO_T}auto" >&6
3316         cf_search_path=
3317         # Look for the library directory using the same prefix as the executable
3318         echo "$as_me:3318: checking for search-list" >&5
3319 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3320         if test "x$PKG_CONFIG" != xnone
3321         then
3322                 # works for pkg-config since version 0.24 (2009)
3323                 # works for pkgconf since version 0.8.3 (2012)
3324                 for cf_pkg_program in \
3325                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3326                         pkg-config \
3327                         pkgconf
3328                 do
3329                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3330                         test -n "$cf_search_path" && break
3331                 done
3332
3333                 # works for pkg-config since import in 2005 of original 2001 HP code.
3334                 test -z "$cf_search_path" && \
3335                 cf_search_path=`
3336                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3337 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3338         sub(\"^[^']*'\",\"\"); \
3339         sub(\"'.*\",\"\"); \
3340         printf \" %s\", \\$0; } \
3341 { next; } \
3342 "`
3343         fi
3344
3345         echo "$as_me:3345: result: $cf_search_path" >&5
3346 echo "${ECHO_T}$cf_search_path" >&6
3347         ;;
3348 (*)
3349         { { echo "$as_me:3349: error: Unexpected option value: $cf_search_path" >&5
3350 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3351    { (exit 1); exit 1; }; }
3352         ;;
3353 esac
3354
3355 if test -n "$cf_search_path"
3356 then
3357         echo "$as_me:3357: checking for first directory" >&5
3358 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3359         cf_pkg_config_path=none
3360         for cf_config in $cf_search_path
3361         do
3362                 if test -d "$cf_config"
3363                 then
3364                         cf_pkg_config_path=$cf_config
3365                         break
3366                 fi
3367         done
3368         echo "$as_me:3368: result: $cf_pkg_config_path" >&5
3369 echo "${ECHO_T}$cf_pkg_config_path" >&6
3370
3371         if test "x$cf_pkg_config_path" != xnone ; then
3372                 # limit this to the first directory found
3373                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3374         fi
3375
3376         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3377         then
3378                 echo "$as_me:3378: checking for workaround" >&5
3379 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3380                 if test "$prefix" = "NONE" ; then
3381                         cf_prefix="$ac_default_prefix"
3382                 else
3383                         cf_prefix="$prefix"
3384                 fi
3385                 eval cf_libdir=$libdir
3386                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3387                 cf_backup=
3388                 for cf_config in $cf_search_path
3389                 do
3390                         case $cf_config in
3391                         $cf_libdir/pkgconfig)
3392                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3393                                 break
3394                                 ;;
3395                         *)
3396                                 test -z "$cf_backup" && cf_backup=$cf_config
3397                                 ;;
3398                         esac
3399                 done
3400                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3401                 echo "$as_me:3401: result: $PKG_CONFIG_LIBDIR" >&5
3402 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3403         fi
3404 fi
3405
3406 echo "$as_me:3406: checking if you want to build test-programs" >&5
3407 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3408
3409 # Check whether --with-tests or --without-tests was given.
3410 if test "${with_tests+set}" = set; then
3411   withval="$with_tests"
3412   cf_with_tests=$withval
3413 else
3414   cf_with_tests=yes
3415 fi;
3416 echo "$as_me:3416: result: $cf_with_tests" >&5
3417 echo "${ECHO_T}$cf_with_tests" >&6
3418
3419 echo "$as_me:3419: checking if we should assume mixed-case filenames" >&5
3420 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3421
3422 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3423 if test "${enable_mixed_case+set}" = set; then
3424   enableval="$enable_mixed_case"
3425   enable_mixedcase=$enableval
3426 else
3427   enable_mixedcase=auto
3428 fi;
3429 echo "$as_me:3429: result: $enable_mixedcase" >&5
3430 echo "${ECHO_T}$enable_mixedcase" >&6
3431 if test "$enable_mixedcase" = "auto" ; then
3432
3433 echo "$as_me:3433: checking if filesystem supports mixed-case filenames" >&5
3434 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3435 if test "${cf_cv_mixedcase+set}" = set; then
3436   echo $ECHO_N "(cached) $ECHO_C" >&6
3437 else
3438
3439 if test "$cross_compiling" = yes ; then
3440         case "$target_alias" in
3441         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3442                 cf_cv_mixedcase=no
3443                 ;;
3444         (*)
3445                 cf_cv_mixedcase=yes
3446                 ;;
3447         esac
3448 else
3449         rm -f conftest CONFTEST
3450         echo test >conftest
3451         if test -f CONFTEST ; then
3452                 cf_cv_mixedcase=no
3453         else
3454                 cf_cv_mixedcase=yes
3455         fi
3456         rm -f conftest CONFTEST
3457 fi
3458
3459 fi
3460 echo "$as_me:3460: result: $cf_cv_mixedcase" >&5
3461 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3462 test "$cf_cv_mixedcase" = yes &&
3463 cat >>confdefs.h <<\EOF
3464 #define MIXEDCASE_FILENAMES 1
3465 EOF
3466
3467 else
3468         cf_cv_mixedcase=$enable_mixedcase
3469         if test "$enable_mixedcase" = "yes" ; then
3470                 cat >>confdefs.h <<\EOF
3471 #define MIXEDCASE_FILENAMES 1
3472 EOF
3473
3474         fi
3475 fi
3476
3477 # do this after mixed-case option (tags/TAGS is not as important as tic).
3478 echo "$as_me:3478: checking whether ${MAKE-make} sets \${MAKE}" >&5
3479 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3480 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3481 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3482   echo $ECHO_N "(cached) $ECHO_C" >&6
3483 else
3484   cat >conftest.make <<\EOF
3485 all:
3486         @echo 'ac_maketemp="${MAKE}"'
3487 EOF
3488 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3489 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3490 if test -n "$ac_maketemp"; then
3491   eval ac_cv_prog_make_${ac_make}_set=yes
3492 else
3493   eval ac_cv_prog_make_${ac_make}_set=no
3494 fi
3495 rm -f conftest.make
3496 fi
3497 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3498   echo "$as_me:3498: result: yes" >&5
3499 echo "${ECHO_T}yes" >&6
3500   SET_MAKE=
3501 else
3502   echo "$as_me:3502: result: no" >&5
3503 echo "${ECHO_T}no" >&6
3504   SET_MAKE="MAKE=${MAKE-make}"
3505 fi
3506
3507 echo "$as_me:3507: checking for \".PHONY\" make-support" >&5
3508 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3509 if test "${cf_cv_make_PHONY+set}" = set; then
3510   echo $ECHO_N "(cached) $ECHO_C" >&6
3511 else
3512
3513         rm -rf conftest*
3514         (
3515                 mkdir conftest || exit 1
3516                 cd conftest
3517                 cat >makefile <<'CF_EOF'
3518 .PHONY: always
3519 DATA=0
3520 always: always.out
3521         @echo "** making $@ $(DATA)"
3522 once: once.out
3523         @echo "** making $@ $(DATA)"
3524 always.out:
3525         @echo "** making $@ $(DATA)"
3526         echo $(DATA) > $@
3527 once.out:
3528         @echo "** making $@ $(DATA)"
3529         echo $(DATA) > $@
3530 CF_EOF
3531                 for cf_data in 1 2 3
3532                 do
3533                         ${MAKE:-make} always DATA=$cf_data
3534                         ${MAKE:-make} once   DATA=$cf_data
3535                         ${MAKE:-make} -t always once
3536                         if test -f always ; then
3537                                 echo "no (case 1)" > ../conftest.tmp
3538                         elif test ! -f always.out ; then
3539                                 echo "no (case 2)" > ../conftest.tmp
3540                         elif test ! -f once.out ; then
3541                                 echo "no (case 3)" > ../conftest.tmp
3542                         elif ! cmp -s always.out once.out ; then
3543                                 echo "no (case 4)" > ../conftest.tmp
3544                                 diff always.out once.out
3545                         else
3546                                 cf_check="`cat always.out`"
3547                                 if test "x$cf_check" != "x$cf_data" ; then
3548                                         echo "no (case 5)" > ../conftest.tmp
3549                                 else
3550                                         echo yes > ../conftest.tmp
3551                                         rm -f ./*.out
3552                                         continue
3553                                 fi
3554                         fi
3555                         break
3556                 done
3557         ) >&5 2>&1
3558         cf_cv_make_PHONY="`cat conftest.tmp`"
3559         rm -rf conftest*
3560
3561 fi
3562 echo "$as_me:3562: result: $cf_cv_make_PHONY" >&5
3563 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3564 MAKE_NO_PHONY="#"
3565 MAKE_PHONY="#"
3566 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3567 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3568
3569 for ac_prog in exctags ctags
3570 do
3571   # Extract the first word of "$ac_prog", so it can be a program name with args.
3572 set dummy $ac_prog; ac_word=$2
3573 echo "$as_me:3573: checking for $ac_word" >&5
3574 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3575 if test "${ac_cv_prog_CTAGS+set}" = set; then
3576   echo $ECHO_N "(cached) $ECHO_C" >&6
3577 else
3578   if test -n "$CTAGS"; then
3579   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3580 else
3581   ac_save_IFS=$IFS; IFS=$ac_path_separator
3582 ac_dummy="$PATH"
3583 for ac_dir in $ac_dummy; do
3584   IFS=$ac_save_IFS
3585   test -z "$ac_dir" && ac_dir=.
3586   $as_executable_p "$ac_dir/$ac_word" || continue
3587 ac_cv_prog_CTAGS="$ac_prog"
3588 echo "$as_me:3588: found $ac_dir/$ac_word" >&5
3589 break
3590 done
3591
3592 fi
3593 fi
3594 CTAGS=$ac_cv_prog_CTAGS
3595 if test -n "$CTAGS"; then
3596   echo "$as_me:3596: result: $CTAGS" >&5
3597 echo "${ECHO_T}$CTAGS" >&6
3598 else
3599   echo "$as_me:3599: result: no" >&5
3600 echo "${ECHO_T}no" >&6
3601 fi
3602
3603   test -n "$CTAGS" && break
3604 done
3605
3606 for ac_prog in exetags etags
3607 do
3608   # Extract the first word of "$ac_prog", so it can be a program name with args.
3609 set dummy $ac_prog; ac_word=$2
3610 echo "$as_me:3610: checking for $ac_word" >&5
3611 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3612 if test "${ac_cv_prog_ETAGS+set}" = set; then
3613   echo $ECHO_N "(cached) $ECHO_C" >&6
3614 else
3615   if test -n "$ETAGS"; then
3616   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3617 else
3618   ac_save_IFS=$IFS; IFS=$ac_path_separator
3619 ac_dummy="$PATH"
3620 for ac_dir in $ac_dummy; do
3621   IFS=$ac_save_IFS
3622   test -z "$ac_dir" && ac_dir=.
3623   $as_executable_p "$ac_dir/$ac_word" || continue
3624 ac_cv_prog_ETAGS="$ac_prog"
3625 echo "$as_me:3625: found $ac_dir/$ac_word" >&5
3626 break
3627 done
3628
3629 fi
3630 fi
3631 ETAGS=$ac_cv_prog_ETAGS
3632 if test -n "$ETAGS"; then
3633   echo "$as_me:3633: result: $ETAGS" >&5
3634 echo "${ECHO_T}$ETAGS" >&6
3635 else
3636   echo "$as_me:3636: result: no" >&5
3637 echo "${ECHO_T}no" >&6
3638 fi
3639
3640   test -n "$ETAGS" && break
3641 done
3642
3643 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3644 set dummy ${CTAGS:-ctags}; ac_word=$2
3645 echo "$as_me:3645: checking for $ac_word" >&5
3646 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3647 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3648   echo $ECHO_N "(cached) $ECHO_C" >&6
3649 else
3650   if test -n "$MAKE_LOWER_TAGS"; then
3651   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3652 else
3653   ac_save_IFS=$IFS; IFS=$ac_path_separator
3654 ac_dummy="$PATH"
3655 for ac_dir in $ac_dummy; do
3656   IFS=$ac_save_IFS
3657   test -z "$ac_dir" && ac_dir=.
3658   $as_executable_p "$ac_dir/$ac_word" || continue
3659 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3660 echo "$as_me:3660: found $ac_dir/$ac_word" >&5
3661 break
3662 done
3663
3664   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3665 fi
3666 fi
3667 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3668 if test -n "$MAKE_LOWER_TAGS"; then
3669   echo "$as_me:3669: result: $MAKE_LOWER_TAGS" >&5
3670 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3671 else
3672   echo "$as_me:3672: result: no" >&5
3673 echo "${ECHO_T}no" >&6
3674 fi
3675
3676 if test "$cf_cv_mixedcase" = yes ; then
3677         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3678 set dummy ${ETAGS:-etags}; ac_word=$2
3679 echo "$as_me:3679: checking for $ac_word" >&5
3680 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3681 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3682   echo $ECHO_N "(cached) $ECHO_C" >&6
3683 else
3684   if test -n "$MAKE_UPPER_TAGS"; then
3685   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3686 else
3687   ac_save_IFS=$IFS; IFS=$ac_path_separator
3688 ac_dummy="$PATH"
3689 for ac_dir in $ac_dummy; do
3690   IFS=$ac_save_IFS
3691   test -z "$ac_dir" && ac_dir=.
3692   $as_executable_p "$ac_dir/$ac_word" || continue
3693 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3694 echo "$as_me:3694: found $ac_dir/$ac_word" >&5
3695 break
3696 done
3697
3698   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3699 fi
3700 fi
3701 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3702 if test -n "$MAKE_UPPER_TAGS"; then
3703   echo "$as_me:3703: result: $MAKE_UPPER_TAGS" >&5
3704 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3705 else
3706   echo "$as_me:3706: result: no" >&5
3707 echo "${ECHO_T}no" >&6
3708 fi
3709
3710 else
3711         MAKE_UPPER_TAGS=no
3712 fi
3713
3714 if test "$MAKE_UPPER_TAGS" = yes ; then
3715         MAKE_UPPER_TAGS=
3716 else
3717         MAKE_UPPER_TAGS="#"
3718 fi
3719
3720 if test "$MAKE_LOWER_TAGS" = yes ; then
3721         MAKE_LOWER_TAGS=
3722 else
3723         MAKE_LOWER_TAGS="#"
3724 fi
3725
3726 echo "$as_me:3726: checking for makeflags variable" >&5
3727 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3728 if test "${cf_cv_makeflags+set}" = set; then
3729   echo $ECHO_N "(cached) $ECHO_C" >&6
3730 else
3731
3732         cf_cv_makeflags=''
3733         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3734         do
3735                 cat >cf_makeflags.tmp <<CF_EOF
3736 SHELL = $SHELL
3737 all :
3738         @ echo '.$cf_option'
3739 CF_EOF
3740                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3741                 case "$cf_result" in
3742                 (.*k|.*kw)
3743                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3744                         case "$cf_result" in
3745                         (.*CC=*)        cf_cv_makeflags=
3746                                 ;;
3747                         (*)     cf_cv_makeflags=$cf_option
3748                                 ;;
3749                         esac
3750                         break
3751                         ;;
3752                 (.-)
3753                         ;;
3754                 (*)
3755
3756 echo "${as_me:-configure}:3756: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3757
3758                         ;;
3759                 esac
3760         done
3761         rm -f cf_makeflags.tmp
3762
3763 fi
3764 echo "$as_me:3764: result: $cf_cv_makeflags" >&5
3765 echo "${ECHO_T}$cf_cv_makeflags" >&6
3766
3767 if test -n "$ac_tool_prefix"; then
3768   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3769 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3770 echo "$as_me:3770: checking for $ac_word" >&5
3771 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3772 if test "${ac_cv_prog_RANLIB+set}" = set; then
3773   echo $ECHO_N "(cached) $ECHO_C" >&6
3774 else
3775   if test -n "$RANLIB"; then
3776   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3777 else
3778   ac_save_IFS=$IFS; IFS=$ac_path_separator
3779 ac_dummy="$PATH"
3780 for ac_dir in $ac_dummy; do
3781   IFS=$ac_save_IFS
3782   test -z "$ac_dir" && ac_dir=.
3783   $as_executable_p "$ac_dir/$ac_word" || continue
3784 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3785 echo "$as_me:3785: found $ac_dir/$ac_word" >&5
3786 break
3787 done
3788
3789 fi
3790 fi
3791 RANLIB=$ac_cv_prog_RANLIB
3792 if test -n "$RANLIB"; then
3793   echo "$as_me:3793: result: $RANLIB" >&5
3794 echo "${ECHO_T}$RANLIB" >&6
3795 else
3796   echo "$as_me:3796: result: no" >&5
3797 echo "${ECHO_T}no" >&6
3798 fi
3799
3800 fi
3801 if test -z "$ac_cv_prog_RANLIB"; then
3802   ac_ct_RANLIB=$RANLIB
3803   # Extract the first word of "ranlib", so it can be a program name with args.
3804 set dummy ranlib; ac_word=$2
3805 echo "$as_me:3805: checking for $ac_word" >&5
3806 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3807 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3808   echo $ECHO_N "(cached) $ECHO_C" >&6
3809 else
3810   if test -n "$ac_ct_RANLIB"; then
3811   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3812 else
3813   ac_save_IFS=$IFS; IFS=$ac_path_separator
3814 ac_dummy="$PATH"
3815 for ac_dir in $ac_dummy; do
3816   IFS=$ac_save_IFS
3817   test -z "$ac_dir" && ac_dir=.
3818   $as_executable_p "$ac_dir/$ac_word" || continue
3819 ac_cv_prog_ac_ct_RANLIB="ranlib"
3820 echo "$as_me:3820: found $ac_dir/$ac_word" >&5
3821 break
3822 done
3823
3824   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3825 fi
3826 fi
3827 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3828 if test -n "$ac_ct_RANLIB"; then
3829   echo "$as_me:3829: result: $ac_ct_RANLIB" >&5
3830 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3831 else
3832   echo "$as_me:3832: result: no" >&5
3833 echo "${ECHO_T}no" >&6
3834 fi
3835
3836   RANLIB=$ac_ct_RANLIB
3837 else
3838   RANLIB="$ac_cv_prog_RANLIB"
3839 fi
3840
3841 if test -n "$ac_tool_prefix"; then
3842   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3843 set dummy ${ac_tool_prefix}ld; ac_word=$2
3844 echo "$as_me:3844: checking for $ac_word" >&5
3845 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3846 if test "${ac_cv_prog_LD+set}" = set; then
3847   echo $ECHO_N "(cached) $ECHO_C" >&6
3848 else
3849   if test -n "$LD"; then
3850   ac_cv_prog_LD="$LD" # Let the user override the test.
3851 else
3852   ac_save_IFS=$IFS; IFS=$ac_path_separator
3853 ac_dummy="$PATH"
3854 for ac_dir in $ac_dummy; do
3855   IFS=$ac_save_IFS
3856   test -z "$ac_dir" && ac_dir=.
3857   $as_executable_p "$ac_dir/$ac_word" || continue
3858 ac_cv_prog_LD="${ac_tool_prefix}ld"
3859 echo "$as_me:3859: found $ac_dir/$ac_word" >&5
3860 break
3861 done
3862
3863 fi
3864 fi
3865 LD=$ac_cv_prog_LD
3866 if test -n "$LD"; then
3867   echo "$as_me:3867: result: $LD" >&5
3868 echo "${ECHO_T}$LD" >&6
3869 else
3870   echo "$as_me:3870: result: no" >&5
3871 echo "${ECHO_T}no" >&6
3872 fi
3873
3874 fi
3875 if test -z "$ac_cv_prog_LD"; then
3876   ac_ct_LD=$LD
3877   # Extract the first word of "ld", so it can be a program name with args.
3878 set dummy ld; ac_word=$2
3879 echo "$as_me:3879: checking for $ac_word" >&5
3880 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3881 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3882   echo $ECHO_N "(cached) $ECHO_C" >&6
3883 else
3884   if test -n "$ac_ct_LD"; then
3885   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3886 else
3887   ac_save_IFS=$IFS; IFS=$ac_path_separator
3888 ac_dummy="$PATH"
3889 for ac_dir in $ac_dummy; do
3890   IFS=$ac_save_IFS
3891   test -z "$ac_dir" && ac_dir=.
3892   $as_executable_p "$ac_dir/$ac_word" || continue
3893 ac_cv_prog_ac_ct_LD="ld"
3894 echo "$as_me:3894: found $ac_dir/$ac_word" >&5
3895 break
3896 done
3897
3898   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3899 fi
3900 fi
3901 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3902 if test -n "$ac_ct_LD"; then
3903   echo "$as_me:3903: result: $ac_ct_LD" >&5
3904 echo "${ECHO_T}$ac_ct_LD" >&6
3905 else
3906   echo "$as_me:3906: result: no" >&5
3907 echo "${ECHO_T}no" >&6
3908 fi
3909
3910   LD=$ac_ct_LD
3911 else
3912   LD="$ac_cv_prog_LD"
3913 fi
3914
3915 if test -n "$ac_tool_prefix"; then
3916   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3917 set dummy ${ac_tool_prefix}ar; ac_word=$2
3918 echo "$as_me:3918: checking for $ac_word" >&5
3919 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3920 if test "${ac_cv_prog_AR+set}" = set; then
3921   echo $ECHO_N "(cached) $ECHO_C" >&6
3922 else
3923   if test -n "$AR"; then
3924   ac_cv_prog_AR="$AR" # Let the user override the test.
3925 else
3926   ac_save_IFS=$IFS; IFS=$ac_path_separator
3927 ac_dummy="$PATH"
3928 for ac_dir in $ac_dummy; do
3929   IFS=$ac_save_IFS
3930   test -z "$ac_dir" && ac_dir=.
3931   $as_executable_p "$ac_dir/$ac_word" || continue
3932 ac_cv_prog_AR="${ac_tool_prefix}ar"
3933 echo "$as_me:3933: found $ac_dir/$ac_word" >&5
3934 break
3935 done
3936
3937 fi
3938 fi
3939 AR=$ac_cv_prog_AR
3940 if test -n "$AR"; then
3941   echo "$as_me:3941: result: $AR" >&5
3942 echo "${ECHO_T}$AR" >&6
3943 else
3944   echo "$as_me:3944: result: no" >&5
3945 echo "${ECHO_T}no" >&6
3946 fi
3947
3948 fi
3949 if test -z "$ac_cv_prog_AR"; then
3950   ac_ct_AR=$AR
3951   # Extract the first word of "ar", so it can be a program name with args.
3952 set dummy ar; ac_word=$2
3953 echo "$as_me:3953: checking for $ac_word" >&5
3954 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3955 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958   if test -n "$ac_ct_AR"; then
3959   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3960 else
3961   ac_save_IFS=$IFS; IFS=$ac_path_separator
3962 ac_dummy="$PATH"
3963 for ac_dir in $ac_dummy; do
3964   IFS=$ac_save_IFS
3965   test -z "$ac_dir" && ac_dir=.
3966   $as_executable_p "$ac_dir/$ac_word" || continue
3967 ac_cv_prog_ac_ct_AR="ar"
3968 echo "$as_me:3968: found $ac_dir/$ac_word" >&5
3969 break
3970 done
3971
3972   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3973 fi
3974 fi
3975 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3976 if test -n "$ac_ct_AR"; then
3977   echo "$as_me:3977: result: $ac_ct_AR" >&5
3978 echo "${ECHO_T}$ac_ct_AR" >&6
3979 else
3980   echo "$as_me:3980: result: no" >&5
3981 echo "${ECHO_T}no" >&6
3982 fi
3983
3984   AR=$ac_ct_AR
3985 else
3986   AR="$ac_cv_prog_AR"
3987 fi
3988
3989 if test -n "$ac_tool_prefix"; then
3990   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3991 set dummy ${ac_tool_prefix}ar; ac_word=$2
3992 echo "$as_me:3992: checking for $ac_word" >&5
3993 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3994 if test "${ac_cv_prog_AR+set}" = set; then
3995   echo $ECHO_N "(cached) $ECHO_C" >&6
3996 else
3997   if test -n "$AR"; then
3998   ac_cv_prog_AR="$AR" # Let the user override the test.
3999 else
4000   ac_save_IFS=$IFS; IFS=$ac_path_separator
4001 ac_dummy="$PATH"
4002 for ac_dir in $ac_dummy; do
4003   IFS=$ac_save_IFS
4004   test -z "$ac_dir" && ac_dir=.
4005   $as_executable_p "$ac_dir/$ac_word" || continue
4006 ac_cv_prog_AR="${ac_tool_prefix}ar"
4007 echo "$as_me:4007: found $ac_dir/$ac_word" >&5
4008 break
4009 done
4010
4011 fi
4012 fi
4013 AR=$ac_cv_prog_AR
4014 if test -n "$AR"; then
4015   echo "$as_me:4015: result: $AR" >&5
4016 echo "${ECHO_T}$AR" >&6
4017 else
4018   echo "$as_me:4018: result: no" >&5
4019 echo "${ECHO_T}no" >&6
4020 fi
4021
4022 fi
4023 if test -z "$ac_cv_prog_AR"; then
4024   ac_ct_AR=$AR
4025   # Extract the first word of "ar", so it can be a program name with args.
4026 set dummy ar; ac_word=$2
4027 echo "$as_me:4027: checking for $ac_word" >&5
4028 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4029 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4030   echo $ECHO_N "(cached) $ECHO_C" >&6
4031 else
4032   if test -n "$ac_ct_AR"; then
4033   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4034 else
4035   ac_save_IFS=$IFS; IFS=$ac_path_separator
4036 ac_dummy="$PATH"
4037 for ac_dir in $ac_dummy; do
4038   IFS=$ac_save_IFS
4039   test -z "$ac_dir" && ac_dir=.
4040   $as_executable_p "$ac_dir/$ac_word" || continue
4041 ac_cv_prog_ac_ct_AR="ar"
4042 echo "$as_me:4042: found $ac_dir/$ac_word" >&5
4043 break
4044 done
4045
4046   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4047 fi
4048 fi
4049 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4050 if test -n "$ac_ct_AR"; then
4051   echo "$as_me:4051: result: $ac_ct_AR" >&5
4052 echo "${ECHO_T}$ac_ct_AR" >&6
4053 else
4054   echo "$as_me:4054: result: no" >&5
4055 echo "${ECHO_T}no" >&6
4056 fi
4057
4058   AR=$ac_ct_AR
4059 else
4060   AR="$ac_cv_prog_AR"
4061 fi
4062
4063 echo "$as_me:4063: checking for options to update archives" >&5
4064 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4065 if test "${cf_cv_ar_flags+set}" = set; then
4066   echo $ECHO_N "(cached) $ECHO_C" >&6
4067 else
4068
4069         case "$cf_cv_system_name" in
4070         (*-msvc*)
4071                 cf_cv_ar_flags=''
4072                 cat >mk_static_lib.sh <<-EOF
4073                 #!$SHELL
4074                 MSVC_BIN="$AR"
4075                 out="\$1"
4076                 shift
4077                 exec \$MSVC_BIN -out:"\$out" \$@
4078                 EOF
4079                 chmod +x mk_static_lib.sh
4080                 AR=`pwd`/mk_static_lib.sh
4081                 ;;
4082         (*)
4083                 cf_cv_ar_flags=unknown
4084                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4085                 do
4086
4087                         # check if $ARFLAGS already contains this choice
4088                         if test "x$ARFLAGS" != "x" ; then
4089                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4090                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4091                                         cf_cv_ar_flags=
4092                                         break
4093                                 fi
4094                         fi
4095
4096                         rm -f "conftest.$ac_cv_objext"
4097                         rm -f conftest.a
4098
4099                         cat >"conftest.$ac_ext" <<EOF
4100 #line 4100 "configure"
4101 int     testdata[3] = { 123, 456, 789 };
4102 EOF
4103                         if { (eval echo "$as_me:4103: \"$ac_compile\"") >&5
4104   (eval $ac_compile) 2>&5
4105   ac_status=$?
4106   echo "$as_me:4106: \$? = $ac_status" >&5
4107   (exit "$ac_status"); } ; then
4108                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4109                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4110                                 if test -f conftest.a ; then
4111                                         cf_cv_ar_flags="$cf_ar_flags"
4112                                         break
4113                                 fi
4114                         else
4115                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4116
4117 echo "${as_me:-configure}:4117: testing cannot compile test-program ..." 1>&5
4118
4119                                 break
4120                         fi
4121                 done
4122                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4123                 ;;
4124         esac
4125
4126 fi
4127 echo "$as_me:4127: result: $cf_cv_ar_flags" >&5
4128 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4129
4130 if test -n "$ARFLAGS" ; then
4131         if test -n "$cf_cv_ar_flags" ; then
4132                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4133         fi
4134 else
4135         ARFLAGS=$cf_cv_ar_flags
4136 fi
4137
4138         echo "$as_me:4138: checking for PATH separator" >&5
4139 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4140         case "$cf_cv_system_name" in
4141         (os2*)  PATH_SEPARATOR=';'  ;;
4142         (*)     ${PATH_SEPARATOR:=':'}  ;;
4143         esac
4144
4145         echo "$as_me:4145: result: $PATH_SEPARATOR" >&5
4146 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4147
4148 echo "$as_me:4148: checking if you have specified an install-prefix" >&5
4149 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4150
4151 # Check whether --with-install-prefix or --without-install-prefix was given.
4152 if test "${with_install_prefix+set}" = set; then
4153   withval="$with_install_prefix"
4154   case "$withval" in
4155         (yes|no)
4156                 ;;
4157         (*)     DESTDIR="$withval"
4158                 ;;
4159         esac
4160 fi;
4161 echo "$as_me:4161: result: $DESTDIR" >&5
4162 echo "${ECHO_T}$DESTDIR" >&6
4163
4164 ###############################################################################
4165
4166 # If we're cross-compiling, allow the user to override the tools and their
4167 # options.  The configure script is oriented toward identifying the host
4168 # compiler, etc., but we need a build compiler to generate parts of the source.
4169
4170 if test "$cross_compiling" = yes ; then
4171
4172         # defaults that we might want to override
4173         : ${BUILD_CFLAGS:=''}
4174         : ${BUILD_CPPFLAGS:=''}
4175         : ${BUILD_LDFLAGS:=''}
4176         : ${BUILD_LIBS:=''}
4177         : ${BUILD_EXEEXT:='$x'}
4178         : ${BUILD_OBJEXT:='o'}
4179
4180 # Check whether --with-build-cc or --without-build-cc was given.
4181 if test "${with_build_cc+set}" = set; then
4182   withval="$with_build_cc"
4183   BUILD_CC="$withval"
4184 else
4185   for ac_prog in gcc clang c99 c89 cc cl
4186 do
4187   # Extract the first word of "$ac_prog", so it can be a program name with args.
4188 set dummy $ac_prog; ac_word=$2
4189 echo "$as_me:4189: checking for $ac_word" >&5
4190 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4191 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4192   echo $ECHO_N "(cached) $ECHO_C" >&6
4193 else
4194   if test -n "$BUILD_CC"; then
4195   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4196 else
4197   ac_save_IFS=$IFS; IFS=$ac_path_separator
4198 ac_dummy="$PATH"
4199 for ac_dir in $ac_dummy; do
4200   IFS=$ac_save_IFS
4201   test -z "$ac_dir" && ac_dir=.
4202   $as_executable_p "$ac_dir/$ac_word" || continue
4203 ac_cv_prog_BUILD_CC="$ac_prog"
4204 echo "$as_me:4204: found $ac_dir/$ac_word" >&5
4205 break
4206 done
4207
4208 fi
4209 fi
4210 BUILD_CC=$ac_cv_prog_BUILD_CC
4211 if test -n "$BUILD_CC"; then
4212   echo "$as_me:4212: result: $BUILD_CC" >&5
4213 echo "${ECHO_T}$BUILD_CC" >&6
4214 else
4215   echo "$as_me:4215: result: no" >&5
4216 echo "${ECHO_T}no" >&6
4217 fi
4218
4219   test -n "$BUILD_CC" && break
4220 done
4221 test -n "$BUILD_CC" || BUILD_CC="none"
4222
4223 fi;
4224         echo "$as_me:4224: checking for native build C compiler" >&5
4225 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4226         echo "$as_me:4226: result: $BUILD_CC" >&5
4227 echo "${ECHO_T}$BUILD_CC" >&6
4228
4229         echo "$as_me:4229: checking for native build C preprocessor" >&5
4230 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4231
4232 # Check whether --with-build-cpp or --without-build-cpp was given.
4233 if test "${with_build_cpp+set}" = set; then
4234   withval="$with_build_cpp"
4235   BUILD_CPP="$withval"
4236 else
4237   BUILD_CPP='${BUILD_CC} -E'
4238 fi;
4239         echo "$as_me:4239: result: $BUILD_CPP" >&5
4240 echo "${ECHO_T}$BUILD_CPP" >&6
4241
4242         echo "$as_me:4242: checking for native build C flags" >&5
4243 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4244
4245 # Check whether --with-build-cflags or --without-build-cflags was given.
4246 if test "${with_build_cflags+set}" = set; then
4247   withval="$with_build_cflags"
4248   BUILD_CFLAGS="$withval"
4249 fi;
4250         echo "$as_me:4250: result: $BUILD_CFLAGS" >&5
4251 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4252
4253         echo "$as_me:4253: checking for native build C preprocessor-flags" >&5
4254 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4255
4256 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4257 if test "${with_build_cppflags+set}" = set; then
4258   withval="$with_build_cppflags"
4259   BUILD_CPPFLAGS="$withval"
4260 fi;
4261         echo "$as_me:4261: result: $BUILD_CPPFLAGS" >&5
4262 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4263
4264         echo "$as_me:4264: checking for native build linker-flags" >&5
4265 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4266
4267 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4268 if test "${with_build_ldflags+set}" = set; then
4269   withval="$with_build_ldflags"
4270   BUILD_LDFLAGS="$withval"
4271 fi;
4272         echo "$as_me:4272: result: $BUILD_LDFLAGS" >&5
4273 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4274
4275         echo "$as_me:4275: checking for native build linker-libraries" >&5
4276 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4277
4278 # Check whether --with-build-libs or --without-build-libs was given.
4279 if test "${with_build_libs+set}" = set; then
4280   withval="$with_build_libs"
4281   BUILD_LIBS="$withval"
4282 fi;
4283         echo "$as_me:4283: result: $BUILD_LIBS" >&5
4284 echo "${ECHO_T}$BUILD_LIBS" >&6
4285
4286         # this assumes we're on Unix.
4287         BUILD_EXEEXT=
4288         BUILD_OBJEXT=o
4289
4290         : ${BUILD_CC:='${CC}'}
4291
4292         echo "$as_me:4292: checking if the build-compiler \"$BUILD_CC\" works" >&5
4293 echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4294
4295         cf_save_crossed=$cross_compiling
4296         cf_save_ac_link=$ac_link
4297         cross_compiling=no
4298         cf_build_cppflags=$BUILD_CPPFLAGS
4299         test "$cf_build_cppflags" = "#" && cf_build_cppflags=
4300         ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $cf_build_cppflags $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4301
4302         if test "$cross_compiling" = yes; then
4303   cf_ok_build_cc=unknown
4304 else
4305   cat >"conftest.$ac_ext" <<_ACEOF
4306 #line 4306 "configure"
4307 #include "confdefs.h"
4308 #include <stdio.h>
4309                 int main(int argc, char *argv[])
4310                 {
4311                         ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4312                 }
4313
4314 _ACEOF
4315 rm -f "conftest$ac_exeext"
4316 if { (eval echo "$as_me:4316: \"$ac_link\"") >&5
4317   (eval $ac_link) 2>&5
4318   ac_status=$?
4319   echo "$as_me:4319: \$? = $ac_status" >&5
4320   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4321   { (eval echo "$as_me:4321: \"$ac_try\"") >&5
4322   (eval $ac_try) 2>&5
4323   ac_status=$?
4324   echo "$as_me:4324: \$? = $ac_status" >&5
4325   (exit "$ac_status"); }; }; then
4326   cf_ok_build_cc=yes
4327 else
4328   echo "$as_me: program exited with status $ac_status" >&5
4329 echo "$as_me: failed program was:" >&5
4330 cat "conftest.$ac_ext" >&5
4331 cf_ok_build_cc=no
4332 fi
4333 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4334 fi
4335
4336         cross_compiling=$cf_save_crossed
4337         ac_link=$cf_save_ac_link
4338
4339         echo "$as_me:4339: result: $cf_ok_build_cc" >&5
4340 echo "${ECHO_T}$cf_ok_build_cc" >&6
4341
4342         if test "$cf_ok_build_cc" != yes
4343         then
4344                 { { echo "$as_me:4344: error: Cross-build requires two compilers.
4345 Use --with-build-cc to specify the native compiler." >&5
4346 echo "$as_me: error: Cross-build requires two compilers.
4347 Use --with-build-cc to specify the native compiler." >&2;}
4348    { (exit 1); exit 1; }; }
4349         fi
4350
4351 else
4352         : ${BUILD_CC:='${CC}'}
4353         : ${BUILD_CPP:='${CPP}'}
4354         : ${BUILD_CFLAGS:='${CFLAGS}'}
4355         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4356         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4357         : ${BUILD_LIBS:='${LIBS}'}
4358         : ${BUILD_EXEEXT:='$x'}
4359         : ${BUILD_OBJEXT:='o'}
4360 fi
4361
4362 ###############################################################################
4363
4364 ### Options to allow the user to specify the set of libraries which are used.
4365 ### Use "--without-normal --with-shared" to allow the default model to be
4366 ### shared, for example.
4367 cf_list_models=""
4368
4369 echo "$as_me:4369: checking if you want to build shared C-objects" >&5
4370 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4371
4372 # Check whether --with-shared or --without-shared was given.
4373 if test "${with_shared+set}" = set; then
4374   withval="$with_shared"
4375   with_shared=$withval
4376 else
4377   with_shared=no
4378 fi;
4379 echo "$as_me:4379: result: $with_shared" >&5
4380 echo "${ECHO_T}$with_shared" >&6
4381 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4382
4383 echo "$as_me:4383: checking for specified models" >&5
4384 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4385 test -z "$cf_list_models" && cf_list_models=normal
4386 echo "$as_me:4386: result: $cf_list_models" >&5
4387 echo "${ECHO_T}$cf_list_models" >&6
4388
4389 ### Use the first model as the default, and save its suffix for use in building
4390 ### up test-applications.
4391 echo "$as_me:4391: checking for default model" >&5
4392 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4393 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4394 echo "$as_me:4394: result: $DFT_LWR_MODEL" >&5
4395 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4396
4397 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4398
4399 echo "$as_me:4399: checking for specific curses-directory" >&5
4400 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4401
4402 # Check whether --with-curses-dir or --without-curses-dir was given.
4403 if test "${with_curses_dir+set}" = set; then
4404   withval="$with_curses_dir"
4405   cf_cv_curses_dir=$withval
4406 else
4407   cf_cv_curses_dir=no
4408 fi;
4409 echo "$as_me:4409: result: $cf_cv_curses_dir" >&5
4410 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4411
4412 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4413 then
4414
4415 if test "x$prefix" != xNONE; then
4416         cf_path_syntax="$prefix"
4417 else
4418         cf_path_syntax="$ac_default_prefix"
4419 fi
4420
4421 case ".$withval" in
4422 (.\$\(*\)*|.\'*\'*)
4423         ;;
4424 (..|./*|.\\*)
4425         ;;
4426 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4427         ;;
4428 (.\$\{*prefix\}*|.\$\{*dir\}*)
4429         eval withval="$withval"
4430         case ".$withval" in
4431         (.NONE/*)
4432                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4433                 ;;
4434         esac
4435         ;;
4436 (.no|.NONE/*)
4437         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4438         ;;
4439 (*)
4440         { { echo "$as_me:4440: error: expected a pathname, not \"$withval\"" >&5
4441 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4442    { (exit 1); exit 1; }; }
4443         ;;
4444 esac
4445
4446         if test -d "$cf_cv_curses_dir"
4447         then
4448
4449 if test -n "$cf_cv_curses_dir/include" ; then
4450   for cf_add_incdir in $cf_cv_curses_dir/include
4451   do
4452         while test "$cf_add_incdir" != /usr/include
4453         do
4454           if test -d "$cf_add_incdir"
4455           then
4456                 cf_have_incdir=no
4457                 if test -n "$CFLAGS$CPPFLAGS" ; then
4458                   # a loop is needed to ensure we can add subdirs of existing dirs
4459                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4460                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4461                           cf_have_incdir=yes; break
4462                         fi
4463                   done
4464                 fi
4465
4466                 if test "$cf_have_incdir" = no ; then
4467                   if test "$cf_add_incdir" = /usr/local/include ; then
4468                         if test "$GCC" = yes
4469                         then
4470                           cf_save_CPPFLAGS=$CPPFLAGS
4471
4472         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4473         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4474
4475                           cat >"conftest.$ac_ext" <<_ACEOF
4476 #line 4476 "configure"
4477 #include "confdefs.h"
4478 #include <stdio.h>
4479 int
4480 main (void)
4481 {
4482 printf("Hello")
4483   ;
4484   return 0;
4485 }
4486 _ACEOF
4487 rm -f "conftest.$ac_objext"
4488 if { (eval echo "$as_me:4488: \"$ac_compile\"") >&5
4489   (eval $ac_compile) 2>&5
4490   ac_status=$?
4491   echo "$as_me:4491: \$? = $ac_status" >&5
4492   (exit "$ac_status"); } &&
4493          { ac_try='test -s "conftest.$ac_objext"'
4494   { (eval echo "$as_me:4494: \"$ac_try\"") >&5
4495   (eval $ac_try) 2>&5
4496   ac_status=$?
4497   echo "$as_me:4497: \$? = $ac_status" >&5
4498   (exit "$ac_status"); }; }; then
4499   :
4500 else
4501   echo "$as_me: failed program was:" >&5
4502 cat "conftest.$ac_ext" >&5
4503 cf_have_incdir=yes
4504 fi
4505 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4506                           CPPFLAGS=$cf_save_CPPFLAGS
4507                         fi
4508                   fi
4509                 fi
4510
4511                 if test "$cf_have_incdir" = no ; then
4512                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4513
4514 echo "${as_me:-configure}:4514: testing adding $cf_add_incdir to include-path ..." 1>&5
4515
4516                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4517
4518                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4519                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4520                   cf_add_incdir="$cf_top_incdir"
4521                 else
4522                   break
4523                 fi
4524           else
4525                 break
4526           fi
4527         done
4528   done
4529 fi
4530
4531 if test -n "$cf_cv_curses_dir/lib" ; then
4532         for cf_add_libdir in $cf_cv_curses_dir/lib
4533         do
4534                 if test "$cf_add_libdir" = /usr/lib ; then
4535                         :
4536                 elif test -d "$cf_add_libdir"
4537                 then
4538                         cf_have_libdir=no
4539                         if test -n "$LDFLAGS$LIBS" ; then
4540                                 # a loop is needed to ensure we can add subdirs of existing dirs
4541                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4542                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4543                                                 cf_have_libdir=yes; break
4544                                         fi
4545                                 done
4546                         fi
4547                         if test "$cf_have_libdir" = no ; then
4548                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4549
4550 echo "${as_me:-configure}:4550: testing adding $cf_add_libdir to library-path ..." 1>&5
4551
4552                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4553                         fi
4554                 fi
4555         done
4556 fi
4557
4558         fi
4559 fi
4560
4561 cf_ncuconfig_root=ncurses
4562 cf_have_ncuconfig=no
4563
4564 if test "x${PKG_CONFIG:=none}" != xnone; then
4565         echo "$as_me:4565: checking pkg-config for $cf_ncuconfig_root" >&5
4566 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4567         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4568                 echo "$as_me:4568: result: yes" >&5
4569 echo "${ECHO_T}yes" >&6
4570
4571                 echo "$as_me:4571: checking if the $cf_ncuconfig_root package files work" >&5
4572 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4573                 cf_have_ncuconfig=unknown
4574
4575                 cf_save_CFLAGS="$CFLAGS"
4576                 cf_save_CPPFLAGS="$CPPFLAGS"
4577                 cf_save_LIBS="$LIBS"
4578
4579                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4580                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4581
4582                 # while -W for passing linker flags is prevalent, it is not "standard".
4583                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4584                 # incompatible _and_ non-standard -W option which gives an error.  Work
4585                 # around that pitfall.
4586                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4587                 (x*c[89]9@@*-W*)
4588
4589 cf_fix_cppflags=no
4590 cf_new_cflags=
4591 cf_new_cppflags=
4592 cf_new_extra_cppflags=
4593
4594 for cf_add_cflags in $cf_pkg_cflags
4595 do
4596 case "$cf_fix_cppflags" in
4597 (no)
4598         case "$cf_add_cflags" in
4599         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4600                 case "$cf_add_cflags" in
4601                 (-D*)
4602                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4603
4604                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4605                                 && test -z "${cf_tst_cflags}" \
4606                                 && cf_fix_cppflags=yes
4607
4608                         if test "$cf_fix_cppflags" = yes ; then
4609
4610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4612
4613                                 continue
4614                         elif test "${cf_tst_cflags}" = "\"'" ; then
4615
4616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4618
4619                                 continue
4620                         fi
4621                         ;;
4622                 esac
4623                 case "$CPPFLAGS" in
4624                 (*$cf_add_cflags)
4625                         ;;
4626                 (*)
4627                         case "$cf_add_cflags" in
4628                         (-D*)
4629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4630
4631 CPPFLAGS=`echo "$CPPFLAGS" | \
4632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4634
4635                                 ;;
4636                         esac
4637
4638         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4639         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4640
4641                         ;;
4642                 esac
4643                 ;;
4644         (*)
4645
4646         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4647         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4648
4649                 ;;
4650         esac
4651         ;;
4652 (yes)
4653
4654         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4655         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4656
4657         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4658
4659         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4660                 && test -z "${cf_tst_cflags}" \
4661                 && cf_fix_cppflags=no
4662         ;;
4663 esac
4664 done
4665
4666 if test -n "$cf_new_cflags" ; then
4667
4668         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4669         CFLAGS="${CFLAGS}$cf_new_cflags"
4670
4671 fi
4672
4673 if test -n "$cf_new_cppflags" ; then
4674
4675         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4676         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4677
4678 fi
4679
4680 if test -n "$cf_new_extra_cppflags" ; then
4681
4682         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4683         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4684
4685 fi
4686
4687 cf_add_libs="$LIBS"
4688 # reverse order
4689 cf_add_0lib=
4690 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4691 # filter duplicates
4692 for cf_add_1lib in $cf_add_0lib; do
4693         for cf_add_2lib in $cf_add_libs; do
4694                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4695                         cf_add_1lib=
4696                         break
4697                 fi
4698         done
4699         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4700 done
4701 LIBS="$cf_add_libs"
4702
4703                         cat >"conftest.$ac_ext" <<_ACEOF
4704 #line 4704 "configure"
4705 #include "confdefs.h"
4706 #include <${cf_cv_ncurses_header:-curses.h}>
4707 int
4708 main (void)
4709 {
4710 initscr(); mousemask(0,0); tigetstr((char *)0);
4711   ;
4712   return 0;
4713 }
4714 _ACEOF
4715 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4716 if { (eval echo "$as_me:4716: \"$ac_link\"") >&5
4717   (eval $ac_link) 2>&5
4718   ac_status=$?
4719   echo "$as_me:4719: \$? = $ac_status" >&5
4720   (exit "$ac_status"); } &&
4721          { ac_try='test -s "conftest$ac_exeext"'
4722   { (eval echo "$as_me:4722: \"$ac_try\"") >&5
4723   (eval $ac_try) 2>&5
4724   ac_status=$?
4725   echo "$as_me:4725: \$? = $ac_status" >&5
4726   (exit "$ac_status"); }; }; then
4727   if test "$cross_compiling" = yes; then
4728   cf_test_ncuconfig=maybe
4729 else
4730   cat >"conftest.$ac_ext" <<_ACEOF
4731 #line 4731 "configure"
4732 #include "confdefs.h"
4733 #include <${cf_cv_ncurses_header:-curses.h}>
4734                                         int main(void)
4735                                         { const char *xx = curses_version(); return (xx == 0); }
4736 _ACEOF
4737 rm -f "conftest$ac_exeext"
4738 if { (eval echo "$as_me:4738: \"$ac_link\"") >&5
4739   (eval $ac_link) 2>&5
4740   ac_status=$?
4741   echo "$as_me:4741: \$? = $ac_status" >&5
4742   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4743   { (eval echo "$as_me:4743: \"$ac_try\"") >&5
4744   (eval $ac_try) 2>&5
4745   ac_status=$?
4746   echo "$as_me:4746: \$? = $ac_status" >&5
4747   (exit "$ac_status"); }; }; then
4748   cf_test_ncuconfig=yes
4749 else
4750   echo "$as_me: program exited with status $ac_status" >&5
4751 echo "$as_me: failed program was:" >&5
4752 cat "conftest.$ac_ext" >&5
4753 cf_test_ncuconfig=no
4754 fi
4755 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4756 fi
4757 else
4758   echo "$as_me: failed program was:" >&5
4759 cat "conftest.$ac_ext" >&5
4760 cf_test_ncuconfig=no
4761 fi
4762 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4763
4764                         CFLAGS="$cf_save_CFLAGS"
4765                         CPPFLAGS="$cf_save_CPPFLAGS"
4766                         LIBS="$cf_save_LIBS"
4767
4768                         if test "x$cf_test_ncuconfig" != xyes; then
4769                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4770                                 cf_pkg_cflags="$cf_temp"
4771                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4772                                 cf_pkg_libs="$cf_temp"
4773                         fi
4774                         ;;
4775                 esac
4776
4777 for cf_add_cflags in $cf_pkg_cflags
4778 do
4779         case "x$cf_add_cflags" in
4780         (x-[DU]*)
4781
4782 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4783 while true
4784 do
4785         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4786         test "$CFLAGS" != "$cf_old_cflag" || break
4787
4788         CFLAGS="$cf_old_cflag"
4789 done
4790
4791 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4792 while true
4793 do
4794         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4795         test "$CPPFLAGS" != "$cf_old_cflag" || break
4796
4797         CPPFLAGS="$cf_old_cflag"
4798 done
4799
4800                 ;;
4801         esac
4802
4803 cf_fix_cppflags=no
4804 cf_new_cflags=
4805 cf_new_cppflags=
4806 cf_new_extra_cppflags=
4807
4808 for cf_add_cflags in $cf_add_cflags
4809 do
4810 case "$cf_fix_cppflags" in
4811 (no)
4812         case "$cf_add_cflags" in
4813         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4814                 case "$cf_add_cflags" in
4815                 (-D*)
4816                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4817
4818                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4819                                 && test -z "${cf_tst_cflags}" \
4820                                 && cf_fix_cppflags=yes
4821
4822                         if test "$cf_fix_cppflags" = yes ; then
4823
4824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4826
4827                                 continue
4828                         elif test "${cf_tst_cflags}" = "\"'" ; then
4829
4830         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4831         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4832
4833                                 continue
4834                         fi
4835                         ;;
4836                 esac
4837                 case "$CPPFLAGS" in
4838                 (*$cf_add_cflags)
4839                         ;;
4840                 (*)
4841                         case "$cf_add_cflags" in
4842                         (-D*)
4843                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4844
4845 CPPFLAGS=`echo "$CPPFLAGS" | \
4846         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4847                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4848
4849                                 ;;
4850                         esac
4851
4852         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4853         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4854
4855                         ;;
4856                 esac
4857                 ;;
4858         (*)
4859
4860         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4861         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4862
4863                 ;;
4864         esac
4865         ;;
4866 (yes)
4867
4868         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4869         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4870
4871         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4872
4873         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4874                 && test -z "${cf_tst_cflags}" \
4875                 && cf_fix_cppflags=no
4876         ;;
4877 esac
4878 done
4879
4880 if test -n "$cf_new_cflags" ; then
4881
4882         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4883         CFLAGS="${CFLAGS}$cf_new_cflags"
4884
4885 fi
4886
4887 if test -n "$cf_new_cppflags" ; then
4888
4889         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4890         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4891
4892 fi
4893
4894 if test -n "$cf_new_extra_cppflags" ; then
4895
4896         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4897         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4898
4899 fi
4900
4901 done
4902
4903 cf_add_libs="$LIBS"
4904 # reverse order
4905 cf_add_0lib=
4906 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4907 # filter duplicates
4908 for cf_add_1lib in $cf_add_0lib; do
4909         for cf_add_2lib in $cf_add_libs; do
4910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4911                         cf_add_1lib=
4912                         break
4913                 fi
4914         done
4915         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4916 done
4917 LIBS="$cf_add_libs"
4918
4919                 cat >"conftest.$ac_ext" <<_ACEOF
4920 #line 4920 "configure"
4921 #include "confdefs.h"
4922 #include <${cf_cv_ncurses_header:-curses.h}>
4923 int
4924 main (void)
4925 {
4926 initscr(); mousemask(0,0); tigetstr((char *)0);
4927   ;
4928   return 0;
4929 }
4930 _ACEOF
4931 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4932 if { (eval echo "$as_me:4932: \"$ac_link\"") >&5
4933   (eval $ac_link) 2>&5
4934   ac_status=$?
4935   echo "$as_me:4935: \$? = $ac_status" >&5
4936   (exit "$ac_status"); } &&
4937          { ac_try='test -s "conftest$ac_exeext"'
4938   { (eval echo "$as_me:4938: \"$ac_try\"") >&5
4939   (eval $ac_try) 2>&5
4940   ac_status=$?
4941   echo "$as_me:4941: \$? = $ac_status" >&5
4942   (exit "$ac_status"); }; }; then
4943   if test "$cross_compiling" = yes; then
4944   cf_have_ncuconfig=maybe
4945 else
4946   cat >"conftest.$ac_ext" <<_ACEOF
4947 #line 4947 "configure"
4948 #include "confdefs.h"
4949 #include <${cf_cv_ncurses_header:-curses.h}>
4950                                 int main(void)
4951                                 { const char *xx = curses_version(); return (xx == 0); }
4952 _ACEOF
4953 rm -f "conftest$ac_exeext"
4954 if { (eval echo "$as_me:4954: \"$ac_link\"") >&5
4955   (eval $ac_link) 2>&5
4956   ac_status=$?
4957   echo "$as_me:4957: \$? = $ac_status" >&5
4958   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4959   { (eval echo "$as_me:4959: \"$ac_try\"") >&5
4960   (eval $ac_try) 2>&5
4961   ac_status=$?
4962   echo "$as_me:4962: \$? = $ac_status" >&5
4963   (exit "$ac_status"); }; }; then
4964   cf_have_ncuconfig=yes
4965 else
4966   echo "$as_me: program exited with status $ac_status" >&5
4967 echo "$as_me: failed program was:" >&5
4968 cat "conftest.$ac_ext" >&5
4969 cf_have_ncuconfig=no
4970 fi
4971 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4972 fi
4973 else
4974   echo "$as_me: failed program was:" >&5
4975 cat "conftest.$ac_ext" >&5
4976 cf_have_ncuconfig=no
4977 fi
4978 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4979                 echo "$as_me:4979: result: $cf_have_ncuconfig" >&5
4980 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4981                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4982                 if test "$cf_have_ncuconfig" != "yes"
4983                 then
4984                         CPPFLAGS="$cf_save_CPPFLAGS"
4985                         LIBS="$cf_save_LIBS"
4986                         NCURSES_CONFIG_PKG=none
4987                 else
4988
4989 cat >>confdefs.h <<\EOF
4990 #define NCURSES 1
4991 EOF
4992
4993                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4994
4995 echo "$as_me:4995: checking for terminfo header" >&5
4996 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4997 if test "${cf_cv_term_header+set}" = set; then
4998   echo $ECHO_N "(cached) $ECHO_C" >&6
4999 else
5000
5001 case "${cf_cv_ncurses_header}" in
5002 (*/ncurses.h|*/ncursesw.h)
5003         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5004         ;;
5005 (*)
5006         cf_term_header=term.h
5007         ;;
5008 esac
5009
5010 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5011 do
5012 cat >"conftest.$ac_ext" <<_ACEOF
5013 #line 5013 "configure"
5014 #include "confdefs.h"
5015 #include <stdio.h>
5016 #include <${cf_cv_ncurses_header:-curses.h}>
5017 #include <$cf_test>
5018
5019 int
5020 main (void)
5021 {
5022 int x = auto_left_margin; (void)x
5023   ;
5024   return 0;
5025 }
5026 _ACEOF
5027 rm -f "conftest.$ac_objext"
5028 if { (eval echo "$as_me:5028: \"$ac_compile\"") >&5
5029   (eval $ac_compile) 2>&5
5030   ac_status=$?
5031   echo "$as_me:5031: \$? = $ac_status" >&5
5032   (exit "$ac_status"); } &&
5033          { ac_try='test -s "conftest.$ac_objext"'
5034   { (eval echo "$as_me:5034: \"$ac_try\"") >&5
5035   (eval $ac_try) 2>&5
5036   ac_status=$?
5037   echo "$as_me:5037: \$? = $ac_status" >&5
5038   (exit "$ac_status"); }; }; then
5039
5040         cf_cv_term_header="$cf_test"
5041 else
5042   echo "$as_me: failed program was:" >&5
5043 cat "conftest.$ac_ext" >&5
5044
5045         cf_cv_term_header=unknown
5046
5047 fi
5048 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5049         test "$cf_cv_term_header" != unknown && break
5050 done
5051
5052 fi
5053 echo "$as_me:5053: result: $cf_cv_term_header" >&5
5054 echo "${ECHO_T}$cf_cv_term_header" >&6
5055
5056 # Set definitions to allow ifdef'ing to accommodate subdirectories
5057
5058 case "$cf_cv_term_header" in
5059 (*term.h)
5060
5061 cat >>confdefs.h <<\EOF
5062 #define HAVE_TERM_H 1
5063 EOF
5064
5065         ;;
5066 esac
5067
5068 case "$cf_cv_term_header" in
5069 (ncurses/term.h)
5070
5071 cat >>confdefs.h <<\EOF
5072 #define HAVE_NCURSES_TERM_H 1
5073 EOF
5074
5075         ;;
5076 (ncursesw/term.h)
5077
5078 cat >>confdefs.h <<\EOF
5079 #define HAVE_NCURSESW_TERM_H 1
5080 EOF
5081
5082         ;;
5083 esac
5084
5085                 fi
5086
5087         else
5088                 echo "$as_me:5088: result: no" >&5
5089 echo "${ECHO_T}no" >&6
5090                 NCURSES_CONFIG_PKG=none
5091         fi
5092 else
5093         NCURSES_CONFIG_PKG=none
5094 fi
5095
5096 if test "x$cf_have_ncuconfig" = "xno"; then
5097         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5098
5099 if test -n "$ac_tool_prefix"; then
5100   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5101   do
5102     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5103 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5104 echo "$as_me:5104: checking for $ac_word" >&5
5105 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5106 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5107   echo $ECHO_N "(cached) $ECHO_C" >&6
5108 else
5109   if test -n "$NCURSES_CONFIG"; then
5110   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5111 else
5112   ac_save_IFS=$IFS; IFS=$ac_path_separator
5113 ac_dummy="$PATH"
5114 for ac_dir in $ac_dummy; do
5115   IFS=$ac_save_IFS
5116   test -z "$ac_dir" && ac_dir=.
5117   $as_executable_p "$ac_dir/$ac_word" || continue
5118 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5119 echo "$as_me:5119: found $ac_dir/$ac_word" >&5
5120 break
5121 done
5122
5123 fi
5124 fi
5125 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5126 if test -n "$NCURSES_CONFIG"; then
5127   echo "$as_me:5127: result: $NCURSES_CONFIG" >&5
5128 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5129 else
5130   echo "$as_me:5130: result: no" >&5
5131 echo "${ECHO_T}no" >&6
5132 fi
5133
5134     test -n "$NCURSES_CONFIG" && break
5135   done
5136 fi
5137 if test -z "$NCURSES_CONFIG"; then
5138   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5139   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5140 do
5141   # Extract the first word of "$ac_prog", so it can be a program name with args.
5142 set dummy $ac_prog; ac_word=$2
5143 echo "$as_me:5143: checking for $ac_word" >&5
5144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5145 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5146   echo $ECHO_N "(cached) $ECHO_C" >&6
5147 else
5148   if test -n "$ac_ct_NCURSES_CONFIG"; then
5149   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5150 else
5151   ac_save_IFS=$IFS; IFS=$ac_path_separator
5152 ac_dummy="$PATH"
5153 for ac_dir in $ac_dummy; do
5154   IFS=$ac_save_IFS
5155   test -z "$ac_dir" && ac_dir=.
5156   $as_executable_p "$ac_dir/$ac_word" || continue
5157 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5158 echo "$as_me:5158: found $ac_dir/$ac_word" >&5
5159 break
5160 done
5161
5162 fi
5163 fi
5164 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5165 if test -n "$ac_ct_NCURSES_CONFIG"; then
5166   echo "$as_me:5166: result: $ac_ct_NCURSES_CONFIG" >&5
5167 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5168 else
5169   echo "$as_me:5169: result: no" >&5
5170 echo "${ECHO_T}no" >&6
5171 fi
5172
5173   test -n "$ac_ct_NCURSES_CONFIG" && break
5174 done
5175 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5176
5177   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5178 fi
5179
5180         if test "$NCURSES_CONFIG" != none ; then
5181
5182 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5183 do
5184         case "x$cf_add_cflags" in
5185         (x-[DU]*)
5186
5187 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5188 while true
5189 do
5190         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5191         test "$CFLAGS" != "$cf_old_cflag" || break
5192
5193         CFLAGS="$cf_old_cflag"
5194 done
5195
5196 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5197 while true
5198 do
5199         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5200         test "$CPPFLAGS" != "$cf_old_cflag" || break
5201
5202         CPPFLAGS="$cf_old_cflag"
5203 done
5204
5205                 ;;
5206         esac
5207
5208 cf_fix_cppflags=no
5209 cf_new_cflags=
5210 cf_new_cppflags=
5211 cf_new_extra_cppflags=
5212
5213 for cf_add_cflags in $cf_add_cflags
5214 do
5215 case "$cf_fix_cppflags" in
5216 (no)
5217         case "$cf_add_cflags" in
5218         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5219                 case "$cf_add_cflags" in
5220                 (-D*)
5221                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5222
5223                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5224                                 && test -z "${cf_tst_cflags}" \
5225                                 && cf_fix_cppflags=yes
5226
5227                         if test "$cf_fix_cppflags" = yes ; then
5228
5229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5231
5232                                 continue
5233                         elif test "${cf_tst_cflags}" = "\"'" ; then
5234
5235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5237
5238                                 continue
5239                         fi
5240                         ;;
5241                 esac
5242                 case "$CPPFLAGS" in
5243                 (*$cf_add_cflags)
5244                         ;;
5245                 (*)
5246                         case "$cf_add_cflags" in
5247                         (-D*)
5248                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5249
5250 CPPFLAGS=`echo "$CPPFLAGS" | \
5251         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5252                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5253
5254                                 ;;
5255                         esac
5256
5257         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5258         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5259
5260                         ;;
5261                 esac
5262                 ;;
5263         (*)
5264
5265         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5266         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5267
5268                 ;;
5269         esac
5270         ;;
5271 (yes)
5272
5273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5275
5276         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5277
5278         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5279                 && test -z "${cf_tst_cflags}" \
5280                 && cf_fix_cppflags=no
5281         ;;
5282 esac
5283 done
5284
5285 if test -n "$cf_new_cflags" ; then
5286
5287         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5288         CFLAGS="${CFLAGS}$cf_new_cflags"
5289
5290 fi
5291
5292 if test -n "$cf_new_cppflags" ; then
5293
5294         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5295         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5296
5297 fi
5298
5299 if test -n "$cf_new_extra_cppflags" ; then
5300
5301         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5302         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5303
5304 fi
5305
5306 done
5307
5308 cf_add_libs="$LIBS"
5309 # reverse order
5310 cf_add_0lib=
5311 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5312 # filter duplicates
5313 for cf_add_1lib in $cf_add_0lib; do
5314         for cf_add_2lib in $cf_add_libs; do
5315                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5316                         cf_add_1lib=
5317                         break
5318                 fi
5319         done
5320         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5321 done
5322 LIBS="$cf_add_libs"
5323
5324                 # even with config script, some packages use no-override for curses.h
5325
5326 echo "$as_me:5326: checking if we have identified curses headers" >&5
5327 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5328 if test "${cf_cv_ncurses_header+set}" = set; then
5329   echo $ECHO_N "(cached) $ECHO_C" >&6
5330 else
5331
5332 cf_cv_ncurses_header=none
5333 for cf_header in \
5334         ncurses.h ncurses/ncurses.h \
5335         curses.h ncurses/curses.h
5336 do
5337 cat >"conftest.$ac_ext" <<_ACEOF
5338 #line 5338 "configure"
5339 #include "confdefs.h"
5340 #include <${cf_header}>
5341 int
5342 main (void)
5343 {
5344 initscr(); endwin()
5345   ;
5346   return 0;
5347 }
5348 _ACEOF
5349 rm -f "conftest.$ac_objext"
5350 if { (eval echo "$as_me:5350: \"$ac_compile\"") >&5
5351   (eval $ac_compile) 2>&5
5352   ac_status=$?
5353   echo "$as_me:5353: \$? = $ac_status" >&5
5354   (exit "$ac_status"); } &&
5355          { ac_try='test -s "conftest.$ac_objext"'
5356   { (eval echo "$as_me:5356: \"$ac_try\"") >&5
5357   (eval $ac_try) 2>&5
5358   ac_status=$?
5359   echo "$as_me:5359: \$? = $ac_status" >&5
5360   (exit "$ac_status"); }; }; then
5361   cf_cv_ncurses_header=$cf_header; break
5362 else
5363   echo "$as_me: failed program was:" >&5
5364 cat "conftest.$ac_ext" >&5
5365 fi
5366 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5367 done
5368
5369 fi
5370 echo "$as_me:5370: result: $cf_cv_ncurses_header" >&5
5371 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5372
5373 if test "$cf_cv_ncurses_header" = none ; then
5374         { { echo "$as_me:5374: error: No curses header-files found" >&5
5375 echo "$as_me: error: No curses header-files found" >&2;}
5376    { (exit 1); exit 1; }; }
5377 fi
5378
5379 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5380
5381 for ac_header in $cf_cv_ncurses_header
5382 do
5383 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5384 echo "$as_me:5384: checking for $ac_header" >&5
5385 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5386 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5387   echo $ECHO_N "(cached) $ECHO_C" >&6
5388 else
5389   cat >"conftest.$ac_ext" <<_ACEOF
5390 #line 5390 "configure"
5391 #include "confdefs.h"
5392 #include <$ac_header>
5393 _ACEOF
5394 if { (eval echo "$as_me:5394: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5395   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5396   ac_status=$?
5397   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5398   rm -f conftest.er1
5399   cat conftest.err >&5
5400   echo "$as_me:5400: \$? = $ac_status" >&5
5401   (exit "$ac_status"); } >/dev/null; then
5402   if test -s conftest.err; then
5403     ac_cpp_err=$ac_c_preproc_warn_flag
5404   else
5405     ac_cpp_err=
5406   fi
5407 else
5408   ac_cpp_err=yes
5409 fi
5410 if test -z "$ac_cpp_err"; then
5411   eval "$as_ac_Header=yes"
5412 else
5413   echo "$as_me: failed program was:" >&5
5414   cat "conftest.$ac_ext" >&5
5415   eval "$as_ac_Header=no"
5416 fi
5417 rm -f conftest.err "conftest.$ac_ext"
5418 fi
5419 echo "$as_me:5419: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5420 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5421 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5422   cat >>confdefs.h <<EOF
5423 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5424 EOF
5425
5426 fi
5427 done
5428
5429 cat >>confdefs.h <<\EOF
5430 #define NCURSES 1
5431 EOF
5432
5433 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5434
5435                 cat >>confdefs.h <<EOF
5436 #define $cf_nculib_ROOT 1
5437 EOF
5438
5439                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5440
5441         else
5442
5443 cf_ncuhdr_root=ncurses
5444
5445 test -n "$cf_cv_curses_dir" && \
5446 test "$cf_cv_curses_dir" != "no" && { \
5447
5448 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5449   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5450   do
5451         while test "$cf_add_incdir" != /usr/include
5452         do
5453           if test -d "$cf_add_incdir"
5454           then
5455                 cf_have_incdir=no
5456                 if test -n "$CFLAGS$CPPFLAGS" ; then
5457                   # a loop is needed to ensure we can add subdirs of existing dirs
5458                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5459                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5460                           cf_have_incdir=yes; break
5461                         fi
5462                   done
5463                 fi
5464
5465                 if test "$cf_have_incdir" = no ; then
5466                   if test "$cf_add_incdir" = /usr/local/include ; then
5467                         if test "$GCC" = yes
5468                         then
5469                           cf_save_CPPFLAGS=$CPPFLAGS
5470
5471         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5472         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5473
5474                           cat >"conftest.$ac_ext" <<_ACEOF
5475 #line 5475 "configure"
5476 #include "confdefs.h"
5477 #include <stdio.h>
5478 int
5479 main (void)
5480 {
5481 printf("Hello")
5482   ;
5483   return 0;
5484 }
5485 _ACEOF
5486 rm -f "conftest.$ac_objext"
5487 if { (eval echo "$as_me:5487: \"$ac_compile\"") >&5
5488   (eval $ac_compile) 2>&5
5489   ac_status=$?
5490   echo "$as_me:5490: \$? = $ac_status" >&5
5491   (exit "$ac_status"); } &&
5492          { ac_try='test -s "conftest.$ac_objext"'
5493   { (eval echo "$as_me:5493: \"$ac_try\"") >&5
5494   (eval $ac_try) 2>&5
5495   ac_status=$?
5496   echo "$as_me:5496: \$? = $ac_status" >&5
5497   (exit "$ac_status"); }; }; then
5498   :
5499 else
5500   echo "$as_me: failed program was:" >&5
5501 cat "conftest.$ac_ext" >&5
5502 cf_have_incdir=yes
5503 fi
5504 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5505                           CPPFLAGS=$cf_save_CPPFLAGS
5506                         fi
5507                   fi
5508                 fi
5509
5510                 if test "$cf_have_incdir" = no ; then
5511                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5512
5513 echo "${as_me:-configure}:5513: testing adding $cf_add_incdir to include-path ..." 1>&5
5514
5515                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5516
5517                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5518                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5519                   cf_add_incdir="$cf_top_incdir"
5520                 else
5521                   break
5522                 fi
5523           else
5524                 break
5525           fi
5526         done
5527   done
5528 fi
5529
5530 }
5531
5532 echo "$as_me:5532: checking for $cf_ncuhdr_root header in include-path" >&5
5533 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5534 if test "${cf_cv_ncurses_h+set}" = set; then
5535   echo $ECHO_N "(cached) $ECHO_C" >&6
5536 else
5537
5538         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5539         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5540         for cf_header in $cf_header_list
5541         do
5542
5543         cat >"conftest.$ac_ext" <<_ACEOF
5544 #line 5544 "configure"
5545 #include "confdefs.h"
5546
5547 #include <$cf_header>
5548 int
5549 main (void)
5550 {
5551
5552 #ifdef NCURSES_VERSION
5553
5554 printf("%s\\n", NCURSES_VERSION);
5555 #else
5556 #ifdef __NCURSES_H
5557 printf("old\\n");
5558 #else
5559         make an error
5560 #endif
5561 #endif
5562
5563   ;
5564   return 0;
5565 }
5566 _ACEOF
5567 rm -f "conftest.$ac_objext"
5568 if { (eval echo "$as_me:5568: \"$ac_compile\"") >&5
5569   (eval $ac_compile) 2>&5
5570   ac_status=$?
5571   echo "$as_me:5571: \$? = $ac_status" >&5
5572   (exit "$ac_status"); } &&
5573          { ac_try='test -s "conftest.$ac_objext"'
5574   { (eval echo "$as_me:5574: \"$ac_try\"") >&5
5575   (eval $ac_try) 2>&5
5576   ac_status=$?
5577   echo "$as_me:5577: \$? = $ac_status" >&5
5578   (exit "$ac_status"); }; }; then
5579   cf_cv_ncurses_h=$cf_header
5580
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat "conftest.$ac_ext" >&5
5584 cf_cv_ncurses_h=no
5585 fi
5586 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5587
5588                 test "$cf_cv_ncurses_h" != no && break
5589         done
5590
5591 fi
5592 echo "$as_me:5592: result: $cf_cv_ncurses_h" >&5
5593 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5594
5595 if test "$cf_cv_ncurses_h" != no ; then
5596         cf_cv_ncurses_header=$cf_cv_ncurses_h
5597 else
5598
5599 echo "$as_me:5599: checking for $cf_ncuhdr_root include-path" >&5
5600 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5601 if test "${cf_cv_ncurses_h2+set}" = set; then
5602   echo $ECHO_N "(cached) $ECHO_C" >&6
5603 else
5604
5605         test -n "$verbose" && echo
5606
5607 cf_search=
5608
5609 # collect the current set of include-directories from compiler flags
5610 cf_header_path_list=""
5611 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5612         for cf_header_path in $CPPFLAGS $CFLAGS
5613         do
5614                 case "$cf_header_path" in
5615                 (-I*)
5616                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5617
5618 test "x$cf_header_path" != "xNONE" && \
5619 test -d "$cf_header_path" && \
5620  {
5621         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5622         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5623         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5624         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5625         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5626         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"
5627 }
5628
5629                         cf_header_path_list="$cf_header_path_list $cf_search"
5630                         ;;
5631                 esac
5632         done
5633 fi
5634
5635 # add the variations for the package we are looking for
5636
5637 cf_search=
5638
5639 test "x$prefix" != "xNONE" && \
5640 test -d "$prefix" && \
5641  {
5642         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5643         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5644         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5645         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5646         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5647         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5648 }
5649
5650 for cf_subdir_prefix in \
5651         /usr \
5652         /usr/local \
5653         /usr/pkg \
5654         /opt \
5655         /opt/local \
5656         $HOME
5657 do
5658
5659 test "x$cf_subdir_prefix" != "x$prefix" && \
5660 test -d "$cf_subdir_prefix" && \
5661 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5662         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5663         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5664         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5665         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5666         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5667         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"
5668 }
5669
5670 done
5671
5672 test "$includedir" != NONE && \
5673 test "$includedir" != "/usr/include" && \
5674 test -d "$includedir" && {
5675         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5676         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5677 }
5678
5679 test "$oldincludedir" != NONE && \
5680 test "$oldincludedir" != "/usr/include" && \
5681 test -d "$oldincludedir" && {
5682         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5683         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5684 }
5685
5686 cf_search="$cf_search $cf_header_path_list"
5687
5688         test -n "$verbose" && echo "search path $cf_search"
5689         cf_save2_CPPFLAGS="$CPPFLAGS"
5690         for cf_incdir in $cf_search
5691         do
5692
5693 if test -n "$cf_incdir" ; then
5694   for cf_add_incdir in $cf_incdir
5695   do
5696         while test "$cf_add_incdir" != /usr/include
5697         do
5698           if test -d "$cf_add_incdir"
5699           then
5700                 cf_have_incdir=no
5701                 if test -n "$CFLAGS$CPPFLAGS" ; then
5702                   # a loop is needed to ensure we can add subdirs of existing dirs
5703                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5704                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5705                           cf_have_incdir=yes; break
5706                         fi
5707                   done
5708                 fi
5709
5710                 if test "$cf_have_incdir" = no ; then
5711                   if test "$cf_add_incdir" = /usr/local/include ; then
5712                         if test "$GCC" = yes
5713                         then
5714                           cf_save_CPPFLAGS=$CPPFLAGS
5715
5716         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5717         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5718
5719                           cat >"conftest.$ac_ext" <<_ACEOF
5720 #line 5720 "configure"
5721 #include "confdefs.h"
5722 #include <stdio.h>
5723 int
5724 main (void)
5725 {
5726 printf("Hello")
5727   ;
5728   return 0;
5729 }
5730 _ACEOF
5731 rm -f "conftest.$ac_objext"
5732 if { (eval echo "$as_me:5732: \"$ac_compile\"") >&5
5733   (eval $ac_compile) 2>&5
5734   ac_status=$?
5735   echo "$as_me:5735: \$? = $ac_status" >&5
5736   (exit "$ac_status"); } &&
5737          { ac_try='test -s "conftest.$ac_objext"'
5738   { (eval echo "$as_me:5738: \"$ac_try\"") >&5
5739   (eval $ac_try) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit "$ac_status"); }; }; then
5743   :
5744 else
5745   echo "$as_me: failed program was:" >&5
5746 cat "conftest.$ac_ext" >&5
5747 cf_have_incdir=yes
5748 fi
5749 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5750                           CPPFLAGS=$cf_save_CPPFLAGS
5751                         fi
5752                   fi
5753                 fi
5754
5755                 if test "$cf_have_incdir" = no ; then
5756                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5757
5758 echo "${as_me:-configure}:5758: testing adding $cf_add_incdir to include-path ..." 1>&5
5759
5760                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5761
5762                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5763                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5764                   cf_add_incdir="$cf_top_incdir"
5765                 else
5766                   break
5767                 fi
5768           else
5769                 break
5770           fi
5771         done
5772   done
5773 fi
5774
5775                 for cf_header in \
5776                         ncurses.h \
5777                         curses.h
5778                 do
5779
5780         cat >"conftest.$ac_ext" <<_ACEOF
5781 #line 5781 "configure"
5782 #include "confdefs.h"
5783
5784 #include <$cf_header>
5785 int
5786 main (void)
5787 {
5788
5789 #ifdef NCURSES_VERSION
5790
5791 printf("%s\\n", NCURSES_VERSION);
5792 #else
5793 #ifdef __NCURSES_H
5794 printf("old\\n");
5795 #else
5796         make an error
5797 #endif
5798 #endif
5799
5800   ;
5801   return 0;
5802 }
5803 _ACEOF
5804 rm -f "conftest.$ac_objext"
5805 if { (eval echo "$as_me:5805: \"$ac_compile\"") >&5
5806   (eval $ac_compile) 2>&5
5807   ac_status=$?
5808   echo "$as_me:5808: \$? = $ac_status" >&5
5809   (exit "$ac_status"); } &&
5810          { ac_try='test -s "conftest.$ac_objext"'
5811   { (eval echo "$as_me:5811: \"$ac_try\"") >&5
5812   (eval $ac_try) 2>&5
5813   ac_status=$?
5814   echo "$as_me:5814: \$? = $ac_status" >&5
5815   (exit "$ac_status"); }; }; then
5816   cf_cv_ncurses_h2=$cf_header
5817
5818 else
5819   echo "$as_me: failed program was:" >&5
5820 cat "conftest.$ac_ext" >&5
5821 cf_cv_ncurses_h2=no
5822 fi
5823 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5824
5825                         if test "$cf_cv_ncurses_h2" != no ; then
5826                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5827                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5828                                 break
5829                         fi
5830                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5831                 done
5832                 CPPFLAGS="$cf_save2_CPPFLAGS"
5833                 test "$cf_cv_ncurses_h2" != no && break
5834         done
5835         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5835: error: not found" >&5
5836 echo "$as_me: error: not found" >&2;}
5837    { (exit 1); exit 1; }; }
5838
5839 fi
5840 echo "$as_me:5840: result: $cf_cv_ncurses_h2" >&5
5841 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5842
5843         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5844         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5845         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5846                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5847         fi
5848
5849 if test -n "$cf_1st_incdir" ; then
5850   for cf_add_incdir in $cf_1st_incdir
5851   do
5852         while test "$cf_add_incdir" != /usr/include
5853         do
5854           if test -d "$cf_add_incdir"
5855           then
5856                 cf_have_incdir=no
5857                 if test -n "$CFLAGS$CPPFLAGS" ; then
5858                   # a loop is needed to ensure we can add subdirs of existing dirs
5859                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5860                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5861                           cf_have_incdir=yes; break
5862                         fi
5863                   done
5864                 fi
5865
5866                 if test "$cf_have_incdir" = no ; then
5867                   if test "$cf_add_incdir" = /usr/local/include ; then
5868                         if test "$GCC" = yes
5869                         then
5870                           cf_save_CPPFLAGS=$CPPFLAGS
5871
5872         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5873         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5874
5875                           cat >"conftest.$ac_ext" <<_ACEOF
5876 #line 5876 "configure"
5877 #include "confdefs.h"
5878 #include <stdio.h>
5879 int
5880 main (void)
5881 {
5882 printf("Hello")
5883   ;
5884   return 0;
5885 }
5886 _ACEOF
5887 rm -f "conftest.$ac_objext"
5888 if { (eval echo "$as_me:5888: \"$ac_compile\"") >&5
5889   (eval $ac_compile) 2>&5
5890   ac_status=$?
5891   echo "$as_me:5891: \$? = $ac_status" >&5
5892   (exit "$ac_status"); } &&
5893          { ac_try='test -s "conftest.$ac_objext"'
5894   { (eval echo "$as_me:5894: \"$ac_try\"") >&5
5895   (eval $ac_try) 2>&5
5896   ac_status=$?
5897   echo "$as_me:5897: \$? = $ac_status" >&5
5898   (exit "$ac_status"); }; }; then
5899   :
5900 else
5901   echo "$as_me: failed program was:" >&5
5902 cat "conftest.$ac_ext" >&5
5903 cf_have_incdir=yes
5904 fi
5905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5906                           CPPFLAGS=$cf_save_CPPFLAGS
5907                         fi
5908                   fi
5909                 fi
5910
5911                 if test "$cf_have_incdir" = no ; then
5912                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5913
5914 echo "${as_me:-configure}:5914: testing adding $cf_add_incdir to include-path ..." 1>&5
5915
5916                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5917
5918                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5919                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5920                   cf_add_incdir="$cf_top_incdir"
5921                 else
5922                   break
5923                 fi
5924           else
5925                 break
5926           fi
5927         done
5928   done
5929 fi
5930
5931 fi
5932
5933 # Set definitions to allow ifdef'ing for ncurses.h
5934
5935 case "$cf_cv_ncurses_header" in
5936 (*ncurses.h)
5937
5938 cat >>confdefs.h <<\EOF
5939 #define HAVE_NCURSES_H 1
5940 EOF
5941
5942         ;;
5943 esac
5944
5945 case "$cf_cv_ncurses_header" in
5946 (ncurses/curses.h|ncurses/ncurses.h)
5947
5948 cat >>confdefs.h <<\EOF
5949 #define HAVE_NCURSES_NCURSES_H 1
5950 EOF
5951
5952         ;;
5953 (ncursesw/curses.h|ncursesw/ncurses.h)
5954
5955 cat >>confdefs.h <<\EOF
5956 #define HAVE_NCURSESW_NCURSES_H 1
5957 EOF
5958
5959         ;;
5960 esac
5961
5962 echo "$as_me:5962: checking for terminfo header" >&5
5963 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5964 if test "${cf_cv_term_header+set}" = set; then
5965   echo $ECHO_N "(cached) $ECHO_C" >&6
5966 else
5967
5968 case "${cf_cv_ncurses_header}" in
5969 (*/ncurses.h|*/ncursesw.h)
5970         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5971         ;;
5972 (*)
5973         cf_term_header=term.h
5974         ;;
5975 esac
5976
5977 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5978 do
5979 cat >"conftest.$ac_ext" <<_ACEOF
5980 #line 5980 "configure"
5981 #include "confdefs.h"
5982 #include <stdio.h>
5983 #include <${cf_cv_ncurses_header:-curses.h}>
5984 #include <$cf_test>
5985
5986 int
5987 main (void)
5988 {
5989 int x = auto_left_margin; (void)x
5990   ;
5991   return 0;
5992 }
5993 _ACEOF
5994 rm -f "conftest.$ac_objext"
5995 if { (eval echo "$as_me:5995: \"$ac_compile\"") >&5
5996   (eval $ac_compile) 2>&5
5997   ac_status=$?
5998   echo "$as_me:5998: \$? = $ac_status" >&5
5999   (exit "$ac_status"); } &&
6000          { ac_try='test -s "conftest.$ac_objext"'
6001   { (eval echo "$as_me:6001: \"$ac_try\"") >&5
6002   (eval $ac_try) 2>&5
6003   ac_status=$?
6004   echo "$as_me:6004: \$? = $ac_status" >&5
6005   (exit "$ac_status"); }; }; then
6006
6007         cf_cv_term_header="$cf_test"
6008 else
6009   echo "$as_me: failed program was:" >&5
6010 cat "conftest.$ac_ext" >&5
6011
6012         cf_cv_term_header=unknown
6013
6014 fi
6015 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6016         test "$cf_cv_term_header" != unknown && break
6017 done
6018
6019 fi
6020 echo "$as_me:6020: result: $cf_cv_term_header" >&5
6021 echo "${ECHO_T}$cf_cv_term_header" >&6
6022
6023 # Set definitions to allow ifdef'ing to accommodate subdirectories
6024
6025 case "$cf_cv_term_header" in
6026 (*term.h)
6027
6028 cat >>confdefs.h <<\EOF
6029 #define HAVE_TERM_H 1
6030 EOF
6031
6032         ;;
6033 esac
6034
6035 case "$cf_cv_term_header" in
6036 (ncurses/term.h)
6037
6038 cat >>confdefs.h <<\EOF
6039 #define HAVE_NCURSES_TERM_H 1
6040 EOF
6041
6042         ;;
6043 (ncursesw/term.h)
6044
6045 cat >>confdefs.h <<\EOF
6046 #define HAVE_NCURSESW_TERM_H 1
6047 EOF
6048
6049         ;;
6050 esac
6051
6052 # some applications need this, but should check for NCURSES_VERSION
6053
6054 cat >>confdefs.h <<\EOF
6055 #define NCURSES 1
6056 EOF
6057
6058 echo "$as_me:6058: checking for ncurses version" >&5
6059 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6060 if test "${cf_cv_ncurses_version+set}" = set; then
6061   echo $ECHO_N "(cached) $ECHO_C" >&6
6062 else
6063
6064         cf_cv_ncurses_version=no
6065         cf_tempfile=out$$
6066         rm -f "$cf_tempfile"
6067         if test "$cross_compiling" = yes; then
6068
6069         # This will not work if the preprocessor splits the line after the
6070         # Autoconf token.  The 'unproto' program does that.
6071         cat > "conftest.$ac_ext" <<EOF
6072 #include <${cf_cv_ncurses_header:-curses.h}>
6073 #undef Autoconf
6074 #ifdef NCURSES_VERSION
6075 Autoconf NCURSES_VERSION
6076 #else
6077 #ifdef __NCURSES_H
6078 Autoconf "old"
6079 #endif
6080 ;
6081 #endif
6082 EOF
6083         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6084         { (eval echo "$as_me:6084: \"$cf_try\"") >&5
6085   (eval $cf_try) 2>&5
6086   ac_status=$?
6087   echo "$as_me:6087: \$? = $ac_status" >&5
6088   (exit "$ac_status"); }
6089         if test -f conftest.out ; then
6090                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6091                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6092                 rm -f conftest.out
6093         fi
6094
6095 else
6096   cat >"conftest.$ac_ext" <<_ACEOF
6097 #line 6097 "configure"
6098 #include "confdefs.h"
6099
6100 $ac_includes_default
6101
6102 #include <${cf_cv_ncurses_header:-curses.h}>
6103
6104 int main(void)
6105 {
6106         FILE *fp = fopen("$cf_tempfile", "w");
6107 #ifdef NCURSES_VERSION
6108 # ifdef NCURSES_VERSION_PATCH
6109         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6110 # else
6111         fprintf(fp, "%s\\n", NCURSES_VERSION);
6112 # endif
6113 #else
6114 # ifdef __NCURSES_H
6115         fprintf(fp, "old\\n");
6116 # else
6117         make an error
6118 # endif
6119 #endif
6120         ${cf_cv_main_return:-return}(0);
6121 }
6122 _ACEOF
6123 rm -f "conftest$ac_exeext"
6124 if { (eval echo "$as_me:6124: \"$ac_link\"") >&5
6125   (eval $ac_link) 2>&5
6126   ac_status=$?
6127   echo "$as_me:6127: \$? = $ac_status" >&5
6128   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6129   { (eval echo "$as_me:6129: \"$ac_try\"") >&5
6130   (eval $ac_try) 2>&5
6131   ac_status=$?
6132   echo "$as_me:6132: \$? = $ac_status" >&5
6133   (exit "$ac_status"); }; }; then
6134
6135         cf_cv_ncurses_version=`cat $cf_tempfile`
6136 else
6137   echo "$as_me: program exited with status $ac_status" >&5
6138 echo "$as_me: failed program was:" >&5
6139 cat "conftest.$ac_ext" >&5
6140 fi
6141 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6142 fi
6143         rm -f "$cf_tempfile"
6144
6145 fi
6146 echo "$as_me:6146: result: $cf_cv_ncurses_version" >&5
6147 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6148 test "$cf_cv_ncurses_version" = no ||
6149 cat >>confdefs.h <<\EOF
6150 #define NCURSES 1
6151 EOF
6152
6153 cf_nculib_root=ncurses
6154         # This works, except for the special case where we find gpm, but
6155         # ncurses is in a nonstandard location via $LIBS, and we really want
6156         # to link gpm.
6157 cf_ncurses_LIBS=""
6158 cf_ncurses_SAVE="$LIBS"
6159 echo "$as_me:6159: checking for Gpm_Open in -lgpm" >&5
6160 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6161 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6162   echo $ECHO_N "(cached) $ECHO_C" >&6
6163 else
6164   ac_check_lib_save_LIBS=$LIBS
6165 LIBS="-lgpm  $LIBS"
6166 cat >"conftest.$ac_ext" <<_ACEOF
6167 #line 6167 "configure"
6168 #include "confdefs.h"
6169
6170 /* Override any gcc2 internal prototype to avoid an error.  */
6171 #ifdef __cplusplus
6172 extern "C"
6173 #endif
6174 /* We use char because int might match the return type of a gcc2
6175    builtin and then its argument prototype would still apply.  */
6176 char Gpm_Open ();
6177 int
6178 main (void)
6179 {
6180 Gpm_Open ();
6181   ;
6182   return 0;
6183 }
6184 _ACEOF
6185 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6186 if { (eval echo "$as_me:6186: \"$ac_link\"") >&5
6187   (eval $ac_link) 2>&5
6188   ac_status=$?
6189   echo "$as_me:6189: \$? = $ac_status" >&5
6190   (exit "$ac_status"); } &&
6191          { ac_try='test -s "conftest$ac_exeext"'
6192   { (eval echo "$as_me:6192: \"$ac_try\"") >&5
6193   (eval $ac_try) 2>&5
6194   ac_status=$?
6195   echo "$as_me:6195: \$? = $ac_status" >&5
6196   (exit "$ac_status"); }; }; then
6197   ac_cv_lib_gpm_Gpm_Open=yes
6198 else
6199   echo "$as_me: failed program was:" >&5
6200 cat "conftest.$ac_ext" >&5
6201 ac_cv_lib_gpm_Gpm_Open=no
6202 fi
6203 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6204 LIBS=$ac_check_lib_save_LIBS
6205 fi
6206 echo "$as_me:6206: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6207 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6208 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6209   echo "$as_me:6209: checking for initscr in -lgpm" >&5
6210 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6211 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6212   echo $ECHO_N "(cached) $ECHO_C" >&6
6213 else
6214   ac_check_lib_save_LIBS=$LIBS
6215 LIBS="-lgpm  $LIBS"
6216 cat >"conftest.$ac_ext" <<_ACEOF
6217 #line 6217 "configure"
6218 #include "confdefs.h"
6219
6220 /* Override any gcc2 internal prototype to avoid an error.  */
6221 #ifdef __cplusplus
6222 extern "C"
6223 #endif
6224 /* We use char because int might match the return type of a gcc2
6225    builtin and then its argument prototype would still apply.  */
6226 char initscr ();
6227 int
6228 main (void)
6229 {
6230 initscr ();
6231   ;
6232   return 0;
6233 }
6234 _ACEOF
6235 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6236 if { (eval echo "$as_me:6236: \"$ac_link\"") >&5
6237   (eval $ac_link) 2>&5
6238   ac_status=$?
6239   echo "$as_me:6239: \$? = $ac_status" >&5
6240   (exit "$ac_status"); } &&
6241          { ac_try='test -s "conftest$ac_exeext"'
6242   { (eval echo "$as_me:6242: \"$ac_try\"") >&5
6243   (eval $ac_try) 2>&5
6244   ac_status=$?
6245   echo "$as_me:6245: \$? = $ac_status" >&5
6246   (exit "$ac_status"); }; }; then
6247   ac_cv_lib_gpm_initscr=yes
6248 else
6249   echo "$as_me: failed program was:" >&5
6250 cat "conftest.$ac_ext" >&5
6251 ac_cv_lib_gpm_initscr=no
6252 fi
6253 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6254 LIBS=$ac_check_lib_save_LIBS
6255 fi
6256 echo "$as_me:6256: result: $ac_cv_lib_gpm_initscr" >&5
6257 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6258 if test "$ac_cv_lib_gpm_initscr" = yes; then
6259   LIBS="$cf_ncurses_SAVE"
6260 else
6261   cf_ncurses_LIBS="-lgpm"
6262 fi
6263
6264 fi
6265
6266 case "$host_os" in
6267 (freebsd*)
6268         # This is only necessary if you are linking against an obsolete
6269         # version of ncurses (but it should do no harm, since it is static).
6270         if test "$cf_nculib_root" = ncurses ; then
6271                 echo "$as_me:6271: checking for tgoto in -lmytinfo" >&5
6272 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6273 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6274   echo $ECHO_N "(cached) $ECHO_C" >&6
6275 else
6276   ac_check_lib_save_LIBS=$LIBS
6277 LIBS="-lmytinfo  $LIBS"
6278 cat >"conftest.$ac_ext" <<_ACEOF
6279 #line 6279 "configure"
6280 #include "confdefs.h"
6281
6282 /* Override any gcc2 internal prototype to avoid an error.  */
6283 #ifdef __cplusplus
6284 extern "C"
6285 #endif
6286 /* We use char because int might match the return type of a gcc2
6287    builtin and then its argument prototype would still apply.  */
6288 char tgoto ();
6289 int
6290 main (void)
6291 {
6292 tgoto ();
6293   ;
6294   return 0;
6295 }
6296 _ACEOF
6297 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6298 if { (eval echo "$as_me:6298: \"$ac_link\"") >&5
6299   (eval $ac_link) 2>&5
6300   ac_status=$?
6301   echo "$as_me:6301: \$? = $ac_status" >&5
6302   (exit "$ac_status"); } &&
6303          { ac_try='test -s "conftest$ac_exeext"'
6304   { (eval echo "$as_me:6304: \"$ac_try\"") >&5
6305   (eval $ac_try) 2>&5
6306   ac_status=$?
6307   echo "$as_me:6307: \$? = $ac_status" >&5
6308   (exit "$ac_status"); }; }; then
6309   ac_cv_lib_mytinfo_tgoto=yes
6310 else
6311   echo "$as_me: failed program was:" >&5
6312 cat "conftest.$ac_ext" >&5
6313 ac_cv_lib_mytinfo_tgoto=no
6314 fi
6315 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6316 LIBS=$ac_check_lib_save_LIBS
6317 fi
6318 echo "$as_me:6318: result: $ac_cv_lib_mytinfo_tgoto" >&5
6319 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6320 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6321   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6322 fi
6323
6324         fi
6325         ;;
6326 esac
6327
6328 cf_add_libs="$LIBS"
6329 # reverse order
6330 cf_add_0lib=
6331 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6332 # filter duplicates
6333 for cf_add_1lib in $cf_add_0lib; do
6334         for cf_add_2lib in $cf_add_libs; do
6335                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6336                         cf_add_1lib=
6337                         break
6338                 fi
6339         done
6340         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6341 done
6342 LIBS="$cf_add_libs"
6343
6344 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6345 then
6346
6347 cf_add_libs="$LIBS"
6348 # reverse order
6349 cf_add_0lib=
6350 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6351 # filter duplicates
6352 for cf_add_1lib in $cf_add_0lib; do
6353         for cf_add_2lib in $cf_add_libs; do
6354                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6355                         cf_add_1lib=
6356                         break
6357                 fi
6358         done
6359         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6360 done
6361 LIBS="$cf_add_libs"
6362
6363 else
6364
6365         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6366         cf_libdir=""
6367         echo "$as_me:6367: checking for initscr" >&5
6368 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6369 if test "${ac_cv_func_initscr+set}" = set; then
6370   echo $ECHO_N "(cached) $ECHO_C" >&6
6371 else
6372   cat >"conftest.$ac_ext" <<_ACEOF
6373 #line 6373 "configure"
6374 #include "confdefs.h"
6375 #define initscr autoconf_temporary
6376 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6377 #undef initscr
6378
6379 #ifdef __cplusplus
6380 extern "C"
6381 #endif
6382
6383 /* We use char because int might match the return type of a gcc2
6384    builtin and then its argument prototype would still apply.  */
6385 char initscr (void);
6386
6387 int
6388 main (void)
6389 {
6390
6391 /* The GNU C library defines stubs for functions which it implements
6392     to always fail with ENOSYS.  Some functions are actually named
6393     something starting with __ and the normal name is an alias.  */
6394 #if defined (__stub_initscr) || defined (__stub___initscr)
6395 #error found stub for initscr
6396 #endif
6397
6398         return initscr ();
6399   ;
6400   return 0;
6401 }
6402 _ACEOF
6403 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6404 if { (eval echo "$as_me:6404: \"$ac_link\"") >&5
6405   (eval $ac_link) 2>&5
6406   ac_status=$?
6407   echo "$as_me:6407: \$? = $ac_status" >&5
6408   (exit "$ac_status"); } &&
6409          { ac_try='test -s "conftest$ac_exeext"'
6410   { (eval echo "$as_me:6410: \"$ac_try\"") >&5
6411   (eval $ac_try) 2>&5
6412   ac_status=$?
6413   echo "$as_me:6413: \$? = $ac_status" >&5
6414   (exit "$ac_status"); }; }; then
6415   ac_cv_func_initscr=yes
6416 else
6417   echo "$as_me: failed program was:" >&5
6418 cat "conftest.$ac_ext" >&5
6419 ac_cv_func_initscr=no
6420 fi
6421 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6422 fi
6423 echo "$as_me:6423: result: $ac_cv_func_initscr" >&5
6424 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6425 if test "$ac_cv_func_initscr" = yes; then
6426   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6427 else
6428
6429                 cf_save_LIBS="$LIBS"
6430                 echo "$as_me:6430: checking for initscr in -l$cf_nculib_root" >&5
6431 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6432                 LIBS="-l$cf_nculib_root $LIBS"
6433                 cat >"conftest.$ac_ext" <<_ACEOF
6434 #line 6434 "configure"
6435 #include "confdefs.h"
6436 #include <${cf_cv_ncurses_header:-curses.h}>
6437 int
6438 main (void)
6439 {
6440 initscr()
6441   ;
6442   return 0;
6443 }
6444 _ACEOF
6445 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6446 if { (eval echo "$as_me:6446: \"$ac_link\"") >&5
6447   (eval $ac_link) 2>&5
6448   ac_status=$?
6449   echo "$as_me:6449: \$? = $ac_status" >&5
6450   (exit "$ac_status"); } &&
6451          { ac_try='test -s "conftest$ac_exeext"'
6452   { (eval echo "$as_me:6452: \"$ac_try\"") >&5
6453   (eval $ac_try) 2>&5
6454   ac_status=$?
6455   echo "$as_me:6455: \$? = $ac_status" >&5
6456   (exit "$ac_status"); }; }; then
6457   echo "$as_me:6457: result: yes" >&5
6458 echo "${ECHO_T}yes" >&6
6459                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6460
6461 else
6462   echo "$as_me: failed program was:" >&5
6463 cat "conftest.$ac_ext" >&5
6464 echo "$as_me:6464: result: no" >&5
6465 echo "${ECHO_T}no" >&6
6466
6467 cf_search=
6468 cf_library_path_list=""
6469 if test -n "${LDFLAGS}${LIBS}" ; then
6470         for cf_library_path in $LDFLAGS $LIBS
6471         do
6472                 case "$cf_library_path" in
6473                 (-L*)
6474                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6475
6476 test "x$cf_library_path" != "xNONE" && \
6477 test -d "$cf_library_path" && \
6478  {
6479         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6480         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6481         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6482         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6483         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6484         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"
6485 }
6486
6487                         cf_library_path_list="$cf_library_path_list $cf_search"
6488                         ;;
6489                 esac
6490         done
6491 fi
6492
6493 cf_search=
6494
6495 test "x$prefix" != "xNONE" && \
6496 test -d "$prefix" && \
6497  {
6498         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6499         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6500         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6501         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6502         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6503         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6504 }
6505
6506 for cf_subdir_prefix in \
6507         /usr \
6508         /usr/local \
6509         /usr/pkg \
6510         /opt \
6511         /opt/local \
6512         $HOME
6513 do
6514
6515 test "x$cf_subdir_prefix" != "x$prefix" && \
6516 test -d "$cf_subdir_prefix" && \
6517 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6518         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6519         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6520         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6521         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6522         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6523         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"
6524 }
6525
6526 done
6527
6528 cf_search="$cf_library_path_list $cf_search"
6529
6530                         for cf_libdir in $cf_search
6531                         do
6532                                 echo "$as_me:6532: checking for -l$cf_nculib_root in $cf_libdir" >&5
6533 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6534                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6535                                 cat >"conftest.$ac_ext" <<_ACEOF
6536 #line 6536 "configure"
6537 #include "confdefs.h"
6538 #include <${cf_cv_ncurses_header:-curses.h}>
6539 int
6540 main (void)
6541 {
6542 initscr()
6543   ;
6544   return 0;
6545 }
6546 _ACEOF
6547 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6548 if { (eval echo "$as_me:6548: \"$ac_link\"") >&5
6549   (eval $ac_link) 2>&5
6550   ac_status=$?
6551   echo "$as_me:6551: \$? = $ac_status" >&5
6552   (exit "$ac_status"); } &&
6553          { ac_try='test -s "conftest$ac_exeext"'
6554   { (eval echo "$as_me:6554: \"$ac_try\"") >&5
6555   (eval $ac_try) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit "$ac_status"); }; }; then
6559   echo "$as_me:6559: result: yes" >&5
6560 echo "${ECHO_T}yes" >&6
6561                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6562                                          break
6563 else
6564   echo "$as_me: failed program was:" >&5
6565 cat "conftest.$ac_ext" >&5
6566 echo "$as_me:6566: result: no" >&5
6567 echo "${ECHO_T}no" >&6
6568                                          LIBS="$cf_save_LIBS"
6569 fi
6570 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6571                         done
6572
6573 fi
6574 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6575
6576 fi
6577
6578 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6579
6580 if test "$cf_found_library" = no ; then
6581         { { echo "$as_me:6581: error: Cannot link $cf_nculib_root library" >&5
6582 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6583    { (exit 1); exit 1; }; }
6584 fi
6585
6586 fi
6587
6588 if test -n "$cf_ncurses_LIBS" ; then
6589         echo "$as_me:6589: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6590 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6591         cf_ncurses_SAVE="$LIBS"
6592         for p in $cf_ncurses_LIBS ; do
6593                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6594                 if test "$q" != "$LIBS" ; then
6595                         LIBS="$q"
6596                 fi
6597         done
6598         cat >"conftest.$ac_ext" <<_ACEOF
6599 #line 6599 "configure"
6600 #include "confdefs.h"
6601 #include <${cf_cv_ncurses_header:-curses.h}>
6602 int
6603 main (void)
6604 {
6605 initscr(); mousemask(0,0); tigetstr((char *)0);
6606   ;
6607   return 0;
6608 }
6609 _ACEOF
6610 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6611 if { (eval echo "$as_me:6611: \"$ac_link\"") >&5
6612   (eval $ac_link) 2>&5
6613   ac_status=$?
6614   echo "$as_me:6614: \$? = $ac_status" >&5
6615   (exit "$ac_status"); } &&
6616          { ac_try='test -s "conftest$ac_exeext"'
6617   { (eval echo "$as_me:6617: \"$ac_try\"") >&5
6618   (eval $ac_try) 2>&5
6619   ac_status=$?
6620   echo "$as_me:6620: \$? = $ac_status" >&5
6621   (exit "$ac_status"); }; }; then
6622   echo "$as_me:6622: result: yes" >&5
6623 echo "${ECHO_T}yes" >&6
6624 else
6625   echo "$as_me: failed program was:" >&5
6626 cat "conftest.$ac_ext" >&5
6627 echo "$as_me:6627: result: no" >&5
6628 echo "${ECHO_T}no" >&6
6629                  LIBS="$cf_ncurses_SAVE"
6630 fi
6631 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6632 fi
6633
6634 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6635
6636 cat >>confdefs.h <<EOF
6637 #define $cf_nculib_ROOT 1
6638 EOF
6639
6640         fi
6641 else
6642         NCURSES_CONFIG=none
6643 fi
6644
6645 echo "$as_me:6645: checking if you want wide-character code" >&5
6646 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6647
6648 # Check whether --enable-widec or --disable-widec was given.
6649 if test "${enable_widec+set}" = set; then
6650   enableval="$enable_widec"
6651   with_widec=$enableval
6652 else
6653   with_widec=no
6654 fi;
6655 echo "$as_me:6655: result: $with_widec" >&5
6656 echo "${ECHO_T}$with_widec" >&6
6657 if test "$with_widec" = yes ; then
6658
6659 for ac_header in wchar.h
6660 do
6661 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6662 echo "$as_me:6662: checking for $ac_header" >&5
6663 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6664 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6665   echo $ECHO_N "(cached) $ECHO_C" >&6
6666 else
6667   cat >"conftest.$ac_ext" <<_ACEOF
6668 #line 6668 "configure"
6669 #include "confdefs.h"
6670 #include <$ac_header>
6671 _ACEOF
6672 if { (eval echo "$as_me:6672: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6673   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6674   ac_status=$?
6675   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6676   rm -f conftest.er1
6677   cat conftest.err >&5
6678   echo "$as_me:6678: \$? = $ac_status" >&5
6679   (exit "$ac_status"); } >/dev/null; then
6680   if test -s conftest.err; then
6681     ac_cpp_err=$ac_c_preproc_warn_flag
6682   else
6683     ac_cpp_err=
6684   fi
6685 else
6686   ac_cpp_err=yes
6687 fi
6688 if test -z "$ac_cpp_err"; then
6689   eval "$as_ac_Header=yes"
6690 else
6691   echo "$as_me: failed program was:" >&5
6692   cat "conftest.$ac_ext" >&5
6693   eval "$as_ac_Header=no"
6694 fi
6695 rm -f conftest.err "conftest.$ac_ext"
6696 fi
6697 echo "$as_me:6697: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6698 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6699 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6700   cat >>confdefs.h <<EOF
6701 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6702 EOF
6703
6704 fi
6705 done
6706
6707 echo "$as_me:6707: checking for multibyte character support" >&5
6708 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6709 if test "${cf_cv_utf8_lib+set}" = set; then
6710   echo $ECHO_N "(cached) $ECHO_C" >&6
6711 else
6712
6713         cf_save_LIBS="$LIBS"
6714         cat >"conftest.$ac_ext" <<_ACEOF
6715 #line 6715 "configure"
6716 #include "confdefs.h"
6717
6718 $ac_includes_default
6719 #ifdef HAVE_WCHAR_H
6720 #include <wchar.h>
6721 #endif
6722
6723 int
6724 main (void)
6725 {
6726 putwc(0,0);
6727   ;
6728   return 0;
6729 }
6730 _ACEOF
6731 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6732 if { (eval echo "$as_me:6732: \"$ac_link\"") >&5
6733   (eval $ac_link) 2>&5
6734   ac_status=$?
6735   echo "$as_me:6735: \$? = $ac_status" >&5
6736   (exit "$ac_status"); } &&
6737          { ac_try='test -s "conftest$ac_exeext"'
6738   { (eval echo "$as_me:6738: \"$ac_try\"") >&5
6739   (eval $ac_try) 2>&5
6740   ac_status=$?
6741   echo "$as_me:6741: \$? = $ac_status" >&5
6742   (exit "$ac_status"); }; }; then
6743   cf_cv_utf8_lib=yes
6744 else
6745   echo "$as_me: failed program was:" >&5
6746 cat "conftest.$ac_ext" >&5
6747
6748 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6749 # will be set on completion of the AC_TRY_LINK below.
6750 cf_cv_header_path_utf8=
6751 cf_cv_library_path_utf8=
6752
6753 echo "${as_me:-configure}:6753: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6754
6755 cf_save_LIBS="$LIBS"
6756
6757 cat >"conftest.$ac_ext" <<_ACEOF
6758 #line 6758 "configure"
6759 #include "confdefs.h"
6760
6761 #include <libutf8.h>
6762 int
6763 main (void)
6764 {
6765 putwc(0,0);
6766   ;
6767   return 0;
6768 }
6769 _ACEOF
6770 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6771 if { (eval echo "$as_me:6771: \"$ac_link\"") >&5
6772   (eval $ac_link) 2>&5
6773   ac_status=$?
6774   echo "$as_me:6774: \$? = $ac_status" >&5
6775   (exit "$ac_status"); } &&
6776          { ac_try='test -s "conftest$ac_exeext"'
6777   { (eval echo "$as_me:6777: \"$ac_try\"") >&5
6778   (eval $ac_try) 2>&5
6779   ac_status=$?
6780   echo "$as_me:6780: \$? = $ac_status" >&5
6781   (exit "$ac_status"); }; }; then
6782
6783         cf_cv_find_linkage_utf8=yes
6784         cf_cv_header_path_utf8=/usr/include
6785         cf_cv_library_path_utf8=/usr/lib
6786
6787 else
6788   echo "$as_me: failed program was:" >&5
6789 cat "conftest.$ac_ext" >&5
6790
6791 LIBS="-lutf8  $cf_save_LIBS"
6792
6793 cat >"conftest.$ac_ext" <<_ACEOF
6794 #line 6794 "configure"
6795 #include "confdefs.h"
6796
6797 #include <libutf8.h>
6798 int
6799 main (void)
6800 {
6801 putwc(0,0);
6802   ;
6803   return 0;
6804 }
6805 _ACEOF
6806 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6807 if { (eval echo "$as_me:6807: \"$ac_link\"") >&5
6808   (eval $ac_link) 2>&5
6809   ac_status=$?
6810   echo "$as_me:6810: \$? = $ac_status" >&5
6811   (exit "$ac_status"); } &&
6812          { ac_try='test -s "conftest$ac_exeext"'
6813   { (eval echo "$as_me:6813: \"$ac_try\"") >&5
6814   (eval $ac_try) 2>&5
6815   ac_status=$?
6816   echo "$as_me:6816: \$? = $ac_status" >&5
6817   (exit "$ac_status"); }; }; then
6818
6819         cf_cv_find_linkage_utf8=yes
6820         cf_cv_header_path_utf8=/usr/include
6821         cf_cv_library_path_utf8=/usr/lib
6822         cf_cv_library_file_utf8="-lutf8"
6823
6824 else
6825   echo "$as_me: failed program was:" >&5
6826 cat "conftest.$ac_ext" >&5
6827
6828         cf_cv_find_linkage_utf8=no
6829         LIBS="$cf_save_LIBS"
6830
6831         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6832
6833 echo "${as_me:-configure}:6833: testing find linkage for utf8 library ..." 1>&5
6834
6835 echo "${as_me:-configure}:6835: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6836
6837         cf_save_CPPFLAGS="$CPPFLAGS"
6838         cf_test_CPPFLAGS="$CPPFLAGS"
6839
6840 cf_search=
6841
6842 # collect the current set of include-directories from compiler flags
6843 cf_header_path_list=""
6844 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6845         for cf_header_path in $CPPFLAGS $CFLAGS
6846         do
6847                 case "$cf_header_path" in
6848                 (-I*)
6849                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6850
6851 test "x$cf_header_path" != "xNONE" && \
6852 test -d "$cf_header_path" && \
6853  {
6854         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6855         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6856         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6857         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6858         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6859         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6860 }
6861
6862                         cf_header_path_list="$cf_header_path_list $cf_search"
6863                         ;;
6864                 esac
6865         done
6866 fi
6867
6868 # add the variations for the package we are looking for
6869
6870 cf_search=
6871
6872 test "x$prefix" != "xNONE" && \
6873 test -d "$prefix" && \
6874  {
6875         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6876         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6877         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6878         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6879         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6880         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6881 }
6882
6883 for cf_subdir_prefix in \
6884         /usr \
6885         /usr/local \
6886         /usr/pkg \
6887         /opt \
6888         /opt/local \
6889         $HOME
6890 do
6891
6892 test "x$cf_subdir_prefix" != "x$prefix" && \
6893 test -d "$cf_subdir_prefix" && \
6894 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6895         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6896         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6897         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6898         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6899         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6900         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6901 }
6902
6903 done
6904
6905 test "$includedir" != NONE && \
6906 test "$includedir" != "/usr/include" && \
6907 test -d "$includedir" && {
6908         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6909         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6910 }
6911
6912 test "$oldincludedir" != NONE && \
6913 test "$oldincludedir" != "/usr/include" && \
6914 test -d "$oldincludedir" && {
6915         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6916         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6917 }
6918
6919 cf_search="$cf_search $cf_header_path_list"
6920
6921         for cf_cv_header_path_utf8 in $cf_search
6922         do
6923                 if test -d "$cf_cv_header_path_utf8" ; then
6924                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6925
6926 echo "${as_me:-configure}:6926: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6927
6928                         CPPFLAGS="$cf_save_CPPFLAGS"
6929
6930         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6931         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6932
6933                         cat >"conftest.$ac_ext" <<_ACEOF
6934 #line 6934 "configure"
6935 #include "confdefs.h"
6936
6937 #include <libutf8.h>
6938 int
6939 main (void)
6940 {
6941 putwc(0,0);
6942   ;
6943   return 0;
6944 }
6945 _ACEOF
6946 rm -f "conftest.$ac_objext"
6947 if { (eval echo "$as_me:6947: \"$ac_compile\"") >&5
6948   (eval $ac_compile) 2>&5
6949   ac_status=$?
6950   echo "$as_me:6950: \$? = $ac_status" >&5
6951   (exit "$ac_status"); } &&
6952          { ac_try='test -s "conftest.$ac_objext"'
6953   { (eval echo "$as_me:6953: \"$ac_try\"") >&5
6954   (eval $ac_try) 2>&5
6955   ac_status=$?
6956   echo "$as_me:6956: \$? = $ac_status" >&5
6957   (exit "$ac_status"); }; }; then
6958
6959                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6960
6961 echo "${as_me:-configure}:6961: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6962
6963                                 cf_cv_find_linkage_utf8=maybe
6964                                 cf_test_CPPFLAGS="$CPPFLAGS"
6965                                 break
6966 else
6967   echo "$as_me: failed program was:" >&5
6968 cat "conftest.$ac_ext" >&5
6969
6970                                 CPPFLAGS="$cf_save_CPPFLAGS"
6971
6972 fi
6973 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6974                 fi
6975         done
6976
6977         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6978
6979 echo "${as_me:-configure}:6979: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6980
6981                 cf_save_LIBS="$LIBS"
6982                 cf_save_LDFLAGS="$LDFLAGS"
6983
6984                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6985
6986 cf_search=
6987 cf_library_path_list=""
6988 if test -n "${LDFLAGS}${LIBS}" ; then
6989         for cf_library_path in $LDFLAGS $LIBS
6990         do
6991                 case "$cf_library_path" in
6992                 (-L*)
6993                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6994
6995 test "x$cf_library_path" != "xNONE" && \
6996 test -d "$cf_library_path" && \
6997  {
6998         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6999         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7000         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7001         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7002         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7003         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7004 }
7005
7006                         cf_library_path_list="$cf_library_path_list $cf_search"
7007                         ;;
7008                 esac
7009         done
7010 fi
7011
7012 cf_search=
7013
7014 test "x$prefix" != "xNONE" && \
7015 test -d "$prefix" && \
7016  {
7017         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7018         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7019         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7020         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7021         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7022         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7023 }
7024
7025 for cf_subdir_prefix in \
7026         /usr \
7027         /usr/local \
7028         /usr/pkg \
7029         /opt \
7030         /opt/local \
7031         $HOME
7032 do
7033
7034 test "x$cf_subdir_prefix" != "x$prefix" && \
7035 test -d "$cf_subdir_prefix" && \
7036 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7037         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7038         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7039         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7040         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7041         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7042         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7043 }
7044
7045 done
7046
7047 cf_search="$cf_library_path_list $cf_search"
7048
7049                         for cf_cv_library_path_utf8 in $cf_search
7050                         do
7051                                 if test -d "$cf_cv_library_path_utf8" ; then
7052                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7053
7054 echo "${as_me:-configure}:7054: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7055
7056                                         CPPFLAGS="$cf_test_CPPFLAGS"
7057                                         LIBS="-lutf8  $cf_save_LIBS"
7058                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7059                                         cat >"conftest.$ac_ext" <<_ACEOF
7060 #line 7060 "configure"
7061 #include "confdefs.h"
7062
7063 #include <libutf8.h>
7064 int
7065 main (void)
7066 {
7067 putwc(0,0);
7068   ;
7069   return 0;
7070 }
7071 _ACEOF
7072 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7073 if { (eval echo "$as_me:7073: \"$ac_link\"") >&5
7074   (eval $ac_link) 2>&5
7075   ac_status=$?
7076   echo "$as_me:7076: \$? = $ac_status" >&5
7077   (exit "$ac_status"); } &&
7078          { ac_try='test -s "conftest$ac_exeext"'
7079   { (eval echo "$as_me:7079: \"$ac_try\"") >&5
7080   (eval $ac_try) 2>&5
7081   ac_status=$?
7082   echo "$as_me:7082: \$? = $ac_status" >&5
7083   (exit "$ac_status"); }; }; then
7084
7085                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7086
7087 echo "${as_me:-configure}:7087: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7088
7089                                         cf_cv_find_linkage_utf8=yes
7090                                         cf_cv_library_file_utf8="-lutf8"
7091                                         break
7092 else
7093   echo "$as_me: failed program was:" >&5
7094 cat "conftest.$ac_ext" >&5
7095
7096                                         CPPFLAGS="$cf_save_CPPFLAGS"
7097                                         LIBS="$cf_save_LIBS"
7098                                         LDFLAGS="$cf_save_LDFLAGS"
7099
7100 fi
7101 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7102                                 fi
7103                         done
7104                         CPPFLAGS="$cf_save_CPPFLAGS"
7105                         LDFLAGS="$cf_save_LDFLAGS"
7106                 fi
7107
7108         else
7109                 cf_cv_find_linkage_utf8=no
7110         fi
7111
7112 fi
7113 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7114
7115 fi
7116 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7117
7118 LIBS="$cf_save_LIBS"
7119
7120 if test "$cf_cv_find_linkage_utf8" = yes ; then
7121 cf_cv_utf8_lib=add-on
7122 else
7123 cf_cv_utf8_lib=no
7124 fi
7125
7126 fi
7127 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7128 fi
7129 echo "$as_me:7129: result: $cf_cv_utf8_lib" >&5
7130 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7131
7132 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7133 # ncurses/ncursesw:
7134 if test "$cf_cv_utf8_lib" = "add-on" ; then
7135
7136 cat >>confdefs.h <<\EOF
7137 #define HAVE_LIBUTF8_H 1
7138 EOF
7139
7140 if test -n "$cf_cv_header_path_utf8" ; then
7141   for cf_add_incdir in $cf_cv_header_path_utf8
7142   do
7143         while test "$cf_add_incdir" != /usr/include
7144         do
7145           if test -d "$cf_add_incdir"
7146           then
7147                 cf_have_incdir=no
7148                 if test -n "$CFLAGS$CPPFLAGS" ; then
7149                   # a loop is needed to ensure we can add subdirs of existing dirs
7150                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7151                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7152                           cf_have_incdir=yes; break
7153                         fi
7154                   done
7155                 fi
7156
7157                 if test "$cf_have_incdir" = no ; then
7158                   if test "$cf_add_incdir" = /usr/local/include ; then
7159                         if test "$GCC" = yes
7160                         then
7161                           cf_save_CPPFLAGS=$CPPFLAGS
7162
7163         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7164         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7165
7166                           cat >"conftest.$ac_ext" <<_ACEOF
7167 #line 7167 "configure"
7168 #include "confdefs.h"
7169 #include <stdio.h>
7170 int
7171 main (void)
7172 {
7173 printf("Hello")
7174   ;
7175   return 0;
7176 }
7177 _ACEOF
7178 rm -f "conftest.$ac_objext"
7179 if { (eval echo "$as_me:7179: \"$ac_compile\"") >&5
7180   (eval $ac_compile) 2>&5
7181   ac_status=$?
7182   echo "$as_me:7182: \$? = $ac_status" >&5
7183   (exit "$ac_status"); } &&
7184          { ac_try='test -s "conftest.$ac_objext"'
7185   { (eval echo "$as_me:7185: \"$ac_try\"") >&5
7186   (eval $ac_try) 2>&5
7187   ac_status=$?
7188   echo "$as_me:7188: \$? = $ac_status" >&5
7189   (exit "$ac_status"); }; }; then
7190   :
7191 else
7192   echo "$as_me: failed program was:" >&5
7193 cat "conftest.$ac_ext" >&5
7194 cf_have_incdir=yes
7195 fi
7196 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7197                           CPPFLAGS=$cf_save_CPPFLAGS
7198                         fi
7199                   fi
7200                 fi
7201
7202                 if test "$cf_have_incdir" = no ; then
7203                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7204
7205 echo "${as_me:-configure}:7205: testing adding $cf_add_incdir to include-path ..." 1>&5
7206
7207                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7208
7209                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7210                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7211                   cf_add_incdir="$cf_top_incdir"
7212                 else
7213                   break
7214                 fi
7215           else
7216                 break
7217           fi
7218         done
7219   done
7220 fi
7221
7222 if test -n "$cf_cv_library_path_utf8" ; then
7223         for cf_add_libdir in $cf_cv_library_path_utf8
7224         do
7225                 if test "$cf_add_libdir" = /usr/lib ; then
7226                         :
7227                 elif test -d "$cf_add_libdir"
7228                 then
7229                         cf_have_libdir=no
7230                         if test -n "$LDFLAGS$LIBS" ; then
7231                                 # a loop is needed to ensure we can add subdirs of existing dirs
7232                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7233                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7234                                                 cf_have_libdir=yes; break
7235                                         fi
7236                                 done
7237                         fi
7238                         if test "$cf_have_libdir" = no ; then
7239                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7240
7241 echo "${as_me:-configure}:7241: testing adding $cf_add_libdir to library-path ..." 1>&5
7242
7243                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7244                         fi
7245                 fi
7246         done
7247 fi
7248
7249 cf_add_libs="$LIBS"
7250 # reverse order
7251 cf_add_0lib=
7252 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7253 # filter duplicates
7254 for cf_add_1lib in $cf_add_0lib; do
7255         for cf_add_2lib in $cf_add_libs; do
7256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7257                         cf_add_1lib=
7258                         break
7259                 fi
7260         done
7261         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7262 done
7263 LIBS="$cf_add_libs"
7264
7265 fi
7266
7267 cf_ncuconfig_root=ncursesw
7268 cf_have_ncuconfig=no
7269
7270 if test "x${PKG_CONFIG:=none}" != xnone; then
7271         echo "$as_me:7271: checking pkg-config for $cf_ncuconfig_root" >&5
7272 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7273         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7274                 echo "$as_me:7274: result: yes" >&5
7275 echo "${ECHO_T}yes" >&6
7276
7277                 echo "$as_me:7277: checking if the $cf_ncuconfig_root package files work" >&5
7278 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7279                 cf_have_ncuconfig=unknown
7280
7281                 cf_save_CFLAGS="$CFLAGS"
7282                 cf_save_CPPFLAGS="$CPPFLAGS"
7283                 cf_save_LIBS="$LIBS"
7284
7285                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7286                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7287
7288                 # while -W for passing linker flags is prevalent, it is not "standard".
7289                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7290                 # incompatible _and_ non-standard -W option which gives an error.  Work
7291                 # around that pitfall.
7292                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7293                 (x*c[89]9@@*-W*)
7294
7295 cf_fix_cppflags=no
7296 cf_new_cflags=
7297 cf_new_cppflags=
7298 cf_new_extra_cppflags=
7299
7300 for cf_add_cflags in $cf_pkg_cflags
7301 do
7302 case "$cf_fix_cppflags" in
7303 (no)
7304         case "$cf_add_cflags" in
7305         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7306                 case "$cf_add_cflags" in
7307                 (-D*)
7308                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7309
7310                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7311                                 && test -z "${cf_tst_cflags}" \
7312                                 && cf_fix_cppflags=yes
7313
7314                         if test "$cf_fix_cppflags" = yes ; then
7315
7316         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7317         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7318
7319                                 continue
7320                         elif test "${cf_tst_cflags}" = "\"'" ; then
7321
7322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7324
7325                                 continue
7326                         fi
7327                         ;;
7328                 esac
7329                 case "$CPPFLAGS" in
7330                 (*$cf_add_cflags)
7331                         ;;
7332                 (*)
7333                         case "$cf_add_cflags" in
7334                         (-D*)
7335                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7336
7337 CPPFLAGS=`echo "$CPPFLAGS" | \
7338         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7339                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7340
7341                                 ;;
7342                         esac
7343
7344         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7345         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7346
7347                         ;;
7348                 esac
7349                 ;;
7350         (*)
7351
7352         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7353         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7354
7355                 ;;
7356         esac
7357         ;;
7358 (yes)
7359
7360         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7361         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7362
7363         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7364
7365         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7366                 && test -z "${cf_tst_cflags}" \
7367                 && cf_fix_cppflags=no
7368         ;;
7369 esac
7370 done
7371
7372 if test -n "$cf_new_cflags" ; then
7373
7374         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7375         CFLAGS="${CFLAGS}$cf_new_cflags"
7376
7377 fi
7378
7379 if test -n "$cf_new_cppflags" ; then
7380
7381         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7382         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7383
7384 fi
7385
7386 if test -n "$cf_new_extra_cppflags" ; then
7387
7388         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7389         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7390
7391 fi
7392
7393 cf_add_libs="$LIBS"
7394 # reverse order
7395 cf_add_0lib=
7396 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7397 # filter duplicates
7398 for cf_add_1lib in $cf_add_0lib; do
7399         for cf_add_2lib in $cf_add_libs; do
7400                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7401                         cf_add_1lib=
7402                         break
7403                 fi
7404         done
7405         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7406 done
7407 LIBS="$cf_add_libs"
7408
7409                         cat >"conftest.$ac_ext" <<_ACEOF
7410 #line 7410 "configure"
7411 #include "confdefs.h"
7412 #include <${cf_cv_ncurses_header:-curses.h}>
7413 int
7414 main (void)
7415 {
7416 initscr(); mousemask(0,0); tigetstr((char *)0);
7417   ;
7418   return 0;
7419 }
7420 _ACEOF
7421 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7422 if { (eval echo "$as_me:7422: \"$ac_link\"") >&5
7423   (eval $ac_link) 2>&5
7424   ac_status=$?
7425   echo "$as_me:7425: \$? = $ac_status" >&5
7426   (exit "$ac_status"); } &&
7427          { ac_try='test -s "conftest$ac_exeext"'
7428   { (eval echo "$as_me:7428: \"$ac_try\"") >&5
7429   (eval $ac_try) 2>&5
7430   ac_status=$?
7431   echo "$as_me:7431: \$? = $ac_status" >&5
7432   (exit "$ac_status"); }; }; then
7433   if test "$cross_compiling" = yes; then
7434   cf_test_ncuconfig=maybe
7435 else
7436   cat >"conftest.$ac_ext" <<_ACEOF
7437 #line 7437 "configure"
7438 #include "confdefs.h"
7439 #include <${cf_cv_ncurses_header:-curses.h}>
7440                                         int main(void)
7441                                         { const char *xx = curses_version(); return (xx == 0); }
7442 _ACEOF
7443 rm -f "conftest$ac_exeext"
7444 if { (eval echo "$as_me:7444: \"$ac_link\"") >&5
7445   (eval $ac_link) 2>&5
7446   ac_status=$?
7447   echo "$as_me:7447: \$? = $ac_status" >&5
7448   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7449   { (eval echo "$as_me:7449: \"$ac_try\"") >&5
7450   (eval $ac_try) 2>&5
7451   ac_status=$?
7452   echo "$as_me:7452: \$? = $ac_status" >&5
7453   (exit "$ac_status"); }; }; then
7454   cf_test_ncuconfig=yes
7455 else
7456   echo "$as_me: program exited with status $ac_status" >&5
7457 echo "$as_me: failed program was:" >&5
7458 cat "conftest.$ac_ext" >&5
7459 cf_test_ncuconfig=no
7460 fi
7461 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7462 fi
7463 else
7464   echo "$as_me: failed program was:" >&5
7465 cat "conftest.$ac_ext" >&5
7466 cf_test_ncuconfig=no
7467 fi
7468 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7469
7470                         CFLAGS="$cf_save_CFLAGS"
7471                         CPPFLAGS="$cf_save_CPPFLAGS"
7472                         LIBS="$cf_save_LIBS"
7473
7474                         if test "x$cf_test_ncuconfig" != xyes; then
7475                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7476                                 cf_pkg_cflags="$cf_temp"
7477                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7478                                 cf_pkg_libs="$cf_temp"
7479                         fi
7480                         ;;
7481                 esac
7482
7483 for cf_add_cflags in $cf_pkg_cflags
7484 do
7485         case "x$cf_add_cflags" in
7486         (x-[DU]*)
7487
7488 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7489 while true
7490 do
7491         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7492         test "$CFLAGS" != "$cf_old_cflag" || break
7493
7494         CFLAGS="$cf_old_cflag"
7495 done
7496
7497 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7498 while true
7499 do
7500         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7501         test "$CPPFLAGS" != "$cf_old_cflag" || break
7502
7503         CPPFLAGS="$cf_old_cflag"
7504 done
7505
7506                 ;;
7507         esac
7508
7509 cf_fix_cppflags=no
7510 cf_new_cflags=
7511 cf_new_cppflags=
7512 cf_new_extra_cppflags=
7513
7514 for cf_add_cflags in $cf_add_cflags
7515 do
7516 case "$cf_fix_cppflags" in
7517 (no)
7518         case "$cf_add_cflags" in
7519         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7520                 case "$cf_add_cflags" in
7521                 (-D*)
7522                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7523
7524                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7525                                 && test -z "${cf_tst_cflags}" \
7526                                 && cf_fix_cppflags=yes
7527
7528                         if test "$cf_fix_cppflags" = yes ; then
7529
7530         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7531         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7532
7533                                 continue
7534                         elif test "${cf_tst_cflags}" = "\"'" ; then
7535
7536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7538
7539                                 continue
7540                         fi
7541                         ;;
7542                 esac
7543                 case "$CPPFLAGS" in
7544                 (*$cf_add_cflags)
7545                         ;;
7546                 (*)
7547                         case "$cf_add_cflags" in
7548                         (-D*)
7549                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7550
7551 CPPFLAGS=`echo "$CPPFLAGS" | \
7552         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7553                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7554
7555                                 ;;
7556                         esac
7557
7558         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7559         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7560
7561                         ;;
7562                 esac
7563                 ;;
7564         (*)
7565
7566         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7567         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7568
7569                 ;;
7570         esac
7571         ;;
7572 (yes)
7573
7574         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7575         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7576
7577         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7578
7579         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7580                 && test -z "${cf_tst_cflags}" \
7581                 && cf_fix_cppflags=no
7582         ;;
7583 esac
7584 done
7585
7586 if test -n "$cf_new_cflags" ; then
7587
7588         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7589         CFLAGS="${CFLAGS}$cf_new_cflags"
7590
7591 fi
7592
7593 if test -n "$cf_new_cppflags" ; then
7594
7595         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7596         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7597
7598 fi
7599
7600 if test -n "$cf_new_extra_cppflags" ; then
7601
7602         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7603         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7604
7605 fi
7606
7607 done
7608
7609 cf_add_libs="$LIBS"
7610 # reverse order
7611 cf_add_0lib=
7612 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7613 # filter duplicates
7614 for cf_add_1lib in $cf_add_0lib; do
7615         for cf_add_2lib in $cf_add_libs; do
7616                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7617                         cf_add_1lib=
7618                         break
7619                 fi
7620         done
7621         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7622 done
7623 LIBS="$cf_add_libs"
7624
7625                 cat >"conftest.$ac_ext" <<_ACEOF
7626 #line 7626 "configure"
7627 #include "confdefs.h"
7628 #include <${cf_cv_ncurses_header:-curses.h}>
7629 int
7630 main (void)
7631 {
7632 initscr(); mousemask(0,0); tigetstr((char *)0);
7633   ;
7634   return 0;
7635 }
7636 _ACEOF
7637 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7638 if { (eval echo "$as_me:7638: \"$ac_link\"") >&5
7639   (eval $ac_link) 2>&5
7640   ac_status=$?
7641   echo "$as_me:7641: \$? = $ac_status" >&5
7642   (exit "$ac_status"); } &&
7643          { ac_try='test -s "conftest$ac_exeext"'
7644   { (eval echo "$as_me:7644: \"$ac_try\"") >&5
7645   (eval $ac_try) 2>&5
7646   ac_status=$?
7647   echo "$as_me:7647: \$? = $ac_status" >&5
7648   (exit "$ac_status"); }; }; then
7649   if test "$cross_compiling" = yes; then
7650   cf_have_ncuconfig=maybe
7651 else
7652   cat >"conftest.$ac_ext" <<_ACEOF
7653 #line 7653 "configure"
7654 #include "confdefs.h"
7655 #include <${cf_cv_ncurses_header:-curses.h}>
7656                                 int main(void)
7657                                 { const char *xx = curses_version(); return (xx == 0); }
7658 _ACEOF
7659 rm -f "conftest$ac_exeext"
7660 if { (eval echo "$as_me:7660: \"$ac_link\"") >&5
7661   (eval $ac_link) 2>&5
7662   ac_status=$?
7663   echo "$as_me:7663: \$? = $ac_status" >&5
7664   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7665   { (eval echo "$as_me:7665: \"$ac_try\"") >&5
7666   (eval $ac_try) 2>&5
7667   ac_status=$?
7668   echo "$as_me:7668: \$? = $ac_status" >&5
7669   (exit "$ac_status"); }; }; then
7670   cf_have_ncuconfig=yes
7671 else
7672   echo "$as_me: program exited with status $ac_status" >&5
7673 echo "$as_me: failed program was:" >&5
7674 cat "conftest.$ac_ext" >&5
7675 cf_have_ncuconfig=no
7676 fi
7677 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7678 fi
7679 else
7680   echo "$as_me: failed program was:" >&5
7681 cat "conftest.$ac_ext" >&5
7682 cf_have_ncuconfig=no
7683 fi
7684 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7685                 echo "$as_me:7685: result: $cf_have_ncuconfig" >&5
7686 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7687                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7688                 if test "$cf_have_ncuconfig" != "yes"
7689                 then
7690                         CPPFLAGS="$cf_save_CPPFLAGS"
7691                         LIBS="$cf_save_LIBS"
7692                         NCURSES_CONFIG_PKG=none
7693                 else
7694
7695 cat >>confdefs.h <<\EOF
7696 #define NCURSES 1
7697 EOF
7698
7699                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7700
7701 echo "$as_me:7701: checking for terminfo header" >&5
7702 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7703 if test "${cf_cv_term_header+set}" = set; then
7704   echo $ECHO_N "(cached) $ECHO_C" >&6
7705 else
7706
7707 case "${cf_cv_ncurses_header}" in
7708 (*/ncurses.h|*/ncursesw.h)
7709         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7710         ;;
7711 (*)
7712         cf_term_header=term.h
7713         ;;
7714 esac
7715
7716 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7717 do
7718 cat >"conftest.$ac_ext" <<_ACEOF
7719 #line 7719 "configure"
7720 #include "confdefs.h"
7721 #include <stdio.h>
7722 #include <${cf_cv_ncurses_header:-curses.h}>
7723 #include <$cf_test>
7724
7725 int
7726 main (void)
7727 {
7728 int x = auto_left_margin; (void)x
7729   ;
7730   return 0;
7731 }
7732 _ACEOF
7733 rm -f "conftest.$ac_objext"
7734 if { (eval echo "$as_me:7734: \"$ac_compile\"") >&5
7735   (eval $ac_compile) 2>&5
7736   ac_status=$?
7737   echo "$as_me:7737: \$? = $ac_status" >&5
7738   (exit "$ac_status"); } &&
7739          { ac_try='test -s "conftest.$ac_objext"'
7740   { (eval echo "$as_me:7740: \"$ac_try\"") >&5
7741   (eval $ac_try) 2>&5
7742   ac_status=$?
7743   echo "$as_me:7743: \$? = $ac_status" >&5
7744   (exit "$ac_status"); }; }; then
7745
7746         cf_cv_term_header="$cf_test"
7747 else
7748   echo "$as_me: failed program was:" >&5
7749 cat "conftest.$ac_ext" >&5
7750
7751         cf_cv_term_header=unknown
7752
7753 fi
7754 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7755         test "$cf_cv_term_header" != unknown && break
7756 done
7757
7758 fi
7759 echo "$as_me:7759: result: $cf_cv_term_header" >&5
7760 echo "${ECHO_T}$cf_cv_term_header" >&6
7761
7762 # Set definitions to allow ifdef'ing to accommodate subdirectories
7763
7764 case "$cf_cv_term_header" in
7765 (*term.h)
7766
7767 cat >>confdefs.h <<\EOF
7768 #define HAVE_TERM_H 1
7769 EOF
7770
7771         ;;
7772 esac
7773
7774 case "$cf_cv_term_header" in
7775 (ncurses/term.h)
7776
7777 cat >>confdefs.h <<\EOF
7778 #define HAVE_NCURSES_TERM_H 1
7779 EOF
7780
7781         ;;
7782 (ncursesw/term.h)
7783
7784 cat >>confdefs.h <<\EOF
7785 #define HAVE_NCURSESW_TERM_H 1
7786 EOF
7787
7788         ;;
7789 esac
7790
7791                 fi
7792
7793         else
7794                 echo "$as_me:7794: result: no" >&5
7795 echo "${ECHO_T}no" >&6
7796                 NCURSES_CONFIG_PKG=none
7797         fi
7798 else
7799         NCURSES_CONFIG_PKG=none
7800 fi
7801
7802 if test "x$cf_have_ncuconfig" = "xno"; then
7803         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7804
7805 if test -n "$ac_tool_prefix"; then
7806   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7807   do
7808     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7809 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7810 echo "$as_me:7810: checking for $ac_word" >&5
7811 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7812 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7813   echo $ECHO_N "(cached) $ECHO_C" >&6
7814 else
7815   if test -n "$NCURSES_CONFIG"; then
7816   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7817 else
7818   ac_save_IFS=$IFS; IFS=$ac_path_separator
7819 ac_dummy="$PATH"
7820 for ac_dir in $ac_dummy; do
7821   IFS=$ac_save_IFS
7822   test -z "$ac_dir" && ac_dir=.
7823   $as_executable_p "$ac_dir/$ac_word" || continue
7824 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7825 echo "$as_me:7825: found $ac_dir/$ac_word" >&5
7826 break
7827 done
7828
7829 fi
7830 fi
7831 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7832 if test -n "$NCURSES_CONFIG"; then
7833   echo "$as_me:7833: result: $NCURSES_CONFIG" >&5
7834 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7835 else
7836   echo "$as_me:7836: result: no" >&5
7837 echo "${ECHO_T}no" >&6
7838 fi
7839
7840     test -n "$NCURSES_CONFIG" && break
7841   done
7842 fi
7843 if test -z "$NCURSES_CONFIG"; then
7844   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7845   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7846 do
7847   # Extract the first word of "$ac_prog", so it can be a program name with args.
7848 set dummy $ac_prog; ac_word=$2
7849 echo "$as_me:7849: checking for $ac_word" >&5
7850 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7851 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7852   echo $ECHO_N "(cached) $ECHO_C" >&6
7853 else
7854   if test -n "$ac_ct_NCURSES_CONFIG"; then
7855   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7856 else
7857   ac_save_IFS=$IFS; IFS=$ac_path_separator
7858 ac_dummy="$PATH"
7859 for ac_dir in $ac_dummy; do
7860   IFS=$ac_save_IFS
7861   test -z "$ac_dir" && ac_dir=.
7862   $as_executable_p "$ac_dir/$ac_word" || continue
7863 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7864 echo "$as_me:7864: found $ac_dir/$ac_word" >&5
7865 break
7866 done
7867
7868 fi
7869 fi
7870 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7871 if test -n "$ac_ct_NCURSES_CONFIG"; then
7872   echo "$as_me:7872: result: $ac_ct_NCURSES_CONFIG" >&5
7873 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7874 else
7875   echo "$as_me:7875: result: no" >&5
7876 echo "${ECHO_T}no" >&6
7877 fi
7878
7879   test -n "$ac_ct_NCURSES_CONFIG" && break
7880 done
7881 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7882
7883   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7884 fi
7885
7886         if test "$NCURSES_CONFIG" != none ; then
7887
7888 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7889 do
7890         case "x$cf_add_cflags" in
7891         (x-[DU]*)
7892
7893 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7894 while true
7895 do
7896         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7897         test "$CFLAGS" != "$cf_old_cflag" || break
7898
7899         CFLAGS="$cf_old_cflag"
7900 done
7901
7902 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7903 while true
7904 do
7905         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7906         test "$CPPFLAGS" != "$cf_old_cflag" || break
7907
7908         CPPFLAGS="$cf_old_cflag"
7909 done
7910
7911                 ;;
7912         esac
7913
7914 cf_fix_cppflags=no
7915 cf_new_cflags=
7916 cf_new_cppflags=
7917 cf_new_extra_cppflags=
7918
7919 for cf_add_cflags in $cf_add_cflags
7920 do
7921 case "$cf_fix_cppflags" in
7922 (no)
7923         case "$cf_add_cflags" in
7924         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7925                 case "$cf_add_cflags" in
7926                 (-D*)
7927                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7928
7929                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7930                                 && test -z "${cf_tst_cflags}" \
7931                                 && cf_fix_cppflags=yes
7932
7933                         if test "$cf_fix_cppflags" = yes ; then
7934
7935         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7936         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7937
7938                                 continue
7939                         elif test "${cf_tst_cflags}" = "\"'" ; then
7940
7941         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7942         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7943
7944                                 continue
7945                         fi
7946                         ;;
7947                 esac
7948                 case "$CPPFLAGS" in
7949                 (*$cf_add_cflags)
7950                         ;;
7951                 (*)
7952                         case "$cf_add_cflags" in
7953                         (-D*)
7954                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7955
7956 CPPFLAGS=`echo "$CPPFLAGS" | \
7957         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7958                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7959
7960                                 ;;
7961                         esac
7962
7963         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7964         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7965
7966                         ;;
7967                 esac
7968                 ;;
7969         (*)
7970
7971         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7972         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7973
7974                 ;;
7975         esac
7976         ;;
7977 (yes)
7978
7979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7981
7982         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7983
7984         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7985                 && test -z "${cf_tst_cflags}" \
7986                 && cf_fix_cppflags=no
7987         ;;
7988 esac
7989 done
7990
7991 if test -n "$cf_new_cflags" ; then
7992
7993         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7994         CFLAGS="${CFLAGS}$cf_new_cflags"
7995
7996 fi
7997
7998 if test -n "$cf_new_cppflags" ; then
7999
8000         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8001         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8002
8003 fi
8004
8005 if test -n "$cf_new_extra_cppflags" ; then
8006
8007         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8008         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8009
8010 fi
8011
8012 done
8013
8014 cf_add_libs="$LIBS"
8015 # reverse order
8016 cf_add_0lib=
8017 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8018 # filter duplicates
8019 for cf_add_1lib in $cf_add_0lib; do
8020         for cf_add_2lib in $cf_add_libs; do
8021                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8022                         cf_add_1lib=
8023                         break
8024                 fi
8025         done
8026         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8027 done
8028 LIBS="$cf_add_libs"
8029
8030                 # even with config script, some packages use no-override for curses.h
8031
8032 echo "$as_me:8032: checking if we have identified curses headers" >&5
8033 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8034 if test "${cf_cv_ncurses_header+set}" = set; then
8035   echo $ECHO_N "(cached) $ECHO_C" >&6
8036 else
8037
8038 cf_cv_ncurses_header=none
8039 for cf_header in \
8040         ncurses.h ncursesw/ncurses.h \
8041         curses.h ncursesw/curses.h
8042 do
8043 cat >"conftest.$ac_ext" <<_ACEOF
8044 #line 8044 "configure"
8045 #include "confdefs.h"
8046 #include <${cf_header}>
8047 int
8048 main (void)
8049 {
8050 initscr(); endwin()
8051   ;
8052   return 0;
8053 }
8054 _ACEOF
8055 rm -f "conftest.$ac_objext"
8056 if { (eval echo "$as_me:8056: \"$ac_compile\"") >&5
8057   (eval $ac_compile) 2>&5
8058   ac_status=$?
8059   echo "$as_me:8059: \$? = $ac_status" >&5
8060   (exit "$ac_status"); } &&
8061          { ac_try='test -s "conftest.$ac_objext"'
8062   { (eval echo "$as_me:8062: \"$ac_try\"") >&5
8063   (eval $ac_try) 2>&5
8064   ac_status=$?
8065   echo "$as_me:8065: \$? = $ac_status" >&5
8066   (exit "$ac_status"); }; }; then
8067   cf_cv_ncurses_header=$cf_header; break
8068 else
8069   echo "$as_me: failed program was:" >&5
8070 cat "conftest.$ac_ext" >&5
8071 fi
8072 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8073 done
8074
8075 fi
8076 echo "$as_me:8076: result: $cf_cv_ncurses_header" >&5
8077 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8078
8079 if test "$cf_cv_ncurses_header" = none ; then
8080         { { echo "$as_me:8080: error: No curses header-files found" >&5
8081 echo "$as_me: error: No curses header-files found" >&2;}
8082    { (exit 1); exit 1; }; }
8083 fi
8084
8085 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8086
8087 for ac_header in $cf_cv_ncurses_header
8088 do
8089 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8090 echo "$as_me:8090: checking for $ac_header" >&5
8091 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8092 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8093   echo $ECHO_N "(cached) $ECHO_C" >&6
8094 else
8095   cat >"conftest.$ac_ext" <<_ACEOF
8096 #line 8096 "configure"
8097 #include "confdefs.h"
8098 #include <$ac_header>
8099 _ACEOF
8100 if { (eval echo "$as_me:8100: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8101   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8102   ac_status=$?
8103   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8104   rm -f conftest.er1
8105   cat conftest.err >&5
8106   echo "$as_me:8106: \$? = $ac_status" >&5
8107   (exit "$ac_status"); } >/dev/null; then
8108   if test -s conftest.err; then
8109     ac_cpp_err=$ac_c_preproc_warn_flag
8110   else
8111     ac_cpp_err=
8112   fi
8113 else
8114   ac_cpp_err=yes
8115 fi
8116 if test -z "$ac_cpp_err"; then
8117   eval "$as_ac_Header=yes"
8118 else
8119   echo "$as_me: failed program was:" >&5
8120   cat "conftest.$ac_ext" >&5
8121   eval "$as_ac_Header=no"
8122 fi
8123 rm -f conftest.err "conftest.$ac_ext"
8124 fi
8125 echo "$as_me:8125: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8126 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8127 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8128   cat >>confdefs.h <<EOF
8129 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8130 EOF
8131
8132 fi
8133 done
8134
8135 cat >>confdefs.h <<\EOF
8136 #define NCURSES 1
8137 EOF
8138
8139 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8140
8141                 cat >>confdefs.h <<EOF
8142 #define $cf_nculib_ROOT 1
8143 EOF
8144
8145                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8146
8147         else
8148
8149 cf_ncuhdr_root=ncursesw
8150
8151 test -n "$cf_cv_curses_dir" && \
8152 test "$cf_cv_curses_dir" != "no" && { \
8153
8154 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8155   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8156   do
8157         while test "$cf_add_incdir" != /usr/include
8158         do
8159           if test -d "$cf_add_incdir"
8160           then
8161                 cf_have_incdir=no
8162                 if test -n "$CFLAGS$CPPFLAGS" ; then
8163                   # a loop is needed to ensure we can add subdirs of existing dirs
8164                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8165                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8166                           cf_have_incdir=yes; break
8167                         fi
8168                   done
8169                 fi
8170
8171                 if test "$cf_have_incdir" = no ; then
8172                   if test "$cf_add_incdir" = /usr/local/include ; then
8173                         if test "$GCC" = yes
8174                         then
8175                           cf_save_CPPFLAGS=$CPPFLAGS
8176
8177         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8178         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8179
8180                           cat >"conftest.$ac_ext" <<_ACEOF
8181 #line 8181 "configure"
8182 #include "confdefs.h"
8183 #include <stdio.h>
8184 int
8185 main (void)
8186 {
8187 printf("Hello")
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 else
8206   echo "$as_me: failed program was:" >&5
8207 cat "conftest.$ac_ext" >&5
8208 cf_have_incdir=yes
8209 fi
8210 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8211                           CPPFLAGS=$cf_save_CPPFLAGS
8212                         fi
8213                   fi
8214                 fi
8215
8216                 if test "$cf_have_incdir" = no ; then
8217                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8218
8219 echo "${as_me:-configure}:8219: testing adding $cf_add_incdir to include-path ..." 1>&5
8220
8221                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8222
8223                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8224                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8225                   cf_add_incdir="$cf_top_incdir"
8226                 else
8227                   break
8228                 fi
8229           else
8230                 break
8231           fi
8232         done
8233   done
8234 fi
8235
8236 }
8237
8238 echo "$as_me:8238: checking for $cf_ncuhdr_root header in include-path" >&5
8239 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8240 if test "${cf_cv_ncurses_h+set}" = set; then
8241   echo $ECHO_N "(cached) $ECHO_C" >&6
8242 else
8243
8244         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8245         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8246         for cf_header in $cf_header_list
8247         do
8248
8249         cat >"conftest.$ac_ext" <<_ACEOF
8250 #line 8250 "configure"
8251 #include "confdefs.h"
8252
8253 #define _XOPEN_SOURCE_EXTENDED
8254 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8255 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8256
8257 #include <$cf_header>
8258 int
8259 main (void)
8260 {
8261
8262 #ifdef NCURSES_VERSION
8263
8264 #ifndef WACS_BSSB
8265         make an error
8266 #endif
8267
8268 printf("%s\\n", NCURSES_VERSION);
8269 #else
8270 #ifdef __NCURSES_H
8271 printf("old\\n");
8272 #else
8273         make an error
8274 #endif
8275 #endif
8276
8277   ;
8278   return 0;
8279 }
8280 _ACEOF
8281 rm -f "conftest.$ac_objext"
8282 if { (eval echo "$as_me:8282: \"$ac_compile\"") >&5
8283   (eval $ac_compile) 2>&5
8284   ac_status=$?
8285   echo "$as_me:8285: \$? = $ac_status" >&5
8286   (exit "$ac_status"); } &&
8287          { ac_try='test -s "conftest.$ac_objext"'
8288   { (eval echo "$as_me:8288: \"$ac_try\"") >&5
8289   (eval $ac_try) 2>&5
8290   ac_status=$?
8291   echo "$as_me:8291: \$? = $ac_status" >&5
8292   (exit "$ac_status"); }; }; then
8293   cf_cv_ncurses_h=$cf_header
8294
8295 else
8296   echo "$as_me: failed program was:" >&5
8297 cat "conftest.$ac_ext" >&5
8298 cf_cv_ncurses_h=no
8299 fi
8300 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8301
8302                 test "$cf_cv_ncurses_h" != no && break
8303         done
8304
8305 fi
8306 echo "$as_me:8306: result: $cf_cv_ncurses_h" >&5
8307 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8308
8309 if test "$cf_cv_ncurses_h" != no ; then
8310         cf_cv_ncurses_header=$cf_cv_ncurses_h
8311 else
8312
8313 echo "$as_me:8313: checking for $cf_ncuhdr_root include-path" >&5
8314 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8315 if test "${cf_cv_ncurses_h2+set}" = set; then
8316   echo $ECHO_N "(cached) $ECHO_C" >&6
8317 else
8318
8319         test -n "$verbose" && echo
8320
8321 cf_search=
8322
8323 # collect the current set of include-directories from compiler flags
8324 cf_header_path_list=""
8325 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8326         for cf_header_path in $CPPFLAGS $CFLAGS
8327         do
8328                 case "$cf_header_path" in
8329                 (-I*)
8330                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8331
8332 test "x$cf_header_path" != "xNONE" && \
8333 test -d "$cf_header_path" && \
8334  {
8335         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8336         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8337         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8338         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8339         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8340         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"
8341 }
8342
8343                         cf_header_path_list="$cf_header_path_list $cf_search"
8344                         ;;
8345                 esac
8346         done
8347 fi
8348
8349 # add the variations for the package we are looking for
8350
8351 cf_search=
8352
8353 test "x$prefix" != "xNONE" && \
8354 test -d "$prefix" && \
8355  {
8356         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8357         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8358         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8359         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8360         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8361         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8362 }
8363
8364 for cf_subdir_prefix in \
8365         /usr \
8366         /usr/local \
8367         /usr/pkg \
8368         /opt \
8369         /opt/local \
8370         $HOME
8371 do
8372
8373 test "x$cf_subdir_prefix" != "x$prefix" && \
8374 test -d "$cf_subdir_prefix" && \
8375 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8376         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8377         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8378         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8379         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8380         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8381         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"
8382 }
8383
8384 done
8385
8386 test "$includedir" != NONE && \
8387 test "$includedir" != "/usr/include" && \
8388 test -d "$includedir" && {
8389         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8390         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8391 }
8392
8393 test "$oldincludedir" != NONE && \
8394 test "$oldincludedir" != "/usr/include" && \
8395 test -d "$oldincludedir" && {
8396         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8397         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8398 }
8399
8400 cf_search="$cf_search $cf_header_path_list"
8401
8402         test -n "$verbose" && echo "search path $cf_search"
8403         cf_save2_CPPFLAGS="$CPPFLAGS"
8404         for cf_incdir in $cf_search
8405         do
8406
8407 if test -n "$cf_incdir" ; then
8408   for cf_add_incdir in $cf_incdir
8409   do
8410         while test "$cf_add_incdir" != /usr/include
8411         do
8412           if test -d "$cf_add_incdir"
8413           then
8414                 cf_have_incdir=no
8415                 if test -n "$CFLAGS$CPPFLAGS" ; then
8416                   # a loop is needed to ensure we can add subdirs of existing dirs
8417                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8418                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8419                           cf_have_incdir=yes; break
8420                         fi
8421                   done
8422                 fi
8423
8424                 if test "$cf_have_incdir" = no ; then
8425                   if test "$cf_add_incdir" = /usr/local/include ; then
8426                         if test "$GCC" = yes
8427                         then
8428                           cf_save_CPPFLAGS=$CPPFLAGS
8429
8430         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8431         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8432
8433                           cat >"conftest.$ac_ext" <<_ACEOF
8434 #line 8434 "configure"
8435 #include "confdefs.h"
8436 #include <stdio.h>
8437 int
8438 main (void)
8439 {
8440 printf("Hello")
8441   ;
8442   return 0;
8443 }
8444 _ACEOF
8445 rm -f "conftest.$ac_objext"
8446 if { (eval echo "$as_me:8446: \"$ac_compile\"") >&5
8447   (eval $ac_compile) 2>&5
8448   ac_status=$?
8449   echo "$as_me:8449: \$? = $ac_status" >&5
8450   (exit "$ac_status"); } &&
8451          { ac_try='test -s "conftest.$ac_objext"'
8452   { (eval echo "$as_me:8452: \"$ac_try\"") >&5
8453   (eval $ac_try) 2>&5
8454   ac_status=$?
8455   echo "$as_me:8455: \$? = $ac_status" >&5
8456   (exit "$ac_status"); }; }; then
8457   :
8458 else
8459   echo "$as_me: failed program was:" >&5
8460 cat "conftest.$ac_ext" >&5
8461 cf_have_incdir=yes
8462 fi
8463 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8464                           CPPFLAGS=$cf_save_CPPFLAGS
8465                         fi
8466                   fi
8467                 fi
8468
8469                 if test "$cf_have_incdir" = no ; then
8470                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8471
8472 echo "${as_me:-configure}:8472: testing adding $cf_add_incdir to include-path ..." 1>&5
8473
8474                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8475
8476                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8477                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8478                   cf_add_incdir="$cf_top_incdir"
8479                 else
8480                   break
8481                 fi
8482           else
8483                 break
8484           fi
8485         done
8486   done
8487 fi
8488
8489                 for cf_header in \
8490                         ncurses.h \
8491                         curses.h
8492                 do
8493
8494         cat >"conftest.$ac_ext" <<_ACEOF
8495 #line 8495 "configure"
8496 #include "confdefs.h"
8497
8498 #include <$cf_header>
8499 int
8500 main (void)
8501 {
8502
8503 #ifdef NCURSES_VERSION
8504
8505 printf("%s\\n", NCURSES_VERSION);
8506 #else
8507 #ifdef __NCURSES_H
8508 printf("old\\n");
8509 #else
8510         make an error
8511 #endif
8512 #endif
8513
8514   ;
8515   return 0;
8516 }
8517 _ACEOF
8518 rm -f "conftest.$ac_objext"
8519 if { (eval echo "$as_me:8519: \"$ac_compile\"") >&5
8520   (eval $ac_compile) 2>&5
8521   ac_status=$?
8522   echo "$as_me:8522: \$? = $ac_status" >&5
8523   (exit "$ac_status"); } &&
8524          { ac_try='test -s "conftest.$ac_objext"'
8525   { (eval echo "$as_me:8525: \"$ac_try\"") >&5
8526   (eval $ac_try) 2>&5
8527   ac_status=$?
8528   echo "$as_me:8528: \$? = $ac_status" >&5
8529   (exit "$ac_status"); }; }; then
8530   cf_cv_ncurses_h2=$cf_header
8531
8532 else
8533   echo "$as_me: failed program was:" >&5
8534 cat "conftest.$ac_ext" >&5
8535 cf_cv_ncurses_h2=no
8536 fi
8537 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8538
8539                         if test "$cf_cv_ncurses_h2" != no ; then
8540                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8541                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8542                                 break
8543                         fi
8544                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8545                 done
8546                 CPPFLAGS="$cf_save2_CPPFLAGS"
8547                 test "$cf_cv_ncurses_h2" != no && break
8548         done
8549         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8549: error: not found" >&5
8550 echo "$as_me: error: not found" >&2;}
8551    { (exit 1); exit 1; }; }
8552
8553 fi
8554 echo "$as_me:8554: result: $cf_cv_ncurses_h2" >&5
8555 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8556
8557         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8558         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8559         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8560                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8561         fi
8562
8563 if test -n "$cf_1st_incdir" ; then
8564   for cf_add_incdir in $cf_1st_incdir
8565   do
8566         while test "$cf_add_incdir" != /usr/include
8567         do
8568           if test -d "$cf_add_incdir"
8569           then
8570                 cf_have_incdir=no
8571                 if test -n "$CFLAGS$CPPFLAGS" ; then
8572                   # a loop is needed to ensure we can add subdirs of existing dirs
8573                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8574                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8575                           cf_have_incdir=yes; break
8576                         fi
8577                   done
8578                 fi
8579
8580                 if test "$cf_have_incdir" = no ; then
8581                   if test "$cf_add_incdir" = /usr/local/include ; then
8582                         if test "$GCC" = yes
8583                         then
8584                           cf_save_CPPFLAGS=$CPPFLAGS
8585
8586         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8587         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8588
8589                           cat >"conftest.$ac_ext" <<_ACEOF
8590 #line 8590 "configure"
8591 #include "confdefs.h"
8592 #include <stdio.h>
8593 int
8594 main (void)
8595 {
8596 printf("Hello")
8597   ;
8598   return 0;
8599 }
8600 _ACEOF
8601 rm -f "conftest.$ac_objext"
8602 if { (eval echo "$as_me:8602: \"$ac_compile\"") >&5
8603   (eval $ac_compile) 2>&5
8604   ac_status=$?
8605   echo "$as_me:8605: \$? = $ac_status" >&5
8606   (exit "$ac_status"); } &&
8607          { ac_try='test -s "conftest.$ac_objext"'
8608   { (eval echo "$as_me:8608: \"$ac_try\"") >&5
8609   (eval $ac_try) 2>&5
8610   ac_status=$?
8611   echo "$as_me:8611: \$? = $ac_status" >&5
8612   (exit "$ac_status"); }; }; then
8613   :
8614 else
8615   echo "$as_me: failed program was:" >&5
8616 cat "conftest.$ac_ext" >&5
8617 cf_have_incdir=yes
8618 fi
8619 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8620                           CPPFLAGS=$cf_save_CPPFLAGS
8621                         fi
8622                   fi
8623                 fi
8624
8625                 if test "$cf_have_incdir" = no ; then
8626                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8627
8628 echo "${as_me:-configure}:8628: testing adding $cf_add_incdir to include-path ..." 1>&5
8629
8630                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8631
8632                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8633                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8634                   cf_add_incdir="$cf_top_incdir"
8635                 else
8636                   break
8637                 fi
8638           else
8639                 break
8640           fi
8641         done
8642   done
8643 fi
8644
8645 fi
8646
8647 # Set definitions to allow ifdef'ing for ncurses.h
8648
8649 case "$cf_cv_ncurses_header" in
8650 (*ncurses.h)
8651
8652 cat >>confdefs.h <<\EOF
8653 #define HAVE_NCURSES_H 1
8654 EOF
8655
8656         ;;
8657 esac
8658
8659 case "$cf_cv_ncurses_header" in
8660 (ncurses/curses.h|ncurses/ncurses.h)
8661
8662 cat >>confdefs.h <<\EOF
8663 #define HAVE_NCURSES_NCURSES_H 1
8664 EOF
8665
8666         ;;
8667 (ncursesw/curses.h|ncursesw/ncurses.h)
8668
8669 cat >>confdefs.h <<\EOF
8670 #define HAVE_NCURSESW_NCURSES_H 1
8671 EOF
8672
8673         ;;
8674 esac
8675
8676 echo "$as_me:8676: checking for terminfo header" >&5
8677 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8678 if test "${cf_cv_term_header+set}" = set; then
8679   echo $ECHO_N "(cached) $ECHO_C" >&6
8680 else
8681
8682 case "${cf_cv_ncurses_header}" in
8683 (*/ncurses.h|*/ncursesw.h)
8684         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8685         ;;
8686 (*)
8687         cf_term_header=term.h
8688         ;;
8689 esac
8690
8691 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8692 do
8693 cat >"conftest.$ac_ext" <<_ACEOF
8694 #line 8694 "configure"
8695 #include "confdefs.h"
8696 #include <stdio.h>
8697 #include <${cf_cv_ncurses_header:-curses.h}>
8698 #include <$cf_test>
8699
8700 int
8701 main (void)
8702 {
8703 int x = auto_left_margin; (void)x
8704   ;
8705   return 0;
8706 }
8707 _ACEOF
8708 rm -f "conftest.$ac_objext"
8709 if { (eval echo "$as_me:8709: \"$ac_compile\"") >&5
8710   (eval $ac_compile) 2>&5
8711   ac_status=$?
8712   echo "$as_me:8712: \$? = $ac_status" >&5
8713   (exit "$ac_status"); } &&
8714          { ac_try='test -s "conftest.$ac_objext"'
8715   { (eval echo "$as_me:8715: \"$ac_try\"") >&5
8716   (eval $ac_try) 2>&5
8717   ac_status=$?
8718   echo "$as_me:8718: \$? = $ac_status" >&5
8719   (exit "$ac_status"); }; }; then
8720
8721         cf_cv_term_header="$cf_test"
8722 else
8723   echo "$as_me: failed program was:" >&5
8724 cat "conftest.$ac_ext" >&5
8725
8726         cf_cv_term_header=unknown
8727
8728 fi
8729 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8730         test "$cf_cv_term_header" != unknown && break
8731 done
8732
8733 fi
8734 echo "$as_me:8734: result: $cf_cv_term_header" >&5
8735 echo "${ECHO_T}$cf_cv_term_header" >&6
8736
8737 # Set definitions to allow ifdef'ing to accommodate subdirectories
8738
8739 case "$cf_cv_term_header" in
8740 (*term.h)
8741
8742 cat >>confdefs.h <<\EOF
8743 #define HAVE_TERM_H 1
8744 EOF
8745
8746         ;;
8747 esac
8748
8749 case "$cf_cv_term_header" in
8750 (ncurses/term.h)
8751
8752 cat >>confdefs.h <<\EOF
8753 #define HAVE_NCURSES_TERM_H 1
8754 EOF
8755
8756         ;;
8757 (ncursesw/term.h)
8758
8759 cat >>confdefs.h <<\EOF
8760 #define HAVE_NCURSESW_TERM_H 1
8761 EOF
8762
8763         ;;
8764 esac
8765
8766 # some applications need this, but should check for NCURSES_VERSION
8767
8768 cat >>confdefs.h <<\EOF
8769 #define NCURSES 1
8770 EOF
8771
8772 echo "$as_me:8772: checking for ncurses version" >&5
8773 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8774 if test "${cf_cv_ncurses_version+set}" = set; then
8775   echo $ECHO_N "(cached) $ECHO_C" >&6
8776 else
8777
8778         cf_cv_ncurses_version=no
8779         cf_tempfile=out$$
8780         rm -f "$cf_tempfile"
8781         if test "$cross_compiling" = yes; then
8782
8783         # This will not work if the preprocessor splits the line after the
8784         # Autoconf token.  The 'unproto' program does that.
8785         cat > "conftest.$ac_ext" <<EOF
8786 #include <${cf_cv_ncurses_header:-curses.h}>
8787 #undef Autoconf
8788 #ifdef NCURSES_VERSION
8789 Autoconf NCURSES_VERSION
8790 #else
8791 #ifdef __NCURSES_H
8792 Autoconf "old"
8793 #endif
8794 ;
8795 #endif
8796 EOF
8797         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8798         { (eval echo "$as_me:8798: \"$cf_try\"") >&5
8799   (eval $cf_try) 2>&5
8800   ac_status=$?
8801   echo "$as_me:8801: \$? = $ac_status" >&5
8802   (exit "$ac_status"); }
8803         if test -f conftest.out ; then
8804                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8805                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8806                 rm -f conftest.out
8807         fi
8808
8809 else
8810   cat >"conftest.$ac_ext" <<_ACEOF
8811 #line 8811 "configure"
8812 #include "confdefs.h"
8813
8814 $ac_includes_default
8815
8816 #include <${cf_cv_ncurses_header:-curses.h}>
8817
8818 int main(void)
8819 {
8820         FILE *fp = fopen("$cf_tempfile", "w");
8821 #ifdef NCURSES_VERSION
8822 # ifdef NCURSES_VERSION_PATCH
8823         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8824 # else
8825         fprintf(fp, "%s\\n", NCURSES_VERSION);
8826 # endif
8827 #else
8828 # ifdef __NCURSES_H
8829         fprintf(fp, "old\\n");
8830 # else
8831         make an error
8832 # endif
8833 #endif
8834         ${cf_cv_main_return:-return}(0);
8835 }
8836 _ACEOF
8837 rm -f "conftest$ac_exeext"
8838 if { (eval echo "$as_me:8838: \"$ac_link\"") >&5
8839   (eval $ac_link) 2>&5
8840   ac_status=$?
8841   echo "$as_me:8841: \$? = $ac_status" >&5
8842   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8843   { (eval echo "$as_me:8843: \"$ac_try\"") >&5
8844   (eval $ac_try) 2>&5
8845   ac_status=$?
8846   echo "$as_me:8846: \$? = $ac_status" >&5
8847   (exit "$ac_status"); }; }; then
8848
8849         cf_cv_ncurses_version=`cat $cf_tempfile`
8850 else
8851   echo "$as_me: program exited with status $ac_status" >&5
8852 echo "$as_me: failed program was:" >&5
8853 cat "conftest.$ac_ext" >&5
8854 fi
8855 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8856 fi
8857         rm -f "$cf_tempfile"
8858
8859 fi
8860 echo "$as_me:8860: result: $cf_cv_ncurses_version" >&5
8861 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8862 test "$cf_cv_ncurses_version" = no ||
8863 cat >>confdefs.h <<\EOF
8864 #define NCURSES 1
8865 EOF
8866
8867 cf_nculib_root=ncursesw
8868         # This works, except for the special case where we find gpm, but
8869         # ncurses is in a nonstandard location via $LIBS, and we really want
8870         # to link gpm.
8871 cf_ncurses_LIBS=""
8872 cf_ncurses_SAVE="$LIBS"
8873 echo "$as_me:8873: checking for Gpm_Open in -lgpm" >&5
8874 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8875 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8876   echo $ECHO_N "(cached) $ECHO_C" >&6
8877 else
8878   ac_check_lib_save_LIBS=$LIBS
8879 LIBS="-lgpm  $LIBS"
8880 cat >"conftest.$ac_ext" <<_ACEOF
8881 #line 8881 "configure"
8882 #include "confdefs.h"
8883
8884 /* Override any gcc2 internal prototype to avoid an error.  */
8885 #ifdef __cplusplus
8886 extern "C"
8887 #endif
8888 /* We use char because int might match the return type of a gcc2
8889    builtin and then its argument prototype would still apply.  */
8890 char Gpm_Open ();
8891 int
8892 main (void)
8893 {
8894 Gpm_Open ();
8895   ;
8896   return 0;
8897 }
8898 _ACEOF
8899 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8900 if { (eval echo "$as_me:8900: \"$ac_link\"") >&5
8901   (eval $ac_link) 2>&5
8902   ac_status=$?
8903   echo "$as_me:8903: \$? = $ac_status" >&5
8904   (exit "$ac_status"); } &&
8905          { ac_try='test -s "conftest$ac_exeext"'
8906   { (eval echo "$as_me:8906: \"$ac_try\"") >&5
8907   (eval $ac_try) 2>&5
8908   ac_status=$?
8909   echo "$as_me:8909: \$? = $ac_status" >&5
8910   (exit "$ac_status"); }; }; then
8911   ac_cv_lib_gpm_Gpm_Open=yes
8912 else
8913   echo "$as_me: failed program was:" >&5
8914 cat "conftest.$ac_ext" >&5
8915 ac_cv_lib_gpm_Gpm_Open=no
8916 fi
8917 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8918 LIBS=$ac_check_lib_save_LIBS
8919 fi
8920 echo "$as_me:8920: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8921 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8922 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8923   echo "$as_me:8923: checking for initscr in -lgpm" >&5
8924 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8925 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8926   echo $ECHO_N "(cached) $ECHO_C" >&6
8927 else
8928   ac_check_lib_save_LIBS=$LIBS
8929 LIBS="-lgpm  $LIBS"
8930 cat >"conftest.$ac_ext" <<_ACEOF
8931 #line 8931 "configure"
8932 #include "confdefs.h"
8933
8934 /* Override any gcc2 internal prototype to avoid an error.  */
8935 #ifdef __cplusplus
8936 extern "C"
8937 #endif
8938 /* We use char because int might match the return type of a gcc2
8939    builtin and then its argument prototype would still apply.  */
8940 char initscr ();
8941 int
8942 main (void)
8943 {
8944 initscr ();
8945   ;
8946   return 0;
8947 }
8948 _ACEOF
8949 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8950 if { (eval echo "$as_me:8950: \"$ac_link\"") >&5
8951   (eval $ac_link) 2>&5
8952   ac_status=$?
8953   echo "$as_me:8953: \$? = $ac_status" >&5
8954   (exit "$ac_status"); } &&
8955          { ac_try='test -s "conftest$ac_exeext"'
8956   { (eval echo "$as_me:8956: \"$ac_try\"") >&5
8957   (eval $ac_try) 2>&5
8958   ac_status=$?
8959   echo "$as_me:8959: \$? = $ac_status" >&5
8960   (exit "$ac_status"); }; }; then
8961   ac_cv_lib_gpm_initscr=yes
8962 else
8963   echo "$as_me: failed program was:" >&5
8964 cat "conftest.$ac_ext" >&5
8965 ac_cv_lib_gpm_initscr=no
8966 fi
8967 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8968 LIBS=$ac_check_lib_save_LIBS
8969 fi
8970 echo "$as_me:8970: result: $ac_cv_lib_gpm_initscr" >&5
8971 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8972 if test "$ac_cv_lib_gpm_initscr" = yes; then
8973   LIBS="$cf_ncurses_SAVE"
8974 else
8975   cf_ncurses_LIBS="-lgpm"
8976 fi
8977
8978 fi
8979
8980 case "$host_os" in
8981 (freebsd*)
8982         # This is only necessary if you are linking against an obsolete
8983         # version of ncurses (but it should do no harm, since it is static).
8984         if test "$cf_nculib_root" = ncurses ; then
8985                 echo "$as_me:8985: checking for tgoto in -lmytinfo" >&5
8986 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8987 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8988   echo $ECHO_N "(cached) $ECHO_C" >&6
8989 else
8990   ac_check_lib_save_LIBS=$LIBS
8991 LIBS="-lmytinfo  $LIBS"
8992 cat >"conftest.$ac_ext" <<_ACEOF
8993 #line 8993 "configure"
8994 #include "confdefs.h"
8995
8996 /* Override any gcc2 internal prototype to avoid an error.  */
8997 #ifdef __cplusplus
8998 extern "C"
8999 #endif
9000 /* We use char because int might match the return type of a gcc2
9001    builtin and then its argument prototype would still apply.  */
9002 char tgoto ();
9003 int
9004 main (void)
9005 {
9006 tgoto ();
9007   ;
9008   return 0;
9009 }
9010 _ACEOF
9011 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9012 if { (eval echo "$as_me:9012: \"$ac_link\"") >&5
9013   (eval $ac_link) 2>&5
9014   ac_status=$?
9015   echo "$as_me:9015: \$? = $ac_status" >&5
9016   (exit "$ac_status"); } &&
9017          { ac_try='test -s "conftest$ac_exeext"'
9018   { (eval echo "$as_me:9018: \"$ac_try\"") >&5
9019   (eval $ac_try) 2>&5
9020   ac_status=$?
9021   echo "$as_me:9021: \$? = $ac_status" >&5
9022   (exit "$ac_status"); }; }; then
9023   ac_cv_lib_mytinfo_tgoto=yes
9024 else
9025   echo "$as_me: failed program was:" >&5
9026 cat "conftest.$ac_ext" >&5
9027 ac_cv_lib_mytinfo_tgoto=no
9028 fi
9029 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9030 LIBS=$ac_check_lib_save_LIBS
9031 fi
9032 echo "$as_me:9032: result: $ac_cv_lib_mytinfo_tgoto" >&5
9033 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9034 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9035   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9036 fi
9037
9038         fi
9039         ;;
9040 esac
9041
9042 cf_add_libs="$LIBS"
9043 # reverse order
9044 cf_add_0lib=
9045 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9046 # filter duplicates
9047 for cf_add_1lib in $cf_add_0lib; do
9048         for cf_add_2lib in $cf_add_libs; do
9049                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9050                         cf_add_1lib=
9051                         break
9052                 fi
9053         done
9054         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9055 done
9056 LIBS="$cf_add_libs"
9057
9058 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9059 then
9060
9061 cf_add_libs="$LIBS"
9062 # reverse order
9063 cf_add_0lib=
9064 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9065 # filter duplicates
9066 for cf_add_1lib in $cf_add_0lib; do
9067         for cf_add_2lib in $cf_add_libs; do
9068                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9069                         cf_add_1lib=
9070                         break
9071                 fi
9072         done
9073         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9074 done
9075 LIBS="$cf_add_libs"
9076
9077 else
9078
9079         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9080         cf_libdir=""
9081         echo "$as_me:9081: checking for initscr" >&5
9082 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9083 if test "${ac_cv_func_initscr+set}" = set; then
9084   echo $ECHO_N "(cached) $ECHO_C" >&6
9085 else
9086   cat >"conftest.$ac_ext" <<_ACEOF
9087 #line 9087 "configure"
9088 #include "confdefs.h"
9089 #define initscr autoconf_temporary
9090 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9091 #undef initscr
9092
9093 #ifdef __cplusplus
9094 extern "C"
9095 #endif
9096
9097 /* We use char because int might match the return type of a gcc2
9098    builtin and then its argument prototype would still apply.  */
9099 char initscr (void);
9100
9101 int
9102 main (void)
9103 {
9104
9105 /* The GNU C library defines stubs for functions which it implements
9106     to always fail with ENOSYS.  Some functions are actually named
9107     something starting with __ and the normal name is an alias.  */
9108 #if defined (__stub_initscr) || defined (__stub___initscr)
9109 #error found stub for initscr
9110 #endif
9111
9112         return initscr ();
9113   ;
9114   return 0;
9115 }
9116 _ACEOF
9117 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9118 if { (eval echo "$as_me:9118: \"$ac_link\"") >&5
9119   (eval $ac_link) 2>&5
9120   ac_status=$?
9121   echo "$as_me:9121: \$? = $ac_status" >&5
9122   (exit "$ac_status"); } &&
9123          { ac_try='test -s "conftest$ac_exeext"'
9124   { (eval echo "$as_me:9124: \"$ac_try\"") >&5
9125   (eval $ac_try) 2>&5
9126   ac_status=$?
9127   echo "$as_me:9127: \$? = $ac_status" >&5
9128   (exit "$ac_status"); }; }; then
9129   ac_cv_func_initscr=yes
9130 else
9131   echo "$as_me: failed program was:" >&5
9132 cat "conftest.$ac_ext" >&5
9133 ac_cv_func_initscr=no
9134 fi
9135 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9136 fi
9137 echo "$as_me:9137: result: $ac_cv_func_initscr" >&5
9138 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9139 if test "$ac_cv_func_initscr" = yes; then
9140   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9141 else
9142
9143                 cf_save_LIBS="$LIBS"
9144                 echo "$as_me:9144: checking for initscr in -l$cf_nculib_root" >&5
9145 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9146                 LIBS="-l$cf_nculib_root $LIBS"
9147                 cat >"conftest.$ac_ext" <<_ACEOF
9148 #line 9148 "configure"
9149 #include "confdefs.h"
9150 #include <${cf_cv_ncurses_header:-curses.h}>
9151 int
9152 main (void)
9153 {
9154 initscr()
9155   ;
9156   return 0;
9157 }
9158 _ACEOF
9159 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9160 if { (eval echo "$as_me:9160: \"$ac_link\"") >&5
9161   (eval $ac_link) 2>&5
9162   ac_status=$?
9163   echo "$as_me:9163: \$? = $ac_status" >&5
9164   (exit "$ac_status"); } &&
9165          { ac_try='test -s "conftest$ac_exeext"'
9166   { (eval echo "$as_me:9166: \"$ac_try\"") >&5
9167   (eval $ac_try) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit "$ac_status"); }; }; then
9171   echo "$as_me:9171: result: yes" >&5
9172 echo "${ECHO_T}yes" >&6
9173                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9174
9175 else
9176   echo "$as_me: failed program was:" >&5
9177 cat "conftest.$ac_ext" >&5
9178 echo "$as_me:9178: result: no" >&5
9179 echo "${ECHO_T}no" >&6
9180
9181 cf_search=
9182 cf_library_path_list=""
9183 if test -n "${LDFLAGS}${LIBS}" ; then
9184         for cf_library_path in $LDFLAGS $LIBS
9185         do
9186                 case "$cf_library_path" in
9187                 (-L*)
9188                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9189
9190 test "x$cf_library_path" != "xNONE" && \
9191 test -d "$cf_library_path" && \
9192  {
9193         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9194         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9195         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9196         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9197         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9198         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"
9199 }
9200
9201                         cf_library_path_list="$cf_library_path_list $cf_search"
9202                         ;;
9203                 esac
9204         done
9205 fi
9206
9207 cf_search=
9208
9209 test "x$prefix" != "xNONE" && \
9210 test -d "$prefix" && \
9211  {
9212         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9213         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9214         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9215         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9216         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9217         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9218 }
9219
9220 for cf_subdir_prefix in \
9221         /usr \
9222         /usr/local \
9223         /usr/pkg \
9224         /opt \
9225         /opt/local \
9226         $HOME
9227 do
9228
9229 test "x$cf_subdir_prefix" != "x$prefix" && \
9230 test -d "$cf_subdir_prefix" && \
9231 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9232         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9233         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9234         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9235         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9236         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9237         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"
9238 }
9239
9240 done
9241
9242 cf_search="$cf_library_path_list $cf_search"
9243
9244                         for cf_libdir in $cf_search
9245                         do
9246                                 echo "$as_me:9246: checking for -l$cf_nculib_root in $cf_libdir" >&5
9247 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9248                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9249                                 cat >"conftest.$ac_ext" <<_ACEOF
9250 #line 9250 "configure"
9251 #include "confdefs.h"
9252 #include <${cf_cv_ncurses_header:-curses.h}>
9253 int
9254 main (void)
9255 {
9256 initscr()
9257   ;
9258   return 0;
9259 }
9260 _ACEOF
9261 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9262 if { (eval echo "$as_me:9262: \"$ac_link\"") >&5
9263   (eval $ac_link) 2>&5
9264   ac_status=$?
9265   echo "$as_me:9265: \$? = $ac_status" >&5
9266   (exit "$ac_status"); } &&
9267          { ac_try='test -s "conftest$ac_exeext"'
9268   { (eval echo "$as_me:9268: \"$ac_try\"") >&5
9269   (eval $ac_try) 2>&5
9270   ac_status=$?
9271   echo "$as_me:9271: \$? = $ac_status" >&5
9272   (exit "$ac_status"); }; }; then
9273   echo "$as_me:9273: result: yes" >&5
9274 echo "${ECHO_T}yes" >&6
9275                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9276                                          break
9277 else
9278   echo "$as_me: failed program was:" >&5
9279 cat "conftest.$ac_ext" >&5
9280 echo "$as_me:9280: result: no" >&5
9281 echo "${ECHO_T}no" >&6
9282                                          LIBS="$cf_save_LIBS"
9283 fi
9284 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9285                         done
9286
9287 fi
9288 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9289
9290 fi
9291
9292 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9293
9294 if test "$cf_found_library" = no ; then
9295         { { echo "$as_me:9295: error: Cannot link $cf_nculib_root library" >&5
9296 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9297    { (exit 1); exit 1; }; }
9298 fi
9299
9300 fi
9301
9302 if test -n "$cf_ncurses_LIBS" ; then
9303         echo "$as_me:9303: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9304 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9305         cf_ncurses_SAVE="$LIBS"
9306         for p in $cf_ncurses_LIBS ; do
9307                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9308                 if test "$q" != "$LIBS" ; then
9309                         LIBS="$q"
9310                 fi
9311         done
9312         cat >"conftest.$ac_ext" <<_ACEOF
9313 #line 9313 "configure"
9314 #include "confdefs.h"
9315 #include <${cf_cv_ncurses_header:-curses.h}>
9316 int
9317 main (void)
9318 {
9319 initscr(); mousemask(0,0); tigetstr((char *)0);
9320   ;
9321   return 0;
9322 }
9323 _ACEOF
9324 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9325 if { (eval echo "$as_me:9325: \"$ac_link\"") >&5
9326   (eval $ac_link) 2>&5
9327   ac_status=$?
9328   echo "$as_me:9328: \$? = $ac_status" >&5
9329   (exit "$ac_status"); } &&
9330          { ac_try='test -s "conftest$ac_exeext"'
9331   { (eval echo "$as_me:9331: \"$ac_try\"") >&5
9332   (eval $ac_try) 2>&5
9333   ac_status=$?
9334   echo "$as_me:9334: \$? = $ac_status" >&5
9335   (exit "$ac_status"); }; }; then
9336   echo "$as_me:9336: result: yes" >&5
9337 echo "${ECHO_T}yes" >&6
9338 else
9339   echo "$as_me: failed program was:" >&5
9340 cat "conftest.$ac_ext" >&5
9341 echo "$as_me:9341: result: no" >&5
9342 echo "${ECHO_T}no" >&6
9343                  LIBS="$cf_ncurses_SAVE"
9344 fi
9345 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9346 fi
9347
9348 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9349
9350 cat >>confdefs.h <<EOF
9351 #define $cf_nculib_ROOT 1
9352 EOF
9353
9354         fi
9355 else
9356         NCURSES_CONFIG=none
9357 fi
9358
9359 else
9360
9361 cf_ncuconfig_root=ncurses
9362 cf_have_ncuconfig=no
9363
9364 if test "x${PKG_CONFIG:=none}" != xnone; then
9365         echo "$as_me:9365: checking pkg-config for $cf_ncuconfig_root" >&5
9366 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9367         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9368                 echo "$as_me:9368: result: yes" >&5
9369 echo "${ECHO_T}yes" >&6
9370
9371                 echo "$as_me:9371: checking if the $cf_ncuconfig_root package files work" >&5
9372 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9373                 cf_have_ncuconfig=unknown
9374
9375                 cf_save_CFLAGS="$CFLAGS"
9376                 cf_save_CPPFLAGS="$CPPFLAGS"
9377                 cf_save_LIBS="$LIBS"
9378
9379                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9380                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9381
9382                 # while -W for passing linker flags is prevalent, it is not "standard".
9383                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9384                 # incompatible _and_ non-standard -W option which gives an error.  Work
9385                 # around that pitfall.
9386                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9387                 (x*c[89]9@@*-W*)
9388
9389 cf_fix_cppflags=no
9390 cf_new_cflags=
9391 cf_new_cppflags=
9392 cf_new_extra_cppflags=
9393
9394 for cf_add_cflags in $cf_pkg_cflags
9395 do
9396 case "$cf_fix_cppflags" in
9397 (no)
9398         case "$cf_add_cflags" in
9399         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9400                 case "$cf_add_cflags" in
9401                 (-D*)
9402                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9403
9404                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9405                                 && test -z "${cf_tst_cflags}" \
9406                                 && cf_fix_cppflags=yes
9407
9408                         if test "$cf_fix_cppflags" = yes ; then
9409
9410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9412
9413                                 continue
9414                         elif test "${cf_tst_cflags}" = "\"'" ; then
9415
9416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9418
9419                                 continue
9420                         fi
9421                         ;;
9422                 esac
9423                 case "$CPPFLAGS" in
9424                 (*$cf_add_cflags)
9425                         ;;
9426                 (*)
9427                         case "$cf_add_cflags" in
9428                         (-D*)
9429                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9430
9431 CPPFLAGS=`echo "$CPPFLAGS" | \
9432         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9433                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9434
9435                                 ;;
9436                         esac
9437
9438         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9439         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9440
9441                         ;;
9442                 esac
9443                 ;;
9444         (*)
9445
9446         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9447         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9448
9449                 ;;
9450         esac
9451         ;;
9452 (yes)
9453
9454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9456
9457         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9458
9459         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9460                 && test -z "${cf_tst_cflags}" \
9461                 && cf_fix_cppflags=no
9462         ;;
9463 esac
9464 done
9465
9466 if test -n "$cf_new_cflags" ; then
9467
9468         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9469         CFLAGS="${CFLAGS}$cf_new_cflags"
9470
9471 fi
9472
9473 if test -n "$cf_new_cppflags" ; then
9474
9475         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9476         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9477
9478 fi
9479
9480 if test -n "$cf_new_extra_cppflags" ; then
9481
9482         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9483         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9484
9485 fi
9486
9487 cf_add_libs="$LIBS"
9488 # reverse order
9489 cf_add_0lib=
9490 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9491 # filter duplicates
9492 for cf_add_1lib in $cf_add_0lib; do
9493         for cf_add_2lib in $cf_add_libs; do
9494                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9495                         cf_add_1lib=
9496                         break
9497                 fi
9498         done
9499         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9500 done
9501 LIBS="$cf_add_libs"
9502
9503                         cat >"conftest.$ac_ext" <<_ACEOF
9504 #line 9504 "configure"
9505 #include "confdefs.h"
9506 #include <${cf_cv_ncurses_header:-curses.h}>
9507 int
9508 main (void)
9509 {
9510 initscr(); mousemask(0,0); tigetstr((char *)0);
9511   ;
9512   return 0;
9513 }
9514 _ACEOF
9515 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9516 if { (eval echo "$as_me:9516: \"$ac_link\"") >&5
9517   (eval $ac_link) 2>&5
9518   ac_status=$?
9519   echo "$as_me:9519: \$? = $ac_status" >&5
9520   (exit "$ac_status"); } &&
9521          { ac_try='test -s "conftest$ac_exeext"'
9522   { (eval echo "$as_me:9522: \"$ac_try\"") >&5
9523   (eval $ac_try) 2>&5
9524   ac_status=$?
9525   echo "$as_me:9525: \$? = $ac_status" >&5
9526   (exit "$ac_status"); }; }; then
9527   if test "$cross_compiling" = yes; then
9528   cf_test_ncuconfig=maybe
9529 else
9530   cat >"conftest.$ac_ext" <<_ACEOF
9531 #line 9531 "configure"
9532 #include "confdefs.h"
9533 #include <${cf_cv_ncurses_header:-curses.h}>
9534                                         int main(void)
9535                                         { const char *xx = curses_version(); return (xx == 0); }
9536 _ACEOF
9537 rm -f "conftest$ac_exeext"
9538 if { (eval echo "$as_me:9538: \"$ac_link\"") >&5
9539   (eval $ac_link) 2>&5
9540   ac_status=$?
9541   echo "$as_me:9541: \$? = $ac_status" >&5
9542   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9543   { (eval echo "$as_me:9543: \"$ac_try\"") >&5
9544   (eval $ac_try) 2>&5
9545   ac_status=$?
9546   echo "$as_me:9546: \$? = $ac_status" >&5
9547   (exit "$ac_status"); }; }; then
9548   cf_test_ncuconfig=yes
9549 else
9550   echo "$as_me: program exited with status $ac_status" >&5
9551 echo "$as_me: failed program was:" >&5
9552 cat "conftest.$ac_ext" >&5
9553 cf_test_ncuconfig=no
9554 fi
9555 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9556 fi
9557 else
9558   echo "$as_me: failed program was:" >&5
9559 cat "conftest.$ac_ext" >&5
9560 cf_test_ncuconfig=no
9561 fi
9562 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9563
9564                         CFLAGS="$cf_save_CFLAGS"
9565                         CPPFLAGS="$cf_save_CPPFLAGS"
9566                         LIBS="$cf_save_LIBS"
9567
9568                         if test "x$cf_test_ncuconfig" != xyes; then
9569                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9570                                 cf_pkg_cflags="$cf_temp"
9571                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9572                                 cf_pkg_libs="$cf_temp"
9573                         fi
9574                         ;;
9575                 esac
9576
9577 for cf_add_cflags in $cf_pkg_cflags
9578 do
9579         case "x$cf_add_cflags" in
9580         (x-[DU]*)
9581
9582 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9583 while true
9584 do
9585         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9586         test "$CFLAGS" != "$cf_old_cflag" || break
9587
9588         CFLAGS="$cf_old_cflag"
9589 done
9590
9591 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9592 while true
9593 do
9594         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9595         test "$CPPFLAGS" != "$cf_old_cflag" || break
9596
9597         CPPFLAGS="$cf_old_cflag"
9598 done
9599
9600                 ;;
9601         esac
9602
9603 cf_fix_cppflags=no
9604 cf_new_cflags=
9605 cf_new_cppflags=
9606 cf_new_extra_cppflags=
9607
9608 for cf_add_cflags in $cf_add_cflags
9609 do
9610 case "$cf_fix_cppflags" in
9611 (no)
9612         case "$cf_add_cflags" in
9613         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9614                 case "$cf_add_cflags" in
9615                 (-D*)
9616                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9617
9618                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9619                                 && test -z "${cf_tst_cflags}" \
9620                                 && cf_fix_cppflags=yes
9621
9622                         if test "$cf_fix_cppflags" = yes ; then
9623
9624         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9625         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9626
9627                                 continue
9628                         elif test "${cf_tst_cflags}" = "\"'" ; then
9629
9630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9632
9633                                 continue
9634                         fi
9635                         ;;
9636                 esac
9637                 case "$CPPFLAGS" in
9638                 (*$cf_add_cflags)
9639                         ;;
9640                 (*)
9641                         case "$cf_add_cflags" in
9642                         (-D*)
9643                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9644
9645 CPPFLAGS=`echo "$CPPFLAGS" | \
9646         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9647                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9648
9649                                 ;;
9650                         esac
9651
9652         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9653         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9654
9655                         ;;
9656                 esac
9657                 ;;
9658         (*)
9659
9660         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9661         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9662
9663                 ;;
9664         esac
9665         ;;
9666 (yes)
9667
9668         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9669         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9670
9671         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9672
9673         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9674                 && test -z "${cf_tst_cflags}" \
9675                 && cf_fix_cppflags=no
9676         ;;
9677 esac
9678 done
9679
9680 if test -n "$cf_new_cflags" ; then
9681
9682         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9683         CFLAGS="${CFLAGS}$cf_new_cflags"
9684
9685 fi
9686
9687 if test -n "$cf_new_cppflags" ; then
9688
9689         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9690         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9691
9692 fi
9693
9694 if test -n "$cf_new_extra_cppflags" ; then
9695
9696         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9697         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9698
9699 fi
9700
9701 done
9702
9703 cf_add_libs="$LIBS"
9704 # reverse order
9705 cf_add_0lib=
9706 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9707 # filter duplicates
9708 for cf_add_1lib in $cf_add_0lib; do
9709         for cf_add_2lib in $cf_add_libs; do
9710                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9711                         cf_add_1lib=
9712                         break
9713                 fi
9714         done
9715         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9716 done
9717 LIBS="$cf_add_libs"
9718
9719                 cat >"conftest.$ac_ext" <<_ACEOF
9720 #line 9720 "configure"
9721 #include "confdefs.h"
9722 #include <${cf_cv_ncurses_header:-curses.h}>
9723 int
9724 main (void)
9725 {
9726 initscr(); mousemask(0,0); tigetstr((char *)0);
9727   ;
9728   return 0;
9729 }
9730 _ACEOF
9731 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9732 if { (eval echo "$as_me:9732: \"$ac_link\"") >&5
9733   (eval $ac_link) 2>&5
9734   ac_status=$?
9735   echo "$as_me:9735: \$? = $ac_status" >&5
9736   (exit "$ac_status"); } &&
9737          { ac_try='test -s "conftest$ac_exeext"'
9738   { (eval echo "$as_me:9738: \"$ac_try\"") >&5
9739   (eval $ac_try) 2>&5
9740   ac_status=$?
9741   echo "$as_me:9741: \$? = $ac_status" >&5
9742   (exit "$ac_status"); }; }; then
9743   if test "$cross_compiling" = yes; then
9744   cf_have_ncuconfig=maybe
9745 else
9746   cat >"conftest.$ac_ext" <<_ACEOF
9747 #line 9747 "configure"
9748 #include "confdefs.h"
9749 #include <${cf_cv_ncurses_header:-curses.h}>
9750                                 int main(void)
9751                                 { const char *xx = curses_version(); return (xx == 0); }
9752 _ACEOF
9753 rm -f "conftest$ac_exeext"
9754 if { (eval echo "$as_me:9754: \"$ac_link\"") >&5
9755   (eval $ac_link) 2>&5
9756   ac_status=$?
9757   echo "$as_me:9757: \$? = $ac_status" >&5
9758   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9759   { (eval echo "$as_me:9759: \"$ac_try\"") >&5
9760   (eval $ac_try) 2>&5
9761   ac_status=$?
9762   echo "$as_me:9762: \$? = $ac_status" >&5
9763   (exit "$ac_status"); }; }; then
9764   cf_have_ncuconfig=yes
9765 else
9766   echo "$as_me: program exited with status $ac_status" >&5
9767 echo "$as_me: failed program was:" >&5
9768 cat "conftest.$ac_ext" >&5
9769 cf_have_ncuconfig=no
9770 fi
9771 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9772 fi
9773 else
9774   echo "$as_me: failed program was:" >&5
9775 cat "conftest.$ac_ext" >&5
9776 cf_have_ncuconfig=no
9777 fi
9778 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9779                 echo "$as_me:9779: result: $cf_have_ncuconfig" >&5
9780 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9781                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9782                 if test "$cf_have_ncuconfig" != "yes"
9783                 then
9784                         CPPFLAGS="$cf_save_CPPFLAGS"
9785                         LIBS="$cf_save_LIBS"
9786                         NCURSES_CONFIG_PKG=none
9787                 else
9788
9789 cat >>confdefs.h <<\EOF
9790 #define NCURSES 1
9791 EOF
9792
9793                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9794
9795 echo "$as_me:9795: checking for terminfo header" >&5
9796 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9797 if test "${cf_cv_term_header+set}" = set; then
9798   echo $ECHO_N "(cached) $ECHO_C" >&6
9799 else
9800
9801 case "${cf_cv_ncurses_header}" in
9802 (*/ncurses.h|*/ncursesw.h)
9803         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9804         ;;
9805 (*)
9806         cf_term_header=term.h
9807         ;;
9808 esac
9809
9810 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9811 do
9812 cat >"conftest.$ac_ext" <<_ACEOF
9813 #line 9813 "configure"
9814 #include "confdefs.h"
9815 #include <stdio.h>
9816 #include <${cf_cv_ncurses_header:-curses.h}>
9817 #include <$cf_test>
9818
9819 int
9820 main (void)
9821 {
9822 int x = auto_left_margin; (void)x
9823   ;
9824   return 0;
9825 }
9826 _ACEOF
9827 rm -f "conftest.$ac_objext"
9828 if { (eval echo "$as_me:9828: \"$ac_compile\"") >&5
9829   (eval $ac_compile) 2>&5
9830   ac_status=$?
9831   echo "$as_me:9831: \$? = $ac_status" >&5
9832   (exit "$ac_status"); } &&
9833          { ac_try='test -s "conftest.$ac_objext"'
9834   { (eval echo "$as_me:9834: \"$ac_try\"") >&5
9835   (eval $ac_try) 2>&5
9836   ac_status=$?
9837   echo "$as_me:9837: \$? = $ac_status" >&5
9838   (exit "$ac_status"); }; }; then
9839
9840         cf_cv_term_header="$cf_test"
9841 else
9842   echo "$as_me: failed program was:" >&5
9843 cat "conftest.$ac_ext" >&5
9844
9845         cf_cv_term_header=unknown
9846
9847 fi
9848 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9849         test "$cf_cv_term_header" != unknown && break
9850 done
9851
9852 fi
9853 echo "$as_me:9853: result: $cf_cv_term_header" >&5
9854 echo "${ECHO_T}$cf_cv_term_header" >&6
9855
9856 # Set definitions to allow ifdef'ing to accommodate subdirectories
9857
9858 case "$cf_cv_term_header" in
9859 (*term.h)
9860
9861 cat >>confdefs.h <<\EOF
9862 #define HAVE_TERM_H 1
9863 EOF
9864
9865         ;;
9866 esac
9867
9868 case "$cf_cv_term_header" in
9869 (ncurses/term.h)
9870
9871 cat >>confdefs.h <<\EOF
9872 #define HAVE_NCURSES_TERM_H 1
9873 EOF
9874
9875         ;;
9876 (ncursesw/term.h)
9877
9878 cat >>confdefs.h <<\EOF
9879 #define HAVE_NCURSESW_TERM_H 1
9880 EOF
9881
9882         ;;
9883 esac
9884
9885                 fi
9886
9887         else
9888                 echo "$as_me:9888: result: no" >&5
9889 echo "${ECHO_T}no" >&6
9890                 NCURSES_CONFIG_PKG=none
9891         fi
9892 else
9893         NCURSES_CONFIG_PKG=none
9894 fi
9895
9896 if test "x$cf_have_ncuconfig" = "xno"; then
9897         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9898
9899 if test -n "$ac_tool_prefix"; then
9900   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9901   do
9902     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9903 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9904 echo "$as_me:9904: checking for $ac_word" >&5
9905 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9906 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9907   echo $ECHO_N "(cached) $ECHO_C" >&6
9908 else
9909   if test -n "$NCURSES_CONFIG"; then
9910   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9911 else
9912   ac_save_IFS=$IFS; IFS=$ac_path_separator
9913 ac_dummy="$PATH"
9914 for ac_dir in $ac_dummy; do
9915   IFS=$ac_save_IFS
9916   test -z "$ac_dir" && ac_dir=.
9917   $as_executable_p "$ac_dir/$ac_word" || continue
9918 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9919 echo "$as_me:9919: found $ac_dir/$ac_word" >&5
9920 break
9921 done
9922
9923 fi
9924 fi
9925 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9926 if test -n "$NCURSES_CONFIG"; then
9927   echo "$as_me:9927: result: $NCURSES_CONFIG" >&5
9928 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9929 else
9930   echo "$as_me:9930: result: no" >&5
9931 echo "${ECHO_T}no" >&6
9932 fi
9933
9934     test -n "$NCURSES_CONFIG" && break
9935   done
9936 fi
9937 if test -z "$NCURSES_CONFIG"; then
9938   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9939   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9940 do
9941   # Extract the first word of "$ac_prog", so it can be a program name with args.
9942 set dummy $ac_prog; ac_word=$2
9943 echo "$as_me:9943: checking for $ac_word" >&5
9944 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9945 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9946   echo $ECHO_N "(cached) $ECHO_C" >&6
9947 else
9948   if test -n "$ac_ct_NCURSES_CONFIG"; then
9949   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9950 else
9951   ac_save_IFS=$IFS; IFS=$ac_path_separator
9952 ac_dummy="$PATH"
9953 for ac_dir in $ac_dummy; do
9954   IFS=$ac_save_IFS
9955   test -z "$ac_dir" && ac_dir=.
9956   $as_executable_p "$ac_dir/$ac_word" || continue
9957 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9958 echo "$as_me:9958: found $ac_dir/$ac_word" >&5
9959 break
9960 done
9961
9962 fi
9963 fi
9964 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9965 if test -n "$ac_ct_NCURSES_CONFIG"; then
9966   echo "$as_me:9966: result: $ac_ct_NCURSES_CONFIG" >&5
9967 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9968 else
9969   echo "$as_me:9969: result: no" >&5
9970 echo "${ECHO_T}no" >&6
9971 fi
9972
9973   test -n "$ac_ct_NCURSES_CONFIG" && break
9974 done
9975 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9976
9977   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9978 fi
9979
9980         if test "$NCURSES_CONFIG" != none ; then
9981
9982 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9983 do
9984         case "x$cf_add_cflags" in
9985         (x-[DU]*)
9986
9987 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9988 while true
9989 do
9990         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9991         test "$CFLAGS" != "$cf_old_cflag" || break
9992
9993         CFLAGS="$cf_old_cflag"
9994 done
9995
9996 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9997 while true
9998 do
9999         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10000         test "$CPPFLAGS" != "$cf_old_cflag" || break
10001
10002         CPPFLAGS="$cf_old_cflag"
10003 done
10004
10005                 ;;
10006         esac
10007
10008 cf_fix_cppflags=no
10009 cf_new_cflags=
10010 cf_new_cppflags=
10011 cf_new_extra_cppflags=
10012
10013 for cf_add_cflags in $cf_add_cflags
10014 do
10015 case "$cf_fix_cppflags" in
10016 (no)
10017         case "$cf_add_cflags" in
10018         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10019                 case "$cf_add_cflags" in
10020                 (-D*)
10021                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10022
10023                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10024                                 && test -z "${cf_tst_cflags}" \
10025                                 && cf_fix_cppflags=yes
10026
10027                         if test "$cf_fix_cppflags" = yes ; then
10028
10029         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10030         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10031
10032                                 continue
10033                         elif test "${cf_tst_cflags}" = "\"'" ; then
10034
10035         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10036         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10037
10038                                 continue
10039                         fi
10040                         ;;
10041                 esac
10042                 case "$CPPFLAGS" in
10043                 (*$cf_add_cflags)
10044                         ;;
10045                 (*)
10046                         case "$cf_add_cflags" in
10047                         (-D*)
10048                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10049
10050 CPPFLAGS=`echo "$CPPFLAGS" | \
10051         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10052                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10053
10054                                 ;;
10055                         esac
10056
10057         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10058         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10059
10060                         ;;
10061                 esac
10062                 ;;
10063         (*)
10064
10065         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10066         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10067
10068                 ;;
10069         esac
10070         ;;
10071 (yes)
10072
10073         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10074         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10075
10076         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10077
10078         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10079                 && test -z "${cf_tst_cflags}" \
10080                 && cf_fix_cppflags=no
10081         ;;
10082 esac
10083 done
10084
10085 if test -n "$cf_new_cflags" ; then
10086
10087         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10088         CFLAGS="${CFLAGS}$cf_new_cflags"
10089
10090 fi
10091
10092 if test -n "$cf_new_cppflags" ; then
10093
10094         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10095         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10096
10097 fi
10098
10099 if test -n "$cf_new_extra_cppflags" ; then
10100
10101         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10102         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10103
10104 fi
10105
10106 done
10107
10108 cf_add_libs="$LIBS"
10109 # reverse order
10110 cf_add_0lib=
10111 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10112 # filter duplicates
10113 for cf_add_1lib in $cf_add_0lib; do
10114         for cf_add_2lib in $cf_add_libs; do
10115                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10116                         cf_add_1lib=
10117                         break
10118                 fi
10119         done
10120         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10121 done
10122 LIBS="$cf_add_libs"
10123
10124                 # even with config script, some packages use no-override for curses.h
10125
10126 echo "$as_me:10126: checking if we have identified curses headers" >&5
10127 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10128 if test "${cf_cv_ncurses_header+set}" = set; then
10129   echo $ECHO_N "(cached) $ECHO_C" >&6
10130 else
10131
10132 cf_cv_ncurses_header=none
10133 for cf_header in \
10134         ncurses.h ncurses/ncurses.h \
10135         curses.h ncurses/curses.h
10136 do
10137 cat >"conftest.$ac_ext" <<_ACEOF
10138 #line 10138 "configure"
10139 #include "confdefs.h"
10140 #include <${cf_header}>
10141 int
10142 main (void)
10143 {
10144 initscr(); endwin()
10145   ;
10146   return 0;
10147 }
10148 _ACEOF
10149 rm -f "conftest.$ac_objext"
10150 if { (eval echo "$as_me:10150: \"$ac_compile\"") >&5
10151   (eval $ac_compile) 2>&5
10152   ac_status=$?
10153   echo "$as_me:10153: \$? = $ac_status" >&5
10154   (exit "$ac_status"); } &&
10155          { ac_try='test -s "conftest.$ac_objext"'
10156   { (eval echo "$as_me:10156: \"$ac_try\"") >&5
10157   (eval $ac_try) 2>&5
10158   ac_status=$?
10159   echo "$as_me:10159: \$? = $ac_status" >&5
10160   (exit "$ac_status"); }; }; then
10161   cf_cv_ncurses_header=$cf_header; break
10162 else
10163   echo "$as_me: failed program was:" >&5
10164 cat "conftest.$ac_ext" >&5
10165 fi
10166 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10167 done
10168
10169 fi
10170 echo "$as_me:10170: result: $cf_cv_ncurses_header" >&5
10171 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10172
10173 if test "$cf_cv_ncurses_header" = none ; then
10174         { { echo "$as_me:10174: error: No curses header-files found" >&5
10175 echo "$as_me: error: No curses header-files found" >&2;}
10176    { (exit 1); exit 1; }; }
10177 fi
10178
10179 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10180
10181 for ac_header in $cf_cv_ncurses_header
10182 do
10183 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10184 echo "$as_me:10184: checking for $ac_header" >&5
10185 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10186 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10187   echo $ECHO_N "(cached) $ECHO_C" >&6
10188 else
10189   cat >"conftest.$ac_ext" <<_ACEOF
10190 #line 10190 "configure"
10191 #include "confdefs.h"
10192 #include <$ac_header>
10193 _ACEOF
10194 if { (eval echo "$as_me:10194: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10195   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10196   ac_status=$?
10197   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10198   rm -f conftest.er1
10199   cat conftest.err >&5
10200   echo "$as_me:10200: \$? = $ac_status" >&5
10201   (exit "$ac_status"); } >/dev/null; then
10202   if test -s conftest.err; then
10203     ac_cpp_err=$ac_c_preproc_warn_flag
10204   else
10205     ac_cpp_err=
10206   fi
10207 else
10208   ac_cpp_err=yes
10209 fi
10210 if test -z "$ac_cpp_err"; then
10211   eval "$as_ac_Header=yes"
10212 else
10213   echo "$as_me: failed program was:" >&5
10214   cat "conftest.$ac_ext" >&5
10215   eval "$as_ac_Header=no"
10216 fi
10217 rm -f conftest.err "conftest.$ac_ext"
10218 fi
10219 echo "$as_me:10219: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10220 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10221 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10222   cat >>confdefs.h <<EOF
10223 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10224 EOF
10225
10226 fi
10227 done
10228
10229 cat >>confdefs.h <<\EOF
10230 #define NCURSES 1
10231 EOF
10232
10233 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10234
10235                 cat >>confdefs.h <<EOF
10236 #define $cf_nculib_ROOT 1
10237 EOF
10238
10239                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10240
10241         else
10242
10243 cf_ncuhdr_root=ncurses
10244
10245 test -n "$cf_cv_curses_dir" && \
10246 test "$cf_cv_curses_dir" != "no" && { \
10247
10248 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10249   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10250   do
10251         while test "$cf_add_incdir" != /usr/include
10252         do
10253           if test -d "$cf_add_incdir"
10254           then
10255                 cf_have_incdir=no
10256                 if test -n "$CFLAGS$CPPFLAGS" ; then
10257                   # a loop is needed to ensure we can add subdirs of existing dirs
10258                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10259                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10260                           cf_have_incdir=yes; break
10261                         fi
10262                   done
10263                 fi
10264
10265                 if test "$cf_have_incdir" = no ; then
10266                   if test "$cf_add_incdir" = /usr/local/include ; then
10267                         if test "$GCC" = yes
10268                         then
10269                           cf_save_CPPFLAGS=$CPPFLAGS
10270
10271         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10272         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10273
10274                           cat >"conftest.$ac_ext" <<_ACEOF
10275 #line 10275 "configure"
10276 #include "confdefs.h"
10277 #include <stdio.h>
10278 int
10279 main (void)
10280 {
10281 printf("Hello")
10282   ;
10283   return 0;
10284 }
10285 _ACEOF
10286 rm -f "conftest.$ac_objext"
10287 if { (eval echo "$as_me:10287: \"$ac_compile\"") >&5
10288   (eval $ac_compile) 2>&5
10289   ac_status=$?
10290   echo "$as_me:10290: \$? = $ac_status" >&5
10291   (exit "$ac_status"); } &&
10292          { ac_try='test -s "conftest.$ac_objext"'
10293   { (eval echo "$as_me:10293: \"$ac_try\"") >&5
10294   (eval $ac_try) 2>&5
10295   ac_status=$?
10296   echo "$as_me:10296: \$? = $ac_status" >&5
10297   (exit "$ac_status"); }; }; then
10298   :
10299 else
10300   echo "$as_me: failed program was:" >&5
10301 cat "conftest.$ac_ext" >&5
10302 cf_have_incdir=yes
10303 fi
10304 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10305                           CPPFLAGS=$cf_save_CPPFLAGS
10306                         fi
10307                   fi
10308                 fi
10309
10310                 if test "$cf_have_incdir" = no ; then
10311                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10312
10313 echo "${as_me:-configure}:10313: testing adding $cf_add_incdir to include-path ..." 1>&5
10314
10315                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10316
10317                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10318                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10319                   cf_add_incdir="$cf_top_incdir"
10320                 else
10321                   break
10322                 fi
10323           else
10324                 break
10325           fi
10326         done
10327   done
10328 fi
10329
10330 }
10331
10332 echo "$as_me:10332: checking for $cf_ncuhdr_root header in include-path" >&5
10333 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10334 if test "${cf_cv_ncurses_h+set}" = set; then
10335   echo $ECHO_N "(cached) $ECHO_C" >&6
10336 else
10337
10338         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10339         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10340         for cf_header in $cf_header_list
10341         do
10342
10343         cat >"conftest.$ac_ext" <<_ACEOF
10344 #line 10344 "configure"
10345 #include "confdefs.h"
10346
10347 #include <$cf_header>
10348 int
10349 main (void)
10350 {
10351
10352 #ifdef NCURSES_VERSION
10353
10354 printf("%s\\n", NCURSES_VERSION);
10355 #else
10356 #ifdef __NCURSES_H
10357 printf("old\\n");
10358 #else
10359         make an error
10360 #endif
10361 #endif
10362
10363   ;
10364   return 0;
10365 }
10366 _ACEOF
10367 rm -f "conftest.$ac_objext"
10368 if { (eval echo "$as_me:10368: \"$ac_compile\"") >&5
10369   (eval $ac_compile) 2>&5
10370   ac_status=$?
10371   echo "$as_me:10371: \$? = $ac_status" >&5
10372   (exit "$ac_status"); } &&
10373          { ac_try='test -s "conftest.$ac_objext"'
10374   { (eval echo "$as_me:10374: \"$ac_try\"") >&5
10375   (eval $ac_try) 2>&5
10376   ac_status=$?
10377   echo "$as_me:10377: \$? = $ac_status" >&5
10378   (exit "$ac_status"); }; }; then
10379   cf_cv_ncurses_h=$cf_header
10380
10381 else
10382   echo "$as_me: failed program was:" >&5
10383 cat "conftest.$ac_ext" >&5
10384 cf_cv_ncurses_h=no
10385 fi
10386 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10387
10388                 test "$cf_cv_ncurses_h" != no && break
10389         done
10390
10391 fi
10392 echo "$as_me:10392: result: $cf_cv_ncurses_h" >&5
10393 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10394
10395 if test "$cf_cv_ncurses_h" != no ; then
10396         cf_cv_ncurses_header=$cf_cv_ncurses_h
10397 else
10398
10399 echo "$as_me:10399: checking for $cf_ncuhdr_root include-path" >&5
10400 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10401 if test "${cf_cv_ncurses_h2+set}" = set; then
10402   echo $ECHO_N "(cached) $ECHO_C" >&6
10403 else
10404
10405         test -n "$verbose" && echo
10406
10407 cf_search=
10408
10409 # collect the current set of include-directories from compiler flags
10410 cf_header_path_list=""
10411 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10412         for cf_header_path in $CPPFLAGS $CFLAGS
10413         do
10414                 case "$cf_header_path" in
10415                 (-I*)
10416                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10417
10418 test "x$cf_header_path" != "xNONE" && \
10419 test -d "$cf_header_path" && \
10420  {
10421         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10422         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10423         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10424         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10425         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10426         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"
10427 }
10428
10429                         cf_header_path_list="$cf_header_path_list $cf_search"
10430                         ;;
10431                 esac
10432         done
10433 fi
10434
10435 # add the variations for the package we are looking for
10436
10437 cf_search=
10438
10439 test "x$prefix" != "xNONE" && \
10440 test -d "$prefix" && \
10441  {
10442         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10443         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10444         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10445         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10446         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10447         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10448 }
10449
10450 for cf_subdir_prefix in \
10451         /usr \
10452         /usr/local \
10453         /usr/pkg \
10454         /opt \
10455         /opt/local \
10456         $HOME
10457 do
10458
10459 test "x$cf_subdir_prefix" != "x$prefix" && \
10460 test -d "$cf_subdir_prefix" && \
10461 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10462         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10463         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10464         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10465         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10466         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10467         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"
10468 }
10469
10470 done
10471
10472 test "$includedir" != NONE && \
10473 test "$includedir" != "/usr/include" && \
10474 test -d "$includedir" && {
10475         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10476         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10477 }
10478
10479 test "$oldincludedir" != NONE && \
10480 test "$oldincludedir" != "/usr/include" && \
10481 test -d "$oldincludedir" && {
10482         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10483         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10484 }
10485
10486 cf_search="$cf_search $cf_header_path_list"
10487
10488         test -n "$verbose" && echo "search path $cf_search"
10489         cf_save2_CPPFLAGS="$CPPFLAGS"
10490         for cf_incdir in $cf_search
10491         do
10492
10493 if test -n "$cf_incdir" ; then
10494   for cf_add_incdir in $cf_incdir
10495   do
10496         while test "$cf_add_incdir" != /usr/include
10497         do
10498           if test -d "$cf_add_incdir"
10499           then
10500                 cf_have_incdir=no
10501                 if test -n "$CFLAGS$CPPFLAGS" ; then
10502                   # a loop is needed to ensure we can add subdirs of existing dirs
10503                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10504                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10505                           cf_have_incdir=yes; break
10506                         fi
10507                   done
10508                 fi
10509
10510                 if test "$cf_have_incdir" = no ; then
10511                   if test "$cf_add_incdir" = /usr/local/include ; then
10512                         if test "$GCC" = yes
10513                         then
10514                           cf_save_CPPFLAGS=$CPPFLAGS
10515
10516         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10517         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10518
10519                           cat >"conftest.$ac_ext" <<_ACEOF
10520 #line 10520 "configure"
10521 #include "confdefs.h"
10522 #include <stdio.h>
10523 int
10524 main (void)
10525 {
10526 printf("Hello")
10527   ;
10528   return 0;
10529 }
10530 _ACEOF
10531 rm -f "conftest.$ac_objext"
10532 if { (eval echo "$as_me:10532: \"$ac_compile\"") >&5
10533   (eval $ac_compile) 2>&5
10534   ac_status=$?
10535   echo "$as_me:10535: \$? = $ac_status" >&5
10536   (exit "$ac_status"); } &&
10537          { ac_try='test -s "conftest.$ac_objext"'
10538   { (eval echo "$as_me:10538: \"$ac_try\"") >&5
10539   (eval $ac_try) 2>&5
10540   ac_status=$?
10541   echo "$as_me:10541: \$? = $ac_status" >&5
10542   (exit "$ac_status"); }; }; then
10543   :
10544 else
10545   echo "$as_me: failed program was:" >&5
10546 cat "conftest.$ac_ext" >&5
10547 cf_have_incdir=yes
10548 fi
10549 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10550                           CPPFLAGS=$cf_save_CPPFLAGS
10551                         fi
10552                   fi
10553                 fi
10554
10555                 if test "$cf_have_incdir" = no ; then
10556                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10557
10558 echo "${as_me:-configure}:10558: testing adding $cf_add_incdir to include-path ..." 1>&5
10559
10560                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10561
10562                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10563                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10564                   cf_add_incdir="$cf_top_incdir"
10565                 else
10566                   break
10567                 fi
10568           else
10569                 break
10570           fi
10571         done
10572   done
10573 fi
10574
10575                 for cf_header in \
10576                         ncurses.h \
10577                         curses.h
10578                 do
10579
10580         cat >"conftest.$ac_ext" <<_ACEOF
10581 #line 10581 "configure"
10582 #include "confdefs.h"
10583
10584 #include <$cf_header>
10585 int
10586 main (void)
10587 {
10588
10589 #ifdef NCURSES_VERSION
10590
10591 printf("%s\\n", NCURSES_VERSION);
10592 #else
10593 #ifdef __NCURSES_H
10594 printf("old\\n");
10595 #else
10596         make an error
10597 #endif
10598 #endif
10599
10600   ;
10601   return 0;
10602 }
10603 _ACEOF
10604 rm -f "conftest.$ac_objext"
10605 if { (eval echo "$as_me:10605: \"$ac_compile\"") >&5
10606   (eval $ac_compile) 2>&5
10607   ac_status=$?
10608   echo "$as_me:10608: \$? = $ac_status" >&5
10609   (exit "$ac_status"); } &&
10610          { ac_try='test -s "conftest.$ac_objext"'
10611   { (eval echo "$as_me:10611: \"$ac_try\"") >&5
10612   (eval $ac_try) 2>&5
10613   ac_status=$?
10614   echo "$as_me:10614: \$? = $ac_status" >&5
10615   (exit "$ac_status"); }; }; then
10616   cf_cv_ncurses_h2=$cf_header
10617
10618 else
10619   echo "$as_me: failed program was:" >&5
10620 cat "conftest.$ac_ext" >&5
10621 cf_cv_ncurses_h2=no
10622 fi
10623 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10624
10625                         if test "$cf_cv_ncurses_h2" != no ; then
10626                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10627                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10628                                 break
10629                         fi
10630                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10631                 done
10632                 CPPFLAGS="$cf_save2_CPPFLAGS"
10633                 test "$cf_cv_ncurses_h2" != no && break
10634         done
10635         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10635: error: not found" >&5
10636 echo "$as_me: error: not found" >&2;}
10637    { (exit 1); exit 1; }; }
10638
10639 fi
10640 echo "$as_me:10640: result: $cf_cv_ncurses_h2" >&5
10641 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10642
10643         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10644         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10645         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10646                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10647         fi
10648
10649 if test -n "$cf_1st_incdir" ; then
10650   for cf_add_incdir in $cf_1st_incdir
10651   do
10652         while test "$cf_add_incdir" != /usr/include
10653         do
10654           if test -d "$cf_add_incdir"
10655           then
10656                 cf_have_incdir=no
10657                 if test -n "$CFLAGS$CPPFLAGS" ; then
10658                   # a loop is needed to ensure we can add subdirs of existing dirs
10659                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10660                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10661                           cf_have_incdir=yes; break
10662                         fi
10663                   done
10664                 fi
10665
10666                 if test "$cf_have_incdir" = no ; then
10667                   if test "$cf_add_incdir" = /usr/local/include ; then
10668                         if test "$GCC" = yes
10669                         then
10670                           cf_save_CPPFLAGS=$CPPFLAGS
10671
10672         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10673         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10674
10675                           cat >"conftest.$ac_ext" <<_ACEOF
10676 #line 10676 "configure"
10677 #include "confdefs.h"
10678 #include <stdio.h>
10679 int
10680 main (void)
10681 {
10682 printf("Hello")
10683   ;
10684   return 0;
10685 }
10686 _ACEOF
10687 rm -f "conftest.$ac_objext"
10688 if { (eval echo "$as_me:10688: \"$ac_compile\"") >&5
10689   (eval $ac_compile) 2>&5
10690   ac_status=$?
10691   echo "$as_me:10691: \$? = $ac_status" >&5
10692   (exit "$ac_status"); } &&
10693          { ac_try='test -s "conftest.$ac_objext"'
10694   { (eval echo "$as_me:10694: \"$ac_try\"") >&5
10695   (eval $ac_try) 2>&5
10696   ac_status=$?
10697   echo "$as_me:10697: \$? = $ac_status" >&5
10698   (exit "$ac_status"); }; }; then
10699   :
10700 else
10701   echo "$as_me: failed program was:" >&5
10702 cat "conftest.$ac_ext" >&5
10703 cf_have_incdir=yes
10704 fi
10705 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10706                           CPPFLAGS=$cf_save_CPPFLAGS
10707                         fi
10708                   fi
10709                 fi
10710
10711                 if test "$cf_have_incdir" = no ; then
10712                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10713
10714 echo "${as_me:-configure}:10714: testing adding $cf_add_incdir to include-path ..." 1>&5
10715
10716                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10717
10718                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10719                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10720                   cf_add_incdir="$cf_top_incdir"
10721                 else
10722                   break
10723                 fi
10724           else
10725                 break
10726           fi
10727         done
10728   done
10729 fi
10730
10731 fi
10732
10733 # Set definitions to allow ifdef'ing for ncurses.h
10734
10735 case "$cf_cv_ncurses_header" in
10736 (*ncurses.h)
10737
10738 cat >>confdefs.h <<\EOF
10739 #define HAVE_NCURSES_H 1
10740 EOF
10741
10742         ;;
10743 esac
10744
10745 case "$cf_cv_ncurses_header" in
10746 (ncurses/curses.h|ncurses/ncurses.h)
10747
10748 cat >>confdefs.h <<\EOF
10749 #define HAVE_NCURSES_NCURSES_H 1
10750 EOF
10751
10752         ;;
10753 (ncursesw/curses.h|ncursesw/ncurses.h)
10754
10755 cat >>confdefs.h <<\EOF
10756 #define HAVE_NCURSESW_NCURSES_H 1
10757 EOF
10758
10759         ;;
10760 esac
10761
10762 echo "$as_me:10762: checking for terminfo header" >&5
10763 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10764 if test "${cf_cv_term_header+set}" = set; then
10765   echo $ECHO_N "(cached) $ECHO_C" >&6
10766 else
10767
10768 case "${cf_cv_ncurses_header}" in
10769 (*/ncurses.h|*/ncursesw.h)
10770         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10771         ;;
10772 (*)
10773         cf_term_header=term.h
10774         ;;
10775 esac
10776
10777 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10778 do
10779 cat >"conftest.$ac_ext" <<_ACEOF
10780 #line 10780 "configure"
10781 #include "confdefs.h"
10782 #include <stdio.h>
10783 #include <${cf_cv_ncurses_header:-curses.h}>
10784 #include <$cf_test>
10785
10786 int
10787 main (void)
10788 {
10789 int x = auto_left_margin; (void)x
10790   ;
10791   return 0;
10792 }
10793 _ACEOF
10794 rm -f "conftest.$ac_objext"
10795 if { (eval echo "$as_me:10795: \"$ac_compile\"") >&5
10796   (eval $ac_compile) 2>&5
10797   ac_status=$?
10798   echo "$as_me:10798: \$? = $ac_status" >&5
10799   (exit "$ac_status"); } &&
10800          { ac_try='test -s "conftest.$ac_objext"'
10801   { (eval echo "$as_me:10801: \"$ac_try\"") >&5
10802   (eval $ac_try) 2>&5
10803   ac_status=$?
10804   echo "$as_me:10804: \$? = $ac_status" >&5
10805   (exit "$ac_status"); }; }; then
10806
10807         cf_cv_term_header="$cf_test"
10808 else
10809   echo "$as_me: failed program was:" >&5
10810 cat "conftest.$ac_ext" >&5
10811
10812         cf_cv_term_header=unknown
10813
10814 fi
10815 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10816         test "$cf_cv_term_header" != unknown && break
10817 done
10818
10819 fi
10820 echo "$as_me:10820: result: $cf_cv_term_header" >&5
10821 echo "${ECHO_T}$cf_cv_term_header" >&6
10822
10823 # Set definitions to allow ifdef'ing to accommodate subdirectories
10824
10825 case "$cf_cv_term_header" in
10826 (*term.h)
10827
10828 cat >>confdefs.h <<\EOF
10829 #define HAVE_TERM_H 1
10830 EOF
10831
10832         ;;
10833 esac
10834
10835 case "$cf_cv_term_header" in
10836 (ncurses/term.h)
10837
10838 cat >>confdefs.h <<\EOF
10839 #define HAVE_NCURSES_TERM_H 1
10840 EOF
10841
10842         ;;
10843 (ncursesw/term.h)
10844
10845 cat >>confdefs.h <<\EOF
10846 #define HAVE_NCURSESW_TERM_H 1
10847 EOF
10848
10849         ;;
10850 esac
10851
10852 # some applications need this, but should check for NCURSES_VERSION
10853
10854 cat >>confdefs.h <<\EOF
10855 #define NCURSES 1
10856 EOF
10857
10858 echo "$as_me:10858: checking for ncurses version" >&5
10859 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10860 if test "${cf_cv_ncurses_version+set}" = set; then
10861   echo $ECHO_N "(cached) $ECHO_C" >&6
10862 else
10863
10864         cf_cv_ncurses_version=no
10865         cf_tempfile=out$$
10866         rm -f "$cf_tempfile"
10867         if test "$cross_compiling" = yes; then
10868
10869         # This will not work if the preprocessor splits the line after the
10870         # Autoconf token.  The 'unproto' program does that.
10871         cat > "conftest.$ac_ext" <<EOF
10872 #include <${cf_cv_ncurses_header:-curses.h}>
10873 #undef Autoconf
10874 #ifdef NCURSES_VERSION
10875 Autoconf NCURSES_VERSION
10876 #else
10877 #ifdef __NCURSES_H
10878 Autoconf "old"
10879 #endif
10880 ;
10881 #endif
10882 EOF
10883         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10884         { (eval echo "$as_me:10884: \"$cf_try\"") >&5
10885   (eval $cf_try) 2>&5
10886   ac_status=$?
10887   echo "$as_me:10887: \$? = $ac_status" >&5
10888   (exit "$ac_status"); }
10889         if test -f conftest.out ; then
10890                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10891                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10892                 rm -f conftest.out
10893         fi
10894
10895 else
10896   cat >"conftest.$ac_ext" <<_ACEOF
10897 #line 10897 "configure"
10898 #include "confdefs.h"
10899
10900 $ac_includes_default
10901
10902 #include <${cf_cv_ncurses_header:-curses.h}>
10903
10904 int main(void)
10905 {
10906         FILE *fp = fopen("$cf_tempfile", "w");
10907 #ifdef NCURSES_VERSION
10908 # ifdef NCURSES_VERSION_PATCH
10909         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10910 # else
10911         fprintf(fp, "%s\\n", NCURSES_VERSION);
10912 # endif
10913 #else
10914 # ifdef __NCURSES_H
10915         fprintf(fp, "old\\n");
10916 # else
10917         make an error
10918 # endif
10919 #endif
10920         ${cf_cv_main_return:-return}(0);
10921 }
10922 _ACEOF
10923 rm -f "conftest$ac_exeext"
10924 if { (eval echo "$as_me:10924: \"$ac_link\"") >&5
10925   (eval $ac_link) 2>&5
10926   ac_status=$?
10927   echo "$as_me:10927: \$? = $ac_status" >&5
10928   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10929   { (eval echo "$as_me:10929: \"$ac_try\"") >&5
10930   (eval $ac_try) 2>&5
10931   ac_status=$?
10932   echo "$as_me:10932: \$? = $ac_status" >&5
10933   (exit "$ac_status"); }; }; then
10934
10935         cf_cv_ncurses_version=`cat $cf_tempfile`
10936 else
10937   echo "$as_me: program exited with status $ac_status" >&5
10938 echo "$as_me: failed program was:" >&5
10939 cat "conftest.$ac_ext" >&5
10940 fi
10941 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10942 fi
10943         rm -f "$cf_tempfile"
10944
10945 fi
10946 echo "$as_me:10946: result: $cf_cv_ncurses_version" >&5
10947 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10948 test "$cf_cv_ncurses_version" = no ||
10949 cat >>confdefs.h <<\EOF
10950 #define NCURSES 1
10951 EOF
10952
10953 cf_nculib_root=ncurses
10954         # This works, except for the special case where we find gpm, but
10955         # ncurses is in a nonstandard location via $LIBS, and we really want
10956         # to link gpm.
10957 cf_ncurses_LIBS=""
10958 cf_ncurses_SAVE="$LIBS"
10959 echo "$as_me:10959: checking for Gpm_Open in -lgpm" >&5
10960 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10961 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10962   echo $ECHO_N "(cached) $ECHO_C" >&6
10963 else
10964   ac_check_lib_save_LIBS=$LIBS
10965 LIBS="-lgpm  $LIBS"
10966 cat >"conftest.$ac_ext" <<_ACEOF
10967 #line 10967 "configure"
10968 #include "confdefs.h"
10969
10970 /* Override any gcc2 internal prototype to avoid an error.  */
10971 #ifdef __cplusplus
10972 extern "C"
10973 #endif
10974 /* We use char because int might match the return type of a gcc2
10975    builtin and then its argument prototype would still apply.  */
10976 char Gpm_Open ();
10977 int
10978 main (void)
10979 {
10980 Gpm_Open ();
10981   ;
10982   return 0;
10983 }
10984 _ACEOF
10985 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10986 if { (eval echo "$as_me:10986: \"$ac_link\"") >&5
10987   (eval $ac_link) 2>&5
10988   ac_status=$?
10989   echo "$as_me:10989: \$? = $ac_status" >&5
10990   (exit "$ac_status"); } &&
10991          { ac_try='test -s "conftest$ac_exeext"'
10992   { (eval echo "$as_me:10992: \"$ac_try\"") >&5
10993   (eval $ac_try) 2>&5
10994   ac_status=$?
10995   echo "$as_me:10995: \$? = $ac_status" >&5
10996   (exit "$ac_status"); }; }; then
10997   ac_cv_lib_gpm_Gpm_Open=yes
10998 else
10999   echo "$as_me: failed program was:" >&5
11000 cat "conftest.$ac_ext" >&5
11001 ac_cv_lib_gpm_Gpm_Open=no
11002 fi
11003 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11004 LIBS=$ac_check_lib_save_LIBS
11005 fi
11006 echo "$as_me:11006: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11007 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11008 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11009   echo "$as_me:11009: checking for initscr in -lgpm" >&5
11010 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11011 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11012   echo $ECHO_N "(cached) $ECHO_C" >&6
11013 else
11014   ac_check_lib_save_LIBS=$LIBS
11015 LIBS="-lgpm  $LIBS"
11016 cat >"conftest.$ac_ext" <<_ACEOF
11017 #line 11017 "configure"
11018 #include "confdefs.h"
11019
11020 /* Override any gcc2 internal prototype to avoid an error.  */
11021 #ifdef __cplusplus
11022 extern "C"
11023 #endif
11024 /* We use char because int might match the return type of a gcc2
11025    builtin and then its argument prototype would still apply.  */
11026 char initscr ();
11027 int
11028 main (void)
11029 {
11030 initscr ();
11031   ;
11032   return 0;
11033 }
11034 _ACEOF
11035 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11036 if { (eval echo "$as_me:11036: \"$ac_link\"") >&5
11037   (eval $ac_link) 2>&5
11038   ac_status=$?
11039   echo "$as_me:11039: \$? = $ac_status" >&5
11040   (exit "$ac_status"); } &&
11041          { ac_try='test -s "conftest$ac_exeext"'
11042   { (eval echo "$as_me:11042: \"$ac_try\"") >&5
11043   (eval $ac_try) 2>&5
11044   ac_status=$?
11045   echo "$as_me:11045: \$? = $ac_status" >&5
11046   (exit "$ac_status"); }; }; then
11047   ac_cv_lib_gpm_initscr=yes
11048 else
11049   echo "$as_me: failed program was:" >&5
11050 cat "conftest.$ac_ext" >&5
11051 ac_cv_lib_gpm_initscr=no
11052 fi
11053 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11054 LIBS=$ac_check_lib_save_LIBS
11055 fi
11056 echo "$as_me:11056: result: $ac_cv_lib_gpm_initscr" >&5
11057 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11058 if test "$ac_cv_lib_gpm_initscr" = yes; then
11059   LIBS="$cf_ncurses_SAVE"
11060 else
11061   cf_ncurses_LIBS="-lgpm"
11062 fi
11063
11064 fi
11065
11066 case "$host_os" in
11067 (freebsd*)
11068         # This is only necessary if you are linking against an obsolete
11069         # version of ncurses (but it should do no harm, since it is static).
11070         if test "$cf_nculib_root" = ncurses ; then
11071                 echo "$as_me:11071: checking for tgoto in -lmytinfo" >&5
11072 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11073 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11074   echo $ECHO_N "(cached) $ECHO_C" >&6
11075 else
11076   ac_check_lib_save_LIBS=$LIBS
11077 LIBS="-lmytinfo  $LIBS"
11078 cat >"conftest.$ac_ext" <<_ACEOF
11079 #line 11079 "configure"
11080 #include "confdefs.h"
11081
11082 /* Override any gcc2 internal prototype to avoid an error.  */
11083 #ifdef __cplusplus
11084 extern "C"
11085 #endif
11086 /* We use char because int might match the return type of a gcc2
11087    builtin and then its argument prototype would still apply.  */
11088 char tgoto ();
11089 int
11090 main (void)
11091 {
11092 tgoto ();
11093   ;
11094   return 0;
11095 }
11096 _ACEOF
11097 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11098 if { (eval echo "$as_me:11098: \"$ac_link\"") >&5
11099   (eval $ac_link) 2>&5
11100   ac_status=$?
11101   echo "$as_me:11101: \$? = $ac_status" >&5
11102   (exit "$ac_status"); } &&
11103          { ac_try='test -s "conftest$ac_exeext"'
11104   { (eval echo "$as_me:11104: \"$ac_try\"") >&5
11105   (eval $ac_try) 2>&5
11106   ac_status=$?
11107   echo "$as_me:11107: \$? = $ac_status" >&5
11108   (exit "$ac_status"); }; }; then
11109   ac_cv_lib_mytinfo_tgoto=yes
11110 else
11111   echo "$as_me: failed program was:" >&5
11112 cat "conftest.$ac_ext" >&5
11113 ac_cv_lib_mytinfo_tgoto=no
11114 fi
11115 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11116 LIBS=$ac_check_lib_save_LIBS
11117 fi
11118 echo "$as_me:11118: result: $ac_cv_lib_mytinfo_tgoto" >&5
11119 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11120 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11121   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11122 fi
11123
11124         fi
11125         ;;
11126 esac
11127
11128 cf_add_libs="$LIBS"
11129 # reverse order
11130 cf_add_0lib=
11131 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11132 # filter duplicates
11133 for cf_add_1lib in $cf_add_0lib; do
11134         for cf_add_2lib in $cf_add_libs; do
11135                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11136                         cf_add_1lib=
11137                         break
11138                 fi
11139         done
11140         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11141 done
11142 LIBS="$cf_add_libs"
11143
11144 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11145 then
11146
11147 cf_add_libs="$LIBS"
11148 # reverse order
11149 cf_add_0lib=
11150 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11151 # filter duplicates
11152 for cf_add_1lib in $cf_add_0lib; do
11153         for cf_add_2lib in $cf_add_libs; do
11154                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11155                         cf_add_1lib=
11156                         break
11157                 fi
11158         done
11159         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11160 done
11161 LIBS="$cf_add_libs"
11162
11163 else
11164
11165         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11166         cf_libdir=""
11167         echo "$as_me:11167: checking for initscr" >&5
11168 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11169 if test "${ac_cv_func_initscr+set}" = set; then
11170   echo $ECHO_N "(cached) $ECHO_C" >&6
11171 else
11172   cat >"conftest.$ac_ext" <<_ACEOF
11173 #line 11173 "configure"
11174 #include "confdefs.h"
11175 #define initscr autoconf_temporary
11176 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11177 #undef initscr
11178
11179 #ifdef __cplusplus
11180 extern "C"
11181 #endif
11182
11183 /* We use char because int might match the return type of a gcc2
11184    builtin and then its argument prototype would still apply.  */
11185 char initscr (void);
11186
11187 int
11188 main (void)
11189 {
11190
11191 /* The GNU C library defines stubs for functions which it implements
11192     to always fail with ENOSYS.  Some functions are actually named
11193     something starting with __ and the normal name is an alias.  */
11194 #if defined (__stub_initscr) || defined (__stub___initscr)
11195 #error found stub for initscr
11196 #endif
11197
11198         return initscr ();
11199   ;
11200   return 0;
11201 }
11202 _ACEOF
11203 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11204 if { (eval echo "$as_me:11204: \"$ac_link\"") >&5
11205   (eval $ac_link) 2>&5
11206   ac_status=$?
11207   echo "$as_me:11207: \$? = $ac_status" >&5
11208   (exit "$ac_status"); } &&
11209          { ac_try='test -s "conftest$ac_exeext"'
11210   { (eval echo "$as_me:11210: \"$ac_try\"") >&5
11211   (eval $ac_try) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit "$ac_status"); }; }; then
11215   ac_cv_func_initscr=yes
11216 else
11217   echo "$as_me: failed program was:" >&5
11218 cat "conftest.$ac_ext" >&5
11219 ac_cv_func_initscr=no
11220 fi
11221 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11222 fi
11223 echo "$as_me:11223: result: $ac_cv_func_initscr" >&5
11224 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11225 if test "$ac_cv_func_initscr" = yes; then
11226   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11227 else
11228
11229                 cf_save_LIBS="$LIBS"
11230                 echo "$as_me:11230: checking for initscr in -l$cf_nculib_root" >&5
11231 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11232                 LIBS="-l$cf_nculib_root $LIBS"
11233                 cat >"conftest.$ac_ext" <<_ACEOF
11234 #line 11234 "configure"
11235 #include "confdefs.h"
11236 #include <${cf_cv_ncurses_header:-curses.h}>
11237 int
11238 main (void)
11239 {
11240 initscr()
11241   ;
11242   return 0;
11243 }
11244 _ACEOF
11245 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11246 if { (eval echo "$as_me:11246: \"$ac_link\"") >&5
11247   (eval $ac_link) 2>&5
11248   ac_status=$?
11249   echo "$as_me:11249: \$? = $ac_status" >&5
11250   (exit "$ac_status"); } &&
11251          { ac_try='test -s "conftest$ac_exeext"'
11252   { (eval echo "$as_me:11252: \"$ac_try\"") >&5
11253   (eval $ac_try) 2>&5
11254   ac_status=$?
11255   echo "$as_me:11255: \$? = $ac_status" >&5
11256   (exit "$ac_status"); }; }; then
11257   echo "$as_me:11257: result: yes" >&5
11258 echo "${ECHO_T}yes" >&6
11259                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11260
11261 else
11262   echo "$as_me: failed program was:" >&5
11263 cat "conftest.$ac_ext" >&5
11264 echo "$as_me:11264: result: no" >&5
11265 echo "${ECHO_T}no" >&6
11266
11267 cf_search=
11268 cf_library_path_list=""
11269 if test -n "${LDFLAGS}${LIBS}" ; then
11270         for cf_library_path in $LDFLAGS $LIBS
11271         do
11272                 case "$cf_library_path" in
11273                 (-L*)
11274                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11275
11276 test "x$cf_library_path" != "xNONE" && \
11277 test -d "$cf_library_path" && \
11278  {
11279         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11280         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11281         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11282         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11283         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11284         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"
11285 }
11286
11287                         cf_library_path_list="$cf_library_path_list $cf_search"
11288                         ;;
11289                 esac
11290         done
11291 fi
11292
11293 cf_search=
11294
11295 test "x$prefix" != "xNONE" && \
11296 test -d "$prefix" && \
11297  {
11298         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11299         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11300         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11301         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11302         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11303         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11304 }
11305
11306 for cf_subdir_prefix in \
11307         /usr \
11308         /usr/local \
11309         /usr/pkg \
11310         /opt \
11311         /opt/local \
11312         $HOME
11313 do
11314
11315 test "x$cf_subdir_prefix" != "x$prefix" && \
11316 test -d "$cf_subdir_prefix" && \
11317 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11318         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11319         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11320         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11321         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11322         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11323         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"
11324 }
11325
11326 done
11327
11328 cf_search="$cf_library_path_list $cf_search"
11329
11330                         for cf_libdir in $cf_search
11331                         do
11332                                 echo "$as_me:11332: checking for -l$cf_nculib_root in $cf_libdir" >&5
11333 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11334                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11335                                 cat >"conftest.$ac_ext" <<_ACEOF
11336 #line 11336 "configure"
11337 #include "confdefs.h"
11338 #include <${cf_cv_ncurses_header:-curses.h}>
11339 int
11340 main (void)
11341 {
11342 initscr()
11343   ;
11344   return 0;
11345 }
11346 _ACEOF
11347 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11348 if { (eval echo "$as_me:11348: \"$ac_link\"") >&5
11349   (eval $ac_link) 2>&5
11350   ac_status=$?
11351   echo "$as_me:11351: \$? = $ac_status" >&5
11352   (exit "$ac_status"); } &&
11353          { ac_try='test -s "conftest$ac_exeext"'
11354   { (eval echo "$as_me:11354: \"$ac_try\"") >&5
11355   (eval $ac_try) 2>&5
11356   ac_status=$?
11357   echo "$as_me:11357: \$? = $ac_status" >&5
11358   (exit "$ac_status"); }; }; then
11359   echo "$as_me:11359: result: yes" >&5
11360 echo "${ECHO_T}yes" >&6
11361                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11362                                          break
11363 else
11364   echo "$as_me: failed program was:" >&5
11365 cat "conftest.$ac_ext" >&5
11366 echo "$as_me:11366: result: no" >&5
11367 echo "${ECHO_T}no" >&6
11368                                          LIBS="$cf_save_LIBS"
11369 fi
11370 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11371                         done
11372
11373 fi
11374 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11375
11376 fi
11377
11378 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11379
11380 if test "$cf_found_library" = no ; then
11381         { { echo "$as_me:11381: error: Cannot link $cf_nculib_root library" >&5
11382 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11383    { (exit 1); exit 1; }; }
11384 fi
11385
11386 fi
11387
11388 if test -n "$cf_ncurses_LIBS" ; then
11389         echo "$as_me:11389: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11390 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11391         cf_ncurses_SAVE="$LIBS"
11392         for p in $cf_ncurses_LIBS ; do
11393                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11394                 if test "$q" != "$LIBS" ; then
11395                         LIBS="$q"
11396                 fi
11397         done
11398         cat >"conftest.$ac_ext" <<_ACEOF
11399 #line 11399 "configure"
11400 #include "confdefs.h"
11401 #include <${cf_cv_ncurses_header:-curses.h}>
11402 int
11403 main (void)
11404 {
11405 initscr(); mousemask(0,0); tigetstr((char *)0);
11406   ;
11407   return 0;
11408 }
11409 _ACEOF
11410 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11411 if { (eval echo "$as_me:11411: \"$ac_link\"") >&5
11412   (eval $ac_link) 2>&5
11413   ac_status=$?
11414   echo "$as_me:11414: \$? = $ac_status" >&5
11415   (exit "$ac_status"); } &&
11416          { ac_try='test -s "conftest$ac_exeext"'
11417   { (eval echo "$as_me:11417: \"$ac_try\"") >&5
11418   (eval $ac_try) 2>&5
11419   ac_status=$?
11420   echo "$as_me:11420: \$? = $ac_status" >&5
11421   (exit "$ac_status"); }; }; then
11422   echo "$as_me:11422: result: yes" >&5
11423 echo "${ECHO_T}yes" >&6
11424 else
11425   echo "$as_me: failed program was:" >&5
11426 cat "conftest.$ac_ext" >&5
11427 echo "$as_me:11427: result: no" >&5
11428 echo "${ECHO_T}no" >&6
11429                  LIBS="$cf_ncurses_SAVE"
11430 fi
11431 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11432 fi
11433
11434 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11435
11436 cat >>confdefs.h <<EOF
11437 #define $cf_nculib_ROOT 1
11438 EOF
11439
11440         fi
11441 else
11442         NCURSES_CONFIG=none
11443 fi
11444
11445 fi
11446
11447 if test "$NCURSES_CONFIG_PKG" != none ; then
11448         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11449
11450         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11451         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11452         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11453
11454         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11455         if test -z "$cf_cv_abi_version"
11456         then
11457                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11458         fi
11459
11460 elif test "$NCURSES_CONFIG" != none ; then
11461
11462         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11463
11464         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11465         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11466         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11467
11468         # ABI version is not available from headers
11469         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11470
11471 else
11472
11473         for cf_name in MAJOR MINOR PATCH
11474         do
11475         cat >conftest.$ac_ext <<CF_EOF
11476         #include <${cf_cv_ncurses_header:-curses.h}>
11477         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11478 CF_EOF
11479                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11480                 { (eval echo "$as_me:11480: \"$cf_try\"") >&5
11481   (eval $cf_try) 2>&5
11482   ac_status=$?
11483   echo "$as_me:11483: \$? = $ac_status" >&5
11484   (exit "$ac_status"); }
11485                 if test -f conftest.out ; then
11486                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11487                         eval NCURSES_$cf_name=\"$cf_result\"
11488                         # cat conftest.$ac_ext
11489                         # cat conftest.out
11490                 fi
11491         done
11492
11493         cf_cv_abi_version=${NCURSES_MAJOR}
11494
11495 fi
11496
11497 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11498
11499 cf_cv_timestamp=`date`
11500
11501 echo "$as_me:11501: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11502 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11503
11504 echo "$as_me:11504: checking if you want to have a library-prefix" >&5
11505 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11506
11507 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11508 if test "${with_lib_prefix+set}" = set; then
11509   withval="$with_lib_prefix"
11510   with_lib_prefix=$withval
11511 else
11512   with_lib_prefix=auto
11513 fi;
11514 echo "$as_me:11514: result: $with_lib_prefix" >&5
11515 echo "${ECHO_T}$with_lib_prefix" >&6
11516
11517 if test "$with_lib_prefix" = auto
11518 then
11519
11520         case "$cf_cv_system_name" in
11521         (OS/2*|os2*)
11522                 if test "$DFT_LWR_MODEL" = libtool; then
11523                         LIB_PREFIX='lib'
11524                 else
11525                         LIB_PREFIX=''
11526                 fi
11527                 ;;
11528         (*-msvc*)
11529                 LIB_PREFIX=''
11530                 ;;
11531         (*)     LIB_PREFIX='lib'
11532                 ;;
11533         esac
11534 cf_prefix=$LIB_PREFIX
11535
11536 elif test "$with_lib_prefix" = no
11537 then
11538         LIB_PREFIX=
11539 else
11540         LIB_PREFIX=$with_lib_prefix
11541 fi
11542
11543 LIB_SUFFIX=
11544
11545 ###############################################################################
11546
11547 if test X"$CC_G_OPT" = X"" ; then
11548         CC_G_OPT='-g'
11549         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11550 fi
11551
11552 echo "$as_me:11552: checking for default loader flags" >&5
11553 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11554 case $DFT_LWR_MODEL in
11555 (normal)  LD_MODEL=''   ;;
11556 (debug)   LD_MODEL=$CC_G_OPT ;;
11557 (profile) LD_MODEL='-pg';;
11558 (shared)  LD_MODEL=''   ;;
11559 esac
11560 echo "$as_me:11560: result: $LD_MODEL" >&5
11561 echo "${ECHO_T}$LD_MODEL" >&6
11562
11563 LD_RPATH_OPT=
11564 if test "x$cf_cv_enable_rpath" != xno
11565 then
11566         echo "$as_me:11566: checking for an rpath option" >&5
11567 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11568         case "$cf_cv_system_name" in
11569         (irix*)
11570                 if test "$GCC" = yes; then
11571                         LD_RPATH_OPT="-Wl,-rpath,"
11572                 else
11573                         LD_RPATH_OPT="-rpath "
11574                 fi
11575                 ;;
11576         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11577                 LD_RPATH_OPT="-Wl,-rpath,"
11578                 ;;
11579         (openbsd[2-9].*|mirbsd*)
11580                 LD_RPATH_OPT="-Wl,-rpath,"
11581                 ;;
11582         (dragonfly*)
11583                 LD_RPATH_OPT="-rpath "
11584                 ;;
11585         (netbsd*)
11586                 LD_RPATH_OPT="-Wl,-rpath,"
11587                 ;;
11588         (osf*|mls+*)
11589                 LD_RPATH_OPT="-rpath "
11590                 ;;
11591         (solaris2*)
11592                 LD_RPATH_OPT="-R"
11593                 ;;
11594         (*)
11595                 ;;
11596         esac
11597         echo "$as_me:11597: result: $LD_RPATH_OPT" >&5
11598 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11599
11600         case "x$LD_RPATH_OPT" in
11601         (x-R*)
11602                 echo "$as_me:11602: checking if we need a space after rpath option" >&5
11603 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11604                 cf_save_LIBS="$LIBS"
11605
11606 cf_add_libs="$LIBS"
11607 # reverse order
11608 cf_add_0lib=
11609 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11610 # filter duplicates
11611 for cf_add_1lib in $cf_add_0lib; do
11612         for cf_add_2lib in $cf_add_libs; do
11613                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11614                         cf_add_1lib=
11615                         break
11616                 fi
11617         done
11618         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11619 done
11620 LIBS="$cf_add_libs"
11621
11622                 cat >"conftest.$ac_ext" <<_ACEOF
11623 #line 11623 "configure"
11624 #include "confdefs.h"
11625
11626 int
11627 main (void)
11628 {
11629
11630   ;
11631   return 0;
11632 }
11633 _ACEOF
11634 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11635 if { (eval echo "$as_me:11635: \"$ac_link\"") >&5
11636   (eval $ac_link) 2>&5
11637   ac_status=$?
11638   echo "$as_me:11638: \$? = $ac_status" >&5
11639   (exit "$ac_status"); } &&
11640          { ac_try='test -s "conftest$ac_exeext"'
11641   { (eval echo "$as_me:11641: \"$ac_try\"") >&5
11642   (eval $ac_try) 2>&5
11643   ac_status=$?
11644   echo "$as_me:11644: \$? = $ac_status" >&5
11645   (exit "$ac_status"); }; }; then
11646   cf_rpath_space=no
11647 else
11648   echo "$as_me: failed program was:" >&5
11649 cat "conftest.$ac_ext" >&5
11650 cf_rpath_space=yes
11651 fi
11652 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11653                 LIBS="$cf_save_LIBS"
11654                 echo "$as_me:11654: result: $cf_rpath_space" >&5
11655 echo "${ECHO_T}$cf_rpath_space" >&6
11656                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11657                 ;;
11658         esac
11659 fi
11660
11661         RM_SHARED_OPTS=
11662         LOCAL_LDFLAGS=
11663         LOCAL_LDFLAGS2=
11664         LD_SHARED_OPTS=
11665         INSTALL_LIB="-m 644"
11666         : ${rel_builddir:=.}
11667
11668         shlibdir=$libdir
11669
11670         MAKE_DLLS="#"
11671
11672         cf_cv_do_symlinks=no
11673         cf_ld_rpath_opt=
11674         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11675
11676         echo "$as_me:11676: checking if release/abi version should be used for shared libs" >&5
11677 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11678
11679 # Check whether --with-shlib-version or --without-shlib-version was given.
11680 if test "${with_shlib_version+set}" = set; then
11681   withval="$with_shlib_version"
11682   test -z "$withval" && withval=auto
11683         case "$withval" in
11684         (yes)
11685                 cf_cv_shlib_version=auto
11686                 ;;
11687         (rel|abi|auto)
11688                 cf_cv_shlib_version=$withval
11689                 ;;
11690         (*)
11691                 echo "$as_me:11691: result: $withval" >&5
11692 echo "${ECHO_T}$withval" >&6
11693                 { { echo "$as_me:11693: error: option value must be one of: rel, abi, or auto" >&5
11694 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11695    { (exit 1); exit 1; }; }
11696                 ;;
11697         esac
11698
11699 else
11700   cf_cv_shlib_version=auto
11701 fi;
11702         echo "$as_me:11702: result: $cf_cv_shlib_version" >&5
11703 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11704
11705         cf_cv_rm_so_locs=no
11706         cf_try_cflags=
11707
11708         # Some less-capable ports of gcc support only -fpic
11709         CC_SHARED_OPTS=
11710
11711         cf_try_fPIC=no
11712         if test "$GCC" = yes
11713         then
11714                 cf_try_fPIC=yes
11715         else
11716                 case "$cf_cv_system_name" in
11717                 (*linux*)       # e.g., PGI compiler
11718                         cf_try_fPIC=yes
11719                         ;;
11720                 esac
11721         fi
11722
11723         if test "$cf_try_fPIC" = yes
11724         then
11725                 echo "$as_me:11725: checking which $CC option to use" >&5
11726 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11727                 cf_save_CFLAGS="$CFLAGS"
11728                 for CC_SHARED_OPTS in -fPIC -fpic ''
11729                 do
11730                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11731                         cat >"conftest.$ac_ext" <<_ACEOF
11732 #line 11732 "configure"
11733 #include "confdefs.h"
11734 #include <stdio.h>
11735 int
11736 main (void)
11737 {
11738 int x = 1
11739   ;
11740   return 0;
11741 }
11742 _ACEOF
11743 rm -f "conftest.$ac_objext"
11744 if { (eval echo "$as_me:11744: \"$ac_compile\"") >&5
11745   (eval $ac_compile) 2>&5
11746   ac_status=$?
11747   echo "$as_me:11747: \$? = $ac_status" >&5
11748   (exit "$ac_status"); } &&
11749          { ac_try='test -s "conftest.$ac_objext"'
11750   { (eval echo "$as_me:11750: \"$ac_try\"") >&5
11751   (eval $ac_try) 2>&5
11752   ac_status=$?
11753   echo "$as_me:11753: \$? = $ac_status" >&5
11754   (exit "$ac_status"); }; }; then
11755   break
11756 else
11757   echo "$as_me: failed program was:" >&5
11758 cat "conftest.$ac_ext" >&5
11759 fi
11760 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11761                 done
11762                 echo "$as_me:11762: result: $CC_SHARED_OPTS" >&5
11763 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11764                 CFLAGS="$cf_save_CFLAGS"
11765         fi
11766
11767         cf_cv_shlib_version_infix=no
11768
11769         case "$cf_cv_system_name" in
11770         (aix4.3-9*|aix[5-7]*)
11771                 if test "$GCC" = yes; then
11772                         CC_SHARED_OPTS='-Wl,-brtl'
11773                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11774                 else
11775                         CC_SHARED_OPTS='-brtl'
11776                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11777                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11778                 fi
11779                 ;;
11780         (beos*)
11781                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11782                 ;;
11783         (cygwin*)
11784                 CC_SHARED_OPTS=
11785                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11786                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11787                 cf_cv_shlib_version=cygdll
11788                 cf_cv_shlib_version_infix=cygdll
11789                 shlibdir=$bindir
11790                 MAKE_DLLS=
11791                 cat >mk_shared_lib.sh <<-CF_EOF
11792                 #!$SHELL
11793                 SHARED_LIB=\$1
11794                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11795                 shift
11796                 cat <<-EOF
11797                 Linking shared library
11798                 ** SHARED_LIB \$SHARED_LIB
11799                 ** IMPORT_LIB \$IMPORT_LIB
11800 EOF
11801                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11802 CF_EOF
11803                 chmod +x mk_shared_lib.sh
11804                 ;;
11805         (msys*)
11806                 CC_SHARED_OPTS=
11807                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11808                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11809                 cf_cv_shlib_version=msysdll
11810                 cf_cv_shlib_version_infix=msysdll
11811                 shlibdir=$bindir
11812                 MAKE_DLLS=
11813                 cat >mk_shared_lib.sh <<-CF_EOF
11814                 #!$SHELL
11815                 SHARED_LIB=\$1
11816                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11817                 shift
11818                 cat <<-EOF
11819                 Linking shared library
11820                 ** SHARED_LIB \$SHARED_LIB
11821                 ** IMPORT_LIB \$IMPORT_LIB
11822 EOF
11823                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11824 CF_EOF
11825                 chmod +x mk_shared_lib.sh
11826                 ;;
11827         (darwin*)
11828                 cf_try_cflags="no-cpp-precomp"
11829                 CC_SHARED_OPTS="-dynamic"
11830                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11831                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11832                 cf_cv_shlib_version_infix=yes
11833                 echo "$as_me:11833: checking if ld -search_paths_first works" >&5
11834 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11835 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11836   echo $ECHO_N "(cached) $ECHO_C" >&6
11837 else
11838
11839                         cf_save_LDFLAGS=$LDFLAGS
11840                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11841                         cat >"conftest.$ac_ext" <<_ACEOF
11842 #line 11842 "configure"
11843 #include "confdefs.h"
11844
11845 int
11846 main (void)
11847 {
11848 int i;
11849   ;
11850   return 0;
11851 }
11852 _ACEOF
11853 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11854 if { (eval echo "$as_me:11854: \"$ac_link\"") >&5
11855   (eval $ac_link) 2>&5
11856   ac_status=$?
11857   echo "$as_me:11857: \$? = $ac_status" >&5
11858   (exit "$ac_status"); } &&
11859          { ac_try='test -s "conftest$ac_exeext"'
11860   { (eval echo "$as_me:11860: \"$ac_try\"") >&5
11861   (eval $ac_try) 2>&5
11862   ac_status=$?
11863   echo "$as_me:11863: \$? = $ac_status" >&5
11864   (exit "$ac_status"); }; }; then
11865   cf_cv_ldflags_search_paths_first=yes
11866 else
11867   echo "$as_me: failed program was:" >&5
11868 cat "conftest.$ac_ext" >&5
11869 cf_cv_ldflags_search_paths_first=no
11870 fi
11871 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11872                                 LDFLAGS=$cf_save_LDFLAGS
11873 fi
11874 echo "$as_me:11874: result: $cf_cv_ldflags_search_paths_first" >&5
11875 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11876                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11877                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11878                 fi
11879                 ;;
11880         (haiku*)
11881
11882         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11883         if test "$cf_cv_shlib_version" = rel; then
11884                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11885         else
11886                 cf_cv_shared_soname='`basename $@`'
11887         fi
11888
11889                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11890                 ;;
11891         (hpux[7-8]*)
11892                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11893                 if test "$GCC" != yes; then
11894                         CC_SHARED_OPTS='+Z'
11895                 fi
11896                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11897                 INSTALL_LIB="-m 555"
11898                 ;;
11899         (hpux*)
11900                 # (tested with gcc 2.7.2 -- I don't have c89)
11901                 if test "$GCC" = yes; then
11902                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11903                 else
11904                         CC_SHARED_OPTS='+Z'
11905                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11906                 fi
11907                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11908                 # HP-UX shared libraries must be executable, and should be
11909                 # readonly to exploit a quirk in the memory manager.
11910                 INSTALL_LIB="-m 555"
11911                 ;;
11912         (interix*)
11913                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11914                 if test "$cf_cv_shlib_version" = rel; then
11915                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11916                 else
11917                         cf_shared_soname='`basename $@`'
11918                 fi
11919                 CC_SHARED_OPTS=
11920                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11921                 ;;
11922         (irix*)
11923                 if test "$cf_cv_enable_rpath" = yes ; then
11924                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11925                 fi
11926                 # tested with IRIX 5.2 and 'cc'.
11927                 if test "$GCC" != yes; then
11928                         CC_SHARED_OPTS='-KPIC'
11929                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11930                 else
11931                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11932                 fi
11933                 cf_cv_rm_so_locs=yes
11934                 ;;
11935         (linux*|gnu*|k*bsd*-gnu)
11936                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11937                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11938                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11939                 fi
11940                 if test "$cf_cv_enable_rpath" = yes ; then
11941                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11942                 fi
11943
11944         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11945         if test "$cf_cv_shlib_version" = rel; then
11946                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11947         else
11948                 cf_cv_shared_soname='`basename $@`'
11949         fi
11950
11951                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11952                 ;;
11953         (mingw*msvc*)
11954                 cf_cv_shlib_version=msvcdll
11955                 cf_cv_shlib_version_infix=msvcdll
11956                 shlibdir=$bindir
11957                 MAKE_DLLS=
11958                 if test "$DFT_LWR_MODEL" = "shared" ; then
11959                         LOCAL_LDFLAGS="-link -dll"
11960                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11961                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11962                 fi
11963                 CC_SHARED_OPTS=
11964                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11965                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11966                 cat >mk_shared_lib.sh <<-CF_EOF
11967                 #!$SHELL
11968                 SHARED_LIB=\$1
11969                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11970                 shift
11971                 my_ld=\$1
11972                 shift
11973                 cat <<-EOF
11974                 Linking shared library
11975                 ** SHARED LIB \$SHARED_LIB
11976                 ** IMPORT_LIB \$IMPORT_LIB
11977 EOF
11978                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11979                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11980                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11981 CF_EOF
11982                 chmod +x mk_shared_lib.sh
11983                 cat >mk_prog.sh <<-CF_EOF
11984                 #!$SHELL
11985                 shift
11986                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11987                 LD="$LD"
11988                 clopts=()
11989                 ldopts=("/subsystem:console")
11990                 libs=()
11991                 isdll=0
11992                 while test \$# -gt 0; do
11993                         case "\$1" in
11994                                 -link)
11995                                         # ignore -link argument
11996                                         ;;
11997                                 -M[TD] | -M[TD]d)
11998                                         # ignore runtime-library option
11999                                         ;;
12000                                 -dll)
12001                                         isdll=1
12002                                         ;;
12003                                 -W* | -w*)
12004                                         # ignore warnings
12005                                         ;;
12006                                 -D*)
12007                                         clopts+=("\$1")
12008                                         ;;
12009                                 -I*)
12010                                         clopts+=("\$1")
12011                                         ;;
12012                                 -l*)
12013                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12014                                         ;;
12015                                 -L*)
12016                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12017                                         ;;
12018                                 *.obj | *.o)
12019                                         ldopts+=("\$1")
12020                                         ;;
12021                                 -Wl,*)
12022                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12023                                                 ldopts+=("\${linkarg}")
12024                                         done
12025                                         ;;
12026                                 *.lib)
12027                                         ldopts+=("\$1")
12028                                         ;;
12029                                 -o)
12030                                         shift
12031                                         ldopts+=("-out:\$1")
12032                                         ;;
12033                                 *)
12034                                         clopts+=("\$1")
12035                                         ldopts+=("\$1")
12036                                         ;;
12037                         esac
12038                         shift
12039                 done
12040                 if [ "\$isdll" -ne 0 ]; then
12041                         for lib in \${libs[*]}; do
12042                                 ldopts+=("\$lib.dll.lib")
12043                         done
12044                 else
12045                         for lib in \${libs[*]}; do
12046                                 ldopts+=("\$lib.lib")
12047                         done
12048                 fi
12049                 cat <<-EOF
12050                 Creating program
12051                 ** ld options:   "\${ldopts[@]}"
12052 EOF
12053                 exec \$LD \${ldopts[@]}
12054 CF_EOF
12055                 chmod +x mk_prog.sh
12056                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12057                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12058                 ;;
12059         (mingw*)
12060                 cf_cv_shlib_version=mingw
12061                 cf_cv_shlib_version_infix=mingw
12062                 shlibdir=$bindir
12063                 MAKE_DLLS=
12064                 if test "$DFT_LWR_MODEL" = "shared" ; then
12065                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12066                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12067                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12068                 fi
12069                 CC_SHARED_OPTS=
12070                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12071                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12072                 cat >mk_shared_lib.sh <<-CF_EOF
12073                 #!$SHELL
12074                 SHARED_LIB=\$1
12075                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12076                 shift
12077                 cat <<-EOF
12078                 Linking shared library
12079                 ** SHARED_LIB \$SHARED_LIB
12080                 ** IMPORT_LIB \$IMPORT_LIB
12081 EOF
12082                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12083 CF_EOF
12084                 chmod +x mk_shared_lib.sh
12085                 ;;
12086         (openbsd[2-9].*|mirbsd*)
12087                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12088                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12089                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12090                 fi
12091                 if test "$cf_cv_enable_rpath" = yes ; then
12092                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12093                 fi
12094                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12095
12096         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12097         if test "$cf_cv_shlib_version" = rel; then
12098                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12099         else
12100                 cf_cv_shared_soname='`basename $@`'
12101         fi
12102
12103                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12104                 ;;
12105         (nskJ*)
12106                 CC_SHARED_OPTS=
12107                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12108                 ;;
12109         (nskL*)
12110                 CC_SHARED_OPTS=
12111                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12112                 ;;
12113         (nto-qnx*|openbsd*|freebsd[12].*)
12114                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12115                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12116                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12117                 ;;
12118         (dragonfly*|freebsd*)
12119                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12120                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12121                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12122                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12123                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12124                 fi
12125
12126         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12127         if test "$cf_cv_shlib_version" = rel; then
12128                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12129         else
12130                 cf_cv_shared_soname='`basename $@`'
12131         fi
12132
12133                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12134                 ;;
12135         (netbsd*)
12136                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12137                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12138                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12139                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12140                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12141                         if test "$cf_cv_shlib_version" = auto; then
12142                         if test -f /usr/libexec/ld.elf_so; then
12143                                 cf_cv_shlib_version=abi
12144                         else
12145                                 cf_cv_shlib_version=rel
12146                         fi
12147                         fi
12148
12149         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12150         if test "$cf_cv_shlib_version" = rel; then
12151                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12152         else
12153                 cf_cv_shared_soname='`basename $@`'
12154         fi
12155
12156                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12157                 else
12158                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12159                 fi
12160                 ;;
12161         (osf*|mls+*)
12162                 # tested with OSF/1 V3.2 and 'cc'
12163                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12164                 # link with shared libs).
12165                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12166                 case "$host_os" in
12167                 (osf4*)
12168                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12169                         ;;
12170                 esac
12171                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12172                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12173                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12174                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12175                 fi
12176                 cf_cv_rm_so_locs=yes
12177                 ;;
12178         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12179                 # tested with osr5.0.5
12180                 if test "$GCC" != yes; then
12181                         CC_SHARED_OPTS='-belf -KPIC'
12182                 fi
12183                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12184                 if test "$cf_cv_enable_rpath" = yes ; then
12185                         # only way is to set LD_RUN_PATH but no switch for it
12186                         RUN_PATH=$libdir
12187                 fi
12188                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12189                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12190                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12191                 ;;
12192         (sunos4*)
12193                 # tested with SunOS 4.1.1 and gcc 2.7.0
12194                 if test "$GCC" != yes; then
12195                         CC_SHARED_OPTS='-KPIC'
12196                 fi
12197                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12198                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12199                 ;;
12200         (solaris2*)
12201                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12202                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12203                 if test "$DFT_LWR_MODEL" = "shared" ; then
12204                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12205                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12206                 fi
12207                 if test "$cf_cv_enable_rpath" = yes ; then
12208                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12209                 fi
12210
12211         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12212         if test "$cf_cv_shlib_version" = rel; then
12213                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12214         else
12215                 cf_cv_shared_soname='`basename $@`'
12216         fi
12217
12218                 if test "$GCC" != yes; then
12219                         cf_save_CFLAGS="$CFLAGS"
12220                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12221                         do
12222                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12223                                 cat >"conftest.$ac_ext" <<_ACEOF
12224 #line 12224 "configure"
12225 #include "confdefs.h"
12226 #include <stdio.h>
12227 int
12228 main (void)
12229 {
12230 printf("Hello\\n");
12231   ;
12232   return 0;
12233 }
12234 _ACEOF
12235 rm -f "conftest.$ac_objext"
12236 if { (eval echo "$as_me:12236: \"$ac_compile\"") >&5
12237   (eval $ac_compile) 2>&5
12238   ac_status=$?
12239   echo "$as_me:12239: \$? = $ac_status" >&5
12240   (exit "$ac_status"); } &&
12241          { ac_try='test -s "conftest.$ac_objext"'
12242   { (eval echo "$as_me:12242: \"$ac_try\"") >&5
12243   (eval $ac_try) 2>&5
12244   ac_status=$?
12245   echo "$as_me:12245: \$? = $ac_status" >&5
12246   (exit "$ac_status"); }; }; then
12247   break
12248 else
12249   echo "$as_me: failed program was:" >&5
12250 cat "conftest.$ac_ext" >&5
12251 fi
12252 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12253                         done
12254                         CFLAGS="$cf_save_CFLAGS"
12255                         CC_SHARED_OPTS=$cf_shared_opts
12256                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12257                 else
12258                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12259                 fi
12260                 ;;
12261         (sysv5uw7*|unix_sv*)
12262                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12263                 if test "$GCC" != yes; then
12264                         CC_SHARED_OPTS='-KPIC'
12265                 fi
12266                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12267                 ;;
12268         (*)
12269                 CC_SHARED_OPTS='unknown'
12270                 MK_SHARED_LIB='echo unknown'
12271                 ;;
12272         esac
12273
12274         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12275         case "$cf_cv_shlib_version" in
12276         (rel|abi)
12277                 case "$MK_SHARED_LIB" in
12278                 (*'-o $@')
12279                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12280                         ;;
12281                 (*)
12282                         { echo "$as_me:12282: WARNING: ignored --with-shlib-version" >&5
12283 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12284                         ;;
12285                 esac
12286                 ;;
12287         esac
12288
12289         if test -n "$cf_try_cflags"
12290         then
12291 cat > conftest.$ac_ext <<EOF
12292 #line 12292 "${as_me:-configure}"
12293 #include <stdio.h>
12294 int main(int argc, char *argv[])
12295 {
12296         printf("hello\\n");
12297         return (argv[argc-1] == 0) ;
12298 }
12299 EOF
12300                 cf_save_CFLAGS="$CFLAGS"
12301                 for cf_opt in $cf_try_cflags
12302                 do
12303                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12304                         echo "$as_me:12304: checking if CFLAGS option -$cf_opt works" >&5
12305 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12306                         if { (eval echo "$as_me:12306: \"$ac_compile\"") >&5
12307   (eval $ac_compile) 2>&5
12308   ac_status=$?
12309   echo "$as_me:12309: \$? = $ac_status" >&5
12310   (exit "$ac_status"); }; then
12311                                 echo "$as_me:12311: result: yes" >&5
12312 echo "${ECHO_T}yes" >&6
12313                                 cf_save_CFLAGS="$CFLAGS"
12314                         else
12315                                 echo "$as_me:12315: result: no" >&5
12316 echo "${ECHO_T}no" >&6
12317                         fi
12318                 done
12319                 CFLAGS="$cf_save_CFLAGS"
12320         fi
12321
12322         # RPATH_LIST is a colon-separated list of directories
12323         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12324         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12325
12326         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12327
12328         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12329
12330 echo "${as_me:-configure}:12330: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12331
12332         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12333
12334 echo "${as_me:-configure}:12334: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12335
12336 # The test/sample programs in the original tree link using rpath option.
12337 # Make it optional for packagers.
12338 if test -n "$LOCAL_LDFLAGS"
12339 then
12340         echo "$as_me:12340: checking if you want to link sample programs with rpath option" >&5
12341 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12342
12343 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12344 if test "${enable_rpath_link+set}" = set; then
12345   enableval="$enable_rpath_link"
12346   with_rpath_link=$enableval
12347 else
12348   with_rpath_link=yes
12349 fi;
12350         echo "$as_me:12350: result: $with_rpath_link" >&5
12351 echo "${ECHO_T}$with_rpath_link" >&6
12352         if test "$with_rpath_link" = no
12353         then
12354                 LOCAL_LDFLAGS=
12355                 LOCAL_LDFLAGS2=
12356         fi
12357 fi
12358
12359 ###############################################################################
12360
12361 ###   use option --enable-broken-linker to force on use of broken-linker support
12362
12363 echo "$as_me:12363: checking if you want broken-linker support code" >&5
12364 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12365
12366 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12367 if test "${enable_broken_linker+set}" = set; then
12368   enableval="$enable_broken_linker"
12369   with_broken_linker=$enableval
12370 else
12371   with_broken_linker=no
12372 fi;
12373 echo "$as_me:12373: result: $with_broken_linker" >&5
12374 echo "${ECHO_T}$with_broken_linker" >&6
12375
12376 : "${BROKEN_LINKER:=0}"
12377 if test "x$with_broken_linker" = xyes ; then
12378
12379 cat >>confdefs.h <<\EOF
12380 #define BROKEN_LINKER 1
12381 EOF
12382
12383         BROKEN_LINKER=1
12384 fi
12385
12386 # Check to define _XOPEN_SOURCE "automatically"
12387
12388 echo "$as_me:12388: checking if the POSIX test-macros are already defined" >&5
12389 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12390 if test "${cf_cv_posix_visible+set}" = set; then
12391   echo $ECHO_N "(cached) $ECHO_C" >&6
12392 else
12393
12394 cat >"conftest.$ac_ext" <<_ACEOF
12395 #line 12395 "configure"
12396 #include "confdefs.h"
12397 #include <stdio.h>
12398 int
12399 main (void)
12400 {
12401
12402 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12403         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12404         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12405         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12406 #error conflicting symbols found
12407 #endif
12408
12409   ;
12410   return 0;
12411 }
12412 _ACEOF
12413 rm -f "conftest.$ac_objext"
12414 if { (eval echo "$as_me:12414: \"$ac_compile\"") >&5
12415   (eval $ac_compile) 2>&5
12416   ac_status=$?
12417   echo "$as_me:12417: \$? = $ac_status" >&5
12418   (exit "$ac_status"); } &&
12419          { ac_try='test -s "conftest.$ac_objext"'
12420   { (eval echo "$as_me:12420: \"$ac_try\"") >&5
12421   (eval $ac_try) 2>&5
12422   ac_status=$?
12423   echo "$as_me:12423: \$? = $ac_status" >&5
12424   (exit "$ac_status"); }; }; then
12425   cf_cv_posix_visible=no
12426 else
12427   echo "$as_me: failed program was:" >&5
12428 cat "conftest.$ac_ext" >&5
12429 cf_cv_posix_visible=yes
12430 fi
12431 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12432
12433 fi
12434 echo "$as_me:12434: result: $cf_cv_posix_visible" >&5
12435 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12436
12437 if test "$cf_cv_posix_visible" = no; then
12438
12439 cf_XOPEN_SOURCE=600
12440 cf_POSIX_C_SOURCE=199506L
12441 cf_xopen_source=
12442
12443 case "$host_os" in
12444 (aix[4-7]*)
12445         cf_xopen_source="-D_ALL_SOURCE"
12446         ;;
12447 (msys)
12448         cf_XOPEN_SOURCE=600
12449         ;;
12450 (darwin[0-8].*)
12451         cf_xopen_source="-D_APPLE_C_SOURCE"
12452         ;;
12453 (darwin*)
12454         cf_xopen_source="-D_DARWIN_C_SOURCE"
12455         cf_XOPEN_SOURCE=
12456         ;;
12457 (freebsd*|dragonfly*|midnightbsd*)
12458         # 5.x headers associate
12459         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12460         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12461         cf_POSIX_C_SOURCE=200112L
12462         cf_XOPEN_SOURCE=600
12463         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12464         ;;
12465 (hpux11*)
12466         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12467         ;;
12468 (hpux*)
12469         cf_xopen_source="-D_HPUX_SOURCE"
12470         ;;
12471 (irix[56].*)
12472         cf_xopen_source="-D_SGI_SOURCE"
12473         cf_XOPEN_SOURCE=
12474         ;;
12475 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12476
12477 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12478
12479 echo "$as_me:12479: checking if this is the GNU C library" >&5
12480 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12481 if test "${cf_cv_gnu_library+set}" = set; then
12482   echo $ECHO_N "(cached) $ECHO_C" >&6
12483 else
12484
12485 cat >"conftest.$ac_ext" <<_ACEOF
12486 #line 12486 "configure"
12487 #include "confdefs.h"
12488 #include <sys/types.h>
12489 int
12490 main (void)
12491 {
12492
12493         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12494                 return 0;
12495         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12496                 return 0;
12497         #else
12498         #       error not GNU C library
12499         #endif
12500   ;
12501   return 0;
12502 }
12503 _ACEOF
12504 rm -f "conftest.$ac_objext"
12505 if { (eval echo "$as_me:12505: \"$ac_compile\"") >&5
12506   (eval $ac_compile) 2>&5
12507   ac_status=$?
12508   echo "$as_me:12508: \$? = $ac_status" >&5
12509   (exit "$ac_status"); } &&
12510          { ac_try='test -s "conftest.$ac_objext"'
12511   { (eval echo "$as_me:12511: \"$ac_try\"") >&5
12512   (eval $ac_try) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit "$ac_status"); }; }; then
12516   cf_cv_gnu_library=yes
12517 else
12518   echo "$as_me: failed program was:" >&5
12519 cat "conftest.$ac_ext" >&5
12520 cf_cv_gnu_library=no
12521 fi
12522 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12523
12524 fi
12525 echo "$as_me:12525: result: $cf_cv_gnu_library" >&5
12526 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12527
12528 if test x$cf_cv_gnu_library = xyes; then
12529
12530         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12531         # was changed to help a little.  newlib incorporated the change about 4
12532         # years later.
12533         echo "$as_me:12533: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12534 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12535 if test "${cf_cv_gnu_library_219+set}" = set; then
12536   echo $ECHO_N "(cached) $ECHO_C" >&6
12537 else
12538
12539                 cf_save="$CPPFLAGS"
12540
12541         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12542         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12543
12544                 cat >"conftest.$ac_ext" <<_ACEOF
12545 #line 12545 "configure"
12546 #include "confdefs.h"
12547 #include <sys/types.h>
12548 int
12549 main (void)
12550 {
12551
12552                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12553                                 return 0;
12554                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12555                                 return 0;
12556                         #else
12557                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12558                         #endif
12559   ;
12560   return 0;
12561 }
12562 _ACEOF
12563 rm -f "conftest.$ac_objext"
12564 if { (eval echo "$as_me:12564: \"$ac_compile\"") >&5
12565   (eval $ac_compile) 2>&5
12566   ac_status=$?
12567   echo "$as_me:12567: \$? = $ac_status" >&5
12568   (exit "$ac_status"); } &&
12569          { ac_try='test -s "conftest.$ac_objext"'
12570   { (eval echo "$as_me:12570: \"$ac_try\"") >&5
12571   (eval $ac_try) 2>&5
12572   ac_status=$?
12573   echo "$as_me:12573: \$? = $ac_status" >&5
12574   (exit "$ac_status"); }; }; then
12575   cf_cv_gnu_library_219=yes
12576 else
12577   echo "$as_me: failed program was:" >&5
12578 cat "conftest.$ac_ext" >&5
12579 cf_cv_gnu_library_219=no
12580 fi
12581 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12582                 CPPFLAGS="$cf_save"
12583
12584 fi
12585 echo "$as_me:12585: result: $cf_cv_gnu_library_219" >&5
12586 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12587
12588         if test "x$cf_cv_gnu_library_219" = xyes; then
12589                 cf_save="$CPPFLAGS"
12590                 echo "$as_me:12590: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12591 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12592 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12593   echo $ECHO_N "(cached) $ECHO_C" >&6
12594 else
12595
12596 cf_fix_cppflags=no
12597 cf_new_cflags=
12598 cf_new_cppflags=
12599 cf_new_extra_cppflags=
12600
12601 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12602 do
12603 case "$cf_fix_cppflags" in
12604 (no)
12605         case "$cf_add_cflags" in
12606         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12607                 case "$cf_add_cflags" in
12608                 (-D*)
12609                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12610
12611                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12612                                 && test -z "${cf_tst_cflags}" \
12613                                 && cf_fix_cppflags=yes
12614
12615                         if test "$cf_fix_cppflags" = yes ; then
12616
12617         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12618         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12619
12620                                 continue
12621                         elif test "${cf_tst_cflags}" = "\"'" ; then
12622
12623         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12624         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12625
12626                                 continue
12627                         fi
12628                         ;;
12629                 esac
12630                 case "$CPPFLAGS" in
12631                 (*$cf_add_cflags)
12632                         ;;
12633                 (*)
12634                         case "$cf_add_cflags" in
12635                         (-D*)
12636                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12637
12638 CPPFLAGS=`echo "$CPPFLAGS" | \
12639         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12640                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12641
12642                                 ;;
12643                         esac
12644
12645         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12646         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12647
12648                         ;;
12649                 esac
12650                 ;;
12651         (*)
12652
12653         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12654         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12655
12656                 ;;
12657         esac
12658         ;;
12659 (yes)
12660
12661         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12662         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12663
12664         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12665
12666         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12667                 && test -z "${cf_tst_cflags}" \
12668                 && cf_fix_cppflags=no
12669         ;;
12670 esac
12671 done
12672
12673 if test -n "$cf_new_cflags" ; then
12674
12675         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12676         CFLAGS="${CFLAGS}$cf_new_cflags"
12677
12678 fi
12679
12680 if test -n "$cf_new_cppflags" ; then
12681
12682         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12683         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12684
12685 fi
12686
12687 if test -n "$cf_new_extra_cppflags" ; then
12688
12689         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12690         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12691
12692 fi
12693
12694                         cat >"conftest.$ac_ext" <<_ACEOF
12695 #line 12695 "configure"
12696 #include "confdefs.h"
12697
12698                                 #include <limits.h>
12699                                 #include <sys/types.h>
12700
12701 int
12702 main (void)
12703 {
12704
12705                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12706                                         return 0;
12707                                 #else
12708                                 #       error GNU C library is too old
12709                                 #endif
12710   ;
12711   return 0;
12712 }
12713 _ACEOF
12714 rm -f "conftest.$ac_objext"
12715 if { (eval echo "$as_me:12715: \"$ac_compile\"") >&5
12716   (eval $ac_compile) 2>&5
12717   ac_status=$?
12718   echo "$as_me:12718: \$? = $ac_status" >&5
12719   (exit "$ac_status"); } &&
12720          { ac_try='test -s "conftest.$ac_objext"'
12721   { (eval echo "$as_me:12721: \"$ac_try\"") >&5
12722   (eval $ac_try) 2>&5
12723   ac_status=$?
12724   echo "$as_me:12724: \$? = $ac_status" >&5
12725   (exit "$ac_status"); }; }; then
12726   cf_cv_gnu_dftsrc_219=yes
12727 else
12728   echo "$as_me: failed program was:" >&5
12729 cat "conftest.$ac_ext" >&5
12730 cf_cv_gnu_dftsrc_219=no
12731 fi
12732 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12733
12734 fi
12735 echo "$as_me:12735: result: $cf_cv_gnu_dftsrc_219" >&5
12736 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12737                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12738         else
12739                 cf_cv_gnu_dftsrc_219=maybe
12740         fi
12741
12742         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12743
12744                 echo "$as_me:12744: checking if we must define _GNU_SOURCE" >&5
12745 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12746 if test "${cf_cv_gnu_source+set}" = set; then
12747   echo $ECHO_N "(cached) $ECHO_C" >&6
12748 else
12749
12750                 cat >"conftest.$ac_ext" <<_ACEOF
12751 #line 12751 "configure"
12752 #include "confdefs.h"
12753 #include <sys/types.h>
12754 int
12755 main (void)
12756 {
12757
12758                         #ifndef _XOPEN_SOURCE
12759                         #error  expected _XOPEN_SOURCE to be defined
12760                         #endif
12761   ;
12762   return 0;
12763 }
12764 _ACEOF
12765 rm -f "conftest.$ac_objext"
12766 if { (eval echo "$as_me:12766: \"$ac_compile\"") >&5
12767   (eval $ac_compile) 2>&5
12768   ac_status=$?
12769   echo "$as_me:12769: \$? = $ac_status" >&5
12770   (exit "$ac_status"); } &&
12771          { ac_try='test -s "conftest.$ac_objext"'
12772   { (eval echo "$as_me:12772: \"$ac_try\"") >&5
12773   (eval $ac_try) 2>&5
12774   ac_status=$?
12775   echo "$as_me:12775: \$? = $ac_status" >&5
12776   (exit "$ac_status"); }; }; then
12777   cf_cv_gnu_source=no
12778 else
12779   echo "$as_me: failed program was:" >&5
12780 cat "conftest.$ac_ext" >&5
12781 cf_save="$CPPFLAGS"
12782
12783 cf_fix_cppflags=no
12784 cf_new_cflags=
12785 cf_new_cppflags=
12786 cf_new_extra_cppflags=
12787
12788 for cf_add_cflags in -D_GNU_SOURCE
12789 do
12790 case "$cf_fix_cppflags" in
12791 (no)
12792         case "$cf_add_cflags" in
12793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12794                 case "$cf_add_cflags" in
12795                 (-D*)
12796                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12797
12798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12799                                 && test -z "${cf_tst_cflags}" \
12800                                 && cf_fix_cppflags=yes
12801
12802                         if test "$cf_fix_cppflags" = yes ; then
12803
12804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12806
12807                                 continue
12808                         elif test "${cf_tst_cflags}" = "\"'" ; then
12809
12810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12812
12813                                 continue
12814                         fi
12815                         ;;
12816                 esac
12817                 case "$CPPFLAGS" in
12818                 (*$cf_add_cflags)
12819                         ;;
12820                 (*)
12821                         case "$cf_add_cflags" in
12822                         (-D*)
12823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12824
12825 CPPFLAGS=`echo "$CPPFLAGS" | \
12826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12828
12829                                 ;;
12830                         esac
12831
12832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12834
12835                         ;;
12836                 esac
12837                 ;;
12838         (*)
12839
12840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12842
12843                 ;;
12844         esac
12845         ;;
12846 (yes)
12847
12848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12850
12851         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12852
12853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12854                 && test -z "${cf_tst_cflags}" \
12855                 && cf_fix_cppflags=no
12856         ;;
12857 esac
12858 done
12859
12860 if test -n "$cf_new_cflags" ; then
12861
12862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12863         CFLAGS="${CFLAGS}$cf_new_cflags"
12864
12865 fi
12866
12867 if test -n "$cf_new_cppflags" ; then
12868
12869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12871
12872 fi
12873
12874 if test -n "$cf_new_extra_cppflags" ; then
12875
12876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12878
12879 fi
12880
12881                          cat >"conftest.$ac_ext" <<_ACEOF
12882 #line 12882 "configure"
12883 #include "confdefs.h"
12884 #include <sys/types.h>
12885 int
12886 main (void)
12887 {
12888
12889                                 #ifdef _XOPEN_SOURCE
12890                                 #error  expected _XOPEN_SOURCE to be undefined
12891                                 #endif
12892   ;
12893   return 0;
12894 }
12895 _ACEOF
12896 rm -f "conftest.$ac_objext"
12897 if { (eval echo "$as_me:12897: \"$ac_compile\"") >&5
12898   (eval $ac_compile) 2>&5
12899   ac_status=$?
12900   echo "$as_me:12900: \$? = $ac_status" >&5
12901   (exit "$ac_status"); } &&
12902          { ac_try='test -s "conftest.$ac_objext"'
12903   { (eval echo "$as_me:12903: \"$ac_try\"") >&5
12904   (eval $ac_try) 2>&5
12905   ac_status=$?
12906   echo "$as_me:12906: \$? = $ac_status" >&5
12907   (exit "$ac_status"); }; }; then
12908   cf_cv_gnu_source=no
12909 else
12910   echo "$as_me: failed program was:" >&5
12911 cat "conftest.$ac_ext" >&5
12912 cf_cv_gnu_source=yes
12913 fi
12914 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12915                         CPPFLAGS="$cf_save"
12916
12917 fi
12918 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12919
12920 fi
12921 echo "$as_me:12921: result: $cf_cv_gnu_source" >&5
12922 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12923
12924                 if test "$cf_cv_gnu_source" = yes
12925                 then
12926                 echo "$as_me:12926: checking if we should also define _DEFAULT_SOURCE" >&5
12927 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12928 if test "${cf_cv_default_source+set}" = set; then
12929   echo $ECHO_N "(cached) $ECHO_C" >&6
12930 else
12931
12932         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12933         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12934
12935                         cat >"conftest.$ac_ext" <<_ACEOF
12936 #line 12936 "configure"
12937 #include "confdefs.h"
12938 #include <sys/types.h>
12939 int
12940 main (void)
12941 {
12942
12943                                 #ifdef _DEFAULT_SOURCE
12944                                 #error  expected _DEFAULT_SOURCE to be undefined
12945                                 #endif
12946   ;
12947   return 0;
12948 }
12949 _ACEOF
12950 rm -f "conftest.$ac_objext"
12951 if { (eval echo "$as_me:12951: \"$ac_compile\"") >&5
12952   (eval $ac_compile) 2>&5
12953   ac_status=$?
12954   echo "$as_me:12954: \$? = $ac_status" >&5
12955   (exit "$ac_status"); } &&
12956          { ac_try='test -s "conftest.$ac_objext"'
12957   { (eval echo "$as_me:12957: \"$ac_try\"") >&5
12958   (eval $ac_try) 2>&5
12959   ac_status=$?
12960   echo "$as_me:12960: \$? = $ac_status" >&5
12961   (exit "$ac_status"); }; }; then
12962   cf_cv_default_source=no
12963 else
12964   echo "$as_me: failed program was:" >&5
12965 cat "conftest.$ac_ext" >&5
12966 cf_cv_default_source=yes
12967 fi
12968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12969
12970 fi
12971 echo "$as_me:12971: result: $cf_cv_default_source" >&5
12972 echo "${ECHO_T}$cf_cv_default_source" >&6
12973                         if test "$cf_cv_default_source" = yes
12974                         then
12975
12976         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12977         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12978
12979                         fi
12980                 fi
12981         fi
12982
12983 fi
12984
12985         ;;
12986 (minix*)
12987         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12988         ;;
12989 (mirbsd*)
12990         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12991         cf_XOPEN_SOURCE=
12992
12993 if test "$cf_cv_posix_visible" = no; then
12994
12995 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12996
12997 cf_save_CFLAGS="$CFLAGS"
12998 cf_save_CPPFLAGS="$CPPFLAGS"
12999
13000 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13001         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13002                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13003
13004 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13005         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13006                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13007
13008 echo "$as_me:13008: checking if we should define _POSIX_C_SOURCE" >&5
13009 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13010 if test "${cf_cv_posix_c_source+set}" = set; then
13011   echo $ECHO_N "(cached) $ECHO_C" >&6
13012 else
13013
13014 echo "${as_me:-configure}:13014: testing if the symbol is already defined go no further ..." 1>&5
13015
13016         cat >"conftest.$ac_ext" <<_ACEOF
13017 #line 13017 "configure"
13018 #include "confdefs.h"
13019 #include <sys/types.h>
13020 int
13021 main (void)
13022 {
13023
13024 #ifndef _POSIX_C_SOURCE
13025 make an error
13026 #endif
13027   ;
13028   return 0;
13029 }
13030 _ACEOF
13031 rm -f "conftest.$ac_objext"
13032 if { (eval echo "$as_me:13032: \"$ac_compile\"") >&5
13033   (eval $ac_compile) 2>&5
13034   ac_status=$?
13035   echo "$as_me:13035: \$? = $ac_status" >&5
13036   (exit "$ac_status"); } &&
13037          { ac_try='test -s "conftest.$ac_objext"'
13038   { (eval echo "$as_me:13038: \"$ac_try\"") >&5
13039   (eval $ac_try) 2>&5
13040   ac_status=$?
13041   echo "$as_me:13041: \$? = $ac_status" >&5
13042   (exit "$ac_status"); }; }; then
13043   cf_cv_posix_c_source=no
13044 else
13045   echo "$as_me: failed program was:" >&5
13046 cat "conftest.$ac_ext" >&5
13047 cf_want_posix_source=no
13048          case .$cf_POSIX_C_SOURCE in
13049          (.[12]??*)
13050                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13051                 ;;
13052          (.2)
13053                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13054                 cf_want_posix_source=yes
13055                 ;;
13056          (.*)
13057                 cf_want_posix_source=yes
13058                 ;;
13059          esac
13060          if test "$cf_want_posix_source" = yes ; then
13061                 cat >"conftest.$ac_ext" <<_ACEOF
13062 #line 13062 "configure"
13063 #include "confdefs.h"
13064 #include <sys/types.h>
13065 int
13066 main (void)
13067 {
13068
13069 #ifdef _POSIX_SOURCE
13070 make an error
13071 #endif
13072   ;
13073   return 0;
13074 }
13075 _ACEOF
13076 rm -f "conftest.$ac_objext"
13077 if { (eval echo "$as_me:13077: \"$ac_compile\"") >&5
13078   (eval $ac_compile) 2>&5
13079   ac_status=$?
13080   echo "$as_me:13080: \$? = $ac_status" >&5
13081   (exit "$ac_status"); } &&
13082          { ac_try='test -s "conftest.$ac_objext"'
13083   { (eval echo "$as_me:13083: \"$ac_try\"") >&5
13084   (eval $ac_try) 2>&5
13085   ac_status=$?
13086   echo "$as_me:13086: \$? = $ac_status" >&5
13087   (exit "$ac_status"); }; }; then
13088   :
13089 else
13090   echo "$as_me: failed program was:" >&5
13091 cat "conftest.$ac_ext" >&5
13092 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13093 fi
13094 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13095          fi
13096
13097 echo "${as_me:-configure}:13097: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13098
13099          CFLAGS="$cf_trim_CFLAGS"
13100          CPPFLAGS="$cf_trim_CPPFLAGS"
13101
13102         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13103         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13104
13105 echo "${as_me:-configure}:13105: testing if the second compile does not leave our definition intact error ..." 1>&5
13106
13107          cat >"conftest.$ac_ext" <<_ACEOF
13108 #line 13108 "configure"
13109 #include "confdefs.h"
13110 #include <sys/types.h>
13111 int
13112 main (void)
13113 {
13114
13115 #ifndef _POSIX_C_SOURCE
13116 make an error
13117 #endif
13118   ;
13119   return 0;
13120 }
13121 _ACEOF
13122 rm -f "conftest.$ac_objext"
13123 if { (eval echo "$as_me:13123: \"$ac_compile\"") >&5
13124   (eval $ac_compile) 2>&5
13125   ac_status=$?
13126   echo "$as_me:13126: \$? = $ac_status" >&5
13127   (exit "$ac_status"); } &&
13128          { ac_try='test -s "conftest.$ac_objext"'
13129   { (eval echo "$as_me:13129: \"$ac_try\"") >&5
13130   (eval $ac_try) 2>&5
13131   ac_status=$?
13132   echo "$as_me:13132: \$? = $ac_status" >&5
13133   (exit "$ac_status"); }; }; then
13134   :
13135 else
13136   echo "$as_me: failed program was:" >&5
13137 cat "conftest.$ac_ext" >&5
13138 cf_cv_posix_c_source=no
13139 fi
13140 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13141          CFLAGS="$cf_save_CFLAGS"
13142          CPPFLAGS="$cf_save_CPPFLAGS"
13143
13144 fi
13145 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13146
13147 fi
13148 echo "$as_me:13148: result: $cf_cv_posix_c_source" >&5
13149 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13150
13151 if test "$cf_cv_posix_c_source" != no ; then
13152         CFLAGS="$cf_trim_CFLAGS"
13153         CPPFLAGS="$cf_trim_CPPFLAGS"
13154
13155 cf_fix_cppflags=no
13156 cf_new_cflags=
13157 cf_new_cppflags=
13158 cf_new_extra_cppflags=
13159
13160 for cf_add_cflags in $cf_cv_posix_c_source
13161 do
13162 case "$cf_fix_cppflags" in
13163 (no)
13164         case "$cf_add_cflags" in
13165         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13166                 case "$cf_add_cflags" in
13167                 (-D*)
13168                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13169
13170                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13171                                 && test -z "${cf_tst_cflags}" \
13172                                 && cf_fix_cppflags=yes
13173
13174                         if test "$cf_fix_cppflags" = yes ; then
13175
13176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13178
13179                                 continue
13180                         elif test "${cf_tst_cflags}" = "\"'" ; then
13181
13182         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13183         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13184
13185                                 continue
13186                         fi
13187                         ;;
13188                 esac
13189                 case "$CPPFLAGS" in
13190                 (*$cf_add_cflags)
13191                         ;;
13192                 (*)
13193                         case "$cf_add_cflags" in
13194                         (-D*)
13195                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13196
13197 CPPFLAGS=`echo "$CPPFLAGS" | \
13198         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13199                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13200
13201                                 ;;
13202                         esac
13203
13204         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13205         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13206
13207                         ;;
13208                 esac
13209                 ;;
13210         (*)
13211
13212         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13213         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13214
13215                 ;;
13216         esac
13217         ;;
13218 (yes)
13219
13220         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13221         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13222
13223         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13224
13225         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13226                 && test -z "${cf_tst_cflags}" \
13227                 && cf_fix_cppflags=no
13228         ;;
13229 esac
13230 done
13231
13232 if test -n "$cf_new_cflags" ; then
13233
13234         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13235         CFLAGS="${CFLAGS}$cf_new_cflags"
13236
13237 fi
13238
13239 if test -n "$cf_new_cppflags" ; then
13240
13241         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13242         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13243
13244 fi
13245
13246 if test -n "$cf_new_extra_cppflags" ; then
13247
13248         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13249         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13250
13251 fi
13252
13253 fi
13254
13255 fi # cf_cv_posix_visible
13256
13257         ;;
13258 (netbsd*)
13259         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13260         ;;
13261 (openbsd[6-9]*)
13262         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13263         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13264         # Abusing the conformance level is a workaround.
13265         { echo "$as_me:13265: WARNING: this system does not provide usable locale support" >&5
13266 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13267         cf_xopen_source="-D_BSD_SOURCE"
13268         cf_XOPEN_SOURCE=700
13269         ;;
13270 (openbsd[4-5]*)
13271         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13272         cf_xopen_source="-D_BSD_SOURCE"
13273         cf_XOPEN_SOURCE=600
13274         ;;
13275 (openbsd*)
13276         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13277         ;;
13278 (osf[45]*)
13279         cf_xopen_source="-D_OSF_SOURCE"
13280         ;;
13281 (nto-qnx*)
13282         cf_xopen_source="-D_QNX_SOURCE"
13283         ;;
13284 (sco*)
13285         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13286         ;;
13287 (solaris2.*)
13288         cf_xopen_source="-D__EXTENSIONS__"
13289         cf_cv_xopen_source=broken
13290         ;;
13291 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13292         cf_XOPEN_SOURCE=
13293         cf_POSIX_C_SOURCE=
13294         ;;
13295 (*)
13296
13297 echo "$as_me:13297: checking if we should define _XOPEN_SOURCE" >&5
13298 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13299 if test "${cf_cv_xopen_source+set}" = set; then
13300   echo $ECHO_N "(cached) $ECHO_C" >&6
13301 else
13302
13303         cat >"conftest.$ac_ext" <<_ACEOF
13304 #line 13304 "configure"
13305 #include "confdefs.h"
13306
13307 #include <stdlib.h>
13308 #include <string.h>
13309 #include <sys/types.h>
13310
13311 int
13312 main (void)
13313 {
13314
13315 #ifndef _XOPEN_SOURCE
13316 make an error
13317 #endif
13318
13319   ;
13320   return 0;
13321 }
13322 _ACEOF
13323 rm -f "conftest.$ac_objext"
13324 if { (eval echo "$as_me:13324: \"$ac_compile\"") >&5
13325   (eval $ac_compile) 2>&5
13326   ac_status=$?
13327   echo "$as_me:13327: \$? = $ac_status" >&5
13328   (exit "$ac_status"); } &&
13329          { ac_try='test -s "conftest.$ac_objext"'
13330   { (eval echo "$as_me:13330: \"$ac_try\"") >&5
13331   (eval $ac_try) 2>&5
13332   ac_status=$?
13333   echo "$as_me:13333: \$? = $ac_status" >&5
13334   (exit "$ac_status"); }; }; then
13335   cf_cv_xopen_source=no
13336 else
13337   echo "$as_me: failed program was:" >&5
13338 cat "conftest.$ac_ext" >&5
13339 cf_save="$CPPFLAGS"
13340
13341         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13342         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13343
13344          cat >"conftest.$ac_ext" <<_ACEOF
13345 #line 13345 "configure"
13346 #include "confdefs.h"
13347
13348 #include <stdlib.h>
13349 #include <string.h>
13350 #include <sys/types.h>
13351
13352 int
13353 main (void)
13354 {
13355
13356 #ifndef _XOPEN_SOURCE
13357 make an error
13358 #endif
13359
13360   ;
13361   return 0;
13362 }
13363 _ACEOF
13364 rm -f "conftest.$ac_objext"
13365 if { (eval echo "$as_me:13365: \"$ac_compile\"") >&5
13366   (eval $ac_compile) 2>&5
13367   ac_status=$?
13368   echo "$as_me:13368: \$? = $ac_status" >&5
13369   (exit "$ac_status"); } &&
13370          { ac_try='test -s "conftest.$ac_objext"'
13371   { (eval echo "$as_me:13371: \"$ac_try\"") >&5
13372   (eval $ac_try) 2>&5
13373   ac_status=$?
13374   echo "$as_me:13374: \$? = $ac_status" >&5
13375   (exit "$ac_status"); }; }; then
13376   cf_cv_xopen_source=no
13377 else
13378   echo "$as_me: failed program was:" >&5
13379 cat "conftest.$ac_ext" >&5
13380 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13381 fi
13382 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13383                 CPPFLAGS="$cf_save"
13384
13385 fi
13386 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13387
13388 fi
13389 echo "$as_me:13389: result: $cf_cv_xopen_source" >&5
13390 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13391
13392 if test "$cf_cv_xopen_source" != no ; then
13393
13394 CFLAGS=`echo "$CFLAGS" | \
13395         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13396                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13397
13398 CPPFLAGS=`echo "$CPPFLAGS" | \
13399         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13400                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13401
13402         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13403
13404 for cf_add_cflags in $cf_temp_xopen_source
13405 do
13406         case "x$cf_add_cflags" in
13407         (x-[DU]*)
13408
13409 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13410 while true
13411 do
13412         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13413         test "$CFLAGS" != "$cf_old_cflag" || break
13414
13415         CFLAGS="$cf_old_cflag"
13416 done
13417
13418 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13419 while true
13420 do
13421         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13422         test "$CPPFLAGS" != "$cf_old_cflag" || break
13423
13424         CPPFLAGS="$cf_old_cflag"
13425 done
13426
13427                 ;;
13428         esac
13429
13430 cf_fix_cppflags=no
13431 cf_new_cflags=
13432 cf_new_cppflags=
13433 cf_new_extra_cppflags=
13434
13435 for cf_add_cflags in $cf_add_cflags
13436 do
13437 case "$cf_fix_cppflags" in
13438 (no)
13439         case "$cf_add_cflags" in
13440         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13441                 case "$cf_add_cflags" in
13442                 (-D*)
13443                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13444
13445                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13446                                 && test -z "${cf_tst_cflags}" \
13447                                 && cf_fix_cppflags=yes
13448
13449                         if test "$cf_fix_cppflags" = yes ; then
13450
13451         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13452         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13453
13454                                 continue
13455                         elif test "${cf_tst_cflags}" = "\"'" ; then
13456
13457         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13458         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13459
13460                                 continue
13461                         fi
13462                         ;;
13463                 esac
13464                 case "$CPPFLAGS" in
13465                 (*$cf_add_cflags)
13466                         ;;
13467                 (*)
13468                         case "$cf_add_cflags" in
13469                         (-D*)
13470                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13471
13472 CPPFLAGS=`echo "$CPPFLAGS" | \
13473         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13474                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13475
13476                                 ;;
13477                         esac
13478
13479         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13480         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13481
13482                         ;;
13483                 esac
13484                 ;;
13485         (*)
13486
13487         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13488         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13489
13490                 ;;
13491         esac
13492         ;;
13493 (yes)
13494
13495         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13496         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13497
13498         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13499
13500         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13501                 && test -z "${cf_tst_cflags}" \
13502                 && cf_fix_cppflags=no
13503         ;;
13504 esac
13505 done
13506
13507 if test -n "$cf_new_cflags" ; then
13508
13509         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13510         CFLAGS="${CFLAGS}$cf_new_cflags"
13511
13512 fi
13513
13514 if test -n "$cf_new_cppflags" ; then
13515
13516         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13517         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13518
13519 fi
13520
13521 if test -n "$cf_new_extra_cppflags" ; then
13522
13523         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13524         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13525
13526 fi
13527
13528 done
13529
13530 fi
13531
13532         cf_save_xopen_cppflags="$CPPFLAGS"
13533
13534 if test "$cf_cv_posix_visible" = no; then
13535
13536 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13537
13538 cf_save_CFLAGS="$CFLAGS"
13539 cf_save_CPPFLAGS="$CPPFLAGS"
13540
13541 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13542         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13543                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13544
13545 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13546         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13547                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13548
13549 echo "$as_me:13549: checking if we should define _POSIX_C_SOURCE" >&5
13550 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13551 if test "${cf_cv_posix_c_source+set}" = set; then
13552   echo $ECHO_N "(cached) $ECHO_C" >&6
13553 else
13554
13555 echo "${as_me:-configure}:13555: testing if the symbol is already defined go no further ..." 1>&5
13556
13557         cat >"conftest.$ac_ext" <<_ACEOF
13558 #line 13558 "configure"
13559 #include "confdefs.h"
13560 #include <sys/types.h>
13561 int
13562 main (void)
13563 {
13564
13565 #ifndef _POSIX_C_SOURCE
13566 make an error
13567 #endif
13568   ;
13569   return 0;
13570 }
13571 _ACEOF
13572 rm -f "conftest.$ac_objext"
13573 if { (eval echo "$as_me:13573: \"$ac_compile\"") >&5
13574   (eval $ac_compile) 2>&5
13575   ac_status=$?
13576   echo "$as_me:13576: \$? = $ac_status" >&5
13577   (exit "$ac_status"); } &&
13578          { ac_try='test -s "conftest.$ac_objext"'
13579   { (eval echo "$as_me:13579: \"$ac_try\"") >&5
13580   (eval $ac_try) 2>&5
13581   ac_status=$?
13582   echo "$as_me:13582: \$? = $ac_status" >&5
13583   (exit "$ac_status"); }; }; then
13584   cf_cv_posix_c_source=no
13585 else
13586   echo "$as_me: failed program was:" >&5
13587 cat "conftest.$ac_ext" >&5
13588 cf_want_posix_source=no
13589          case .$cf_POSIX_C_SOURCE in
13590          (.[12]??*)
13591                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13592                 ;;
13593          (.2)
13594                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13595                 cf_want_posix_source=yes
13596                 ;;
13597          (.*)
13598                 cf_want_posix_source=yes
13599                 ;;
13600          esac
13601          if test "$cf_want_posix_source" = yes ; then
13602                 cat >"conftest.$ac_ext" <<_ACEOF
13603 #line 13603 "configure"
13604 #include "confdefs.h"
13605 #include <sys/types.h>
13606 int
13607 main (void)
13608 {
13609
13610 #ifdef _POSIX_SOURCE
13611 make an error
13612 #endif
13613   ;
13614   return 0;
13615 }
13616 _ACEOF
13617 rm -f "conftest.$ac_objext"
13618 if { (eval echo "$as_me:13618: \"$ac_compile\"") >&5
13619   (eval $ac_compile) 2>&5
13620   ac_status=$?
13621   echo "$as_me:13621: \$? = $ac_status" >&5
13622   (exit "$ac_status"); } &&
13623          { ac_try='test -s "conftest.$ac_objext"'
13624   { (eval echo "$as_me:13624: \"$ac_try\"") >&5
13625   (eval $ac_try) 2>&5
13626   ac_status=$?
13627   echo "$as_me:13627: \$? = $ac_status" >&5
13628   (exit "$ac_status"); }; }; then
13629   :
13630 else
13631   echo "$as_me: failed program was:" >&5
13632 cat "conftest.$ac_ext" >&5
13633 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13634 fi
13635 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13636          fi
13637
13638 echo "${as_me:-configure}:13638: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13639
13640          CFLAGS="$cf_trim_CFLAGS"
13641          CPPFLAGS="$cf_trim_CPPFLAGS"
13642
13643         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13644         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13645
13646 echo "${as_me:-configure}:13646: testing if the second compile does not leave our definition intact error ..." 1>&5
13647
13648          cat >"conftest.$ac_ext" <<_ACEOF
13649 #line 13649 "configure"
13650 #include "confdefs.h"
13651 #include <sys/types.h>
13652 int
13653 main (void)
13654 {
13655
13656 #ifndef _POSIX_C_SOURCE
13657 make an error
13658 #endif
13659   ;
13660   return 0;
13661 }
13662 _ACEOF
13663 rm -f "conftest.$ac_objext"
13664 if { (eval echo "$as_me:13664: \"$ac_compile\"") >&5
13665   (eval $ac_compile) 2>&5
13666   ac_status=$?
13667   echo "$as_me:13667: \$? = $ac_status" >&5
13668   (exit "$ac_status"); } &&
13669          { ac_try='test -s "conftest.$ac_objext"'
13670   { (eval echo "$as_me:13670: \"$ac_try\"") >&5
13671   (eval $ac_try) 2>&5
13672   ac_status=$?
13673   echo "$as_me:13673: \$? = $ac_status" >&5
13674   (exit "$ac_status"); }; }; then
13675   :
13676 else
13677   echo "$as_me: failed program was:" >&5
13678 cat "conftest.$ac_ext" >&5
13679 cf_cv_posix_c_source=no
13680 fi
13681 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13682          CFLAGS="$cf_save_CFLAGS"
13683          CPPFLAGS="$cf_save_CPPFLAGS"
13684
13685 fi
13686 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13687
13688 fi
13689 echo "$as_me:13689: result: $cf_cv_posix_c_source" >&5
13690 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13691
13692 if test "$cf_cv_posix_c_source" != no ; then
13693         CFLAGS="$cf_trim_CFLAGS"
13694         CPPFLAGS="$cf_trim_CPPFLAGS"
13695
13696 cf_fix_cppflags=no
13697 cf_new_cflags=
13698 cf_new_cppflags=
13699 cf_new_extra_cppflags=
13700
13701 for cf_add_cflags in $cf_cv_posix_c_source
13702 do
13703 case "$cf_fix_cppflags" in
13704 (no)
13705         case "$cf_add_cflags" in
13706         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13707                 case "$cf_add_cflags" in
13708                 (-D*)
13709                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13710
13711                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13712                                 && test -z "${cf_tst_cflags}" \
13713                                 && cf_fix_cppflags=yes
13714
13715                         if test "$cf_fix_cppflags" = yes ; then
13716
13717         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13718         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13719
13720                                 continue
13721                         elif test "${cf_tst_cflags}" = "\"'" ; then
13722
13723         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13724         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13725
13726                                 continue
13727                         fi
13728                         ;;
13729                 esac
13730                 case "$CPPFLAGS" in
13731                 (*$cf_add_cflags)
13732                         ;;
13733                 (*)
13734                         case "$cf_add_cflags" in
13735                         (-D*)
13736                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13737
13738 CPPFLAGS=`echo "$CPPFLAGS" | \
13739         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13740                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13741
13742                                 ;;
13743                         esac
13744
13745         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13746         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13747
13748                         ;;
13749                 esac
13750                 ;;
13751         (*)
13752
13753         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13754         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13755
13756                 ;;
13757         esac
13758         ;;
13759 (yes)
13760
13761         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13762         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13763
13764         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13765
13766         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13767                 && test -z "${cf_tst_cflags}" \
13768                 && cf_fix_cppflags=no
13769         ;;
13770 esac
13771 done
13772
13773 if test -n "$cf_new_cflags" ; then
13774
13775         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13776         CFLAGS="${CFLAGS}$cf_new_cflags"
13777
13778 fi
13779
13780 if test -n "$cf_new_cppflags" ; then
13781
13782         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13783         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13784
13785 fi
13786
13787 if test -n "$cf_new_extra_cppflags" ; then
13788
13789         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13790         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13791
13792 fi
13793
13794 fi
13795
13796 fi # cf_cv_posix_visible
13797
13798         # Some of these niche implementations use copy/paste, double-check...
13799         if test "$cf_cv_xopen_source" != no ; then
13800                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
13801
13802 echo "${as_me:-configure}:13802: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
13803
13804                 cat >"conftest.$ac_ext" <<_ACEOF
13805 #line 13805 "configure"
13806 #include "confdefs.h"
13807
13808 #include <stdlib.h>
13809 #include <string.h>
13810 #include <sys/types.h>
13811
13812 int
13813 main (void)
13814 {
13815
13816 #ifndef _XOPEN_SOURCE
13817 make an error
13818 #endif
13819
13820   ;
13821   return 0;
13822 }
13823 _ACEOF
13824 rm -f "conftest.$ac_objext"
13825 if { (eval echo "$as_me:13825: \"$ac_compile\"") >&5
13826   (eval $ac_compile) 2>&5
13827   ac_status=$?
13828   echo "$as_me:13828: \$? = $ac_status" >&5
13829   (exit "$ac_status"); } &&
13830          { ac_try='test -s "conftest.$ac_objext"'
13831   { (eval echo "$as_me:13831: \"$ac_try\"") >&5
13832   (eval $ac_try) 2>&5
13833   ac_status=$?
13834   echo "$as_me:13834: \$? = $ac_status" >&5
13835   (exit "$ac_status"); }; }; then
13836   :
13837 else
13838   echo "$as_me: failed program was:" >&5
13839 cat "conftest.$ac_ext" >&5
13840
13841                         { echo "$as_me:13841: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
13842 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
13843                         CPPFLAGS="$cf_save_xopen_cppflags"
13844 fi
13845 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13846         fi
13847         ;;
13848 esac
13849
13850 if test -n "$cf_xopen_source" ; then
13851
13852 for cf_add_cflags in $cf_xopen_source
13853 do
13854         case "x$cf_add_cflags" in
13855         (x-[DU]*)
13856
13857 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13858 while true
13859 do
13860         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13861         test "$CFLAGS" != "$cf_old_cflag" || break
13862         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13863
13864 echo "${as_me:-configure}:13864: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13865
13866         CFLAGS="$cf_old_cflag"
13867 done
13868
13869 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13870 while true
13871 do
13872         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13873         test "$CPPFLAGS" != "$cf_old_cflag" || break
13874         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13875
13876 echo "${as_me:-configure}:13876: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13877
13878         CPPFLAGS="$cf_old_cflag"
13879 done
13880
13881                 ;;
13882         esac
13883
13884 cf_fix_cppflags=no
13885 cf_new_cflags=
13886 cf_new_cppflags=
13887 cf_new_extra_cppflags=
13888
13889 for cf_add_cflags in $cf_add_cflags
13890 do
13891 case "$cf_fix_cppflags" in
13892 (no)
13893         case "$cf_add_cflags" in
13894         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13895                 case "$cf_add_cflags" in
13896                 (-D*)
13897                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13898
13899                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13900                                 && test -z "${cf_tst_cflags}" \
13901                                 && cf_fix_cppflags=yes
13902
13903                         if test "$cf_fix_cppflags" = yes ; then
13904
13905         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13906         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13907
13908                                 continue
13909                         elif test "${cf_tst_cflags}" = "\"'" ; then
13910
13911         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13912         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13913
13914                                 continue
13915                         fi
13916                         ;;
13917                 esac
13918                 case "$CPPFLAGS" in
13919                 (*$cf_add_cflags)
13920                         ;;
13921                 (*)
13922                         case "$cf_add_cflags" in
13923                         (-D*)
13924                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13925
13926 CPPFLAGS=`echo "$CPPFLAGS" | \
13927         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13928                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13929
13930                                 ;;
13931                         esac
13932
13933         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13934         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13935
13936                         ;;
13937                 esac
13938                 ;;
13939         (*)
13940
13941         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13942         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13943
13944                 ;;
13945         esac
13946         ;;
13947 (yes)
13948
13949         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13950         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13951
13952         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13953
13954         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13955                 && test -z "${cf_tst_cflags}" \
13956                 && cf_fix_cppflags=no
13957         ;;
13958 esac
13959 done
13960
13961 if test -n "$cf_new_cflags" ; then
13962         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13963
13964 echo "${as_me:-configure}:13964: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13965
13966         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13967         CFLAGS="${CFLAGS}$cf_new_cflags"
13968
13969 fi
13970
13971 if test -n "$cf_new_cppflags" ; then
13972         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13973
13974 echo "${as_me:-configure}:13974: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13975
13976         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13977         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13978
13979 fi
13980
13981 if test -n "$cf_new_extra_cppflags" ; then
13982         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13983
13984 echo "${as_me:-configure}:13984: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13985
13986         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13987         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13988
13989 fi
13990
13991 done
13992
13993 fi
13994
13995 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13996         echo "$as_me:13996: checking if _XOPEN_SOURCE really is set" >&5
13997 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13998         cat >"conftest.$ac_ext" <<_ACEOF
13999 #line 13999 "configure"
14000 #include "confdefs.h"
14001 #include <stdlib.h>
14002 int
14003 main (void)
14004 {
14005
14006 #ifndef _XOPEN_SOURCE
14007 make an error
14008 #endif
14009   ;
14010   return 0;
14011 }
14012 _ACEOF
14013 rm -f "conftest.$ac_objext"
14014 if { (eval echo "$as_me:14014: \"$ac_compile\"") >&5
14015   (eval $ac_compile) 2>&5
14016   ac_status=$?
14017   echo "$as_me:14017: \$? = $ac_status" >&5
14018   (exit "$ac_status"); } &&
14019          { ac_try='test -s "conftest.$ac_objext"'
14020   { (eval echo "$as_me:14020: \"$ac_try\"") >&5
14021   (eval $ac_try) 2>&5
14022   ac_status=$?
14023   echo "$as_me:14023: \$? = $ac_status" >&5
14024   (exit "$ac_status"); }; }; then
14025   cf_XOPEN_SOURCE_set=yes
14026 else
14027   echo "$as_me: failed program was:" >&5
14028 cat "conftest.$ac_ext" >&5
14029 cf_XOPEN_SOURCE_set=no
14030 fi
14031 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14032         echo "$as_me:14032: result: $cf_XOPEN_SOURCE_set" >&5
14033 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14034         if test "$cf_XOPEN_SOURCE_set" = yes
14035         then
14036                 cat >"conftest.$ac_ext" <<_ACEOF
14037 #line 14037 "configure"
14038 #include "confdefs.h"
14039 #include <stdlib.h>
14040 int
14041 main (void)
14042 {
14043
14044 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14045 make an error
14046 #endif
14047   ;
14048   return 0;
14049 }
14050 _ACEOF
14051 rm -f "conftest.$ac_objext"
14052 if { (eval echo "$as_me:14052: \"$ac_compile\"") >&5
14053   (eval $ac_compile) 2>&5
14054   ac_status=$?
14055   echo "$as_me:14055: \$? = $ac_status" >&5
14056   (exit "$ac_status"); } &&
14057          { ac_try='test -s "conftest.$ac_objext"'
14058   { (eval echo "$as_me:14058: \"$ac_try\"") >&5
14059   (eval $ac_try) 2>&5
14060   ac_status=$?
14061   echo "$as_me:14061: \$? = $ac_status" >&5
14062   (exit "$ac_status"); }; }; then
14063   cf_XOPEN_SOURCE_set_ok=yes
14064 else
14065   echo "$as_me: failed program was:" >&5
14066 cat "conftest.$ac_ext" >&5
14067 cf_XOPEN_SOURCE_set_ok=no
14068 fi
14069 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14070                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14071                 then
14072                         { echo "$as_me:14072: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14073 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14074                 fi
14075         else
14076
14077 echo "$as_me:14077: checking if we should define _XOPEN_SOURCE" >&5
14078 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14079 if test "${cf_cv_xopen_source+set}" = set; then
14080   echo $ECHO_N "(cached) $ECHO_C" >&6
14081 else
14082
14083         cat >"conftest.$ac_ext" <<_ACEOF
14084 #line 14084 "configure"
14085 #include "confdefs.h"
14086
14087 #include <stdlib.h>
14088 #include <string.h>
14089 #include <sys/types.h>
14090
14091 int
14092 main (void)
14093 {
14094
14095 #ifndef _XOPEN_SOURCE
14096 make an error
14097 #endif
14098
14099   ;
14100   return 0;
14101 }
14102 _ACEOF
14103 rm -f "conftest.$ac_objext"
14104 if { (eval echo "$as_me:14104: \"$ac_compile\"") >&5
14105   (eval $ac_compile) 2>&5
14106   ac_status=$?
14107   echo "$as_me:14107: \$? = $ac_status" >&5
14108   (exit "$ac_status"); } &&
14109          { ac_try='test -s "conftest.$ac_objext"'
14110   { (eval echo "$as_me:14110: \"$ac_try\"") >&5
14111   (eval $ac_try) 2>&5
14112   ac_status=$?
14113   echo "$as_me:14113: \$? = $ac_status" >&5
14114   (exit "$ac_status"); }; }; then
14115   cf_cv_xopen_source=no
14116 else
14117   echo "$as_me: failed program was:" >&5
14118 cat "conftest.$ac_ext" >&5
14119 cf_save="$CPPFLAGS"
14120
14121         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14122         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14123
14124          cat >"conftest.$ac_ext" <<_ACEOF
14125 #line 14125 "configure"
14126 #include "confdefs.h"
14127
14128 #include <stdlib.h>
14129 #include <string.h>
14130 #include <sys/types.h>
14131
14132 int
14133 main (void)
14134 {
14135
14136 #ifndef _XOPEN_SOURCE
14137 make an error
14138 #endif
14139
14140   ;
14141   return 0;
14142 }
14143 _ACEOF
14144 rm -f "conftest.$ac_objext"
14145 if { (eval echo "$as_me:14145: \"$ac_compile\"") >&5
14146   (eval $ac_compile) 2>&5
14147   ac_status=$?
14148   echo "$as_me:14148: \$? = $ac_status" >&5
14149   (exit "$ac_status"); } &&
14150          { ac_try='test -s "conftest.$ac_objext"'
14151   { (eval echo "$as_me:14151: \"$ac_try\"") >&5
14152   (eval $ac_try) 2>&5
14153   ac_status=$?
14154   echo "$as_me:14154: \$? = $ac_status" >&5
14155   (exit "$ac_status"); }; }; then
14156   cf_cv_xopen_source=no
14157 else
14158   echo "$as_me: failed program was:" >&5
14159 cat "conftest.$ac_ext" >&5
14160 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14161 fi
14162 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14163                 CPPFLAGS="$cf_save"
14164
14165 fi
14166 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14167
14168 fi
14169 echo "$as_me:14169: result: $cf_cv_xopen_source" >&5
14170 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14171
14172 if test "$cf_cv_xopen_source" != no ; then
14173
14174 CFLAGS=`echo "$CFLAGS" | \
14175         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14176                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14177
14178 CPPFLAGS=`echo "$CPPFLAGS" | \
14179         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14180                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14181
14182         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14183
14184 for cf_add_cflags in $cf_temp_xopen_source
14185 do
14186         case "x$cf_add_cflags" in
14187         (x-[DU]*)
14188
14189 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14190 while true
14191 do
14192         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14193         test "$CFLAGS" != "$cf_old_cflag" || break
14194
14195         CFLAGS="$cf_old_cflag"
14196 done
14197
14198 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14199 while true
14200 do
14201         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14202         test "$CPPFLAGS" != "$cf_old_cflag" || break
14203
14204         CPPFLAGS="$cf_old_cflag"
14205 done
14206
14207                 ;;
14208         esac
14209
14210 cf_fix_cppflags=no
14211 cf_new_cflags=
14212 cf_new_cppflags=
14213 cf_new_extra_cppflags=
14214
14215 for cf_add_cflags in $cf_add_cflags
14216 do
14217 case "$cf_fix_cppflags" in
14218 (no)
14219         case "$cf_add_cflags" in
14220         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14221                 case "$cf_add_cflags" in
14222                 (-D*)
14223                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14224
14225                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14226                                 && test -z "${cf_tst_cflags}" \
14227                                 && cf_fix_cppflags=yes
14228
14229                         if test "$cf_fix_cppflags" = yes ; then
14230
14231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14233
14234                                 continue
14235                         elif test "${cf_tst_cflags}" = "\"'" ; then
14236
14237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14239
14240                                 continue
14241                         fi
14242                         ;;
14243                 esac
14244                 case "$CPPFLAGS" in
14245                 (*$cf_add_cflags)
14246                         ;;
14247                 (*)
14248                         case "$cf_add_cflags" in
14249                         (-D*)
14250                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14251
14252 CPPFLAGS=`echo "$CPPFLAGS" | \
14253         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14254                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14255
14256                                 ;;
14257                         esac
14258
14259         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14260         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14261
14262                         ;;
14263                 esac
14264                 ;;
14265         (*)
14266
14267         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14268         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14269
14270                 ;;
14271         esac
14272         ;;
14273 (yes)
14274
14275         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14276         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14277
14278         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14279
14280         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14281                 && test -z "${cf_tst_cflags}" \
14282                 && cf_fix_cppflags=no
14283         ;;
14284 esac
14285 done
14286
14287 if test -n "$cf_new_cflags" ; then
14288
14289         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14290         CFLAGS="${CFLAGS}$cf_new_cflags"
14291
14292 fi
14293
14294 if test -n "$cf_new_cppflags" ; then
14295
14296         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14297         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14298
14299 fi
14300
14301 if test -n "$cf_new_extra_cppflags" ; then
14302
14303         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14304         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14305
14306 fi
14307
14308 done
14309
14310 fi
14311
14312         fi
14313 fi
14314 fi # cf_cv_posix_visible
14315
14316 # Check whether --enable-largefile or --disable-largefile was given.
14317 if test "${enable_largefile+set}" = set; then
14318   enableval="$enable_largefile"
14319
14320 fi;
14321 if test "$enable_largefile" != no; then
14322
14323   echo "$as_me:14323: checking for special C compiler options needed for large files" >&5
14324 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14325 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14326   echo $ECHO_N "(cached) $ECHO_C" >&6
14327 else
14328   ac_cv_sys_largefile_CC=no
14329      if test "$GCC" != yes; then
14330        ac_save_CC=$CC
14331        while :; do
14332          # IRIX 6.2 and later do not support large files by default,
14333          # so use the C compiler's -n32 option if that helps.
14334          cat >"conftest.$ac_ext" <<_ACEOF
14335 #line 14335 "configure"
14336 #include "confdefs.h"
14337 #include <sys/types.h>
14338  /* Check that off_t can represent 2**63 - 1 correctly.
14339     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14340     since some C++ compilers masquerading as C compilers
14341     incorrectly reject 9223372036854775807.  */
14342 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14343   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14344                        && LARGE_OFF_T % 2147483647 == 1)
14345                       ? 1 : -1];
14346 int
14347 main (void)
14348 {
14349
14350   ;
14351   return 0;
14352 }
14353 _ACEOF
14354          rm -f "conftest.$ac_objext"
14355 if { (eval echo "$as_me:14355: \"$ac_compile\"") >&5
14356   (eval $ac_compile) 2>&5
14357   ac_status=$?
14358   echo "$as_me:14358: \$? = $ac_status" >&5
14359   (exit "$ac_status"); } &&
14360          { ac_try='test -s "conftest.$ac_objext"'
14361   { (eval echo "$as_me:14361: \"$ac_try\"") >&5
14362   (eval $ac_try) 2>&5
14363   ac_status=$?
14364   echo "$as_me:14364: \$? = $ac_status" >&5
14365   (exit "$ac_status"); }; }; then
14366   break
14367 else
14368   echo "$as_me: failed program was:" >&5
14369 cat "conftest.$ac_ext" >&5
14370 fi
14371 rm -f "conftest.$ac_objext"
14372          CC="$CC -n32"
14373          rm -f "conftest.$ac_objext"
14374 if { (eval echo "$as_me:14374: \"$ac_compile\"") >&5
14375   (eval $ac_compile) 2>&5
14376   ac_status=$?
14377   echo "$as_me:14377: \$? = $ac_status" >&5
14378   (exit "$ac_status"); } &&
14379          { ac_try='test -s "conftest.$ac_objext"'
14380   { (eval echo "$as_me:14380: \"$ac_try\"") >&5
14381   (eval $ac_try) 2>&5
14382   ac_status=$?
14383   echo "$as_me:14383: \$? = $ac_status" >&5
14384   (exit "$ac_status"); }; }; then
14385   ac_cv_sys_largefile_CC=' -n32'; break
14386 else
14387   echo "$as_me: failed program was:" >&5
14388 cat "conftest.$ac_ext" >&5
14389 fi
14390 rm -f "conftest.$ac_objext"
14391          break
14392        done
14393        CC=$ac_save_CC
14394        rm -f "conftest.$ac_ext"
14395     fi
14396 fi
14397 echo "$as_me:14397: result: $ac_cv_sys_largefile_CC" >&5
14398 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14399   if test "$ac_cv_sys_largefile_CC" != no; then
14400     CC=$CC$ac_cv_sys_largefile_CC
14401   fi
14402
14403   echo "$as_me:14403: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14404 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14405 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14406   echo $ECHO_N "(cached) $ECHO_C" >&6
14407 else
14408   while :; do
14409   ac_cv_sys_file_offset_bits=no
14410   cat >"conftest.$ac_ext" <<_ACEOF
14411 #line 14411 "configure"
14412 #include "confdefs.h"
14413 #include <sys/types.h>
14414  /* Check that off_t can represent 2**63 - 1 correctly.
14415     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14416     since some C++ compilers masquerading as C compilers
14417     incorrectly reject 9223372036854775807.  */
14418 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14419   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14420                        && LARGE_OFF_T % 2147483647 == 1)
14421                       ? 1 : -1];
14422 int
14423 main (void)
14424 {
14425
14426   ;
14427   return 0;
14428 }
14429 _ACEOF
14430 rm -f "conftest.$ac_objext"
14431 if { (eval echo "$as_me:14431: \"$ac_compile\"") >&5
14432   (eval $ac_compile) 2>&5
14433   ac_status=$?
14434   echo "$as_me:14434: \$? = $ac_status" >&5
14435   (exit "$ac_status"); } &&
14436          { ac_try='test -s "conftest.$ac_objext"'
14437   { (eval echo "$as_me:14437: \"$ac_try\"") >&5
14438   (eval $ac_try) 2>&5
14439   ac_status=$?
14440   echo "$as_me:14440: \$? = $ac_status" >&5
14441   (exit "$ac_status"); }; }; then
14442   break
14443 else
14444   echo "$as_me: failed program was:" >&5
14445 cat "conftest.$ac_ext" >&5
14446 fi
14447 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14448   cat >"conftest.$ac_ext" <<_ACEOF
14449 #line 14449 "configure"
14450 #include "confdefs.h"
14451 #define _FILE_OFFSET_BITS 64
14452 #include <sys/types.h>
14453  /* Check that off_t can represent 2**63 - 1 correctly.
14454     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14455     since some C++ compilers masquerading as C compilers
14456     incorrectly reject 9223372036854775807.  */
14457 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14458   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14459                        && LARGE_OFF_T % 2147483647 == 1)
14460                       ? 1 : -1];
14461 int
14462 main (void)
14463 {
14464
14465   ;
14466   return 0;
14467 }
14468 _ACEOF
14469 rm -f "conftest.$ac_objext"
14470 if { (eval echo "$as_me:14470: \"$ac_compile\"") >&5
14471   (eval $ac_compile) 2>&5
14472   ac_status=$?
14473   echo "$as_me:14473: \$? = $ac_status" >&5
14474   (exit "$ac_status"); } &&
14475          { ac_try='test -s "conftest.$ac_objext"'
14476   { (eval echo "$as_me:14476: \"$ac_try\"") >&5
14477   (eval $ac_try) 2>&5
14478   ac_status=$?
14479   echo "$as_me:14479: \$? = $ac_status" >&5
14480   (exit "$ac_status"); }; }; then
14481   ac_cv_sys_file_offset_bits=64; break
14482 else
14483   echo "$as_me: failed program was:" >&5
14484 cat "conftest.$ac_ext" >&5
14485 fi
14486 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14487   break
14488 done
14489 fi
14490 echo "$as_me:14490: result: $ac_cv_sys_file_offset_bits" >&5
14491 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14492 if test "$ac_cv_sys_file_offset_bits" != no; then
14493
14494 cat >>confdefs.h <<EOF
14495 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14496 EOF
14497
14498 fi
14499 rm -rf conftest*
14500   echo "$as_me:14500: checking for _LARGE_FILES value needed for large files" >&5
14501 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14502 if test "${ac_cv_sys_large_files+set}" = set; then
14503   echo $ECHO_N "(cached) $ECHO_C" >&6
14504 else
14505   while :; do
14506   ac_cv_sys_large_files=no
14507   cat >"conftest.$ac_ext" <<_ACEOF
14508 #line 14508 "configure"
14509 #include "confdefs.h"
14510 #include <sys/types.h>
14511  /* Check that off_t can represent 2**63 - 1 correctly.
14512     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14513     since some C++ compilers masquerading as C compilers
14514     incorrectly reject 9223372036854775807.  */
14515 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14516   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14517                        && LARGE_OFF_T % 2147483647 == 1)
14518                       ? 1 : -1];
14519 int
14520 main (void)
14521 {
14522
14523   ;
14524   return 0;
14525 }
14526 _ACEOF
14527 rm -f "conftest.$ac_objext"
14528 if { (eval echo "$as_me:14528: \"$ac_compile\"") >&5
14529   (eval $ac_compile) 2>&5
14530   ac_status=$?
14531   echo "$as_me:14531: \$? = $ac_status" >&5
14532   (exit "$ac_status"); } &&
14533          { ac_try='test -s "conftest.$ac_objext"'
14534   { (eval echo "$as_me:14534: \"$ac_try\"") >&5
14535   (eval $ac_try) 2>&5
14536   ac_status=$?
14537   echo "$as_me:14537: \$? = $ac_status" >&5
14538   (exit "$ac_status"); }; }; then
14539   break
14540 else
14541   echo "$as_me: failed program was:" >&5
14542 cat "conftest.$ac_ext" >&5
14543 fi
14544 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14545   cat >"conftest.$ac_ext" <<_ACEOF
14546 #line 14546 "configure"
14547 #include "confdefs.h"
14548 #define _LARGE_FILES 1
14549 #include <sys/types.h>
14550  /* Check that off_t can represent 2**63 - 1 correctly.
14551     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14552     since some C++ compilers masquerading as C compilers
14553     incorrectly reject 9223372036854775807.  */
14554 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14555   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14556                        && LARGE_OFF_T % 2147483647 == 1)
14557                       ? 1 : -1];
14558 int
14559 main (void)
14560 {
14561
14562   ;
14563   return 0;
14564 }
14565 _ACEOF
14566 rm -f "conftest.$ac_objext"
14567 if { (eval echo "$as_me:14567: \"$ac_compile\"") >&5
14568   (eval $ac_compile) 2>&5
14569   ac_status=$?
14570   echo "$as_me:14570: \$? = $ac_status" >&5
14571   (exit "$ac_status"); } &&
14572          { ac_try='test -s "conftest.$ac_objext"'
14573   { (eval echo "$as_me:14573: \"$ac_try\"") >&5
14574   (eval $ac_try) 2>&5
14575   ac_status=$?
14576   echo "$as_me:14576: \$? = $ac_status" >&5
14577   (exit "$ac_status"); }; }; then
14578   ac_cv_sys_large_files=1; break
14579 else
14580   echo "$as_me: failed program was:" >&5
14581 cat "conftest.$ac_ext" >&5
14582 fi
14583 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14584   break
14585 done
14586 fi
14587 echo "$as_me:14587: result: $ac_cv_sys_large_files" >&5
14588 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14589 if test "$ac_cv_sys_large_files" != no; then
14590
14591 cat >>confdefs.h <<EOF
14592 #define _LARGE_FILES $ac_cv_sys_large_files
14593 EOF
14594
14595 fi
14596 rm -rf conftest*
14597 fi
14598
14599         if test "$enable_largefile" != no ; then
14600         echo "$as_me:14600: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14601 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14602 if test "${ac_cv_sys_largefile_source+set}" = set; then
14603   echo $ECHO_N "(cached) $ECHO_C" >&6
14604 else
14605   while :; do
14606   ac_cv_sys_largefile_source=no
14607   cat >"conftest.$ac_ext" <<_ACEOF
14608 #line 14608 "configure"
14609 #include "confdefs.h"
14610 #include <stdio.h>
14611 int
14612 main (void)
14613 {
14614 return !fseeko;
14615   ;
14616   return 0;
14617 }
14618 _ACEOF
14619 rm -f "conftest.$ac_objext"
14620 if { (eval echo "$as_me:14620: \"$ac_compile\"") >&5
14621   (eval $ac_compile) 2>&5
14622   ac_status=$?
14623   echo "$as_me:14623: \$? = $ac_status" >&5
14624   (exit "$ac_status"); } &&
14625          { ac_try='test -s "conftest.$ac_objext"'
14626   { (eval echo "$as_me:14626: \"$ac_try\"") >&5
14627   (eval $ac_try) 2>&5
14628   ac_status=$?
14629   echo "$as_me:14629: \$? = $ac_status" >&5
14630   (exit "$ac_status"); }; }; then
14631   break
14632 else
14633   echo "$as_me: failed program was:" >&5
14634 cat "conftest.$ac_ext" >&5
14635 fi
14636 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14637   cat >"conftest.$ac_ext" <<_ACEOF
14638 #line 14638 "configure"
14639 #include "confdefs.h"
14640 #define _LARGEFILE_SOURCE 1
14641 #include <stdio.h>
14642 int
14643 main (void)
14644 {
14645 return !fseeko;
14646   ;
14647   return 0;
14648 }
14649 _ACEOF
14650 rm -f "conftest.$ac_objext"
14651 if { (eval echo "$as_me:14651: \"$ac_compile\"") >&5
14652   (eval $ac_compile) 2>&5
14653   ac_status=$?
14654   echo "$as_me:14654: \$? = $ac_status" >&5
14655   (exit "$ac_status"); } &&
14656          { ac_try='test -s "conftest.$ac_objext"'
14657   { (eval echo "$as_me:14657: \"$ac_try\"") >&5
14658   (eval $ac_try) 2>&5
14659   ac_status=$?
14660   echo "$as_me:14660: \$? = $ac_status" >&5
14661   (exit "$ac_status"); }; }; then
14662   ac_cv_sys_largefile_source=1; break
14663 else
14664   echo "$as_me: failed program was:" >&5
14665 cat "conftest.$ac_ext" >&5
14666 fi
14667 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14668   break
14669 done
14670 fi
14671 echo "$as_me:14671: result: $ac_cv_sys_largefile_source" >&5
14672 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14673 if test "$ac_cv_sys_largefile_source" != no; then
14674
14675 cat >>confdefs.h <<EOF
14676 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14677 EOF
14678
14679 fi
14680 rm -rf conftest*
14681
14682 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14683 # in glibc 2.1.3, but that breaks too many other things.
14684 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14685 echo "$as_me:14685: checking for fseeko" >&5
14686 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14687 if test "${ac_cv_func_fseeko+set}" = set; then
14688   echo $ECHO_N "(cached) $ECHO_C" >&6
14689 else
14690   cat >"conftest.$ac_ext" <<_ACEOF
14691 #line 14691 "configure"
14692 #include "confdefs.h"
14693 #include <stdio.h>
14694 int
14695 main (void)
14696 {
14697 return fseeko && fseeko (stdin, 0, 0);
14698   ;
14699   return 0;
14700 }
14701 _ACEOF
14702 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14703 if { (eval echo "$as_me:14703: \"$ac_link\"") >&5
14704   (eval $ac_link) 2>&5
14705   ac_status=$?
14706   echo "$as_me:14706: \$? = $ac_status" >&5
14707   (exit "$ac_status"); } &&
14708          { ac_try='test -s "conftest$ac_exeext"'
14709   { (eval echo "$as_me:14709: \"$ac_try\"") >&5
14710   (eval $ac_try) 2>&5
14711   ac_status=$?
14712   echo "$as_me:14712: \$? = $ac_status" >&5
14713   (exit "$ac_status"); }; }; then
14714   ac_cv_func_fseeko=yes
14715 else
14716   echo "$as_me: failed program was:" >&5
14717 cat "conftest.$ac_ext" >&5
14718 ac_cv_func_fseeko=no
14719 fi
14720 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14721 fi
14722 echo "$as_me:14722: result: $ac_cv_func_fseeko" >&5
14723 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14724 if test $ac_cv_func_fseeko = yes; then
14725
14726 cat >>confdefs.h <<\EOF
14727 #define HAVE_FSEEKO 1
14728 EOF
14729
14730 fi
14731
14732         # Normally we would collect these definitions in the config.h,
14733         # but (like _XOPEN_SOURCE), some environments rely on having these
14734         # defined before any of the system headers are included.  Another
14735         # case comes up with C++, e.g., on AIX the compiler compiles the
14736         # header files by themselves before looking at the body files it is
14737         # told to compile.  For ncurses, those header files do not include
14738         # the config.h
14739         if test "$ac_cv_sys_large_files" != no
14740         then
14741
14742         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14743         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14744
14745         fi
14746         if test "$ac_cv_sys_largefile_source" != no
14747         then
14748
14749         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14750         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14751
14752         fi
14753         if test "$ac_cv_sys_file_offset_bits" != no
14754         then
14755
14756         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14757         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14758
14759         fi
14760
14761         echo "$as_me:14761: checking whether to use struct dirent64" >&5
14762 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14763 if test "${cf_cv_struct_dirent64+set}" = set; then
14764   echo $ECHO_N "(cached) $ECHO_C" >&6
14765 else
14766
14767                 cat >"conftest.$ac_ext" <<_ACEOF
14768 #line 14768 "configure"
14769 #include "confdefs.h"
14770
14771 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14772 #include <sys/types.h>
14773 #include <dirent.h>
14774
14775 int
14776 main (void)
14777 {
14778
14779                 /* if transitional largefile support is setup, this is true */
14780                 extern struct dirent64 * readdir(DIR *);
14781                 struct dirent64 *x = readdir((DIR *)0);
14782                 struct dirent *y = readdir((DIR *)0);
14783                 int z = x - y;
14784                 (void)z;
14785
14786   ;
14787   return 0;
14788 }
14789 _ACEOF
14790 rm -f "conftest.$ac_objext"
14791 if { (eval echo "$as_me:14791: \"$ac_compile\"") >&5
14792   (eval $ac_compile) 2>&5
14793   ac_status=$?
14794   echo "$as_me:14794: \$? = $ac_status" >&5
14795   (exit "$ac_status"); } &&
14796          { ac_try='test -s "conftest.$ac_objext"'
14797   { (eval echo "$as_me:14797: \"$ac_try\"") >&5
14798   (eval $ac_try) 2>&5
14799   ac_status=$?
14800   echo "$as_me:14800: \$? = $ac_status" >&5
14801   (exit "$ac_status"); }; }; then
14802   cf_cv_struct_dirent64=yes
14803 else
14804   echo "$as_me: failed program was:" >&5
14805 cat "conftest.$ac_ext" >&5
14806 cf_cv_struct_dirent64=no
14807 fi
14808 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14809
14810 fi
14811 echo "$as_me:14811: result: $cf_cv_struct_dirent64" >&5
14812 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14813         test "$cf_cv_struct_dirent64" = yes &&
14814 cat >>confdefs.h <<\EOF
14815 #define HAVE_STRUCT_DIRENT64 1
14816 EOF
14817
14818         fi
14819
14820 ### Enable compiling-in rcs id's
14821 echo "$as_me:14821: checking if RCS identifiers should be compiled-in" >&5
14822 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14823
14824 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14825 if test "${with_rcs_ids+set}" = set; then
14826   withval="$with_rcs_ids"
14827   with_rcs_ids=$withval
14828 else
14829   with_rcs_ids=no
14830 fi;
14831 echo "$as_me:14831: result: $with_rcs_ids" >&5
14832 echo "${ECHO_T}$with_rcs_ids" >&6
14833 test "$with_rcs_ids" = yes &&
14834 cat >>confdefs.h <<\EOF
14835 #define USE_RCS_IDS 1
14836 EOF
14837
14838 ###############################################################################
14839
14840 ### Note that some functions (such as const) are normally disabled anyway.
14841 echo "$as_me:14841: checking if you want to build with function extensions" >&5
14842 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14843
14844 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14845 if test "${enable_ext_funcs+set}" = set; then
14846   enableval="$enable_ext_funcs"
14847   with_ext_funcs=$enableval
14848 else
14849   with_ext_funcs=yes
14850 fi;
14851 echo "$as_me:14851: result: $with_ext_funcs" >&5
14852 echo "${ECHO_T}$with_ext_funcs" >&6
14853 if test "$with_ext_funcs" = yes ; then
14854         NCURSES_EXT_FUNCS=1
14855
14856 cat >>confdefs.h <<\EOF
14857 #define HAVE_USE_DEFAULT_COLORS 1
14858 EOF
14859
14860 cat >>confdefs.h <<\EOF
14861 #define NCURSES_EXT_FUNCS 1
14862 EOF
14863
14864 else
14865         NCURSES_EXT_FUNCS=0
14866 fi
14867
14868 ###   use option --enable-const to turn on use of const beyond that in XSI.
14869 echo "$as_me:14869: checking for extended use of const keyword" >&5
14870 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14871
14872 # Check whether --enable-const or --disable-const was given.
14873 if test "${enable_const+set}" = set; then
14874   enableval="$enable_const"
14875   with_ext_const=$enableval
14876 else
14877   with_ext_const=no
14878 fi;
14879 echo "$as_me:14879: result: $with_ext_const" >&5
14880 echo "${ECHO_T}$with_ext_const" >&6
14881 NCURSES_CONST='/*nothing*/'
14882 if test "$with_ext_const" = yes ; then
14883         NCURSES_CONST=const
14884 fi
14885
14886 ###############################################################################
14887 # These options are relatively safe to experiment with.
14888
14889 echo "$as_me:14889: checking if you want all development code" >&5
14890 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14891
14892 # Check whether --with-develop or --without-develop was given.
14893 if test "${with_develop+set}" = set; then
14894   withval="$with_develop"
14895   with_develop=$withval
14896 else
14897   with_develop=no
14898 fi;
14899 echo "$as_me:14899: result: $with_develop" >&5
14900 echo "${ECHO_T}$with_develop" >&6
14901
14902 ###############################################################################
14903 # These are just experimental, probably should not be in a package:
14904
14905 # This is still experimental (20080329), but should ultimately be moved to
14906 # the script-block --with-normal, etc.
14907
14908 echo "$as_me:14908: checking if you want to link with the pthread library" >&5
14909 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14910
14911 # Check whether --with-pthread or --without-pthread was given.
14912 if test "${with_pthread+set}" = set; then
14913   withval="$with_pthread"
14914   with_pthread=$withval
14915 else
14916   with_pthread=no
14917 fi;
14918 echo "$as_me:14918: result: $with_pthread" >&5
14919 echo "${ECHO_T}$with_pthread" >&6
14920
14921 if test "$with_pthread" != no ; then
14922         echo "$as_me:14922: checking for pthread.h" >&5
14923 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14924 if test "${ac_cv_header_pthread_h+set}" = set; then
14925   echo $ECHO_N "(cached) $ECHO_C" >&6
14926 else
14927   cat >"conftest.$ac_ext" <<_ACEOF
14928 #line 14928 "configure"
14929 #include "confdefs.h"
14930 #include <pthread.h>
14931 _ACEOF
14932 if { (eval echo "$as_me:14932: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14933   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14934   ac_status=$?
14935   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14936   rm -f conftest.er1
14937   cat conftest.err >&5
14938   echo "$as_me:14938: \$? = $ac_status" >&5
14939   (exit "$ac_status"); } >/dev/null; then
14940   if test -s conftest.err; then
14941     ac_cpp_err=$ac_c_preproc_warn_flag
14942   else
14943     ac_cpp_err=
14944   fi
14945 else
14946   ac_cpp_err=yes
14947 fi
14948 if test -z "$ac_cpp_err"; then
14949   ac_cv_header_pthread_h=yes
14950 else
14951   echo "$as_me: failed program was:" >&5
14952   cat "conftest.$ac_ext" >&5
14953   ac_cv_header_pthread_h=no
14954 fi
14955 rm -f conftest.err "conftest.$ac_ext"
14956 fi
14957 echo "$as_me:14957: result: $ac_cv_header_pthread_h" >&5
14958 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14959 if test "$ac_cv_header_pthread_h" = yes; then
14960
14961 cat >>confdefs.h <<\EOF
14962 #define HAVE_PTHREADS_H 1
14963 EOF
14964
14965         for cf_lib_pthread in pthread c_r
14966         do
14967             echo "$as_me:14967: checking if we can link with the $cf_lib_pthread library" >&5
14968 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14969             cf_save_LIBS="$LIBS"
14970
14971 cf_add_libs="$LIBS"
14972 # reverse order
14973 cf_add_0lib=
14974 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14975 # filter duplicates
14976 for cf_add_1lib in $cf_add_0lib; do
14977         for cf_add_2lib in $cf_add_libs; do
14978                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14979                         cf_add_1lib=
14980                         break
14981                 fi
14982         done
14983         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14984 done
14985 LIBS="$cf_add_libs"
14986
14987             cat >"conftest.$ac_ext" <<_ACEOF
14988 #line 14988 "configure"
14989 #include "confdefs.h"
14990
14991 #include <pthread.h>
14992
14993 int
14994 main (void)
14995 {
14996
14997                 int rc = pthread_create(0,0,0,0);
14998                 int r2 = pthread_mutexattr_settype(0, 0);
14999
15000   ;
15001   return 0;
15002 }
15003 _ACEOF
15004 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15005 if { (eval echo "$as_me:15005: \"$ac_link\"") >&5
15006   (eval $ac_link) 2>&5
15007   ac_status=$?
15008   echo "$as_me:15008: \$? = $ac_status" >&5
15009   (exit "$ac_status"); } &&
15010          { ac_try='test -s "conftest$ac_exeext"'
15011   { (eval echo "$as_me:15011: \"$ac_try\"") >&5
15012   (eval $ac_try) 2>&5
15013   ac_status=$?
15014   echo "$as_me:15014: \$? = $ac_status" >&5
15015   (exit "$ac_status"); }; }; then
15016   with_pthread=yes
15017 else
15018   echo "$as_me: failed program was:" >&5
15019 cat "conftest.$ac_ext" >&5
15020 with_pthread=no
15021 fi
15022 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15023             LIBS="$cf_save_LIBS"
15024             echo "$as_me:15024: result: $with_pthread" >&5
15025 echo "${ECHO_T}$with_pthread" >&6
15026             test "$with_pthread" = yes && break
15027         done
15028
15029         if test "$with_pthread" = yes ; then
15030
15031 cf_add_libs="$LIBS"
15032 # reverse order
15033 cf_add_0lib=
15034 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15035 # filter duplicates
15036 for cf_add_1lib in $cf_add_0lib; do
15037         for cf_add_2lib in $cf_add_libs; do
15038                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15039                         cf_add_1lib=
15040                         break
15041                 fi
15042         done
15043         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15044 done
15045 LIBS="$cf_add_libs"
15046
15047 cat >>confdefs.h <<\EOF
15048 #define HAVE_LIBPTHREADS 1
15049 EOF
15050
15051         else
15052             { { echo "$as_me:15052: error: Cannot link with pthread library" >&5
15053 echo "$as_me: error: Cannot link with pthread library" >&2;}
15054    { (exit 1); exit 1; }; }
15055         fi
15056
15057 fi
15058
15059 fi
15060
15061 echo "$as_me:15061: checking if you want to use weak-symbols for pthreads" >&5
15062 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15063
15064 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15065 if test "${enable_weak_symbols+set}" = set; then
15066   enableval="$enable_weak_symbols"
15067   use_weak_symbols=$withval
15068 else
15069   use_weak_symbols=no
15070 fi;
15071 echo "$as_me:15071: result: $use_weak_symbols" >&5
15072 echo "${ECHO_T}$use_weak_symbols" >&6
15073 if test "$use_weak_symbols" = yes ; then
15074
15075 echo "$as_me:15075: checking if $CC supports weak symbols" >&5
15076 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15077 if test "${cf_cv_weak_symbols+set}" = set; then
15078   echo $ECHO_N "(cached) $ECHO_C" >&6
15079 else
15080
15081 cat >"conftest.$ac_ext" <<_ACEOF
15082 #line 15082 "configure"
15083 #include "confdefs.h"
15084
15085 #include <stdio.h>
15086 int
15087 main (void)
15088 {
15089
15090 #if defined(__GNUC__)
15091 #  if defined __USE_ISOC99
15092 #    define _cat_pragma(exp)    _Pragma(#exp)
15093 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15094 #  else
15095 #    define _weak_pragma(exp)
15096 #  endif
15097 #  define _declare(name)        __extension__ extern __typeof__(name) name
15098 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15099 #endif
15100
15101 weak_symbol(fopen);
15102
15103   ;
15104   return 0;
15105 }
15106 _ACEOF
15107 rm -f "conftest.$ac_objext"
15108 if { (eval echo "$as_me:15108: \"$ac_compile\"") >&5
15109   (eval $ac_compile) 2>&5
15110   ac_status=$?
15111   echo "$as_me:15111: \$? = $ac_status" >&5
15112   (exit "$ac_status"); } &&
15113          { ac_try='test -s "conftest.$ac_objext"'
15114   { (eval echo "$as_me:15114: \"$ac_try\"") >&5
15115   (eval $ac_try) 2>&5
15116   ac_status=$?
15117   echo "$as_me:15117: \$? = $ac_status" >&5
15118   (exit "$ac_status"); }; }; then
15119   cf_cv_weak_symbols=yes
15120 else
15121   echo "$as_me: failed program was:" >&5
15122 cat "conftest.$ac_ext" >&5
15123 cf_cv_weak_symbols=no
15124 fi
15125 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15126
15127 fi
15128 echo "$as_me:15128: result: $cf_cv_weak_symbols" >&5
15129 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15130
15131 else
15132         cf_cv_weak_symbols=no
15133 fi
15134
15135 if test $cf_cv_weak_symbols = yes ; then
15136
15137 cat >>confdefs.h <<\EOF
15138 #define USE_WEAK_SYMBOLS 1
15139 EOF
15140
15141 fi
15142
15143 PTHREAD=
15144 if test "$with_pthread" = "yes" ; then
15145
15146 cat >>confdefs.h <<\EOF
15147 #define USE_PTHREADS 1
15148 EOF
15149
15150         enable_reentrant=yes
15151         if test $cf_cv_weak_symbols = yes ; then
15152                 PTHREAD=-lpthread
15153         fi
15154 fi
15155
15156 # OpenSUSE is installing ncurses6, using reentrant option.
15157 echo "$as_me:15157: checking for _nc_TABSIZE" >&5
15158 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15159 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15160   echo $ECHO_N "(cached) $ECHO_C" >&6
15161 else
15162   cat >"conftest.$ac_ext" <<_ACEOF
15163 #line 15163 "configure"
15164 #include "confdefs.h"
15165 #define _nc_TABSIZE autoconf_temporary
15166 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15167 #undef _nc_TABSIZE
15168
15169 #ifdef __cplusplus
15170 extern "C"
15171 #endif
15172
15173 /* We use char because int might match the return type of a gcc2
15174    builtin and then its argument prototype would still apply.  */
15175 char _nc_TABSIZE (void);
15176
15177 int
15178 main (void)
15179 {
15180
15181 /* The GNU C library defines stubs for functions which it implements
15182     to always fail with ENOSYS.  Some functions are actually named
15183     something starting with __ and the normal name is an alias.  */
15184 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15185 #error found stub for _nc_TABSIZE
15186 #endif
15187
15188         return _nc_TABSIZE ();
15189   ;
15190   return 0;
15191 }
15192 _ACEOF
15193 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15194 if { (eval echo "$as_me:15194: \"$ac_link\"") >&5
15195   (eval $ac_link) 2>&5
15196   ac_status=$?
15197   echo "$as_me:15197: \$? = $ac_status" >&5
15198   (exit "$ac_status"); } &&
15199          { ac_try='test -s "conftest$ac_exeext"'
15200   { (eval echo "$as_me:15200: \"$ac_try\"") >&5
15201   (eval $ac_try) 2>&5
15202   ac_status=$?
15203   echo "$as_me:15203: \$? = $ac_status" >&5
15204   (exit "$ac_status"); }; }; then
15205   ac_cv_func__nc_TABSIZE=yes
15206 else
15207   echo "$as_me: failed program was:" >&5
15208 cat "conftest.$ac_ext" >&5
15209 ac_cv_func__nc_TABSIZE=no
15210 fi
15211 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15212 fi
15213 echo "$as_me:15213: result: $ac_cv_func__nc_TABSIZE" >&5
15214 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15215 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15216   assume_reentrant=yes
15217 else
15218   assume_reentrant=no
15219 fi
15220
15221 # Reentrant code has to be opaque; there's little advantage to making ncurses
15222 # opaque outside of that, so there is no --enable-opaque option.  We can use
15223 # this option without --with-pthreads, but this will be always set for
15224 # pthreads.
15225 echo "$as_me:15225: checking if you want experimental reentrant code" >&5
15226 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15227
15228 # Check whether --enable-reentrant or --disable-reentrant was given.
15229 if test "${enable_reentrant+set}" = set; then
15230   enableval="$enable_reentrant"
15231   with_reentrant=$enableval
15232 else
15233   with_reentrant=$assume_reentrant
15234 fi;
15235 echo "$as_me:15235: result: $with_reentrant" >&5
15236 echo "${ECHO_T}$with_reentrant" >&6
15237 if test "$with_reentrant" = yes ; then
15238         cf_cv_enable_reentrant=1
15239         if test $cf_cv_weak_symbols = yes ; then
15240
15241 # remove pthread library from $LIBS
15242 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15243
15244         elif test "$assume_reentrant" = no ; then
15245                 LIB_SUFFIX="t${LIB_SUFFIX}"
15246         fi
15247
15248 cat >>confdefs.h <<\EOF
15249 #define USE_REENTRANT 1
15250 EOF
15251
15252 else
15253         cf_cv_enable_reentrant=0
15254 fi
15255
15256 ### Allow using a different wrap-prefix
15257 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15258         echo "$as_me:15258: checking for prefix used to wrap public variables" >&5
15259 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15260
15261 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15262 if test "${with_wrap_prefix+set}" = set; then
15263   withval="$with_wrap_prefix"
15264   NCURSES_WRAP_PREFIX=$withval
15265 else
15266   NCURSES_WRAP_PREFIX=_nc_
15267 fi;
15268         echo "$as_me:15268: result: $NCURSES_WRAP_PREFIX" >&5
15269 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15270 else
15271         NCURSES_WRAP_PREFIX=_nc_
15272 fi
15273
15274 cat >>confdefs.h <<EOF
15275 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15276 EOF
15277
15278 ###############################################################################
15279
15280 ###     use option --disable-echo to suppress full display compiling commands
15281
15282 echo "$as_me:15282: checking if you want to see long compiling messages" >&5
15283 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15284
15285 # Check whether --enable-echo or --disable-echo was given.
15286 if test "${enable_echo+set}" = set; then
15287   enableval="$enable_echo"
15288   test "$enableval" != no && enableval=yes
15289         if test "$enableval" != "yes" ; then
15290
15291         ECHO_LT='--silent'
15292         ECHO_LD='@echo linking $@;'
15293         RULE_CC='@echo compiling $<'
15294         SHOW_CC='@echo compiling $@'
15295         ECHO_CC='@'
15296
15297         else
15298
15299         ECHO_LT=''
15300         ECHO_LD=''
15301         RULE_CC=''
15302         SHOW_CC=''
15303         ECHO_CC=''
15304
15305         fi
15306 else
15307   enableval=yes
15308
15309         ECHO_LT=''
15310         ECHO_LD=''
15311         RULE_CC=''
15312         SHOW_CC=''
15313         ECHO_CC=''
15314
15315 fi;
15316 echo "$as_me:15316: result: $enableval" >&5
15317 echo "${ECHO_T}$enableval" >&6
15318
15319 echo "$as_me:15319: checking if you want to use C11 _Noreturn feature" >&5
15320 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15321
15322 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15323 if test "${enable_stdnoreturn+set}" = set; then
15324   enableval="$enable_stdnoreturn"
15325   test "$enableval" != yes && enableval=no
15326         if test "$enableval" != "no" ; then
15327     enable_stdnoreturn=yes
15328         else
15329                 enable_stdnoreturn=no
15330         fi
15331 else
15332   enableval=no
15333         enable_stdnoreturn=no
15334
15335 fi;
15336 echo "$as_me:15336: result: $enable_stdnoreturn" >&5
15337 echo "${ECHO_T}$enable_stdnoreturn" >&6
15338
15339 if test $enable_stdnoreturn = yes; then
15340 echo "$as_me:15340: checking for C11 _Noreturn feature" >&5
15341 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15342 if test "${cf_cv_c11_noreturn+set}" = set; then
15343   echo $ECHO_N "(cached) $ECHO_C" >&6
15344 else
15345   cat >"conftest.$ac_ext" <<_ACEOF
15346 #line 15346 "configure"
15347 #include "confdefs.h"
15348
15349 #include <stdio.h>
15350 #include <stdlib.h>
15351 #include <stdnoreturn.h>
15352 static _Noreturn void giveup(void) { exit(0); }
15353
15354 int
15355 main (void)
15356 {
15357 if (feof(stdin)) giveup()
15358   ;
15359   return 0;
15360 }
15361 _ACEOF
15362 rm -f "conftest.$ac_objext"
15363 if { (eval echo "$as_me:15363: \"$ac_compile\"") >&5
15364   (eval $ac_compile) 2>&5
15365   ac_status=$?
15366   echo "$as_me:15366: \$? = $ac_status" >&5
15367   (exit "$ac_status"); } &&
15368          { ac_try='test -s "conftest.$ac_objext"'
15369   { (eval echo "$as_me:15369: \"$ac_try\"") >&5
15370   (eval $ac_try) 2>&5
15371   ac_status=$?
15372   echo "$as_me:15372: \$? = $ac_status" >&5
15373   (exit "$ac_status"); }; }; then
15374   cf_cv_c11_noreturn=yes
15375 else
15376   echo "$as_me: failed program was:" >&5
15377 cat "conftest.$ac_ext" >&5
15378 cf_cv_c11_noreturn=no
15379 fi
15380 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15381
15382 fi
15383 echo "$as_me:15383: result: $cf_cv_c11_noreturn" >&5
15384 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15385 else
15386         cf_cv_c11_noreturn=no,
15387 fi
15388
15389 if test "$cf_cv_c11_noreturn" = yes; then
15390
15391 cat >>confdefs.h <<\EOF
15392 #define HAVE_STDNORETURN_H 1
15393 EOF
15394
15395 cat >>confdefs.h <<EOF
15396 #define STDC_NORETURN _Noreturn
15397 EOF
15398
15399         HAVE_STDNORETURN_H=1
15400 else
15401         HAVE_STDNORETURN_H=0
15402 fi
15403
15404 if test "$GCC" = yes || test "$GXX" = yes
15405 then
15406
15407 if test "$GCC" = yes || test "$GXX" = yes
15408 then
15409         case $CFLAGS in
15410         (*-Werror=*)
15411                 cf_temp_flags=
15412                 for cf_temp_scan in $CFLAGS
15413                 do
15414                         case "x$cf_temp_scan" in
15415                         (x-Werror=format*)
15416
15417         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15418         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15419
15420                                 ;;
15421                         (x-Werror=*)
15422
15423         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15424         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15425
15426                                 ;;
15427                         (*)
15428
15429         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15430         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15431
15432                                 ;;
15433                         esac
15434                 done
15435                 if test "x$CFLAGS" != "x$cf_temp_flags"
15436                 then
15437                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15438
15439 echo "${as_me:-configure}:15439: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15440
15441                         CFLAGS="$cf_temp_flags"
15442                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15443
15444 echo "${as_me:-configure}:15444: testing ... fixed $CFLAGS ..." 1>&5
15445
15446                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15447
15448 echo "${as_me:-configure}:15448: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15449
15450                 fi
15451                 ;;
15452         esac
15453 fi
15454
15455 if test "$GCC" = yes || test "$GXX" = yes
15456 then
15457         case $CPPFLAGS in
15458         (*-Werror=*)
15459                 cf_temp_flags=
15460                 for cf_temp_scan in $CPPFLAGS
15461                 do
15462                         case "x$cf_temp_scan" in
15463                         (x-Werror=format*)
15464
15465         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15466         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15467
15468                                 ;;
15469                         (x-Werror=*)
15470
15471         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15472         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15473
15474                                 ;;
15475                         (*)
15476
15477         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15478         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15479
15480                                 ;;
15481                         esac
15482                 done
15483                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15484                 then
15485                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15486
15487 echo "${as_me:-configure}:15487: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15488
15489                         CPPFLAGS="$cf_temp_flags"
15490                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15491
15492 echo "${as_me:-configure}:15492: testing ... fixed $CPPFLAGS ..." 1>&5
15493
15494                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15495
15496 echo "${as_me:-configure}:15496: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15497
15498                 fi
15499                 ;;
15500         esac
15501 fi
15502
15503 if test "$GCC" = yes || test "$GXX" = yes
15504 then
15505         case $LDFLAGS in
15506         (*-Werror=*)
15507                 cf_temp_flags=
15508                 for cf_temp_scan in $LDFLAGS
15509                 do
15510                         case "x$cf_temp_scan" in
15511                         (x-Werror=format*)
15512
15513         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15514         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15515
15516                                 ;;
15517                         (x-Werror=*)
15518
15519         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15520         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15521
15522                                 ;;
15523                         (*)
15524
15525         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15526         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15527
15528                                 ;;
15529                         esac
15530                 done
15531                 if test "x$LDFLAGS" != "x$cf_temp_flags"
15532                 then
15533                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15534
15535 echo "${as_me:-configure}:15535: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15536
15537                         LDFLAGS="$cf_temp_flags"
15538                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15539
15540 echo "${as_me:-configure}:15540: testing ... fixed $LDFLAGS ..." 1>&5
15541
15542                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15543
15544 echo "${as_me:-configure}:15544: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15545
15546                 fi
15547                 ;;
15548         esac
15549 fi
15550
15551 echo "$as_me:15551: checking if you want to turn on gcc warnings" >&5
15552 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15553
15554 # Check whether --enable-warnings or --disable-warnings was given.
15555 if test "${enable_warnings+set}" = set; then
15556   enableval="$enable_warnings"
15557   test "$enableval" != yes && enableval=no
15558         if test "$enableval" != "no" ; then
15559     enable_warnings=yes
15560         else
15561                 enable_warnings=no
15562         fi
15563 else
15564   enableval=no
15565         enable_warnings=no
15566
15567 fi;
15568 echo "$as_me:15568: result: $enable_warnings" >&5
15569 echo "${ECHO_T}$enable_warnings" >&6
15570 if test "$enable_warnings" = "yes"
15571 then
15572
15573 if test "x$have_x" = xyes; then
15574
15575 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15576 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15577 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15578 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15579 for cf_X_CFLAGS in $X_CFLAGS
15580 do
15581         case "x$cf_X_CFLAGS" in
15582         x-[IUD]*)
15583                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15584                 ;;
15585         *)
15586                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15587                 ;;
15588         esac
15589 done
15590
15591 cat >"conftest.$ac_ext" <<_ACEOF
15592 #line 15592 "configure"
15593 #include "confdefs.h"
15594
15595 #include <stdlib.h>
15596 #include <X11/Intrinsic.h>
15597
15598 int
15599 main (void)
15600 {
15601 String foo = malloc(1); free((void*)foo)
15602   ;
15603   return 0;
15604 }
15605 _ACEOF
15606 rm -f "conftest.$ac_objext"
15607 if { (eval echo "$as_me:15607: \"$ac_compile\"") >&5
15608   (eval $ac_compile) 2>&5
15609   ac_status=$?
15610   echo "$as_me:15610: \$? = $ac_status" >&5
15611   (exit "$ac_status"); } &&
15612          { ac_try='test -s "conftest.$ac_objext"'
15613   { (eval echo "$as_me:15613: \"$ac_try\"") >&5
15614   (eval $ac_try) 2>&5
15615   ac_status=$?
15616   echo "$as_me:15616: \$? = $ac_status" >&5
15617   (exit "$ac_status"); }; }; then
15618
15619 echo "$as_me:15619: checking for X11/Xt const-feature" >&5
15620 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15621 if test "${cf_cv_const_x_string+set}" = set; then
15622   echo $ECHO_N "(cached) $ECHO_C" >&6
15623 else
15624
15625         cat >"conftest.$ac_ext" <<_ACEOF
15626 #line 15626 "configure"
15627 #include "confdefs.h"
15628
15629 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15630 #undef  XTSTRINGDEFINES /* X11R5 and later */
15631 #include <stdlib.h>
15632 #include <X11/Intrinsic.h>
15633
15634 int
15635 main (void)
15636 {
15637 String foo = malloc(1); *foo = 0
15638   ;
15639   return 0;
15640 }
15641 _ACEOF
15642 rm -f "conftest.$ac_objext"
15643 if { (eval echo "$as_me:15643: \"$ac_compile\"") >&5
15644   (eval $ac_compile) 2>&5
15645   ac_status=$?
15646   echo "$as_me:15646: \$? = $ac_status" >&5
15647   (exit "$ac_status"); } &&
15648          { ac_try='test -s "conftest.$ac_objext"'
15649   { (eval echo "$as_me:15649: \"$ac_try\"") >&5
15650   (eval $ac_try) 2>&5
15651   ac_status=$?
15652   echo "$as_me:15652: \$? = $ac_status" >&5
15653   (exit "$ac_status"); }; }; then
15654
15655                         cf_cv_const_x_string=no
15656
15657 else
15658   echo "$as_me: failed program was:" >&5
15659 cat "conftest.$ac_ext" >&5
15660
15661                         cf_cv_const_x_string=yes
15662
15663 fi
15664 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15665
15666 fi
15667 echo "$as_me:15667: result: $cf_cv_const_x_string" >&5
15668 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15669
15670 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15671 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15672 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15673
15674 case "$cf_cv_const_x_string" in
15675 (no)
15676
15677         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15678         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15679
15680         ;;
15681 (*)
15682
15683         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15684         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15685
15686         ;;
15687 esac
15688
15689 else
15690   echo "$as_me: failed program was:" >&5
15691 cat "conftest.$ac_ext" >&5
15692 fi
15693 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15694  fi
15695 cat > "conftest.$ac_ext" <<EOF
15696 #line 15696 "${as_me:-configure}"
15697 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15698 EOF
15699 if test "$INTEL_COMPILER" = yes
15700 then
15701 # The "-wdXXX" options suppress warnings:
15702 # remark #1419: external declaration in primary source file
15703 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15704 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15705 # remark #193: zero used for undefined preprocessing identifier
15706 # remark #593: variable "curs_sb_left_arrow" was set but never used
15707 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15708 # remark #869: parameter "tw" was never referenced
15709 # remark #981: operands are evaluated in unspecified order
15710 # warning #279: controlling expression is constant
15711
15712         { echo "$as_me:15712: checking for $CC warning options..." >&5
15713 echo "$as_me: checking for $CC warning options..." >&6;}
15714         cf_save_CFLAGS="$CFLAGS"
15715         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15716         for cf_opt in \
15717                 wd1419 \
15718                 wd1683 \
15719                 wd1684 \
15720                 wd193 \
15721                 wd593 \
15722                 wd279 \
15723                 wd810 \
15724                 wd869 \
15725                 wd981
15726         do
15727                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15728                 if { (eval echo "$as_me:15728: \"$ac_compile\"") >&5
15729   (eval $ac_compile) 2>&5
15730   ac_status=$?
15731   echo "$as_me:15731: \$? = $ac_status" >&5
15732   (exit "$ac_status"); }; then
15733                         test -n "$verbose" && echo "$as_me:15733: result: ... -$cf_opt" >&5
15734 echo "${ECHO_T}... -$cf_opt" >&6
15735                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15736                 fi
15737         done
15738         CFLAGS="$cf_save_CFLAGS"
15739 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15740 then
15741         { echo "$as_me:15741: checking for $CC warning options..." >&5
15742 echo "$as_me: checking for $CC warning options..." >&6;}
15743         cf_save_CFLAGS="$CFLAGS"
15744         cf_warn_CONST=""
15745         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15746         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15747         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15748         for cf_opt in W Wall \
15749                 Wbad-function-cast \
15750                 Wcast-align \
15751                 Wcast-qual \
15752                 Wdeclaration-after-statement \
15753                 Wextra \
15754                 Winline \
15755                 Wmissing-declarations \
15756                 Wmissing-prototypes \
15757                 Wnested-externs \
15758                 Wpointer-arith \
15759                 Wshadow \
15760                 Wstrict-prototypes \
15761                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15762         do
15763                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15764                 if { (eval echo "$as_me:15764: \"$ac_compile\"") >&5
15765   (eval $ac_compile) 2>&5
15766   ac_status=$?
15767   echo "$as_me:15767: \$? = $ac_status" >&5
15768   (exit "$ac_status"); }; then
15769                         test -n "$verbose" && echo "$as_me:15769: result: ... -$cf_opt" >&5
15770 echo "${ECHO_T}... -$cf_opt" >&6
15771                         case "$cf_opt" in
15772                         (Winline)
15773                                 case "$GCC_VERSION" in
15774                                 ([34].*)
15775                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15776
15777 echo "${as_me:-configure}:15777: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15778
15779                                         continue;;
15780                                 esac
15781                                 ;;
15782                         (Wpointer-arith)
15783                                 case "$GCC_VERSION" in
15784                                 ([12].*)
15785                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15786
15787 echo "${as_me:-configure}:15787: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15788
15789                                         continue;;
15790                                 esac
15791                                 ;;
15792                         esac
15793                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15794                 fi
15795         done
15796         CFLAGS="$cf_save_CFLAGS"
15797 fi
15798 rm -rf ./conftest*
15799
15800 fi
15801
15802 if test "$GCC" = yes || test "$GXX" = yes
15803 then
15804 cat > conftest.i <<EOF
15805 #ifndef GCC_PRINTF
15806 #define GCC_PRINTF 0
15807 #endif
15808 #ifndef GCC_SCANF
15809 #define GCC_SCANF 0
15810 #endif
15811 #ifndef GCC_NORETURN
15812 #define GCC_NORETURN /* nothing */
15813 #endif
15814 #ifndef GCC_UNUSED
15815 #define GCC_UNUSED /* nothing */
15816 #endif
15817 EOF
15818 if test "$GCC" = yes
15819 then
15820         { echo "$as_me:15820: checking for $CC __attribute__ directives..." >&5
15821 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15822 cat > "conftest.$ac_ext" <<EOF
15823 #line 15823 "${as_me:-configure}"
15824 #include <stdio.h>
15825 #include "confdefs.h"
15826 #include "conftest.h"
15827 #include "conftest.i"
15828 #if     GCC_PRINTF
15829 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15830 #else
15831 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15832 #endif
15833 #if     GCC_SCANF
15834 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15835 #else
15836 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15837 #endif
15838 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15839 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15840 extern GCC_NORETURN void foo(void);
15841 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15842 EOF
15843         cf_printf_attribute=no
15844         cf_scanf_attribute=no
15845         for cf_attribute in scanf printf unused noreturn
15846         do
15847
15848 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15849
15850                 cf_directive="__attribute__(($cf_attribute))"
15851                 echo "checking for $CC $cf_directive" 1>&5
15852
15853                 case "$cf_attribute" in
15854                 (printf)
15855                         cf_printf_attribute=yes
15856                         cat >conftest.h <<EOF
15857 #define GCC_$cf_ATTRIBUTE 1
15858 EOF
15859                         ;;
15860                 (scanf)
15861                         cf_scanf_attribute=yes
15862                         cat >conftest.h <<EOF
15863 #define GCC_$cf_ATTRIBUTE 1
15864 EOF
15865                         ;;
15866                 (*)
15867                         cat >conftest.h <<EOF
15868 #define GCC_$cf_ATTRIBUTE $cf_directive
15869 EOF
15870                         ;;
15871                 esac
15872
15873                 if { (eval echo "$as_me:15873: \"$ac_compile\"") >&5
15874   (eval $ac_compile) 2>&5
15875   ac_status=$?
15876   echo "$as_me:15876: \$? = $ac_status" >&5
15877   (exit "$ac_status"); }; then
15878                         test -n "$verbose" && echo "$as_me:15878: result: ... $cf_attribute" >&5
15879 echo "${ECHO_T}... $cf_attribute" >&6
15880                         cat conftest.h >>confdefs.h
15881                         case "$cf_attribute" in
15882                         (noreturn)
15883
15884 cat >>confdefs.h <<EOF
15885 #define GCC_NORETURN $cf_directive
15886 EOF
15887
15888                                 ;;
15889                         (printf)
15890                                 cf_value='/* nothing */'
15891                                 if test "$cf_printf_attribute" != no ; then
15892                                         cf_value='__attribute__((format(printf,fmt,var)))'
15893
15894 cat >>confdefs.h <<\EOF
15895 #define GCC_PRINTF 1
15896 EOF
15897
15898                                 fi
15899
15900 cat >>confdefs.h <<EOF
15901 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15902 EOF
15903
15904                                 ;;
15905                         (scanf)
15906                                 cf_value='/* nothing */'
15907                                 if test "$cf_scanf_attribute" != no ; then
15908                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15909
15910 cat >>confdefs.h <<\EOF
15911 #define GCC_SCANF 1
15912 EOF
15913
15914                                 fi
15915
15916 cat >>confdefs.h <<EOF
15917 #define GCC_SCANFLIKE(fmt,var) $cf_value
15918 EOF
15919
15920                                 ;;
15921                         (unused)
15922
15923 cat >>confdefs.h <<EOF
15924 #define GCC_UNUSED $cf_directive
15925 EOF
15926
15927                                 ;;
15928                         esac
15929                 fi
15930         done
15931 else
15932         ${FGREP-fgrep} define conftest.i >>confdefs.h
15933 fi
15934 rm -rf ./conftest*
15935 fi
15936
15937 fi
15938
15939 if test "x$enable_warnings" = "xyes"; then
15940
15941         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
15942
15943 fi
15944
15945 ###     use option --enable-assertions to turn on generation of assertion code
15946 echo "$as_me:15946: checking if you want to enable runtime assertions" >&5
15947 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15948
15949 # Check whether --enable-assertions or --disable-assertions was given.
15950 if test "${enable_assertions+set}" = set; then
15951   enableval="$enable_assertions"
15952   with_assertions=$enableval
15953 else
15954   with_assertions=no
15955 fi;
15956 echo "$as_me:15956: result: $with_assertions" >&5
15957 echo "${ECHO_T}$with_assertions" >&6
15958 if test -n "$GCC"
15959 then
15960         if test "$with_assertions" = no
15961         then
15962                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15963         else
15964
15965         ADAFLAGS="$ADAFLAGS -gnata"
15966
15967         fi
15968 fi
15969
15970 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15971
15972 cat >>confdefs.h <<\EOF
15973 #define HAVE_NC_ALLOC_H 1
15974 EOF
15975
15976 ###     use option --enable-expanded to generate certain macros as functions
15977
15978 # Check whether --enable-expanded or --disable-expanded was given.
15979 if test "${enable_expanded+set}" = set; then
15980   enableval="$enable_expanded"
15981   test "$enableval" = yes &&
15982 cat >>confdefs.h <<\EOF
15983 #define NCURSES_EXPANDED 1
15984 EOF
15985
15986 fi;
15987
15988 ###     use option --disable-macros to suppress macros in favor of functions
15989
15990 # Check whether --enable-macros or --disable-macros was given.
15991 if test "${enable_macros+set}" = set; then
15992   enableval="$enable_macros"
15993   test "$enableval" = no &&
15994 cat >>confdefs.h <<\EOF
15995 #define NCURSES_NOMACROS 1
15996 EOF
15997
15998 fi;
15999
16000 # Normally we only add trace() to the debug-library.  Allow this to be
16001 # extended to all models of the ncurses library:
16002 cf_all_traces=no
16003 case "$CFLAGS $CPPFLAGS" in
16004 (*-DTRACE*)
16005         cf_all_traces=yes
16006         ;;
16007 esac
16008
16009 echo "$as_me:16009: checking whether to add trace feature to all models" >&5
16010 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16011
16012 # Check whether --with-trace or --without-trace was given.
16013 if test "${with_trace+set}" = set; then
16014   withval="$with_trace"
16015   cf_with_trace=$withval
16016 else
16017   cf_with_trace=$cf_all_traces
16018 fi;
16019 echo "$as_me:16019: result: $cf_with_trace" >&5
16020 echo "${ECHO_T}$cf_with_trace" >&6
16021
16022 if test "$cf_with_trace" = yes ; then
16023         ADA_TRACE=TRUE
16024
16025 cf_fix_cppflags=no
16026 cf_new_cflags=
16027 cf_new_cppflags=
16028 cf_new_extra_cppflags=
16029
16030 for cf_add_cflags in -DTRACE
16031 do
16032 case "$cf_fix_cppflags" in
16033 (no)
16034         case "$cf_add_cflags" in
16035         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16036                 case "$cf_add_cflags" in
16037                 (-D*)
16038                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16039
16040                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16041                                 && test -z "${cf_tst_cflags}" \
16042                                 && cf_fix_cppflags=yes
16043
16044                         if test "$cf_fix_cppflags" = yes ; then
16045
16046         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16047         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16048
16049                                 continue
16050                         elif test "${cf_tst_cflags}" = "\"'" ; then
16051
16052         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16053         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16054
16055                                 continue
16056                         fi
16057                         ;;
16058                 esac
16059                 case "$CPPFLAGS" in
16060                 (*$cf_add_cflags)
16061                         ;;
16062                 (*)
16063                         case "$cf_add_cflags" in
16064                         (-D*)
16065                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16066
16067 CPPFLAGS=`echo "$CPPFLAGS" | \
16068         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16069                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16070
16071                                 ;;
16072                         esac
16073
16074         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16075         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16076
16077                         ;;
16078                 esac
16079                 ;;
16080         (*)
16081
16082         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16083         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16084
16085                 ;;
16086         esac
16087         ;;
16088 (yes)
16089
16090         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16091         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16092
16093         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16094
16095         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16096                 && test -z "${cf_tst_cflags}" \
16097                 && cf_fix_cppflags=no
16098         ;;
16099 esac
16100 done
16101
16102 if test -n "$cf_new_cflags" ; then
16103
16104         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16105         CFLAGS="${CFLAGS}$cf_new_cflags"
16106
16107 fi
16108
16109 if test -n "$cf_new_cppflags" ; then
16110
16111         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16112         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16113
16114 fi
16115
16116 if test -n "$cf_new_extra_cppflags" ; then
16117
16118         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16119         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16120
16121 fi
16122
16123 else
16124         ADA_TRACE=FALSE
16125 fi
16126
16127 echo "$as_me:16127: checking if we want to use GNAT projects" >&5
16128 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16129
16130 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16131 if test "${enable_gnat_projects+set}" = set; then
16132   enableval="$enable_gnat_projects"
16133   test "$enableval" != no && enableval=yes
16134         if test "$enableval" != "yes" ; then
16135     enable_gnat_projects=no
16136         else
16137                 enable_gnat_projects=yes
16138         fi
16139 else
16140   enableval=yes
16141         enable_gnat_projects=yes
16142
16143 fi;
16144 echo "$as_me:16144: result: $enable_gnat_projects" >&5
16145 echo "${ECHO_T}$enable_gnat_projects" >&6
16146
16147 ###     Checks for libraries.
16148 case $cf_cv_system_name in
16149 (*mingw32*)
16150
16151 echo "$as_me:16151: checking if ssp library is needed" >&5
16152 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16153 if test "${cf_cv_need_libssp+set}" = set; then
16154   echo $ECHO_N "(cached) $ECHO_C" >&6
16155 else
16156
16157 cat >"conftest.$ac_ext" <<_ACEOF
16158 #line 16158 "configure"
16159 #include "confdefs.h"
16160
16161 #include <sys/types.h>
16162 #include <dirent.h>
16163
16164 int
16165 main (void)
16166 {
16167
16168        DIR *dp = opendir(".");
16169
16170   ;
16171   return 0;
16172 }
16173 _ACEOF
16174 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16175 if { (eval echo "$as_me:16175: \"$ac_link\"") >&5
16176   (eval $ac_link) 2>&5
16177   ac_status=$?
16178   echo "$as_me:16178: \$? = $ac_status" >&5
16179   (exit "$ac_status"); } &&
16180          { ac_try='test -s "conftest$ac_exeext"'
16181   { (eval echo "$as_me:16181: \"$ac_try\"") >&5
16182   (eval $ac_try) 2>&5
16183   ac_status=$?
16184   echo "$as_me:16184: \$? = $ac_status" >&5
16185   (exit "$ac_status"); }; }; then
16186   cf_cv_need_libssp=no
16187 else
16188   echo "$as_me: failed program was:" >&5
16189 cat "conftest.$ac_ext" >&5
16190
16191         cf_save_LIBS="$LIBS"
16192         LIBS="$LIBS -lssp"
16193         cat >"conftest.$ac_ext" <<_ACEOF
16194 #line 16194 "configure"
16195 #include "confdefs.h"
16196
16197 #include <sys/types.h>
16198 #include <dirent.h>
16199
16200 int
16201 main (void)
16202 {
16203
16204                    DIR *dp = opendir(".");
16205
16206   ;
16207   return 0;
16208 }
16209 _ACEOF
16210 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16211 if { (eval echo "$as_me:16211: \"$ac_link\"") >&5
16212   (eval $ac_link) 2>&5
16213   ac_status=$?
16214   echo "$as_me:16214: \$? = $ac_status" >&5
16215   (exit "$ac_status"); } &&
16216          { ac_try='test -s "conftest$ac_exeext"'
16217   { (eval echo "$as_me:16217: \"$ac_try\"") >&5
16218   (eval $ac_try) 2>&5
16219   ac_status=$?
16220   echo "$as_me:16220: \$? = $ac_status" >&5
16221   (exit "$ac_status"); }; }; then
16222   cf_cv_need_libssp=yes
16223 else
16224   echo "$as_me: failed program was:" >&5
16225 cat "conftest.$ac_ext" >&5
16226 cf_cv_need_libssp=maybe
16227 fi
16228 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16229         LIBS="$cf_save_LIBS"
16230
16231 fi
16232 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16233 fi
16234 echo "$as_me:16234: result: $cf_cv_need_libssp" >&5
16235 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16236
16237 if test "x$cf_cv_need_libssp" = xyes
16238 then
16239
16240 cf_add_libs="$LIBS"
16241 # reverse order
16242 cf_add_0lib=
16243 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16244 # filter duplicates
16245 for cf_add_1lib in $cf_add_0lib; do
16246         for cf_add_2lib in $cf_add_libs; do
16247                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16248                         cf_add_1lib=
16249                         break
16250                 fi
16251         done
16252         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16253 done
16254 LIBS="$cf_add_libs"
16255
16256 fi
16257
16258         ;;
16259 (*)
16260 echo "$as_me:16260: checking for gettimeofday" >&5
16261 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16262 if test "${ac_cv_func_gettimeofday+set}" = set; then
16263   echo $ECHO_N "(cached) $ECHO_C" >&6
16264 else
16265   cat >"conftest.$ac_ext" <<_ACEOF
16266 #line 16266 "configure"
16267 #include "confdefs.h"
16268 #define gettimeofday autoconf_temporary
16269 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16270 #undef gettimeofday
16271
16272 #ifdef __cplusplus
16273 extern "C"
16274 #endif
16275
16276 /* We use char because int might match the return type of a gcc2
16277    builtin and then its argument prototype would still apply.  */
16278 char gettimeofday (void);
16279
16280 int
16281 main (void)
16282 {
16283
16284 /* The GNU C library defines stubs for functions which it implements
16285     to always fail with ENOSYS.  Some functions are actually named
16286     something starting with __ and the normal name is an alias.  */
16287 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16288 #error found stub for gettimeofday
16289 #endif
16290
16291         return gettimeofday ();
16292   ;
16293   return 0;
16294 }
16295 _ACEOF
16296 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16297 if { (eval echo "$as_me:16297: \"$ac_link\"") >&5
16298   (eval $ac_link) 2>&5
16299   ac_status=$?
16300   echo "$as_me:16300: \$? = $ac_status" >&5
16301   (exit "$ac_status"); } &&
16302          { ac_try='test -s "conftest$ac_exeext"'
16303   { (eval echo "$as_me:16303: \"$ac_try\"") >&5
16304   (eval $ac_try) 2>&5
16305   ac_status=$?
16306   echo "$as_me:16306: \$? = $ac_status" >&5
16307   (exit "$ac_status"); }; }; then
16308   ac_cv_func_gettimeofday=yes
16309 else
16310   echo "$as_me: failed program was:" >&5
16311 cat "conftest.$ac_ext" >&5
16312 ac_cv_func_gettimeofday=no
16313 fi
16314 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16315 fi
16316 echo "$as_me:16316: result: $ac_cv_func_gettimeofday" >&5
16317 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16318 if test "$ac_cv_func_gettimeofday" = yes; then
16319   cat >>confdefs.h <<\EOF
16320 #define HAVE_GETTIMEOFDAY 1
16321 EOF
16322
16323 else
16324
16325 echo "$as_me:16325: checking for gettimeofday in -lbsd" >&5
16326 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16327 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16328   echo $ECHO_N "(cached) $ECHO_C" >&6
16329 else
16330   ac_check_lib_save_LIBS=$LIBS
16331 LIBS="-lbsd  $LIBS"
16332 cat >"conftest.$ac_ext" <<_ACEOF
16333 #line 16333 "configure"
16334 #include "confdefs.h"
16335
16336 /* Override any gcc2 internal prototype to avoid an error.  */
16337 #ifdef __cplusplus
16338 extern "C"
16339 #endif
16340 /* We use char because int might match the return type of a gcc2
16341    builtin and then its argument prototype would still apply.  */
16342 char gettimeofday ();
16343 int
16344 main (void)
16345 {
16346 gettimeofday ();
16347   ;
16348   return 0;
16349 }
16350 _ACEOF
16351 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16352 if { (eval echo "$as_me:16352: \"$ac_link\"") >&5
16353   (eval $ac_link) 2>&5
16354   ac_status=$?
16355   echo "$as_me:16355: \$? = $ac_status" >&5
16356   (exit "$ac_status"); } &&
16357          { ac_try='test -s "conftest$ac_exeext"'
16358   { (eval echo "$as_me:16358: \"$ac_try\"") >&5
16359   (eval $ac_try) 2>&5
16360   ac_status=$?
16361   echo "$as_me:16361: \$? = $ac_status" >&5
16362   (exit "$ac_status"); }; }; then
16363   ac_cv_lib_bsd_gettimeofday=yes
16364 else
16365   echo "$as_me: failed program was:" >&5
16366 cat "conftest.$ac_ext" >&5
16367 ac_cv_lib_bsd_gettimeofday=no
16368 fi
16369 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16370 LIBS=$ac_check_lib_save_LIBS
16371 fi
16372 echo "$as_me:16372: result: $ac_cv_lib_bsd_gettimeofday" >&5
16373 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16374 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16375
16376 cat >>confdefs.h <<\EOF
16377 #define HAVE_GETTIMEOFDAY 1
16378 EOF
16379
16380         LIBS="$LIBS -lbsd"
16381 fi
16382
16383 fi
16384         ;;
16385 esac
16386
16387 ###     Checks for header files.
16388 echo "$as_me:16388: checking for ANSI C header files" >&5
16389 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16390 if test "${ac_cv_header_stdc+set}" = set; then
16391   echo $ECHO_N "(cached) $ECHO_C" >&6
16392 else
16393   cat >"conftest.$ac_ext" <<_ACEOF
16394 #line 16394 "configure"
16395 #include "confdefs.h"
16396 #include <stdlib.h>
16397 #include <stdarg.h>
16398 #include <string.h>
16399 #include <float.h>
16400
16401 _ACEOF
16402 if { (eval echo "$as_me:16402: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16403   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16404   ac_status=$?
16405   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16406   rm -f conftest.er1
16407   cat conftest.err >&5
16408   echo "$as_me:16408: \$? = $ac_status" >&5
16409   (exit "$ac_status"); } >/dev/null; then
16410   if test -s conftest.err; then
16411     ac_cpp_err=$ac_c_preproc_warn_flag
16412   else
16413     ac_cpp_err=
16414   fi
16415 else
16416   ac_cpp_err=yes
16417 fi
16418 if test -z "$ac_cpp_err"; then
16419   ac_cv_header_stdc=yes
16420 else
16421   echo "$as_me: failed program was:" >&5
16422   cat "conftest.$ac_ext" >&5
16423   ac_cv_header_stdc=no
16424 fi
16425 rm -f conftest.err "conftest.$ac_ext"
16426
16427 if test $ac_cv_header_stdc = yes; then
16428   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16429   cat >"conftest.$ac_ext" <<_ACEOF
16430 #line 16430 "configure"
16431 #include "confdefs.h"
16432 #include <string.h>
16433
16434 _ACEOF
16435 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16436   $EGREP "memchr" >/dev/null 2>&1; then
16437   :
16438 else
16439   ac_cv_header_stdc=no
16440 fi
16441 rm -rf conftest*
16442
16443 fi
16444
16445 if test $ac_cv_header_stdc = yes; then
16446   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16447   cat >"conftest.$ac_ext" <<_ACEOF
16448 #line 16448 "configure"
16449 #include "confdefs.h"
16450 #include <stdlib.h>
16451
16452 _ACEOF
16453 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16454   $EGREP "free" >/dev/null 2>&1; then
16455   :
16456 else
16457   ac_cv_header_stdc=no
16458 fi
16459 rm -rf conftest*
16460
16461 fi
16462
16463 if test $ac_cv_header_stdc = yes; then
16464   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16465   if test "$cross_compiling" = yes; then
16466   :
16467 else
16468   cat >"conftest.$ac_ext" <<_ACEOF
16469 #line 16469 "configure"
16470 #include "confdefs.h"
16471 #include <ctype.h>
16472 #if ((' ' & 0x0FF) == 0x020)
16473 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16474 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16475 #else
16476 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16477                      || ('j' <= (c) && (c) <= 'r') \
16478                      || ('s' <= (c) && (c) <= 'z'))
16479 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16480 #endif
16481
16482 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16483 int
16484 main (void)
16485 {
16486   int i;
16487   for (i = 0; i < 256; i++)
16488     if (XOR (islower (i), ISLOWER (i))
16489         || toupper (i) != TOUPPER (i))
16490       $ac_main_return(2);
16491   $ac_main_return (0);
16492 }
16493 _ACEOF
16494 rm -f "conftest$ac_exeext"
16495 if { (eval echo "$as_me:16495: \"$ac_link\"") >&5
16496   (eval $ac_link) 2>&5
16497   ac_status=$?
16498   echo "$as_me:16498: \$? = $ac_status" >&5
16499   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16500   { (eval echo "$as_me:16500: \"$ac_try\"") >&5
16501   (eval $ac_try) 2>&5
16502   ac_status=$?
16503   echo "$as_me:16503: \$? = $ac_status" >&5
16504   (exit "$ac_status"); }; }; then
16505   :
16506 else
16507   echo "$as_me: program exited with status $ac_status" >&5
16508 echo "$as_me: failed program was:" >&5
16509 cat "conftest.$ac_ext" >&5
16510 ac_cv_header_stdc=no
16511 fi
16512 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16513 fi
16514 fi
16515 fi
16516 echo "$as_me:16516: result: $ac_cv_header_stdc" >&5
16517 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16518 if test $ac_cv_header_stdc = yes; then
16519
16520 cat >>confdefs.h <<\EOF
16521 #define STDC_HEADERS 1
16522 EOF
16523
16524 fi
16525
16526 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16527
16528 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16529                   inttypes.h stdint.h unistd.h
16530 do
16531 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16532 echo "$as_me:16532: checking for $ac_header" >&5
16533 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16534 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16535   echo $ECHO_N "(cached) $ECHO_C" >&6
16536 else
16537   cat >"conftest.$ac_ext" <<_ACEOF
16538 #line 16538 "configure"
16539 #include "confdefs.h"
16540 $ac_includes_default
16541 #include <$ac_header>
16542 _ACEOF
16543 rm -f "conftest.$ac_objext"
16544 if { (eval echo "$as_me:16544: \"$ac_compile\"") >&5
16545   (eval $ac_compile) 2>&5
16546   ac_status=$?
16547   echo "$as_me:16547: \$? = $ac_status" >&5
16548   (exit "$ac_status"); } &&
16549          { ac_try='test -s "conftest.$ac_objext"'
16550   { (eval echo "$as_me:16550: \"$ac_try\"") >&5
16551   (eval $ac_try) 2>&5
16552   ac_status=$?
16553   echo "$as_me:16553: \$? = $ac_status" >&5
16554   (exit "$ac_status"); }; }; then
16555   eval "$as_ac_Header=yes"
16556 else
16557   echo "$as_me: failed program was:" >&5
16558 cat "conftest.$ac_ext" >&5
16559 eval "$as_ac_Header=no"
16560 fi
16561 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16562 fi
16563 echo "$as_me:16563: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16564 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16565 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16566   cat >>confdefs.h <<EOF
16567 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16568 EOF
16569
16570 fi
16571 done
16572
16573 echo "$as_me:16573: checking for signed char" >&5
16574 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16575 if test "${ac_cv_type_signed_char+set}" = set; then
16576   echo $ECHO_N "(cached) $ECHO_C" >&6
16577 else
16578   cat >"conftest.$ac_ext" <<_ACEOF
16579 #line 16579 "configure"
16580 #include "confdefs.h"
16581 $ac_includes_default
16582 int
16583 main (void)
16584 {
16585 if ((signed char *) 0)
16586   return 0;
16587 if (sizeof (signed char))
16588   return 0;
16589   ;
16590   return 0;
16591 }
16592 _ACEOF
16593 rm -f "conftest.$ac_objext"
16594 if { (eval echo "$as_me:16594: \"$ac_compile\"") >&5
16595   (eval $ac_compile) 2>&5
16596   ac_status=$?
16597   echo "$as_me:16597: \$? = $ac_status" >&5
16598   (exit "$ac_status"); } &&
16599          { ac_try='test -s "conftest.$ac_objext"'
16600   { (eval echo "$as_me:16600: \"$ac_try\"") >&5
16601   (eval $ac_try) 2>&5
16602   ac_status=$?
16603   echo "$as_me:16603: \$? = $ac_status" >&5
16604   (exit "$ac_status"); }; }; then
16605   ac_cv_type_signed_char=yes
16606 else
16607   echo "$as_me: failed program was:" >&5
16608 cat "conftest.$ac_ext" >&5
16609 ac_cv_type_signed_char=no
16610 fi
16611 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16612 fi
16613 echo "$as_me:16613: result: $ac_cv_type_signed_char" >&5
16614 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16615
16616 echo "$as_me:16616: checking size of signed char" >&5
16617 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16618 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16619   echo $ECHO_N "(cached) $ECHO_C" >&6
16620 else
16621   if test "$ac_cv_type_signed_char" = yes; then
16622   if test "$cross_compiling" = yes; then
16623   # Depending upon the size, compute the lo and hi bounds.
16624 cat >"conftest.$ac_ext" <<_ACEOF
16625 #line 16625 "configure"
16626 #include "confdefs.h"
16627 $ac_includes_default
16628 int
16629 main (void)
16630 {
16631 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16632   ;
16633   return 0;
16634 }
16635 _ACEOF
16636 rm -f "conftest.$ac_objext"
16637 if { (eval echo "$as_me:16637: \"$ac_compile\"") >&5
16638   (eval $ac_compile) 2>&5
16639   ac_status=$?
16640   echo "$as_me:16640: \$? = $ac_status" >&5
16641   (exit "$ac_status"); } &&
16642          { ac_try='test -s "conftest.$ac_objext"'
16643   { (eval echo "$as_me:16643: \"$ac_try\"") >&5
16644   (eval $ac_try) 2>&5
16645   ac_status=$?
16646   echo "$as_me:16646: \$? = $ac_status" >&5
16647   (exit "$ac_status"); }; }; then
16648   ac_lo=0 ac_mid=0
16649   while :; do
16650     cat >"conftest.$ac_ext" <<_ACEOF
16651 #line 16651 "configure"
16652 #include "confdefs.h"
16653 $ac_includes_default
16654 int
16655 main (void)
16656 {
16657 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16658   ;
16659   return 0;
16660 }
16661 _ACEOF
16662 rm -f "conftest.$ac_objext"
16663 if { (eval echo "$as_me:16663: \"$ac_compile\"") >&5
16664   (eval $ac_compile) 2>&5
16665   ac_status=$?
16666   echo "$as_me:16666: \$? = $ac_status" >&5
16667   (exit "$ac_status"); } &&
16668          { ac_try='test -s "conftest.$ac_objext"'
16669   { (eval echo "$as_me:16669: \"$ac_try\"") >&5
16670   (eval $ac_try) 2>&5
16671   ac_status=$?
16672   echo "$as_me:16672: \$? = $ac_status" >&5
16673   (exit "$ac_status"); }; }; then
16674   ac_hi=$ac_mid; break
16675 else
16676   echo "$as_me: failed program was:" >&5
16677 cat "conftest.$ac_ext" >&5
16678 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16679 fi
16680 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16681   done
16682 else
16683   echo "$as_me: failed program was:" >&5
16684 cat "conftest.$ac_ext" >&5
16685 ac_hi=-1 ac_mid=-1
16686   while :; do
16687     cat >"conftest.$ac_ext" <<_ACEOF
16688 #line 16688 "configure"
16689 #include "confdefs.h"
16690 $ac_includes_default
16691 int
16692 main (void)
16693 {
16694 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16695   ;
16696   return 0;
16697 }
16698 _ACEOF
16699 rm -f "conftest.$ac_objext"
16700 if { (eval echo "$as_me:16700: \"$ac_compile\"") >&5
16701   (eval $ac_compile) 2>&5
16702   ac_status=$?
16703   echo "$as_me:16703: \$? = $ac_status" >&5
16704   (exit "$ac_status"); } &&
16705          { ac_try='test -s "conftest.$ac_objext"'
16706   { (eval echo "$as_me:16706: \"$ac_try\"") >&5
16707   (eval $ac_try) 2>&5
16708   ac_status=$?
16709   echo "$as_me:16709: \$? = $ac_status" >&5
16710   (exit "$ac_status"); }; }; then
16711   ac_lo=$ac_mid; break
16712 else
16713   echo "$as_me: failed program was:" >&5
16714 cat "conftest.$ac_ext" >&5
16715 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16716 fi
16717 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16718   done
16719 fi
16720 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16721 # Binary search between lo and hi bounds.
16722 while test "x$ac_lo" != "x$ac_hi"; do
16723   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16724   cat >"conftest.$ac_ext" <<_ACEOF
16725 #line 16725 "configure"
16726 #include "confdefs.h"
16727 $ac_includes_default
16728 int
16729 main (void)
16730 {
16731 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16732   ;
16733   return 0;
16734 }
16735 _ACEOF
16736 rm -f "conftest.$ac_objext"
16737 if { (eval echo "$as_me:16737: \"$ac_compile\"") >&5
16738   (eval $ac_compile) 2>&5
16739   ac_status=$?
16740   echo "$as_me:16740: \$? = $ac_status" >&5
16741   (exit "$ac_status"); } &&
16742          { ac_try='test -s "conftest.$ac_objext"'
16743   { (eval echo "$as_me:16743: \"$ac_try\"") >&5
16744   (eval $ac_try) 2>&5
16745   ac_status=$?
16746   echo "$as_me:16746: \$? = $ac_status" >&5
16747   (exit "$ac_status"); }; }; then
16748   ac_hi=$ac_mid
16749 else
16750   echo "$as_me: failed program was:" >&5
16751 cat "conftest.$ac_ext" >&5
16752 ac_lo=`expr "$ac_mid" + 1`
16753 fi
16754 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16755 done
16756 ac_cv_sizeof_signed_char=$ac_lo
16757 else
16758   if test "$cross_compiling" = yes; then
16759   { { echo "$as_me:16759: error: cannot run test program while cross compiling" >&5
16760 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16761    { (exit 1); exit 1; }; }
16762 else
16763   cat >"conftest.$ac_ext" <<_ACEOF
16764 #line 16764 "configure"
16765 #include "confdefs.h"
16766 $ac_includes_default
16767 int
16768 main (void)
16769 {
16770 FILE *f = fopen ("conftest.val", "w");
16771 if (!f)
16772   $ac_main_return (1);
16773 fprintf (f, "%ld", (long)(sizeof (signed char)));
16774 fclose (f);
16775   ;
16776   return 0;
16777 }
16778 _ACEOF
16779 rm -f "conftest$ac_exeext"
16780 if { (eval echo "$as_me:16780: \"$ac_link\"") >&5
16781   (eval $ac_link) 2>&5
16782   ac_status=$?
16783   echo "$as_me:16783: \$? = $ac_status" >&5
16784   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16785   { (eval echo "$as_me:16785: \"$ac_try\"") >&5
16786   (eval $ac_try) 2>&5
16787   ac_status=$?
16788   echo "$as_me:16788: \$? = $ac_status" >&5
16789   (exit "$ac_status"); }; }; then
16790   ac_cv_sizeof_signed_char=`cat conftest.val`
16791 else
16792   echo "$as_me: program exited with status $ac_status" >&5
16793 echo "$as_me: failed program was:" >&5
16794 cat "conftest.$ac_ext" >&5
16795 fi
16796 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16797 fi
16798 fi
16799 rm -f conftest.val
16800 else
16801   ac_cv_sizeof_signed_char=0
16802 fi
16803 fi
16804 echo "$as_me:16804: result: $ac_cv_sizeof_signed_char" >&5
16805 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16806 cat >>confdefs.h <<EOF
16807 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16808 EOF
16809
16810 echo "$as_me:16810: checking for ANSI C header files" >&5
16811 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16812 if test "${ac_cv_header_stdc+set}" = set; then
16813   echo $ECHO_N "(cached) $ECHO_C" >&6
16814 else
16815   cat >"conftest.$ac_ext" <<_ACEOF
16816 #line 16816 "configure"
16817 #include "confdefs.h"
16818 #include <stdlib.h>
16819 #include <stdarg.h>
16820 #include <string.h>
16821 #include <float.h>
16822
16823 _ACEOF
16824 if { (eval echo "$as_me:16824: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16825   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16826   ac_status=$?
16827   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16828   rm -f conftest.er1
16829   cat conftest.err >&5
16830   echo "$as_me:16830: \$? = $ac_status" >&5
16831   (exit "$ac_status"); } >/dev/null; then
16832   if test -s conftest.err; then
16833     ac_cpp_err=$ac_c_preproc_warn_flag
16834   else
16835     ac_cpp_err=
16836   fi
16837 else
16838   ac_cpp_err=yes
16839 fi
16840 if test -z "$ac_cpp_err"; then
16841   ac_cv_header_stdc=yes
16842 else
16843   echo "$as_me: failed program was:" >&5
16844   cat "conftest.$ac_ext" >&5
16845   ac_cv_header_stdc=no
16846 fi
16847 rm -f conftest.err "conftest.$ac_ext"
16848
16849 if test $ac_cv_header_stdc = yes; then
16850   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16851   cat >"conftest.$ac_ext" <<_ACEOF
16852 #line 16852 "configure"
16853 #include "confdefs.h"
16854 #include <string.h>
16855
16856 _ACEOF
16857 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16858   $EGREP "memchr" >/dev/null 2>&1; then
16859   :
16860 else
16861   ac_cv_header_stdc=no
16862 fi
16863 rm -rf conftest*
16864
16865 fi
16866
16867 if test $ac_cv_header_stdc = yes; then
16868   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16869   cat >"conftest.$ac_ext" <<_ACEOF
16870 #line 16870 "configure"
16871 #include "confdefs.h"
16872 #include <stdlib.h>
16873
16874 _ACEOF
16875 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16876   $EGREP "free" >/dev/null 2>&1; then
16877   :
16878 else
16879   ac_cv_header_stdc=no
16880 fi
16881 rm -rf conftest*
16882
16883 fi
16884
16885 if test $ac_cv_header_stdc = yes; then
16886   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16887   if test "$cross_compiling" = yes; then
16888   :
16889 else
16890   cat >"conftest.$ac_ext" <<_ACEOF
16891 #line 16891 "configure"
16892 #include "confdefs.h"
16893 #include <ctype.h>
16894 #if ((' ' & 0x0FF) == 0x020)
16895 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16896 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16897 #else
16898 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16899                      || ('j' <= (c) && (c) <= 'r') \
16900                      || ('s' <= (c) && (c) <= 'z'))
16901 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16902 #endif
16903
16904 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16905 int
16906 main (void)
16907 {
16908   int i;
16909   for (i = 0; i < 256; i++)
16910     if (XOR (islower (i), ISLOWER (i))
16911         || toupper (i) != TOUPPER (i))
16912       $ac_main_return(2);
16913   $ac_main_return (0);
16914 }
16915 _ACEOF
16916 rm -f "conftest$ac_exeext"
16917 if { (eval echo "$as_me:16917: \"$ac_link\"") >&5
16918   (eval $ac_link) 2>&5
16919   ac_status=$?
16920   echo "$as_me:16920: \$? = $ac_status" >&5
16921   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16922   { (eval echo "$as_me:16922: \"$ac_try\"") >&5
16923   (eval $ac_try) 2>&5
16924   ac_status=$?
16925   echo "$as_me:16925: \$? = $ac_status" >&5
16926   (exit "$ac_status"); }; }; then
16927   :
16928 else
16929   echo "$as_me: program exited with status $ac_status" >&5
16930 echo "$as_me: failed program was:" >&5
16931 cat "conftest.$ac_ext" >&5
16932 ac_cv_header_stdc=no
16933 fi
16934 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16935 fi
16936 fi
16937 fi
16938 echo "$as_me:16938: result: $ac_cv_header_stdc" >&5
16939 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16940 if test $ac_cv_header_stdc = yes; then
16941
16942 cat >>confdefs.h <<\EOF
16943 #define STDC_HEADERS 1
16944 EOF
16945
16946 fi
16947
16948 ac_header_dirent=no
16949 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16950   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16951 echo "$as_me:16951: checking for $ac_hdr that defines DIR" >&5
16952 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16953 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16954   echo $ECHO_N "(cached) $ECHO_C" >&6
16955 else
16956   cat >"conftest.$ac_ext" <<_ACEOF
16957 #line 16957 "configure"
16958 #include "confdefs.h"
16959 #include <sys/types.h>
16960 #include <$ac_hdr>
16961
16962 int
16963 main (void)
16964 {
16965 if ((DIR *) 0)
16966 return 0;
16967   ;
16968   return 0;
16969 }
16970 _ACEOF
16971 rm -f "conftest.$ac_objext"
16972 if { (eval echo "$as_me:16972: \"$ac_compile\"") >&5
16973   (eval $ac_compile) 2>&5
16974   ac_status=$?
16975   echo "$as_me:16975: \$? = $ac_status" >&5
16976   (exit "$ac_status"); } &&
16977          { ac_try='test -s "conftest.$ac_objext"'
16978   { (eval echo "$as_me:16978: \"$ac_try\"") >&5
16979   (eval $ac_try) 2>&5
16980   ac_status=$?
16981   echo "$as_me:16981: \$? = $ac_status" >&5
16982   (exit "$ac_status"); }; }; then
16983   eval "$as_ac_Header=yes"
16984 else
16985   echo "$as_me: failed program was:" >&5
16986 cat "conftest.$ac_ext" >&5
16987 eval "$as_ac_Header=no"
16988 fi
16989 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16990 fi
16991 echo "$as_me:16991: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16992 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16993 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16994   cat >>confdefs.h <<EOF
16995 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16996 EOF
16997
16998 ac_header_dirent=$ac_hdr; break
16999 fi
17000
17001 done
17002 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
17003 if test $ac_header_dirent = dirent.h; then
17004   echo "$as_me:17004: checking for opendir in -ldir" >&5
17005 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
17006 if test "${ac_cv_lib_dir_opendir+set}" = set; then
17007   echo $ECHO_N "(cached) $ECHO_C" >&6
17008 else
17009   ac_check_lib_save_LIBS=$LIBS
17010 LIBS="-ldir  $LIBS"
17011 cat >"conftest.$ac_ext" <<_ACEOF
17012 #line 17012 "configure"
17013 #include "confdefs.h"
17014
17015 /* Override any gcc2 internal prototype to avoid an error.  */
17016 #ifdef __cplusplus
17017 extern "C"
17018 #endif
17019 /* We use char because int might match the return type of a gcc2
17020    builtin and then its argument prototype would still apply.  */
17021 char opendir ();
17022 int
17023 main (void)
17024 {
17025 opendir ();
17026   ;
17027   return 0;
17028 }
17029 _ACEOF
17030 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17031 if { (eval echo "$as_me:17031: \"$ac_link\"") >&5
17032   (eval $ac_link) 2>&5
17033   ac_status=$?
17034   echo "$as_me:17034: \$? = $ac_status" >&5
17035   (exit "$ac_status"); } &&
17036          { ac_try='test -s "conftest$ac_exeext"'
17037   { (eval echo "$as_me:17037: \"$ac_try\"") >&5
17038   (eval $ac_try) 2>&5
17039   ac_status=$?
17040   echo "$as_me:17040: \$? = $ac_status" >&5
17041   (exit "$ac_status"); }; }; then
17042   ac_cv_lib_dir_opendir=yes
17043 else
17044   echo "$as_me: failed program was:" >&5
17045 cat "conftest.$ac_ext" >&5
17046 ac_cv_lib_dir_opendir=no
17047 fi
17048 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17049 LIBS=$ac_check_lib_save_LIBS
17050 fi
17051 echo "$as_me:17051: result: $ac_cv_lib_dir_opendir" >&5
17052 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17053 if test "$ac_cv_lib_dir_opendir" = yes; then
17054   LIBS="$LIBS -ldir"
17055 fi
17056
17057 else
17058   echo "$as_me:17058: checking for opendir in -lx" >&5
17059 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17060 if test "${ac_cv_lib_x_opendir+set}" = set; then
17061   echo $ECHO_N "(cached) $ECHO_C" >&6
17062 else
17063   ac_check_lib_save_LIBS=$LIBS
17064 LIBS="-lx  $LIBS"
17065 cat >"conftest.$ac_ext" <<_ACEOF
17066 #line 17066 "configure"
17067 #include "confdefs.h"
17068
17069 /* Override any gcc2 internal prototype to avoid an error.  */
17070 #ifdef __cplusplus
17071 extern "C"
17072 #endif
17073 /* We use char because int might match the return type of a gcc2
17074    builtin and then its argument prototype would still apply.  */
17075 char opendir ();
17076 int
17077 main (void)
17078 {
17079 opendir ();
17080   ;
17081   return 0;
17082 }
17083 _ACEOF
17084 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17085 if { (eval echo "$as_me:17085: \"$ac_link\"") >&5
17086   (eval $ac_link) 2>&5
17087   ac_status=$?
17088   echo "$as_me:17088: \$? = $ac_status" >&5
17089   (exit "$ac_status"); } &&
17090          { ac_try='test -s "conftest$ac_exeext"'
17091   { (eval echo "$as_me:17091: \"$ac_try\"") >&5
17092   (eval $ac_try) 2>&5
17093   ac_status=$?
17094   echo "$as_me:17094: \$? = $ac_status" >&5
17095   (exit "$ac_status"); }; }; then
17096   ac_cv_lib_x_opendir=yes
17097 else
17098   echo "$as_me: failed program was:" >&5
17099 cat "conftest.$ac_ext" >&5
17100 ac_cv_lib_x_opendir=no
17101 fi
17102 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17103 LIBS=$ac_check_lib_save_LIBS
17104 fi
17105 echo "$as_me:17105: result: $ac_cv_lib_x_opendir" >&5
17106 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17107 if test "$ac_cv_lib_x_opendir" = yes; then
17108   LIBS="$LIBS -lx"
17109 fi
17110
17111 fi
17112
17113 echo "$as_me:17113: checking whether time.h and sys/time.h may both be included" >&5
17114 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17115 if test "${ac_cv_header_time+set}" = set; then
17116   echo $ECHO_N "(cached) $ECHO_C" >&6
17117 else
17118   cat >"conftest.$ac_ext" <<_ACEOF
17119 #line 17119 "configure"
17120 #include "confdefs.h"
17121 #include <sys/types.h>
17122 #include <sys/time.h>
17123 #include <time.h>
17124
17125 int
17126 main (void)
17127 {
17128 if ((struct tm *) 0)
17129 return 0;
17130   ;
17131   return 0;
17132 }
17133 _ACEOF
17134 rm -f "conftest.$ac_objext"
17135 if { (eval echo "$as_me:17135: \"$ac_compile\"") >&5
17136   (eval $ac_compile) 2>&5
17137   ac_status=$?
17138   echo "$as_me:17138: \$? = $ac_status" >&5
17139   (exit "$ac_status"); } &&
17140          { ac_try='test -s "conftest.$ac_objext"'
17141   { (eval echo "$as_me:17141: \"$ac_try\"") >&5
17142   (eval $ac_try) 2>&5
17143   ac_status=$?
17144   echo "$as_me:17144: \$? = $ac_status" >&5
17145   (exit "$ac_status"); }; }; then
17146   ac_cv_header_time=yes
17147 else
17148   echo "$as_me: failed program was:" >&5
17149 cat "conftest.$ac_ext" >&5
17150 ac_cv_header_time=no
17151 fi
17152 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17153 fi
17154 echo "$as_me:17154: result: $ac_cv_header_time" >&5
17155 echo "${ECHO_T}$ac_cv_header_time" >&6
17156 if test $ac_cv_header_time = yes; then
17157
17158 cat >>confdefs.h <<\EOF
17159 #define TIME_WITH_SYS_TIME 1
17160 EOF
17161
17162 fi
17163
17164 ###     checks for compiler characteristics
17165 ac_ext=c
17166 ac_cpp='$CPP $CPPFLAGS'
17167 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17168 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17169 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17170 ac_main_return="return"
17171
17172 echo "$as_me:17172: checking for an ANSI C-conforming const" >&5
17173 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17174 if test "${ac_cv_c_const+set}" = set; then
17175   echo $ECHO_N "(cached) $ECHO_C" >&6
17176 else
17177   cat >"conftest.$ac_ext" <<_ACEOF
17178 #line 17178 "configure"
17179 #include "confdefs.h"
17180
17181 int
17182 main (void)
17183 {
17184 /* FIXME: Include the comments suggested by Paul. */
17185 #ifndef __cplusplus
17186   /* Ultrix mips cc rejects this.  */
17187   typedef int charset[2];
17188   const charset x;
17189   /* SunOS 4.1.1 cc rejects this.  */
17190   char const *const *ccp;
17191   char **p;
17192   /* NEC SVR4.0.2 mips cc rejects this.  */
17193   struct point {int x, y;};
17194   static struct point const zero = {0,0};
17195   /* AIX XL C 1.02.0.0 rejects this.
17196      It does not let you subtract one const X* pointer from another in
17197      an arm of an if-expression whose if-part is not a constant
17198      expression */
17199   const char *g = "string";
17200   ccp = &g + (g ? g-g : 0);
17201   /* HPUX 7.0 cc rejects these. */
17202   ++ccp;
17203   p = (char**) ccp;
17204   ccp = (char const *const *) p;
17205   { /* SCO 3.2v4 cc rejects this.  */
17206     char *t;
17207     char const *s = 0 ? (char *) 0 : (char const *) 0;
17208
17209     *t++ = 0;
17210   }
17211   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17212     int x[] = {25, 17};
17213     const int *foo = &x[0];
17214     ++foo;
17215   }
17216   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17217     typedef const int *iptr;
17218     iptr p = 0;
17219     ++p;
17220   }
17221   { /* AIX XL C 1.02.0.0 rejects this saying
17222        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17223     struct s { int j; const int *ap[3]; };
17224     struct s *b; b->j = 5;
17225   }
17226   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17227     const int foo = 10;
17228   }
17229 #endif
17230
17231   ;
17232   return 0;
17233 }
17234 _ACEOF
17235 rm -f "conftest.$ac_objext"
17236 if { (eval echo "$as_me:17236: \"$ac_compile\"") >&5
17237   (eval $ac_compile) 2>&5
17238   ac_status=$?
17239   echo "$as_me:17239: \$? = $ac_status" >&5
17240   (exit "$ac_status"); } &&
17241          { ac_try='test -s "conftest.$ac_objext"'
17242   { (eval echo "$as_me:17242: \"$ac_try\"") >&5
17243   (eval $ac_try) 2>&5
17244   ac_status=$?
17245   echo "$as_me:17245: \$? = $ac_status" >&5
17246   (exit "$ac_status"); }; }; then
17247   ac_cv_c_const=yes
17248 else
17249   echo "$as_me: failed program was:" >&5
17250 cat "conftest.$ac_ext" >&5
17251 ac_cv_c_const=no
17252 fi
17253 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17254 fi
17255 echo "$as_me:17255: result: $ac_cv_c_const" >&5
17256 echo "${ECHO_T}$ac_cv_c_const" >&6
17257 if test $ac_cv_c_const = no; then
17258
17259 cat >>confdefs.h <<\EOF
17260 #define const
17261 EOF
17262
17263 fi
17264
17265 ###     Checks for external-data
17266
17267 echo "$as_me:17267: checking if data-only library module links" >&5
17268 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17269 if test "${cf_cv_link_dataonly+set}" = set; then
17270   echo $ECHO_N "(cached) $ECHO_C" >&6
17271 else
17272
17273         rm -f conftest.a
17274         cat >conftest.$ac_ext <<EOF
17275 #line 17275 "configure"
17276 int     testdata[3] = { 123, 456, 789 };
17277 EOF
17278         if { (eval echo "$as_me:17278: \"$ac_compile\"") >&5
17279   (eval $ac_compile) 2>&5
17280   ac_status=$?
17281   echo "$as_me:17281: \$? = $ac_status" >&5
17282   (exit "$ac_status"); } ; then
17283                 mv conftest.o data.o && \
17284                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17285         fi
17286         rm -f conftest.$ac_ext data.o
17287         cat >conftest.$ac_ext <<EOF
17288 #line 17288 "configure"
17289 int     testfunc(void)
17290 {
17291 #if defined(NeXT)
17292         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17293 #else
17294         extern int testdata[3];
17295         return testdata[0] == 123
17296            &&  testdata[1] == 456
17297            &&  testdata[2] == 789;
17298 #endif
17299 }
17300 EOF
17301         if { (eval echo "$as_me:17301: \"$ac_compile\"") >&5
17302   (eval $ac_compile) 2>&5
17303   ac_status=$?
17304   echo "$as_me:17304: \$? = $ac_status" >&5
17305   (exit "$ac_status"); }; then
17306                 mv conftest.o func.o && \
17307                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17308         fi
17309         rm -f conftest.$ac_ext func.o
17310         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17311         cf_saveLIBS="$LIBS"
17312         LIBS="conftest.a $LIBS"
17313         if test "$cross_compiling" = yes; then
17314   cf_cv_link_dataonly=unknown
17315 else
17316   cat >"conftest.$ac_ext" <<_ACEOF
17317 #line 17317 "configure"
17318 #include "confdefs.h"
17319
17320         int main(void)
17321         {
17322                 extern int testfunc();
17323                 ${cf_cv_main_return:-return} (!testfunc());
17324         }
17325
17326 _ACEOF
17327 rm -f "conftest$ac_exeext"
17328 if { (eval echo "$as_me:17328: \"$ac_link\"") >&5
17329   (eval $ac_link) 2>&5
17330   ac_status=$?
17331   echo "$as_me:17331: \$? = $ac_status" >&5
17332   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17333   { (eval echo "$as_me:17333: \"$ac_try\"") >&5
17334   (eval $ac_try) 2>&5
17335   ac_status=$?
17336   echo "$as_me:17336: \$? = $ac_status" >&5
17337   (exit "$ac_status"); }; }; then
17338   cf_cv_link_dataonly=yes
17339 else
17340   echo "$as_me: program exited with status $ac_status" >&5
17341 echo "$as_me: failed program was:" >&5
17342 cat "conftest.$ac_ext" >&5
17343 cf_cv_link_dataonly=no
17344 fi
17345 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17346 fi
17347         LIBS="$cf_saveLIBS"
17348
17349 fi
17350
17351 echo "$as_me:17351: result: $cf_cv_link_dataonly" >&5
17352 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17353
17354 if test "$cf_cv_link_dataonly" = no ; then
17355
17356 cat >>confdefs.h <<\EOF
17357 #define BROKEN_LINKER 1
17358 EOF
17359
17360         BROKEN_LINKER=1
17361 fi
17362
17363 ###     Checks for library functions.
17364
17365 for ac_header in \
17366 unistd.h \
17367
17368 do
17369 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17370 echo "$as_me:17370: checking for $ac_header" >&5
17371 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17372 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17373   echo $ECHO_N "(cached) $ECHO_C" >&6
17374 else
17375   cat >"conftest.$ac_ext" <<_ACEOF
17376 #line 17376 "configure"
17377 #include "confdefs.h"
17378 #include <$ac_header>
17379 _ACEOF
17380 if { (eval echo "$as_me:17380: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17381   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17382   ac_status=$?
17383   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17384   rm -f conftest.er1
17385   cat conftest.err >&5
17386   echo "$as_me:17386: \$? = $ac_status" >&5
17387   (exit "$ac_status"); } >/dev/null; then
17388   if test -s conftest.err; then
17389     ac_cpp_err=$ac_c_preproc_warn_flag
17390   else
17391     ac_cpp_err=
17392   fi
17393 else
17394   ac_cpp_err=yes
17395 fi
17396 if test -z "$ac_cpp_err"; then
17397   eval "$as_ac_Header=yes"
17398 else
17399   echo "$as_me: failed program was:" >&5
17400   cat "conftest.$ac_ext" >&5
17401   eval "$as_ac_Header=no"
17402 fi
17403 rm -f conftest.err "conftest.$ac_ext"
17404 fi
17405 echo "$as_me:17405: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17406 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17407 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17408   cat >>confdefs.h <<EOF
17409 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17410 EOF
17411
17412 fi
17413 done
17414
17415 echo "$as_me:17415: checking for working mkstemp" >&5
17416 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17417 if test "${cf_cv_func_mkstemp+set}" = set; then
17418   echo $ECHO_N "(cached) $ECHO_C" >&6
17419 else
17420
17421 rm -rf ./conftest*
17422 if test "$cross_compiling" = yes; then
17423   cf_cv_func_mkstemp=maybe
17424 else
17425   cat >"conftest.$ac_ext" <<_ACEOF
17426 #line 17426 "configure"
17427 #include "confdefs.h"
17428
17429 $ac_includes_default
17430
17431 int main(void)
17432 {
17433         char *tmpl = "conftestXXXXXX";
17434         char name[2][80];
17435         int n;
17436         int result = 0;
17437         int fd;
17438         struct stat sb;
17439
17440         umask(077);
17441         for (n = 0; n < 2; ++n) {
17442                 strcpy(name[n], tmpl);
17443                 if ((fd = mkstemp(name[n])) >= 0) {
17444                         if (!strcmp(name[n], tmpl)
17445                          || stat(name[n], &sb) != 0
17446                          || (sb.st_mode & S_IFMT) != S_IFREG
17447                          || (sb.st_mode & 077) != 0) {
17448                                 result = 1;
17449                         }
17450                         close(fd);
17451                 }
17452         }
17453         if (result == 0
17454          && !strcmp(name[0], name[1]))
17455                 result = 1;
17456         ${cf_cv_main_return:-return}(result);
17457 }
17458
17459 _ACEOF
17460 rm -f "conftest$ac_exeext"
17461 if { (eval echo "$as_me:17461: \"$ac_link\"") >&5
17462   (eval $ac_link) 2>&5
17463   ac_status=$?
17464   echo "$as_me:17464: \$? = $ac_status" >&5
17465   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17466   { (eval echo "$as_me:17466: \"$ac_try\"") >&5
17467   (eval $ac_try) 2>&5
17468   ac_status=$?
17469   echo "$as_me:17469: \$? = $ac_status" >&5
17470   (exit "$ac_status"); }; }; then
17471   cf_cv_func_mkstemp=yes
17472
17473 else
17474   echo "$as_me: program exited with status $ac_status" >&5
17475 echo "$as_me: failed program was:" >&5
17476 cat "conftest.$ac_ext" >&5
17477 cf_cv_func_mkstemp=no
17478
17479 fi
17480 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17481 fi
17482
17483 fi
17484 echo "$as_me:17484: result: $cf_cv_func_mkstemp" >&5
17485 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17486 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17487         echo "$as_me:17487: checking for mkstemp" >&5
17488 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17489 if test "${ac_cv_func_mkstemp+set}" = set; then
17490   echo $ECHO_N "(cached) $ECHO_C" >&6
17491 else
17492   cat >"conftest.$ac_ext" <<_ACEOF
17493 #line 17493 "configure"
17494 #include "confdefs.h"
17495 #define mkstemp autoconf_temporary
17496 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17497 #undef mkstemp
17498
17499 #ifdef __cplusplus
17500 extern "C"
17501 #endif
17502
17503 /* We use char because int might match the return type of a gcc2
17504    builtin and then its argument prototype would still apply.  */
17505 char mkstemp (void);
17506
17507 int
17508 main (void)
17509 {
17510
17511 /* The GNU C library defines stubs for functions which it implements
17512     to always fail with ENOSYS.  Some functions are actually named
17513     something starting with __ and the normal name is an alias.  */
17514 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17515 #error found stub for mkstemp
17516 #endif
17517
17518         return mkstemp ();
17519   ;
17520   return 0;
17521 }
17522 _ACEOF
17523 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17524 if { (eval echo "$as_me:17524: \"$ac_link\"") >&5
17525   (eval $ac_link) 2>&5
17526   ac_status=$?
17527   echo "$as_me:17527: \$? = $ac_status" >&5
17528   (exit "$ac_status"); } &&
17529          { ac_try='test -s "conftest$ac_exeext"'
17530   { (eval echo "$as_me:17530: \"$ac_try\"") >&5
17531   (eval $ac_try) 2>&5
17532   ac_status=$?
17533   echo "$as_me:17533: \$? = $ac_status" >&5
17534   (exit "$ac_status"); }; }; then
17535   ac_cv_func_mkstemp=yes
17536 else
17537   echo "$as_me: failed program was:" >&5
17538 cat "conftest.$ac_ext" >&5
17539 ac_cv_func_mkstemp=no
17540 fi
17541 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17542 fi
17543 echo "$as_me:17543: result: $ac_cv_func_mkstemp" >&5
17544 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17545
17546 fi
17547 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17548
17549 cat >>confdefs.h <<\EOF
17550 #define HAVE_MKSTEMP 1
17551 EOF
17552
17553 fi
17554
17555 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17556         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17557         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17558 fi
17559
17560 cf_with_ada=yes
17561 if test "$cf_with_ada" != "no" ; then
17562
17563 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17564 do
17565
17566 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17567
17568         unset ac_cv_path_cf_TEMP_gnat
17569         unset cf_TEMP_gnat
17570         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17571 set dummy $cf_prog_gnat; ac_word=$2
17572 echo "$as_me:17572: checking for $ac_word" >&5
17573 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17574 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17575   echo $ECHO_N "(cached) $ECHO_C" >&6
17576 else
17577   case $cf_TEMP_gnat in
17578   [\\/]* | ?:[\\/]*)
17579   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17580   ;;
17581   *)
17582   ac_save_IFS=$IFS; IFS=$ac_path_separator
17583 ac_dummy="$PATH"
17584 for ac_dir in $ac_dummy; do
17585   IFS=$ac_save_IFS
17586   test -z "$ac_dir" && ac_dir=.
17587   if $as_executable_p "$ac_dir/$ac_word"; then
17588    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17589    echo "$as_me:17589: found $ac_dir/$ac_word" >&5
17590    break
17591 fi
17592 done
17593
17594   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17595   ;;
17596 esac
17597 fi
17598 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17599
17600 if test -n "$cf_TEMP_gnat"; then
17601   echo "$as_me:17601: result: $cf_TEMP_gnat" >&5
17602 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17603 else
17604   echo "$as_me:17604: result: no" >&5
17605 echo "${ECHO_T}no" >&6
17606 fi
17607
17608         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17609
17610         if test "x$cf_TEMP_gnat" != xno; then
17611                 unset cf_cv_gnat_version
17612                 unset cf_TEMP_gnat
17613
17614 echo "$as_me:17614: checking for $cf_prog_gnat version" >&5
17615 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17616 if test "${cf_cv_gnat_version+set}" = set; then
17617   echo $ECHO_N "(cached) $ECHO_C" >&6
17618 else
17619
17620 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17621         grep '[0-9].[0-9][0-9]*' |\
17622         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17623
17624 fi
17625 echo "$as_me:17625: result: $cf_cv_gnat_version" >&5
17626 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17627 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17628 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17629
17630         fi
17631         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17632
17633         unset cf_TEMP_gnat
17634         unset cf_cv_gnat_version
17635         unset ac_cv_path_cf_TEMP_gnat
17636 done
17637
17638 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17639         cf_ada_make=
17640         cf_cv_prog_gnat_correct=no
17641 else
17642         cf_ada_make=gnatmake
17643         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17644                 # gprconfig is newer than gnatmake; we can continue...
17645                 cf_ada_config="##"
17646         else
17647                 rm -rf ./conftest* ./*~conftest*
17648                 if mkdir conftest.src
17649                 then
17650                         cf_ada_config=""
17651                         cd conftest.src
17652                         for cf_gprconfig in Ada C
17653                         do
17654                                 echo "$as_me:17654: checking for gprconfig name for $cf_gprconfig" >&5
17655 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17656                                 if test "$cf_gprconfig" = C
17657                                 then
17658                                         for cf_gprconfig_param in \
17659                                                 "$cf_gprconfig,,,,GNATGCC" \
17660                                                 "$cf_gprconfig,,,,GCC" \
17661                                                 "$cf_gprconfig"
17662                                         do
17663                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17664                                                 test -n "$cf_gprconfig_value" && break
17665                                         done
17666                                 else
17667                                         cf_gprconfig_param=$cf_gprconfig
17668                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17669                                 fi
17670                                 if test -n "$cf_gprconfig_value"
17671                                 then
17672                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17673                                         echo "$as_me:17673: result: $cf_gprconfig_value" >&5
17674 echo "${ECHO_T}$cf_gprconfig_value" >&6
17675                                 else
17676                                         echo "$as_me:17676: result: missing" >&5
17677 echo "${ECHO_T}missing" >&6
17678                                         cf_ada_config="#"
17679                                         break
17680                                 fi
17681                         done
17682                         cd ..
17683                         rm -rf ./conftest* ./*~conftest*
17684                 fi
17685         fi
17686         if test "x$cf_ada_config" != "x#"
17687         then
17688
17689 echo "$as_me:17689: checking for gnat version" >&5
17690 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17691 if test "${cf_cv_gnat_version+set}" = set; then
17692   echo $ECHO_N "(cached) $ECHO_C" >&6
17693 else
17694
17695 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17696         grep '[0-9].[0-9][0-9]*' |\
17697         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17698
17699 fi
17700 echo "$as_me:17700: result: $cf_cv_gnat_version" >&5
17701 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17702 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17703
17704 case "$cf_cv_gnat_version" in
17705 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17706         cf_cv_prog_gnat_correct=yes
17707         ;;
17708 (*)
17709         { echo "$as_me:17709: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17710 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17711         cf_cv_prog_gnat_correct=no
17712         ;;
17713 esac
17714
17715                 # Extract the first word of "m4", so it can be a program name with args.
17716 set dummy m4; ac_word=$2
17717 echo "$as_me:17717: checking for $ac_word" >&5
17718 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17719 if test "${ac_cv_prog_M4_exists+set}" = set; then
17720   echo $ECHO_N "(cached) $ECHO_C" >&6
17721 else
17722   if test -n "$M4_exists"; then
17723   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17724 else
17725   ac_save_IFS=$IFS; IFS=$ac_path_separator
17726 ac_dummy="$PATH"
17727 for ac_dir in $ac_dummy; do
17728   IFS=$ac_save_IFS
17729   test -z "$ac_dir" && ac_dir=.
17730   $as_executable_p "$ac_dir/$ac_word" || continue
17731 ac_cv_prog_M4_exists="yes"
17732 echo "$as_me:17732: found $ac_dir/$ac_word" >&5
17733 break
17734 done
17735
17736   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17737 fi
17738 fi
17739 M4_exists=$ac_cv_prog_M4_exists
17740 if test -n "$M4_exists"; then
17741   echo "$as_me:17741: result: $M4_exists" >&5
17742 echo "${ECHO_T}$M4_exists" >&6
17743 else
17744   echo "$as_me:17744: result: no" >&5
17745 echo "${ECHO_T}no" >&6
17746 fi
17747
17748                 if test "$ac_cv_prog_M4_exists" = no; then
17749                         cf_cv_prog_gnat_correct=no
17750                         { echo "$as_me:17750: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17751 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17752                 fi
17753                 if test "$cf_cv_prog_gnat_correct" = yes; then
17754                         echo "$as_me:17754: checking if GNAT works" >&5
17755 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17756
17757 rm -rf ./conftest* ./*~conftest*
17758 cat >>conftest.ads <<CF_EOF
17759 procedure conftest;
17760 CF_EOF
17761 cat >>conftest.adb <<CF_EOF
17762 with Text_IO;
17763 with GNAT.OS_Lib;
17764 procedure conftest is
17765 begin
17766    Text_IO.Put ("Hello World");
17767    Text_IO.New_Line;
17768    GNAT.OS_Lib.OS_Exit (0);
17769 end conftest;
17770 CF_EOF
17771 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17772    if ( ./conftest 1>&5 2>&1 ) ; then
17773       cf_cv_prog_gnat_correct=yes
17774    else
17775       cf_cv_prog_gnat_correct=no
17776    fi
17777 else
17778    cf_cv_prog_gnat_correct=no
17779 fi
17780 rm -rf ./conftest* ./*~conftest*
17781
17782                         echo "$as_me:17782: result: $cf_cv_prog_gnat_correct" >&5
17783 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17784                 fi
17785         else
17786                 cf_cv_prog_gnat_correct=no
17787         fi
17788 fi
17789
17790         if test "$cf_cv_prog_gnat_correct" = yes; then
17791
17792         echo "$as_me:17792: checking optimization options for ADAFLAGS" >&5
17793 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17794         case "$CFLAGS" in
17795         (*-g*)
17796
17797         ADAFLAGS="$ADAFLAGS -g"
17798
17799                 ;;
17800         esac
17801         case "$CFLAGS" in
17802         (*-O*)
17803                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17804
17805         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17806
17807                 ;;
17808         esac
17809         echo "$as_me:17809: result: $ADAFLAGS" >&5
17810 echo "${ECHO_T}$ADAFLAGS" >&6
17811
17812 echo "$as_me:17812: checking if GNATPREP supports -T option" >&5
17813 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17814 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17815   echo $ECHO_N "(cached) $ECHO_C" >&6
17816 else
17817
17818 cf_cv_gnatprep_opt_t=no
17819 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17820
17821 fi
17822 echo "$as_me:17822: result: $cf_cv_gnatprep_opt_t" >&5
17823 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17824 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17825
17826 echo "$as_me:17826: checking if GNAT supports generics" >&5
17827 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17828 case "$cf_cv_gnat_version" in
17829 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17830         cf_gnat_generics=yes
17831         ;;
17832 (*)
17833         cf_gnat_generics=no
17834         ;;
17835 esac
17836 echo "$as_me:17836: result: $cf_gnat_generics" >&5
17837 echo "${ECHO_T}$cf_gnat_generics" >&6
17838
17839 if test "$cf_gnat_generics" = yes
17840 then
17841         cf_compile_generics=generics
17842         cf_generic_objects="\${GENOBJS}"
17843 else
17844         cf_compile_generics=
17845         cf_generic_objects=
17846 fi
17847
17848 echo "$as_me:17848: checking if GNAT supports SIGINT" >&5
17849 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17850 if test "${cf_cv_gnat_sigint+set}" = set; then
17851   echo $ECHO_N "(cached) $ECHO_C" >&6
17852 else
17853
17854 rm -rf ./conftest* ./*~conftest*
17855 cat >>conftest.ads <<CF_EOF
17856 with Ada.Interrupts.Names;
17857
17858 package ConfTest is
17859
17860    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17861    pragma Unreserve_All_Interrupts;
17862    pragma Warnings (On);
17863
17864    protected Process is
17865       procedure Stop;
17866       function Continue return Boolean;
17867       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17868    private
17869       Done : Boolean := False;
17870    end Process;
17871
17872 end ConfTest;
17873 CF_EOF
17874 cat >>conftest.adb <<CF_EOF
17875 package body ConfTest is
17876    protected body Process is
17877       procedure Stop is
17878       begin
17879          Done := True;
17880       end Stop;
17881       function Continue return Boolean is
17882       begin
17883          return not Done;
17884       end Continue;
17885    end Process;
17886 end ConfTest;
17887 CF_EOF
17888 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17889       cf_cv_gnat_sigint=yes
17890 else
17891    cf_cv_gnat_sigint=no
17892 fi
17893 rm -rf ./conftest* ./*~conftest*
17894
17895 fi
17896 echo "$as_me:17896: result: $cf_cv_gnat_sigint" >&5
17897 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17898
17899 if test "$cf_cv_gnat_sigint" = yes ; then
17900         USE_GNAT_SIGINT=""
17901 else
17902         USE_GNAT_SIGINT="#"
17903 fi
17904
17905 cf_gnat_libraries=no
17906 cf_gnat_projects=no
17907
17908 if test "$enable_gnat_projects" != no ; then
17909 echo "$as_me:17909: checking if GNAT supports project files" >&5
17910 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17911 case "$cf_cv_gnat_version" in
17912 (3.[0-9]*)
17913         ;;
17914 (*)
17915         case "$cf_cv_system_name" in
17916         (cygwin*|msys*)
17917                 ;;
17918         (*)
17919                 rm -rf ./conftest* ./*~conftest*
17920                 if mkdir conftest.src conftest.bin conftest.lib
17921                 then
17922                         cd conftest.src
17923                         rm -rf ./conftest* ./*~conftest*
17924                         cat >>library.gpr <<CF_EOF
17925 project Library is
17926   Kind := External ("LIB_KIND");
17927   for Library_Name use "ConfTest";
17928   for Object_Dir use ".";
17929   for Library_ALI_Dir use External("LIBRARY_DIR");
17930   for Library_Version use External ("SONAME");
17931   for Library_Kind use Kind;
17932   for Library_Dir use External("BUILD_DIR");
17933   Source_Dir := External ("SOURCE_DIR");
17934   for Source_Dirs use (Source_Dir);
17935 end Library;
17936 CF_EOF
17937                         cat >>confpackage.ads <<CF_EOF
17938 package ConfPackage is
17939    procedure conftest;
17940 end ConfPackage;
17941 CF_EOF
17942                         cat >>confpackage.adb <<CF_EOF
17943 with Text_IO;
17944 package body ConfPackage is
17945    procedure conftest is
17946    begin
17947       Text_IO.Put ("Hello World");
17948       Text_IO.New_Line;
17949    end conftest;
17950 end ConfPackage;
17951 CF_EOF
17952                         if ( "$cf_ada_make" $ADAFLAGS \
17953                                         -Plibrary.gpr \
17954                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17955                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17956                                         -XSOURCE_DIR="`pwd`" \
17957                                         -XSONAME=libConfTest.so.1 \
17958                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17959                                 cf_gnat_projects=yes
17960                         fi
17961                         cd ..
17962                 fi
17963                 if test -f conftest.lib/confpackage.ali
17964                 then
17965                         cf_gnat_libraries=yes
17966                 fi
17967                 rm -rf ./conftest* ./*~conftest*
17968                 ;;
17969         esac
17970         ;;
17971 esac
17972 echo "$as_me:17972: result: $cf_gnat_projects" >&5
17973 echo "${ECHO_T}$cf_gnat_projects" >&6
17974 fi # enable_gnat_projects
17975
17976 if test "$cf_gnat_projects" = yes
17977 then
17978         echo "$as_me:17978: checking if GNAT supports libraries" >&5
17979 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17980         echo "$as_me:17980: result: $cf_gnat_libraries" >&5
17981 echo "${ECHO_T}$cf_gnat_libraries" >&6
17982 fi
17983
17984 USE_OLD_MAKERULES=""
17985 USE_GNAT_PROJECTS="#"
17986 USE_GNAT_MAKE_GPR="#"
17987 USE_GNAT_GPRBUILD="#"
17988
17989 if test "$cf_gnat_projects" = yes
17990 then
17991         USE_OLD_MAKERULES="#"
17992         USE_GNAT_PROJECTS=""
17993         if test "$cf_cv_VERSION_GPRBUILD" != no
17994         then
17995                 USE_GNAT_GPRBUILD=""
17996         elif test "$cf_cv_VERSION_GNATMAKE" != no
17997         then
17998                 USE_GNAT_MAKE_GPR=""
17999         else
18000                 { echo "$as_me:18000: WARNING: use old makefile rules since tools are missing" >&5
18001 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
18002         fi
18003 fi
18004
18005 if test "$cf_gnat_libraries" = yes
18006 then
18007         USE_GNAT_LIBRARIES=""
18008 else
18009         USE_GNAT_LIBRARIES="#"
18010 fi
18011
18012 echo "$as_me:18012: checking for ada-compiler" >&5
18013 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
18014
18015 # Check whether --with-ada-compiler or --without-ada-compiler was given.
18016 if test "${with_ada_compiler+set}" = set; then
18017   withval="$with_ada_compiler"
18018   cf_ada_compiler=$withval
18019 else
18020   cf_ada_compiler=gnatmake
18021 fi;
18022
18023 echo "$as_me:18023: result: $cf_ada_compiler" >&5
18024 echo "${ECHO_T}$cf_ada_compiler" >&6
18025
18026                 cf_ada_package=terminal_interface
18027
18028 echo "$as_me:18028: checking for ada-include" >&5
18029 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
18030
18031 # Check whether --with-ada-include or --without-ada-include was given.
18032 if test "${with_ada_include+set}" = set; then
18033   withval="$with_ada_include"
18034
18035 else
18036   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18037 fi; if test -n "$prefix/share/ada/adainclude" ; then
18038
18039 if test "x$prefix" != xNONE; then
18040         cf_path_syntax="$prefix"
18041 else
18042         cf_path_syntax="$ac_default_prefix"
18043 fi
18044
18045 case ".$withval" in
18046 (.\$\(*\)*|.\'*\'*)
18047         ;;
18048 (..|./*|.\\*)
18049         ;;
18050 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18051         ;;
18052 (.\$\{*prefix\}*|.\$\{*dir\}*)
18053         eval withval="$withval"
18054         case ".$withval" in
18055         (.NONE/*)
18056                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18057                 ;;
18058         esac
18059         ;;
18060 (.no|.NONE/*)
18061         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18062         ;;
18063 (*)
18064         { { echo "$as_me:18064: error: expected a pathname, not \"$withval\"" >&5
18065 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18066    { (exit 1); exit 1; }; }
18067         ;;
18068 esac
18069
18070 fi
18071 eval ADA_INCLUDE="$withval"
18072
18073 echo "$as_me:18073: result: $ADA_INCLUDE" >&5
18074 echo "${ECHO_T}$ADA_INCLUDE" >&6
18075
18076 echo "$as_me:18076: checking for ada-objects" >&5
18077 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
18078
18079 # Check whether --with-ada-objects or --without-ada-objects was given.
18080 if test "${with_ada_objects+set}" = set; then
18081   withval="$with_ada_objects"
18082
18083 else
18084   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18085 fi; if test -n "$prefix/lib/ada/adalib" ; then
18086
18087 if test "x$prefix" != xNONE; then
18088         cf_path_syntax="$prefix"
18089 else
18090         cf_path_syntax="$ac_default_prefix"
18091 fi
18092
18093 case ".$withval" in
18094 (.\$\(*\)*|.\'*\'*)
18095         ;;
18096 (..|./*|.\\*)
18097         ;;
18098 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18099         ;;
18100 (.\$\{*prefix\}*|.\$\{*dir\}*)
18101         eval withval="$withval"
18102         case ".$withval" in
18103         (.NONE/*)
18104                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18105                 ;;
18106         esac
18107         ;;
18108 (.no|.NONE/*)
18109         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18110         ;;
18111 (*)
18112         { { echo "$as_me:18112: error: expected a pathname, not \"$withval\"" >&5
18113 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18114    { (exit 1); exit 1; }; }
18115         ;;
18116 esac
18117
18118 fi
18119 eval ADA_OBJECTS="$withval"
18120
18121 echo "$as_me:18121: result: $ADA_OBJECTS" >&5
18122 echo "${ECHO_T}$ADA_OBJECTS" >&6
18123
18124 echo "$as_me:18124: checking if an Ada95 shared-library should be built" >&5
18125 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18126
18127 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18128 if test "${with_ada_sharedlib+set}" = set; then
18129   withval="$with_ada_sharedlib"
18130   with_ada_sharedlib=$withval
18131 else
18132   with_ada_sharedlib=no
18133 fi;
18134 echo "$as_me:18134: result: $with_ada_sharedlib" >&5
18135 echo "${ECHO_T}$with_ada_sharedlib" >&6
18136
18137 if test "x$with_ada_sharedlib" != xno
18138 then
18139         if test "x$cf_gnat_projects" != xyes
18140         then
18141                 { echo "$as_me:18141: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18142 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18143                 with_ada_sharedlib=no
18144         fi
18145 fi
18146
18147 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18148 MAKE_ADA_SHAREDLIB="#"
18149
18150 if test "x$with_ada_sharedlib" != xno
18151 then
18152         MAKE_ADA_SHAREDLIB=
18153         if test "x$with_ada_sharedlib" != xyes
18154         then
18155                 ADA_SHAREDLIB="$with_ada_sharedlib"
18156         fi
18157 fi
18158
18159                 # allow the Ada binding to be renamed
18160
18161 echo "$as_me:18161: checking for ada-libname" >&5
18162 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18163
18164 # Check whether --with-ada-libname or --without-ada-libname was given.
18165 if test "${with_ada_libname+set}" = set; then
18166   withval="$with_ada_libname"
18167   ADA_LIBNAME=$withval
18168 else
18169   ADA_LIBNAME=AdaCurses
18170 fi;
18171 case "x$ADA_LIBNAME" in
18172 (x|xyes|xno)
18173         ADA_LIBNAME=AdaCurses
18174         ;;
18175 esac
18176
18177 echo "$as_me:18177: result: $ADA_LIBNAME" >&5
18178 echo "${ECHO_T}$ADA_LIBNAME" >&6
18179
18180         else
18181                 { { echo "$as_me:18181: error: No usable Ada compiler found" >&5
18182 echo "$as_me: error: No usable Ada compiler found" >&2;}
18183    { (exit 1); exit 1; }; }
18184         fi
18185 else
18186         { { echo "$as_me:18186: error: The Ada compiler is needed for this package" >&5
18187 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18188    { (exit 1); exit 1; }; }
18189 fi
18190
18191 ################################################################################
18192
18193 # not needed
18194 TINFO_LDFLAGS2=
18195
18196 TINFO_LIBS=
18197
18198 ### Construct the list of include-directories to be generated
18199
18200 if test "$srcdir" != "."; then
18201         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18202 fi
18203 CPPFLAGS="-I../include $CPPFLAGS"
18204 if test "$srcdir" != "."; then
18205         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18206 fi
18207 CPPFLAGS="-I. $CPPFLAGS"
18208
18209 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18210 if test "$srcdir" != "."; then
18211         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18212 fi
18213 if test "$GCC" != yes; then
18214         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18215 elif test "$includedir" != "/usr/include"; then
18216         if test "$includedir" = '${prefix}/include' ; then
18217                 if test x$prefix != x/usr ; then
18218                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18219                 fi
18220         else
18221                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18222         fi
18223 fi
18224
18225 ### Build up pieces for makefile rules
18226 echo "$as_me:18226: checking default library suffix" >&5
18227 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18228
18229         case $DFT_LWR_MODEL in
18230         (libtool) DFT_ARG_SUFFIX=''   ;;
18231         (normal)  DFT_ARG_SUFFIX=''   ;;
18232         (debug)   DFT_ARG_SUFFIX='_g' ;;
18233         (profile) DFT_ARG_SUFFIX='_p' ;;
18234         (shared)  DFT_ARG_SUFFIX=''   ;;
18235         esac
18236         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18237 echo "$as_me:18237: result: $DFT_ARG_SUFFIX" >&5
18238 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18239
18240 echo "$as_me:18240: checking default library-dependency suffix" >&5
18241 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18242
18243         case X$DFT_LWR_MODEL in
18244         (Xlibtool)
18245                 DFT_LIB_SUFFIX='.la'
18246                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18247                 ;;
18248         (Xdebug)
18249                 case "$cf_cv_system_name" in
18250                 (*-msvc*)
18251                         DFT_LIB_SUFFIX='_g.lib'
18252                         ;;
18253                 (*)
18254                         DFT_LIB_SUFFIX='_g.a'
18255                         ;;
18256                 esac
18257                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18258                 ;;
18259         (Xprofile)
18260                 case "$cf_cv_system_name" in
18261                 (*-msvc*)
18262                         DFT_LIB_SUFFIX='_p.lib'
18263                         ;;
18264                 (*)
18265                         DFT_LIB_SUFFIX='_p.a'
18266                         ;;
18267                 esac
18268                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18269                 ;;
18270         (Xshared)
18271                 case "$cf_cv_system_name" in
18272                 (aix[5-7]*)
18273                         DFT_LIB_SUFFIX='.so'
18274                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18275                         ;;
18276                 (*-msvc*)
18277                         DFT_LIB_SUFFIX='.dll'
18278                         DFT_DEP_SUFFIX='.dll.lib'
18279                         ;;
18280                 (cygwin*|msys*|mingw*)
18281                         DFT_LIB_SUFFIX='.dll'
18282                         DFT_DEP_SUFFIX='.dll.a'
18283                         ;;
18284                 (darwin*)
18285                         DFT_LIB_SUFFIX='.dylib'
18286                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18287                         ;;
18288                 (hpux*)
18289                         case "$target" in
18290                         (ia64*)
18291                                 DFT_LIB_SUFFIX='.so'
18292                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18293                                 ;;
18294                         (*)
18295                                 DFT_LIB_SUFFIX='.sl'
18296                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18297                                 ;;
18298                         esac
18299                         ;;
18300                 (*)
18301                         DFT_LIB_SUFFIX='.so'
18302                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18303                         ;;
18304                 esac
18305                 ;;
18306         (*)
18307                 case "$target" in
18308                 (*-msvc*)
18309                         DFT_LIB_SUFFIX='.lib'
18310                         ;;
18311                 (*)
18312                         DFT_LIB_SUFFIX='.a'
18313                         ;;
18314                 esac
18315                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18316                 ;;
18317         esac
18318         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18319         then
18320                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18321                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18322         fi
18323 echo "$as_me:18323: result: $DFT_DEP_SUFFIX" >&5
18324 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18325
18326 echo "$as_me:18326: checking default object directory" >&5
18327 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18328
18329         case $DFT_LWR_MODEL in
18330         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18331         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18332         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18333         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18334         (shared)
18335                 case "$cf_cv_system_name" in
18336                 (cygwin|msys)
18337                         DFT_OBJ_SUBDIR='objects' ;;
18338                 (*)
18339                         DFT_OBJ_SUBDIR='obj_s' ;;
18340                 esac
18341         esac
18342 echo "$as_me:18342: result: $DFT_OBJ_SUBDIR" >&5
18343 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18344
18345 ### Set up low-level terminfo dependencies for makefiles.
18346
18347 if test "$DFT_LWR_MODEL" = shared ; then
18348         case $cf_cv_system_name in
18349         (cygwin*)
18350                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18351                 ;;
18352         (msys*)
18353                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18354                 ;;
18355         esac
18356 fi
18357
18358 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18359
18360 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18361
18362 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18363
18364 ### Construct the list of subdirectories for which we'll customize makefiles
18365 ### with the appropriate compile-rules.
18366
18367 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18368
18369 cat >>confdefs.h <<EOF
18370 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18371 EOF
18372
18373 ################################################################################
18374
18375 TEST_ARG2=
18376
18377 TEST_LIBS2=
18378
18379 NCURSES_SHLIB2="sh -c"
18380
18381 ADA_SUBDIRS="include gen src doc"
18382 if test "x$cf_with_tests" != "xno" ; then
18383         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18384 fi
18385 for cf_dir in $ADA_SUBDIRS
18386 do
18387         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18388 done
18389
18390 NCURSES_TREE="#"
18391
18392 EXTERNAL_TREE=
18393
18394 # match layout used by make-tar.sh
18395 ADAHTML_DIR=../doc/ada
18396
18397 if test "x$cross_compiling" = xyes ; then
18398         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18399 else
18400         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18401 fi
18402
18403 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"
18404 ac_config_commands="$ac_config_commands default"
18405 cat >confcache <<\_ACEOF
18406 # This file is a shell script that caches the results of configure
18407 # tests run on this system so they can be shared between configure
18408 # scripts and configure runs, see configure's option --config-cache.
18409 # It is not useful on other systems.  If it contains results you don't
18410 # want to keep, you may remove or edit it.
18411 #
18412 # config.status only pays attention to the cache file if you give it
18413 # the --recheck option to rerun configure.
18414 #
18415 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18416 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18417 # following values.
18418
18419 _ACEOF
18420
18421 # The following way of writing the cache mishandles newlines in values,
18422 # but we know of no workaround that is simple, portable, and efficient.
18423 # So, don't put newlines in cache variables' values.
18424 # Ultrix sh set writes to stderr and can't be redirected directly,
18425 # and sets the high bit in the cache file unless we assign to the vars.
18426 {
18427   (set) 2>&1 |
18428     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18429     *ac_space=\ *)
18430       # `set' does not quote correctly, so add quotes (double-quote
18431       # substitution turns \\\\ into \\, and sed turns \\ into \).
18432       sed -n \
18433         "s/'/'\\\\''/g;
18434           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18435       ;;
18436     *)
18437       # `set' quotes correctly as required by POSIX, so do not add quotes.
18438       sed -n \
18439         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18440       ;;
18441     esac;
18442 } |
18443   sed '
18444      t clear
18445      : clear
18446      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18447      t end
18448      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18449      : end' >>confcache
18450 if cmp -s $cache_file confcache; then :; else
18451   if test -w $cache_file; then
18452     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18453     cat confcache >$cache_file
18454   else
18455     echo "not updating unwritable cache $cache_file"
18456   fi
18457 fi
18458 rm -f confcache
18459
18460 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18461 # Let make expand exec_prefix.
18462 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18463
18464 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18465 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18466 # trailing colons and then remove the whole line if VPATH becomes empty
18467 # (actually we leave an empty line to preserve line numbers).
18468 if test "x$srcdir" = x.; then
18469   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18470 s/:*\$(srcdir):*/:/;
18471 s/:*\${srcdir}:*/:/;
18472 s/:*@srcdir@:*/:/;
18473 s/^\([^=]*=[    ]*\):*/\1/;
18474 s/:*$//;
18475 s/^[^=]*=[      ]*$//;
18476 }'
18477 fi
18478
18479 DEFS=-DHAVE_CONFIG_H
18480
18481 : "${CONFIG_STATUS=./config.status}"
18482 ac_clean_files_save=$ac_clean_files
18483 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18484 { echo "$as_me:18484: creating $CONFIG_STATUS" >&5
18485 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18486 cat >"$CONFIG_STATUS" <<_ACEOF
18487 #! $SHELL
18488 # Generated automatically by configure.
18489 # Run this file to recreate the current configuration.
18490 # Compiler output produced by configure, useful for debugging
18491 # configure, is in config.log if it exists.
18492
18493 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18494
18495 debug=false
18496 SHELL=\${CONFIG_SHELL-$SHELL}
18497 ac_cs_invocation="\$0 \$@"
18498
18499 CLICOLOR_FORCE= GREP_OPTIONS=
18500 unset CLICOLOR_FORCE GREP_OPTIONS
18501 _ACEOF
18502
18503 cat >>"$CONFIG_STATUS" <<\_ACEOF
18504 # Be Bourne compatible
18505 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18506   emulate sh
18507   NULLCMD=:
18508 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18509   set -o posix
18510 fi
18511
18512 # Name of the executable.
18513 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18514
18515 if expr a : '\(a\)' >/dev/null 2>&1; then
18516   as_expr="expr"
18517 else
18518   as_expr="false"
18519 fi
18520
18521 rm -f conf$$ conf$$.exe conf$$.file
18522 echo >conf$$.file
18523 if ln -s conf$$.file conf$$ 2>/dev/null; then
18524   # We could just check for DJGPP; but this test a) works b) is more generic
18525   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18526   if test -f conf$$.exe; then
18527     # Don't use ln at all; we don't have any links
18528     as_ln_s='cp -p'
18529   else
18530     as_ln_s='ln -s'
18531   fi
18532 elif ln conf$$.file conf$$ 2>/dev/null; then
18533   as_ln_s='ln'
18534 else
18535   as_ln_s='cp -p'
18536 fi
18537 rm -f conf$$ conf$$.exe conf$$.file
18538
18539 as_executable_p="test -f"
18540
18541 # Support unset when possible.
18542 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18543   as_unset="unset"
18544 else
18545   as_unset="false"
18546 fi
18547
18548 # NLS nuisances.
18549 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18550 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18551 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18552 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18553 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18554 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18555 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18556 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18557
18558 # IFS
18559 # We need space, tab and new line, in precisely that order.
18560 as_nl='
18561 '
18562 IFS="   $as_nl"
18563
18564 # CDPATH.
18565 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18566
18567 exec 6>&1
18568
18569 _ACEOF
18570
18571 # Files that config.status was made for.
18572 if test -n "$ac_config_files"; then
18573   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18574 fi
18575
18576 if test -n "$ac_config_headers"; then
18577   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18578 fi
18579
18580 if test -n "$ac_config_links"; then
18581   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18582 fi
18583
18584 if test -n "$ac_config_commands"; then
18585   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18586 fi
18587
18588 cat >>"$CONFIG_STATUS" <<\EOF
18589
18590 ac_cs_usage="\
18591 \`$as_me' instantiates files from templates according to the
18592 current configuration.
18593
18594 Usage: $0 [OPTIONS] [FILE]...
18595
18596   -h, --help       print this help, then exit
18597   -V, --version    print version number, then exit
18598   -d, --debug      don't remove temporary files
18599       --recheck    update $as_me by reconfiguring in the same conditions
18600   --file=FILE[:TEMPLATE]
18601                    instantiate the configuration file FILE
18602   --header=FILE[:TEMPLATE]
18603                    instantiate the configuration header FILE
18604
18605 Configuration files:
18606 $config_files
18607
18608 Configuration headers:
18609 $config_headers
18610
18611 Configuration commands:
18612 $config_commands
18613
18614 Report bugs to <dickey@invisible-island.net>."
18615 EOF
18616
18617 cat >>"$CONFIG_STATUS" <<EOF
18618 ac_cs_version="\\
18619 config.status
18620 configured by $0, generated by GNU Autoconf 2.52.20230114,
18621   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18622
18623 Copyright 2003-2022,2023        Thomas E. Dickey
18624 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18625 Free Software Foundation, Inc.
18626 This config.status script is free software; the Free Software Foundation
18627 gives unlimited permission to copy, distribute and modify it."
18628 srcdir="$srcdir"
18629 INSTALL="$INSTALL"
18630 EOF
18631
18632 cat >>"$CONFIG_STATUS" <<\EOF
18633 # If no file are specified by the user, then we need to provide default
18634 # value.  By we need to know if files were specified by the user.
18635 ac_need_defaults=:
18636 while test $# != 0
18637 do
18638   case $1 in
18639   --*=*)
18640     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18641     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18642     shift
18643     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18644     shift
18645     ;;
18646   -*);;
18647   *) # This is not an option, so the user has probably given explicit
18648      # arguments.
18649      ac_need_defaults=false;;
18650   esac
18651
18652   case $1 in
18653   # Handling of the options.
18654 EOF
18655 cat >>"$CONFIG_STATUS" <<EOF
18656   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18657     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18658     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18659 EOF
18660 cat >>"$CONFIG_STATUS" <<\EOF
18661   --version | --vers* | -V )
18662     echo "$ac_cs_version"; exit 0 ;;
18663   --he | --h)
18664     # Conflict between --help and --header
18665     { { echo "$as_me:18665: error: ambiguous option: $1
18666 Try \`$0 --help' for more information." >&5
18667 echo "$as_me: error: ambiguous option: $1
18668 Try \`$0 --help' for more information." >&2;}
18669    { (exit 1); exit 1; }; };;
18670   --help | --hel | -h )
18671     echo "$ac_cs_usage"; exit 0 ;;
18672   --debug | --d* | -d )
18673     debug=: ;;
18674   --file | --fil | --fi | --f )
18675     shift
18676     CONFIG_FILES="$CONFIG_FILES $1"
18677     ac_need_defaults=false;;
18678   --header | --heade | --head | --hea )
18679     shift
18680     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18681     ac_need_defaults=false;;
18682
18683   # This is an error.
18684   -*) { { echo "$as_me:18684: error: unrecognized option: $1
18685 Try \`$0 --help' for more information." >&5
18686 echo "$as_me: error: unrecognized option: $1
18687 Try \`$0 --help' for more information." >&2;}
18688    { (exit 1); exit 1; }; } ;;
18689
18690   *) ac_config_targets="$ac_config_targets $1" ;;
18691
18692   esac
18693   shift
18694 done
18695
18696 exec 5>>config.log
18697 cat >&5 << _ACEOF
18698
18699 ## ----------------------- ##
18700 ## Running config.status.  ##
18701 ## ----------------------- ##
18702
18703 This file was extended by $as_me 2.52.20230114, executed with
18704   CONFIG_FILES    = $CONFIG_FILES
18705   CONFIG_HEADERS  = $CONFIG_HEADERS
18706   CONFIG_LINKS    = $CONFIG_LINKS
18707   CONFIG_COMMANDS = $CONFIG_COMMANDS
18708   > "$ac_cs_invocation"
18709 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18710
18711 _ACEOF
18712 EOF
18713
18714 cat >>"$CONFIG_STATUS" <<EOF
18715 #
18716 # INIT-COMMANDS section.
18717 #
18718
18719 ### Special initialization commands, used to pass information from the
18720 ### configuration-run into config.status
18721
18722 AWK="$AWK"
18723 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18724 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18725 LIB_NAME="$LIB_NAME"
18726 LIB_PREFIX="$LIB_PREFIX"
18727 LIB_SUFFIX="$LIB_SUFFIX"
18728 LN_S="$LN_S"
18729 NCURSES_MAJOR="$NCURSES_MAJOR"
18730 NCURSES_MINOR="$NCURSES_MINOR"
18731 NCURSES_PATCH="$NCURSES_PATCH"
18732 PACKAGE="$PACKAGE"
18733 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18734 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18735 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18736 cf_cv_abi_version="$cf_cv_abi_version"
18737 cf_cv_rel_version="$cf_cv_rel_version"
18738 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18739 cf_cv_shared_soname='$cf_cv_shared_soname'
18740 cf_cv_shlib_version="$cf_cv_shlib_version"
18741 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18742 cf_cv_system_name="$cf_cv_system_name"
18743 host="$host"
18744 target="$target"
18745
18746 EOF
18747
18748 cat >>"$CONFIG_STATUS" <<\EOF
18749 for ac_config_target in $ac_config_targets
18750 do
18751   case "$ac_config_target" in
18752   # Handling of arguments.
18753   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18754   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18755   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18756   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18757   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18758   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18759   *) { { echo "$as_me:18759: error: invalid argument: $ac_config_target" >&5
18760 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18761    { (exit 1); exit 1; }; };;
18762   esac
18763 done
18764
18765 # If the user did not use the arguments to specify the items to instantiate,
18766 # then the envvar interface is used.  Set only those that are not.
18767 # We use the long form for the default assignment because of an extremely
18768 # bizarre bug on SunOS 4.1.3.
18769 if "$ac_need_defaults"; then
18770   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18771   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18772   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18773 fi
18774
18775 # Create a temporary directory, and hook for its removal unless debugging.
18776 $debug ||
18777 {
18778   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18779   trap '{ (exit 1); exit 1; }' 1 2 13 15
18780 }
18781
18782 # Create a (secure) tmp directory for tmp files.
18783 : "${TMPDIR=/tmp}"
18784 {
18785   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18786   test -n "$tmp" && test -d "$tmp"
18787 }  ||
18788 {
18789   tmp=$TMPDIR/cs$$-$RANDOM
18790   (umask 077 && mkdir "$tmp")
18791 } ||
18792 {
18793    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18794    { (exit 1); exit 1; }
18795 }
18796
18797 EOF
18798
18799 cat >>"$CONFIG_STATUS" <<EOF
18800
18801 #
18802 # CONFIG_FILES section.
18803 #
18804
18805 # No need to generate the scripts if there are no CONFIG_FILES.
18806 # This happens for instance when ./config.status config.h
18807 if test -n "\$CONFIG_FILES"; then
18808   # Protect against being on the right side of a sed subst in config.status.
18809   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18810    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
18811 s,@SHELL@,$SHELL,;t t
18812 s,@exec_prefix@,$exec_prefix,;t t
18813 s,@prefix@,$prefix,;t t
18814 s,@program_transform_name@,$program_transform_name,;t t
18815 s,@bindir@,$bindir,;t t
18816 s,@sbindir@,$sbindir,;t t
18817 s,@libexecdir@,$libexecdir,;t t
18818 s,@datarootdir@,$datarootdir,;t t
18819 s,@datadir@,$datadir,;t t
18820 s,@sysconfdir@,$sysconfdir,;t t
18821 s,@sharedstatedir@,$sharedstatedir,;t t
18822 s,@localstatedir@,$localstatedir,;t t
18823 s,@runstatedir@,$runstatedir,;t t
18824 s,@libdir@,$libdir,;t t
18825 s,@includedir@,$includedir,;t t
18826 s,@oldincludedir@,$oldincludedir,;t t
18827 s,@infodir@,$infodir,;t t
18828 s,@mandir@,$mandir,;t t
18829 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18830 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18831 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18832 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18833 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18834 s,@build_alias@,$build_alias,;t t
18835 s,@host_alias@,$host_alias,;t t
18836 s,@target_alias@,$target_alias,;t t
18837 s,@ECHO_C@,$ECHO_C,;t t
18838 s,@ECHO_N@,$ECHO_N,;t t
18839 s,@ECHO_T@,$ECHO_T,;t t
18840 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18841 s,@DEFS@,$DEFS,;t t
18842 s,@LIBS@,$LIBS,;t t
18843 s,@PACKAGE@,$PACKAGE,;t t
18844 s,@top_builddir@,$top_builddir,;t t
18845 s,@build@,$build,;t t
18846 s,@build_cpu@,$build_cpu,;t t
18847 s,@build_vendor@,$build_vendor,;t t
18848 s,@build_os@,$build_os,;t t
18849 s,@host@,$host,;t t
18850 s,@host_cpu@,$host_cpu,;t t
18851 s,@host_vendor@,$host_vendor,;t t
18852 s,@host_os@,$host_os,;t t
18853 s,@target@,$target,;t t
18854 s,@target_cpu@,$target_cpu,;t t
18855 s,@target_vendor@,$target_vendor,;t t
18856 s,@target_os@,$target_os,;t t
18857 s,@GREP@,$GREP,;t t
18858 s,@FGREP@,$FGREP,;t t
18859 s,@CC@,$CC,;t t
18860 s,@CFLAGS@,$CFLAGS,;t t
18861 s,@LDFLAGS@,$LDFLAGS,;t t
18862 s,@CPPFLAGS@,$CPPFLAGS,;t t
18863 s,@ac_ct_CC@,$ac_ct_CC,;t t
18864 s,@EXEEXT@,$EXEEXT,;t t
18865 s,@OBJEXT@,$OBJEXT,;t t
18866 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18867 s,@CPP@,$CPP,;t t
18868 s,@EGREP@,$EGREP,;t t
18869 s,@AWK@,$AWK,;t t
18870 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18871 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18872 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18873 s,@LN_S@,$LN_S,;t t
18874 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18875 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18876 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18877 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18878 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18879 s,@SET_MAKE@,$SET_MAKE,;t t
18880 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18881 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18882 s,@CTAGS@,$CTAGS,;t t
18883 s,@ETAGS@,$ETAGS,;t t
18884 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18885 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18886 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18887 s,@RANLIB@,$RANLIB,;t t
18888 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18889 s,@LD@,$LD,;t t
18890 s,@ac_ct_LD@,$ac_ct_LD,;t t
18891 s,@AR@,$AR,;t t
18892 s,@ac_ct_AR@,$ac_ct_AR,;t t
18893 s,@ARFLAGS@,$ARFLAGS,;t t
18894 s,@DESTDIR@,$DESTDIR,;t t
18895 s,@BUILD_CC@,$BUILD_CC,;t t
18896 s,@BUILD_CPP@,$BUILD_CPP,;t t
18897 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18898 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18899 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18900 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18901 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18902 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18903 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18904 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18905 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18906 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18907 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18908 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18909 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18910 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18911 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18912 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18913 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18914 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18915 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18916 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18917 s,@CC_G_OPT@,$CC_G_OPT,;t t
18918 s,@LD_MODEL@,$LD_MODEL,;t t
18919 s,@shlibdir@,$shlibdir,;t t
18920 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18921 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18922 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18923 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18924 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18925 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18926 s,@LINK_PROGS@,$LINK_PROGS,;t t
18927 s,@LINK_TESTS@,$LINK_TESTS,;t t
18928 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18929 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18930 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18931 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18932 s,@RPATH_LIST@,$RPATH_LIST,;t t
18933 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18934 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18935 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18936 s,@PTHREAD@,$PTHREAD,;t t
18937 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18938 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18939 s,@ECHO_LT@,$ECHO_LT,;t t
18940 s,@ECHO_LD@,$ECHO_LD,;t t
18941 s,@RULE_CC@,$RULE_CC,;t t
18942 s,@SHOW_CC@,$SHOW_CC,;t t
18943 s,@ECHO_CC@,$ECHO_CC,;t t
18944 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18945 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18946 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18947 s,@ADAFLAGS@,$ADAFLAGS,;t t
18948 s,@ADA_TRACE@,$ADA_TRACE,;t t
18949 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18950 s,@M4_exists@,$M4_exists,;t t
18951 s,@cf_ada_make@,$cf_ada_make,;t t
18952 s,@cf_ada_config@,$cf_ada_config,;t t
18953 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18954 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18955 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18956 s,@cf_compile_generics@,$cf_compile_generics,;t t
18957 s,@cf_generic_objects@,$cf_generic_objects,;t t
18958 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18959 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18960 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18961 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18962 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18963 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18964 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18965 s,@cf_ada_package@,$cf_ada_package,;t t
18966 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18967 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18968 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18969 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18970 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18971 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18972 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18973 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18974 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18975 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18976 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18977 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18978 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18979 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18980 s,@TEST_ARG2@,$TEST_ARG2,;t t
18981 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18982 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18983 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18984 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18985 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18986 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18987 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18988 CEOF
18989
18990 EOF
18991
18992   cat >>"$CONFIG_STATUS" <<\EOF
18993   # Split the substitutions into bite-sized pieces for seds with
18994   # small command number limits, like on Digital OSF/1 and HP-UX.
18995   ac_max_sed_lines=48
18996   ac_sed_frag=1 # Number of current file.
18997   ac_beg=1 # First line for current file.
18998   ac_end=$ac_max_sed_lines # Line after last line for current file.
18999   ac_more_lines=:
19000   ac_sed_cmds=
19001   while "$ac_more_lines"; do
19002     if test "$ac_beg" -gt 1; then
19003       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19004     else
19005       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19006     fi
19007     if test ! -s "$tmp"/subs.frag; then
19008       ac_more_lines=false
19009     else
19010       # The purpose of the label and of the branching condition is to
19011       # speed up the sed processing (if there are no `@' at all, there
19012       # is no need to browse any of the substitutions).
19013       # These are the two extra sed commands mentioned above.
19014       (echo ':t
19015   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19016       # It is possible to make a multiline substitution using escaped newlines.
19017       # Ensure that we do not split the substitution between script fragments.
19018       ac_BEG=$ac_end
19019       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19020       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19021       if test -s "$tmp"/subs.next; then
19022         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19023         if test ! -s "$tmp"/subs.edit; then
19024           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19025           if test ! -s "$tmp"/subs.edit; then
19026             if test "$ac_beg" -gt 1; then
19027               ac_end=`expr "$ac_end" - 1`
19028               continue
19029             fi
19030           fi
19031         fi
19032       fi
19033
19034       if test -z "$ac_sed_cmds"; then
19035         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19036       else
19037         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19038       fi
19039       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19040       ac_beg=$ac_end
19041       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19042     fi
19043   done
19044   if test -z "$ac_sed_cmds"; then
19045     ac_sed_cmds="cat"
19046   fi
19047 fi # test -n "$CONFIG_FILES"
19048
19049 EOF
19050 cat >>"$CONFIG_STATUS" <<\EOF
19051 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19052   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19053   case "$ac_file" in
19054   - | *:- | *:-:* ) # input from stdin
19055         cat >"$tmp"/stdin
19056         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19057         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19058   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19059         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19060   * )   ac_file_in=$ac_file.in ;;
19061   esac
19062
19063   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19064   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19065          X"$ac_file" : 'X\(//\)[^/]' \| \
19066          X"$ac_file" : 'X\(//\)$' \| \
19067          X"$ac_file" : 'X\(/\)' \| \
19068          .     : '\(.\)' 2>/dev/null ||
19069 echo X"$ac_file" |
19070     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19071           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19072           /^X\(\/\/\)$/{ s//\1/; q; }
19073           /^X\(\/\).*/{ s//\1/; q; }
19074           s/.*/./; q'`
19075   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19076     { case "$ac_dir" in
19077   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19078   *)                      as_incr_dir=.;;
19079 esac
19080 as_dummy="$ac_dir"
19081 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19082   case $as_mkdir_dir in
19083     # Skip DOS drivespec
19084     ?:) as_incr_dir=$as_mkdir_dir ;;
19085     *)
19086       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19087       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19088     ;;
19089   esac
19090 done; }
19091
19092     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19093     # A "../" for each directory in $ac_dir_suffix.
19094     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19095   else
19096     ac_dir_suffix= ac_dots=
19097   fi
19098
19099   case "$srcdir" in
19100   .)  ac_srcdir=.
19101       if test -z "$ac_dots"; then
19102          ac_top_srcdir=.
19103       else
19104          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19105       fi ;;
19106   [\\/]* | ?:[\\/]* )
19107       ac_srcdir="$srcdir$ac_dir_suffix";
19108       ac_top_srcdir="$srcdir" ;;
19109   *) # Relative path.
19110     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19111     ac_top_srcdir="$ac_dots$srcdir" ;;
19112   esac
19113
19114   case $INSTALL in
19115   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19116   *) ac_INSTALL=$ac_dots$INSTALL ;;
19117   esac
19118
19119   if test x"$ac_file" != x-; then
19120     { echo "$as_me:19120: creating $ac_file" >&5
19121 echo "$as_me: creating $ac_file" >&6;}
19122     rm -f "$ac_file"
19123   fi
19124   # Let's still pretend it is `configure' which instantiates (i.e., don't
19125   # use $as_me), people would be surprised to read:
19126   #    /* config.h.  Generated automatically by config.status.  */
19127   configure_input="Generated automatically from `echo $ac_file_in |
19128                                                  sed 's,.*/,,'` by configure."
19129
19130   # First look for the input files in the build tree, otherwise in the
19131   # src tree.
19132   ac_file_inputs=`IFS=:
19133     for f in $ac_file_in; do
19134       case $f in
19135       -) echo "$tmp"/stdin ;;
19136       [\\/$]*)
19137          # Absolute (can't be DOS-style, as IFS=:)
19138          test -f "$f" || { { echo "$as_me:19138: error: cannot find input file: $f" >&5
19139 echo "$as_me: error: cannot find input file: $f" >&2;}
19140    { (exit 1); exit 1; }; }
19141          echo "$f";;
19142       *) # Relative
19143          if test -f "$f"; then
19144            # Build tree
19145            echo "$f"
19146          elif test -f "$srcdir/$f"; then
19147            # Source tree
19148            echo "$srcdir/$f"
19149          else
19150            # /dev/null tree
19151            { { echo "$as_me:19151: error: cannot find input file: $f" >&5
19152 echo "$as_me: error: cannot find input file: $f" >&2;}
19153    { (exit 1); exit 1; }; }
19154          fi;;
19155       esac
19156     done` || { (exit 1); exit 1; }
19157 EOF
19158 cat >>"$CONFIG_STATUS" <<\EOF
19159   ac_warn_datarootdir=no
19160   if test x"$ac_file" != x-; then
19161     for ac_item in $ac_file_inputs
19162     do
19163       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19164       if test -n "$ac_seen"; then
19165         ac_used=`grep '@datarootdir@' "$ac_item"`
19166         if test -z "$ac_used"; then
19167           { echo "$as_me:19167: WARNING: datarootdir was used implicitly but not set:
19168 $ac_seen" >&5
19169 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19170 $ac_seen" >&2;}
19171           ac_warn_datarootdir=yes
19172         fi
19173       fi
19174       ac_seen=`grep '${datarootdir}' "$ac_item"`
19175       if test -n "$ac_seen"; then
19176         { echo "$as_me:19176: WARNING: datarootdir was used explicitly but not set:
19177 $ac_seen" >&5
19178 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19179 $ac_seen" >&2;}
19180         ac_warn_datarootdir=yes
19181       fi
19182     done
19183   fi
19184
19185 if test "x$ac_warn_datarootdir" = xyes; then
19186   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19187 fi
19188
19189 EOF
19190 cat >>"$CONFIG_STATUS" <<EOF
19191   sed "$ac_vpsub
19192 $extrasub
19193 EOF
19194 cat >>"$CONFIG_STATUS" <<\EOF
19195 :t
19196 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19197 s,@configure_input@,$configure_input,;t t
19198 s,@srcdir@,$ac_srcdir,;t t
19199 s,@top_srcdir@,$ac_top_srcdir,;t t
19200 s,@INSTALL@,$ac_INSTALL,;t t
19201 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19202   rm -f "$tmp"/stdin
19203 EOF
19204 : "${FGREP:=grep -F}"
19205 : "${EGREP:=grep -E}"
19206 cat >>"$CONFIG_STATUS" <<EOF
19207   : "\${FGREP:=$FGREP}"
19208   : "\${EGREP:=$EGREP}"
19209 EOF
19210 cat >>"$CONFIG_STATUS" <<\EOF
19211   if test x"$ac_file" != x-; then
19212     cp "$tmp/out" "$ac_file"
19213
19214     for ac_name in prefix exec_prefix datarootdir
19215     do
19216         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19217         if test -n "$ac_seen"; then
19218             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19219             if test -z "$ac_init"; then
19220               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19221               { echo "$as_me:19221: WARNING: Variable $ac_name is used but was not set:
19222 $ac_seen" >&5
19223 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19224 $ac_seen" >&2;}
19225             fi
19226         fi
19227     done
19228     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19229     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19230     if test -s "$tmp"/out; then
19231       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19232       { echo "$as_me:19232: WARNING: Some variables may not be substituted:
19233 $ac_seen" >&5
19234 echo "$as_me: WARNING: Some variables may not be substituted:
19235 $ac_seen" >&2;}
19236     fi
19237   else
19238     cat "$tmp"/out
19239   fi
19240   rm -f "$tmp"/out
19241
19242 done
19243 EOF
19244 cat >>"$CONFIG_STATUS" <<\EOF
19245
19246 #
19247 # CONFIG_HEADER section.
19248 #
19249
19250 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19251 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19252 #
19253 # ac_d sets the value in "#define NAME VALUE" lines.
19254 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19255 ac_dB='[        ].*$,\1#\2'
19256 ac_dC=' '
19257 ac_dD=',;t'
19258 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19259 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19260 ac_iB='\([      ]\),\1#\2define\3'
19261 ac_iC=' '
19262 ac_iD='\4,;t'
19263 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19264 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19265 ac_uB='$,\1#\2define\3'
19266 ac_uC=' '
19267 ac_uD=',;t'
19268
19269 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19270   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19271   case "$ac_file" in
19272   - | *:- | *:-:* ) # input from stdin
19273         cat >"$tmp"/stdin
19274         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19275         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19276   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19277         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19278   * )   ac_file_in=$ac_file.in ;;
19279   esac
19280
19281   test x"$ac_file" != x- && { echo "$as_me:19281: creating $ac_file" >&5
19282 echo "$as_me: creating $ac_file" >&6;}
19283
19284   # First look for the input files in the build tree, otherwise in the
19285   # src tree.
19286   ac_file_inputs=`IFS=:
19287     for f in $ac_file_in; do
19288       case $f in
19289       -) echo "$tmp"/stdin ;;
19290       [\\/$]*)
19291          # Absolute (can't be DOS-style, as IFS=:)
19292          test -f "$f" || { { echo "$as_me:19292: error: cannot find input file: $f" >&5
19293 echo "$as_me: error: cannot find input file: $f" >&2;}
19294    { (exit 1); exit 1; }; }
19295          echo $f;;
19296       *) # Relative
19297          if test -f "$f"; then
19298            # Build tree
19299            echo $f
19300          elif test -f "$srcdir/$f"; then
19301            # Source tree
19302            echo "$srcdir/$f"
19303          else
19304            # /dev/null tree
19305            { { echo "$as_me:19305: error: cannot find input file: $f" >&5
19306 echo "$as_me: error: cannot find input file: $f" >&2;}
19307    { (exit 1); exit 1; }; }
19308          fi;;
19309       esac
19310     done` || { (exit 1); exit 1; }
19311   # Remove the trailing spaces.
19312   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19313
19314 EOF
19315
19316 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19317 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19318 # be either 'cat' or 'sort'.
19319 cat confdefs.h | uniq >conftest.vals
19320
19321 # Break up conftest.vals because some shells have a limit on
19322 # the size of here documents, and old seds have small limits too.
19323
19324 rm -f conftest.tail
19325 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19326 while grep . conftest.vals >/dev/null
19327 do
19328   # Write chunks of a limited-size here document to conftest.frag.
19329   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19330   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19331   echo 'CEOF' >> "$CONFIG_STATUS"
19332   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19333   rm -f conftest.vals
19334   mv conftest.tail conftest.vals
19335 done
19336 rm -f conftest.vals
19337
19338 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19339 # marker @DEFS@.
19340 echo '  cat >> conftest.edit <<CEOF
19341 /@DEFS@/r conftest.frag
19342 /@DEFS@/d
19343 CEOF
19344 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19345 rm -f "$tmp"/in
19346 mv "$tmp"/out "$tmp"/in
19347 rm -f conftest.edit conftest.frag
19348 ' >> "$CONFIG_STATUS"
19349
19350 cat >>"$CONFIG_STATUS" <<\EOF
19351   # Let's still pretend it is `configure' which instantiates (i.e., don't
19352   # use $as_me), people would be surprised to read:
19353   #    /* config.h.  Generated automatically by config.status.  */
19354   if test x"$ac_file" = x-; then
19355     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19356   else
19357     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19358   fi
19359   cat "$tmp"/in >>"$tmp"/config.h
19360   rm -f "$tmp"/in
19361   if test x"$ac_file" != x-; then
19362     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19363       { echo "$as_me:19363: $ac_file is unchanged" >&5
19364 echo "$as_me: $ac_file is unchanged" >&6;}
19365     else
19366       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19367          X"$ac_file" : 'X\(//\)[^/]' \| \
19368          X"$ac_file" : 'X\(//\)$' \| \
19369          X"$ac_file" : 'X\(/\)' \| \
19370          .     : '\(.\)' 2>/dev/null ||
19371 echo X"$ac_file" |
19372     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19373           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19374           /^X\(\/\/\)$/{ s//\1/; q; }
19375           /^X\(\/\).*/{ s//\1/; q; }
19376           s/.*/./; q'`
19377       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19378         { case "$ac_dir" in
19379   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19380   *)                      as_incr_dir=.;;
19381 esac
19382 as_dummy="$ac_dir"
19383 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19384   case $as_mkdir_dir in
19385     # Skip DOS drivespec
19386     ?:) as_incr_dir=$as_mkdir_dir ;;
19387     *)
19388       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19389       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19390     ;;
19391   esac
19392 done; }
19393
19394       fi
19395       rm -f "$ac_file"
19396       mv "$tmp/config.h" "$ac_file"
19397     fi
19398   else
19399     cat "$tmp"/config.h
19400     rm -f "$tmp"/config.h
19401   fi
19402 done
19403 EOF
19404 cat >>"$CONFIG_STATUS" <<\EOF
19405 #
19406 # CONFIG_COMMANDS section.
19407 #
19408 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19409   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19410   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19411
19412   case "$ac_dest" in
19413     default )
19414 $AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
19415 if test -z "$USE_OLD_MAKERULES" ; then
19416         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19417 fi
19418  ;;
19419   esac
19420 done
19421 EOF
19422
19423 cat >>"$CONFIG_STATUS" <<\EOF
19424
19425 { (exit 0); exit 0; }
19426 EOF
19427 chmod +x "$CONFIG_STATUS"
19428 ac_clean_files=$ac_clean_files_save
19429
19430 # configure is writing to config.log, and then calls config.status.
19431 # config.status does its own redirection, appending to config.log.
19432 # Unfortunately, on DOS this fails, as config.log is still kept open
19433 # by configure, so config.status won't be able to write to it; its
19434 # output is simply discarded.  So we exec the FD to /dev/null,
19435 # effectively closing config.log, so it can be properly (re)opened and
19436 # appended to by config.status.  When coming back to configure, we
19437 # need to make the FD available again.
19438 if test "$no_create" != yes; then
19439   ac_cs_success=:
19440   exec 5>/dev/null
19441   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19442   exec 5>>config.log
19443   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19444   # would make configure fail if this is the last instruction.
19445   "$ac_cs_success" || { (exit 1); exit 1; }
19446 fi
19447 ${MAKE:-make} preinstall