]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20210731
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.83 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20210509.
5 #
6 # Copyright 2003-2020,2021      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-2020,2021        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.20210509.  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 top_builddir=`pwd`
1063
1064 ac_aux_dir=
1065 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1066   if test -f "$ac_dir/install-sh"; then
1067     ac_aux_dir=$ac_dir
1068     ac_install_sh="$ac_aux_dir/install-sh -c"
1069     break
1070   elif test -f "$ac_dir/install.sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install.sh -c"
1073     break
1074   elif test -f "$ac_dir/shtool"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/shtool install -c"
1077     break
1078   fi
1079 done
1080 if test -z "$ac_aux_dir"; then
1081   { { echo "$as_me:1081: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1082 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1086 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1087 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1088
1089 # Make sure we can run config.sub.
1090 $ac_config_sub sun4 >/dev/null 2>&1 ||
1091   { { echo "$as_me:1091: error: cannot run $ac_config_sub" >&5
1092 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1093    { (exit 1); exit 1; }; }
1094
1095 echo "$as_me:1095: checking build system type" >&5
1096 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1097 if test "${ac_cv_build+set}" = set; then
1098   echo $ECHO_N "(cached) $ECHO_C" >&6
1099 else
1100   ac_cv_build_alias=$build_alias
1101 test -z "$ac_cv_build_alias" &&
1102   ac_cv_build_alias=`$ac_config_guess`
1103 test -z "$ac_cv_build_alias" &&
1104   { { echo "$as_me:1104: error: cannot guess build type; you must specify one" >&5
1105 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1106    { (exit 1); exit 1; }; }
1107 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1108   { { echo "$as_me:1108: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1109 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1110    { (exit 1); exit 1; }; }
1111
1112 fi
1113 echo "$as_me:1113: result: $ac_cv_build" >&5
1114 echo "${ECHO_T}$ac_cv_build" >&6
1115 build=$ac_cv_build
1116 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1117 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1118 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1119
1120 echo "$as_me:1120: checking host system type" >&5
1121 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1122 if test "${ac_cv_host+set}" = set; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   ac_cv_host_alias=$host_alias
1126 test -z "$ac_cv_host_alias" &&
1127   ac_cv_host_alias=$ac_cv_build_alias
1128 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1129   { { echo "$as_me:1129: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1130 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1131    { (exit 1); exit 1; }; }
1132
1133 fi
1134 echo "$as_me:1134: result: $ac_cv_host" >&5
1135 echo "${ECHO_T}$ac_cv_host" >&6
1136 host=$ac_cv_host
1137 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1138 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1139 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1140
1141 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1142         echo "$as_me:1142: checking target system type" >&5
1143 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1144 if test "${ac_cv_target+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   ac_cv_target_alias=$target_alias
1148 test "x$ac_cv_target_alias" = "x" &&
1149   ac_cv_target_alias=$ac_cv_host_alias
1150 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1151   { { echo "$as_me:1151: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1152 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1153    { (exit 1); exit 1; }; }
1154
1155 fi
1156 echo "$as_me:1156: result: $ac_cv_target" >&5
1157 echo "${ECHO_T}$ac_cv_target" >&6
1158 target=$ac_cv_target
1159 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1160 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1161 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1162
1163 # The aliases save the names the user supplied, while $host etc.
1164 # will get canonicalized.
1165 test -n "$target_alias" &&
1166   test "$program_prefix$program_suffix$program_transform_name" = \
1167     NONENONEs,x,x, &&
1168   program_prefix=${target_alias}-
1169         system_name="$host_os"
1170 else
1171         system_name="`(uname -s -r) 2>/dev/null`"
1172         if test -z "$system_name" ; then
1173                 system_name="`(hostname) 2>/dev/null`"
1174         fi
1175 fi
1176 test -n "$system_name" &&
1177 cat >>confdefs.h <<EOF
1178 #define SYSTEM_NAME "$system_name"
1179 EOF
1180
1181 if test "${cf_cv_system_name+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   cf_cv_system_name="$system_name"
1185 fi
1186
1187 test -z "$system_name" && system_name="$cf_cv_system_name"
1188 test -n "$cf_cv_system_name" && echo "$as_me:1188: result: Configuring for $cf_cv_system_name" >&5
1189 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1190
1191 if test ".$system_name" != ".$cf_cv_system_name" ; then
1192         echo "$as_me:1192: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1193 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1194         { { echo "$as_me:1194: error: \"Please remove config.cache and try again.\"" >&5
1195 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1196    { (exit 1); exit 1; }; }
1197 fi
1198
1199 # Check whether --with-system-type or --without-system-type was given.
1200 if test "${with_system_type+set}" = set; then
1201   withval="$with_system_type"
1202   { echo "$as_me:1202: WARNING: overriding system type to $withval" >&5
1203 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1204         cf_cv_system_name=$withval
1205         host_os=$withval
1206
1207 fi;
1208
1209 ###     Save the given $CFLAGS to allow user-override.
1210 cf_user_CFLAGS="$CFLAGS"
1211
1212 ###     Default install-location
1213 for ac_prog in ggrep grep
1214 do
1215   # Extract the first word of "$ac_prog", so it can be a program name with args.
1216 set dummy $ac_prog; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_GREP+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$GREP"; then
1223   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_GREP="$ac_prog"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 GREP=$ac_cv_prog_GREP
1239 if test -n "$GREP"; then
1240   echo "$as_me:1240: result: $GREP" >&5
1241 echo "${ECHO_T}$GREP" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247   test -n "$GREP" && break
1248 done
1249 test -n "$GREP" || GREP=": "
1250
1251 echo "$as_me:1251: checking for fgrep" >&5
1252 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1253 if test "${ac_cv_path_FGREP+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1257    then ac_cv_path_FGREP="$GREP -F"
1258    else
1259      for ac_prog in gfgrep fgrep
1260 do
1261   # Extract the first word of "$ac_prog", so it can be a program name with args.
1262 set dummy $ac_prog; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_path_FGREP+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   case $FGREP in
1269   [\\/]* | ?:[\\/]*)
1270   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1271   ;;
1272   *)
1273   ac_save_IFS=$IFS; IFS=$ac_path_separator
1274 ac_dummy="$PATH"
1275 for ac_dir in $ac_dummy; do
1276   IFS=$ac_save_IFS
1277   test -z "$ac_dir" && ac_dir=.
1278   if $as_executable_p "$ac_dir/$ac_word"; then
1279    ac_cv_path_FGREP="$ac_dir/$ac_word"
1280    echo "$as_me:1280: found $ac_dir/$ac_word" >&5
1281    break
1282 fi
1283 done
1284
1285   ;;
1286 esac
1287 fi
1288 FGREP=$ac_cv_path_FGREP
1289
1290 if test -n "$FGREP"; then
1291   echo "$as_me:1291: result: $FGREP" >&5
1292 echo "${ECHO_T}$FGREP" >&6
1293 else
1294   echo "$as_me:1294: result: no" >&5
1295 echo "${ECHO_T}no" >&6
1296 fi
1297
1298   test -n "$FGREP" && break
1299 done
1300 test -n "$FGREP" || FGREP=": "
1301
1302      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1302: error: cannot find workable fgrep" >&5
1303 echo "$as_me: error: cannot find workable fgrep" >&2;}
1304    { (exit 1); exit 1; }; }
1305    fi
1306 fi
1307 echo "$as_me:1307: result: $ac_cv_path_FGREP" >&5
1308 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1309  FGREP="$ac_cv_path_FGREP"
1310
1311 echo "$as_me:1311: checking for prefix" >&5
1312 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1313 if test "x$prefix" = "xNONE" ; then
1314         case "$cf_cv_system_name" in
1315                 # non-vendor systems don't have a conflict
1316         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1317                 prefix=/usr
1318                 ;;
1319         (*)     prefix=$ac_default_prefix
1320                 ;;
1321         esac
1322 fi
1323 echo "$as_me:1323: result: $prefix" >&5
1324 echo "${ECHO_T}$prefix" >&6
1325
1326 if test "x$prefix" = "xNONE" ; then
1327 echo "$as_me:1327: checking for default include-directory" >&5
1328 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1329 test -n "$verbose" && echo 1>&6
1330 for cf_symbol in \
1331         "$includedir" \
1332         "$includedir/ncurses" \
1333         "$prefix/include" \
1334         "$prefix/include/ncurses" \
1335         /usr/local/include \
1336         /usr/local/include/ncurses \
1337         /usr/include \
1338         /usr/include/ncurses
1339 do
1340         cf_dir=`eval echo "$cf_symbol"`
1341         if test -f "$cf_dir/curses.h" ; then
1342         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1343                 includedir="$cf_symbol"
1344                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1345                 break
1346         fi
1347         fi
1348         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1349 done
1350 echo "$as_me:1350: result: $includedir" >&5
1351 echo "${ECHO_T}$includedir" >&6
1352 fi
1353
1354 ###     Checks for programs.
1355
1356 ac_ext=c
1357 ac_cpp='$CPP $CPPFLAGS'
1358 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1359 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1360 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1361 ac_main_return="return"
1362 if test -n "$ac_tool_prefix"; then
1363   for ac_prog in gnatgcc gcc cc
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in gnatgcc gcc cc
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo "$2"`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit "$ac_status"); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit "$ac_status"); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit "$ac_status"); }
1465
1466 cat >"conftest.$ac_ext" <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main (void)
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit "$ac_status"); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat "conftest.$ac_ext" >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit "$ac_status"); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe "conftest$ac_cv_exeext"
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit "$ac_status"); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f "conftest$ac_cv_exeext"
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f "conftest.$ac_ext"
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >"conftest.$ac_ext" <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main (void)
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit "$ac_status"); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat "conftest.$ac_ext" >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >"conftest.$ac_ext" <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main (void)
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f "conftest.$ac_objext"
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit "$ac_status"); } &&
1662          { ac_try='test -s "conftest.$ac_objext"'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit "$ac_status"); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat "conftest.$ac_ext" >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >"conftest.$ac_ext" <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main (void)
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f "conftest.$ac_objext"
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit "$ac_status"); } &&
1707          { ac_try='test -s "conftest.$ac_objext"'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit "$ac_status"); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat "conftest.$ac_ext" >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >"conftest.$ac_ext" <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f "conftest.$ac_objext"
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit "$ac_status"); } &&
1753          { ac_try='test -s "conftest.$ac_objext"'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit "$ac_status"); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >"conftest.$ac_ext" <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main (void)
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f "conftest.$ac_objext"
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit "$ac_status"); } &&
1787          { ac_try='test -s "conftest.$ac_objext"'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit "$ac_status"); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat "conftest.$ac_ext" >&5
1797 continue
1798 fi
1799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1800   cat >"conftest.$ac_ext" <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main (void)
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f "conftest.$ac_objext"
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit "$ac_status"); } &&
1818          { ac_try='test -s "conftest.$ac_objext"'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit "$ac_status"); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat "conftest.$ac_ext" >&5
1828 fi
1829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo "$ac_declaration"    >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1846 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return="return"
1849
1850 GCC_VERSION=none
1851 if test "$GCC" = yes ; then
1852         echo "$as_me:1852: checking version of $CC" >&5
1853 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1854         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.].*//'`"
1855         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1856         echo "$as_me:1856: result: $GCC_VERSION" >&5
1857 echo "${ECHO_T}$GCC_VERSION" >&6
1858 fi
1859
1860 INTEL_COMPILER=no
1861
1862 if test "$GCC" = yes ; then
1863         case "$host_os" in
1864         (linux*|gnu*)
1865                 echo "$as_me:1865: checking if this is really Intel C compiler" >&5
1866 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1867                 cf_save_CFLAGS="$CFLAGS"
1868                 CFLAGS="$CFLAGS -no-gcc"
1869                 cat >"conftest.$ac_ext" <<_ACEOF
1870 #line 1870 "configure"
1871 #include "confdefs.h"
1872
1873 int
1874 main (void)
1875 {
1876
1877 #ifdef __INTEL_COMPILER
1878 #else
1879 make an error
1880 #endif
1881
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 rm -f "conftest.$ac_objext"
1887 if { (eval echo "$as_me:1887: \"$ac_compile\"") >&5
1888   (eval $ac_compile) 2>&5
1889   ac_status=$?
1890   echo "$as_me:1890: \$? = $ac_status" >&5
1891   (exit "$ac_status"); } &&
1892          { ac_try='test -s "conftest.$ac_objext"'
1893   { (eval echo "$as_me:1893: \"$ac_try\"") >&5
1894   (eval $ac_try) 2>&5
1895   ac_status=$?
1896   echo "$as_me:1896: \$? = $ac_status" >&5
1897   (exit "$ac_status"); }; }; then
1898   INTEL_COMPILER=yes
1899 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1900
1901 else
1902   echo "$as_me: failed program was:" >&5
1903 cat "conftest.$ac_ext" >&5
1904 fi
1905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1906                 CFLAGS="$cf_save_CFLAGS"
1907                 echo "$as_me:1907: result: $INTEL_COMPILER" >&5
1908 echo "${ECHO_T}$INTEL_COMPILER" >&6
1909                 ;;
1910         esac
1911 fi
1912
1913 CLANG_COMPILER=no
1914
1915 if test "$GCC" = yes ; then
1916         echo "$as_me:1916: checking if this is really Clang C compiler" >&5
1917 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1918         cf_save_CFLAGS="$CFLAGS"
1919         cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   CLANG_COMPILER=yes
1949
1950 else
1951   echo "$as_me: failed program was:" >&5
1952 cat "conftest.$ac_ext" >&5
1953 fi
1954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1955         CFLAGS="$cf_save_CFLAGS"
1956         echo "$as_me:1956: result: $CLANG_COMPILER" >&5
1957 echo "${ECHO_T}$CLANG_COMPILER" >&6
1958 fi
1959
1960 CLANG_VERSION=none
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         case "$CC" in
1964         (c[1-9][0-9]|*/c[1-9][0-9])
1965                 { echo "$as_me:1965: WARNING: replacing broken compiler alias $CC" >&5
1966 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1967                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1968                 CC=clang
1969                 ;;
1970         esac
1971
1972         echo "$as_me:1972: checking version of $CC" >&5
1973 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1974         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.].*//'`"
1975         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1976         echo "$as_me:1976: result: $CLANG_VERSION" >&5
1977 echo "${ECHO_T}$CLANG_VERSION" >&6
1978
1979         for cf_clang_opt in \
1980                 -Qunused-arguments \
1981                 -Wno-error=implicit-function-declaration
1982         do
1983                 echo "$as_me:1983: checking if option $cf_clang_opt works" >&5
1984 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1985                 cf_save_CFLAGS="$CFLAGS"
1986                 CFLAGS="$CFLAGS $cf_clang_opt"
1987                 cat >"conftest.$ac_ext" <<_ACEOF
1988 #line 1988 "configure"
1989 #include "confdefs.h"
1990
1991                         #include <stdio.h>
1992 int
1993 main (void)
1994 {
1995
1996                         printf("hello!\\n");
1997   ;
1998   return 0;
1999 }
2000 _ACEOF
2001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2002 if { (eval echo "$as_me:2002: \"$ac_link\"") >&5
2003   (eval $ac_link) 2>&5
2004   ac_status=$?
2005   echo "$as_me:2005: \$? = $ac_status" >&5
2006   (exit "$ac_status"); } &&
2007          { ac_try='test -s "conftest$ac_exeext"'
2008   { (eval echo "$as_me:2008: \"$ac_try\"") >&5
2009   (eval $ac_try) 2>&5
2010   ac_status=$?
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit "$ac_status"); }; }; then
2013
2014                         cf_clang_optok=yes
2015 else
2016   echo "$as_me: failed program was:" >&5
2017 cat "conftest.$ac_ext" >&5
2018
2019                         cf_clang_optok=no
2020 fi
2021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2022                 echo "$as_me:2022: result: $cf_clang_optok" >&5
2023 echo "${ECHO_T}$cf_clang_optok" >&6
2024                 CFLAGS="$cf_save_CFLAGS"
2025                 if test "$cf_clang_optok" = yes; then
2026                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing adding option $cf_clang_opt ..." 1>&5
2029
2030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2031         CFLAGS="${CFLAGS}$cf_clang_opt"
2032
2033                 fi
2034         done
2035 fi
2036
2037 echo "$as_me:2037: checking for $CC option to accept ANSI C" >&5
2038 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2039 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2040   echo $ECHO_N "(cached) $ECHO_C" >&6
2041 else
2042   ac_cv_prog_cc_stdc=no
2043 ac_save_CC=$CC
2044 cat >"conftest.$ac_ext" <<_ACEOF
2045 #line 2045 "configure"
2046 #include "confdefs.h"
2047 #include <stdarg.h>
2048 #include <stdio.h>
2049 #include <sys/types.h>
2050 #include <sys/stat.h>
2051 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2052 struct buf { int x; };
2053 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2054 static char *e (p, i)
2055      char **p;
2056      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 PKG_CONFIG_LIBDIR=no
3283
3284 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3285 if test "${with_pkg_config_libdir+set}" = set; then
3286   withval="$with_pkg_config_libdir"
3287   PKG_CONFIG_LIBDIR=$withval
3288 else
3289   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3290 fi;
3291
3292 case x$PKG_CONFIG_LIBDIR in
3293 (x/*)
3294         ;;
3295 (xyes)
3296         # Look for the library directory using the same prefix as the executable
3297         if test "x$PKG_CONFIG" = xnone
3298         then
3299                 cf_path=$prefix
3300         else
3301                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3302         fi
3303
3304         # If you don't like using the default architecture, you have to specify the
3305         # intended library directory and corresponding compiler/linker options.
3306         #
3307         # This case allows for Debian's 2014-flavor of multiarch, along with the
3308         # most common variations before that point.  Some other variants spell the
3309         # directory differently, e.g., "pkg-config", and put it in unusual places.
3310         # pkg-config has always been poorly standardized, which is ironic...
3311         case x`(arch) 2>/dev/null` in
3312         (*64)
3313                 cf_search_path="\
3314                         $cf_path/lib/*64-linux-gnu \
3315                         $cf_path/share \
3316                         $cf_path/lib64 \
3317                         $cf_path/lib32 \
3318                         $cf_path/lib"
3319                 ;;
3320         (*)
3321                 cf_search_path="\
3322                         $cf_path/lib/*-linux-gnu \
3323                         $cf_path/share \
3324                         $cf_path/lib32 \
3325                         $cf_path/lib \
3326                         $cf_path/libdata"
3327                 ;;
3328         esac
3329
3330         test -n "$verbose" && echo "    list..." 1>&6
3331
3332 echo "${as_me:-configure}:3332: testing list... ..." 1>&5
3333
3334         for cf_config in $cf_search_path
3335         do
3336                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3337
3338 echo "${as_me:-configure}:3338: testing checking $cf_config/pkgconfig ..." 1>&5
3339
3340                 if test -d "$cf_config/pkgconfig"
3341                 then
3342                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3343                         echo "$as_me:3343: checking done" >&5
3344 echo $ECHO_N "checking done... $ECHO_C" >&6
3345                         break
3346                 fi
3347         done
3348         ;;
3349 (*)
3350         ;;
3351 esac
3352
3353 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3354         echo "$as_me:3354: result: $PKG_CONFIG_LIBDIR" >&5
3355 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3356 fi
3357
3358 echo "$as_me:3358: checking if you want to build test-programs" >&5
3359 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3360
3361 # Check whether --with-tests or --without-tests was given.
3362 if test "${with_tests+set}" = set; then
3363   withval="$with_tests"
3364   cf_with_tests=$withval
3365 else
3366   cf_with_tests=yes
3367 fi;
3368 echo "$as_me:3368: result: $cf_with_tests" >&5
3369 echo "${ECHO_T}$cf_with_tests" >&6
3370
3371 echo "$as_me:3371: checking if we should assume mixed-case filenames" >&5
3372 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3373
3374 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3375 if test "${enable_mixed_case+set}" = set; then
3376   enableval="$enable_mixed_case"
3377   enable_mixedcase=$enableval
3378 else
3379   enable_mixedcase=auto
3380 fi;
3381 echo "$as_me:3381: result: $enable_mixedcase" >&5
3382 echo "${ECHO_T}$enable_mixedcase" >&6
3383 if test "$enable_mixedcase" = "auto" ; then
3384
3385 echo "$as_me:3385: checking if filesystem supports mixed-case filenames" >&5
3386 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3387 if test "${cf_cv_mixedcase+set}" = set; then
3388   echo $ECHO_N "(cached) $ECHO_C" >&6
3389 else
3390
3391 if test "$cross_compiling" = yes ; then
3392         case "$target_alias" in
3393         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3394                 cf_cv_mixedcase=no
3395                 ;;
3396         (*)
3397                 cf_cv_mixedcase=yes
3398                 ;;
3399         esac
3400 else
3401         rm -f conftest CONFTEST
3402         echo test >conftest
3403         if test -f CONFTEST ; then
3404                 cf_cv_mixedcase=no
3405         else
3406                 cf_cv_mixedcase=yes
3407         fi
3408         rm -f conftest CONFTEST
3409 fi
3410
3411 fi
3412 echo "$as_me:3412: result: $cf_cv_mixedcase" >&5
3413 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3414 test "$cf_cv_mixedcase" = yes &&
3415 cat >>confdefs.h <<\EOF
3416 #define MIXEDCASE_FILENAMES 1
3417 EOF
3418
3419 else
3420         cf_cv_mixedcase=$enable_mixedcase
3421         if test "$enable_mixedcase" = "yes" ; then
3422                 cat >>confdefs.h <<\EOF
3423 #define MIXEDCASE_FILENAMES 1
3424 EOF
3425
3426         fi
3427 fi
3428
3429 # do this after mixed-case option (tags/TAGS is not as important as tic).
3430 echo "$as_me:3430: checking whether ${MAKE-make} sets \${MAKE}" >&5
3431 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3432 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3433 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3434   echo $ECHO_N "(cached) $ECHO_C" >&6
3435 else
3436   cat >conftest.make <<\EOF
3437 all:
3438         @echo 'ac_maketemp="${MAKE}"'
3439 EOF
3440 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3441 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3442 if test -n "$ac_maketemp"; then
3443   eval ac_cv_prog_make_${ac_make}_set=yes
3444 else
3445   eval ac_cv_prog_make_${ac_make}_set=no
3446 fi
3447 rm -f conftest.make
3448 fi
3449 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3450   echo "$as_me:3450: result: yes" >&5
3451 echo "${ECHO_T}yes" >&6
3452   SET_MAKE=
3453 else
3454   echo "$as_me:3454: result: no" >&5
3455 echo "${ECHO_T}no" >&6
3456   SET_MAKE="MAKE=${MAKE-make}"
3457 fi
3458
3459 echo "$as_me:3459: checking for \".PHONY\" make-support" >&5
3460 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3461 if test "${cf_cv_make_PHONY+set}" = set; then
3462   echo $ECHO_N "(cached) $ECHO_C" >&6
3463 else
3464
3465         rm -rf conftest*
3466         (
3467                 mkdir conftest || exit 1
3468                 cd conftest
3469                 cat >makefile <<'CF_EOF'
3470 .PHONY: always
3471 DATA=0
3472 always: always.out
3473         @echo "** making $@ $(DATA)"
3474 once: once.out
3475         @echo "** making $@ $(DATA)"
3476 always.out:
3477         @echo "** making $@ $(DATA)"
3478         echo $(DATA) > $@
3479 once.out:
3480         @echo "** making $@ $(DATA)"
3481         echo $(DATA) > $@
3482 CF_EOF
3483                 for cf_data in 1 2 3
3484                 do
3485                         ${MAKE:-make} always DATA=$cf_data
3486                         ${MAKE:-make} once   DATA=$cf_data
3487                         ${MAKE:-make} -t always once
3488                         if test -f always ; then
3489                                 echo "no (case 1)" > ../conftest.tmp
3490                         elif test ! -f always.out ; then
3491                                 echo "no (case 2)" > ../conftest.tmp
3492                         elif test ! -f once.out ; then
3493                                 echo "no (case 3)" > ../conftest.tmp
3494                         elif ! cmp -s always.out once.out ; then
3495                                 echo "no (case 4)" > ../conftest.tmp
3496                                 diff always.out once.out
3497                         else
3498                                 cf_check="`cat always.out`"
3499                                 if test "x$cf_check" != "x$cf_data" ; then
3500                                         echo "no (case 5)" > ../conftest.tmp
3501                                 else
3502                                         echo yes > ../conftest.tmp
3503                                         rm -f ./*.out
3504                                         continue
3505                                 fi
3506                         fi
3507                         break
3508                 done
3509         ) >&5 2>&1
3510         cf_cv_make_PHONY="`cat conftest.tmp`"
3511         rm -rf conftest*
3512
3513 fi
3514 echo "$as_me:3514: result: $cf_cv_make_PHONY" >&5
3515 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3516 MAKE_NO_PHONY="#"
3517 MAKE_PHONY="#"
3518 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3519 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3520
3521 for ac_prog in exctags ctags
3522 do
3523   # Extract the first word of "$ac_prog", so it can be a program name with args.
3524 set dummy $ac_prog; ac_word=$2
3525 echo "$as_me:3525: checking for $ac_word" >&5
3526 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3527 if test "${ac_cv_prog_CTAGS+set}" = set; then
3528   echo $ECHO_N "(cached) $ECHO_C" >&6
3529 else
3530   if test -n "$CTAGS"; then
3531   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3532 else
3533   ac_save_IFS=$IFS; IFS=$ac_path_separator
3534 ac_dummy="$PATH"
3535 for ac_dir in $ac_dummy; do
3536   IFS=$ac_save_IFS
3537   test -z "$ac_dir" && ac_dir=.
3538   $as_executable_p "$ac_dir/$ac_word" || continue
3539 ac_cv_prog_CTAGS="$ac_prog"
3540 echo "$as_me:3540: found $ac_dir/$ac_word" >&5
3541 break
3542 done
3543
3544 fi
3545 fi
3546 CTAGS=$ac_cv_prog_CTAGS
3547 if test -n "$CTAGS"; then
3548   echo "$as_me:3548: result: $CTAGS" >&5
3549 echo "${ECHO_T}$CTAGS" >&6
3550 else
3551   echo "$as_me:3551: result: no" >&5
3552 echo "${ECHO_T}no" >&6
3553 fi
3554
3555   test -n "$CTAGS" && break
3556 done
3557
3558 for ac_prog in exetags etags
3559 do
3560   # Extract the first word of "$ac_prog", so it can be a program name with args.
3561 set dummy $ac_prog; ac_word=$2
3562 echo "$as_me:3562: checking for $ac_word" >&5
3563 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3564 if test "${ac_cv_prog_ETAGS+set}" = set; then
3565   echo $ECHO_N "(cached) $ECHO_C" >&6
3566 else
3567   if test -n "$ETAGS"; then
3568   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3569 else
3570   ac_save_IFS=$IFS; IFS=$ac_path_separator
3571 ac_dummy="$PATH"
3572 for ac_dir in $ac_dummy; do
3573   IFS=$ac_save_IFS
3574   test -z "$ac_dir" && ac_dir=.
3575   $as_executable_p "$ac_dir/$ac_word" || continue
3576 ac_cv_prog_ETAGS="$ac_prog"
3577 echo "$as_me:3577: found $ac_dir/$ac_word" >&5
3578 break
3579 done
3580
3581 fi
3582 fi
3583 ETAGS=$ac_cv_prog_ETAGS
3584 if test -n "$ETAGS"; then
3585   echo "$as_me:3585: result: $ETAGS" >&5
3586 echo "${ECHO_T}$ETAGS" >&6
3587 else
3588   echo "$as_me:3588: result: no" >&5
3589 echo "${ECHO_T}no" >&6
3590 fi
3591
3592   test -n "$ETAGS" && break
3593 done
3594
3595 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3596 set dummy ${CTAGS:-ctags}; ac_word=$2
3597 echo "$as_me:3597: checking for $ac_word" >&5
3598 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3599 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3600   echo $ECHO_N "(cached) $ECHO_C" >&6
3601 else
3602   if test -n "$MAKE_LOWER_TAGS"; then
3603   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3604 else
3605   ac_save_IFS=$IFS; IFS=$ac_path_separator
3606 ac_dummy="$PATH"
3607 for ac_dir in $ac_dummy; do
3608   IFS=$ac_save_IFS
3609   test -z "$ac_dir" && ac_dir=.
3610   $as_executable_p "$ac_dir/$ac_word" || continue
3611 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3612 echo "$as_me:3612: found $ac_dir/$ac_word" >&5
3613 break
3614 done
3615
3616   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3617 fi
3618 fi
3619 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3620 if test -n "$MAKE_LOWER_TAGS"; then
3621   echo "$as_me:3621: result: $MAKE_LOWER_TAGS" >&5
3622 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3623 else
3624   echo "$as_me:3624: result: no" >&5
3625 echo "${ECHO_T}no" >&6
3626 fi
3627
3628 if test "$cf_cv_mixedcase" = yes ; then
3629         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3630 set dummy ${ETAGS:-etags}; ac_word=$2
3631 echo "$as_me:3631: checking for $ac_word" >&5
3632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3633 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3634   echo $ECHO_N "(cached) $ECHO_C" >&6
3635 else
3636   if test -n "$MAKE_UPPER_TAGS"; then
3637   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3638 else
3639   ac_save_IFS=$IFS; IFS=$ac_path_separator
3640 ac_dummy="$PATH"
3641 for ac_dir in $ac_dummy; do
3642   IFS=$ac_save_IFS
3643   test -z "$ac_dir" && ac_dir=.
3644   $as_executable_p "$ac_dir/$ac_word" || continue
3645 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3646 echo "$as_me:3646: found $ac_dir/$ac_word" >&5
3647 break
3648 done
3649
3650   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3651 fi
3652 fi
3653 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3654 if test -n "$MAKE_UPPER_TAGS"; then
3655   echo "$as_me:3655: result: $MAKE_UPPER_TAGS" >&5
3656 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3657 else
3658   echo "$as_me:3658: result: no" >&5
3659 echo "${ECHO_T}no" >&6
3660 fi
3661
3662 else
3663         MAKE_UPPER_TAGS=no
3664 fi
3665
3666 if test "$MAKE_UPPER_TAGS" = yes ; then
3667         MAKE_UPPER_TAGS=
3668 else
3669         MAKE_UPPER_TAGS="#"
3670 fi
3671
3672 if test "$MAKE_LOWER_TAGS" = yes ; then
3673         MAKE_LOWER_TAGS=
3674 else
3675         MAKE_LOWER_TAGS="#"
3676 fi
3677
3678 echo "$as_me:3678: checking for makeflags variable" >&5
3679 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3680 if test "${cf_cv_makeflags+set}" = set; then
3681   echo $ECHO_N "(cached) $ECHO_C" >&6
3682 else
3683
3684         cf_cv_makeflags=''
3685         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3686         do
3687                 cat >cf_makeflags.tmp <<CF_EOF
3688 SHELL = $SHELL
3689 all :
3690         @ echo '.$cf_option'
3691 CF_EOF
3692                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3693                 case "$cf_result" in
3694                 (.*k|.*kw)
3695                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3696                         case "$cf_result" in
3697                         (.*CC=*)        cf_cv_makeflags=
3698                                 ;;
3699                         (*)     cf_cv_makeflags=$cf_option
3700                                 ;;
3701                         esac
3702                         break
3703                         ;;
3704                 (.-)
3705                         ;;
3706                 (*)
3707
3708 echo "${as_me:-configure}:3708: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3709
3710                         ;;
3711                 esac
3712         done
3713         rm -f cf_makeflags.tmp
3714
3715 fi
3716 echo "$as_me:3716: result: $cf_cv_makeflags" >&5
3717 echo "${ECHO_T}$cf_cv_makeflags" >&6
3718
3719 if test -n "$ac_tool_prefix"; then
3720   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3721 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3722 echo "$as_me:3722: checking for $ac_word" >&5
3723 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3724 if test "${ac_cv_prog_RANLIB+set}" = set; then
3725   echo $ECHO_N "(cached) $ECHO_C" >&6
3726 else
3727   if test -n "$RANLIB"; then
3728   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3729 else
3730   ac_save_IFS=$IFS; IFS=$ac_path_separator
3731 ac_dummy="$PATH"
3732 for ac_dir in $ac_dummy; do
3733   IFS=$ac_save_IFS
3734   test -z "$ac_dir" && ac_dir=.
3735   $as_executable_p "$ac_dir/$ac_word" || continue
3736 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3737 echo "$as_me:3737: found $ac_dir/$ac_word" >&5
3738 break
3739 done
3740
3741 fi
3742 fi
3743 RANLIB=$ac_cv_prog_RANLIB
3744 if test -n "$RANLIB"; then
3745   echo "$as_me:3745: result: $RANLIB" >&5
3746 echo "${ECHO_T}$RANLIB" >&6
3747 else
3748   echo "$as_me:3748: result: no" >&5
3749 echo "${ECHO_T}no" >&6
3750 fi
3751
3752 fi
3753 if test -z "$ac_cv_prog_RANLIB"; then
3754   ac_ct_RANLIB=$RANLIB
3755   # Extract the first word of "ranlib", so it can be a program name with args.
3756 set dummy ranlib; ac_word=$2
3757 echo "$as_me:3757: checking for $ac_word" >&5
3758 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3759 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3760   echo $ECHO_N "(cached) $ECHO_C" >&6
3761 else
3762   if test -n "$ac_ct_RANLIB"; then
3763   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3764 else
3765   ac_save_IFS=$IFS; IFS=$ac_path_separator
3766 ac_dummy="$PATH"
3767 for ac_dir in $ac_dummy; do
3768   IFS=$ac_save_IFS
3769   test -z "$ac_dir" && ac_dir=.
3770   $as_executable_p "$ac_dir/$ac_word" || continue
3771 ac_cv_prog_ac_ct_RANLIB="ranlib"
3772 echo "$as_me:3772: found $ac_dir/$ac_word" >&5
3773 break
3774 done
3775
3776   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3777 fi
3778 fi
3779 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3780 if test -n "$ac_ct_RANLIB"; then
3781   echo "$as_me:3781: result: $ac_ct_RANLIB" >&5
3782 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3783 else
3784   echo "$as_me:3784: result: no" >&5
3785 echo "${ECHO_T}no" >&6
3786 fi
3787
3788   RANLIB=$ac_ct_RANLIB
3789 else
3790   RANLIB="$ac_cv_prog_RANLIB"
3791 fi
3792
3793 if test -n "$ac_tool_prefix"; then
3794   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3795 set dummy ${ac_tool_prefix}ld; ac_word=$2
3796 echo "$as_me:3796: checking for $ac_word" >&5
3797 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3798 if test "${ac_cv_prog_LD+set}" = set; then
3799   echo $ECHO_N "(cached) $ECHO_C" >&6
3800 else
3801   if test -n "$LD"; then
3802   ac_cv_prog_LD="$LD" # Let the user override the test.
3803 else
3804   ac_save_IFS=$IFS; IFS=$ac_path_separator
3805 ac_dummy="$PATH"
3806 for ac_dir in $ac_dummy; do
3807   IFS=$ac_save_IFS
3808   test -z "$ac_dir" && ac_dir=.
3809   $as_executable_p "$ac_dir/$ac_word" || continue
3810 ac_cv_prog_LD="${ac_tool_prefix}ld"
3811 echo "$as_me:3811: found $ac_dir/$ac_word" >&5
3812 break
3813 done
3814
3815 fi
3816 fi
3817 LD=$ac_cv_prog_LD
3818 if test -n "$LD"; then
3819   echo "$as_me:3819: result: $LD" >&5
3820 echo "${ECHO_T}$LD" >&6
3821 else
3822   echo "$as_me:3822: result: no" >&5
3823 echo "${ECHO_T}no" >&6
3824 fi
3825
3826 fi
3827 if test -z "$ac_cv_prog_LD"; then
3828   ac_ct_LD=$LD
3829   # Extract the first word of "ld", so it can be a program name with args.
3830 set dummy ld; ac_word=$2
3831 echo "$as_me:3831: checking for $ac_word" >&5
3832 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3833 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3834   echo $ECHO_N "(cached) $ECHO_C" >&6
3835 else
3836   if test -n "$ac_ct_LD"; then
3837   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3838 else
3839   ac_save_IFS=$IFS; IFS=$ac_path_separator
3840 ac_dummy="$PATH"
3841 for ac_dir in $ac_dummy; do
3842   IFS=$ac_save_IFS
3843   test -z "$ac_dir" && ac_dir=.
3844   $as_executable_p "$ac_dir/$ac_word" || continue
3845 ac_cv_prog_ac_ct_LD="ld"
3846 echo "$as_me:3846: found $ac_dir/$ac_word" >&5
3847 break
3848 done
3849
3850   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3851 fi
3852 fi
3853 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3854 if test -n "$ac_ct_LD"; then
3855   echo "$as_me:3855: result: $ac_ct_LD" >&5
3856 echo "${ECHO_T}$ac_ct_LD" >&6
3857 else
3858   echo "$as_me:3858: result: no" >&5
3859 echo "${ECHO_T}no" >&6
3860 fi
3861
3862   LD=$ac_ct_LD
3863 else
3864   LD="$ac_cv_prog_LD"
3865 fi
3866
3867 if test -n "$ac_tool_prefix"; then
3868   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3869 set dummy ${ac_tool_prefix}ar; ac_word=$2
3870 echo "$as_me:3870: checking for $ac_word" >&5
3871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3872 if test "${ac_cv_prog_AR+set}" = set; then
3873   echo $ECHO_N "(cached) $ECHO_C" >&6
3874 else
3875   if test -n "$AR"; then
3876   ac_cv_prog_AR="$AR" # Let the user override the test.
3877 else
3878   ac_save_IFS=$IFS; IFS=$ac_path_separator
3879 ac_dummy="$PATH"
3880 for ac_dir in $ac_dummy; do
3881   IFS=$ac_save_IFS
3882   test -z "$ac_dir" && ac_dir=.
3883   $as_executable_p "$ac_dir/$ac_word" || continue
3884 ac_cv_prog_AR="${ac_tool_prefix}ar"
3885 echo "$as_me:3885: found $ac_dir/$ac_word" >&5
3886 break
3887 done
3888
3889 fi
3890 fi
3891 AR=$ac_cv_prog_AR
3892 if test -n "$AR"; then
3893   echo "$as_me:3893: result: $AR" >&5
3894 echo "${ECHO_T}$AR" >&6
3895 else
3896   echo "$as_me:3896: result: no" >&5
3897 echo "${ECHO_T}no" >&6
3898 fi
3899
3900 fi
3901 if test -z "$ac_cv_prog_AR"; then
3902   ac_ct_AR=$AR
3903   # Extract the first word of "ar", so it can be a program name with args.
3904 set dummy ar; ac_word=$2
3905 echo "$as_me:3905: checking for $ac_word" >&5
3906 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3907 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3908   echo $ECHO_N "(cached) $ECHO_C" >&6
3909 else
3910   if test -n "$ac_ct_AR"; then
3911   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3912 else
3913   ac_save_IFS=$IFS; IFS=$ac_path_separator
3914 ac_dummy="$PATH"
3915 for ac_dir in $ac_dummy; do
3916   IFS=$ac_save_IFS
3917   test -z "$ac_dir" && ac_dir=.
3918   $as_executable_p "$ac_dir/$ac_word" || continue
3919 ac_cv_prog_ac_ct_AR="ar"
3920 echo "$as_me:3920: found $ac_dir/$ac_word" >&5
3921 break
3922 done
3923
3924   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3925 fi
3926 fi
3927 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3928 if test -n "$ac_ct_AR"; then
3929   echo "$as_me:3929: result: $ac_ct_AR" >&5
3930 echo "${ECHO_T}$ac_ct_AR" >&6
3931 else
3932   echo "$as_me:3932: result: no" >&5
3933 echo "${ECHO_T}no" >&6
3934 fi
3935
3936   AR=$ac_ct_AR
3937 else
3938   AR="$ac_cv_prog_AR"
3939 fi
3940
3941 if test -n "$ac_tool_prefix"; then
3942   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3943 set dummy ${ac_tool_prefix}ar; ac_word=$2
3944 echo "$as_me:3944: checking for $ac_word" >&5
3945 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3946 if test "${ac_cv_prog_AR+set}" = set; then
3947   echo $ECHO_N "(cached) $ECHO_C" >&6
3948 else
3949   if test -n "$AR"; then
3950   ac_cv_prog_AR="$AR" # Let the user override the test.
3951 else
3952   ac_save_IFS=$IFS; IFS=$ac_path_separator
3953 ac_dummy="$PATH"
3954 for ac_dir in $ac_dummy; do
3955   IFS=$ac_save_IFS
3956   test -z "$ac_dir" && ac_dir=.
3957   $as_executable_p "$ac_dir/$ac_word" || continue
3958 ac_cv_prog_AR="${ac_tool_prefix}ar"
3959 echo "$as_me:3959: found $ac_dir/$ac_word" >&5
3960 break
3961 done
3962
3963 fi
3964 fi
3965 AR=$ac_cv_prog_AR
3966 if test -n "$AR"; then
3967   echo "$as_me:3967: result: $AR" >&5
3968 echo "${ECHO_T}$AR" >&6
3969 else
3970   echo "$as_me:3970: result: no" >&5
3971 echo "${ECHO_T}no" >&6
3972 fi
3973
3974 fi
3975 if test -z "$ac_cv_prog_AR"; then
3976   ac_ct_AR=$AR
3977   # Extract the first word of "ar", so it can be a program name with args.
3978 set dummy ar; ac_word=$2
3979 echo "$as_me:3979: checking for $ac_word" >&5
3980 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3981 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3982   echo $ECHO_N "(cached) $ECHO_C" >&6
3983 else
3984   if test -n "$ac_ct_AR"; then
3985   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3986 else
3987   ac_save_IFS=$IFS; IFS=$ac_path_separator
3988 ac_dummy="$PATH"
3989 for ac_dir in $ac_dummy; do
3990   IFS=$ac_save_IFS
3991   test -z "$ac_dir" && ac_dir=.
3992   $as_executable_p "$ac_dir/$ac_word" || continue
3993 ac_cv_prog_ac_ct_AR="ar"
3994 echo "$as_me:3994: found $ac_dir/$ac_word" >&5
3995 break
3996 done
3997
3998   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3999 fi
4000 fi
4001 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4002 if test -n "$ac_ct_AR"; then
4003   echo "$as_me:4003: result: $ac_ct_AR" >&5
4004 echo "${ECHO_T}$ac_ct_AR" >&6
4005 else
4006   echo "$as_me:4006: result: no" >&5
4007 echo "${ECHO_T}no" >&6
4008 fi
4009
4010   AR=$ac_ct_AR
4011 else
4012   AR="$ac_cv_prog_AR"
4013 fi
4014
4015 echo "$as_me:4015: checking for options to update archives" >&5
4016 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4017 if test "${cf_cv_ar_flags+set}" = set; then
4018   echo $ECHO_N "(cached) $ECHO_C" >&6
4019 else
4020
4021         case "$cf_cv_system_name" in
4022         (*-msvc*)
4023                 cf_cv_ar_flags=''
4024                 cat >mk_static_lib.sh <<-EOF
4025                 #!$SHELL
4026                 MSVC_BIN="$AR"
4027                 out="\$1"
4028                 shift
4029                 exec \$MSVC_BIN -out:"\$out" \$@
4030                 EOF
4031                 chmod +x mk_static_lib.sh
4032                 AR=`pwd`/mk_static_lib.sh
4033                 ;;
4034         (*)
4035                 cf_cv_ar_flags=unknown
4036                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4037                 do
4038
4039                         # check if $ARFLAGS already contains this choice
4040                         if test "x$ARFLAGS" != "x" ; then
4041                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4042                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4043                                         cf_cv_ar_flags=
4044                                         break
4045                                 fi
4046                         fi
4047
4048                         rm -f "conftest.$ac_cv_objext"
4049                         rm -f conftest.a
4050
4051                         cat >"conftest.$ac_ext" <<EOF
4052 #line 4052 "configure"
4053 int     testdata[3] = { 123, 456, 789 };
4054 EOF
4055                         if { (eval echo "$as_me:4055: \"$ac_compile\"") >&5
4056   (eval $ac_compile) 2>&5
4057   ac_status=$?
4058   echo "$as_me:4058: \$? = $ac_status" >&5
4059   (exit "$ac_status"); } ; then
4060                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4061                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4062                                 if test -f conftest.a ; then
4063                                         cf_cv_ar_flags="$cf_ar_flags"
4064                                         break
4065                                 fi
4066                         else
4067                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4068
4069 echo "${as_me:-configure}:4069: testing cannot compile test-program ..." 1>&5
4070
4071                                 break
4072                         fi
4073                 done
4074                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4075                 ;;
4076         esac
4077
4078 fi
4079 echo "$as_me:4079: result: $cf_cv_ar_flags" >&5
4080 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4081
4082 if test -n "$ARFLAGS" ; then
4083         if test -n "$cf_cv_ar_flags" ; then
4084                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4085         fi
4086 else
4087         ARFLAGS=$cf_cv_ar_flags
4088 fi
4089
4090         echo "$as_me:4090: checking for PATH separator" >&5
4091 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4092         case "$cf_cv_system_name" in
4093         (os2*)  PATH_SEPARATOR=';'  ;;
4094         (*)     ${PATH_SEPARATOR:=':'}  ;;
4095         esac
4096
4097         echo "$as_me:4097: result: $PATH_SEPARATOR" >&5
4098 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4099
4100 echo "$as_me:4100: checking if you have specified an install-prefix" >&5
4101 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4102
4103 # Check whether --with-install-prefix or --without-install-prefix was given.
4104 if test "${with_install_prefix+set}" = set; then
4105   withval="$with_install_prefix"
4106   case "$withval" in
4107         (yes|no)
4108                 ;;
4109         (*)     DESTDIR="$withval"
4110                 ;;
4111         esac
4112 fi;
4113 echo "$as_me:4113: result: $DESTDIR" >&5
4114 echo "${ECHO_T}$DESTDIR" >&6
4115
4116 ###############################################################################
4117
4118 # If we're cross-compiling, allow the user to override the tools and their
4119 # options.  The configure script is oriented toward identifying the host
4120 # compiler, etc., but we need a build compiler to generate parts of the source.
4121
4122 if test "$cross_compiling" = yes ; then
4123
4124         # defaults that we might want to override
4125         : ${BUILD_CFLAGS:=''}
4126         : ${BUILD_CPPFLAGS:=''}
4127         : ${BUILD_LDFLAGS:=''}
4128         : ${BUILD_LIBS:=''}
4129         : ${BUILD_EXEEXT:='$x'}
4130         : ${BUILD_OBJEXT:='o'}
4131
4132 # Check whether --with-build-cc or --without-build-cc was given.
4133 if test "${with_build_cc+set}" = set; then
4134   withval="$with_build_cc"
4135   BUILD_CC="$withval"
4136 else
4137   for ac_prog in gcc clang c99 c89 cc cl
4138 do
4139   # Extract the first word of "$ac_prog", so it can be a program name with args.
4140 set dummy $ac_prog; ac_word=$2
4141 echo "$as_me:4141: checking for $ac_word" >&5
4142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4143 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4144   echo $ECHO_N "(cached) $ECHO_C" >&6
4145 else
4146   if test -n "$BUILD_CC"; then
4147   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4148 else
4149   ac_save_IFS=$IFS; IFS=$ac_path_separator
4150 ac_dummy="$PATH"
4151 for ac_dir in $ac_dummy; do
4152   IFS=$ac_save_IFS
4153   test -z "$ac_dir" && ac_dir=.
4154   $as_executable_p "$ac_dir/$ac_word" || continue
4155 ac_cv_prog_BUILD_CC="$ac_prog"
4156 echo "$as_me:4156: found $ac_dir/$ac_word" >&5
4157 break
4158 done
4159
4160 fi
4161 fi
4162 BUILD_CC=$ac_cv_prog_BUILD_CC
4163 if test -n "$BUILD_CC"; then
4164   echo "$as_me:4164: result: $BUILD_CC" >&5
4165 echo "${ECHO_T}$BUILD_CC" >&6
4166 else
4167   echo "$as_me:4167: result: no" >&5
4168 echo "${ECHO_T}no" >&6
4169 fi
4170
4171   test -n "$BUILD_CC" && break
4172 done
4173 test -n "$BUILD_CC" || BUILD_CC="none"
4174
4175 fi;
4176         echo "$as_me:4176: checking for native build C compiler" >&5
4177 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4178         echo "$as_me:4178: result: $BUILD_CC" >&5
4179 echo "${ECHO_T}$BUILD_CC" >&6
4180
4181         echo "$as_me:4181: checking for native build C preprocessor" >&5
4182 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4183
4184 # Check whether --with-build-cpp or --without-build-cpp was given.
4185 if test "${with_build_cpp+set}" = set; then
4186   withval="$with_build_cpp"
4187   BUILD_CPP="$withval"
4188 else
4189   BUILD_CPP='${BUILD_CC} -E'
4190 fi;
4191         echo "$as_me:4191: result: $BUILD_CPP" >&5
4192 echo "${ECHO_T}$BUILD_CPP" >&6
4193
4194         echo "$as_me:4194: checking for native build C flags" >&5
4195 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4196
4197 # Check whether --with-build-cflags or --without-build-cflags was given.
4198 if test "${with_build_cflags+set}" = set; then
4199   withval="$with_build_cflags"
4200   BUILD_CFLAGS="$withval"
4201 fi;
4202         echo "$as_me:4202: result: $BUILD_CFLAGS" >&5
4203 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4204
4205         echo "$as_me:4205: checking for native build C preprocessor-flags" >&5
4206 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4207
4208 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4209 if test "${with_build_cppflags+set}" = set; then
4210   withval="$with_build_cppflags"
4211   BUILD_CPPFLAGS="$withval"
4212 fi;
4213         echo "$as_me:4213: result: $BUILD_CPPFLAGS" >&5
4214 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4215
4216         echo "$as_me:4216: checking for native build linker-flags" >&5
4217 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4218
4219 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4220 if test "${with_build_ldflags+set}" = set; then
4221   withval="$with_build_ldflags"
4222   BUILD_LDFLAGS="$withval"
4223 fi;
4224         echo "$as_me:4224: result: $BUILD_LDFLAGS" >&5
4225 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4226
4227         echo "$as_me:4227: checking for native build linker-libraries" >&5
4228 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4229
4230 # Check whether --with-build-libs or --without-build-libs was given.
4231 if test "${with_build_libs+set}" = set; then
4232   withval="$with_build_libs"
4233   BUILD_LIBS="$withval"
4234 fi;
4235         echo "$as_me:4235: result: $BUILD_LIBS" >&5
4236 echo "${ECHO_T}$BUILD_LIBS" >&6
4237
4238         # this assumes we're on Unix.
4239         BUILD_EXEEXT=
4240         BUILD_OBJEXT=o
4241
4242         : ${BUILD_CC:='${CC}'}
4243
4244         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4245                 { { echo "$as_me:4245: error: Cross-build requires two compilers.
4246 Use --with-build-cc to specify the native compiler." >&5
4247 echo "$as_me: error: Cross-build requires two compilers.
4248 Use --with-build-cc to specify the native compiler." >&2;}
4249    { (exit 1); exit 1; }; }
4250         fi
4251
4252 else
4253         : ${BUILD_CC:='${CC}'}
4254         : ${BUILD_CPP:='${CPP}'}
4255         : ${BUILD_CFLAGS:='${CFLAGS}'}
4256         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4257         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4258         : ${BUILD_LIBS:='${LIBS}'}
4259         : ${BUILD_EXEEXT:='$x'}
4260         : ${BUILD_OBJEXT:='o'}
4261 fi
4262
4263 ###############################################################################
4264
4265 ### Options to allow the user to specify the set of libraries which are used.
4266 ### Use "--without-normal --with-shared" to allow the default model to be
4267 ### shared, for example.
4268 cf_list_models=""
4269
4270 echo "$as_me:4270: checking if you want to build shared C-objects" >&5
4271 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4272
4273 # Check whether --with-shared or --without-shared was given.
4274 if test "${with_shared+set}" = set; then
4275   withval="$with_shared"
4276   with_shared=$withval
4277 else
4278   with_shared=no
4279 fi;
4280 echo "$as_me:4280: result: $with_shared" >&5
4281 echo "${ECHO_T}$with_shared" >&6
4282 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4283
4284 echo "$as_me:4284: checking for specified models" >&5
4285 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4286 test -z "$cf_list_models" && cf_list_models=normal
4287 echo "$as_me:4287: result: $cf_list_models" >&5
4288 echo "${ECHO_T}$cf_list_models" >&6
4289
4290 ### Use the first model as the default, and save its suffix for use in building
4291 ### up test-applications.
4292 echo "$as_me:4292: checking for default model" >&5
4293 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4294 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4295 echo "$as_me:4295: result: $DFT_LWR_MODEL" >&5
4296 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4297
4298 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4299
4300 echo "$as_me:4300: checking for specific curses-directory" >&5
4301 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4302
4303 # Check whether --with-curses-dir or --without-curses-dir was given.
4304 if test "${with_curses_dir+set}" = set; then
4305   withval="$with_curses_dir"
4306   cf_cv_curses_dir=$withval
4307 else
4308   cf_cv_curses_dir=no
4309 fi;
4310 echo "$as_me:4310: result: $cf_cv_curses_dir" >&5
4311 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4312
4313 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4314 then
4315
4316 if test "x$prefix" != xNONE; then
4317         cf_path_syntax="$prefix"
4318 else
4319         cf_path_syntax="$ac_default_prefix"
4320 fi
4321
4322 case ".$withval" in
4323 (.\$\(*\)*|.\'*\'*)
4324         ;;
4325 (..|./*|.\\*)
4326         ;;
4327 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4328         ;;
4329 (.\$\{*prefix\}*|.\$\{*dir\}*)
4330         eval withval="$withval"
4331         case ".$withval" in
4332         (.NONE/*)
4333                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4334                 ;;
4335         esac
4336         ;;
4337 (.no|.NONE/*)
4338         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4339         ;;
4340 (*)
4341         { { echo "$as_me:4341: error: expected a pathname, not \"$withval\"" >&5
4342 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4343    { (exit 1); exit 1; }; }
4344         ;;
4345 esac
4346
4347         if test -d "$cf_cv_curses_dir"
4348         then
4349
4350 if test -n "$cf_cv_curses_dir/include" ; then
4351   for cf_add_incdir in $cf_cv_curses_dir/include
4352   do
4353         while test "$cf_add_incdir" != /usr/include
4354         do
4355           if test -d "$cf_add_incdir"
4356           then
4357                 cf_have_incdir=no
4358                 if test -n "$CFLAGS$CPPFLAGS" ; then
4359                   # a loop is needed to ensure we can add subdirs of existing dirs
4360                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4361                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4362                           cf_have_incdir=yes; break
4363                         fi
4364                   done
4365                 fi
4366
4367                 if test "$cf_have_incdir" = no ; then
4368                   if test "$cf_add_incdir" = /usr/local/include ; then
4369                         if test "$GCC" = yes
4370                         then
4371                           cf_save_CPPFLAGS=$CPPFLAGS
4372
4373         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4374         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4375
4376                           cat >"conftest.$ac_ext" <<_ACEOF
4377 #line 4377 "configure"
4378 #include "confdefs.h"
4379 #include <stdio.h>
4380 int
4381 main (void)
4382 {
4383 printf("Hello")
4384   ;
4385   return 0;
4386 }
4387 _ACEOF
4388 rm -f "conftest.$ac_objext"
4389 if { (eval echo "$as_me:4389: \"$ac_compile\"") >&5
4390   (eval $ac_compile) 2>&5
4391   ac_status=$?
4392   echo "$as_me:4392: \$? = $ac_status" >&5
4393   (exit "$ac_status"); } &&
4394          { ac_try='test -s "conftest.$ac_objext"'
4395   { (eval echo "$as_me:4395: \"$ac_try\"") >&5
4396   (eval $ac_try) 2>&5
4397   ac_status=$?
4398   echo "$as_me:4398: \$? = $ac_status" >&5
4399   (exit "$ac_status"); }; }; then
4400   :
4401 else
4402   echo "$as_me: failed program was:" >&5
4403 cat "conftest.$ac_ext" >&5
4404 cf_have_incdir=yes
4405 fi
4406 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4407                           CPPFLAGS=$cf_save_CPPFLAGS
4408                         fi
4409                   fi
4410                 fi
4411
4412                 if test "$cf_have_incdir" = no ; then
4413                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4414
4415 echo "${as_me:-configure}:4415: testing adding $cf_add_incdir to include-path ..." 1>&5
4416
4417                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4418
4419                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4420                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4421                   cf_add_incdir="$cf_top_incdir"
4422                 else
4423                   break
4424                 fi
4425           else
4426                 break
4427           fi
4428         done
4429   done
4430 fi
4431
4432 if test -n "$cf_cv_curses_dir/lib" ; then
4433         for cf_add_libdir in $cf_cv_curses_dir/lib
4434         do
4435                 if test "$cf_add_libdir" = /usr/lib ; then
4436                         :
4437                 elif test -d "$cf_add_libdir"
4438                 then
4439                         cf_have_libdir=no
4440                         if test -n "$LDFLAGS$LIBS" ; then
4441                                 # a loop is needed to ensure we can add subdirs of existing dirs
4442                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4443                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4444                                                 cf_have_libdir=yes; break
4445                                         fi
4446                                 done
4447                         fi
4448                         if test "$cf_have_libdir" = no ; then
4449                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4450
4451 echo "${as_me:-configure}:4451: testing adding $cf_add_libdir to library-path ..." 1>&5
4452
4453                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4454                         fi
4455                 fi
4456         done
4457 fi
4458
4459         fi
4460 fi
4461
4462 cf_ncuconfig_root=ncurses
4463 cf_have_ncuconfig=no
4464
4465 if test "x${PKG_CONFIG:=none}" != xnone; then
4466         echo "$as_me:4466: checking pkg-config for $cf_ncuconfig_root" >&5
4467 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4468         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4469                 echo "$as_me:4469: result: yes" >&5
4470 echo "${ECHO_T}yes" >&6
4471
4472                 echo "$as_me:4472: checking if the $cf_ncuconfig_root package files work" >&5
4473 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4474                 cf_have_ncuconfig=unknown
4475
4476                 cf_save_CFLAGS="$CFLAGS"
4477                 cf_save_CPPFLAGS="$CPPFLAGS"
4478                 cf_save_LIBS="$LIBS"
4479
4480                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4481                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4482
4483                 # while -W for passing linker flags is prevalent, it is not "standard".
4484                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4485                 # incompatible _and_ non-standard -W option which gives an error.  Work
4486                 # around that pitfall.
4487                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4488                 (x*c[89]9@@*-W*)
4489
4490 cf_fix_cppflags=no
4491 cf_new_cflags=
4492 cf_new_cppflags=
4493 cf_new_extra_cppflags=
4494
4495 for cf_add_cflags in $cf_pkg_cflags
4496 do
4497 case "$cf_fix_cppflags" in
4498 (no)
4499         case "$cf_add_cflags" in
4500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4501                 case "$cf_add_cflags" in
4502                 (-D*)
4503                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4504
4505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4506                                 && test -z "${cf_tst_cflags}" \
4507                                 && cf_fix_cppflags=yes
4508
4509                         if test "$cf_fix_cppflags" = yes ; then
4510
4511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4513
4514                                 continue
4515                         elif test "${cf_tst_cflags}" = "\"'" ; then
4516
4517         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4518         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4519
4520                                 continue
4521                         fi
4522                         ;;
4523                 esac
4524                 case "$CPPFLAGS" in
4525                 (*$cf_add_cflags)
4526                         ;;
4527                 (*)
4528                         case "$cf_add_cflags" in
4529                         (-D*)
4530                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4531
4532 CPPFLAGS=`echo "$CPPFLAGS" | \
4533         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4534                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4535
4536                                 ;;
4537                         esac
4538
4539         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4540         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4541
4542                         ;;
4543                 esac
4544                 ;;
4545         (*)
4546
4547         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4548         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4549
4550                 ;;
4551         esac
4552         ;;
4553 (yes)
4554
4555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4557
4558         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4559
4560         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4561                 && test -z "${cf_tst_cflags}" \
4562                 && cf_fix_cppflags=no
4563         ;;
4564 esac
4565 done
4566
4567 if test -n "$cf_new_cflags" ; then
4568
4569         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4570         CFLAGS="${CFLAGS}$cf_new_cflags"
4571
4572 fi
4573
4574 if test -n "$cf_new_cppflags" ; then
4575
4576         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4577         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4578
4579 fi
4580
4581 if test -n "$cf_new_extra_cppflags" ; then
4582
4583         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4584         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4585
4586 fi
4587
4588 cf_add_libs="$LIBS"
4589 # reverse order
4590 cf_add_0lib=
4591 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4592 # filter duplicates
4593 for cf_add_1lib in $cf_add_0lib; do
4594         for cf_add_2lib in $cf_add_libs; do
4595                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4596                         cf_add_1lib=
4597                         break
4598                 fi
4599         done
4600         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4601 done
4602 LIBS="$cf_add_libs"
4603
4604                         cat >"conftest.$ac_ext" <<_ACEOF
4605 #line 4605 "configure"
4606 #include "confdefs.h"
4607 #include <${cf_cv_ncurses_header:-curses.h}>
4608 int
4609 main (void)
4610 {
4611 initscr(); mousemask(0,0); tigetstr((char *)0);
4612   ;
4613   return 0;
4614 }
4615 _ACEOF
4616 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4617 if { (eval echo "$as_me:4617: \"$ac_link\"") >&5
4618   (eval $ac_link) 2>&5
4619   ac_status=$?
4620   echo "$as_me:4620: \$? = $ac_status" >&5
4621   (exit "$ac_status"); } &&
4622          { ac_try='test -s "conftest$ac_exeext"'
4623   { (eval echo "$as_me:4623: \"$ac_try\"") >&5
4624   (eval $ac_try) 2>&5
4625   ac_status=$?
4626   echo "$as_me:4626: \$? = $ac_status" >&5
4627   (exit "$ac_status"); }; }; then
4628   if test "$cross_compiling" = yes; then
4629   cf_test_ncuconfig=maybe
4630 else
4631   cat >"conftest.$ac_ext" <<_ACEOF
4632 #line 4632 "configure"
4633 #include "confdefs.h"
4634 #include <${cf_cv_ncurses_header:-curses.h}>
4635                                         int main(void)
4636                                         { const char *xx = curses_version(); return (xx == 0); }
4637 _ACEOF
4638 rm -f "conftest$ac_exeext"
4639 if { (eval echo "$as_me:4639: \"$ac_link\"") >&5
4640   (eval $ac_link) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4644   { (eval echo "$as_me:4644: \"$ac_try\"") >&5
4645   (eval $ac_try) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit "$ac_status"); }; }; then
4649   cf_test_ncuconfig=yes
4650 else
4651   echo "$as_me: program exited with status $ac_status" >&5
4652 echo "$as_me: failed program was:" >&5
4653 cat "conftest.$ac_ext" >&5
4654 cf_test_ncuconfig=no
4655 fi
4656 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4657 fi
4658 else
4659   echo "$as_me: failed program was:" >&5
4660 cat "conftest.$ac_ext" >&5
4661 cf_test_ncuconfig=no
4662 fi
4663 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4664
4665                         CFLAGS="$cf_save_CFLAGS"
4666                         CPPFLAGS="$cf_save_CPPFLAGS"
4667                         LIBS="$cf_save_LIBS"
4668
4669                         if test "x$cf_test_ncuconfig" != xyes; then
4670                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4671                                 cf_pkg_cflags="$cf_temp"
4672                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4673                                 cf_pkg_libs="$cf_temp"
4674                         fi
4675                         ;;
4676                 esac
4677
4678 cf_fix_cppflags=no
4679 cf_new_cflags=
4680 cf_new_cppflags=
4681 cf_new_extra_cppflags=
4682
4683 for cf_add_cflags in $cf_pkg_cflags
4684 do
4685 case "$cf_fix_cppflags" in
4686 (no)
4687         case "$cf_add_cflags" in
4688         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4689                 case "$cf_add_cflags" in
4690                 (-D*)
4691                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4692
4693                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4694                                 && test -z "${cf_tst_cflags}" \
4695                                 && cf_fix_cppflags=yes
4696
4697                         if test "$cf_fix_cppflags" = yes ; then
4698
4699         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4700         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4701
4702                                 continue
4703                         elif test "${cf_tst_cflags}" = "\"'" ; then
4704
4705         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4706         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4707
4708                                 continue
4709                         fi
4710                         ;;
4711                 esac
4712                 case "$CPPFLAGS" in
4713                 (*$cf_add_cflags)
4714                         ;;
4715                 (*)
4716                         case "$cf_add_cflags" in
4717                         (-D*)
4718                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4719
4720 CPPFLAGS=`echo "$CPPFLAGS" | \
4721         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4722                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4723
4724                                 ;;
4725                         esac
4726
4727         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4728         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4729
4730                         ;;
4731                 esac
4732                 ;;
4733         (*)
4734
4735         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4736         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4737
4738                 ;;
4739         esac
4740         ;;
4741 (yes)
4742
4743         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4744         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4745
4746         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4747
4748         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4749                 && test -z "${cf_tst_cflags}" \
4750                 && cf_fix_cppflags=no
4751         ;;
4752 esac
4753 done
4754
4755 if test -n "$cf_new_cflags" ; then
4756
4757         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4758         CFLAGS="${CFLAGS}$cf_new_cflags"
4759
4760 fi
4761
4762 if test -n "$cf_new_cppflags" ; then
4763
4764         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4765         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4766
4767 fi
4768
4769 if test -n "$cf_new_extra_cppflags" ; then
4770
4771         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4772         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4773
4774 fi
4775
4776 cf_add_libs="$LIBS"
4777 # reverse order
4778 cf_add_0lib=
4779 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4780 # filter duplicates
4781 for cf_add_1lib in $cf_add_0lib; do
4782         for cf_add_2lib in $cf_add_libs; do
4783                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4784                         cf_add_1lib=
4785                         break
4786                 fi
4787         done
4788         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4789 done
4790 LIBS="$cf_add_libs"
4791
4792                 cat >"conftest.$ac_ext" <<_ACEOF
4793 #line 4793 "configure"
4794 #include "confdefs.h"
4795 #include <${cf_cv_ncurses_header:-curses.h}>
4796 int
4797 main (void)
4798 {
4799 initscr(); mousemask(0,0); tigetstr((char *)0);
4800   ;
4801   return 0;
4802 }
4803 _ACEOF
4804 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4805 if { (eval echo "$as_me:4805: \"$ac_link\"") >&5
4806   (eval $ac_link) 2>&5
4807   ac_status=$?
4808   echo "$as_me:4808: \$? = $ac_status" >&5
4809   (exit "$ac_status"); } &&
4810          { ac_try='test -s "conftest$ac_exeext"'
4811   { (eval echo "$as_me:4811: \"$ac_try\"") >&5
4812   (eval $ac_try) 2>&5
4813   ac_status=$?
4814   echo "$as_me:4814: \$? = $ac_status" >&5
4815   (exit "$ac_status"); }; }; then
4816   if test "$cross_compiling" = yes; then
4817   cf_have_ncuconfig=maybe
4818 else
4819   cat >"conftest.$ac_ext" <<_ACEOF
4820 #line 4820 "configure"
4821 #include "confdefs.h"
4822 #include <${cf_cv_ncurses_header:-curses.h}>
4823                                 int main(void)
4824                                 { const char *xx = curses_version(); return (xx == 0); }
4825 _ACEOF
4826 rm -f "conftest$ac_exeext"
4827 if { (eval echo "$as_me:4827: \"$ac_link\"") >&5
4828   (eval $ac_link) 2>&5
4829   ac_status=$?
4830   echo "$as_me:4830: \$? = $ac_status" >&5
4831   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4832   { (eval echo "$as_me:4832: \"$ac_try\"") >&5
4833   (eval $ac_try) 2>&5
4834   ac_status=$?
4835   echo "$as_me:4835: \$? = $ac_status" >&5
4836   (exit "$ac_status"); }; }; then
4837   cf_have_ncuconfig=yes
4838 else
4839   echo "$as_me: program exited with status $ac_status" >&5
4840 echo "$as_me: failed program was:" >&5
4841 cat "conftest.$ac_ext" >&5
4842 cf_have_ncuconfig=no
4843 fi
4844 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4845 fi
4846 else
4847   echo "$as_me: failed program was:" >&5
4848 cat "conftest.$ac_ext" >&5
4849 cf_have_ncuconfig=no
4850 fi
4851 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4852                 echo "$as_me:4852: result: $cf_have_ncuconfig" >&5
4853 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4854                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4855                 if test "$cf_have_ncuconfig" != "yes"
4856                 then
4857                         CPPFLAGS="$cf_save_CPPFLAGS"
4858                         LIBS="$cf_save_LIBS"
4859                         NCURSES_CONFIG_PKG=none
4860                 else
4861
4862 cat >>confdefs.h <<\EOF
4863 #define NCURSES 1
4864 EOF
4865
4866                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4867
4868 echo "$as_me:4868: checking for terminfo header" >&5
4869 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4870 if test "${cf_cv_term_header+set}" = set; then
4871   echo $ECHO_N "(cached) $ECHO_C" >&6
4872 else
4873
4874 case "${cf_cv_ncurses_header}" in
4875 (*/ncurses.h|*/ncursesw.h)
4876         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4877         ;;
4878 (*)
4879         cf_term_header=term.h
4880         ;;
4881 esac
4882
4883 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4884 do
4885 cat >"conftest.$ac_ext" <<_ACEOF
4886 #line 4886 "configure"
4887 #include "confdefs.h"
4888 #include <stdio.h>
4889 #include <${cf_cv_ncurses_header:-curses.h}>
4890 #include <$cf_test>
4891
4892 int
4893 main (void)
4894 {
4895 int x = auto_left_margin; (void)x
4896   ;
4897   return 0;
4898 }
4899 _ACEOF
4900 rm -f "conftest.$ac_objext"
4901 if { (eval echo "$as_me:4901: \"$ac_compile\"") >&5
4902   (eval $ac_compile) 2>&5
4903   ac_status=$?
4904   echo "$as_me:4904: \$? = $ac_status" >&5
4905   (exit "$ac_status"); } &&
4906          { ac_try='test -s "conftest.$ac_objext"'
4907   { (eval echo "$as_me:4907: \"$ac_try\"") >&5
4908   (eval $ac_try) 2>&5
4909   ac_status=$?
4910   echo "$as_me:4910: \$? = $ac_status" >&5
4911   (exit "$ac_status"); }; }; then
4912
4913         cf_cv_term_header="$cf_test"
4914 else
4915   echo "$as_me: failed program was:" >&5
4916 cat "conftest.$ac_ext" >&5
4917
4918         cf_cv_term_header=unknown
4919
4920 fi
4921 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4922         test "$cf_cv_term_header" != unknown && break
4923 done
4924
4925 fi
4926 echo "$as_me:4926: result: $cf_cv_term_header" >&5
4927 echo "${ECHO_T}$cf_cv_term_header" >&6
4928
4929 # Set definitions to allow ifdef'ing to accommodate subdirectories
4930
4931 case "$cf_cv_term_header" in
4932 (*term.h)
4933
4934 cat >>confdefs.h <<\EOF
4935 #define HAVE_TERM_H 1
4936 EOF
4937
4938         ;;
4939 esac
4940
4941 case "$cf_cv_term_header" in
4942 (ncurses/term.h)
4943
4944 cat >>confdefs.h <<\EOF
4945 #define HAVE_NCURSES_TERM_H 1
4946 EOF
4947
4948         ;;
4949 (ncursesw/term.h)
4950
4951 cat >>confdefs.h <<\EOF
4952 #define HAVE_NCURSESW_TERM_H 1
4953 EOF
4954
4955         ;;
4956 esac
4957
4958                 fi
4959
4960         else
4961                 echo "$as_me:4961: result: no" >&5
4962 echo "${ECHO_T}no" >&6
4963                 NCURSES_CONFIG_PKG=none
4964         fi
4965 else
4966         NCURSES_CONFIG_PKG=none
4967 fi
4968
4969 if test "x$cf_have_ncuconfig" = "xno"; then
4970         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4971
4972 if test -n "$ac_tool_prefix"; then
4973   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4974   do
4975     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4976 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4977 echo "$as_me:4977: checking for $ac_word" >&5
4978 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4979 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4980   echo $ECHO_N "(cached) $ECHO_C" >&6
4981 else
4982   if test -n "$NCURSES_CONFIG"; then
4983   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4984 else
4985   ac_save_IFS=$IFS; IFS=$ac_path_separator
4986 ac_dummy="$PATH"
4987 for ac_dir in $ac_dummy; do
4988   IFS=$ac_save_IFS
4989   test -z "$ac_dir" && ac_dir=.
4990   $as_executable_p "$ac_dir/$ac_word" || continue
4991 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4992 echo "$as_me:4992: found $ac_dir/$ac_word" >&5
4993 break
4994 done
4995
4996 fi
4997 fi
4998 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4999 if test -n "$NCURSES_CONFIG"; then
5000   echo "$as_me:5000: result: $NCURSES_CONFIG" >&5
5001 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5002 else
5003   echo "$as_me:5003: result: no" >&5
5004 echo "${ECHO_T}no" >&6
5005 fi
5006
5007     test -n "$NCURSES_CONFIG" && break
5008   done
5009 fi
5010 if test -z "$NCURSES_CONFIG"; then
5011   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5012   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5013 do
5014   # Extract the first word of "$ac_prog", so it can be a program name with args.
5015 set dummy $ac_prog; ac_word=$2
5016 echo "$as_me:5016: checking for $ac_word" >&5
5017 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5018 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5019   echo $ECHO_N "(cached) $ECHO_C" >&6
5020 else
5021   if test -n "$ac_ct_NCURSES_CONFIG"; then
5022   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5023 else
5024   ac_save_IFS=$IFS; IFS=$ac_path_separator
5025 ac_dummy="$PATH"
5026 for ac_dir in $ac_dummy; do
5027   IFS=$ac_save_IFS
5028   test -z "$ac_dir" && ac_dir=.
5029   $as_executable_p "$ac_dir/$ac_word" || continue
5030 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5031 echo "$as_me:5031: found $ac_dir/$ac_word" >&5
5032 break
5033 done
5034
5035 fi
5036 fi
5037 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5038 if test -n "$ac_ct_NCURSES_CONFIG"; then
5039   echo "$as_me:5039: result: $ac_ct_NCURSES_CONFIG" >&5
5040 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5041 else
5042   echo "$as_me:5042: result: no" >&5
5043 echo "${ECHO_T}no" >&6
5044 fi
5045
5046   test -n "$ac_ct_NCURSES_CONFIG" && break
5047 done
5048 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5049
5050   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5051 fi
5052
5053         if test "$NCURSES_CONFIG" != none ; then
5054
5055 cf_fix_cppflags=no
5056 cf_new_cflags=
5057 cf_new_cppflags=
5058 cf_new_extra_cppflags=
5059
5060 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5061 do
5062 case "$cf_fix_cppflags" in
5063 (no)
5064         case "$cf_add_cflags" in
5065         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5066                 case "$cf_add_cflags" in
5067                 (-D*)
5068                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5069
5070                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5071                                 && test -z "${cf_tst_cflags}" \
5072                                 && cf_fix_cppflags=yes
5073
5074                         if test "$cf_fix_cppflags" = yes ; then
5075
5076         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5077         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5078
5079                                 continue
5080                         elif test "${cf_tst_cflags}" = "\"'" ; then
5081
5082         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5083         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5084
5085                                 continue
5086                         fi
5087                         ;;
5088                 esac
5089                 case "$CPPFLAGS" in
5090                 (*$cf_add_cflags)
5091                         ;;
5092                 (*)
5093                         case "$cf_add_cflags" in
5094                         (-D*)
5095                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5096
5097 CPPFLAGS=`echo "$CPPFLAGS" | \
5098         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5099                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5100
5101                                 ;;
5102                         esac
5103
5104         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5105         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5106
5107                         ;;
5108                 esac
5109                 ;;
5110         (*)
5111
5112         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5113         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5114
5115                 ;;
5116         esac
5117         ;;
5118 (yes)
5119
5120         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5121         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5122
5123         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5124
5125         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5126                 && test -z "${cf_tst_cflags}" \
5127                 && cf_fix_cppflags=no
5128         ;;
5129 esac
5130 done
5131
5132 if test -n "$cf_new_cflags" ; then
5133
5134         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5135         CFLAGS="${CFLAGS}$cf_new_cflags"
5136
5137 fi
5138
5139 if test -n "$cf_new_cppflags" ; then
5140
5141         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5142         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5143
5144 fi
5145
5146 if test -n "$cf_new_extra_cppflags" ; then
5147
5148         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5149         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5150
5151 fi
5152
5153 cf_add_libs="$LIBS"
5154 # reverse order
5155 cf_add_0lib=
5156 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5157 # filter duplicates
5158 for cf_add_1lib in $cf_add_0lib; do
5159         for cf_add_2lib in $cf_add_libs; do
5160                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5161                         cf_add_1lib=
5162                         break
5163                 fi
5164         done
5165         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5166 done
5167 LIBS="$cf_add_libs"
5168
5169                 # even with config script, some packages use no-override for curses.h
5170
5171 echo "$as_me:5171: checking if we have identified curses headers" >&5
5172 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5173 if test "${cf_cv_ncurses_header+set}" = set; then
5174   echo $ECHO_N "(cached) $ECHO_C" >&6
5175 else
5176
5177 cf_cv_ncurses_header=none
5178 for cf_header in \
5179         ncurses.h ncurses/ncurses.h \
5180         curses.h ncurses/curses.h
5181 do
5182 cat >"conftest.$ac_ext" <<_ACEOF
5183 #line 5183 "configure"
5184 #include "confdefs.h"
5185 #include <${cf_header}>
5186 int
5187 main (void)
5188 {
5189 initscr(); tgoto("?", 0,0)
5190   ;
5191   return 0;
5192 }
5193 _ACEOF
5194 rm -f "conftest.$ac_objext"
5195 if { (eval echo "$as_me:5195: \"$ac_compile\"") >&5
5196   (eval $ac_compile) 2>&5
5197   ac_status=$?
5198   echo "$as_me:5198: \$? = $ac_status" >&5
5199   (exit "$ac_status"); } &&
5200          { ac_try='test -s "conftest.$ac_objext"'
5201   { (eval echo "$as_me:5201: \"$ac_try\"") >&5
5202   (eval $ac_try) 2>&5
5203   ac_status=$?
5204   echo "$as_me:5204: \$? = $ac_status" >&5
5205   (exit "$ac_status"); }; }; then
5206   cf_cv_ncurses_header=$cf_header; break
5207 else
5208   echo "$as_me: failed program was:" >&5
5209 cat "conftest.$ac_ext" >&5
5210 fi
5211 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5212 done
5213
5214 fi
5215 echo "$as_me:5215: result: $cf_cv_ncurses_header" >&5
5216 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5217
5218 if test "$cf_cv_ncurses_header" = none ; then
5219         { { echo "$as_me:5219: error: No curses header-files found" >&5
5220 echo "$as_me: error: No curses header-files found" >&2;}
5221    { (exit 1); exit 1; }; }
5222 fi
5223
5224 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5225
5226 for ac_header in $cf_cv_ncurses_header
5227 do
5228 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5229 echo "$as_me:5229: checking for $ac_header" >&5
5230 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5231 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5232   echo $ECHO_N "(cached) $ECHO_C" >&6
5233 else
5234   cat >"conftest.$ac_ext" <<_ACEOF
5235 #line 5235 "configure"
5236 #include "confdefs.h"
5237 #include <$ac_header>
5238 _ACEOF
5239 if { (eval echo "$as_me:5239: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5240   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5241   ac_status=$?
5242   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5243   rm -f conftest.er1
5244   cat conftest.err >&5
5245   echo "$as_me:5245: \$? = $ac_status" >&5
5246   (exit "$ac_status"); } >/dev/null; then
5247   if test -s conftest.err; then
5248     ac_cpp_err=$ac_c_preproc_warn_flag
5249   else
5250     ac_cpp_err=
5251   fi
5252 else
5253   ac_cpp_err=yes
5254 fi
5255 if test -z "$ac_cpp_err"; then
5256   eval "$as_ac_Header=yes"
5257 else
5258   echo "$as_me: failed program was:" >&5
5259   cat "conftest.$ac_ext" >&5
5260   eval "$as_ac_Header=no"
5261 fi
5262 rm -f conftest.err "conftest.$ac_ext"
5263 fi
5264 echo "$as_me:5264: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5265 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5266 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5267   cat >>confdefs.h <<EOF
5268 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5269 EOF
5270
5271 fi
5272 done
5273
5274 cat >>confdefs.h <<\EOF
5275 #define NCURSES 1
5276 EOF
5277
5278 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5279
5280                 cat >>confdefs.h <<EOF
5281 #define $cf_nculib_ROOT 1
5282 EOF
5283
5284                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5285
5286         else
5287
5288 cf_ncuhdr_root=ncurses
5289
5290 test -n "$cf_cv_curses_dir" && \
5291 test "$cf_cv_curses_dir" != "no" && { \
5292
5293 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5294   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5295   do
5296         while test "$cf_add_incdir" != /usr/include
5297         do
5298           if test -d "$cf_add_incdir"
5299           then
5300                 cf_have_incdir=no
5301                 if test -n "$CFLAGS$CPPFLAGS" ; then
5302                   # a loop is needed to ensure we can add subdirs of existing dirs
5303                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5304                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5305                           cf_have_incdir=yes; break
5306                         fi
5307                   done
5308                 fi
5309
5310                 if test "$cf_have_incdir" = no ; then
5311                   if test "$cf_add_incdir" = /usr/local/include ; then
5312                         if test "$GCC" = yes
5313                         then
5314                           cf_save_CPPFLAGS=$CPPFLAGS
5315
5316         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5317         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5318
5319                           cat >"conftest.$ac_ext" <<_ACEOF
5320 #line 5320 "configure"
5321 #include "confdefs.h"
5322 #include <stdio.h>
5323 int
5324 main (void)
5325 {
5326 printf("Hello")
5327   ;
5328   return 0;
5329 }
5330 _ACEOF
5331 rm -f "conftest.$ac_objext"
5332 if { (eval echo "$as_me:5332: \"$ac_compile\"") >&5
5333   (eval $ac_compile) 2>&5
5334   ac_status=$?
5335   echo "$as_me:5335: \$? = $ac_status" >&5
5336   (exit "$ac_status"); } &&
5337          { ac_try='test -s "conftest.$ac_objext"'
5338   { (eval echo "$as_me:5338: \"$ac_try\"") >&5
5339   (eval $ac_try) 2>&5
5340   ac_status=$?
5341   echo "$as_me:5341: \$? = $ac_status" >&5
5342   (exit "$ac_status"); }; }; then
5343   :
5344 else
5345   echo "$as_me: failed program was:" >&5
5346 cat "conftest.$ac_ext" >&5
5347 cf_have_incdir=yes
5348 fi
5349 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5350                           CPPFLAGS=$cf_save_CPPFLAGS
5351                         fi
5352                   fi
5353                 fi
5354
5355                 if test "$cf_have_incdir" = no ; then
5356                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5357
5358 echo "${as_me:-configure}:5358: testing adding $cf_add_incdir to include-path ..." 1>&5
5359
5360                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5361
5362                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5363                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5364                   cf_add_incdir="$cf_top_incdir"
5365                 else
5366                   break
5367                 fi
5368           else
5369                 break
5370           fi
5371         done
5372   done
5373 fi
5374
5375 }
5376
5377 echo "$as_me:5377: checking for $cf_ncuhdr_root header in include-path" >&5
5378 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5379 if test "${cf_cv_ncurses_h+set}" = set; then
5380   echo $ECHO_N "(cached) $ECHO_C" >&6
5381 else
5382
5383         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5384         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5385         for cf_header in $cf_header_list
5386         do
5387
5388         cat >"conftest.$ac_ext" <<_ACEOF
5389 #line 5389 "configure"
5390 #include "confdefs.h"
5391
5392 #include <$cf_header>
5393 int
5394 main (void)
5395 {
5396
5397 #ifdef NCURSES_VERSION
5398
5399 printf("%s\\n", NCURSES_VERSION);
5400 #else
5401 #ifdef __NCURSES_H
5402 printf("old\\n");
5403 #else
5404         make an error
5405 #endif
5406 #endif
5407
5408   ;
5409   return 0;
5410 }
5411 _ACEOF
5412 rm -f "conftest.$ac_objext"
5413 if { (eval echo "$as_me:5413: \"$ac_compile\"") >&5
5414   (eval $ac_compile) 2>&5
5415   ac_status=$?
5416   echo "$as_me:5416: \$? = $ac_status" >&5
5417   (exit "$ac_status"); } &&
5418          { ac_try='test -s "conftest.$ac_objext"'
5419   { (eval echo "$as_me:5419: \"$ac_try\"") >&5
5420   (eval $ac_try) 2>&5
5421   ac_status=$?
5422   echo "$as_me:5422: \$? = $ac_status" >&5
5423   (exit "$ac_status"); }; }; then
5424   cf_cv_ncurses_h=$cf_header
5425
5426 else
5427   echo "$as_me: failed program was:" >&5
5428 cat "conftest.$ac_ext" >&5
5429 cf_cv_ncurses_h=no
5430 fi
5431 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5432
5433                 test "$cf_cv_ncurses_h" != no && break
5434         done
5435
5436 fi
5437 echo "$as_me:5437: result: $cf_cv_ncurses_h" >&5
5438 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5439
5440 if test "$cf_cv_ncurses_h" != no ; then
5441         cf_cv_ncurses_header=$cf_cv_ncurses_h
5442 else
5443
5444 echo "$as_me:5444: checking for $cf_ncuhdr_root include-path" >&5
5445 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5446 if test "${cf_cv_ncurses_h2+set}" = set; then
5447   echo $ECHO_N "(cached) $ECHO_C" >&6
5448 else
5449
5450         test -n "$verbose" && echo
5451
5452 cf_search=
5453
5454 # collect the current set of include-directories from compiler flags
5455 cf_header_path_list=""
5456 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5457         for cf_header_path in $CPPFLAGS $CFLAGS
5458         do
5459                 case "$cf_header_path" in
5460                 (-I*)
5461                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5462
5463 test "x$cf_header_path" != "xNONE" && \
5464 test -d "$cf_header_path" && \
5465  {
5466         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5467         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5468         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5469         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5470         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5471         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"
5472 }
5473
5474                         cf_header_path_list="$cf_header_path_list $cf_search"
5475                         ;;
5476                 esac
5477         done
5478 fi
5479
5480 # add the variations for the package we are looking for
5481
5482 cf_search=
5483
5484 test "x$prefix" != "xNONE" && \
5485 test -d "$prefix" && \
5486  {
5487         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5488         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5489         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5490         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5491         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5492         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5493 }
5494
5495 for cf_subdir_prefix in \
5496         /usr \
5497         /usr/local \
5498         /usr/pkg \
5499         /opt \
5500         /opt/local \
5501         $HOME
5502 do
5503
5504 test "x$cf_subdir_prefix" != "x$prefix" && \
5505 test -d "$cf_subdir_prefix" && \
5506 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5507         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5508         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5509         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5510         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5511         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5512         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"
5513 }
5514
5515 done
5516
5517 test "$includedir" != NONE && \
5518 test "$includedir" != "/usr/include" && \
5519 test -d "$includedir" && {
5520         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5521         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5522 }
5523
5524 test "$oldincludedir" != NONE && \
5525 test "$oldincludedir" != "/usr/include" && \
5526 test -d "$oldincludedir" && {
5527         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5528         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5529 }
5530
5531 cf_search="$cf_search $cf_header_path_list"
5532
5533         test -n "$verbose" && echo "search path $cf_search"
5534         cf_save2_CPPFLAGS="$CPPFLAGS"
5535         for cf_incdir in $cf_search
5536         do
5537
5538 if test -n "$cf_incdir" ; then
5539   for cf_add_incdir in $cf_incdir
5540   do
5541         while test "$cf_add_incdir" != /usr/include
5542         do
5543           if test -d "$cf_add_incdir"
5544           then
5545                 cf_have_incdir=no
5546                 if test -n "$CFLAGS$CPPFLAGS" ; then
5547                   # a loop is needed to ensure we can add subdirs of existing dirs
5548                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5549                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5550                           cf_have_incdir=yes; break
5551                         fi
5552                   done
5553                 fi
5554
5555                 if test "$cf_have_incdir" = no ; then
5556                   if test "$cf_add_incdir" = /usr/local/include ; then
5557                         if test "$GCC" = yes
5558                         then
5559                           cf_save_CPPFLAGS=$CPPFLAGS
5560
5561         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5562         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5563
5564                           cat >"conftest.$ac_ext" <<_ACEOF
5565 #line 5565 "configure"
5566 #include "confdefs.h"
5567 #include <stdio.h>
5568 int
5569 main (void)
5570 {
5571 printf("Hello")
5572   ;
5573   return 0;
5574 }
5575 _ACEOF
5576 rm -f "conftest.$ac_objext"
5577 if { (eval echo "$as_me:5577: \"$ac_compile\"") >&5
5578   (eval $ac_compile) 2>&5
5579   ac_status=$?
5580   echo "$as_me:5580: \$? = $ac_status" >&5
5581   (exit "$ac_status"); } &&
5582          { ac_try='test -s "conftest.$ac_objext"'
5583   { (eval echo "$as_me:5583: \"$ac_try\"") >&5
5584   (eval $ac_try) 2>&5
5585   ac_status=$?
5586   echo "$as_me:5586: \$? = $ac_status" >&5
5587   (exit "$ac_status"); }; }; then
5588   :
5589 else
5590   echo "$as_me: failed program was:" >&5
5591 cat "conftest.$ac_ext" >&5
5592 cf_have_incdir=yes
5593 fi
5594 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5595                           CPPFLAGS=$cf_save_CPPFLAGS
5596                         fi
5597                   fi
5598                 fi
5599
5600                 if test "$cf_have_incdir" = no ; then
5601                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5602
5603 echo "${as_me:-configure}:5603: testing adding $cf_add_incdir to include-path ..." 1>&5
5604
5605                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5606
5607                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5608                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5609                   cf_add_incdir="$cf_top_incdir"
5610                 else
5611                   break
5612                 fi
5613           else
5614                 break
5615           fi
5616         done
5617   done
5618 fi
5619
5620                 for cf_header in \
5621                         ncurses.h \
5622                         curses.h
5623                 do
5624
5625         cat >"conftest.$ac_ext" <<_ACEOF
5626 #line 5626 "configure"
5627 #include "confdefs.h"
5628
5629 #include <$cf_header>
5630 int
5631 main (void)
5632 {
5633
5634 #ifdef NCURSES_VERSION
5635
5636 printf("%s\\n", NCURSES_VERSION);
5637 #else
5638 #ifdef __NCURSES_H
5639 printf("old\\n");
5640 #else
5641         make an error
5642 #endif
5643 #endif
5644
5645   ;
5646   return 0;
5647 }
5648 _ACEOF
5649 rm -f "conftest.$ac_objext"
5650 if { (eval echo "$as_me:5650: \"$ac_compile\"") >&5
5651   (eval $ac_compile) 2>&5
5652   ac_status=$?
5653   echo "$as_me:5653: \$? = $ac_status" >&5
5654   (exit "$ac_status"); } &&
5655          { ac_try='test -s "conftest.$ac_objext"'
5656   { (eval echo "$as_me:5656: \"$ac_try\"") >&5
5657   (eval $ac_try) 2>&5
5658   ac_status=$?
5659   echo "$as_me:5659: \$? = $ac_status" >&5
5660   (exit "$ac_status"); }; }; then
5661   cf_cv_ncurses_h2=$cf_header
5662
5663 else
5664   echo "$as_me: failed program was:" >&5
5665 cat "conftest.$ac_ext" >&5
5666 cf_cv_ncurses_h2=no
5667 fi
5668 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5669
5670                         if test "$cf_cv_ncurses_h2" != no ; then
5671                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5672                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5673                                 break
5674                         fi
5675                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5676                 done
5677                 CPPFLAGS="$cf_save2_CPPFLAGS"
5678                 test "$cf_cv_ncurses_h2" != no && break
5679         done
5680         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5680: error: not found" >&5
5681 echo "$as_me: error: not found" >&2;}
5682    { (exit 1); exit 1; }; }
5683
5684 fi
5685 echo "$as_me:5685: result: $cf_cv_ncurses_h2" >&5
5686 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5687
5688         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5689         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5690         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5691                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5692         fi
5693
5694 if test -n "$cf_1st_incdir" ; then
5695   for cf_add_incdir in $cf_1st_incdir
5696   do
5697         while test "$cf_add_incdir" != /usr/include
5698         do
5699           if test -d "$cf_add_incdir"
5700           then
5701                 cf_have_incdir=no
5702                 if test -n "$CFLAGS$CPPFLAGS" ; then
5703                   # a loop is needed to ensure we can add subdirs of existing dirs
5704                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5705                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5706                           cf_have_incdir=yes; break
5707                         fi
5708                   done
5709                 fi
5710
5711                 if test "$cf_have_incdir" = no ; then
5712                   if test "$cf_add_incdir" = /usr/local/include ; then
5713                         if test "$GCC" = yes
5714                         then
5715                           cf_save_CPPFLAGS=$CPPFLAGS
5716
5717         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5718         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5719
5720                           cat >"conftest.$ac_ext" <<_ACEOF
5721 #line 5721 "configure"
5722 #include "confdefs.h"
5723 #include <stdio.h>
5724 int
5725 main (void)
5726 {
5727 printf("Hello")
5728   ;
5729   return 0;
5730 }
5731 _ACEOF
5732 rm -f "conftest.$ac_objext"
5733 if { (eval echo "$as_me:5733: \"$ac_compile\"") >&5
5734   (eval $ac_compile) 2>&5
5735   ac_status=$?
5736   echo "$as_me:5736: \$? = $ac_status" >&5
5737   (exit "$ac_status"); } &&
5738          { ac_try='test -s "conftest.$ac_objext"'
5739   { (eval echo "$as_me:5739: \"$ac_try\"") >&5
5740   (eval $ac_try) 2>&5
5741   ac_status=$?
5742   echo "$as_me:5742: \$? = $ac_status" >&5
5743   (exit "$ac_status"); }; }; then
5744   :
5745 else
5746   echo "$as_me: failed program was:" >&5
5747 cat "conftest.$ac_ext" >&5
5748 cf_have_incdir=yes
5749 fi
5750 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5751                           CPPFLAGS=$cf_save_CPPFLAGS
5752                         fi
5753                   fi
5754                 fi
5755
5756                 if test "$cf_have_incdir" = no ; then
5757                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5758
5759 echo "${as_me:-configure}:5759: testing adding $cf_add_incdir to include-path ..." 1>&5
5760
5761                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5762
5763                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5764                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5765                   cf_add_incdir="$cf_top_incdir"
5766                 else
5767                   break
5768                 fi
5769           else
5770                 break
5771           fi
5772         done
5773   done
5774 fi
5775
5776 fi
5777
5778 # Set definitions to allow ifdef'ing for ncurses.h
5779
5780 case "$cf_cv_ncurses_header" in
5781 (*ncurses.h)
5782
5783 cat >>confdefs.h <<\EOF
5784 #define HAVE_NCURSES_H 1
5785 EOF
5786
5787         ;;
5788 esac
5789
5790 case "$cf_cv_ncurses_header" in
5791 (ncurses/curses.h|ncurses/ncurses.h)
5792
5793 cat >>confdefs.h <<\EOF
5794 #define HAVE_NCURSES_NCURSES_H 1
5795 EOF
5796
5797         ;;
5798 (ncursesw/curses.h|ncursesw/ncurses.h)
5799
5800 cat >>confdefs.h <<\EOF
5801 #define HAVE_NCURSESW_NCURSES_H 1
5802 EOF
5803
5804         ;;
5805 esac
5806
5807 echo "$as_me:5807: checking for terminfo header" >&5
5808 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5809 if test "${cf_cv_term_header+set}" = set; then
5810   echo $ECHO_N "(cached) $ECHO_C" >&6
5811 else
5812
5813 case "${cf_cv_ncurses_header}" in
5814 (*/ncurses.h|*/ncursesw.h)
5815         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5816         ;;
5817 (*)
5818         cf_term_header=term.h
5819         ;;
5820 esac
5821
5822 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5823 do
5824 cat >"conftest.$ac_ext" <<_ACEOF
5825 #line 5825 "configure"
5826 #include "confdefs.h"
5827 #include <stdio.h>
5828 #include <${cf_cv_ncurses_header:-curses.h}>
5829 #include <$cf_test>
5830
5831 int
5832 main (void)
5833 {
5834 int x = auto_left_margin; (void)x
5835   ;
5836   return 0;
5837 }
5838 _ACEOF
5839 rm -f "conftest.$ac_objext"
5840 if { (eval echo "$as_me:5840: \"$ac_compile\"") >&5
5841   (eval $ac_compile) 2>&5
5842   ac_status=$?
5843   echo "$as_me:5843: \$? = $ac_status" >&5
5844   (exit "$ac_status"); } &&
5845          { ac_try='test -s "conftest.$ac_objext"'
5846   { (eval echo "$as_me:5846: \"$ac_try\"") >&5
5847   (eval $ac_try) 2>&5
5848   ac_status=$?
5849   echo "$as_me:5849: \$? = $ac_status" >&5
5850   (exit "$ac_status"); }; }; then
5851
5852         cf_cv_term_header="$cf_test"
5853 else
5854   echo "$as_me: failed program was:" >&5
5855 cat "conftest.$ac_ext" >&5
5856
5857         cf_cv_term_header=unknown
5858
5859 fi
5860 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5861         test "$cf_cv_term_header" != unknown && break
5862 done
5863
5864 fi
5865 echo "$as_me:5865: result: $cf_cv_term_header" >&5
5866 echo "${ECHO_T}$cf_cv_term_header" >&6
5867
5868 # Set definitions to allow ifdef'ing to accommodate subdirectories
5869
5870 case "$cf_cv_term_header" in
5871 (*term.h)
5872
5873 cat >>confdefs.h <<\EOF
5874 #define HAVE_TERM_H 1
5875 EOF
5876
5877         ;;
5878 esac
5879
5880 case "$cf_cv_term_header" in
5881 (ncurses/term.h)
5882
5883 cat >>confdefs.h <<\EOF
5884 #define HAVE_NCURSES_TERM_H 1
5885 EOF
5886
5887         ;;
5888 (ncursesw/term.h)
5889
5890 cat >>confdefs.h <<\EOF
5891 #define HAVE_NCURSESW_TERM_H 1
5892 EOF
5893
5894         ;;
5895 esac
5896
5897 # some applications need this, but should check for NCURSES_VERSION
5898
5899 cat >>confdefs.h <<\EOF
5900 #define NCURSES 1
5901 EOF
5902
5903 echo "$as_me:5903: checking for ncurses version" >&5
5904 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5905 if test "${cf_cv_ncurses_version+set}" = set; then
5906   echo $ECHO_N "(cached) $ECHO_C" >&6
5907 else
5908
5909         cf_cv_ncurses_version=no
5910         cf_tempfile=out$$
5911         rm -f "$cf_tempfile"
5912         if test "$cross_compiling" = yes; then
5913
5914         # This will not work if the preprocessor splits the line after the
5915         # Autoconf token.  The 'unproto' program does that.
5916         cat > "conftest.$ac_ext" <<EOF
5917 #include <${cf_cv_ncurses_header:-curses.h}>
5918 #undef Autoconf
5919 #ifdef NCURSES_VERSION
5920 Autoconf NCURSES_VERSION
5921 #else
5922 #ifdef __NCURSES_H
5923 Autoconf "old"
5924 #endif
5925 ;
5926 #endif
5927 EOF
5928         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5929         { (eval echo "$as_me:5929: \"$cf_try\"") >&5
5930   (eval $cf_try) 2>&5
5931   ac_status=$?
5932   echo "$as_me:5932: \$? = $ac_status" >&5
5933   (exit "$ac_status"); }
5934         if test -f conftest.out ; then
5935                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
5936                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5937                 rm -f conftest.out
5938         fi
5939
5940 else
5941   cat >"conftest.$ac_ext" <<_ACEOF
5942 #line 5942 "configure"
5943 #include "confdefs.h"
5944
5945 #include <${cf_cv_ncurses_header:-curses.h}>
5946 #include <stdio.h>
5947 int main(void)
5948 {
5949         FILE *fp = fopen("$cf_tempfile", "w");
5950 #ifdef NCURSES_VERSION
5951 # ifdef NCURSES_VERSION_PATCH
5952         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5953 # else
5954         fprintf(fp, "%s\\n", NCURSES_VERSION);
5955 # endif
5956 #else
5957 # ifdef __NCURSES_H
5958         fprintf(fp, "old\\n");
5959 # else
5960         make an error
5961 # endif
5962 #endif
5963         ${cf_cv_main_return:-return}(0);
5964 }
5965 _ACEOF
5966 rm -f "conftest$ac_exeext"
5967 if { (eval echo "$as_me:5967: \"$ac_link\"") >&5
5968   (eval $ac_link) 2>&5
5969   ac_status=$?
5970   echo "$as_me:5970: \$? = $ac_status" >&5
5971   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5972   { (eval echo "$as_me:5972: \"$ac_try\"") >&5
5973   (eval $ac_try) 2>&5
5974   ac_status=$?
5975   echo "$as_me:5975: \$? = $ac_status" >&5
5976   (exit "$ac_status"); }; }; then
5977
5978         cf_cv_ncurses_version=`cat $cf_tempfile`
5979 else
5980   echo "$as_me: program exited with status $ac_status" >&5
5981 echo "$as_me: failed program was:" >&5
5982 cat "conftest.$ac_ext" >&5
5983 fi
5984 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5985 fi
5986         rm -f "$cf_tempfile"
5987
5988 fi
5989 echo "$as_me:5989: result: $cf_cv_ncurses_version" >&5
5990 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5991 test "$cf_cv_ncurses_version" = no ||
5992 cat >>confdefs.h <<\EOF
5993 #define NCURSES 1
5994 EOF
5995
5996 cf_nculib_root=ncurses
5997         # This works, except for the special case where we find gpm, but
5998         # ncurses is in a nonstandard location via $LIBS, and we really want
5999         # to link gpm.
6000 cf_ncurses_LIBS=""
6001 cf_ncurses_SAVE="$LIBS"
6002 echo "$as_me:6002: checking for Gpm_Open in -lgpm" >&5
6003 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6004 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6005   echo $ECHO_N "(cached) $ECHO_C" >&6
6006 else
6007   ac_check_lib_save_LIBS=$LIBS
6008 LIBS="-lgpm  $LIBS"
6009 cat >"conftest.$ac_ext" <<_ACEOF
6010 #line 6010 "configure"
6011 #include "confdefs.h"
6012
6013 /* Override any gcc2 internal prototype to avoid an error.  */
6014 #ifdef __cplusplus
6015 extern "C"
6016 #endif
6017 /* We use char because int might match the return type of a gcc2
6018    builtin and then its argument prototype would still apply.  */
6019 char Gpm_Open ();
6020 int
6021 main (void)
6022 {
6023 Gpm_Open ();
6024   ;
6025   return 0;
6026 }
6027 _ACEOF
6028 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6029 if { (eval echo "$as_me:6029: \"$ac_link\"") >&5
6030   (eval $ac_link) 2>&5
6031   ac_status=$?
6032   echo "$as_me:6032: \$? = $ac_status" >&5
6033   (exit "$ac_status"); } &&
6034          { ac_try='test -s "conftest$ac_exeext"'
6035   { (eval echo "$as_me:6035: \"$ac_try\"") >&5
6036   (eval $ac_try) 2>&5
6037   ac_status=$?
6038   echo "$as_me:6038: \$? = $ac_status" >&5
6039   (exit "$ac_status"); }; }; then
6040   ac_cv_lib_gpm_Gpm_Open=yes
6041 else
6042   echo "$as_me: failed program was:" >&5
6043 cat "conftest.$ac_ext" >&5
6044 ac_cv_lib_gpm_Gpm_Open=no
6045 fi
6046 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6047 LIBS=$ac_check_lib_save_LIBS
6048 fi
6049 echo "$as_me:6049: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6050 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6051 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6052   echo "$as_me:6052: checking for initscr in -lgpm" >&5
6053 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6054 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6055   echo $ECHO_N "(cached) $ECHO_C" >&6
6056 else
6057   ac_check_lib_save_LIBS=$LIBS
6058 LIBS="-lgpm  $LIBS"
6059 cat >"conftest.$ac_ext" <<_ACEOF
6060 #line 6060 "configure"
6061 #include "confdefs.h"
6062
6063 /* Override any gcc2 internal prototype to avoid an error.  */
6064 #ifdef __cplusplus
6065 extern "C"
6066 #endif
6067 /* We use char because int might match the return type of a gcc2
6068    builtin and then its argument prototype would still apply.  */
6069 char initscr ();
6070 int
6071 main (void)
6072 {
6073 initscr ();
6074   ;
6075   return 0;
6076 }
6077 _ACEOF
6078 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6079 if { (eval echo "$as_me:6079: \"$ac_link\"") >&5
6080   (eval $ac_link) 2>&5
6081   ac_status=$?
6082   echo "$as_me:6082: \$? = $ac_status" >&5
6083   (exit "$ac_status"); } &&
6084          { ac_try='test -s "conftest$ac_exeext"'
6085   { (eval echo "$as_me:6085: \"$ac_try\"") >&5
6086   (eval $ac_try) 2>&5
6087   ac_status=$?
6088   echo "$as_me:6088: \$? = $ac_status" >&5
6089   (exit "$ac_status"); }; }; then
6090   ac_cv_lib_gpm_initscr=yes
6091 else
6092   echo "$as_me: failed program was:" >&5
6093 cat "conftest.$ac_ext" >&5
6094 ac_cv_lib_gpm_initscr=no
6095 fi
6096 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6097 LIBS=$ac_check_lib_save_LIBS
6098 fi
6099 echo "$as_me:6099: result: $ac_cv_lib_gpm_initscr" >&5
6100 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6101 if test "$ac_cv_lib_gpm_initscr" = yes; then
6102   LIBS="$cf_ncurses_SAVE"
6103 else
6104   cf_ncurses_LIBS="-lgpm"
6105 fi
6106
6107 fi
6108
6109 case "$host_os" in
6110 (freebsd*)
6111         # This is only necessary if you are linking against an obsolete
6112         # version of ncurses (but it should do no harm, since it's static).
6113         if test "$cf_nculib_root" = ncurses ; then
6114                 echo "$as_me:6114: checking for tgoto in -lmytinfo" >&5
6115 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6116 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6117   echo $ECHO_N "(cached) $ECHO_C" >&6
6118 else
6119   ac_check_lib_save_LIBS=$LIBS
6120 LIBS="-lmytinfo  $LIBS"
6121 cat >"conftest.$ac_ext" <<_ACEOF
6122 #line 6122 "configure"
6123 #include "confdefs.h"
6124
6125 /* Override any gcc2 internal prototype to avoid an error.  */
6126 #ifdef __cplusplus
6127 extern "C"
6128 #endif
6129 /* We use char because int might match the return type of a gcc2
6130    builtin and then its argument prototype would still apply.  */
6131 char tgoto ();
6132 int
6133 main (void)
6134 {
6135 tgoto ();
6136   ;
6137   return 0;
6138 }
6139 _ACEOF
6140 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6141 if { (eval echo "$as_me:6141: \"$ac_link\"") >&5
6142   (eval $ac_link) 2>&5
6143   ac_status=$?
6144   echo "$as_me:6144: \$? = $ac_status" >&5
6145   (exit "$ac_status"); } &&
6146          { ac_try='test -s "conftest$ac_exeext"'
6147   { (eval echo "$as_me:6147: \"$ac_try\"") >&5
6148   (eval $ac_try) 2>&5
6149   ac_status=$?
6150   echo "$as_me:6150: \$? = $ac_status" >&5
6151   (exit "$ac_status"); }; }; then
6152   ac_cv_lib_mytinfo_tgoto=yes
6153 else
6154   echo "$as_me: failed program was:" >&5
6155 cat "conftest.$ac_ext" >&5
6156 ac_cv_lib_mytinfo_tgoto=no
6157 fi
6158 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6159 LIBS=$ac_check_lib_save_LIBS
6160 fi
6161 echo "$as_me:6161: result: $ac_cv_lib_mytinfo_tgoto" >&5
6162 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6163 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6164   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6165 fi
6166
6167         fi
6168         ;;
6169 esac
6170
6171 cf_add_libs="$LIBS"
6172 # reverse order
6173 cf_add_0lib=
6174 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6175 # filter duplicates
6176 for cf_add_1lib in $cf_add_0lib; do
6177         for cf_add_2lib in $cf_add_libs; do
6178                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6179                         cf_add_1lib=
6180                         break
6181                 fi
6182         done
6183         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6184 done
6185 LIBS="$cf_add_libs"
6186
6187 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6188 then
6189
6190 cf_add_libs="$LIBS"
6191 # reverse order
6192 cf_add_0lib=
6193 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6194 # filter duplicates
6195 for cf_add_1lib in $cf_add_0lib; do
6196         for cf_add_2lib in $cf_add_libs; do
6197                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6198                         cf_add_1lib=
6199                         break
6200                 fi
6201         done
6202         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6203 done
6204 LIBS="$cf_add_libs"
6205
6206 else
6207
6208         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6209         cf_libdir=""
6210         echo "$as_me:6210: checking for initscr" >&5
6211 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6212 if test "${ac_cv_func_initscr+set}" = set; then
6213   echo $ECHO_N "(cached) $ECHO_C" >&6
6214 else
6215   cat >"conftest.$ac_ext" <<_ACEOF
6216 #line 6216 "configure"
6217 #include "confdefs.h"
6218 #define initscr autoconf_temporary
6219 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6220 #undef initscr
6221
6222 #ifdef __cplusplus
6223 extern "C"
6224 #endif
6225
6226 /* We use char because int might match the return type of a gcc2
6227    builtin and then its argument prototype would still apply.  */
6228 char initscr (void);
6229
6230 int
6231 main (void)
6232 {
6233
6234 /* The GNU C library defines stubs for functions which it implements
6235     to always fail with ENOSYS.  Some functions are actually named
6236     something starting with __ and the normal name is an alias.  */
6237 #if defined (__stub_initscr) || defined (__stub___initscr)
6238 #error found stub for initscr
6239 #endif
6240
6241         return initscr ();
6242   ;
6243   return 0;
6244 }
6245 _ACEOF
6246 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6247 if { (eval echo "$as_me:6247: \"$ac_link\"") >&5
6248   (eval $ac_link) 2>&5
6249   ac_status=$?
6250   echo "$as_me:6250: \$? = $ac_status" >&5
6251   (exit "$ac_status"); } &&
6252          { ac_try='test -s "conftest$ac_exeext"'
6253   { (eval echo "$as_me:6253: \"$ac_try\"") >&5
6254   (eval $ac_try) 2>&5
6255   ac_status=$?
6256   echo "$as_me:6256: \$? = $ac_status" >&5
6257   (exit "$ac_status"); }; }; then
6258   ac_cv_func_initscr=yes
6259 else
6260   echo "$as_me: failed program was:" >&5
6261 cat "conftest.$ac_ext" >&5
6262 ac_cv_func_initscr=no
6263 fi
6264 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6265 fi
6266 echo "$as_me:6266: result: $ac_cv_func_initscr" >&5
6267 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6268 if test "$ac_cv_func_initscr" = yes; then
6269   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6270 else
6271
6272                 cf_save_LIBS="$LIBS"
6273                 echo "$as_me:6273: checking for initscr in -l$cf_nculib_root" >&5
6274 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6275                 LIBS="-l$cf_nculib_root $LIBS"
6276                 cat >"conftest.$ac_ext" <<_ACEOF
6277 #line 6277 "configure"
6278 #include "confdefs.h"
6279 #include <${cf_cv_ncurses_header:-curses.h}>
6280 int
6281 main (void)
6282 {
6283 initscr()
6284   ;
6285   return 0;
6286 }
6287 _ACEOF
6288 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6289 if { (eval echo "$as_me:6289: \"$ac_link\"") >&5
6290   (eval $ac_link) 2>&5
6291   ac_status=$?
6292   echo "$as_me:6292: \$? = $ac_status" >&5
6293   (exit "$ac_status"); } &&
6294          { ac_try='test -s "conftest$ac_exeext"'
6295   { (eval echo "$as_me:6295: \"$ac_try\"") >&5
6296   (eval $ac_try) 2>&5
6297   ac_status=$?
6298   echo "$as_me:6298: \$? = $ac_status" >&5
6299   (exit "$ac_status"); }; }; then
6300   echo "$as_me:6300: result: yes" >&5
6301 echo "${ECHO_T}yes" >&6
6302                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6303
6304 else
6305   echo "$as_me: failed program was:" >&5
6306 cat "conftest.$ac_ext" >&5
6307 echo "$as_me:6307: result: no" >&5
6308 echo "${ECHO_T}no" >&6
6309
6310 cf_search=
6311 cf_library_path_list=""
6312 if test -n "${LDFLAGS}${LIBS}" ; then
6313         for cf_library_path in $LDFLAGS $LIBS
6314         do
6315                 case "$cf_library_path" in
6316                 (-L*)
6317                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6318
6319 test "x$cf_library_path" != "xNONE" && \
6320 test -d "$cf_library_path" && \
6321  {
6322         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6323         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6324         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6325         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6326         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6327         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"
6328 }
6329
6330                         cf_library_path_list="$cf_library_path_list $cf_search"
6331                         ;;
6332                 esac
6333         done
6334 fi
6335
6336 cf_search=
6337
6338 test "x$prefix" != "xNONE" && \
6339 test -d "$prefix" && \
6340  {
6341         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6342         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6343         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6344         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6345         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6346         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6347 }
6348
6349 for cf_subdir_prefix in \
6350         /usr \
6351         /usr/local \
6352         /usr/pkg \
6353         /opt \
6354         /opt/local \
6355         $HOME
6356 do
6357
6358 test "x$cf_subdir_prefix" != "x$prefix" && \
6359 test -d "$cf_subdir_prefix" && \
6360 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6361         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6362         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6363         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6364         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6365         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6366         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"
6367 }
6368
6369 done
6370
6371 cf_search="$cf_library_path_list $cf_search"
6372
6373                         for cf_libdir in $cf_search
6374                         do
6375                                 echo "$as_me:6375: checking for -l$cf_nculib_root in $cf_libdir" >&5
6376 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6377                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6378                                 cat >"conftest.$ac_ext" <<_ACEOF
6379 #line 6379 "configure"
6380 #include "confdefs.h"
6381 #include <${cf_cv_ncurses_header:-curses.h}>
6382 int
6383 main (void)
6384 {
6385 initscr()
6386   ;
6387   return 0;
6388 }
6389 _ACEOF
6390 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6391 if { (eval echo "$as_me:6391: \"$ac_link\"") >&5
6392   (eval $ac_link) 2>&5
6393   ac_status=$?
6394   echo "$as_me:6394: \$? = $ac_status" >&5
6395   (exit "$ac_status"); } &&
6396          { ac_try='test -s "conftest$ac_exeext"'
6397   { (eval echo "$as_me:6397: \"$ac_try\"") >&5
6398   (eval $ac_try) 2>&5
6399   ac_status=$?
6400   echo "$as_me:6400: \$? = $ac_status" >&5
6401   (exit "$ac_status"); }; }; then
6402   echo "$as_me:6402: result: yes" >&5
6403 echo "${ECHO_T}yes" >&6
6404                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6405                                          break
6406 else
6407   echo "$as_me: failed program was:" >&5
6408 cat "conftest.$ac_ext" >&5
6409 echo "$as_me:6409: result: no" >&5
6410 echo "${ECHO_T}no" >&6
6411                                          LIBS="$cf_save_LIBS"
6412 fi
6413 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6414                         done
6415
6416 fi
6417 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6418
6419 fi
6420
6421 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6422
6423 if test "$cf_found_library" = no ; then
6424         { { echo "$as_me:6424: error: Cannot link $cf_nculib_root library" >&5
6425 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6426    { (exit 1); exit 1; }; }
6427 fi
6428
6429 fi
6430
6431 if test -n "$cf_ncurses_LIBS" ; then
6432         echo "$as_me:6432: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6433 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6434         cf_ncurses_SAVE="$LIBS"
6435         for p in $cf_ncurses_LIBS ; do
6436                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6437                 if test "$q" != "$LIBS" ; then
6438                         LIBS="$q"
6439                 fi
6440         done
6441         cat >"conftest.$ac_ext" <<_ACEOF
6442 #line 6442 "configure"
6443 #include "confdefs.h"
6444 #include <${cf_cv_ncurses_header:-curses.h}>
6445 int
6446 main (void)
6447 {
6448 initscr(); mousemask(0,0); tigetstr((char *)0);
6449   ;
6450   return 0;
6451 }
6452 _ACEOF
6453 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6454 if { (eval echo "$as_me:6454: \"$ac_link\"") >&5
6455   (eval $ac_link) 2>&5
6456   ac_status=$?
6457   echo "$as_me:6457: \$? = $ac_status" >&5
6458   (exit "$ac_status"); } &&
6459          { ac_try='test -s "conftest$ac_exeext"'
6460   { (eval echo "$as_me:6460: \"$ac_try\"") >&5
6461   (eval $ac_try) 2>&5
6462   ac_status=$?
6463   echo "$as_me:6463: \$? = $ac_status" >&5
6464   (exit "$ac_status"); }; }; then
6465   echo "$as_me:6465: result: yes" >&5
6466 echo "${ECHO_T}yes" >&6
6467 else
6468   echo "$as_me: failed program was:" >&5
6469 cat "conftest.$ac_ext" >&5
6470 echo "$as_me:6470: result: no" >&5
6471 echo "${ECHO_T}no" >&6
6472                  LIBS="$cf_ncurses_SAVE"
6473 fi
6474 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6475 fi
6476
6477 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6478
6479 cat >>confdefs.h <<EOF
6480 #define $cf_nculib_ROOT 1
6481 EOF
6482
6483         fi
6484 else
6485         NCURSES_CONFIG=none
6486 fi
6487
6488 echo "$as_me:6488: checking if you want wide-character code" >&5
6489 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6490
6491 # Check whether --enable-widec or --disable-widec was given.
6492 if test "${enable_widec+set}" = set; then
6493   enableval="$enable_widec"
6494   with_widec=$enableval
6495 else
6496   with_widec=no
6497 fi;
6498 echo "$as_me:6498: result: $with_widec" >&5
6499 echo "${ECHO_T}$with_widec" >&6
6500 if test "$with_widec" = yes ; then
6501
6502 for ac_header in wchar.h
6503 do
6504 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6505 echo "$as_me:6505: checking for $ac_header" >&5
6506 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6507 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6508   echo $ECHO_N "(cached) $ECHO_C" >&6
6509 else
6510   cat >"conftest.$ac_ext" <<_ACEOF
6511 #line 6511 "configure"
6512 #include "confdefs.h"
6513 #include <$ac_header>
6514 _ACEOF
6515 if { (eval echo "$as_me:6515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6517   ac_status=$?
6518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6519   rm -f conftest.er1
6520   cat conftest.err >&5
6521   echo "$as_me:6521: \$? = $ac_status" >&5
6522   (exit "$ac_status"); } >/dev/null; then
6523   if test -s conftest.err; then
6524     ac_cpp_err=$ac_c_preproc_warn_flag
6525   else
6526     ac_cpp_err=
6527   fi
6528 else
6529   ac_cpp_err=yes
6530 fi
6531 if test -z "$ac_cpp_err"; then
6532   eval "$as_ac_Header=yes"
6533 else
6534   echo "$as_me: failed program was:" >&5
6535   cat "conftest.$ac_ext" >&5
6536   eval "$as_ac_Header=no"
6537 fi
6538 rm -f conftest.err "conftest.$ac_ext"
6539 fi
6540 echo "$as_me:6540: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6541 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6542 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6543   cat >>confdefs.h <<EOF
6544 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6545 EOF
6546
6547 fi
6548 done
6549
6550 echo "$as_me:6550: checking for multibyte character support" >&5
6551 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6552 if test "${cf_cv_utf8_lib+set}" = set; then
6553   echo $ECHO_N "(cached) $ECHO_C" >&6
6554 else
6555
6556         cf_save_LIBS="$LIBS"
6557         cat >"conftest.$ac_ext" <<_ACEOF
6558 #line 6558 "configure"
6559 #include "confdefs.h"
6560
6561 #include <stdlib.h>
6562 #include <stdio.h>
6563 #ifdef HAVE_WCHAR_H
6564 #include <wchar.h>
6565 #endif
6566
6567 int
6568 main (void)
6569 {
6570 putwc(0,0);
6571   ;
6572   return 0;
6573 }
6574 _ACEOF
6575 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6576 if { (eval echo "$as_me:6576: \"$ac_link\"") >&5
6577   (eval $ac_link) 2>&5
6578   ac_status=$?
6579   echo "$as_me:6579: \$? = $ac_status" >&5
6580   (exit "$ac_status"); } &&
6581          { ac_try='test -s "conftest$ac_exeext"'
6582   { (eval echo "$as_me:6582: \"$ac_try\"") >&5
6583   (eval $ac_try) 2>&5
6584   ac_status=$?
6585   echo "$as_me:6585: \$? = $ac_status" >&5
6586   (exit "$ac_status"); }; }; then
6587   cf_cv_utf8_lib=yes
6588 else
6589   echo "$as_me: failed program was:" >&5
6590 cat "conftest.$ac_ext" >&5
6591
6592 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6593 # will be set on completion of the AC_TRY_LINK below.
6594 cf_cv_header_path_utf8=
6595 cf_cv_library_path_utf8=
6596
6597 echo "${as_me:-configure}:6597: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6598
6599 cf_save_LIBS="$LIBS"
6600
6601 cat >"conftest.$ac_ext" <<_ACEOF
6602 #line 6602 "configure"
6603 #include "confdefs.h"
6604
6605 #include <libutf8.h>
6606 int
6607 main (void)
6608 {
6609 putwc(0,0);
6610   ;
6611   return 0;
6612 }
6613 _ACEOF
6614 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6615 if { (eval echo "$as_me:6615: \"$ac_link\"") >&5
6616   (eval $ac_link) 2>&5
6617   ac_status=$?
6618   echo "$as_me:6618: \$? = $ac_status" >&5
6619   (exit "$ac_status"); } &&
6620          { ac_try='test -s "conftest$ac_exeext"'
6621   { (eval echo "$as_me:6621: \"$ac_try\"") >&5
6622   (eval $ac_try) 2>&5
6623   ac_status=$?
6624   echo "$as_me:6624: \$? = $ac_status" >&5
6625   (exit "$ac_status"); }; }; then
6626
6627         cf_cv_find_linkage_utf8=yes
6628         cf_cv_header_path_utf8=/usr/include
6629         cf_cv_library_path_utf8=/usr/lib
6630
6631 else
6632   echo "$as_me: failed program was:" >&5
6633 cat "conftest.$ac_ext" >&5
6634
6635 LIBS="-lutf8  $cf_save_LIBS"
6636
6637 cat >"conftest.$ac_ext" <<_ACEOF
6638 #line 6638 "configure"
6639 #include "confdefs.h"
6640
6641 #include <libutf8.h>
6642 int
6643 main (void)
6644 {
6645 putwc(0,0);
6646   ;
6647   return 0;
6648 }
6649 _ACEOF
6650 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6651 if { (eval echo "$as_me:6651: \"$ac_link\"") >&5
6652   (eval $ac_link) 2>&5
6653   ac_status=$?
6654   echo "$as_me:6654: \$? = $ac_status" >&5
6655   (exit "$ac_status"); } &&
6656          { ac_try='test -s "conftest$ac_exeext"'
6657   { (eval echo "$as_me:6657: \"$ac_try\"") >&5
6658   (eval $ac_try) 2>&5
6659   ac_status=$?
6660   echo "$as_me:6660: \$? = $ac_status" >&5
6661   (exit "$ac_status"); }; }; then
6662
6663         cf_cv_find_linkage_utf8=yes
6664         cf_cv_header_path_utf8=/usr/include
6665         cf_cv_library_path_utf8=/usr/lib
6666         cf_cv_library_file_utf8="-lutf8"
6667
6668 else
6669   echo "$as_me: failed program was:" >&5
6670 cat "conftest.$ac_ext" >&5
6671
6672         cf_cv_find_linkage_utf8=no
6673         LIBS="$cf_save_LIBS"
6674
6675         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6676
6677 echo "${as_me:-configure}:6677: testing find linkage for utf8 library ..." 1>&5
6678
6679 echo "${as_me:-configure}:6679: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6680
6681         cf_save_CPPFLAGS="$CPPFLAGS"
6682         cf_test_CPPFLAGS="$CPPFLAGS"
6683
6684 cf_search=
6685
6686 # collect the current set of include-directories from compiler flags
6687 cf_header_path_list=""
6688 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6689         for cf_header_path in $CPPFLAGS $CFLAGS
6690         do
6691                 case "$cf_header_path" in
6692                 (-I*)
6693                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6694
6695 test "x$cf_header_path" != "xNONE" && \
6696 test -d "$cf_header_path" && \
6697  {
6698         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6699         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6700         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6701         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6702         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6703         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6704 }
6705
6706                         cf_header_path_list="$cf_header_path_list $cf_search"
6707                         ;;
6708                 esac
6709         done
6710 fi
6711
6712 # add the variations for the package we are looking for
6713
6714 cf_search=
6715
6716 test "x$prefix" != "xNONE" && \
6717 test -d "$prefix" && \
6718  {
6719         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6720         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6721         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6722         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6723         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6724         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6725 }
6726
6727 for cf_subdir_prefix in \
6728         /usr \
6729         /usr/local \
6730         /usr/pkg \
6731         /opt \
6732         /opt/local \
6733         $HOME
6734 do
6735
6736 test "x$cf_subdir_prefix" != "x$prefix" && \
6737 test -d "$cf_subdir_prefix" && \
6738 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6739         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6740         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6741         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6742         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6743         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6744         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6745 }
6746
6747 done
6748
6749 test "$includedir" != NONE && \
6750 test "$includedir" != "/usr/include" && \
6751 test -d "$includedir" && {
6752         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6753         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6754 }
6755
6756 test "$oldincludedir" != NONE && \
6757 test "$oldincludedir" != "/usr/include" && \
6758 test -d "$oldincludedir" && {
6759         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6760         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6761 }
6762
6763 cf_search="$cf_search $cf_header_path_list"
6764
6765         for cf_cv_header_path_utf8 in $cf_search
6766         do
6767                 if test -d "$cf_cv_header_path_utf8" ; then
6768                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6769
6770 echo "${as_me:-configure}:6770: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6771
6772                         CPPFLAGS="$cf_save_CPPFLAGS"
6773
6774         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6775         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6776
6777                         cat >"conftest.$ac_ext" <<_ACEOF
6778 #line 6778 "configure"
6779 #include "confdefs.h"
6780
6781 #include <libutf8.h>
6782 int
6783 main (void)
6784 {
6785 putwc(0,0);
6786   ;
6787   return 0;
6788 }
6789 _ACEOF
6790 rm -f "conftest.$ac_objext"
6791 if { (eval echo "$as_me:6791: \"$ac_compile\"") >&5
6792   (eval $ac_compile) 2>&5
6793   ac_status=$?
6794   echo "$as_me:6794: \$? = $ac_status" >&5
6795   (exit "$ac_status"); } &&
6796          { ac_try='test -s "conftest.$ac_objext"'
6797   { (eval echo "$as_me:6797: \"$ac_try\"") >&5
6798   (eval $ac_try) 2>&5
6799   ac_status=$?
6800   echo "$as_me:6800: \$? = $ac_status" >&5
6801   (exit "$ac_status"); }; }; then
6802
6803                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6804
6805 echo "${as_me:-configure}:6805: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6806
6807                                 cf_cv_find_linkage_utf8=maybe
6808                                 cf_test_CPPFLAGS="$CPPFLAGS"
6809                                 break
6810 else
6811   echo "$as_me: failed program was:" >&5
6812 cat "conftest.$ac_ext" >&5
6813
6814                                 CPPFLAGS="$cf_save_CPPFLAGS"
6815
6816 fi
6817 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6818                 fi
6819         done
6820
6821         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6822
6823 echo "${as_me:-configure}:6823: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6824
6825                 cf_save_LIBS="$LIBS"
6826                 cf_save_LDFLAGS="$LDFLAGS"
6827
6828                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6829
6830 cf_search=
6831 cf_library_path_list=""
6832 if test -n "${LDFLAGS}${LIBS}" ; then
6833         for cf_library_path in $LDFLAGS $LIBS
6834         do
6835                 case "$cf_library_path" in
6836                 (-L*)
6837                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6838
6839 test "x$cf_library_path" != "xNONE" && \
6840 test -d "$cf_library_path" && \
6841  {
6842         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6843         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6844         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6845         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6846         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6847         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6848 }
6849
6850                         cf_library_path_list="$cf_library_path_list $cf_search"
6851                         ;;
6852                 esac
6853         done
6854 fi
6855
6856 cf_search=
6857
6858 test "x$prefix" != "xNONE" && \
6859 test -d "$prefix" && \
6860  {
6861         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6862         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6863         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6864         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6865         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6866         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6867 }
6868
6869 for cf_subdir_prefix in \
6870         /usr \
6871         /usr/local \
6872         /usr/pkg \
6873         /opt \
6874         /opt/local \
6875         $HOME
6876 do
6877
6878 test "x$cf_subdir_prefix" != "x$prefix" && \
6879 test -d "$cf_subdir_prefix" && \
6880 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6881         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6882         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6883         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6884         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6885         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6886         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6887 }
6888
6889 done
6890
6891 cf_search="$cf_library_path_list $cf_search"
6892
6893                         for cf_cv_library_path_utf8 in $cf_search
6894                         do
6895                                 if test -d "$cf_cv_library_path_utf8" ; then
6896                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6897
6898 echo "${as_me:-configure}:6898: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6899
6900                                         CPPFLAGS="$cf_test_CPPFLAGS"
6901                                         LIBS="-lutf8  $cf_save_LIBS"
6902                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6903                                         cat >"conftest.$ac_ext" <<_ACEOF
6904 #line 6904 "configure"
6905 #include "confdefs.h"
6906
6907 #include <libutf8.h>
6908 int
6909 main (void)
6910 {
6911 putwc(0,0);
6912   ;
6913   return 0;
6914 }
6915 _ACEOF
6916 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6917 if { (eval echo "$as_me:6917: \"$ac_link\"") >&5
6918   (eval $ac_link) 2>&5
6919   ac_status=$?
6920   echo "$as_me:6920: \$? = $ac_status" >&5
6921   (exit "$ac_status"); } &&
6922          { ac_try='test -s "conftest$ac_exeext"'
6923   { (eval echo "$as_me:6923: \"$ac_try\"") >&5
6924   (eval $ac_try) 2>&5
6925   ac_status=$?
6926   echo "$as_me:6926: \$? = $ac_status" >&5
6927   (exit "$ac_status"); }; }; then
6928
6929                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6930
6931 echo "${as_me:-configure}:6931: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6932
6933                                         cf_cv_find_linkage_utf8=yes
6934                                         cf_cv_library_file_utf8="-lutf8"
6935                                         break
6936 else
6937   echo "$as_me: failed program was:" >&5
6938 cat "conftest.$ac_ext" >&5
6939
6940                                         CPPFLAGS="$cf_save_CPPFLAGS"
6941                                         LIBS="$cf_save_LIBS"
6942                                         LDFLAGS="$cf_save_LDFLAGS"
6943
6944 fi
6945 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6946                                 fi
6947                         done
6948                         CPPFLAGS="$cf_save_CPPFLAGS"
6949                         LDFLAGS="$cf_save_LDFLAGS"
6950                 fi
6951
6952         else
6953                 cf_cv_find_linkage_utf8=no
6954         fi
6955
6956 fi
6957 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6958
6959 fi
6960 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6961
6962 LIBS="$cf_save_LIBS"
6963
6964 if test "$cf_cv_find_linkage_utf8" = yes ; then
6965 cf_cv_utf8_lib=add-on
6966 else
6967 cf_cv_utf8_lib=no
6968 fi
6969
6970 fi
6971 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6972 fi
6973 echo "$as_me:6973: result: $cf_cv_utf8_lib" >&5
6974 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6975
6976 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6977 # ncurses/ncursesw:
6978 if test "$cf_cv_utf8_lib" = "add-on" ; then
6979
6980 cat >>confdefs.h <<\EOF
6981 #define HAVE_LIBUTF8_H 1
6982 EOF
6983
6984 if test -n "$cf_cv_header_path_utf8" ; then
6985   for cf_add_incdir in $cf_cv_header_path_utf8
6986   do
6987         while test "$cf_add_incdir" != /usr/include
6988         do
6989           if test -d "$cf_add_incdir"
6990           then
6991                 cf_have_incdir=no
6992                 if test -n "$CFLAGS$CPPFLAGS" ; then
6993                   # a loop is needed to ensure we can add subdirs of existing dirs
6994                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6995                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6996                           cf_have_incdir=yes; break
6997                         fi
6998                   done
6999                 fi
7000
7001                 if test "$cf_have_incdir" = no ; then
7002                   if test "$cf_add_incdir" = /usr/local/include ; then
7003                         if test "$GCC" = yes
7004                         then
7005                           cf_save_CPPFLAGS=$CPPFLAGS
7006
7007         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7008         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7009
7010                           cat >"conftest.$ac_ext" <<_ACEOF
7011 #line 7011 "configure"
7012 #include "confdefs.h"
7013 #include <stdio.h>
7014 int
7015 main (void)
7016 {
7017 printf("Hello")
7018   ;
7019   return 0;
7020 }
7021 _ACEOF
7022 rm -f "conftest.$ac_objext"
7023 if { (eval echo "$as_me:7023: \"$ac_compile\"") >&5
7024   (eval $ac_compile) 2>&5
7025   ac_status=$?
7026   echo "$as_me:7026: \$? = $ac_status" >&5
7027   (exit "$ac_status"); } &&
7028          { ac_try='test -s "conftest.$ac_objext"'
7029   { (eval echo "$as_me:7029: \"$ac_try\"") >&5
7030   (eval $ac_try) 2>&5
7031   ac_status=$?
7032   echo "$as_me:7032: \$? = $ac_status" >&5
7033   (exit "$ac_status"); }; }; then
7034   :
7035 else
7036   echo "$as_me: failed program was:" >&5
7037 cat "conftest.$ac_ext" >&5
7038 cf_have_incdir=yes
7039 fi
7040 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7041                           CPPFLAGS=$cf_save_CPPFLAGS
7042                         fi
7043                   fi
7044                 fi
7045
7046                 if test "$cf_have_incdir" = no ; then
7047                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7048
7049 echo "${as_me:-configure}:7049: testing adding $cf_add_incdir to include-path ..." 1>&5
7050
7051                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7052
7053                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7054                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7055                   cf_add_incdir="$cf_top_incdir"
7056                 else
7057                   break
7058                 fi
7059           else
7060                 break
7061           fi
7062         done
7063   done
7064 fi
7065
7066 if test -n "$cf_cv_library_path_utf8" ; then
7067         for cf_add_libdir in $cf_cv_library_path_utf8
7068         do
7069                 if test "$cf_add_libdir" = /usr/lib ; then
7070                         :
7071                 elif test -d "$cf_add_libdir"
7072                 then
7073                         cf_have_libdir=no
7074                         if test -n "$LDFLAGS$LIBS" ; then
7075                                 # a loop is needed to ensure we can add subdirs of existing dirs
7076                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7077                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7078                                                 cf_have_libdir=yes; break
7079                                         fi
7080                                 done
7081                         fi
7082                         if test "$cf_have_libdir" = no ; then
7083                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7084
7085 echo "${as_me:-configure}:7085: testing adding $cf_add_libdir to library-path ..." 1>&5
7086
7087                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7088                         fi
7089                 fi
7090         done
7091 fi
7092
7093 cf_add_libs="$LIBS"
7094 # reverse order
7095 cf_add_0lib=
7096 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7097 # filter duplicates
7098 for cf_add_1lib in $cf_add_0lib; do
7099         for cf_add_2lib in $cf_add_libs; do
7100                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7101                         cf_add_1lib=
7102                         break
7103                 fi
7104         done
7105         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7106 done
7107 LIBS="$cf_add_libs"
7108
7109 fi
7110
7111 cf_ncuconfig_root=ncursesw
7112 cf_have_ncuconfig=no
7113
7114 if test "x${PKG_CONFIG:=none}" != xnone; then
7115         echo "$as_me:7115: checking pkg-config for $cf_ncuconfig_root" >&5
7116 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7117         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7118                 echo "$as_me:7118: result: yes" >&5
7119 echo "${ECHO_T}yes" >&6
7120
7121                 echo "$as_me:7121: checking if the $cf_ncuconfig_root package files work" >&5
7122 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7123                 cf_have_ncuconfig=unknown
7124
7125                 cf_save_CFLAGS="$CFLAGS"
7126                 cf_save_CPPFLAGS="$CPPFLAGS"
7127                 cf_save_LIBS="$LIBS"
7128
7129                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7130                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7131
7132                 # while -W for passing linker flags is prevalent, it is not "standard".
7133                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7134                 # incompatible _and_ non-standard -W option which gives an error.  Work
7135                 # around that pitfall.
7136                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7137                 (x*c[89]9@@*-W*)
7138
7139 cf_fix_cppflags=no
7140 cf_new_cflags=
7141 cf_new_cppflags=
7142 cf_new_extra_cppflags=
7143
7144 for cf_add_cflags in $cf_pkg_cflags
7145 do
7146 case "$cf_fix_cppflags" in
7147 (no)
7148         case "$cf_add_cflags" in
7149         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7150                 case "$cf_add_cflags" in
7151                 (-D*)
7152                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7153
7154                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7155                                 && test -z "${cf_tst_cflags}" \
7156                                 && cf_fix_cppflags=yes
7157
7158                         if test "$cf_fix_cppflags" = yes ; then
7159
7160         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7161         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7162
7163                                 continue
7164                         elif test "${cf_tst_cflags}" = "\"'" ; then
7165
7166         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7167         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7168
7169                                 continue
7170                         fi
7171                         ;;
7172                 esac
7173                 case "$CPPFLAGS" in
7174                 (*$cf_add_cflags)
7175                         ;;
7176                 (*)
7177                         case "$cf_add_cflags" in
7178                         (-D*)
7179                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7180
7181 CPPFLAGS=`echo "$CPPFLAGS" | \
7182         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7183                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7184
7185                                 ;;
7186                         esac
7187
7188         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7189         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7190
7191                         ;;
7192                 esac
7193                 ;;
7194         (*)
7195
7196         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7197         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7198
7199                 ;;
7200         esac
7201         ;;
7202 (yes)
7203
7204         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7205         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7206
7207         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7208
7209         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7210                 && test -z "${cf_tst_cflags}" \
7211                 && cf_fix_cppflags=no
7212         ;;
7213 esac
7214 done
7215
7216 if test -n "$cf_new_cflags" ; then
7217
7218         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7219         CFLAGS="${CFLAGS}$cf_new_cflags"
7220
7221 fi
7222
7223 if test -n "$cf_new_cppflags" ; then
7224
7225         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7226         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7227
7228 fi
7229
7230 if test -n "$cf_new_extra_cppflags" ; then
7231
7232         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7233         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7234
7235 fi
7236
7237 cf_add_libs="$LIBS"
7238 # reverse order
7239 cf_add_0lib=
7240 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7241 # filter duplicates
7242 for cf_add_1lib in $cf_add_0lib; do
7243         for cf_add_2lib in $cf_add_libs; do
7244                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7245                         cf_add_1lib=
7246                         break
7247                 fi
7248         done
7249         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7250 done
7251 LIBS="$cf_add_libs"
7252
7253                         cat >"conftest.$ac_ext" <<_ACEOF
7254 #line 7254 "configure"
7255 #include "confdefs.h"
7256 #include <${cf_cv_ncurses_header:-curses.h}>
7257 int
7258 main (void)
7259 {
7260 initscr(); mousemask(0,0); tigetstr((char *)0);
7261   ;
7262   return 0;
7263 }
7264 _ACEOF
7265 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7266 if { (eval echo "$as_me:7266: \"$ac_link\"") >&5
7267   (eval $ac_link) 2>&5
7268   ac_status=$?
7269   echo "$as_me:7269: \$? = $ac_status" >&5
7270   (exit "$ac_status"); } &&
7271          { ac_try='test -s "conftest$ac_exeext"'
7272   { (eval echo "$as_me:7272: \"$ac_try\"") >&5
7273   (eval $ac_try) 2>&5
7274   ac_status=$?
7275   echo "$as_me:7275: \$? = $ac_status" >&5
7276   (exit "$ac_status"); }; }; then
7277   if test "$cross_compiling" = yes; then
7278   cf_test_ncuconfig=maybe
7279 else
7280   cat >"conftest.$ac_ext" <<_ACEOF
7281 #line 7281 "configure"
7282 #include "confdefs.h"
7283 #include <${cf_cv_ncurses_header:-curses.h}>
7284                                         int main(void)
7285                                         { const char *xx = curses_version(); return (xx == 0); }
7286 _ACEOF
7287 rm -f "conftest$ac_exeext"
7288 if { (eval echo "$as_me:7288: \"$ac_link\"") >&5
7289   (eval $ac_link) 2>&5
7290   ac_status=$?
7291   echo "$as_me:7291: \$? = $ac_status" >&5
7292   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7293   { (eval echo "$as_me:7293: \"$ac_try\"") >&5
7294   (eval $ac_try) 2>&5
7295   ac_status=$?
7296   echo "$as_me:7296: \$? = $ac_status" >&5
7297   (exit "$ac_status"); }; }; then
7298   cf_test_ncuconfig=yes
7299 else
7300   echo "$as_me: program exited with status $ac_status" >&5
7301 echo "$as_me: failed program was:" >&5
7302 cat "conftest.$ac_ext" >&5
7303 cf_test_ncuconfig=no
7304 fi
7305 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7306 fi
7307 else
7308   echo "$as_me: failed program was:" >&5
7309 cat "conftest.$ac_ext" >&5
7310 cf_test_ncuconfig=no
7311 fi
7312 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7313
7314                         CFLAGS="$cf_save_CFLAGS"
7315                         CPPFLAGS="$cf_save_CPPFLAGS"
7316                         LIBS="$cf_save_LIBS"
7317
7318                         if test "x$cf_test_ncuconfig" != xyes; then
7319                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7320                                 cf_pkg_cflags="$cf_temp"
7321                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7322                                 cf_pkg_libs="$cf_temp"
7323                         fi
7324                         ;;
7325                 esac
7326
7327 cf_fix_cppflags=no
7328 cf_new_cflags=
7329 cf_new_cppflags=
7330 cf_new_extra_cppflags=
7331
7332 for cf_add_cflags in $cf_pkg_cflags
7333 do
7334 case "$cf_fix_cppflags" in
7335 (no)
7336         case "$cf_add_cflags" in
7337         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7338                 case "$cf_add_cflags" in
7339                 (-D*)
7340                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7341
7342                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7343                                 && test -z "${cf_tst_cflags}" \
7344                                 && cf_fix_cppflags=yes
7345
7346                         if test "$cf_fix_cppflags" = yes ; then
7347
7348         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7349         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7350
7351                                 continue
7352                         elif test "${cf_tst_cflags}" = "\"'" ; then
7353
7354         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7355         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7356
7357                                 continue
7358                         fi
7359                         ;;
7360                 esac
7361                 case "$CPPFLAGS" in
7362                 (*$cf_add_cflags)
7363                         ;;
7364                 (*)
7365                         case "$cf_add_cflags" in
7366                         (-D*)
7367                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7368
7369 CPPFLAGS=`echo "$CPPFLAGS" | \
7370         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7371                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7372
7373                                 ;;
7374                         esac
7375
7376         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7377         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7378
7379                         ;;
7380                 esac
7381                 ;;
7382         (*)
7383
7384         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7385         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7386
7387                 ;;
7388         esac
7389         ;;
7390 (yes)
7391
7392         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7393         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7394
7395         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7396
7397         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7398                 && test -z "${cf_tst_cflags}" \
7399                 && cf_fix_cppflags=no
7400         ;;
7401 esac
7402 done
7403
7404 if test -n "$cf_new_cflags" ; then
7405
7406         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7407         CFLAGS="${CFLAGS}$cf_new_cflags"
7408
7409 fi
7410
7411 if test -n "$cf_new_cppflags" ; then
7412
7413         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7414         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7415
7416 fi
7417
7418 if test -n "$cf_new_extra_cppflags" ; then
7419
7420         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7421         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7422
7423 fi
7424
7425 cf_add_libs="$LIBS"
7426 # reverse order
7427 cf_add_0lib=
7428 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7429 # filter duplicates
7430 for cf_add_1lib in $cf_add_0lib; do
7431         for cf_add_2lib in $cf_add_libs; do
7432                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7433                         cf_add_1lib=
7434                         break
7435                 fi
7436         done
7437         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7438 done
7439 LIBS="$cf_add_libs"
7440
7441                 cat >"conftest.$ac_ext" <<_ACEOF
7442 #line 7442 "configure"
7443 #include "confdefs.h"
7444 #include <${cf_cv_ncurses_header:-curses.h}>
7445 int
7446 main (void)
7447 {
7448 initscr(); mousemask(0,0); tigetstr((char *)0);
7449   ;
7450   return 0;
7451 }
7452 _ACEOF
7453 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7454 if { (eval echo "$as_me:7454: \"$ac_link\"") >&5
7455   (eval $ac_link) 2>&5
7456   ac_status=$?
7457   echo "$as_me:7457: \$? = $ac_status" >&5
7458   (exit "$ac_status"); } &&
7459          { ac_try='test -s "conftest$ac_exeext"'
7460   { (eval echo "$as_me:7460: \"$ac_try\"") >&5
7461   (eval $ac_try) 2>&5
7462   ac_status=$?
7463   echo "$as_me:7463: \$? = $ac_status" >&5
7464   (exit "$ac_status"); }; }; then
7465   if test "$cross_compiling" = yes; then
7466   cf_have_ncuconfig=maybe
7467 else
7468   cat >"conftest.$ac_ext" <<_ACEOF
7469 #line 7469 "configure"
7470 #include "confdefs.h"
7471 #include <${cf_cv_ncurses_header:-curses.h}>
7472                                 int main(void)
7473                                 { const char *xx = curses_version(); return (xx == 0); }
7474 _ACEOF
7475 rm -f "conftest$ac_exeext"
7476 if { (eval echo "$as_me:7476: \"$ac_link\"") >&5
7477   (eval $ac_link) 2>&5
7478   ac_status=$?
7479   echo "$as_me:7479: \$? = $ac_status" >&5
7480   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7481   { (eval echo "$as_me:7481: \"$ac_try\"") >&5
7482   (eval $ac_try) 2>&5
7483   ac_status=$?
7484   echo "$as_me:7484: \$? = $ac_status" >&5
7485   (exit "$ac_status"); }; }; then
7486   cf_have_ncuconfig=yes
7487 else
7488   echo "$as_me: program exited with status $ac_status" >&5
7489 echo "$as_me: failed program was:" >&5
7490 cat "conftest.$ac_ext" >&5
7491 cf_have_ncuconfig=no
7492 fi
7493 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7494 fi
7495 else
7496   echo "$as_me: failed program was:" >&5
7497 cat "conftest.$ac_ext" >&5
7498 cf_have_ncuconfig=no
7499 fi
7500 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7501                 echo "$as_me:7501: result: $cf_have_ncuconfig" >&5
7502 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7503                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7504                 if test "$cf_have_ncuconfig" != "yes"
7505                 then
7506                         CPPFLAGS="$cf_save_CPPFLAGS"
7507                         LIBS="$cf_save_LIBS"
7508                         NCURSES_CONFIG_PKG=none
7509                 else
7510
7511 cat >>confdefs.h <<\EOF
7512 #define NCURSES 1
7513 EOF
7514
7515                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7516
7517 echo "$as_me:7517: checking for terminfo header" >&5
7518 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7519 if test "${cf_cv_term_header+set}" = set; then
7520   echo $ECHO_N "(cached) $ECHO_C" >&6
7521 else
7522
7523 case "${cf_cv_ncurses_header}" in
7524 (*/ncurses.h|*/ncursesw.h)
7525         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7526         ;;
7527 (*)
7528         cf_term_header=term.h
7529         ;;
7530 esac
7531
7532 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7533 do
7534 cat >"conftest.$ac_ext" <<_ACEOF
7535 #line 7535 "configure"
7536 #include "confdefs.h"
7537 #include <stdio.h>
7538 #include <${cf_cv_ncurses_header:-curses.h}>
7539 #include <$cf_test>
7540
7541 int
7542 main (void)
7543 {
7544 int x = auto_left_margin; (void)x
7545   ;
7546   return 0;
7547 }
7548 _ACEOF
7549 rm -f "conftest.$ac_objext"
7550 if { (eval echo "$as_me:7550: \"$ac_compile\"") >&5
7551   (eval $ac_compile) 2>&5
7552   ac_status=$?
7553   echo "$as_me:7553: \$? = $ac_status" >&5
7554   (exit "$ac_status"); } &&
7555          { ac_try='test -s "conftest.$ac_objext"'
7556   { (eval echo "$as_me:7556: \"$ac_try\"") >&5
7557   (eval $ac_try) 2>&5
7558   ac_status=$?
7559   echo "$as_me:7559: \$? = $ac_status" >&5
7560   (exit "$ac_status"); }; }; then
7561
7562         cf_cv_term_header="$cf_test"
7563 else
7564   echo "$as_me: failed program was:" >&5
7565 cat "conftest.$ac_ext" >&5
7566
7567         cf_cv_term_header=unknown
7568
7569 fi
7570 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7571         test "$cf_cv_term_header" != unknown && break
7572 done
7573
7574 fi
7575 echo "$as_me:7575: result: $cf_cv_term_header" >&5
7576 echo "${ECHO_T}$cf_cv_term_header" >&6
7577
7578 # Set definitions to allow ifdef'ing to accommodate subdirectories
7579
7580 case "$cf_cv_term_header" in
7581 (*term.h)
7582
7583 cat >>confdefs.h <<\EOF
7584 #define HAVE_TERM_H 1
7585 EOF
7586
7587         ;;
7588 esac
7589
7590 case "$cf_cv_term_header" in
7591 (ncurses/term.h)
7592
7593 cat >>confdefs.h <<\EOF
7594 #define HAVE_NCURSES_TERM_H 1
7595 EOF
7596
7597         ;;
7598 (ncursesw/term.h)
7599
7600 cat >>confdefs.h <<\EOF
7601 #define HAVE_NCURSESW_TERM_H 1
7602 EOF
7603
7604         ;;
7605 esac
7606
7607                 fi
7608
7609         else
7610                 echo "$as_me:7610: result: no" >&5
7611 echo "${ECHO_T}no" >&6
7612                 NCURSES_CONFIG_PKG=none
7613         fi
7614 else
7615         NCURSES_CONFIG_PKG=none
7616 fi
7617
7618 if test "x$cf_have_ncuconfig" = "xno"; then
7619         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7620
7621 if test -n "$ac_tool_prefix"; then
7622   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7623   do
7624     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7625 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7626 echo "$as_me:7626: checking for $ac_word" >&5
7627 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7628 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7629   echo $ECHO_N "(cached) $ECHO_C" >&6
7630 else
7631   if test -n "$NCURSES_CONFIG"; then
7632   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7633 else
7634   ac_save_IFS=$IFS; IFS=$ac_path_separator
7635 ac_dummy="$PATH"
7636 for ac_dir in $ac_dummy; do
7637   IFS=$ac_save_IFS
7638   test -z "$ac_dir" && ac_dir=.
7639   $as_executable_p "$ac_dir/$ac_word" || continue
7640 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7641 echo "$as_me:7641: found $ac_dir/$ac_word" >&5
7642 break
7643 done
7644
7645 fi
7646 fi
7647 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7648 if test -n "$NCURSES_CONFIG"; then
7649   echo "$as_me:7649: result: $NCURSES_CONFIG" >&5
7650 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7651 else
7652   echo "$as_me:7652: result: no" >&5
7653 echo "${ECHO_T}no" >&6
7654 fi
7655
7656     test -n "$NCURSES_CONFIG" && break
7657   done
7658 fi
7659 if test -z "$NCURSES_CONFIG"; then
7660   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7661   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7662 do
7663   # Extract the first word of "$ac_prog", so it can be a program name with args.
7664 set dummy $ac_prog; ac_word=$2
7665 echo "$as_me:7665: checking for $ac_word" >&5
7666 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7667 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7668   echo $ECHO_N "(cached) $ECHO_C" >&6
7669 else
7670   if test -n "$ac_ct_NCURSES_CONFIG"; then
7671   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7672 else
7673   ac_save_IFS=$IFS; IFS=$ac_path_separator
7674 ac_dummy="$PATH"
7675 for ac_dir in $ac_dummy; do
7676   IFS=$ac_save_IFS
7677   test -z "$ac_dir" && ac_dir=.
7678   $as_executable_p "$ac_dir/$ac_word" || continue
7679 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7680 echo "$as_me:7680: found $ac_dir/$ac_word" >&5
7681 break
7682 done
7683
7684 fi
7685 fi
7686 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7687 if test -n "$ac_ct_NCURSES_CONFIG"; then
7688   echo "$as_me:7688: result: $ac_ct_NCURSES_CONFIG" >&5
7689 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7690 else
7691   echo "$as_me:7691: result: no" >&5
7692 echo "${ECHO_T}no" >&6
7693 fi
7694
7695   test -n "$ac_ct_NCURSES_CONFIG" && break
7696 done
7697 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7698
7699   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7700 fi
7701
7702         if test "$NCURSES_CONFIG" != none ; then
7703
7704 cf_fix_cppflags=no
7705 cf_new_cflags=
7706 cf_new_cppflags=
7707 cf_new_extra_cppflags=
7708
7709 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7710 do
7711 case "$cf_fix_cppflags" in
7712 (no)
7713         case "$cf_add_cflags" in
7714         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7715                 case "$cf_add_cflags" in
7716                 (-D*)
7717                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7718
7719                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7720                                 && test -z "${cf_tst_cflags}" \
7721                                 && cf_fix_cppflags=yes
7722
7723                         if test "$cf_fix_cppflags" = yes ; then
7724
7725         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7726         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7727
7728                                 continue
7729                         elif test "${cf_tst_cflags}" = "\"'" ; then
7730
7731         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7732         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7733
7734                                 continue
7735                         fi
7736                         ;;
7737                 esac
7738                 case "$CPPFLAGS" in
7739                 (*$cf_add_cflags)
7740                         ;;
7741                 (*)
7742                         case "$cf_add_cflags" in
7743                         (-D*)
7744                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7745
7746 CPPFLAGS=`echo "$CPPFLAGS" | \
7747         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7748                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7749
7750                                 ;;
7751                         esac
7752
7753         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7754         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7755
7756                         ;;
7757                 esac
7758                 ;;
7759         (*)
7760
7761         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7762         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7763
7764                 ;;
7765         esac
7766         ;;
7767 (yes)
7768
7769         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7770         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7771
7772         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7773
7774         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7775                 && test -z "${cf_tst_cflags}" \
7776                 && cf_fix_cppflags=no
7777         ;;
7778 esac
7779 done
7780
7781 if test -n "$cf_new_cflags" ; then
7782
7783         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7784         CFLAGS="${CFLAGS}$cf_new_cflags"
7785
7786 fi
7787
7788 if test -n "$cf_new_cppflags" ; then
7789
7790         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7791         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7792
7793 fi
7794
7795 if test -n "$cf_new_extra_cppflags" ; then
7796
7797         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7798         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7799
7800 fi
7801
7802 cf_add_libs="$LIBS"
7803 # reverse order
7804 cf_add_0lib=
7805 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7806 # filter duplicates
7807 for cf_add_1lib in $cf_add_0lib; do
7808         for cf_add_2lib in $cf_add_libs; do
7809                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7810                         cf_add_1lib=
7811                         break
7812                 fi
7813         done
7814         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7815 done
7816 LIBS="$cf_add_libs"
7817
7818                 # even with config script, some packages use no-override for curses.h
7819
7820 echo "$as_me:7820: checking if we have identified curses headers" >&5
7821 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7822 if test "${cf_cv_ncurses_header+set}" = set; then
7823   echo $ECHO_N "(cached) $ECHO_C" >&6
7824 else
7825
7826 cf_cv_ncurses_header=none
7827 for cf_header in \
7828         ncurses.h ncursesw/ncurses.h \
7829         curses.h ncursesw/curses.h
7830 do
7831 cat >"conftest.$ac_ext" <<_ACEOF
7832 #line 7832 "configure"
7833 #include "confdefs.h"
7834 #include <${cf_header}>
7835 int
7836 main (void)
7837 {
7838 initscr(); tgoto("?", 0,0)
7839   ;
7840   return 0;
7841 }
7842 _ACEOF
7843 rm -f "conftest.$ac_objext"
7844 if { (eval echo "$as_me:7844: \"$ac_compile\"") >&5
7845   (eval $ac_compile) 2>&5
7846   ac_status=$?
7847   echo "$as_me:7847: \$? = $ac_status" >&5
7848   (exit "$ac_status"); } &&
7849          { ac_try='test -s "conftest.$ac_objext"'
7850   { (eval echo "$as_me:7850: \"$ac_try\"") >&5
7851   (eval $ac_try) 2>&5
7852   ac_status=$?
7853   echo "$as_me:7853: \$? = $ac_status" >&5
7854   (exit "$ac_status"); }; }; then
7855   cf_cv_ncurses_header=$cf_header; break
7856 else
7857   echo "$as_me: failed program was:" >&5
7858 cat "conftest.$ac_ext" >&5
7859 fi
7860 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7861 done
7862
7863 fi
7864 echo "$as_me:7864: result: $cf_cv_ncurses_header" >&5
7865 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7866
7867 if test "$cf_cv_ncurses_header" = none ; then
7868         { { echo "$as_me:7868: error: No curses header-files found" >&5
7869 echo "$as_me: error: No curses header-files found" >&2;}
7870    { (exit 1); exit 1; }; }
7871 fi
7872
7873 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7874
7875 for ac_header in $cf_cv_ncurses_header
7876 do
7877 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7878 echo "$as_me:7878: checking for $ac_header" >&5
7879 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7880 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7881   echo $ECHO_N "(cached) $ECHO_C" >&6
7882 else
7883   cat >"conftest.$ac_ext" <<_ACEOF
7884 #line 7884 "configure"
7885 #include "confdefs.h"
7886 #include <$ac_header>
7887 _ACEOF
7888 if { (eval echo "$as_me:7888: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7889   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7890   ac_status=$?
7891   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7892   rm -f conftest.er1
7893   cat conftest.err >&5
7894   echo "$as_me:7894: \$? = $ac_status" >&5
7895   (exit "$ac_status"); } >/dev/null; then
7896   if test -s conftest.err; then
7897     ac_cpp_err=$ac_c_preproc_warn_flag
7898   else
7899     ac_cpp_err=
7900   fi
7901 else
7902   ac_cpp_err=yes
7903 fi
7904 if test -z "$ac_cpp_err"; then
7905   eval "$as_ac_Header=yes"
7906 else
7907   echo "$as_me: failed program was:" >&5
7908   cat "conftest.$ac_ext" >&5
7909   eval "$as_ac_Header=no"
7910 fi
7911 rm -f conftest.err "conftest.$ac_ext"
7912 fi
7913 echo "$as_me:7913: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7914 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7915 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7916   cat >>confdefs.h <<EOF
7917 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7918 EOF
7919
7920 fi
7921 done
7922
7923 cat >>confdefs.h <<\EOF
7924 #define NCURSES 1
7925 EOF
7926
7927 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7928
7929                 cat >>confdefs.h <<EOF
7930 #define $cf_nculib_ROOT 1
7931 EOF
7932
7933                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
7934
7935         else
7936
7937 cf_ncuhdr_root=ncursesw
7938
7939 test -n "$cf_cv_curses_dir" && \
7940 test "$cf_cv_curses_dir" != "no" && { \
7941
7942 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7943   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7944   do
7945         while test "$cf_add_incdir" != /usr/include
7946         do
7947           if test -d "$cf_add_incdir"
7948           then
7949                 cf_have_incdir=no
7950                 if test -n "$CFLAGS$CPPFLAGS" ; then
7951                   # a loop is needed to ensure we can add subdirs of existing dirs
7952                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7953                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7954                           cf_have_incdir=yes; break
7955                         fi
7956                   done
7957                 fi
7958
7959                 if test "$cf_have_incdir" = no ; then
7960                   if test "$cf_add_incdir" = /usr/local/include ; then
7961                         if test "$GCC" = yes
7962                         then
7963                           cf_save_CPPFLAGS=$CPPFLAGS
7964
7965         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7966         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7967
7968                           cat >"conftest.$ac_ext" <<_ACEOF
7969 #line 7969 "configure"
7970 #include "confdefs.h"
7971 #include <stdio.h>
7972 int
7973 main (void)
7974 {
7975 printf("Hello")
7976   ;
7977   return 0;
7978 }
7979 _ACEOF
7980 rm -f "conftest.$ac_objext"
7981 if { (eval echo "$as_me:7981: \"$ac_compile\"") >&5
7982   (eval $ac_compile) 2>&5
7983   ac_status=$?
7984   echo "$as_me:7984: \$? = $ac_status" >&5
7985   (exit "$ac_status"); } &&
7986          { ac_try='test -s "conftest.$ac_objext"'
7987   { (eval echo "$as_me:7987: \"$ac_try\"") >&5
7988   (eval $ac_try) 2>&5
7989   ac_status=$?
7990   echo "$as_me:7990: \$? = $ac_status" >&5
7991   (exit "$ac_status"); }; }; then
7992   :
7993 else
7994   echo "$as_me: failed program was:" >&5
7995 cat "conftest.$ac_ext" >&5
7996 cf_have_incdir=yes
7997 fi
7998 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7999                           CPPFLAGS=$cf_save_CPPFLAGS
8000                         fi
8001                   fi
8002                 fi
8003
8004                 if test "$cf_have_incdir" = no ; then
8005                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8006
8007 echo "${as_me:-configure}:8007: testing adding $cf_add_incdir to include-path ..." 1>&5
8008
8009                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8010
8011                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8012                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8013                   cf_add_incdir="$cf_top_incdir"
8014                 else
8015                   break
8016                 fi
8017           else
8018                 break
8019           fi
8020         done
8021   done
8022 fi
8023
8024 }
8025
8026 echo "$as_me:8026: checking for $cf_ncuhdr_root header in include-path" >&5
8027 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8028 if test "${cf_cv_ncurses_h+set}" = set; then
8029   echo $ECHO_N "(cached) $ECHO_C" >&6
8030 else
8031
8032         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8033         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8034         for cf_header in $cf_header_list
8035         do
8036
8037         cat >"conftest.$ac_ext" <<_ACEOF
8038 #line 8038 "configure"
8039 #include "confdefs.h"
8040
8041 #define _XOPEN_SOURCE_EXTENDED
8042 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8043 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8044
8045 #include <$cf_header>
8046 int
8047 main (void)
8048 {
8049
8050 #ifdef NCURSES_VERSION
8051
8052 #ifndef WACS_BSSB
8053         make an error
8054 #endif
8055
8056 printf("%s\\n", NCURSES_VERSION);
8057 #else
8058 #ifdef __NCURSES_H
8059 printf("old\\n");
8060 #else
8061         make an error
8062 #endif
8063 #endif
8064
8065   ;
8066   return 0;
8067 }
8068 _ACEOF
8069 rm -f "conftest.$ac_objext"
8070 if { (eval echo "$as_me:8070: \"$ac_compile\"") >&5
8071   (eval $ac_compile) 2>&5
8072   ac_status=$?
8073   echo "$as_me:8073: \$? = $ac_status" >&5
8074   (exit "$ac_status"); } &&
8075          { ac_try='test -s "conftest.$ac_objext"'
8076   { (eval echo "$as_me:8076: \"$ac_try\"") >&5
8077   (eval $ac_try) 2>&5
8078   ac_status=$?
8079   echo "$as_me:8079: \$? = $ac_status" >&5
8080   (exit "$ac_status"); }; }; then
8081   cf_cv_ncurses_h=$cf_header
8082
8083 else
8084   echo "$as_me: failed program was:" >&5
8085 cat "conftest.$ac_ext" >&5
8086 cf_cv_ncurses_h=no
8087 fi
8088 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8089
8090                 test "$cf_cv_ncurses_h" != no && break
8091         done
8092
8093 fi
8094 echo "$as_me:8094: result: $cf_cv_ncurses_h" >&5
8095 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8096
8097 if test "$cf_cv_ncurses_h" != no ; then
8098         cf_cv_ncurses_header=$cf_cv_ncurses_h
8099 else
8100
8101 echo "$as_me:8101: checking for $cf_ncuhdr_root include-path" >&5
8102 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8103 if test "${cf_cv_ncurses_h2+set}" = set; then
8104   echo $ECHO_N "(cached) $ECHO_C" >&6
8105 else
8106
8107         test -n "$verbose" && echo
8108
8109 cf_search=
8110
8111 # collect the current set of include-directories from compiler flags
8112 cf_header_path_list=""
8113 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8114         for cf_header_path in $CPPFLAGS $CFLAGS
8115         do
8116                 case "$cf_header_path" in
8117                 (-I*)
8118                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8119
8120 test "x$cf_header_path" != "xNONE" && \
8121 test -d "$cf_header_path" && \
8122  {
8123         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8124         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8125         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8126         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8127         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8128         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"
8129 }
8130
8131                         cf_header_path_list="$cf_header_path_list $cf_search"
8132                         ;;
8133                 esac
8134         done
8135 fi
8136
8137 # add the variations for the package we are looking for
8138
8139 cf_search=
8140
8141 test "x$prefix" != "xNONE" && \
8142 test -d "$prefix" && \
8143  {
8144         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8145         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8146         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8147         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8148         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8149         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8150 }
8151
8152 for cf_subdir_prefix in \
8153         /usr \
8154         /usr/local \
8155         /usr/pkg \
8156         /opt \
8157         /opt/local \
8158         $HOME
8159 do
8160
8161 test "x$cf_subdir_prefix" != "x$prefix" && \
8162 test -d "$cf_subdir_prefix" && \
8163 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8164         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8165         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8166         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8167         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8168         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8169         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"
8170 }
8171
8172 done
8173
8174 test "$includedir" != NONE && \
8175 test "$includedir" != "/usr/include" && \
8176 test -d "$includedir" && {
8177         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8178         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8179 }
8180
8181 test "$oldincludedir" != NONE && \
8182 test "$oldincludedir" != "/usr/include" && \
8183 test -d "$oldincludedir" && {
8184         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8185         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8186 }
8187
8188 cf_search="$cf_search $cf_header_path_list"
8189
8190         test -n "$verbose" && echo "search path $cf_search"
8191         cf_save2_CPPFLAGS="$CPPFLAGS"
8192         for cf_incdir in $cf_search
8193         do
8194
8195 if test -n "$cf_incdir" ; then
8196   for cf_add_incdir in $cf_incdir
8197   do
8198         while test "$cf_add_incdir" != /usr/include
8199         do
8200           if test -d "$cf_add_incdir"
8201           then
8202                 cf_have_incdir=no
8203                 if test -n "$CFLAGS$CPPFLAGS" ; then
8204                   # a loop is needed to ensure we can add subdirs of existing dirs
8205                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8206                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8207                           cf_have_incdir=yes; break
8208                         fi
8209                   done
8210                 fi
8211
8212                 if test "$cf_have_incdir" = no ; then
8213                   if test "$cf_add_incdir" = /usr/local/include ; then
8214                         if test "$GCC" = yes
8215                         then
8216                           cf_save_CPPFLAGS=$CPPFLAGS
8217
8218         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8219         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8220
8221                           cat >"conftest.$ac_ext" <<_ACEOF
8222 #line 8222 "configure"
8223 #include "confdefs.h"
8224 #include <stdio.h>
8225 int
8226 main (void)
8227 {
8228 printf("Hello")
8229   ;
8230   return 0;
8231 }
8232 _ACEOF
8233 rm -f "conftest.$ac_objext"
8234 if { (eval echo "$as_me:8234: \"$ac_compile\"") >&5
8235   (eval $ac_compile) 2>&5
8236   ac_status=$?
8237   echo "$as_me:8237: \$? = $ac_status" >&5
8238   (exit "$ac_status"); } &&
8239          { ac_try='test -s "conftest.$ac_objext"'
8240   { (eval echo "$as_me:8240: \"$ac_try\"") >&5
8241   (eval $ac_try) 2>&5
8242   ac_status=$?
8243   echo "$as_me:8243: \$? = $ac_status" >&5
8244   (exit "$ac_status"); }; }; then
8245   :
8246 else
8247   echo "$as_me: failed program was:" >&5
8248 cat "conftest.$ac_ext" >&5
8249 cf_have_incdir=yes
8250 fi
8251 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8252                           CPPFLAGS=$cf_save_CPPFLAGS
8253                         fi
8254                   fi
8255                 fi
8256
8257                 if test "$cf_have_incdir" = no ; then
8258                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8259
8260 echo "${as_me:-configure}:8260: testing adding $cf_add_incdir to include-path ..." 1>&5
8261
8262                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8263
8264                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8265                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8266                   cf_add_incdir="$cf_top_incdir"
8267                 else
8268                   break
8269                 fi
8270           else
8271                 break
8272           fi
8273         done
8274   done
8275 fi
8276
8277                 for cf_header in \
8278                         ncurses.h \
8279                         curses.h
8280                 do
8281
8282         cat >"conftest.$ac_ext" <<_ACEOF
8283 #line 8283 "configure"
8284 #include "confdefs.h"
8285
8286 #include <$cf_header>
8287 int
8288 main (void)
8289 {
8290
8291 #ifdef NCURSES_VERSION
8292
8293 printf("%s\\n", NCURSES_VERSION);
8294 #else
8295 #ifdef __NCURSES_H
8296 printf("old\\n");
8297 #else
8298         make an error
8299 #endif
8300 #endif
8301
8302   ;
8303   return 0;
8304 }
8305 _ACEOF
8306 rm -f "conftest.$ac_objext"
8307 if { (eval echo "$as_me:8307: \"$ac_compile\"") >&5
8308   (eval $ac_compile) 2>&5
8309   ac_status=$?
8310   echo "$as_me:8310: \$? = $ac_status" >&5
8311   (exit "$ac_status"); } &&
8312          { ac_try='test -s "conftest.$ac_objext"'
8313   { (eval echo "$as_me:8313: \"$ac_try\"") >&5
8314   (eval $ac_try) 2>&5
8315   ac_status=$?
8316   echo "$as_me:8316: \$? = $ac_status" >&5
8317   (exit "$ac_status"); }; }; then
8318   cf_cv_ncurses_h2=$cf_header
8319
8320 else
8321   echo "$as_me: failed program was:" >&5
8322 cat "conftest.$ac_ext" >&5
8323 cf_cv_ncurses_h2=no
8324 fi
8325 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8326
8327                         if test "$cf_cv_ncurses_h2" != no ; then
8328                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8329                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8330                                 break
8331                         fi
8332                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8333                 done
8334                 CPPFLAGS="$cf_save2_CPPFLAGS"
8335                 test "$cf_cv_ncurses_h2" != no && break
8336         done
8337         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8337: error: not found" >&5
8338 echo "$as_me: error: not found" >&2;}
8339    { (exit 1); exit 1; }; }
8340
8341 fi
8342 echo "$as_me:8342: result: $cf_cv_ncurses_h2" >&5
8343 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8344
8345         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8346         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8347         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8348                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8349         fi
8350
8351 if test -n "$cf_1st_incdir" ; then
8352   for cf_add_incdir in $cf_1st_incdir
8353   do
8354         while test "$cf_add_incdir" != /usr/include
8355         do
8356           if test -d "$cf_add_incdir"
8357           then
8358                 cf_have_incdir=no
8359                 if test -n "$CFLAGS$CPPFLAGS" ; then
8360                   # a loop is needed to ensure we can add subdirs of existing dirs
8361                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8362                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8363                           cf_have_incdir=yes; break
8364                         fi
8365                   done
8366                 fi
8367
8368                 if test "$cf_have_incdir" = no ; then
8369                   if test "$cf_add_incdir" = /usr/local/include ; then
8370                         if test "$GCC" = yes
8371                         then
8372                           cf_save_CPPFLAGS=$CPPFLAGS
8373
8374         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8375         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8376
8377                           cat >"conftest.$ac_ext" <<_ACEOF
8378 #line 8378 "configure"
8379 #include "confdefs.h"
8380 #include <stdio.h>
8381 int
8382 main (void)
8383 {
8384 printf("Hello")
8385   ;
8386   return 0;
8387 }
8388 _ACEOF
8389 rm -f "conftest.$ac_objext"
8390 if { (eval echo "$as_me:8390: \"$ac_compile\"") >&5
8391   (eval $ac_compile) 2>&5
8392   ac_status=$?
8393   echo "$as_me:8393: \$? = $ac_status" >&5
8394   (exit "$ac_status"); } &&
8395          { ac_try='test -s "conftest.$ac_objext"'
8396   { (eval echo "$as_me:8396: \"$ac_try\"") >&5
8397   (eval $ac_try) 2>&5
8398   ac_status=$?
8399   echo "$as_me:8399: \$? = $ac_status" >&5
8400   (exit "$ac_status"); }; }; then
8401   :
8402 else
8403   echo "$as_me: failed program was:" >&5
8404 cat "conftest.$ac_ext" >&5
8405 cf_have_incdir=yes
8406 fi
8407 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8408                           CPPFLAGS=$cf_save_CPPFLAGS
8409                         fi
8410                   fi
8411                 fi
8412
8413                 if test "$cf_have_incdir" = no ; then
8414                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8415
8416 echo "${as_me:-configure}:8416: testing adding $cf_add_incdir to include-path ..." 1>&5
8417
8418                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8419
8420                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8421                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8422                   cf_add_incdir="$cf_top_incdir"
8423                 else
8424                   break
8425                 fi
8426           else
8427                 break
8428           fi
8429         done
8430   done
8431 fi
8432
8433 fi
8434
8435 # Set definitions to allow ifdef'ing for ncurses.h
8436
8437 case "$cf_cv_ncurses_header" in
8438 (*ncurses.h)
8439
8440 cat >>confdefs.h <<\EOF
8441 #define HAVE_NCURSES_H 1
8442 EOF
8443
8444         ;;
8445 esac
8446
8447 case "$cf_cv_ncurses_header" in
8448 (ncurses/curses.h|ncurses/ncurses.h)
8449
8450 cat >>confdefs.h <<\EOF
8451 #define HAVE_NCURSES_NCURSES_H 1
8452 EOF
8453
8454         ;;
8455 (ncursesw/curses.h|ncursesw/ncurses.h)
8456
8457 cat >>confdefs.h <<\EOF
8458 #define HAVE_NCURSESW_NCURSES_H 1
8459 EOF
8460
8461         ;;
8462 esac
8463
8464 echo "$as_me:8464: checking for terminfo header" >&5
8465 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8466 if test "${cf_cv_term_header+set}" = set; then
8467   echo $ECHO_N "(cached) $ECHO_C" >&6
8468 else
8469
8470 case "${cf_cv_ncurses_header}" in
8471 (*/ncurses.h|*/ncursesw.h)
8472         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8473         ;;
8474 (*)
8475         cf_term_header=term.h
8476         ;;
8477 esac
8478
8479 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8480 do
8481 cat >"conftest.$ac_ext" <<_ACEOF
8482 #line 8482 "configure"
8483 #include "confdefs.h"
8484 #include <stdio.h>
8485 #include <${cf_cv_ncurses_header:-curses.h}>
8486 #include <$cf_test>
8487
8488 int
8489 main (void)
8490 {
8491 int x = auto_left_margin; (void)x
8492   ;
8493   return 0;
8494 }
8495 _ACEOF
8496 rm -f "conftest.$ac_objext"
8497 if { (eval echo "$as_me:8497: \"$ac_compile\"") >&5
8498   (eval $ac_compile) 2>&5
8499   ac_status=$?
8500   echo "$as_me:8500: \$? = $ac_status" >&5
8501   (exit "$ac_status"); } &&
8502          { ac_try='test -s "conftest.$ac_objext"'
8503   { (eval echo "$as_me:8503: \"$ac_try\"") >&5
8504   (eval $ac_try) 2>&5
8505   ac_status=$?
8506   echo "$as_me:8506: \$? = $ac_status" >&5
8507   (exit "$ac_status"); }; }; then
8508
8509         cf_cv_term_header="$cf_test"
8510 else
8511   echo "$as_me: failed program was:" >&5
8512 cat "conftest.$ac_ext" >&5
8513
8514         cf_cv_term_header=unknown
8515
8516 fi
8517 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8518         test "$cf_cv_term_header" != unknown && break
8519 done
8520
8521 fi
8522 echo "$as_me:8522: result: $cf_cv_term_header" >&5
8523 echo "${ECHO_T}$cf_cv_term_header" >&6
8524
8525 # Set definitions to allow ifdef'ing to accommodate subdirectories
8526
8527 case "$cf_cv_term_header" in
8528 (*term.h)
8529
8530 cat >>confdefs.h <<\EOF
8531 #define HAVE_TERM_H 1
8532 EOF
8533
8534         ;;
8535 esac
8536
8537 case "$cf_cv_term_header" in
8538 (ncurses/term.h)
8539
8540 cat >>confdefs.h <<\EOF
8541 #define HAVE_NCURSES_TERM_H 1
8542 EOF
8543
8544         ;;
8545 (ncursesw/term.h)
8546
8547 cat >>confdefs.h <<\EOF
8548 #define HAVE_NCURSESW_TERM_H 1
8549 EOF
8550
8551         ;;
8552 esac
8553
8554 # some applications need this, but should check for NCURSES_VERSION
8555
8556 cat >>confdefs.h <<\EOF
8557 #define NCURSES 1
8558 EOF
8559
8560 echo "$as_me:8560: checking for ncurses version" >&5
8561 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8562 if test "${cf_cv_ncurses_version+set}" = set; then
8563   echo $ECHO_N "(cached) $ECHO_C" >&6
8564 else
8565
8566         cf_cv_ncurses_version=no
8567         cf_tempfile=out$$
8568         rm -f "$cf_tempfile"
8569         if test "$cross_compiling" = yes; then
8570
8571         # This will not work if the preprocessor splits the line after the
8572         # Autoconf token.  The 'unproto' program does that.
8573         cat > "conftest.$ac_ext" <<EOF
8574 #include <${cf_cv_ncurses_header:-curses.h}>
8575 #undef Autoconf
8576 #ifdef NCURSES_VERSION
8577 Autoconf NCURSES_VERSION
8578 #else
8579 #ifdef __NCURSES_H
8580 Autoconf "old"
8581 #endif
8582 ;
8583 #endif
8584 EOF
8585         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8586         { (eval echo "$as_me:8586: \"$cf_try\"") >&5
8587   (eval $cf_try) 2>&5
8588   ac_status=$?
8589   echo "$as_me:8589: \$? = $ac_status" >&5
8590   (exit "$ac_status"); }
8591         if test -f conftest.out ; then
8592                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8593                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8594                 rm -f conftest.out
8595         fi
8596
8597 else
8598   cat >"conftest.$ac_ext" <<_ACEOF
8599 #line 8599 "configure"
8600 #include "confdefs.h"
8601
8602 #include <${cf_cv_ncurses_header:-curses.h}>
8603 #include <stdio.h>
8604 int main(void)
8605 {
8606         FILE *fp = fopen("$cf_tempfile", "w");
8607 #ifdef NCURSES_VERSION
8608 # ifdef NCURSES_VERSION_PATCH
8609         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8610 # else
8611         fprintf(fp, "%s\\n", NCURSES_VERSION);
8612 # endif
8613 #else
8614 # ifdef __NCURSES_H
8615         fprintf(fp, "old\\n");
8616 # else
8617         make an error
8618 # endif
8619 #endif
8620         ${cf_cv_main_return:-return}(0);
8621 }
8622 _ACEOF
8623 rm -f "conftest$ac_exeext"
8624 if { (eval echo "$as_me:8624: \"$ac_link\"") >&5
8625   (eval $ac_link) 2>&5
8626   ac_status=$?
8627   echo "$as_me:8627: \$? = $ac_status" >&5
8628   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8629   { (eval echo "$as_me:8629: \"$ac_try\"") >&5
8630   (eval $ac_try) 2>&5
8631   ac_status=$?
8632   echo "$as_me:8632: \$? = $ac_status" >&5
8633   (exit "$ac_status"); }; }; then
8634
8635         cf_cv_ncurses_version=`cat $cf_tempfile`
8636 else
8637   echo "$as_me: program exited with status $ac_status" >&5
8638 echo "$as_me: failed program was:" >&5
8639 cat "conftest.$ac_ext" >&5
8640 fi
8641 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8642 fi
8643         rm -f "$cf_tempfile"
8644
8645 fi
8646 echo "$as_me:8646: result: $cf_cv_ncurses_version" >&5
8647 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8648 test "$cf_cv_ncurses_version" = no ||
8649 cat >>confdefs.h <<\EOF
8650 #define NCURSES 1
8651 EOF
8652
8653 cf_nculib_root=ncursesw
8654         # This works, except for the special case where we find gpm, but
8655         # ncurses is in a nonstandard location via $LIBS, and we really want
8656         # to link gpm.
8657 cf_ncurses_LIBS=""
8658 cf_ncurses_SAVE="$LIBS"
8659 echo "$as_me:8659: checking for Gpm_Open in -lgpm" >&5
8660 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8661 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8662   echo $ECHO_N "(cached) $ECHO_C" >&6
8663 else
8664   ac_check_lib_save_LIBS=$LIBS
8665 LIBS="-lgpm  $LIBS"
8666 cat >"conftest.$ac_ext" <<_ACEOF
8667 #line 8667 "configure"
8668 #include "confdefs.h"
8669
8670 /* Override any gcc2 internal prototype to avoid an error.  */
8671 #ifdef __cplusplus
8672 extern "C"
8673 #endif
8674 /* We use char because int might match the return type of a gcc2
8675    builtin and then its argument prototype would still apply.  */
8676 char Gpm_Open ();
8677 int
8678 main (void)
8679 {
8680 Gpm_Open ();
8681   ;
8682   return 0;
8683 }
8684 _ACEOF
8685 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8686 if { (eval echo "$as_me:8686: \"$ac_link\"") >&5
8687   (eval $ac_link) 2>&5
8688   ac_status=$?
8689   echo "$as_me:8689: \$? = $ac_status" >&5
8690   (exit "$ac_status"); } &&
8691          { ac_try='test -s "conftest$ac_exeext"'
8692   { (eval echo "$as_me:8692: \"$ac_try\"") >&5
8693   (eval $ac_try) 2>&5
8694   ac_status=$?
8695   echo "$as_me:8695: \$? = $ac_status" >&5
8696   (exit "$ac_status"); }; }; then
8697   ac_cv_lib_gpm_Gpm_Open=yes
8698 else
8699   echo "$as_me: failed program was:" >&5
8700 cat "conftest.$ac_ext" >&5
8701 ac_cv_lib_gpm_Gpm_Open=no
8702 fi
8703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8704 LIBS=$ac_check_lib_save_LIBS
8705 fi
8706 echo "$as_me:8706: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8707 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8708 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8709   echo "$as_me:8709: checking for initscr in -lgpm" >&5
8710 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8711 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8712   echo $ECHO_N "(cached) $ECHO_C" >&6
8713 else
8714   ac_check_lib_save_LIBS=$LIBS
8715 LIBS="-lgpm  $LIBS"
8716 cat >"conftest.$ac_ext" <<_ACEOF
8717 #line 8717 "configure"
8718 #include "confdefs.h"
8719
8720 /* Override any gcc2 internal prototype to avoid an error.  */
8721 #ifdef __cplusplus
8722 extern "C"
8723 #endif
8724 /* We use char because int might match the return type of a gcc2
8725    builtin and then its argument prototype would still apply.  */
8726 char initscr ();
8727 int
8728 main (void)
8729 {
8730 initscr ();
8731   ;
8732   return 0;
8733 }
8734 _ACEOF
8735 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8736 if { (eval echo "$as_me:8736: \"$ac_link\"") >&5
8737   (eval $ac_link) 2>&5
8738   ac_status=$?
8739   echo "$as_me:8739: \$? = $ac_status" >&5
8740   (exit "$ac_status"); } &&
8741          { ac_try='test -s "conftest$ac_exeext"'
8742   { (eval echo "$as_me:8742: \"$ac_try\"") >&5
8743   (eval $ac_try) 2>&5
8744   ac_status=$?
8745   echo "$as_me:8745: \$? = $ac_status" >&5
8746   (exit "$ac_status"); }; }; then
8747   ac_cv_lib_gpm_initscr=yes
8748 else
8749   echo "$as_me: failed program was:" >&5
8750 cat "conftest.$ac_ext" >&5
8751 ac_cv_lib_gpm_initscr=no
8752 fi
8753 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8754 LIBS=$ac_check_lib_save_LIBS
8755 fi
8756 echo "$as_me:8756: result: $ac_cv_lib_gpm_initscr" >&5
8757 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8758 if test "$ac_cv_lib_gpm_initscr" = yes; then
8759   LIBS="$cf_ncurses_SAVE"
8760 else
8761   cf_ncurses_LIBS="-lgpm"
8762 fi
8763
8764 fi
8765
8766 case "$host_os" in
8767 (freebsd*)
8768         # This is only necessary if you are linking against an obsolete
8769         # version of ncurses (but it should do no harm, since it's static).
8770         if test "$cf_nculib_root" = ncurses ; then
8771                 echo "$as_me:8771: checking for tgoto in -lmytinfo" >&5
8772 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8773 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8774   echo $ECHO_N "(cached) $ECHO_C" >&6
8775 else
8776   ac_check_lib_save_LIBS=$LIBS
8777 LIBS="-lmytinfo  $LIBS"
8778 cat >"conftest.$ac_ext" <<_ACEOF
8779 #line 8779 "configure"
8780 #include "confdefs.h"
8781
8782 /* Override any gcc2 internal prototype to avoid an error.  */
8783 #ifdef __cplusplus
8784 extern "C"
8785 #endif
8786 /* We use char because int might match the return type of a gcc2
8787    builtin and then its argument prototype would still apply.  */
8788 char tgoto ();
8789 int
8790 main (void)
8791 {
8792 tgoto ();
8793   ;
8794   return 0;
8795 }
8796 _ACEOF
8797 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8798 if { (eval echo "$as_me:8798: \"$ac_link\"") >&5
8799   (eval $ac_link) 2>&5
8800   ac_status=$?
8801   echo "$as_me:8801: \$? = $ac_status" >&5
8802   (exit "$ac_status"); } &&
8803          { ac_try='test -s "conftest$ac_exeext"'
8804   { (eval echo "$as_me:8804: \"$ac_try\"") >&5
8805   (eval $ac_try) 2>&5
8806   ac_status=$?
8807   echo "$as_me:8807: \$? = $ac_status" >&5
8808   (exit "$ac_status"); }; }; then
8809   ac_cv_lib_mytinfo_tgoto=yes
8810 else
8811   echo "$as_me: failed program was:" >&5
8812 cat "conftest.$ac_ext" >&5
8813 ac_cv_lib_mytinfo_tgoto=no
8814 fi
8815 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8816 LIBS=$ac_check_lib_save_LIBS
8817 fi
8818 echo "$as_me:8818: result: $ac_cv_lib_mytinfo_tgoto" >&5
8819 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8820 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8821   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8822 fi
8823
8824         fi
8825         ;;
8826 esac
8827
8828 cf_add_libs="$LIBS"
8829 # reverse order
8830 cf_add_0lib=
8831 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8832 # filter duplicates
8833 for cf_add_1lib in $cf_add_0lib; do
8834         for cf_add_2lib in $cf_add_libs; do
8835                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8836                         cf_add_1lib=
8837                         break
8838                 fi
8839         done
8840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8841 done
8842 LIBS="$cf_add_libs"
8843
8844 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8845 then
8846
8847 cf_add_libs="$LIBS"
8848 # reverse order
8849 cf_add_0lib=
8850 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8851 # filter duplicates
8852 for cf_add_1lib in $cf_add_0lib; do
8853         for cf_add_2lib in $cf_add_libs; do
8854                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8855                         cf_add_1lib=
8856                         break
8857                 fi
8858         done
8859         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8860 done
8861 LIBS="$cf_add_libs"
8862
8863 else
8864
8865         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
8866         cf_libdir=""
8867         echo "$as_me:8867: checking for initscr" >&5
8868 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8869 if test "${ac_cv_func_initscr+set}" = set; then
8870   echo $ECHO_N "(cached) $ECHO_C" >&6
8871 else
8872   cat >"conftest.$ac_ext" <<_ACEOF
8873 #line 8873 "configure"
8874 #include "confdefs.h"
8875 #define initscr autoconf_temporary
8876 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8877 #undef initscr
8878
8879 #ifdef __cplusplus
8880 extern "C"
8881 #endif
8882
8883 /* We use char because int might match the return type of a gcc2
8884    builtin and then its argument prototype would still apply.  */
8885 char initscr (void);
8886
8887 int
8888 main (void)
8889 {
8890
8891 /* The GNU C library defines stubs for functions which it implements
8892     to always fail with ENOSYS.  Some functions are actually named
8893     something starting with __ and the normal name is an alias.  */
8894 #if defined (__stub_initscr) || defined (__stub___initscr)
8895 #error found stub for initscr
8896 #endif
8897
8898         return initscr ();
8899   ;
8900   return 0;
8901 }
8902 _ACEOF
8903 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8904 if { (eval echo "$as_me:8904: \"$ac_link\"") >&5
8905   (eval $ac_link) 2>&5
8906   ac_status=$?
8907   echo "$as_me:8907: \$? = $ac_status" >&5
8908   (exit "$ac_status"); } &&
8909          { ac_try='test -s "conftest$ac_exeext"'
8910   { (eval echo "$as_me:8910: \"$ac_try\"") >&5
8911   (eval $ac_try) 2>&5
8912   ac_status=$?
8913   echo "$as_me:8913: \$? = $ac_status" >&5
8914   (exit "$ac_status"); }; }; then
8915   ac_cv_func_initscr=yes
8916 else
8917   echo "$as_me: failed program was:" >&5
8918 cat "conftest.$ac_ext" >&5
8919 ac_cv_func_initscr=no
8920 fi
8921 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8922 fi
8923 echo "$as_me:8923: result: $ac_cv_func_initscr" >&5
8924 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8925 if test "$ac_cv_func_initscr" = yes; then
8926   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8927 else
8928
8929                 cf_save_LIBS="$LIBS"
8930                 echo "$as_me:8930: checking for initscr in -l$cf_nculib_root" >&5
8931 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8932                 LIBS="-l$cf_nculib_root $LIBS"
8933                 cat >"conftest.$ac_ext" <<_ACEOF
8934 #line 8934 "configure"
8935 #include "confdefs.h"
8936 #include <${cf_cv_ncurses_header:-curses.h}>
8937 int
8938 main (void)
8939 {
8940 initscr()
8941   ;
8942   return 0;
8943 }
8944 _ACEOF
8945 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8946 if { (eval echo "$as_me:8946: \"$ac_link\"") >&5
8947   (eval $ac_link) 2>&5
8948   ac_status=$?
8949   echo "$as_me:8949: \$? = $ac_status" >&5
8950   (exit "$ac_status"); } &&
8951          { ac_try='test -s "conftest$ac_exeext"'
8952   { (eval echo "$as_me:8952: \"$ac_try\"") >&5
8953   (eval $ac_try) 2>&5
8954   ac_status=$?
8955   echo "$as_me:8955: \$? = $ac_status" >&5
8956   (exit "$ac_status"); }; }; then
8957   echo "$as_me:8957: result: yes" >&5
8958 echo "${ECHO_T}yes" >&6
8959                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8960
8961 else
8962   echo "$as_me: failed program was:" >&5
8963 cat "conftest.$ac_ext" >&5
8964 echo "$as_me:8964: result: no" >&5
8965 echo "${ECHO_T}no" >&6
8966
8967 cf_search=
8968 cf_library_path_list=""
8969 if test -n "${LDFLAGS}${LIBS}" ; then
8970         for cf_library_path in $LDFLAGS $LIBS
8971         do
8972                 case "$cf_library_path" in
8973                 (-L*)
8974                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8975
8976 test "x$cf_library_path" != "xNONE" && \
8977 test -d "$cf_library_path" && \
8978  {
8979         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8980         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
8981         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8982         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8983         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8984         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"
8985 }
8986
8987                         cf_library_path_list="$cf_library_path_list $cf_search"
8988                         ;;
8989                 esac
8990         done
8991 fi
8992
8993 cf_search=
8994
8995 test "x$prefix" != "xNONE" && \
8996 test -d "$prefix" && \
8997  {
8998         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8999         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9000         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9001         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9002         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9003         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9004 }
9005
9006 for cf_subdir_prefix in \
9007         /usr \
9008         /usr/local \
9009         /usr/pkg \
9010         /opt \
9011         /opt/local \
9012         $HOME
9013 do
9014
9015 test "x$cf_subdir_prefix" != "x$prefix" && \
9016 test -d "$cf_subdir_prefix" && \
9017 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9018         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9019         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9020         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9021         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9022         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9023         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"
9024 }
9025
9026 done
9027
9028 cf_search="$cf_library_path_list $cf_search"
9029
9030                         for cf_libdir in $cf_search
9031                         do
9032                                 echo "$as_me:9032: checking for -l$cf_nculib_root in $cf_libdir" >&5
9033 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9034                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9035                                 cat >"conftest.$ac_ext" <<_ACEOF
9036 #line 9036 "configure"
9037 #include "confdefs.h"
9038 #include <${cf_cv_ncurses_header:-curses.h}>
9039 int
9040 main (void)
9041 {
9042 initscr()
9043   ;
9044   return 0;
9045 }
9046 _ACEOF
9047 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9048 if { (eval echo "$as_me:9048: \"$ac_link\"") >&5
9049   (eval $ac_link) 2>&5
9050   ac_status=$?
9051   echo "$as_me:9051: \$? = $ac_status" >&5
9052   (exit "$ac_status"); } &&
9053          { ac_try='test -s "conftest$ac_exeext"'
9054   { (eval echo "$as_me:9054: \"$ac_try\"") >&5
9055   (eval $ac_try) 2>&5
9056   ac_status=$?
9057   echo "$as_me:9057: \$? = $ac_status" >&5
9058   (exit "$ac_status"); }; }; then
9059   echo "$as_me:9059: result: yes" >&5
9060 echo "${ECHO_T}yes" >&6
9061                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9062                                          break
9063 else
9064   echo "$as_me: failed program was:" >&5
9065 cat "conftest.$ac_ext" >&5
9066 echo "$as_me:9066: result: no" >&5
9067 echo "${ECHO_T}no" >&6
9068                                          LIBS="$cf_save_LIBS"
9069 fi
9070 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9071                         done
9072
9073 fi
9074 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9075
9076 fi
9077
9078 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9079
9080 if test "$cf_found_library" = no ; then
9081         { { echo "$as_me:9081: error: Cannot link $cf_nculib_root library" >&5
9082 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9083    { (exit 1); exit 1; }; }
9084 fi
9085
9086 fi
9087
9088 if test -n "$cf_ncurses_LIBS" ; then
9089         echo "$as_me:9089: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9090 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9091         cf_ncurses_SAVE="$LIBS"
9092         for p in $cf_ncurses_LIBS ; do
9093                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9094                 if test "$q" != "$LIBS" ; then
9095                         LIBS="$q"
9096                 fi
9097         done
9098         cat >"conftest.$ac_ext" <<_ACEOF
9099 #line 9099 "configure"
9100 #include "confdefs.h"
9101 #include <${cf_cv_ncurses_header:-curses.h}>
9102 int
9103 main (void)
9104 {
9105 initscr(); mousemask(0,0); tigetstr((char *)0);
9106   ;
9107   return 0;
9108 }
9109 _ACEOF
9110 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9111 if { (eval echo "$as_me:9111: \"$ac_link\"") >&5
9112   (eval $ac_link) 2>&5
9113   ac_status=$?
9114   echo "$as_me:9114: \$? = $ac_status" >&5
9115   (exit "$ac_status"); } &&
9116          { ac_try='test -s "conftest$ac_exeext"'
9117   { (eval echo "$as_me:9117: \"$ac_try\"") >&5
9118   (eval $ac_try) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit "$ac_status"); }; }; then
9122   echo "$as_me:9122: result: yes" >&5
9123 echo "${ECHO_T}yes" >&6
9124 else
9125   echo "$as_me: failed program was:" >&5
9126 cat "conftest.$ac_ext" >&5
9127 echo "$as_me:9127: result: no" >&5
9128 echo "${ECHO_T}no" >&6
9129                  LIBS="$cf_ncurses_SAVE"
9130 fi
9131 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9132 fi
9133
9134 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9135
9136 cat >>confdefs.h <<EOF
9137 #define $cf_nculib_ROOT 1
9138 EOF
9139
9140         fi
9141 else
9142         NCURSES_CONFIG=none
9143 fi
9144
9145 else
9146
9147 cf_ncuconfig_root=ncurses
9148 cf_have_ncuconfig=no
9149
9150 if test "x${PKG_CONFIG:=none}" != xnone; then
9151         echo "$as_me:9151: checking pkg-config for $cf_ncuconfig_root" >&5
9152 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9153         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9154                 echo "$as_me:9154: result: yes" >&5
9155 echo "${ECHO_T}yes" >&6
9156
9157                 echo "$as_me:9157: checking if the $cf_ncuconfig_root package files work" >&5
9158 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9159                 cf_have_ncuconfig=unknown
9160
9161                 cf_save_CFLAGS="$CFLAGS"
9162                 cf_save_CPPFLAGS="$CPPFLAGS"
9163                 cf_save_LIBS="$LIBS"
9164
9165                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9166                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9167
9168                 # while -W for passing linker flags is prevalent, it is not "standard".
9169                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9170                 # incompatible _and_ non-standard -W option which gives an error.  Work
9171                 # around that pitfall.
9172                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9173                 (x*c[89]9@@*-W*)
9174
9175 cf_fix_cppflags=no
9176 cf_new_cflags=
9177 cf_new_cppflags=
9178 cf_new_extra_cppflags=
9179
9180 for cf_add_cflags in $cf_pkg_cflags
9181 do
9182 case "$cf_fix_cppflags" in
9183 (no)
9184         case "$cf_add_cflags" in
9185         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9186                 case "$cf_add_cflags" in
9187                 (-D*)
9188                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9189
9190                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9191                                 && test -z "${cf_tst_cflags}" \
9192                                 && cf_fix_cppflags=yes
9193
9194                         if test "$cf_fix_cppflags" = yes ; then
9195
9196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9198
9199                                 continue
9200                         elif test "${cf_tst_cflags}" = "\"'" ; then
9201
9202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9204
9205                                 continue
9206                         fi
9207                         ;;
9208                 esac
9209                 case "$CPPFLAGS" in
9210                 (*$cf_add_cflags)
9211                         ;;
9212                 (*)
9213                         case "$cf_add_cflags" in
9214                         (-D*)
9215                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9216
9217 CPPFLAGS=`echo "$CPPFLAGS" | \
9218         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9219                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9220
9221                                 ;;
9222                         esac
9223
9224         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9225         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9226
9227                         ;;
9228                 esac
9229                 ;;
9230         (*)
9231
9232         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9233         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9234
9235                 ;;
9236         esac
9237         ;;
9238 (yes)
9239
9240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9242
9243         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9244
9245         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9246                 && test -z "${cf_tst_cflags}" \
9247                 && cf_fix_cppflags=no
9248         ;;
9249 esac
9250 done
9251
9252 if test -n "$cf_new_cflags" ; then
9253
9254         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9255         CFLAGS="${CFLAGS}$cf_new_cflags"
9256
9257 fi
9258
9259 if test -n "$cf_new_cppflags" ; then
9260
9261         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9262         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9263
9264 fi
9265
9266 if test -n "$cf_new_extra_cppflags" ; then
9267
9268         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9269         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9270
9271 fi
9272
9273 cf_add_libs="$LIBS"
9274 # reverse order
9275 cf_add_0lib=
9276 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9277 # filter duplicates
9278 for cf_add_1lib in $cf_add_0lib; do
9279         for cf_add_2lib in $cf_add_libs; do
9280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9281                         cf_add_1lib=
9282                         break
9283                 fi
9284         done
9285         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9286 done
9287 LIBS="$cf_add_libs"
9288
9289                         cat >"conftest.$ac_ext" <<_ACEOF
9290 #line 9290 "configure"
9291 #include "confdefs.h"
9292 #include <${cf_cv_ncurses_header:-curses.h}>
9293 int
9294 main (void)
9295 {
9296 initscr(); mousemask(0,0); tigetstr((char *)0);
9297   ;
9298   return 0;
9299 }
9300 _ACEOF
9301 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9302 if { (eval echo "$as_me:9302: \"$ac_link\"") >&5
9303   (eval $ac_link) 2>&5
9304   ac_status=$?
9305   echo "$as_me:9305: \$? = $ac_status" >&5
9306   (exit "$ac_status"); } &&
9307          { ac_try='test -s "conftest$ac_exeext"'
9308   { (eval echo "$as_me:9308: \"$ac_try\"") >&5
9309   (eval $ac_try) 2>&5
9310   ac_status=$?
9311   echo "$as_me:9311: \$? = $ac_status" >&5
9312   (exit "$ac_status"); }; }; then
9313   if test "$cross_compiling" = yes; then
9314   cf_test_ncuconfig=maybe
9315 else
9316   cat >"conftest.$ac_ext" <<_ACEOF
9317 #line 9317 "configure"
9318 #include "confdefs.h"
9319 #include <${cf_cv_ncurses_header:-curses.h}>
9320                                         int main(void)
9321                                         { const char *xx = curses_version(); return (xx == 0); }
9322 _ACEOF
9323 rm -f "conftest$ac_exeext"
9324 if { (eval echo "$as_me:9324: \"$ac_link\"") >&5
9325   (eval $ac_link) 2>&5
9326   ac_status=$?
9327   echo "$as_me:9327: \$? = $ac_status" >&5
9328   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9329   { (eval echo "$as_me:9329: \"$ac_try\"") >&5
9330   (eval $ac_try) 2>&5
9331   ac_status=$?
9332   echo "$as_me:9332: \$? = $ac_status" >&5
9333   (exit "$ac_status"); }; }; then
9334   cf_test_ncuconfig=yes
9335 else
9336   echo "$as_me: program exited with status $ac_status" >&5
9337 echo "$as_me: failed program was:" >&5
9338 cat "conftest.$ac_ext" >&5
9339 cf_test_ncuconfig=no
9340 fi
9341 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9342 fi
9343 else
9344   echo "$as_me: failed program was:" >&5
9345 cat "conftest.$ac_ext" >&5
9346 cf_test_ncuconfig=no
9347 fi
9348 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9349
9350                         CFLAGS="$cf_save_CFLAGS"
9351                         CPPFLAGS="$cf_save_CPPFLAGS"
9352                         LIBS="$cf_save_LIBS"
9353
9354                         if test "x$cf_test_ncuconfig" != xyes; then
9355                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9356                                 cf_pkg_cflags="$cf_temp"
9357                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9358                                 cf_pkg_libs="$cf_temp"
9359                         fi
9360                         ;;
9361                 esac
9362
9363 cf_fix_cppflags=no
9364 cf_new_cflags=
9365 cf_new_cppflags=
9366 cf_new_extra_cppflags=
9367
9368 for cf_add_cflags in $cf_pkg_cflags
9369 do
9370 case "$cf_fix_cppflags" in
9371 (no)
9372         case "$cf_add_cflags" in
9373         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9374                 case "$cf_add_cflags" in
9375                 (-D*)
9376                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9377
9378                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9379                                 && test -z "${cf_tst_cflags}" \
9380                                 && cf_fix_cppflags=yes
9381
9382                         if test "$cf_fix_cppflags" = yes ; then
9383
9384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9386
9387                                 continue
9388                         elif test "${cf_tst_cflags}" = "\"'" ; then
9389
9390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9392
9393                                 continue
9394                         fi
9395                         ;;
9396                 esac
9397                 case "$CPPFLAGS" in
9398                 (*$cf_add_cflags)
9399                         ;;
9400                 (*)
9401                         case "$cf_add_cflags" in
9402                         (-D*)
9403                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9404
9405 CPPFLAGS=`echo "$CPPFLAGS" | \
9406         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9407                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9408
9409                                 ;;
9410                         esac
9411
9412         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9413         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9414
9415                         ;;
9416                 esac
9417                 ;;
9418         (*)
9419
9420         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9421         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9422
9423                 ;;
9424         esac
9425         ;;
9426 (yes)
9427
9428         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9429         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9430
9431         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9432
9433         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9434                 && test -z "${cf_tst_cflags}" \
9435                 && cf_fix_cppflags=no
9436         ;;
9437 esac
9438 done
9439
9440 if test -n "$cf_new_cflags" ; then
9441
9442         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9443         CFLAGS="${CFLAGS}$cf_new_cflags"
9444
9445 fi
9446
9447 if test -n "$cf_new_cppflags" ; then
9448
9449         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9450         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9451
9452 fi
9453
9454 if test -n "$cf_new_extra_cppflags" ; then
9455
9456         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9457         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9458
9459 fi
9460
9461 cf_add_libs="$LIBS"
9462 # reverse order
9463 cf_add_0lib=
9464 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9465 # filter duplicates
9466 for cf_add_1lib in $cf_add_0lib; do
9467         for cf_add_2lib in $cf_add_libs; do
9468                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9469                         cf_add_1lib=
9470                         break
9471                 fi
9472         done
9473         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9474 done
9475 LIBS="$cf_add_libs"
9476
9477                 cat >"conftest.$ac_ext" <<_ACEOF
9478 #line 9478 "configure"
9479 #include "confdefs.h"
9480 #include <${cf_cv_ncurses_header:-curses.h}>
9481 int
9482 main (void)
9483 {
9484 initscr(); mousemask(0,0); tigetstr((char *)0);
9485   ;
9486   return 0;
9487 }
9488 _ACEOF
9489 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9490 if { (eval echo "$as_me:9490: \"$ac_link\"") >&5
9491   (eval $ac_link) 2>&5
9492   ac_status=$?
9493   echo "$as_me:9493: \$? = $ac_status" >&5
9494   (exit "$ac_status"); } &&
9495          { ac_try='test -s "conftest$ac_exeext"'
9496   { (eval echo "$as_me:9496: \"$ac_try\"") >&5
9497   (eval $ac_try) 2>&5
9498   ac_status=$?
9499   echo "$as_me:9499: \$? = $ac_status" >&5
9500   (exit "$ac_status"); }; }; then
9501   if test "$cross_compiling" = yes; then
9502   cf_have_ncuconfig=maybe
9503 else
9504   cat >"conftest.$ac_ext" <<_ACEOF
9505 #line 9505 "configure"
9506 #include "confdefs.h"
9507 #include <${cf_cv_ncurses_header:-curses.h}>
9508                                 int main(void)
9509                                 { const char *xx = curses_version(); return (xx == 0); }
9510 _ACEOF
9511 rm -f "conftest$ac_exeext"
9512 if { (eval echo "$as_me:9512: \"$ac_link\"") >&5
9513   (eval $ac_link) 2>&5
9514   ac_status=$?
9515   echo "$as_me:9515: \$? = $ac_status" >&5
9516   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9517   { (eval echo "$as_me:9517: \"$ac_try\"") >&5
9518   (eval $ac_try) 2>&5
9519   ac_status=$?
9520   echo "$as_me:9520: \$? = $ac_status" >&5
9521   (exit "$ac_status"); }; }; then
9522   cf_have_ncuconfig=yes
9523 else
9524   echo "$as_me: program exited with status $ac_status" >&5
9525 echo "$as_me: failed program was:" >&5
9526 cat "conftest.$ac_ext" >&5
9527 cf_have_ncuconfig=no
9528 fi
9529 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9530 fi
9531 else
9532   echo "$as_me: failed program was:" >&5
9533 cat "conftest.$ac_ext" >&5
9534 cf_have_ncuconfig=no
9535 fi
9536 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9537                 echo "$as_me:9537: result: $cf_have_ncuconfig" >&5
9538 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9539                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9540                 if test "$cf_have_ncuconfig" != "yes"
9541                 then
9542                         CPPFLAGS="$cf_save_CPPFLAGS"
9543                         LIBS="$cf_save_LIBS"
9544                         NCURSES_CONFIG_PKG=none
9545                 else
9546
9547 cat >>confdefs.h <<\EOF
9548 #define NCURSES 1
9549 EOF
9550
9551                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9552
9553 echo "$as_me:9553: checking for terminfo header" >&5
9554 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9555 if test "${cf_cv_term_header+set}" = set; then
9556   echo $ECHO_N "(cached) $ECHO_C" >&6
9557 else
9558
9559 case "${cf_cv_ncurses_header}" in
9560 (*/ncurses.h|*/ncursesw.h)
9561         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9562         ;;
9563 (*)
9564         cf_term_header=term.h
9565         ;;
9566 esac
9567
9568 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9569 do
9570 cat >"conftest.$ac_ext" <<_ACEOF
9571 #line 9571 "configure"
9572 #include "confdefs.h"
9573 #include <stdio.h>
9574 #include <${cf_cv_ncurses_header:-curses.h}>
9575 #include <$cf_test>
9576
9577 int
9578 main (void)
9579 {
9580 int x = auto_left_margin; (void)x
9581   ;
9582   return 0;
9583 }
9584 _ACEOF
9585 rm -f "conftest.$ac_objext"
9586 if { (eval echo "$as_me:9586: \"$ac_compile\"") >&5
9587   (eval $ac_compile) 2>&5
9588   ac_status=$?
9589   echo "$as_me:9589: \$? = $ac_status" >&5
9590   (exit "$ac_status"); } &&
9591          { ac_try='test -s "conftest.$ac_objext"'
9592   { (eval echo "$as_me:9592: \"$ac_try\"") >&5
9593   (eval $ac_try) 2>&5
9594   ac_status=$?
9595   echo "$as_me:9595: \$? = $ac_status" >&5
9596   (exit "$ac_status"); }; }; then
9597
9598         cf_cv_term_header="$cf_test"
9599 else
9600   echo "$as_me: failed program was:" >&5
9601 cat "conftest.$ac_ext" >&5
9602
9603         cf_cv_term_header=unknown
9604
9605 fi
9606 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9607         test "$cf_cv_term_header" != unknown && break
9608 done
9609
9610 fi
9611 echo "$as_me:9611: result: $cf_cv_term_header" >&5
9612 echo "${ECHO_T}$cf_cv_term_header" >&6
9613
9614 # Set definitions to allow ifdef'ing to accommodate subdirectories
9615
9616 case "$cf_cv_term_header" in
9617 (*term.h)
9618
9619 cat >>confdefs.h <<\EOF
9620 #define HAVE_TERM_H 1
9621 EOF
9622
9623         ;;
9624 esac
9625
9626 case "$cf_cv_term_header" in
9627 (ncurses/term.h)
9628
9629 cat >>confdefs.h <<\EOF
9630 #define HAVE_NCURSES_TERM_H 1
9631 EOF
9632
9633         ;;
9634 (ncursesw/term.h)
9635
9636 cat >>confdefs.h <<\EOF
9637 #define HAVE_NCURSESW_TERM_H 1
9638 EOF
9639
9640         ;;
9641 esac
9642
9643                 fi
9644
9645         else
9646                 echo "$as_me:9646: result: no" >&5
9647 echo "${ECHO_T}no" >&6
9648                 NCURSES_CONFIG_PKG=none
9649         fi
9650 else
9651         NCURSES_CONFIG_PKG=none
9652 fi
9653
9654 if test "x$cf_have_ncuconfig" = "xno"; then
9655         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9656
9657 if test -n "$ac_tool_prefix"; then
9658   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9659   do
9660     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9661 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9662 echo "$as_me:9662: checking for $ac_word" >&5
9663 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9664 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9665   echo $ECHO_N "(cached) $ECHO_C" >&6
9666 else
9667   if test -n "$NCURSES_CONFIG"; then
9668   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9669 else
9670   ac_save_IFS=$IFS; IFS=$ac_path_separator
9671 ac_dummy="$PATH"
9672 for ac_dir in $ac_dummy; do
9673   IFS=$ac_save_IFS
9674   test -z "$ac_dir" && ac_dir=.
9675   $as_executable_p "$ac_dir/$ac_word" || continue
9676 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9677 echo "$as_me:9677: found $ac_dir/$ac_word" >&5
9678 break
9679 done
9680
9681 fi
9682 fi
9683 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9684 if test -n "$NCURSES_CONFIG"; then
9685   echo "$as_me:9685: result: $NCURSES_CONFIG" >&5
9686 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9687 else
9688   echo "$as_me:9688: result: no" >&5
9689 echo "${ECHO_T}no" >&6
9690 fi
9691
9692     test -n "$NCURSES_CONFIG" && break
9693   done
9694 fi
9695 if test -z "$NCURSES_CONFIG"; then
9696   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9697   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9698 do
9699   # Extract the first word of "$ac_prog", so it can be a program name with args.
9700 set dummy $ac_prog; ac_word=$2
9701 echo "$as_me:9701: checking for $ac_word" >&5
9702 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9703 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9704   echo $ECHO_N "(cached) $ECHO_C" >&6
9705 else
9706   if test -n "$ac_ct_NCURSES_CONFIG"; then
9707   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9708 else
9709   ac_save_IFS=$IFS; IFS=$ac_path_separator
9710 ac_dummy="$PATH"
9711 for ac_dir in $ac_dummy; do
9712   IFS=$ac_save_IFS
9713   test -z "$ac_dir" && ac_dir=.
9714   $as_executable_p "$ac_dir/$ac_word" || continue
9715 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9716 echo "$as_me:9716: found $ac_dir/$ac_word" >&5
9717 break
9718 done
9719
9720 fi
9721 fi
9722 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9723 if test -n "$ac_ct_NCURSES_CONFIG"; then
9724   echo "$as_me:9724: result: $ac_ct_NCURSES_CONFIG" >&5
9725 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9726 else
9727   echo "$as_me:9727: result: no" >&5
9728 echo "${ECHO_T}no" >&6
9729 fi
9730
9731   test -n "$ac_ct_NCURSES_CONFIG" && break
9732 done
9733 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9734
9735   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9736 fi
9737
9738         if test "$NCURSES_CONFIG" != none ; then
9739
9740 cf_fix_cppflags=no
9741 cf_new_cflags=
9742 cf_new_cppflags=
9743 cf_new_extra_cppflags=
9744
9745 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9746 do
9747 case "$cf_fix_cppflags" in
9748 (no)
9749         case "$cf_add_cflags" in
9750         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9751                 case "$cf_add_cflags" in
9752                 (-D*)
9753                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9754
9755                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9756                                 && test -z "${cf_tst_cflags}" \
9757                                 && cf_fix_cppflags=yes
9758
9759                         if test "$cf_fix_cppflags" = yes ; then
9760
9761         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9762         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9763
9764                                 continue
9765                         elif test "${cf_tst_cflags}" = "\"'" ; then
9766
9767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9769
9770                                 continue
9771                         fi
9772                         ;;
9773                 esac
9774                 case "$CPPFLAGS" in
9775                 (*$cf_add_cflags)
9776                         ;;
9777                 (*)
9778                         case "$cf_add_cflags" in
9779                         (-D*)
9780                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9781
9782 CPPFLAGS=`echo "$CPPFLAGS" | \
9783         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9784                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9785
9786                                 ;;
9787                         esac
9788
9789         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9790         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9791
9792                         ;;
9793                 esac
9794                 ;;
9795         (*)
9796
9797         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9798         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9799
9800                 ;;
9801         esac
9802         ;;
9803 (yes)
9804
9805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9807
9808         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9809
9810         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9811                 && test -z "${cf_tst_cflags}" \
9812                 && cf_fix_cppflags=no
9813         ;;
9814 esac
9815 done
9816
9817 if test -n "$cf_new_cflags" ; then
9818
9819         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9820         CFLAGS="${CFLAGS}$cf_new_cflags"
9821
9822 fi
9823
9824 if test -n "$cf_new_cppflags" ; then
9825
9826         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9827         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9828
9829 fi
9830
9831 if test -n "$cf_new_extra_cppflags" ; then
9832
9833         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9834         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9835
9836 fi
9837
9838 cf_add_libs="$LIBS"
9839 # reverse order
9840 cf_add_0lib=
9841 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9842 # filter duplicates
9843 for cf_add_1lib in $cf_add_0lib; do
9844         for cf_add_2lib in $cf_add_libs; do
9845                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9846                         cf_add_1lib=
9847                         break
9848                 fi
9849         done
9850         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9851 done
9852 LIBS="$cf_add_libs"
9853
9854                 # even with config script, some packages use no-override for curses.h
9855
9856 echo "$as_me:9856: checking if we have identified curses headers" >&5
9857 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9858 if test "${cf_cv_ncurses_header+set}" = set; then
9859   echo $ECHO_N "(cached) $ECHO_C" >&6
9860 else
9861
9862 cf_cv_ncurses_header=none
9863 for cf_header in \
9864         ncurses.h ncurses/ncurses.h \
9865         curses.h ncurses/curses.h
9866 do
9867 cat >"conftest.$ac_ext" <<_ACEOF
9868 #line 9868 "configure"
9869 #include "confdefs.h"
9870 #include <${cf_header}>
9871 int
9872 main (void)
9873 {
9874 initscr(); tgoto("?", 0,0)
9875   ;
9876   return 0;
9877 }
9878 _ACEOF
9879 rm -f "conftest.$ac_objext"
9880 if { (eval echo "$as_me:9880: \"$ac_compile\"") >&5
9881   (eval $ac_compile) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit "$ac_status"); } &&
9885          { ac_try='test -s "conftest.$ac_objext"'
9886   { (eval echo "$as_me:9886: \"$ac_try\"") >&5
9887   (eval $ac_try) 2>&5
9888   ac_status=$?
9889   echo "$as_me:9889: \$? = $ac_status" >&5
9890   (exit "$ac_status"); }; }; then
9891   cf_cv_ncurses_header=$cf_header; break
9892 else
9893   echo "$as_me: failed program was:" >&5
9894 cat "conftest.$ac_ext" >&5
9895 fi
9896 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9897 done
9898
9899 fi
9900 echo "$as_me:9900: result: $cf_cv_ncurses_header" >&5
9901 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9902
9903 if test "$cf_cv_ncurses_header" = none ; then
9904         { { echo "$as_me:9904: error: No curses header-files found" >&5
9905 echo "$as_me: error: No curses header-files found" >&2;}
9906    { (exit 1); exit 1; }; }
9907 fi
9908
9909 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9910
9911 for ac_header in $cf_cv_ncurses_header
9912 do
9913 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9914 echo "$as_me:9914: checking for $ac_header" >&5
9915 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9916 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9917   echo $ECHO_N "(cached) $ECHO_C" >&6
9918 else
9919   cat >"conftest.$ac_ext" <<_ACEOF
9920 #line 9920 "configure"
9921 #include "confdefs.h"
9922 #include <$ac_header>
9923 _ACEOF
9924 if { (eval echo "$as_me:9924: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9925   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9926   ac_status=$?
9927   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9928   rm -f conftest.er1
9929   cat conftest.err >&5
9930   echo "$as_me:9930: \$? = $ac_status" >&5
9931   (exit "$ac_status"); } >/dev/null; then
9932   if test -s conftest.err; then
9933     ac_cpp_err=$ac_c_preproc_warn_flag
9934   else
9935     ac_cpp_err=
9936   fi
9937 else
9938   ac_cpp_err=yes
9939 fi
9940 if test -z "$ac_cpp_err"; then
9941   eval "$as_ac_Header=yes"
9942 else
9943   echo "$as_me: failed program was:" >&5
9944   cat "conftest.$ac_ext" >&5
9945   eval "$as_ac_Header=no"
9946 fi
9947 rm -f conftest.err "conftest.$ac_ext"
9948 fi
9949 echo "$as_me:9949: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9950 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9951 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9952   cat >>confdefs.h <<EOF
9953 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9954 EOF
9955
9956 fi
9957 done
9958
9959 cat >>confdefs.h <<\EOF
9960 #define NCURSES 1
9961 EOF
9962
9963 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9964
9965                 cat >>confdefs.h <<EOF
9966 #define $cf_nculib_ROOT 1
9967 EOF
9968
9969                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9970
9971         else
9972
9973 cf_ncuhdr_root=ncurses
9974
9975 test -n "$cf_cv_curses_dir" && \
9976 test "$cf_cv_curses_dir" != "no" && { \
9977
9978 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9979   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9980   do
9981         while test "$cf_add_incdir" != /usr/include
9982         do
9983           if test -d "$cf_add_incdir"
9984           then
9985                 cf_have_incdir=no
9986                 if test -n "$CFLAGS$CPPFLAGS" ; then
9987                   # a loop is needed to ensure we can add subdirs of existing dirs
9988                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9989                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9990                           cf_have_incdir=yes; break
9991                         fi
9992                   done
9993                 fi
9994
9995                 if test "$cf_have_incdir" = no ; then
9996                   if test "$cf_add_incdir" = /usr/local/include ; then
9997                         if test "$GCC" = yes
9998                         then
9999                           cf_save_CPPFLAGS=$CPPFLAGS
10000
10001         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10002         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10003
10004                           cat >"conftest.$ac_ext" <<_ACEOF
10005 #line 10005 "configure"
10006 #include "confdefs.h"
10007 #include <stdio.h>
10008 int
10009 main (void)
10010 {
10011 printf("Hello")
10012   ;
10013   return 0;
10014 }
10015 _ACEOF
10016 rm -f "conftest.$ac_objext"
10017 if { (eval echo "$as_me:10017: \"$ac_compile\"") >&5
10018   (eval $ac_compile) 2>&5
10019   ac_status=$?
10020   echo "$as_me:10020: \$? = $ac_status" >&5
10021   (exit "$ac_status"); } &&
10022          { ac_try='test -s "conftest.$ac_objext"'
10023   { (eval echo "$as_me:10023: \"$ac_try\"") >&5
10024   (eval $ac_try) 2>&5
10025   ac_status=$?
10026   echo "$as_me:10026: \$? = $ac_status" >&5
10027   (exit "$ac_status"); }; }; then
10028   :
10029 else
10030   echo "$as_me: failed program was:" >&5
10031 cat "conftest.$ac_ext" >&5
10032 cf_have_incdir=yes
10033 fi
10034 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10035                           CPPFLAGS=$cf_save_CPPFLAGS
10036                         fi
10037                   fi
10038                 fi
10039
10040                 if test "$cf_have_incdir" = no ; then
10041                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10042
10043 echo "${as_me:-configure}:10043: testing adding $cf_add_incdir to include-path ..." 1>&5
10044
10045                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10046
10047                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10048                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10049                   cf_add_incdir="$cf_top_incdir"
10050                 else
10051                   break
10052                 fi
10053           else
10054                 break
10055           fi
10056         done
10057   done
10058 fi
10059
10060 }
10061
10062 echo "$as_me:10062: checking for $cf_ncuhdr_root header in include-path" >&5
10063 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10064 if test "${cf_cv_ncurses_h+set}" = set; then
10065   echo $ECHO_N "(cached) $ECHO_C" >&6
10066 else
10067
10068         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10069         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10070         for cf_header in $cf_header_list
10071         do
10072
10073         cat >"conftest.$ac_ext" <<_ACEOF
10074 #line 10074 "configure"
10075 #include "confdefs.h"
10076
10077 #include <$cf_header>
10078 int
10079 main (void)
10080 {
10081
10082 #ifdef NCURSES_VERSION
10083
10084 printf("%s\\n", NCURSES_VERSION);
10085 #else
10086 #ifdef __NCURSES_H
10087 printf("old\\n");
10088 #else
10089         make an error
10090 #endif
10091 #endif
10092
10093   ;
10094   return 0;
10095 }
10096 _ACEOF
10097 rm -f "conftest.$ac_objext"
10098 if { (eval echo "$as_me:10098: \"$ac_compile\"") >&5
10099   (eval $ac_compile) 2>&5
10100   ac_status=$?
10101   echo "$as_me:10101: \$? = $ac_status" >&5
10102   (exit "$ac_status"); } &&
10103          { ac_try='test -s "conftest.$ac_objext"'
10104   { (eval echo "$as_me:10104: \"$ac_try\"") >&5
10105   (eval $ac_try) 2>&5
10106   ac_status=$?
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit "$ac_status"); }; }; then
10109   cf_cv_ncurses_h=$cf_header
10110
10111 else
10112   echo "$as_me: failed program was:" >&5
10113 cat "conftest.$ac_ext" >&5
10114 cf_cv_ncurses_h=no
10115 fi
10116 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10117
10118                 test "$cf_cv_ncurses_h" != no && break
10119         done
10120
10121 fi
10122 echo "$as_me:10122: result: $cf_cv_ncurses_h" >&5
10123 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10124
10125 if test "$cf_cv_ncurses_h" != no ; then
10126         cf_cv_ncurses_header=$cf_cv_ncurses_h
10127 else
10128
10129 echo "$as_me:10129: checking for $cf_ncuhdr_root include-path" >&5
10130 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10131 if test "${cf_cv_ncurses_h2+set}" = set; then
10132   echo $ECHO_N "(cached) $ECHO_C" >&6
10133 else
10134
10135         test -n "$verbose" && echo
10136
10137 cf_search=
10138
10139 # collect the current set of include-directories from compiler flags
10140 cf_header_path_list=""
10141 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10142         for cf_header_path in $CPPFLAGS $CFLAGS
10143         do
10144                 case "$cf_header_path" in
10145                 (-I*)
10146                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10147
10148 test "x$cf_header_path" != "xNONE" && \
10149 test -d "$cf_header_path" && \
10150  {
10151         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10152         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10153         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10154         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10155         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10156         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"
10157 }
10158
10159                         cf_header_path_list="$cf_header_path_list $cf_search"
10160                         ;;
10161                 esac
10162         done
10163 fi
10164
10165 # add the variations for the package we are looking for
10166
10167 cf_search=
10168
10169 test "x$prefix" != "xNONE" && \
10170 test -d "$prefix" && \
10171  {
10172         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10173         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10174         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10175         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10176         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10177         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10178 }
10179
10180 for cf_subdir_prefix in \
10181         /usr \
10182         /usr/local \
10183         /usr/pkg \
10184         /opt \
10185         /opt/local \
10186         $HOME
10187 do
10188
10189 test "x$cf_subdir_prefix" != "x$prefix" && \
10190 test -d "$cf_subdir_prefix" && \
10191 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10192         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10193         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10194         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10195         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10196         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10197         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"
10198 }
10199
10200 done
10201
10202 test "$includedir" != NONE && \
10203 test "$includedir" != "/usr/include" && \
10204 test -d "$includedir" && {
10205         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10206         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10207 }
10208
10209 test "$oldincludedir" != NONE && \
10210 test "$oldincludedir" != "/usr/include" && \
10211 test -d "$oldincludedir" && {
10212         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10213         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10214 }
10215
10216 cf_search="$cf_search $cf_header_path_list"
10217
10218         test -n "$verbose" && echo "search path $cf_search"
10219         cf_save2_CPPFLAGS="$CPPFLAGS"
10220         for cf_incdir in $cf_search
10221         do
10222
10223 if test -n "$cf_incdir" ; then
10224   for cf_add_incdir in $cf_incdir
10225   do
10226         while test "$cf_add_incdir" != /usr/include
10227         do
10228           if test -d "$cf_add_incdir"
10229           then
10230                 cf_have_incdir=no
10231                 if test -n "$CFLAGS$CPPFLAGS" ; then
10232                   # a loop is needed to ensure we can add subdirs of existing dirs
10233                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10234                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10235                           cf_have_incdir=yes; break
10236                         fi
10237                   done
10238                 fi
10239
10240                 if test "$cf_have_incdir" = no ; then
10241                   if test "$cf_add_incdir" = /usr/local/include ; then
10242                         if test "$GCC" = yes
10243                         then
10244                           cf_save_CPPFLAGS=$CPPFLAGS
10245
10246         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10247         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10248
10249                           cat >"conftest.$ac_ext" <<_ACEOF
10250 #line 10250 "configure"
10251 #include "confdefs.h"
10252 #include <stdio.h>
10253 int
10254 main (void)
10255 {
10256 printf("Hello")
10257   ;
10258   return 0;
10259 }
10260 _ACEOF
10261 rm -f "conftest.$ac_objext"
10262 if { (eval echo "$as_me:10262: \"$ac_compile\"") >&5
10263   (eval $ac_compile) 2>&5
10264   ac_status=$?
10265   echo "$as_me:10265: \$? = $ac_status" >&5
10266   (exit "$ac_status"); } &&
10267          { ac_try='test -s "conftest.$ac_objext"'
10268   { (eval echo "$as_me:10268: \"$ac_try\"") >&5
10269   (eval $ac_try) 2>&5
10270   ac_status=$?
10271   echo "$as_me:10271: \$? = $ac_status" >&5
10272   (exit "$ac_status"); }; }; then
10273   :
10274 else
10275   echo "$as_me: failed program was:" >&5
10276 cat "conftest.$ac_ext" >&5
10277 cf_have_incdir=yes
10278 fi
10279 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10280                           CPPFLAGS=$cf_save_CPPFLAGS
10281                         fi
10282                   fi
10283                 fi
10284
10285                 if test "$cf_have_incdir" = no ; then
10286                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10287
10288 echo "${as_me:-configure}:10288: testing adding $cf_add_incdir to include-path ..." 1>&5
10289
10290                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10291
10292                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10293                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10294                   cf_add_incdir="$cf_top_incdir"
10295                 else
10296                   break
10297                 fi
10298           else
10299                 break
10300           fi
10301         done
10302   done
10303 fi
10304
10305                 for cf_header in \
10306                         ncurses.h \
10307                         curses.h
10308                 do
10309
10310         cat >"conftest.$ac_ext" <<_ACEOF
10311 #line 10311 "configure"
10312 #include "confdefs.h"
10313
10314 #include <$cf_header>
10315 int
10316 main (void)
10317 {
10318
10319 #ifdef NCURSES_VERSION
10320
10321 printf("%s\\n", NCURSES_VERSION);
10322 #else
10323 #ifdef __NCURSES_H
10324 printf("old\\n");
10325 #else
10326         make an error
10327 #endif
10328 #endif
10329
10330   ;
10331   return 0;
10332 }
10333 _ACEOF
10334 rm -f "conftest.$ac_objext"
10335 if { (eval echo "$as_me:10335: \"$ac_compile\"") >&5
10336   (eval $ac_compile) 2>&5
10337   ac_status=$?
10338   echo "$as_me:10338: \$? = $ac_status" >&5
10339   (exit "$ac_status"); } &&
10340          { ac_try='test -s "conftest.$ac_objext"'
10341   { (eval echo "$as_me:10341: \"$ac_try\"") >&5
10342   (eval $ac_try) 2>&5
10343   ac_status=$?
10344   echo "$as_me:10344: \$? = $ac_status" >&5
10345   (exit "$ac_status"); }; }; then
10346   cf_cv_ncurses_h2=$cf_header
10347
10348 else
10349   echo "$as_me: failed program was:" >&5
10350 cat "conftest.$ac_ext" >&5
10351 cf_cv_ncurses_h2=no
10352 fi
10353 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10354
10355                         if test "$cf_cv_ncurses_h2" != no ; then
10356                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10357                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10358                                 break
10359                         fi
10360                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10361                 done
10362                 CPPFLAGS="$cf_save2_CPPFLAGS"
10363                 test "$cf_cv_ncurses_h2" != no && break
10364         done
10365         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10365: error: not found" >&5
10366 echo "$as_me: error: not found" >&2;}
10367    { (exit 1); exit 1; }; }
10368
10369 fi
10370 echo "$as_me:10370: result: $cf_cv_ncurses_h2" >&5
10371 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10372
10373         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10374         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10375         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10376                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10377         fi
10378
10379 if test -n "$cf_1st_incdir" ; then
10380   for cf_add_incdir in $cf_1st_incdir
10381   do
10382         while test "$cf_add_incdir" != /usr/include
10383         do
10384           if test -d "$cf_add_incdir"
10385           then
10386                 cf_have_incdir=no
10387                 if test -n "$CFLAGS$CPPFLAGS" ; then
10388                   # a loop is needed to ensure we can add subdirs of existing dirs
10389                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10390                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10391                           cf_have_incdir=yes; break
10392                         fi
10393                   done
10394                 fi
10395
10396                 if test "$cf_have_incdir" = no ; then
10397                   if test "$cf_add_incdir" = /usr/local/include ; then
10398                         if test "$GCC" = yes
10399                         then
10400                           cf_save_CPPFLAGS=$CPPFLAGS
10401
10402         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10403         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10404
10405                           cat >"conftest.$ac_ext" <<_ACEOF
10406 #line 10406 "configure"
10407 #include "confdefs.h"
10408 #include <stdio.h>
10409 int
10410 main (void)
10411 {
10412 printf("Hello")
10413   ;
10414   return 0;
10415 }
10416 _ACEOF
10417 rm -f "conftest.$ac_objext"
10418 if { (eval echo "$as_me:10418: \"$ac_compile\"") >&5
10419   (eval $ac_compile) 2>&5
10420   ac_status=$?
10421   echo "$as_me:10421: \$? = $ac_status" >&5
10422   (exit "$ac_status"); } &&
10423          { ac_try='test -s "conftest.$ac_objext"'
10424   { (eval echo "$as_me:10424: \"$ac_try\"") >&5
10425   (eval $ac_try) 2>&5
10426   ac_status=$?
10427   echo "$as_me:10427: \$? = $ac_status" >&5
10428   (exit "$ac_status"); }; }; then
10429   :
10430 else
10431   echo "$as_me: failed program was:" >&5
10432 cat "conftest.$ac_ext" >&5
10433 cf_have_incdir=yes
10434 fi
10435 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10436                           CPPFLAGS=$cf_save_CPPFLAGS
10437                         fi
10438                   fi
10439                 fi
10440
10441                 if test "$cf_have_incdir" = no ; then
10442                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10443
10444 echo "${as_me:-configure}:10444: testing adding $cf_add_incdir to include-path ..." 1>&5
10445
10446                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10447
10448                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10449                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10450                   cf_add_incdir="$cf_top_incdir"
10451                 else
10452                   break
10453                 fi
10454           else
10455                 break
10456           fi
10457         done
10458   done
10459 fi
10460
10461 fi
10462
10463 # Set definitions to allow ifdef'ing for ncurses.h
10464
10465 case "$cf_cv_ncurses_header" in
10466 (*ncurses.h)
10467
10468 cat >>confdefs.h <<\EOF
10469 #define HAVE_NCURSES_H 1
10470 EOF
10471
10472         ;;
10473 esac
10474
10475 case "$cf_cv_ncurses_header" in
10476 (ncurses/curses.h|ncurses/ncurses.h)
10477
10478 cat >>confdefs.h <<\EOF
10479 #define HAVE_NCURSES_NCURSES_H 1
10480 EOF
10481
10482         ;;
10483 (ncursesw/curses.h|ncursesw/ncurses.h)
10484
10485 cat >>confdefs.h <<\EOF
10486 #define HAVE_NCURSESW_NCURSES_H 1
10487 EOF
10488
10489         ;;
10490 esac
10491
10492 echo "$as_me:10492: checking for terminfo header" >&5
10493 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10494 if test "${cf_cv_term_header+set}" = set; then
10495   echo $ECHO_N "(cached) $ECHO_C" >&6
10496 else
10497
10498 case "${cf_cv_ncurses_header}" in
10499 (*/ncurses.h|*/ncursesw.h)
10500         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10501         ;;
10502 (*)
10503         cf_term_header=term.h
10504         ;;
10505 esac
10506
10507 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10508 do
10509 cat >"conftest.$ac_ext" <<_ACEOF
10510 #line 10510 "configure"
10511 #include "confdefs.h"
10512 #include <stdio.h>
10513 #include <${cf_cv_ncurses_header:-curses.h}>
10514 #include <$cf_test>
10515
10516 int
10517 main (void)
10518 {
10519 int x = auto_left_margin; (void)x
10520   ;
10521   return 0;
10522 }
10523 _ACEOF
10524 rm -f "conftest.$ac_objext"
10525 if { (eval echo "$as_me:10525: \"$ac_compile\"") >&5
10526   (eval $ac_compile) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit "$ac_status"); } &&
10530          { ac_try='test -s "conftest.$ac_objext"'
10531   { (eval echo "$as_me:10531: \"$ac_try\"") >&5
10532   (eval $ac_try) 2>&5
10533   ac_status=$?
10534   echo "$as_me:10534: \$? = $ac_status" >&5
10535   (exit "$ac_status"); }; }; then
10536
10537         cf_cv_term_header="$cf_test"
10538 else
10539   echo "$as_me: failed program was:" >&5
10540 cat "conftest.$ac_ext" >&5
10541
10542         cf_cv_term_header=unknown
10543
10544 fi
10545 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10546         test "$cf_cv_term_header" != unknown && break
10547 done
10548
10549 fi
10550 echo "$as_me:10550: result: $cf_cv_term_header" >&5
10551 echo "${ECHO_T}$cf_cv_term_header" >&6
10552
10553 # Set definitions to allow ifdef'ing to accommodate subdirectories
10554
10555 case "$cf_cv_term_header" in
10556 (*term.h)
10557
10558 cat >>confdefs.h <<\EOF
10559 #define HAVE_TERM_H 1
10560 EOF
10561
10562         ;;
10563 esac
10564
10565 case "$cf_cv_term_header" in
10566 (ncurses/term.h)
10567
10568 cat >>confdefs.h <<\EOF
10569 #define HAVE_NCURSES_TERM_H 1
10570 EOF
10571
10572         ;;
10573 (ncursesw/term.h)
10574
10575 cat >>confdefs.h <<\EOF
10576 #define HAVE_NCURSESW_TERM_H 1
10577 EOF
10578
10579         ;;
10580 esac
10581
10582 # some applications need this, but should check for NCURSES_VERSION
10583
10584 cat >>confdefs.h <<\EOF
10585 #define NCURSES 1
10586 EOF
10587
10588 echo "$as_me:10588: checking for ncurses version" >&5
10589 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10590 if test "${cf_cv_ncurses_version+set}" = set; then
10591   echo $ECHO_N "(cached) $ECHO_C" >&6
10592 else
10593
10594         cf_cv_ncurses_version=no
10595         cf_tempfile=out$$
10596         rm -f "$cf_tempfile"
10597         if test "$cross_compiling" = yes; then
10598
10599         # This will not work if the preprocessor splits the line after the
10600         # Autoconf token.  The 'unproto' program does that.
10601         cat > "conftest.$ac_ext" <<EOF
10602 #include <${cf_cv_ncurses_header:-curses.h}>
10603 #undef Autoconf
10604 #ifdef NCURSES_VERSION
10605 Autoconf NCURSES_VERSION
10606 #else
10607 #ifdef __NCURSES_H
10608 Autoconf "old"
10609 #endif
10610 ;
10611 #endif
10612 EOF
10613         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10614         { (eval echo "$as_me:10614: \"$cf_try\"") >&5
10615   (eval $cf_try) 2>&5
10616   ac_status=$?
10617   echo "$as_me:10617: \$? = $ac_status" >&5
10618   (exit "$ac_status"); }
10619         if test -f conftest.out ; then
10620                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10621                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10622                 rm -f conftest.out
10623         fi
10624
10625 else
10626   cat >"conftest.$ac_ext" <<_ACEOF
10627 #line 10627 "configure"
10628 #include "confdefs.h"
10629
10630 #include <${cf_cv_ncurses_header:-curses.h}>
10631 #include <stdio.h>
10632 int main(void)
10633 {
10634         FILE *fp = fopen("$cf_tempfile", "w");
10635 #ifdef NCURSES_VERSION
10636 # ifdef NCURSES_VERSION_PATCH
10637         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10638 # else
10639         fprintf(fp, "%s\\n", NCURSES_VERSION);
10640 # endif
10641 #else
10642 # ifdef __NCURSES_H
10643         fprintf(fp, "old\\n");
10644 # else
10645         make an error
10646 # endif
10647 #endif
10648         ${cf_cv_main_return:-return}(0);
10649 }
10650 _ACEOF
10651 rm -f "conftest$ac_exeext"
10652 if { (eval echo "$as_me:10652: \"$ac_link\"") >&5
10653   (eval $ac_link) 2>&5
10654   ac_status=$?
10655   echo "$as_me:10655: \$? = $ac_status" >&5
10656   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10657   { (eval echo "$as_me:10657: \"$ac_try\"") >&5
10658   (eval $ac_try) 2>&5
10659   ac_status=$?
10660   echo "$as_me:10660: \$? = $ac_status" >&5
10661   (exit "$ac_status"); }; }; then
10662
10663         cf_cv_ncurses_version=`cat $cf_tempfile`
10664 else
10665   echo "$as_me: program exited with status $ac_status" >&5
10666 echo "$as_me: failed program was:" >&5
10667 cat "conftest.$ac_ext" >&5
10668 fi
10669 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10670 fi
10671         rm -f "$cf_tempfile"
10672
10673 fi
10674 echo "$as_me:10674: result: $cf_cv_ncurses_version" >&5
10675 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10676 test "$cf_cv_ncurses_version" = no ||
10677 cat >>confdefs.h <<\EOF
10678 #define NCURSES 1
10679 EOF
10680
10681 cf_nculib_root=ncurses
10682         # This works, except for the special case where we find gpm, but
10683         # ncurses is in a nonstandard location via $LIBS, and we really want
10684         # to link gpm.
10685 cf_ncurses_LIBS=""
10686 cf_ncurses_SAVE="$LIBS"
10687 echo "$as_me:10687: checking for Gpm_Open in -lgpm" >&5
10688 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10689 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10690   echo $ECHO_N "(cached) $ECHO_C" >&6
10691 else
10692   ac_check_lib_save_LIBS=$LIBS
10693 LIBS="-lgpm  $LIBS"
10694 cat >"conftest.$ac_ext" <<_ACEOF
10695 #line 10695 "configure"
10696 #include "confdefs.h"
10697
10698 /* Override any gcc2 internal prototype to avoid an error.  */
10699 #ifdef __cplusplus
10700 extern "C"
10701 #endif
10702 /* We use char because int might match the return type of a gcc2
10703    builtin and then its argument prototype would still apply.  */
10704 char Gpm_Open ();
10705 int
10706 main (void)
10707 {
10708 Gpm_Open ();
10709   ;
10710   return 0;
10711 }
10712 _ACEOF
10713 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10714 if { (eval echo "$as_me:10714: \"$ac_link\"") >&5
10715   (eval $ac_link) 2>&5
10716   ac_status=$?
10717   echo "$as_me:10717: \$? = $ac_status" >&5
10718   (exit "$ac_status"); } &&
10719          { ac_try='test -s "conftest$ac_exeext"'
10720   { (eval echo "$as_me:10720: \"$ac_try\"") >&5
10721   (eval $ac_try) 2>&5
10722   ac_status=$?
10723   echo "$as_me:10723: \$? = $ac_status" >&5
10724   (exit "$ac_status"); }; }; then
10725   ac_cv_lib_gpm_Gpm_Open=yes
10726 else
10727   echo "$as_me: failed program was:" >&5
10728 cat "conftest.$ac_ext" >&5
10729 ac_cv_lib_gpm_Gpm_Open=no
10730 fi
10731 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10732 LIBS=$ac_check_lib_save_LIBS
10733 fi
10734 echo "$as_me:10734: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10735 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10736 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10737   echo "$as_me:10737: checking for initscr in -lgpm" >&5
10738 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10739 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10740   echo $ECHO_N "(cached) $ECHO_C" >&6
10741 else
10742   ac_check_lib_save_LIBS=$LIBS
10743 LIBS="-lgpm  $LIBS"
10744 cat >"conftest.$ac_ext" <<_ACEOF
10745 #line 10745 "configure"
10746 #include "confdefs.h"
10747
10748 /* Override any gcc2 internal prototype to avoid an error.  */
10749 #ifdef __cplusplus
10750 extern "C"
10751 #endif
10752 /* We use char because int might match the return type of a gcc2
10753    builtin and then its argument prototype would still apply.  */
10754 char initscr ();
10755 int
10756 main (void)
10757 {
10758 initscr ();
10759   ;
10760   return 0;
10761 }
10762 _ACEOF
10763 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10764 if { (eval echo "$as_me:10764: \"$ac_link\"") >&5
10765   (eval $ac_link) 2>&5
10766   ac_status=$?
10767   echo "$as_me:10767: \$? = $ac_status" >&5
10768   (exit "$ac_status"); } &&
10769          { ac_try='test -s "conftest$ac_exeext"'
10770   { (eval echo "$as_me:10770: \"$ac_try\"") >&5
10771   (eval $ac_try) 2>&5
10772   ac_status=$?
10773   echo "$as_me:10773: \$? = $ac_status" >&5
10774   (exit "$ac_status"); }; }; then
10775   ac_cv_lib_gpm_initscr=yes
10776 else
10777   echo "$as_me: failed program was:" >&5
10778 cat "conftest.$ac_ext" >&5
10779 ac_cv_lib_gpm_initscr=no
10780 fi
10781 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10782 LIBS=$ac_check_lib_save_LIBS
10783 fi
10784 echo "$as_me:10784: result: $ac_cv_lib_gpm_initscr" >&5
10785 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10786 if test "$ac_cv_lib_gpm_initscr" = yes; then
10787   LIBS="$cf_ncurses_SAVE"
10788 else
10789   cf_ncurses_LIBS="-lgpm"
10790 fi
10791
10792 fi
10793
10794 case "$host_os" in
10795 (freebsd*)
10796         # This is only necessary if you are linking against an obsolete
10797         # version of ncurses (but it should do no harm, since it's static).
10798         if test "$cf_nculib_root" = ncurses ; then
10799                 echo "$as_me:10799: checking for tgoto in -lmytinfo" >&5
10800 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10801 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10802   echo $ECHO_N "(cached) $ECHO_C" >&6
10803 else
10804   ac_check_lib_save_LIBS=$LIBS
10805 LIBS="-lmytinfo  $LIBS"
10806 cat >"conftest.$ac_ext" <<_ACEOF
10807 #line 10807 "configure"
10808 #include "confdefs.h"
10809
10810 /* Override any gcc2 internal prototype to avoid an error.  */
10811 #ifdef __cplusplus
10812 extern "C"
10813 #endif
10814 /* We use char because int might match the return type of a gcc2
10815    builtin and then its argument prototype would still apply.  */
10816 char tgoto ();
10817 int
10818 main (void)
10819 {
10820 tgoto ();
10821   ;
10822   return 0;
10823 }
10824 _ACEOF
10825 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10826 if { (eval echo "$as_me:10826: \"$ac_link\"") >&5
10827   (eval $ac_link) 2>&5
10828   ac_status=$?
10829   echo "$as_me:10829: \$? = $ac_status" >&5
10830   (exit "$ac_status"); } &&
10831          { ac_try='test -s "conftest$ac_exeext"'
10832   { (eval echo "$as_me:10832: \"$ac_try\"") >&5
10833   (eval $ac_try) 2>&5
10834   ac_status=$?
10835   echo "$as_me:10835: \$? = $ac_status" >&5
10836   (exit "$ac_status"); }; }; then
10837   ac_cv_lib_mytinfo_tgoto=yes
10838 else
10839   echo "$as_me: failed program was:" >&5
10840 cat "conftest.$ac_ext" >&5
10841 ac_cv_lib_mytinfo_tgoto=no
10842 fi
10843 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10844 LIBS=$ac_check_lib_save_LIBS
10845 fi
10846 echo "$as_me:10846: result: $ac_cv_lib_mytinfo_tgoto" >&5
10847 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10848 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
10849   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10850 fi
10851
10852         fi
10853         ;;
10854 esac
10855
10856 cf_add_libs="$LIBS"
10857 # reverse order
10858 cf_add_0lib=
10859 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10860 # filter duplicates
10861 for cf_add_1lib in $cf_add_0lib; do
10862         for cf_add_2lib in $cf_add_libs; do
10863                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10864                         cf_add_1lib=
10865                         break
10866                 fi
10867         done
10868         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10869 done
10870 LIBS="$cf_add_libs"
10871
10872 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
10873 then
10874
10875 cf_add_libs="$LIBS"
10876 # reverse order
10877 cf_add_0lib=
10878 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10879 # filter duplicates
10880 for cf_add_1lib in $cf_add_0lib; do
10881         for cf_add_2lib in $cf_add_libs; do
10882                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10883                         cf_add_1lib=
10884                         break
10885                 fi
10886         done
10887         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10888 done
10889 LIBS="$cf_add_libs"
10890
10891 else
10892
10893         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10894         cf_libdir=""
10895         echo "$as_me:10895: checking for initscr" >&5
10896 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10897 if test "${ac_cv_func_initscr+set}" = set; then
10898   echo $ECHO_N "(cached) $ECHO_C" >&6
10899 else
10900   cat >"conftest.$ac_ext" <<_ACEOF
10901 #line 10901 "configure"
10902 #include "confdefs.h"
10903 #define initscr autoconf_temporary
10904 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10905 #undef initscr
10906
10907 #ifdef __cplusplus
10908 extern "C"
10909 #endif
10910
10911 /* We use char because int might match the return type of a gcc2
10912    builtin and then its argument prototype would still apply.  */
10913 char initscr (void);
10914
10915 int
10916 main (void)
10917 {
10918
10919 /* The GNU C library defines stubs for functions which it implements
10920     to always fail with ENOSYS.  Some functions are actually named
10921     something starting with __ and the normal name is an alias.  */
10922 #if defined (__stub_initscr) || defined (__stub___initscr)
10923 #error found stub for initscr
10924 #endif
10925
10926         return initscr ();
10927   ;
10928   return 0;
10929 }
10930 _ACEOF
10931 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10932 if { (eval echo "$as_me:10932: \"$ac_link\"") >&5
10933   (eval $ac_link) 2>&5
10934   ac_status=$?
10935   echo "$as_me:10935: \$? = $ac_status" >&5
10936   (exit "$ac_status"); } &&
10937          { ac_try='test -s "conftest$ac_exeext"'
10938   { (eval echo "$as_me:10938: \"$ac_try\"") >&5
10939   (eval $ac_try) 2>&5
10940   ac_status=$?
10941   echo "$as_me:10941: \$? = $ac_status" >&5
10942   (exit "$ac_status"); }; }; then
10943   ac_cv_func_initscr=yes
10944 else
10945   echo "$as_me: failed program was:" >&5
10946 cat "conftest.$ac_ext" >&5
10947 ac_cv_func_initscr=no
10948 fi
10949 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10950 fi
10951 echo "$as_me:10951: result: $ac_cv_func_initscr" >&5
10952 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10953 if test "$ac_cv_func_initscr" = yes; then
10954   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10955 else
10956
10957                 cf_save_LIBS="$LIBS"
10958                 echo "$as_me:10958: checking for initscr in -l$cf_nculib_root" >&5
10959 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10960                 LIBS="-l$cf_nculib_root $LIBS"
10961                 cat >"conftest.$ac_ext" <<_ACEOF
10962 #line 10962 "configure"
10963 #include "confdefs.h"
10964 #include <${cf_cv_ncurses_header:-curses.h}>
10965 int
10966 main (void)
10967 {
10968 initscr()
10969   ;
10970   return 0;
10971 }
10972 _ACEOF
10973 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10974 if { (eval echo "$as_me:10974: \"$ac_link\"") >&5
10975   (eval $ac_link) 2>&5
10976   ac_status=$?
10977   echo "$as_me:10977: \$? = $ac_status" >&5
10978   (exit "$ac_status"); } &&
10979          { ac_try='test -s "conftest$ac_exeext"'
10980   { (eval echo "$as_me:10980: \"$ac_try\"") >&5
10981   (eval $ac_try) 2>&5
10982   ac_status=$?
10983   echo "$as_me:10983: \$? = $ac_status" >&5
10984   (exit "$ac_status"); }; }; then
10985   echo "$as_me:10985: result: yes" >&5
10986 echo "${ECHO_T}yes" >&6
10987                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10988
10989 else
10990   echo "$as_me: failed program was:" >&5
10991 cat "conftest.$ac_ext" >&5
10992 echo "$as_me:10992: result: no" >&5
10993 echo "${ECHO_T}no" >&6
10994
10995 cf_search=
10996 cf_library_path_list=""
10997 if test -n "${LDFLAGS}${LIBS}" ; then
10998         for cf_library_path in $LDFLAGS $LIBS
10999         do
11000                 case "$cf_library_path" in
11001                 (-L*)
11002                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11003
11004 test "x$cf_library_path" != "xNONE" && \
11005 test -d "$cf_library_path" && \
11006  {
11007         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11008         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11009         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11010         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11011         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11012         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"
11013 }
11014
11015                         cf_library_path_list="$cf_library_path_list $cf_search"
11016                         ;;
11017                 esac
11018         done
11019 fi
11020
11021 cf_search=
11022
11023 test "x$prefix" != "xNONE" && \
11024 test -d "$prefix" && \
11025  {
11026         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11027         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11028         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11029         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11030         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11031         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11032 }
11033
11034 for cf_subdir_prefix in \
11035         /usr \
11036         /usr/local \
11037         /usr/pkg \
11038         /opt \
11039         /opt/local \
11040         $HOME
11041 do
11042
11043 test "x$cf_subdir_prefix" != "x$prefix" && \
11044 test -d "$cf_subdir_prefix" && \
11045 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11046         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11047         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11048         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11049         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11050         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11051         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"
11052 }
11053
11054 done
11055
11056 cf_search="$cf_library_path_list $cf_search"
11057
11058                         for cf_libdir in $cf_search
11059                         do
11060                                 echo "$as_me:11060: checking for -l$cf_nculib_root in $cf_libdir" >&5
11061 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11062                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11063                                 cat >"conftest.$ac_ext" <<_ACEOF
11064 #line 11064 "configure"
11065 #include "confdefs.h"
11066 #include <${cf_cv_ncurses_header:-curses.h}>
11067 int
11068 main (void)
11069 {
11070 initscr()
11071   ;
11072   return 0;
11073 }
11074 _ACEOF
11075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11076 if { (eval echo "$as_me:11076: \"$ac_link\"") >&5
11077   (eval $ac_link) 2>&5
11078   ac_status=$?
11079   echo "$as_me:11079: \$? = $ac_status" >&5
11080   (exit "$ac_status"); } &&
11081          { ac_try='test -s "conftest$ac_exeext"'
11082   { (eval echo "$as_me:11082: \"$ac_try\"") >&5
11083   (eval $ac_try) 2>&5
11084   ac_status=$?
11085   echo "$as_me:11085: \$? = $ac_status" >&5
11086   (exit "$ac_status"); }; }; then
11087   echo "$as_me:11087: result: yes" >&5
11088 echo "${ECHO_T}yes" >&6
11089                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11090                                          break
11091 else
11092   echo "$as_me: failed program was:" >&5
11093 cat "conftest.$ac_ext" >&5
11094 echo "$as_me:11094: result: no" >&5
11095 echo "${ECHO_T}no" >&6
11096                                          LIBS="$cf_save_LIBS"
11097 fi
11098 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11099                         done
11100
11101 fi
11102 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11103
11104 fi
11105
11106 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11107
11108 if test "$cf_found_library" = no ; then
11109         { { echo "$as_me:11109: error: Cannot link $cf_nculib_root library" >&5
11110 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11111    { (exit 1); exit 1; }; }
11112 fi
11113
11114 fi
11115
11116 if test -n "$cf_ncurses_LIBS" ; then
11117         echo "$as_me:11117: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11118 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11119         cf_ncurses_SAVE="$LIBS"
11120         for p in $cf_ncurses_LIBS ; do
11121                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11122                 if test "$q" != "$LIBS" ; then
11123                         LIBS="$q"
11124                 fi
11125         done
11126         cat >"conftest.$ac_ext" <<_ACEOF
11127 #line 11127 "configure"
11128 #include "confdefs.h"
11129 #include <${cf_cv_ncurses_header:-curses.h}>
11130 int
11131 main (void)
11132 {
11133 initscr(); mousemask(0,0); tigetstr((char *)0);
11134   ;
11135   return 0;
11136 }
11137 _ACEOF
11138 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11139 if { (eval echo "$as_me:11139: \"$ac_link\"") >&5
11140   (eval $ac_link) 2>&5
11141   ac_status=$?
11142   echo "$as_me:11142: \$? = $ac_status" >&5
11143   (exit "$ac_status"); } &&
11144          { ac_try='test -s "conftest$ac_exeext"'
11145   { (eval echo "$as_me:11145: \"$ac_try\"") >&5
11146   (eval $ac_try) 2>&5
11147   ac_status=$?
11148   echo "$as_me:11148: \$? = $ac_status" >&5
11149   (exit "$ac_status"); }; }; then
11150   echo "$as_me:11150: result: yes" >&5
11151 echo "${ECHO_T}yes" >&6
11152 else
11153   echo "$as_me: failed program was:" >&5
11154 cat "conftest.$ac_ext" >&5
11155 echo "$as_me:11155: result: no" >&5
11156 echo "${ECHO_T}no" >&6
11157                  LIBS="$cf_ncurses_SAVE"
11158 fi
11159 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11160 fi
11161
11162 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11163
11164 cat >>confdefs.h <<EOF
11165 #define $cf_nculib_ROOT 1
11166 EOF
11167
11168         fi
11169 else
11170         NCURSES_CONFIG=none
11171 fi
11172
11173 fi
11174
11175 if test "$NCURSES_CONFIG_PKG" != none ; then
11176         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11177
11178         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11179         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11180         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11181
11182         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11183         if test -z "$cf_cv_abi_version"
11184         then
11185                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11186         fi
11187
11188 elif test "$NCURSES_CONFIG" != none ; then
11189
11190         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11191
11192         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11193         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11194         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11195
11196         # ABI version is not available from headers
11197         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11198
11199 else
11200
11201         for cf_name in MAJOR MINOR PATCH
11202         do
11203         cat >conftest.$ac_ext <<CF_EOF
11204         #include <${cf_cv_ncurses_header:-curses.h}>
11205         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11206 CF_EOF
11207                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11208                 { (eval echo "$as_me:11208: \"$cf_try\"") >&5
11209   (eval $cf_try) 2>&5
11210   ac_status=$?
11211   echo "$as_me:11211: \$? = $ac_status" >&5
11212   (exit "$ac_status"); }
11213                 if test -f conftest.out ; then
11214                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11215                         eval NCURSES_$cf_name=\"$cf_result\"
11216                         # cat conftest.$ac_ext
11217                         # cat conftest.out
11218                 fi
11219         done
11220
11221         cf_cv_abi_version=${NCURSES_MAJOR}
11222
11223 fi
11224
11225 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11226
11227 cf_cv_timestamp=`date`
11228
11229 echo "$as_me:11229: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11230 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11231
11232 echo "$as_me:11232: checking if you want to have a library-prefix" >&5
11233 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11234
11235 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11236 if test "${with_lib_prefix+set}" = set; then
11237   withval="$with_lib_prefix"
11238   with_lib_prefix=$withval
11239 else
11240   with_lib_prefix=auto
11241 fi;
11242 echo "$as_me:11242: result: $with_lib_prefix" >&5
11243 echo "${ECHO_T}$with_lib_prefix" >&6
11244
11245 if test "$with_lib_prefix" = auto
11246 then
11247
11248         case "$cf_cv_system_name" in
11249         (OS/2*|os2*)
11250                 if test "$DFT_LWR_MODEL" = libtool; then
11251                         LIB_PREFIX='lib'
11252                 else
11253                         LIB_PREFIX=''
11254                 fi
11255                 ;;
11256         (*-msvc*)
11257                 LIB_PREFIX=''
11258                 ;;
11259         (*)     LIB_PREFIX='lib'
11260                 ;;
11261         esac
11262 cf_prefix=$LIB_PREFIX
11263
11264 elif test "$with_lib_prefix" = no
11265 then
11266         LIB_PREFIX=
11267 else
11268         LIB_PREFIX=$with_lib_prefix
11269 fi
11270
11271 LIB_SUFFIX=
11272
11273 ###############################################################################
11274
11275 if test X"$CC_G_OPT" = X"" ; then
11276         CC_G_OPT='-g'
11277         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11278 fi
11279
11280 echo "$as_me:11280: checking for default loader flags" >&5
11281 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11282 case $DFT_LWR_MODEL in
11283 (normal)  LD_MODEL=''   ;;
11284 (debug)   LD_MODEL=$CC_G_OPT ;;
11285 (profile) LD_MODEL='-pg';;
11286 (shared)  LD_MODEL=''   ;;
11287 esac
11288 echo "$as_me:11288: result: $LD_MODEL" >&5
11289 echo "${ECHO_T}$LD_MODEL" >&6
11290
11291 LD_RPATH_OPT=
11292 if test "x$cf_cv_enable_rpath" != xno
11293 then
11294         echo "$as_me:11294: checking for an rpath option" >&5
11295 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11296         case "$cf_cv_system_name" in
11297         (irix*)
11298                 if test "$GCC" = yes; then
11299                         LD_RPATH_OPT="-Wl,-rpath,"
11300                 else
11301                         LD_RPATH_OPT="-rpath "
11302                 fi
11303                 ;;
11304         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11305                 LD_RPATH_OPT="-Wl,-rpath,"
11306                 ;;
11307         (openbsd[2-9].*|mirbsd*)
11308                 LD_RPATH_OPT="-Wl,-rpath,"
11309                 ;;
11310         (dragonfly*)
11311                 LD_RPATH_OPT="-rpath "
11312                 ;;
11313         (netbsd*)
11314                 LD_RPATH_OPT="-Wl,-rpath,"
11315                 ;;
11316         (osf*|mls+*)
11317                 LD_RPATH_OPT="-rpath "
11318                 ;;
11319         (solaris2*)
11320                 LD_RPATH_OPT="-R"
11321                 ;;
11322         (*)
11323                 ;;
11324         esac
11325         echo "$as_me:11325: result: $LD_RPATH_OPT" >&5
11326 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11327
11328         case "x$LD_RPATH_OPT" in
11329         (x-R*)
11330                 echo "$as_me:11330: checking if we need a space after rpath option" >&5
11331 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11332                 cf_save_LIBS="$LIBS"
11333
11334 cf_add_libs="$LIBS"
11335 # reverse order
11336 cf_add_0lib=
11337 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11338 # filter duplicates
11339 for cf_add_1lib in $cf_add_0lib; do
11340         for cf_add_2lib in $cf_add_libs; do
11341                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11342                         cf_add_1lib=
11343                         break
11344                 fi
11345         done
11346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11347 done
11348 LIBS="$cf_add_libs"
11349
11350                 cat >"conftest.$ac_ext" <<_ACEOF
11351 #line 11351 "configure"
11352 #include "confdefs.h"
11353
11354 int
11355 main (void)
11356 {
11357
11358   ;
11359   return 0;
11360 }
11361 _ACEOF
11362 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11363 if { (eval echo "$as_me:11363: \"$ac_link\"") >&5
11364   (eval $ac_link) 2>&5
11365   ac_status=$?
11366   echo "$as_me:11366: \$? = $ac_status" >&5
11367   (exit "$ac_status"); } &&
11368          { ac_try='test -s "conftest$ac_exeext"'
11369   { (eval echo "$as_me:11369: \"$ac_try\"") >&5
11370   (eval $ac_try) 2>&5
11371   ac_status=$?
11372   echo "$as_me:11372: \$? = $ac_status" >&5
11373   (exit "$ac_status"); }; }; then
11374   cf_rpath_space=no
11375 else
11376   echo "$as_me: failed program was:" >&5
11377 cat "conftest.$ac_ext" >&5
11378 cf_rpath_space=yes
11379 fi
11380 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11381                 LIBS="$cf_save_LIBS"
11382                 echo "$as_me:11382: result: $cf_rpath_space" >&5
11383 echo "${ECHO_T}$cf_rpath_space" >&6
11384                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11385                 ;;
11386         esac
11387 fi
11388
11389         RM_SHARED_OPTS=
11390         LOCAL_LDFLAGS=
11391         LOCAL_LDFLAGS2=
11392         LD_SHARED_OPTS=
11393         INSTALL_LIB="-m 644"
11394         : ${rel_builddir:=.}
11395
11396         shlibdir=$libdir
11397
11398         MAKE_DLLS="#"
11399
11400         cf_cv_do_symlinks=no
11401         cf_ld_rpath_opt=
11402         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11403
11404         echo "$as_me:11404: checking if release/abi version should be used for shared libs" >&5
11405 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11406
11407 # Check whether --with-shlib-version or --without-shlib-version was given.
11408 if test "${with_shlib_version+set}" = set; then
11409   withval="$with_shlib_version"
11410   test -z "$withval" && withval=auto
11411         case "$withval" in
11412         (yes)
11413                 cf_cv_shlib_version=auto
11414                 ;;
11415         (rel|abi|auto)
11416                 cf_cv_shlib_version=$withval
11417                 ;;
11418         (*)
11419                 echo "$as_me:11419: result: $withval" >&5
11420 echo "${ECHO_T}$withval" >&6
11421                 { { echo "$as_me:11421: error: option value must be one of: rel, abi, or auto" >&5
11422 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11423    { (exit 1); exit 1; }; }
11424                 ;;
11425         esac
11426
11427 else
11428   cf_cv_shlib_version=auto
11429 fi;
11430         echo "$as_me:11430: result: $cf_cv_shlib_version" >&5
11431 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11432
11433         cf_cv_rm_so_locs=no
11434         cf_try_cflags=
11435
11436         # Some less-capable ports of gcc support only -fpic
11437         CC_SHARED_OPTS=
11438
11439         cf_try_fPIC=no
11440         if test "$GCC" = yes
11441         then
11442                 cf_try_fPIC=yes
11443         else
11444                 case "$cf_cv_system_name" in
11445                 (*linux*)       # e.g., PGI compiler
11446                         cf_try_fPIC=yes
11447                         ;;
11448                 esac
11449         fi
11450
11451         if test "$cf_try_fPIC" = yes
11452         then
11453                 echo "$as_me:11453: checking which $CC option to use" >&5
11454 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11455                 cf_save_CFLAGS="$CFLAGS"
11456                 for CC_SHARED_OPTS in -fPIC -fpic ''
11457                 do
11458                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11459                         cat >"conftest.$ac_ext" <<_ACEOF
11460 #line 11460 "configure"
11461 #include "confdefs.h"
11462 #include <stdio.h>
11463 int
11464 main (void)
11465 {
11466 int x = 1
11467   ;
11468   return 0;
11469 }
11470 _ACEOF
11471 rm -f "conftest.$ac_objext"
11472 if { (eval echo "$as_me:11472: \"$ac_compile\"") >&5
11473   (eval $ac_compile) 2>&5
11474   ac_status=$?
11475   echo "$as_me:11475: \$? = $ac_status" >&5
11476   (exit "$ac_status"); } &&
11477          { ac_try='test -s "conftest.$ac_objext"'
11478   { (eval echo "$as_me:11478: \"$ac_try\"") >&5
11479   (eval $ac_try) 2>&5
11480   ac_status=$?
11481   echo "$as_me:11481: \$? = $ac_status" >&5
11482   (exit "$ac_status"); }; }; then
11483   break
11484 else
11485   echo "$as_me: failed program was:" >&5
11486 cat "conftest.$ac_ext" >&5
11487 fi
11488 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11489                 done
11490                 echo "$as_me:11490: result: $CC_SHARED_OPTS" >&5
11491 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11492                 CFLAGS="$cf_save_CFLAGS"
11493         fi
11494
11495         cf_cv_shlib_version_infix=no
11496
11497         case "$cf_cv_system_name" in
11498         (aix4.3-9*|aix[5-7]*)
11499                 if test "$GCC" = yes; then
11500                         CC_SHARED_OPTS='-Wl,-brtl'
11501                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11502                 else
11503                         CC_SHARED_OPTS='-brtl'
11504                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11505                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11506                 fi
11507                 ;;
11508         (beos*)
11509                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11510                 ;;
11511         (cygwin*)
11512                 CC_SHARED_OPTS=
11513                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11514                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11515                 cf_cv_shlib_version=cygdll
11516                 cf_cv_shlib_version_infix=cygdll
11517                 shlibdir=$bindir
11518                 MAKE_DLLS=
11519                 cat >mk_shared_lib.sh <<-CF_EOF
11520                 #!$SHELL
11521                 SHARED_LIB=\$1
11522                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11523                 shift
11524                 cat <<-EOF
11525                 Linking shared library
11526                 ** SHARED_LIB \$SHARED_LIB
11527                 ** IMPORT_LIB \$IMPORT_LIB
11528 EOF
11529                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11530 CF_EOF
11531                 chmod +x mk_shared_lib.sh
11532                 ;;
11533         (msys*)
11534                 CC_SHARED_OPTS=
11535                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11536                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11537                 cf_cv_shlib_version=msysdll
11538                 cf_cv_shlib_version_infix=msysdll
11539                 shlibdir=$bindir
11540                 MAKE_DLLS=
11541                 cat >mk_shared_lib.sh <<-CF_EOF
11542                 #!$SHELL
11543                 SHARED_LIB=\$1
11544                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11545                 shift
11546                 cat <<-EOF
11547                 Linking shared library
11548                 ** SHARED_LIB \$SHARED_LIB
11549                 ** IMPORT_LIB \$IMPORT_LIB
11550 EOF
11551                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11552 CF_EOF
11553                 chmod +x mk_shared_lib.sh
11554                 ;;
11555         (darwin*)
11556                 cf_try_cflags="no-cpp-precomp"
11557                 CC_SHARED_OPTS="-dynamic"
11558                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11559                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11560                 cf_cv_shlib_version_infix=yes
11561                 echo "$as_me:11561: checking if ld -search_paths_first works" >&5
11562 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11563 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11564   echo $ECHO_N "(cached) $ECHO_C" >&6
11565 else
11566
11567                         cf_save_LDFLAGS=$LDFLAGS
11568                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11569                         cat >"conftest.$ac_ext" <<_ACEOF
11570 #line 11570 "configure"
11571 #include "confdefs.h"
11572
11573 int
11574 main (void)
11575 {
11576 int i;
11577   ;
11578   return 0;
11579 }
11580 _ACEOF
11581 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11582 if { (eval echo "$as_me:11582: \"$ac_link\"") >&5
11583   (eval $ac_link) 2>&5
11584   ac_status=$?
11585   echo "$as_me:11585: \$? = $ac_status" >&5
11586   (exit "$ac_status"); } &&
11587          { ac_try='test -s "conftest$ac_exeext"'
11588   { (eval echo "$as_me:11588: \"$ac_try\"") >&5
11589   (eval $ac_try) 2>&5
11590   ac_status=$?
11591   echo "$as_me:11591: \$? = $ac_status" >&5
11592   (exit "$ac_status"); }; }; then
11593   cf_cv_ldflags_search_paths_first=yes
11594 else
11595   echo "$as_me: failed program was:" >&5
11596 cat "conftest.$ac_ext" >&5
11597 cf_cv_ldflags_search_paths_first=no
11598 fi
11599 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11600                                 LDFLAGS=$cf_save_LDFLAGS
11601 fi
11602 echo "$as_me:11602: result: $cf_cv_ldflags_search_paths_first" >&5
11603 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11604                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11605                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11606                 fi
11607                 ;;
11608         (hpux[7-8]*)
11609                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11610                 if test "$GCC" != yes; then
11611                         CC_SHARED_OPTS='+Z'
11612                 fi
11613                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11614                 INSTALL_LIB="-m 555"
11615                 ;;
11616         (hpux*)
11617                 # (tested with gcc 2.7.2 -- I don't have c89)
11618                 if test "$GCC" = yes; then
11619                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11620                 else
11621                         CC_SHARED_OPTS='+Z'
11622                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11623                 fi
11624                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11625                 # HP-UX shared libraries must be executable, and should be
11626                 # readonly to exploit a quirk in the memory manager.
11627                 INSTALL_LIB="-m 555"
11628                 ;;
11629         (interix*)
11630                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11631                 if test "$cf_cv_shlib_version" = rel; then
11632                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11633                 else
11634                         cf_shared_soname='`basename $@`'
11635                 fi
11636                 CC_SHARED_OPTS=
11637                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11638                 ;;
11639         (irix*)
11640                 if test "$cf_cv_enable_rpath" = yes ; then
11641                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11642                 fi
11643                 # tested with IRIX 5.2 and 'cc'.
11644                 if test "$GCC" != yes; then
11645                         CC_SHARED_OPTS='-KPIC'
11646                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11647                 else
11648                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11649                 fi
11650                 cf_cv_rm_so_locs=yes
11651                 ;;
11652         (linux*|gnu*|k*bsd*-gnu)
11653                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11654                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11655                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11656                 fi
11657                 if test "$cf_cv_enable_rpath" = yes ; then
11658                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11659                 fi
11660
11661         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11662         if test "$cf_cv_shlib_version" = rel; then
11663                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11664         else
11665                 cf_cv_shared_soname='`basename $@`'
11666         fi
11667
11668                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11669                 ;;
11670         (mingw*msvc*)
11671                 cf_cv_shlib_version=msvcdll
11672                 cf_cv_shlib_version_infix=msvcdll
11673                 shlibdir=$bindir
11674                 MAKE_DLLS=
11675                 if test "$DFT_LWR_MODEL" = "shared" ; then
11676                         LOCAL_LDFLAGS="-link -dll"
11677                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11678                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11679                 fi
11680                 CC_SHARED_OPTS=
11681                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11682                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11683                 cat >mk_shared_lib.sh <<-CF_EOF
11684                 #!$SHELL
11685                 SHARED_LIB=\$1
11686                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11687                 shift
11688                 my_ld=\$1
11689                 shift
11690                 cat <<-EOF
11691                 Linking shared library
11692                 ** SHARED LIB \$SHARED_LIB
11693                 ** IMPORT_LIB \$IMPORT_LIB
11694 EOF
11695                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11696                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11697                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11698 CF_EOF
11699                 chmod +x mk_shared_lib.sh
11700                 cat >mk_prog.sh <<-CF_EOF
11701                 #!$SHELL
11702                 shift
11703                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11704                 LD="$LD"
11705                 clopts=()
11706                 ldopts=("/subsystem:console")
11707                 libs=()
11708                 isdll=0
11709                 while test \$# -gt 0; do
11710                         case "\$1" in
11711                                 -link)
11712                                         # ignore -link argument
11713                                         ;;
11714                                 -M[TD] | -M[TD]d)
11715                                         # ignore runtime-library option
11716                                         ;;
11717                                 -dll)
11718                                         isdll=1
11719                                         ;;
11720                                 -W* | -w*)
11721                                         # ignore warnings
11722                                         ;;
11723                                 -D*)
11724                                         clopts+=("\$1")
11725                                         ;;
11726                                 -I*)
11727                                         clopts+=("\$1")
11728                                         ;;
11729                                 -l*)
11730                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11731                                         ;;
11732                                 -L*)
11733                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11734                                         ;;
11735                                 *.obj | *.o)
11736                                         ldopts+=("\$1")
11737                                         ;;
11738                                 -Wl,*)
11739                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11740                                                 ldopts+=("\${linkarg}")
11741                                         done
11742                                         ;;
11743                                 *.lib)
11744                                         ldopts+=("\$1")
11745                                         ;;
11746                                 -o)
11747                                         shift
11748                                         ldopts+=("-out:\$1")
11749                                         ;;
11750                                 *)
11751                                         clopts+=("\$1")
11752                                         ldopts+=("\$1")
11753                                         ;;
11754                         esac
11755                         shift
11756                 done
11757                 if [ "\$isdll" -ne 0 ]; then
11758                         for lib in \${libs[*]}; do
11759                                 ldopts+=("\$lib.dll.lib")
11760                         done
11761                 else
11762                         for lib in \${libs[*]}; do
11763                                 ldopts+=("\$lib.lib")
11764                         done
11765                 fi
11766                 cat <<-EOF
11767                 Creating program
11768                 ** ld options:   "\${ldopts[@]}"
11769 EOF
11770                 exec \$LD \${ldopts[@]}
11771 CF_EOF
11772                 chmod +x mk_prog.sh
11773                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11774                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11775                 ;;
11776         (mingw*)
11777                 cf_cv_shlib_version=mingw
11778                 cf_cv_shlib_version_infix=mingw
11779                 shlibdir=$bindir
11780                 MAKE_DLLS=
11781                 if test "$DFT_LWR_MODEL" = "shared" ; then
11782                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11783                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11784                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11785                 fi
11786                 CC_SHARED_OPTS=
11787                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11788                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11789                 cat >mk_shared_lib.sh <<-CF_EOF
11790                 #!$SHELL
11791                 SHARED_LIB=\$1
11792                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11793                 shift
11794                 cat <<-EOF
11795                 Linking shared library
11796                 ** SHARED_LIB \$SHARED_LIB
11797                 ** IMPORT_LIB \$IMPORT_LIB
11798 EOF
11799                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11800 CF_EOF
11801                 chmod +x mk_shared_lib.sh
11802                 ;;
11803         (openbsd[2-9].*|mirbsd*)
11804                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11805                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11806                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11807                 fi
11808                 if test "$cf_cv_enable_rpath" = yes ; then
11809                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11810                 fi
11811                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11812
11813         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11814         if test "$cf_cv_shlib_version" = rel; then
11815                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11816         else
11817                 cf_cv_shared_soname='`basename $@`'
11818         fi
11819
11820                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11821                 ;;
11822         (nskJ*)
11823                 CC_SHARED_OPTS=
11824                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11825                 ;;
11826         (nskL*)
11827                 CC_SHARED_OPTS=
11828                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11829                 ;;
11830         (nto-qnx*|openbsd*|freebsd[12].*)
11831                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11832                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11833                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11834                 ;;
11835         (dragonfly*|freebsd*)
11836                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11837                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11838                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11839                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11840                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11841                 fi
11842
11843         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11844         if test "$cf_cv_shlib_version" = rel; then
11845                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11846         else
11847                 cf_cv_shared_soname='`basename $@`'
11848         fi
11849
11850                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11851                 ;;
11852         (netbsd*)
11853                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11854                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11855                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11856                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11857                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11858                         if test "$cf_cv_shlib_version" = auto; then
11859                         if test -f /usr/libexec/ld.elf_so; then
11860                                 cf_cv_shlib_version=abi
11861                         else
11862                                 cf_cv_shlib_version=rel
11863                         fi
11864                         fi
11865
11866         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11867         if test "$cf_cv_shlib_version" = rel; then
11868                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11869         else
11870                 cf_cv_shared_soname='`basename $@`'
11871         fi
11872
11873                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11874                 else
11875                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11876                 fi
11877                 ;;
11878         (osf*|mls+*)
11879                 # tested with OSF/1 V3.2 and 'cc'
11880                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11881                 # link with shared libs).
11882                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11883                 case "$host_os" in
11884                 (osf4*)
11885                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11886                         ;;
11887                 esac
11888                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11889                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11890                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11891                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11892                 fi
11893                 cf_cv_rm_so_locs=yes
11894                 ;;
11895         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11896                 # tested with osr5.0.5
11897                 if test "$GCC" != yes; then
11898                         CC_SHARED_OPTS='-belf -KPIC'
11899                 fi
11900                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11901                 if test "$cf_cv_enable_rpath" = yes ; then
11902                         # only way is to set LD_RUN_PATH but no switch for it
11903                         RUN_PATH=$libdir
11904                 fi
11905                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11906                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11907                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11908                 ;;
11909         (sunos4*)
11910                 # tested with SunOS 4.1.1 and gcc 2.7.0
11911                 if test "$GCC" != yes; then
11912                         CC_SHARED_OPTS='-KPIC'
11913                 fi
11914                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11915                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11916                 ;;
11917         (solaris2*)
11918                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11919                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11920                 if test "$DFT_LWR_MODEL" = "shared" ; then
11921                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11922                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11923                 fi
11924                 if test "$cf_cv_enable_rpath" = yes ; then
11925                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11926                 fi
11927
11928         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11929         if test "$cf_cv_shlib_version" = rel; then
11930                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11931         else
11932                 cf_cv_shared_soname='`basename $@`'
11933         fi
11934
11935                 if test "$GCC" != yes; then
11936                         cf_save_CFLAGS="$CFLAGS"
11937                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11938                         do
11939                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11940                                 cat >"conftest.$ac_ext" <<_ACEOF
11941 #line 11941 "configure"
11942 #include "confdefs.h"
11943 #include <stdio.h>
11944 int
11945 main (void)
11946 {
11947 printf("Hello\\n");
11948   ;
11949   return 0;
11950 }
11951 _ACEOF
11952 rm -f "conftest.$ac_objext"
11953 if { (eval echo "$as_me:11953: \"$ac_compile\"") >&5
11954   (eval $ac_compile) 2>&5
11955   ac_status=$?
11956   echo "$as_me:11956: \$? = $ac_status" >&5
11957   (exit "$ac_status"); } &&
11958          { ac_try='test -s "conftest.$ac_objext"'
11959   { (eval echo "$as_me:11959: \"$ac_try\"") >&5
11960   (eval $ac_try) 2>&5
11961   ac_status=$?
11962   echo "$as_me:11962: \$? = $ac_status" >&5
11963   (exit "$ac_status"); }; }; then
11964   break
11965 else
11966   echo "$as_me: failed program was:" >&5
11967 cat "conftest.$ac_ext" >&5
11968 fi
11969 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11970                         done
11971                         CFLAGS="$cf_save_CFLAGS"
11972                         CC_SHARED_OPTS=$cf_shared_opts
11973                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11974                 else
11975                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11976                 fi
11977                 ;;
11978         (sysv5uw7*|unix_sv*)
11979                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11980                 if test "$GCC" != yes; then
11981                         CC_SHARED_OPTS='-KPIC'
11982                 fi
11983                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11984                 ;;
11985         (*)
11986                 CC_SHARED_OPTS='unknown'
11987                 MK_SHARED_LIB='echo unknown'
11988                 ;;
11989         esac
11990
11991         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11992         case "$cf_cv_shlib_version" in
11993         (rel|abi)
11994                 case "$MK_SHARED_LIB" in
11995                 (*'-o $@')
11996                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11997                         ;;
11998                 (*)
11999                         { echo "$as_me:11999: WARNING: ignored --with-shlib-version" >&5
12000 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12001                         ;;
12002                 esac
12003                 ;;
12004         esac
12005
12006         if test -n "$cf_try_cflags"
12007         then
12008 cat > conftest.$ac_ext <<EOF
12009 #line 12009 "${as_me:-configure}"
12010 #include <stdio.h>
12011 int main(int argc, char *argv[])
12012 {
12013         printf("hello\\n");
12014         return (argv[argc-1] == 0) ;
12015 }
12016 EOF
12017                 cf_save_CFLAGS="$CFLAGS"
12018                 for cf_opt in $cf_try_cflags
12019                 do
12020                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12021                         echo "$as_me:12021: checking if CFLAGS option -$cf_opt works" >&5
12022 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12023                         if { (eval echo "$as_me:12023: \"$ac_compile\"") >&5
12024   (eval $ac_compile) 2>&5
12025   ac_status=$?
12026   echo "$as_me:12026: \$? = $ac_status" >&5
12027   (exit "$ac_status"); }; then
12028                                 echo "$as_me:12028: result: yes" >&5
12029 echo "${ECHO_T}yes" >&6
12030                                 cf_save_CFLAGS="$CFLAGS"
12031                         else
12032                                 echo "$as_me:12032: result: no" >&5
12033 echo "${ECHO_T}no" >&6
12034                         fi
12035                 done
12036                 CFLAGS="$cf_save_CFLAGS"
12037         fi
12038
12039         # RPATH_LIST is a colon-separated list of directories
12040         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12041         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12042
12043         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12044
12045         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12046
12047 echo "${as_me:-configure}:12047: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12048
12049         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12050
12051 echo "${as_me:-configure}:12051: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12052
12053 # The test/sample programs in the original tree link using rpath option.
12054 # Make it optional for packagers.
12055 if test -n "$LOCAL_LDFLAGS"
12056 then
12057         echo "$as_me:12057: checking if you want to link sample programs with rpath option" >&5
12058 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12059
12060 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12061 if test "${enable_rpath_link+set}" = set; then
12062   enableval="$enable_rpath_link"
12063   with_rpath_link=$enableval
12064 else
12065   with_rpath_link=yes
12066 fi;
12067         echo "$as_me:12067: result: $with_rpath_link" >&5
12068 echo "${ECHO_T}$with_rpath_link" >&6
12069         if test "$with_rpath_link" = no
12070         then
12071                 LOCAL_LDFLAGS=
12072                 LOCAL_LDFLAGS2=
12073         fi
12074 fi
12075
12076 ###############################################################################
12077
12078 ###   use option --enable-broken-linker to force on use of broken-linker support
12079
12080 echo "$as_me:12080: checking if you want broken-linker support code" >&5
12081 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12082
12083 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12084 if test "${enable_broken_linker+set}" = set; then
12085   enableval="$enable_broken_linker"
12086   with_broken_linker=$enableval
12087 else
12088   with_broken_linker=no
12089 fi;
12090 echo "$as_me:12090: result: $with_broken_linker" >&5
12091 echo "${ECHO_T}$with_broken_linker" >&6
12092
12093 : "${BROKEN_LINKER:=0}"
12094 if test "x$with_broken_linker" = xyes ; then
12095
12096 cat >>confdefs.h <<\EOF
12097 #define BROKEN_LINKER 1
12098 EOF
12099
12100         BROKEN_LINKER=1
12101 fi
12102
12103 # Check to define _XOPEN_SOURCE "automatically"
12104
12105 echo "$as_me:12105: checking if the POSIX test-macros are already defined" >&5
12106 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12107 if test "${cf_cv_posix_visible+set}" = set; then
12108   echo $ECHO_N "(cached) $ECHO_C" >&6
12109 else
12110
12111 cat >"conftest.$ac_ext" <<_ACEOF
12112 #line 12112 "configure"
12113 #include "confdefs.h"
12114 #include <stdio.h>
12115 int
12116 main (void)
12117 {
12118
12119 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12120         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12121         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12122         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12123 #error conflicting symbols found
12124 #endif
12125
12126   ;
12127   return 0;
12128 }
12129 _ACEOF
12130 rm -f "conftest.$ac_objext"
12131 if { (eval echo "$as_me:12131: \"$ac_compile\"") >&5
12132   (eval $ac_compile) 2>&5
12133   ac_status=$?
12134   echo "$as_me:12134: \$? = $ac_status" >&5
12135   (exit "$ac_status"); } &&
12136          { ac_try='test -s "conftest.$ac_objext"'
12137   { (eval echo "$as_me:12137: \"$ac_try\"") >&5
12138   (eval $ac_try) 2>&5
12139   ac_status=$?
12140   echo "$as_me:12140: \$? = $ac_status" >&5
12141   (exit "$ac_status"); }; }; then
12142   cf_cv_posix_visible=no
12143 else
12144   echo "$as_me: failed program was:" >&5
12145 cat "conftest.$ac_ext" >&5
12146 cf_cv_posix_visible=yes
12147 fi
12148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12149
12150 fi
12151 echo "$as_me:12151: result: $cf_cv_posix_visible" >&5
12152 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12153
12154 if test "$cf_cv_posix_visible" = no; then
12155
12156 cf_XOPEN_SOURCE=600
12157 cf_POSIX_C_SOURCE=199506L
12158 cf_xopen_source=
12159
12160 case "$host_os" in
12161 (aix[4-7]*)
12162         cf_xopen_source="-D_ALL_SOURCE"
12163         ;;
12164 (msys)
12165         cf_XOPEN_SOURCE=600
12166         ;;
12167 (darwin[0-8].*)
12168         cf_xopen_source="-D_APPLE_C_SOURCE"
12169         ;;
12170 (darwin*)
12171         cf_xopen_source="-D_DARWIN_C_SOURCE"
12172         cf_XOPEN_SOURCE=
12173         ;;
12174 (freebsd*|dragonfly*|midnightbsd*)
12175         # 5.x headers associate
12176         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12177         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12178         cf_POSIX_C_SOURCE=200112L
12179         cf_XOPEN_SOURCE=600
12180         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12181         ;;
12182 (hpux11*)
12183         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12184         ;;
12185 (hpux*)
12186         cf_xopen_source="-D_HPUX_SOURCE"
12187         ;;
12188 (irix[56].*)
12189         cf_xopen_source="-D_SGI_SOURCE"
12190         cf_XOPEN_SOURCE=
12191         ;;
12192 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12193
12194 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12195
12196 echo "$as_me:12196: checking if this is the GNU C library" >&5
12197 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12198 if test "${cf_cv_gnu_library+set}" = set; then
12199   echo $ECHO_N "(cached) $ECHO_C" >&6
12200 else
12201
12202 cat >"conftest.$ac_ext" <<_ACEOF
12203 #line 12203 "configure"
12204 #include "confdefs.h"
12205 #include <sys/types.h>
12206 int
12207 main (void)
12208 {
12209
12210         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12211                 return 0;
12212         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12213                 return 0;
12214         #else
12215         #       error not GNU C library
12216         #endif
12217   ;
12218   return 0;
12219 }
12220 _ACEOF
12221 rm -f "conftest.$ac_objext"
12222 if { (eval echo "$as_me:12222: \"$ac_compile\"") >&5
12223   (eval $ac_compile) 2>&5
12224   ac_status=$?
12225   echo "$as_me:12225: \$? = $ac_status" >&5
12226   (exit "$ac_status"); } &&
12227          { ac_try='test -s "conftest.$ac_objext"'
12228   { (eval echo "$as_me:12228: \"$ac_try\"") >&5
12229   (eval $ac_try) 2>&5
12230   ac_status=$?
12231   echo "$as_me:12231: \$? = $ac_status" >&5
12232   (exit "$ac_status"); }; }; then
12233   cf_cv_gnu_library=yes
12234 else
12235   echo "$as_me: failed program was:" >&5
12236 cat "conftest.$ac_ext" >&5
12237 cf_cv_gnu_library=no
12238 fi
12239 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12240
12241 fi
12242 echo "$as_me:12242: result: $cf_cv_gnu_library" >&5
12243 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12244
12245 if test x$cf_cv_gnu_library = xyes; then
12246
12247         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12248         # was changed to help a little.  newlib incorporated the change about 4
12249         # years later.
12250         echo "$as_me:12250: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12251 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12252 if test "${cf_cv_gnu_library_219+set}" = set; then
12253   echo $ECHO_N "(cached) $ECHO_C" >&6
12254 else
12255
12256                 cf_save="$CPPFLAGS"
12257
12258         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12259         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12260
12261                 cat >"conftest.$ac_ext" <<_ACEOF
12262 #line 12262 "configure"
12263 #include "confdefs.h"
12264 #include <sys/types.h>
12265 int
12266 main (void)
12267 {
12268
12269                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12270                                 return 0;
12271                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12272                                 return 0;
12273                         #else
12274                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12275                         #endif
12276   ;
12277   return 0;
12278 }
12279 _ACEOF
12280 rm -f "conftest.$ac_objext"
12281 if { (eval echo "$as_me:12281: \"$ac_compile\"") >&5
12282   (eval $ac_compile) 2>&5
12283   ac_status=$?
12284   echo "$as_me:12284: \$? = $ac_status" >&5
12285   (exit "$ac_status"); } &&
12286          { ac_try='test -s "conftest.$ac_objext"'
12287   { (eval echo "$as_me:12287: \"$ac_try\"") >&5
12288   (eval $ac_try) 2>&5
12289   ac_status=$?
12290   echo "$as_me:12290: \$? = $ac_status" >&5
12291   (exit "$ac_status"); }; }; then
12292   cf_cv_gnu_library_219=yes
12293 else
12294   echo "$as_me: failed program was:" >&5
12295 cat "conftest.$ac_ext" >&5
12296 cf_cv_gnu_library_219=no
12297 fi
12298 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12299                 CPPFLAGS="$cf_save"
12300
12301 fi
12302 echo "$as_me:12302: result: $cf_cv_gnu_library_219" >&5
12303 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12304
12305         if test "x$cf_cv_gnu_library_219" = xyes; then
12306                 cf_save="$CPPFLAGS"
12307                 echo "$as_me:12307: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12308 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12309 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12310   echo $ECHO_N "(cached) $ECHO_C" >&6
12311 else
12312
12313 cf_fix_cppflags=no
12314 cf_new_cflags=
12315 cf_new_cppflags=
12316 cf_new_extra_cppflags=
12317
12318 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12319 do
12320 case "$cf_fix_cppflags" in
12321 (no)
12322         case "$cf_add_cflags" in
12323         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12324                 case "$cf_add_cflags" in
12325                 (-D*)
12326                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12327
12328                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12329                                 && test -z "${cf_tst_cflags}" \
12330                                 && cf_fix_cppflags=yes
12331
12332                         if test "$cf_fix_cppflags" = yes ; then
12333
12334         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12335         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12336
12337                                 continue
12338                         elif test "${cf_tst_cflags}" = "\"'" ; then
12339
12340         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12341         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12342
12343                                 continue
12344                         fi
12345                         ;;
12346                 esac
12347                 case "$CPPFLAGS" in
12348                 (*$cf_add_cflags)
12349                         ;;
12350                 (*)
12351                         case "$cf_add_cflags" in
12352                         (-D*)
12353                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12354
12355 CPPFLAGS=`echo "$CPPFLAGS" | \
12356         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12357                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12358
12359                                 ;;
12360                         esac
12361
12362         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12363         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12364
12365                         ;;
12366                 esac
12367                 ;;
12368         (*)
12369
12370         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12371         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12372
12373                 ;;
12374         esac
12375         ;;
12376 (yes)
12377
12378         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12379         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12380
12381         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12382
12383         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12384                 && test -z "${cf_tst_cflags}" \
12385                 && cf_fix_cppflags=no
12386         ;;
12387 esac
12388 done
12389
12390 if test -n "$cf_new_cflags" ; then
12391
12392         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12393         CFLAGS="${CFLAGS}$cf_new_cflags"
12394
12395 fi
12396
12397 if test -n "$cf_new_cppflags" ; then
12398
12399         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12400         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12401
12402 fi
12403
12404 if test -n "$cf_new_extra_cppflags" ; then
12405
12406         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12407         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12408
12409 fi
12410
12411                         cat >"conftest.$ac_ext" <<_ACEOF
12412 #line 12412 "configure"
12413 #include "confdefs.h"
12414
12415                                 #include <limits.h>
12416                                 #include <sys/types.h>
12417
12418 int
12419 main (void)
12420 {
12421
12422                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12423                                         return 0;
12424                                 #else
12425                                 #       error GNU C library is too old
12426                                 #endif
12427   ;
12428   return 0;
12429 }
12430 _ACEOF
12431 rm -f "conftest.$ac_objext"
12432 if { (eval echo "$as_me:12432: \"$ac_compile\"") >&5
12433   (eval $ac_compile) 2>&5
12434   ac_status=$?
12435   echo "$as_me:12435: \$? = $ac_status" >&5
12436   (exit "$ac_status"); } &&
12437          { ac_try='test -s "conftest.$ac_objext"'
12438   { (eval echo "$as_me:12438: \"$ac_try\"") >&5
12439   (eval $ac_try) 2>&5
12440   ac_status=$?
12441   echo "$as_me:12441: \$? = $ac_status" >&5
12442   (exit "$ac_status"); }; }; then
12443   cf_cv_gnu_dftsrc_219=yes
12444 else
12445   echo "$as_me: failed program was:" >&5
12446 cat "conftest.$ac_ext" >&5
12447 cf_cv_gnu_dftsrc_219=no
12448 fi
12449 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12450
12451 fi
12452 echo "$as_me:12452: result: $cf_cv_gnu_dftsrc_219" >&5
12453 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12454                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12455         else
12456                 cf_cv_gnu_dftsrc_219=maybe
12457         fi
12458
12459         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12460
12461                 echo "$as_me:12461: checking if we must define _GNU_SOURCE" >&5
12462 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12463 if test "${cf_cv_gnu_source+set}" = set; then
12464   echo $ECHO_N "(cached) $ECHO_C" >&6
12465 else
12466
12467                 cat >"conftest.$ac_ext" <<_ACEOF
12468 #line 12468 "configure"
12469 #include "confdefs.h"
12470 #include <sys/types.h>
12471 int
12472 main (void)
12473 {
12474
12475                         #ifndef _XOPEN_SOURCE
12476                         #error  expected _XOPEN_SOURCE to be defined
12477                         #endif
12478   ;
12479   return 0;
12480 }
12481 _ACEOF
12482 rm -f "conftest.$ac_objext"
12483 if { (eval echo "$as_me:12483: \"$ac_compile\"") >&5
12484   (eval $ac_compile) 2>&5
12485   ac_status=$?
12486   echo "$as_me:12486: \$? = $ac_status" >&5
12487   (exit "$ac_status"); } &&
12488          { ac_try='test -s "conftest.$ac_objext"'
12489   { (eval echo "$as_me:12489: \"$ac_try\"") >&5
12490   (eval $ac_try) 2>&5
12491   ac_status=$?
12492   echo "$as_me:12492: \$? = $ac_status" >&5
12493   (exit "$ac_status"); }; }; then
12494   cf_cv_gnu_source=no
12495 else
12496   echo "$as_me: failed program was:" >&5
12497 cat "conftest.$ac_ext" >&5
12498 cf_save="$CPPFLAGS"
12499
12500 cf_fix_cppflags=no
12501 cf_new_cflags=
12502 cf_new_cppflags=
12503 cf_new_extra_cppflags=
12504
12505 for cf_add_cflags in -D_GNU_SOURCE
12506 do
12507 case "$cf_fix_cppflags" in
12508 (no)
12509         case "$cf_add_cflags" in
12510         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12511                 case "$cf_add_cflags" in
12512                 (-D*)
12513                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12514
12515                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12516                                 && test -z "${cf_tst_cflags}" \
12517                                 && cf_fix_cppflags=yes
12518
12519                         if test "$cf_fix_cppflags" = yes ; then
12520
12521         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12522         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12523
12524                                 continue
12525                         elif test "${cf_tst_cflags}" = "\"'" ; then
12526
12527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12529
12530                                 continue
12531                         fi
12532                         ;;
12533                 esac
12534                 case "$CPPFLAGS" in
12535                 (*$cf_add_cflags)
12536                         ;;
12537                 (*)
12538                         case "$cf_add_cflags" in
12539                         (-D*)
12540                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12541
12542 CPPFLAGS=`echo "$CPPFLAGS" | \
12543         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12544                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12545
12546                                 ;;
12547                         esac
12548
12549         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12550         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12551
12552                         ;;
12553                 esac
12554                 ;;
12555         (*)
12556
12557         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12558         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12559
12560                 ;;
12561         esac
12562         ;;
12563 (yes)
12564
12565         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12566         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12567
12568         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12569
12570         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12571                 && test -z "${cf_tst_cflags}" \
12572                 && cf_fix_cppflags=no
12573         ;;
12574 esac
12575 done
12576
12577 if test -n "$cf_new_cflags" ; then
12578
12579         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12580         CFLAGS="${CFLAGS}$cf_new_cflags"
12581
12582 fi
12583
12584 if test -n "$cf_new_cppflags" ; then
12585
12586         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12587         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12588
12589 fi
12590
12591 if test -n "$cf_new_extra_cppflags" ; then
12592
12593         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12594         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12595
12596 fi
12597
12598                          cat >"conftest.$ac_ext" <<_ACEOF
12599 #line 12599 "configure"
12600 #include "confdefs.h"
12601 #include <sys/types.h>
12602 int
12603 main (void)
12604 {
12605
12606                                 #ifdef _XOPEN_SOURCE
12607                                 #error  expected _XOPEN_SOURCE to be undefined
12608                                 #endif
12609   ;
12610   return 0;
12611 }
12612 _ACEOF
12613 rm -f "conftest.$ac_objext"
12614 if { (eval echo "$as_me:12614: \"$ac_compile\"") >&5
12615   (eval $ac_compile) 2>&5
12616   ac_status=$?
12617   echo "$as_me:12617: \$? = $ac_status" >&5
12618   (exit "$ac_status"); } &&
12619          { ac_try='test -s "conftest.$ac_objext"'
12620   { (eval echo "$as_me:12620: \"$ac_try\"") >&5
12621   (eval $ac_try) 2>&5
12622   ac_status=$?
12623   echo "$as_me:12623: \$? = $ac_status" >&5
12624   (exit "$ac_status"); }; }; then
12625   cf_cv_gnu_source=no
12626 else
12627   echo "$as_me: failed program was:" >&5
12628 cat "conftest.$ac_ext" >&5
12629 cf_cv_gnu_source=yes
12630 fi
12631 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12632                         CPPFLAGS="$cf_save"
12633
12634 fi
12635 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12636
12637 fi
12638 echo "$as_me:12638: result: $cf_cv_gnu_source" >&5
12639 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12640
12641                 if test "$cf_cv_gnu_source" = yes
12642                 then
12643                 echo "$as_me:12643: checking if we should also define _DEFAULT_SOURCE" >&5
12644 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12645 if test "${cf_cv_default_source+set}" = set; then
12646   echo $ECHO_N "(cached) $ECHO_C" >&6
12647 else
12648
12649         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12650         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12651
12652                         cat >"conftest.$ac_ext" <<_ACEOF
12653 #line 12653 "configure"
12654 #include "confdefs.h"
12655 #include <sys/types.h>
12656 int
12657 main (void)
12658 {
12659
12660                                 #ifdef _DEFAULT_SOURCE
12661                                 #error  expected _DEFAULT_SOURCE to be undefined
12662                                 #endif
12663   ;
12664   return 0;
12665 }
12666 _ACEOF
12667 rm -f "conftest.$ac_objext"
12668 if { (eval echo "$as_me:12668: \"$ac_compile\"") >&5
12669   (eval $ac_compile) 2>&5
12670   ac_status=$?
12671   echo "$as_me:12671: \$? = $ac_status" >&5
12672   (exit "$ac_status"); } &&
12673          { ac_try='test -s "conftest.$ac_objext"'
12674   { (eval echo "$as_me:12674: \"$ac_try\"") >&5
12675   (eval $ac_try) 2>&5
12676   ac_status=$?
12677   echo "$as_me:12677: \$? = $ac_status" >&5
12678   (exit "$ac_status"); }; }; then
12679   cf_cv_default_source=no
12680 else
12681   echo "$as_me: failed program was:" >&5
12682 cat "conftest.$ac_ext" >&5
12683 cf_cv_default_source=yes
12684 fi
12685 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12686
12687 fi
12688 echo "$as_me:12688: result: $cf_cv_default_source" >&5
12689 echo "${ECHO_T}$cf_cv_default_source" >&6
12690                         if test "$cf_cv_default_source" = yes
12691                         then
12692
12693         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12694         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12695
12696                         fi
12697                 fi
12698         fi
12699
12700 fi
12701
12702         ;;
12703 (minix*)
12704         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12705         ;;
12706 (mirbsd*)
12707         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12708         cf_XOPEN_SOURCE=
12709
12710 if test "$cf_cv_posix_visible" = no; then
12711
12712 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12713
12714 cf_save_CFLAGS="$CFLAGS"
12715 cf_save_CPPFLAGS="$CPPFLAGS"
12716
12717 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12718         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12719                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12720
12721 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12722         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12723                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12724
12725 echo "$as_me:12725: checking if we should define _POSIX_C_SOURCE" >&5
12726 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12727 if test "${cf_cv_posix_c_source+set}" = set; then
12728   echo $ECHO_N "(cached) $ECHO_C" >&6
12729 else
12730
12731 echo "${as_me:-configure}:12731: testing if the symbol is already defined go no further ..." 1>&5
12732
12733         cat >"conftest.$ac_ext" <<_ACEOF
12734 #line 12734 "configure"
12735 #include "confdefs.h"
12736 #include <sys/types.h>
12737 int
12738 main (void)
12739 {
12740
12741 #ifndef _POSIX_C_SOURCE
12742 make an error
12743 #endif
12744   ;
12745   return 0;
12746 }
12747 _ACEOF
12748 rm -f "conftest.$ac_objext"
12749 if { (eval echo "$as_me:12749: \"$ac_compile\"") >&5
12750   (eval $ac_compile) 2>&5
12751   ac_status=$?
12752   echo "$as_me:12752: \$? = $ac_status" >&5
12753   (exit "$ac_status"); } &&
12754          { ac_try='test -s "conftest.$ac_objext"'
12755   { (eval echo "$as_me:12755: \"$ac_try\"") >&5
12756   (eval $ac_try) 2>&5
12757   ac_status=$?
12758   echo "$as_me:12758: \$? = $ac_status" >&5
12759   (exit "$ac_status"); }; }; then
12760   cf_cv_posix_c_source=no
12761 else
12762   echo "$as_me: failed program was:" >&5
12763 cat "conftest.$ac_ext" >&5
12764 cf_want_posix_source=no
12765          case .$cf_POSIX_C_SOURCE in
12766          (.[12]??*)
12767                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12768                 ;;
12769          (.2)
12770                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12771                 cf_want_posix_source=yes
12772                 ;;
12773          (.*)
12774                 cf_want_posix_source=yes
12775                 ;;
12776          esac
12777          if test "$cf_want_posix_source" = yes ; then
12778                 cat >"conftest.$ac_ext" <<_ACEOF
12779 #line 12779 "configure"
12780 #include "confdefs.h"
12781 #include <sys/types.h>
12782 int
12783 main (void)
12784 {
12785
12786 #ifdef _POSIX_SOURCE
12787 make an error
12788 #endif
12789   ;
12790   return 0;
12791 }
12792 _ACEOF
12793 rm -f "conftest.$ac_objext"
12794 if { (eval echo "$as_me:12794: \"$ac_compile\"") >&5
12795   (eval $ac_compile) 2>&5
12796   ac_status=$?
12797   echo "$as_me:12797: \$? = $ac_status" >&5
12798   (exit "$ac_status"); } &&
12799          { ac_try='test -s "conftest.$ac_objext"'
12800   { (eval echo "$as_me:12800: \"$ac_try\"") >&5
12801   (eval $ac_try) 2>&5
12802   ac_status=$?
12803   echo "$as_me:12803: \$? = $ac_status" >&5
12804   (exit "$ac_status"); }; }; then
12805   :
12806 else
12807   echo "$as_me: failed program was:" >&5
12808 cat "conftest.$ac_ext" >&5
12809 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12810 fi
12811 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12812          fi
12813
12814 echo "${as_me:-configure}:12814: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12815
12816          CFLAGS="$cf_trim_CFLAGS"
12817          CPPFLAGS="$cf_trim_CPPFLAGS"
12818
12819         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12820         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12821
12822 echo "${as_me:-configure}:12822: testing if the second compile does not leave our definition intact error ..." 1>&5
12823
12824          cat >"conftest.$ac_ext" <<_ACEOF
12825 #line 12825 "configure"
12826 #include "confdefs.h"
12827 #include <sys/types.h>
12828 int
12829 main (void)
12830 {
12831
12832 #ifndef _POSIX_C_SOURCE
12833 make an error
12834 #endif
12835   ;
12836   return 0;
12837 }
12838 _ACEOF
12839 rm -f "conftest.$ac_objext"
12840 if { (eval echo "$as_me:12840: \"$ac_compile\"") >&5
12841   (eval $ac_compile) 2>&5
12842   ac_status=$?
12843   echo "$as_me:12843: \$? = $ac_status" >&5
12844   (exit "$ac_status"); } &&
12845          { ac_try='test -s "conftest.$ac_objext"'
12846   { (eval echo "$as_me:12846: \"$ac_try\"") >&5
12847   (eval $ac_try) 2>&5
12848   ac_status=$?
12849   echo "$as_me:12849: \$? = $ac_status" >&5
12850   (exit "$ac_status"); }; }; then
12851   :
12852 else
12853   echo "$as_me: failed program was:" >&5
12854 cat "conftest.$ac_ext" >&5
12855 cf_cv_posix_c_source=no
12856 fi
12857 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12858          CFLAGS="$cf_save_CFLAGS"
12859          CPPFLAGS="$cf_save_CPPFLAGS"
12860
12861 fi
12862 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12863
12864 fi
12865 echo "$as_me:12865: result: $cf_cv_posix_c_source" >&5
12866 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12867
12868 if test "$cf_cv_posix_c_source" != no ; then
12869         CFLAGS="$cf_trim_CFLAGS"
12870         CPPFLAGS="$cf_trim_CPPFLAGS"
12871
12872 cf_fix_cppflags=no
12873 cf_new_cflags=
12874 cf_new_cppflags=
12875 cf_new_extra_cppflags=
12876
12877 for cf_add_cflags in $cf_cv_posix_c_source
12878 do
12879 case "$cf_fix_cppflags" in
12880 (no)
12881         case "$cf_add_cflags" in
12882         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12883                 case "$cf_add_cflags" in
12884                 (-D*)
12885                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12886
12887                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12888                                 && test -z "${cf_tst_cflags}" \
12889                                 && cf_fix_cppflags=yes
12890
12891                         if test "$cf_fix_cppflags" = yes ; then
12892
12893         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12894         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12895
12896                                 continue
12897                         elif test "${cf_tst_cflags}" = "\"'" ; then
12898
12899         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12900         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12901
12902                                 continue
12903                         fi
12904                         ;;
12905                 esac
12906                 case "$CPPFLAGS" in
12907                 (*$cf_add_cflags)
12908                         ;;
12909                 (*)
12910                         case "$cf_add_cflags" in
12911                         (-D*)
12912                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12913
12914 CPPFLAGS=`echo "$CPPFLAGS" | \
12915         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12916                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12917
12918                                 ;;
12919                         esac
12920
12921         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12922         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12923
12924                         ;;
12925                 esac
12926                 ;;
12927         (*)
12928
12929         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12930         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12931
12932                 ;;
12933         esac
12934         ;;
12935 (yes)
12936
12937         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12938         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12939
12940         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12941
12942         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12943                 && test -z "${cf_tst_cflags}" \
12944                 && cf_fix_cppflags=no
12945         ;;
12946 esac
12947 done
12948
12949 if test -n "$cf_new_cflags" ; then
12950
12951         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12952         CFLAGS="${CFLAGS}$cf_new_cflags"
12953
12954 fi
12955
12956 if test -n "$cf_new_cppflags" ; then
12957
12958         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12959         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12960
12961 fi
12962
12963 if test -n "$cf_new_extra_cppflags" ; then
12964
12965         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12966         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12967
12968 fi
12969
12970 fi
12971
12972 fi # cf_cv_posix_visible
12973
12974         ;;
12975 (netbsd*)
12976         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12977         ;;
12978 (openbsd[6-9]*)
12979         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
12980         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
12981         # Abusing the conformance level is a workaround.
12982         { echo "$as_me:12982: WARNING: this system does not provide usable locale support" >&5
12983 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
12984         cf_xopen_source="-D_BSD_SOURCE"
12985         cf_XOPEN_SOURCE=700
12986         ;;
12987 (openbsd[4-5]*)
12988         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12989         cf_xopen_source="-D_BSD_SOURCE"
12990         cf_XOPEN_SOURCE=600
12991         ;;
12992 (openbsd*)
12993         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12994         ;;
12995 (osf[45]*)
12996         cf_xopen_source="-D_OSF_SOURCE"
12997         ;;
12998 (nto-qnx*)
12999         cf_xopen_source="-D_QNX_SOURCE"
13000         ;;
13001 (sco*)
13002         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13003         ;;
13004 (solaris2.*)
13005         cf_xopen_source="-D__EXTENSIONS__"
13006         cf_cv_xopen_source=broken
13007         ;;
13008 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13009         cf_XOPEN_SOURCE=
13010         cf_POSIX_C_SOURCE=
13011         ;;
13012 (*)
13013
13014 echo "$as_me:13014: checking if we should define _XOPEN_SOURCE" >&5
13015 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13016 if test "${cf_cv_xopen_source+set}" = set; then
13017   echo $ECHO_N "(cached) $ECHO_C" >&6
13018 else
13019
13020         cat >"conftest.$ac_ext" <<_ACEOF
13021 #line 13021 "configure"
13022 #include "confdefs.h"
13023
13024 #include <stdlib.h>
13025 #include <string.h>
13026 #include <sys/types.h>
13027
13028 int
13029 main (void)
13030 {
13031
13032 #ifndef _XOPEN_SOURCE
13033 make an error
13034 #endif
13035   ;
13036   return 0;
13037 }
13038 _ACEOF
13039 rm -f "conftest.$ac_objext"
13040 if { (eval echo "$as_me:13040: \"$ac_compile\"") >&5
13041   (eval $ac_compile) 2>&5
13042   ac_status=$?
13043   echo "$as_me:13043: \$? = $ac_status" >&5
13044   (exit "$ac_status"); } &&
13045          { ac_try='test -s "conftest.$ac_objext"'
13046   { (eval echo "$as_me:13046: \"$ac_try\"") >&5
13047   (eval $ac_try) 2>&5
13048   ac_status=$?
13049   echo "$as_me:13049: \$? = $ac_status" >&5
13050   (exit "$ac_status"); }; }; then
13051   cf_cv_xopen_source=no
13052 else
13053   echo "$as_me: failed program was:" >&5
13054 cat "conftest.$ac_ext" >&5
13055 cf_save="$CPPFLAGS"
13056
13057         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13058         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13059
13060          cat >"conftest.$ac_ext" <<_ACEOF
13061 #line 13061 "configure"
13062 #include "confdefs.h"
13063
13064 #include <stdlib.h>
13065 #include <string.h>
13066 #include <sys/types.h>
13067
13068 int
13069 main (void)
13070 {
13071
13072 #ifdef _XOPEN_SOURCE
13073 make an error
13074 #endif
13075   ;
13076   return 0;
13077 }
13078 _ACEOF
13079 rm -f "conftest.$ac_objext"
13080 if { (eval echo "$as_me:13080: \"$ac_compile\"") >&5
13081   (eval $ac_compile) 2>&5
13082   ac_status=$?
13083   echo "$as_me:13083: \$? = $ac_status" >&5
13084   (exit "$ac_status"); } &&
13085          { ac_try='test -s "conftest.$ac_objext"'
13086   { (eval echo "$as_me:13086: \"$ac_try\"") >&5
13087   (eval $ac_try) 2>&5
13088   ac_status=$?
13089   echo "$as_me:13089: \$? = $ac_status" >&5
13090   (exit "$ac_status"); }; }; then
13091   cf_cv_xopen_source=no
13092 else
13093   echo "$as_me: failed program was:" >&5
13094 cat "conftest.$ac_ext" >&5
13095 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13096 fi
13097 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13098         CPPFLAGS="$cf_save"
13099
13100 fi
13101 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13102
13103 fi
13104 echo "$as_me:13104: result: $cf_cv_xopen_source" >&5
13105 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13106
13107 if test "$cf_cv_xopen_source" != no ; then
13108
13109 CFLAGS=`echo "$CFLAGS" | \
13110         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13111                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13112
13113 CPPFLAGS=`echo "$CPPFLAGS" | \
13114         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13115                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13116
13117         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13118
13119 cf_fix_cppflags=no
13120 cf_new_cflags=
13121 cf_new_cppflags=
13122 cf_new_extra_cppflags=
13123
13124 for cf_add_cflags in $cf_temp_xopen_source
13125 do
13126 case "$cf_fix_cppflags" in
13127 (no)
13128         case "$cf_add_cflags" in
13129         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13130                 case "$cf_add_cflags" in
13131                 (-D*)
13132                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13133
13134                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13135                                 && test -z "${cf_tst_cflags}" \
13136                                 && cf_fix_cppflags=yes
13137
13138                         if test "$cf_fix_cppflags" = yes ; then
13139
13140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13142
13143                                 continue
13144                         elif test "${cf_tst_cflags}" = "\"'" ; then
13145
13146         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13147         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13148
13149                                 continue
13150                         fi
13151                         ;;
13152                 esac
13153                 case "$CPPFLAGS" in
13154                 (*$cf_add_cflags)
13155                         ;;
13156                 (*)
13157                         case "$cf_add_cflags" in
13158                         (-D*)
13159                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13160
13161 CPPFLAGS=`echo "$CPPFLAGS" | \
13162         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13163                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13164
13165                                 ;;
13166                         esac
13167
13168         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13169         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13170
13171                         ;;
13172                 esac
13173                 ;;
13174         (*)
13175
13176         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13177         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13178
13179                 ;;
13180         esac
13181         ;;
13182 (yes)
13183
13184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13186
13187         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13188
13189         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13190                 && test -z "${cf_tst_cflags}" \
13191                 && cf_fix_cppflags=no
13192         ;;
13193 esac
13194 done
13195
13196 if test -n "$cf_new_cflags" ; then
13197
13198         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13199         CFLAGS="${CFLAGS}$cf_new_cflags"
13200
13201 fi
13202
13203 if test -n "$cf_new_cppflags" ; then
13204
13205         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13206         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13207
13208 fi
13209
13210 if test -n "$cf_new_extra_cppflags" ; then
13211
13212         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13213         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13214
13215 fi
13216
13217 fi
13218
13219 if test "$cf_cv_posix_visible" = no; then
13220
13221 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13222
13223 cf_save_CFLAGS="$CFLAGS"
13224 cf_save_CPPFLAGS="$CPPFLAGS"
13225
13226 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13227         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13228                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13229
13230 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13231         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13232                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13233
13234 echo "$as_me:13234: checking if we should define _POSIX_C_SOURCE" >&5
13235 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13236 if test "${cf_cv_posix_c_source+set}" = set; then
13237   echo $ECHO_N "(cached) $ECHO_C" >&6
13238 else
13239
13240 echo "${as_me:-configure}:13240: testing if the symbol is already defined go no further ..." 1>&5
13241
13242         cat >"conftest.$ac_ext" <<_ACEOF
13243 #line 13243 "configure"
13244 #include "confdefs.h"
13245 #include <sys/types.h>
13246 int
13247 main (void)
13248 {
13249
13250 #ifndef _POSIX_C_SOURCE
13251 make an error
13252 #endif
13253   ;
13254   return 0;
13255 }
13256 _ACEOF
13257 rm -f "conftest.$ac_objext"
13258 if { (eval echo "$as_me:13258: \"$ac_compile\"") >&5
13259   (eval $ac_compile) 2>&5
13260   ac_status=$?
13261   echo "$as_me:13261: \$? = $ac_status" >&5
13262   (exit "$ac_status"); } &&
13263          { ac_try='test -s "conftest.$ac_objext"'
13264   { (eval echo "$as_me:13264: \"$ac_try\"") >&5
13265   (eval $ac_try) 2>&5
13266   ac_status=$?
13267   echo "$as_me:13267: \$? = $ac_status" >&5
13268   (exit "$ac_status"); }; }; then
13269   cf_cv_posix_c_source=no
13270 else
13271   echo "$as_me: failed program was:" >&5
13272 cat "conftest.$ac_ext" >&5
13273 cf_want_posix_source=no
13274          case .$cf_POSIX_C_SOURCE in
13275          (.[12]??*)
13276                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13277                 ;;
13278          (.2)
13279                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13280                 cf_want_posix_source=yes
13281                 ;;
13282          (.*)
13283                 cf_want_posix_source=yes
13284                 ;;
13285          esac
13286          if test "$cf_want_posix_source" = yes ; then
13287                 cat >"conftest.$ac_ext" <<_ACEOF
13288 #line 13288 "configure"
13289 #include "confdefs.h"
13290 #include <sys/types.h>
13291 int
13292 main (void)
13293 {
13294
13295 #ifdef _POSIX_SOURCE
13296 make an error
13297 #endif
13298   ;
13299   return 0;
13300 }
13301 _ACEOF
13302 rm -f "conftest.$ac_objext"
13303 if { (eval echo "$as_me:13303: \"$ac_compile\"") >&5
13304   (eval $ac_compile) 2>&5
13305   ac_status=$?
13306   echo "$as_me:13306: \$? = $ac_status" >&5
13307   (exit "$ac_status"); } &&
13308          { ac_try='test -s "conftest.$ac_objext"'
13309   { (eval echo "$as_me:13309: \"$ac_try\"") >&5
13310   (eval $ac_try) 2>&5
13311   ac_status=$?
13312   echo "$as_me:13312: \$? = $ac_status" >&5
13313   (exit "$ac_status"); }; }; then
13314   :
13315 else
13316   echo "$as_me: failed program was:" >&5
13317 cat "conftest.$ac_ext" >&5
13318 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13319 fi
13320 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13321          fi
13322
13323 echo "${as_me:-configure}:13323: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13324
13325          CFLAGS="$cf_trim_CFLAGS"
13326          CPPFLAGS="$cf_trim_CPPFLAGS"
13327
13328         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13329         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13330
13331 echo "${as_me:-configure}:13331: testing if the second compile does not leave our definition intact error ..." 1>&5
13332
13333          cat >"conftest.$ac_ext" <<_ACEOF
13334 #line 13334 "configure"
13335 #include "confdefs.h"
13336 #include <sys/types.h>
13337 int
13338 main (void)
13339 {
13340
13341 #ifndef _POSIX_C_SOURCE
13342 make an error
13343 #endif
13344   ;
13345   return 0;
13346 }
13347 _ACEOF
13348 rm -f "conftest.$ac_objext"
13349 if { (eval echo "$as_me:13349: \"$ac_compile\"") >&5
13350   (eval $ac_compile) 2>&5
13351   ac_status=$?
13352   echo "$as_me:13352: \$? = $ac_status" >&5
13353   (exit "$ac_status"); } &&
13354          { ac_try='test -s "conftest.$ac_objext"'
13355   { (eval echo "$as_me:13355: \"$ac_try\"") >&5
13356   (eval $ac_try) 2>&5
13357   ac_status=$?
13358   echo "$as_me:13358: \$? = $ac_status" >&5
13359   (exit "$ac_status"); }; }; then
13360   :
13361 else
13362   echo "$as_me: failed program was:" >&5
13363 cat "conftest.$ac_ext" >&5
13364 cf_cv_posix_c_source=no
13365 fi
13366 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13367          CFLAGS="$cf_save_CFLAGS"
13368          CPPFLAGS="$cf_save_CPPFLAGS"
13369
13370 fi
13371 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13372
13373 fi
13374 echo "$as_me:13374: result: $cf_cv_posix_c_source" >&5
13375 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13376
13377 if test "$cf_cv_posix_c_source" != no ; then
13378         CFLAGS="$cf_trim_CFLAGS"
13379         CPPFLAGS="$cf_trim_CPPFLAGS"
13380
13381 cf_fix_cppflags=no
13382 cf_new_cflags=
13383 cf_new_cppflags=
13384 cf_new_extra_cppflags=
13385
13386 for cf_add_cflags in $cf_cv_posix_c_source
13387 do
13388 case "$cf_fix_cppflags" in
13389 (no)
13390         case "$cf_add_cflags" in
13391         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13392                 case "$cf_add_cflags" in
13393                 (-D*)
13394                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13395
13396                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13397                                 && test -z "${cf_tst_cflags}" \
13398                                 && cf_fix_cppflags=yes
13399
13400                         if test "$cf_fix_cppflags" = yes ; then
13401
13402         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13403         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13404
13405                                 continue
13406                         elif test "${cf_tst_cflags}" = "\"'" ; then
13407
13408         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13409         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13410
13411                                 continue
13412                         fi
13413                         ;;
13414                 esac
13415                 case "$CPPFLAGS" in
13416                 (*$cf_add_cflags)
13417                         ;;
13418                 (*)
13419                         case "$cf_add_cflags" in
13420                         (-D*)
13421                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13422
13423 CPPFLAGS=`echo "$CPPFLAGS" | \
13424         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13425                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13426
13427                                 ;;
13428                         esac
13429
13430         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13431         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13432
13433                         ;;
13434                 esac
13435                 ;;
13436         (*)
13437
13438         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13439         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13440
13441                 ;;
13442         esac
13443         ;;
13444 (yes)
13445
13446         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13447         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13448
13449         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13450
13451         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13452                 && test -z "${cf_tst_cflags}" \
13453                 && cf_fix_cppflags=no
13454         ;;
13455 esac
13456 done
13457
13458 if test -n "$cf_new_cflags" ; then
13459
13460         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13461         CFLAGS="${CFLAGS}$cf_new_cflags"
13462
13463 fi
13464
13465 if test -n "$cf_new_cppflags" ; then
13466
13467         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13468         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13469
13470 fi
13471
13472 if test -n "$cf_new_extra_cppflags" ; then
13473
13474         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13475         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13476
13477 fi
13478
13479 fi
13480
13481 fi # cf_cv_posix_visible
13482
13483         ;;
13484 esac
13485
13486 if test -n "$cf_xopen_source" ; then
13487
13488 cf_fix_cppflags=no
13489 cf_new_cflags=
13490 cf_new_cppflags=
13491 cf_new_extra_cppflags=
13492
13493 for cf_add_cflags in $cf_xopen_source
13494 do
13495 case "$cf_fix_cppflags" in
13496 (no)
13497         case "$cf_add_cflags" in
13498         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13499                 case "$cf_add_cflags" in
13500                 (-D*)
13501                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13502
13503                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13504                                 && test -z "${cf_tst_cflags}" \
13505                                 && cf_fix_cppflags=yes
13506
13507                         if test "$cf_fix_cppflags" = yes ; then
13508
13509         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13510         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13511
13512                                 continue
13513                         elif test "${cf_tst_cflags}" = "\"'" ; then
13514
13515         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13516         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13517
13518                                 continue
13519                         fi
13520                         ;;
13521                 esac
13522                 case "$CPPFLAGS" in
13523                 (*$cf_add_cflags)
13524                         ;;
13525                 (*)
13526                         case "$cf_add_cflags" in
13527                         (-D*)
13528                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13529
13530 CPPFLAGS=`echo "$CPPFLAGS" | \
13531         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13532                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13533
13534                                 ;;
13535                         esac
13536
13537         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13538         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13539
13540                         ;;
13541                 esac
13542                 ;;
13543         (*)
13544
13545         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13546         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13547
13548                 ;;
13549         esac
13550         ;;
13551 (yes)
13552
13553         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13554         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13555
13556         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13557
13558         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13559                 && test -z "${cf_tst_cflags}" \
13560                 && cf_fix_cppflags=no
13561         ;;
13562 esac
13563 done
13564
13565 if test -n "$cf_new_cflags" ; then
13566         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13567
13568 echo "${as_me:-configure}:13568: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13569
13570         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13571         CFLAGS="${CFLAGS}$cf_new_cflags"
13572
13573 fi
13574
13575 if test -n "$cf_new_cppflags" ; then
13576         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13577
13578 echo "${as_me:-configure}:13578: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13579
13580         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13581         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13582
13583 fi
13584
13585 if test -n "$cf_new_extra_cppflags" ; then
13586         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13587
13588 echo "${as_me:-configure}:13588: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13589
13590         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13591         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13592
13593 fi
13594
13595 fi
13596
13597 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13598         echo "$as_me:13598: checking if _XOPEN_SOURCE really is set" >&5
13599 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13600         cat >"conftest.$ac_ext" <<_ACEOF
13601 #line 13601 "configure"
13602 #include "confdefs.h"
13603 #include <stdlib.h>
13604 int
13605 main (void)
13606 {
13607
13608 #ifndef _XOPEN_SOURCE
13609 make an error
13610 #endif
13611   ;
13612   return 0;
13613 }
13614 _ACEOF
13615 rm -f "conftest.$ac_objext"
13616 if { (eval echo "$as_me:13616: \"$ac_compile\"") >&5
13617   (eval $ac_compile) 2>&5
13618   ac_status=$?
13619   echo "$as_me:13619: \$? = $ac_status" >&5
13620   (exit "$ac_status"); } &&
13621          { ac_try='test -s "conftest.$ac_objext"'
13622   { (eval echo "$as_me:13622: \"$ac_try\"") >&5
13623   (eval $ac_try) 2>&5
13624   ac_status=$?
13625   echo "$as_me:13625: \$? = $ac_status" >&5
13626   (exit "$ac_status"); }; }; then
13627   cf_XOPEN_SOURCE_set=yes
13628 else
13629   echo "$as_me: failed program was:" >&5
13630 cat "conftest.$ac_ext" >&5
13631 cf_XOPEN_SOURCE_set=no
13632 fi
13633 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13634         echo "$as_me:13634: result: $cf_XOPEN_SOURCE_set" >&5
13635 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13636         if test "$cf_XOPEN_SOURCE_set" = yes
13637         then
13638                 cat >"conftest.$ac_ext" <<_ACEOF
13639 #line 13639 "configure"
13640 #include "confdefs.h"
13641 #include <stdlib.h>
13642 int
13643 main (void)
13644 {
13645
13646 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13647 make an error
13648 #endif
13649   ;
13650   return 0;
13651 }
13652 _ACEOF
13653 rm -f "conftest.$ac_objext"
13654 if { (eval echo "$as_me:13654: \"$ac_compile\"") >&5
13655   (eval $ac_compile) 2>&5
13656   ac_status=$?
13657   echo "$as_me:13657: \$? = $ac_status" >&5
13658   (exit "$ac_status"); } &&
13659          { ac_try='test -s "conftest.$ac_objext"'
13660   { (eval echo "$as_me:13660: \"$ac_try\"") >&5
13661   (eval $ac_try) 2>&5
13662   ac_status=$?
13663   echo "$as_me:13663: \$? = $ac_status" >&5
13664   (exit "$ac_status"); }; }; then
13665   cf_XOPEN_SOURCE_set_ok=yes
13666 else
13667   echo "$as_me: failed program was:" >&5
13668 cat "conftest.$ac_ext" >&5
13669 cf_XOPEN_SOURCE_set_ok=no
13670 fi
13671 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13672                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13673                 then
13674                         { echo "$as_me:13674: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13675 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13676                 fi
13677         else
13678
13679 echo "$as_me:13679: checking if we should define _XOPEN_SOURCE" >&5
13680 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13681 if test "${cf_cv_xopen_source+set}" = set; then
13682   echo $ECHO_N "(cached) $ECHO_C" >&6
13683 else
13684
13685         cat >"conftest.$ac_ext" <<_ACEOF
13686 #line 13686 "configure"
13687 #include "confdefs.h"
13688
13689 #include <stdlib.h>
13690 #include <string.h>
13691 #include <sys/types.h>
13692
13693 int
13694 main (void)
13695 {
13696
13697 #ifndef _XOPEN_SOURCE
13698 make an error
13699 #endif
13700   ;
13701   return 0;
13702 }
13703 _ACEOF
13704 rm -f "conftest.$ac_objext"
13705 if { (eval echo "$as_me:13705: \"$ac_compile\"") >&5
13706   (eval $ac_compile) 2>&5
13707   ac_status=$?
13708   echo "$as_me:13708: \$? = $ac_status" >&5
13709   (exit "$ac_status"); } &&
13710          { ac_try='test -s "conftest.$ac_objext"'
13711   { (eval echo "$as_me:13711: \"$ac_try\"") >&5
13712   (eval $ac_try) 2>&5
13713   ac_status=$?
13714   echo "$as_me:13714: \$? = $ac_status" >&5
13715   (exit "$ac_status"); }; }; then
13716   cf_cv_xopen_source=no
13717 else
13718   echo "$as_me: failed program was:" >&5
13719 cat "conftest.$ac_ext" >&5
13720 cf_save="$CPPFLAGS"
13721
13722         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13723         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13724
13725          cat >"conftest.$ac_ext" <<_ACEOF
13726 #line 13726 "configure"
13727 #include "confdefs.h"
13728
13729 #include <stdlib.h>
13730 #include <string.h>
13731 #include <sys/types.h>
13732
13733 int
13734 main (void)
13735 {
13736
13737 #ifdef _XOPEN_SOURCE
13738 make an error
13739 #endif
13740   ;
13741   return 0;
13742 }
13743 _ACEOF
13744 rm -f "conftest.$ac_objext"
13745 if { (eval echo "$as_me:13745: \"$ac_compile\"") >&5
13746   (eval $ac_compile) 2>&5
13747   ac_status=$?
13748   echo "$as_me:13748: \$? = $ac_status" >&5
13749   (exit "$ac_status"); } &&
13750          { ac_try='test -s "conftest.$ac_objext"'
13751   { (eval echo "$as_me:13751: \"$ac_try\"") >&5
13752   (eval $ac_try) 2>&5
13753   ac_status=$?
13754   echo "$as_me:13754: \$? = $ac_status" >&5
13755   (exit "$ac_status"); }; }; then
13756   cf_cv_xopen_source=no
13757 else
13758   echo "$as_me: failed program was:" >&5
13759 cat "conftest.$ac_ext" >&5
13760 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13761 fi
13762 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13763         CPPFLAGS="$cf_save"
13764
13765 fi
13766 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13767
13768 fi
13769 echo "$as_me:13769: result: $cf_cv_xopen_source" >&5
13770 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13771
13772 if test "$cf_cv_xopen_source" != no ; then
13773
13774 CFLAGS=`echo "$CFLAGS" | \
13775         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13776                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13777
13778 CPPFLAGS=`echo "$CPPFLAGS" | \
13779         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13780                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13781
13782         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13783
13784 cf_fix_cppflags=no
13785 cf_new_cflags=
13786 cf_new_cppflags=
13787 cf_new_extra_cppflags=
13788
13789 for cf_add_cflags in $cf_temp_xopen_source
13790 do
13791 case "$cf_fix_cppflags" in
13792 (no)
13793         case "$cf_add_cflags" in
13794         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13795                 case "$cf_add_cflags" in
13796                 (-D*)
13797                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13798
13799                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13800                                 && test -z "${cf_tst_cflags}" \
13801                                 && cf_fix_cppflags=yes
13802
13803                         if test "$cf_fix_cppflags" = yes ; then
13804
13805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13807
13808                                 continue
13809                         elif test "${cf_tst_cflags}" = "\"'" ; then
13810
13811         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13812         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13813
13814                                 continue
13815                         fi
13816                         ;;
13817                 esac
13818                 case "$CPPFLAGS" in
13819                 (*$cf_add_cflags)
13820                         ;;
13821                 (*)
13822                         case "$cf_add_cflags" in
13823                         (-D*)
13824                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13825
13826 CPPFLAGS=`echo "$CPPFLAGS" | \
13827         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13828                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13829
13830                                 ;;
13831                         esac
13832
13833         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13834         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13835
13836                         ;;
13837                 esac
13838                 ;;
13839         (*)
13840
13841         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13842         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13843
13844                 ;;
13845         esac
13846         ;;
13847 (yes)
13848
13849         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13850         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13851
13852         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13853
13854         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13855                 && test -z "${cf_tst_cflags}" \
13856                 && cf_fix_cppflags=no
13857         ;;
13858 esac
13859 done
13860
13861 if test -n "$cf_new_cflags" ; then
13862
13863         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13864         CFLAGS="${CFLAGS}$cf_new_cflags"
13865
13866 fi
13867
13868 if test -n "$cf_new_cppflags" ; then
13869
13870         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13871         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13872
13873 fi
13874
13875 if test -n "$cf_new_extra_cppflags" ; then
13876
13877         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13878         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13879
13880 fi
13881
13882 fi
13883
13884         fi
13885 fi
13886 fi # cf_cv_posix_visible
13887
13888 # Check whether --enable-largefile or --disable-largefile was given.
13889 if test "${enable_largefile+set}" = set; then
13890   enableval="$enable_largefile"
13891
13892 fi;
13893 if test "$enable_largefile" != no; then
13894
13895   echo "$as_me:13895: checking for special C compiler options needed for large files" >&5
13896 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13897 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13898   echo $ECHO_N "(cached) $ECHO_C" >&6
13899 else
13900   ac_cv_sys_largefile_CC=no
13901      if test "$GCC" != yes; then
13902        ac_save_CC=$CC
13903        while :; do
13904          # IRIX 6.2 and later do not support large files by default,
13905          # so use the C compiler's -n32 option if that helps.
13906          cat >"conftest.$ac_ext" <<_ACEOF
13907 #line 13907 "configure"
13908 #include "confdefs.h"
13909 #include <sys/types.h>
13910  /* Check that off_t can represent 2**63 - 1 correctly.
13911     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13912     since some C++ compilers masquerading as C compilers
13913     incorrectly reject 9223372036854775807.  */
13914 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13915   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13916                        && LARGE_OFF_T % 2147483647 == 1)
13917                       ? 1 : -1];
13918 int
13919 main (void)
13920 {
13921
13922   ;
13923   return 0;
13924 }
13925 _ACEOF
13926          rm -f "conftest.$ac_objext"
13927 if { (eval echo "$as_me:13927: \"$ac_compile\"") >&5
13928   (eval $ac_compile) 2>&5
13929   ac_status=$?
13930   echo "$as_me:13930: \$? = $ac_status" >&5
13931   (exit "$ac_status"); } &&
13932          { ac_try='test -s "conftest.$ac_objext"'
13933   { (eval echo "$as_me:13933: \"$ac_try\"") >&5
13934   (eval $ac_try) 2>&5
13935   ac_status=$?
13936   echo "$as_me:13936: \$? = $ac_status" >&5
13937   (exit "$ac_status"); }; }; then
13938   break
13939 else
13940   echo "$as_me: failed program was:" >&5
13941 cat "conftest.$ac_ext" >&5
13942 fi
13943 rm -f "conftest.$ac_objext"
13944          CC="$CC -n32"
13945          rm -f "conftest.$ac_objext"
13946 if { (eval echo "$as_me:13946: \"$ac_compile\"") >&5
13947   (eval $ac_compile) 2>&5
13948   ac_status=$?
13949   echo "$as_me:13949: \$? = $ac_status" >&5
13950   (exit "$ac_status"); } &&
13951          { ac_try='test -s "conftest.$ac_objext"'
13952   { (eval echo "$as_me:13952: \"$ac_try\"") >&5
13953   (eval $ac_try) 2>&5
13954   ac_status=$?
13955   echo "$as_me:13955: \$? = $ac_status" >&5
13956   (exit "$ac_status"); }; }; then
13957   ac_cv_sys_largefile_CC=' -n32'; break
13958 else
13959   echo "$as_me: failed program was:" >&5
13960 cat "conftest.$ac_ext" >&5
13961 fi
13962 rm -f "conftest.$ac_objext"
13963          break
13964        done
13965        CC=$ac_save_CC
13966        rm -f "conftest.$ac_ext"
13967     fi
13968 fi
13969 echo "$as_me:13969: result: $ac_cv_sys_largefile_CC" >&5
13970 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13971   if test "$ac_cv_sys_largefile_CC" != no; then
13972     CC=$CC$ac_cv_sys_largefile_CC
13973   fi
13974
13975   echo "$as_me:13975: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13976 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13977 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13978   echo $ECHO_N "(cached) $ECHO_C" >&6
13979 else
13980   while :; do
13981   ac_cv_sys_file_offset_bits=no
13982   cat >"conftest.$ac_ext" <<_ACEOF
13983 #line 13983 "configure"
13984 #include "confdefs.h"
13985 #include <sys/types.h>
13986  /* Check that off_t can represent 2**63 - 1 correctly.
13987     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13988     since some C++ compilers masquerading as C compilers
13989     incorrectly reject 9223372036854775807.  */
13990 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13991   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13992                        && LARGE_OFF_T % 2147483647 == 1)
13993                       ? 1 : -1];
13994 int
13995 main (void)
13996 {
13997
13998   ;
13999   return 0;
14000 }
14001 _ACEOF
14002 rm -f "conftest.$ac_objext"
14003 if { (eval echo "$as_me:14003: \"$ac_compile\"") >&5
14004   (eval $ac_compile) 2>&5
14005   ac_status=$?
14006   echo "$as_me:14006: \$? = $ac_status" >&5
14007   (exit "$ac_status"); } &&
14008          { ac_try='test -s "conftest.$ac_objext"'
14009   { (eval echo "$as_me:14009: \"$ac_try\"") >&5
14010   (eval $ac_try) 2>&5
14011   ac_status=$?
14012   echo "$as_me:14012: \$? = $ac_status" >&5
14013   (exit "$ac_status"); }; }; then
14014   break
14015 else
14016   echo "$as_me: failed program was:" >&5
14017 cat "conftest.$ac_ext" >&5
14018 fi
14019 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14020   cat >"conftest.$ac_ext" <<_ACEOF
14021 #line 14021 "configure"
14022 #include "confdefs.h"
14023 #define _FILE_OFFSET_BITS 64
14024 #include <sys/types.h>
14025  /* Check that off_t can represent 2**63 - 1 correctly.
14026     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14027     since some C++ compilers masquerading as C compilers
14028     incorrectly reject 9223372036854775807.  */
14029 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14030   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14031                        && LARGE_OFF_T % 2147483647 == 1)
14032                       ? 1 : -1];
14033 int
14034 main (void)
14035 {
14036
14037   ;
14038   return 0;
14039 }
14040 _ACEOF
14041 rm -f "conftest.$ac_objext"
14042 if { (eval echo "$as_me:14042: \"$ac_compile\"") >&5
14043   (eval $ac_compile) 2>&5
14044   ac_status=$?
14045   echo "$as_me:14045: \$? = $ac_status" >&5
14046   (exit "$ac_status"); } &&
14047          { ac_try='test -s "conftest.$ac_objext"'
14048   { (eval echo "$as_me:14048: \"$ac_try\"") >&5
14049   (eval $ac_try) 2>&5
14050   ac_status=$?
14051   echo "$as_me:14051: \$? = $ac_status" >&5
14052   (exit "$ac_status"); }; }; then
14053   ac_cv_sys_file_offset_bits=64; break
14054 else
14055   echo "$as_me: failed program was:" >&5
14056 cat "conftest.$ac_ext" >&5
14057 fi
14058 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14059   break
14060 done
14061 fi
14062 echo "$as_me:14062: result: $ac_cv_sys_file_offset_bits" >&5
14063 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14064 if test "$ac_cv_sys_file_offset_bits" != no; then
14065
14066 cat >>confdefs.h <<EOF
14067 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14068 EOF
14069
14070 fi
14071 rm -rf conftest*
14072   echo "$as_me:14072: checking for _LARGE_FILES value needed for large files" >&5
14073 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14074 if test "${ac_cv_sys_large_files+set}" = set; then
14075   echo $ECHO_N "(cached) $ECHO_C" >&6
14076 else
14077   while :; do
14078   ac_cv_sys_large_files=no
14079   cat >"conftest.$ac_ext" <<_ACEOF
14080 #line 14080 "configure"
14081 #include "confdefs.h"
14082 #include <sys/types.h>
14083  /* Check that off_t can represent 2**63 - 1 correctly.
14084     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14085     since some C++ compilers masquerading as C compilers
14086     incorrectly reject 9223372036854775807.  */
14087 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14088   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14089                        && LARGE_OFF_T % 2147483647 == 1)
14090                       ? 1 : -1];
14091 int
14092 main (void)
14093 {
14094
14095   ;
14096   return 0;
14097 }
14098 _ACEOF
14099 rm -f "conftest.$ac_objext"
14100 if { (eval echo "$as_me:14100: \"$ac_compile\"") >&5
14101   (eval $ac_compile) 2>&5
14102   ac_status=$?
14103   echo "$as_me:14103: \$? = $ac_status" >&5
14104   (exit "$ac_status"); } &&
14105          { ac_try='test -s "conftest.$ac_objext"'
14106   { (eval echo "$as_me:14106: \"$ac_try\"") >&5
14107   (eval $ac_try) 2>&5
14108   ac_status=$?
14109   echo "$as_me:14109: \$? = $ac_status" >&5
14110   (exit "$ac_status"); }; }; then
14111   break
14112 else
14113   echo "$as_me: failed program was:" >&5
14114 cat "conftest.$ac_ext" >&5
14115 fi
14116 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14117   cat >"conftest.$ac_ext" <<_ACEOF
14118 #line 14118 "configure"
14119 #include "confdefs.h"
14120 #define _LARGE_FILES 1
14121 #include <sys/types.h>
14122  /* Check that off_t can represent 2**63 - 1 correctly.
14123     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14124     since some C++ compilers masquerading as C compilers
14125     incorrectly reject 9223372036854775807.  */
14126 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14127   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14128                        && LARGE_OFF_T % 2147483647 == 1)
14129                       ? 1 : -1];
14130 int
14131 main (void)
14132 {
14133
14134   ;
14135   return 0;
14136 }
14137 _ACEOF
14138 rm -f "conftest.$ac_objext"
14139 if { (eval echo "$as_me:14139: \"$ac_compile\"") >&5
14140   (eval $ac_compile) 2>&5
14141   ac_status=$?
14142   echo "$as_me:14142: \$? = $ac_status" >&5
14143   (exit "$ac_status"); } &&
14144          { ac_try='test -s "conftest.$ac_objext"'
14145   { (eval echo "$as_me:14145: \"$ac_try\"") >&5
14146   (eval $ac_try) 2>&5
14147   ac_status=$?
14148   echo "$as_me:14148: \$? = $ac_status" >&5
14149   (exit "$ac_status"); }; }; then
14150   ac_cv_sys_large_files=1; break
14151 else
14152   echo "$as_me: failed program was:" >&5
14153 cat "conftest.$ac_ext" >&5
14154 fi
14155 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14156   break
14157 done
14158 fi
14159 echo "$as_me:14159: result: $ac_cv_sys_large_files" >&5
14160 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14161 if test "$ac_cv_sys_large_files" != no; then
14162
14163 cat >>confdefs.h <<EOF
14164 #define _LARGE_FILES $ac_cv_sys_large_files
14165 EOF
14166
14167 fi
14168 rm -rf conftest*
14169 fi
14170
14171         if test "$enable_largefile" != no ; then
14172         echo "$as_me:14172: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14173 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14174 if test "${ac_cv_sys_largefile_source+set}" = set; then
14175   echo $ECHO_N "(cached) $ECHO_C" >&6
14176 else
14177   while :; do
14178   ac_cv_sys_largefile_source=no
14179   cat >"conftest.$ac_ext" <<_ACEOF
14180 #line 14180 "configure"
14181 #include "confdefs.h"
14182 #include <stdio.h>
14183 int
14184 main (void)
14185 {
14186 return !fseeko;
14187   ;
14188   return 0;
14189 }
14190 _ACEOF
14191 rm -f "conftest.$ac_objext"
14192 if { (eval echo "$as_me:14192: \"$ac_compile\"") >&5
14193   (eval $ac_compile) 2>&5
14194   ac_status=$?
14195   echo "$as_me:14195: \$? = $ac_status" >&5
14196   (exit "$ac_status"); } &&
14197          { ac_try='test -s "conftest.$ac_objext"'
14198   { (eval echo "$as_me:14198: \"$ac_try\"") >&5
14199   (eval $ac_try) 2>&5
14200   ac_status=$?
14201   echo "$as_me:14201: \$? = $ac_status" >&5
14202   (exit "$ac_status"); }; }; then
14203   break
14204 else
14205   echo "$as_me: failed program was:" >&5
14206 cat "conftest.$ac_ext" >&5
14207 fi
14208 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14209   cat >"conftest.$ac_ext" <<_ACEOF
14210 #line 14210 "configure"
14211 #include "confdefs.h"
14212 #define _LARGEFILE_SOURCE 1
14213 #include <stdio.h>
14214 int
14215 main (void)
14216 {
14217 return !fseeko;
14218   ;
14219   return 0;
14220 }
14221 _ACEOF
14222 rm -f "conftest.$ac_objext"
14223 if { (eval echo "$as_me:14223: \"$ac_compile\"") >&5
14224   (eval $ac_compile) 2>&5
14225   ac_status=$?
14226   echo "$as_me:14226: \$? = $ac_status" >&5
14227   (exit "$ac_status"); } &&
14228          { ac_try='test -s "conftest.$ac_objext"'
14229   { (eval echo "$as_me:14229: \"$ac_try\"") >&5
14230   (eval $ac_try) 2>&5
14231   ac_status=$?
14232   echo "$as_me:14232: \$? = $ac_status" >&5
14233   (exit "$ac_status"); }; }; then
14234   ac_cv_sys_largefile_source=1; break
14235 else
14236   echo "$as_me: failed program was:" >&5
14237 cat "conftest.$ac_ext" >&5
14238 fi
14239 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14240   break
14241 done
14242 fi
14243 echo "$as_me:14243: result: $ac_cv_sys_largefile_source" >&5
14244 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14245 if test "$ac_cv_sys_largefile_source" != no; then
14246
14247 cat >>confdefs.h <<EOF
14248 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14249 EOF
14250
14251 fi
14252 rm -rf conftest*
14253
14254 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14255 # in glibc 2.1.3, but that breaks too many other things.
14256 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14257 echo "$as_me:14257: checking for fseeko" >&5
14258 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14259 if test "${ac_cv_func_fseeko+set}" = set; then
14260   echo $ECHO_N "(cached) $ECHO_C" >&6
14261 else
14262   cat >"conftest.$ac_ext" <<_ACEOF
14263 #line 14263 "configure"
14264 #include "confdefs.h"
14265 #include <stdio.h>
14266 int
14267 main (void)
14268 {
14269 return fseeko && fseeko (stdin, 0, 0);
14270   ;
14271   return 0;
14272 }
14273 _ACEOF
14274 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14275 if { (eval echo "$as_me:14275: \"$ac_link\"") >&5
14276   (eval $ac_link) 2>&5
14277   ac_status=$?
14278   echo "$as_me:14278: \$? = $ac_status" >&5
14279   (exit "$ac_status"); } &&
14280          { ac_try='test -s "conftest$ac_exeext"'
14281   { (eval echo "$as_me:14281: \"$ac_try\"") >&5
14282   (eval $ac_try) 2>&5
14283   ac_status=$?
14284   echo "$as_me:14284: \$? = $ac_status" >&5
14285   (exit "$ac_status"); }; }; then
14286   ac_cv_func_fseeko=yes
14287 else
14288   echo "$as_me: failed program was:" >&5
14289 cat "conftest.$ac_ext" >&5
14290 ac_cv_func_fseeko=no
14291 fi
14292 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14293 fi
14294 echo "$as_me:14294: result: $ac_cv_func_fseeko" >&5
14295 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14296 if test $ac_cv_func_fseeko = yes; then
14297
14298 cat >>confdefs.h <<\EOF
14299 #define HAVE_FSEEKO 1
14300 EOF
14301
14302 fi
14303
14304         # Normally we would collect these definitions in the config.h,
14305         # but (like _XOPEN_SOURCE), some environments rely on having these
14306         # defined before any of the system headers are included.  Another
14307         # case comes up with C++, e.g., on AIX the compiler compiles the
14308         # header files by themselves before looking at the body files it is
14309         # told to compile.  For ncurses, those header files do not include
14310         # the config.h
14311         if test "$ac_cv_sys_large_files" != no
14312         then
14313
14314         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14315         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14316
14317         fi
14318         if test "$ac_cv_sys_largefile_source" != no
14319         then
14320
14321         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14322         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14323
14324         fi
14325         if test "$ac_cv_sys_file_offset_bits" != no
14326         then
14327
14328         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14329         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14330
14331         fi
14332
14333         echo "$as_me:14333: checking whether to use struct dirent64" >&5
14334 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14335 if test "${cf_cv_struct_dirent64+set}" = set; then
14336   echo $ECHO_N "(cached) $ECHO_C" >&6
14337 else
14338
14339                 cat >"conftest.$ac_ext" <<_ACEOF
14340 #line 14340 "configure"
14341 #include "confdefs.h"
14342
14343 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14344 #include <sys/types.h>
14345 #include <dirent.h>
14346
14347 int
14348 main (void)
14349 {
14350
14351                 /* if transitional largefile support is setup, this is true */
14352                 extern struct dirent64 * readdir(DIR *);
14353                 struct dirent64 *x = readdir((DIR *)0);
14354                 struct dirent *y = readdir((DIR *)0);
14355                 int z = x - y;
14356                 (void)z;
14357
14358   ;
14359   return 0;
14360 }
14361 _ACEOF
14362 rm -f "conftest.$ac_objext"
14363 if { (eval echo "$as_me:14363: \"$ac_compile\"") >&5
14364   (eval $ac_compile) 2>&5
14365   ac_status=$?
14366   echo "$as_me:14366: \$? = $ac_status" >&5
14367   (exit "$ac_status"); } &&
14368          { ac_try='test -s "conftest.$ac_objext"'
14369   { (eval echo "$as_me:14369: \"$ac_try\"") >&5
14370   (eval $ac_try) 2>&5
14371   ac_status=$?
14372   echo "$as_me:14372: \$? = $ac_status" >&5
14373   (exit "$ac_status"); }; }; then
14374   cf_cv_struct_dirent64=yes
14375 else
14376   echo "$as_me: failed program was:" >&5
14377 cat "conftest.$ac_ext" >&5
14378 cf_cv_struct_dirent64=no
14379 fi
14380 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14381
14382 fi
14383 echo "$as_me:14383: result: $cf_cv_struct_dirent64" >&5
14384 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14385         test "$cf_cv_struct_dirent64" = yes &&
14386 cat >>confdefs.h <<\EOF
14387 #define HAVE_STRUCT_DIRENT64 1
14388 EOF
14389
14390         fi
14391
14392 ### Enable compiling-in rcs id's
14393 echo "$as_me:14393: checking if RCS identifiers should be compiled-in" >&5
14394 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14395
14396 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14397 if test "${with_rcs_ids+set}" = set; then
14398   withval="$with_rcs_ids"
14399   with_rcs_ids=$withval
14400 else
14401   with_rcs_ids=no
14402 fi;
14403 echo "$as_me:14403: result: $with_rcs_ids" >&5
14404 echo "${ECHO_T}$with_rcs_ids" >&6
14405 test "$with_rcs_ids" = yes &&
14406 cat >>confdefs.h <<\EOF
14407 #define USE_RCS_IDS 1
14408 EOF
14409
14410 ###############################################################################
14411
14412 ### Note that some functions (such as const) are normally disabled anyway.
14413 echo "$as_me:14413: checking if you want to build with function extensions" >&5
14414 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14415
14416 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14417 if test "${enable_ext_funcs+set}" = set; then
14418   enableval="$enable_ext_funcs"
14419   with_ext_funcs=$enableval
14420 else
14421   with_ext_funcs=yes
14422 fi;
14423 echo "$as_me:14423: result: $with_ext_funcs" >&5
14424 echo "${ECHO_T}$with_ext_funcs" >&6
14425 if test "$with_ext_funcs" = yes ; then
14426         NCURSES_EXT_FUNCS=1
14427
14428 cat >>confdefs.h <<\EOF
14429 #define HAVE_USE_DEFAULT_COLORS 1
14430 EOF
14431
14432 cat >>confdefs.h <<\EOF
14433 #define NCURSES_EXT_FUNCS 1
14434 EOF
14435
14436 else
14437         NCURSES_EXT_FUNCS=0
14438 fi
14439
14440 ###   use option --enable-const to turn on use of const beyond that in XSI.
14441 echo "$as_me:14441: checking for extended use of const keyword" >&5
14442 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14443
14444 # Check whether --enable-const or --disable-const was given.
14445 if test "${enable_const+set}" = set; then
14446   enableval="$enable_const"
14447   with_ext_const=$enableval
14448 else
14449   with_ext_const=no
14450 fi;
14451 echo "$as_me:14451: result: $with_ext_const" >&5
14452 echo "${ECHO_T}$with_ext_const" >&6
14453 NCURSES_CONST='/*nothing*/'
14454 if test "$with_ext_const" = yes ; then
14455         NCURSES_CONST=const
14456 fi
14457
14458 ###############################################################################
14459 # These options are relatively safe to experiment with.
14460
14461 echo "$as_me:14461: checking if you want all development code" >&5
14462 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14463
14464 # Check whether --with-develop or --without-develop was given.
14465 if test "${with_develop+set}" = set; then
14466   withval="$with_develop"
14467   with_develop=$withval
14468 else
14469   with_develop=no
14470 fi;
14471 echo "$as_me:14471: result: $with_develop" >&5
14472 echo "${ECHO_T}$with_develop" >&6
14473
14474 ###############################################################################
14475 # These are just experimental, probably should not be in a package:
14476
14477 # This is still experimental (20080329), but should ultimately be moved to
14478 # the script-block --with-normal, etc.
14479
14480 echo "$as_me:14480: checking if you want to link with the pthread library" >&5
14481 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14482
14483 # Check whether --with-pthread or --without-pthread was given.
14484 if test "${with_pthread+set}" = set; then
14485   withval="$with_pthread"
14486   with_pthread=$withval
14487 else
14488   with_pthread=no
14489 fi;
14490 echo "$as_me:14490: result: $with_pthread" >&5
14491 echo "${ECHO_T}$with_pthread" >&6
14492
14493 if test "$with_pthread" != no ; then
14494         echo "$as_me:14494: checking for pthread.h" >&5
14495 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14496 if test "${ac_cv_header_pthread_h+set}" = set; then
14497   echo $ECHO_N "(cached) $ECHO_C" >&6
14498 else
14499   cat >"conftest.$ac_ext" <<_ACEOF
14500 #line 14500 "configure"
14501 #include "confdefs.h"
14502 #include <pthread.h>
14503 _ACEOF
14504 if { (eval echo "$as_me:14504: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14505   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14506   ac_status=$?
14507   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14508   rm -f conftest.er1
14509   cat conftest.err >&5
14510   echo "$as_me:14510: \$? = $ac_status" >&5
14511   (exit "$ac_status"); } >/dev/null; then
14512   if test -s conftest.err; then
14513     ac_cpp_err=$ac_c_preproc_warn_flag
14514   else
14515     ac_cpp_err=
14516   fi
14517 else
14518   ac_cpp_err=yes
14519 fi
14520 if test -z "$ac_cpp_err"; then
14521   ac_cv_header_pthread_h=yes
14522 else
14523   echo "$as_me: failed program was:" >&5
14524   cat "conftest.$ac_ext" >&5
14525   ac_cv_header_pthread_h=no
14526 fi
14527 rm -f conftest.err "conftest.$ac_ext"
14528 fi
14529 echo "$as_me:14529: result: $ac_cv_header_pthread_h" >&5
14530 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14531 if test "$ac_cv_header_pthread_h" = yes; then
14532
14533 cat >>confdefs.h <<\EOF
14534 #define HAVE_PTHREADS_H 1
14535 EOF
14536
14537         for cf_lib_pthread in pthread c_r
14538         do
14539             echo "$as_me:14539: checking if we can link with the $cf_lib_pthread library" >&5
14540 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14541             cf_save_LIBS="$LIBS"
14542
14543 cf_add_libs="$LIBS"
14544 # reverse order
14545 cf_add_0lib=
14546 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14547 # filter duplicates
14548 for cf_add_1lib in $cf_add_0lib; do
14549         for cf_add_2lib in $cf_add_libs; do
14550                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14551                         cf_add_1lib=
14552                         break
14553                 fi
14554         done
14555         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14556 done
14557 LIBS="$cf_add_libs"
14558
14559             cat >"conftest.$ac_ext" <<_ACEOF
14560 #line 14560 "configure"
14561 #include "confdefs.h"
14562
14563 #include <pthread.h>
14564
14565 int
14566 main (void)
14567 {
14568
14569                 int rc = pthread_create(0,0,0,0);
14570                 int r2 = pthread_mutexattr_settype(0, 0);
14571
14572   ;
14573   return 0;
14574 }
14575 _ACEOF
14576 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14577 if { (eval echo "$as_me:14577: \"$ac_link\"") >&5
14578   (eval $ac_link) 2>&5
14579   ac_status=$?
14580   echo "$as_me:14580: \$? = $ac_status" >&5
14581   (exit "$ac_status"); } &&
14582          { ac_try='test -s "conftest$ac_exeext"'
14583   { (eval echo "$as_me:14583: \"$ac_try\"") >&5
14584   (eval $ac_try) 2>&5
14585   ac_status=$?
14586   echo "$as_me:14586: \$? = $ac_status" >&5
14587   (exit "$ac_status"); }; }; then
14588   with_pthread=yes
14589 else
14590   echo "$as_me: failed program was:" >&5
14591 cat "conftest.$ac_ext" >&5
14592 with_pthread=no
14593 fi
14594 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14595             LIBS="$cf_save_LIBS"
14596             echo "$as_me:14596: result: $with_pthread" >&5
14597 echo "${ECHO_T}$with_pthread" >&6
14598             test "$with_pthread" = yes && break
14599         done
14600
14601         if test "$with_pthread" = yes ; then
14602
14603 cf_add_libs="$LIBS"
14604 # reverse order
14605 cf_add_0lib=
14606 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14607 # filter duplicates
14608 for cf_add_1lib in $cf_add_0lib; do
14609         for cf_add_2lib in $cf_add_libs; do
14610                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14611                         cf_add_1lib=
14612                         break
14613                 fi
14614         done
14615         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14616 done
14617 LIBS="$cf_add_libs"
14618
14619 cat >>confdefs.h <<\EOF
14620 #define HAVE_LIBPTHREADS 1
14621 EOF
14622
14623         else
14624             { { echo "$as_me:14624: error: Cannot link with pthread library" >&5
14625 echo "$as_me: error: Cannot link with pthread library" >&2;}
14626    { (exit 1); exit 1; }; }
14627         fi
14628
14629 fi
14630
14631 fi
14632
14633 echo "$as_me:14633: checking if you want to use weak-symbols for pthreads" >&5
14634 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14635
14636 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14637 if test "${enable_weak_symbols+set}" = set; then
14638   enableval="$enable_weak_symbols"
14639   use_weak_symbols=$withval
14640 else
14641   use_weak_symbols=no
14642 fi;
14643 echo "$as_me:14643: result: $use_weak_symbols" >&5
14644 echo "${ECHO_T}$use_weak_symbols" >&6
14645 if test "$use_weak_symbols" = yes ; then
14646
14647 echo "$as_me:14647: checking if $CC supports weak symbols" >&5
14648 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14649 if test "${cf_cv_weak_symbols+set}" = set; then
14650   echo $ECHO_N "(cached) $ECHO_C" >&6
14651 else
14652
14653 cat >"conftest.$ac_ext" <<_ACEOF
14654 #line 14654 "configure"
14655 #include "confdefs.h"
14656
14657 #include <stdio.h>
14658 int
14659 main (void)
14660 {
14661
14662 #if defined(__GNUC__)
14663 #  if defined __USE_ISOC99
14664 #    define _cat_pragma(exp)    _Pragma(#exp)
14665 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14666 #  else
14667 #    define _weak_pragma(exp)
14668 #  endif
14669 #  define _declare(name)        __extension__ extern __typeof__(name) name
14670 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14671 #endif
14672
14673 weak_symbol(fopen);
14674
14675   ;
14676   return 0;
14677 }
14678 _ACEOF
14679 rm -f "conftest.$ac_objext"
14680 if { (eval echo "$as_me:14680: \"$ac_compile\"") >&5
14681   (eval $ac_compile) 2>&5
14682   ac_status=$?
14683   echo "$as_me:14683: \$? = $ac_status" >&5
14684   (exit "$ac_status"); } &&
14685          { ac_try='test -s "conftest.$ac_objext"'
14686   { (eval echo "$as_me:14686: \"$ac_try\"") >&5
14687   (eval $ac_try) 2>&5
14688   ac_status=$?
14689   echo "$as_me:14689: \$? = $ac_status" >&5
14690   (exit "$ac_status"); }; }; then
14691   cf_cv_weak_symbols=yes
14692 else
14693   echo "$as_me: failed program was:" >&5
14694 cat "conftest.$ac_ext" >&5
14695 cf_cv_weak_symbols=no
14696 fi
14697 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14698
14699 fi
14700 echo "$as_me:14700: result: $cf_cv_weak_symbols" >&5
14701 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14702
14703 else
14704         cf_cv_weak_symbols=no
14705 fi
14706
14707 if test $cf_cv_weak_symbols = yes ; then
14708
14709 cat >>confdefs.h <<\EOF
14710 #define USE_WEAK_SYMBOLS 1
14711 EOF
14712
14713 fi
14714
14715 PTHREAD=
14716 if test "$with_pthread" = "yes" ; then
14717
14718 cat >>confdefs.h <<\EOF
14719 #define USE_PTHREADS 1
14720 EOF
14721
14722         enable_reentrant=yes
14723         if test $cf_cv_weak_symbols = yes ; then
14724                 PTHREAD=-lpthread
14725         fi
14726 fi
14727
14728 # OpenSUSE is installing ncurses6, using reentrant option.
14729 echo "$as_me:14729: checking for _nc_TABSIZE" >&5
14730 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14731 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14732   echo $ECHO_N "(cached) $ECHO_C" >&6
14733 else
14734   cat >"conftest.$ac_ext" <<_ACEOF
14735 #line 14735 "configure"
14736 #include "confdefs.h"
14737 #define _nc_TABSIZE autoconf_temporary
14738 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14739 #undef _nc_TABSIZE
14740
14741 #ifdef __cplusplus
14742 extern "C"
14743 #endif
14744
14745 /* We use char because int might match the return type of a gcc2
14746    builtin and then its argument prototype would still apply.  */
14747 char _nc_TABSIZE (void);
14748
14749 int
14750 main (void)
14751 {
14752
14753 /* The GNU C library defines stubs for functions which it implements
14754     to always fail with ENOSYS.  Some functions are actually named
14755     something starting with __ and the normal name is an alias.  */
14756 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14757 #error found stub for _nc_TABSIZE
14758 #endif
14759
14760         return _nc_TABSIZE ();
14761   ;
14762   return 0;
14763 }
14764 _ACEOF
14765 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14766 if { (eval echo "$as_me:14766: \"$ac_link\"") >&5
14767   (eval $ac_link) 2>&5
14768   ac_status=$?
14769   echo "$as_me:14769: \$? = $ac_status" >&5
14770   (exit "$ac_status"); } &&
14771          { ac_try='test -s "conftest$ac_exeext"'
14772   { (eval echo "$as_me:14772: \"$ac_try\"") >&5
14773   (eval $ac_try) 2>&5
14774   ac_status=$?
14775   echo "$as_me:14775: \$? = $ac_status" >&5
14776   (exit "$ac_status"); }; }; then
14777   ac_cv_func__nc_TABSIZE=yes
14778 else
14779   echo "$as_me: failed program was:" >&5
14780 cat "conftest.$ac_ext" >&5
14781 ac_cv_func__nc_TABSIZE=no
14782 fi
14783 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14784 fi
14785 echo "$as_me:14785: result: $ac_cv_func__nc_TABSIZE" >&5
14786 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14787 if test "$ac_cv_func__nc_TABSIZE" = yes; then
14788   assume_reentrant=yes
14789 else
14790   assume_reentrant=no
14791 fi
14792
14793 # Reentrant code has to be opaque; there's little advantage to making ncurses
14794 # opaque outside of that, so there is no --enable-opaque option.  We can use
14795 # this option without --with-pthreads, but this will be always set for
14796 # pthreads.
14797 echo "$as_me:14797: checking if you want experimental reentrant code" >&5
14798 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14799
14800 # Check whether --enable-reentrant or --disable-reentrant was given.
14801 if test "${enable_reentrant+set}" = set; then
14802   enableval="$enable_reentrant"
14803   with_reentrant=$enableval
14804 else
14805   with_reentrant=$assume_reentrant
14806 fi;
14807 echo "$as_me:14807: result: $with_reentrant" >&5
14808 echo "${ECHO_T}$with_reentrant" >&6
14809 if test "$with_reentrant" = yes ; then
14810         cf_cv_enable_reentrant=1
14811         if test $cf_cv_weak_symbols = yes ; then
14812
14813 # remove pthread library from $LIBS
14814 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14815
14816         elif test "$assume_reentrant" = no ; then
14817                 LIB_SUFFIX="t${LIB_SUFFIX}"
14818         fi
14819
14820 cat >>confdefs.h <<\EOF
14821 #define USE_REENTRANT 1
14822 EOF
14823
14824 else
14825         cf_cv_enable_reentrant=0
14826 fi
14827
14828 ### Allow using a different wrap-prefix
14829 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14830         echo "$as_me:14830: checking for prefix used to wrap public variables" >&5
14831 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14832
14833 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14834 if test "${with_wrap_prefix+set}" = set; then
14835   withval="$with_wrap_prefix"
14836   NCURSES_WRAP_PREFIX=$withval
14837 else
14838   NCURSES_WRAP_PREFIX=_nc_
14839 fi;
14840         echo "$as_me:14840: result: $NCURSES_WRAP_PREFIX" >&5
14841 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14842 else
14843         NCURSES_WRAP_PREFIX=_nc_
14844 fi
14845
14846 cat >>confdefs.h <<EOF
14847 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14848 EOF
14849
14850 ###############################################################################
14851
14852 ###     use option --disable-echo to suppress full display compiling commands
14853
14854 echo "$as_me:14854: checking if you want to see long compiling messages" >&5
14855 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14856
14857 # Check whether --enable-echo or --disable-echo was given.
14858 if test "${enable_echo+set}" = set; then
14859   enableval="$enable_echo"
14860   test "$enableval" != no && enableval=yes
14861         if test "$enableval" != "yes" ; then
14862
14863         ECHO_LT='--silent'
14864         ECHO_LD='@echo linking $@;'
14865         RULE_CC='@echo compiling $<'
14866         SHOW_CC='@echo compiling $@'
14867         ECHO_CC='@'
14868
14869         else
14870
14871         ECHO_LT=''
14872         ECHO_LD=''
14873         RULE_CC=''
14874         SHOW_CC=''
14875         ECHO_CC=''
14876
14877         fi
14878 else
14879   enableval=yes
14880
14881         ECHO_LT=''
14882         ECHO_LD=''
14883         RULE_CC=''
14884         SHOW_CC=''
14885         ECHO_CC=''
14886
14887 fi;
14888 echo "$as_me:14888: result: $enableval" >&5
14889 echo "${ECHO_T}$enableval" >&6
14890
14891 echo "$as_me:14891: checking if you want to use C11 _Noreturn feature" >&5
14892 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
14893
14894 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
14895 if test "${enable_stdnoreturn+set}" = set; then
14896   enableval="$enable_stdnoreturn"
14897   test "$enableval" != yes && enableval=no
14898         if test "$enableval" != "no" ; then
14899     enable_stdnoreturn=yes
14900         else
14901                 enable_stdnoreturn=no
14902         fi
14903 else
14904   enableval=no
14905         enable_stdnoreturn=no
14906
14907 fi;
14908 echo "$as_me:14908: result: $enable_stdnoreturn" >&5
14909 echo "${ECHO_T}$enable_stdnoreturn" >&6
14910
14911 if test $enable_stdnoreturn = yes; then
14912 echo "$as_me:14912: checking for C11 _Noreturn feature" >&5
14913 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
14914 if test "${cf_cv_c11_noreturn+set}" = set; then
14915   echo $ECHO_N "(cached) $ECHO_C" >&6
14916 else
14917   cat >"conftest.$ac_ext" <<_ACEOF
14918 #line 14918 "configure"
14919 #include "confdefs.h"
14920
14921 #include <stdio.h>
14922 #include <stdlib.h>
14923 #include <stdnoreturn.h>
14924 static _Noreturn void giveup(void) { exit(0); }
14925
14926 int
14927 main (void)
14928 {
14929 if (feof(stdin)) giveup()
14930   ;
14931   return 0;
14932 }
14933 _ACEOF
14934 rm -f "conftest.$ac_objext"
14935 if { (eval echo "$as_me:14935: \"$ac_compile\"") >&5
14936   (eval $ac_compile) 2>&5
14937   ac_status=$?
14938   echo "$as_me:14938: \$? = $ac_status" >&5
14939   (exit "$ac_status"); } &&
14940          { ac_try='test -s "conftest.$ac_objext"'
14941   { (eval echo "$as_me:14941: \"$ac_try\"") >&5
14942   (eval $ac_try) 2>&5
14943   ac_status=$?
14944   echo "$as_me:14944: \$? = $ac_status" >&5
14945   (exit "$ac_status"); }; }; then
14946   cf_cv_c11_noreturn=yes
14947 else
14948   echo "$as_me: failed program was:" >&5
14949 cat "conftest.$ac_ext" >&5
14950 cf_cv_c11_noreturn=no
14951 fi
14952 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14953
14954 fi
14955 echo "$as_me:14955: result: $cf_cv_c11_noreturn" >&5
14956 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
14957 else
14958         cf_cv_c11_noreturn=no,
14959 fi
14960
14961 if test "$cf_cv_c11_noreturn" = yes; then
14962
14963 cat >>confdefs.h <<\EOF
14964 #define HAVE_STDNORETURN_H 1
14965 EOF
14966
14967 cat >>confdefs.h <<EOF
14968 #define STDC_NORETURN _Noreturn
14969 EOF
14970
14971         HAVE_STDNORETURN_H=1
14972 else
14973         HAVE_STDNORETURN_H=0
14974 fi
14975
14976 if test "$GCC" = yes || test "$GXX" = yes
14977 then
14978
14979 if test "$GCC" = yes || test "$GXX" = yes
14980 then
14981         case $CFLAGS in
14982         (*-Werror=*)
14983                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14984
14985 echo "${as_me:-configure}:14985: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14986
14987                 cf_temp_flags=
14988                 for cf_temp_scan in $CFLAGS
14989                 do
14990                         case "x$cf_temp_scan" in
14991                         (x-Werror=*)
14992
14993         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14994         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14995
14996                                 ;;
14997                         (*)
14998
14999         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15000         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15001
15002                                 ;;
15003                         esac
15004                 done
15005                 CFLAGS="$cf_temp_flags"
15006                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15007
15008 echo "${as_me:-configure}:15008: testing ... fixed $CFLAGS ..." 1>&5
15009
15010                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15011
15012 echo "${as_me:-configure}:15012: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15013
15014                 ;;
15015         esac
15016 fi
15017
15018 if test "$GCC" = yes || test "$GXX" = yes
15019 then
15020         case $CPPFLAGS in
15021         (*-Werror=*)
15022                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15023
15024 echo "${as_me:-configure}:15024: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15025
15026                 cf_temp_flags=
15027                 for cf_temp_scan in $CPPFLAGS
15028                 do
15029                         case "x$cf_temp_scan" in
15030                         (x-Werror=*)
15031
15032         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15033         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15034
15035                                 ;;
15036                         (*)
15037
15038         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15039         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15040
15041                                 ;;
15042                         esac
15043                 done
15044                 CPPFLAGS="$cf_temp_flags"
15045                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15046
15047 echo "${as_me:-configure}:15047: testing ... fixed $CPPFLAGS ..." 1>&5
15048
15049                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15050
15051 echo "${as_me:-configure}:15051: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15052
15053                 ;;
15054         esac
15055 fi
15056
15057 if test "$GCC" = yes || test "$GXX" = yes
15058 then
15059         case $LDFLAGS in
15060         (*-Werror=*)
15061                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15062
15063 echo "${as_me:-configure}:15063: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15064
15065                 cf_temp_flags=
15066                 for cf_temp_scan in $LDFLAGS
15067                 do
15068                         case "x$cf_temp_scan" in
15069                         (x-Werror=*)
15070
15071         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15072         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15073
15074                                 ;;
15075                         (*)
15076
15077         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15078         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15079
15080                                 ;;
15081                         esac
15082                 done
15083                 LDFLAGS="$cf_temp_flags"
15084                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15085
15086 echo "${as_me:-configure}:15086: testing ... fixed $LDFLAGS ..." 1>&5
15087
15088                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15089
15090 echo "${as_me:-configure}:15090: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15091
15092                 ;;
15093         esac
15094 fi
15095
15096 echo "$as_me:15096: checking if you want to turn on gcc warnings" >&5
15097 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15098
15099 # Check whether --enable-warnings or --disable-warnings was given.
15100 if test "${enable_warnings+set}" = set; then
15101   enableval="$enable_warnings"
15102   test "$enableval" != yes && enableval=no
15103         if test "$enableval" != "no" ; then
15104     enable_warnings=yes
15105         else
15106                 enable_warnings=no
15107         fi
15108 else
15109   enableval=no
15110         enable_warnings=no
15111
15112 fi;
15113 echo "$as_me:15113: result: $enable_warnings" >&5
15114 echo "${ECHO_T}$enable_warnings" >&6
15115 if test "$enable_warnings" = "yes"
15116 then
15117
15118 if test "x$have_x" = xyes; then
15119
15120 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15121 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15122 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15123 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15124 for cf_X_CFLAGS in $X_CFLAGS
15125 do
15126         case "x$cf_X_CFLAGS" in
15127         x-[IUD]*)
15128                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15129                 ;;
15130         *)
15131                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15132                 ;;
15133         esac
15134 done
15135
15136 cat >"conftest.$ac_ext" <<_ACEOF
15137 #line 15137 "configure"
15138 #include "confdefs.h"
15139
15140 #include <stdlib.h>
15141 #include <X11/Intrinsic.h>
15142
15143 int
15144 main (void)
15145 {
15146 String foo = malloc(1); free((void*)foo)
15147   ;
15148   return 0;
15149 }
15150 _ACEOF
15151 rm -f "conftest.$ac_objext"
15152 if { (eval echo "$as_me:15152: \"$ac_compile\"") >&5
15153   (eval $ac_compile) 2>&5
15154   ac_status=$?
15155   echo "$as_me:15155: \$? = $ac_status" >&5
15156   (exit "$ac_status"); } &&
15157          { ac_try='test -s "conftest.$ac_objext"'
15158   { (eval echo "$as_me:15158: \"$ac_try\"") >&5
15159   (eval $ac_try) 2>&5
15160   ac_status=$?
15161   echo "$as_me:15161: \$? = $ac_status" >&5
15162   (exit "$ac_status"); }; }; then
15163
15164 echo "$as_me:15164: checking for X11/Xt const-feature" >&5
15165 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15166 if test "${cf_cv_const_x_string+set}" = set; then
15167   echo $ECHO_N "(cached) $ECHO_C" >&6
15168 else
15169
15170         cat >"conftest.$ac_ext" <<_ACEOF
15171 #line 15171 "configure"
15172 #include "confdefs.h"
15173
15174 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15175 #undef  XTSTRINGDEFINES /* X11R5 and later */
15176 #include <stdlib.h>
15177 #include <X11/Intrinsic.h>
15178
15179 int
15180 main (void)
15181 {
15182 String foo = malloc(1); *foo = 0
15183   ;
15184   return 0;
15185 }
15186 _ACEOF
15187 rm -f "conftest.$ac_objext"
15188 if { (eval echo "$as_me:15188: \"$ac_compile\"") >&5
15189   (eval $ac_compile) 2>&5
15190   ac_status=$?
15191   echo "$as_me:15191: \$? = $ac_status" >&5
15192   (exit "$ac_status"); } &&
15193          { ac_try='test -s "conftest.$ac_objext"'
15194   { (eval echo "$as_me:15194: \"$ac_try\"") >&5
15195   (eval $ac_try) 2>&5
15196   ac_status=$?
15197   echo "$as_me:15197: \$? = $ac_status" >&5
15198   (exit "$ac_status"); }; }; then
15199
15200                         cf_cv_const_x_string=no
15201
15202 else
15203   echo "$as_me: failed program was:" >&5
15204 cat "conftest.$ac_ext" >&5
15205
15206                         cf_cv_const_x_string=yes
15207
15208 fi
15209 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15210
15211 fi
15212 echo "$as_me:15212: result: $cf_cv_const_x_string" >&5
15213 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15214
15215 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15216 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15217 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15218
15219 case "$cf_cv_const_x_string" in
15220 (no)
15221
15222         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15223         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15224
15225         ;;
15226 (*)
15227
15228         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15229         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15230
15231         ;;
15232 esac
15233
15234 else
15235   echo "$as_me: failed program was:" >&5
15236 cat "conftest.$ac_ext" >&5
15237 fi
15238 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15239  fi
15240 cat > "conftest.$ac_ext" <<EOF
15241 #line 15241 "${as_me:-configure}"
15242 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15243 EOF
15244 if test "$INTEL_COMPILER" = yes
15245 then
15246 # The "-wdXXX" options suppress warnings:
15247 # remark #1419: external declaration in primary source file
15248 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15249 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15250 # remark #193: zero used for undefined preprocessing identifier
15251 # remark #593: variable "curs_sb_left_arrow" was set but never used
15252 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15253 # remark #869: parameter "tw" was never referenced
15254 # remark #981: operands are evaluated in unspecified order
15255 # warning #279: controlling expression is constant
15256
15257         { echo "$as_me:15257: checking for $CC warning options..." >&5
15258 echo "$as_me: checking for $CC warning options..." >&6;}
15259         cf_save_CFLAGS="$CFLAGS"
15260         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15261         for cf_opt in \
15262                 wd1419 \
15263                 wd1683 \
15264                 wd1684 \
15265                 wd193 \
15266                 wd593 \
15267                 wd279 \
15268                 wd810 \
15269                 wd869 \
15270                 wd981
15271         do
15272                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15273                 if { (eval echo "$as_me:15273: \"$ac_compile\"") >&5
15274   (eval $ac_compile) 2>&5
15275   ac_status=$?
15276   echo "$as_me:15276: \$? = $ac_status" >&5
15277   (exit "$ac_status"); }; then
15278                         test -n "$verbose" && echo "$as_me:15278: result: ... -$cf_opt" >&5
15279 echo "${ECHO_T}... -$cf_opt" >&6
15280                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15281                 fi
15282         done
15283         CFLAGS="$cf_save_CFLAGS"
15284 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15285 then
15286         { echo "$as_me:15286: checking for $CC warning options..." >&5
15287 echo "$as_me: checking for $CC warning options..." >&6;}
15288         cf_save_CFLAGS="$CFLAGS"
15289         cf_warn_CONST=""
15290         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15291         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15292         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15293         for cf_opt in W Wall \
15294                 Wbad-function-cast \
15295                 Wcast-align \
15296                 Wcast-qual \
15297                 Wdeclaration-after-statement \
15298                 Wextra \
15299                 Winline \
15300                 Wmissing-declarations \
15301                 Wmissing-prototypes \
15302                 Wnested-externs \
15303                 Wpointer-arith \
15304                 Wshadow \
15305                 Wstrict-prototypes \
15306                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15307         do
15308                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15309                 if { (eval echo "$as_me:15309: \"$ac_compile\"") >&5
15310   (eval $ac_compile) 2>&5
15311   ac_status=$?
15312   echo "$as_me:15312: \$? = $ac_status" >&5
15313   (exit "$ac_status"); }; then
15314                         test -n "$verbose" && echo "$as_me:15314: result: ... -$cf_opt" >&5
15315 echo "${ECHO_T}... -$cf_opt" >&6
15316                         case "$cf_opt" in
15317                         (Winline)
15318                                 case "$GCC_VERSION" in
15319                                 ([34].*)
15320                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15321
15322 echo "${as_me:-configure}:15322: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15323
15324                                         continue;;
15325                                 esac
15326                                 ;;
15327                         (Wpointer-arith)
15328                                 case "$GCC_VERSION" in
15329                                 ([12].*)
15330                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15331
15332 echo "${as_me:-configure}:15332: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15333
15334                                         continue;;
15335                                 esac
15336                                 ;;
15337                         esac
15338                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15339                 fi
15340         done
15341         CFLAGS="$cf_save_CFLAGS"
15342 fi
15343 rm -rf ./conftest*
15344
15345 fi
15346
15347 if test "$GCC" = yes || test "$GXX" = yes
15348 then
15349 cat > conftest.i <<EOF
15350 #ifndef GCC_PRINTF
15351 #define GCC_PRINTF 0
15352 #endif
15353 #ifndef GCC_SCANF
15354 #define GCC_SCANF 0
15355 #endif
15356 #ifndef GCC_NORETURN
15357 #define GCC_NORETURN /* nothing */
15358 #endif
15359 #ifndef GCC_UNUSED
15360 #define GCC_UNUSED /* nothing */
15361 #endif
15362 EOF
15363 if test "$GCC" = yes
15364 then
15365         { echo "$as_me:15365: checking for $CC __attribute__ directives..." >&5
15366 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15367 cat > "conftest.$ac_ext" <<EOF
15368 #line 15368 "${as_me:-configure}"
15369 #include "confdefs.h"
15370 #include "conftest.h"
15371 #include "conftest.i"
15372 #if     GCC_PRINTF
15373 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15374 #else
15375 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15376 #endif
15377 #if     GCC_SCANF
15378 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15379 #else
15380 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15381 #endif
15382 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15383 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15384 extern GCC_NORETURN void foo(void);
15385 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15386 EOF
15387         cf_printf_attribute=no
15388         cf_scanf_attribute=no
15389         for cf_attribute in scanf printf unused noreturn
15390         do
15391
15392 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15393
15394                 cf_directive="__attribute__(($cf_attribute))"
15395                 echo "checking for $CC $cf_directive" 1>&5
15396
15397                 case "$cf_attribute" in
15398                 (printf)
15399                         cf_printf_attribute=yes
15400                         cat >conftest.h <<EOF
15401 #define GCC_$cf_ATTRIBUTE 1
15402 EOF
15403                         ;;
15404                 (scanf)
15405                         cf_scanf_attribute=yes
15406                         cat >conftest.h <<EOF
15407 #define GCC_$cf_ATTRIBUTE 1
15408 EOF
15409                         ;;
15410                 (*)
15411                         cat >conftest.h <<EOF
15412 #define GCC_$cf_ATTRIBUTE $cf_directive
15413 EOF
15414                         ;;
15415                 esac
15416
15417                 if { (eval echo "$as_me:15417: \"$ac_compile\"") >&5
15418   (eval $ac_compile) 2>&5
15419   ac_status=$?
15420   echo "$as_me:15420: \$? = $ac_status" >&5
15421   (exit "$ac_status"); }; then
15422                         test -n "$verbose" && echo "$as_me:15422: result: ... $cf_attribute" >&5
15423 echo "${ECHO_T}... $cf_attribute" >&6
15424                         cat conftest.h >>confdefs.h
15425                         case "$cf_attribute" in
15426                         (noreturn)
15427
15428 cat >>confdefs.h <<EOF
15429 #define GCC_NORETURN $cf_directive
15430 EOF
15431
15432                                 ;;
15433                         (printf)
15434                                 cf_value='/* nothing */'
15435                                 if test "$cf_printf_attribute" != no ; then
15436                                         cf_value='__attribute__((format(printf,fmt,var)))'
15437
15438 cat >>confdefs.h <<\EOF
15439 #define GCC_PRINTF 1
15440 EOF
15441
15442                                 fi
15443
15444 cat >>confdefs.h <<EOF
15445 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15446 EOF
15447
15448                                 ;;
15449                         (scanf)
15450                                 cf_value='/* nothing */'
15451                                 if test "$cf_scanf_attribute" != no ; then
15452                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15453
15454 cat >>confdefs.h <<\EOF
15455 #define GCC_SCANF 1
15456 EOF
15457
15458                                 fi
15459
15460 cat >>confdefs.h <<EOF
15461 #define GCC_SCANFLIKE(fmt,var) $cf_value
15462 EOF
15463
15464                                 ;;
15465                         (unused)
15466
15467 cat >>confdefs.h <<EOF
15468 #define GCC_UNUSED $cf_directive
15469 EOF
15470
15471                                 ;;
15472                         esac
15473                 fi
15474         done
15475 else
15476         ${FGREP-fgrep} define conftest.i >>confdefs.h
15477 fi
15478 rm -rf ./conftest*
15479 fi
15480
15481 fi
15482
15483 if test "x$enable_warnings" = "xyes"; then
15484
15485         ADAFLAGS="$ADAFLAGS -gnatg"
15486
15487 fi
15488
15489 ###     use option --enable-assertions to turn on generation of assertion code
15490 echo "$as_me:15490: checking if you want to enable runtime assertions" >&5
15491 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15492
15493 # Check whether --enable-assertions or --disable-assertions was given.
15494 if test "${enable_assertions+set}" = set; then
15495   enableval="$enable_assertions"
15496   with_assertions=$enableval
15497 else
15498   with_assertions=no
15499 fi;
15500 echo "$as_me:15500: result: $with_assertions" >&5
15501 echo "${ECHO_T}$with_assertions" >&6
15502 if test -n "$GCC"
15503 then
15504         if test "$with_assertions" = no
15505         then
15506                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15507         else
15508
15509         ADAFLAGS="$ADAFLAGS -gnata"
15510
15511         fi
15512 fi
15513
15514 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15515
15516 cat >>confdefs.h <<\EOF
15517 #define HAVE_NC_ALLOC_H 1
15518 EOF
15519
15520 ###     use option --enable-expanded to generate certain macros as functions
15521
15522 # Check whether --enable-expanded or --disable-expanded was given.
15523 if test "${enable_expanded+set}" = set; then
15524   enableval="$enable_expanded"
15525   test "$enableval" = yes &&
15526 cat >>confdefs.h <<\EOF
15527 #define NCURSES_EXPANDED 1
15528 EOF
15529
15530 fi;
15531
15532 ###     use option --disable-macros to suppress macros in favor of functions
15533
15534 # Check whether --enable-macros or --disable-macros was given.
15535 if test "${enable_macros+set}" = set; then
15536   enableval="$enable_macros"
15537   test "$enableval" = no &&
15538 cat >>confdefs.h <<\EOF
15539 #define NCURSES_NOMACROS 1
15540 EOF
15541
15542 fi;
15543
15544 # Normally we only add trace() to the debug-library.  Allow this to be
15545 # extended to all models of the ncurses library:
15546 cf_all_traces=no
15547 case "$CFLAGS $CPPFLAGS" in
15548 (*-DTRACE*)
15549         cf_all_traces=yes
15550         ;;
15551 esac
15552
15553 echo "$as_me:15553: checking whether to add trace feature to all models" >&5
15554 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15555
15556 # Check whether --with-trace or --without-trace was given.
15557 if test "${with_trace+set}" = set; then
15558   withval="$with_trace"
15559   cf_with_trace=$withval
15560 else
15561   cf_with_trace=$cf_all_traces
15562 fi;
15563 echo "$as_me:15563: result: $cf_with_trace" >&5
15564 echo "${ECHO_T}$cf_with_trace" >&6
15565
15566 if test "$cf_with_trace" = yes ; then
15567         ADA_TRACE=TRUE
15568
15569 cf_fix_cppflags=no
15570 cf_new_cflags=
15571 cf_new_cppflags=
15572 cf_new_extra_cppflags=
15573
15574 for cf_add_cflags in -DTRACE
15575 do
15576 case "$cf_fix_cppflags" in
15577 (no)
15578         case "$cf_add_cflags" in
15579         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15580                 case "$cf_add_cflags" in
15581                 (-D*)
15582                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15583
15584                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15585                                 && test -z "${cf_tst_cflags}" \
15586                                 && cf_fix_cppflags=yes
15587
15588                         if test "$cf_fix_cppflags" = yes ; then
15589
15590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15592
15593                                 continue
15594                         elif test "${cf_tst_cflags}" = "\"'" ; then
15595
15596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15598
15599                                 continue
15600                         fi
15601                         ;;
15602                 esac
15603                 case "$CPPFLAGS" in
15604                 (*$cf_add_cflags)
15605                         ;;
15606                 (*)
15607                         case "$cf_add_cflags" in
15608                         (-D*)
15609                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15610
15611 CPPFLAGS=`echo "$CPPFLAGS" | \
15612         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15613                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15614
15615                                 ;;
15616                         esac
15617
15618         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15619         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15620
15621                         ;;
15622                 esac
15623                 ;;
15624         (*)
15625
15626         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15627         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15628
15629                 ;;
15630         esac
15631         ;;
15632 (yes)
15633
15634         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15635         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15636
15637         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15638
15639         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15640                 && test -z "${cf_tst_cflags}" \
15641                 && cf_fix_cppflags=no
15642         ;;
15643 esac
15644 done
15645
15646 if test -n "$cf_new_cflags" ; then
15647
15648         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15649         CFLAGS="${CFLAGS}$cf_new_cflags"
15650
15651 fi
15652
15653 if test -n "$cf_new_cppflags" ; then
15654
15655         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15656         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15657
15658 fi
15659
15660 if test -n "$cf_new_extra_cppflags" ; then
15661
15662         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15663         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15664
15665 fi
15666
15667 else
15668         ADA_TRACE=FALSE
15669 fi
15670
15671 echo "$as_me:15671: checking if we want to use GNAT projects" >&5
15672 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15673
15674 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15675 if test "${enable_gnat_projects+set}" = set; then
15676   enableval="$enable_gnat_projects"
15677   test "$enableval" != no && enableval=yes
15678         if test "$enableval" != "yes" ; then
15679     enable_gnat_projects=no
15680         else
15681                 enable_gnat_projects=yes
15682         fi
15683 else
15684   enableval=yes
15685         enable_gnat_projects=yes
15686
15687 fi;
15688 echo "$as_me:15688: result: $enable_gnat_projects" >&5
15689 echo "${ECHO_T}$enable_gnat_projects" >&6
15690
15691 ###     Checks for libraries.
15692 case $cf_cv_system_name in
15693 (*mingw32*)
15694         ;;
15695 (*)
15696 echo "$as_me:15696: checking for gettimeofday" >&5
15697 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15698 if test "${ac_cv_func_gettimeofday+set}" = set; then
15699   echo $ECHO_N "(cached) $ECHO_C" >&6
15700 else
15701   cat >"conftest.$ac_ext" <<_ACEOF
15702 #line 15702 "configure"
15703 #include "confdefs.h"
15704 #define gettimeofday autoconf_temporary
15705 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15706 #undef gettimeofday
15707
15708 #ifdef __cplusplus
15709 extern "C"
15710 #endif
15711
15712 /* We use char because int might match the return type of a gcc2
15713    builtin and then its argument prototype would still apply.  */
15714 char gettimeofday (void);
15715
15716 int
15717 main (void)
15718 {
15719
15720 /* The GNU C library defines stubs for functions which it implements
15721     to always fail with ENOSYS.  Some functions are actually named
15722     something starting with __ and the normal name is an alias.  */
15723 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15724 #error found stub for gettimeofday
15725 #endif
15726
15727         return gettimeofday ();
15728   ;
15729   return 0;
15730 }
15731 _ACEOF
15732 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15733 if { (eval echo "$as_me:15733: \"$ac_link\"") >&5
15734   (eval $ac_link) 2>&5
15735   ac_status=$?
15736   echo "$as_me:15736: \$? = $ac_status" >&5
15737   (exit "$ac_status"); } &&
15738          { ac_try='test -s "conftest$ac_exeext"'
15739   { (eval echo "$as_me:15739: \"$ac_try\"") >&5
15740   (eval $ac_try) 2>&5
15741   ac_status=$?
15742   echo "$as_me:15742: \$? = $ac_status" >&5
15743   (exit "$ac_status"); }; }; then
15744   ac_cv_func_gettimeofday=yes
15745 else
15746   echo "$as_me: failed program was:" >&5
15747 cat "conftest.$ac_ext" >&5
15748 ac_cv_func_gettimeofday=no
15749 fi
15750 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15751 fi
15752 echo "$as_me:15752: result: $ac_cv_func_gettimeofday" >&5
15753 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15754 if test "$ac_cv_func_gettimeofday" = yes; then
15755   cat >>confdefs.h <<\EOF
15756 #define HAVE_GETTIMEOFDAY 1
15757 EOF
15758
15759 else
15760
15761 echo "$as_me:15761: checking for gettimeofday in -lbsd" >&5
15762 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15763 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15764   echo $ECHO_N "(cached) $ECHO_C" >&6
15765 else
15766   ac_check_lib_save_LIBS=$LIBS
15767 LIBS="-lbsd  $LIBS"
15768 cat >"conftest.$ac_ext" <<_ACEOF
15769 #line 15769 "configure"
15770 #include "confdefs.h"
15771
15772 /* Override any gcc2 internal prototype to avoid an error.  */
15773 #ifdef __cplusplus
15774 extern "C"
15775 #endif
15776 /* We use char because int might match the return type of a gcc2
15777    builtin and then its argument prototype would still apply.  */
15778 char gettimeofday ();
15779 int
15780 main (void)
15781 {
15782 gettimeofday ();
15783   ;
15784   return 0;
15785 }
15786 _ACEOF
15787 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15788 if { (eval echo "$as_me:15788: \"$ac_link\"") >&5
15789   (eval $ac_link) 2>&5
15790   ac_status=$?
15791   echo "$as_me:15791: \$? = $ac_status" >&5
15792   (exit "$ac_status"); } &&
15793          { ac_try='test -s "conftest$ac_exeext"'
15794   { (eval echo "$as_me:15794: \"$ac_try\"") >&5
15795   (eval $ac_try) 2>&5
15796   ac_status=$?
15797   echo "$as_me:15797: \$? = $ac_status" >&5
15798   (exit "$ac_status"); }; }; then
15799   ac_cv_lib_bsd_gettimeofday=yes
15800 else
15801   echo "$as_me: failed program was:" >&5
15802 cat "conftest.$ac_ext" >&5
15803 ac_cv_lib_bsd_gettimeofday=no
15804 fi
15805 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15806 LIBS=$ac_check_lib_save_LIBS
15807 fi
15808 echo "$as_me:15808: result: $ac_cv_lib_bsd_gettimeofday" >&5
15809 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15810 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
15811
15812 cat >>confdefs.h <<\EOF
15813 #define HAVE_GETTIMEOFDAY 1
15814 EOF
15815
15816         LIBS="$LIBS -lbsd"
15817 fi
15818
15819 fi
15820         ;;
15821 esac
15822
15823 ###     Checks for header files.
15824 echo "$as_me:15824: checking for ANSI C header files" >&5
15825 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15826 if test "${ac_cv_header_stdc+set}" = set; then
15827   echo $ECHO_N "(cached) $ECHO_C" >&6
15828 else
15829   cat >"conftest.$ac_ext" <<_ACEOF
15830 #line 15830 "configure"
15831 #include "confdefs.h"
15832 #include <stdlib.h>
15833 #include <stdarg.h>
15834 #include <string.h>
15835 #include <float.h>
15836
15837 _ACEOF
15838 if { (eval echo "$as_me:15838: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15839   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15840   ac_status=$?
15841   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15842   rm -f conftest.er1
15843   cat conftest.err >&5
15844   echo "$as_me:15844: \$? = $ac_status" >&5
15845   (exit "$ac_status"); } >/dev/null; then
15846   if test -s conftest.err; then
15847     ac_cpp_err=$ac_c_preproc_warn_flag
15848   else
15849     ac_cpp_err=
15850   fi
15851 else
15852   ac_cpp_err=yes
15853 fi
15854 if test -z "$ac_cpp_err"; then
15855   ac_cv_header_stdc=yes
15856 else
15857   echo "$as_me: failed program was:" >&5
15858   cat "conftest.$ac_ext" >&5
15859   ac_cv_header_stdc=no
15860 fi
15861 rm -f conftest.err "conftest.$ac_ext"
15862
15863 if test $ac_cv_header_stdc = yes; then
15864   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15865   cat >"conftest.$ac_ext" <<_ACEOF
15866 #line 15866 "configure"
15867 #include "confdefs.h"
15868 #include <string.h>
15869
15870 _ACEOF
15871 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15872   $EGREP "memchr" >/dev/null 2>&1; then
15873   :
15874 else
15875   ac_cv_header_stdc=no
15876 fi
15877 rm -rf conftest*
15878
15879 fi
15880
15881 if test $ac_cv_header_stdc = yes; then
15882   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15883   cat >"conftest.$ac_ext" <<_ACEOF
15884 #line 15884 "configure"
15885 #include "confdefs.h"
15886 #include <stdlib.h>
15887
15888 _ACEOF
15889 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15890   $EGREP "free" >/dev/null 2>&1; then
15891   :
15892 else
15893   ac_cv_header_stdc=no
15894 fi
15895 rm -rf conftest*
15896
15897 fi
15898
15899 if test $ac_cv_header_stdc = yes; then
15900   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15901   if test "$cross_compiling" = yes; then
15902   :
15903 else
15904   cat >"conftest.$ac_ext" <<_ACEOF
15905 #line 15905 "configure"
15906 #include "confdefs.h"
15907 #include <ctype.h>
15908 #if ((' ' & 0x0FF) == 0x020)
15909 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15910 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15911 #else
15912 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15913                      || ('j' <= (c) && (c) <= 'r') \
15914                      || ('s' <= (c) && (c) <= 'z'))
15915 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15916 #endif
15917
15918 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15919 int
15920 main (void)
15921 {
15922   int i;
15923   for (i = 0; i < 256; i++)
15924     if (XOR (islower (i), ISLOWER (i))
15925         || toupper (i) != TOUPPER (i))
15926       $ac_main_return(2);
15927   $ac_main_return (0);
15928 }
15929 _ACEOF
15930 rm -f "conftest$ac_exeext"
15931 if { (eval echo "$as_me:15931: \"$ac_link\"") >&5
15932   (eval $ac_link) 2>&5
15933   ac_status=$?
15934   echo "$as_me:15934: \$? = $ac_status" >&5
15935   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
15936   { (eval echo "$as_me:15936: \"$ac_try\"") >&5
15937   (eval $ac_try) 2>&5
15938   ac_status=$?
15939   echo "$as_me:15939: \$? = $ac_status" >&5
15940   (exit "$ac_status"); }; }; then
15941   :
15942 else
15943   echo "$as_me: program exited with status $ac_status" >&5
15944 echo "$as_me: failed program was:" >&5
15945 cat "conftest.$ac_ext" >&5
15946 ac_cv_header_stdc=no
15947 fi
15948 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
15949 fi
15950 fi
15951 fi
15952 echo "$as_me:15952: result: $ac_cv_header_stdc" >&5
15953 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15954 if test $ac_cv_header_stdc = yes; then
15955
15956 cat >>confdefs.h <<\EOF
15957 #define STDC_HEADERS 1
15958 EOF
15959
15960 fi
15961
15962 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15963
15964 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15965                   inttypes.h stdint.h unistd.h
15966 do
15967 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15968 echo "$as_me:15968: checking for $ac_header" >&5
15969 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15970 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15971   echo $ECHO_N "(cached) $ECHO_C" >&6
15972 else
15973   cat >"conftest.$ac_ext" <<_ACEOF
15974 #line 15974 "configure"
15975 #include "confdefs.h"
15976 $ac_includes_default
15977 #include <$ac_header>
15978 _ACEOF
15979 rm -f "conftest.$ac_objext"
15980 if { (eval echo "$as_me:15980: \"$ac_compile\"") >&5
15981   (eval $ac_compile) 2>&5
15982   ac_status=$?
15983   echo "$as_me:15983: \$? = $ac_status" >&5
15984   (exit "$ac_status"); } &&
15985          { ac_try='test -s "conftest.$ac_objext"'
15986   { (eval echo "$as_me:15986: \"$ac_try\"") >&5
15987   (eval $ac_try) 2>&5
15988   ac_status=$?
15989   echo "$as_me:15989: \$? = $ac_status" >&5
15990   (exit "$ac_status"); }; }; then
15991   eval "$as_ac_Header=yes"
15992 else
15993   echo "$as_me: failed program was:" >&5
15994 cat "conftest.$ac_ext" >&5
15995 eval "$as_ac_Header=no"
15996 fi
15997 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15998 fi
15999 echo "$as_me:15999: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16000 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16001 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16002   cat >>confdefs.h <<EOF
16003 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16004 EOF
16005
16006 fi
16007 done
16008
16009 echo "$as_me:16009: checking for signed char" >&5
16010 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16011 if test "${ac_cv_type_signed_char+set}" = set; then
16012   echo $ECHO_N "(cached) $ECHO_C" >&6
16013 else
16014   cat >"conftest.$ac_ext" <<_ACEOF
16015 #line 16015 "configure"
16016 #include "confdefs.h"
16017 $ac_includes_default
16018 int
16019 main (void)
16020 {
16021 if ((signed char *) 0)
16022   return 0;
16023 if (sizeof (signed char))
16024   return 0;
16025   ;
16026   return 0;
16027 }
16028 _ACEOF
16029 rm -f "conftest.$ac_objext"
16030 if { (eval echo "$as_me:16030: \"$ac_compile\"") >&5
16031   (eval $ac_compile) 2>&5
16032   ac_status=$?
16033   echo "$as_me:16033: \$? = $ac_status" >&5
16034   (exit "$ac_status"); } &&
16035          { ac_try='test -s "conftest.$ac_objext"'
16036   { (eval echo "$as_me:16036: \"$ac_try\"") >&5
16037   (eval $ac_try) 2>&5
16038   ac_status=$?
16039   echo "$as_me:16039: \$? = $ac_status" >&5
16040   (exit "$ac_status"); }; }; then
16041   ac_cv_type_signed_char=yes
16042 else
16043   echo "$as_me: failed program was:" >&5
16044 cat "conftest.$ac_ext" >&5
16045 ac_cv_type_signed_char=no
16046 fi
16047 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16048 fi
16049 echo "$as_me:16049: result: $ac_cv_type_signed_char" >&5
16050 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16051
16052 echo "$as_me:16052: checking size of signed char" >&5
16053 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16054 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16055   echo $ECHO_N "(cached) $ECHO_C" >&6
16056 else
16057   if test "$ac_cv_type_signed_char" = yes; then
16058   if test "$cross_compiling" = yes; then
16059   # Depending upon the size, compute the lo and hi bounds.
16060 cat >"conftest.$ac_ext" <<_ACEOF
16061 #line 16061 "configure"
16062 #include "confdefs.h"
16063 $ac_includes_default
16064 int
16065 main (void)
16066 {
16067 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16068   ;
16069   return 0;
16070 }
16071 _ACEOF
16072 rm -f "conftest.$ac_objext"
16073 if { (eval echo "$as_me:16073: \"$ac_compile\"") >&5
16074   (eval $ac_compile) 2>&5
16075   ac_status=$?
16076   echo "$as_me:16076: \$? = $ac_status" >&5
16077   (exit "$ac_status"); } &&
16078          { ac_try='test -s "conftest.$ac_objext"'
16079   { (eval echo "$as_me:16079: \"$ac_try\"") >&5
16080   (eval $ac_try) 2>&5
16081   ac_status=$?
16082   echo "$as_me:16082: \$? = $ac_status" >&5
16083   (exit "$ac_status"); }; }; then
16084   ac_lo=0 ac_mid=0
16085   while :; do
16086     cat >"conftest.$ac_ext" <<_ACEOF
16087 #line 16087 "configure"
16088 #include "confdefs.h"
16089 $ac_includes_default
16090 int
16091 main (void)
16092 {
16093 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16094   ;
16095   return 0;
16096 }
16097 _ACEOF
16098 rm -f "conftest.$ac_objext"
16099 if { (eval echo "$as_me:16099: \"$ac_compile\"") >&5
16100   (eval $ac_compile) 2>&5
16101   ac_status=$?
16102   echo "$as_me:16102: \$? = $ac_status" >&5
16103   (exit "$ac_status"); } &&
16104          { ac_try='test -s "conftest.$ac_objext"'
16105   { (eval echo "$as_me:16105: \"$ac_try\"") >&5
16106   (eval $ac_try) 2>&5
16107   ac_status=$?
16108   echo "$as_me:16108: \$? = $ac_status" >&5
16109   (exit "$ac_status"); }; }; then
16110   ac_hi=$ac_mid; break
16111 else
16112   echo "$as_me: failed program was:" >&5
16113 cat "conftest.$ac_ext" >&5
16114 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16115 fi
16116 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16117   done
16118 else
16119   echo "$as_me: failed program was:" >&5
16120 cat "conftest.$ac_ext" >&5
16121 ac_hi=-1 ac_mid=-1
16122   while :; do
16123     cat >"conftest.$ac_ext" <<_ACEOF
16124 #line 16124 "configure"
16125 #include "confdefs.h"
16126 $ac_includes_default
16127 int
16128 main (void)
16129 {
16130 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16131   ;
16132   return 0;
16133 }
16134 _ACEOF
16135 rm -f "conftest.$ac_objext"
16136 if { (eval echo "$as_me:16136: \"$ac_compile\"") >&5
16137   (eval $ac_compile) 2>&5
16138   ac_status=$?
16139   echo "$as_me:16139: \$? = $ac_status" >&5
16140   (exit "$ac_status"); } &&
16141          { ac_try='test -s "conftest.$ac_objext"'
16142   { (eval echo "$as_me:16142: \"$ac_try\"") >&5
16143   (eval $ac_try) 2>&5
16144   ac_status=$?
16145   echo "$as_me:16145: \$? = $ac_status" >&5
16146   (exit "$ac_status"); }; }; then
16147   ac_lo=$ac_mid; break
16148 else
16149   echo "$as_me: failed program was:" >&5
16150 cat "conftest.$ac_ext" >&5
16151 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16152 fi
16153 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16154   done
16155 fi
16156 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16157 # Binary search between lo and hi bounds.
16158 while test "x$ac_lo" != "x$ac_hi"; do
16159   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16160   cat >"conftest.$ac_ext" <<_ACEOF
16161 #line 16161 "configure"
16162 #include "confdefs.h"
16163 $ac_includes_default
16164 int
16165 main (void)
16166 {
16167 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16168   ;
16169   return 0;
16170 }
16171 _ACEOF
16172 rm -f "conftest.$ac_objext"
16173 if { (eval echo "$as_me:16173: \"$ac_compile\"") >&5
16174   (eval $ac_compile) 2>&5
16175   ac_status=$?
16176   echo "$as_me:16176: \$? = $ac_status" >&5
16177   (exit "$ac_status"); } &&
16178          { ac_try='test -s "conftest.$ac_objext"'
16179   { (eval echo "$as_me:16179: \"$ac_try\"") >&5
16180   (eval $ac_try) 2>&5
16181   ac_status=$?
16182   echo "$as_me:16182: \$? = $ac_status" >&5
16183   (exit "$ac_status"); }; }; then
16184   ac_hi=$ac_mid
16185 else
16186   echo "$as_me: failed program was:" >&5
16187 cat "conftest.$ac_ext" >&5
16188 ac_lo=`expr "$ac_mid" + 1`
16189 fi
16190 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16191 done
16192 ac_cv_sizeof_signed_char=$ac_lo
16193 else
16194   if test "$cross_compiling" = yes; then
16195   { { echo "$as_me:16195: error: cannot run test program while cross compiling" >&5
16196 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16197    { (exit 1); exit 1; }; }
16198 else
16199   cat >"conftest.$ac_ext" <<_ACEOF
16200 #line 16200 "configure"
16201 #include "confdefs.h"
16202 $ac_includes_default
16203 int
16204 main (void)
16205 {
16206 FILE *f = fopen ("conftest.val", "w");
16207 if (!f)
16208   $ac_main_return (1);
16209 fprintf (f, "%ld", (long)(sizeof (signed char)));
16210 fclose (f);
16211   ;
16212   return 0;
16213 }
16214 _ACEOF
16215 rm -f "conftest$ac_exeext"
16216 if { (eval echo "$as_me:16216: \"$ac_link\"") >&5
16217   (eval $ac_link) 2>&5
16218   ac_status=$?
16219   echo "$as_me:16219: \$? = $ac_status" >&5
16220   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16221   { (eval echo "$as_me:16221: \"$ac_try\"") >&5
16222   (eval $ac_try) 2>&5
16223   ac_status=$?
16224   echo "$as_me:16224: \$? = $ac_status" >&5
16225   (exit "$ac_status"); }; }; then
16226   ac_cv_sizeof_signed_char=`cat conftest.val`
16227 else
16228   echo "$as_me: program exited with status $ac_status" >&5
16229 echo "$as_me: failed program was:" >&5
16230 cat "conftest.$ac_ext" >&5
16231 fi
16232 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16233 fi
16234 fi
16235 rm -f conftest.val
16236 else
16237   ac_cv_sizeof_signed_char=0
16238 fi
16239 fi
16240 echo "$as_me:16240: result: $ac_cv_sizeof_signed_char" >&5
16241 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16242 cat >>confdefs.h <<EOF
16243 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16244 EOF
16245
16246 echo "$as_me:16246: checking for ANSI C header files" >&5
16247 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16248 if test "${ac_cv_header_stdc+set}" = set; then
16249   echo $ECHO_N "(cached) $ECHO_C" >&6
16250 else
16251   cat >"conftest.$ac_ext" <<_ACEOF
16252 #line 16252 "configure"
16253 #include "confdefs.h"
16254 #include <stdlib.h>
16255 #include <stdarg.h>
16256 #include <string.h>
16257 #include <float.h>
16258
16259 _ACEOF
16260 if { (eval echo "$as_me:16260: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16261   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16262   ac_status=$?
16263   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16264   rm -f conftest.er1
16265   cat conftest.err >&5
16266   echo "$as_me:16266: \$? = $ac_status" >&5
16267   (exit "$ac_status"); } >/dev/null; then
16268   if test -s conftest.err; then
16269     ac_cpp_err=$ac_c_preproc_warn_flag
16270   else
16271     ac_cpp_err=
16272   fi
16273 else
16274   ac_cpp_err=yes
16275 fi
16276 if test -z "$ac_cpp_err"; then
16277   ac_cv_header_stdc=yes
16278 else
16279   echo "$as_me: failed program was:" >&5
16280   cat "conftest.$ac_ext" >&5
16281   ac_cv_header_stdc=no
16282 fi
16283 rm -f conftest.err "conftest.$ac_ext"
16284
16285 if test $ac_cv_header_stdc = yes; then
16286   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16287   cat >"conftest.$ac_ext" <<_ACEOF
16288 #line 16288 "configure"
16289 #include "confdefs.h"
16290 #include <string.h>
16291
16292 _ACEOF
16293 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16294   $EGREP "memchr" >/dev/null 2>&1; then
16295   :
16296 else
16297   ac_cv_header_stdc=no
16298 fi
16299 rm -rf conftest*
16300
16301 fi
16302
16303 if test $ac_cv_header_stdc = yes; then
16304   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16305   cat >"conftest.$ac_ext" <<_ACEOF
16306 #line 16306 "configure"
16307 #include "confdefs.h"
16308 #include <stdlib.h>
16309
16310 _ACEOF
16311 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16312   $EGREP "free" >/dev/null 2>&1; then
16313   :
16314 else
16315   ac_cv_header_stdc=no
16316 fi
16317 rm -rf conftest*
16318
16319 fi
16320
16321 if test $ac_cv_header_stdc = yes; then
16322   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16323   if test "$cross_compiling" = yes; then
16324   :
16325 else
16326   cat >"conftest.$ac_ext" <<_ACEOF
16327 #line 16327 "configure"
16328 #include "confdefs.h"
16329 #include <ctype.h>
16330 #if ((' ' & 0x0FF) == 0x020)
16331 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16332 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16333 #else
16334 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16335                      || ('j' <= (c) && (c) <= 'r') \
16336                      || ('s' <= (c) && (c) <= 'z'))
16337 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16338 #endif
16339
16340 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16341 int
16342 main (void)
16343 {
16344   int i;
16345   for (i = 0; i < 256; i++)
16346     if (XOR (islower (i), ISLOWER (i))
16347         || toupper (i) != TOUPPER (i))
16348       $ac_main_return(2);
16349   $ac_main_return (0);
16350 }
16351 _ACEOF
16352 rm -f "conftest$ac_exeext"
16353 if { (eval echo "$as_me:16353: \"$ac_link\"") >&5
16354   (eval $ac_link) 2>&5
16355   ac_status=$?
16356   echo "$as_me:16356: \$? = $ac_status" >&5
16357   (exit "$ac_status"); } && { ac_try='"./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   :
16364 else
16365   echo "$as_me: program exited with status $ac_status" >&5
16366 echo "$as_me: failed program was:" >&5
16367 cat "conftest.$ac_ext" >&5
16368 ac_cv_header_stdc=no
16369 fi
16370 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16371 fi
16372 fi
16373 fi
16374 echo "$as_me:16374: result: $ac_cv_header_stdc" >&5
16375 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16376 if test $ac_cv_header_stdc = yes; then
16377
16378 cat >>confdefs.h <<\EOF
16379 #define STDC_HEADERS 1
16380 EOF
16381
16382 fi
16383
16384 ac_header_dirent=no
16385 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16386   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16387 echo "$as_me:16387: checking for $ac_hdr that defines DIR" >&5
16388 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16389 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16390   echo $ECHO_N "(cached) $ECHO_C" >&6
16391 else
16392   cat >"conftest.$ac_ext" <<_ACEOF
16393 #line 16393 "configure"
16394 #include "confdefs.h"
16395 #include <sys/types.h>
16396 #include <$ac_hdr>
16397
16398 int
16399 main (void)
16400 {
16401 if ((DIR *) 0)
16402 return 0;
16403   ;
16404   return 0;
16405 }
16406 _ACEOF
16407 rm -f "conftest.$ac_objext"
16408 if { (eval echo "$as_me:16408: \"$ac_compile\"") >&5
16409   (eval $ac_compile) 2>&5
16410   ac_status=$?
16411   echo "$as_me:16411: \$? = $ac_status" >&5
16412   (exit "$ac_status"); } &&
16413          { ac_try='test -s "conftest.$ac_objext"'
16414   { (eval echo "$as_me:16414: \"$ac_try\"") >&5
16415   (eval $ac_try) 2>&5
16416   ac_status=$?
16417   echo "$as_me:16417: \$? = $ac_status" >&5
16418   (exit "$ac_status"); }; }; then
16419   eval "$as_ac_Header=yes"
16420 else
16421   echo "$as_me: failed program was:" >&5
16422 cat "conftest.$ac_ext" >&5
16423 eval "$as_ac_Header=no"
16424 fi
16425 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16426 fi
16427 echo "$as_me:16427: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16428 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16429 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16430   cat >>confdefs.h <<EOF
16431 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16432 EOF
16433
16434 ac_header_dirent=$ac_hdr; break
16435 fi
16436
16437 done
16438 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16439 if test $ac_header_dirent = dirent.h; then
16440   echo "$as_me:16440: checking for opendir in -ldir" >&5
16441 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16442 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16443   echo $ECHO_N "(cached) $ECHO_C" >&6
16444 else
16445   ac_check_lib_save_LIBS=$LIBS
16446 LIBS="-ldir  $LIBS"
16447 cat >"conftest.$ac_ext" <<_ACEOF
16448 #line 16448 "configure"
16449 #include "confdefs.h"
16450
16451 /* Override any gcc2 internal prototype to avoid an error.  */
16452 #ifdef __cplusplus
16453 extern "C"
16454 #endif
16455 /* We use char because int might match the return type of a gcc2
16456    builtin and then its argument prototype would still apply.  */
16457 char opendir ();
16458 int
16459 main (void)
16460 {
16461 opendir ();
16462   ;
16463   return 0;
16464 }
16465 _ACEOF
16466 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16467 if { (eval echo "$as_me:16467: \"$ac_link\"") >&5
16468   (eval $ac_link) 2>&5
16469   ac_status=$?
16470   echo "$as_me:16470: \$? = $ac_status" >&5
16471   (exit "$ac_status"); } &&
16472          { ac_try='test -s "conftest$ac_exeext"'
16473   { (eval echo "$as_me:16473: \"$ac_try\"") >&5
16474   (eval $ac_try) 2>&5
16475   ac_status=$?
16476   echo "$as_me:16476: \$? = $ac_status" >&5
16477   (exit "$ac_status"); }; }; then
16478   ac_cv_lib_dir_opendir=yes
16479 else
16480   echo "$as_me: failed program was:" >&5
16481 cat "conftest.$ac_ext" >&5
16482 ac_cv_lib_dir_opendir=no
16483 fi
16484 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16485 LIBS=$ac_check_lib_save_LIBS
16486 fi
16487 echo "$as_me:16487: result: $ac_cv_lib_dir_opendir" >&5
16488 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16489 if test "$ac_cv_lib_dir_opendir" = yes; then
16490   LIBS="$LIBS -ldir"
16491 fi
16492
16493 else
16494   echo "$as_me:16494: checking for opendir in -lx" >&5
16495 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16496 if test "${ac_cv_lib_x_opendir+set}" = set; then
16497   echo $ECHO_N "(cached) $ECHO_C" >&6
16498 else
16499   ac_check_lib_save_LIBS=$LIBS
16500 LIBS="-lx  $LIBS"
16501 cat >"conftest.$ac_ext" <<_ACEOF
16502 #line 16502 "configure"
16503 #include "confdefs.h"
16504
16505 /* Override any gcc2 internal prototype to avoid an error.  */
16506 #ifdef __cplusplus
16507 extern "C"
16508 #endif
16509 /* We use char because int might match the return type of a gcc2
16510    builtin and then its argument prototype would still apply.  */
16511 char opendir ();
16512 int
16513 main (void)
16514 {
16515 opendir ();
16516   ;
16517   return 0;
16518 }
16519 _ACEOF
16520 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16521 if { (eval echo "$as_me:16521: \"$ac_link\"") >&5
16522   (eval $ac_link) 2>&5
16523   ac_status=$?
16524   echo "$as_me:16524: \$? = $ac_status" >&5
16525   (exit "$ac_status"); } &&
16526          { ac_try='test -s "conftest$ac_exeext"'
16527   { (eval echo "$as_me:16527: \"$ac_try\"") >&5
16528   (eval $ac_try) 2>&5
16529   ac_status=$?
16530   echo "$as_me:16530: \$? = $ac_status" >&5
16531   (exit "$ac_status"); }; }; then
16532   ac_cv_lib_x_opendir=yes
16533 else
16534   echo "$as_me: failed program was:" >&5
16535 cat "conftest.$ac_ext" >&5
16536 ac_cv_lib_x_opendir=no
16537 fi
16538 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16539 LIBS=$ac_check_lib_save_LIBS
16540 fi
16541 echo "$as_me:16541: result: $ac_cv_lib_x_opendir" >&5
16542 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16543 if test "$ac_cv_lib_x_opendir" = yes; then
16544   LIBS="$LIBS -lx"
16545 fi
16546
16547 fi
16548
16549 echo "$as_me:16549: checking whether time.h and sys/time.h may both be included" >&5
16550 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16551 if test "${ac_cv_header_time+set}" = set; then
16552   echo $ECHO_N "(cached) $ECHO_C" >&6
16553 else
16554   cat >"conftest.$ac_ext" <<_ACEOF
16555 #line 16555 "configure"
16556 #include "confdefs.h"
16557 #include <sys/types.h>
16558 #include <sys/time.h>
16559 #include <time.h>
16560
16561 int
16562 main (void)
16563 {
16564 if ((struct tm *) 0)
16565 return 0;
16566   ;
16567   return 0;
16568 }
16569 _ACEOF
16570 rm -f "conftest.$ac_objext"
16571 if { (eval echo "$as_me:16571: \"$ac_compile\"") >&5
16572   (eval $ac_compile) 2>&5
16573   ac_status=$?
16574   echo "$as_me:16574: \$? = $ac_status" >&5
16575   (exit "$ac_status"); } &&
16576          { ac_try='test -s "conftest.$ac_objext"'
16577   { (eval echo "$as_me:16577: \"$ac_try\"") >&5
16578   (eval $ac_try) 2>&5
16579   ac_status=$?
16580   echo "$as_me:16580: \$? = $ac_status" >&5
16581   (exit "$ac_status"); }; }; then
16582   ac_cv_header_time=yes
16583 else
16584   echo "$as_me: failed program was:" >&5
16585 cat "conftest.$ac_ext" >&5
16586 ac_cv_header_time=no
16587 fi
16588 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16589 fi
16590 echo "$as_me:16590: result: $ac_cv_header_time" >&5
16591 echo "${ECHO_T}$ac_cv_header_time" >&6
16592 if test $ac_cv_header_time = yes; then
16593
16594 cat >>confdefs.h <<\EOF
16595 #define TIME_WITH_SYS_TIME 1
16596 EOF
16597
16598 fi
16599
16600 ###     checks for compiler characteristics
16601 ac_ext=c
16602 ac_cpp='$CPP $CPPFLAGS'
16603 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16604 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16605 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16606 ac_main_return="return"
16607
16608 echo "$as_me:16608: checking for an ANSI C-conforming const" >&5
16609 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16610 if test "${ac_cv_c_const+set}" = set; then
16611   echo $ECHO_N "(cached) $ECHO_C" >&6
16612 else
16613   cat >"conftest.$ac_ext" <<_ACEOF
16614 #line 16614 "configure"
16615 #include "confdefs.h"
16616
16617 int
16618 main (void)
16619 {
16620 /* FIXME: Include the comments suggested by Paul. */
16621 #ifndef __cplusplus
16622   /* Ultrix mips cc rejects this.  */
16623   typedef int charset[2];
16624   const charset x;
16625   /* SunOS 4.1.1 cc rejects this.  */
16626   char const *const *ccp;
16627   char **p;
16628   /* NEC SVR4.0.2 mips cc rejects this.  */
16629   struct point {int x, y;};
16630   static struct point const zero = {0,0};
16631   /* AIX XL C 1.02.0.0 rejects this.
16632      It does not let you subtract one const X* pointer from another in
16633      an arm of an if-expression whose if-part is not a constant
16634      expression */
16635   const char *g = "string";
16636   ccp = &g + (g ? g-g : 0);
16637   /* HPUX 7.0 cc rejects these. */
16638   ++ccp;
16639   p = (char**) ccp;
16640   ccp = (char const *const *) p;
16641   { /* SCO 3.2v4 cc rejects this.  */
16642     char *t;
16643     char const *s = 0 ? (char *) 0 : (char const *) 0;
16644
16645     *t++ = 0;
16646   }
16647   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16648     int x[] = {25, 17};
16649     const int *foo = &x[0];
16650     ++foo;
16651   }
16652   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16653     typedef const int *iptr;
16654     iptr p = 0;
16655     ++p;
16656   }
16657   { /* AIX XL C 1.02.0.0 rejects this saying
16658        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16659     struct s { int j; const int *ap[3]; };
16660     struct s *b; b->j = 5;
16661   }
16662   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16663     const int foo = 10;
16664   }
16665 #endif
16666
16667   ;
16668   return 0;
16669 }
16670 _ACEOF
16671 rm -f "conftest.$ac_objext"
16672 if { (eval echo "$as_me:16672: \"$ac_compile\"") >&5
16673   (eval $ac_compile) 2>&5
16674   ac_status=$?
16675   echo "$as_me:16675: \$? = $ac_status" >&5
16676   (exit "$ac_status"); } &&
16677          { ac_try='test -s "conftest.$ac_objext"'
16678   { (eval echo "$as_me:16678: \"$ac_try\"") >&5
16679   (eval $ac_try) 2>&5
16680   ac_status=$?
16681   echo "$as_me:16681: \$? = $ac_status" >&5
16682   (exit "$ac_status"); }; }; then
16683   ac_cv_c_const=yes
16684 else
16685   echo "$as_me: failed program was:" >&5
16686 cat "conftest.$ac_ext" >&5
16687 ac_cv_c_const=no
16688 fi
16689 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16690 fi
16691 echo "$as_me:16691: result: $ac_cv_c_const" >&5
16692 echo "${ECHO_T}$ac_cv_c_const" >&6
16693 if test $ac_cv_c_const = no; then
16694
16695 cat >>confdefs.h <<\EOF
16696 #define const
16697 EOF
16698
16699 fi
16700
16701 ###     Checks for external-data
16702
16703 echo "$as_me:16703: checking if data-only library module links" >&5
16704 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16705 if test "${cf_cv_link_dataonly+set}" = set; then
16706   echo $ECHO_N "(cached) $ECHO_C" >&6
16707 else
16708
16709         rm -f conftest.a
16710         cat >conftest.$ac_ext <<EOF
16711 #line 16711 "configure"
16712 int     testdata[3] = { 123, 456, 789 };
16713 EOF
16714         if { (eval echo "$as_me:16714: \"$ac_compile\"") >&5
16715   (eval $ac_compile) 2>&5
16716   ac_status=$?
16717   echo "$as_me:16717: \$? = $ac_status" >&5
16718   (exit "$ac_status"); } ; then
16719                 mv conftest.o data.o && \
16720                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16721         fi
16722         rm -f conftest.$ac_ext data.o
16723         cat >conftest.$ac_ext <<EOF
16724 #line 16724 "configure"
16725 int     testfunc(void)
16726 {
16727 #if defined(NeXT)
16728         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16729 #else
16730         extern int testdata[3];
16731         return testdata[0] == 123
16732            &&  testdata[1] == 456
16733            &&  testdata[2] == 789;
16734 #endif
16735 }
16736 EOF
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"); }; then
16742                 mv conftest.o func.o && \
16743                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16744         fi
16745         rm -f conftest.$ac_ext func.o
16746         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16747         cf_saveLIBS="$LIBS"
16748         LIBS="conftest.a $LIBS"
16749         if test "$cross_compiling" = yes; then
16750   cf_cv_link_dataonly=unknown
16751 else
16752   cat >"conftest.$ac_ext" <<_ACEOF
16753 #line 16753 "configure"
16754 #include "confdefs.h"
16755
16756         int main(void)
16757         {
16758                 extern int testfunc();
16759                 ${cf_cv_main_return:-return} (!testfunc());
16760         }
16761
16762 _ACEOF
16763 rm -f "conftest$ac_exeext"
16764 if { (eval echo "$as_me:16764: \"$ac_link\"") >&5
16765   (eval $ac_link) 2>&5
16766   ac_status=$?
16767   echo "$as_me:16767: \$? = $ac_status" >&5
16768   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16769   { (eval echo "$as_me:16769: \"$ac_try\"") >&5
16770   (eval $ac_try) 2>&5
16771   ac_status=$?
16772   echo "$as_me:16772: \$? = $ac_status" >&5
16773   (exit "$ac_status"); }; }; then
16774   cf_cv_link_dataonly=yes
16775 else
16776   echo "$as_me: program exited with status $ac_status" >&5
16777 echo "$as_me: failed program was:" >&5
16778 cat "conftest.$ac_ext" >&5
16779 cf_cv_link_dataonly=no
16780 fi
16781 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16782 fi
16783         LIBS="$cf_saveLIBS"
16784
16785 fi
16786
16787 echo "$as_me:16787: result: $cf_cv_link_dataonly" >&5
16788 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16789
16790 if test "$cf_cv_link_dataonly" = no ; then
16791
16792 cat >>confdefs.h <<\EOF
16793 #define BROKEN_LINKER 1
16794 EOF
16795
16796         BROKEN_LINKER=1
16797 fi
16798
16799 ###     Checks for library functions.
16800
16801 for ac_header in \
16802 unistd.h \
16803
16804 do
16805 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16806 echo "$as_me:16806: checking for $ac_header" >&5
16807 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16808 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16809   echo $ECHO_N "(cached) $ECHO_C" >&6
16810 else
16811   cat >"conftest.$ac_ext" <<_ACEOF
16812 #line 16812 "configure"
16813 #include "confdefs.h"
16814 #include <$ac_header>
16815 _ACEOF
16816 if { (eval echo "$as_me:16816: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16817   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16818   ac_status=$?
16819   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16820   rm -f conftest.er1
16821   cat conftest.err >&5
16822   echo "$as_me:16822: \$? = $ac_status" >&5
16823   (exit "$ac_status"); } >/dev/null; then
16824   if test -s conftest.err; then
16825     ac_cpp_err=$ac_c_preproc_warn_flag
16826   else
16827     ac_cpp_err=
16828   fi
16829 else
16830   ac_cpp_err=yes
16831 fi
16832 if test -z "$ac_cpp_err"; then
16833   eval "$as_ac_Header=yes"
16834 else
16835   echo "$as_me: failed program was:" >&5
16836   cat "conftest.$ac_ext" >&5
16837   eval "$as_ac_Header=no"
16838 fi
16839 rm -f conftest.err "conftest.$ac_ext"
16840 fi
16841 echo "$as_me:16841: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16842 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16843 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16844   cat >>confdefs.h <<EOF
16845 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16846 EOF
16847
16848 fi
16849 done
16850
16851 echo "$as_me:16851: checking for working mkstemp" >&5
16852 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16853 if test "${cf_cv_func_mkstemp+set}" = set; then
16854   echo $ECHO_N "(cached) $ECHO_C" >&6
16855 else
16856
16857 rm -rf ./conftest*
16858 if test "$cross_compiling" = yes; then
16859   cf_cv_func_mkstemp=maybe
16860 else
16861   cat >"conftest.$ac_ext" <<_ACEOF
16862 #line 16862 "configure"
16863 #include "confdefs.h"
16864
16865 #include <sys/types.h>
16866 #ifdef HAVE_UNISTD_H
16867 #include <unistd.h>
16868 #endif
16869 #include <stdlib.h>
16870 #include <stdio.h>
16871 #include <string.h>
16872 #include <sys/stat.h>
16873 int main(void)
16874 {
16875         char *tmpl = "conftestXXXXXX";
16876         char name[2][80];
16877         int n;
16878         int result = 0;
16879         int fd;
16880         struct stat sb;
16881
16882         umask(077);
16883         for (n = 0; n < 2; ++n) {
16884                 strcpy(name[n], tmpl);
16885                 if ((fd = mkstemp(name[n])) >= 0) {
16886                         if (!strcmp(name[n], tmpl)
16887                          || stat(name[n], &sb) != 0
16888                          || (sb.st_mode & S_IFMT) != S_IFREG
16889                          || (sb.st_mode & 077) != 0) {
16890                                 result = 1;
16891                         }
16892                         close(fd);
16893                 }
16894         }
16895         if (result == 0
16896          && !strcmp(name[0], name[1]))
16897                 result = 1;
16898         ${cf_cv_main_return:-return}(result);
16899 }
16900
16901 _ACEOF
16902 rm -f "conftest$ac_exeext"
16903 if { (eval echo "$as_me:16903: \"$ac_link\"") >&5
16904   (eval $ac_link) 2>&5
16905   ac_status=$?
16906   echo "$as_me:16906: \$? = $ac_status" >&5
16907   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16908   { (eval echo "$as_me:16908: \"$ac_try\"") >&5
16909   (eval $ac_try) 2>&5
16910   ac_status=$?
16911   echo "$as_me:16911: \$? = $ac_status" >&5
16912   (exit "$ac_status"); }; }; then
16913   cf_cv_func_mkstemp=yes
16914
16915 else
16916   echo "$as_me: program exited with status $ac_status" >&5
16917 echo "$as_me: failed program was:" >&5
16918 cat "conftest.$ac_ext" >&5
16919 cf_cv_func_mkstemp=no
16920
16921 fi
16922 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16923 fi
16924
16925 fi
16926 echo "$as_me:16926: result: $cf_cv_func_mkstemp" >&5
16927 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16928 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16929         echo "$as_me:16929: checking for mkstemp" >&5
16930 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16931 if test "${ac_cv_func_mkstemp+set}" = set; then
16932   echo $ECHO_N "(cached) $ECHO_C" >&6
16933 else
16934   cat >"conftest.$ac_ext" <<_ACEOF
16935 #line 16935 "configure"
16936 #include "confdefs.h"
16937 #define mkstemp autoconf_temporary
16938 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16939 #undef mkstemp
16940
16941 #ifdef __cplusplus
16942 extern "C"
16943 #endif
16944
16945 /* We use char because int might match the return type of a gcc2
16946    builtin and then its argument prototype would still apply.  */
16947 char mkstemp (void);
16948
16949 int
16950 main (void)
16951 {
16952
16953 /* The GNU C library defines stubs for functions which it implements
16954     to always fail with ENOSYS.  Some functions are actually named
16955     something starting with __ and the normal name is an alias.  */
16956 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16957 #error found stub for mkstemp
16958 #endif
16959
16960         return mkstemp ();
16961   ;
16962   return 0;
16963 }
16964 _ACEOF
16965 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16966 if { (eval echo "$as_me:16966: \"$ac_link\"") >&5
16967   (eval $ac_link) 2>&5
16968   ac_status=$?
16969   echo "$as_me:16969: \$? = $ac_status" >&5
16970   (exit "$ac_status"); } &&
16971          { ac_try='test -s "conftest$ac_exeext"'
16972   { (eval echo "$as_me:16972: \"$ac_try\"") >&5
16973   (eval $ac_try) 2>&5
16974   ac_status=$?
16975   echo "$as_me:16975: \$? = $ac_status" >&5
16976   (exit "$ac_status"); }; }; then
16977   ac_cv_func_mkstemp=yes
16978 else
16979   echo "$as_me: failed program was:" >&5
16980 cat "conftest.$ac_ext" >&5
16981 ac_cv_func_mkstemp=no
16982 fi
16983 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16984 fi
16985 echo "$as_me:16985: result: $ac_cv_func_mkstemp" >&5
16986 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16987
16988 fi
16989 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16990
16991 cat >>confdefs.h <<\EOF
16992 #define HAVE_MKSTEMP 1
16993 EOF
16994
16995 fi
16996
16997 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16998         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
16999         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17000 fi
17001
17002 cf_with_ada=yes
17003 if test "$cf_with_ada" != "no" ; then
17004
17005 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17006 do
17007
17008 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17009
17010         unset ac_cv_path_cf_TEMP_gnat
17011         unset cf_TEMP_gnat
17012         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17013 set dummy $cf_prog_gnat; ac_word=$2
17014 echo "$as_me:17014: checking for $ac_word" >&5
17015 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17016 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17017   echo $ECHO_N "(cached) $ECHO_C" >&6
17018 else
17019   case $cf_TEMP_gnat in
17020   [\\/]* | ?:[\\/]*)
17021   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17022   ;;
17023   *)
17024   ac_save_IFS=$IFS; IFS=$ac_path_separator
17025 ac_dummy="$PATH"
17026 for ac_dir in $ac_dummy; do
17027   IFS=$ac_save_IFS
17028   test -z "$ac_dir" && ac_dir=.
17029   if $as_executable_p "$ac_dir/$ac_word"; then
17030    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17031    echo "$as_me:17031: found $ac_dir/$ac_word" >&5
17032    break
17033 fi
17034 done
17035
17036   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17037   ;;
17038 esac
17039 fi
17040 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17041
17042 if test -n "$cf_TEMP_gnat"; then
17043   echo "$as_me:17043: result: $cf_TEMP_gnat" >&5
17044 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17045 else
17046   echo "$as_me:17046: result: no" >&5
17047 echo "${ECHO_T}no" >&6
17048 fi
17049
17050         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17051
17052         if test "x$cf_TEMP_gnat" != xno; then
17053                 unset cf_cv_gnat_version
17054                 unset cf_TEMP_gnat
17055
17056 echo "$as_me:17056: checking for $cf_prog_gnat version" >&5
17057 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17058 if test "${cf_cv_gnat_version+set}" = set; then
17059   echo $ECHO_N "(cached) $ECHO_C" >&6
17060 else
17061
17062 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17063         grep '[0-9].[0-9][0-9]*' |\
17064         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17065
17066 fi
17067 echo "$as_me:17067: result: $cf_cv_gnat_version" >&5
17068 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17069 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17070 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17071
17072         fi
17073         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17074
17075         unset cf_TEMP_gnat
17076         unset cf_cv_gnat_version
17077         unset ac_cv_path_cf_TEMP_gnat
17078 done
17079
17080 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17081         cf_ada_make=
17082         cf_cv_prog_gnat_correct=no
17083 else
17084         cf_ada_make=gnatmake
17085         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17086                 # gprconfig is newer than gnatmake; we can continue...
17087                 cf_ada_config="##"
17088         else
17089                 rm -rf ./conftest* ./*~conftest*
17090                 if mkdir conftest.src
17091                 then
17092                         cf_ada_config=""
17093                         cd conftest.src
17094                         for cf_gprconfig in Ada C
17095                         do
17096                                 echo "$as_me:17096: checking for gprconfig name for $cf_gprconfig" >&5
17097 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17098                                 if test "$cf_gprconfig" = C
17099                                 then
17100                                         for cf_gprconfig_param in \
17101                                                 "$cf_gprconfig,,,,GNATGCC" \
17102                                                 "$cf_gprconfig,,,,GCC" \
17103                                                 "$cf_gprconfig"
17104                                         do
17105                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17106                                                 test -n "$cf_gprconfig_value" && break
17107                                         done
17108                                 else
17109                                         cf_gprconfig_param=$cf_gprconfig
17110                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17111                                 fi
17112                                 if test -n "$cf_gprconfig_value"
17113                                 then
17114                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17115                                         echo "$as_me:17115: result: $cf_gprconfig_value" >&5
17116 echo "${ECHO_T}$cf_gprconfig_value" >&6
17117                                 else
17118                                         echo "$as_me:17118: result: missing" >&5
17119 echo "${ECHO_T}missing" >&6
17120                                         cf_ada_config="#"
17121                                         break
17122                                 fi
17123                         done
17124                         cd ..
17125                         rm -rf ./conftest* ./*~conftest*
17126                 fi
17127         fi
17128         if test "x$cf_ada_config" != "x#"
17129         then
17130
17131 echo "$as_me:17131: checking for gnat version" >&5
17132 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17133 if test "${cf_cv_gnat_version+set}" = set; then
17134   echo $ECHO_N "(cached) $ECHO_C" >&6
17135 else
17136
17137 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17138         grep '[0-9].[0-9][0-9]*' |\
17139         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17140
17141 fi
17142 echo "$as_me:17142: result: $cf_cv_gnat_version" >&5
17143 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17144 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17145
17146 case "$cf_cv_gnat_version" in
17147 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17148         cf_cv_prog_gnat_correct=yes
17149         ;;
17150 (*)
17151         { echo "$as_me:17151: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17152 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17153         cf_cv_prog_gnat_correct=no
17154         ;;
17155 esac
17156
17157                 # Extract the first word of "m4", so it can be a program name with args.
17158 set dummy m4; ac_word=$2
17159 echo "$as_me:17159: checking for $ac_word" >&5
17160 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17161 if test "${ac_cv_prog_M4_exists+set}" = set; then
17162   echo $ECHO_N "(cached) $ECHO_C" >&6
17163 else
17164   if test -n "$M4_exists"; then
17165   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17166 else
17167   ac_save_IFS=$IFS; IFS=$ac_path_separator
17168 ac_dummy="$PATH"
17169 for ac_dir in $ac_dummy; do
17170   IFS=$ac_save_IFS
17171   test -z "$ac_dir" && ac_dir=.
17172   $as_executable_p "$ac_dir/$ac_word" || continue
17173 ac_cv_prog_M4_exists="yes"
17174 echo "$as_me:17174: found $ac_dir/$ac_word" >&5
17175 break
17176 done
17177
17178   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17179 fi
17180 fi
17181 M4_exists=$ac_cv_prog_M4_exists
17182 if test -n "$M4_exists"; then
17183   echo "$as_me:17183: result: $M4_exists" >&5
17184 echo "${ECHO_T}$M4_exists" >&6
17185 else
17186   echo "$as_me:17186: result: no" >&5
17187 echo "${ECHO_T}no" >&6
17188 fi
17189
17190                 if test "$ac_cv_prog_M4_exists" = no; then
17191                         cf_cv_prog_gnat_correct=no
17192                         { echo "$as_me:17192: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17193 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17194                 fi
17195                 if test "$cf_cv_prog_gnat_correct" = yes; then
17196                         echo "$as_me:17196: checking if GNAT works" >&5
17197 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17198
17199 rm -rf ./conftest* ./*~conftest*
17200 cat >>conftest.ads <<CF_EOF
17201 procedure conftest;
17202 CF_EOF
17203 cat >>conftest.adb <<CF_EOF
17204 with Text_IO;
17205 with GNAT.OS_Lib;
17206 procedure conftest is
17207 begin
17208    Text_IO.Put ("Hello World");
17209    Text_IO.New_Line;
17210    GNAT.OS_Lib.OS_Exit (0);
17211 end conftest;
17212 CF_EOF
17213 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17214    if ( ./conftest 1>&5 2>&1 ) ; then
17215       cf_cv_prog_gnat_correct=yes
17216    else
17217       cf_cv_prog_gnat_correct=no
17218    fi
17219 else
17220    cf_cv_prog_gnat_correct=no
17221 fi
17222 rm -rf ./conftest* ./*~conftest*
17223
17224                         echo "$as_me:17224: result: $cf_cv_prog_gnat_correct" >&5
17225 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17226                 fi
17227         else
17228                 cf_cv_prog_gnat_correct=no
17229         fi
17230 fi
17231
17232         if test "$cf_cv_prog_gnat_correct" = yes; then
17233
17234         echo "$as_me:17234: checking optimization options for ADAFLAGS" >&5
17235 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17236         case "$CFLAGS" in
17237         (*-g*)
17238
17239         ADAFLAGS="$ADAFLAGS -g"
17240
17241                 ;;
17242         esac
17243         case "$CFLAGS" in
17244         (*-O*)
17245                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17246
17247         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17248
17249                 ;;
17250         esac
17251         echo "$as_me:17251: result: $ADAFLAGS" >&5
17252 echo "${ECHO_T}$ADAFLAGS" >&6
17253
17254 echo "$as_me:17254: checking if GNATPREP supports -T option" >&5
17255 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17256 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17257   echo $ECHO_N "(cached) $ECHO_C" >&6
17258 else
17259
17260 cf_cv_gnatprep_opt_t=no
17261 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17262
17263 fi
17264 echo "$as_me:17264: result: $cf_cv_gnatprep_opt_t" >&5
17265 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17266 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17267
17268 echo "$as_me:17268: checking if GNAT supports generics" >&5
17269 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17270 case "$cf_cv_gnat_version" in
17271 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17272         cf_gnat_generics=yes
17273         ;;
17274 (*)
17275         cf_gnat_generics=no
17276         ;;
17277 esac
17278 echo "$as_me:17278: result: $cf_gnat_generics" >&5
17279 echo "${ECHO_T}$cf_gnat_generics" >&6
17280
17281 if test "$cf_gnat_generics" = yes
17282 then
17283         cf_compile_generics=generics
17284         cf_generic_objects="\${GENOBJS}"
17285 else
17286         cf_compile_generics=
17287         cf_generic_objects=
17288 fi
17289
17290 echo "$as_me:17290: checking if GNAT supports SIGINT" >&5
17291 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17292 if test "${cf_cv_gnat_sigint+set}" = set; then
17293   echo $ECHO_N "(cached) $ECHO_C" >&6
17294 else
17295
17296 rm -rf ./conftest* ./*~conftest*
17297 cat >>conftest.ads <<CF_EOF
17298 with Ada.Interrupts.Names;
17299
17300 package ConfTest is
17301
17302    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17303    pragma Unreserve_All_Interrupts;
17304    pragma Warnings (On);
17305
17306    protected Process is
17307       procedure Stop;
17308       function Continue return Boolean;
17309       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17310    private
17311       Done : Boolean := False;
17312    end Process;
17313
17314 end ConfTest;
17315 CF_EOF
17316 cat >>conftest.adb <<CF_EOF
17317 package body ConfTest is
17318    protected body Process is
17319       procedure Stop is
17320       begin
17321          Done := True;
17322       end Stop;
17323       function Continue return Boolean is
17324       begin
17325          return not Done;
17326       end Continue;
17327    end Process;
17328 end ConfTest;
17329 CF_EOF
17330 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17331       cf_cv_gnat_sigint=yes
17332 else
17333    cf_cv_gnat_sigint=no
17334 fi
17335 rm -rf ./conftest* ./*~conftest*
17336
17337 fi
17338 echo "$as_me:17338: result: $cf_cv_gnat_sigint" >&5
17339 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17340
17341 if test "$cf_cv_gnat_sigint" = yes ; then
17342         USE_GNAT_SIGINT=""
17343 else
17344         USE_GNAT_SIGINT="#"
17345 fi
17346
17347 cf_gnat_libraries=no
17348 cf_gnat_projects=no
17349
17350 if test "$enable_gnat_projects" != no ; then
17351 echo "$as_me:17351: checking if GNAT supports project files" >&5
17352 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17353 case "$cf_cv_gnat_version" in
17354 (3.[0-9]*)
17355         ;;
17356 (*)
17357         case "$cf_cv_system_name" in
17358         (cygwin*|msys*)
17359                 ;;
17360         (*)
17361                 rm -rf ./conftest* ./*~conftest*
17362                 if mkdir conftest.src conftest.bin conftest.lib
17363                 then
17364                         cd conftest.src
17365                         rm -rf ./conftest* ./*~conftest*
17366                         cat >>library.gpr <<CF_EOF
17367 project Library is
17368   Kind := External ("LIB_KIND");
17369   for Library_Name use "ConfTest";
17370   for Object_Dir use ".";
17371   for Library_ALI_Dir use External("LIBRARY_DIR");
17372   for Library_Version use External ("SONAME");
17373   for Library_Kind use Kind;
17374   for Library_Dir use External("BUILD_DIR");
17375   Source_Dir := External ("SOURCE_DIR");
17376   for Source_Dirs use (Source_Dir);
17377 end Library;
17378 CF_EOF
17379                         cat >>confpackage.ads <<CF_EOF
17380 package ConfPackage is
17381    procedure conftest;
17382 end ConfPackage;
17383 CF_EOF
17384                         cat >>confpackage.adb <<CF_EOF
17385 with Text_IO;
17386 package body ConfPackage is
17387    procedure conftest is
17388    begin
17389       Text_IO.Put ("Hello World");
17390       Text_IO.New_Line;
17391    end conftest;
17392 end ConfPackage;
17393 CF_EOF
17394                         if ( "$cf_ada_make" $ADAFLAGS \
17395                                         -Plibrary.gpr \
17396                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17397                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17398                                         -XSOURCE_DIR="`pwd`" \
17399                                         -XSONAME=libConfTest.so.1 \
17400                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17401                                 cf_gnat_projects=yes
17402                         fi
17403                         cd ..
17404                 fi
17405                 if test -f conftest.lib/confpackage.ali
17406                 then
17407                         cf_gnat_libraries=yes
17408                 fi
17409                 rm -rf ./conftest* ./*~conftest*
17410                 ;;
17411         esac
17412         ;;
17413 esac
17414 echo "$as_me:17414: result: $cf_gnat_projects" >&5
17415 echo "${ECHO_T}$cf_gnat_projects" >&6
17416 fi # enable_gnat_projects
17417
17418 if test "$cf_gnat_projects" = yes
17419 then
17420         echo "$as_me:17420: checking if GNAT supports libraries" >&5
17421 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17422         echo "$as_me:17422: result: $cf_gnat_libraries" >&5
17423 echo "${ECHO_T}$cf_gnat_libraries" >&6
17424 fi
17425
17426 USE_OLD_MAKERULES=""
17427 USE_GNAT_PROJECTS="#"
17428 USE_GNAT_MAKE_GPR="#"
17429 USE_GNAT_GPRBUILD="#"
17430
17431 if test "$cf_gnat_projects" = yes
17432 then
17433         USE_OLD_MAKERULES="#"
17434         USE_GNAT_PROJECTS=""
17435         if test "$cf_cv_VERSION_GPRBUILD" != no
17436         then
17437                 USE_GNAT_GPRBUILD=""
17438         elif test "$cf_cv_VERSION_GNATMAKE" != no
17439         then
17440                 USE_GNAT_MAKE_GPR=""
17441         else
17442                 { echo "$as_me:17442: WARNING: use old makefile rules since tools are missing" >&5
17443 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17444         fi
17445 fi
17446
17447 if test "$cf_gnat_libraries" = yes
17448 then
17449         USE_GNAT_LIBRARIES=""
17450 else
17451         USE_GNAT_LIBRARIES="#"
17452 fi
17453
17454 echo "$as_me:17454: checking for ada-compiler" >&5
17455 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17456
17457 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17458 if test "${with_ada_compiler+set}" = set; then
17459   withval="$with_ada_compiler"
17460   cf_ada_compiler=$withval
17461 else
17462   cf_ada_compiler=gnatmake
17463 fi;
17464
17465 echo "$as_me:17465: result: $cf_ada_compiler" >&5
17466 echo "${ECHO_T}$cf_ada_compiler" >&6
17467
17468                 cf_ada_package=terminal_interface
17469
17470 echo "$as_me:17470: checking for ada-include" >&5
17471 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17472
17473 # Check whether --with-ada-include or --without-ada-include was given.
17474 if test "${with_ada_include+set}" = set; then
17475   withval="$with_ada_include"
17476
17477 else
17478   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17479 fi; if test -n "$prefix/share/ada/adainclude" ; then
17480
17481 if test "x$prefix" != xNONE; then
17482         cf_path_syntax="$prefix"
17483 else
17484         cf_path_syntax="$ac_default_prefix"
17485 fi
17486
17487 case ".$withval" in
17488 (.\$\(*\)*|.\'*\'*)
17489         ;;
17490 (..|./*|.\\*)
17491         ;;
17492 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17493         ;;
17494 (.\$\{*prefix\}*|.\$\{*dir\}*)
17495         eval withval="$withval"
17496         case ".$withval" in
17497         (.NONE/*)
17498                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17499                 ;;
17500         esac
17501         ;;
17502 (.no|.NONE/*)
17503         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17504         ;;
17505 (*)
17506         { { echo "$as_me:17506: error: expected a pathname, not \"$withval\"" >&5
17507 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17508    { (exit 1); exit 1; }; }
17509         ;;
17510 esac
17511
17512 fi
17513 eval ADA_INCLUDE="$withval"
17514
17515 echo "$as_me:17515: result: $ADA_INCLUDE" >&5
17516 echo "${ECHO_T}$ADA_INCLUDE" >&6
17517
17518 echo "$as_me:17518: checking for ada-objects" >&5
17519 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17520
17521 # Check whether --with-ada-objects or --without-ada-objects was given.
17522 if test "${with_ada_objects+set}" = set; then
17523   withval="$with_ada_objects"
17524
17525 else
17526   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17527 fi; if test -n "$prefix/lib/ada/adalib" ; then
17528
17529 if test "x$prefix" != xNONE; then
17530         cf_path_syntax="$prefix"
17531 else
17532         cf_path_syntax="$ac_default_prefix"
17533 fi
17534
17535 case ".$withval" in
17536 (.\$\(*\)*|.\'*\'*)
17537         ;;
17538 (..|./*|.\\*)
17539         ;;
17540 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17541         ;;
17542 (.\$\{*prefix\}*|.\$\{*dir\}*)
17543         eval withval="$withval"
17544         case ".$withval" in
17545         (.NONE/*)
17546                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17547                 ;;
17548         esac
17549         ;;
17550 (.no|.NONE/*)
17551         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17552         ;;
17553 (*)
17554         { { echo "$as_me:17554: error: expected a pathname, not \"$withval\"" >&5
17555 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17556    { (exit 1); exit 1; }; }
17557         ;;
17558 esac
17559
17560 fi
17561 eval ADA_OBJECTS="$withval"
17562
17563 echo "$as_me:17563: result: $ADA_OBJECTS" >&5
17564 echo "${ECHO_T}$ADA_OBJECTS" >&6
17565
17566 echo "$as_me:17566: checking if an Ada95 shared-library should be built" >&5
17567 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17568
17569 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17570 if test "${with_ada_sharedlib+set}" = set; then
17571   withval="$with_ada_sharedlib"
17572   with_ada_sharedlib=$withval
17573 else
17574   with_ada_sharedlib=no
17575 fi;
17576 echo "$as_me:17576: result: $with_ada_sharedlib" >&5
17577 echo "${ECHO_T}$with_ada_sharedlib" >&6
17578
17579 if test "x$with_ada_sharedlib" != xno
17580 then
17581         if test "x$cf_gnat_projects" != xyes
17582         then
17583                 { echo "$as_me:17583: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17584 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17585                 with_ada_sharedlib=no
17586         fi
17587 fi
17588
17589 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17590 MAKE_ADA_SHAREDLIB="#"
17591
17592 if test "x$with_ada_sharedlib" != xno
17593 then
17594         MAKE_ADA_SHAREDLIB=
17595         if test "x$with_ada_sharedlib" != xyes
17596         then
17597                 ADA_SHAREDLIB="$with_ada_sharedlib"
17598         fi
17599 fi
17600
17601                 # allow the Ada binding to be renamed
17602
17603 echo "$as_me:17603: checking for ada-libname" >&5
17604 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17605
17606 # Check whether --with-ada-libname or --without-ada-libname was given.
17607 if test "${with_ada_libname+set}" = set; then
17608   withval="$with_ada_libname"
17609   ADA_LIBNAME=$withval
17610 else
17611   ADA_LIBNAME=AdaCurses
17612 fi;
17613 case "x$ADA_LIBNAME" in
17614 (x|xyes|xno)
17615         ADA_LIBNAME=AdaCurses
17616         ;;
17617 esac
17618
17619 echo "$as_me:17619: result: $ADA_LIBNAME" >&5
17620 echo "${ECHO_T}$ADA_LIBNAME" >&6
17621
17622         else
17623                 { { echo "$as_me:17623: error: No usable Ada compiler found" >&5
17624 echo "$as_me: error: No usable Ada compiler found" >&2;}
17625    { (exit 1); exit 1; }; }
17626         fi
17627 else
17628         { { echo "$as_me:17628: error: The Ada compiler is needed for this package" >&5
17629 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17630    { (exit 1); exit 1; }; }
17631 fi
17632
17633 ################################################################################
17634
17635 # not needed
17636 TINFO_LDFLAGS2=
17637
17638 TINFO_LIBS=
17639
17640 ### Construct the list of include-directories to be generated
17641
17642 if test "$srcdir" != "."; then
17643         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17644 fi
17645 CPPFLAGS="-I../include $CPPFLAGS"
17646 if test "$srcdir" != "."; then
17647         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17648 fi
17649 CPPFLAGS="-I. $CPPFLAGS"
17650
17651 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17652 if test "$srcdir" != "."; then
17653         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17654 fi
17655 if test "$GCC" != yes; then
17656         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17657 elif test "$includedir" != "/usr/include"; then
17658         if test "$includedir" = '${prefix}/include' ; then
17659                 if test x$prefix != x/usr ; then
17660                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17661                 fi
17662         else
17663                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17664         fi
17665 fi
17666
17667 ### Build up pieces for makefile rules
17668 echo "$as_me:17668: checking default library suffix" >&5
17669 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17670
17671         case $DFT_LWR_MODEL in
17672         (libtool) DFT_ARG_SUFFIX=''   ;;
17673         (normal)  DFT_ARG_SUFFIX=''   ;;
17674         (debug)   DFT_ARG_SUFFIX='_g' ;;
17675         (profile) DFT_ARG_SUFFIX='_p' ;;
17676         (shared)  DFT_ARG_SUFFIX=''   ;;
17677         esac
17678         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17679 echo "$as_me:17679: result: $DFT_ARG_SUFFIX" >&5
17680 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17681
17682 echo "$as_me:17682: checking default library-dependency suffix" >&5
17683 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17684
17685         case X$DFT_LWR_MODEL in
17686         (Xlibtool)
17687                 DFT_LIB_SUFFIX='.la'
17688                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17689                 ;;
17690         (Xdebug)
17691                 case "$cf_cv_system_name" in
17692                 (*-msvc*)
17693                         DFT_LIB_SUFFIX='_g.lib'
17694                         ;;
17695                 (*)
17696                         DFT_LIB_SUFFIX='_g.a'
17697                         ;;
17698                 esac
17699                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17700                 ;;
17701         (Xprofile)
17702                 case "$cf_cv_system_name" in
17703                 (*-msvc*)
17704                         DFT_LIB_SUFFIX='_p.lib'
17705                         ;;
17706                 (*)
17707                         DFT_LIB_SUFFIX='_p.a'
17708                         ;;
17709                 esac
17710                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17711                 ;;
17712         (Xshared)
17713                 case "$cf_cv_system_name" in
17714                 (aix[5-7]*)
17715                         DFT_LIB_SUFFIX='.so'
17716                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17717                         ;;
17718                 (*-msvc*)
17719                         DFT_LIB_SUFFIX='.dll'
17720                         DFT_DEP_SUFFIX='.dll.lib'
17721                         ;;
17722                 (cygwin*|msys*|mingw*)
17723                         DFT_LIB_SUFFIX='.dll'
17724                         DFT_DEP_SUFFIX='.dll.a'
17725                         ;;
17726                 (darwin*)
17727                         DFT_LIB_SUFFIX='.dylib'
17728                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17729                         ;;
17730                 (hpux*)
17731                         case "$target" in
17732                         (ia64*)
17733                                 DFT_LIB_SUFFIX='.so'
17734                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17735                                 ;;
17736                         (*)
17737                                 DFT_LIB_SUFFIX='.sl'
17738                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17739                                 ;;
17740                         esac
17741                         ;;
17742                 (*)
17743                         DFT_LIB_SUFFIX='.so'
17744                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17745                         ;;
17746                 esac
17747                 ;;
17748         (*)
17749                 case "$target" in
17750                 (*-msvc*)
17751                         DFT_LIB_SUFFIX='.lib'
17752                         ;;
17753                 (*)
17754                         DFT_LIB_SUFFIX='.a'
17755                         ;;
17756                 esac
17757                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17758                 ;;
17759         esac
17760         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17761         then
17762                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17763                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17764         fi
17765 echo "$as_me:17765: result: $DFT_DEP_SUFFIX" >&5
17766 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17767
17768 echo "$as_me:17768: checking default object directory" >&5
17769 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17770
17771         case $DFT_LWR_MODEL in
17772         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17773         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17774         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17775         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17776         (shared)
17777                 case "$cf_cv_system_name" in
17778                 (cygwin|msys)
17779                         DFT_OBJ_SUBDIR='objects' ;;
17780                 (*)
17781                         DFT_OBJ_SUBDIR='obj_s' ;;
17782                 esac
17783         esac
17784 echo "$as_me:17784: result: $DFT_OBJ_SUBDIR" >&5
17785 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17786
17787 ### Set up low-level terminfo dependencies for makefiles.
17788
17789 if test "$DFT_LWR_MODEL" = shared ; then
17790         case $cf_cv_system_name in
17791         (cygwin*)
17792                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17793                 ;;
17794         (msys*)
17795                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17796                 ;;
17797         esac
17798 fi
17799
17800 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17801
17802 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17803
17804 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17805
17806 ### Construct the list of subdirectories for which we'll customize makefiles
17807 ### with the appropriate compile-rules.
17808
17809 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17810
17811 cat >>confdefs.h <<EOF
17812 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17813 EOF
17814
17815 ################################################################################
17816
17817 TEST_ARG2=
17818
17819 TEST_LIBS2=
17820
17821 NCURSES_SHLIB2="sh -c"
17822
17823 ADA_SUBDIRS="include gen src doc"
17824 if test "x$cf_with_tests" != "xno" ; then
17825         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17826 fi
17827 for cf_dir in $ADA_SUBDIRS
17828 do
17829         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17830 done
17831
17832 NCURSES_TREE="#"
17833
17834 EXTERNAL_TREE=
17835
17836 # match layout used by make-tar.sh
17837 ADAHTML_DIR=../doc/ada
17838
17839 if test "x$cross_compiling" = xyes ; then
17840         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17841 else
17842         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17843 fi
17844
17845 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"
17846 ac_config_commands="$ac_config_commands default"
17847 cat >confcache <<\_ACEOF
17848 # This file is a shell script that caches the results of configure
17849 # tests run on this system so they can be shared between configure
17850 # scripts and configure runs, see configure's option --config-cache.
17851 # It is not useful on other systems.  If it contains results you don't
17852 # want to keep, you may remove or edit it.
17853 #
17854 # config.status only pays attention to the cache file if you give it
17855 # the --recheck option to rerun configure.
17856 #
17857 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17858 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17859 # following values.
17860
17861 _ACEOF
17862
17863 # The following way of writing the cache mishandles newlines in values,
17864 # but we know of no workaround that is simple, portable, and efficient.
17865 # So, don't put newlines in cache variables' values.
17866 # Ultrix sh set writes to stderr and can't be redirected directly,
17867 # and sets the high bit in the cache file unless we assign to the vars.
17868 {
17869   (set) 2>&1 |
17870     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17871     *ac_space=\ *)
17872       # `set' does not quote correctly, so add quotes (double-quote
17873       # substitution turns \\\\ into \\, and sed turns \\ into \).
17874       sed -n \
17875         "s/'/'\\\\''/g;
17876           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17877       ;;
17878     *)
17879       # `set' quotes correctly as required by POSIX, so do not add quotes.
17880       sed -n \
17881         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17882       ;;
17883     esac;
17884 } |
17885   sed '
17886      t clear
17887      : clear
17888      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17889      t end
17890      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17891      : end' >>confcache
17892 if cmp -s $cache_file confcache; then :; else
17893   if test -w $cache_file; then
17894     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17895     cat confcache >$cache_file
17896   else
17897     echo "not updating unwritable cache $cache_file"
17898   fi
17899 fi
17900 rm -f confcache
17901
17902 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17903 # Let make expand exec_prefix.
17904 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17905
17906 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17907 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17908 # trailing colons and then remove the whole line if VPATH becomes empty
17909 # (actually we leave an empty line to preserve line numbers).
17910 if test "x$srcdir" = x.; then
17911   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17912 s/:*\$(srcdir):*/:/;
17913 s/:*\${srcdir}:*/:/;
17914 s/:*@srcdir@:*/:/;
17915 s/^\([^=]*=[    ]*\):*/\1/;
17916 s/:*$//;
17917 s/^[^=]*=[      ]*$//;
17918 }'
17919 fi
17920
17921 DEFS=-DHAVE_CONFIG_H
17922
17923 : "${CONFIG_STATUS=./config.status}"
17924 ac_clean_files_save=$ac_clean_files
17925 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17926 { echo "$as_me:17926: creating $CONFIG_STATUS" >&5
17927 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17928 cat >"$CONFIG_STATUS" <<_ACEOF
17929 #! $SHELL
17930 # Generated automatically by configure.
17931 # Run this file to recreate the current configuration.
17932 # Compiler output produced by configure, useful for debugging
17933 # configure, is in config.log if it exists.
17934
17935 debug=false
17936 SHELL=\${CONFIG_SHELL-$SHELL}
17937 ac_cs_invocation="\$0 \$@"
17938
17939 CLICOLOR_FORCE= GREP_OPTIONS=
17940 unset CLICOLOR_FORCE GREP_OPTIONS
17941 _ACEOF
17942
17943 cat >>"$CONFIG_STATUS" <<\_ACEOF
17944 # Be Bourne compatible
17945 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17946   emulate sh
17947   NULLCMD=:
17948 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17949   set -o posix
17950 fi
17951
17952 # Name of the executable.
17953 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17954
17955 if expr a : '\(a\)' >/dev/null 2>&1; then
17956   as_expr=expr
17957 else
17958   as_expr=false
17959 fi
17960
17961 rm -f conf$$ conf$$.exe conf$$.file
17962 echo >conf$$.file
17963 if ln -s conf$$.file conf$$ 2>/dev/null; then
17964   # We could just check for DJGPP; but this test a) works b) is more generic
17965   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17966   if test -f conf$$.exe; then
17967     # Don't use ln at all; we don't have any links
17968     as_ln_s='cp -p'
17969   else
17970     as_ln_s='ln -s'
17971   fi
17972 elif ln conf$$.file conf$$ 2>/dev/null; then
17973   as_ln_s=ln
17974 else
17975   as_ln_s='cp -p'
17976 fi
17977 rm -f conf$$ conf$$.exe conf$$.file
17978
17979 as_executable_p="test -f"
17980
17981 # Support unset when possible.
17982 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17983   as_unset="unset"
17984 else
17985   as_unset="false"
17986 fi
17987
17988 # NLS nuisances.
17989 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17990 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17991 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17992 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17993 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17994 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17995 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17996 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17997
17998 # IFS
17999 # We need space, tab and new line, in precisely that order.
18000 as_nl='
18001 '
18002 IFS="   $as_nl"
18003
18004 # CDPATH.
18005 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18006
18007 exec 6>&1
18008
18009 _ACEOF
18010
18011 # Files that config.status was made for.
18012 if test -n "$ac_config_files"; then
18013   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18014 fi
18015
18016 if test -n "$ac_config_headers"; then
18017   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18018 fi
18019
18020 if test -n "$ac_config_links"; then
18021   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18022 fi
18023
18024 if test -n "$ac_config_commands"; then
18025   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18026 fi
18027
18028 cat >>"$CONFIG_STATUS" <<\EOF
18029
18030 ac_cs_usage="\
18031 \`$as_me' instantiates files from templates according to the
18032 current configuration.
18033
18034 Usage: $0 [OPTIONS] [FILE]...
18035
18036   -h, --help       print this help, then exit
18037   -V, --version    print version number, then exit
18038   -d, --debug      don't remove temporary files
18039       --recheck    update $as_me by reconfiguring in the same conditions
18040   --file=FILE[:TEMPLATE]
18041                    instantiate the configuration file FILE
18042   --header=FILE[:TEMPLATE]
18043                    instantiate the configuration header FILE
18044
18045 Configuration files:
18046 $config_files
18047
18048 Configuration headers:
18049 $config_headers
18050
18051 Configuration commands:
18052 $config_commands
18053
18054 Report bugs to <dickey@invisible-island.net>."
18055 EOF
18056
18057 cat >>"$CONFIG_STATUS" <<EOF
18058 ac_cs_version="\\
18059 config.status
18060 configured by $0, generated by GNU Autoconf 2.52.20210509,
18061   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18062
18063 Copyright 2003-2020,2021        Thomas E. Dickey
18064 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18065 Free Software Foundation, Inc.
18066 This config.status script is free software; the Free Software Foundation
18067 gives unlimited permission to copy, distribute and modify it."
18068 srcdir="$srcdir"
18069 INSTALL="$INSTALL"
18070 EOF
18071
18072 cat >>"$CONFIG_STATUS" <<\EOF
18073 # If no file are specified by the user, then we need to provide default
18074 # value.  By we need to know if files were specified by the user.
18075 ac_need_defaults=:
18076 while test $# != 0
18077 do
18078   case $1 in
18079   --*=*)
18080     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18081     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18082     shift
18083     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18084     shift
18085     ;;
18086   -*);;
18087   *) # This is not an option, so the user has probably given explicit
18088      # arguments.
18089      ac_need_defaults=false;;
18090   esac
18091
18092   case $1 in
18093   # Handling of the options.
18094 EOF
18095 cat >>"$CONFIG_STATUS" <<EOF
18096   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18097     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18098     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18099 EOF
18100 cat >>"$CONFIG_STATUS" <<\EOF
18101   --version | --vers* | -V )
18102     echo "$ac_cs_version"; exit 0 ;;
18103   --he | --h)
18104     # Conflict between --help and --header
18105     { { echo "$as_me:18105: error: ambiguous option: $1
18106 Try \`$0 --help' for more information." >&5
18107 echo "$as_me: error: ambiguous option: $1
18108 Try \`$0 --help' for more information." >&2;}
18109    { (exit 1); exit 1; }; };;
18110   --help | --hel | -h )
18111     echo "$ac_cs_usage"; exit 0 ;;
18112   --debug | --d* | -d )
18113     debug=: ;;
18114   --file | --fil | --fi | --f )
18115     shift
18116     CONFIG_FILES="$CONFIG_FILES $1"
18117     ac_need_defaults=false;;
18118   --header | --heade | --head | --hea )
18119     shift
18120     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18121     ac_need_defaults=false;;
18122
18123   # This is an error.
18124   -*) { { echo "$as_me:18124: error: unrecognized option: $1
18125 Try \`$0 --help' for more information." >&5
18126 echo "$as_me: error: unrecognized option: $1
18127 Try \`$0 --help' for more information." >&2;}
18128    { (exit 1); exit 1; }; } ;;
18129
18130   *) ac_config_targets="$ac_config_targets $1" ;;
18131
18132   esac
18133   shift
18134 done
18135
18136 exec 5>>config.log
18137 cat >&5 << _ACEOF
18138
18139 ## ----------------------- ##
18140 ## Running config.status.  ##
18141 ## ----------------------- ##
18142
18143 This file was extended by $as_me 2.52.20210509, executed with
18144   CONFIG_FILES    = $CONFIG_FILES
18145   CONFIG_HEADERS  = $CONFIG_HEADERS
18146   CONFIG_LINKS    = $CONFIG_LINKS
18147   CONFIG_COMMANDS = $CONFIG_COMMANDS
18148   > "$ac_cs_invocation"
18149 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18150
18151 _ACEOF
18152 EOF
18153
18154 cat >>"$CONFIG_STATUS" <<EOF
18155 #
18156 # INIT-COMMANDS section.
18157 #
18158
18159 ### Special initialization commands, used to pass information from the
18160 ### configuration-run into config.status
18161
18162 AWK="$AWK"
18163 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18164 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18165 LIB_NAME="$LIB_NAME"
18166 LIB_PREFIX="$LIB_PREFIX"
18167 LIB_SUFFIX="$LIB_SUFFIX"
18168 LN_S="$LN_S"
18169 NCURSES_MAJOR="$NCURSES_MAJOR"
18170 NCURSES_MINOR="$NCURSES_MINOR"
18171 NCURSES_PATCH="$NCURSES_PATCH"
18172 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18173 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18174 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18175 cf_cv_abi_version="$cf_cv_abi_version"
18176 cf_cv_rel_version="$cf_cv_rel_version"
18177 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18178 cf_cv_shared_soname='$cf_cv_shared_soname'
18179 cf_cv_shlib_version="$cf_cv_shlib_version"
18180 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18181 cf_cv_system_name="$cf_cv_system_name"
18182 host="$host"
18183 target="$target"
18184
18185 EOF
18186
18187 cat >>"$CONFIG_STATUS" <<\EOF
18188 for ac_config_target in $ac_config_targets
18189 do
18190   case "$ac_config_target" in
18191   # Handling of arguments.
18192   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18193   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18194   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18195   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18196   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18197   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18198   *) { { echo "$as_me:18198: error: invalid argument: $ac_config_target" >&5
18199 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18200    { (exit 1); exit 1; }; };;
18201   esac
18202 done
18203
18204 # If the user did not use the arguments to specify the items to instantiate,
18205 # then the envvar interface is used.  Set only those that are not.
18206 # We use the long form for the default assignment because of an extremely
18207 # bizarre bug on SunOS 4.1.3.
18208 if "$ac_need_defaults"; then
18209   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18210   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18211   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18212 fi
18213
18214 # Create a temporary directory, and hook for its removal unless debugging.
18215 $debug ||
18216 {
18217   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18218   trap '{ (exit 1); exit 1; }' 1 2 13 15
18219 }
18220
18221 # Create a (secure) tmp directory for tmp files.
18222 : ${TMPDIR=/tmp}
18223 {
18224   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18225   test -n "$tmp" && test -d "$tmp"
18226 }  ||
18227 {
18228   tmp=$TMPDIR/cs$$-$RANDOM
18229   (umask 077 && mkdir $tmp)
18230 } ||
18231 {
18232    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18233    { (exit 1); exit 1; }
18234 }
18235
18236 EOF
18237
18238 cat >>"$CONFIG_STATUS" <<EOF
18239
18240 #
18241 # CONFIG_FILES section.
18242 #
18243
18244 # No need to generate the scripts if there are no CONFIG_FILES.
18245 # This happens for instance when ./config.status config.h
18246 if test -n "\$CONFIG_FILES"; then
18247   # Protect against being on the right side of a sed subst in config.status.
18248   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18249    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18250 s,@SHELL@,$SHELL,;t t
18251 s,@exec_prefix@,$exec_prefix,;t t
18252 s,@prefix@,$prefix,;t t
18253 s,@program_transform_name@,$program_transform_name,;t t
18254 s,@bindir@,$bindir,;t t
18255 s,@sbindir@,$sbindir,;t t
18256 s,@libexecdir@,$libexecdir,;t t
18257 s,@datarootdir@,$datarootdir,;t t
18258 s,@datadir@,$datadir,;t t
18259 s,@sysconfdir@,$sysconfdir,;t t
18260 s,@sharedstatedir@,$sharedstatedir,;t t
18261 s,@localstatedir@,$localstatedir,;t t
18262 s,@runstatedir@,$runstatedir,;t t
18263 s,@libdir@,$libdir,;t t
18264 s,@includedir@,$includedir,;t t
18265 s,@oldincludedir@,$oldincludedir,;t t
18266 s,@infodir@,$infodir,;t t
18267 s,@mandir@,$mandir,;t t
18268 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18269 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18270 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18271 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18272 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18273 s,@build_alias@,$build_alias,;t t
18274 s,@host_alias@,$host_alias,;t t
18275 s,@target_alias@,$target_alias,;t t
18276 s,@ECHO_C@,$ECHO_C,;t t
18277 s,@ECHO_N@,$ECHO_N,;t t
18278 s,@ECHO_T@,$ECHO_T,;t t
18279 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18280 s,@DEFS@,$DEFS,;t t
18281 s,@LIBS@,$LIBS,;t t
18282 s,@top_builddir@,$top_builddir,;t t
18283 s,@build@,$build,;t t
18284 s,@build_cpu@,$build_cpu,;t t
18285 s,@build_vendor@,$build_vendor,;t t
18286 s,@build_os@,$build_os,;t t
18287 s,@host@,$host,;t t
18288 s,@host_cpu@,$host_cpu,;t t
18289 s,@host_vendor@,$host_vendor,;t t
18290 s,@host_os@,$host_os,;t t
18291 s,@target@,$target,;t t
18292 s,@target_cpu@,$target_cpu,;t t
18293 s,@target_vendor@,$target_vendor,;t t
18294 s,@target_os@,$target_os,;t t
18295 s,@GREP@,$GREP,;t t
18296 s,@FGREP@,$FGREP,;t t
18297 s,@CC@,$CC,;t t
18298 s,@CFLAGS@,$CFLAGS,;t t
18299 s,@LDFLAGS@,$LDFLAGS,;t t
18300 s,@CPPFLAGS@,$CPPFLAGS,;t t
18301 s,@ac_ct_CC@,$ac_ct_CC,;t t
18302 s,@EXEEXT@,$EXEEXT,;t t
18303 s,@OBJEXT@,$OBJEXT,;t t
18304 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18305 s,@CPP@,$CPP,;t t
18306 s,@EGREP@,$EGREP,;t t
18307 s,@AWK@,$AWK,;t t
18308 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18309 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18310 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18311 s,@LN_S@,$LN_S,;t t
18312 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18313 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18314 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18315 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18316 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18317 s,@SET_MAKE@,$SET_MAKE,;t t
18318 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18319 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18320 s,@CTAGS@,$CTAGS,;t t
18321 s,@ETAGS@,$ETAGS,;t t
18322 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18323 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18324 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18325 s,@RANLIB@,$RANLIB,;t t
18326 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18327 s,@LD@,$LD,;t t
18328 s,@ac_ct_LD@,$ac_ct_LD,;t t
18329 s,@AR@,$AR,;t t
18330 s,@ac_ct_AR@,$ac_ct_AR,;t t
18331 s,@ARFLAGS@,$ARFLAGS,;t t
18332 s,@DESTDIR@,$DESTDIR,;t t
18333 s,@BUILD_CC@,$BUILD_CC,;t t
18334 s,@BUILD_CPP@,$BUILD_CPP,;t t
18335 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18336 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18337 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18338 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18339 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18340 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18341 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18342 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18343 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18344 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18345 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18346 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18347 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18348 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18349 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18350 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18351 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18352 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18353 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18354 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18355 s,@CC_G_OPT@,$CC_G_OPT,;t t
18356 s,@LD_MODEL@,$LD_MODEL,;t t
18357 s,@shlibdir@,$shlibdir,;t t
18358 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18359 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18360 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18361 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18362 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18363 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18364 s,@LINK_PROGS@,$LINK_PROGS,;t t
18365 s,@LINK_TESTS@,$LINK_TESTS,;t t
18366 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18367 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18368 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18369 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18370 s,@RPATH_LIST@,$RPATH_LIST,;t t
18371 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18372 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18373 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18374 s,@PTHREAD@,$PTHREAD,;t t
18375 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18376 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18377 s,@ECHO_LT@,$ECHO_LT,;t t
18378 s,@ECHO_LD@,$ECHO_LD,;t t
18379 s,@RULE_CC@,$RULE_CC,;t t
18380 s,@SHOW_CC@,$SHOW_CC,;t t
18381 s,@ECHO_CC@,$ECHO_CC,;t t
18382 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18383 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18384 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18385 s,@ADAFLAGS@,$ADAFLAGS,;t t
18386 s,@ADA_TRACE@,$ADA_TRACE,;t t
18387 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18388 s,@M4_exists@,$M4_exists,;t t
18389 s,@cf_ada_make@,$cf_ada_make,;t t
18390 s,@cf_ada_config@,$cf_ada_config,;t t
18391 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18392 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18393 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18394 s,@cf_compile_generics@,$cf_compile_generics,;t t
18395 s,@cf_generic_objects@,$cf_generic_objects,;t t
18396 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18397 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18398 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18399 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18400 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18401 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18402 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18403 s,@cf_ada_package@,$cf_ada_package,;t t
18404 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18405 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18406 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18407 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18408 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18409 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18410 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18411 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18412 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18413 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18414 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18415 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18416 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18417 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18418 s,@TEST_ARG2@,$TEST_ARG2,;t t
18419 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18420 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18421 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18422 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18423 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18424 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18425 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18426 CEOF
18427
18428 EOF
18429
18430   cat >>"$CONFIG_STATUS" <<\EOF
18431   # Split the substitutions into bite-sized pieces for seds with
18432   # small command number limits, like on Digital OSF/1 and HP-UX.
18433   ac_max_sed_lines=48
18434   ac_sed_frag=1 # Number of current file.
18435   ac_beg=1 # First line for current file.
18436   ac_end=$ac_max_sed_lines # Line after last line for current file.
18437   ac_more_lines=:
18438   ac_sed_cmds=
18439   while "$ac_more_lines"; do
18440     if test "$ac_beg" -gt 1; then
18441       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18442     else
18443       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18444     fi
18445     if test ! -s $tmp/subs.frag; then
18446       ac_more_lines=false
18447     else
18448       # The purpose of the label and of the branching condition is to
18449       # speed up the sed processing (if there are no `@' at all, there
18450       # is no need to browse any of the substitutions).
18451       # These are the two extra sed commands mentioned above.
18452       (echo ':t
18453   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18454       # It is possible to make a multiline substitution using escaped newlines.
18455       # Ensure that we do not split the substitution between script fragments.
18456       ac_BEG=$ac_end
18457       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18458       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18459       if test -s $tmp/subs.next; then
18460         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18461         if test ! -s $tmp/subs.edit; then
18462           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18463           if test ! -s $tmp/subs.edit; then
18464             if test "$ac_beg" -gt 1; then
18465               ac_end=`expr "$ac_end" - 1`
18466               continue
18467             fi
18468           fi
18469         fi
18470       fi
18471
18472       if test -z "$ac_sed_cmds"; then
18473         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18474       else
18475         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18476       fi
18477       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18478       ac_beg=$ac_end
18479       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18480     fi
18481   done
18482   if test -z "$ac_sed_cmds"; then
18483     ac_sed_cmds=cat
18484   fi
18485 fi # test -n "$CONFIG_FILES"
18486
18487 EOF
18488 cat >>"$CONFIG_STATUS" <<\EOF
18489 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18490   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18491   case "$ac_file" in
18492   - | *:- | *:-:* ) # input from stdin
18493         cat >$tmp/stdin
18494         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18495         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18496   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18497         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18498   * )   ac_file_in=$ac_file.in ;;
18499   esac
18500
18501   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18502   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18503          X"$ac_file" : 'X\(//\)[^/]' \| \
18504          X"$ac_file" : 'X\(//\)$' \| \
18505          X"$ac_file" : 'X\(/\)' \| \
18506          .     : '\(.\)' 2>/dev/null ||
18507 echo X"$ac_file" |
18508     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18509           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18510           /^X\(\/\/\)$/{ s//\1/; q; }
18511           /^X\(\/\).*/{ s//\1/; q; }
18512           s/.*/./; q'`
18513   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18514     { case "$ac_dir" in
18515   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18516   *)                      as_incr_dir=.;;
18517 esac
18518 as_dummy="$ac_dir"
18519 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18520   case $as_mkdir_dir in
18521     # Skip DOS drivespec
18522     ?:) as_incr_dir=$as_mkdir_dir ;;
18523     *)
18524       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18525       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18526     ;;
18527   esac
18528 done; }
18529
18530     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18531     # A "../" for each directory in $ac_dir_suffix.
18532     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18533   else
18534     ac_dir_suffix= ac_dots=
18535   fi
18536
18537   case "$srcdir" in
18538   .)  ac_srcdir=.
18539       if test -z "$ac_dots"; then
18540          ac_top_srcdir=.
18541       else
18542          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18543       fi ;;
18544   [\\/]* | ?:[\\/]* )
18545       ac_srcdir="$srcdir$ac_dir_suffix";
18546       ac_top_srcdir="$srcdir" ;;
18547   *) # Relative path.
18548     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18549     ac_top_srcdir="$ac_dots$srcdir" ;;
18550   esac
18551
18552   case $INSTALL in
18553   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18554   *) ac_INSTALL=$ac_dots$INSTALL ;;
18555   esac
18556
18557   if test x"$ac_file" != x-; then
18558     { echo "$as_me:18558: creating $ac_file" >&5
18559 echo "$as_me: creating $ac_file" >&6;}
18560     rm -f "$ac_file"
18561   fi
18562   # Let's still pretend it is `configure' which instantiates (i.e., don't
18563   # use $as_me), people would be surprised to read:
18564   #    /* config.h.  Generated automatically by config.status.  */
18565   configure_input="Generated automatically from `echo $ac_file_in |
18566                                                  sed 's,.*/,,'` by configure."
18567
18568   # First look for the input files in the build tree, otherwise in the
18569   # src tree.
18570   ac_file_inputs=`IFS=:
18571     for f in $ac_file_in; do
18572       case $f in
18573       -) echo $tmp/stdin ;;
18574       [\\/$]*)
18575          # Absolute (can't be DOS-style, as IFS=:)
18576          test -f "$f" || { { echo "$as_me:18576: error: cannot find input file: $f" >&5
18577 echo "$as_me: error: cannot find input file: $f" >&2;}
18578    { (exit 1); exit 1; }; }
18579          echo $f;;
18580       *) # Relative
18581          if test -f "$f"; then
18582            # Build tree
18583            echo $f
18584          elif test -f "$srcdir/$f"; then
18585            # Source tree
18586            echo "$srcdir/$f"
18587          else
18588            # /dev/null tree
18589            { { echo "$as_me:18589: error: cannot find input file: $f" >&5
18590 echo "$as_me: error: cannot find input file: $f" >&2;}
18591    { (exit 1); exit 1; }; }
18592          fi;;
18593       esac
18594     done` || { (exit 1); exit 1; }
18595 EOF
18596 cat >>"$CONFIG_STATUS" <<\EOF
18597   ac_warn_datarootdir=no
18598   if test x"$ac_file" != x-; then
18599     for ac_item in $ac_file_inputs
18600     do
18601       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18602       if test -n "$ac_seen"; then
18603         ac_used=`grep '@datarootdir@' "$ac_item"`
18604         if test -z "$ac_used"; then
18605           { echo "$as_me:18605: WARNING: datarootdir was used implicitly but not set:
18606 $ac_seen" >&5
18607 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18608 $ac_seen" >&2;}
18609           ac_warn_datarootdir=yes
18610         fi
18611       fi
18612       ac_seen=`grep '${datarootdir}' "$ac_item"`
18613       if test -n "$ac_seen"; then
18614         { echo "$as_me:18614: WARNING: datarootdir was used explicitly but not set:
18615 $ac_seen" >&5
18616 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18617 $ac_seen" >&2;}
18618         ac_warn_datarootdir=yes
18619       fi
18620     done
18621   fi
18622
18623 if test "x$ac_warn_datarootdir" = xyes; then
18624   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18625 fi
18626
18627 EOF
18628 cat >>"$CONFIG_STATUS" <<EOF
18629   sed "$ac_vpsub
18630 $extrasub
18631 EOF
18632 cat >>"$CONFIG_STATUS" <<\EOF
18633 :t
18634 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18635 s,@configure_input@,$configure_input,;t t
18636 s,@srcdir@,$ac_srcdir,;t t
18637 s,@top_srcdir@,$ac_top_srcdir,;t t
18638 s,@INSTALL@,$ac_INSTALL,;t t
18639 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18640   rm -f $tmp/stdin
18641   if test x"$ac_file" != x-; then
18642     cp "$tmp/out" "$ac_file"
18643
18644     for ac_name in prefix exec_prefix datarootdir
18645     do
18646         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18647         if test -n "$ac_seen"; then
18648             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18649             if test -z "$ac_init"; then
18650               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18651               { echo "$as_me:18651: WARNING: Variable $ac_name is used but was not set:
18652 $ac_seen" >&5
18653 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18654 $ac_seen" >&2;}
18655             fi
18656         fi
18657     done
18658     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18659     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18660     if test -s $tmp/out; then
18661       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18662       { echo "$as_me:18662: WARNING: Some variables may not be substituted:
18663 $ac_seen" >&5
18664 echo "$as_me: WARNING: Some variables may not be substituted:
18665 $ac_seen" >&2;}
18666     fi
18667   else
18668     cat $tmp/out
18669   fi
18670   rm -f $tmp/out
18671
18672 done
18673 EOF
18674 cat >>"$CONFIG_STATUS" <<\EOF
18675
18676 #
18677 # CONFIG_HEADER section.
18678 #
18679
18680 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18681 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18682 #
18683 # ac_d sets the value in "#define NAME VALUE" lines.
18684 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18685 ac_dB='[        ].*$,\1#\2'
18686 ac_dC=' '
18687 ac_dD=',;t'
18688 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18689 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18690 ac_iB='\([      ]\),\1#\2define\3'
18691 ac_iC=' '
18692 ac_iD='\4,;t'
18693 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18694 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18695 ac_uB='$,\1#\2define\3'
18696 ac_uC=' '
18697 ac_uD=',;t'
18698
18699 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18700   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18701   case "$ac_file" in
18702   - | *:- | *:-:* ) # input from stdin
18703         cat >$tmp/stdin
18704         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18705         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18706   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18707         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18708   * )   ac_file_in=$ac_file.in ;;
18709   esac
18710
18711   test x"$ac_file" != x- && { echo "$as_me:18711: creating $ac_file" >&5
18712 echo "$as_me: creating $ac_file" >&6;}
18713
18714   # First look for the input files in the build tree, otherwise in the
18715   # src tree.
18716   ac_file_inputs=`IFS=:
18717     for f in $ac_file_in; do
18718       case $f in
18719       -) echo $tmp/stdin ;;
18720       [\\/$]*)
18721          # Absolute (can't be DOS-style, as IFS=:)
18722          test -f "$f" || { { echo "$as_me:18722: error: cannot find input file: $f" >&5
18723 echo "$as_me: error: cannot find input file: $f" >&2;}
18724    { (exit 1); exit 1; }; }
18725          echo $f;;
18726       *) # Relative
18727          if test -f "$f"; then
18728            # Build tree
18729            echo $f
18730          elif test -f "$srcdir/$f"; then
18731            # Source tree
18732            echo "$srcdir/$f"
18733          else
18734            # /dev/null tree
18735            { { echo "$as_me:18735: error: cannot find input file: $f" >&5
18736 echo "$as_me: error: cannot find input file: $f" >&2;}
18737    { (exit 1); exit 1; }; }
18738          fi;;
18739       esac
18740     done` || { (exit 1); exit 1; }
18741   # Remove the trailing spaces.
18742   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18743
18744 EOF
18745
18746 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18747 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18748 # be either 'cat' or 'sort'.
18749 cat confdefs.h | uniq >conftest.vals
18750
18751 # Break up conftest.vals because some shells have a limit on
18752 # the size of here documents, and old seds have small limits too.
18753
18754 rm -f conftest.tail
18755 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
18756 while grep . conftest.vals >/dev/null
18757 do
18758   # Write chunks of a limited-size here document to conftest.frag.
18759   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
18760   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
18761   echo 'CEOF' >> "$CONFIG_STATUS"
18762   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
18763   rm -f conftest.vals
18764   mv conftest.tail conftest.vals
18765 done
18766 rm -f conftest.vals
18767
18768 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18769 # marker @DEFS@.
18770 echo '  cat >> conftest.edit <<CEOF
18771 /@DEFS@/r conftest.frag
18772 /@DEFS@/d
18773 CEOF
18774 sed -f conftest.edit $tmp/in > $tmp/out
18775 rm -f $tmp/in
18776 mv $tmp/out $tmp/in
18777 rm -f conftest.edit conftest.frag
18778 ' >> "$CONFIG_STATUS"
18779
18780 cat >>"$CONFIG_STATUS" <<\EOF
18781   # Let's still pretend it is `configure' which instantiates (i.e., don't
18782   # use $as_me), people would be surprised to read:
18783   #    /* config.h.  Generated automatically by config.status.  */
18784   if test x"$ac_file" = x-; then
18785     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18786   else
18787     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18788   fi
18789   cat $tmp/in >>$tmp/config.h
18790   rm -f $tmp/in
18791   if test x"$ac_file" != x-; then
18792     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
18793       { echo "$as_me:18793: $ac_file is unchanged" >&5
18794 echo "$as_me: $ac_file is unchanged" >&6;}
18795     else
18796       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18797          X"$ac_file" : 'X\(//\)[^/]' \| \
18798          X"$ac_file" : 'X\(//\)$' \| \
18799          X"$ac_file" : 'X\(/\)' \| \
18800          .     : '\(.\)' 2>/dev/null ||
18801 echo X"$ac_file" |
18802     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18803           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18804           /^X\(\/\/\)$/{ s//\1/; q; }
18805           /^X\(\/\).*/{ s//\1/; q; }
18806           s/.*/./; q'`
18807       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18808         { case "$ac_dir" in
18809   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18810   *)                      as_incr_dir=.;;
18811 esac
18812 as_dummy="$ac_dir"
18813 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18814   case $as_mkdir_dir in
18815     # Skip DOS drivespec
18816     ?:) as_incr_dir=$as_mkdir_dir ;;
18817     *)
18818       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18819       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18820     ;;
18821   esac
18822 done; }
18823
18824       fi
18825       rm -f "$ac_file"
18826       mv "$tmp/config.h" "$ac_file"
18827     fi
18828   else
18829     cat $tmp/config.h
18830     rm -f $tmp/config.h
18831   fi
18832 done
18833 EOF
18834 cat >>"$CONFIG_STATUS" <<\EOF
18835 #
18836 # CONFIG_COMMANDS section.
18837 #
18838 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18839   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18840   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18841
18842   case "$ac_dest" in
18843     default )
18844 if test -z "$USE_OLD_MAKERULES" ; then
18845         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18846 fi
18847  ;;
18848   esac
18849 done
18850 EOF
18851
18852 cat >>"$CONFIG_STATUS" <<\EOF
18853
18854 { (exit 0); exit 0; }
18855 EOF
18856 chmod +x "$CONFIG_STATUS"
18857 ac_clean_files=$ac_clean_files_save
18858
18859 # configure is writing to config.log, and then calls config.status.
18860 # config.status does its own redirection, appending to config.log.
18861 # Unfortunately, on DOS this fails, as config.log is still kept open
18862 # by configure, so config.status won't be able to write to it; its
18863 # output is simply discarded.  So we exec the FD to /dev/null,
18864 # effectively closing config.log, so it can be properly (re)opened and
18865 # appended to by config.status.  When coming back to configure, we
18866 # need to make the FD available again.
18867 if test "$no_create" != yes; then
18868   ac_cs_success=:
18869   exec 5>/dev/null
18870   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
18871   exec 5>>config.log
18872   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18873   # would make configure fail if this is the last instruction.
18874   "$ac_cs_success" || { (exit 1); exit 1; }
18875 fi
18876 ${MAKE:-make} preinstall