]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20210522
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.82 .
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 for ac_prog in exctags ctags
3460 do
3461   # Extract the first word of "$ac_prog", so it can be a program name with args.
3462 set dummy $ac_prog; ac_word=$2
3463 echo "$as_me:3463: checking for $ac_word" >&5
3464 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3465 if test "${ac_cv_prog_CTAGS+set}" = set; then
3466   echo $ECHO_N "(cached) $ECHO_C" >&6
3467 else
3468   if test -n "$CTAGS"; then
3469   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3470 else
3471   ac_save_IFS=$IFS; IFS=$ac_path_separator
3472 ac_dummy="$PATH"
3473 for ac_dir in $ac_dummy; do
3474   IFS=$ac_save_IFS
3475   test -z "$ac_dir" && ac_dir=.
3476   $as_executable_p "$ac_dir/$ac_word" || continue
3477 ac_cv_prog_CTAGS="$ac_prog"
3478 echo "$as_me:3478: found $ac_dir/$ac_word" >&5
3479 break
3480 done
3481
3482 fi
3483 fi
3484 CTAGS=$ac_cv_prog_CTAGS
3485 if test -n "$CTAGS"; then
3486   echo "$as_me:3486: result: $CTAGS" >&5
3487 echo "${ECHO_T}$CTAGS" >&6
3488 else
3489   echo "$as_me:3489: result: no" >&5
3490 echo "${ECHO_T}no" >&6
3491 fi
3492
3493   test -n "$CTAGS" && break
3494 done
3495
3496 for ac_prog in exetags etags
3497 do
3498   # Extract the first word of "$ac_prog", so it can be a program name with args.
3499 set dummy $ac_prog; ac_word=$2
3500 echo "$as_me:3500: checking for $ac_word" >&5
3501 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3502 if test "${ac_cv_prog_ETAGS+set}" = set; then
3503   echo $ECHO_N "(cached) $ECHO_C" >&6
3504 else
3505   if test -n "$ETAGS"; then
3506   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3507 else
3508   ac_save_IFS=$IFS; IFS=$ac_path_separator
3509 ac_dummy="$PATH"
3510 for ac_dir in $ac_dummy; do
3511   IFS=$ac_save_IFS
3512   test -z "$ac_dir" && ac_dir=.
3513   $as_executable_p "$ac_dir/$ac_word" || continue
3514 ac_cv_prog_ETAGS="$ac_prog"
3515 echo "$as_me:3515: found $ac_dir/$ac_word" >&5
3516 break
3517 done
3518
3519 fi
3520 fi
3521 ETAGS=$ac_cv_prog_ETAGS
3522 if test -n "$ETAGS"; then
3523   echo "$as_me:3523: result: $ETAGS" >&5
3524 echo "${ECHO_T}$ETAGS" >&6
3525 else
3526   echo "$as_me:3526: result: no" >&5
3527 echo "${ECHO_T}no" >&6
3528 fi
3529
3530   test -n "$ETAGS" && break
3531 done
3532
3533 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3534 set dummy ${CTAGS:-ctags}; ac_word=$2
3535 echo "$as_me:3535: checking for $ac_word" >&5
3536 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3537 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3538   echo $ECHO_N "(cached) $ECHO_C" >&6
3539 else
3540   if test -n "$MAKE_LOWER_TAGS"; then
3541   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3542 else
3543   ac_save_IFS=$IFS; IFS=$ac_path_separator
3544 ac_dummy="$PATH"
3545 for ac_dir in $ac_dummy; do
3546   IFS=$ac_save_IFS
3547   test -z "$ac_dir" && ac_dir=.
3548   $as_executable_p "$ac_dir/$ac_word" || continue
3549 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3550 echo "$as_me:3550: found $ac_dir/$ac_word" >&5
3551 break
3552 done
3553
3554   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3555 fi
3556 fi
3557 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3558 if test -n "$MAKE_LOWER_TAGS"; then
3559   echo "$as_me:3559: result: $MAKE_LOWER_TAGS" >&5
3560 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3561 else
3562   echo "$as_me:3562: result: no" >&5
3563 echo "${ECHO_T}no" >&6
3564 fi
3565
3566 if test "$cf_cv_mixedcase" = yes ; then
3567         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3568 set dummy ${ETAGS:-etags}; ac_word=$2
3569 echo "$as_me:3569: checking for $ac_word" >&5
3570 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3571 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3572   echo $ECHO_N "(cached) $ECHO_C" >&6
3573 else
3574   if test -n "$MAKE_UPPER_TAGS"; then
3575   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3576 else
3577   ac_save_IFS=$IFS; IFS=$ac_path_separator
3578 ac_dummy="$PATH"
3579 for ac_dir in $ac_dummy; do
3580   IFS=$ac_save_IFS
3581   test -z "$ac_dir" && ac_dir=.
3582   $as_executable_p "$ac_dir/$ac_word" || continue
3583 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3584 echo "$as_me:3584: found $ac_dir/$ac_word" >&5
3585 break
3586 done
3587
3588   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3589 fi
3590 fi
3591 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3592 if test -n "$MAKE_UPPER_TAGS"; then
3593   echo "$as_me:3593: result: $MAKE_UPPER_TAGS" >&5
3594 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3595 else
3596   echo "$as_me:3596: result: no" >&5
3597 echo "${ECHO_T}no" >&6
3598 fi
3599
3600 else
3601         MAKE_UPPER_TAGS=no
3602 fi
3603
3604 if test "$MAKE_UPPER_TAGS" = yes ; then
3605         MAKE_UPPER_TAGS=
3606 else
3607         MAKE_UPPER_TAGS="#"
3608 fi
3609
3610 if test "$MAKE_LOWER_TAGS" = yes ; then
3611         MAKE_LOWER_TAGS=
3612 else
3613         MAKE_LOWER_TAGS="#"
3614 fi
3615
3616 echo "$as_me:3616: checking for makeflags variable" >&5
3617 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3618 if test "${cf_cv_makeflags+set}" = set; then
3619   echo $ECHO_N "(cached) $ECHO_C" >&6
3620 else
3621
3622         cf_cv_makeflags=''
3623         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3624         do
3625                 cat >cf_makeflags.tmp <<CF_EOF
3626 SHELL = $SHELL
3627 all :
3628         @ echo '.$cf_option'
3629 CF_EOF
3630                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3631                 case "$cf_result" in
3632                 (.*k|.*kw)
3633                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3634                         case "$cf_result" in
3635                         (.*CC=*)        cf_cv_makeflags=
3636                                 ;;
3637                         (*)     cf_cv_makeflags=$cf_option
3638                                 ;;
3639                         esac
3640                         break
3641                         ;;
3642                 (.-)
3643                         ;;
3644                 (*)
3645
3646 echo "${as_me:-configure}:3646: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3647
3648                         ;;
3649                 esac
3650         done
3651         rm -f cf_makeflags.tmp
3652
3653 fi
3654 echo "$as_me:3654: result: $cf_cv_makeflags" >&5
3655 echo "${ECHO_T}$cf_cv_makeflags" >&6
3656
3657 if test -n "$ac_tool_prefix"; then
3658   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3659 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3660 echo "$as_me:3660: checking for $ac_word" >&5
3661 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3662 if test "${ac_cv_prog_RANLIB+set}" = set; then
3663   echo $ECHO_N "(cached) $ECHO_C" >&6
3664 else
3665   if test -n "$RANLIB"; then
3666   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3667 else
3668   ac_save_IFS=$IFS; IFS=$ac_path_separator
3669 ac_dummy="$PATH"
3670 for ac_dir in $ac_dummy; do
3671   IFS=$ac_save_IFS
3672   test -z "$ac_dir" && ac_dir=.
3673   $as_executable_p "$ac_dir/$ac_word" || continue
3674 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3675 echo "$as_me:3675: found $ac_dir/$ac_word" >&5
3676 break
3677 done
3678
3679 fi
3680 fi
3681 RANLIB=$ac_cv_prog_RANLIB
3682 if test -n "$RANLIB"; then
3683   echo "$as_me:3683: result: $RANLIB" >&5
3684 echo "${ECHO_T}$RANLIB" >&6
3685 else
3686   echo "$as_me:3686: result: no" >&5
3687 echo "${ECHO_T}no" >&6
3688 fi
3689
3690 fi
3691 if test -z "$ac_cv_prog_RANLIB"; then
3692   ac_ct_RANLIB=$RANLIB
3693   # Extract the first word of "ranlib", so it can be a program name with args.
3694 set dummy ranlib; ac_word=$2
3695 echo "$as_me:3695: checking for $ac_word" >&5
3696 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3697 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3698   echo $ECHO_N "(cached) $ECHO_C" >&6
3699 else
3700   if test -n "$ac_ct_RANLIB"; then
3701   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3702 else
3703   ac_save_IFS=$IFS; IFS=$ac_path_separator
3704 ac_dummy="$PATH"
3705 for ac_dir in $ac_dummy; do
3706   IFS=$ac_save_IFS
3707   test -z "$ac_dir" && ac_dir=.
3708   $as_executable_p "$ac_dir/$ac_word" || continue
3709 ac_cv_prog_ac_ct_RANLIB="ranlib"
3710 echo "$as_me:3710: found $ac_dir/$ac_word" >&5
3711 break
3712 done
3713
3714   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3715 fi
3716 fi
3717 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3718 if test -n "$ac_ct_RANLIB"; then
3719   echo "$as_me:3719: result: $ac_ct_RANLIB" >&5
3720 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3721 else
3722   echo "$as_me:3722: result: no" >&5
3723 echo "${ECHO_T}no" >&6
3724 fi
3725
3726   RANLIB=$ac_ct_RANLIB
3727 else
3728   RANLIB="$ac_cv_prog_RANLIB"
3729 fi
3730
3731 if test -n "$ac_tool_prefix"; then
3732   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3733 set dummy ${ac_tool_prefix}ld; ac_word=$2
3734 echo "$as_me:3734: checking for $ac_word" >&5
3735 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3736 if test "${ac_cv_prog_LD+set}" = set; then
3737   echo $ECHO_N "(cached) $ECHO_C" >&6
3738 else
3739   if test -n "$LD"; then
3740   ac_cv_prog_LD="$LD" # Let the user override the test.
3741 else
3742   ac_save_IFS=$IFS; IFS=$ac_path_separator
3743 ac_dummy="$PATH"
3744 for ac_dir in $ac_dummy; do
3745   IFS=$ac_save_IFS
3746   test -z "$ac_dir" && ac_dir=.
3747   $as_executable_p "$ac_dir/$ac_word" || continue
3748 ac_cv_prog_LD="${ac_tool_prefix}ld"
3749 echo "$as_me:3749: found $ac_dir/$ac_word" >&5
3750 break
3751 done
3752
3753 fi
3754 fi
3755 LD=$ac_cv_prog_LD
3756 if test -n "$LD"; then
3757   echo "$as_me:3757: result: $LD" >&5
3758 echo "${ECHO_T}$LD" >&6
3759 else
3760   echo "$as_me:3760: result: no" >&5
3761 echo "${ECHO_T}no" >&6
3762 fi
3763
3764 fi
3765 if test -z "$ac_cv_prog_LD"; then
3766   ac_ct_LD=$LD
3767   # Extract the first word of "ld", so it can be a program name with args.
3768 set dummy ld; ac_word=$2
3769 echo "$as_me:3769: checking for $ac_word" >&5
3770 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3771 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3772   echo $ECHO_N "(cached) $ECHO_C" >&6
3773 else
3774   if test -n "$ac_ct_LD"; then
3775   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3776 else
3777   ac_save_IFS=$IFS; IFS=$ac_path_separator
3778 ac_dummy="$PATH"
3779 for ac_dir in $ac_dummy; do
3780   IFS=$ac_save_IFS
3781   test -z "$ac_dir" && ac_dir=.
3782   $as_executable_p "$ac_dir/$ac_word" || continue
3783 ac_cv_prog_ac_ct_LD="ld"
3784 echo "$as_me:3784: found $ac_dir/$ac_word" >&5
3785 break
3786 done
3787
3788   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3789 fi
3790 fi
3791 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3792 if test -n "$ac_ct_LD"; then
3793   echo "$as_me:3793: result: $ac_ct_LD" >&5
3794 echo "${ECHO_T}$ac_ct_LD" >&6
3795 else
3796   echo "$as_me:3796: result: no" >&5
3797 echo "${ECHO_T}no" >&6
3798 fi
3799
3800   LD=$ac_ct_LD
3801 else
3802   LD="$ac_cv_prog_LD"
3803 fi
3804
3805 if test -n "$ac_tool_prefix"; then
3806   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3807 set dummy ${ac_tool_prefix}ar; ac_word=$2
3808 echo "$as_me:3808: checking for $ac_word" >&5
3809 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3810 if test "${ac_cv_prog_AR+set}" = set; then
3811   echo $ECHO_N "(cached) $ECHO_C" >&6
3812 else
3813   if test -n "$AR"; then
3814   ac_cv_prog_AR="$AR" # Let the user override the test.
3815 else
3816   ac_save_IFS=$IFS; IFS=$ac_path_separator
3817 ac_dummy="$PATH"
3818 for ac_dir in $ac_dummy; do
3819   IFS=$ac_save_IFS
3820   test -z "$ac_dir" && ac_dir=.
3821   $as_executable_p "$ac_dir/$ac_word" || continue
3822 ac_cv_prog_AR="${ac_tool_prefix}ar"
3823 echo "$as_me:3823: found $ac_dir/$ac_word" >&5
3824 break
3825 done
3826
3827 fi
3828 fi
3829 AR=$ac_cv_prog_AR
3830 if test -n "$AR"; then
3831   echo "$as_me:3831: result: $AR" >&5
3832 echo "${ECHO_T}$AR" >&6
3833 else
3834   echo "$as_me:3834: result: no" >&5
3835 echo "${ECHO_T}no" >&6
3836 fi
3837
3838 fi
3839 if test -z "$ac_cv_prog_AR"; then
3840   ac_ct_AR=$AR
3841   # Extract the first word of "ar", so it can be a program name with args.
3842 set dummy ar; ac_word=$2
3843 echo "$as_me:3843: checking for $ac_word" >&5
3844 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3845 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3846   echo $ECHO_N "(cached) $ECHO_C" >&6
3847 else
3848   if test -n "$ac_ct_AR"; then
3849   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3850 else
3851   ac_save_IFS=$IFS; IFS=$ac_path_separator
3852 ac_dummy="$PATH"
3853 for ac_dir in $ac_dummy; do
3854   IFS=$ac_save_IFS
3855   test -z "$ac_dir" && ac_dir=.
3856   $as_executable_p "$ac_dir/$ac_word" || continue
3857 ac_cv_prog_ac_ct_AR="ar"
3858 echo "$as_me:3858: found $ac_dir/$ac_word" >&5
3859 break
3860 done
3861
3862   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3863 fi
3864 fi
3865 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3866 if test -n "$ac_ct_AR"; then
3867   echo "$as_me:3867: result: $ac_ct_AR" >&5
3868 echo "${ECHO_T}$ac_ct_AR" >&6
3869 else
3870   echo "$as_me:3870: result: no" >&5
3871 echo "${ECHO_T}no" >&6
3872 fi
3873
3874   AR=$ac_ct_AR
3875 else
3876   AR="$ac_cv_prog_AR"
3877 fi
3878
3879 if test -n "$ac_tool_prefix"; then
3880   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3881 set dummy ${ac_tool_prefix}ar; ac_word=$2
3882 echo "$as_me:3882: checking for $ac_word" >&5
3883 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3884 if test "${ac_cv_prog_AR+set}" = set; then
3885   echo $ECHO_N "(cached) $ECHO_C" >&6
3886 else
3887   if test -n "$AR"; then
3888   ac_cv_prog_AR="$AR" # Let the user override the test.
3889 else
3890   ac_save_IFS=$IFS; IFS=$ac_path_separator
3891 ac_dummy="$PATH"
3892 for ac_dir in $ac_dummy; do
3893   IFS=$ac_save_IFS
3894   test -z "$ac_dir" && ac_dir=.
3895   $as_executable_p "$ac_dir/$ac_word" || continue
3896 ac_cv_prog_AR="${ac_tool_prefix}ar"
3897 echo "$as_me:3897: found $ac_dir/$ac_word" >&5
3898 break
3899 done
3900
3901 fi
3902 fi
3903 AR=$ac_cv_prog_AR
3904 if test -n "$AR"; then
3905   echo "$as_me:3905: result: $AR" >&5
3906 echo "${ECHO_T}$AR" >&6
3907 else
3908   echo "$as_me:3908: result: no" >&5
3909 echo "${ECHO_T}no" >&6
3910 fi
3911
3912 fi
3913 if test -z "$ac_cv_prog_AR"; then
3914   ac_ct_AR=$AR
3915   # Extract the first word of "ar", so it can be a program name with args.
3916 set dummy ar; ac_word=$2
3917 echo "$as_me:3917: checking for $ac_word" >&5
3918 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3919 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3920   echo $ECHO_N "(cached) $ECHO_C" >&6
3921 else
3922   if test -n "$ac_ct_AR"; then
3923   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3924 else
3925   ac_save_IFS=$IFS; IFS=$ac_path_separator
3926 ac_dummy="$PATH"
3927 for ac_dir in $ac_dummy; do
3928   IFS=$ac_save_IFS
3929   test -z "$ac_dir" && ac_dir=.
3930   $as_executable_p "$ac_dir/$ac_word" || continue
3931 ac_cv_prog_ac_ct_AR="ar"
3932 echo "$as_me:3932: found $ac_dir/$ac_word" >&5
3933 break
3934 done
3935
3936   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3937 fi
3938 fi
3939 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3940 if test -n "$ac_ct_AR"; then
3941   echo "$as_me:3941: result: $ac_ct_AR" >&5
3942 echo "${ECHO_T}$ac_ct_AR" >&6
3943 else
3944   echo "$as_me:3944: result: no" >&5
3945 echo "${ECHO_T}no" >&6
3946 fi
3947
3948   AR=$ac_ct_AR
3949 else
3950   AR="$ac_cv_prog_AR"
3951 fi
3952
3953 echo "$as_me:3953: checking for options to update archives" >&5
3954 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3955 if test "${cf_cv_ar_flags+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958
3959         case "$cf_cv_system_name" in
3960         (*-msvc*)
3961                 cf_cv_ar_flags=''
3962                 cat >mk_static_lib.sh <<-EOF
3963                 #!$SHELL
3964                 MSVC_BIN="$AR"
3965                 out="\$1"
3966                 shift
3967                 exec \$MSVC_BIN -out:"\$out" \$@
3968                 EOF
3969                 chmod +x mk_static_lib.sh
3970                 AR=`pwd`/mk_static_lib.sh
3971                 ;;
3972         (*)
3973                 cf_cv_ar_flags=unknown
3974                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3975                 do
3976
3977                         # check if $ARFLAGS already contains this choice
3978                         if test "x$ARFLAGS" != "x" ; then
3979                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3980                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3981                                         cf_cv_ar_flags=
3982                                         break
3983                                 fi
3984                         fi
3985
3986                         rm -f "conftest.$ac_cv_objext"
3987                         rm -f conftest.a
3988
3989                         cat >"conftest.$ac_ext" <<EOF
3990 #line 3990 "configure"
3991 int     testdata[3] = { 123, 456, 789 };
3992 EOF
3993                         if { (eval echo "$as_me:3993: \"$ac_compile\"") >&5
3994   (eval $ac_compile) 2>&5
3995   ac_status=$?
3996   echo "$as_me:3996: \$? = $ac_status" >&5
3997   (exit "$ac_status"); } ; then
3998                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3999                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4000                                 if test -f conftest.a ; then
4001                                         cf_cv_ar_flags="$cf_ar_flags"
4002                                         break
4003                                 fi
4004                         else
4005                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4006
4007 echo "${as_me:-configure}:4007: testing cannot compile test-program ..." 1>&5
4008
4009                                 break
4010                         fi
4011                 done
4012                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4013                 ;;
4014         esac
4015
4016 fi
4017 echo "$as_me:4017: result: $cf_cv_ar_flags" >&5
4018 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4019
4020 if test -n "$ARFLAGS" ; then
4021         if test -n "$cf_cv_ar_flags" ; then
4022                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4023         fi
4024 else
4025         ARFLAGS=$cf_cv_ar_flags
4026 fi
4027
4028         echo "$as_me:4028: checking for PATH separator" >&5
4029 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4030         case "$cf_cv_system_name" in
4031         (os2*)  PATH_SEPARATOR=';'  ;;
4032         (*)     ${PATH_SEPARATOR:=':'}  ;;
4033         esac
4034
4035         echo "$as_me:4035: result: $PATH_SEPARATOR" >&5
4036 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4037
4038 echo "$as_me:4038: checking if you have specified an install-prefix" >&5
4039 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4040
4041 # Check whether --with-install-prefix or --without-install-prefix was given.
4042 if test "${with_install_prefix+set}" = set; then
4043   withval="$with_install_prefix"
4044   case "$withval" in
4045         (yes|no)
4046                 ;;
4047         (*)     DESTDIR="$withval"
4048                 ;;
4049         esac
4050 fi;
4051 echo "$as_me:4051: result: $DESTDIR" >&5
4052 echo "${ECHO_T}$DESTDIR" >&6
4053
4054 ###############################################################################
4055
4056 # If we're cross-compiling, allow the user to override the tools and their
4057 # options.  The configure script is oriented toward identifying the host
4058 # compiler, etc., but we need a build compiler to generate parts of the source.
4059
4060 if test "$cross_compiling" = yes ; then
4061
4062         # defaults that we might want to override
4063         : ${BUILD_CFLAGS:=''}
4064         : ${BUILD_CPPFLAGS:=''}
4065         : ${BUILD_LDFLAGS:=''}
4066         : ${BUILD_LIBS:=''}
4067         : ${BUILD_EXEEXT:='$x'}
4068         : ${BUILD_OBJEXT:='o'}
4069
4070 # Check whether --with-build-cc or --without-build-cc was given.
4071 if test "${with_build_cc+set}" = set; then
4072   withval="$with_build_cc"
4073   BUILD_CC="$withval"
4074 else
4075   for ac_prog in gcc clang c99 c89 cc cl
4076 do
4077   # Extract the first word of "$ac_prog", so it can be a program name with args.
4078 set dummy $ac_prog; ac_word=$2
4079 echo "$as_me:4079: checking for $ac_word" >&5
4080 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4081 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4082   echo $ECHO_N "(cached) $ECHO_C" >&6
4083 else
4084   if test -n "$BUILD_CC"; then
4085   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4086 else
4087   ac_save_IFS=$IFS; IFS=$ac_path_separator
4088 ac_dummy="$PATH"
4089 for ac_dir in $ac_dummy; do
4090   IFS=$ac_save_IFS
4091   test -z "$ac_dir" && ac_dir=.
4092   $as_executable_p "$ac_dir/$ac_word" || continue
4093 ac_cv_prog_BUILD_CC="$ac_prog"
4094 echo "$as_me:4094: found $ac_dir/$ac_word" >&5
4095 break
4096 done
4097
4098 fi
4099 fi
4100 BUILD_CC=$ac_cv_prog_BUILD_CC
4101 if test -n "$BUILD_CC"; then
4102   echo "$as_me:4102: result: $BUILD_CC" >&5
4103 echo "${ECHO_T}$BUILD_CC" >&6
4104 else
4105   echo "$as_me:4105: result: no" >&5
4106 echo "${ECHO_T}no" >&6
4107 fi
4108
4109   test -n "$BUILD_CC" && break
4110 done
4111 test -n "$BUILD_CC" || BUILD_CC="none"
4112
4113 fi;
4114         echo "$as_me:4114: checking for native build C compiler" >&5
4115 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4116         echo "$as_me:4116: result: $BUILD_CC" >&5
4117 echo "${ECHO_T}$BUILD_CC" >&6
4118
4119         echo "$as_me:4119: checking for native build C preprocessor" >&5
4120 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4121
4122 # Check whether --with-build-cpp or --without-build-cpp was given.
4123 if test "${with_build_cpp+set}" = set; then
4124   withval="$with_build_cpp"
4125   BUILD_CPP="$withval"
4126 else
4127   BUILD_CPP='${BUILD_CC} -E'
4128 fi;
4129         echo "$as_me:4129: result: $BUILD_CPP" >&5
4130 echo "${ECHO_T}$BUILD_CPP" >&6
4131
4132         echo "$as_me:4132: checking for native build C flags" >&5
4133 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4134
4135 # Check whether --with-build-cflags or --without-build-cflags was given.
4136 if test "${with_build_cflags+set}" = set; then
4137   withval="$with_build_cflags"
4138   BUILD_CFLAGS="$withval"
4139 fi;
4140         echo "$as_me:4140: result: $BUILD_CFLAGS" >&5
4141 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4142
4143         echo "$as_me:4143: checking for native build C preprocessor-flags" >&5
4144 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4145
4146 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4147 if test "${with_build_cppflags+set}" = set; then
4148   withval="$with_build_cppflags"
4149   BUILD_CPPFLAGS="$withval"
4150 fi;
4151         echo "$as_me:4151: result: $BUILD_CPPFLAGS" >&5
4152 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4153
4154         echo "$as_me:4154: checking for native build linker-flags" >&5
4155 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4156
4157 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4158 if test "${with_build_ldflags+set}" = set; then
4159   withval="$with_build_ldflags"
4160   BUILD_LDFLAGS="$withval"
4161 fi;
4162         echo "$as_me:4162: result: $BUILD_LDFLAGS" >&5
4163 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4164
4165         echo "$as_me:4165: checking for native build linker-libraries" >&5
4166 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4167
4168 # Check whether --with-build-libs or --without-build-libs was given.
4169 if test "${with_build_libs+set}" = set; then
4170   withval="$with_build_libs"
4171   BUILD_LIBS="$withval"
4172 fi;
4173         echo "$as_me:4173: result: $BUILD_LIBS" >&5
4174 echo "${ECHO_T}$BUILD_LIBS" >&6
4175
4176         # this assumes we're on Unix.
4177         BUILD_EXEEXT=
4178         BUILD_OBJEXT=o
4179
4180         : ${BUILD_CC:='${CC}'}
4181
4182         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4183                 { { echo "$as_me:4183: error: Cross-build requires two compilers.
4184 Use --with-build-cc to specify the native compiler." >&5
4185 echo "$as_me: error: Cross-build requires two compilers.
4186 Use --with-build-cc to specify the native compiler." >&2;}
4187    { (exit 1); exit 1; }; }
4188         fi
4189
4190 else
4191         : ${BUILD_CC:='${CC}'}
4192         : ${BUILD_CPP:='${CPP}'}
4193         : ${BUILD_CFLAGS:='${CFLAGS}'}
4194         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4195         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4196         : ${BUILD_LIBS:='${LIBS}'}
4197         : ${BUILD_EXEEXT:='$x'}
4198         : ${BUILD_OBJEXT:='o'}
4199 fi
4200
4201 ###############################################################################
4202
4203 ### Options to allow the user to specify the set of libraries which are used.
4204 ### Use "--without-normal --with-shared" to allow the default model to be
4205 ### shared, for example.
4206 cf_list_models=""
4207
4208 echo "$as_me:4208: checking if you want to build shared C-objects" >&5
4209 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4210
4211 # Check whether --with-shared or --without-shared was given.
4212 if test "${with_shared+set}" = set; then
4213   withval="$with_shared"
4214   with_shared=$withval
4215 else
4216   with_shared=no
4217 fi;
4218 echo "$as_me:4218: result: $with_shared" >&5
4219 echo "${ECHO_T}$with_shared" >&6
4220 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4221
4222 echo "$as_me:4222: checking for specified models" >&5
4223 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4224 test -z "$cf_list_models" && cf_list_models=normal
4225 echo "$as_me:4225: result: $cf_list_models" >&5
4226 echo "${ECHO_T}$cf_list_models" >&6
4227
4228 ### Use the first model as the default, and save its suffix for use in building
4229 ### up test-applications.
4230 echo "$as_me:4230: checking for default model" >&5
4231 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4232 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4233 echo "$as_me:4233: result: $DFT_LWR_MODEL" >&5
4234 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4235
4236 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4237
4238 echo "$as_me:4238: checking for specific curses-directory" >&5
4239 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4240
4241 # Check whether --with-curses-dir or --without-curses-dir was given.
4242 if test "${with_curses_dir+set}" = set; then
4243   withval="$with_curses_dir"
4244   cf_cv_curses_dir=$withval
4245 else
4246   cf_cv_curses_dir=no
4247 fi;
4248 echo "$as_me:4248: result: $cf_cv_curses_dir" >&5
4249 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4250
4251 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4252 then
4253
4254 if test "x$prefix" != xNONE; then
4255         cf_path_syntax="$prefix"
4256 else
4257         cf_path_syntax="$ac_default_prefix"
4258 fi
4259
4260 case ".$withval" in
4261 (.\$\(*\)*|.\'*\'*)
4262         ;;
4263 (..|./*|.\\*)
4264         ;;
4265 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4266         ;;
4267 (.\$\{*prefix\}*|.\$\{*dir\}*)
4268         eval withval="$withval"
4269         case ".$withval" in
4270         (.NONE/*)
4271                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4272                 ;;
4273         esac
4274         ;;
4275 (.no|.NONE/*)
4276         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4277         ;;
4278 (*)
4279         { { echo "$as_me:4279: error: expected a pathname, not \"$withval\"" >&5
4280 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4281    { (exit 1); exit 1; }; }
4282         ;;
4283 esac
4284
4285         if test -d "$cf_cv_curses_dir"
4286         then
4287
4288 if test -n "$cf_cv_curses_dir/include" ; then
4289   for cf_add_incdir in $cf_cv_curses_dir/include
4290   do
4291         while test "$cf_add_incdir" != /usr/include
4292         do
4293           if test -d "$cf_add_incdir"
4294           then
4295                 cf_have_incdir=no
4296                 if test -n "$CFLAGS$CPPFLAGS" ; then
4297                   # a loop is needed to ensure we can add subdirs of existing dirs
4298                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4299                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4300                           cf_have_incdir=yes; break
4301                         fi
4302                   done
4303                 fi
4304
4305                 if test "$cf_have_incdir" = no ; then
4306                   if test "$cf_add_incdir" = /usr/local/include ; then
4307                         if test "$GCC" = yes
4308                         then
4309                           cf_save_CPPFLAGS=$CPPFLAGS
4310
4311         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4312         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4313
4314                           cat >"conftest.$ac_ext" <<_ACEOF
4315 #line 4315 "configure"
4316 #include "confdefs.h"
4317 #include <stdio.h>
4318 int
4319 main (void)
4320 {
4321 printf("Hello")
4322   ;
4323   return 0;
4324 }
4325 _ACEOF
4326 rm -f "conftest.$ac_objext"
4327 if { (eval echo "$as_me:4327: \"$ac_compile\"") >&5
4328   (eval $ac_compile) 2>&5
4329   ac_status=$?
4330   echo "$as_me:4330: \$? = $ac_status" >&5
4331   (exit "$ac_status"); } &&
4332          { ac_try='test -s "conftest.$ac_objext"'
4333   { (eval echo "$as_me:4333: \"$ac_try\"") >&5
4334   (eval $ac_try) 2>&5
4335   ac_status=$?
4336   echo "$as_me:4336: \$? = $ac_status" >&5
4337   (exit "$ac_status"); }; }; then
4338   :
4339 else
4340   echo "$as_me: failed program was:" >&5
4341 cat "conftest.$ac_ext" >&5
4342 cf_have_incdir=yes
4343 fi
4344 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4345                           CPPFLAGS=$cf_save_CPPFLAGS
4346                         fi
4347                   fi
4348                 fi
4349
4350                 if test "$cf_have_incdir" = no ; then
4351                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4352
4353 echo "${as_me:-configure}:4353: testing adding $cf_add_incdir to include-path ..." 1>&5
4354
4355                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4356
4357                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4358                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4359                   cf_add_incdir="$cf_top_incdir"
4360                 else
4361                   break
4362                 fi
4363           else
4364                 break
4365           fi
4366         done
4367   done
4368 fi
4369
4370 if test -n "$cf_cv_curses_dir/lib" ; then
4371         for cf_add_libdir in $cf_cv_curses_dir/lib
4372         do
4373                 if test "$cf_add_libdir" = /usr/lib ; then
4374                         :
4375                 elif test -d "$cf_add_libdir"
4376                 then
4377                         cf_have_libdir=no
4378                         if test -n "$LDFLAGS$LIBS" ; then
4379                                 # a loop is needed to ensure we can add subdirs of existing dirs
4380                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4381                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4382                                                 cf_have_libdir=yes; break
4383                                         fi
4384                                 done
4385                         fi
4386                         if test "$cf_have_libdir" = no ; then
4387                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4388
4389 echo "${as_me:-configure}:4389: testing adding $cf_add_libdir to library-path ..." 1>&5
4390
4391                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4392                         fi
4393                 fi
4394         done
4395 fi
4396
4397         fi
4398 fi
4399
4400 cf_ncuconfig_root=ncurses
4401 cf_have_ncuconfig=no
4402
4403 if test "x${PKG_CONFIG:=none}" != xnone; then
4404         echo "$as_me:4404: checking pkg-config for $cf_ncuconfig_root" >&5
4405 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4406         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4407                 echo "$as_me:4407: result: yes" >&5
4408 echo "${ECHO_T}yes" >&6
4409
4410                 echo "$as_me:4410: checking if the $cf_ncuconfig_root package files work" >&5
4411 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4412                 cf_have_ncuconfig=unknown
4413
4414                 cf_save_CFLAGS="$CFLAGS"
4415                 cf_save_CPPFLAGS="$CPPFLAGS"
4416                 cf_save_LIBS="$LIBS"
4417
4418                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4419                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4420
4421                 # while -W for passing linker flags is prevalent, it is not "standard".
4422                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4423                 # incompatible _and_ non-standard -W option which gives an error.  Work
4424                 # around that pitfall.
4425                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4426                 (x*c[89]9@@*-W*)
4427
4428 cf_fix_cppflags=no
4429 cf_new_cflags=
4430 cf_new_cppflags=
4431 cf_new_extra_cppflags=
4432
4433 for cf_add_cflags in $cf_pkg_cflags
4434 do
4435 case "$cf_fix_cppflags" in
4436 (no)
4437         case "$cf_add_cflags" in
4438         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4439                 case "$cf_add_cflags" in
4440                 (-D*)
4441                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4442
4443                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4444                                 && test -z "${cf_tst_cflags}" \
4445                                 && cf_fix_cppflags=yes
4446
4447                         if test "$cf_fix_cppflags" = yes ; then
4448
4449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4451
4452                                 continue
4453                         elif test "${cf_tst_cflags}" = "\"'" ; then
4454
4455         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4456         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4457
4458                                 continue
4459                         fi
4460                         ;;
4461                 esac
4462                 case "$CPPFLAGS" in
4463                 (*$cf_add_cflags)
4464                         ;;
4465                 (*)
4466                         case "$cf_add_cflags" in
4467                         (-D*)
4468                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4469
4470 CPPFLAGS=`echo "$CPPFLAGS" | \
4471         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4472                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4473
4474                                 ;;
4475                         esac
4476
4477         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4478         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4479
4480                         ;;
4481                 esac
4482                 ;;
4483         (*)
4484
4485         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4486         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4487
4488                 ;;
4489         esac
4490         ;;
4491 (yes)
4492
4493         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4494         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4495
4496         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4497
4498         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4499                 && test -z "${cf_tst_cflags}" \
4500                 && cf_fix_cppflags=no
4501         ;;
4502 esac
4503 done
4504
4505 if test -n "$cf_new_cflags" ; then
4506
4507         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4508         CFLAGS="${CFLAGS}$cf_new_cflags"
4509
4510 fi
4511
4512 if test -n "$cf_new_cppflags" ; then
4513
4514         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4515         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4516
4517 fi
4518
4519 if test -n "$cf_new_extra_cppflags" ; then
4520
4521         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4522         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4523
4524 fi
4525
4526 cf_add_libs="$LIBS"
4527 # reverse order
4528 cf_add_0lib=
4529 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4530 # filter duplicates
4531 for cf_add_1lib in $cf_add_0lib; do
4532         for cf_add_2lib in $cf_add_libs; do
4533                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4534                         cf_add_1lib=
4535                         break
4536                 fi
4537         done
4538         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4539 done
4540 LIBS="$cf_add_libs"
4541
4542                         cat >"conftest.$ac_ext" <<_ACEOF
4543 #line 4543 "configure"
4544 #include "confdefs.h"
4545 #include <${cf_cv_ncurses_header:-curses.h}>
4546 int
4547 main (void)
4548 {
4549 initscr(); mousemask(0,0); tigetstr((char *)0);
4550   ;
4551   return 0;
4552 }
4553 _ACEOF
4554 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4555 if { (eval echo "$as_me:4555: \"$ac_link\"") >&5
4556   (eval $ac_link) 2>&5
4557   ac_status=$?
4558   echo "$as_me:4558: \$? = $ac_status" >&5
4559   (exit "$ac_status"); } &&
4560          { ac_try='test -s "conftest$ac_exeext"'
4561   { (eval echo "$as_me:4561: \"$ac_try\"") >&5
4562   (eval $ac_try) 2>&5
4563   ac_status=$?
4564   echo "$as_me:4564: \$? = $ac_status" >&5
4565   (exit "$ac_status"); }; }; then
4566   if test "$cross_compiling" = yes; then
4567   cf_test_ncuconfig=maybe
4568 else
4569   cat >"conftest.$ac_ext" <<_ACEOF
4570 #line 4570 "configure"
4571 #include "confdefs.h"
4572 #include <${cf_cv_ncurses_header:-curses.h}>
4573                                         int main(void)
4574                                         { const char *xx = curses_version(); return (xx == 0); }
4575 _ACEOF
4576 rm -f "conftest$ac_exeext"
4577 if { (eval echo "$as_me:4577: \"$ac_link\"") >&5
4578   (eval $ac_link) 2>&5
4579   ac_status=$?
4580   echo "$as_me:4580: \$? = $ac_status" >&5
4581   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4582   { (eval echo "$as_me:4582: \"$ac_try\"") >&5
4583   (eval $ac_try) 2>&5
4584   ac_status=$?
4585   echo "$as_me:4585: \$? = $ac_status" >&5
4586   (exit "$ac_status"); }; }; then
4587   cf_test_ncuconfig=yes
4588 else
4589   echo "$as_me: program exited with status $ac_status" >&5
4590 echo "$as_me: failed program was:" >&5
4591 cat "conftest.$ac_ext" >&5
4592 cf_test_ncuconfig=no
4593 fi
4594 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4595 fi
4596 else
4597   echo "$as_me: failed program was:" >&5
4598 cat "conftest.$ac_ext" >&5
4599 cf_test_ncuconfig=no
4600 fi
4601 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4602
4603                         CFLAGS="$cf_save_CFLAGS"
4604                         CPPFLAGS="$cf_save_CPPFLAGS"
4605                         LIBS="$cf_save_LIBS"
4606
4607                         if test "x$cf_test_ncuconfig" != xyes; then
4608                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4609                                 cf_pkg_cflags="$cf_temp"
4610                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4611                                 cf_pkg_libs="$cf_temp"
4612                         fi
4613                         ;;
4614                 esac
4615
4616 cf_fix_cppflags=no
4617 cf_new_cflags=
4618 cf_new_cppflags=
4619 cf_new_extra_cppflags=
4620
4621 for cf_add_cflags in $cf_pkg_cflags
4622 do
4623 case "$cf_fix_cppflags" in
4624 (no)
4625         case "$cf_add_cflags" in
4626         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4627                 case "$cf_add_cflags" in
4628                 (-D*)
4629                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4630
4631                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4632                                 && test -z "${cf_tst_cflags}" \
4633                                 && cf_fix_cppflags=yes
4634
4635                         if test "$cf_fix_cppflags" = yes ; then
4636
4637         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4638         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4639
4640                                 continue
4641                         elif test "${cf_tst_cflags}" = "\"'" ; then
4642
4643         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4644         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4645
4646                                 continue
4647                         fi
4648                         ;;
4649                 esac
4650                 case "$CPPFLAGS" in
4651                 (*$cf_add_cflags)
4652                         ;;
4653                 (*)
4654                         case "$cf_add_cflags" in
4655                         (-D*)
4656                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4657
4658 CPPFLAGS=`echo "$CPPFLAGS" | \
4659         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4660                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4661
4662                                 ;;
4663                         esac
4664
4665         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4666         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4667
4668                         ;;
4669                 esac
4670                 ;;
4671         (*)
4672
4673         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4674         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4675
4676                 ;;
4677         esac
4678         ;;
4679 (yes)
4680
4681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4683
4684         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4685
4686         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4687                 && test -z "${cf_tst_cflags}" \
4688                 && cf_fix_cppflags=no
4689         ;;
4690 esac
4691 done
4692
4693 if test -n "$cf_new_cflags" ; then
4694
4695         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4696         CFLAGS="${CFLAGS}$cf_new_cflags"
4697
4698 fi
4699
4700 if test -n "$cf_new_cppflags" ; then
4701
4702         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4703         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4704
4705 fi
4706
4707 if test -n "$cf_new_extra_cppflags" ; then
4708
4709         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4710         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4711
4712 fi
4713
4714 cf_add_libs="$LIBS"
4715 # reverse order
4716 cf_add_0lib=
4717 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4718 # filter duplicates
4719 for cf_add_1lib in $cf_add_0lib; do
4720         for cf_add_2lib in $cf_add_libs; do
4721                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4722                         cf_add_1lib=
4723                         break
4724                 fi
4725         done
4726         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4727 done
4728 LIBS="$cf_add_libs"
4729
4730                 cat >"conftest.$ac_ext" <<_ACEOF
4731 #line 4731 "configure"
4732 #include "confdefs.h"
4733 #include <${cf_cv_ncurses_header:-curses.h}>
4734 int
4735 main (void)
4736 {
4737 initscr(); mousemask(0,0); tigetstr((char *)0);
4738   ;
4739   return 0;
4740 }
4741 _ACEOF
4742 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4743 if { (eval echo "$as_me:4743: \"$ac_link\"") >&5
4744   (eval $ac_link) 2>&5
4745   ac_status=$?
4746   echo "$as_me:4746: \$? = $ac_status" >&5
4747   (exit "$ac_status"); } &&
4748          { ac_try='test -s "conftest$ac_exeext"'
4749   { (eval echo "$as_me:4749: \"$ac_try\"") >&5
4750   (eval $ac_try) 2>&5
4751   ac_status=$?
4752   echo "$as_me:4752: \$? = $ac_status" >&5
4753   (exit "$ac_status"); }; }; then
4754   if test "$cross_compiling" = yes; then
4755   cf_have_ncuconfig=maybe
4756 else
4757   cat >"conftest.$ac_ext" <<_ACEOF
4758 #line 4758 "configure"
4759 #include "confdefs.h"
4760 #include <${cf_cv_ncurses_header:-curses.h}>
4761                                 int main(void)
4762                                 { const char *xx = curses_version(); return (xx == 0); }
4763 _ACEOF
4764 rm -f "conftest$ac_exeext"
4765 if { (eval echo "$as_me:4765: \"$ac_link\"") >&5
4766   (eval $ac_link) 2>&5
4767   ac_status=$?
4768   echo "$as_me:4768: \$? = $ac_status" >&5
4769   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4770   { (eval echo "$as_me:4770: \"$ac_try\"") >&5
4771   (eval $ac_try) 2>&5
4772   ac_status=$?
4773   echo "$as_me:4773: \$? = $ac_status" >&5
4774   (exit "$ac_status"); }; }; then
4775   cf_have_ncuconfig=yes
4776 else
4777   echo "$as_me: program exited with status $ac_status" >&5
4778 echo "$as_me: failed program was:" >&5
4779 cat "conftest.$ac_ext" >&5
4780 cf_have_ncuconfig=no
4781 fi
4782 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4783 fi
4784 else
4785   echo "$as_me: failed program was:" >&5
4786 cat "conftest.$ac_ext" >&5
4787 cf_have_ncuconfig=no
4788 fi
4789 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4790                 echo "$as_me:4790: result: $cf_have_ncuconfig" >&5
4791 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4792                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4793                 if test "$cf_have_ncuconfig" != "yes"
4794                 then
4795                         CPPFLAGS="$cf_save_CPPFLAGS"
4796                         LIBS="$cf_save_LIBS"
4797                         NCURSES_CONFIG_PKG=none
4798                 else
4799
4800 cat >>confdefs.h <<\EOF
4801 #define NCURSES 1
4802 EOF
4803
4804                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4805
4806 echo "$as_me:4806: checking for terminfo header" >&5
4807 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4808 if test "${cf_cv_term_header+set}" = set; then
4809   echo $ECHO_N "(cached) $ECHO_C" >&6
4810 else
4811
4812 case "${cf_cv_ncurses_header}" in
4813 (*/ncurses.h|*/ncursesw.h)
4814         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4815         ;;
4816 (*)
4817         cf_term_header=term.h
4818         ;;
4819 esac
4820
4821 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4822 do
4823 cat >"conftest.$ac_ext" <<_ACEOF
4824 #line 4824 "configure"
4825 #include "confdefs.h"
4826 #include <stdio.h>
4827 #include <${cf_cv_ncurses_header:-curses.h}>
4828 #include <$cf_test>
4829
4830 int
4831 main (void)
4832 {
4833 int x = auto_left_margin; (void)x
4834   ;
4835   return 0;
4836 }
4837 _ACEOF
4838 rm -f "conftest.$ac_objext"
4839 if { (eval echo "$as_me:4839: \"$ac_compile\"") >&5
4840   (eval $ac_compile) 2>&5
4841   ac_status=$?
4842   echo "$as_me:4842: \$? = $ac_status" >&5
4843   (exit "$ac_status"); } &&
4844          { ac_try='test -s "conftest.$ac_objext"'
4845   { (eval echo "$as_me:4845: \"$ac_try\"") >&5
4846   (eval $ac_try) 2>&5
4847   ac_status=$?
4848   echo "$as_me:4848: \$? = $ac_status" >&5
4849   (exit "$ac_status"); }; }; then
4850
4851         cf_cv_term_header="$cf_test"
4852 else
4853   echo "$as_me: failed program was:" >&5
4854 cat "conftest.$ac_ext" >&5
4855
4856         cf_cv_term_header=unknown
4857
4858 fi
4859 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4860         test "$cf_cv_term_header" != unknown && break
4861 done
4862
4863 fi
4864 echo "$as_me:4864: result: $cf_cv_term_header" >&5
4865 echo "${ECHO_T}$cf_cv_term_header" >&6
4866
4867 # Set definitions to allow ifdef'ing to accommodate subdirectories
4868
4869 case "$cf_cv_term_header" in
4870 (*term.h)
4871
4872 cat >>confdefs.h <<\EOF
4873 #define HAVE_TERM_H 1
4874 EOF
4875
4876         ;;
4877 esac
4878
4879 case "$cf_cv_term_header" in
4880 (ncurses/term.h)
4881
4882 cat >>confdefs.h <<\EOF
4883 #define HAVE_NCURSES_TERM_H 1
4884 EOF
4885
4886         ;;
4887 (ncursesw/term.h)
4888
4889 cat >>confdefs.h <<\EOF
4890 #define HAVE_NCURSESW_TERM_H 1
4891 EOF
4892
4893         ;;
4894 esac
4895
4896                 fi
4897
4898         else
4899                 echo "$as_me:4899: result: no" >&5
4900 echo "${ECHO_T}no" >&6
4901                 NCURSES_CONFIG_PKG=none
4902         fi
4903 else
4904         NCURSES_CONFIG_PKG=none
4905 fi
4906
4907 if test "x$cf_have_ncuconfig" = "xno"; then
4908         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4909
4910 if test -n "$ac_tool_prefix"; then
4911   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4912   do
4913     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4914 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4915 echo "$as_me:4915: checking for $ac_word" >&5
4916 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4917 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4918   echo $ECHO_N "(cached) $ECHO_C" >&6
4919 else
4920   if test -n "$NCURSES_CONFIG"; then
4921   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4922 else
4923   ac_save_IFS=$IFS; IFS=$ac_path_separator
4924 ac_dummy="$PATH"
4925 for ac_dir in $ac_dummy; do
4926   IFS=$ac_save_IFS
4927   test -z "$ac_dir" && ac_dir=.
4928   $as_executable_p "$ac_dir/$ac_word" || continue
4929 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4930 echo "$as_me:4930: found $ac_dir/$ac_word" >&5
4931 break
4932 done
4933
4934 fi
4935 fi
4936 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4937 if test -n "$NCURSES_CONFIG"; then
4938   echo "$as_me:4938: result: $NCURSES_CONFIG" >&5
4939 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4940 else
4941   echo "$as_me:4941: result: no" >&5
4942 echo "${ECHO_T}no" >&6
4943 fi
4944
4945     test -n "$NCURSES_CONFIG" && break
4946   done
4947 fi
4948 if test -z "$NCURSES_CONFIG"; then
4949   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4950   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4951 do
4952   # Extract the first word of "$ac_prog", so it can be a program name with args.
4953 set dummy $ac_prog; ac_word=$2
4954 echo "$as_me:4954: checking for $ac_word" >&5
4955 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4956 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4957   echo $ECHO_N "(cached) $ECHO_C" >&6
4958 else
4959   if test -n "$ac_ct_NCURSES_CONFIG"; then
4960   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4961 else
4962   ac_save_IFS=$IFS; IFS=$ac_path_separator
4963 ac_dummy="$PATH"
4964 for ac_dir in $ac_dummy; do
4965   IFS=$ac_save_IFS
4966   test -z "$ac_dir" && ac_dir=.
4967   $as_executable_p "$ac_dir/$ac_word" || continue
4968 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4969 echo "$as_me:4969: found $ac_dir/$ac_word" >&5
4970 break
4971 done
4972
4973 fi
4974 fi
4975 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4976 if test -n "$ac_ct_NCURSES_CONFIG"; then
4977   echo "$as_me:4977: result: $ac_ct_NCURSES_CONFIG" >&5
4978 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4979 else
4980   echo "$as_me:4980: result: no" >&5
4981 echo "${ECHO_T}no" >&6
4982 fi
4983
4984   test -n "$ac_ct_NCURSES_CONFIG" && break
4985 done
4986 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4987
4988   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4989 fi
4990
4991         if test "$NCURSES_CONFIG" != none ; then
4992
4993 cf_fix_cppflags=no
4994 cf_new_cflags=
4995 cf_new_cppflags=
4996 cf_new_extra_cppflags=
4997
4998 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4999 do
5000 case "$cf_fix_cppflags" in
5001 (no)
5002         case "$cf_add_cflags" in
5003         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5004                 case "$cf_add_cflags" in
5005                 (-D*)
5006                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5007
5008                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5009                                 && test -z "${cf_tst_cflags}" \
5010                                 && cf_fix_cppflags=yes
5011
5012                         if test "$cf_fix_cppflags" = yes ; then
5013
5014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5016
5017                                 continue
5018                         elif test "${cf_tst_cflags}" = "\"'" ; then
5019
5020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5022
5023                                 continue
5024                         fi
5025                         ;;
5026                 esac
5027                 case "$CPPFLAGS" in
5028                 (*$cf_add_cflags)
5029                         ;;
5030                 (*)
5031                         case "$cf_add_cflags" in
5032                         (-D*)
5033                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5034
5035 CPPFLAGS=`echo "$CPPFLAGS" | \
5036         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5037                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5038
5039                                 ;;
5040                         esac
5041
5042         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5043         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5044
5045                         ;;
5046                 esac
5047                 ;;
5048         (*)
5049
5050         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5051         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5052
5053                 ;;
5054         esac
5055         ;;
5056 (yes)
5057
5058         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5059         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5060
5061         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5062
5063         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5064                 && test -z "${cf_tst_cflags}" \
5065                 && cf_fix_cppflags=no
5066         ;;
5067 esac
5068 done
5069
5070 if test -n "$cf_new_cflags" ; then
5071
5072         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5073         CFLAGS="${CFLAGS}$cf_new_cflags"
5074
5075 fi
5076
5077 if test -n "$cf_new_cppflags" ; then
5078
5079         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5080         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5081
5082 fi
5083
5084 if test -n "$cf_new_extra_cppflags" ; then
5085
5086         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5087         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5088
5089 fi
5090
5091 cf_add_libs="$LIBS"
5092 # reverse order
5093 cf_add_0lib=
5094 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5095 # filter duplicates
5096 for cf_add_1lib in $cf_add_0lib; do
5097         for cf_add_2lib in $cf_add_libs; do
5098                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5099                         cf_add_1lib=
5100                         break
5101                 fi
5102         done
5103         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5104 done
5105 LIBS="$cf_add_libs"
5106
5107                 # even with config script, some packages use no-override for curses.h
5108
5109 echo "$as_me:5109: checking if we have identified curses headers" >&5
5110 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5111 if test "${cf_cv_ncurses_header+set}" = set; then
5112   echo $ECHO_N "(cached) $ECHO_C" >&6
5113 else
5114
5115 cf_cv_ncurses_header=none
5116 for cf_header in \
5117         ncurses.h ncurses/ncurses.h \
5118         curses.h ncurses/curses.h
5119 do
5120 cat >"conftest.$ac_ext" <<_ACEOF
5121 #line 5121 "configure"
5122 #include "confdefs.h"
5123 #include <${cf_header}>
5124 int
5125 main (void)
5126 {
5127 initscr(); tgoto("?", 0,0)
5128   ;
5129   return 0;
5130 }
5131 _ACEOF
5132 rm -f "conftest.$ac_objext"
5133 if { (eval echo "$as_me:5133: \"$ac_compile\"") >&5
5134   (eval $ac_compile) 2>&5
5135   ac_status=$?
5136   echo "$as_me:5136: \$? = $ac_status" >&5
5137   (exit "$ac_status"); } &&
5138          { ac_try='test -s "conftest.$ac_objext"'
5139   { (eval echo "$as_me:5139: \"$ac_try\"") >&5
5140   (eval $ac_try) 2>&5
5141   ac_status=$?
5142   echo "$as_me:5142: \$? = $ac_status" >&5
5143   (exit "$ac_status"); }; }; then
5144   cf_cv_ncurses_header=$cf_header; break
5145 else
5146   echo "$as_me: failed program was:" >&5
5147 cat "conftest.$ac_ext" >&5
5148 fi
5149 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5150 done
5151
5152 fi
5153 echo "$as_me:5153: result: $cf_cv_ncurses_header" >&5
5154 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5155
5156 if test "$cf_cv_ncurses_header" = none ; then
5157         { { echo "$as_me:5157: error: No curses header-files found" >&5
5158 echo "$as_me: error: No curses header-files found" >&2;}
5159    { (exit 1); exit 1; }; }
5160 fi
5161
5162 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5163
5164 for ac_header in $cf_cv_ncurses_header
5165 do
5166 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5167 echo "$as_me:5167: checking for $ac_header" >&5
5168 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5169 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5170   echo $ECHO_N "(cached) $ECHO_C" >&6
5171 else
5172   cat >"conftest.$ac_ext" <<_ACEOF
5173 #line 5173 "configure"
5174 #include "confdefs.h"
5175 #include <$ac_header>
5176 _ACEOF
5177 if { (eval echo "$as_me:5177: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5178   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5179   ac_status=$?
5180   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5181   rm -f conftest.er1
5182   cat conftest.err >&5
5183   echo "$as_me:5183: \$? = $ac_status" >&5
5184   (exit "$ac_status"); } >/dev/null; then
5185   if test -s conftest.err; then
5186     ac_cpp_err=$ac_c_preproc_warn_flag
5187   else
5188     ac_cpp_err=
5189   fi
5190 else
5191   ac_cpp_err=yes
5192 fi
5193 if test -z "$ac_cpp_err"; then
5194   eval "$as_ac_Header=yes"
5195 else
5196   echo "$as_me: failed program was:" >&5
5197   cat "conftest.$ac_ext" >&5
5198   eval "$as_ac_Header=no"
5199 fi
5200 rm -f conftest.err "conftest.$ac_ext"
5201 fi
5202 echo "$as_me:5202: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5203 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5204 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5205   cat >>confdefs.h <<EOF
5206 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5207 EOF
5208
5209 fi
5210 done
5211
5212 cat >>confdefs.h <<\EOF
5213 #define NCURSES 1
5214 EOF
5215
5216 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5217
5218                 cat >>confdefs.h <<EOF
5219 #define $cf_nculib_ROOT 1
5220 EOF
5221
5222                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5223
5224         else
5225
5226 cf_ncuhdr_root=ncurses
5227
5228 test -n "$cf_cv_curses_dir" && \
5229 test "$cf_cv_curses_dir" != "no" && { \
5230
5231 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5232   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5233   do
5234         while test "$cf_add_incdir" != /usr/include
5235         do
5236           if test -d "$cf_add_incdir"
5237           then
5238                 cf_have_incdir=no
5239                 if test -n "$CFLAGS$CPPFLAGS" ; then
5240                   # a loop is needed to ensure we can add subdirs of existing dirs
5241                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5242                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5243                           cf_have_incdir=yes; break
5244                         fi
5245                   done
5246                 fi
5247
5248                 if test "$cf_have_incdir" = no ; then
5249                   if test "$cf_add_incdir" = /usr/local/include ; then
5250                         if test "$GCC" = yes
5251                         then
5252                           cf_save_CPPFLAGS=$CPPFLAGS
5253
5254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5255         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5256
5257                           cat >"conftest.$ac_ext" <<_ACEOF
5258 #line 5258 "configure"
5259 #include "confdefs.h"
5260 #include <stdio.h>
5261 int
5262 main (void)
5263 {
5264 printf("Hello")
5265   ;
5266   return 0;
5267 }
5268 _ACEOF
5269 rm -f "conftest.$ac_objext"
5270 if { (eval echo "$as_me:5270: \"$ac_compile\"") >&5
5271   (eval $ac_compile) 2>&5
5272   ac_status=$?
5273   echo "$as_me:5273: \$? = $ac_status" >&5
5274   (exit "$ac_status"); } &&
5275          { ac_try='test -s "conftest.$ac_objext"'
5276   { (eval echo "$as_me:5276: \"$ac_try\"") >&5
5277   (eval $ac_try) 2>&5
5278   ac_status=$?
5279   echo "$as_me:5279: \$? = $ac_status" >&5
5280   (exit "$ac_status"); }; }; then
5281   :
5282 else
5283   echo "$as_me: failed program was:" >&5
5284 cat "conftest.$ac_ext" >&5
5285 cf_have_incdir=yes
5286 fi
5287 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5288                           CPPFLAGS=$cf_save_CPPFLAGS
5289                         fi
5290                   fi
5291                 fi
5292
5293                 if test "$cf_have_incdir" = no ; then
5294                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5295
5296 echo "${as_me:-configure}:5296: testing adding $cf_add_incdir to include-path ..." 1>&5
5297
5298                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5299
5300                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5301                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5302                   cf_add_incdir="$cf_top_incdir"
5303                 else
5304                   break
5305                 fi
5306           else
5307                 break
5308           fi
5309         done
5310   done
5311 fi
5312
5313 }
5314
5315 echo "$as_me:5315: checking for $cf_ncuhdr_root header in include-path" >&5
5316 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5317 if test "${cf_cv_ncurses_h+set}" = set; then
5318   echo $ECHO_N "(cached) $ECHO_C" >&6
5319 else
5320
5321         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5322         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5323         for cf_header in $cf_header_list
5324         do
5325
5326         cat >"conftest.$ac_ext" <<_ACEOF
5327 #line 5327 "configure"
5328 #include "confdefs.h"
5329
5330 #include <$cf_header>
5331 int
5332 main (void)
5333 {
5334
5335 #ifdef NCURSES_VERSION
5336
5337 printf("%s\\n", NCURSES_VERSION);
5338 #else
5339 #ifdef __NCURSES_H
5340 printf("old\\n");
5341 #else
5342         make an error
5343 #endif
5344 #endif
5345
5346   ;
5347   return 0;
5348 }
5349 _ACEOF
5350 rm -f "conftest.$ac_objext"
5351 if { (eval echo "$as_me:5351: \"$ac_compile\"") >&5
5352   (eval $ac_compile) 2>&5
5353   ac_status=$?
5354   echo "$as_me:5354: \$? = $ac_status" >&5
5355   (exit "$ac_status"); } &&
5356          { ac_try='test -s "conftest.$ac_objext"'
5357   { (eval echo "$as_me:5357: \"$ac_try\"") >&5
5358   (eval $ac_try) 2>&5
5359   ac_status=$?
5360   echo "$as_me:5360: \$? = $ac_status" >&5
5361   (exit "$ac_status"); }; }; then
5362   cf_cv_ncurses_h=$cf_header
5363
5364 else
5365   echo "$as_me: failed program was:" >&5
5366 cat "conftest.$ac_ext" >&5
5367 cf_cv_ncurses_h=no
5368 fi
5369 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5370
5371                 test "$cf_cv_ncurses_h" != no && break
5372         done
5373
5374 fi
5375 echo "$as_me:5375: result: $cf_cv_ncurses_h" >&5
5376 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5377
5378 if test "$cf_cv_ncurses_h" != no ; then
5379         cf_cv_ncurses_header=$cf_cv_ncurses_h
5380 else
5381
5382 echo "$as_me:5382: checking for $cf_ncuhdr_root include-path" >&5
5383 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5384 if test "${cf_cv_ncurses_h2+set}" = set; then
5385   echo $ECHO_N "(cached) $ECHO_C" >&6
5386 else
5387
5388         test -n "$verbose" && echo
5389
5390 cf_search=
5391
5392 # collect the current set of include-directories from compiler flags
5393 cf_header_path_list=""
5394 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5395         for cf_header_path in $CPPFLAGS $CFLAGS
5396         do
5397                 case "$cf_header_path" in
5398                 (-I*)
5399                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5400
5401 test "x$cf_header_path" != "xNONE" && \
5402 test -d "$cf_header_path" && \
5403  {
5404         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5405         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5406         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5407         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5408         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5409         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"
5410 }
5411
5412                         cf_header_path_list="$cf_header_path_list $cf_search"
5413                         ;;
5414                 esac
5415         done
5416 fi
5417
5418 # add the variations for the package we are looking for
5419
5420 cf_search=
5421
5422 test "x$prefix" != "xNONE" && \
5423 test -d "$prefix" && \
5424  {
5425         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5426         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5427         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5428         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5429         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5430         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5431 }
5432
5433 for cf_subdir_prefix in \
5434         /usr \
5435         /usr/local \
5436         /usr/pkg \
5437         /opt \
5438         /opt/local \
5439         $HOME
5440 do
5441
5442 test "x$cf_subdir_prefix" != "x$prefix" && \
5443 test -d "$cf_subdir_prefix" && \
5444 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5445         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5446         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5447         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5448         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5449         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5450         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"
5451 }
5452
5453 done
5454
5455 test "$includedir" != NONE && \
5456 test "$includedir" != "/usr/include" && \
5457 test -d "$includedir" && {
5458         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5459         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5460 }
5461
5462 test "$oldincludedir" != NONE && \
5463 test "$oldincludedir" != "/usr/include" && \
5464 test -d "$oldincludedir" && {
5465         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5466         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5467 }
5468
5469 cf_search="$cf_search $cf_header_path_list"
5470
5471         test -n "$verbose" && echo "search path $cf_search"
5472         cf_save2_CPPFLAGS="$CPPFLAGS"
5473         for cf_incdir in $cf_search
5474         do
5475
5476 if test -n "$cf_incdir" ; then
5477   for cf_add_incdir in $cf_incdir
5478   do
5479         while test "$cf_add_incdir" != /usr/include
5480         do
5481           if test -d "$cf_add_incdir"
5482           then
5483                 cf_have_incdir=no
5484                 if test -n "$CFLAGS$CPPFLAGS" ; then
5485                   # a loop is needed to ensure we can add subdirs of existing dirs
5486                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5487                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5488                           cf_have_incdir=yes; break
5489                         fi
5490                   done
5491                 fi
5492
5493                 if test "$cf_have_incdir" = no ; then
5494                   if test "$cf_add_incdir" = /usr/local/include ; then
5495                         if test "$GCC" = yes
5496                         then
5497                           cf_save_CPPFLAGS=$CPPFLAGS
5498
5499         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5500         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5501
5502                           cat >"conftest.$ac_ext" <<_ACEOF
5503 #line 5503 "configure"
5504 #include "confdefs.h"
5505 #include <stdio.h>
5506 int
5507 main (void)
5508 {
5509 printf("Hello")
5510   ;
5511   return 0;
5512 }
5513 _ACEOF
5514 rm -f "conftest.$ac_objext"
5515 if { (eval echo "$as_me:5515: \"$ac_compile\"") >&5
5516   (eval $ac_compile) 2>&5
5517   ac_status=$?
5518   echo "$as_me:5518: \$? = $ac_status" >&5
5519   (exit "$ac_status"); } &&
5520          { ac_try='test -s "conftest.$ac_objext"'
5521   { (eval echo "$as_me:5521: \"$ac_try\"") >&5
5522   (eval $ac_try) 2>&5
5523   ac_status=$?
5524   echo "$as_me:5524: \$? = $ac_status" >&5
5525   (exit "$ac_status"); }; }; then
5526   :
5527 else
5528   echo "$as_me: failed program was:" >&5
5529 cat "conftest.$ac_ext" >&5
5530 cf_have_incdir=yes
5531 fi
5532 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5533                           CPPFLAGS=$cf_save_CPPFLAGS
5534                         fi
5535                   fi
5536                 fi
5537
5538                 if test "$cf_have_incdir" = no ; then
5539                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5540
5541 echo "${as_me:-configure}:5541: testing adding $cf_add_incdir to include-path ..." 1>&5
5542
5543                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5544
5545                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5546                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5547                   cf_add_incdir="$cf_top_incdir"
5548                 else
5549                   break
5550                 fi
5551           else
5552                 break
5553           fi
5554         done
5555   done
5556 fi
5557
5558                 for cf_header in \
5559                         ncurses.h \
5560                         curses.h
5561                 do
5562
5563         cat >"conftest.$ac_ext" <<_ACEOF
5564 #line 5564 "configure"
5565 #include "confdefs.h"
5566
5567 #include <$cf_header>
5568 int
5569 main (void)
5570 {
5571
5572 #ifdef NCURSES_VERSION
5573
5574 printf("%s\\n", NCURSES_VERSION);
5575 #else
5576 #ifdef __NCURSES_H
5577 printf("old\\n");
5578 #else
5579         make an error
5580 #endif
5581 #endif
5582
5583   ;
5584   return 0;
5585 }
5586 _ACEOF
5587 rm -f "conftest.$ac_objext"
5588 if { (eval echo "$as_me:5588: \"$ac_compile\"") >&5
5589   (eval $ac_compile) 2>&5
5590   ac_status=$?
5591   echo "$as_me:5591: \$? = $ac_status" >&5
5592   (exit "$ac_status"); } &&
5593          { ac_try='test -s "conftest.$ac_objext"'
5594   { (eval echo "$as_me:5594: \"$ac_try\"") >&5
5595   (eval $ac_try) 2>&5
5596   ac_status=$?
5597   echo "$as_me:5597: \$? = $ac_status" >&5
5598   (exit "$ac_status"); }; }; then
5599   cf_cv_ncurses_h2=$cf_header
5600
5601 else
5602   echo "$as_me: failed program was:" >&5
5603 cat "conftest.$ac_ext" >&5
5604 cf_cv_ncurses_h2=no
5605 fi
5606 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5607
5608                         if test "$cf_cv_ncurses_h2" != no ; then
5609                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5610                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5611                                 break
5612                         fi
5613                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5614                 done
5615                 CPPFLAGS="$cf_save2_CPPFLAGS"
5616                 test "$cf_cv_ncurses_h2" != no && break
5617         done
5618         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5618: error: not found" >&5
5619 echo "$as_me: error: not found" >&2;}
5620    { (exit 1); exit 1; }; }
5621
5622 fi
5623 echo "$as_me:5623: result: $cf_cv_ncurses_h2" >&5
5624 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5625
5626         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5627         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5628         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5629                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5630         fi
5631
5632 if test -n "$cf_1st_incdir" ; then
5633   for cf_add_incdir in $cf_1st_incdir
5634   do
5635         while test "$cf_add_incdir" != /usr/include
5636         do
5637           if test -d "$cf_add_incdir"
5638           then
5639                 cf_have_incdir=no
5640                 if test -n "$CFLAGS$CPPFLAGS" ; then
5641                   # a loop is needed to ensure we can add subdirs of existing dirs
5642                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5643                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5644                           cf_have_incdir=yes; break
5645                         fi
5646                   done
5647                 fi
5648
5649                 if test "$cf_have_incdir" = no ; then
5650                   if test "$cf_add_incdir" = /usr/local/include ; then
5651                         if test "$GCC" = yes
5652                         then
5653                           cf_save_CPPFLAGS=$CPPFLAGS
5654
5655         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5656         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5657
5658                           cat >"conftest.$ac_ext" <<_ACEOF
5659 #line 5659 "configure"
5660 #include "confdefs.h"
5661 #include <stdio.h>
5662 int
5663 main (void)
5664 {
5665 printf("Hello")
5666   ;
5667   return 0;
5668 }
5669 _ACEOF
5670 rm -f "conftest.$ac_objext"
5671 if { (eval echo "$as_me:5671: \"$ac_compile\"") >&5
5672   (eval $ac_compile) 2>&5
5673   ac_status=$?
5674   echo "$as_me:5674: \$? = $ac_status" >&5
5675   (exit "$ac_status"); } &&
5676          { ac_try='test -s "conftest.$ac_objext"'
5677   { (eval echo "$as_me:5677: \"$ac_try\"") >&5
5678   (eval $ac_try) 2>&5
5679   ac_status=$?
5680   echo "$as_me:5680: \$? = $ac_status" >&5
5681   (exit "$ac_status"); }; }; then
5682   :
5683 else
5684   echo "$as_me: failed program was:" >&5
5685 cat "conftest.$ac_ext" >&5
5686 cf_have_incdir=yes
5687 fi
5688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5689                           CPPFLAGS=$cf_save_CPPFLAGS
5690                         fi
5691                   fi
5692                 fi
5693
5694                 if test "$cf_have_incdir" = no ; then
5695                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5696
5697 echo "${as_me:-configure}:5697: testing adding $cf_add_incdir to include-path ..." 1>&5
5698
5699                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5700
5701                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5702                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5703                   cf_add_incdir="$cf_top_incdir"
5704                 else
5705                   break
5706                 fi
5707           else
5708                 break
5709           fi
5710         done
5711   done
5712 fi
5713
5714 fi
5715
5716 # Set definitions to allow ifdef'ing for ncurses.h
5717
5718 case "$cf_cv_ncurses_header" in
5719 (*ncurses.h)
5720
5721 cat >>confdefs.h <<\EOF
5722 #define HAVE_NCURSES_H 1
5723 EOF
5724
5725         ;;
5726 esac
5727
5728 case "$cf_cv_ncurses_header" in
5729 (ncurses/curses.h|ncurses/ncurses.h)
5730
5731 cat >>confdefs.h <<\EOF
5732 #define HAVE_NCURSES_NCURSES_H 1
5733 EOF
5734
5735         ;;
5736 (ncursesw/curses.h|ncursesw/ncurses.h)
5737
5738 cat >>confdefs.h <<\EOF
5739 #define HAVE_NCURSESW_NCURSES_H 1
5740 EOF
5741
5742         ;;
5743 esac
5744
5745 echo "$as_me:5745: checking for terminfo header" >&5
5746 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5747 if test "${cf_cv_term_header+set}" = set; then
5748   echo $ECHO_N "(cached) $ECHO_C" >&6
5749 else
5750
5751 case "${cf_cv_ncurses_header}" in
5752 (*/ncurses.h|*/ncursesw.h)
5753         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5754         ;;
5755 (*)
5756         cf_term_header=term.h
5757         ;;
5758 esac
5759
5760 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5761 do
5762 cat >"conftest.$ac_ext" <<_ACEOF
5763 #line 5763 "configure"
5764 #include "confdefs.h"
5765 #include <stdio.h>
5766 #include <${cf_cv_ncurses_header:-curses.h}>
5767 #include <$cf_test>
5768
5769 int
5770 main (void)
5771 {
5772 int x = auto_left_margin; (void)x
5773   ;
5774   return 0;
5775 }
5776 _ACEOF
5777 rm -f "conftest.$ac_objext"
5778 if { (eval echo "$as_me:5778: \"$ac_compile\"") >&5
5779   (eval $ac_compile) 2>&5
5780   ac_status=$?
5781   echo "$as_me:5781: \$? = $ac_status" >&5
5782   (exit "$ac_status"); } &&
5783          { ac_try='test -s "conftest.$ac_objext"'
5784   { (eval echo "$as_me:5784: \"$ac_try\"") >&5
5785   (eval $ac_try) 2>&5
5786   ac_status=$?
5787   echo "$as_me:5787: \$? = $ac_status" >&5
5788   (exit "$ac_status"); }; }; then
5789
5790         cf_cv_term_header="$cf_test"
5791 else
5792   echo "$as_me: failed program was:" >&5
5793 cat "conftest.$ac_ext" >&5
5794
5795         cf_cv_term_header=unknown
5796
5797 fi
5798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5799         test "$cf_cv_term_header" != unknown && break
5800 done
5801
5802 fi
5803 echo "$as_me:5803: result: $cf_cv_term_header" >&5
5804 echo "${ECHO_T}$cf_cv_term_header" >&6
5805
5806 # Set definitions to allow ifdef'ing to accommodate subdirectories
5807
5808 case "$cf_cv_term_header" in
5809 (*term.h)
5810
5811 cat >>confdefs.h <<\EOF
5812 #define HAVE_TERM_H 1
5813 EOF
5814
5815         ;;
5816 esac
5817
5818 case "$cf_cv_term_header" in
5819 (ncurses/term.h)
5820
5821 cat >>confdefs.h <<\EOF
5822 #define HAVE_NCURSES_TERM_H 1
5823 EOF
5824
5825         ;;
5826 (ncursesw/term.h)
5827
5828 cat >>confdefs.h <<\EOF
5829 #define HAVE_NCURSESW_TERM_H 1
5830 EOF
5831
5832         ;;
5833 esac
5834
5835 # some applications need this, but should check for NCURSES_VERSION
5836
5837 cat >>confdefs.h <<\EOF
5838 #define NCURSES 1
5839 EOF
5840
5841 echo "$as_me:5841: checking for ncurses version" >&5
5842 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5843 if test "${cf_cv_ncurses_version+set}" = set; then
5844   echo $ECHO_N "(cached) $ECHO_C" >&6
5845 else
5846
5847         cf_cv_ncurses_version=no
5848         cf_tempfile=out$$
5849         rm -f "$cf_tempfile"
5850         if test "$cross_compiling" = yes; then
5851
5852         # This will not work if the preprocessor splits the line after the
5853         # Autoconf token.  The 'unproto' program does that.
5854         cat > "conftest.$ac_ext" <<EOF
5855 #include <${cf_cv_ncurses_header:-curses.h}>
5856 #undef Autoconf
5857 #ifdef NCURSES_VERSION
5858 Autoconf NCURSES_VERSION
5859 #else
5860 #ifdef __NCURSES_H
5861 Autoconf "old"
5862 #endif
5863 ;
5864 #endif
5865 EOF
5866         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5867         { (eval echo "$as_me:5867: \"$cf_try\"") >&5
5868   (eval $cf_try) 2>&5
5869   ac_status=$?
5870   echo "$as_me:5870: \$? = $ac_status" >&5
5871   (exit "$ac_status"); }
5872         if test -f conftest.out ; then
5873                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
5874                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5875                 rm -f conftest.out
5876         fi
5877
5878 else
5879   cat >"conftest.$ac_ext" <<_ACEOF
5880 #line 5880 "configure"
5881 #include "confdefs.h"
5882
5883 #include <${cf_cv_ncurses_header:-curses.h}>
5884 #include <stdio.h>
5885 int main(void)
5886 {
5887         FILE *fp = fopen("$cf_tempfile", "w");
5888 #ifdef NCURSES_VERSION
5889 # ifdef NCURSES_VERSION_PATCH
5890         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5891 # else
5892         fprintf(fp, "%s\\n", NCURSES_VERSION);
5893 # endif
5894 #else
5895 # ifdef __NCURSES_H
5896         fprintf(fp, "old\\n");
5897 # else
5898         make an error
5899 # endif
5900 #endif
5901         ${cf_cv_main_return:-return}(0);
5902 }
5903 _ACEOF
5904 rm -f "conftest$ac_exeext"
5905 if { (eval echo "$as_me:5905: \"$ac_link\"") >&5
5906   (eval $ac_link) 2>&5
5907   ac_status=$?
5908   echo "$as_me:5908: \$? = $ac_status" >&5
5909   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5910   { (eval echo "$as_me:5910: \"$ac_try\"") >&5
5911   (eval $ac_try) 2>&5
5912   ac_status=$?
5913   echo "$as_me:5913: \$? = $ac_status" >&5
5914   (exit "$ac_status"); }; }; then
5915
5916         cf_cv_ncurses_version=`cat $cf_tempfile`
5917 else
5918   echo "$as_me: program exited with status $ac_status" >&5
5919 echo "$as_me: failed program was:" >&5
5920 cat "conftest.$ac_ext" >&5
5921 fi
5922 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5923 fi
5924         rm -f "$cf_tempfile"
5925
5926 fi
5927 echo "$as_me:5927: result: $cf_cv_ncurses_version" >&5
5928 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5929 test "$cf_cv_ncurses_version" = no ||
5930 cat >>confdefs.h <<\EOF
5931 #define NCURSES 1
5932 EOF
5933
5934 cf_nculib_root=ncurses
5935         # This works, except for the special case where we find gpm, but
5936         # ncurses is in a nonstandard location via $LIBS, and we really want
5937         # to link gpm.
5938 cf_ncurses_LIBS=""
5939 cf_ncurses_SAVE="$LIBS"
5940 echo "$as_me:5940: checking for Gpm_Open in -lgpm" >&5
5941 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5942 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5943   echo $ECHO_N "(cached) $ECHO_C" >&6
5944 else
5945   ac_check_lib_save_LIBS=$LIBS
5946 LIBS="-lgpm  $LIBS"
5947 cat >"conftest.$ac_ext" <<_ACEOF
5948 #line 5948 "configure"
5949 #include "confdefs.h"
5950
5951 /* Override any gcc2 internal prototype to avoid an error.  */
5952 #ifdef __cplusplus
5953 extern "C"
5954 #endif
5955 /* We use char because int might match the return type of a gcc2
5956    builtin and then its argument prototype would still apply.  */
5957 char Gpm_Open ();
5958 int
5959 main (void)
5960 {
5961 Gpm_Open ();
5962   ;
5963   return 0;
5964 }
5965 _ACEOF
5966 rm -f "conftest.$ac_objext" "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"); } &&
5972          { ac_try='test -s "conftest$ac_exeext"'
5973   { (eval echo "$as_me:5973: \"$ac_try\"") >&5
5974   (eval $ac_try) 2>&5
5975   ac_status=$?
5976   echo "$as_me:5976: \$? = $ac_status" >&5
5977   (exit "$ac_status"); }; }; then
5978   ac_cv_lib_gpm_Gpm_Open=yes
5979 else
5980   echo "$as_me: failed program was:" >&5
5981 cat "conftest.$ac_ext" >&5
5982 ac_cv_lib_gpm_Gpm_Open=no
5983 fi
5984 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5985 LIBS=$ac_check_lib_save_LIBS
5986 fi
5987 echo "$as_me:5987: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5988 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5989 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
5990   echo "$as_me:5990: checking for initscr in -lgpm" >&5
5991 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5992 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5993   echo $ECHO_N "(cached) $ECHO_C" >&6
5994 else
5995   ac_check_lib_save_LIBS=$LIBS
5996 LIBS="-lgpm  $LIBS"
5997 cat >"conftest.$ac_ext" <<_ACEOF
5998 #line 5998 "configure"
5999 #include "confdefs.h"
6000
6001 /* Override any gcc2 internal prototype to avoid an error.  */
6002 #ifdef __cplusplus
6003 extern "C"
6004 #endif
6005 /* We use char because int might match the return type of a gcc2
6006    builtin and then its argument prototype would still apply.  */
6007 char initscr ();
6008 int
6009 main (void)
6010 {
6011 initscr ();
6012   ;
6013   return 0;
6014 }
6015 _ACEOF
6016 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6017 if { (eval echo "$as_me:6017: \"$ac_link\"") >&5
6018   (eval $ac_link) 2>&5
6019   ac_status=$?
6020   echo "$as_me:6020: \$? = $ac_status" >&5
6021   (exit "$ac_status"); } &&
6022          { ac_try='test -s "conftest$ac_exeext"'
6023   { (eval echo "$as_me:6023: \"$ac_try\"") >&5
6024   (eval $ac_try) 2>&5
6025   ac_status=$?
6026   echo "$as_me:6026: \$? = $ac_status" >&5
6027   (exit "$ac_status"); }; }; then
6028   ac_cv_lib_gpm_initscr=yes
6029 else
6030   echo "$as_me: failed program was:" >&5
6031 cat "conftest.$ac_ext" >&5
6032 ac_cv_lib_gpm_initscr=no
6033 fi
6034 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6035 LIBS=$ac_check_lib_save_LIBS
6036 fi
6037 echo "$as_me:6037: result: $ac_cv_lib_gpm_initscr" >&5
6038 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6039 if test "$ac_cv_lib_gpm_initscr" = yes; then
6040   LIBS="$cf_ncurses_SAVE"
6041 else
6042   cf_ncurses_LIBS="-lgpm"
6043 fi
6044
6045 fi
6046
6047 case "$host_os" in
6048 (freebsd*)
6049         # This is only necessary if you are linking against an obsolete
6050         # version of ncurses (but it should do no harm, since it's static).
6051         if test "$cf_nculib_root" = ncurses ; then
6052                 echo "$as_me:6052: checking for tgoto in -lmytinfo" >&5
6053 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6054 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6055   echo $ECHO_N "(cached) $ECHO_C" >&6
6056 else
6057   ac_check_lib_save_LIBS=$LIBS
6058 LIBS="-lmytinfo  $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 tgoto ();
6070 int
6071 main (void)
6072 {
6073 tgoto ();
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_mytinfo_tgoto=yes
6091 else
6092   echo "$as_me: failed program was:" >&5
6093 cat "conftest.$ac_ext" >&5
6094 ac_cv_lib_mytinfo_tgoto=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_mytinfo_tgoto" >&5
6100 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6101 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6102   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6103 fi
6104
6105         fi
6106         ;;
6107 esac
6108
6109 cf_add_libs="$LIBS"
6110 # reverse order
6111 cf_add_0lib=
6112 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6113 # filter duplicates
6114 for cf_add_1lib in $cf_add_0lib; do
6115         for cf_add_2lib in $cf_add_libs; do
6116                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6117                         cf_add_1lib=
6118                         break
6119                 fi
6120         done
6121         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6122 done
6123 LIBS="$cf_add_libs"
6124
6125 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6126 then
6127
6128 cf_add_libs="$LIBS"
6129 # reverse order
6130 cf_add_0lib=
6131 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6132 # filter duplicates
6133 for cf_add_1lib in $cf_add_0lib; do
6134         for cf_add_2lib in $cf_add_libs; do
6135                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6136                         cf_add_1lib=
6137                         break
6138                 fi
6139         done
6140         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6141 done
6142 LIBS="$cf_add_libs"
6143
6144 else
6145
6146         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6147         cf_libdir=""
6148         echo "$as_me:6148: checking for initscr" >&5
6149 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6150 if test "${ac_cv_func_initscr+set}" = set; then
6151   echo $ECHO_N "(cached) $ECHO_C" >&6
6152 else
6153   cat >"conftest.$ac_ext" <<_ACEOF
6154 #line 6154 "configure"
6155 #include "confdefs.h"
6156 #define initscr autoconf_temporary
6157 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6158 #undef initscr
6159
6160 #ifdef __cplusplus
6161 extern "C"
6162 #endif
6163
6164 /* We use char because int might match the return type of a gcc2
6165    builtin and then its argument prototype would still apply.  */
6166 char initscr (void);
6167
6168 int
6169 main (void)
6170 {
6171
6172 /* The GNU C library defines stubs for functions which it implements
6173     to always fail with ENOSYS.  Some functions are actually named
6174     something starting with __ and the normal name is an alias.  */
6175 #if defined (__stub_initscr) || defined (__stub___initscr)
6176 #error found stub for initscr
6177 #endif
6178
6179         return initscr ();
6180   ;
6181   return 0;
6182 }
6183 _ACEOF
6184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6185 if { (eval echo "$as_me:6185: \"$ac_link\"") >&5
6186   (eval $ac_link) 2>&5
6187   ac_status=$?
6188   echo "$as_me:6188: \$? = $ac_status" >&5
6189   (exit "$ac_status"); } &&
6190          { ac_try='test -s "conftest$ac_exeext"'
6191   { (eval echo "$as_me:6191: \"$ac_try\"") >&5
6192   (eval $ac_try) 2>&5
6193   ac_status=$?
6194   echo "$as_me:6194: \$? = $ac_status" >&5
6195   (exit "$ac_status"); }; }; then
6196   ac_cv_func_initscr=yes
6197 else
6198   echo "$as_me: failed program was:" >&5
6199 cat "conftest.$ac_ext" >&5
6200 ac_cv_func_initscr=no
6201 fi
6202 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6203 fi
6204 echo "$as_me:6204: result: $ac_cv_func_initscr" >&5
6205 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6206 if test "$ac_cv_func_initscr" = yes; then
6207   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6208 else
6209
6210                 cf_save_LIBS="$LIBS"
6211                 echo "$as_me:6211: checking for initscr in -l$cf_nculib_root" >&5
6212 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6213                 LIBS="-l$cf_nculib_root $LIBS"
6214                 cat >"conftest.$ac_ext" <<_ACEOF
6215 #line 6215 "configure"
6216 #include "confdefs.h"
6217 #include <${cf_cv_ncurses_header:-curses.h}>
6218 int
6219 main (void)
6220 {
6221 initscr()
6222   ;
6223   return 0;
6224 }
6225 _ACEOF
6226 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6227 if { (eval echo "$as_me:6227: \"$ac_link\"") >&5
6228   (eval $ac_link) 2>&5
6229   ac_status=$?
6230   echo "$as_me:6230: \$? = $ac_status" >&5
6231   (exit "$ac_status"); } &&
6232          { ac_try='test -s "conftest$ac_exeext"'
6233   { (eval echo "$as_me:6233: \"$ac_try\"") >&5
6234   (eval $ac_try) 2>&5
6235   ac_status=$?
6236   echo "$as_me:6236: \$? = $ac_status" >&5
6237   (exit "$ac_status"); }; }; then
6238   echo "$as_me:6238: result: yes" >&5
6239 echo "${ECHO_T}yes" >&6
6240                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6241
6242 else
6243   echo "$as_me: failed program was:" >&5
6244 cat "conftest.$ac_ext" >&5
6245 echo "$as_me:6245: result: no" >&5
6246 echo "${ECHO_T}no" >&6
6247
6248 cf_search=
6249 cf_library_path_list=""
6250 if test -n "${LDFLAGS}${LIBS}" ; then
6251         for cf_library_path in $LDFLAGS $LIBS
6252         do
6253                 case "$cf_library_path" in
6254                 (-L*)
6255                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6256
6257 test "x$cf_library_path" != "xNONE" && \
6258 test -d "$cf_library_path" && \
6259  {
6260         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6261         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6262         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6263         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6264         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6265         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"
6266 }
6267
6268                         cf_library_path_list="$cf_library_path_list $cf_search"
6269                         ;;
6270                 esac
6271         done
6272 fi
6273
6274 cf_search=
6275
6276 test "x$prefix" != "xNONE" && \
6277 test -d "$prefix" && \
6278  {
6279         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6280         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6281         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6282         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6283         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6284         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6285 }
6286
6287 for cf_subdir_prefix in \
6288         /usr \
6289         /usr/local \
6290         /usr/pkg \
6291         /opt \
6292         /opt/local \
6293         $HOME
6294 do
6295
6296 test "x$cf_subdir_prefix" != "x$prefix" && \
6297 test -d "$cf_subdir_prefix" && \
6298 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6299         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6300         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6301         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6302         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6303         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6304         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"
6305 }
6306
6307 done
6308
6309 cf_search="$cf_library_path_list $cf_search"
6310
6311                         for cf_libdir in $cf_search
6312                         do
6313                                 echo "$as_me:6313: checking for -l$cf_nculib_root in $cf_libdir" >&5
6314 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6315                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6316                                 cat >"conftest.$ac_ext" <<_ACEOF
6317 #line 6317 "configure"
6318 #include "confdefs.h"
6319 #include <${cf_cv_ncurses_header:-curses.h}>
6320 int
6321 main (void)
6322 {
6323 initscr()
6324   ;
6325   return 0;
6326 }
6327 _ACEOF
6328 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6329 if { (eval echo "$as_me:6329: \"$ac_link\"") >&5
6330   (eval $ac_link) 2>&5
6331   ac_status=$?
6332   echo "$as_me:6332: \$? = $ac_status" >&5
6333   (exit "$ac_status"); } &&
6334          { ac_try='test -s "conftest$ac_exeext"'
6335   { (eval echo "$as_me:6335: \"$ac_try\"") >&5
6336   (eval $ac_try) 2>&5
6337   ac_status=$?
6338   echo "$as_me:6338: \$? = $ac_status" >&5
6339   (exit "$ac_status"); }; }; then
6340   echo "$as_me:6340: result: yes" >&5
6341 echo "${ECHO_T}yes" >&6
6342                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6343                                          break
6344 else
6345   echo "$as_me: failed program was:" >&5
6346 cat "conftest.$ac_ext" >&5
6347 echo "$as_me:6347: result: no" >&5
6348 echo "${ECHO_T}no" >&6
6349                                          LIBS="$cf_save_LIBS"
6350 fi
6351 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6352                         done
6353
6354 fi
6355 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6356
6357 fi
6358
6359 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6360
6361 if test "$cf_found_library" = no ; then
6362         { { echo "$as_me:6362: error: Cannot link $cf_nculib_root library" >&5
6363 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6364    { (exit 1); exit 1; }; }
6365 fi
6366
6367 fi
6368
6369 if test -n "$cf_ncurses_LIBS" ; then
6370         echo "$as_me:6370: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6371 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6372         cf_ncurses_SAVE="$LIBS"
6373         for p in $cf_ncurses_LIBS ; do
6374                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6375                 if test "$q" != "$LIBS" ; then
6376                         LIBS="$q"
6377                 fi
6378         done
6379         cat >"conftest.$ac_ext" <<_ACEOF
6380 #line 6380 "configure"
6381 #include "confdefs.h"
6382 #include <${cf_cv_ncurses_header:-curses.h}>
6383 int
6384 main (void)
6385 {
6386 initscr(); mousemask(0,0); tigetstr((char *)0);
6387   ;
6388   return 0;
6389 }
6390 _ACEOF
6391 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6392 if { (eval echo "$as_me:6392: \"$ac_link\"") >&5
6393   (eval $ac_link) 2>&5
6394   ac_status=$?
6395   echo "$as_me:6395: \$? = $ac_status" >&5
6396   (exit "$ac_status"); } &&
6397          { ac_try='test -s "conftest$ac_exeext"'
6398   { (eval echo "$as_me:6398: \"$ac_try\"") >&5
6399   (eval $ac_try) 2>&5
6400   ac_status=$?
6401   echo "$as_me:6401: \$? = $ac_status" >&5
6402   (exit "$ac_status"); }; }; then
6403   echo "$as_me:6403: result: yes" >&5
6404 echo "${ECHO_T}yes" >&6
6405 else
6406   echo "$as_me: failed program was:" >&5
6407 cat "conftest.$ac_ext" >&5
6408 echo "$as_me:6408: result: no" >&5
6409 echo "${ECHO_T}no" >&6
6410                  LIBS="$cf_ncurses_SAVE"
6411 fi
6412 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6413 fi
6414
6415 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6416
6417 cat >>confdefs.h <<EOF
6418 #define $cf_nculib_ROOT 1
6419 EOF
6420
6421         fi
6422 else
6423         NCURSES_CONFIG=none
6424 fi
6425
6426 echo "$as_me:6426: checking if you want wide-character code" >&5
6427 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6428
6429 # Check whether --enable-widec or --disable-widec was given.
6430 if test "${enable_widec+set}" = set; then
6431   enableval="$enable_widec"
6432   with_widec=$enableval
6433 else
6434   with_widec=no
6435 fi;
6436 echo "$as_me:6436: result: $with_widec" >&5
6437 echo "${ECHO_T}$with_widec" >&6
6438 if test "$with_widec" = yes ; then
6439
6440 for ac_header in wchar.h
6441 do
6442 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6443 echo "$as_me:6443: checking for $ac_header" >&5
6444 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6445 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6446   echo $ECHO_N "(cached) $ECHO_C" >&6
6447 else
6448   cat >"conftest.$ac_ext" <<_ACEOF
6449 #line 6449 "configure"
6450 #include "confdefs.h"
6451 #include <$ac_header>
6452 _ACEOF
6453 if { (eval echo "$as_me:6453: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6454   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6455   ac_status=$?
6456   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6457   rm -f conftest.er1
6458   cat conftest.err >&5
6459   echo "$as_me:6459: \$? = $ac_status" >&5
6460   (exit "$ac_status"); } >/dev/null; then
6461   if test -s conftest.err; then
6462     ac_cpp_err=$ac_c_preproc_warn_flag
6463   else
6464     ac_cpp_err=
6465   fi
6466 else
6467   ac_cpp_err=yes
6468 fi
6469 if test -z "$ac_cpp_err"; then
6470   eval "$as_ac_Header=yes"
6471 else
6472   echo "$as_me: failed program was:" >&5
6473   cat "conftest.$ac_ext" >&5
6474   eval "$as_ac_Header=no"
6475 fi
6476 rm -f conftest.err "conftest.$ac_ext"
6477 fi
6478 echo "$as_me:6478: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6479 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6480 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6481   cat >>confdefs.h <<EOF
6482 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6483 EOF
6484
6485 fi
6486 done
6487
6488 echo "$as_me:6488: checking for multibyte character support" >&5
6489 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6490 if test "${cf_cv_utf8_lib+set}" = set; then
6491   echo $ECHO_N "(cached) $ECHO_C" >&6
6492 else
6493
6494         cf_save_LIBS="$LIBS"
6495         cat >"conftest.$ac_ext" <<_ACEOF
6496 #line 6496 "configure"
6497 #include "confdefs.h"
6498
6499 #include <stdlib.h>
6500 #include <stdio.h>
6501 #ifdef HAVE_WCHAR_H
6502 #include <wchar.h>
6503 #endif
6504
6505 int
6506 main (void)
6507 {
6508 putwc(0,0);
6509   ;
6510   return 0;
6511 }
6512 _ACEOF
6513 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6514 if { (eval echo "$as_me:6514: \"$ac_link\"") >&5
6515   (eval $ac_link) 2>&5
6516   ac_status=$?
6517   echo "$as_me:6517: \$? = $ac_status" >&5
6518   (exit "$ac_status"); } &&
6519          { ac_try='test -s "conftest$ac_exeext"'
6520   { (eval echo "$as_me:6520: \"$ac_try\"") >&5
6521   (eval $ac_try) 2>&5
6522   ac_status=$?
6523   echo "$as_me:6523: \$? = $ac_status" >&5
6524   (exit "$ac_status"); }; }; then
6525   cf_cv_utf8_lib=yes
6526 else
6527   echo "$as_me: failed program was:" >&5
6528 cat "conftest.$ac_ext" >&5
6529
6530 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6531 # will be set on completion of the AC_TRY_LINK below.
6532 cf_cv_header_path_utf8=
6533 cf_cv_library_path_utf8=
6534
6535 echo "${as_me:-configure}:6535: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6536
6537 cf_save_LIBS="$LIBS"
6538
6539 cat >"conftest.$ac_ext" <<_ACEOF
6540 #line 6540 "configure"
6541 #include "confdefs.h"
6542
6543 #include <libutf8.h>
6544 int
6545 main (void)
6546 {
6547 putwc(0,0);
6548   ;
6549   return 0;
6550 }
6551 _ACEOF
6552 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6553 if { (eval echo "$as_me:6553: \"$ac_link\"") >&5
6554   (eval $ac_link) 2>&5
6555   ac_status=$?
6556   echo "$as_me:6556: \$? = $ac_status" >&5
6557   (exit "$ac_status"); } &&
6558          { ac_try='test -s "conftest$ac_exeext"'
6559   { (eval echo "$as_me:6559: \"$ac_try\"") >&5
6560   (eval $ac_try) 2>&5
6561   ac_status=$?
6562   echo "$as_me:6562: \$? = $ac_status" >&5
6563   (exit "$ac_status"); }; }; then
6564
6565         cf_cv_find_linkage_utf8=yes
6566         cf_cv_header_path_utf8=/usr/include
6567         cf_cv_library_path_utf8=/usr/lib
6568
6569 else
6570   echo "$as_me: failed program was:" >&5
6571 cat "conftest.$ac_ext" >&5
6572
6573 LIBS="-lutf8  $cf_save_LIBS"
6574
6575 cat >"conftest.$ac_ext" <<_ACEOF
6576 #line 6576 "configure"
6577 #include "confdefs.h"
6578
6579 #include <libutf8.h>
6580 int
6581 main (void)
6582 {
6583 putwc(0,0);
6584   ;
6585   return 0;
6586 }
6587 _ACEOF
6588 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6589 if { (eval echo "$as_me:6589: \"$ac_link\"") >&5
6590   (eval $ac_link) 2>&5
6591   ac_status=$?
6592   echo "$as_me:6592: \$? = $ac_status" >&5
6593   (exit "$ac_status"); } &&
6594          { ac_try='test -s "conftest$ac_exeext"'
6595   { (eval echo "$as_me:6595: \"$ac_try\"") >&5
6596   (eval $ac_try) 2>&5
6597   ac_status=$?
6598   echo "$as_me:6598: \$? = $ac_status" >&5
6599   (exit "$ac_status"); }; }; then
6600
6601         cf_cv_find_linkage_utf8=yes
6602         cf_cv_header_path_utf8=/usr/include
6603         cf_cv_library_path_utf8=/usr/lib
6604         cf_cv_library_file_utf8="-lutf8"
6605
6606 else
6607   echo "$as_me: failed program was:" >&5
6608 cat "conftest.$ac_ext" >&5
6609
6610         cf_cv_find_linkage_utf8=no
6611         LIBS="$cf_save_LIBS"
6612
6613         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6614
6615 echo "${as_me:-configure}:6615: testing find linkage for utf8 library ..." 1>&5
6616
6617 echo "${as_me:-configure}:6617: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6618
6619         cf_save_CPPFLAGS="$CPPFLAGS"
6620         cf_test_CPPFLAGS="$CPPFLAGS"
6621
6622 cf_search=
6623
6624 # collect the current set of include-directories from compiler flags
6625 cf_header_path_list=""
6626 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6627         for cf_header_path in $CPPFLAGS $CFLAGS
6628         do
6629                 case "$cf_header_path" in
6630                 (-I*)
6631                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6632
6633 test "x$cf_header_path" != "xNONE" && \
6634 test -d "$cf_header_path" && \
6635  {
6636         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6637         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6638         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6639         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6640         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6641         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6642 }
6643
6644                         cf_header_path_list="$cf_header_path_list $cf_search"
6645                         ;;
6646                 esac
6647         done
6648 fi
6649
6650 # add the variations for the package we are looking for
6651
6652 cf_search=
6653
6654 test "x$prefix" != "xNONE" && \
6655 test -d "$prefix" && \
6656  {
6657         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6658         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6659         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6660         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6661         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6662         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6663 }
6664
6665 for cf_subdir_prefix in \
6666         /usr \
6667         /usr/local \
6668         /usr/pkg \
6669         /opt \
6670         /opt/local \
6671         $HOME
6672 do
6673
6674 test "x$cf_subdir_prefix" != "x$prefix" && \
6675 test -d "$cf_subdir_prefix" && \
6676 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6677         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6678         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6679         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6680         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6681         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6682         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6683 }
6684
6685 done
6686
6687 test "$includedir" != NONE && \
6688 test "$includedir" != "/usr/include" && \
6689 test -d "$includedir" && {
6690         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6691         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6692 }
6693
6694 test "$oldincludedir" != NONE && \
6695 test "$oldincludedir" != "/usr/include" && \
6696 test -d "$oldincludedir" && {
6697         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6698         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6699 }
6700
6701 cf_search="$cf_search $cf_header_path_list"
6702
6703         for cf_cv_header_path_utf8 in $cf_search
6704         do
6705                 if test -d "$cf_cv_header_path_utf8" ; then
6706                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6707
6708 echo "${as_me:-configure}:6708: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6709
6710                         CPPFLAGS="$cf_save_CPPFLAGS"
6711
6712         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6713         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6714
6715                         cat >"conftest.$ac_ext" <<_ACEOF
6716 #line 6716 "configure"
6717 #include "confdefs.h"
6718
6719 #include <libutf8.h>
6720 int
6721 main (void)
6722 {
6723 putwc(0,0);
6724   ;
6725   return 0;
6726 }
6727 _ACEOF
6728 rm -f "conftest.$ac_objext"
6729 if { (eval echo "$as_me:6729: \"$ac_compile\"") >&5
6730   (eval $ac_compile) 2>&5
6731   ac_status=$?
6732   echo "$as_me:6732: \$? = $ac_status" >&5
6733   (exit "$ac_status"); } &&
6734          { ac_try='test -s "conftest.$ac_objext"'
6735   { (eval echo "$as_me:6735: \"$ac_try\"") >&5
6736   (eval $ac_try) 2>&5
6737   ac_status=$?
6738   echo "$as_me:6738: \$? = $ac_status" >&5
6739   (exit "$ac_status"); }; }; then
6740
6741                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6742
6743 echo "${as_me:-configure}:6743: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6744
6745                                 cf_cv_find_linkage_utf8=maybe
6746                                 cf_test_CPPFLAGS="$CPPFLAGS"
6747                                 break
6748 else
6749   echo "$as_me: failed program was:" >&5
6750 cat "conftest.$ac_ext" >&5
6751
6752                                 CPPFLAGS="$cf_save_CPPFLAGS"
6753
6754 fi
6755 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6756                 fi
6757         done
6758
6759         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6760
6761 echo "${as_me:-configure}:6761: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6762
6763                 cf_save_LIBS="$LIBS"
6764                 cf_save_LDFLAGS="$LDFLAGS"
6765
6766                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6767
6768 cf_search=
6769 cf_library_path_list=""
6770 if test -n "${LDFLAGS}${LIBS}" ; then
6771         for cf_library_path in $LDFLAGS $LIBS
6772         do
6773                 case "$cf_library_path" in
6774                 (-L*)
6775                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6776
6777 test "x$cf_library_path" != "xNONE" && \
6778 test -d "$cf_library_path" && \
6779  {
6780         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6781         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6782         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6783         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6784         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6785         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6786 }
6787
6788                         cf_library_path_list="$cf_library_path_list $cf_search"
6789                         ;;
6790                 esac
6791         done
6792 fi
6793
6794 cf_search=
6795
6796 test "x$prefix" != "xNONE" && \
6797 test -d "$prefix" && \
6798  {
6799         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6800         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6801         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6802         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6803         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6804         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6805 }
6806
6807 for cf_subdir_prefix in \
6808         /usr \
6809         /usr/local \
6810         /usr/pkg \
6811         /opt \
6812         /opt/local \
6813         $HOME
6814 do
6815
6816 test "x$cf_subdir_prefix" != "x$prefix" && \
6817 test -d "$cf_subdir_prefix" && \
6818 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6819         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6820         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6821         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6822         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6823         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6824         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6825 }
6826
6827 done
6828
6829 cf_search="$cf_library_path_list $cf_search"
6830
6831                         for cf_cv_library_path_utf8 in $cf_search
6832                         do
6833                                 if test -d "$cf_cv_library_path_utf8" ; then
6834                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6835
6836 echo "${as_me:-configure}:6836: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6837
6838                                         CPPFLAGS="$cf_test_CPPFLAGS"
6839                                         LIBS="-lutf8  $cf_save_LIBS"
6840                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6841                                         cat >"conftest.$ac_ext" <<_ACEOF
6842 #line 6842 "configure"
6843 #include "confdefs.h"
6844
6845 #include <libutf8.h>
6846 int
6847 main (void)
6848 {
6849 putwc(0,0);
6850   ;
6851   return 0;
6852 }
6853 _ACEOF
6854 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6855 if { (eval echo "$as_me:6855: \"$ac_link\"") >&5
6856   (eval $ac_link) 2>&5
6857   ac_status=$?
6858   echo "$as_me:6858: \$? = $ac_status" >&5
6859   (exit "$ac_status"); } &&
6860          { ac_try='test -s "conftest$ac_exeext"'
6861   { (eval echo "$as_me:6861: \"$ac_try\"") >&5
6862   (eval $ac_try) 2>&5
6863   ac_status=$?
6864   echo "$as_me:6864: \$? = $ac_status" >&5
6865   (exit "$ac_status"); }; }; then
6866
6867                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6868
6869 echo "${as_me:-configure}:6869: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6870
6871                                         cf_cv_find_linkage_utf8=yes
6872                                         cf_cv_library_file_utf8="-lutf8"
6873                                         break
6874 else
6875   echo "$as_me: failed program was:" >&5
6876 cat "conftest.$ac_ext" >&5
6877
6878                                         CPPFLAGS="$cf_save_CPPFLAGS"
6879                                         LIBS="$cf_save_LIBS"
6880                                         LDFLAGS="$cf_save_LDFLAGS"
6881
6882 fi
6883 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6884                                 fi
6885                         done
6886                         CPPFLAGS="$cf_save_CPPFLAGS"
6887                         LDFLAGS="$cf_save_LDFLAGS"
6888                 fi
6889
6890         else
6891                 cf_cv_find_linkage_utf8=no
6892         fi
6893
6894 fi
6895 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6896
6897 fi
6898 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6899
6900 LIBS="$cf_save_LIBS"
6901
6902 if test "$cf_cv_find_linkage_utf8" = yes ; then
6903 cf_cv_utf8_lib=add-on
6904 else
6905 cf_cv_utf8_lib=no
6906 fi
6907
6908 fi
6909 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6910 fi
6911 echo "$as_me:6911: result: $cf_cv_utf8_lib" >&5
6912 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6913
6914 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6915 # ncurses/ncursesw:
6916 if test "$cf_cv_utf8_lib" = "add-on" ; then
6917
6918 cat >>confdefs.h <<\EOF
6919 #define HAVE_LIBUTF8_H 1
6920 EOF
6921
6922 if test -n "$cf_cv_header_path_utf8" ; then
6923   for cf_add_incdir in $cf_cv_header_path_utf8
6924   do
6925         while test "$cf_add_incdir" != /usr/include
6926         do
6927           if test -d "$cf_add_incdir"
6928           then
6929                 cf_have_incdir=no
6930                 if test -n "$CFLAGS$CPPFLAGS" ; then
6931                   # a loop is needed to ensure we can add subdirs of existing dirs
6932                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6933                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6934                           cf_have_incdir=yes; break
6935                         fi
6936                   done
6937                 fi
6938
6939                 if test "$cf_have_incdir" = no ; then
6940                   if test "$cf_add_incdir" = /usr/local/include ; then
6941                         if test "$GCC" = yes
6942                         then
6943                           cf_save_CPPFLAGS=$CPPFLAGS
6944
6945         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6946         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6947
6948                           cat >"conftest.$ac_ext" <<_ACEOF
6949 #line 6949 "configure"
6950 #include "confdefs.h"
6951 #include <stdio.h>
6952 int
6953 main (void)
6954 {
6955 printf("Hello")
6956   ;
6957   return 0;
6958 }
6959 _ACEOF
6960 rm -f "conftest.$ac_objext"
6961 if { (eval echo "$as_me:6961: \"$ac_compile\"") >&5
6962   (eval $ac_compile) 2>&5
6963   ac_status=$?
6964   echo "$as_me:6964: \$? = $ac_status" >&5
6965   (exit "$ac_status"); } &&
6966          { ac_try='test -s "conftest.$ac_objext"'
6967   { (eval echo "$as_me:6967: \"$ac_try\"") >&5
6968   (eval $ac_try) 2>&5
6969   ac_status=$?
6970   echo "$as_me:6970: \$? = $ac_status" >&5
6971   (exit "$ac_status"); }; }; then
6972   :
6973 else
6974   echo "$as_me: failed program was:" >&5
6975 cat "conftest.$ac_ext" >&5
6976 cf_have_incdir=yes
6977 fi
6978 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6979                           CPPFLAGS=$cf_save_CPPFLAGS
6980                         fi
6981                   fi
6982                 fi
6983
6984                 if test "$cf_have_incdir" = no ; then
6985                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6986
6987 echo "${as_me:-configure}:6987: testing adding $cf_add_incdir to include-path ..." 1>&5
6988
6989                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6990
6991                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6992                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6993                   cf_add_incdir="$cf_top_incdir"
6994                 else
6995                   break
6996                 fi
6997           else
6998                 break
6999           fi
7000         done
7001   done
7002 fi
7003
7004 if test -n "$cf_cv_library_path_utf8" ; then
7005         for cf_add_libdir in $cf_cv_library_path_utf8
7006         do
7007                 if test "$cf_add_libdir" = /usr/lib ; then
7008                         :
7009                 elif test -d "$cf_add_libdir"
7010                 then
7011                         cf_have_libdir=no
7012                         if test -n "$LDFLAGS$LIBS" ; then
7013                                 # a loop is needed to ensure we can add subdirs of existing dirs
7014                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7015                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7016                                                 cf_have_libdir=yes; break
7017                                         fi
7018                                 done
7019                         fi
7020                         if test "$cf_have_libdir" = no ; then
7021                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7022
7023 echo "${as_me:-configure}:7023: testing adding $cf_add_libdir to library-path ..." 1>&5
7024
7025                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7026                         fi
7027                 fi
7028         done
7029 fi
7030
7031 cf_add_libs="$LIBS"
7032 # reverse order
7033 cf_add_0lib=
7034 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7035 # filter duplicates
7036 for cf_add_1lib in $cf_add_0lib; do
7037         for cf_add_2lib in $cf_add_libs; do
7038                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7039                         cf_add_1lib=
7040                         break
7041                 fi
7042         done
7043         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7044 done
7045 LIBS="$cf_add_libs"
7046
7047 fi
7048
7049 cf_ncuconfig_root=ncursesw
7050 cf_have_ncuconfig=no
7051
7052 if test "x${PKG_CONFIG:=none}" != xnone; then
7053         echo "$as_me:7053: checking pkg-config for $cf_ncuconfig_root" >&5
7054 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7055         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7056                 echo "$as_me:7056: result: yes" >&5
7057 echo "${ECHO_T}yes" >&6
7058
7059                 echo "$as_me:7059: checking if the $cf_ncuconfig_root package files work" >&5
7060 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7061                 cf_have_ncuconfig=unknown
7062
7063                 cf_save_CFLAGS="$CFLAGS"
7064                 cf_save_CPPFLAGS="$CPPFLAGS"
7065                 cf_save_LIBS="$LIBS"
7066
7067                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7068                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7069
7070                 # while -W for passing linker flags is prevalent, it is not "standard".
7071                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7072                 # incompatible _and_ non-standard -W option which gives an error.  Work
7073                 # around that pitfall.
7074                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7075                 (x*c[89]9@@*-W*)
7076
7077 cf_fix_cppflags=no
7078 cf_new_cflags=
7079 cf_new_cppflags=
7080 cf_new_extra_cppflags=
7081
7082 for cf_add_cflags in $cf_pkg_cflags
7083 do
7084 case "$cf_fix_cppflags" in
7085 (no)
7086         case "$cf_add_cflags" in
7087         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7088                 case "$cf_add_cflags" in
7089                 (-D*)
7090                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7091
7092                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7093                                 && test -z "${cf_tst_cflags}" \
7094                                 && cf_fix_cppflags=yes
7095
7096                         if test "$cf_fix_cppflags" = yes ; then
7097
7098         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7099         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7100
7101                                 continue
7102                         elif test "${cf_tst_cflags}" = "\"'" ; then
7103
7104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7106
7107                                 continue
7108                         fi
7109                         ;;
7110                 esac
7111                 case "$CPPFLAGS" in
7112                 (*$cf_add_cflags)
7113                         ;;
7114                 (*)
7115                         case "$cf_add_cflags" in
7116                         (-D*)
7117                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7118
7119 CPPFLAGS=`echo "$CPPFLAGS" | \
7120         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7121                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7122
7123                                 ;;
7124                         esac
7125
7126         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7127         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7128
7129                         ;;
7130                 esac
7131                 ;;
7132         (*)
7133
7134         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7135         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7136
7137                 ;;
7138         esac
7139         ;;
7140 (yes)
7141
7142         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7143         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7144
7145         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7146
7147         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7148                 && test -z "${cf_tst_cflags}" \
7149                 && cf_fix_cppflags=no
7150         ;;
7151 esac
7152 done
7153
7154 if test -n "$cf_new_cflags" ; then
7155
7156         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7157         CFLAGS="${CFLAGS}$cf_new_cflags"
7158
7159 fi
7160
7161 if test -n "$cf_new_cppflags" ; then
7162
7163         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7164         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7165
7166 fi
7167
7168 if test -n "$cf_new_extra_cppflags" ; then
7169
7170         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7171         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7172
7173 fi
7174
7175 cf_add_libs="$LIBS"
7176 # reverse order
7177 cf_add_0lib=
7178 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7179 # filter duplicates
7180 for cf_add_1lib in $cf_add_0lib; do
7181         for cf_add_2lib in $cf_add_libs; do
7182                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7183                         cf_add_1lib=
7184                         break
7185                 fi
7186         done
7187         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7188 done
7189 LIBS="$cf_add_libs"
7190
7191                         cat >"conftest.$ac_ext" <<_ACEOF
7192 #line 7192 "configure"
7193 #include "confdefs.h"
7194 #include <${cf_cv_ncurses_header:-curses.h}>
7195 int
7196 main (void)
7197 {
7198 initscr(); mousemask(0,0); tigetstr((char *)0);
7199   ;
7200   return 0;
7201 }
7202 _ACEOF
7203 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7204 if { (eval echo "$as_me:7204: \"$ac_link\"") >&5
7205   (eval $ac_link) 2>&5
7206   ac_status=$?
7207   echo "$as_me:7207: \$? = $ac_status" >&5
7208   (exit "$ac_status"); } &&
7209          { ac_try='test -s "conftest$ac_exeext"'
7210   { (eval echo "$as_me:7210: \"$ac_try\"") >&5
7211   (eval $ac_try) 2>&5
7212   ac_status=$?
7213   echo "$as_me:7213: \$? = $ac_status" >&5
7214   (exit "$ac_status"); }; }; then
7215   if test "$cross_compiling" = yes; then
7216   cf_test_ncuconfig=maybe
7217 else
7218   cat >"conftest.$ac_ext" <<_ACEOF
7219 #line 7219 "configure"
7220 #include "confdefs.h"
7221 #include <${cf_cv_ncurses_header:-curses.h}>
7222                                         int main(void)
7223                                         { const char *xx = curses_version(); return (xx == 0); }
7224 _ACEOF
7225 rm -f "conftest$ac_exeext"
7226 if { (eval echo "$as_me:7226: \"$ac_link\"") >&5
7227   (eval $ac_link) 2>&5
7228   ac_status=$?
7229   echo "$as_me:7229: \$? = $ac_status" >&5
7230   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7231   { (eval echo "$as_me:7231: \"$ac_try\"") >&5
7232   (eval $ac_try) 2>&5
7233   ac_status=$?
7234   echo "$as_me:7234: \$? = $ac_status" >&5
7235   (exit "$ac_status"); }; }; then
7236   cf_test_ncuconfig=yes
7237 else
7238   echo "$as_me: program exited with status $ac_status" >&5
7239 echo "$as_me: failed program was:" >&5
7240 cat "conftest.$ac_ext" >&5
7241 cf_test_ncuconfig=no
7242 fi
7243 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7244 fi
7245 else
7246   echo "$as_me: failed program was:" >&5
7247 cat "conftest.$ac_ext" >&5
7248 cf_test_ncuconfig=no
7249 fi
7250 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7251
7252                         CFLAGS="$cf_save_CFLAGS"
7253                         CPPFLAGS="$cf_save_CPPFLAGS"
7254                         LIBS="$cf_save_LIBS"
7255
7256                         if test "x$cf_test_ncuconfig" != xyes; then
7257                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7258                                 cf_pkg_cflags="$cf_temp"
7259                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7260                                 cf_pkg_libs="$cf_temp"
7261                         fi
7262                         ;;
7263                 esac
7264
7265 cf_fix_cppflags=no
7266 cf_new_cflags=
7267 cf_new_cppflags=
7268 cf_new_extra_cppflags=
7269
7270 for cf_add_cflags in $cf_pkg_cflags
7271 do
7272 case "$cf_fix_cppflags" in
7273 (no)
7274         case "$cf_add_cflags" in
7275         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7276                 case "$cf_add_cflags" in
7277                 (-D*)
7278                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7279
7280                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7281                                 && test -z "${cf_tst_cflags}" \
7282                                 && cf_fix_cppflags=yes
7283
7284                         if test "$cf_fix_cppflags" = yes ; then
7285
7286         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7287         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7288
7289                                 continue
7290                         elif test "${cf_tst_cflags}" = "\"'" ; then
7291
7292         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7293         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7294
7295                                 continue
7296                         fi
7297                         ;;
7298                 esac
7299                 case "$CPPFLAGS" in
7300                 (*$cf_add_cflags)
7301                         ;;
7302                 (*)
7303                         case "$cf_add_cflags" in
7304                         (-D*)
7305                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7306
7307 CPPFLAGS=`echo "$CPPFLAGS" | \
7308         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7309                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7310
7311                                 ;;
7312                         esac
7313
7314         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7315         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7316
7317                         ;;
7318                 esac
7319                 ;;
7320         (*)
7321
7322         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7323         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7324
7325                 ;;
7326         esac
7327         ;;
7328 (yes)
7329
7330         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7331         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7332
7333         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7334
7335         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7336                 && test -z "${cf_tst_cflags}" \
7337                 && cf_fix_cppflags=no
7338         ;;
7339 esac
7340 done
7341
7342 if test -n "$cf_new_cflags" ; then
7343
7344         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7345         CFLAGS="${CFLAGS}$cf_new_cflags"
7346
7347 fi
7348
7349 if test -n "$cf_new_cppflags" ; then
7350
7351         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7352         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7353
7354 fi
7355
7356 if test -n "$cf_new_extra_cppflags" ; then
7357
7358         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7359         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7360
7361 fi
7362
7363 cf_add_libs="$LIBS"
7364 # reverse order
7365 cf_add_0lib=
7366 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7367 # filter duplicates
7368 for cf_add_1lib in $cf_add_0lib; do
7369         for cf_add_2lib in $cf_add_libs; do
7370                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7371                         cf_add_1lib=
7372                         break
7373                 fi
7374         done
7375         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7376 done
7377 LIBS="$cf_add_libs"
7378
7379                 cat >"conftest.$ac_ext" <<_ACEOF
7380 #line 7380 "configure"
7381 #include "confdefs.h"
7382 #include <${cf_cv_ncurses_header:-curses.h}>
7383 int
7384 main (void)
7385 {
7386 initscr(); mousemask(0,0); tigetstr((char *)0);
7387   ;
7388   return 0;
7389 }
7390 _ACEOF
7391 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7392 if { (eval echo "$as_me:7392: \"$ac_link\"") >&5
7393   (eval $ac_link) 2>&5
7394   ac_status=$?
7395   echo "$as_me:7395: \$? = $ac_status" >&5
7396   (exit "$ac_status"); } &&
7397          { ac_try='test -s "conftest$ac_exeext"'
7398   { (eval echo "$as_me:7398: \"$ac_try\"") >&5
7399   (eval $ac_try) 2>&5
7400   ac_status=$?
7401   echo "$as_me:7401: \$? = $ac_status" >&5
7402   (exit "$ac_status"); }; }; then
7403   if test "$cross_compiling" = yes; then
7404   cf_have_ncuconfig=maybe
7405 else
7406   cat >"conftest.$ac_ext" <<_ACEOF
7407 #line 7407 "configure"
7408 #include "confdefs.h"
7409 #include <${cf_cv_ncurses_header:-curses.h}>
7410                                 int main(void)
7411                                 { const char *xx = curses_version(); return (xx == 0); }
7412 _ACEOF
7413 rm -f "conftest$ac_exeext"
7414 if { (eval echo "$as_me:7414: \"$ac_link\"") >&5
7415   (eval $ac_link) 2>&5
7416   ac_status=$?
7417   echo "$as_me:7417: \$? = $ac_status" >&5
7418   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7419   { (eval echo "$as_me:7419: \"$ac_try\"") >&5
7420   (eval $ac_try) 2>&5
7421   ac_status=$?
7422   echo "$as_me:7422: \$? = $ac_status" >&5
7423   (exit "$ac_status"); }; }; then
7424   cf_have_ncuconfig=yes
7425 else
7426   echo "$as_me: program exited with status $ac_status" >&5
7427 echo "$as_me: failed program was:" >&5
7428 cat "conftest.$ac_ext" >&5
7429 cf_have_ncuconfig=no
7430 fi
7431 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7432 fi
7433 else
7434   echo "$as_me: failed program was:" >&5
7435 cat "conftest.$ac_ext" >&5
7436 cf_have_ncuconfig=no
7437 fi
7438 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7439                 echo "$as_me:7439: result: $cf_have_ncuconfig" >&5
7440 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7441                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7442                 if test "$cf_have_ncuconfig" != "yes"
7443                 then
7444                         CPPFLAGS="$cf_save_CPPFLAGS"
7445                         LIBS="$cf_save_LIBS"
7446                         NCURSES_CONFIG_PKG=none
7447                 else
7448
7449 cat >>confdefs.h <<\EOF
7450 #define NCURSES 1
7451 EOF
7452
7453                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7454
7455 echo "$as_me:7455: checking for terminfo header" >&5
7456 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7457 if test "${cf_cv_term_header+set}" = set; then
7458   echo $ECHO_N "(cached) $ECHO_C" >&6
7459 else
7460
7461 case "${cf_cv_ncurses_header}" in
7462 (*/ncurses.h|*/ncursesw.h)
7463         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7464         ;;
7465 (*)
7466         cf_term_header=term.h
7467         ;;
7468 esac
7469
7470 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7471 do
7472 cat >"conftest.$ac_ext" <<_ACEOF
7473 #line 7473 "configure"
7474 #include "confdefs.h"
7475 #include <stdio.h>
7476 #include <${cf_cv_ncurses_header:-curses.h}>
7477 #include <$cf_test>
7478
7479 int
7480 main (void)
7481 {
7482 int x = auto_left_margin; (void)x
7483   ;
7484   return 0;
7485 }
7486 _ACEOF
7487 rm -f "conftest.$ac_objext"
7488 if { (eval echo "$as_me:7488: \"$ac_compile\"") >&5
7489   (eval $ac_compile) 2>&5
7490   ac_status=$?
7491   echo "$as_me:7491: \$? = $ac_status" >&5
7492   (exit "$ac_status"); } &&
7493          { ac_try='test -s "conftest.$ac_objext"'
7494   { (eval echo "$as_me:7494: \"$ac_try\"") >&5
7495   (eval $ac_try) 2>&5
7496   ac_status=$?
7497   echo "$as_me:7497: \$? = $ac_status" >&5
7498   (exit "$ac_status"); }; }; then
7499
7500         cf_cv_term_header="$cf_test"
7501 else
7502   echo "$as_me: failed program was:" >&5
7503 cat "conftest.$ac_ext" >&5
7504
7505         cf_cv_term_header=unknown
7506
7507 fi
7508 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7509         test "$cf_cv_term_header" != unknown && break
7510 done
7511
7512 fi
7513 echo "$as_me:7513: result: $cf_cv_term_header" >&5
7514 echo "${ECHO_T}$cf_cv_term_header" >&6
7515
7516 # Set definitions to allow ifdef'ing to accommodate subdirectories
7517
7518 case "$cf_cv_term_header" in
7519 (*term.h)
7520
7521 cat >>confdefs.h <<\EOF
7522 #define HAVE_TERM_H 1
7523 EOF
7524
7525         ;;
7526 esac
7527
7528 case "$cf_cv_term_header" in
7529 (ncurses/term.h)
7530
7531 cat >>confdefs.h <<\EOF
7532 #define HAVE_NCURSES_TERM_H 1
7533 EOF
7534
7535         ;;
7536 (ncursesw/term.h)
7537
7538 cat >>confdefs.h <<\EOF
7539 #define HAVE_NCURSESW_TERM_H 1
7540 EOF
7541
7542         ;;
7543 esac
7544
7545                 fi
7546
7547         else
7548                 echo "$as_me:7548: result: no" >&5
7549 echo "${ECHO_T}no" >&6
7550                 NCURSES_CONFIG_PKG=none
7551         fi
7552 else
7553         NCURSES_CONFIG_PKG=none
7554 fi
7555
7556 if test "x$cf_have_ncuconfig" = "xno"; then
7557         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7558
7559 if test -n "$ac_tool_prefix"; then
7560   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7561   do
7562     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7563 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7564 echo "$as_me:7564: checking for $ac_word" >&5
7565 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7566 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7567   echo $ECHO_N "(cached) $ECHO_C" >&6
7568 else
7569   if test -n "$NCURSES_CONFIG"; then
7570   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7571 else
7572   ac_save_IFS=$IFS; IFS=$ac_path_separator
7573 ac_dummy="$PATH"
7574 for ac_dir in $ac_dummy; do
7575   IFS=$ac_save_IFS
7576   test -z "$ac_dir" && ac_dir=.
7577   $as_executable_p "$ac_dir/$ac_word" || continue
7578 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7579 echo "$as_me:7579: found $ac_dir/$ac_word" >&5
7580 break
7581 done
7582
7583 fi
7584 fi
7585 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7586 if test -n "$NCURSES_CONFIG"; then
7587   echo "$as_me:7587: result: $NCURSES_CONFIG" >&5
7588 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7589 else
7590   echo "$as_me:7590: result: no" >&5
7591 echo "${ECHO_T}no" >&6
7592 fi
7593
7594     test -n "$NCURSES_CONFIG" && break
7595   done
7596 fi
7597 if test -z "$NCURSES_CONFIG"; then
7598   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7599   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7600 do
7601   # Extract the first word of "$ac_prog", so it can be a program name with args.
7602 set dummy $ac_prog; ac_word=$2
7603 echo "$as_me:7603: checking for $ac_word" >&5
7604 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7605 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7606   echo $ECHO_N "(cached) $ECHO_C" >&6
7607 else
7608   if test -n "$ac_ct_NCURSES_CONFIG"; then
7609   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7610 else
7611   ac_save_IFS=$IFS; IFS=$ac_path_separator
7612 ac_dummy="$PATH"
7613 for ac_dir in $ac_dummy; do
7614   IFS=$ac_save_IFS
7615   test -z "$ac_dir" && ac_dir=.
7616   $as_executable_p "$ac_dir/$ac_word" || continue
7617 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7618 echo "$as_me:7618: found $ac_dir/$ac_word" >&5
7619 break
7620 done
7621
7622 fi
7623 fi
7624 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7625 if test -n "$ac_ct_NCURSES_CONFIG"; then
7626   echo "$as_me:7626: result: $ac_ct_NCURSES_CONFIG" >&5
7627 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7628 else
7629   echo "$as_me:7629: result: no" >&5
7630 echo "${ECHO_T}no" >&6
7631 fi
7632
7633   test -n "$ac_ct_NCURSES_CONFIG" && break
7634 done
7635 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7636
7637   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7638 fi
7639
7640         if test "$NCURSES_CONFIG" != none ; then
7641
7642 cf_fix_cppflags=no
7643 cf_new_cflags=
7644 cf_new_cppflags=
7645 cf_new_extra_cppflags=
7646
7647 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7648 do
7649 case "$cf_fix_cppflags" in
7650 (no)
7651         case "$cf_add_cflags" in
7652         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7653                 case "$cf_add_cflags" in
7654                 (-D*)
7655                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7656
7657                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7658                                 && test -z "${cf_tst_cflags}" \
7659                                 && cf_fix_cppflags=yes
7660
7661                         if test "$cf_fix_cppflags" = yes ; then
7662
7663         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7664         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7665
7666                                 continue
7667                         elif test "${cf_tst_cflags}" = "\"'" ; then
7668
7669         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7670         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7671
7672                                 continue
7673                         fi
7674                         ;;
7675                 esac
7676                 case "$CPPFLAGS" in
7677                 (*$cf_add_cflags)
7678                         ;;
7679                 (*)
7680                         case "$cf_add_cflags" in
7681                         (-D*)
7682                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7683
7684 CPPFLAGS=`echo "$CPPFLAGS" | \
7685         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7686                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7687
7688                                 ;;
7689                         esac
7690
7691         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7692         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7693
7694                         ;;
7695                 esac
7696                 ;;
7697         (*)
7698
7699         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7700         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7701
7702                 ;;
7703         esac
7704         ;;
7705 (yes)
7706
7707         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7708         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7709
7710         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7711
7712         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7713                 && test -z "${cf_tst_cflags}" \
7714                 && cf_fix_cppflags=no
7715         ;;
7716 esac
7717 done
7718
7719 if test -n "$cf_new_cflags" ; then
7720
7721         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7722         CFLAGS="${CFLAGS}$cf_new_cflags"
7723
7724 fi
7725
7726 if test -n "$cf_new_cppflags" ; then
7727
7728         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7729         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7730
7731 fi
7732
7733 if test -n "$cf_new_extra_cppflags" ; then
7734
7735         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7736         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7737
7738 fi
7739
7740 cf_add_libs="$LIBS"
7741 # reverse order
7742 cf_add_0lib=
7743 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7744 # filter duplicates
7745 for cf_add_1lib in $cf_add_0lib; do
7746         for cf_add_2lib in $cf_add_libs; do
7747                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7748                         cf_add_1lib=
7749                         break
7750                 fi
7751         done
7752         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7753 done
7754 LIBS="$cf_add_libs"
7755
7756                 # even with config script, some packages use no-override for curses.h
7757
7758 echo "$as_me:7758: checking if we have identified curses headers" >&5
7759 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7760 if test "${cf_cv_ncurses_header+set}" = set; then
7761   echo $ECHO_N "(cached) $ECHO_C" >&6
7762 else
7763
7764 cf_cv_ncurses_header=none
7765 for cf_header in \
7766         ncurses.h ncursesw/ncurses.h \
7767         curses.h ncursesw/curses.h
7768 do
7769 cat >"conftest.$ac_ext" <<_ACEOF
7770 #line 7770 "configure"
7771 #include "confdefs.h"
7772 #include <${cf_header}>
7773 int
7774 main (void)
7775 {
7776 initscr(); tgoto("?", 0,0)
7777   ;
7778   return 0;
7779 }
7780 _ACEOF
7781 rm -f "conftest.$ac_objext"
7782 if { (eval echo "$as_me:7782: \"$ac_compile\"") >&5
7783   (eval $ac_compile) 2>&5
7784   ac_status=$?
7785   echo "$as_me:7785: \$? = $ac_status" >&5
7786   (exit "$ac_status"); } &&
7787          { ac_try='test -s "conftest.$ac_objext"'
7788   { (eval echo "$as_me:7788: \"$ac_try\"") >&5
7789   (eval $ac_try) 2>&5
7790   ac_status=$?
7791   echo "$as_me:7791: \$? = $ac_status" >&5
7792   (exit "$ac_status"); }; }; then
7793   cf_cv_ncurses_header=$cf_header; break
7794 else
7795   echo "$as_me: failed program was:" >&5
7796 cat "conftest.$ac_ext" >&5
7797 fi
7798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7799 done
7800
7801 fi
7802 echo "$as_me:7802: result: $cf_cv_ncurses_header" >&5
7803 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7804
7805 if test "$cf_cv_ncurses_header" = none ; then
7806         { { echo "$as_me:7806: error: No curses header-files found" >&5
7807 echo "$as_me: error: No curses header-files found" >&2;}
7808    { (exit 1); exit 1; }; }
7809 fi
7810
7811 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7812
7813 for ac_header in $cf_cv_ncurses_header
7814 do
7815 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7816 echo "$as_me:7816: checking for $ac_header" >&5
7817 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7818 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7819   echo $ECHO_N "(cached) $ECHO_C" >&6
7820 else
7821   cat >"conftest.$ac_ext" <<_ACEOF
7822 #line 7822 "configure"
7823 #include "confdefs.h"
7824 #include <$ac_header>
7825 _ACEOF
7826 if { (eval echo "$as_me:7826: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7827   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7828   ac_status=$?
7829   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7830   rm -f conftest.er1
7831   cat conftest.err >&5
7832   echo "$as_me:7832: \$? = $ac_status" >&5
7833   (exit "$ac_status"); } >/dev/null; then
7834   if test -s conftest.err; then
7835     ac_cpp_err=$ac_c_preproc_warn_flag
7836   else
7837     ac_cpp_err=
7838   fi
7839 else
7840   ac_cpp_err=yes
7841 fi
7842 if test -z "$ac_cpp_err"; then
7843   eval "$as_ac_Header=yes"
7844 else
7845   echo "$as_me: failed program was:" >&5
7846   cat "conftest.$ac_ext" >&5
7847   eval "$as_ac_Header=no"
7848 fi
7849 rm -f conftest.err "conftest.$ac_ext"
7850 fi
7851 echo "$as_me:7851: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7852 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7853 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7854   cat >>confdefs.h <<EOF
7855 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7856 EOF
7857
7858 fi
7859 done
7860
7861 cat >>confdefs.h <<\EOF
7862 #define NCURSES 1
7863 EOF
7864
7865 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7866
7867                 cat >>confdefs.h <<EOF
7868 #define $cf_nculib_ROOT 1
7869 EOF
7870
7871                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
7872
7873         else
7874
7875 cf_ncuhdr_root=ncursesw
7876
7877 test -n "$cf_cv_curses_dir" && \
7878 test "$cf_cv_curses_dir" != "no" && { \
7879
7880 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7881   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7882   do
7883         while test "$cf_add_incdir" != /usr/include
7884         do
7885           if test -d "$cf_add_incdir"
7886           then
7887                 cf_have_incdir=no
7888                 if test -n "$CFLAGS$CPPFLAGS" ; then
7889                   # a loop is needed to ensure we can add subdirs of existing dirs
7890                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7891                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7892                           cf_have_incdir=yes; break
7893                         fi
7894                   done
7895                 fi
7896
7897                 if test "$cf_have_incdir" = no ; then
7898                   if test "$cf_add_incdir" = /usr/local/include ; then
7899                         if test "$GCC" = yes
7900                         then
7901                           cf_save_CPPFLAGS=$CPPFLAGS
7902
7903         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7904         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7905
7906                           cat >"conftest.$ac_ext" <<_ACEOF
7907 #line 7907 "configure"
7908 #include "confdefs.h"
7909 #include <stdio.h>
7910 int
7911 main (void)
7912 {
7913 printf("Hello")
7914   ;
7915   return 0;
7916 }
7917 _ACEOF
7918 rm -f "conftest.$ac_objext"
7919 if { (eval echo "$as_me:7919: \"$ac_compile\"") >&5
7920   (eval $ac_compile) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit "$ac_status"); } &&
7924          { ac_try='test -s "conftest.$ac_objext"'
7925   { (eval echo "$as_me:7925: \"$ac_try\"") >&5
7926   (eval $ac_try) 2>&5
7927   ac_status=$?
7928   echo "$as_me:7928: \$? = $ac_status" >&5
7929   (exit "$ac_status"); }; }; then
7930   :
7931 else
7932   echo "$as_me: failed program was:" >&5
7933 cat "conftest.$ac_ext" >&5
7934 cf_have_incdir=yes
7935 fi
7936 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7937                           CPPFLAGS=$cf_save_CPPFLAGS
7938                         fi
7939                   fi
7940                 fi
7941
7942                 if test "$cf_have_incdir" = no ; then
7943                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7944
7945 echo "${as_me:-configure}:7945: testing adding $cf_add_incdir to include-path ..." 1>&5
7946
7947                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7948
7949                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7950                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7951                   cf_add_incdir="$cf_top_incdir"
7952                 else
7953                   break
7954                 fi
7955           else
7956                 break
7957           fi
7958         done
7959   done
7960 fi
7961
7962 }
7963
7964 echo "$as_me:7964: checking for $cf_ncuhdr_root header in include-path" >&5
7965 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7966 if test "${cf_cv_ncurses_h+set}" = set; then
7967   echo $ECHO_N "(cached) $ECHO_C" >&6
7968 else
7969
7970         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7971         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
7972         for cf_header in $cf_header_list
7973         do
7974
7975         cat >"conftest.$ac_ext" <<_ACEOF
7976 #line 7976 "configure"
7977 #include "confdefs.h"
7978
7979 #define _XOPEN_SOURCE_EXTENDED
7980 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7981 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7982
7983 #include <$cf_header>
7984 int
7985 main (void)
7986 {
7987
7988 #ifdef NCURSES_VERSION
7989
7990 #ifndef WACS_BSSB
7991         make an error
7992 #endif
7993
7994 printf("%s\\n", NCURSES_VERSION);
7995 #else
7996 #ifdef __NCURSES_H
7997 printf("old\\n");
7998 #else
7999         make an error
8000 #endif
8001 #endif
8002
8003   ;
8004   return 0;
8005 }
8006 _ACEOF
8007 rm -f "conftest.$ac_objext"
8008 if { (eval echo "$as_me:8008: \"$ac_compile\"") >&5
8009   (eval $ac_compile) 2>&5
8010   ac_status=$?
8011   echo "$as_me:8011: \$? = $ac_status" >&5
8012   (exit "$ac_status"); } &&
8013          { ac_try='test -s "conftest.$ac_objext"'
8014   { (eval echo "$as_me:8014: \"$ac_try\"") >&5
8015   (eval $ac_try) 2>&5
8016   ac_status=$?
8017   echo "$as_me:8017: \$? = $ac_status" >&5
8018   (exit "$ac_status"); }; }; then
8019   cf_cv_ncurses_h=$cf_header
8020
8021 else
8022   echo "$as_me: failed program was:" >&5
8023 cat "conftest.$ac_ext" >&5
8024 cf_cv_ncurses_h=no
8025 fi
8026 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8027
8028                 test "$cf_cv_ncurses_h" != no && break
8029         done
8030
8031 fi
8032 echo "$as_me:8032: result: $cf_cv_ncurses_h" >&5
8033 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8034
8035 if test "$cf_cv_ncurses_h" != no ; then
8036         cf_cv_ncurses_header=$cf_cv_ncurses_h
8037 else
8038
8039 echo "$as_me:8039: checking for $cf_ncuhdr_root include-path" >&5
8040 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8041 if test "${cf_cv_ncurses_h2+set}" = set; then
8042   echo $ECHO_N "(cached) $ECHO_C" >&6
8043 else
8044
8045         test -n "$verbose" && echo
8046
8047 cf_search=
8048
8049 # collect the current set of include-directories from compiler flags
8050 cf_header_path_list=""
8051 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8052         for cf_header_path in $CPPFLAGS $CFLAGS
8053         do
8054                 case "$cf_header_path" in
8055                 (-I*)
8056                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8057
8058 test "x$cf_header_path" != "xNONE" && \
8059 test -d "$cf_header_path" && \
8060  {
8061         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8062         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8063         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8064         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8065         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8066         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"
8067 }
8068
8069                         cf_header_path_list="$cf_header_path_list $cf_search"
8070                         ;;
8071                 esac
8072         done
8073 fi
8074
8075 # add the variations for the package we are looking for
8076
8077 cf_search=
8078
8079 test "x$prefix" != "xNONE" && \
8080 test -d "$prefix" && \
8081  {
8082         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8083         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8084         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8085         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8086         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8087         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8088 }
8089
8090 for cf_subdir_prefix in \
8091         /usr \
8092         /usr/local \
8093         /usr/pkg \
8094         /opt \
8095         /opt/local \
8096         $HOME
8097 do
8098
8099 test "x$cf_subdir_prefix" != "x$prefix" && \
8100 test -d "$cf_subdir_prefix" && \
8101 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8102         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8103         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8104         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8105         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8106         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8107         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"
8108 }
8109
8110 done
8111
8112 test "$includedir" != NONE && \
8113 test "$includedir" != "/usr/include" && \
8114 test -d "$includedir" && {
8115         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8116         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8117 }
8118
8119 test "$oldincludedir" != NONE && \
8120 test "$oldincludedir" != "/usr/include" && \
8121 test -d "$oldincludedir" && {
8122         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8123         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8124 }
8125
8126 cf_search="$cf_search $cf_header_path_list"
8127
8128         test -n "$verbose" && echo "search path $cf_search"
8129         cf_save2_CPPFLAGS="$CPPFLAGS"
8130         for cf_incdir in $cf_search
8131         do
8132
8133 if test -n "$cf_incdir" ; then
8134   for cf_add_incdir in $cf_incdir
8135   do
8136         while test "$cf_add_incdir" != /usr/include
8137         do
8138           if test -d "$cf_add_incdir"
8139           then
8140                 cf_have_incdir=no
8141                 if test -n "$CFLAGS$CPPFLAGS" ; then
8142                   # a loop is needed to ensure we can add subdirs of existing dirs
8143                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8144                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8145                           cf_have_incdir=yes; break
8146                         fi
8147                   done
8148                 fi
8149
8150                 if test "$cf_have_incdir" = no ; then
8151                   if test "$cf_add_incdir" = /usr/local/include ; then
8152                         if test "$GCC" = yes
8153                         then
8154                           cf_save_CPPFLAGS=$CPPFLAGS
8155
8156         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8157         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8158
8159                           cat >"conftest.$ac_ext" <<_ACEOF
8160 #line 8160 "configure"
8161 #include "confdefs.h"
8162 #include <stdio.h>
8163 int
8164 main (void)
8165 {
8166 printf("Hello")
8167   ;
8168   return 0;
8169 }
8170 _ACEOF
8171 rm -f "conftest.$ac_objext"
8172 if { (eval echo "$as_me:8172: \"$ac_compile\"") >&5
8173   (eval $ac_compile) 2>&5
8174   ac_status=$?
8175   echo "$as_me:8175: \$? = $ac_status" >&5
8176   (exit "$ac_status"); } &&
8177          { ac_try='test -s "conftest.$ac_objext"'
8178   { (eval echo "$as_me:8178: \"$ac_try\"") >&5
8179   (eval $ac_try) 2>&5
8180   ac_status=$?
8181   echo "$as_me:8181: \$? = $ac_status" >&5
8182   (exit "$ac_status"); }; }; then
8183   :
8184 else
8185   echo "$as_me: failed program was:" >&5
8186 cat "conftest.$ac_ext" >&5
8187 cf_have_incdir=yes
8188 fi
8189 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8190                           CPPFLAGS=$cf_save_CPPFLAGS
8191                         fi
8192                   fi
8193                 fi
8194
8195                 if test "$cf_have_incdir" = no ; then
8196                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8197
8198 echo "${as_me:-configure}:8198: testing adding $cf_add_incdir to include-path ..." 1>&5
8199
8200                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8201
8202                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8203                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8204                   cf_add_incdir="$cf_top_incdir"
8205                 else
8206                   break
8207                 fi
8208           else
8209                 break
8210           fi
8211         done
8212   done
8213 fi
8214
8215                 for cf_header in \
8216                         ncurses.h \
8217                         curses.h
8218                 do
8219
8220         cat >"conftest.$ac_ext" <<_ACEOF
8221 #line 8221 "configure"
8222 #include "confdefs.h"
8223
8224 #include <$cf_header>
8225 int
8226 main (void)
8227 {
8228
8229 #ifdef NCURSES_VERSION
8230
8231 printf("%s\\n", NCURSES_VERSION);
8232 #else
8233 #ifdef __NCURSES_H
8234 printf("old\\n");
8235 #else
8236         make an error
8237 #endif
8238 #endif
8239
8240   ;
8241   return 0;
8242 }
8243 _ACEOF
8244 rm -f "conftest.$ac_objext"
8245 if { (eval echo "$as_me:8245: \"$ac_compile\"") >&5
8246   (eval $ac_compile) 2>&5
8247   ac_status=$?
8248   echo "$as_me:8248: \$? = $ac_status" >&5
8249   (exit "$ac_status"); } &&
8250          { ac_try='test -s "conftest.$ac_objext"'
8251   { (eval echo "$as_me:8251: \"$ac_try\"") >&5
8252   (eval $ac_try) 2>&5
8253   ac_status=$?
8254   echo "$as_me:8254: \$? = $ac_status" >&5
8255   (exit "$ac_status"); }; }; then
8256   cf_cv_ncurses_h2=$cf_header
8257
8258 else
8259   echo "$as_me: failed program was:" >&5
8260 cat "conftest.$ac_ext" >&5
8261 cf_cv_ncurses_h2=no
8262 fi
8263 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8264
8265                         if test "$cf_cv_ncurses_h2" != no ; then
8266                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8267                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8268                                 break
8269                         fi
8270                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8271                 done
8272                 CPPFLAGS="$cf_save2_CPPFLAGS"
8273                 test "$cf_cv_ncurses_h2" != no && break
8274         done
8275         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8275: error: not found" >&5
8276 echo "$as_me: error: not found" >&2;}
8277    { (exit 1); exit 1; }; }
8278
8279 fi
8280 echo "$as_me:8280: result: $cf_cv_ncurses_h2" >&5
8281 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8282
8283         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8284         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8285         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8286                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8287         fi
8288
8289 if test -n "$cf_1st_incdir" ; then
8290   for cf_add_incdir in $cf_1st_incdir
8291   do
8292         while test "$cf_add_incdir" != /usr/include
8293         do
8294           if test -d "$cf_add_incdir"
8295           then
8296                 cf_have_incdir=no
8297                 if test -n "$CFLAGS$CPPFLAGS" ; then
8298                   # a loop is needed to ensure we can add subdirs of existing dirs
8299                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8300                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8301                           cf_have_incdir=yes; break
8302                         fi
8303                   done
8304                 fi
8305
8306                 if test "$cf_have_incdir" = no ; then
8307                   if test "$cf_add_incdir" = /usr/local/include ; then
8308                         if test "$GCC" = yes
8309                         then
8310                           cf_save_CPPFLAGS=$CPPFLAGS
8311
8312         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8313         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8314
8315                           cat >"conftest.$ac_ext" <<_ACEOF
8316 #line 8316 "configure"
8317 #include "confdefs.h"
8318 #include <stdio.h>
8319 int
8320 main (void)
8321 {
8322 printf("Hello")
8323   ;
8324   return 0;
8325 }
8326 _ACEOF
8327 rm -f "conftest.$ac_objext"
8328 if { (eval echo "$as_me:8328: \"$ac_compile\"") >&5
8329   (eval $ac_compile) 2>&5
8330   ac_status=$?
8331   echo "$as_me:8331: \$? = $ac_status" >&5
8332   (exit "$ac_status"); } &&
8333          { ac_try='test -s "conftest.$ac_objext"'
8334   { (eval echo "$as_me:8334: \"$ac_try\"") >&5
8335   (eval $ac_try) 2>&5
8336   ac_status=$?
8337   echo "$as_me:8337: \$? = $ac_status" >&5
8338   (exit "$ac_status"); }; }; then
8339   :
8340 else
8341   echo "$as_me: failed program was:" >&5
8342 cat "conftest.$ac_ext" >&5
8343 cf_have_incdir=yes
8344 fi
8345 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8346                           CPPFLAGS=$cf_save_CPPFLAGS
8347                         fi
8348                   fi
8349                 fi
8350
8351                 if test "$cf_have_incdir" = no ; then
8352                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8353
8354 echo "${as_me:-configure}:8354: testing adding $cf_add_incdir to include-path ..." 1>&5
8355
8356                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8357
8358                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8359                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8360                   cf_add_incdir="$cf_top_incdir"
8361                 else
8362                   break
8363                 fi
8364           else
8365                 break
8366           fi
8367         done
8368   done
8369 fi
8370
8371 fi
8372
8373 # Set definitions to allow ifdef'ing for ncurses.h
8374
8375 case "$cf_cv_ncurses_header" in
8376 (*ncurses.h)
8377
8378 cat >>confdefs.h <<\EOF
8379 #define HAVE_NCURSES_H 1
8380 EOF
8381
8382         ;;
8383 esac
8384
8385 case "$cf_cv_ncurses_header" in
8386 (ncurses/curses.h|ncurses/ncurses.h)
8387
8388 cat >>confdefs.h <<\EOF
8389 #define HAVE_NCURSES_NCURSES_H 1
8390 EOF
8391
8392         ;;
8393 (ncursesw/curses.h|ncursesw/ncurses.h)
8394
8395 cat >>confdefs.h <<\EOF
8396 #define HAVE_NCURSESW_NCURSES_H 1
8397 EOF
8398
8399         ;;
8400 esac
8401
8402 echo "$as_me:8402: checking for terminfo header" >&5
8403 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8404 if test "${cf_cv_term_header+set}" = set; then
8405   echo $ECHO_N "(cached) $ECHO_C" >&6
8406 else
8407
8408 case "${cf_cv_ncurses_header}" in
8409 (*/ncurses.h|*/ncursesw.h)
8410         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8411         ;;
8412 (*)
8413         cf_term_header=term.h
8414         ;;
8415 esac
8416
8417 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8418 do
8419 cat >"conftest.$ac_ext" <<_ACEOF
8420 #line 8420 "configure"
8421 #include "confdefs.h"
8422 #include <stdio.h>
8423 #include <${cf_cv_ncurses_header:-curses.h}>
8424 #include <$cf_test>
8425
8426 int
8427 main (void)
8428 {
8429 int x = auto_left_margin; (void)x
8430   ;
8431   return 0;
8432 }
8433 _ACEOF
8434 rm -f "conftest.$ac_objext"
8435 if { (eval echo "$as_me:8435: \"$ac_compile\"") >&5
8436   (eval $ac_compile) 2>&5
8437   ac_status=$?
8438   echo "$as_me:8438: \$? = $ac_status" >&5
8439   (exit "$ac_status"); } &&
8440          { ac_try='test -s "conftest.$ac_objext"'
8441   { (eval echo "$as_me:8441: \"$ac_try\"") >&5
8442   (eval $ac_try) 2>&5
8443   ac_status=$?
8444   echo "$as_me:8444: \$? = $ac_status" >&5
8445   (exit "$ac_status"); }; }; then
8446
8447         cf_cv_term_header="$cf_test"
8448 else
8449   echo "$as_me: failed program was:" >&5
8450 cat "conftest.$ac_ext" >&5
8451
8452         cf_cv_term_header=unknown
8453
8454 fi
8455 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8456         test "$cf_cv_term_header" != unknown && break
8457 done
8458
8459 fi
8460 echo "$as_me:8460: result: $cf_cv_term_header" >&5
8461 echo "${ECHO_T}$cf_cv_term_header" >&6
8462
8463 # Set definitions to allow ifdef'ing to accommodate subdirectories
8464
8465 case "$cf_cv_term_header" in
8466 (*term.h)
8467
8468 cat >>confdefs.h <<\EOF
8469 #define HAVE_TERM_H 1
8470 EOF
8471
8472         ;;
8473 esac
8474
8475 case "$cf_cv_term_header" in
8476 (ncurses/term.h)
8477
8478 cat >>confdefs.h <<\EOF
8479 #define HAVE_NCURSES_TERM_H 1
8480 EOF
8481
8482         ;;
8483 (ncursesw/term.h)
8484
8485 cat >>confdefs.h <<\EOF
8486 #define HAVE_NCURSESW_TERM_H 1
8487 EOF
8488
8489         ;;
8490 esac
8491
8492 # some applications need this, but should check for NCURSES_VERSION
8493
8494 cat >>confdefs.h <<\EOF
8495 #define NCURSES 1
8496 EOF
8497
8498 echo "$as_me:8498: checking for ncurses version" >&5
8499 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8500 if test "${cf_cv_ncurses_version+set}" = set; then
8501   echo $ECHO_N "(cached) $ECHO_C" >&6
8502 else
8503
8504         cf_cv_ncurses_version=no
8505         cf_tempfile=out$$
8506         rm -f "$cf_tempfile"
8507         if test "$cross_compiling" = yes; then
8508
8509         # This will not work if the preprocessor splits the line after the
8510         # Autoconf token.  The 'unproto' program does that.
8511         cat > "conftest.$ac_ext" <<EOF
8512 #include <${cf_cv_ncurses_header:-curses.h}>
8513 #undef Autoconf
8514 #ifdef NCURSES_VERSION
8515 Autoconf NCURSES_VERSION
8516 #else
8517 #ifdef __NCURSES_H
8518 Autoconf "old"
8519 #endif
8520 ;
8521 #endif
8522 EOF
8523         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8524         { (eval echo "$as_me:8524: \"$cf_try\"") >&5
8525   (eval $cf_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit "$ac_status"); }
8529         if test -f conftest.out ; then
8530                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8531                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8532                 rm -f conftest.out
8533         fi
8534
8535 else
8536   cat >"conftest.$ac_ext" <<_ACEOF
8537 #line 8537 "configure"
8538 #include "confdefs.h"
8539
8540 #include <${cf_cv_ncurses_header:-curses.h}>
8541 #include <stdio.h>
8542 int main(void)
8543 {
8544         FILE *fp = fopen("$cf_tempfile", "w");
8545 #ifdef NCURSES_VERSION
8546 # ifdef NCURSES_VERSION_PATCH
8547         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8548 # else
8549         fprintf(fp, "%s\\n", NCURSES_VERSION);
8550 # endif
8551 #else
8552 # ifdef __NCURSES_H
8553         fprintf(fp, "old\\n");
8554 # else
8555         make an error
8556 # endif
8557 #endif
8558         ${cf_cv_main_return:-return}(0);
8559 }
8560 _ACEOF
8561 rm -f "conftest$ac_exeext"
8562 if { (eval echo "$as_me:8562: \"$ac_link\"") >&5
8563   (eval $ac_link) 2>&5
8564   ac_status=$?
8565   echo "$as_me:8565: \$? = $ac_status" >&5
8566   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8567   { (eval echo "$as_me:8567: \"$ac_try\"") >&5
8568   (eval $ac_try) 2>&5
8569   ac_status=$?
8570   echo "$as_me:8570: \$? = $ac_status" >&5
8571   (exit "$ac_status"); }; }; then
8572
8573         cf_cv_ncurses_version=`cat $cf_tempfile`
8574 else
8575   echo "$as_me: program exited with status $ac_status" >&5
8576 echo "$as_me: failed program was:" >&5
8577 cat "conftest.$ac_ext" >&5
8578 fi
8579 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8580 fi
8581         rm -f "$cf_tempfile"
8582
8583 fi
8584 echo "$as_me:8584: result: $cf_cv_ncurses_version" >&5
8585 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8586 test "$cf_cv_ncurses_version" = no ||
8587 cat >>confdefs.h <<\EOF
8588 #define NCURSES 1
8589 EOF
8590
8591 cf_nculib_root=ncursesw
8592         # This works, except for the special case where we find gpm, but
8593         # ncurses is in a nonstandard location via $LIBS, and we really want
8594         # to link gpm.
8595 cf_ncurses_LIBS=""
8596 cf_ncurses_SAVE="$LIBS"
8597 echo "$as_me:8597: checking for Gpm_Open in -lgpm" >&5
8598 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8599 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8600   echo $ECHO_N "(cached) $ECHO_C" >&6
8601 else
8602   ac_check_lib_save_LIBS=$LIBS
8603 LIBS="-lgpm  $LIBS"
8604 cat >"conftest.$ac_ext" <<_ACEOF
8605 #line 8605 "configure"
8606 #include "confdefs.h"
8607
8608 /* Override any gcc2 internal prototype to avoid an error.  */
8609 #ifdef __cplusplus
8610 extern "C"
8611 #endif
8612 /* We use char because int might match the return type of a gcc2
8613    builtin and then its argument prototype would still apply.  */
8614 char Gpm_Open ();
8615 int
8616 main (void)
8617 {
8618 Gpm_Open ();
8619   ;
8620   return 0;
8621 }
8622 _ACEOF
8623 rm -f "conftest.$ac_objext" "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"); } &&
8629          { ac_try='test -s "conftest$ac_exeext"'
8630   { (eval echo "$as_me:8630: \"$ac_try\"") >&5
8631   (eval $ac_try) 2>&5
8632   ac_status=$?
8633   echo "$as_me:8633: \$? = $ac_status" >&5
8634   (exit "$ac_status"); }; }; then
8635   ac_cv_lib_gpm_Gpm_Open=yes
8636 else
8637   echo "$as_me: failed program was:" >&5
8638 cat "conftest.$ac_ext" >&5
8639 ac_cv_lib_gpm_Gpm_Open=no
8640 fi
8641 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8642 LIBS=$ac_check_lib_save_LIBS
8643 fi
8644 echo "$as_me:8644: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8645 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8646 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8647   echo "$as_me:8647: checking for initscr in -lgpm" >&5
8648 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8649 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8650   echo $ECHO_N "(cached) $ECHO_C" >&6
8651 else
8652   ac_check_lib_save_LIBS=$LIBS
8653 LIBS="-lgpm  $LIBS"
8654 cat >"conftest.$ac_ext" <<_ACEOF
8655 #line 8655 "configure"
8656 #include "confdefs.h"
8657
8658 /* Override any gcc2 internal prototype to avoid an error.  */
8659 #ifdef __cplusplus
8660 extern "C"
8661 #endif
8662 /* We use char because int might match the return type of a gcc2
8663    builtin and then its argument prototype would still apply.  */
8664 char initscr ();
8665 int
8666 main (void)
8667 {
8668 initscr ();
8669   ;
8670   return 0;
8671 }
8672 _ACEOF
8673 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8674 if { (eval echo "$as_me:8674: \"$ac_link\"") >&5
8675   (eval $ac_link) 2>&5
8676   ac_status=$?
8677   echo "$as_me:8677: \$? = $ac_status" >&5
8678   (exit "$ac_status"); } &&
8679          { ac_try='test -s "conftest$ac_exeext"'
8680   { (eval echo "$as_me:8680: \"$ac_try\"") >&5
8681   (eval $ac_try) 2>&5
8682   ac_status=$?
8683   echo "$as_me:8683: \$? = $ac_status" >&5
8684   (exit "$ac_status"); }; }; then
8685   ac_cv_lib_gpm_initscr=yes
8686 else
8687   echo "$as_me: failed program was:" >&5
8688 cat "conftest.$ac_ext" >&5
8689 ac_cv_lib_gpm_initscr=no
8690 fi
8691 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8692 LIBS=$ac_check_lib_save_LIBS
8693 fi
8694 echo "$as_me:8694: result: $ac_cv_lib_gpm_initscr" >&5
8695 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8696 if test "$ac_cv_lib_gpm_initscr" = yes; then
8697   LIBS="$cf_ncurses_SAVE"
8698 else
8699   cf_ncurses_LIBS="-lgpm"
8700 fi
8701
8702 fi
8703
8704 case "$host_os" in
8705 (freebsd*)
8706         # This is only necessary if you are linking against an obsolete
8707         # version of ncurses (but it should do no harm, since it's static).
8708         if test "$cf_nculib_root" = ncurses ; then
8709                 echo "$as_me:8709: checking for tgoto in -lmytinfo" >&5
8710 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8711 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8712   echo $ECHO_N "(cached) $ECHO_C" >&6
8713 else
8714   ac_check_lib_save_LIBS=$LIBS
8715 LIBS="-lmytinfo  $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 tgoto ();
8727 int
8728 main (void)
8729 {
8730 tgoto ();
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_mytinfo_tgoto=yes
8748 else
8749   echo "$as_me: failed program was:" >&5
8750 cat "conftest.$ac_ext" >&5
8751 ac_cv_lib_mytinfo_tgoto=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_mytinfo_tgoto" >&5
8757 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8758 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8759   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8760 fi
8761
8762         fi
8763         ;;
8764 esac
8765
8766 cf_add_libs="$LIBS"
8767 # reverse order
8768 cf_add_0lib=
8769 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8770 # filter duplicates
8771 for cf_add_1lib in $cf_add_0lib; do
8772         for cf_add_2lib in $cf_add_libs; do
8773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8774                         cf_add_1lib=
8775                         break
8776                 fi
8777         done
8778         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8779 done
8780 LIBS="$cf_add_libs"
8781
8782 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8783 then
8784
8785 cf_add_libs="$LIBS"
8786 # reverse order
8787 cf_add_0lib=
8788 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8789 # filter duplicates
8790 for cf_add_1lib in $cf_add_0lib; do
8791         for cf_add_2lib in $cf_add_libs; do
8792                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8793                         cf_add_1lib=
8794                         break
8795                 fi
8796         done
8797         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8798 done
8799 LIBS="$cf_add_libs"
8800
8801 else
8802
8803         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
8804         cf_libdir=""
8805         echo "$as_me:8805: checking for initscr" >&5
8806 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8807 if test "${ac_cv_func_initscr+set}" = set; then
8808   echo $ECHO_N "(cached) $ECHO_C" >&6
8809 else
8810   cat >"conftest.$ac_ext" <<_ACEOF
8811 #line 8811 "configure"
8812 #include "confdefs.h"
8813 #define initscr autoconf_temporary
8814 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8815 #undef initscr
8816
8817 #ifdef __cplusplus
8818 extern "C"
8819 #endif
8820
8821 /* We use char because int might match the return type of a gcc2
8822    builtin and then its argument prototype would still apply.  */
8823 char initscr (void);
8824
8825 int
8826 main (void)
8827 {
8828
8829 /* The GNU C library defines stubs for functions which it implements
8830     to always fail with ENOSYS.  Some functions are actually named
8831     something starting with __ and the normal name is an alias.  */
8832 #if defined (__stub_initscr) || defined (__stub___initscr)
8833 #error found stub for initscr
8834 #endif
8835
8836         return initscr ();
8837   ;
8838   return 0;
8839 }
8840 _ACEOF
8841 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8842 if { (eval echo "$as_me:8842: \"$ac_link\"") >&5
8843   (eval $ac_link) 2>&5
8844   ac_status=$?
8845   echo "$as_me:8845: \$? = $ac_status" >&5
8846   (exit "$ac_status"); } &&
8847          { ac_try='test -s "conftest$ac_exeext"'
8848   { (eval echo "$as_me:8848: \"$ac_try\"") >&5
8849   (eval $ac_try) 2>&5
8850   ac_status=$?
8851   echo "$as_me:8851: \$? = $ac_status" >&5
8852   (exit "$ac_status"); }; }; then
8853   ac_cv_func_initscr=yes
8854 else
8855   echo "$as_me: failed program was:" >&5
8856 cat "conftest.$ac_ext" >&5
8857 ac_cv_func_initscr=no
8858 fi
8859 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8860 fi
8861 echo "$as_me:8861: result: $ac_cv_func_initscr" >&5
8862 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8863 if test "$ac_cv_func_initscr" = yes; then
8864   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8865 else
8866
8867                 cf_save_LIBS="$LIBS"
8868                 echo "$as_me:8868: checking for initscr in -l$cf_nculib_root" >&5
8869 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8870                 LIBS="-l$cf_nculib_root $LIBS"
8871                 cat >"conftest.$ac_ext" <<_ACEOF
8872 #line 8872 "configure"
8873 #include "confdefs.h"
8874 #include <${cf_cv_ncurses_header:-curses.h}>
8875 int
8876 main (void)
8877 {
8878 initscr()
8879   ;
8880   return 0;
8881 }
8882 _ACEOF
8883 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8884 if { (eval echo "$as_me:8884: \"$ac_link\"") >&5
8885   (eval $ac_link) 2>&5
8886   ac_status=$?
8887   echo "$as_me:8887: \$? = $ac_status" >&5
8888   (exit "$ac_status"); } &&
8889          { ac_try='test -s "conftest$ac_exeext"'
8890   { (eval echo "$as_me:8890: \"$ac_try\"") >&5
8891   (eval $ac_try) 2>&5
8892   ac_status=$?
8893   echo "$as_me:8893: \$? = $ac_status" >&5
8894   (exit "$ac_status"); }; }; then
8895   echo "$as_me:8895: result: yes" >&5
8896 echo "${ECHO_T}yes" >&6
8897                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8898
8899 else
8900   echo "$as_me: failed program was:" >&5
8901 cat "conftest.$ac_ext" >&5
8902 echo "$as_me:8902: result: no" >&5
8903 echo "${ECHO_T}no" >&6
8904
8905 cf_search=
8906 cf_library_path_list=""
8907 if test -n "${LDFLAGS}${LIBS}" ; then
8908         for cf_library_path in $LDFLAGS $LIBS
8909         do
8910                 case "$cf_library_path" in
8911                 (-L*)
8912                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8913
8914 test "x$cf_library_path" != "xNONE" && \
8915 test -d "$cf_library_path" && \
8916  {
8917         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8918         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
8919         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8920         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8921         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8922         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"
8923 }
8924
8925                         cf_library_path_list="$cf_library_path_list $cf_search"
8926                         ;;
8927                 esac
8928         done
8929 fi
8930
8931 cf_search=
8932
8933 test "x$prefix" != "xNONE" && \
8934 test -d "$prefix" && \
8935  {
8936         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8937         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
8938         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8939         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8940         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8941         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8942 }
8943
8944 for cf_subdir_prefix in \
8945         /usr \
8946         /usr/local \
8947         /usr/pkg \
8948         /opt \
8949         /opt/local \
8950         $HOME
8951 do
8952
8953 test "x$cf_subdir_prefix" != "x$prefix" && \
8954 test -d "$cf_subdir_prefix" && \
8955 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8956         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8957         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8958         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8959         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8960         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8961         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"
8962 }
8963
8964 done
8965
8966 cf_search="$cf_library_path_list $cf_search"
8967
8968                         for cf_libdir in $cf_search
8969                         do
8970                                 echo "$as_me:8970: checking for -l$cf_nculib_root in $cf_libdir" >&5
8971 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8972                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8973                                 cat >"conftest.$ac_ext" <<_ACEOF
8974 #line 8974 "configure"
8975 #include "confdefs.h"
8976 #include <${cf_cv_ncurses_header:-curses.h}>
8977 int
8978 main (void)
8979 {
8980 initscr()
8981   ;
8982   return 0;
8983 }
8984 _ACEOF
8985 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8986 if { (eval echo "$as_me:8986: \"$ac_link\"") >&5
8987   (eval $ac_link) 2>&5
8988   ac_status=$?
8989   echo "$as_me:8989: \$? = $ac_status" >&5
8990   (exit "$ac_status"); } &&
8991          { ac_try='test -s "conftest$ac_exeext"'
8992   { (eval echo "$as_me:8992: \"$ac_try\"") >&5
8993   (eval $ac_try) 2>&5
8994   ac_status=$?
8995   echo "$as_me:8995: \$? = $ac_status" >&5
8996   (exit "$ac_status"); }; }; then
8997   echo "$as_me:8997: result: yes" >&5
8998 echo "${ECHO_T}yes" >&6
8999                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9000                                          break
9001 else
9002   echo "$as_me: failed program was:" >&5
9003 cat "conftest.$ac_ext" >&5
9004 echo "$as_me:9004: result: no" >&5
9005 echo "${ECHO_T}no" >&6
9006                                          LIBS="$cf_save_LIBS"
9007 fi
9008 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9009                         done
9010
9011 fi
9012 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9013
9014 fi
9015
9016 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9017
9018 if test "$cf_found_library" = no ; then
9019         { { echo "$as_me:9019: error: Cannot link $cf_nculib_root library" >&5
9020 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9021    { (exit 1); exit 1; }; }
9022 fi
9023
9024 fi
9025
9026 if test -n "$cf_ncurses_LIBS" ; then
9027         echo "$as_me:9027: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9028 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9029         cf_ncurses_SAVE="$LIBS"
9030         for p in $cf_ncurses_LIBS ; do
9031                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9032                 if test "$q" != "$LIBS" ; then
9033                         LIBS="$q"
9034                 fi
9035         done
9036         cat >"conftest.$ac_ext" <<_ACEOF
9037 #line 9037 "configure"
9038 #include "confdefs.h"
9039 #include <${cf_cv_ncurses_header:-curses.h}>
9040 int
9041 main (void)
9042 {
9043 initscr(); mousemask(0,0); tigetstr((char *)0);
9044   ;
9045   return 0;
9046 }
9047 _ACEOF
9048 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9049 if { (eval echo "$as_me:9049: \"$ac_link\"") >&5
9050   (eval $ac_link) 2>&5
9051   ac_status=$?
9052   echo "$as_me:9052: \$? = $ac_status" >&5
9053   (exit "$ac_status"); } &&
9054          { ac_try='test -s "conftest$ac_exeext"'
9055   { (eval echo "$as_me:9055: \"$ac_try\"") >&5
9056   (eval $ac_try) 2>&5
9057   ac_status=$?
9058   echo "$as_me:9058: \$? = $ac_status" >&5
9059   (exit "$ac_status"); }; }; then
9060   echo "$as_me:9060: result: yes" >&5
9061 echo "${ECHO_T}yes" >&6
9062 else
9063   echo "$as_me: failed program was:" >&5
9064 cat "conftest.$ac_ext" >&5
9065 echo "$as_me:9065: result: no" >&5
9066 echo "${ECHO_T}no" >&6
9067                  LIBS="$cf_ncurses_SAVE"
9068 fi
9069 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9070 fi
9071
9072 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9073
9074 cat >>confdefs.h <<EOF
9075 #define $cf_nculib_ROOT 1
9076 EOF
9077
9078         fi
9079 else
9080         NCURSES_CONFIG=none
9081 fi
9082
9083 else
9084
9085 cf_ncuconfig_root=ncurses
9086 cf_have_ncuconfig=no
9087
9088 if test "x${PKG_CONFIG:=none}" != xnone; then
9089         echo "$as_me:9089: checking pkg-config for $cf_ncuconfig_root" >&5
9090 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9091         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9092                 echo "$as_me:9092: result: yes" >&5
9093 echo "${ECHO_T}yes" >&6
9094
9095                 echo "$as_me:9095: checking if the $cf_ncuconfig_root package files work" >&5
9096 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9097                 cf_have_ncuconfig=unknown
9098
9099                 cf_save_CFLAGS="$CFLAGS"
9100                 cf_save_CPPFLAGS="$CPPFLAGS"
9101                 cf_save_LIBS="$LIBS"
9102
9103                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9104                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9105
9106                 # while -W for passing linker flags is prevalent, it is not "standard".
9107                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9108                 # incompatible _and_ non-standard -W option which gives an error.  Work
9109                 # around that pitfall.
9110                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9111                 (x*c[89]9@@*-W*)
9112
9113 cf_fix_cppflags=no
9114 cf_new_cflags=
9115 cf_new_cppflags=
9116 cf_new_extra_cppflags=
9117
9118 for cf_add_cflags in $cf_pkg_cflags
9119 do
9120 case "$cf_fix_cppflags" in
9121 (no)
9122         case "$cf_add_cflags" in
9123         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9124                 case "$cf_add_cflags" in
9125                 (-D*)
9126                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9127
9128                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9129                                 && test -z "${cf_tst_cflags}" \
9130                                 && cf_fix_cppflags=yes
9131
9132                         if test "$cf_fix_cppflags" = yes ; then
9133
9134         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9135         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9136
9137                                 continue
9138                         elif test "${cf_tst_cflags}" = "\"'" ; then
9139
9140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9142
9143                                 continue
9144                         fi
9145                         ;;
9146                 esac
9147                 case "$CPPFLAGS" in
9148                 (*$cf_add_cflags)
9149                         ;;
9150                 (*)
9151                         case "$cf_add_cflags" in
9152                         (-D*)
9153                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9154
9155 CPPFLAGS=`echo "$CPPFLAGS" | \
9156         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9157                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9158
9159                                 ;;
9160                         esac
9161
9162         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9163         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9164
9165                         ;;
9166                 esac
9167                 ;;
9168         (*)
9169
9170         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9171         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9172
9173                 ;;
9174         esac
9175         ;;
9176 (yes)
9177
9178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9180
9181         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9182
9183         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9184                 && test -z "${cf_tst_cflags}" \
9185                 && cf_fix_cppflags=no
9186         ;;
9187 esac
9188 done
9189
9190 if test -n "$cf_new_cflags" ; then
9191
9192         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9193         CFLAGS="${CFLAGS}$cf_new_cflags"
9194
9195 fi
9196
9197 if test -n "$cf_new_cppflags" ; then
9198
9199         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9200         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9201
9202 fi
9203
9204 if test -n "$cf_new_extra_cppflags" ; then
9205
9206         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9207         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9208
9209 fi
9210
9211 cf_add_libs="$LIBS"
9212 # reverse order
9213 cf_add_0lib=
9214 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9215 # filter duplicates
9216 for cf_add_1lib in $cf_add_0lib; do
9217         for cf_add_2lib in $cf_add_libs; do
9218                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9219                         cf_add_1lib=
9220                         break
9221                 fi
9222         done
9223         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9224 done
9225 LIBS="$cf_add_libs"
9226
9227                         cat >"conftest.$ac_ext" <<_ACEOF
9228 #line 9228 "configure"
9229 #include "confdefs.h"
9230 #include <${cf_cv_ncurses_header:-curses.h}>
9231 int
9232 main (void)
9233 {
9234 initscr(); mousemask(0,0); tigetstr((char *)0);
9235   ;
9236   return 0;
9237 }
9238 _ACEOF
9239 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9240 if { (eval echo "$as_me:9240: \"$ac_link\"") >&5
9241   (eval $ac_link) 2>&5
9242   ac_status=$?
9243   echo "$as_me:9243: \$? = $ac_status" >&5
9244   (exit "$ac_status"); } &&
9245          { ac_try='test -s "conftest$ac_exeext"'
9246   { (eval echo "$as_me:9246: \"$ac_try\"") >&5
9247   (eval $ac_try) 2>&5
9248   ac_status=$?
9249   echo "$as_me:9249: \$? = $ac_status" >&5
9250   (exit "$ac_status"); }; }; then
9251   if test "$cross_compiling" = yes; then
9252   cf_test_ncuconfig=maybe
9253 else
9254   cat >"conftest.$ac_ext" <<_ACEOF
9255 #line 9255 "configure"
9256 #include "confdefs.h"
9257 #include <${cf_cv_ncurses_header:-curses.h}>
9258                                         int main(void)
9259                                         { const char *xx = curses_version(); return (xx == 0); }
9260 _ACEOF
9261 rm -f "conftest$ac_exeext"
9262 if { (eval echo "$as_me:9262: \"$ac_link\"") >&5
9263   (eval $ac_link) 2>&5
9264   ac_status=$?
9265   echo "$as_me:9265: \$? = $ac_status" >&5
9266   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9267   { (eval echo "$as_me:9267: \"$ac_try\"") >&5
9268   (eval $ac_try) 2>&5
9269   ac_status=$?
9270   echo "$as_me:9270: \$? = $ac_status" >&5
9271   (exit "$ac_status"); }; }; then
9272   cf_test_ncuconfig=yes
9273 else
9274   echo "$as_me: program exited with status $ac_status" >&5
9275 echo "$as_me: failed program was:" >&5
9276 cat "conftest.$ac_ext" >&5
9277 cf_test_ncuconfig=no
9278 fi
9279 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9280 fi
9281 else
9282   echo "$as_me: failed program was:" >&5
9283 cat "conftest.$ac_ext" >&5
9284 cf_test_ncuconfig=no
9285 fi
9286 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9287
9288                         CFLAGS="$cf_save_CFLAGS"
9289                         CPPFLAGS="$cf_save_CPPFLAGS"
9290                         LIBS="$cf_save_LIBS"
9291
9292                         if test "x$cf_test_ncuconfig" != xyes; then
9293                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9294                                 cf_pkg_cflags="$cf_temp"
9295                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9296                                 cf_pkg_libs="$cf_temp"
9297                         fi
9298                         ;;
9299                 esac
9300
9301 cf_fix_cppflags=no
9302 cf_new_cflags=
9303 cf_new_cppflags=
9304 cf_new_extra_cppflags=
9305
9306 for cf_add_cflags in $cf_pkg_cflags
9307 do
9308 case "$cf_fix_cppflags" in
9309 (no)
9310         case "$cf_add_cflags" in
9311         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9312                 case "$cf_add_cflags" in
9313                 (-D*)
9314                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9315
9316                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9317                                 && test -z "${cf_tst_cflags}" \
9318                                 && cf_fix_cppflags=yes
9319
9320                         if test "$cf_fix_cppflags" = yes ; then
9321
9322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9324
9325                                 continue
9326                         elif test "${cf_tst_cflags}" = "\"'" ; then
9327
9328         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9329         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9330
9331                                 continue
9332                         fi
9333                         ;;
9334                 esac
9335                 case "$CPPFLAGS" in
9336                 (*$cf_add_cflags)
9337                         ;;
9338                 (*)
9339                         case "$cf_add_cflags" in
9340                         (-D*)
9341                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9342
9343 CPPFLAGS=`echo "$CPPFLAGS" | \
9344         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9345                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9346
9347                                 ;;
9348                         esac
9349
9350         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9351         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9352
9353                         ;;
9354                 esac
9355                 ;;
9356         (*)
9357
9358         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9359         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9360
9361                 ;;
9362         esac
9363         ;;
9364 (yes)
9365
9366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9368
9369         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9370
9371         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9372                 && test -z "${cf_tst_cflags}" \
9373                 && cf_fix_cppflags=no
9374         ;;
9375 esac
9376 done
9377
9378 if test -n "$cf_new_cflags" ; then
9379
9380         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9381         CFLAGS="${CFLAGS}$cf_new_cflags"
9382
9383 fi
9384
9385 if test -n "$cf_new_cppflags" ; then
9386
9387         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9388         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9389
9390 fi
9391
9392 if test -n "$cf_new_extra_cppflags" ; then
9393
9394         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9395         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9396
9397 fi
9398
9399 cf_add_libs="$LIBS"
9400 # reverse order
9401 cf_add_0lib=
9402 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9403 # filter duplicates
9404 for cf_add_1lib in $cf_add_0lib; do
9405         for cf_add_2lib in $cf_add_libs; do
9406                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9407                         cf_add_1lib=
9408                         break
9409                 fi
9410         done
9411         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9412 done
9413 LIBS="$cf_add_libs"
9414
9415                 cat >"conftest.$ac_ext" <<_ACEOF
9416 #line 9416 "configure"
9417 #include "confdefs.h"
9418 #include <${cf_cv_ncurses_header:-curses.h}>
9419 int
9420 main (void)
9421 {
9422 initscr(); mousemask(0,0); tigetstr((char *)0);
9423   ;
9424   return 0;
9425 }
9426 _ACEOF
9427 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9428 if { (eval echo "$as_me:9428: \"$ac_link\"") >&5
9429   (eval $ac_link) 2>&5
9430   ac_status=$?
9431   echo "$as_me:9431: \$? = $ac_status" >&5
9432   (exit "$ac_status"); } &&
9433          { ac_try='test -s "conftest$ac_exeext"'
9434   { (eval echo "$as_me:9434: \"$ac_try\"") >&5
9435   (eval $ac_try) 2>&5
9436   ac_status=$?
9437   echo "$as_me:9437: \$? = $ac_status" >&5
9438   (exit "$ac_status"); }; }; then
9439   if test "$cross_compiling" = yes; then
9440   cf_have_ncuconfig=maybe
9441 else
9442   cat >"conftest.$ac_ext" <<_ACEOF
9443 #line 9443 "configure"
9444 #include "confdefs.h"
9445 #include <${cf_cv_ncurses_header:-curses.h}>
9446                                 int main(void)
9447                                 { const char *xx = curses_version(); return (xx == 0); }
9448 _ACEOF
9449 rm -f "conftest$ac_exeext"
9450 if { (eval echo "$as_me:9450: \"$ac_link\"") >&5
9451   (eval $ac_link) 2>&5
9452   ac_status=$?
9453   echo "$as_me:9453: \$? = $ac_status" >&5
9454   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9455   { (eval echo "$as_me:9455: \"$ac_try\"") >&5
9456   (eval $ac_try) 2>&5
9457   ac_status=$?
9458   echo "$as_me:9458: \$? = $ac_status" >&5
9459   (exit "$ac_status"); }; }; then
9460   cf_have_ncuconfig=yes
9461 else
9462   echo "$as_me: program exited with status $ac_status" >&5
9463 echo "$as_me: failed program was:" >&5
9464 cat "conftest.$ac_ext" >&5
9465 cf_have_ncuconfig=no
9466 fi
9467 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9468 fi
9469 else
9470   echo "$as_me: failed program was:" >&5
9471 cat "conftest.$ac_ext" >&5
9472 cf_have_ncuconfig=no
9473 fi
9474 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9475                 echo "$as_me:9475: result: $cf_have_ncuconfig" >&5
9476 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9477                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9478                 if test "$cf_have_ncuconfig" != "yes"
9479                 then
9480                         CPPFLAGS="$cf_save_CPPFLAGS"
9481                         LIBS="$cf_save_LIBS"
9482                         NCURSES_CONFIG_PKG=none
9483                 else
9484
9485 cat >>confdefs.h <<\EOF
9486 #define NCURSES 1
9487 EOF
9488
9489                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9490
9491 echo "$as_me:9491: checking for terminfo header" >&5
9492 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9493 if test "${cf_cv_term_header+set}" = set; then
9494   echo $ECHO_N "(cached) $ECHO_C" >&6
9495 else
9496
9497 case "${cf_cv_ncurses_header}" in
9498 (*/ncurses.h|*/ncursesw.h)
9499         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9500         ;;
9501 (*)
9502         cf_term_header=term.h
9503         ;;
9504 esac
9505
9506 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9507 do
9508 cat >"conftest.$ac_ext" <<_ACEOF
9509 #line 9509 "configure"
9510 #include "confdefs.h"
9511 #include <stdio.h>
9512 #include <${cf_cv_ncurses_header:-curses.h}>
9513 #include <$cf_test>
9514
9515 int
9516 main (void)
9517 {
9518 int x = auto_left_margin; (void)x
9519   ;
9520   return 0;
9521 }
9522 _ACEOF
9523 rm -f "conftest.$ac_objext"
9524 if { (eval echo "$as_me:9524: \"$ac_compile\"") >&5
9525   (eval $ac_compile) 2>&5
9526   ac_status=$?
9527   echo "$as_me:9527: \$? = $ac_status" >&5
9528   (exit "$ac_status"); } &&
9529          { ac_try='test -s "conftest.$ac_objext"'
9530   { (eval echo "$as_me:9530: \"$ac_try\"") >&5
9531   (eval $ac_try) 2>&5
9532   ac_status=$?
9533   echo "$as_me:9533: \$? = $ac_status" >&5
9534   (exit "$ac_status"); }; }; then
9535
9536         cf_cv_term_header="$cf_test"
9537 else
9538   echo "$as_me: failed program was:" >&5
9539 cat "conftest.$ac_ext" >&5
9540
9541         cf_cv_term_header=unknown
9542
9543 fi
9544 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9545         test "$cf_cv_term_header" != unknown && break
9546 done
9547
9548 fi
9549 echo "$as_me:9549: result: $cf_cv_term_header" >&5
9550 echo "${ECHO_T}$cf_cv_term_header" >&6
9551
9552 # Set definitions to allow ifdef'ing to accommodate subdirectories
9553
9554 case "$cf_cv_term_header" in
9555 (*term.h)
9556
9557 cat >>confdefs.h <<\EOF
9558 #define HAVE_TERM_H 1
9559 EOF
9560
9561         ;;
9562 esac
9563
9564 case "$cf_cv_term_header" in
9565 (ncurses/term.h)
9566
9567 cat >>confdefs.h <<\EOF
9568 #define HAVE_NCURSES_TERM_H 1
9569 EOF
9570
9571         ;;
9572 (ncursesw/term.h)
9573
9574 cat >>confdefs.h <<\EOF
9575 #define HAVE_NCURSESW_TERM_H 1
9576 EOF
9577
9578         ;;
9579 esac
9580
9581                 fi
9582
9583         else
9584                 echo "$as_me:9584: result: no" >&5
9585 echo "${ECHO_T}no" >&6
9586                 NCURSES_CONFIG_PKG=none
9587         fi
9588 else
9589         NCURSES_CONFIG_PKG=none
9590 fi
9591
9592 if test "x$cf_have_ncuconfig" = "xno"; then
9593         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9594
9595 if test -n "$ac_tool_prefix"; then
9596   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9597   do
9598     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9599 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9600 echo "$as_me:9600: checking for $ac_word" >&5
9601 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9602 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9603   echo $ECHO_N "(cached) $ECHO_C" >&6
9604 else
9605   if test -n "$NCURSES_CONFIG"; then
9606   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9607 else
9608   ac_save_IFS=$IFS; IFS=$ac_path_separator
9609 ac_dummy="$PATH"
9610 for ac_dir in $ac_dummy; do
9611   IFS=$ac_save_IFS
9612   test -z "$ac_dir" && ac_dir=.
9613   $as_executable_p "$ac_dir/$ac_word" || continue
9614 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9615 echo "$as_me:9615: found $ac_dir/$ac_word" >&5
9616 break
9617 done
9618
9619 fi
9620 fi
9621 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9622 if test -n "$NCURSES_CONFIG"; then
9623   echo "$as_me:9623: result: $NCURSES_CONFIG" >&5
9624 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9625 else
9626   echo "$as_me:9626: result: no" >&5
9627 echo "${ECHO_T}no" >&6
9628 fi
9629
9630     test -n "$NCURSES_CONFIG" && break
9631   done
9632 fi
9633 if test -z "$NCURSES_CONFIG"; then
9634   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9635   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9636 do
9637   # Extract the first word of "$ac_prog", so it can be a program name with args.
9638 set dummy $ac_prog; ac_word=$2
9639 echo "$as_me:9639: checking for $ac_word" >&5
9640 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9641 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9642   echo $ECHO_N "(cached) $ECHO_C" >&6
9643 else
9644   if test -n "$ac_ct_NCURSES_CONFIG"; then
9645   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9646 else
9647   ac_save_IFS=$IFS; IFS=$ac_path_separator
9648 ac_dummy="$PATH"
9649 for ac_dir in $ac_dummy; do
9650   IFS=$ac_save_IFS
9651   test -z "$ac_dir" && ac_dir=.
9652   $as_executable_p "$ac_dir/$ac_word" || continue
9653 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9654 echo "$as_me:9654: found $ac_dir/$ac_word" >&5
9655 break
9656 done
9657
9658 fi
9659 fi
9660 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9661 if test -n "$ac_ct_NCURSES_CONFIG"; then
9662   echo "$as_me:9662: result: $ac_ct_NCURSES_CONFIG" >&5
9663 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9664 else
9665   echo "$as_me:9665: result: no" >&5
9666 echo "${ECHO_T}no" >&6
9667 fi
9668
9669   test -n "$ac_ct_NCURSES_CONFIG" && break
9670 done
9671 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9672
9673   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9674 fi
9675
9676         if test "$NCURSES_CONFIG" != none ; then
9677
9678 cf_fix_cppflags=no
9679 cf_new_cflags=
9680 cf_new_cppflags=
9681 cf_new_extra_cppflags=
9682
9683 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9684 do
9685 case "$cf_fix_cppflags" in
9686 (no)
9687         case "$cf_add_cflags" in
9688         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9689                 case "$cf_add_cflags" in
9690                 (-D*)
9691                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9692
9693                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9694                                 && test -z "${cf_tst_cflags}" \
9695                                 && cf_fix_cppflags=yes
9696
9697                         if test "$cf_fix_cppflags" = yes ; then
9698
9699         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9700         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9701
9702                                 continue
9703                         elif test "${cf_tst_cflags}" = "\"'" ; then
9704
9705         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9706         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9707
9708                                 continue
9709                         fi
9710                         ;;
9711                 esac
9712                 case "$CPPFLAGS" in
9713                 (*$cf_add_cflags)
9714                         ;;
9715                 (*)
9716                         case "$cf_add_cflags" in
9717                         (-D*)
9718                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9719
9720 CPPFLAGS=`echo "$CPPFLAGS" | \
9721         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9722                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9723
9724                                 ;;
9725                         esac
9726
9727         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9728         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9729
9730                         ;;
9731                 esac
9732                 ;;
9733         (*)
9734
9735         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9736         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9737
9738                 ;;
9739         esac
9740         ;;
9741 (yes)
9742
9743         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9744         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9745
9746         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9747
9748         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9749                 && test -z "${cf_tst_cflags}" \
9750                 && cf_fix_cppflags=no
9751         ;;
9752 esac
9753 done
9754
9755 if test -n "$cf_new_cflags" ; then
9756
9757         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9758         CFLAGS="${CFLAGS}$cf_new_cflags"
9759
9760 fi
9761
9762 if test -n "$cf_new_cppflags" ; then
9763
9764         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9765         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9766
9767 fi
9768
9769 if test -n "$cf_new_extra_cppflags" ; then
9770
9771         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9772         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9773
9774 fi
9775
9776 cf_add_libs="$LIBS"
9777 # reverse order
9778 cf_add_0lib=
9779 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9780 # filter duplicates
9781 for cf_add_1lib in $cf_add_0lib; do
9782         for cf_add_2lib in $cf_add_libs; do
9783                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9784                         cf_add_1lib=
9785                         break
9786                 fi
9787         done
9788         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9789 done
9790 LIBS="$cf_add_libs"
9791
9792                 # even with config script, some packages use no-override for curses.h
9793
9794 echo "$as_me:9794: checking if we have identified curses headers" >&5
9795 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9796 if test "${cf_cv_ncurses_header+set}" = set; then
9797   echo $ECHO_N "(cached) $ECHO_C" >&6
9798 else
9799
9800 cf_cv_ncurses_header=none
9801 for cf_header in \
9802         ncurses.h ncurses/ncurses.h \
9803         curses.h ncurses/curses.h
9804 do
9805 cat >"conftest.$ac_ext" <<_ACEOF
9806 #line 9806 "configure"
9807 #include "confdefs.h"
9808 #include <${cf_header}>
9809 int
9810 main (void)
9811 {
9812 initscr(); tgoto("?", 0,0)
9813   ;
9814   return 0;
9815 }
9816 _ACEOF
9817 rm -f "conftest.$ac_objext"
9818 if { (eval echo "$as_me:9818: \"$ac_compile\"") >&5
9819   (eval $ac_compile) 2>&5
9820   ac_status=$?
9821   echo "$as_me:9821: \$? = $ac_status" >&5
9822   (exit "$ac_status"); } &&
9823          { ac_try='test -s "conftest.$ac_objext"'
9824   { (eval echo "$as_me:9824: \"$ac_try\"") >&5
9825   (eval $ac_try) 2>&5
9826   ac_status=$?
9827   echo "$as_me:9827: \$? = $ac_status" >&5
9828   (exit "$ac_status"); }; }; then
9829   cf_cv_ncurses_header=$cf_header; break
9830 else
9831   echo "$as_me: failed program was:" >&5
9832 cat "conftest.$ac_ext" >&5
9833 fi
9834 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9835 done
9836
9837 fi
9838 echo "$as_me:9838: result: $cf_cv_ncurses_header" >&5
9839 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9840
9841 if test "$cf_cv_ncurses_header" = none ; then
9842         { { echo "$as_me:9842: error: No curses header-files found" >&5
9843 echo "$as_me: error: No curses header-files found" >&2;}
9844    { (exit 1); exit 1; }; }
9845 fi
9846
9847 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9848
9849 for ac_header in $cf_cv_ncurses_header
9850 do
9851 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9852 echo "$as_me:9852: checking for $ac_header" >&5
9853 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9854 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9855   echo $ECHO_N "(cached) $ECHO_C" >&6
9856 else
9857   cat >"conftest.$ac_ext" <<_ACEOF
9858 #line 9858 "configure"
9859 #include "confdefs.h"
9860 #include <$ac_header>
9861 _ACEOF
9862 if { (eval echo "$as_me:9862: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9863   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9864   ac_status=$?
9865   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9866   rm -f conftest.er1
9867   cat conftest.err >&5
9868   echo "$as_me:9868: \$? = $ac_status" >&5
9869   (exit "$ac_status"); } >/dev/null; then
9870   if test -s conftest.err; then
9871     ac_cpp_err=$ac_c_preproc_warn_flag
9872   else
9873     ac_cpp_err=
9874   fi
9875 else
9876   ac_cpp_err=yes
9877 fi
9878 if test -z "$ac_cpp_err"; then
9879   eval "$as_ac_Header=yes"
9880 else
9881   echo "$as_me: failed program was:" >&5
9882   cat "conftest.$ac_ext" >&5
9883   eval "$as_ac_Header=no"
9884 fi
9885 rm -f conftest.err "conftest.$ac_ext"
9886 fi
9887 echo "$as_me:9887: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9888 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9889 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9890   cat >>confdefs.h <<EOF
9891 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9892 EOF
9893
9894 fi
9895 done
9896
9897 cat >>confdefs.h <<\EOF
9898 #define NCURSES 1
9899 EOF
9900
9901 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9902
9903                 cat >>confdefs.h <<EOF
9904 #define $cf_nculib_ROOT 1
9905 EOF
9906
9907                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9908
9909         else
9910
9911 cf_ncuhdr_root=ncurses
9912
9913 test -n "$cf_cv_curses_dir" && \
9914 test "$cf_cv_curses_dir" != "no" && { \
9915
9916 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9917   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9918   do
9919         while test "$cf_add_incdir" != /usr/include
9920         do
9921           if test -d "$cf_add_incdir"
9922           then
9923                 cf_have_incdir=no
9924                 if test -n "$CFLAGS$CPPFLAGS" ; then
9925                   # a loop is needed to ensure we can add subdirs of existing dirs
9926                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9927                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9928                           cf_have_incdir=yes; break
9929                         fi
9930                   done
9931                 fi
9932
9933                 if test "$cf_have_incdir" = no ; then
9934                   if test "$cf_add_incdir" = /usr/local/include ; then
9935                         if test "$GCC" = yes
9936                         then
9937                           cf_save_CPPFLAGS=$CPPFLAGS
9938
9939         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9940         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9941
9942                           cat >"conftest.$ac_ext" <<_ACEOF
9943 #line 9943 "configure"
9944 #include "confdefs.h"
9945 #include <stdio.h>
9946 int
9947 main (void)
9948 {
9949 printf("Hello")
9950   ;
9951   return 0;
9952 }
9953 _ACEOF
9954 rm -f "conftest.$ac_objext"
9955 if { (eval echo "$as_me:9955: \"$ac_compile\"") >&5
9956   (eval $ac_compile) 2>&5
9957   ac_status=$?
9958   echo "$as_me:9958: \$? = $ac_status" >&5
9959   (exit "$ac_status"); } &&
9960          { ac_try='test -s "conftest.$ac_objext"'
9961   { (eval echo "$as_me:9961: \"$ac_try\"") >&5
9962   (eval $ac_try) 2>&5
9963   ac_status=$?
9964   echo "$as_me:9964: \$? = $ac_status" >&5
9965   (exit "$ac_status"); }; }; then
9966   :
9967 else
9968   echo "$as_me: failed program was:" >&5
9969 cat "conftest.$ac_ext" >&5
9970 cf_have_incdir=yes
9971 fi
9972 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9973                           CPPFLAGS=$cf_save_CPPFLAGS
9974                         fi
9975                   fi
9976                 fi
9977
9978                 if test "$cf_have_incdir" = no ; then
9979                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9980
9981 echo "${as_me:-configure}:9981: testing adding $cf_add_incdir to include-path ..." 1>&5
9982
9983                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9984
9985                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9986                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9987                   cf_add_incdir="$cf_top_incdir"
9988                 else
9989                   break
9990                 fi
9991           else
9992                 break
9993           fi
9994         done
9995   done
9996 fi
9997
9998 }
9999
10000 echo "$as_me:10000: checking for $cf_ncuhdr_root header in include-path" >&5
10001 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10002 if test "${cf_cv_ncurses_h+set}" = set; then
10003   echo $ECHO_N "(cached) $ECHO_C" >&6
10004 else
10005
10006         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10007         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10008         for cf_header in $cf_header_list
10009         do
10010
10011         cat >"conftest.$ac_ext" <<_ACEOF
10012 #line 10012 "configure"
10013 #include "confdefs.h"
10014
10015 #include <$cf_header>
10016 int
10017 main (void)
10018 {
10019
10020 #ifdef NCURSES_VERSION
10021
10022 printf("%s\\n", NCURSES_VERSION);
10023 #else
10024 #ifdef __NCURSES_H
10025 printf("old\\n");
10026 #else
10027         make an error
10028 #endif
10029 #endif
10030
10031   ;
10032   return 0;
10033 }
10034 _ACEOF
10035 rm -f "conftest.$ac_objext"
10036 if { (eval echo "$as_me:10036: \"$ac_compile\"") >&5
10037   (eval $ac_compile) 2>&5
10038   ac_status=$?
10039   echo "$as_me:10039: \$? = $ac_status" >&5
10040   (exit "$ac_status"); } &&
10041          { ac_try='test -s "conftest.$ac_objext"'
10042   { (eval echo "$as_me:10042: \"$ac_try\"") >&5
10043   (eval $ac_try) 2>&5
10044   ac_status=$?
10045   echo "$as_me:10045: \$? = $ac_status" >&5
10046   (exit "$ac_status"); }; }; then
10047   cf_cv_ncurses_h=$cf_header
10048
10049 else
10050   echo "$as_me: failed program was:" >&5
10051 cat "conftest.$ac_ext" >&5
10052 cf_cv_ncurses_h=no
10053 fi
10054 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10055
10056                 test "$cf_cv_ncurses_h" != no && break
10057         done
10058
10059 fi
10060 echo "$as_me:10060: result: $cf_cv_ncurses_h" >&5
10061 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10062
10063 if test "$cf_cv_ncurses_h" != no ; then
10064         cf_cv_ncurses_header=$cf_cv_ncurses_h
10065 else
10066
10067 echo "$as_me:10067: checking for $cf_ncuhdr_root include-path" >&5
10068 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10069 if test "${cf_cv_ncurses_h2+set}" = set; then
10070   echo $ECHO_N "(cached) $ECHO_C" >&6
10071 else
10072
10073         test -n "$verbose" && echo
10074
10075 cf_search=
10076
10077 # collect the current set of include-directories from compiler flags
10078 cf_header_path_list=""
10079 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10080         for cf_header_path in $CPPFLAGS $CFLAGS
10081         do
10082                 case "$cf_header_path" in
10083                 (-I*)
10084                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10085
10086 test "x$cf_header_path" != "xNONE" && \
10087 test -d "$cf_header_path" && \
10088  {
10089         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10090         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10091         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10092         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10093         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10094         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"
10095 }
10096
10097                         cf_header_path_list="$cf_header_path_list $cf_search"
10098                         ;;
10099                 esac
10100         done
10101 fi
10102
10103 # add the variations for the package we are looking for
10104
10105 cf_search=
10106
10107 test "x$prefix" != "xNONE" && \
10108 test -d "$prefix" && \
10109  {
10110         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10111         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10112         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10113         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10114         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10115         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10116 }
10117
10118 for cf_subdir_prefix in \
10119         /usr \
10120         /usr/local \
10121         /usr/pkg \
10122         /opt \
10123         /opt/local \
10124         $HOME
10125 do
10126
10127 test "x$cf_subdir_prefix" != "x$prefix" && \
10128 test -d "$cf_subdir_prefix" && \
10129 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10130         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10131         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10132         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10133         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10134         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10135         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"
10136 }
10137
10138 done
10139
10140 test "$includedir" != NONE && \
10141 test "$includedir" != "/usr/include" && \
10142 test -d "$includedir" && {
10143         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10144         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10145 }
10146
10147 test "$oldincludedir" != NONE && \
10148 test "$oldincludedir" != "/usr/include" && \
10149 test -d "$oldincludedir" && {
10150         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10151         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10152 }
10153
10154 cf_search="$cf_search $cf_header_path_list"
10155
10156         test -n "$verbose" && echo "search path $cf_search"
10157         cf_save2_CPPFLAGS="$CPPFLAGS"
10158         for cf_incdir in $cf_search
10159         do
10160
10161 if test -n "$cf_incdir" ; then
10162   for cf_add_incdir in $cf_incdir
10163   do
10164         while test "$cf_add_incdir" != /usr/include
10165         do
10166           if test -d "$cf_add_incdir"
10167           then
10168                 cf_have_incdir=no
10169                 if test -n "$CFLAGS$CPPFLAGS" ; then
10170                   # a loop is needed to ensure we can add subdirs of existing dirs
10171                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10172                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10173                           cf_have_incdir=yes; break
10174                         fi
10175                   done
10176                 fi
10177
10178                 if test "$cf_have_incdir" = no ; then
10179                   if test "$cf_add_incdir" = /usr/local/include ; then
10180                         if test "$GCC" = yes
10181                         then
10182                           cf_save_CPPFLAGS=$CPPFLAGS
10183
10184         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10185         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10186
10187                           cat >"conftest.$ac_ext" <<_ACEOF
10188 #line 10188 "configure"
10189 #include "confdefs.h"
10190 #include <stdio.h>
10191 int
10192 main (void)
10193 {
10194 printf("Hello")
10195   ;
10196   return 0;
10197 }
10198 _ACEOF
10199 rm -f "conftest.$ac_objext"
10200 if { (eval echo "$as_me:10200: \"$ac_compile\"") >&5
10201   (eval $ac_compile) 2>&5
10202   ac_status=$?
10203   echo "$as_me:10203: \$? = $ac_status" >&5
10204   (exit "$ac_status"); } &&
10205          { ac_try='test -s "conftest.$ac_objext"'
10206   { (eval echo "$as_me:10206: \"$ac_try\"") >&5
10207   (eval $ac_try) 2>&5
10208   ac_status=$?
10209   echo "$as_me:10209: \$? = $ac_status" >&5
10210   (exit "$ac_status"); }; }; then
10211   :
10212 else
10213   echo "$as_me: failed program was:" >&5
10214 cat "conftest.$ac_ext" >&5
10215 cf_have_incdir=yes
10216 fi
10217 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10218                           CPPFLAGS=$cf_save_CPPFLAGS
10219                         fi
10220                   fi
10221                 fi
10222
10223                 if test "$cf_have_incdir" = no ; then
10224                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10225
10226 echo "${as_me:-configure}:10226: testing adding $cf_add_incdir to include-path ..." 1>&5
10227
10228                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10229
10230                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10231                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10232                   cf_add_incdir="$cf_top_incdir"
10233                 else
10234                   break
10235                 fi
10236           else
10237                 break
10238           fi
10239         done
10240   done
10241 fi
10242
10243                 for cf_header in \
10244                         ncurses.h \
10245                         curses.h
10246                 do
10247
10248         cat >"conftest.$ac_ext" <<_ACEOF
10249 #line 10249 "configure"
10250 #include "confdefs.h"
10251
10252 #include <$cf_header>
10253 int
10254 main (void)
10255 {
10256
10257 #ifdef NCURSES_VERSION
10258
10259 printf("%s\\n", NCURSES_VERSION);
10260 #else
10261 #ifdef __NCURSES_H
10262 printf("old\\n");
10263 #else
10264         make an error
10265 #endif
10266 #endif
10267
10268   ;
10269   return 0;
10270 }
10271 _ACEOF
10272 rm -f "conftest.$ac_objext"
10273 if { (eval echo "$as_me:10273: \"$ac_compile\"") >&5
10274   (eval $ac_compile) 2>&5
10275   ac_status=$?
10276   echo "$as_me:10276: \$? = $ac_status" >&5
10277   (exit "$ac_status"); } &&
10278          { ac_try='test -s "conftest.$ac_objext"'
10279   { (eval echo "$as_me:10279: \"$ac_try\"") >&5
10280   (eval $ac_try) 2>&5
10281   ac_status=$?
10282   echo "$as_me:10282: \$? = $ac_status" >&5
10283   (exit "$ac_status"); }; }; then
10284   cf_cv_ncurses_h2=$cf_header
10285
10286 else
10287   echo "$as_me: failed program was:" >&5
10288 cat "conftest.$ac_ext" >&5
10289 cf_cv_ncurses_h2=no
10290 fi
10291 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10292
10293                         if test "$cf_cv_ncurses_h2" != no ; then
10294                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10295                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10296                                 break
10297                         fi
10298                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10299                 done
10300                 CPPFLAGS="$cf_save2_CPPFLAGS"
10301                 test "$cf_cv_ncurses_h2" != no && break
10302         done
10303         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10303: error: not found" >&5
10304 echo "$as_me: error: not found" >&2;}
10305    { (exit 1); exit 1; }; }
10306
10307 fi
10308 echo "$as_me:10308: result: $cf_cv_ncurses_h2" >&5
10309 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10310
10311         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10312         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10313         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10314                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10315         fi
10316
10317 if test -n "$cf_1st_incdir" ; then
10318   for cf_add_incdir in $cf_1st_incdir
10319   do
10320         while test "$cf_add_incdir" != /usr/include
10321         do
10322           if test -d "$cf_add_incdir"
10323           then
10324                 cf_have_incdir=no
10325                 if test -n "$CFLAGS$CPPFLAGS" ; then
10326                   # a loop is needed to ensure we can add subdirs of existing dirs
10327                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10328                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10329                           cf_have_incdir=yes; break
10330                         fi
10331                   done
10332                 fi
10333
10334                 if test "$cf_have_incdir" = no ; then
10335                   if test "$cf_add_incdir" = /usr/local/include ; then
10336                         if test "$GCC" = yes
10337                         then
10338                           cf_save_CPPFLAGS=$CPPFLAGS
10339
10340         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10341         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10342
10343                           cat >"conftest.$ac_ext" <<_ACEOF
10344 #line 10344 "configure"
10345 #include "confdefs.h"
10346 #include <stdio.h>
10347 int
10348 main (void)
10349 {
10350 printf("Hello")
10351   ;
10352   return 0;
10353 }
10354 _ACEOF
10355 rm -f "conftest.$ac_objext"
10356 if { (eval echo "$as_me:10356: \"$ac_compile\"") >&5
10357   (eval $ac_compile) 2>&5
10358   ac_status=$?
10359   echo "$as_me:10359: \$? = $ac_status" >&5
10360   (exit "$ac_status"); } &&
10361          { ac_try='test -s "conftest.$ac_objext"'
10362   { (eval echo "$as_me:10362: \"$ac_try\"") >&5
10363   (eval $ac_try) 2>&5
10364   ac_status=$?
10365   echo "$as_me:10365: \$? = $ac_status" >&5
10366   (exit "$ac_status"); }; }; then
10367   :
10368 else
10369   echo "$as_me: failed program was:" >&5
10370 cat "conftest.$ac_ext" >&5
10371 cf_have_incdir=yes
10372 fi
10373 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10374                           CPPFLAGS=$cf_save_CPPFLAGS
10375                         fi
10376                   fi
10377                 fi
10378
10379                 if test "$cf_have_incdir" = no ; then
10380                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10381
10382 echo "${as_me:-configure}:10382: testing adding $cf_add_incdir to include-path ..." 1>&5
10383
10384                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10385
10386                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10387                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10388                   cf_add_incdir="$cf_top_incdir"
10389                 else
10390                   break
10391                 fi
10392           else
10393                 break
10394           fi
10395         done
10396   done
10397 fi
10398
10399 fi
10400
10401 # Set definitions to allow ifdef'ing for ncurses.h
10402
10403 case "$cf_cv_ncurses_header" in
10404 (*ncurses.h)
10405
10406 cat >>confdefs.h <<\EOF
10407 #define HAVE_NCURSES_H 1
10408 EOF
10409
10410         ;;
10411 esac
10412
10413 case "$cf_cv_ncurses_header" in
10414 (ncurses/curses.h|ncurses/ncurses.h)
10415
10416 cat >>confdefs.h <<\EOF
10417 #define HAVE_NCURSES_NCURSES_H 1
10418 EOF
10419
10420         ;;
10421 (ncursesw/curses.h|ncursesw/ncurses.h)
10422
10423 cat >>confdefs.h <<\EOF
10424 #define HAVE_NCURSESW_NCURSES_H 1
10425 EOF
10426
10427         ;;
10428 esac
10429
10430 echo "$as_me:10430: checking for terminfo header" >&5
10431 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10432 if test "${cf_cv_term_header+set}" = set; then
10433   echo $ECHO_N "(cached) $ECHO_C" >&6
10434 else
10435
10436 case "${cf_cv_ncurses_header}" in
10437 (*/ncurses.h|*/ncursesw.h)
10438         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10439         ;;
10440 (*)
10441         cf_term_header=term.h
10442         ;;
10443 esac
10444
10445 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10446 do
10447 cat >"conftest.$ac_ext" <<_ACEOF
10448 #line 10448 "configure"
10449 #include "confdefs.h"
10450 #include <stdio.h>
10451 #include <${cf_cv_ncurses_header:-curses.h}>
10452 #include <$cf_test>
10453
10454 int
10455 main (void)
10456 {
10457 int x = auto_left_margin; (void)x
10458   ;
10459   return 0;
10460 }
10461 _ACEOF
10462 rm -f "conftest.$ac_objext"
10463 if { (eval echo "$as_me:10463: \"$ac_compile\"") >&5
10464   (eval $ac_compile) 2>&5
10465   ac_status=$?
10466   echo "$as_me:10466: \$? = $ac_status" >&5
10467   (exit "$ac_status"); } &&
10468          { ac_try='test -s "conftest.$ac_objext"'
10469   { (eval echo "$as_me:10469: \"$ac_try\"") >&5
10470   (eval $ac_try) 2>&5
10471   ac_status=$?
10472   echo "$as_me:10472: \$? = $ac_status" >&5
10473   (exit "$ac_status"); }; }; then
10474
10475         cf_cv_term_header="$cf_test"
10476 else
10477   echo "$as_me: failed program was:" >&5
10478 cat "conftest.$ac_ext" >&5
10479
10480         cf_cv_term_header=unknown
10481
10482 fi
10483 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10484         test "$cf_cv_term_header" != unknown && break
10485 done
10486
10487 fi
10488 echo "$as_me:10488: result: $cf_cv_term_header" >&5
10489 echo "${ECHO_T}$cf_cv_term_header" >&6
10490
10491 # Set definitions to allow ifdef'ing to accommodate subdirectories
10492
10493 case "$cf_cv_term_header" in
10494 (*term.h)
10495
10496 cat >>confdefs.h <<\EOF
10497 #define HAVE_TERM_H 1
10498 EOF
10499
10500         ;;
10501 esac
10502
10503 case "$cf_cv_term_header" in
10504 (ncurses/term.h)
10505
10506 cat >>confdefs.h <<\EOF
10507 #define HAVE_NCURSES_TERM_H 1
10508 EOF
10509
10510         ;;
10511 (ncursesw/term.h)
10512
10513 cat >>confdefs.h <<\EOF
10514 #define HAVE_NCURSESW_TERM_H 1
10515 EOF
10516
10517         ;;
10518 esac
10519
10520 # some applications need this, but should check for NCURSES_VERSION
10521
10522 cat >>confdefs.h <<\EOF
10523 #define NCURSES 1
10524 EOF
10525
10526 echo "$as_me:10526: checking for ncurses version" >&5
10527 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10528 if test "${cf_cv_ncurses_version+set}" = set; then
10529   echo $ECHO_N "(cached) $ECHO_C" >&6
10530 else
10531
10532         cf_cv_ncurses_version=no
10533         cf_tempfile=out$$
10534         rm -f "$cf_tempfile"
10535         if test "$cross_compiling" = yes; then
10536
10537         # This will not work if the preprocessor splits the line after the
10538         # Autoconf token.  The 'unproto' program does that.
10539         cat > "conftest.$ac_ext" <<EOF
10540 #include <${cf_cv_ncurses_header:-curses.h}>
10541 #undef Autoconf
10542 #ifdef NCURSES_VERSION
10543 Autoconf NCURSES_VERSION
10544 #else
10545 #ifdef __NCURSES_H
10546 Autoconf "old"
10547 #endif
10548 ;
10549 #endif
10550 EOF
10551         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10552         { (eval echo "$as_me:10552: \"$cf_try\"") >&5
10553   (eval $cf_try) 2>&5
10554   ac_status=$?
10555   echo "$as_me:10555: \$? = $ac_status" >&5
10556   (exit "$ac_status"); }
10557         if test -f conftest.out ; then
10558                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10559                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10560                 rm -f conftest.out
10561         fi
10562
10563 else
10564   cat >"conftest.$ac_ext" <<_ACEOF
10565 #line 10565 "configure"
10566 #include "confdefs.h"
10567
10568 #include <${cf_cv_ncurses_header:-curses.h}>
10569 #include <stdio.h>
10570 int main(void)
10571 {
10572         FILE *fp = fopen("$cf_tempfile", "w");
10573 #ifdef NCURSES_VERSION
10574 # ifdef NCURSES_VERSION_PATCH
10575         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10576 # else
10577         fprintf(fp, "%s\\n", NCURSES_VERSION);
10578 # endif
10579 #else
10580 # ifdef __NCURSES_H
10581         fprintf(fp, "old\\n");
10582 # else
10583         make an error
10584 # endif
10585 #endif
10586         ${cf_cv_main_return:-return}(0);
10587 }
10588 _ACEOF
10589 rm -f "conftest$ac_exeext"
10590 if { (eval echo "$as_me:10590: \"$ac_link\"") >&5
10591   (eval $ac_link) 2>&5
10592   ac_status=$?
10593   echo "$as_me:10593: \$? = $ac_status" >&5
10594   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10595   { (eval echo "$as_me:10595: \"$ac_try\"") >&5
10596   (eval $ac_try) 2>&5
10597   ac_status=$?
10598   echo "$as_me:10598: \$? = $ac_status" >&5
10599   (exit "$ac_status"); }; }; then
10600
10601         cf_cv_ncurses_version=`cat $cf_tempfile`
10602 else
10603   echo "$as_me: program exited with status $ac_status" >&5
10604 echo "$as_me: failed program was:" >&5
10605 cat "conftest.$ac_ext" >&5
10606 fi
10607 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10608 fi
10609         rm -f "$cf_tempfile"
10610
10611 fi
10612 echo "$as_me:10612: result: $cf_cv_ncurses_version" >&5
10613 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10614 test "$cf_cv_ncurses_version" = no ||
10615 cat >>confdefs.h <<\EOF
10616 #define NCURSES 1
10617 EOF
10618
10619 cf_nculib_root=ncurses
10620         # This works, except for the special case where we find gpm, but
10621         # ncurses is in a nonstandard location via $LIBS, and we really want
10622         # to link gpm.
10623 cf_ncurses_LIBS=""
10624 cf_ncurses_SAVE="$LIBS"
10625 echo "$as_me:10625: checking for Gpm_Open in -lgpm" >&5
10626 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10627 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10628   echo $ECHO_N "(cached) $ECHO_C" >&6
10629 else
10630   ac_check_lib_save_LIBS=$LIBS
10631 LIBS="-lgpm  $LIBS"
10632 cat >"conftest.$ac_ext" <<_ACEOF
10633 #line 10633 "configure"
10634 #include "confdefs.h"
10635
10636 /* Override any gcc2 internal prototype to avoid an error.  */
10637 #ifdef __cplusplus
10638 extern "C"
10639 #endif
10640 /* We use char because int might match the return type of a gcc2
10641    builtin and then its argument prototype would still apply.  */
10642 char Gpm_Open ();
10643 int
10644 main (void)
10645 {
10646 Gpm_Open ();
10647   ;
10648   return 0;
10649 }
10650 _ACEOF
10651 rm -f "conftest.$ac_objext" "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"); } &&
10657          { ac_try='test -s "conftest$ac_exeext"'
10658   { (eval echo "$as_me:10658: \"$ac_try\"") >&5
10659   (eval $ac_try) 2>&5
10660   ac_status=$?
10661   echo "$as_me:10661: \$? = $ac_status" >&5
10662   (exit "$ac_status"); }; }; then
10663   ac_cv_lib_gpm_Gpm_Open=yes
10664 else
10665   echo "$as_me: failed program was:" >&5
10666 cat "conftest.$ac_ext" >&5
10667 ac_cv_lib_gpm_Gpm_Open=no
10668 fi
10669 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10670 LIBS=$ac_check_lib_save_LIBS
10671 fi
10672 echo "$as_me:10672: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10673 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10674 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10675   echo "$as_me:10675: checking for initscr in -lgpm" >&5
10676 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10677 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10678   echo $ECHO_N "(cached) $ECHO_C" >&6
10679 else
10680   ac_check_lib_save_LIBS=$LIBS
10681 LIBS="-lgpm  $LIBS"
10682 cat >"conftest.$ac_ext" <<_ACEOF
10683 #line 10683 "configure"
10684 #include "confdefs.h"
10685
10686 /* Override any gcc2 internal prototype to avoid an error.  */
10687 #ifdef __cplusplus
10688 extern "C"
10689 #endif
10690 /* We use char because int might match the return type of a gcc2
10691    builtin and then its argument prototype would still apply.  */
10692 char initscr ();
10693 int
10694 main (void)
10695 {
10696 initscr ();
10697   ;
10698   return 0;
10699 }
10700 _ACEOF
10701 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10702 if { (eval echo "$as_me:10702: \"$ac_link\"") >&5
10703   (eval $ac_link) 2>&5
10704   ac_status=$?
10705   echo "$as_me:10705: \$? = $ac_status" >&5
10706   (exit "$ac_status"); } &&
10707          { ac_try='test -s "conftest$ac_exeext"'
10708   { (eval echo "$as_me:10708: \"$ac_try\"") >&5
10709   (eval $ac_try) 2>&5
10710   ac_status=$?
10711   echo "$as_me:10711: \$? = $ac_status" >&5
10712   (exit "$ac_status"); }; }; then
10713   ac_cv_lib_gpm_initscr=yes
10714 else
10715   echo "$as_me: failed program was:" >&5
10716 cat "conftest.$ac_ext" >&5
10717 ac_cv_lib_gpm_initscr=no
10718 fi
10719 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10720 LIBS=$ac_check_lib_save_LIBS
10721 fi
10722 echo "$as_me:10722: result: $ac_cv_lib_gpm_initscr" >&5
10723 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10724 if test "$ac_cv_lib_gpm_initscr" = yes; then
10725   LIBS="$cf_ncurses_SAVE"
10726 else
10727   cf_ncurses_LIBS="-lgpm"
10728 fi
10729
10730 fi
10731
10732 case "$host_os" in
10733 (freebsd*)
10734         # This is only necessary if you are linking against an obsolete
10735         # version of ncurses (but it should do no harm, since it's static).
10736         if test "$cf_nculib_root" = ncurses ; then
10737                 echo "$as_me:10737: checking for tgoto in -lmytinfo" >&5
10738 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10739 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10740   echo $ECHO_N "(cached) $ECHO_C" >&6
10741 else
10742   ac_check_lib_save_LIBS=$LIBS
10743 LIBS="-lmytinfo  $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 tgoto ();
10755 int
10756 main (void)
10757 {
10758 tgoto ();
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_mytinfo_tgoto=yes
10776 else
10777   echo "$as_me: failed program was:" >&5
10778 cat "conftest.$ac_ext" >&5
10779 ac_cv_lib_mytinfo_tgoto=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_mytinfo_tgoto" >&5
10785 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10786 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
10787   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10788 fi
10789
10790         fi
10791         ;;
10792 esac
10793
10794 cf_add_libs="$LIBS"
10795 # reverse order
10796 cf_add_0lib=
10797 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10798 # filter duplicates
10799 for cf_add_1lib in $cf_add_0lib; do
10800         for cf_add_2lib in $cf_add_libs; do
10801                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10802                         cf_add_1lib=
10803                         break
10804                 fi
10805         done
10806         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10807 done
10808 LIBS="$cf_add_libs"
10809
10810 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
10811 then
10812
10813 cf_add_libs="$LIBS"
10814 # reverse order
10815 cf_add_0lib=
10816 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10817 # filter duplicates
10818 for cf_add_1lib in $cf_add_0lib; do
10819         for cf_add_2lib in $cf_add_libs; do
10820                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10821                         cf_add_1lib=
10822                         break
10823                 fi
10824         done
10825         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10826 done
10827 LIBS="$cf_add_libs"
10828
10829 else
10830
10831         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10832         cf_libdir=""
10833         echo "$as_me:10833: checking for initscr" >&5
10834 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10835 if test "${ac_cv_func_initscr+set}" = set; then
10836   echo $ECHO_N "(cached) $ECHO_C" >&6
10837 else
10838   cat >"conftest.$ac_ext" <<_ACEOF
10839 #line 10839 "configure"
10840 #include "confdefs.h"
10841 #define initscr autoconf_temporary
10842 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10843 #undef initscr
10844
10845 #ifdef __cplusplus
10846 extern "C"
10847 #endif
10848
10849 /* We use char because int might match the return type of a gcc2
10850    builtin and then its argument prototype would still apply.  */
10851 char initscr (void);
10852
10853 int
10854 main (void)
10855 {
10856
10857 /* The GNU C library defines stubs for functions which it implements
10858     to always fail with ENOSYS.  Some functions are actually named
10859     something starting with __ and the normal name is an alias.  */
10860 #if defined (__stub_initscr) || defined (__stub___initscr)
10861 #error found stub for initscr
10862 #endif
10863
10864         return initscr ();
10865   ;
10866   return 0;
10867 }
10868 _ACEOF
10869 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10870 if { (eval echo "$as_me:10870: \"$ac_link\"") >&5
10871   (eval $ac_link) 2>&5
10872   ac_status=$?
10873   echo "$as_me:10873: \$? = $ac_status" >&5
10874   (exit "$ac_status"); } &&
10875          { ac_try='test -s "conftest$ac_exeext"'
10876   { (eval echo "$as_me:10876: \"$ac_try\"") >&5
10877   (eval $ac_try) 2>&5
10878   ac_status=$?
10879   echo "$as_me:10879: \$? = $ac_status" >&5
10880   (exit "$ac_status"); }; }; then
10881   ac_cv_func_initscr=yes
10882 else
10883   echo "$as_me: failed program was:" >&5
10884 cat "conftest.$ac_ext" >&5
10885 ac_cv_func_initscr=no
10886 fi
10887 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10888 fi
10889 echo "$as_me:10889: result: $ac_cv_func_initscr" >&5
10890 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10891 if test "$ac_cv_func_initscr" = yes; then
10892   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10893 else
10894
10895                 cf_save_LIBS="$LIBS"
10896                 echo "$as_me:10896: checking for initscr in -l$cf_nculib_root" >&5
10897 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10898                 LIBS="-l$cf_nculib_root $LIBS"
10899                 cat >"conftest.$ac_ext" <<_ACEOF
10900 #line 10900 "configure"
10901 #include "confdefs.h"
10902 #include <${cf_cv_ncurses_header:-curses.h}>
10903 int
10904 main (void)
10905 {
10906 initscr()
10907   ;
10908   return 0;
10909 }
10910 _ACEOF
10911 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10912 if { (eval echo "$as_me:10912: \"$ac_link\"") >&5
10913   (eval $ac_link) 2>&5
10914   ac_status=$?
10915   echo "$as_me:10915: \$? = $ac_status" >&5
10916   (exit "$ac_status"); } &&
10917          { ac_try='test -s "conftest$ac_exeext"'
10918   { (eval echo "$as_me:10918: \"$ac_try\"") >&5
10919   (eval $ac_try) 2>&5
10920   ac_status=$?
10921   echo "$as_me:10921: \$? = $ac_status" >&5
10922   (exit "$ac_status"); }; }; then
10923   echo "$as_me:10923: result: yes" >&5
10924 echo "${ECHO_T}yes" >&6
10925                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10926
10927 else
10928   echo "$as_me: failed program was:" >&5
10929 cat "conftest.$ac_ext" >&5
10930 echo "$as_me:10930: result: no" >&5
10931 echo "${ECHO_T}no" >&6
10932
10933 cf_search=
10934 cf_library_path_list=""
10935 if test -n "${LDFLAGS}${LIBS}" ; then
10936         for cf_library_path in $LDFLAGS $LIBS
10937         do
10938                 case "$cf_library_path" in
10939                 (-L*)
10940                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10941
10942 test "x$cf_library_path" != "xNONE" && \
10943 test -d "$cf_library_path" && \
10944  {
10945         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10946         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10947         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10948         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10949         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10950         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"
10951 }
10952
10953                         cf_library_path_list="$cf_library_path_list $cf_search"
10954                         ;;
10955                 esac
10956         done
10957 fi
10958
10959 cf_search=
10960
10961 test "x$prefix" != "xNONE" && \
10962 test -d "$prefix" && \
10963  {
10964         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10965         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10966         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10967         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10968         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10969         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10970 }
10971
10972 for cf_subdir_prefix in \
10973         /usr \
10974         /usr/local \
10975         /usr/pkg \
10976         /opt \
10977         /opt/local \
10978         $HOME
10979 do
10980
10981 test "x$cf_subdir_prefix" != "x$prefix" && \
10982 test -d "$cf_subdir_prefix" && \
10983 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10984         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10985         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10986         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10987         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10988         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10989         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"
10990 }
10991
10992 done
10993
10994 cf_search="$cf_library_path_list $cf_search"
10995
10996                         for cf_libdir in $cf_search
10997                         do
10998                                 echo "$as_me:10998: checking for -l$cf_nculib_root in $cf_libdir" >&5
10999 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11000                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11001                                 cat >"conftest.$ac_ext" <<_ACEOF
11002 #line 11002 "configure"
11003 #include "confdefs.h"
11004 #include <${cf_cv_ncurses_header:-curses.h}>
11005 int
11006 main (void)
11007 {
11008 initscr()
11009   ;
11010   return 0;
11011 }
11012 _ACEOF
11013 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11014 if { (eval echo "$as_me:11014: \"$ac_link\"") >&5
11015   (eval $ac_link) 2>&5
11016   ac_status=$?
11017   echo "$as_me:11017: \$? = $ac_status" >&5
11018   (exit "$ac_status"); } &&
11019          { ac_try='test -s "conftest$ac_exeext"'
11020   { (eval echo "$as_me:11020: \"$ac_try\"") >&5
11021   (eval $ac_try) 2>&5
11022   ac_status=$?
11023   echo "$as_me:11023: \$? = $ac_status" >&5
11024   (exit "$ac_status"); }; }; then
11025   echo "$as_me:11025: result: yes" >&5
11026 echo "${ECHO_T}yes" >&6
11027                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11028                                          break
11029 else
11030   echo "$as_me: failed program was:" >&5
11031 cat "conftest.$ac_ext" >&5
11032 echo "$as_me:11032: result: no" >&5
11033 echo "${ECHO_T}no" >&6
11034                                          LIBS="$cf_save_LIBS"
11035 fi
11036 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11037                         done
11038
11039 fi
11040 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11041
11042 fi
11043
11044 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11045
11046 if test "$cf_found_library" = no ; then
11047         { { echo "$as_me:11047: error: Cannot link $cf_nculib_root library" >&5
11048 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11049    { (exit 1); exit 1; }; }
11050 fi
11051
11052 fi
11053
11054 if test -n "$cf_ncurses_LIBS" ; then
11055         echo "$as_me:11055: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11056 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11057         cf_ncurses_SAVE="$LIBS"
11058         for p in $cf_ncurses_LIBS ; do
11059                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11060                 if test "$q" != "$LIBS" ; then
11061                         LIBS="$q"
11062                 fi
11063         done
11064         cat >"conftest.$ac_ext" <<_ACEOF
11065 #line 11065 "configure"
11066 #include "confdefs.h"
11067 #include <${cf_cv_ncurses_header:-curses.h}>
11068 int
11069 main (void)
11070 {
11071 initscr(); mousemask(0,0); tigetstr((char *)0);
11072   ;
11073   return 0;
11074 }
11075 _ACEOF
11076 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11077 if { (eval echo "$as_me:11077: \"$ac_link\"") >&5
11078   (eval $ac_link) 2>&5
11079   ac_status=$?
11080   echo "$as_me:11080: \$? = $ac_status" >&5
11081   (exit "$ac_status"); } &&
11082          { ac_try='test -s "conftest$ac_exeext"'
11083   { (eval echo "$as_me:11083: \"$ac_try\"") >&5
11084   (eval $ac_try) 2>&5
11085   ac_status=$?
11086   echo "$as_me:11086: \$? = $ac_status" >&5
11087   (exit "$ac_status"); }; }; then
11088   echo "$as_me:11088: result: yes" >&5
11089 echo "${ECHO_T}yes" >&6
11090 else
11091   echo "$as_me: failed program was:" >&5
11092 cat "conftest.$ac_ext" >&5
11093 echo "$as_me:11093: result: no" >&5
11094 echo "${ECHO_T}no" >&6
11095                  LIBS="$cf_ncurses_SAVE"
11096 fi
11097 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11098 fi
11099
11100 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11101
11102 cat >>confdefs.h <<EOF
11103 #define $cf_nculib_ROOT 1
11104 EOF
11105
11106         fi
11107 else
11108         NCURSES_CONFIG=none
11109 fi
11110
11111 fi
11112
11113 if test "$NCURSES_CONFIG_PKG" != none ; then
11114         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11115
11116         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11117         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11118         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11119
11120         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11121         if test -z "$cf_cv_abi_version"
11122         then
11123                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11124         fi
11125
11126 elif test "$NCURSES_CONFIG" != none ; then
11127
11128         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11129
11130         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11131         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11132         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11133
11134         # ABI version is not available from headers
11135         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11136
11137 else
11138
11139         for cf_name in MAJOR MINOR PATCH
11140         do
11141         cat >conftest.$ac_ext <<CF_EOF
11142         #include <${cf_cv_ncurses_header:-curses.h}>
11143         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11144 CF_EOF
11145                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11146                 { (eval echo "$as_me:11146: \"$cf_try\"") >&5
11147   (eval $cf_try) 2>&5
11148   ac_status=$?
11149   echo "$as_me:11149: \$? = $ac_status" >&5
11150   (exit "$ac_status"); }
11151                 if test -f conftest.out ; then
11152                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11153                         eval NCURSES_$cf_name=\"$cf_result\"
11154                         # cat conftest.$ac_ext
11155                         # cat conftest.out
11156                 fi
11157         done
11158
11159         cf_cv_abi_version=${NCURSES_MAJOR}
11160
11161 fi
11162
11163 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11164
11165 cf_cv_timestamp=`date`
11166
11167 echo "$as_me:11167: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11168 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11169
11170 echo "$as_me:11170: checking if you want to have a library-prefix" >&5
11171 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11172
11173 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11174 if test "${with_lib_prefix+set}" = set; then
11175   withval="$with_lib_prefix"
11176   with_lib_prefix=$withval
11177 else
11178   with_lib_prefix=auto
11179 fi;
11180 echo "$as_me:11180: result: $with_lib_prefix" >&5
11181 echo "${ECHO_T}$with_lib_prefix" >&6
11182
11183 if test "$with_lib_prefix" = auto
11184 then
11185
11186         case "$cf_cv_system_name" in
11187         (OS/2*|os2*)
11188                 if test "$DFT_LWR_MODEL" = libtool; then
11189                         LIB_PREFIX='lib'
11190                 else
11191                         LIB_PREFIX=''
11192                 fi
11193                 ;;
11194         (*-msvc*)
11195                 LIB_PREFIX=''
11196                 ;;
11197         (*)     LIB_PREFIX='lib'
11198                 ;;
11199         esac
11200 cf_prefix=$LIB_PREFIX
11201
11202 elif test "$with_lib_prefix" = no
11203 then
11204         LIB_PREFIX=
11205 else
11206         LIB_PREFIX=$with_lib_prefix
11207 fi
11208
11209 LIB_SUFFIX=
11210
11211 ###############################################################################
11212
11213 if test X"$CC_G_OPT" = X"" ; then
11214         CC_G_OPT='-g'
11215         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11216 fi
11217
11218 echo "$as_me:11218: checking for default loader flags" >&5
11219 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11220 case $DFT_LWR_MODEL in
11221 (normal)  LD_MODEL=''   ;;
11222 (debug)   LD_MODEL=$CC_G_OPT ;;
11223 (profile) LD_MODEL='-pg';;
11224 (shared)  LD_MODEL=''   ;;
11225 esac
11226 echo "$as_me:11226: result: $LD_MODEL" >&5
11227 echo "${ECHO_T}$LD_MODEL" >&6
11228
11229 LD_RPATH_OPT=
11230 if test "x$cf_cv_enable_rpath" != xno
11231 then
11232         echo "$as_me:11232: checking for an rpath option" >&5
11233 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11234         case "$cf_cv_system_name" in
11235         (irix*)
11236                 if test "$GCC" = yes; then
11237                         LD_RPATH_OPT="-Wl,-rpath,"
11238                 else
11239                         LD_RPATH_OPT="-rpath "
11240                 fi
11241                 ;;
11242         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11243                 LD_RPATH_OPT="-Wl,-rpath,"
11244                 ;;
11245         (openbsd[2-9].*|mirbsd*)
11246                 LD_RPATH_OPT="-Wl,-rpath,"
11247                 ;;
11248         (dragonfly*)
11249                 LD_RPATH_OPT="-rpath "
11250                 ;;
11251         (netbsd*)
11252                 LD_RPATH_OPT="-Wl,-rpath,"
11253                 ;;
11254         (osf*|mls+*)
11255                 LD_RPATH_OPT="-rpath "
11256                 ;;
11257         (solaris2*)
11258                 LD_RPATH_OPT="-R"
11259                 ;;
11260         (*)
11261                 ;;
11262         esac
11263         echo "$as_me:11263: result: $LD_RPATH_OPT" >&5
11264 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11265
11266         case "x$LD_RPATH_OPT" in
11267         (x-R*)
11268                 echo "$as_me:11268: checking if we need a space after rpath option" >&5
11269 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11270                 cf_save_LIBS="$LIBS"
11271
11272 cf_add_libs="$LIBS"
11273 # reverse order
11274 cf_add_0lib=
11275 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11276 # filter duplicates
11277 for cf_add_1lib in $cf_add_0lib; do
11278         for cf_add_2lib in $cf_add_libs; do
11279                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11280                         cf_add_1lib=
11281                         break
11282                 fi
11283         done
11284         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11285 done
11286 LIBS="$cf_add_libs"
11287
11288                 cat >"conftest.$ac_ext" <<_ACEOF
11289 #line 11289 "configure"
11290 #include "confdefs.h"
11291
11292 int
11293 main (void)
11294 {
11295
11296   ;
11297   return 0;
11298 }
11299 _ACEOF
11300 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11301 if { (eval echo "$as_me:11301: \"$ac_link\"") >&5
11302   (eval $ac_link) 2>&5
11303   ac_status=$?
11304   echo "$as_me:11304: \$? = $ac_status" >&5
11305   (exit "$ac_status"); } &&
11306          { ac_try='test -s "conftest$ac_exeext"'
11307   { (eval echo "$as_me:11307: \"$ac_try\"") >&5
11308   (eval $ac_try) 2>&5
11309   ac_status=$?
11310   echo "$as_me:11310: \$? = $ac_status" >&5
11311   (exit "$ac_status"); }; }; then
11312   cf_rpath_space=no
11313 else
11314   echo "$as_me: failed program was:" >&5
11315 cat "conftest.$ac_ext" >&5
11316 cf_rpath_space=yes
11317 fi
11318 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11319                 LIBS="$cf_save_LIBS"
11320                 echo "$as_me:11320: result: $cf_rpath_space" >&5
11321 echo "${ECHO_T}$cf_rpath_space" >&6
11322                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11323                 ;;
11324         esac
11325 fi
11326
11327         RM_SHARED_OPTS=
11328         LOCAL_LDFLAGS=
11329         LOCAL_LDFLAGS2=
11330         LD_SHARED_OPTS=
11331         INSTALL_LIB="-m 644"
11332         : ${rel_builddir:=.}
11333
11334         shlibdir=$libdir
11335
11336         MAKE_DLLS="#"
11337
11338         cf_cv_do_symlinks=no
11339         cf_ld_rpath_opt=
11340         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11341
11342         echo "$as_me:11342: checking if release/abi version should be used for shared libs" >&5
11343 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11344
11345 # Check whether --with-shlib-version or --without-shlib-version was given.
11346 if test "${with_shlib_version+set}" = set; then
11347   withval="$with_shlib_version"
11348   test -z "$withval" && withval=auto
11349         case "$withval" in
11350         (yes)
11351                 cf_cv_shlib_version=auto
11352                 ;;
11353         (rel|abi|auto)
11354                 cf_cv_shlib_version=$withval
11355                 ;;
11356         (*)
11357                 echo "$as_me:11357: result: $withval" >&5
11358 echo "${ECHO_T}$withval" >&6
11359                 { { echo "$as_me:11359: error: option value must be one of: rel, abi, or auto" >&5
11360 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11361    { (exit 1); exit 1; }; }
11362                 ;;
11363         esac
11364
11365 else
11366   cf_cv_shlib_version=auto
11367 fi;
11368         echo "$as_me:11368: result: $cf_cv_shlib_version" >&5
11369 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11370
11371         cf_cv_rm_so_locs=no
11372         cf_try_cflags=
11373
11374         # Some less-capable ports of gcc support only -fpic
11375         CC_SHARED_OPTS=
11376
11377         cf_try_fPIC=no
11378         if test "$GCC" = yes
11379         then
11380                 cf_try_fPIC=yes
11381         else
11382                 case "$cf_cv_system_name" in
11383                 (*linux*)       # e.g., PGI compiler
11384                         cf_try_fPIC=yes
11385                         ;;
11386                 esac
11387         fi
11388
11389         if test "$cf_try_fPIC" = yes
11390         then
11391                 echo "$as_me:11391: checking which $CC option to use" >&5
11392 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11393                 cf_save_CFLAGS="$CFLAGS"
11394                 for CC_SHARED_OPTS in -fPIC -fpic ''
11395                 do
11396                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11397                         cat >"conftest.$ac_ext" <<_ACEOF
11398 #line 11398 "configure"
11399 #include "confdefs.h"
11400 #include <stdio.h>
11401 int
11402 main (void)
11403 {
11404 int x = 1
11405   ;
11406   return 0;
11407 }
11408 _ACEOF
11409 rm -f "conftest.$ac_objext"
11410 if { (eval echo "$as_me:11410: \"$ac_compile\"") >&5
11411   (eval $ac_compile) 2>&5
11412   ac_status=$?
11413   echo "$as_me:11413: \$? = $ac_status" >&5
11414   (exit "$ac_status"); } &&
11415          { ac_try='test -s "conftest.$ac_objext"'
11416   { (eval echo "$as_me:11416: \"$ac_try\"") >&5
11417   (eval $ac_try) 2>&5
11418   ac_status=$?
11419   echo "$as_me:11419: \$? = $ac_status" >&5
11420   (exit "$ac_status"); }; }; then
11421   break
11422 else
11423   echo "$as_me: failed program was:" >&5
11424 cat "conftest.$ac_ext" >&5
11425 fi
11426 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11427                 done
11428                 echo "$as_me:11428: result: $CC_SHARED_OPTS" >&5
11429 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11430                 CFLAGS="$cf_save_CFLAGS"
11431         fi
11432
11433         cf_cv_shlib_version_infix=no
11434
11435         case "$cf_cv_system_name" in
11436         (aix4.3-9*|aix[5-7]*)
11437                 if test "$GCC" = yes; then
11438                         CC_SHARED_OPTS='-Wl,-brtl'
11439                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11440                 else
11441                         CC_SHARED_OPTS='-brtl'
11442                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11443                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11444                 fi
11445                 ;;
11446         (beos*)
11447                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11448                 ;;
11449         (cygwin*)
11450                 CC_SHARED_OPTS=
11451                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11452                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11453                 cf_cv_shlib_version=cygdll
11454                 cf_cv_shlib_version_infix=cygdll
11455                 shlibdir=$bindir
11456                 MAKE_DLLS=
11457                 cat >mk_shared_lib.sh <<-CF_EOF
11458                 #!$SHELL
11459                 SHARED_LIB=\$1
11460                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11461                 shift
11462                 cat <<-EOF
11463                 Linking shared library
11464                 ** SHARED_LIB \$SHARED_LIB
11465                 ** IMPORT_LIB \$IMPORT_LIB
11466 EOF
11467                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11468 CF_EOF
11469                 chmod +x mk_shared_lib.sh
11470                 ;;
11471         (msys*)
11472                 CC_SHARED_OPTS=
11473                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11474                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11475                 cf_cv_shlib_version=msysdll
11476                 cf_cv_shlib_version_infix=msysdll
11477                 shlibdir=$bindir
11478                 MAKE_DLLS=
11479                 cat >mk_shared_lib.sh <<-CF_EOF
11480                 #!$SHELL
11481                 SHARED_LIB=\$1
11482                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11483                 shift
11484                 cat <<-EOF
11485                 Linking shared library
11486                 ** SHARED_LIB \$SHARED_LIB
11487                 ** IMPORT_LIB \$IMPORT_LIB
11488 EOF
11489                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11490 CF_EOF
11491                 chmod +x mk_shared_lib.sh
11492                 ;;
11493         (darwin*)
11494                 cf_try_cflags="no-cpp-precomp"
11495                 CC_SHARED_OPTS="-dynamic"
11496                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11497                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11498                 cf_cv_shlib_version_infix=yes
11499                 echo "$as_me:11499: checking if ld -search_paths_first works" >&5
11500 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11501 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11502   echo $ECHO_N "(cached) $ECHO_C" >&6
11503 else
11504
11505                         cf_save_LDFLAGS=$LDFLAGS
11506                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11507                         cat >"conftest.$ac_ext" <<_ACEOF
11508 #line 11508 "configure"
11509 #include "confdefs.h"
11510
11511 int
11512 main (void)
11513 {
11514 int i;
11515   ;
11516   return 0;
11517 }
11518 _ACEOF
11519 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11520 if { (eval echo "$as_me:11520: \"$ac_link\"") >&5
11521   (eval $ac_link) 2>&5
11522   ac_status=$?
11523   echo "$as_me:11523: \$? = $ac_status" >&5
11524   (exit "$ac_status"); } &&
11525          { ac_try='test -s "conftest$ac_exeext"'
11526   { (eval echo "$as_me:11526: \"$ac_try\"") >&5
11527   (eval $ac_try) 2>&5
11528   ac_status=$?
11529   echo "$as_me:11529: \$? = $ac_status" >&5
11530   (exit "$ac_status"); }; }; then
11531   cf_cv_ldflags_search_paths_first=yes
11532 else
11533   echo "$as_me: failed program was:" >&5
11534 cat "conftest.$ac_ext" >&5
11535 cf_cv_ldflags_search_paths_first=no
11536 fi
11537 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11538                                 LDFLAGS=$cf_save_LDFLAGS
11539 fi
11540 echo "$as_me:11540: result: $cf_cv_ldflags_search_paths_first" >&5
11541 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11542                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11543                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11544                 fi
11545                 ;;
11546         (hpux[7-8]*)
11547                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11548                 if test "$GCC" != yes; then
11549                         CC_SHARED_OPTS='+Z'
11550                 fi
11551                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11552                 INSTALL_LIB="-m 555"
11553                 ;;
11554         (hpux*)
11555                 # (tested with gcc 2.7.2 -- I don't have c89)
11556                 if test "$GCC" = yes; then
11557                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11558                 else
11559                         CC_SHARED_OPTS='+Z'
11560                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11561                 fi
11562                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11563                 # HP-UX shared libraries must be executable, and should be
11564                 # readonly to exploit a quirk in the memory manager.
11565                 INSTALL_LIB="-m 555"
11566                 ;;
11567         (interix*)
11568                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11569                 if test "$cf_cv_shlib_version" = rel; then
11570                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11571                 else
11572                         cf_shared_soname='`basename $@`'
11573                 fi
11574                 CC_SHARED_OPTS=
11575                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11576                 ;;
11577         (irix*)
11578                 if test "$cf_cv_enable_rpath" = yes ; then
11579                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11580                 fi
11581                 # tested with IRIX 5.2 and 'cc'.
11582                 if test "$GCC" != yes; then
11583                         CC_SHARED_OPTS='-KPIC'
11584                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11585                 else
11586                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11587                 fi
11588                 cf_cv_rm_so_locs=yes
11589                 ;;
11590         (linux*|gnu*|k*bsd*-gnu)
11591                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11592                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11593                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11594                 fi
11595                 if test "$cf_cv_enable_rpath" = yes ; then
11596                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11597                 fi
11598
11599         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11600         if test "$cf_cv_shlib_version" = rel; then
11601                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11602         else
11603                 cf_cv_shared_soname='`basename $@`'
11604         fi
11605
11606                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11607                 ;;
11608         (mingw*msvc*)
11609                 cf_cv_shlib_version=msvcdll
11610                 cf_cv_shlib_version_infix=msvcdll
11611                 shlibdir=$bindir
11612                 MAKE_DLLS=
11613                 if test "$DFT_LWR_MODEL" = "shared" ; then
11614                         LOCAL_LDFLAGS="-link -dll"
11615                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11616                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11617                 fi
11618                 CC_SHARED_OPTS=
11619                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11620                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11621                 cat >mk_shared_lib.sh <<-CF_EOF
11622                 #!$SHELL
11623                 SHARED_LIB=\$1
11624                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11625                 shift
11626                 my_ld=\$1
11627                 shift
11628                 cat <<-EOF
11629                 Linking shared library
11630                 ** SHARED LIB \$SHARED_LIB
11631                 ** IMPORT_LIB \$IMPORT_LIB
11632 EOF
11633                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11634                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11635                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11636 CF_EOF
11637                 chmod +x mk_shared_lib.sh
11638                 cat >mk_prog.sh <<-CF_EOF
11639                 #!$SHELL
11640                 shift
11641                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11642                 LD="$LD"
11643                 clopts=()
11644                 ldopts=("/subsystem:console")
11645                 libs=()
11646                 isdll=0
11647                 while test \$# -gt 0; do
11648                         case "\$1" in
11649                                 -link)
11650                                         # ignore -link argument
11651                                         ;;
11652                                 -M[TD] | -M[TD]d)
11653                                         # ignore runtime-library option
11654                                         ;;
11655                                 -dll)
11656                                         isdll=1
11657                                         ;;
11658                                 -W* | -w*)
11659                                         # ignore warnings
11660                                         ;;
11661                                 -D*)
11662                                         clopts+=("\$1")
11663                                         ;;
11664                                 -I*)
11665                                         clopts+=("\$1")
11666                                         ;;
11667                                 -l*)
11668                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11669                                         ;;
11670                                 -L*)
11671                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11672                                         ;;
11673                                 *.obj | *.o)
11674                                         ldopts+=("\$1")
11675                                         ;;
11676                                 -Wl,*)
11677                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11678                                                 ldopts+=("\${linkarg}")
11679                                         done
11680                                         ;;
11681                                 *.lib)
11682                                         ldopts+=("\$1")
11683                                         ;;
11684                                 -o)
11685                                         shift
11686                                         ldopts+=("-out:\$1")
11687                                         ;;
11688                                 *)
11689                                         clopts+=("\$1")
11690                                         ldopts+=("\$1")
11691                                         ;;
11692                         esac
11693                         shift
11694                 done
11695                 if [ "\$isdll" -ne 0 ]; then
11696                         for lib in \${libs[*]}; do
11697                                 ldopts+=("\$lib.dll.lib")
11698                         done
11699                 else
11700                         for lib in \${libs[*]}; do
11701                                 ldopts+=("\$lib.lib")
11702                         done
11703                 fi
11704                 cat <<-EOF
11705                 Creating program
11706                 ** ld options:   "\${ldopts[@]}"
11707 EOF
11708                 exec \$LD \${ldopts[@]}
11709 CF_EOF
11710                 chmod +x mk_prog.sh
11711                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11712                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11713                 ;;
11714         (mingw*)
11715                 cf_cv_shlib_version=mingw
11716                 cf_cv_shlib_version_infix=mingw
11717                 shlibdir=$bindir
11718                 MAKE_DLLS=
11719                 if test "$DFT_LWR_MODEL" = "shared" ; then
11720                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11721                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11722                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11723                 fi
11724                 CC_SHARED_OPTS=
11725                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11726                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11727                 cat >mk_shared_lib.sh <<-CF_EOF
11728                 #!$SHELL
11729                 SHARED_LIB=\$1
11730                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11731                 shift
11732                 cat <<-EOF
11733                 Linking shared library
11734                 ** SHARED_LIB \$SHARED_LIB
11735                 ** IMPORT_LIB \$IMPORT_LIB
11736 EOF
11737                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11738 CF_EOF
11739                 chmod +x mk_shared_lib.sh
11740                 ;;
11741         (openbsd[2-9].*|mirbsd*)
11742                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11743                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11744                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11745                 fi
11746                 if test "$cf_cv_enable_rpath" = yes ; then
11747                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11748                 fi
11749                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11750
11751         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11752         if test "$cf_cv_shlib_version" = rel; then
11753                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11754         else
11755                 cf_cv_shared_soname='`basename $@`'
11756         fi
11757
11758                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11759                 ;;
11760         (nskJ*)
11761                 CC_SHARED_OPTS=
11762                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11763                 ;;
11764         (nskL*)
11765                 CC_SHARED_OPTS=
11766                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11767                 ;;
11768         (nto-qnx*|openbsd*|freebsd[12].*)
11769                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11770                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11771                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11772                 ;;
11773         (dragonfly*|freebsd*)
11774                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11775                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11776                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11777                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11778                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11779                 fi
11780
11781         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11782         if test "$cf_cv_shlib_version" = rel; then
11783                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11784         else
11785                 cf_cv_shared_soname='`basename $@`'
11786         fi
11787
11788                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11789                 ;;
11790         (netbsd*)
11791                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11792                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11793                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11794                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11795                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11796                         if test "$cf_cv_shlib_version" = auto; then
11797                         if test -f /usr/libexec/ld.elf_so; then
11798                                 cf_cv_shlib_version=abi
11799                         else
11800                                 cf_cv_shlib_version=rel
11801                         fi
11802                         fi
11803
11804         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11805         if test "$cf_cv_shlib_version" = rel; then
11806                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11807         else
11808                 cf_cv_shared_soname='`basename $@`'
11809         fi
11810
11811                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11812                 else
11813                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11814                 fi
11815                 ;;
11816         (osf*|mls+*)
11817                 # tested with OSF/1 V3.2 and 'cc'
11818                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11819                 # link with shared libs).
11820                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11821                 case "$host_os" in
11822                 (osf4*)
11823                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11824                         ;;
11825                 esac
11826                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11827                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11828                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11829                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11830                 fi
11831                 cf_cv_rm_so_locs=yes
11832                 ;;
11833         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11834                 # tested with osr5.0.5
11835                 if test "$GCC" != yes; then
11836                         CC_SHARED_OPTS='-belf -KPIC'
11837                 fi
11838                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11839                 if test "$cf_cv_enable_rpath" = yes ; then
11840                         # only way is to set LD_RUN_PATH but no switch for it
11841                         RUN_PATH=$libdir
11842                 fi
11843                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11844                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11845                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11846                 ;;
11847         (sunos4*)
11848                 # tested with SunOS 4.1.1 and gcc 2.7.0
11849                 if test "$GCC" != yes; then
11850                         CC_SHARED_OPTS='-KPIC'
11851                 fi
11852                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11853                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11854                 ;;
11855         (solaris2*)
11856                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11857                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11858                 if test "$DFT_LWR_MODEL" = "shared" ; then
11859                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11860                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11861                 fi
11862                 if test "$cf_cv_enable_rpath" = yes ; then
11863                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
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                 if test "$GCC" != yes; then
11874                         cf_save_CFLAGS="$CFLAGS"
11875                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11876                         do
11877                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11878                                 cat >"conftest.$ac_ext" <<_ACEOF
11879 #line 11879 "configure"
11880 #include "confdefs.h"
11881 #include <stdio.h>
11882 int
11883 main (void)
11884 {
11885 printf("Hello\\n");
11886   ;
11887   return 0;
11888 }
11889 _ACEOF
11890 rm -f "conftest.$ac_objext"
11891 if { (eval echo "$as_me:11891: \"$ac_compile\"") >&5
11892   (eval $ac_compile) 2>&5
11893   ac_status=$?
11894   echo "$as_me:11894: \$? = $ac_status" >&5
11895   (exit "$ac_status"); } &&
11896          { ac_try='test -s "conftest.$ac_objext"'
11897   { (eval echo "$as_me:11897: \"$ac_try\"") >&5
11898   (eval $ac_try) 2>&5
11899   ac_status=$?
11900   echo "$as_me:11900: \$? = $ac_status" >&5
11901   (exit "$ac_status"); }; }; then
11902   break
11903 else
11904   echo "$as_me: failed program was:" >&5
11905 cat "conftest.$ac_ext" >&5
11906 fi
11907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11908                         done
11909                         CFLAGS="$cf_save_CFLAGS"
11910                         CC_SHARED_OPTS=$cf_shared_opts
11911                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11912                 else
11913                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11914                 fi
11915                 ;;
11916         (sysv5uw7*|unix_sv*)
11917                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11918                 if test "$GCC" != yes; then
11919                         CC_SHARED_OPTS='-KPIC'
11920                 fi
11921                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11922                 ;;
11923         (*)
11924                 CC_SHARED_OPTS='unknown'
11925                 MK_SHARED_LIB='echo unknown'
11926                 ;;
11927         esac
11928
11929         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11930         case "$cf_cv_shlib_version" in
11931         (rel|abi)
11932                 case "$MK_SHARED_LIB" in
11933                 (*'-o $@')
11934                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11935                         ;;
11936                 (*)
11937                         { echo "$as_me:11937: WARNING: ignored --with-shlib-version" >&5
11938 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11939                         ;;
11940                 esac
11941                 ;;
11942         esac
11943
11944         if test -n "$cf_try_cflags"
11945         then
11946 cat > conftest.$ac_ext <<EOF
11947 #line 11947 "${as_me:-configure}"
11948 #include <stdio.h>
11949 int main(int argc, char *argv[])
11950 {
11951         printf("hello\\n");
11952         return (argv[argc-1] == 0) ;
11953 }
11954 EOF
11955                 cf_save_CFLAGS="$CFLAGS"
11956                 for cf_opt in $cf_try_cflags
11957                 do
11958                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11959                         echo "$as_me:11959: checking if CFLAGS option -$cf_opt works" >&5
11960 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11961                         if { (eval echo "$as_me:11961: \"$ac_compile\"") >&5
11962   (eval $ac_compile) 2>&5
11963   ac_status=$?
11964   echo "$as_me:11964: \$? = $ac_status" >&5
11965   (exit "$ac_status"); }; then
11966                                 echo "$as_me:11966: result: yes" >&5
11967 echo "${ECHO_T}yes" >&6
11968                                 cf_save_CFLAGS="$CFLAGS"
11969                         else
11970                                 echo "$as_me:11970: result: no" >&5
11971 echo "${ECHO_T}no" >&6
11972                         fi
11973                 done
11974                 CFLAGS="$cf_save_CFLAGS"
11975         fi
11976
11977         # RPATH_LIST is a colon-separated list of directories
11978         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11979         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11980
11981         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11982
11983         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11984
11985 echo "${as_me:-configure}:11985: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11986
11987         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11988
11989 echo "${as_me:-configure}:11989: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11990
11991 # The test/sample programs in the original tree link using rpath option.
11992 # Make it optional for packagers.
11993 if test -n "$LOCAL_LDFLAGS"
11994 then
11995         echo "$as_me:11995: checking if you want to link sample programs with rpath option" >&5
11996 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11997
11998 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11999 if test "${enable_rpath_link+set}" = set; then
12000   enableval="$enable_rpath_link"
12001   with_rpath_link=$enableval
12002 else
12003   with_rpath_link=yes
12004 fi;
12005         echo "$as_me:12005: result: $with_rpath_link" >&5
12006 echo "${ECHO_T}$with_rpath_link" >&6
12007         if test "$with_rpath_link" = no
12008         then
12009                 LOCAL_LDFLAGS=
12010                 LOCAL_LDFLAGS2=
12011         fi
12012 fi
12013
12014 ###############################################################################
12015
12016 ###   use option --enable-broken-linker to force on use of broken-linker support
12017
12018 echo "$as_me:12018: checking if you want broken-linker support code" >&5
12019 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12020
12021 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12022 if test "${enable_broken_linker+set}" = set; then
12023   enableval="$enable_broken_linker"
12024   with_broken_linker=$enableval
12025 else
12026   with_broken_linker=no
12027 fi;
12028 echo "$as_me:12028: result: $with_broken_linker" >&5
12029 echo "${ECHO_T}$with_broken_linker" >&6
12030
12031 : "${BROKEN_LINKER:=0}"
12032 if test "x$with_broken_linker" = xyes ; then
12033
12034 cat >>confdefs.h <<\EOF
12035 #define BROKEN_LINKER 1
12036 EOF
12037
12038         BROKEN_LINKER=1
12039 fi
12040
12041 # Check to define _XOPEN_SOURCE "automatically"
12042
12043 echo "$as_me:12043: checking if the POSIX test-macros are already defined" >&5
12044 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12045 if test "${cf_cv_posix_visible+set}" = set; then
12046   echo $ECHO_N "(cached) $ECHO_C" >&6
12047 else
12048
12049 cat >"conftest.$ac_ext" <<_ACEOF
12050 #line 12050 "configure"
12051 #include "confdefs.h"
12052 #include <stdio.h>
12053 int
12054 main (void)
12055 {
12056
12057 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12058         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12059         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12060         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12061 #error conflicting symbols found
12062 #endif
12063
12064   ;
12065   return 0;
12066 }
12067 _ACEOF
12068 rm -f "conftest.$ac_objext"
12069 if { (eval echo "$as_me:12069: \"$ac_compile\"") >&5
12070   (eval $ac_compile) 2>&5
12071   ac_status=$?
12072   echo "$as_me:12072: \$? = $ac_status" >&5
12073   (exit "$ac_status"); } &&
12074          { ac_try='test -s "conftest.$ac_objext"'
12075   { (eval echo "$as_me:12075: \"$ac_try\"") >&5
12076   (eval $ac_try) 2>&5
12077   ac_status=$?
12078   echo "$as_me:12078: \$? = $ac_status" >&5
12079   (exit "$ac_status"); }; }; then
12080   cf_cv_posix_visible=no
12081 else
12082   echo "$as_me: failed program was:" >&5
12083 cat "conftest.$ac_ext" >&5
12084 cf_cv_posix_visible=yes
12085 fi
12086 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12087
12088 fi
12089 echo "$as_me:12089: result: $cf_cv_posix_visible" >&5
12090 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12091
12092 if test "$cf_cv_posix_visible" = no; then
12093
12094 cf_XOPEN_SOURCE=600
12095 cf_POSIX_C_SOURCE=199506L
12096 cf_xopen_source=
12097
12098 case "$host_os" in
12099 (aix[4-7]*)
12100         cf_xopen_source="-D_ALL_SOURCE"
12101         ;;
12102 (msys)
12103         cf_XOPEN_SOURCE=600
12104         ;;
12105 (darwin[0-8].*)
12106         cf_xopen_source="-D_APPLE_C_SOURCE"
12107         ;;
12108 (darwin*)
12109         cf_xopen_source="-D_DARWIN_C_SOURCE"
12110         cf_XOPEN_SOURCE=
12111         ;;
12112 (freebsd*|dragonfly*|midnightbsd*)
12113         # 5.x headers associate
12114         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12115         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12116         cf_POSIX_C_SOURCE=200112L
12117         cf_XOPEN_SOURCE=600
12118         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12119         ;;
12120 (hpux11*)
12121         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12122         ;;
12123 (hpux*)
12124         cf_xopen_source="-D_HPUX_SOURCE"
12125         ;;
12126 (irix[56].*)
12127         cf_xopen_source="-D_SGI_SOURCE"
12128         cf_XOPEN_SOURCE=
12129         ;;
12130 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12131
12132 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12133
12134 echo "$as_me:12134: checking if this is the GNU C library" >&5
12135 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12136 if test "${cf_cv_gnu_library+set}" = set; then
12137   echo $ECHO_N "(cached) $ECHO_C" >&6
12138 else
12139
12140 cat >"conftest.$ac_ext" <<_ACEOF
12141 #line 12141 "configure"
12142 #include "confdefs.h"
12143 #include <sys/types.h>
12144 int
12145 main (void)
12146 {
12147
12148         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12149                 return 0;
12150         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12151                 return 0;
12152         #else
12153         #       error not GNU C library
12154         #endif
12155   ;
12156   return 0;
12157 }
12158 _ACEOF
12159 rm -f "conftest.$ac_objext"
12160 if { (eval echo "$as_me:12160: \"$ac_compile\"") >&5
12161   (eval $ac_compile) 2>&5
12162   ac_status=$?
12163   echo "$as_me:12163: \$? = $ac_status" >&5
12164   (exit "$ac_status"); } &&
12165          { ac_try='test -s "conftest.$ac_objext"'
12166   { (eval echo "$as_me:12166: \"$ac_try\"") >&5
12167   (eval $ac_try) 2>&5
12168   ac_status=$?
12169   echo "$as_me:12169: \$? = $ac_status" >&5
12170   (exit "$ac_status"); }; }; then
12171   cf_cv_gnu_library=yes
12172 else
12173   echo "$as_me: failed program was:" >&5
12174 cat "conftest.$ac_ext" >&5
12175 cf_cv_gnu_library=no
12176 fi
12177 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12178
12179 fi
12180 echo "$as_me:12180: result: $cf_cv_gnu_library" >&5
12181 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12182
12183 if test x$cf_cv_gnu_library = xyes; then
12184
12185         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12186         # was changed to help a little.  newlib incorporated the change about 4
12187         # years later.
12188         echo "$as_me:12188: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12189 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12190 if test "${cf_cv_gnu_library_219+set}" = set; then
12191   echo $ECHO_N "(cached) $ECHO_C" >&6
12192 else
12193
12194                 cf_save="$CPPFLAGS"
12195
12196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12197         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12198
12199                 cat >"conftest.$ac_ext" <<_ACEOF
12200 #line 12200 "configure"
12201 #include "confdefs.h"
12202 #include <sys/types.h>
12203 int
12204 main (void)
12205 {
12206
12207                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12208                                 return 0;
12209                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12210                                 return 0;
12211                         #else
12212                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12213                         #endif
12214   ;
12215   return 0;
12216 }
12217 _ACEOF
12218 rm -f "conftest.$ac_objext"
12219 if { (eval echo "$as_me:12219: \"$ac_compile\"") >&5
12220   (eval $ac_compile) 2>&5
12221   ac_status=$?
12222   echo "$as_me:12222: \$? = $ac_status" >&5
12223   (exit "$ac_status"); } &&
12224          { ac_try='test -s "conftest.$ac_objext"'
12225   { (eval echo "$as_me:12225: \"$ac_try\"") >&5
12226   (eval $ac_try) 2>&5
12227   ac_status=$?
12228   echo "$as_me:12228: \$? = $ac_status" >&5
12229   (exit "$ac_status"); }; }; then
12230   cf_cv_gnu_library_219=yes
12231 else
12232   echo "$as_me: failed program was:" >&5
12233 cat "conftest.$ac_ext" >&5
12234 cf_cv_gnu_library_219=no
12235 fi
12236 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12237                 CPPFLAGS="$cf_save"
12238
12239 fi
12240 echo "$as_me:12240: result: $cf_cv_gnu_library_219" >&5
12241 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12242
12243         if test "x$cf_cv_gnu_library_219" = xyes; then
12244                 cf_save="$CPPFLAGS"
12245                 echo "$as_me:12245: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12246 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12247 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12248   echo $ECHO_N "(cached) $ECHO_C" >&6
12249 else
12250
12251 cf_fix_cppflags=no
12252 cf_new_cflags=
12253 cf_new_cppflags=
12254 cf_new_extra_cppflags=
12255
12256 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12257 do
12258 case "$cf_fix_cppflags" in
12259 (no)
12260         case "$cf_add_cflags" in
12261         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12262                 case "$cf_add_cflags" in
12263                 (-D*)
12264                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12265
12266                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12267                                 && test -z "${cf_tst_cflags}" \
12268                                 && cf_fix_cppflags=yes
12269
12270                         if test "$cf_fix_cppflags" = yes ; then
12271
12272         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12273         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12274
12275                                 continue
12276                         elif test "${cf_tst_cflags}" = "\"'" ; then
12277
12278         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12279         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12280
12281                                 continue
12282                         fi
12283                         ;;
12284                 esac
12285                 case "$CPPFLAGS" in
12286                 (*$cf_add_cflags)
12287                         ;;
12288                 (*)
12289                         case "$cf_add_cflags" in
12290                         (-D*)
12291                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12292
12293 CPPFLAGS=`echo "$CPPFLAGS" | \
12294         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12295                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12296
12297                                 ;;
12298                         esac
12299
12300         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12301         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12302
12303                         ;;
12304                 esac
12305                 ;;
12306         (*)
12307
12308         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12309         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12310
12311                 ;;
12312         esac
12313         ;;
12314 (yes)
12315
12316         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12317         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12318
12319         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12320
12321         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12322                 && test -z "${cf_tst_cflags}" \
12323                 && cf_fix_cppflags=no
12324         ;;
12325 esac
12326 done
12327
12328 if test -n "$cf_new_cflags" ; then
12329
12330         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12331         CFLAGS="${CFLAGS}$cf_new_cflags"
12332
12333 fi
12334
12335 if test -n "$cf_new_cppflags" ; then
12336
12337         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12338         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12339
12340 fi
12341
12342 if test -n "$cf_new_extra_cppflags" ; then
12343
12344         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12345         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12346
12347 fi
12348
12349                         cat >"conftest.$ac_ext" <<_ACEOF
12350 #line 12350 "configure"
12351 #include "confdefs.h"
12352
12353                                 #include <limits.h>
12354                                 #include <sys/types.h>
12355
12356 int
12357 main (void)
12358 {
12359
12360                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12361                                         return 0;
12362                                 #else
12363                                 #       error GNU C library is too old
12364                                 #endif
12365   ;
12366   return 0;
12367 }
12368 _ACEOF
12369 rm -f "conftest.$ac_objext"
12370 if { (eval echo "$as_me:12370: \"$ac_compile\"") >&5
12371   (eval $ac_compile) 2>&5
12372   ac_status=$?
12373   echo "$as_me:12373: \$? = $ac_status" >&5
12374   (exit "$ac_status"); } &&
12375          { ac_try='test -s "conftest.$ac_objext"'
12376   { (eval echo "$as_me:12376: \"$ac_try\"") >&5
12377   (eval $ac_try) 2>&5
12378   ac_status=$?
12379   echo "$as_me:12379: \$? = $ac_status" >&5
12380   (exit "$ac_status"); }; }; then
12381   cf_cv_gnu_dftsrc_219=yes
12382 else
12383   echo "$as_me: failed program was:" >&5
12384 cat "conftest.$ac_ext" >&5
12385 cf_cv_gnu_dftsrc_219=no
12386 fi
12387 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12388
12389 fi
12390 echo "$as_me:12390: result: $cf_cv_gnu_dftsrc_219" >&5
12391 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12392                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12393         else
12394                 cf_cv_gnu_dftsrc_219=maybe
12395         fi
12396
12397         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12398
12399                 echo "$as_me:12399: checking if we must define _GNU_SOURCE" >&5
12400 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12401 if test "${cf_cv_gnu_source+set}" = set; then
12402   echo $ECHO_N "(cached) $ECHO_C" >&6
12403 else
12404
12405                 cat >"conftest.$ac_ext" <<_ACEOF
12406 #line 12406 "configure"
12407 #include "confdefs.h"
12408 #include <sys/types.h>
12409 int
12410 main (void)
12411 {
12412
12413                         #ifndef _XOPEN_SOURCE
12414                         #error  expected _XOPEN_SOURCE to be defined
12415                         #endif
12416   ;
12417   return 0;
12418 }
12419 _ACEOF
12420 rm -f "conftest.$ac_objext"
12421 if { (eval echo "$as_me:12421: \"$ac_compile\"") >&5
12422   (eval $ac_compile) 2>&5
12423   ac_status=$?
12424   echo "$as_me:12424: \$? = $ac_status" >&5
12425   (exit "$ac_status"); } &&
12426          { ac_try='test -s "conftest.$ac_objext"'
12427   { (eval echo "$as_me:12427: \"$ac_try\"") >&5
12428   (eval $ac_try) 2>&5
12429   ac_status=$?
12430   echo "$as_me:12430: \$? = $ac_status" >&5
12431   (exit "$ac_status"); }; }; then
12432   cf_cv_gnu_source=no
12433 else
12434   echo "$as_me: failed program was:" >&5
12435 cat "conftest.$ac_ext" >&5
12436 cf_save="$CPPFLAGS"
12437
12438 cf_fix_cppflags=no
12439 cf_new_cflags=
12440 cf_new_cppflags=
12441 cf_new_extra_cppflags=
12442
12443 for cf_add_cflags in -D_GNU_SOURCE
12444 do
12445 case "$cf_fix_cppflags" in
12446 (no)
12447         case "$cf_add_cflags" in
12448         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12449                 case "$cf_add_cflags" in
12450                 (-D*)
12451                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12452
12453                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12454                                 && test -z "${cf_tst_cflags}" \
12455                                 && cf_fix_cppflags=yes
12456
12457                         if test "$cf_fix_cppflags" = yes ; then
12458
12459         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12460         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12461
12462                                 continue
12463                         elif test "${cf_tst_cflags}" = "\"'" ; then
12464
12465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12467
12468                                 continue
12469                         fi
12470                         ;;
12471                 esac
12472                 case "$CPPFLAGS" in
12473                 (*$cf_add_cflags)
12474                         ;;
12475                 (*)
12476                         case "$cf_add_cflags" in
12477                         (-D*)
12478                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12479
12480 CPPFLAGS=`echo "$CPPFLAGS" | \
12481         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12482                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12483
12484                                 ;;
12485                         esac
12486
12487         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12488         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12489
12490                         ;;
12491                 esac
12492                 ;;
12493         (*)
12494
12495         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12496         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12497
12498                 ;;
12499         esac
12500         ;;
12501 (yes)
12502
12503         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12504         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12505
12506         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12507
12508         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12509                 && test -z "${cf_tst_cflags}" \
12510                 && cf_fix_cppflags=no
12511         ;;
12512 esac
12513 done
12514
12515 if test -n "$cf_new_cflags" ; then
12516
12517         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12518         CFLAGS="${CFLAGS}$cf_new_cflags"
12519
12520 fi
12521
12522 if test -n "$cf_new_cppflags" ; then
12523
12524         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12525         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12526
12527 fi
12528
12529 if test -n "$cf_new_extra_cppflags" ; then
12530
12531         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12532         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12533
12534 fi
12535
12536                          cat >"conftest.$ac_ext" <<_ACEOF
12537 #line 12537 "configure"
12538 #include "confdefs.h"
12539 #include <sys/types.h>
12540 int
12541 main (void)
12542 {
12543
12544                                 #ifdef _XOPEN_SOURCE
12545                                 #error  expected _XOPEN_SOURCE to be undefined
12546                                 #endif
12547   ;
12548   return 0;
12549 }
12550 _ACEOF
12551 rm -f "conftest.$ac_objext"
12552 if { (eval echo "$as_me:12552: \"$ac_compile\"") >&5
12553   (eval $ac_compile) 2>&5
12554   ac_status=$?
12555   echo "$as_me:12555: \$? = $ac_status" >&5
12556   (exit "$ac_status"); } &&
12557          { ac_try='test -s "conftest.$ac_objext"'
12558   { (eval echo "$as_me:12558: \"$ac_try\"") >&5
12559   (eval $ac_try) 2>&5
12560   ac_status=$?
12561   echo "$as_me:12561: \$? = $ac_status" >&5
12562   (exit "$ac_status"); }; }; then
12563   cf_cv_gnu_source=no
12564 else
12565   echo "$as_me: failed program was:" >&5
12566 cat "conftest.$ac_ext" >&5
12567 cf_cv_gnu_source=yes
12568 fi
12569 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12570                         CPPFLAGS="$cf_save"
12571
12572 fi
12573 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12574
12575 fi
12576 echo "$as_me:12576: result: $cf_cv_gnu_source" >&5
12577 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12578
12579                 if test "$cf_cv_gnu_source" = yes
12580                 then
12581                 echo "$as_me:12581: checking if we should also define _DEFAULT_SOURCE" >&5
12582 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12583 if test "${cf_cv_default_source+set}" = set; then
12584   echo $ECHO_N "(cached) $ECHO_C" >&6
12585 else
12586
12587         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12588         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12589
12590                         cat >"conftest.$ac_ext" <<_ACEOF
12591 #line 12591 "configure"
12592 #include "confdefs.h"
12593 #include <sys/types.h>
12594 int
12595 main (void)
12596 {
12597
12598                                 #ifdef _DEFAULT_SOURCE
12599                                 #error  expected _DEFAULT_SOURCE to be undefined
12600                                 #endif
12601   ;
12602   return 0;
12603 }
12604 _ACEOF
12605 rm -f "conftest.$ac_objext"
12606 if { (eval echo "$as_me:12606: \"$ac_compile\"") >&5
12607   (eval $ac_compile) 2>&5
12608   ac_status=$?
12609   echo "$as_me:12609: \$? = $ac_status" >&5
12610   (exit "$ac_status"); } &&
12611          { ac_try='test -s "conftest.$ac_objext"'
12612   { (eval echo "$as_me:12612: \"$ac_try\"") >&5
12613   (eval $ac_try) 2>&5
12614   ac_status=$?
12615   echo "$as_me:12615: \$? = $ac_status" >&5
12616   (exit "$ac_status"); }; }; then
12617   cf_cv_default_source=no
12618 else
12619   echo "$as_me: failed program was:" >&5
12620 cat "conftest.$ac_ext" >&5
12621 cf_cv_default_source=yes
12622 fi
12623 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12624
12625 fi
12626 echo "$as_me:12626: result: $cf_cv_default_source" >&5
12627 echo "${ECHO_T}$cf_cv_default_source" >&6
12628                         if test "$cf_cv_default_source" = yes
12629                         then
12630
12631         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12632         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12633
12634                         fi
12635                 fi
12636         fi
12637
12638 fi
12639
12640         ;;
12641 (minix*)
12642         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12643         ;;
12644 (mirbsd*)
12645         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12646         cf_XOPEN_SOURCE=
12647
12648 if test "$cf_cv_posix_visible" = no; then
12649
12650 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12651
12652 cf_save_CFLAGS="$CFLAGS"
12653 cf_save_CPPFLAGS="$CPPFLAGS"
12654
12655 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12656         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12657                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12658
12659 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12660         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12661                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12662
12663 echo "$as_me:12663: checking if we should define _POSIX_C_SOURCE" >&5
12664 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12665 if test "${cf_cv_posix_c_source+set}" = set; then
12666   echo $ECHO_N "(cached) $ECHO_C" >&6
12667 else
12668
12669 echo "${as_me:-configure}:12669: testing if the symbol is already defined go no further ..." 1>&5
12670
12671         cat >"conftest.$ac_ext" <<_ACEOF
12672 #line 12672 "configure"
12673 #include "confdefs.h"
12674 #include <sys/types.h>
12675 int
12676 main (void)
12677 {
12678
12679 #ifndef _POSIX_C_SOURCE
12680 make an error
12681 #endif
12682   ;
12683   return 0;
12684 }
12685 _ACEOF
12686 rm -f "conftest.$ac_objext"
12687 if { (eval echo "$as_me:12687: \"$ac_compile\"") >&5
12688   (eval $ac_compile) 2>&5
12689   ac_status=$?
12690   echo "$as_me:12690: \$? = $ac_status" >&5
12691   (exit "$ac_status"); } &&
12692          { ac_try='test -s "conftest.$ac_objext"'
12693   { (eval echo "$as_me:12693: \"$ac_try\"") >&5
12694   (eval $ac_try) 2>&5
12695   ac_status=$?
12696   echo "$as_me:12696: \$? = $ac_status" >&5
12697   (exit "$ac_status"); }; }; then
12698   cf_cv_posix_c_source=no
12699 else
12700   echo "$as_me: failed program was:" >&5
12701 cat "conftest.$ac_ext" >&5
12702 cf_want_posix_source=no
12703          case .$cf_POSIX_C_SOURCE in
12704          (.[12]??*)
12705                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12706                 ;;
12707          (.2)
12708                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12709                 cf_want_posix_source=yes
12710                 ;;
12711          (.*)
12712                 cf_want_posix_source=yes
12713                 ;;
12714          esac
12715          if test "$cf_want_posix_source" = yes ; then
12716                 cat >"conftest.$ac_ext" <<_ACEOF
12717 #line 12717 "configure"
12718 #include "confdefs.h"
12719 #include <sys/types.h>
12720 int
12721 main (void)
12722 {
12723
12724 #ifdef _POSIX_SOURCE
12725 make an error
12726 #endif
12727   ;
12728   return 0;
12729 }
12730 _ACEOF
12731 rm -f "conftest.$ac_objext"
12732 if { (eval echo "$as_me:12732: \"$ac_compile\"") >&5
12733   (eval $ac_compile) 2>&5
12734   ac_status=$?
12735   echo "$as_me:12735: \$? = $ac_status" >&5
12736   (exit "$ac_status"); } &&
12737          { ac_try='test -s "conftest.$ac_objext"'
12738   { (eval echo "$as_me:12738: \"$ac_try\"") >&5
12739   (eval $ac_try) 2>&5
12740   ac_status=$?
12741   echo "$as_me:12741: \$? = $ac_status" >&5
12742   (exit "$ac_status"); }; }; then
12743   :
12744 else
12745   echo "$as_me: failed program was:" >&5
12746 cat "conftest.$ac_ext" >&5
12747 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12748 fi
12749 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12750          fi
12751
12752 echo "${as_me:-configure}:12752: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12753
12754          CFLAGS="$cf_trim_CFLAGS"
12755          CPPFLAGS="$cf_trim_CPPFLAGS"
12756
12757         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12758         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12759
12760 echo "${as_me:-configure}:12760: testing if the second compile does not leave our definition intact error ..." 1>&5
12761
12762          cat >"conftest.$ac_ext" <<_ACEOF
12763 #line 12763 "configure"
12764 #include "confdefs.h"
12765 #include <sys/types.h>
12766 int
12767 main (void)
12768 {
12769
12770 #ifndef _POSIX_C_SOURCE
12771 make an error
12772 #endif
12773   ;
12774   return 0;
12775 }
12776 _ACEOF
12777 rm -f "conftest.$ac_objext"
12778 if { (eval echo "$as_me:12778: \"$ac_compile\"") >&5
12779   (eval $ac_compile) 2>&5
12780   ac_status=$?
12781   echo "$as_me:12781: \$? = $ac_status" >&5
12782   (exit "$ac_status"); } &&
12783          { ac_try='test -s "conftest.$ac_objext"'
12784   { (eval echo "$as_me:12784: \"$ac_try\"") >&5
12785   (eval $ac_try) 2>&5
12786   ac_status=$?
12787   echo "$as_me:12787: \$? = $ac_status" >&5
12788   (exit "$ac_status"); }; }; then
12789   :
12790 else
12791   echo "$as_me: failed program was:" >&5
12792 cat "conftest.$ac_ext" >&5
12793 cf_cv_posix_c_source=no
12794 fi
12795 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12796          CFLAGS="$cf_save_CFLAGS"
12797          CPPFLAGS="$cf_save_CPPFLAGS"
12798
12799 fi
12800 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12801
12802 fi
12803 echo "$as_me:12803: result: $cf_cv_posix_c_source" >&5
12804 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12805
12806 if test "$cf_cv_posix_c_source" != no ; then
12807         CFLAGS="$cf_trim_CFLAGS"
12808         CPPFLAGS="$cf_trim_CPPFLAGS"
12809
12810 cf_fix_cppflags=no
12811 cf_new_cflags=
12812 cf_new_cppflags=
12813 cf_new_extra_cppflags=
12814
12815 for cf_add_cflags in $cf_cv_posix_c_source
12816 do
12817 case "$cf_fix_cppflags" in
12818 (no)
12819         case "$cf_add_cflags" in
12820         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12821                 case "$cf_add_cflags" in
12822                 (-D*)
12823                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12824
12825                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12826                                 && test -z "${cf_tst_cflags}" \
12827                                 && cf_fix_cppflags=yes
12828
12829                         if test "$cf_fix_cppflags" = yes ; then
12830
12831         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12832         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12833
12834                                 continue
12835                         elif test "${cf_tst_cflags}" = "\"'" ; then
12836
12837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12839
12840                                 continue
12841                         fi
12842                         ;;
12843                 esac
12844                 case "$CPPFLAGS" in
12845                 (*$cf_add_cflags)
12846                         ;;
12847                 (*)
12848                         case "$cf_add_cflags" in
12849                         (-D*)
12850                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12851
12852 CPPFLAGS=`echo "$CPPFLAGS" | \
12853         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12854                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12855
12856                                 ;;
12857                         esac
12858
12859         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12860         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12861
12862                         ;;
12863                 esac
12864                 ;;
12865         (*)
12866
12867         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12868         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12869
12870                 ;;
12871         esac
12872         ;;
12873 (yes)
12874
12875         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12876         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12877
12878         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12879
12880         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12881                 && test -z "${cf_tst_cflags}" \
12882                 && cf_fix_cppflags=no
12883         ;;
12884 esac
12885 done
12886
12887 if test -n "$cf_new_cflags" ; then
12888
12889         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12890         CFLAGS="${CFLAGS}$cf_new_cflags"
12891
12892 fi
12893
12894 if test -n "$cf_new_cppflags" ; then
12895
12896         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12897         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12898
12899 fi
12900
12901 if test -n "$cf_new_extra_cppflags" ; then
12902
12903         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12904         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12905
12906 fi
12907
12908 fi
12909
12910 fi # cf_cv_posix_visible
12911
12912         ;;
12913 (netbsd*)
12914         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12915         ;;
12916 (openbsd[6-9]*)
12917         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
12918         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
12919         # Abusing the conformance level is a workaround.
12920         { echo "$as_me:12920: WARNING: this system does not provide usable locale support" >&5
12921 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
12922         cf_xopen_source="-D_BSD_SOURCE"
12923         cf_XOPEN_SOURCE=700
12924         ;;
12925 (openbsd[4-5]*)
12926         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12927         cf_xopen_source="-D_BSD_SOURCE"
12928         cf_XOPEN_SOURCE=600
12929         ;;
12930 (openbsd*)
12931         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12932         ;;
12933 (osf[45]*)
12934         cf_xopen_source="-D_OSF_SOURCE"
12935         ;;
12936 (nto-qnx*)
12937         cf_xopen_source="-D_QNX_SOURCE"
12938         ;;
12939 (sco*)
12940         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12941         ;;
12942 (solaris2.*)
12943         cf_xopen_source="-D__EXTENSIONS__"
12944         cf_cv_xopen_source=broken
12945         ;;
12946 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12947         cf_XOPEN_SOURCE=
12948         cf_POSIX_C_SOURCE=
12949         ;;
12950 (*)
12951
12952 echo "$as_me:12952: checking if we should define _XOPEN_SOURCE" >&5
12953 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12954 if test "${cf_cv_xopen_source+set}" = set; then
12955   echo $ECHO_N "(cached) $ECHO_C" >&6
12956 else
12957
12958         cat >"conftest.$ac_ext" <<_ACEOF
12959 #line 12959 "configure"
12960 #include "confdefs.h"
12961
12962 #include <stdlib.h>
12963 #include <string.h>
12964 #include <sys/types.h>
12965
12966 int
12967 main (void)
12968 {
12969
12970 #ifndef _XOPEN_SOURCE
12971 make an error
12972 #endif
12973   ;
12974   return 0;
12975 }
12976 _ACEOF
12977 rm -f "conftest.$ac_objext"
12978 if { (eval echo "$as_me:12978: \"$ac_compile\"") >&5
12979   (eval $ac_compile) 2>&5
12980   ac_status=$?
12981   echo "$as_me:12981: \$? = $ac_status" >&5
12982   (exit "$ac_status"); } &&
12983          { ac_try='test -s "conftest.$ac_objext"'
12984   { (eval echo "$as_me:12984: \"$ac_try\"") >&5
12985   (eval $ac_try) 2>&5
12986   ac_status=$?
12987   echo "$as_me:12987: \$? = $ac_status" >&5
12988   (exit "$ac_status"); }; }; then
12989   cf_cv_xopen_source=no
12990 else
12991   echo "$as_me: failed program was:" >&5
12992 cat "conftest.$ac_ext" >&5
12993 cf_save="$CPPFLAGS"
12994
12995         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12996         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12997
12998          cat >"conftest.$ac_ext" <<_ACEOF
12999 #line 12999 "configure"
13000 #include "confdefs.h"
13001
13002 #include <stdlib.h>
13003 #include <string.h>
13004 #include <sys/types.h>
13005
13006 int
13007 main (void)
13008 {
13009
13010 #ifdef _XOPEN_SOURCE
13011 make an error
13012 #endif
13013   ;
13014   return 0;
13015 }
13016 _ACEOF
13017 rm -f "conftest.$ac_objext"
13018 if { (eval echo "$as_me:13018: \"$ac_compile\"") >&5
13019   (eval $ac_compile) 2>&5
13020   ac_status=$?
13021   echo "$as_me:13021: \$? = $ac_status" >&5
13022   (exit "$ac_status"); } &&
13023          { ac_try='test -s "conftest.$ac_objext"'
13024   { (eval echo "$as_me:13024: \"$ac_try\"") >&5
13025   (eval $ac_try) 2>&5
13026   ac_status=$?
13027   echo "$as_me:13027: \$? = $ac_status" >&5
13028   (exit "$ac_status"); }; }; then
13029   cf_cv_xopen_source=no
13030 else
13031   echo "$as_me: failed program was:" >&5
13032 cat "conftest.$ac_ext" >&5
13033 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13034 fi
13035 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13036         CPPFLAGS="$cf_save"
13037
13038 fi
13039 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13040
13041 fi
13042 echo "$as_me:13042: result: $cf_cv_xopen_source" >&5
13043 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13044
13045 if test "$cf_cv_xopen_source" != no ; then
13046
13047 CFLAGS=`echo "$CFLAGS" | \
13048         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13049                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13050
13051 CPPFLAGS=`echo "$CPPFLAGS" | \
13052         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13053                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13054
13055         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13056
13057 cf_fix_cppflags=no
13058 cf_new_cflags=
13059 cf_new_cppflags=
13060 cf_new_extra_cppflags=
13061
13062 for cf_add_cflags in $cf_temp_xopen_source
13063 do
13064 case "$cf_fix_cppflags" in
13065 (no)
13066         case "$cf_add_cflags" in
13067         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13068                 case "$cf_add_cflags" in
13069                 (-D*)
13070                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13071
13072                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13073                                 && test -z "${cf_tst_cflags}" \
13074                                 && cf_fix_cppflags=yes
13075
13076                         if test "$cf_fix_cppflags" = yes ; then
13077
13078         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13079         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13080
13081                                 continue
13082                         elif test "${cf_tst_cflags}" = "\"'" ; then
13083
13084         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13085         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13086
13087                                 continue
13088                         fi
13089                         ;;
13090                 esac
13091                 case "$CPPFLAGS" in
13092                 (*$cf_add_cflags)
13093                         ;;
13094                 (*)
13095                         case "$cf_add_cflags" in
13096                         (-D*)
13097                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13098
13099 CPPFLAGS=`echo "$CPPFLAGS" | \
13100         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13101                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13102
13103                                 ;;
13104                         esac
13105
13106         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13107         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13108
13109                         ;;
13110                 esac
13111                 ;;
13112         (*)
13113
13114         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13115         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13116
13117                 ;;
13118         esac
13119         ;;
13120 (yes)
13121
13122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13124
13125         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13126
13127         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13128                 && test -z "${cf_tst_cflags}" \
13129                 && cf_fix_cppflags=no
13130         ;;
13131 esac
13132 done
13133
13134 if test -n "$cf_new_cflags" ; then
13135
13136         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13137         CFLAGS="${CFLAGS}$cf_new_cflags"
13138
13139 fi
13140
13141 if test -n "$cf_new_cppflags" ; then
13142
13143         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13144         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13145
13146 fi
13147
13148 if test -n "$cf_new_extra_cppflags" ; then
13149
13150         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13151         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13152
13153 fi
13154
13155 fi
13156
13157 if test "$cf_cv_posix_visible" = no; then
13158
13159 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13160
13161 cf_save_CFLAGS="$CFLAGS"
13162 cf_save_CPPFLAGS="$CPPFLAGS"
13163
13164 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13165         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13166                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13167
13168 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13169         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13170                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13171
13172 echo "$as_me:13172: checking if we should define _POSIX_C_SOURCE" >&5
13173 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13174 if test "${cf_cv_posix_c_source+set}" = set; then
13175   echo $ECHO_N "(cached) $ECHO_C" >&6
13176 else
13177
13178 echo "${as_me:-configure}:13178: testing if the symbol is already defined go no further ..." 1>&5
13179
13180         cat >"conftest.$ac_ext" <<_ACEOF
13181 #line 13181 "configure"
13182 #include "confdefs.h"
13183 #include <sys/types.h>
13184 int
13185 main (void)
13186 {
13187
13188 #ifndef _POSIX_C_SOURCE
13189 make an error
13190 #endif
13191   ;
13192   return 0;
13193 }
13194 _ACEOF
13195 rm -f "conftest.$ac_objext"
13196 if { (eval echo "$as_me:13196: \"$ac_compile\"") >&5
13197   (eval $ac_compile) 2>&5
13198   ac_status=$?
13199   echo "$as_me:13199: \$? = $ac_status" >&5
13200   (exit "$ac_status"); } &&
13201          { ac_try='test -s "conftest.$ac_objext"'
13202   { (eval echo "$as_me:13202: \"$ac_try\"") >&5
13203   (eval $ac_try) 2>&5
13204   ac_status=$?
13205   echo "$as_me:13205: \$? = $ac_status" >&5
13206   (exit "$ac_status"); }; }; then
13207   cf_cv_posix_c_source=no
13208 else
13209   echo "$as_me: failed program was:" >&5
13210 cat "conftest.$ac_ext" >&5
13211 cf_want_posix_source=no
13212          case .$cf_POSIX_C_SOURCE in
13213          (.[12]??*)
13214                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13215                 ;;
13216          (.2)
13217                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13218                 cf_want_posix_source=yes
13219                 ;;
13220          (.*)
13221                 cf_want_posix_source=yes
13222                 ;;
13223          esac
13224          if test "$cf_want_posix_source" = yes ; then
13225                 cat >"conftest.$ac_ext" <<_ACEOF
13226 #line 13226 "configure"
13227 #include "confdefs.h"
13228 #include <sys/types.h>
13229 int
13230 main (void)
13231 {
13232
13233 #ifdef _POSIX_SOURCE
13234 make an error
13235 #endif
13236   ;
13237   return 0;
13238 }
13239 _ACEOF
13240 rm -f "conftest.$ac_objext"
13241 if { (eval echo "$as_me:13241: \"$ac_compile\"") >&5
13242   (eval $ac_compile) 2>&5
13243   ac_status=$?
13244   echo "$as_me:13244: \$? = $ac_status" >&5
13245   (exit "$ac_status"); } &&
13246          { ac_try='test -s "conftest.$ac_objext"'
13247   { (eval echo "$as_me:13247: \"$ac_try\"") >&5
13248   (eval $ac_try) 2>&5
13249   ac_status=$?
13250   echo "$as_me:13250: \$? = $ac_status" >&5
13251   (exit "$ac_status"); }; }; then
13252   :
13253 else
13254   echo "$as_me: failed program was:" >&5
13255 cat "conftest.$ac_ext" >&5
13256 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13257 fi
13258 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13259          fi
13260
13261 echo "${as_me:-configure}:13261: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13262
13263          CFLAGS="$cf_trim_CFLAGS"
13264          CPPFLAGS="$cf_trim_CPPFLAGS"
13265
13266         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13267         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13268
13269 echo "${as_me:-configure}:13269: testing if the second compile does not leave our definition intact error ..." 1>&5
13270
13271          cat >"conftest.$ac_ext" <<_ACEOF
13272 #line 13272 "configure"
13273 #include "confdefs.h"
13274 #include <sys/types.h>
13275 int
13276 main (void)
13277 {
13278
13279 #ifndef _POSIX_C_SOURCE
13280 make an error
13281 #endif
13282   ;
13283   return 0;
13284 }
13285 _ACEOF
13286 rm -f "conftest.$ac_objext"
13287 if { (eval echo "$as_me:13287: \"$ac_compile\"") >&5
13288   (eval $ac_compile) 2>&5
13289   ac_status=$?
13290   echo "$as_me:13290: \$? = $ac_status" >&5
13291   (exit "$ac_status"); } &&
13292          { ac_try='test -s "conftest.$ac_objext"'
13293   { (eval echo "$as_me:13293: \"$ac_try\"") >&5
13294   (eval $ac_try) 2>&5
13295   ac_status=$?
13296   echo "$as_me:13296: \$? = $ac_status" >&5
13297   (exit "$ac_status"); }; }; then
13298   :
13299 else
13300   echo "$as_me: failed program was:" >&5
13301 cat "conftest.$ac_ext" >&5
13302 cf_cv_posix_c_source=no
13303 fi
13304 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13305          CFLAGS="$cf_save_CFLAGS"
13306          CPPFLAGS="$cf_save_CPPFLAGS"
13307
13308 fi
13309 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13310
13311 fi
13312 echo "$as_me:13312: result: $cf_cv_posix_c_source" >&5
13313 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13314
13315 if test "$cf_cv_posix_c_source" != no ; then
13316         CFLAGS="$cf_trim_CFLAGS"
13317         CPPFLAGS="$cf_trim_CPPFLAGS"
13318
13319 cf_fix_cppflags=no
13320 cf_new_cflags=
13321 cf_new_cppflags=
13322 cf_new_extra_cppflags=
13323
13324 for cf_add_cflags in $cf_cv_posix_c_source
13325 do
13326 case "$cf_fix_cppflags" in
13327 (no)
13328         case "$cf_add_cflags" in
13329         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13330                 case "$cf_add_cflags" in
13331                 (-D*)
13332                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13333
13334                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13335                                 && test -z "${cf_tst_cflags}" \
13336                                 && cf_fix_cppflags=yes
13337
13338                         if test "$cf_fix_cppflags" = yes ; then
13339
13340         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13341         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13342
13343                                 continue
13344                         elif test "${cf_tst_cflags}" = "\"'" ; then
13345
13346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13348
13349                                 continue
13350                         fi
13351                         ;;
13352                 esac
13353                 case "$CPPFLAGS" in
13354                 (*$cf_add_cflags)
13355                         ;;
13356                 (*)
13357                         case "$cf_add_cflags" in
13358                         (-D*)
13359                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13360
13361 CPPFLAGS=`echo "$CPPFLAGS" | \
13362         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13363                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13364
13365                                 ;;
13366                         esac
13367
13368         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13369         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13370
13371                         ;;
13372                 esac
13373                 ;;
13374         (*)
13375
13376         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13377         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13378
13379                 ;;
13380         esac
13381         ;;
13382 (yes)
13383
13384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13386
13387         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13388
13389         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13390                 && test -z "${cf_tst_cflags}" \
13391                 && cf_fix_cppflags=no
13392         ;;
13393 esac
13394 done
13395
13396 if test -n "$cf_new_cflags" ; then
13397
13398         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13399         CFLAGS="${CFLAGS}$cf_new_cflags"
13400
13401 fi
13402
13403 if test -n "$cf_new_cppflags" ; then
13404
13405         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13406         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13407
13408 fi
13409
13410 if test -n "$cf_new_extra_cppflags" ; then
13411
13412         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13413         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13414
13415 fi
13416
13417 fi
13418
13419 fi # cf_cv_posix_visible
13420
13421         ;;
13422 esac
13423
13424 if test -n "$cf_xopen_source" ; then
13425
13426 cf_fix_cppflags=no
13427 cf_new_cflags=
13428 cf_new_cppflags=
13429 cf_new_extra_cppflags=
13430
13431 for cf_add_cflags in $cf_xopen_source
13432 do
13433 case "$cf_fix_cppflags" in
13434 (no)
13435         case "$cf_add_cflags" in
13436         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13437                 case "$cf_add_cflags" in
13438                 (-D*)
13439                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13440
13441                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13442                                 && test -z "${cf_tst_cflags}" \
13443                                 && cf_fix_cppflags=yes
13444
13445                         if test "$cf_fix_cppflags" = yes ; then
13446
13447         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13448         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13449
13450                                 continue
13451                         elif test "${cf_tst_cflags}" = "\"'" ; then
13452
13453         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13454         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13455
13456                                 continue
13457                         fi
13458                         ;;
13459                 esac
13460                 case "$CPPFLAGS" in
13461                 (*$cf_add_cflags)
13462                         ;;
13463                 (*)
13464                         case "$cf_add_cflags" in
13465                         (-D*)
13466                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13467
13468 CPPFLAGS=`echo "$CPPFLAGS" | \
13469         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13470                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13471
13472                                 ;;
13473                         esac
13474
13475         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13476         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13477
13478                         ;;
13479                 esac
13480                 ;;
13481         (*)
13482
13483         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13484         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13485
13486                 ;;
13487         esac
13488         ;;
13489 (yes)
13490
13491         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13492         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13493
13494         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13495
13496         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13497                 && test -z "${cf_tst_cflags}" \
13498                 && cf_fix_cppflags=no
13499         ;;
13500 esac
13501 done
13502
13503 if test -n "$cf_new_cflags" ; then
13504         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13505
13506 echo "${as_me:-configure}:13506: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13507
13508         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13509         CFLAGS="${CFLAGS}$cf_new_cflags"
13510
13511 fi
13512
13513 if test -n "$cf_new_cppflags" ; then
13514         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13515
13516 echo "${as_me:-configure}:13516: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13517
13518         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13519         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13520
13521 fi
13522
13523 if test -n "$cf_new_extra_cppflags" ; then
13524         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13525
13526 echo "${as_me:-configure}:13526: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13527
13528         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13529         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13530
13531 fi
13532
13533 fi
13534
13535 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13536         echo "$as_me:13536: checking if _XOPEN_SOURCE really is set" >&5
13537 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13538         cat >"conftest.$ac_ext" <<_ACEOF
13539 #line 13539 "configure"
13540 #include "confdefs.h"
13541 #include <stdlib.h>
13542 int
13543 main (void)
13544 {
13545
13546 #ifndef _XOPEN_SOURCE
13547 make an error
13548 #endif
13549   ;
13550   return 0;
13551 }
13552 _ACEOF
13553 rm -f "conftest.$ac_objext"
13554 if { (eval echo "$as_me:13554: \"$ac_compile\"") >&5
13555   (eval $ac_compile) 2>&5
13556   ac_status=$?
13557   echo "$as_me:13557: \$? = $ac_status" >&5
13558   (exit "$ac_status"); } &&
13559          { ac_try='test -s "conftest.$ac_objext"'
13560   { (eval echo "$as_me:13560: \"$ac_try\"") >&5
13561   (eval $ac_try) 2>&5
13562   ac_status=$?
13563   echo "$as_me:13563: \$? = $ac_status" >&5
13564   (exit "$ac_status"); }; }; then
13565   cf_XOPEN_SOURCE_set=yes
13566 else
13567   echo "$as_me: failed program was:" >&5
13568 cat "conftest.$ac_ext" >&5
13569 cf_XOPEN_SOURCE_set=no
13570 fi
13571 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13572         echo "$as_me:13572: result: $cf_XOPEN_SOURCE_set" >&5
13573 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13574         if test "$cf_XOPEN_SOURCE_set" = yes
13575         then
13576                 cat >"conftest.$ac_ext" <<_ACEOF
13577 #line 13577 "configure"
13578 #include "confdefs.h"
13579 #include <stdlib.h>
13580 int
13581 main (void)
13582 {
13583
13584 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13585 make an error
13586 #endif
13587   ;
13588   return 0;
13589 }
13590 _ACEOF
13591 rm -f "conftest.$ac_objext"
13592 if { (eval echo "$as_me:13592: \"$ac_compile\"") >&5
13593   (eval $ac_compile) 2>&5
13594   ac_status=$?
13595   echo "$as_me:13595: \$? = $ac_status" >&5
13596   (exit "$ac_status"); } &&
13597          { ac_try='test -s "conftest.$ac_objext"'
13598   { (eval echo "$as_me:13598: \"$ac_try\"") >&5
13599   (eval $ac_try) 2>&5
13600   ac_status=$?
13601   echo "$as_me:13601: \$? = $ac_status" >&5
13602   (exit "$ac_status"); }; }; then
13603   cf_XOPEN_SOURCE_set_ok=yes
13604 else
13605   echo "$as_me: failed program was:" >&5
13606 cat "conftest.$ac_ext" >&5
13607 cf_XOPEN_SOURCE_set_ok=no
13608 fi
13609 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13610                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13611                 then
13612                         { echo "$as_me:13612: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13613 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13614                 fi
13615         else
13616
13617 echo "$as_me:13617: checking if we should define _XOPEN_SOURCE" >&5
13618 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13619 if test "${cf_cv_xopen_source+set}" = set; then
13620   echo $ECHO_N "(cached) $ECHO_C" >&6
13621 else
13622
13623         cat >"conftest.$ac_ext" <<_ACEOF
13624 #line 13624 "configure"
13625 #include "confdefs.h"
13626
13627 #include <stdlib.h>
13628 #include <string.h>
13629 #include <sys/types.h>
13630
13631 int
13632 main (void)
13633 {
13634
13635 #ifndef _XOPEN_SOURCE
13636 make an error
13637 #endif
13638   ;
13639   return 0;
13640 }
13641 _ACEOF
13642 rm -f "conftest.$ac_objext"
13643 if { (eval echo "$as_me:13643: \"$ac_compile\"") >&5
13644   (eval $ac_compile) 2>&5
13645   ac_status=$?
13646   echo "$as_me:13646: \$? = $ac_status" >&5
13647   (exit "$ac_status"); } &&
13648          { ac_try='test -s "conftest.$ac_objext"'
13649   { (eval echo "$as_me:13649: \"$ac_try\"") >&5
13650   (eval $ac_try) 2>&5
13651   ac_status=$?
13652   echo "$as_me:13652: \$? = $ac_status" >&5
13653   (exit "$ac_status"); }; }; then
13654   cf_cv_xopen_source=no
13655 else
13656   echo "$as_me: failed program was:" >&5
13657 cat "conftest.$ac_ext" >&5
13658 cf_save="$CPPFLAGS"
13659
13660         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13661         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13662
13663          cat >"conftest.$ac_ext" <<_ACEOF
13664 #line 13664 "configure"
13665 #include "confdefs.h"
13666
13667 #include <stdlib.h>
13668 #include <string.h>
13669 #include <sys/types.h>
13670
13671 int
13672 main (void)
13673 {
13674
13675 #ifdef _XOPEN_SOURCE
13676 make an error
13677 #endif
13678   ;
13679   return 0;
13680 }
13681 _ACEOF
13682 rm -f "conftest.$ac_objext"
13683 if { (eval echo "$as_me:13683: \"$ac_compile\"") >&5
13684   (eval $ac_compile) 2>&5
13685   ac_status=$?
13686   echo "$as_me:13686: \$? = $ac_status" >&5
13687   (exit "$ac_status"); } &&
13688          { ac_try='test -s "conftest.$ac_objext"'
13689   { (eval echo "$as_me:13689: \"$ac_try\"") >&5
13690   (eval $ac_try) 2>&5
13691   ac_status=$?
13692   echo "$as_me:13692: \$? = $ac_status" >&5
13693   (exit "$ac_status"); }; }; then
13694   cf_cv_xopen_source=no
13695 else
13696   echo "$as_me: failed program was:" >&5
13697 cat "conftest.$ac_ext" >&5
13698 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13699 fi
13700 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13701         CPPFLAGS="$cf_save"
13702
13703 fi
13704 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13705
13706 fi
13707 echo "$as_me:13707: result: $cf_cv_xopen_source" >&5
13708 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13709
13710 if test "$cf_cv_xopen_source" != no ; then
13711
13712 CFLAGS=`echo "$CFLAGS" | \
13713         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13714                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13715
13716 CPPFLAGS=`echo "$CPPFLAGS" | \
13717         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13718                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13719
13720         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13721
13722 cf_fix_cppflags=no
13723 cf_new_cflags=
13724 cf_new_cppflags=
13725 cf_new_extra_cppflags=
13726
13727 for cf_add_cflags in $cf_temp_xopen_source
13728 do
13729 case "$cf_fix_cppflags" in
13730 (no)
13731         case "$cf_add_cflags" in
13732         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13733                 case "$cf_add_cflags" in
13734                 (-D*)
13735                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13736
13737                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13738                                 && test -z "${cf_tst_cflags}" \
13739                                 && cf_fix_cppflags=yes
13740
13741                         if test "$cf_fix_cppflags" = yes ; then
13742
13743         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13744         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13745
13746                                 continue
13747                         elif test "${cf_tst_cflags}" = "\"'" ; then
13748
13749         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13750         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13751
13752                                 continue
13753                         fi
13754                         ;;
13755                 esac
13756                 case "$CPPFLAGS" in
13757                 (*$cf_add_cflags)
13758                         ;;
13759                 (*)
13760                         case "$cf_add_cflags" in
13761                         (-D*)
13762                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13763
13764 CPPFLAGS=`echo "$CPPFLAGS" | \
13765         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13766                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13767
13768                                 ;;
13769                         esac
13770
13771         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13772         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13773
13774                         ;;
13775                 esac
13776                 ;;
13777         (*)
13778
13779         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13780         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13781
13782                 ;;
13783         esac
13784         ;;
13785 (yes)
13786
13787         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13788         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13789
13790         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13791
13792         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13793                 && test -z "${cf_tst_cflags}" \
13794                 && cf_fix_cppflags=no
13795         ;;
13796 esac
13797 done
13798
13799 if test -n "$cf_new_cflags" ; then
13800
13801         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13802         CFLAGS="${CFLAGS}$cf_new_cflags"
13803
13804 fi
13805
13806 if test -n "$cf_new_cppflags" ; then
13807
13808         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13809         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13810
13811 fi
13812
13813 if test -n "$cf_new_extra_cppflags" ; then
13814
13815         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13816         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13817
13818 fi
13819
13820 fi
13821
13822         fi
13823 fi
13824 fi # cf_cv_posix_visible
13825
13826 # Check whether --enable-largefile or --disable-largefile was given.
13827 if test "${enable_largefile+set}" = set; then
13828   enableval="$enable_largefile"
13829
13830 fi;
13831 if test "$enable_largefile" != no; then
13832
13833   echo "$as_me:13833: checking for special C compiler options needed for large files" >&5
13834 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13835 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13836   echo $ECHO_N "(cached) $ECHO_C" >&6
13837 else
13838   ac_cv_sys_largefile_CC=no
13839      if test "$GCC" != yes; then
13840        ac_save_CC=$CC
13841        while :; do
13842          # IRIX 6.2 and later do not support large files by default,
13843          # so use the C compiler's -n32 option if that helps.
13844          cat >"conftest.$ac_ext" <<_ACEOF
13845 #line 13845 "configure"
13846 #include "confdefs.h"
13847 #include <sys/types.h>
13848  /* Check that off_t can represent 2**63 - 1 correctly.
13849     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13850     since some C++ compilers masquerading as C compilers
13851     incorrectly reject 9223372036854775807.  */
13852 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13853   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13854                        && LARGE_OFF_T % 2147483647 == 1)
13855                       ? 1 : -1];
13856 int
13857 main (void)
13858 {
13859
13860   ;
13861   return 0;
13862 }
13863 _ACEOF
13864          rm -f "conftest.$ac_objext"
13865 if { (eval echo "$as_me:13865: \"$ac_compile\"") >&5
13866   (eval $ac_compile) 2>&5
13867   ac_status=$?
13868   echo "$as_me:13868: \$? = $ac_status" >&5
13869   (exit "$ac_status"); } &&
13870          { ac_try='test -s "conftest.$ac_objext"'
13871   { (eval echo "$as_me:13871: \"$ac_try\"") >&5
13872   (eval $ac_try) 2>&5
13873   ac_status=$?
13874   echo "$as_me:13874: \$? = $ac_status" >&5
13875   (exit "$ac_status"); }; }; then
13876   break
13877 else
13878   echo "$as_me: failed program was:" >&5
13879 cat "conftest.$ac_ext" >&5
13880 fi
13881 rm -f "conftest.$ac_objext"
13882          CC="$CC -n32"
13883          rm -f "conftest.$ac_objext"
13884 if { (eval echo "$as_me:13884: \"$ac_compile\"") >&5
13885   (eval $ac_compile) 2>&5
13886   ac_status=$?
13887   echo "$as_me:13887: \$? = $ac_status" >&5
13888   (exit "$ac_status"); } &&
13889          { ac_try='test -s "conftest.$ac_objext"'
13890   { (eval echo "$as_me:13890: \"$ac_try\"") >&5
13891   (eval $ac_try) 2>&5
13892   ac_status=$?
13893   echo "$as_me:13893: \$? = $ac_status" >&5
13894   (exit "$ac_status"); }; }; then
13895   ac_cv_sys_largefile_CC=' -n32'; break
13896 else
13897   echo "$as_me: failed program was:" >&5
13898 cat "conftest.$ac_ext" >&5
13899 fi
13900 rm -f "conftest.$ac_objext"
13901          break
13902        done
13903        CC=$ac_save_CC
13904        rm -f "conftest.$ac_ext"
13905     fi
13906 fi
13907 echo "$as_me:13907: result: $ac_cv_sys_largefile_CC" >&5
13908 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13909   if test "$ac_cv_sys_largefile_CC" != no; then
13910     CC=$CC$ac_cv_sys_largefile_CC
13911   fi
13912
13913   echo "$as_me:13913: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13914 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13915 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13916   echo $ECHO_N "(cached) $ECHO_C" >&6
13917 else
13918   while :; do
13919   ac_cv_sys_file_offset_bits=no
13920   cat >"conftest.$ac_ext" <<_ACEOF
13921 #line 13921 "configure"
13922 #include "confdefs.h"
13923 #include <sys/types.h>
13924  /* Check that off_t can represent 2**63 - 1 correctly.
13925     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13926     since some C++ compilers masquerading as C compilers
13927     incorrectly reject 9223372036854775807.  */
13928 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13929   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13930                        && LARGE_OFF_T % 2147483647 == 1)
13931                       ? 1 : -1];
13932 int
13933 main (void)
13934 {
13935
13936   ;
13937   return 0;
13938 }
13939 _ACEOF
13940 rm -f "conftest.$ac_objext"
13941 if { (eval echo "$as_me:13941: \"$ac_compile\"") >&5
13942   (eval $ac_compile) 2>&5
13943   ac_status=$?
13944   echo "$as_me:13944: \$? = $ac_status" >&5
13945   (exit "$ac_status"); } &&
13946          { ac_try='test -s "conftest.$ac_objext"'
13947   { (eval echo "$as_me:13947: \"$ac_try\"") >&5
13948   (eval $ac_try) 2>&5
13949   ac_status=$?
13950   echo "$as_me:13950: \$? = $ac_status" >&5
13951   (exit "$ac_status"); }; }; then
13952   break
13953 else
13954   echo "$as_me: failed program was:" >&5
13955 cat "conftest.$ac_ext" >&5
13956 fi
13957 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13958   cat >"conftest.$ac_ext" <<_ACEOF
13959 #line 13959 "configure"
13960 #include "confdefs.h"
13961 #define _FILE_OFFSET_BITS 64
13962 #include <sys/types.h>
13963  /* Check that off_t can represent 2**63 - 1 correctly.
13964     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13965     since some C++ compilers masquerading as C compilers
13966     incorrectly reject 9223372036854775807.  */
13967 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13968   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13969                        && LARGE_OFF_T % 2147483647 == 1)
13970                       ? 1 : -1];
13971 int
13972 main (void)
13973 {
13974
13975   ;
13976   return 0;
13977 }
13978 _ACEOF
13979 rm -f "conftest.$ac_objext"
13980 if { (eval echo "$as_me:13980: \"$ac_compile\"") >&5
13981   (eval $ac_compile) 2>&5
13982   ac_status=$?
13983   echo "$as_me:13983: \$? = $ac_status" >&5
13984   (exit "$ac_status"); } &&
13985          { ac_try='test -s "conftest.$ac_objext"'
13986   { (eval echo "$as_me:13986: \"$ac_try\"") >&5
13987   (eval $ac_try) 2>&5
13988   ac_status=$?
13989   echo "$as_me:13989: \$? = $ac_status" >&5
13990   (exit "$ac_status"); }; }; then
13991   ac_cv_sys_file_offset_bits=64; break
13992 else
13993   echo "$as_me: failed program was:" >&5
13994 cat "conftest.$ac_ext" >&5
13995 fi
13996 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13997   break
13998 done
13999 fi
14000 echo "$as_me:14000: result: $ac_cv_sys_file_offset_bits" >&5
14001 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14002 if test "$ac_cv_sys_file_offset_bits" != no; then
14003
14004 cat >>confdefs.h <<EOF
14005 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14006 EOF
14007
14008 fi
14009 rm -rf conftest*
14010   echo "$as_me:14010: checking for _LARGE_FILES value needed for large files" >&5
14011 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14012 if test "${ac_cv_sys_large_files+set}" = set; then
14013   echo $ECHO_N "(cached) $ECHO_C" >&6
14014 else
14015   while :; do
14016   ac_cv_sys_large_files=no
14017   cat >"conftest.$ac_ext" <<_ACEOF
14018 #line 14018 "configure"
14019 #include "confdefs.h"
14020 #include <sys/types.h>
14021  /* Check that off_t can represent 2**63 - 1 correctly.
14022     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14023     since some C++ compilers masquerading as C compilers
14024     incorrectly reject 9223372036854775807.  */
14025 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14026   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14027                        && LARGE_OFF_T % 2147483647 == 1)
14028                       ? 1 : -1];
14029 int
14030 main (void)
14031 {
14032
14033   ;
14034   return 0;
14035 }
14036 _ACEOF
14037 rm -f "conftest.$ac_objext"
14038 if { (eval echo "$as_me:14038: \"$ac_compile\"") >&5
14039   (eval $ac_compile) 2>&5
14040   ac_status=$?
14041   echo "$as_me:14041: \$? = $ac_status" >&5
14042   (exit "$ac_status"); } &&
14043          { ac_try='test -s "conftest.$ac_objext"'
14044   { (eval echo "$as_me:14044: \"$ac_try\"") >&5
14045   (eval $ac_try) 2>&5
14046   ac_status=$?
14047   echo "$as_me:14047: \$? = $ac_status" >&5
14048   (exit "$ac_status"); }; }; then
14049   break
14050 else
14051   echo "$as_me: failed program was:" >&5
14052 cat "conftest.$ac_ext" >&5
14053 fi
14054 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14055   cat >"conftest.$ac_ext" <<_ACEOF
14056 #line 14056 "configure"
14057 #include "confdefs.h"
14058 #define _LARGE_FILES 1
14059 #include <sys/types.h>
14060  /* Check that off_t can represent 2**63 - 1 correctly.
14061     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14062     since some C++ compilers masquerading as C compilers
14063     incorrectly reject 9223372036854775807.  */
14064 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14065   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14066                        && LARGE_OFF_T % 2147483647 == 1)
14067                       ? 1 : -1];
14068 int
14069 main (void)
14070 {
14071
14072   ;
14073   return 0;
14074 }
14075 _ACEOF
14076 rm -f "conftest.$ac_objext"
14077 if { (eval echo "$as_me:14077: \"$ac_compile\"") >&5
14078   (eval $ac_compile) 2>&5
14079   ac_status=$?
14080   echo "$as_me:14080: \$? = $ac_status" >&5
14081   (exit "$ac_status"); } &&
14082          { ac_try='test -s "conftest.$ac_objext"'
14083   { (eval echo "$as_me:14083: \"$ac_try\"") >&5
14084   (eval $ac_try) 2>&5
14085   ac_status=$?
14086   echo "$as_me:14086: \$? = $ac_status" >&5
14087   (exit "$ac_status"); }; }; then
14088   ac_cv_sys_large_files=1; break
14089 else
14090   echo "$as_me: failed program was:" >&5
14091 cat "conftest.$ac_ext" >&5
14092 fi
14093 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14094   break
14095 done
14096 fi
14097 echo "$as_me:14097: result: $ac_cv_sys_large_files" >&5
14098 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14099 if test "$ac_cv_sys_large_files" != no; then
14100
14101 cat >>confdefs.h <<EOF
14102 #define _LARGE_FILES $ac_cv_sys_large_files
14103 EOF
14104
14105 fi
14106 rm -rf conftest*
14107 fi
14108
14109         if test "$enable_largefile" != no ; then
14110         echo "$as_me:14110: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14111 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14112 if test "${ac_cv_sys_largefile_source+set}" = set; then
14113   echo $ECHO_N "(cached) $ECHO_C" >&6
14114 else
14115   while :; do
14116   ac_cv_sys_largefile_source=no
14117   cat >"conftest.$ac_ext" <<_ACEOF
14118 #line 14118 "configure"
14119 #include "confdefs.h"
14120 #include <stdio.h>
14121 int
14122 main (void)
14123 {
14124 return !fseeko;
14125   ;
14126   return 0;
14127 }
14128 _ACEOF
14129 rm -f "conftest.$ac_objext"
14130 if { (eval echo "$as_me:14130: \"$ac_compile\"") >&5
14131   (eval $ac_compile) 2>&5
14132   ac_status=$?
14133   echo "$as_me:14133: \$? = $ac_status" >&5
14134   (exit "$ac_status"); } &&
14135          { ac_try='test -s "conftest.$ac_objext"'
14136   { (eval echo "$as_me:14136: \"$ac_try\"") >&5
14137   (eval $ac_try) 2>&5
14138   ac_status=$?
14139   echo "$as_me:14139: \$? = $ac_status" >&5
14140   (exit "$ac_status"); }; }; then
14141   break
14142 else
14143   echo "$as_me: failed program was:" >&5
14144 cat "conftest.$ac_ext" >&5
14145 fi
14146 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14147   cat >"conftest.$ac_ext" <<_ACEOF
14148 #line 14148 "configure"
14149 #include "confdefs.h"
14150 #define _LARGEFILE_SOURCE 1
14151 #include <stdio.h>
14152 int
14153 main (void)
14154 {
14155 return !fseeko;
14156   ;
14157   return 0;
14158 }
14159 _ACEOF
14160 rm -f "conftest.$ac_objext"
14161 if { (eval echo "$as_me:14161: \"$ac_compile\"") >&5
14162   (eval $ac_compile) 2>&5
14163   ac_status=$?
14164   echo "$as_me:14164: \$? = $ac_status" >&5
14165   (exit "$ac_status"); } &&
14166          { ac_try='test -s "conftest.$ac_objext"'
14167   { (eval echo "$as_me:14167: \"$ac_try\"") >&5
14168   (eval $ac_try) 2>&5
14169   ac_status=$?
14170   echo "$as_me:14170: \$? = $ac_status" >&5
14171   (exit "$ac_status"); }; }; then
14172   ac_cv_sys_largefile_source=1; break
14173 else
14174   echo "$as_me: failed program was:" >&5
14175 cat "conftest.$ac_ext" >&5
14176 fi
14177 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14178   break
14179 done
14180 fi
14181 echo "$as_me:14181: result: $ac_cv_sys_largefile_source" >&5
14182 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14183 if test "$ac_cv_sys_largefile_source" != no; then
14184
14185 cat >>confdefs.h <<EOF
14186 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14187 EOF
14188
14189 fi
14190 rm -rf conftest*
14191
14192 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14193 # in glibc 2.1.3, but that breaks too many other things.
14194 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14195 echo "$as_me:14195: checking for fseeko" >&5
14196 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14197 if test "${ac_cv_func_fseeko+set}" = set; then
14198   echo $ECHO_N "(cached) $ECHO_C" >&6
14199 else
14200   cat >"conftest.$ac_ext" <<_ACEOF
14201 #line 14201 "configure"
14202 #include "confdefs.h"
14203 #include <stdio.h>
14204 int
14205 main (void)
14206 {
14207 return fseeko && fseeko (stdin, 0, 0);
14208   ;
14209   return 0;
14210 }
14211 _ACEOF
14212 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14213 if { (eval echo "$as_me:14213: \"$ac_link\"") >&5
14214   (eval $ac_link) 2>&5
14215   ac_status=$?
14216   echo "$as_me:14216: \$? = $ac_status" >&5
14217   (exit "$ac_status"); } &&
14218          { ac_try='test -s "conftest$ac_exeext"'
14219   { (eval echo "$as_me:14219: \"$ac_try\"") >&5
14220   (eval $ac_try) 2>&5
14221   ac_status=$?
14222   echo "$as_me:14222: \$? = $ac_status" >&5
14223   (exit "$ac_status"); }; }; then
14224   ac_cv_func_fseeko=yes
14225 else
14226   echo "$as_me: failed program was:" >&5
14227 cat "conftest.$ac_ext" >&5
14228 ac_cv_func_fseeko=no
14229 fi
14230 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14231 fi
14232 echo "$as_me:14232: result: $ac_cv_func_fseeko" >&5
14233 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14234 if test $ac_cv_func_fseeko = yes; then
14235
14236 cat >>confdefs.h <<\EOF
14237 #define HAVE_FSEEKO 1
14238 EOF
14239
14240 fi
14241
14242         # Normally we would collect these definitions in the config.h,
14243         # but (like _XOPEN_SOURCE), some environments rely on having these
14244         # defined before any of the system headers are included.  Another
14245         # case comes up with C++, e.g., on AIX the compiler compiles the
14246         # header files by themselves before looking at the body files it is
14247         # told to compile.  For ncurses, those header files do not include
14248         # the config.h
14249         if test "$ac_cv_sys_large_files" != no
14250         then
14251
14252         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14253         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14254
14255         fi
14256         if test "$ac_cv_sys_largefile_source" != no
14257         then
14258
14259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14260         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14261
14262         fi
14263         if test "$ac_cv_sys_file_offset_bits" != no
14264         then
14265
14266         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14267         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14268
14269         fi
14270
14271         echo "$as_me:14271: checking whether to use struct dirent64" >&5
14272 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14273 if test "${cf_cv_struct_dirent64+set}" = set; then
14274   echo $ECHO_N "(cached) $ECHO_C" >&6
14275 else
14276
14277                 cat >"conftest.$ac_ext" <<_ACEOF
14278 #line 14278 "configure"
14279 #include "confdefs.h"
14280
14281 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14282 #include <sys/types.h>
14283 #include <dirent.h>
14284
14285 int
14286 main (void)
14287 {
14288
14289                 /* if transitional largefile support is setup, this is true */
14290                 extern struct dirent64 * readdir(DIR *);
14291                 struct dirent64 *x = readdir((DIR *)0);
14292                 struct dirent *y = readdir((DIR *)0);
14293                 int z = x - y;
14294                 (void)z;
14295
14296   ;
14297   return 0;
14298 }
14299 _ACEOF
14300 rm -f "conftest.$ac_objext"
14301 if { (eval echo "$as_me:14301: \"$ac_compile\"") >&5
14302   (eval $ac_compile) 2>&5
14303   ac_status=$?
14304   echo "$as_me:14304: \$? = $ac_status" >&5
14305   (exit "$ac_status"); } &&
14306          { ac_try='test -s "conftest.$ac_objext"'
14307   { (eval echo "$as_me:14307: \"$ac_try\"") >&5
14308   (eval $ac_try) 2>&5
14309   ac_status=$?
14310   echo "$as_me:14310: \$? = $ac_status" >&5
14311   (exit "$ac_status"); }; }; then
14312   cf_cv_struct_dirent64=yes
14313 else
14314   echo "$as_me: failed program was:" >&5
14315 cat "conftest.$ac_ext" >&5
14316 cf_cv_struct_dirent64=no
14317 fi
14318 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14319
14320 fi
14321 echo "$as_me:14321: result: $cf_cv_struct_dirent64" >&5
14322 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14323         test "$cf_cv_struct_dirent64" = yes &&
14324 cat >>confdefs.h <<\EOF
14325 #define HAVE_STRUCT_DIRENT64 1
14326 EOF
14327
14328         fi
14329
14330 ### Enable compiling-in rcs id's
14331 echo "$as_me:14331: checking if RCS identifiers should be compiled-in" >&5
14332 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14333
14334 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14335 if test "${with_rcs_ids+set}" = set; then
14336   withval="$with_rcs_ids"
14337   with_rcs_ids=$withval
14338 else
14339   with_rcs_ids=no
14340 fi;
14341 echo "$as_me:14341: result: $with_rcs_ids" >&5
14342 echo "${ECHO_T}$with_rcs_ids" >&6
14343 test "$with_rcs_ids" = yes &&
14344 cat >>confdefs.h <<\EOF
14345 #define USE_RCS_IDS 1
14346 EOF
14347
14348 ###############################################################################
14349
14350 ### Note that some functions (such as const) are normally disabled anyway.
14351 echo "$as_me:14351: checking if you want to build with function extensions" >&5
14352 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14353
14354 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14355 if test "${enable_ext_funcs+set}" = set; then
14356   enableval="$enable_ext_funcs"
14357   with_ext_funcs=$enableval
14358 else
14359   with_ext_funcs=yes
14360 fi;
14361 echo "$as_me:14361: result: $with_ext_funcs" >&5
14362 echo "${ECHO_T}$with_ext_funcs" >&6
14363 if test "$with_ext_funcs" = yes ; then
14364         NCURSES_EXT_FUNCS=1
14365
14366 cat >>confdefs.h <<\EOF
14367 #define HAVE_USE_DEFAULT_COLORS 1
14368 EOF
14369
14370 cat >>confdefs.h <<\EOF
14371 #define NCURSES_EXT_FUNCS 1
14372 EOF
14373
14374 else
14375         NCURSES_EXT_FUNCS=0
14376 fi
14377
14378 ###   use option --enable-const to turn on use of const beyond that in XSI.
14379 echo "$as_me:14379: checking for extended use of const keyword" >&5
14380 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14381
14382 # Check whether --enable-const or --disable-const was given.
14383 if test "${enable_const+set}" = set; then
14384   enableval="$enable_const"
14385   with_ext_const=$enableval
14386 else
14387   with_ext_const=no
14388 fi;
14389 echo "$as_me:14389: result: $with_ext_const" >&5
14390 echo "${ECHO_T}$with_ext_const" >&6
14391 NCURSES_CONST='/*nothing*/'
14392 if test "$with_ext_const" = yes ; then
14393         NCURSES_CONST=const
14394 fi
14395
14396 ###############################################################################
14397 # These options are relatively safe to experiment with.
14398
14399 echo "$as_me:14399: checking if you want all development code" >&5
14400 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14401
14402 # Check whether --with-develop or --without-develop was given.
14403 if test "${with_develop+set}" = set; then
14404   withval="$with_develop"
14405   with_develop=$withval
14406 else
14407   with_develop=no
14408 fi;
14409 echo "$as_me:14409: result: $with_develop" >&5
14410 echo "${ECHO_T}$with_develop" >&6
14411
14412 ###############################################################################
14413 # These are just experimental, probably should not be in a package:
14414
14415 # This is still experimental (20080329), but should ultimately be moved to
14416 # the script-block --with-normal, etc.
14417
14418 echo "$as_me:14418: checking if you want to link with the pthread library" >&5
14419 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14420
14421 # Check whether --with-pthread or --without-pthread was given.
14422 if test "${with_pthread+set}" = set; then
14423   withval="$with_pthread"
14424   with_pthread=$withval
14425 else
14426   with_pthread=no
14427 fi;
14428 echo "$as_me:14428: result: $with_pthread" >&5
14429 echo "${ECHO_T}$with_pthread" >&6
14430
14431 if test "$with_pthread" != no ; then
14432         echo "$as_me:14432: checking for pthread.h" >&5
14433 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14434 if test "${ac_cv_header_pthread_h+set}" = set; then
14435   echo $ECHO_N "(cached) $ECHO_C" >&6
14436 else
14437   cat >"conftest.$ac_ext" <<_ACEOF
14438 #line 14438 "configure"
14439 #include "confdefs.h"
14440 #include <pthread.h>
14441 _ACEOF
14442 if { (eval echo "$as_me:14442: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14443   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14444   ac_status=$?
14445   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14446   rm -f conftest.er1
14447   cat conftest.err >&5
14448   echo "$as_me:14448: \$? = $ac_status" >&5
14449   (exit "$ac_status"); } >/dev/null; then
14450   if test -s conftest.err; then
14451     ac_cpp_err=$ac_c_preproc_warn_flag
14452   else
14453     ac_cpp_err=
14454   fi
14455 else
14456   ac_cpp_err=yes
14457 fi
14458 if test -z "$ac_cpp_err"; then
14459   ac_cv_header_pthread_h=yes
14460 else
14461   echo "$as_me: failed program was:" >&5
14462   cat "conftest.$ac_ext" >&5
14463   ac_cv_header_pthread_h=no
14464 fi
14465 rm -f conftest.err "conftest.$ac_ext"
14466 fi
14467 echo "$as_me:14467: result: $ac_cv_header_pthread_h" >&5
14468 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14469 if test "$ac_cv_header_pthread_h" = yes; then
14470
14471 cat >>confdefs.h <<\EOF
14472 #define HAVE_PTHREADS_H 1
14473 EOF
14474
14475         for cf_lib_pthread in pthread c_r
14476         do
14477             echo "$as_me:14477: checking if we can link with the $cf_lib_pthread library" >&5
14478 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14479             cf_save_LIBS="$LIBS"
14480
14481 cf_add_libs="$LIBS"
14482 # reverse order
14483 cf_add_0lib=
14484 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14485 # filter duplicates
14486 for cf_add_1lib in $cf_add_0lib; do
14487         for cf_add_2lib in $cf_add_libs; do
14488                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14489                         cf_add_1lib=
14490                         break
14491                 fi
14492         done
14493         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14494 done
14495 LIBS="$cf_add_libs"
14496
14497             cat >"conftest.$ac_ext" <<_ACEOF
14498 #line 14498 "configure"
14499 #include "confdefs.h"
14500
14501 #include <pthread.h>
14502
14503 int
14504 main (void)
14505 {
14506
14507                 int rc = pthread_create(0,0,0,0);
14508                 int r2 = pthread_mutexattr_settype(0, 0);
14509
14510   ;
14511   return 0;
14512 }
14513 _ACEOF
14514 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14515 if { (eval echo "$as_me:14515: \"$ac_link\"") >&5
14516   (eval $ac_link) 2>&5
14517   ac_status=$?
14518   echo "$as_me:14518: \$? = $ac_status" >&5
14519   (exit "$ac_status"); } &&
14520          { ac_try='test -s "conftest$ac_exeext"'
14521   { (eval echo "$as_me:14521: \"$ac_try\"") >&5
14522   (eval $ac_try) 2>&5
14523   ac_status=$?
14524   echo "$as_me:14524: \$? = $ac_status" >&5
14525   (exit "$ac_status"); }; }; then
14526   with_pthread=yes
14527 else
14528   echo "$as_me: failed program was:" >&5
14529 cat "conftest.$ac_ext" >&5
14530 with_pthread=no
14531 fi
14532 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14533             LIBS="$cf_save_LIBS"
14534             echo "$as_me:14534: result: $with_pthread" >&5
14535 echo "${ECHO_T}$with_pthread" >&6
14536             test "$with_pthread" = yes && break
14537         done
14538
14539         if test "$with_pthread" = yes ; then
14540
14541 cf_add_libs="$LIBS"
14542 # reverse order
14543 cf_add_0lib=
14544 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14545 # filter duplicates
14546 for cf_add_1lib in $cf_add_0lib; do
14547         for cf_add_2lib in $cf_add_libs; do
14548                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14549                         cf_add_1lib=
14550                         break
14551                 fi
14552         done
14553         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14554 done
14555 LIBS="$cf_add_libs"
14556
14557 cat >>confdefs.h <<\EOF
14558 #define HAVE_LIBPTHREADS 1
14559 EOF
14560
14561         else
14562             { { echo "$as_me:14562: error: Cannot link with pthread library" >&5
14563 echo "$as_me: error: Cannot link with pthread library" >&2;}
14564    { (exit 1); exit 1; }; }
14565         fi
14566
14567 fi
14568
14569 fi
14570
14571 echo "$as_me:14571: checking if you want to use weak-symbols for pthreads" >&5
14572 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14573
14574 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14575 if test "${enable_weak_symbols+set}" = set; then
14576   enableval="$enable_weak_symbols"
14577   use_weak_symbols=$withval
14578 else
14579   use_weak_symbols=no
14580 fi;
14581 echo "$as_me:14581: result: $use_weak_symbols" >&5
14582 echo "${ECHO_T}$use_weak_symbols" >&6
14583 if test "$use_weak_symbols" = yes ; then
14584
14585 echo "$as_me:14585: checking if $CC supports weak symbols" >&5
14586 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14587 if test "${cf_cv_weak_symbols+set}" = set; then
14588   echo $ECHO_N "(cached) $ECHO_C" >&6
14589 else
14590
14591 cat >"conftest.$ac_ext" <<_ACEOF
14592 #line 14592 "configure"
14593 #include "confdefs.h"
14594
14595 #include <stdio.h>
14596 int
14597 main (void)
14598 {
14599
14600 #if defined(__GNUC__)
14601 #  if defined __USE_ISOC99
14602 #    define _cat_pragma(exp)    _Pragma(#exp)
14603 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14604 #  else
14605 #    define _weak_pragma(exp)
14606 #  endif
14607 #  define _declare(name)        __extension__ extern __typeof__(name) name
14608 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14609 #endif
14610
14611 weak_symbol(fopen);
14612
14613   ;
14614   return 0;
14615 }
14616 _ACEOF
14617 rm -f "conftest.$ac_objext"
14618 if { (eval echo "$as_me:14618: \"$ac_compile\"") >&5
14619   (eval $ac_compile) 2>&5
14620   ac_status=$?
14621   echo "$as_me:14621: \$? = $ac_status" >&5
14622   (exit "$ac_status"); } &&
14623          { ac_try='test -s "conftest.$ac_objext"'
14624   { (eval echo "$as_me:14624: \"$ac_try\"") >&5
14625   (eval $ac_try) 2>&5
14626   ac_status=$?
14627   echo "$as_me:14627: \$? = $ac_status" >&5
14628   (exit "$ac_status"); }; }; then
14629   cf_cv_weak_symbols=yes
14630 else
14631   echo "$as_me: failed program was:" >&5
14632 cat "conftest.$ac_ext" >&5
14633 cf_cv_weak_symbols=no
14634 fi
14635 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14636
14637 fi
14638 echo "$as_me:14638: result: $cf_cv_weak_symbols" >&5
14639 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14640
14641 else
14642         cf_cv_weak_symbols=no
14643 fi
14644
14645 if test $cf_cv_weak_symbols = yes ; then
14646
14647 cat >>confdefs.h <<\EOF
14648 #define USE_WEAK_SYMBOLS 1
14649 EOF
14650
14651 fi
14652
14653 PTHREAD=
14654 if test "$with_pthread" = "yes" ; then
14655
14656 cat >>confdefs.h <<\EOF
14657 #define USE_PTHREADS 1
14658 EOF
14659
14660         enable_reentrant=yes
14661         if test $cf_cv_weak_symbols = yes ; then
14662                 PTHREAD=-lpthread
14663         fi
14664 fi
14665
14666 # OpenSUSE is installing ncurses6, using reentrant option.
14667 echo "$as_me:14667: checking for _nc_TABSIZE" >&5
14668 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14669 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14670   echo $ECHO_N "(cached) $ECHO_C" >&6
14671 else
14672   cat >"conftest.$ac_ext" <<_ACEOF
14673 #line 14673 "configure"
14674 #include "confdefs.h"
14675 #define _nc_TABSIZE autoconf_temporary
14676 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14677 #undef _nc_TABSIZE
14678
14679 #ifdef __cplusplus
14680 extern "C"
14681 #endif
14682
14683 /* We use char because int might match the return type of a gcc2
14684    builtin and then its argument prototype would still apply.  */
14685 char _nc_TABSIZE (void);
14686
14687 int
14688 main (void)
14689 {
14690
14691 /* The GNU C library defines stubs for functions which it implements
14692     to always fail with ENOSYS.  Some functions are actually named
14693     something starting with __ and the normal name is an alias.  */
14694 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14695 #error found stub for _nc_TABSIZE
14696 #endif
14697
14698         return _nc_TABSIZE ();
14699   ;
14700   return 0;
14701 }
14702 _ACEOF
14703 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14704 if { (eval echo "$as_me:14704: \"$ac_link\"") >&5
14705   (eval $ac_link) 2>&5
14706   ac_status=$?
14707   echo "$as_me:14707: \$? = $ac_status" >&5
14708   (exit "$ac_status"); } &&
14709          { ac_try='test -s "conftest$ac_exeext"'
14710   { (eval echo "$as_me:14710: \"$ac_try\"") >&5
14711   (eval $ac_try) 2>&5
14712   ac_status=$?
14713   echo "$as_me:14713: \$? = $ac_status" >&5
14714   (exit "$ac_status"); }; }; then
14715   ac_cv_func__nc_TABSIZE=yes
14716 else
14717   echo "$as_me: failed program was:" >&5
14718 cat "conftest.$ac_ext" >&5
14719 ac_cv_func__nc_TABSIZE=no
14720 fi
14721 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14722 fi
14723 echo "$as_me:14723: result: $ac_cv_func__nc_TABSIZE" >&5
14724 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14725 if test "$ac_cv_func__nc_TABSIZE" = yes; then
14726   assume_reentrant=yes
14727 else
14728   assume_reentrant=no
14729 fi
14730
14731 # Reentrant code has to be opaque; there's little advantage to making ncurses
14732 # opaque outside of that, so there is no --enable-opaque option.  We can use
14733 # this option without --with-pthreads, but this will be always set for
14734 # pthreads.
14735 echo "$as_me:14735: checking if you want experimental reentrant code" >&5
14736 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14737
14738 # Check whether --enable-reentrant or --disable-reentrant was given.
14739 if test "${enable_reentrant+set}" = set; then
14740   enableval="$enable_reentrant"
14741   with_reentrant=$enableval
14742 else
14743   with_reentrant=$assume_reentrant
14744 fi;
14745 echo "$as_me:14745: result: $with_reentrant" >&5
14746 echo "${ECHO_T}$with_reentrant" >&6
14747 if test "$with_reentrant" = yes ; then
14748         cf_cv_enable_reentrant=1
14749         if test $cf_cv_weak_symbols = yes ; then
14750
14751 # remove pthread library from $LIBS
14752 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14753
14754         elif test "$assume_reentrant" = no ; then
14755                 LIB_SUFFIX="t${LIB_SUFFIX}"
14756         fi
14757
14758 cat >>confdefs.h <<\EOF
14759 #define USE_REENTRANT 1
14760 EOF
14761
14762 else
14763         cf_cv_enable_reentrant=0
14764 fi
14765
14766 ### Allow using a different wrap-prefix
14767 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14768         echo "$as_me:14768: checking for prefix used to wrap public variables" >&5
14769 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14770
14771 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14772 if test "${with_wrap_prefix+set}" = set; then
14773   withval="$with_wrap_prefix"
14774   NCURSES_WRAP_PREFIX=$withval
14775 else
14776   NCURSES_WRAP_PREFIX=_nc_
14777 fi;
14778         echo "$as_me:14778: result: $NCURSES_WRAP_PREFIX" >&5
14779 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14780 else
14781         NCURSES_WRAP_PREFIX=_nc_
14782 fi
14783
14784 cat >>confdefs.h <<EOF
14785 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14786 EOF
14787
14788 ###############################################################################
14789
14790 ###     use option --disable-echo to suppress full display compiling commands
14791
14792 echo "$as_me:14792: checking if you want to see long compiling messages" >&5
14793 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14794
14795 # Check whether --enable-echo or --disable-echo was given.
14796 if test "${enable_echo+set}" = set; then
14797   enableval="$enable_echo"
14798   test "$enableval" != no && enableval=yes
14799         if test "$enableval" != "yes" ; then
14800
14801         ECHO_LT='--silent'
14802         ECHO_LD='@echo linking $@;'
14803         RULE_CC='@echo compiling $<'
14804         SHOW_CC='@echo compiling $@'
14805         ECHO_CC='@'
14806
14807         else
14808
14809         ECHO_LT=''
14810         ECHO_LD=''
14811         RULE_CC=''
14812         SHOW_CC=''
14813         ECHO_CC=''
14814
14815         fi
14816 else
14817   enableval=yes
14818
14819         ECHO_LT=''
14820         ECHO_LD=''
14821         RULE_CC=''
14822         SHOW_CC=''
14823         ECHO_CC=''
14824
14825 fi;
14826 echo "$as_me:14826: result: $enableval" >&5
14827 echo "${ECHO_T}$enableval" >&6
14828
14829 echo "$as_me:14829: checking if you want to use C11 _Noreturn feature" >&5
14830 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
14831
14832 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
14833 if test "${enable_stdnoreturn+set}" = set; then
14834   enableval="$enable_stdnoreturn"
14835   test "$enableval" != yes && enableval=no
14836         if test "$enableval" != "no" ; then
14837     enable_stdnoreturn=yes
14838         else
14839                 enable_stdnoreturn=no
14840         fi
14841 else
14842   enableval=no
14843         enable_stdnoreturn=no
14844
14845 fi;
14846 echo "$as_me:14846: result: $enable_stdnoreturn" >&5
14847 echo "${ECHO_T}$enable_stdnoreturn" >&6
14848
14849 if test $enable_stdnoreturn = yes; then
14850 echo "$as_me:14850: checking for C11 _Noreturn feature" >&5
14851 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
14852 if test "${cf_cv_c11_noreturn+set}" = set; then
14853   echo $ECHO_N "(cached) $ECHO_C" >&6
14854 else
14855   cat >"conftest.$ac_ext" <<_ACEOF
14856 #line 14856 "configure"
14857 #include "confdefs.h"
14858
14859 #include <stdio.h>
14860 #include <stdlib.h>
14861 #include <stdnoreturn.h>
14862 static _Noreturn void giveup(void) { exit(0); }
14863
14864 int
14865 main (void)
14866 {
14867 if (feof(stdin)) giveup()
14868   ;
14869   return 0;
14870 }
14871 _ACEOF
14872 rm -f "conftest.$ac_objext"
14873 if { (eval echo "$as_me:14873: \"$ac_compile\"") >&5
14874   (eval $ac_compile) 2>&5
14875   ac_status=$?
14876   echo "$as_me:14876: \$? = $ac_status" >&5
14877   (exit "$ac_status"); } &&
14878          { ac_try='test -s "conftest.$ac_objext"'
14879   { (eval echo "$as_me:14879: \"$ac_try\"") >&5
14880   (eval $ac_try) 2>&5
14881   ac_status=$?
14882   echo "$as_me:14882: \$? = $ac_status" >&5
14883   (exit "$ac_status"); }; }; then
14884   cf_cv_c11_noreturn=yes
14885 else
14886   echo "$as_me: failed program was:" >&5
14887 cat "conftest.$ac_ext" >&5
14888 cf_cv_c11_noreturn=no
14889 fi
14890 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14891
14892 fi
14893 echo "$as_me:14893: result: $cf_cv_c11_noreturn" >&5
14894 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
14895 else
14896         cf_cv_c11_noreturn=no,
14897 fi
14898
14899 if test "$cf_cv_c11_noreturn" = yes; then
14900
14901 cat >>confdefs.h <<\EOF
14902 #define HAVE_STDNORETURN_H 1
14903 EOF
14904
14905 cat >>confdefs.h <<EOF
14906 #define STDC_NORETURN _Noreturn
14907 EOF
14908
14909         HAVE_STDNORETURN_H=1
14910 else
14911         HAVE_STDNORETURN_H=0
14912 fi
14913
14914 if test "$GCC" = yes || test "$GXX" = yes
14915 then
14916
14917 if test "$GCC" = yes || test "$GXX" = yes
14918 then
14919         case $CFLAGS in
14920         (*-Werror=*)
14921                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14922
14923 echo "${as_me:-configure}:14923: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14924
14925                 cf_temp_flags=
14926                 for cf_temp_scan in $CFLAGS
14927                 do
14928                         case "x$cf_temp_scan" in
14929                         (x-Werror=*)
14930
14931         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14932         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14933
14934                                 ;;
14935                         (*)
14936
14937         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14938         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14939
14940                                 ;;
14941                         esac
14942                 done
14943                 CFLAGS="$cf_temp_flags"
14944                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
14945
14946 echo "${as_me:-configure}:14946: testing ... fixed $CFLAGS ..." 1>&5
14947
14948                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14949
14950 echo "${as_me:-configure}:14950: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14951
14952                 ;;
14953         esac
14954 fi
14955
14956 if test "$GCC" = yes || test "$GXX" = yes
14957 then
14958         case $CPPFLAGS in
14959         (*-Werror=*)
14960                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
14961
14962 echo "${as_me:-configure}:14962: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
14963
14964                 cf_temp_flags=
14965                 for cf_temp_scan in $CPPFLAGS
14966                 do
14967                         case "x$cf_temp_scan" in
14968                         (x-Werror=*)
14969
14970         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14971         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14972
14973                                 ;;
14974                         (*)
14975
14976         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14977         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14978
14979                                 ;;
14980                         esac
14981                 done
14982                 CPPFLAGS="$cf_temp_flags"
14983                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
14984
14985 echo "${as_me:-configure}:14985: testing ... fixed $CPPFLAGS ..." 1>&5
14986
14987                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14988
14989 echo "${as_me:-configure}:14989: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14990
14991                 ;;
14992         esac
14993 fi
14994
14995 if test "$GCC" = yes || test "$GXX" = yes
14996 then
14997         case $LDFLAGS in
14998         (*-Werror=*)
14999                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15000
15001 echo "${as_me:-configure}:15001: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15002
15003                 cf_temp_flags=
15004                 for cf_temp_scan in $LDFLAGS
15005                 do
15006                         case "x$cf_temp_scan" in
15007                         (x-Werror=*)
15008
15009         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15010         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15011
15012                                 ;;
15013                         (*)
15014
15015         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15016         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15017
15018                                 ;;
15019                         esac
15020                 done
15021                 LDFLAGS="$cf_temp_flags"
15022                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15023
15024 echo "${as_me:-configure}:15024: testing ... fixed $LDFLAGS ..." 1>&5
15025
15026                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15027
15028 echo "${as_me:-configure}:15028: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15029
15030                 ;;
15031         esac
15032 fi
15033
15034 echo "$as_me:15034: checking if you want to turn on gcc warnings" >&5
15035 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15036
15037 # Check whether --enable-warnings or --disable-warnings was given.
15038 if test "${enable_warnings+set}" = set; then
15039   enableval="$enable_warnings"
15040   test "$enableval" != yes && enableval=no
15041         if test "$enableval" != "no" ; then
15042     enable_warnings=yes
15043         else
15044                 enable_warnings=no
15045         fi
15046 else
15047   enableval=no
15048         enable_warnings=no
15049
15050 fi;
15051 echo "$as_me:15051: result: $enable_warnings" >&5
15052 echo "${ECHO_T}$enable_warnings" >&6
15053 if test "$enable_warnings" = "yes"
15054 then
15055
15056 if test "x$have_x" = xyes; then
15057
15058 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15059 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15060 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15061 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15062 for cf_X_CFLAGS in $X_CFLAGS
15063 do
15064         case "x$cf_X_CFLAGS" in
15065         x-[IUD]*)
15066                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15067                 ;;
15068         *)
15069                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15070                 ;;
15071         esac
15072 done
15073
15074 cat >"conftest.$ac_ext" <<_ACEOF
15075 #line 15075 "configure"
15076 #include "confdefs.h"
15077
15078 #include <stdlib.h>
15079 #include <X11/Intrinsic.h>
15080
15081 int
15082 main (void)
15083 {
15084 String foo = malloc(1); (void)foo
15085   ;
15086   return 0;
15087 }
15088 _ACEOF
15089 rm -f "conftest.$ac_objext"
15090 if { (eval echo "$as_me:15090: \"$ac_compile\"") >&5
15091   (eval $ac_compile) 2>&5
15092   ac_status=$?
15093   echo "$as_me:15093: \$? = $ac_status" >&5
15094   (exit "$ac_status"); } &&
15095          { ac_try='test -s "conftest.$ac_objext"'
15096   { (eval echo "$as_me:15096: \"$ac_try\"") >&5
15097   (eval $ac_try) 2>&5
15098   ac_status=$?
15099   echo "$as_me:15099: \$? = $ac_status" >&5
15100   (exit "$ac_status"); }; }; then
15101
15102 echo "$as_me:15102: checking for X11/Xt const-feature" >&5
15103 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15104 if test "${cf_cv_const_x_string+set}" = set; then
15105   echo $ECHO_N "(cached) $ECHO_C" >&6
15106 else
15107
15108         cat >"conftest.$ac_ext" <<_ACEOF
15109 #line 15109 "configure"
15110 #include "confdefs.h"
15111
15112 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15113 #undef  XTSTRINGDEFINES /* X11R5 and later */
15114 #include <stdlib.h>
15115 #include <X11/Intrinsic.h>
15116
15117 int
15118 main (void)
15119 {
15120 String foo = malloc(1); *foo = 0
15121   ;
15122   return 0;
15123 }
15124 _ACEOF
15125 rm -f "conftest.$ac_objext"
15126 if { (eval echo "$as_me:15126: \"$ac_compile\"") >&5
15127   (eval $ac_compile) 2>&5
15128   ac_status=$?
15129   echo "$as_me:15129: \$? = $ac_status" >&5
15130   (exit "$ac_status"); } &&
15131          { ac_try='test -s "conftest.$ac_objext"'
15132   { (eval echo "$as_me:15132: \"$ac_try\"") >&5
15133   (eval $ac_try) 2>&5
15134   ac_status=$?
15135   echo "$as_me:15135: \$? = $ac_status" >&5
15136   (exit "$ac_status"); }; }; then
15137
15138                         cf_cv_const_x_string=no
15139
15140 else
15141   echo "$as_me: failed program was:" >&5
15142 cat "conftest.$ac_ext" >&5
15143
15144                         cf_cv_const_x_string=yes
15145
15146 fi
15147 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15148
15149 fi
15150 echo "$as_me:15150: result: $cf_cv_const_x_string" >&5
15151 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15152
15153 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15154 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15155 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15156
15157 case "$cf_cv_const_x_string" in
15158 (no)
15159
15160         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15161         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15162
15163         ;;
15164 (*)
15165
15166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15167         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15168
15169         ;;
15170 esac
15171
15172 else
15173   echo "$as_me: failed program was:" >&5
15174 cat "conftest.$ac_ext" >&5
15175 fi
15176 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15177  fi
15178 cat > "conftest.$ac_ext" <<EOF
15179 #line 15179 "${as_me:-configure}"
15180 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15181 EOF
15182 if test "$INTEL_COMPILER" = yes
15183 then
15184 # The "-wdXXX" options suppress warnings:
15185 # remark #1419: external declaration in primary source file
15186 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15187 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15188 # remark #193: zero used for undefined preprocessing identifier
15189 # remark #593: variable "curs_sb_left_arrow" was set but never used
15190 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15191 # remark #869: parameter "tw" was never referenced
15192 # remark #981: operands are evaluated in unspecified order
15193 # warning #279: controlling expression is constant
15194
15195         { echo "$as_me:15195: checking for $CC warning options..." >&5
15196 echo "$as_me: checking for $CC warning options..." >&6;}
15197         cf_save_CFLAGS="$CFLAGS"
15198         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15199         for cf_opt in \
15200                 wd1419 \
15201                 wd1683 \
15202                 wd1684 \
15203                 wd193 \
15204                 wd593 \
15205                 wd279 \
15206                 wd810 \
15207                 wd869 \
15208                 wd981
15209         do
15210                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15211                 if { (eval echo "$as_me:15211: \"$ac_compile\"") >&5
15212   (eval $ac_compile) 2>&5
15213   ac_status=$?
15214   echo "$as_me:15214: \$? = $ac_status" >&5
15215   (exit "$ac_status"); }; then
15216                         test -n "$verbose" && echo "$as_me:15216: result: ... -$cf_opt" >&5
15217 echo "${ECHO_T}... -$cf_opt" >&6
15218                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15219                 fi
15220         done
15221         CFLAGS="$cf_save_CFLAGS"
15222 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15223 then
15224         { echo "$as_me:15224: checking for $CC warning options..." >&5
15225 echo "$as_me: checking for $CC warning options..." >&6;}
15226         cf_save_CFLAGS="$CFLAGS"
15227         cf_warn_CONST=""
15228         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15229         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15230         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15231         for cf_opt in W Wall \
15232                 Wbad-function-cast \
15233                 Wcast-align \
15234                 Wcast-qual \
15235                 Wdeclaration-after-statement \
15236                 Wextra \
15237                 Winline \
15238                 Wmissing-declarations \
15239                 Wmissing-prototypes \
15240                 Wnested-externs \
15241                 Wpointer-arith \
15242                 Wshadow \
15243                 Wstrict-prototypes \
15244                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15245         do
15246                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15247                 if { (eval echo "$as_me:15247: \"$ac_compile\"") >&5
15248   (eval $ac_compile) 2>&5
15249   ac_status=$?
15250   echo "$as_me:15250: \$? = $ac_status" >&5
15251   (exit "$ac_status"); }; then
15252                         test -n "$verbose" && echo "$as_me:15252: result: ... -$cf_opt" >&5
15253 echo "${ECHO_T}... -$cf_opt" >&6
15254                         case "$cf_opt" in
15255                         (Winline)
15256                                 case "$GCC_VERSION" in
15257                                 ([34].*)
15258                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15259
15260 echo "${as_me:-configure}:15260: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15261
15262                                         continue;;
15263                                 esac
15264                                 ;;
15265                         (Wpointer-arith)
15266                                 case "$GCC_VERSION" in
15267                                 ([12].*)
15268                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15269
15270 echo "${as_me:-configure}:15270: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15271
15272                                         continue;;
15273                                 esac
15274                                 ;;
15275                         esac
15276                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15277                 fi
15278         done
15279         CFLAGS="$cf_save_CFLAGS"
15280 fi
15281 rm -rf ./conftest*
15282
15283 fi
15284
15285 if test "$GCC" = yes || test "$GXX" = yes
15286 then
15287 cat > conftest.i <<EOF
15288 #ifndef GCC_PRINTF
15289 #define GCC_PRINTF 0
15290 #endif
15291 #ifndef GCC_SCANF
15292 #define GCC_SCANF 0
15293 #endif
15294 #ifndef GCC_NORETURN
15295 #define GCC_NORETURN /* nothing */
15296 #endif
15297 #ifndef GCC_UNUSED
15298 #define GCC_UNUSED /* nothing */
15299 #endif
15300 EOF
15301 if test "$GCC" = yes
15302 then
15303         { echo "$as_me:15303: checking for $CC __attribute__ directives..." >&5
15304 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15305 cat > "conftest.$ac_ext" <<EOF
15306 #line 15306 "${as_me:-configure}"
15307 #include "confdefs.h"
15308 #include "conftest.h"
15309 #include "conftest.i"
15310 #if     GCC_PRINTF
15311 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15312 #else
15313 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15314 #endif
15315 #if     GCC_SCANF
15316 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15317 #else
15318 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15319 #endif
15320 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15321 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15322 extern GCC_NORETURN void foo(void);
15323 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15324 EOF
15325         cf_printf_attribute=no
15326         cf_scanf_attribute=no
15327         for cf_attribute in scanf printf unused noreturn
15328         do
15329
15330 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15331
15332                 cf_directive="__attribute__(($cf_attribute))"
15333                 echo "checking for $CC $cf_directive" 1>&5
15334
15335                 case "$cf_attribute" in
15336                 (printf)
15337                         cf_printf_attribute=yes
15338                         cat >conftest.h <<EOF
15339 #define GCC_$cf_ATTRIBUTE 1
15340 EOF
15341                         ;;
15342                 (scanf)
15343                         cf_scanf_attribute=yes
15344                         cat >conftest.h <<EOF
15345 #define GCC_$cf_ATTRIBUTE 1
15346 EOF
15347                         ;;
15348                 (*)
15349                         cat >conftest.h <<EOF
15350 #define GCC_$cf_ATTRIBUTE $cf_directive
15351 EOF
15352                         ;;
15353                 esac
15354
15355                 if { (eval echo "$as_me:15355: \"$ac_compile\"") >&5
15356   (eval $ac_compile) 2>&5
15357   ac_status=$?
15358   echo "$as_me:15358: \$? = $ac_status" >&5
15359   (exit "$ac_status"); }; then
15360                         test -n "$verbose" && echo "$as_me:15360: result: ... $cf_attribute" >&5
15361 echo "${ECHO_T}... $cf_attribute" >&6
15362                         cat conftest.h >>confdefs.h
15363                         case "$cf_attribute" in
15364                         (noreturn)
15365
15366 cat >>confdefs.h <<EOF
15367 #define GCC_NORETURN $cf_directive
15368 EOF
15369
15370                                 ;;
15371                         (printf)
15372                                 cf_value='/* nothing */'
15373                                 if test "$cf_printf_attribute" != no ; then
15374                                         cf_value='__attribute__((format(printf,fmt,var)))'
15375
15376 cat >>confdefs.h <<\EOF
15377 #define GCC_PRINTF 1
15378 EOF
15379
15380                                 fi
15381
15382 cat >>confdefs.h <<EOF
15383 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15384 EOF
15385
15386                                 ;;
15387                         (scanf)
15388                                 cf_value='/* nothing */'
15389                                 if test "$cf_scanf_attribute" != no ; then
15390                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15391
15392 cat >>confdefs.h <<\EOF
15393 #define GCC_SCANF 1
15394 EOF
15395
15396                                 fi
15397
15398 cat >>confdefs.h <<EOF
15399 #define GCC_SCANFLIKE(fmt,var) $cf_value
15400 EOF
15401
15402                                 ;;
15403                         (unused)
15404
15405 cat >>confdefs.h <<EOF
15406 #define GCC_UNUSED $cf_directive
15407 EOF
15408
15409                                 ;;
15410                         esac
15411                 fi
15412         done
15413 else
15414         ${FGREP-fgrep} define conftest.i >>confdefs.h
15415 fi
15416 rm -rf ./conftest*
15417 fi
15418
15419 fi
15420
15421 if test "x$enable_warnings" = "xyes"; then
15422
15423         ADAFLAGS="$ADAFLAGS -gnatg"
15424
15425 fi
15426
15427 ###     use option --enable-assertions to turn on generation of assertion code
15428 echo "$as_me:15428: checking if you want to enable runtime assertions" >&5
15429 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15430
15431 # Check whether --enable-assertions or --disable-assertions was given.
15432 if test "${enable_assertions+set}" = set; then
15433   enableval="$enable_assertions"
15434   with_assertions=$enableval
15435 else
15436   with_assertions=no
15437 fi;
15438 echo "$as_me:15438: result: $with_assertions" >&5
15439 echo "${ECHO_T}$with_assertions" >&6
15440 if test -n "$GCC"
15441 then
15442         if test "$with_assertions" = no
15443         then
15444                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15445         else
15446
15447         ADAFLAGS="$ADAFLAGS -gnata"
15448
15449         fi
15450 fi
15451
15452 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15453
15454 cat >>confdefs.h <<\EOF
15455 #define HAVE_NC_ALLOC_H 1
15456 EOF
15457
15458 ###     use option --enable-expanded to generate certain macros as functions
15459
15460 # Check whether --enable-expanded or --disable-expanded was given.
15461 if test "${enable_expanded+set}" = set; then
15462   enableval="$enable_expanded"
15463   test "$enableval" = yes &&
15464 cat >>confdefs.h <<\EOF
15465 #define NCURSES_EXPANDED 1
15466 EOF
15467
15468 fi;
15469
15470 ###     use option --disable-macros to suppress macros in favor of functions
15471
15472 # Check whether --enable-macros or --disable-macros was given.
15473 if test "${enable_macros+set}" = set; then
15474   enableval="$enable_macros"
15475   test "$enableval" = no &&
15476 cat >>confdefs.h <<\EOF
15477 #define NCURSES_NOMACROS 1
15478 EOF
15479
15480 fi;
15481
15482 # Normally we only add trace() to the debug-library.  Allow this to be
15483 # extended to all models of the ncurses library:
15484 cf_all_traces=no
15485 case "$CFLAGS $CPPFLAGS" in
15486 (*-DTRACE*)
15487         cf_all_traces=yes
15488         ;;
15489 esac
15490
15491 echo "$as_me:15491: checking whether to add trace feature to all models" >&5
15492 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15493
15494 # Check whether --with-trace or --without-trace was given.
15495 if test "${with_trace+set}" = set; then
15496   withval="$with_trace"
15497   cf_with_trace=$withval
15498 else
15499   cf_with_trace=$cf_all_traces
15500 fi;
15501 echo "$as_me:15501: result: $cf_with_trace" >&5
15502 echo "${ECHO_T}$cf_with_trace" >&6
15503
15504 if test "$cf_with_trace" = yes ; then
15505         ADA_TRACE=TRUE
15506
15507 cf_fix_cppflags=no
15508 cf_new_cflags=
15509 cf_new_cppflags=
15510 cf_new_extra_cppflags=
15511
15512 for cf_add_cflags in -DTRACE
15513 do
15514 case "$cf_fix_cppflags" in
15515 (no)
15516         case "$cf_add_cflags" in
15517         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15518                 case "$cf_add_cflags" in
15519                 (-D*)
15520                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15521
15522                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15523                                 && test -z "${cf_tst_cflags}" \
15524                                 && cf_fix_cppflags=yes
15525
15526                         if test "$cf_fix_cppflags" = yes ; then
15527
15528         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15529         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15530
15531                                 continue
15532                         elif test "${cf_tst_cflags}" = "\"'" ; then
15533
15534         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15535         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15536
15537                                 continue
15538                         fi
15539                         ;;
15540                 esac
15541                 case "$CPPFLAGS" in
15542                 (*$cf_add_cflags)
15543                         ;;
15544                 (*)
15545                         case "$cf_add_cflags" in
15546                         (-D*)
15547                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15548
15549 CPPFLAGS=`echo "$CPPFLAGS" | \
15550         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15551                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15552
15553                                 ;;
15554                         esac
15555
15556         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15557         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15558
15559                         ;;
15560                 esac
15561                 ;;
15562         (*)
15563
15564         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15565         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15566
15567                 ;;
15568         esac
15569         ;;
15570 (yes)
15571
15572         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15573         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15574
15575         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15576
15577         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15578                 && test -z "${cf_tst_cflags}" \
15579                 && cf_fix_cppflags=no
15580         ;;
15581 esac
15582 done
15583
15584 if test -n "$cf_new_cflags" ; then
15585
15586         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15587         CFLAGS="${CFLAGS}$cf_new_cflags"
15588
15589 fi
15590
15591 if test -n "$cf_new_cppflags" ; then
15592
15593         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15594         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15595
15596 fi
15597
15598 if test -n "$cf_new_extra_cppflags" ; then
15599
15600         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15601         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15602
15603 fi
15604
15605 else
15606         ADA_TRACE=FALSE
15607 fi
15608
15609 echo "$as_me:15609: checking if we want to use GNAT projects" >&5
15610 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15611
15612 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15613 if test "${enable_gnat_projects+set}" = set; then
15614   enableval="$enable_gnat_projects"
15615   test "$enableval" != no && enableval=yes
15616         if test "$enableval" != "yes" ; then
15617     enable_gnat_projects=no
15618         else
15619                 enable_gnat_projects=yes
15620         fi
15621 else
15622   enableval=yes
15623         enable_gnat_projects=yes
15624
15625 fi;
15626 echo "$as_me:15626: result: $enable_gnat_projects" >&5
15627 echo "${ECHO_T}$enable_gnat_projects" >&6
15628
15629 ###     Checks for libraries.
15630 case $cf_cv_system_name in
15631 (*mingw32*)
15632         ;;
15633 (*)
15634 echo "$as_me:15634: checking for gettimeofday" >&5
15635 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15636 if test "${ac_cv_func_gettimeofday+set}" = set; then
15637   echo $ECHO_N "(cached) $ECHO_C" >&6
15638 else
15639   cat >"conftest.$ac_ext" <<_ACEOF
15640 #line 15640 "configure"
15641 #include "confdefs.h"
15642 #define gettimeofday autoconf_temporary
15643 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15644 #undef gettimeofday
15645
15646 #ifdef __cplusplus
15647 extern "C"
15648 #endif
15649
15650 /* We use char because int might match the return type of a gcc2
15651    builtin and then its argument prototype would still apply.  */
15652 char gettimeofday (void);
15653
15654 int
15655 main (void)
15656 {
15657
15658 /* The GNU C library defines stubs for functions which it implements
15659     to always fail with ENOSYS.  Some functions are actually named
15660     something starting with __ and the normal name is an alias.  */
15661 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15662 #error found stub for gettimeofday
15663 #endif
15664
15665         return gettimeofday ();
15666   ;
15667   return 0;
15668 }
15669 _ACEOF
15670 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15671 if { (eval echo "$as_me:15671: \"$ac_link\"") >&5
15672   (eval $ac_link) 2>&5
15673   ac_status=$?
15674   echo "$as_me:15674: \$? = $ac_status" >&5
15675   (exit "$ac_status"); } &&
15676          { ac_try='test -s "conftest$ac_exeext"'
15677   { (eval echo "$as_me:15677: \"$ac_try\"") >&5
15678   (eval $ac_try) 2>&5
15679   ac_status=$?
15680   echo "$as_me:15680: \$? = $ac_status" >&5
15681   (exit "$ac_status"); }; }; then
15682   ac_cv_func_gettimeofday=yes
15683 else
15684   echo "$as_me: failed program was:" >&5
15685 cat "conftest.$ac_ext" >&5
15686 ac_cv_func_gettimeofday=no
15687 fi
15688 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15689 fi
15690 echo "$as_me:15690: result: $ac_cv_func_gettimeofday" >&5
15691 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15692 if test "$ac_cv_func_gettimeofday" = yes; then
15693   cat >>confdefs.h <<\EOF
15694 #define HAVE_GETTIMEOFDAY 1
15695 EOF
15696
15697 else
15698
15699 echo "$as_me:15699: checking for gettimeofday in -lbsd" >&5
15700 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15701 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15702   echo $ECHO_N "(cached) $ECHO_C" >&6
15703 else
15704   ac_check_lib_save_LIBS=$LIBS
15705 LIBS="-lbsd  $LIBS"
15706 cat >"conftest.$ac_ext" <<_ACEOF
15707 #line 15707 "configure"
15708 #include "confdefs.h"
15709
15710 /* Override any gcc2 internal prototype to avoid an error.  */
15711 #ifdef __cplusplus
15712 extern "C"
15713 #endif
15714 /* We use char because int might match the return type of a gcc2
15715    builtin and then its argument prototype would still apply.  */
15716 char gettimeofday ();
15717 int
15718 main (void)
15719 {
15720 gettimeofday ();
15721   ;
15722   return 0;
15723 }
15724 _ACEOF
15725 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15726 if { (eval echo "$as_me:15726: \"$ac_link\"") >&5
15727   (eval $ac_link) 2>&5
15728   ac_status=$?
15729   echo "$as_me:15729: \$? = $ac_status" >&5
15730   (exit "$ac_status"); } &&
15731          { ac_try='test -s "conftest$ac_exeext"'
15732   { (eval echo "$as_me:15732: \"$ac_try\"") >&5
15733   (eval $ac_try) 2>&5
15734   ac_status=$?
15735   echo "$as_me:15735: \$? = $ac_status" >&5
15736   (exit "$ac_status"); }; }; then
15737   ac_cv_lib_bsd_gettimeofday=yes
15738 else
15739   echo "$as_me: failed program was:" >&5
15740 cat "conftest.$ac_ext" >&5
15741 ac_cv_lib_bsd_gettimeofday=no
15742 fi
15743 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15744 LIBS=$ac_check_lib_save_LIBS
15745 fi
15746 echo "$as_me:15746: result: $ac_cv_lib_bsd_gettimeofday" >&5
15747 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15748 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
15749
15750 cat >>confdefs.h <<\EOF
15751 #define HAVE_GETTIMEOFDAY 1
15752 EOF
15753
15754         LIBS="$LIBS -lbsd"
15755 fi
15756
15757 fi
15758         ;;
15759 esac
15760
15761 ###     Checks for header files.
15762 echo "$as_me:15762: checking for ANSI C header files" >&5
15763 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15764 if test "${ac_cv_header_stdc+set}" = set; then
15765   echo $ECHO_N "(cached) $ECHO_C" >&6
15766 else
15767   cat >"conftest.$ac_ext" <<_ACEOF
15768 #line 15768 "configure"
15769 #include "confdefs.h"
15770 #include <stdlib.h>
15771 #include <stdarg.h>
15772 #include <string.h>
15773 #include <float.h>
15774
15775 _ACEOF
15776 if { (eval echo "$as_me:15776: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15777   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15778   ac_status=$?
15779   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15780   rm -f conftest.er1
15781   cat conftest.err >&5
15782   echo "$as_me:15782: \$? = $ac_status" >&5
15783   (exit "$ac_status"); } >/dev/null; then
15784   if test -s conftest.err; then
15785     ac_cpp_err=$ac_c_preproc_warn_flag
15786   else
15787     ac_cpp_err=
15788   fi
15789 else
15790   ac_cpp_err=yes
15791 fi
15792 if test -z "$ac_cpp_err"; then
15793   ac_cv_header_stdc=yes
15794 else
15795   echo "$as_me: failed program was:" >&5
15796   cat "conftest.$ac_ext" >&5
15797   ac_cv_header_stdc=no
15798 fi
15799 rm -f conftest.err "conftest.$ac_ext"
15800
15801 if test $ac_cv_header_stdc = yes; then
15802   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15803   cat >"conftest.$ac_ext" <<_ACEOF
15804 #line 15804 "configure"
15805 #include "confdefs.h"
15806 #include <string.h>
15807
15808 _ACEOF
15809 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15810   $EGREP "memchr" >/dev/null 2>&1; then
15811   :
15812 else
15813   ac_cv_header_stdc=no
15814 fi
15815 rm -rf conftest*
15816
15817 fi
15818
15819 if test $ac_cv_header_stdc = yes; then
15820   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15821   cat >"conftest.$ac_ext" <<_ACEOF
15822 #line 15822 "configure"
15823 #include "confdefs.h"
15824 #include <stdlib.h>
15825
15826 _ACEOF
15827 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15828   $EGREP "free" >/dev/null 2>&1; then
15829   :
15830 else
15831   ac_cv_header_stdc=no
15832 fi
15833 rm -rf conftest*
15834
15835 fi
15836
15837 if test $ac_cv_header_stdc = yes; then
15838   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15839   if test "$cross_compiling" = yes; then
15840   :
15841 else
15842   cat >"conftest.$ac_ext" <<_ACEOF
15843 #line 15843 "configure"
15844 #include "confdefs.h"
15845 #include <ctype.h>
15846 #if ((' ' & 0x0FF) == 0x020)
15847 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15848 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15849 #else
15850 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15851                      || ('j' <= (c) && (c) <= 'r') \
15852                      || ('s' <= (c) && (c) <= 'z'))
15853 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15854 #endif
15855
15856 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15857 int
15858 main (void)
15859 {
15860   int i;
15861   for (i = 0; i < 256; i++)
15862     if (XOR (islower (i), ISLOWER (i))
15863         || toupper (i) != TOUPPER (i))
15864       $ac_main_return(2);
15865   $ac_main_return (0);
15866 }
15867 _ACEOF
15868 rm -f "conftest$ac_exeext"
15869 if { (eval echo "$as_me:15869: \"$ac_link\"") >&5
15870   (eval $ac_link) 2>&5
15871   ac_status=$?
15872   echo "$as_me:15872: \$? = $ac_status" >&5
15873   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
15874   { (eval echo "$as_me:15874: \"$ac_try\"") >&5
15875   (eval $ac_try) 2>&5
15876   ac_status=$?
15877   echo "$as_me:15877: \$? = $ac_status" >&5
15878   (exit "$ac_status"); }; }; then
15879   :
15880 else
15881   echo "$as_me: program exited with status $ac_status" >&5
15882 echo "$as_me: failed program was:" >&5
15883 cat "conftest.$ac_ext" >&5
15884 ac_cv_header_stdc=no
15885 fi
15886 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
15887 fi
15888 fi
15889 fi
15890 echo "$as_me:15890: result: $ac_cv_header_stdc" >&5
15891 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15892 if test $ac_cv_header_stdc = yes; then
15893
15894 cat >>confdefs.h <<\EOF
15895 #define STDC_HEADERS 1
15896 EOF
15897
15898 fi
15899
15900 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15901
15902 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15903                   inttypes.h stdint.h unistd.h
15904 do
15905 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15906 echo "$as_me:15906: checking for $ac_header" >&5
15907 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15908 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15909   echo $ECHO_N "(cached) $ECHO_C" >&6
15910 else
15911   cat >"conftest.$ac_ext" <<_ACEOF
15912 #line 15912 "configure"
15913 #include "confdefs.h"
15914 $ac_includes_default
15915 #include <$ac_header>
15916 _ACEOF
15917 rm -f "conftest.$ac_objext"
15918 if { (eval echo "$as_me:15918: \"$ac_compile\"") >&5
15919   (eval $ac_compile) 2>&5
15920   ac_status=$?
15921   echo "$as_me:15921: \$? = $ac_status" >&5
15922   (exit "$ac_status"); } &&
15923          { ac_try='test -s "conftest.$ac_objext"'
15924   { (eval echo "$as_me:15924: \"$ac_try\"") >&5
15925   (eval $ac_try) 2>&5
15926   ac_status=$?
15927   echo "$as_me:15927: \$? = $ac_status" >&5
15928   (exit "$ac_status"); }; }; then
15929   eval "$as_ac_Header=yes"
15930 else
15931   echo "$as_me: failed program was:" >&5
15932 cat "conftest.$ac_ext" >&5
15933 eval "$as_ac_Header=no"
15934 fi
15935 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15936 fi
15937 echo "$as_me:15937: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
15938 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
15939 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
15940   cat >>confdefs.h <<EOF
15941 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15942 EOF
15943
15944 fi
15945 done
15946
15947 echo "$as_me:15947: checking for signed char" >&5
15948 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15949 if test "${ac_cv_type_signed_char+set}" = set; then
15950   echo $ECHO_N "(cached) $ECHO_C" >&6
15951 else
15952   cat >"conftest.$ac_ext" <<_ACEOF
15953 #line 15953 "configure"
15954 #include "confdefs.h"
15955 $ac_includes_default
15956 int
15957 main (void)
15958 {
15959 if ((signed char *) 0)
15960   return 0;
15961 if (sizeof (signed char))
15962   return 0;
15963   ;
15964   return 0;
15965 }
15966 _ACEOF
15967 rm -f "conftest.$ac_objext"
15968 if { (eval echo "$as_me:15968: \"$ac_compile\"") >&5
15969   (eval $ac_compile) 2>&5
15970   ac_status=$?
15971   echo "$as_me:15971: \$? = $ac_status" >&5
15972   (exit "$ac_status"); } &&
15973          { ac_try='test -s "conftest.$ac_objext"'
15974   { (eval echo "$as_me:15974: \"$ac_try\"") >&5
15975   (eval $ac_try) 2>&5
15976   ac_status=$?
15977   echo "$as_me:15977: \$? = $ac_status" >&5
15978   (exit "$ac_status"); }; }; then
15979   ac_cv_type_signed_char=yes
15980 else
15981   echo "$as_me: failed program was:" >&5
15982 cat "conftest.$ac_ext" >&5
15983 ac_cv_type_signed_char=no
15984 fi
15985 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15986 fi
15987 echo "$as_me:15987: result: $ac_cv_type_signed_char" >&5
15988 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15989
15990 echo "$as_me:15990: checking size of signed char" >&5
15991 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15992 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15993   echo $ECHO_N "(cached) $ECHO_C" >&6
15994 else
15995   if test "$ac_cv_type_signed_char" = yes; then
15996   if test "$cross_compiling" = yes; then
15997   # Depending upon the size, compute the lo and hi bounds.
15998 cat >"conftest.$ac_ext" <<_ACEOF
15999 #line 15999 "configure"
16000 #include "confdefs.h"
16001 $ac_includes_default
16002 int
16003 main (void)
16004 {
16005 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16006   ;
16007   return 0;
16008 }
16009 _ACEOF
16010 rm -f "conftest.$ac_objext"
16011 if { (eval echo "$as_me:16011: \"$ac_compile\"") >&5
16012   (eval $ac_compile) 2>&5
16013   ac_status=$?
16014   echo "$as_me:16014: \$? = $ac_status" >&5
16015   (exit "$ac_status"); } &&
16016          { ac_try='test -s "conftest.$ac_objext"'
16017   { (eval echo "$as_me:16017: \"$ac_try\"") >&5
16018   (eval $ac_try) 2>&5
16019   ac_status=$?
16020   echo "$as_me:16020: \$? = $ac_status" >&5
16021   (exit "$ac_status"); }; }; then
16022   ac_lo=0 ac_mid=0
16023   while :; do
16024     cat >"conftest.$ac_ext" <<_ACEOF
16025 #line 16025 "configure"
16026 #include "confdefs.h"
16027 $ac_includes_default
16028 int
16029 main (void)
16030 {
16031 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16032   ;
16033   return 0;
16034 }
16035 _ACEOF
16036 rm -f "conftest.$ac_objext"
16037 if { (eval echo "$as_me:16037: \"$ac_compile\"") >&5
16038   (eval $ac_compile) 2>&5
16039   ac_status=$?
16040   echo "$as_me:16040: \$? = $ac_status" >&5
16041   (exit "$ac_status"); } &&
16042          { ac_try='test -s "conftest.$ac_objext"'
16043   { (eval echo "$as_me:16043: \"$ac_try\"") >&5
16044   (eval $ac_try) 2>&5
16045   ac_status=$?
16046   echo "$as_me:16046: \$? = $ac_status" >&5
16047   (exit "$ac_status"); }; }; then
16048   ac_hi=$ac_mid; break
16049 else
16050   echo "$as_me: failed program was:" >&5
16051 cat "conftest.$ac_ext" >&5
16052 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16053 fi
16054 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16055   done
16056 else
16057   echo "$as_me: failed program was:" >&5
16058 cat "conftest.$ac_ext" >&5
16059 ac_hi=-1 ac_mid=-1
16060   while :; do
16061     cat >"conftest.$ac_ext" <<_ACEOF
16062 #line 16062 "configure"
16063 #include "confdefs.h"
16064 $ac_includes_default
16065 int
16066 main (void)
16067 {
16068 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16069   ;
16070   return 0;
16071 }
16072 _ACEOF
16073 rm -f "conftest.$ac_objext"
16074 if { (eval echo "$as_me:16074: \"$ac_compile\"") >&5
16075   (eval $ac_compile) 2>&5
16076   ac_status=$?
16077   echo "$as_me:16077: \$? = $ac_status" >&5
16078   (exit "$ac_status"); } &&
16079          { ac_try='test -s "conftest.$ac_objext"'
16080   { (eval echo "$as_me:16080: \"$ac_try\"") >&5
16081   (eval $ac_try) 2>&5
16082   ac_status=$?
16083   echo "$as_me:16083: \$? = $ac_status" >&5
16084   (exit "$ac_status"); }; }; then
16085   ac_lo=$ac_mid; break
16086 else
16087   echo "$as_me: failed program was:" >&5
16088 cat "conftest.$ac_ext" >&5
16089 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16090 fi
16091 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16092   done
16093 fi
16094 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16095 # Binary search between lo and hi bounds.
16096 while test "x$ac_lo" != "x$ac_hi"; do
16097   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16098   cat >"conftest.$ac_ext" <<_ACEOF
16099 #line 16099 "configure"
16100 #include "confdefs.h"
16101 $ac_includes_default
16102 int
16103 main (void)
16104 {
16105 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16106   ;
16107   return 0;
16108 }
16109 _ACEOF
16110 rm -f "conftest.$ac_objext"
16111 if { (eval echo "$as_me:16111: \"$ac_compile\"") >&5
16112   (eval $ac_compile) 2>&5
16113   ac_status=$?
16114   echo "$as_me:16114: \$? = $ac_status" >&5
16115   (exit "$ac_status"); } &&
16116          { ac_try='test -s "conftest.$ac_objext"'
16117   { (eval echo "$as_me:16117: \"$ac_try\"") >&5
16118   (eval $ac_try) 2>&5
16119   ac_status=$?
16120   echo "$as_me:16120: \$? = $ac_status" >&5
16121   (exit "$ac_status"); }; }; then
16122   ac_hi=$ac_mid
16123 else
16124   echo "$as_me: failed program was:" >&5
16125 cat "conftest.$ac_ext" >&5
16126 ac_lo=`expr "$ac_mid" + 1`
16127 fi
16128 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16129 done
16130 ac_cv_sizeof_signed_char=$ac_lo
16131 else
16132   if test "$cross_compiling" = yes; then
16133   { { echo "$as_me:16133: error: cannot run test program while cross compiling" >&5
16134 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16135    { (exit 1); exit 1; }; }
16136 else
16137   cat >"conftest.$ac_ext" <<_ACEOF
16138 #line 16138 "configure"
16139 #include "confdefs.h"
16140 $ac_includes_default
16141 int
16142 main (void)
16143 {
16144 FILE *f = fopen ("conftest.val", "w");
16145 if (!f)
16146   $ac_main_return (1);
16147 fprintf (f, "%ld", (long)(sizeof (signed char)));
16148 fclose (f);
16149   ;
16150   return 0;
16151 }
16152 _ACEOF
16153 rm -f "conftest$ac_exeext"
16154 if { (eval echo "$as_me:16154: \"$ac_link\"") >&5
16155   (eval $ac_link) 2>&5
16156   ac_status=$?
16157   echo "$as_me:16157: \$? = $ac_status" >&5
16158   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16159   { (eval echo "$as_me:16159: \"$ac_try\"") >&5
16160   (eval $ac_try) 2>&5
16161   ac_status=$?
16162   echo "$as_me:16162: \$? = $ac_status" >&5
16163   (exit "$ac_status"); }; }; then
16164   ac_cv_sizeof_signed_char=`cat conftest.val`
16165 else
16166   echo "$as_me: program exited with status $ac_status" >&5
16167 echo "$as_me: failed program was:" >&5
16168 cat "conftest.$ac_ext" >&5
16169 fi
16170 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16171 fi
16172 fi
16173 rm -f conftest.val
16174 else
16175   ac_cv_sizeof_signed_char=0
16176 fi
16177 fi
16178 echo "$as_me:16178: result: $ac_cv_sizeof_signed_char" >&5
16179 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16180 cat >>confdefs.h <<EOF
16181 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16182 EOF
16183
16184 echo "$as_me:16184: checking for ANSI C header files" >&5
16185 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16186 if test "${ac_cv_header_stdc+set}" = set; then
16187   echo $ECHO_N "(cached) $ECHO_C" >&6
16188 else
16189   cat >"conftest.$ac_ext" <<_ACEOF
16190 #line 16190 "configure"
16191 #include "confdefs.h"
16192 #include <stdlib.h>
16193 #include <stdarg.h>
16194 #include <string.h>
16195 #include <float.h>
16196
16197 _ACEOF
16198 if { (eval echo "$as_me:16198: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16199   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16200   ac_status=$?
16201   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16202   rm -f conftest.er1
16203   cat conftest.err >&5
16204   echo "$as_me:16204: \$? = $ac_status" >&5
16205   (exit "$ac_status"); } >/dev/null; then
16206   if test -s conftest.err; then
16207     ac_cpp_err=$ac_c_preproc_warn_flag
16208   else
16209     ac_cpp_err=
16210   fi
16211 else
16212   ac_cpp_err=yes
16213 fi
16214 if test -z "$ac_cpp_err"; then
16215   ac_cv_header_stdc=yes
16216 else
16217   echo "$as_me: failed program was:" >&5
16218   cat "conftest.$ac_ext" >&5
16219   ac_cv_header_stdc=no
16220 fi
16221 rm -f conftest.err "conftest.$ac_ext"
16222
16223 if test $ac_cv_header_stdc = yes; then
16224   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16225   cat >"conftest.$ac_ext" <<_ACEOF
16226 #line 16226 "configure"
16227 #include "confdefs.h"
16228 #include <string.h>
16229
16230 _ACEOF
16231 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16232   $EGREP "memchr" >/dev/null 2>&1; then
16233   :
16234 else
16235   ac_cv_header_stdc=no
16236 fi
16237 rm -rf conftest*
16238
16239 fi
16240
16241 if test $ac_cv_header_stdc = yes; then
16242   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16243   cat >"conftest.$ac_ext" <<_ACEOF
16244 #line 16244 "configure"
16245 #include "confdefs.h"
16246 #include <stdlib.h>
16247
16248 _ACEOF
16249 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16250   $EGREP "free" >/dev/null 2>&1; then
16251   :
16252 else
16253   ac_cv_header_stdc=no
16254 fi
16255 rm -rf conftest*
16256
16257 fi
16258
16259 if test $ac_cv_header_stdc = yes; then
16260   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16261   if test "$cross_compiling" = yes; then
16262   :
16263 else
16264   cat >"conftest.$ac_ext" <<_ACEOF
16265 #line 16265 "configure"
16266 #include "confdefs.h"
16267 #include <ctype.h>
16268 #if ((' ' & 0x0FF) == 0x020)
16269 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16270 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16271 #else
16272 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16273                      || ('j' <= (c) && (c) <= 'r') \
16274                      || ('s' <= (c) && (c) <= 'z'))
16275 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16276 #endif
16277
16278 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16279 int
16280 main (void)
16281 {
16282   int i;
16283   for (i = 0; i < 256; i++)
16284     if (XOR (islower (i), ISLOWER (i))
16285         || toupper (i) != TOUPPER (i))
16286       $ac_main_return(2);
16287   $ac_main_return (0);
16288 }
16289 _ACEOF
16290 rm -f "conftest$ac_exeext"
16291 if { (eval echo "$as_me:16291: \"$ac_link\"") >&5
16292   (eval $ac_link) 2>&5
16293   ac_status=$?
16294   echo "$as_me:16294: \$? = $ac_status" >&5
16295   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16296   { (eval echo "$as_me:16296: \"$ac_try\"") >&5
16297   (eval $ac_try) 2>&5
16298   ac_status=$?
16299   echo "$as_me:16299: \$? = $ac_status" >&5
16300   (exit "$ac_status"); }; }; then
16301   :
16302 else
16303   echo "$as_me: program exited with status $ac_status" >&5
16304 echo "$as_me: failed program was:" >&5
16305 cat "conftest.$ac_ext" >&5
16306 ac_cv_header_stdc=no
16307 fi
16308 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16309 fi
16310 fi
16311 fi
16312 echo "$as_me:16312: result: $ac_cv_header_stdc" >&5
16313 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16314 if test $ac_cv_header_stdc = yes; then
16315
16316 cat >>confdefs.h <<\EOF
16317 #define STDC_HEADERS 1
16318 EOF
16319
16320 fi
16321
16322 ac_header_dirent=no
16323 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16324   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16325 echo "$as_me:16325: checking for $ac_hdr that defines DIR" >&5
16326 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16327 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16328   echo $ECHO_N "(cached) $ECHO_C" >&6
16329 else
16330   cat >"conftest.$ac_ext" <<_ACEOF
16331 #line 16331 "configure"
16332 #include "confdefs.h"
16333 #include <sys/types.h>
16334 #include <$ac_hdr>
16335
16336 int
16337 main (void)
16338 {
16339 if ((DIR *) 0)
16340 return 0;
16341   ;
16342   return 0;
16343 }
16344 _ACEOF
16345 rm -f "conftest.$ac_objext"
16346 if { (eval echo "$as_me:16346: \"$ac_compile\"") >&5
16347   (eval $ac_compile) 2>&5
16348   ac_status=$?
16349   echo "$as_me:16349: \$? = $ac_status" >&5
16350   (exit "$ac_status"); } &&
16351          { ac_try='test -s "conftest.$ac_objext"'
16352   { (eval echo "$as_me:16352: \"$ac_try\"") >&5
16353   (eval $ac_try) 2>&5
16354   ac_status=$?
16355   echo "$as_me:16355: \$? = $ac_status" >&5
16356   (exit "$ac_status"); }; }; then
16357   eval "$as_ac_Header=yes"
16358 else
16359   echo "$as_me: failed program was:" >&5
16360 cat "conftest.$ac_ext" >&5
16361 eval "$as_ac_Header=no"
16362 fi
16363 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16364 fi
16365 echo "$as_me:16365: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16366 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16367 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16368   cat >>confdefs.h <<EOF
16369 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16370 EOF
16371
16372 ac_header_dirent=$ac_hdr; break
16373 fi
16374
16375 done
16376 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16377 if test $ac_header_dirent = dirent.h; then
16378   echo "$as_me:16378: checking for opendir in -ldir" >&5
16379 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16380 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16381   echo $ECHO_N "(cached) $ECHO_C" >&6
16382 else
16383   ac_check_lib_save_LIBS=$LIBS
16384 LIBS="-ldir  $LIBS"
16385 cat >"conftest.$ac_ext" <<_ACEOF
16386 #line 16386 "configure"
16387 #include "confdefs.h"
16388
16389 /* Override any gcc2 internal prototype to avoid an error.  */
16390 #ifdef __cplusplus
16391 extern "C"
16392 #endif
16393 /* We use char because int might match the return type of a gcc2
16394    builtin and then its argument prototype would still apply.  */
16395 char opendir ();
16396 int
16397 main (void)
16398 {
16399 opendir ();
16400   ;
16401   return 0;
16402 }
16403 _ACEOF
16404 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16405 if { (eval echo "$as_me:16405: \"$ac_link\"") >&5
16406   (eval $ac_link) 2>&5
16407   ac_status=$?
16408   echo "$as_me:16408: \$? = $ac_status" >&5
16409   (exit "$ac_status"); } &&
16410          { ac_try='test -s "conftest$ac_exeext"'
16411   { (eval echo "$as_me:16411: \"$ac_try\"") >&5
16412   (eval $ac_try) 2>&5
16413   ac_status=$?
16414   echo "$as_me:16414: \$? = $ac_status" >&5
16415   (exit "$ac_status"); }; }; then
16416   ac_cv_lib_dir_opendir=yes
16417 else
16418   echo "$as_me: failed program was:" >&5
16419 cat "conftest.$ac_ext" >&5
16420 ac_cv_lib_dir_opendir=no
16421 fi
16422 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16423 LIBS=$ac_check_lib_save_LIBS
16424 fi
16425 echo "$as_me:16425: result: $ac_cv_lib_dir_opendir" >&5
16426 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16427 if test "$ac_cv_lib_dir_opendir" = yes; then
16428   LIBS="$LIBS -ldir"
16429 fi
16430
16431 else
16432   echo "$as_me:16432: checking for opendir in -lx" >&5
16433 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16434 if test "${ac_cv_lib_x_opendir+set}" = set; then
16435   echo $ECHO_N "(cached) $ECHO_C" >&6
16436 else
16437   ac_check_lib_save_LIBS=$LIBS
16438 LIBS="-lx  $LIBS"
16439 cat >"conftest.$ac_ext" <<_ACEOF
16440 #line 16440 "configure"
16441 #include "confdefs.h"
16442
16443 /* Override any gcc2 internal prototype to avoid an error.  */
16444 #ifdef __cplusplus
16445 extern "C"
16446 #endif
16447 /* We use char because int might match the return type of a gcc2
16448    builtin and then its argument prototype would still apply.  */
16449 char opendir ();
16450 int
16451 main (void)
16452 {
16453 opendir ();
16454   ;
16455   return 0;
16456 }
16457 _ACEOF
16458 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16459 if { (eval echo "$as_me:16459: \"$ac_link\"") >&5
16460   (eval $ac_link) 2>&5
16461   ac_status=$?
16462   echo "$as_me:16462: \$? = $ac_status" >&5
16463   (exit "$ac_status"); } &&
16464          { ac_try='test -s "conftest$ac_exeext"'
16465   { (eval echo "$as_me:16465: \"$ac_try\"") >&5
16466   (eval $ac_try) 2>&5
16467   ac_status=$?
16468   echo "$as_me:16468: \$? = $ac_status" >&5
16469   (exit "$ac_status"); }; }; then
16470   ac_cv_lib_x_opendir=yes
16471 else
16472   echo "$as_me: failed program was:" >&5
16473 cat "conftest.$ac_ext" >&5
16474 ac_cv_lib_x_opendir=no
16475 fi
16476 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16477 LIBS=$ac_check_lib_save_LIBS
16478 fi
16479 echo "$as_me:16479: result: $ac_cv_lib_x_opendir" >&5
16480 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16481 if test "$ac_cv_lib_x_opendir" = yes; then
16482   LIBS="$LIBS -lx"
16483 fi
16484
16485 fi
16486
16487 echo "$as_me:16487: checking whether time.h and sys/time.h may both be included" >&5
16488 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16489 if test "${ac_cv_header_time+set}" = set; then
16490   echo $ECHO_N "(cached) $ECHO_C" >&6
16491 else
16492   cat >"conftest.$ac_ext" <<_ACEOF
16493 #line 16493 "configure"
16494 #include "confdefs.h"
16495 #include <sys/types.h>
16496 #include <sys/time.h>
16497 #include <time.h>
16498
16499 int
16500 main (void)
16501 {
16502 if ((struct tm *) 0)
16503 return 0;
16504   ;
16505   return 0;
16506 }
16507 _ACEOF
16508 rm -f "conftest.$ac_objext"
16509 if { (eval echo "$as_me:16509: \"$ac_compile\"") >&5
16510   (eval $ac_compile) 2>&5
16511   ac_status=$?
16512   echo "$as_me:16512: \$? = $ac_status" >&5
16513   (exit "$ac_status"); } &&
16514          { ac_try='test -s "conftest.$ac_objext"'
16515   { (eval echo "$as_me:16515: \"$ac_try\"") >&5
16516   (eval $ac_try) 2>&5
16517   ac_status=$?
16518   echo "$as_me:16518: \$? = $ac_status" >&5
16519   (exit "$ac_status"); }; }; then
16520   ac_cv_header_time=yes
16521 else
16522   echo "$as_me: failed program was:" >&5
16523 cat "conftest.$ac_ext" >&5
16524 ac_cv_header_time=no
16525 fi
16526 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16527 fi
16528 echo "$as_me:16528: result: $ac_cv_header_time" >&5
16529 echo "${ECHO_T}$ac_cv_header_time" >&6
16530 if test $ac_cv_header_time = yes; then
16531
16532 cat >>confdefs.h <<\EOF
16533 #define TIME_WITH_SYS_TIME 1
16534 EOF
16535
16536 fi
16537
16538 ###     checks for compiler characteristics
16539 ac_ext=c
16540 ac_cpp='$CPP $CPPFLAGS'
16541 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16542 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16543 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16544 ac_main_return="return"
16545
16546 echo "$as_me:16546: checking for an ANSI C-conforming const" >&5
16547 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16548 if test "${ac_cv_c_const+set}" = set; then
16549   echo $ECHO_N "(cached) $ECHO_C" >&6
16550 else
16551   cat >"conftest.$ac_ext" <<_ACEOF
16552 #line 16552 "configure"
16553 #include "confdefs.h"
16554
16555 int
16556 main (void)
16557 {
16558 /* FIXME: Include the comments suggested by Paul. */
16559 #ifndef __cplusplus
16560   /* Ultrix mips cc rejects this.  */
16561   typedef int charset[2];
16562   const charset x;
16563   /* SunOS 4.1.1 cc rejects this.  */
16564   char const *const *ccp;
16565   char **p;
16566   /* NEC SVR4.0.2 mips cc rejects this.  */
16567   struct point {int x, y;};
16568   static struct point const zero = {0,0};
16569   /* AIX XL C 1.02.0.0 rejects this.
16570      It does not let you subtract one const X* pointer from another in
16571      an arm of an if-expression whose if-part is not a constant
16572      expression */
16573   const char *g = "string";
16574   ccp = &g + (g ? g-g : 0);
16575   /* HPUX 7.0 cc rejects these. */
16576   ++ccp;
16577   p = (char**) ccp;
16578   ccp = (char const *const *) p;
16579   { /* SCO 3.2v4 cc rejects this.  */
16580     char *t;
16581     char const *s = 0 ? (char *) 0 : (char const *) 0;
16582
16583     *t++ = 0;
16584   }
16585   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16586     int x[] = {25, 17};
16587     const int *foo = &x[0];
16588     ++foo;
16589   }
16590   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16591     typedef const int *iptr;
16592     iptr p = 0;
16593     ++p;
16594   }
16595   { /* AIX XL C 1.02.0.0 rejects this saying
16596        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16597     struct s { int j; const int *ap[3]; };
16598     struct s *b; b->j = 5;
16599   }
16600   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16601     const int foo = 10;
16602   }
16603 #endif
16604
16605   ;
16606   return 0;
16607 }
16608 _ACEOF
16609 rm -f "conftest.$ac_objext"
16610 if { (eval echo "$as_me:16610: \"$ac_compile\"") >&5
16611   (eval $ac_compile) 2>&5
16612   ac_status=$?
16613   echo "$as_me:16613: \$? = $ac_status" >&5
16614   (exit "$ac_status"); } &&
16615          { ac_try='test -s "conftest.$ac_objext"'
16616   { (eval echo "$as_me:16616: \"$ac_try\"") >&5
16617   (eval $ac_try) 2>&5
16618   ac_status=$?
16619   echo "$as_me:16619: \$? = $ac_status" >&5
16620   (exit "$ac_status"); }; }; then
16621   ac_cv_c_const=yes
16622 else
16623   echo "$as_me: failed program was:" >&5
16624 cat "conftest.$ac_ext" >&5
16625 ac_cv_c_const=no
16626 fi
16627 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16628 fi
16629 echo "$as_me:16629: result: $ac_cv_c_const" >&5
16630 echo "${ECHO_T}$ac_cv_c_const" >&6
16631 if test $ac_cv_c_const = no; then
16632
16633 cat >>confdefs.h <<\EOF
16634 #define const
16635 EOF
16636
16637 fi
16638
16639 ###     Checks for external-data
16640
16641 echo "$as_me:16641: checking if data-only library module links" >&5
16642 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16643 if test "${cf_cv_link_dataonly+set}" = set; then
16644   echo $ECHO_N "(cached) $ECHO_C" >&6
16645 else
16646
16647         rm -f conftest.a
16648         cat >conftest.$ac_ext <<EOF
16649 #line 16649 "configure"
16650 int     testdata[3] = { 123, 456, 789 };
16651 EOF
16652         if { (eval echo "$as_me:16652: \"$ac_compile\"") >&5
16653   (eval $ac_compile) 2>&5
16654   ac_status=$?
16655   echo "$as_me:16655: \$? = $ac_status" >&5
16656   (exit "$ac_status"); } ; then
16657                 mv conftest.o data.o && \
16658                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16659         fi
16660         rm -f conftest.$ac_ext data.o
16661         cat >conftest.$ac_ext <<EOF
16662 #line 16662 "configure"
16663 int     testfunc(void)
16664 {
16665 #if defined(NeXT)
16666         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16667 #else
16668         extern int testdata[3];
16669         return testdata[0] == 123
16670            &&  testdata[1] == 456
16671            &&  testdata[2] == 789;
16672 #endif
16673 }
16674 EOF
16675         if { (eval echo "$as_me:16675: \"$ac_compile\"") >&5
16676   (eval $ac_compile) 2>&5
16677   ac_status=$?
16678   echo "$as_me:16678: \$? = $ac_status" >&5
16679   (exit "$ac_status"); }; then
16680                 mv conftest.o func.o && \
16681                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16682         fi
16683         rm -f conftest.$ac_ext func.o
16684         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16685         cf_saveLIBS="$LIBS"
16686         LIBS="conftest.a $LIBS"
16687         if test "$cross_compiling" = yes; then
16688   cf_cv_link_dataonly=unknown
16689 else
16690   cat >"conftest.$ac_ext" <<_ACEOF
16691 #line 16691 "configure"
16692 #include "confdefs.h"
16693
16694         int main(void)
16695         {
16696                 extern int testfunc();
16697                 ${cf_cv_main_return:-return} (!testfunc());
16698         }
16699
16700 _ACEOF
16701 rm -f "conftest$ac_exeext"
16702 if { (eval echo "$as_me:16702: \"$ac_link\"") >&5
16703   (eval $ac_link) 2>&5
16704   ac_status=$?
16705   echo "$as_me:16705: \$? = $ac_status" >&5
16706   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16707   { (eval echo "$as_me:16707: \"$ac_try\"") >&5
16708   (eval $ac_try) 2>&5
16709   ac_status=$?
16710   echo "$as_me:16710: \$? = $ac_status" >&5
16711   (exit "$ac_status"); }; }; then
16712   cf_cv_link_dataonly=yes
16713 else
16714   echo "$as_me: program exited with status $ac_status" >&5
16715 echo "$as_me: failed program was:" >&5
16716 cat "conftest.$ac_ext" >&5
16717 cf_cv_link_dataonly=no
16718 fi
16719 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16720 fi
16721         LIBS="$cf_saveLIBS"
16722
16723 fi
16724
16725 echo "$as_me:16725: result: $cf_cv_link_dataonly" >&5
16726 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16727
16728 if test "$cf_cv_link_dataonly" = no ; then
16729
16730 cat >>confdefs.h <<\EOF
16731 #define BROKEN_LINKER 1
16732 EOF
16733
16734         BROKEN_LINKER=1
16735 fi
16736
16737 ###     Checks for library functions.
16738
16739 for ac_header in \
16740 unistd.h \
16741
16742 do
16743 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16744 echo "$as_me:16744: checking for $ac_header" >&5
16745 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16746 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16747   echo $ECHO_N "(cached) $ECHO_C" >&6
16748 else
16749   cat >"conftest.$ac_ext" <<_ACEOF
16750 #line 16750 "configure"
16751 #include "confdefs.h"
16752 #include <$ac_header>
16753 _ACEOF
16754 if { (eval echo "$as_me:16754: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16755   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16756   ac_status=$?
16757   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16758   rm -f conftest.er1
16759   cat conftest.err >&5
16760   echo "$as_me:16760: \$? = $ac_status" >&5
16761   (exit "$ac_status"); } >/dev/null; then
16762   if test -s conftest.err; then
16763     ac_cpp_err=$ac_c_preproc_warn_flag
16764   else
16765     ac_cpp_err=
16766   fi
16767 else
16768   ac_cpp_err=yes
16769 fi
16770 if test -z "$ac_cpp_err"; then
16771   eval "$as_ac_Header=yes"
16772 else
16773   echo "$as_me: failed program was:" >&5
16774   cat "conftest.$ac_ext" >&5
16775   eval "$as_ac_Header=no"
16776 fi
16777 rm -f conftest.err "conftest.$ac_ext"
16778 fi
16779 echo "$as_me:16779: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16780 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16781 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16782   cat >>confdefs.h <<EOF
16783 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16784 EOF
16785
16786 fi
16787 done
16788
16789 echo "$as_me:16789: checking for working mkstemp" >&5
16790 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16791 if test "${cf_cv_func_mkstemp+set}" = set; then
16792   echo $ECHO_N "(cached) $ECHO_C" >&6
16793 else
16794
16795 rm -rf ./conftest*
16796 if test "$cross_compiling" = yes; then
16797   cf_cv_func_mkstemp=maybe
16798 else
16799   cat >"conftest.$ac_ext" <<_ACEOF
16800 #line 16800 "configure"
16801 #include "confdefs.h"
16802
16803 #include <sys/types.h>
16804 #ifdef HAVE_UNISTD_H
16805 #include <unistd.h>
16806 #endif
16807 #include <stdlib.h>
16808 #include <stdio.h>
16809 #include <string.h>
16810 #include <sys/stat.h>
16811 int main(void)
16812 {
16813         char *tmpl = "conftestXXXXXX";
16814         char name[2][80];
16815         int n;
16816         int result = 0;
16817         int fd;
16818         struct stat sb;
16819
16820         umask(077);
16821         for (n = 0; n < 2; ++n) {
16822                 strcpy(name[n], tmpl);
16823                 if ((fd = mkstemp(name[n])) >= 0) {
16824                         if (!strcmp(name[n], tmpl)
16825                          || stat(name[n], &sb) != 0
16826                          || (sb.st_mode & S_IFMT) != S_IFREG
16827                          || (sb.st_mode & 077) != 0) {
16828                                 result = 1;
16829                         }
16830                         close(fd);
16831                 }
16832         }
16833         if (result == 0
16834          && !strcmp(name[0], name[1]))
16835                 result = 1;
16836         ${cf_cv_main_return:-return}(result);
16837 }
16838
16839 _ACEOF
16840 rm -f "conftest$ac_exeext"
16841 if { (eval echo "$as_me:16841: \"$ac_link\"") >&5
16842   (eval $ac_link) 2>&5
16843   ac_status=$?
16844   echo "$as_me:16844: \$? = $ac_status" >&5
16845   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16846   { (eval echo "$as_me:16846: \"$ac_try\"") >&5
16847   (eval $ac_try) 2>&5
16848   ac_status=$?
16849   echo "$as_me:16849: \$? = $ac_status" >&5
16850   (exit "$ac_status"); }; }; then
16851   cf_cv_func_mkstemp=yes
16852
16853 else
16854   echo "$as_me: program exited with status $ac_status" >&5
16855 echo "$as_me: failed program was:" >&5
16856 cat "conftest.$ac_ext" >&5
16857 cf_cv_func_mkstemp=no
16858
16859 fi
16860 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16861 fi
16862
16863 fi
16864 echo "$as_me:16864: result: $cf_cv_func_mkstemp" >&5
16865 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16866 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16867         echo "$as_me:16867: checking for mkstemp" >&5
16868 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16869 if test "${ac_cv_func_mkstemp+set}" = set; then
16870   echo $ECHO_N "(cached) $ECHO_C" >&6
16871 else
16872   cat >"conftest.$ac_ext" <<_ACEOF
16873 #line 16873 "configure"
16874 #include "confdefs.h"
16875 #define mkstemp autoconf_temporary
16876 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16877 #undef mkstemp
16878
16879 #ifdef __cplusplus
16880 extern "C"
16881 #endif
16882
16883 /* We use char because int might match the return type of a gcc2
16884    builtin and then its argument prototype would still apply.  */
16885 char mkstemp (void);
16886
16887 int
16888 main (void)
16889 {
16890
16891 /* The GNU C library defines stubs for functions which it implements
16892     to always fail with ENOSYS.  Some functions are actually named
16893     something starting with __ and the normal name is an alias.  */
16894 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16895 #error found stub for mkstemp
16896 #endif
16897
16898         return mkstemp ();
16899   ;
16900   return 0;
16901 }
16902 _ACEOF
16903 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16904 if { (eval echo "$as_me:16904: \"$ac_link\"") >&5
16905   (eval $ac_link) 2>&5
16906   ac_status=$?
16907   echo "$as_me:16907: \$? = $ac_status" >&5
16908   (exit "$ac_status"); } &&
16909          { ac_try='test -s "conftest$ac_exeext"'
16910   { (eval echo "$as_me:16910: \"$ac_try\"") >&5
16911   (eval $ac_try) 2>&5
16912   ac_status=$?
16913   echo "$as_me:16913: \$? = $ac_status" >&5
16914   (exit "$ac_status"); }; }; then
16915   ac_cv_func_mkstemp=yes
16916 else
16917   echo "$as_me: failed program was:" >&5
16918 cat "conftest.$ac_ext" >&5
16919 ac_cv_func_mkstemp=no
16920 fi
16921 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16922 fi
16923 echo "$as_me:16923: result: $ac_cv_func_mkstemp" >&5
16924 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16925
16926 fi
16927 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16928
16929 cat >>confdefs.h <<\EOF
16930 #define HAVE_MKSTEMP 1
16931 EOF
16932
16933 fi
16934
16935 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16936         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
16937         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
16938 fi
16939
16940 cf_with_ada=yes
16941 if test "$cf_with_ada" != "no" ; then
16942
16943 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16944 do
16945
16946 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16947
16948         unset ac_cv_path_cf_TEMP_gnat
16949         unset cf_TEMP_gnat
16950         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16951 set dummy $cf_prog_gnat; ac_word=$2
16952 echo "$as_me:16952: checking for $ac_word" >&5
16953 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16954 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16955   echo $ECHO_N "(cached) $ECHO_C" >&6
16956 else
16957   case $cf_TEMP_gnat in
16958   [\\/]* | ?:[\\/]*)
16959   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16960   ;;
16961   *)
16962   ac_save_IFS=$IFS; IFS=$ac_path_separator
16963 ac_dummy="$PATH"
16964 for ac_dir in $ac_dummy; do
16965   IFS=$ac_save_IFS
16966   test -z "$ac_dir" && ac_dir=.
16967   if $as_executable_p "$ac_dir/$ac_word"; then
16968    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16969    echo "$as_me:16969: found $ac_dir/$ac_word" >&5
16970    break
16971 fi
16972 done
16973
16974   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16975   ;;
16976 esac
16977 fi
16978 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16979
16980 if test -n "$cf_TEMP_gnat"; then
16981   echo "$as_me:16981: result: $cf_TEMP_gnat" >&5
16982 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16983 else
16984   echo "$as_me:16984: result: no" >&5
16985 echo "${ECHO_T}no" >&6
16986 fi
16987
16988         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
16989
16990         if test "x$cf_TEMP_gnat" != xno; then
16991                 unset cf_cv_gnat_version
16992                 unset cf_TEMP_gnat
16993
16994 echo "$as_me:16994: checking for $cf_prog_gnat version" >&5
16995 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16996 if test "${cf_cv_gnat_version+set}" = set; then
16997   echo $ECHO_N "(cached) $ECHO_C" >&6
16998 else
16999
17000 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17001         grep '[0-9].[0-9][0-9]*' |\
17002         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17003
17004 fi
17005 echo "$as_me:17005: result: $cf_cv_gnat_version" >&5
17006 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17007 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17008 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17009
17010         fi
17011         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17012
17013         unset cf_TEMP_gnat
17014         unset cf_cv_gnat_version
17015         unset ac_cv_path_cf_TEMP_gnat
17016 done
17017
17018 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17019         cf_ada_make=
17020         cf_cv_prog_gnat_correct=no
17021 else
17022         cf_ada_make=gnatmake
17023         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17024                 # gprconfig is newer than gnatmake; we can continue...
17025                 cf_ada_config="##"
17026         else
17027                 rm -rf ./conftest* ./*~conftest*
17028                 if mkdir conftest.src
17029                 then
17030                         cf_ada_config=""
17031                         cd conftest.src
17032                         for cf_gprconfig in Ada C
17033                         do
17034                                 echo "$as_me:17034: checking for gprconfig name for $cf_gprconfig" >&5
17035 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17036                                 if test "$cf_gprconfig" = C
17037                                 then
17038                                         for cf_gprconfig_param in \
17039                                                 "$cf_gprconfig,,,,GNATGCC" \
17040                                                 "$cf_gprconfig,,,,GCC" \
17041                                                 "$cf_gprconfig"
17042                                         do
17043                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17044                                                 test -n "$cf_gprconfig_value" && break
17045                                         done
17046                                 else
17047                                         cf_gprconfig_param=$cf_gprconfig
17048                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17049                                 fi
17050                                 if test -n "$cf_gprconfig_value"
17051                                 then
17052                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17053                                         echo "$as_me:17053: result: $cf_gprconfig_value" >&5
17054 echo "${ECHO_T}$cf_gprconfig_value" >&6
17055                                 else
17056                                         echo "$as_me:17056: result: missing" >&5
17057 echo "${ECHO_T}missing" >&6
17058                                         cf_ada_config="#"
17059                                         break
17060                                 fi
17061                         done
17062                         cd ..
17063                         rm -rf ./conftest* ./*~conftest*
17064                 fi
17065         fi
17066         if test "x$cf_ada_config" != "x#"
17067         then
17068
17069 echo "$as_me:17069: checking for gnat version" >&5
17070 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17071 if test "${cf_cv_gnat_version+set}" = set; then
17072   echo $ECHO_N "(cached) $ECHO_C" >&6
17073 else
17074
17075 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17076         grep '[0-9].[0-9][0-9]*' |\
17077         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17078
17079 fi
17080 echo "$as_me:17080: result: $cf_cv_gnat_version" >&5
17081 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17082 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17083
17084 case "$cf_cv_gnat_version" in
17085 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17086         cf_cv_prog_gnat_correct=yes
17087         ;;
17088 (*)
17089         { echo "$as_me:17089: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17090 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17091         cf_cv_prog_gnat_correct=no
17092         ;;
17093 esac
17094
17095                 # Extract the first word of "m4", so it can be a program name with args.
17096 set dummy m4; ac_word=$2
17097 echo "$as_me:17097: checking for $ac_word" >&5
17098 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17099 if test "${ac_cv_prog_M4_exists+set}" = set; then
17100   echo $ECHO_N "(cached) $ECHO_C" >&6
17101 else
17102   if test -n "$M4_exists"; then
17103   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17104 else
17105   ac_save_IFS=$IFS; IFS=$ac_path_separator
17106 ac_dummy="$PATH"
17107 for ac_dir in $ac_dummy; do
17108   IFS=$ac_save_IFS
17109   test -z "$ac_dir" && ac_dir=.
17110   $as_executable_p "$ac_dir/$ac_word" || continue
17111 ac_cv_prog_M4_exists="yes"
17112 echo "$as_me:17112: found $ac_dir/$ac_word" >&5
17113 break
17114 done
17115
17116   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17117 fi
17118 fi
17119 M4_exists=$ac_cv_prog_M4_exists
17120 if test -n "$M4_exists"; then
17121   echo "$as_me:17121: result: $M4_exists" >&5
17122 echo "${ECHO_T}$M4_exists" >&6
17123 else
17124   echo "$as_me:17124: result: no" >&5
17125 echo "${ECHO_T}no" >&6
17126 fi
17127
17128                 if test "$ac_cv_prog_M4_exists" = no; then
17129                         cf_cv_prog_gnat_correct=no
17130                         { echo "$as_me:17130: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17131 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17132                 fi
17133                 if test "$cf_cv_prog_gnat_correct" = yes; then
17134                         echo "$as_me:17134: checking if GNAT works" >&5
17135 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17136
17137 rm -rf ./conftest* ./*~conftest*
17138 cat >>conftest.ads <<CF_EOF
17139 procedure conftest;
17140 CF_EOF
17141 cat >>conftest.adb <<CF_EOF
17142 with Text_IO;
17143 with GNAT.OS_Lib;
17144 procedure conftest is
17145 begin
17146    Text_IO.Put ("Hello World");
17147    Text_IO.New_Line;
17148    GNAT.OS_Lib.OS_Exit (0);
17149 end conftest;
17150 CF_EOF
17151 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17152    if ( ./conftest 1>&5 2>&1 ) ; then
17153       cf_cv_prog_gnat_correct=yes
17154    else
17155       cf_cv_prog_gnat_correct=no
17156    fi
17157 else
17158    cf_cv_prog_gnat_correct=no
17159 fi
17160 rm -rf ./conftest* ./*~conftest*
17161
17162                         echo "$as_me:17162: result: $cf_cv_prog_gnat_correct" >&5
17163 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17164                 fi
17165         else
17166                 cf_cv_prog_gnat_correct=no
17167         fi
17168 fi
17169
17170         if test "$cf_cv_prog_gnat_correct" = yes; then
17171
17172         echo "$as_me:17172: checking optimization options for ADAFLAGS" >&5
17173 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17174         case "$CFLAGS" in
17175         (*-g*)
17176
17177         ADAFLAGS="$ADAFLAGS -g"
17178
17179                 ;;
17180         esac
17181         case "$CFLAGS" in
17182         (*-O*)
17183                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17184
17185         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17186
17187                 ;;
17188         esac
17189         echo "$as_me:17189: result: $ADAFLAGS" >&5
17190 echo "${ECHO_T}$ADAFLAGS" >&6
17191
17192 echo "$as_me:17192: checking if GNATPREP supports -T option" >&5
17193 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17194 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17195   echo $ECHO_N "(cached) $ECHO_C" >&6
17196 else
17197
17198 cf_cv_gnatprep_opt_t=no
17199 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17200
17201 fi
17202 echo "$as_me:17202: result: $cf_cv_gnatprep_opt_t" >&5
17203 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17204 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17205
17206 echo "$as_me:17206: checking if GNAT supports generics" >&5
17207 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17208 case "$cf_cv_gnat_version" in
17209 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17210         cf_gnat_generics=yes
17211         ;;
17212 (*)
17213         cf_gnat_generics=no
17214         ;;
17215 esac
17216 echo "$as_me:17216: result: $cf_gnat_generics" >&5
17217 echo "${ECHO_T}$cf_gnat_generics" >&6
17218
17219 if test "$cf_gnat_generics" = yes
17220 then
17221         cf_compile_generics=generics
17222         cf_generic_objects="\${GENOBJS}"
17223 else
17224         cf_compile_generics=
17225         cf_generic_objects=
17226 fi
17227
17228 echo "$as_me:17228: checking if GNAT supports SIGINT" >&5
17229 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17230 if test "${cf_cv_gnat_sigint+set}" = set; then
17231   echo $ECHO_N "(cached) $ECHO_C" >&6
17232 else
17233
17234 rm -rf ./conftest* ./*~conftest*
17235 cat >>conftest.ads <<CF_EOF
17236 with Ada.Interrupts.Names;
17237
17238 package ConfTest is
17239
17240    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17241    pragma Unreserve_All_Interrupts;
17242    pragma Warnings (On);
17243
17244    protected Process is
17245       procedure Stop;
17246       function Continue return Boolean;
17247       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17248    private
17249       Done : Boolean := False;
17250    end Process;
17251
17252 end ConfTest;
17253 CF_EOF
17254 cat >>conftest.adb <<CF_EOF
17255 package body ConfTest is
17256    protected body Process is
17257       procedure Stop is
17258       begin
17259          Done := True;
17260       end Stop;
17261       function Continue return Boolean is
17262       begin
17263          return not Done;
17264       end Continue;
17265    end Process;
17266 end ConfTest;
17267 CF_EOF
17268 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17269       cf_cv_gnat_sigint=yes
17270 else
17271    cf_cv_gnat_sigint=no
17272 fi
17273 rm -rf ./conftest* ./*~conftest*
17274
17275 fi
17276 echo "$as_me:17276: result: $cf_cv_gnat_sigint" >&5
17277 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17278
17279 if test "$cf_cv_gnat_sigint" = yes ; then
17280         USE_GNAT_SIGINT=""
17281 else
17282         USE_GNAT_SIGINT="#"
17283 fi
17284
17285 cf_gnat_libraries=no
17286 cf_gnat_projects=no
17287
17288 if test "$enable_gnat_projects" != no ; then
17289 echo "$as_me:17289: checking if GNAT supports project files" >&5
17290 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17291 case "$cf_cv_gnat_version" in
17292 (3.[0-9]*)
17293         ;;
17294 (*)
17295         case "$cf_cv_system_name" in
17296         (cygwin*|msys*)
17297                 ;;
17298         (*)
17299                 rm -rf ./conftest* ./*~conftest*
17300                 if mkdir conftest.src conftest.bin conftest.lib
17301                 then
17302                         cd conftest.src
17303                         rm -rf ./conftest* ./*~conftest*
17304                         cat >>library.gpr <<CF_EOF
17305 project Library is
17306   Kind := External ("LIB_KIND");
17307   for Library_Name use "ConfTest";
17308   for Object_Dir use ".";
17309   for Library_ALI_Dir use External("LIBRARY_DIR");
17310   for Library_Version use External ("SONAME");
17311   for Library_Kind use Kind;
17312   for Library_Dir use External("BUILD_DIR");
17313   Source_Dir := External ("SOURCE_DIR");
17314   for Source_Dirs use (Source_Dir);
17315 end Library;
17316 CF_EOF
17317                         cat >>confpackage.ads <<CF_EOF
17318 package ConfPackage is
17319    procedure conftest;
17320 end ConfPackage;
17321 CF_EOF
17322                         cat >>confpackage.adb <<CF_EOF
17323 with Text_IO;
17324 package body ConfPackage is
17325    procedure conftest is
17326    begin
17327       Text_IO.Put ("Hello World");
17328       Text_IO.New_Line;
17329    end conftest;
17330 end ConfPackage;
17331 CF_EOF
17332                         if ( "$cf_ada_make" $ADAFLAGS \
17333                                         -Plibrary.gpr \
17334                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17335                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17336                                         -XSOURCE_DIR="`pwd`" \
17337                                         -XSONAME=libConfTest.so.1 \
17338                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17339                                 cf_gnat_projects=yes
17340                         fi
17341                         cd ..
17342                 fi
17343                 if test -f conftest.lib/confpackage.ali
17344                 then
17345                         cf_gnat_libraries=yes
17346                 fi
17347                 rm -rf ./conftest* ./*~conftest*
17348                 ;;
17349         esac
17350         ;;
17351 esac
17352 echo "$as_me:17352: result: $cf_gnat_projects" >&5
17353 echo "${ECHO_T}$cf_gnat_projects" >&6
17354 fi # enable_gnat_projects
17355
17356 if test "$cf_gnat_projects" = yes
17357 then
17358         echo "$as_me:17358: checking if GNAT supports libraries" >&5
17359 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17360         echo "$as_me:17360: result: $cf_gnat_libraries" >&5
17361 echo "${ECHO_T}$cf_gnat_libraries" >&6
17362 fi
17363
17364 USE_OLD_MAKERULES=""
17365 USE_GNAT_PROJECTS="#"
17366 USE_GNAT_MAKE_GPR="#"
17367 USE_GNAT_GPRBUILD="#"
17368
17369 if test "$cf_gnat_projects" = yes
17370 then
17371         USE_OLD_MAKERULES="#"
17372         USE_GNAT_PROJECTS=""
17373         if test "$cf_cv_VERSION_GPRBUILD" != no
17374         then
17375                 USE_GNAT_GPRBUILD=""
17376         elif test "$cf_cv_VERSION_GNATMAKE" != no
17377         then
17378                 USE_GNAT_MAKE_GPR=""
17379         else
17380                 { echo "$as_me:17380: WARNING: use old makefile rules since tools are missing" >&5
17381 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17382         fi
17383 fi
17384
17385 if test "$cf_gnat_libraries" = yes
17386 then
17387         USE_GNAT_LIBRARIES=""
17388 else
17389         USE_GNAT_LIBRARIES="#"
17390 fi
17391
17392 echo "$as_me:17392: checking for ada-compiler" >&5
17393 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17394
17395 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17396 if test "${with_ada_compiler+set}" = set; then
17397   withval="$with_ada_compiler"
17398   cf_ada_compiler=$withval
17399 else
17400   cf_ada_compiler=gnatmake
17401 fi;
17402
17403 echo "$as_me:17403: result: $cf_ada_compiler" >&5
17404 echo "${ECHO_T}$cf_ada_compiler" >&6
17405
17406                 cf_ada_package=terminal_interface
17407
17408 echo "$as_me:17408: checking for ada-include" >&5
17409 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17410
17411 # Check whether --with-ada-include or --without-ada-include was given.
17412 if test "${with_ada_include+set}" = set; then
17413   withval="$with_ada_include"
17414
17415 else
17416   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17417 fi; if test -n "$prefix/share/ada/adainclude" ; then
17418
17419 if test "x$prefix" != xNONE; then
17420         cf_path_syntax="$prefix"
17421 else
17422         cf_path_syntax="$ac_default_prefix"
17423 fi
17424
17425 case ".$withval" in
17426 (.\$\(*\)*|.\'*\'*)
17427         ;;
17428 (..|./*|.\\*)
17429         ;;
17430 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17431         ;;
17432 (.\$\{*prefix\}*|.\$\{*dir\}*)
17433         eval withval="$withval"
17434         case ".$withval" in
17435         (.NONE/*)
17436                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17437                 ;;
17438         esac
17439         ;;
17440 (.no|.NONE/*)
17441         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17442         ;;
17443 (*)
17444         { { echo "$as_me:17444: error: expected a pathname, not \"$withval\"" >&5
17445 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17446    { (exit 1); exit 1; }; }
17447         ;;
17448 esac
17449
17450 fi
17451 eval ADA_INCLUDE="$withval"
17452
17453 echo "$as_me:17453: result: $ADA_INCLUDE" >&5
17454 echo "${ECHO_T}$ADA_INCLUDE" >&6
17455
17456 echo "$as_me:17456: checking for ada-objects" >&5
17457 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17458
17459 # Check whether --with-ada-objects or --without-ada-objects was given.
17460 if test "${with_ada_objects+set}" = set; then
17461   withval="$with_ada_objects"
17462
17463 else
17464   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17465 fi; if test -n "$prefix/lib/ada/adalib" ; then
17466
17467 if test "x$prefix" != xNONE; then
17468         cf_path_syntax="$prefix"
17469 else
17470         cf_path_syntax="$ac_default_prefix"
17471 fi
17472
17473 case ".$withval" in
17474 (.\$\(*\)*|.\'*\'*)
17475         ;;
17476 (..|./*|.\\*)
17477         ;;
17478 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17479         ;;
17480 (.\$\{*prefix\}*|.\$\{*dir\}*)
17481         eval withval="$withval"
17482         case ".$withval" in
17483         (.NONE/*)
17484                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17485                 ;;
17486         esac
17487         ;;
17488 (.no|.NONE/*)
17489         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17490         ;;
17491 (*)
17492         { { echo "$as_me:17492: error: expected a pathname, not \"$withval\"" >&5
17493 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17494    { (exit 1); exit 1; }; }
17495         ;;
17496 esac
17497
17498 fi
17499 eval ADA_OBJECTS="$withval"
17500
17501 echo "$as_me:17501: result: $ADA_OBJECTS" >&5
17502 echo "${ECHO_T}$ADA_OBJECTS" >&6
17503
17504 echo "$as_me:17504: checking if an Ada95 shared-library should be built" >&5
17505 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17506
17507 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17508 if test "${with_ada_sharedlib+set}" = set; then
17509   withval="$with_ada_sharedlib"
17510   with_ada_sharedlib=$withval
17511 else
17512   with_ada_sharedlib=no
17513 fi;
17514 echo "$as_me:17514: result: $with_ada_sharedlib" >&5
17515 echo "${ECHO_T}$with_ada_sharedlib" >&6
17516
17517 if test "x$with_ada_sharedlib" != xno
17518 then
17519         if test "x$cf_gnat_projects" != xyes
17520         then
17521                 { echo "$as_me:17521: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17522 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17523                 with_ada_sharedlib=no
17524         fi
17525 fi
17526
17527 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17528 MAKE_ADA_SHAREDLIB="#"
17529
17530 if test "x$with_ada_sharedlib" != xno
17531 then
17532         MAKE_ADA_SHAREDLIB=
17533         if test "x$with_ada_sharedlib" != xyes
17534         then
17535                 ADA_SHAREDLIB="$with_ada_sharedlib"
17536         fi
17537 fi
17538
17539                 # allow the Ada binding to be renamed
17540
17541 echo "$as_me:17541: checking for ada-libname" >&5
17542 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17543
17544 # Check whether --with-ada-libname or --without-ada-libname was given.
17545 if test "${with_ada_libname+set}" = set; then
17546   withval="$with_ada_libname"
17547   ADA_LIBNAME=$withval
17548 else
17549   ADA_LIBNAME=AdaCurses
17550 fi;
17551 case "x$ADA_LIBNAME" in
17552 (x|xyes|xno)
17553         ADA_LIBNAME=AdaCurses
17554         ;;
17555 esac
17556
17557 echo "$as_me:17557: result: $ADA_LIBNAME" >&5
17558 echo "${ECHO_T}$ADA_LIBNAME" >&6
17559
17560         else
17561                 { { echo "$as_me:17561: error: No usable Ada compiler found" >&5
17562 echo "$as_me: error: No usable Ada compiler found" >&2;}
17563    { (exit 1); exit 1; }; }
17564         fi
17565 else
17566         { { echo "$as_me:17566: error: The Ada compiler is needed for this package" >&5
17567 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17568    { (exit 1); exit 1; }; }
17569 fi
17570
17571 ################################################################################
17572
17573 # not needed
17574 TINFO_LDFLAGS2=
17575
17576 TINFO_LIBS=
17577
17578 ### Construct the list of include-directories to be generated
17579
17580 if test "$srcdir" != "."; then
17581         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17582 fi
17583 CPPFLAGS="-I../include $CPPFLAGS"
17584 if test "$srcdir" != "."; then
17585         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17586 fi
17587 CPPFLAGS="-I. $CPPFLAGS"
17588
17589 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17590 if test "$srcdir" != "."; then
17591         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17592 fi
17593 if test "$GCC" != yes; then
17594         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17595 elif test "$includedir" != "/usr/include"; then
17596         if test "$includedir" = '${prefix}/include' ; then
17597                 if test x$prefix != x/usr ; then
17598                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17599                 fi
17600         else
17601                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17602         fi
17603 fi
17604
17605 ### Build up pieces for makefile rules
17606 echo "$as_me:17606: checking default library suffix" >&5
17607 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17608
17609         case $DFT_LWR_MODEL in
17610         (libtool) DFT_ARG_SUFFIX=''   ;;
17611         (normal)  DFT_ARG_SUFFIX=''   ;;
17612         (debug)   DFT_ARG_SUFFIX='_g' ;;
17613         (profile) DFT_ARG_SUFFIX='_p' ;;
17614         (shared)  DFT_ARG_SUFFIX=''   ;;
17615         esac
17616         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17617 echo "$as_me:17617: result: $DFT_ARG_SUFFIX" >&5
17618 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17619
17620 echo "$as_me:17620: checking default library-dependency suffix" >&5
17621 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17622
17623         case X$DFT_LWR_MODEL in
17624         (Xlibtool)
17625                 DFT_LIB_SUFFIX='.la'
17626                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17627                 ;;
17628         (Xdebug)
17629                 case "$cf_cv_system_name" in
17630                 (*-msvc*)
17631                         DFT_LIB_SUFFIX='_g.lib'
17632                         ;;
17633                 (*)
17634                         DFT_LIB_SUFFIX='_g.a'
17635                         ;;
17636                 esac
17637                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17638                 ;;
17639         (Xprofile)
17640                 case "$cf_cv_system_name" in
17641                 (*-msvc*)
17642                         DFT_LIB_SUFFIX='_p.lib'
17643                         ;;
17644                 (*)
17645                         DFT_LIB_SUFFIX='_p.a'
17646                         ;;
17647                 esac
17648                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17649                 ;;
17650         (Xshared)
17651                 case "$cf_cv_system_name" in
17652                 (aix[5-7]*)
17653                         DFT_LIB_SUFFIX='.so'
17654                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17655                         ;;
17656                 (*-msvc*)
17657                         DFT_LIB_SUFFIX='.dll'
17658                         DFT_DEP_SUFFIX='.dll.lib'
17659                         ;;
17660                 (cygwin*|msys*|mingw*)
17661                         DFT_LIB_SUFFIX='.dll'
17662                         DFT_DEP_SUFFIX='.dll.a'
17663                         ;;
17664                 (darwin*)
17665                         DFT_LIB_SUFFIX='.dylib'
17666                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17667                         ;;
17668                 (hpux*)
17669                         case "$target" in
17670                         (ia64*)
17671                                 DFT_LIB_SUFFIX='.so'
17672                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17673                                 ;;
17674                         (*)
17675                                 DFT_LIB_SUFFIX='.sl'
17676                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17677                                 ;;
17678                         esac
17679                         ;;
17680                 (*)
17681                         DFT_LIB_SUFFIX='.so'
17682                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17683                         ;;
17684                 esac
17685                 ;;
17686         (*)
17687                 case "$target" in
17688                 (*-msvc*)
17689                         DFT_LIB_SUFFIX='.lib'
17690                         ;;
17691                 (*)
17692                         DFT_LIB_SUFFIX='.a'
17693                         ;;
17694                 esac
17695                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17696                 ;;
17697         esac
17698         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17699         then
17700                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17701                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17702         fi
17703 echo "$as_me:17703: result: $DFT_DEP_SUFFIX" >&5
17704 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17705
17706 echo "$as_me:17706: checking default object directory" >&5
17707 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17708
17709         case $DFT_LWR_MODEL in
17710         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17711         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17712         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17713         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17714         (shared)
17715                 case "$cf_cv_system_name" in
17716                 (cygwin|msys)
17717                         DFT_OBJ_SUBDIR='objects' ;;
17718                 (*)
17719                         DFT_OBJ_SUBDIR='obj_s' ;;
17720                 esac
17721         esac
17722 echo "$as_me:17722: result: $DFT_OBJ_SUBDIR" >&5
17723 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17724
17725 ### Set up low-level terminfo dependencies for makefiles.
17726
17727 if test "$DFT_LWR_MODEL" = shared ; then
17728         case $cf_cv_system_name in
17729         (cygwin*)
17730                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17731                 ;;
17732         (msys*)
17733                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17734                 ;;
17735         esac
17736 fi
17737
17738 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17739
17740 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17741
17742 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17743
17744 ### Construct the list of subdirectories for which we'll customize makefiles
17745 ### with the appropriate compile-rules.
17746
17747 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17748
17749 cat >>confdefs.h <<EOF
17750 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17751 EOF
17752
17753 ################################################################################
17754
17755 TEST_ARG2=
17756
17757 TEST_LIBS2=
17758
17759 NCURSES_SHLIB2="sh -c"
17760
17761 ADA_SUBDIRS="include gen src doc"
17762 if test "x$cf_with_tests" != "xno" ; then
17763         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17764 fi
17765 for cf_dir in $ADA_SUBDIRS
17766 do
17767         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17768 done
17769
17770 NCURSES_TREE="#"
17771
17772 EXTERNAL_TREE=
17773
17774 # match layout used by make-tar.sh
17775 ADAHTML_DIR=../doc/ada
17776
17777 if test "x$cross_compiling" = xyes ; then
17778         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17779 else
17780         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17781 fi
17782
17783 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"
17784 ac_config_commands="$ac_config_commands default"
17785 cat >confcache <<\_ACEOF
17786 # This file is a shell script that caches the results of configure
17787 # tests run on this system so they can be shared between configure
17788 # scripts and configure runs, see configure's option --config-cache.
17789 # It is not useful on other systems.  If it contains results you don't
17790 # want to keep, you may remove or edit it.
17791 #
17792 # config.status only pays attention to the cache file if you give it
17793 # the --recheck option to rerun configure.
17794 #
17795 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17796 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17797 # following values.
17798
17799 _ACEOF
17800
17801 # The following way of writing the cache mishandles newlines in values,
17802 # but we know of no workaround that is simple, portable, and efficient.
17803 # So, don't put newlines in cache variables' values.
17804 # Ultrix sh set writes to stderr and can't be redirected directly,
17805 # and sets the high bit in the cache file unless we assign to the vars.
17806 {
17807   (set) 2>&1 |
17808     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17809     *ac_space=\ *)
17810       # `set' does not quote correctly, so add quotes (double-quote
17811       # substitution turns \\\\ into \\, and sed turns \\ into \).
17812       sed -n \
17813         "s/'/'\\\\''/g;
17814           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17815       ;;
17816     *)
17817       # `set' quotes correctly as required by POSIX, so do not add quotes.
17818       sed -n \
17819         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17820       ;;
17821     esac;
17822 } |
17823   sed '
17824      t clear
17825      : clear
17826      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17827      t end
17828      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17829      : end' >>confcache
17830 if cmp -s $cache_file confcache; then :; else
17831   if test -w $cache_file; then
17832     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17833     cat confcache >$cache_file
17834   else
17835     echo "not updating unwritable cache $cache_file"
17836   fi
17837 fi
17838 rm -f confcache
17839
17840 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17841 # Let make expand exec_prefix.
17842 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17843
17844 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17845 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17846 # trailing colons and then remove the whole line if VPATH becomes empty
17847 # (actually we leave an empty line to preserve line numbers).
17848 if test "x$srcdir" = x.; then
17849   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17850 s/:*\$(srcdir):*/:/;
17851 s/:*\${srcdir}:*/:/;
17852 s/:*@srcdir@:*/:/;
17853 s/^\([^=]*=[    ]*\):*/\1/;
17854 s/:*$//;
17855 s/^[^=]*=[      ]*$//;
17856 }'
17857 fi
17858
17859 DEFS=-DHAVE_CONFIG_H
17860
17861 : "${CONFIG_STATUS=./config.status}"
17862 ac_clean_files_save=$ac_clean_files
17863 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17864 { echo "$as_me:17864: creating $CONFIG_STATUS" >&5
17865 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17866 cat >"$CONFIG_STATUS" <<_ACEOF
17867 #! $SHELL
17868 # Generated automatically by configure.
17869 # Run this file to recreate the current configuration.
17870 # Compiler output produced by configure, useful for debugging
17871 # configure, is in config.log if it exists.
17872
17873 debug=false
17874 SHELL=\${CONFIG_SHELL-$SHELL}
17875 ac_cs_invocation="\$0 \$@"
17876
17877 CLICOLOR_FORCE= GREP_OPTIONS=
17878 unset CLICOLOR_FORCE GREP_OPTIONS
17879 _ACEOF
17880
17881 cat >>"$CONFIG_STATUS" <<\_ACEOF
17882 # Be Bourne compatible
17883 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17884   emulate sh
17885   NULLCMD=:
17886 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17887   set -o posix
17888 fi
17889
17890 # Name of the executable.
17891 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17892
17893 if expr a : '\(a\)' >/dev/null 2>&1; then
17894   as_expr=expr
17895 else
17896   as_expr=false
17897 fi
17898
17899 rm -f conf$$ conf$$.exe conf$$.file
17900 echo >conf$$.file
17901 if ln -s conf$$.file conf$$ 2>/dev/null; then
17902   # We could just check for DJGPP; but this test a) works b) is more generic
17903   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17904   if test -f conf$$.exe; then
17905     # Don't use ln at all; we don't have any links
17906     as_ln_s='cp -p'
17907   else
17908     as_ln_s='ln -s'
17909   fi
17910 elif ln conf$$.file conf$$ 2>/dev/null; then
17911   as_ln_s=ln
17912 else
17913   as_ln_s='cp -p'
17914 fi
17915 rm -f conf$$ conf$$.exe conf$$.file
17916
17917 as_executable_p="test -f"
17918
17919 # Support unset when possible.
17920 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17921   as_unset="unset"
17922 else
17923   as_unset="false"
17924 fi
17925
17926 # NLS nuisances.
17927 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17928 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17929 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17930 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17931 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17932 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17933 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17934 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17935
17936 # IFS
17937 # We need space, tab and new line, in precisely that order.
17938 as_nl='
17939 '
17940 IFS="   $as_nl"
17941
17942 # CDPATH.
17943 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17944
17945 exec 6>&1
17946
17947 _ACEOF
17948
17949 # Files that config.status was made for.
17950 if test -n "$ac_config_files"; then
17951   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
17952 fi
17953
17954 if test -n "$ac_config_headers"; then
17955   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
17956 fi
17957
17958 if test -n "$ac_config_links"; then
17959   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
17960 fi
17961
17962 if test -n "$ac_config_commands"; then
17963   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
17964 fi
17965
17966 cat >>"$CONFIG_STATUS" <<\EOF
17967
17968 ac_cs_usage="\
17969 \`$as_me' instantiates files from templates according to the
17970 current configuration.
17971
17972 Usage: $0 [OPTIONS] [FILE]...
17973
17974   -h, --help       print this help, then exit
17975   -V, --version    print version number, then exit
17976   -d, --debug      don't remove temporary files
17977       --recheck    update $as_me by reconfiguring in the same conditions
17978   --file=FILE[:TEMPLATE]
17979                    instantiate the configuration file FILE
17980   --header=FILE[:TEMPLATE]
17981                    instantiate the configuration header FILE
17982
17983 Configuration files:
17984 $config_files
17985
17986 Configuration headers:
17987 $config_headers
17988
17989 Configuration commands:
17990 $config_commands
17991
17992 Report bugs to <dickey@invisible-island.net>."
17993 EOF
17994
17995 cat >>"$CONFIG_STATUS" <<EOF
17996 ac_cs_version="\\
17997 config.status
17998 configured by $0, generated by GNU Autoconf 2.52.20210509,
17999   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18000
18001 Copyright 2003-2020,2021        Thomas E. Dickey
18002 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18003 Free Software Foundation, Inc.
18004 This config.status script is free software; the Free Software Foundation
18005 gives unlimited permission to copy, distribute and modify it."
18006 srcdir="$srcdir"
18007 INSTALL="$INSTALL"
18008 EOF
18009
18010 cat >>"$CONFIG_STATUS" <<\EOF
18011 # If no file are specified by the user, then we need to provide default
18012 # value.  By we need to know if files were specified by the user.
18013 ac_need_defaults=:
18014 while test $# != 0
18015 do
18016   case $1 in
18017   --*=*)
18018     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18019     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18020     shift
18021     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18022     shift
18023     ;;
18024   -*);;
18025   *) # This is not an option, so the user has probably given explicit
18026      # arguments.
18027      ac_need_defaults=false;;
18028   esac
18029
18030   case $1 in
18031   # Handling of the options.
18032 EOF
18033 cat >>"$CONFIG_STATUS" <<EOF
18034   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18035     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18036     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18037 EOF
18038 cat >>"$CONFIG_STATUS" <<\EOF
18039   --version | --vers* | -V )
18040     echo "$ac_cs_version"; exit 0 ;;
18041   --he | --h)
18042     # Conflict between --help and --header
18043     { { echo "$as_me:18043: error: ambiguous option: $1
18044 Try \`$0 --help' for more information." >&5
18045 echo "$as_me: error: ambiguous option: $1
18046 Try \`$0 --help' for more information." >&2;}
18047    { (exit 1); exit 1; }; };;
18048   --help | --hel | -h )
18049     echo "$ac_cs_usage"; exit 0 ;;
18050   --debug | --d* | -d )
18051     debug=: ;;
18052   --file | --fil | --fi | --f )
18053     shift
18054     CONFIG_FILES="$CONFIG_FILES $1"
18055     ac_need_defaults=false;;
18056   --header | --heade | --head | --hea )
18057     shift
18058     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18059     ac_need_defaults=false;;
18060
18061   # This is an error.
18062   -*) { { echo "$as_me:18062: error: unrecognized option: $1
18063 Try \`$0 --help' for more information." >&5
18064 echo "$as_me: error: unrecognized option: $1
18065 Try \`$0 --help' for more information." >&2;}
18066    { (exit 1); exit 1; }; } ;;
18067
18068   *) ac_config_targets="$ac_config_targets $1" ;;
18069
18070   esac
18071   shift
18072 done
18073
18074 exec 5>>config.log
18075 cat >&5 << _ACEOF
18076
18077 ## ----------------------- ##
18078 ## Running config.status.  ##
18079 ## ----------------------- ##
18080
18081 This file was extended by $as_me 2.52.20210509, executed with
18082   CONFIG_FILES    = $CONFIG_FILES
18083   CONFIG_HEADERS  = $CONFIG_HEADERS
18084   CONFIG_LINKS    = $CONFIG_LINKS
18085   CONFIG_COMMANDS = $CONFIG_COMMANDS
18086   > "$ac_cs_invocation"
18087 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18088
18089 _ACEOF
18090 EOF
18091
18092 cat >>"$CONFIG_STATUS" <<EOF
18093 #
18094 # INIT-COMMANDS section.
18095 #
18096
18097 ### Special initialization commands, used to pass information from the
18098 ### configuration-run into config.status
18099
18100 AWK="$AWK"
18101 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18102 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18103 LIB_NAME="$LIB_NAME"
18104 LIB_PREFIX="$LIB_PREFIX"
18105 LIB_SUFFIX="$LIB_SUFFIX"
18106 LN_S="$LN_S"
18107 NCURSES_MAJOR="$NCURSES_MAJOR"
18108 NCURSES_MINOR="$NCURSES_MINOR"
18109 NCURSES_PATCH="$NCURSES_PATCH"
18110 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18111 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18112 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18113 cf_cv_abi_version="$cf_cv_abi_version"
18114 cf_cv_rel_version="$cf_cv_rel_version"
18115 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18116 cf_cv_shared_soname='$cf_cv_shared_soname'
18117 cf_cv_shlib_version="$cf_cv_shlib_version"
18118 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18119 cf_cv_system_name="$cf_cv_system_name"
18120 host="$host"
18121 target="$target"
18122
18123 EOF
18124
18125 cat >>"$CONFIG_STATUS" <<\EOF
18126 for ac_config_target in $ac_config_targets
18127 do
18128   case "$ac_config_target" in
18129   # Handling of arguments.
18130   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18131   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18132   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18133   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18134   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18135   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18136   *) { { echo "$as_me:18136: error: invalid argument: $ac_config_target" >&5
18137 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18138    { (exit 1); exit 1; }; };;
18139   esac
18140 done
18141
18142 # If the user did not use the arguments to specify the items to instantiate,
18143 # then the envvar interface is used.  Set only those that are not.
18144 # We use the long form for the default assignment because of an extremely
18145 # bizarre bug on SunOS 4.1.3.
18146 if "$ac_need_defaults"; then
18147   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18148   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18149   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18150 fi
18151
18152 # Create a temporary directory, and hook for its removal unless debugging.
18153 $debug ||
18154 {
18155   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18156   trap '{ (exit 1); exit 1; }' 1 2 13 15
18157 }
18158
18159 # Create a (secure) tmp directory for tmp files.
18160 : ${TMPDIR=/tmp}
18161 {
18162   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18163   test -n "$tmp" && test -d "$tmp"
18164 }  ||
18165 {
18166   tmp=$TMPDIR/cs$$-$RANDOM
18167   (umask 077 && mkdir $tmp)
18168 } ||
18169 {
18170    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18171    { (exit 1); exit 1; }
18172 }
18173
18174 EOF
18175
18176 cat >>"$CONFIG_STATUS" <<EOF
18177
18178 #
18179 # CONFIG_FILES section.
18180 #
18181
18182 # No need to generate the scripts if there are no CONFIG_FILES.
18183 # This happens for instance when ./config.status config.h
18184 if test -n "\$CONFIG_FILES"; then
18185   # Protect against being on the right side of a sed subst in config.status.
18186   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18187    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18188 s,@SHELL@,$SHELL,;t t
18189 s,@exec_prefix@,$exec_prefix,;t t
18190 s,@prefix@,$prefix,;t t
18191 s,@program_transform_name@,$program_transform_name,;t t
18192 s,@bindir@,$bindir,;t t
18193 s,@sbindir@,$sbindir,;t t
18194 s,@libexecdir@,$libexecdir,;t t
18195 s,@datarootdir@,$datarootdir,;t t
18196 s,@datadir@,$datadir,;t t
18197 s,@sysconfdir@,$sysconfdir,;t t
18198 s,@sharedstatedir@,$sharedstatedir,;t t
18199 s,@localstatedir@,$localstatedir,;t t
18200 s,@runstatedir@,$runstatedir,;t t
18201 s,@libdir@,$libdir,;t t
18202 s,@includedir@,$includedir,;t t
18203 s,@oldincludedir@,$oldincludedir,;t t
18204 s,@infodir@,$infodir,;t t
18205 s,@mandir@,$mandir,;t t
18206 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18207 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18208 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18209 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18210 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18211 s,@build_alias@,$build_alias,;t t
18212 s,@host_alias@,$host_alias,;t t
18213 s,@target_alias@,$target_alias,;t t
18214 s,@ECHO_C@,$ECHO_C,;t t
18215 s,@ECHO_N@,$ECHO_N,;t t
18216 s,@ECHO_T@,$ECHO_T,;t t
18217 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18218 s,@DEFS@,$DEFS,;t t
18219 s,@LIBS@,$LIBS,;t t
18220 s,@top_builddir@,$top_builddir,;t t
18221 s,@build@,$build,;t t
18222 s,@build_cpu@,$build_cpu,;t t
18223 s,@build_vendor@,$build_vendor,;t t
18224 s,@build_os@,$build_os,;t t
18225 s,@host@,$host,;t t
18226 s,@host_cpu@,$host_cpu,;t t
18227 s,@host_vendor@,$host_vendor,;t t
18228 s,@host_os@,$host_os,;t t
18229 s,@target@,$target,;t t
18230 s,@target_cpu@,$target_cpu,;t t
18231 s,@target_vendor@,$target_vendor,;t t
18232 s,@target_os@,$target_os,;t t
18233 s,@GREP@,$GREP,;t t
18234 s,@FGREP@,$FGREP,;t t
18235 s,@CC@,$CC,;t t
18236 s,@CFLAGS@,$CFLAGS,;t t
18237 s,@LDFLAGS@,$LDFLAGS,;t t
18238 s,@CPPFLAGS@,$CPPFLAGS,;t t
18239 s,@ac_ct_CC@,$ac_ct_CC,;t t
18240 s,@EXEEXT@,$EXEEXT,;t t
18241 s,@OBJEXT@,$OBJEXT,;t t
18242 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18243 s,@CPP@,$CPP,;t t
18244 s,@EGREP@,$EGREP,;t t
18245 s,@AWK@,$AWK,;t t
18246 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18247 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18248 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18249 s,@LN_S@,$LN_S,;t t
18250 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18251 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18252 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18253 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18254 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18255 s,@SET_MAKE@,$SET_MAKE,;t t
18256 s,@CTAGS@,$CTAGS,;t t
18257 s,@ETAGS@,$ETAGS,;t t
18258 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18259 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18260 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18261 s,@RANLIB@,$RANLIB,;t t
18262 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18263 s,@LD@,$LD,;t t
18264 s,@ac_ct_LD@,$ac_ct_LD,;t t
18265 s,@AR@,$AR,;t t
18266 s,@ac_ct_AR@,$ac_ct_AR,;t t
18267 s,@ARFLAGS@,$ARFLAGS,;t t
18268 s,@DESTDIR@,$DESTDIR,;t t
18269 s,@BUILD_CC@,$BUILD_CC,;t t
18270 s,@BUILD_CPP@,$BUILD_CPP,;t t
18271 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18272 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18273 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18274 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18275 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18276 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18277 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18278 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18279 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18280 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18281 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18282 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18283 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18284 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18285 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18286 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18287 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18288 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18289 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18290 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18291 s,@CC_G_OPT@,$CC_G_OPT,;t t
18292 s,@LD_MODEL@,$LD_MODEL,;t t
18293 s,@shlibdir@,$shlibdir,;t t
18294 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18295 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18296 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18297 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18298 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18299 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18300 s,@LINK_PROGS@,$LINK_PROGS,;t t
18301 s,@LINK_TESTS@,$LINK_TESTS,;t t
18302 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18303 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18304 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18305 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18306 s,@RPATH_LIST@,$RPATH_LIST,;t t
18307 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18308 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18309 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18310 s,@PTHREAD@,$PTHREAD,;t t
18311 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18312 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18313 s,@ECHO_LT@,$ECHO_LT,;t t
18314 s,@ECHO_LD@,$ECHO_LD,;t t
18315 s,@RULE_CC@,$RULE_CC,;t t
18316 s,@SHOW_CC@,$SHOW_CC,;t t
18317 s,@ECHO_CC@,$ECHO_CC,;t t
18318 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18319 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18320 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18321 s,@ADAFLAGS@,$ADAFLAGS,;t t
18322 s,@ADA_TRACE@,$ADA_TRACE,;t t
18323 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18324 s,@M4_exists@,$M4_exists,;t t
18325 s,@cf_ada_make@,$cf_ada_make,;t t
18326 s,@cf_ada_config@,$cf_ada_config,;t t
18327 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18328 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18329 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18330 s,@cf_compile_generics@,$cf_compile_generics,;t t
18331 s,@cf_generic_objects@,$cf_generic_objects,;t t
18332 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18333 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18334 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18335 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18336 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18337 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18338 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18339 s,@cf_ada_package@,$cf_ada_package,;t t
18340 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18341 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18342 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18343 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18344 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18345 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18346 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18347 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18348 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18349 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18350 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18351 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18352 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18353 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18354 s,@TEST_ARG2@,$TEST_ARG2,;t t
18355 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18356 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18357 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18358 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18359 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18360 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18361 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18362 CEOF
18363
18364 EOF
18365
18366   cat >>"$CONFIG_STATUS" <<\EOF
18367   # Split the substitutions into bite-sized pieces for seds with
18368   # small command number limits, like on Digital OSF/1 and HP-UX.
18369   ac_max_sed_lines=48
18370   ac_sed_frag=1 # Number of current file.
18371   ac_beg=1 # First line for current file.
18372   ac_end=$ac_max_sed_lines # Line after last line for current file.
18373   ac_more_lines=:
18374   ac_sed_cmds=
18375   while "$ac_more_lines"; do
18376     if test "$ac_beg" -gt 1; then
18377       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18378     else
18379       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18380     fi
18381     if test ! -s $tmp/subs.frag; then
18382       ac_more_lines=false
18383     else
18384       # The purpose of the label and of the branching condition is to
18385       # speed up the sed processing (if there are no `@' at all, there
18386       # is no need to browse any of the substitutions).
18387       # These are the two extra sed commands mentioned above.
18388       (echo ':t
18389   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18390       # It is possible to make a multiline substitution using escaped newlines.
18391       # Ensure that we do not split the substitution between script fragments.
18392       ac_BEG=$ac_end
18393       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18394       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18395       if test -s $tmp/subs.next; then
18396         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18397         if test ! -s $tmp/subs.edit; then
18398           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18399           if test ! -s $tmp/subs.edit; then
18400             if test "$ac_beg" -gt 1; then
18401               ac_end=`expr "$ac_end" - 1`
18402               continue
18403             fi
18404           fi
18405         fi
18406       fi
18407
18408       if test -z "$ac_sed_cmds"; then
18409         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18410       else
18411         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18412       fi
18413       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18414       ac_beg=$ac_end
18415       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18416     fi
18417   done
18418   if test -z "$ac_sed_cmds"; then
18419     ac_sed_cmds=cat
18420   fi
18421 fi # test -n "$CONFIG_FILES"
18422
18423 EOF
18424 cat >>"$CONFIG_STATUS" <<\EOF
18425 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18426   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18427   case "$ac_file" in
18428   - | *:- | *:-:* ) # input from stdin
18429         cat >$tmp/stdin
18430         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18431         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18432   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18433         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18434   * )   ac_file_in=$ac_file.in ;;
18435   esac
18436
18437   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18438   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18439          X"$ac_file" : 'X\(//\)[^/]' \| \
18440          X"$ac_file" : 'X\(//\)$' \| \
18441          X"$ac_file" : 'X\(/\)' \| \
18442          .     : '\(.\)' 2>/dev/null ||
18443 echo X"$ac_file" |
18444     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18445           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18446           /^X\(\/\/\)$/{ s//\1/; q; }
18447           /^X\(\/\).*/{ s//\1/; q; }
18448           s/.*/./; q'`
18449   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18450     { case "$ac_dir" in
18451   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18452   *)                      as_incr_dir=.;;
18453 esac
18454 as_dummy="$ac_dir"
18455 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18456   case $as_mkdir_dir in
18457     # Skip DOS drivespec
18458     ?:) as_incr_dir=$as_mkdir_dir ;;
18459     *)
18460       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18461       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18462     ;;
18463   esac
18464 done; }
18465
18466     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18467     # A "../" for each directory in $ac_dir_suffix.
18468     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18469   else
18470     ac_dir_suffix= ac_dots=
18471   fi
18472
18473   case "$srcdir" in
18474   .)  ac_srcdir=.
18475       if test -z "$ac_dots"; then
18476          ac_top_srcdir=.
18477       else
18478          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18479       fi ;;
18480   [\\/]* | ?:[\\/]* )
18481       ac_srcdir="$srcdir$ac_dir_suffix";
18482       ac_top_srcdir="$srcdir" ;;
18483   *) # Relative path.
18484     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18485     ac_top_srcdir="$ac_dots$srcdir" ;;
18486   esac
18487
18488   case $INSTALL in
18489   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18490   *) ac_INSTALL=$ac_dots$INSTALL ;;
18491   esac
18492
18493   if test x"$ac_file" != x-; then
18494     { echo "$as_me:18494: creating $ac_file" >&5
18495 echo "$as_me: creating $ac_file" >&6;}
18496     rm -f "$ac_file"
18497   fi
18498   # Let's still pretend it is `configure' which instantiates (i.e., don't
18499   # use $as_me), people would be surprised to read:
18500   #    /* config.h.  Generated automatically by config.status.  */
18501   configure_input="Generated automatically from `echo $ac_file_in |
18502                                                  sed 's,.*/,,'` by configure."
18503
18504   # First look for the input files in the build tree, otherwise in the
18505   # src tree.
18506   ac_file_inputs=`IFS=:
18507     for f in $ac_file_in; do
18508       case $f in
18509       -) echo $tmp/stdin ;;
18510       [\\/$]*)
18511          # Absolute (can't be DOS-style, as IFS=:)
18512          test -f "$f" || { { echo "$as_me:18512: error: cannot find input file: $f" >&5
18513 echo "$as_me: error: cannot find input file: $f" >&2;}
18514    { (exit 1); exit 1; }; }
18515          echo $f;;
18516       *) # Relative
18517          if test -f "$f"; then
18518            # Build tree
18519            echo $f
18520          elif test -f "$srcdir/$f"; then
18521            # Source tree
18522            echo "$srcdir/$f"
18523          else
18524            # /dev/null tree
18525            { { echo "$as_me:18525: error: cannot find input file: $f" >&5
18526 echo "$as_me: error: cannot find input file: $f" >&2;}
18527    { (exit 1); exit 1; }; }
18528          fi;;
18529       esac
18530     done` || { (exit 1); exit 1; }
18531 EOF
18532 cat >>"$CONFIG_STATUS" <<\EOF
18533   ac_warn_datarootdir=no
18534   if test x"$ac_file" != x-; then
18535     for ac_item in $ac_file_inputs
18536     do
18537       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18538       if test -n "$ac_seen"; then
18539         ac_used=`grep '@datarootdir@' "$ac_item"`
18540         if test -z "$ac_used"; then
18541           { echo "$as_me:18541: WARNING: datarootdir was used implicitly but not set:
18542 $ac_seen" >&5
18543 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18544 $ac_seen" >&2;}
18545           ac_warn_datarootdir=yes
18546         fi
18547       fi
18548       ac_seen=`grep '${datarootdir}' "$ac_item"`
18549       if test -n "$ac_seen"; then
18550         { echo "$as_me:18550: WARNING: datarootdir was used explicitly but not set:
18551 $ac_seen" >&5
18552 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18553 $ac_seen" >&2;}
18554         ac_warn_datarootdir=yes
18555       fi
18556     done
18557   fi
18558
18559 if test "x$ac_warn_datarootdir" = xyes; then
18560   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18561 fi
18562
18563 EOF
18564 cat >>"$CONFIG_STATUS" <<EOF
18565   sed "$ac_vpsub
18566 $extrasub
18567 EOF
18568 cat >>"$CONFIG_STATUS" <<\EOF
18569 :t
18570 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18571 s,@configure_input@,$configure_input,;t t
18572 s,@srcdir@,$ac_srcdir,;t t
18573 s,@top_srcdir@,$ac_top_srcdir,;t t
18574 s,@INSTALL@,$ac_INSTALL,;t t
18575 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18576   rm -f $tmp/stdin
18577   if test x"$ac_file" != x-; then
18578     cp "$tmp/out" "$ac_file"
18579
18580     for ac_name in prefix exec_prefix datarootdir
18581     do
18582         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18583         if test -n "$ac_seen"; then
18584             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18585             if test -z "$ac_init"; then
18586               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18587               { echo "$as_me:18587: WARNING: Variable $ac_name is used but was not set:
18588 $ac_seen" >&5
18589 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18590 $ac_seen" >&2;}
18591             fi
18592         fi
18593     done
18594     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18595     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18596     if test -s $tmp/out; then
18597       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18598       { echo "$as_me:18598: WARNING: Some variables may not be substituted:
18599 $ac_seen" >&5
18600 echo "$as_me: WARNING: Some variables may not be substituted:
18601 $ac_seen" >&2;}
18602     fi
18603   else
18604     cat $tmp/out
18605   fi
18606   rm -f $tmp/out
18607
18608 done
18609 EOF
18610 cat >>"$CONFIG_STATUS" <<\EOF
18611
18612 #
18613 # CONFIG_HEADER section.
18614 #
18615
18616 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18617 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18618 #
18619 # ac_d sets the value in "#define NAME VALUE" lines.
18620 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18621 ac_dB='[        ].*$,\1#\2'
18622 ac_dC=' '
18623 ac_dD=',;t'
18624 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18625 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18626 ac_iB='\([      ]\),\1#\2define\3'
18627 ac_iC=' '
18628 ac_iD='\4,;t'
18629 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18630 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18631 ac_uB='$,\1#\2define\3'
18632 ac_uC=' '
18633 ac_uD=',;t'
18634
18635 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18636   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18637   case "$ac_file" in
18638   - | *:- | *:-:* ) # input from stdin
18639         cat >$tmp/stdin
18640         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18641         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18642   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18643         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18644   * )   ac_file_in=$ac_file.in ;;
18645   esac
18646
18647   test x"$ac_file" != x- && { echo "$as_me:18647: creating $ac_file" >&5
18648 echo "$as_me: creating $ac_file" >&6;}
18649
18650   # First look for the input files in the build tree, otherwise in the
18651   # src tree.
18652   ac_file_inputs=`IFS=:
18653     for f in $ac_file_in; do
18654       case $f in
18655       -) echo $tmp/stdin ;;
18656       [\\/$]*)
18657          # Absolute (can't be DOS-style, as IFS=:)
18658          test -f "$f" || { { echo "$as_me:18658: error: cannot find input file: $f" >&5
18659 echo "$as_me: error: cannot find input file: $f" >&2;}
18660    { (exit 1); exit 1; }; }
18661          echo $f;;
18662       *) # Relative
18663          if test -f "$f"; then
18664            # Build tree
18665            echo $f
18666          elif test -f "$srcdir/$f"; then
18667            # Source tree
18668            echo "$srcdir/$f"
18669          else
18670            # /dev/null tree
18671            { { echo "$as_me:18671: error: cannot find input file: $f" >&5
18672 echo "$as_me: error: cannot find input file: $f" >&2;}
18673    { (exit 1); exit 1; }; }
18674          fi;;
18675       esac
18676     done` || { (exit 1); exit 1; }
18677   # Remove the trailing spaces.
18678   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18679
18680 EOF
18681
18682 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18683 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18684 # be either 'cat' or 'sort'.
18685 cat confdefs.h | uniq >conftest.vals
18686
18687 # Break up conftest.vals because some shells have a limit on
18688 # the size of here documents, and old seds have small limits too.
18689
18690 rm -f conftest.tail
18691 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
18692 while grep . conftest.vals >/dev/null
18693 do
18694   # Write chunks of a limited-size here document to conftest.frag.
18695   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
18696   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
18697   echo 'CEOF' >> "$CONFIG_STATUS"
18698   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
18699   rm -f conftest.vals
18700   mv conftest.tail conftest.vals
18701 done
18702 rm -f conftest.vals
18703
18704 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18705 # marker @DEFS@.
18706 echo '  cat >> conftest.edit <<CEOF
18707 /@DEFS@/r conftest.frag
18708 /@DEFS@/d
18709 CEOF
18710 sed -f conftest.edit $tmp/in > $tmp/out
18711 rm -f $tmp/in
18712 mv $tmp/out $tmp/in
18713 rm -f conftest.edit conftest.frag
18714 ' >> "$CONFIG_STATUS"
18715
18716 cat >>"$CONFIG_STATUS" <<\EOF
18717   # Let's still pretend it is `configure' which instantiates (i.e., don't
18718   # use $as_me), people would be surprised to read:
18719   #    /* config.h.  Generated automatically by config.status.  */
18720   if test x"$ac_file" = x-; then
18721     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18722   else
18723     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18724   fi
18725   cat $tmp/in >>$tmp/config.h
18726   rm -f $tmp/in
18727   if test x"$ac_file" != x-; then
18728     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
18729       { echo "$as_me:18729: $ac_file is unchanged" >&5
18730 echo "$as_me: $ac_file is unchanged" >&6;}
18731     else
18732       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18733          X"$ac_file" : 'X\(//\)[^/]' \| \
18734          X"$ac_file" : 'X\(//\)$' \| \
18735          X"$ac_file" : 'X\(/\)' \| \
18736          .     : '\(.\)' 2>/dev/null ||
18737 echo X"$ac_file" |
18738     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18739           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18740           /^X\(\/\/\)$/{ s//\1/; q; }
18741           /^X\(\/\).*/{ s//\1/; q; }
18742           s/.*/./; q'`
18743       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18744         { case "$ac_dir" in
18745   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18746   *)                      as_incr_dir=.;;
18747 esac
18748 as_dummy="$ac_dir"
18749 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18750   case $as_mkdir_dir in
18751     # Skip DOS drivespec
18752     ?:) as_incr_dir=$as_mkdir_dir ;;
18753     *)
18754       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18755       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18756     ;;
18757   esac
18758 done; }
18759
18760       fi
18761       rm -f "$ac_file"
18762       mv "$tmp/config.h" "$ac_file"
18763     fi
18764   else
18765     cat $tmp/config.h
18766     rm -f $tmp/config.h
18767   fi
18768 done
18769 EOF
18770 cat >>"$CONFIG_STATUS" <<\EOF
18771 #
18772 # CONFIG_COMMANDS section.
18773 #
18774 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18775   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18776   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18777
18778   case "$ac_dest" in
18779     default )
18780 if test -z "$USE_OLD_MAKERULES" ; then
18781         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18782 fi
18783  ;;
18784   esac
18785 done
18786 EOF
18787
18788 cat >>"$CONFIG_STATUS" <<\EOF
18789
18790 { (exit 0); exit 0; }
18791 EOF
18792 chmod +x "$CONFIG_STATUS"
18793 ac_clean_files=$ac_clean_files_save
18794
18795 # configure is writing to config.log, and then calls config.status.
18796 # config.status does its own redirection, appending to config.log.
18797 # Unfortunately, on DOS this fails, as config.log is still kept open
18798 # by configure, so config.status won't be able to write to it; its
18799 # output is simply discarded.  So we exec the FD to /dev/null,
18800 # effectively closing config.log, so it can be properly (re)opened and
18801 # appended to by config.status.  When coming back to configure, we
18802 # need to make the FD available again.
18803 if test "$no_create" != yes; then
18804   ac_cs_success=:
18805   exec 5>/dev/null
18806   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
18807   exec 5>>config.log
18808   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18809   # would make configure fail if this is the last instruction.
18810   "$ac_cs_success" || { (exit 1); exit 1; }
18811 fi
18812 ${MAKE:-make} preinstall