]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.3 - patch 20221119
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.87 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20221009.
5 #
6 # Copyright 2003-2021,2022      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-2021,2022        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.20221009.  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 # if $PKG_CONFIG_LIBDIR is set, try to use that
3283 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,'`
3284
3285 # if the option is used, let that override.  otherwise default to "libdir"
3286
3287 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3288 if test "${with_pkg_config_libdir+set}" = set; then
3289   withval="$with_pkg_config_libdir"
3290   cf_search_path=$withval
3291 else
3292   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3293 fi;
3294
3295 case "x$cf_search_path" in
3296 (xlibdir)
3297         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3298         echo "$as_me:3298: result: $PKG_CONFIG_LIBDIR" >&5
3299 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3300         cf_search_path=
3301         ;;
3302 (x)
3303         ;;
3304 (x/*\ *)
3305         PKG_CONFIG_LIBDIR=
3306         ;;
3307 (x/*)
3308         PKG_CONFIG_LIBDIR="$cf_search_path"
3309         echo "$as_me:3309: result: $PKG_CONFIG_LIBDIR" >&5
3310 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3311         cf_search_path=
3312         ;;
3313 (xyes|xauto)
3314         echo "$as_me:3314: result: auto" >&5
3315 echo "${ECHO_T}auto" >&6
3316         cf_search_path=
3317         # Look for the library directory using the same prefix as the executable
3318         echo "$as_me:3318: checking for search-list" >&5
3319 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3320         if test "x$PKG_CONFIG" != xnone
3321         then
3322                 # works for pkg-config since version 0.24 (2009)
3323                 # works for pkgconf since version 0.8.3 (2012)
3324                 for cf_pkg_program in \
3325                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3326                         pkg-config \
3327                         pkgconf
3328                 do
3329                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3330                         test -n "$cf_search_path" && break
3331                 done
3332
3333                 # works for pkg-config since import in 2005 of original 2001 HP code.
3334                 test -z "$cf_search_path" && \
3335                 cf_search_path=`
3336                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3337 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3338         sub(\"^[^']*'\",\"\"); \
3339         sub(\"'.*\",\"\"); \
3340         printf \" %s\", \\$0; } \
3341 { next; } \
3342 "`
3343         fi
3344
3345         echo "$as_me:3345: result: $cf_search_path" >&5
3346 echo "${ECHO_T}$cf_search_path" >&6
3347         ;;
3348 (*)
3349         { { echo "$as_me:3349: error: Unexpected option value: $cf_search_path" >&5
3350 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3351    { (exit 1); exit 1; }; }
3352         ;;
3353 esac
3354
3355 if test -n "$cf_search_path"
3356 then
3357         echo "$as_me:3357: checking for first directory" >&5
3358 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3359         cf_pkg_config_path=none
3360         for cf_config in $cf_search_path
3361         do
3362                 if test -d "$cf_config"
3363                 then
3364                         cf_pkg_config_path=$cf_config
3365                         break
3366                 fi
3367         done
3368         echo "$as_me:3368: result: $cf_pkg_config_path" >&5
3369 echo "${ECHO_T}$cf_pkg_config_path" >&6
3370
3371         if test "x$cf_pkg_config_path" != xnone ; then
3372                 # limit this to the first directory found
3373                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3374         fi
3375
3376         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3377         then
3378                 echo "$as_me:3378: checking for workaround" >&5
3379 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3380                 if test "$prefix" = "NONE" ; then
3381                         cf_prefix="$ac_default_prefix"
3382                 else
3383                         cf_prefix="$prefix"
3384                 fi
3385                 eval cf_libdir=$libdir
3386                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3387                 cf_backup=
3388                 for cf_config in $cf_search_path
3389                 do
3390                         case $cf_config in
3391                         $cf_libdir/pkgconfig)
3392                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3393                                 break
3394                                 ;;
3395                         *)
3396                                 test -z "$cf_backup" && cf_backup=$cf_config
3397                                 ;;
3398                         esac
3399                 done
3400                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3401                 echo "$as_me:3401: result: $PKG_CONFIG_LIBDIR" >&5
3402 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3403         fi
3404 fi
3405
3406 echo "$as_me:3406: checking if you want to build test-programs" >&5
3407 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3408
3409 # Check whether --with-tests or --without-tests was given.
3410 if test "${with_tests+set}" = set; then
3411   withval="$with_tests"
3412   cf_with_tests=$withval
3413 else
3414   cf_with_tests=yes
3415 fi;
3416 echo "$as_me:3416: result: $cf_with_tests" >&5
3417 echo "${ECHO_T}$cf_with_tests" >&6
3418
3419 echo "$as_me:3419: checking if we should assume mixed-case filenames" >&5
3420 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3421
3422 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3423 if test "${enable_mixed_case+set}" = set; then
3424   enableval="$enable_mixed_case"
3425   enable_mixedcase=$enableval
3426 else
3427   enable_mixedcase=auto
3428 fi;
3429 echo "$as_me:3429: result: $enable_mixedcase" >&5
3430 echo "${ECHO_T}$enable_mixedcase" >&6
3431 if test "$enable_mixedcase" = "auto" ; then
3432
3433 echo "$as_me:3433: checking if filesystem supports mixed-case filenames" >&5
3434 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3435 if test "${cf_cv_mixedcase+set}" = set; then
3436   echo $ECHO_N "(cached) $ECHO_C" >&6
3437 else
3438
3439 if test "$cross_compiling" = yes ; then
3440         case "$target_alias" in
3441         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3442                 cf_cv_mixedcase=no
3443                 ;;
3444         (*)
3445                 cf_cv_mixedcase=yes
3446                 ;;
3447         esac
3448 else
3449         rm -f conftest CONFTEST
3450         echo test >conftest
3451         if test -f CONFTEST ; then
3452                 cf_cv_mixedcase=no
3453         else
3454                 cf_cv_mixedcase=yes
3455         fi
3456         rm -f conftest CONFTEST
3457 fi
3458
3459 fi
3460 echo "$as_me:3460: result: $cf_cv_mixedcase" >&5
3461 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3462 test "$cf_cv_mixedcase" = yes &&
3463 cat >>confdefs.h <<\EOF
3464 #define MIXEDCASE_FILENAMES 1
3465 EOF
3466
3467 else
3468         cf_cv_mixedcase=$enable_mixedcase
3469         if test "$enable_mixedcase" = "yes" ; then
3470                 cat >>confdefs.h <<\EOF
3471 #define MIXEDCASE_FILENAMES 1
3472 EOF
3473
3474         fi
3475 fi
3476
3477 # do this after mixed-case option (tags/TAGS is not as important as tic).
3478 echo "$as_me:3478: checking whether ${MAKE-make} sets \${MAKE}" >&5
3479 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3480 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3481 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3482   echo $ECHO_N "(cached) $ECHO_C" >&6
3483 else
3484   cat >conftest.make <<\EOF
3485 all:
3486         @echo 'ac_maketemp="${MAKE}"'
3487 EOF
3488 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3489 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3490 if test -n "$ac_maketemp"; then
3491   eval ac_cv_prog_make_${ac_make}_set=yes
3492 else
3493   eval ac_cv_prog_make_${ac_make}_set=no
3494 fi
3495 rm -f conftest.make
3496 fi
3497 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3498   echo "$as_me:3498: result: yes" >&5
3499 echo "${ECHO_T}yes" >&6
3500   SET_MAKE=
3501 else
3502   echo "$as_me:3502: result: no" >&5
3503 echo "${ECHO_T}no" >&6
3504   SET_MAKE="MAKE=${MAKE-make}"
3505 fi
3506
3507 echo "$as_me:3507: checking for \".PHONY\" make-support" >&5
3508 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3509 if test "${cf_cv_make_PHONY+set}" = set; then
3510   echo $ECHO_N "(cached) $ECHO_C" >&6
3511 else
3512
3513         rm -rf conftest*
3514         (
3515                 mkdir conftest || exit 1
3516                 cd conftest
3517                 cat >makefile <<'CF_EOF'
3518 .PHONY: always
3519 DATA=0
3520 always: always.out
3521         @echo "** making $@ $(DATA)"
3522 once: once.out
3523         @echo "** making $@ $(DATA)"
3524 always.out:
3525         @echo "** making $@ $(DATA)"
3526         echo $(DATA) > $@
3527 once.out:
3528         @echo "** making $@ $(DATA)"
3529         echo $(DATA) > $@
3530 CF_EOF
3531                 for cf_data in 1 2 3
3532                 do
3533                         ${MAKE:-make} always DATA=$cf_data
3534                         ${MAKE:-make} once   DATA=$cf_data
3535                         ${MAKE:-make} -t always once
3536                         if test -f always ; then
3537                                 echo "no (case 1)" > ../conftest.tmp
3538                         elif test ! -f always.out ; then
3539                                 echo "no (case 2)" > ../conftest.tmp
3540                         elif test ! -f once.out ; then
3541                                 echo "no (case 3)" > ../conftest.tmp
3542                         elif ! cmp -s always.out once.out ; then
3543                                 echo "no (case 4)" > ../conftest.tmp
3544                                 diff always.out once.out
3545                         else
3546                                 cf_check="`cat always.out`"
3547                                 if test "x$cf_check" != "x$cf_data" ; then
3548                                         echo "no (case 5)" > ../conftest.tmp
3549                                 else
3550                                         echo yes > ../conftest.tmp
3551                                         rm -f ./*.out
3552                                         continue
3553                                 fi
3554                         fi
3555                         break
3556                 done
3557         ) >&5 2>&1
3558         cf_cv_make_PHONY="`cat conftest.tmp`"
3559         rm -rf conftest*
3560
3561 fi
3562 echo "$as_me:3562: result: $cf_cv_make_PHONY" >&5
3563 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3564 MAKE_NO_PHONY="#"
3565 MAKE_PHONY="#"
3566 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3567 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3568
3569 for ac_prog in exctags ctags
3570 do
3571   # Extract the first word of "$ac_prog", so it can be a program name with args.
3572 set dummy $ac_prog; ac_word=$2
3573 echo "$as_me:3573: checking for $ac_word" >&5
3574 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3575 if test "${ac_cv_prog_CTAGS+set}" = set; then
3576   echo $ECHO_N "(cached) $ECHO_C" >&6
3577 else
3578   if test -n "$CTAGS"; then
3579   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3580 else
3581   ac_save_IFS=$IFS; IFS=$ac_path_separator
3582 ac_dummy="$PATH"
3583 for ac_dir in $ac_dummy; do
3584   IFS=$ac_save_IFS
3585   test -z "$ac_dir" && ac_dir=.
3586   $as_executable_p "$ac_dir/$ac_word" || continue
3587 ac_cv_prog_CTAGS="$ac_prog"
3588 echo "$as_me:3588: found $ac_dir/$ac_word" >&5
3589 break
3590 done
3591
3592 fi
3593 fi
3594 CTAGS=$ac_cv_prog_CTAGS
3595 if test -n "$CTAGS"; then
3596   echo "$as_me:3596: result: $CTAGS" >&5
3597 echo "${ECHO_T}$CTAGS" >&6
3598 else
3599   echo "$as_me:3599: result: no" >&5
3600 echo "${ECHO_T}no" >&6
3601 fi
3602
3603   test -n "$CTAGS" && break
3604 done
3605
3606 for ac_prog in exetags etags
3607 do
3608   # Extract the first word of "$ac_prog", so it can be a program name with args.
3609 set dummy $ac_prog; ac_word=$2
3610 echo "$as_me:3610: checking for $ac_word" >&5
3611 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3612 if test "${ac_cv_prog_ETAGS+set}" = set; then
3613   echo $ECHO_N "(cached) $ECHO_C" >&6
3614 else
3615   if test -n "$ETAGS"; then
3616   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3617 else
3618   ac_save_IFS=$IFS; IFS=$ac_path_separator
3619 ac_dummy="$PATH"
3620 for ac_dir in $ac_dummy; do
3621   IFS=$ac_save_IFS
3622   test -z "$ac_dir" && ac_dir=.
3623   $as_executable_p "$ac_dir/$ac_word" || continue
3624 ac_cv_prog_ETAGS="$ac_prog"
3625 echo "$as_me:3625: found $ac_dir/$ac_word" >&5
3626 break
3627 done
3628
3629 fi
3630 fi
3631 ETAGS=$ac_cv_prog_ETAGS
3632 if test -n "$ETAGS"; then
3633   echo "$as_me:3633: result: $ETAGS" >&5
3634 echo "${ECHO_T}$ETAGS" >&6
3635 else
3636   echo "$as_me:3636: result: no" >&5
3637 echo "${ECHO_T}no" >&6
3638 fi
3639
3640   test -n "$ETAGS" && break
3641 done
3642
3643 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3644 set dummy ${CTAGS:-ctags}; ac_word=$2
3645 echo "$as_me:3645: checking for $ac_word" >&5
3646 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3647 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3648   echo $ECHO_N "(cached) $ECHO_C" >&6
3649 else
3650   if test -n "$MAKE_LOWER_TAGS"; then
3651   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3652 else
3653   ac_save_IFS=$IFS; IFS=$ac_path_separator
3654 ac_dummy="$PATH"
3655 for ac_dir in $ac_dummy; do
3656   IFS=$ac_save_IFS
3657   test -z "$ac_dir" && ac_dir=.
3658   $as_executable_p "$ac_dir/$ac_word" || continue
3659 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3660 echo "$as_me:3660: found $ac_dir/$ac_word" >&5
3661 break
3662 done
3663
3664   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3665 fi
3666 fi
3667 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3668 if test -n "$MAKE_LOWER_TAGS"; then
3669   echo "$as_me:3669: result: $MAKE_LOWER_TAGS" >&5
3670 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3671 else
3672   echo "$as_me:3672: result: no" >&5
3673 echo "${ECHO_T}no" >&6
3674 fi
3675
3676 if test "$cf_cv_mixedcase" = yes ; then
3677         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3678 set dummy ${ETAGS:-etags}; ac_word=$2
3679 echo "$as_me:3679: checking for $ac_word" >&5
3680 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3681 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3682   echo $ECHO_N "(cached) $ECHO_C" >&6
3683 else
3684   if test -n "$MAKE_UPPER_TAGS"; then
3685   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3686 else
3687   ac_save_IFS=$IFS; IFS=$ac_path_separator
3688 ac_dummy="$PATH"
3689 for ac_dir in $ac_dummy; do
3690   IFS=$ac_save_IFS
3691   test -z "$ac_dir" && ac_dir=.
3692   $as_executable_p "$ac_dir/$ac_word" || continue
3693 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3694 echo "$as_me:3694: found $ac_dir/$ac_word" >&5
3695 break
3696 done
3697
3698   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3699 fi
3700 fi
3701 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3702 if test -n "$MAKE_UPPER_TAGS"; then
3703   echo "$as_me:3703: result: $MAKE_UPPER_TAGS" >&5
3704 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3705 else
3706   echo "$as_me:3706: result: no" >&5
3707 echo "${ECHO_T}no" >&6
3708 fi
3709
3710 else
3711         MAKE_UPPER_TAGS=no
3712 fi
3713
3714 if test "$MAKE_UPPER_TAGS" = yes ; then
3715         MAKE_UPPER_TAGS=
3716 else
3717         MAKE_UPPER_TAGS="#"
3718 fi
3719
3720 if test "$MAKE_LOWER_TAGS" = yes ; then
3721         MAKE_LOWER_TAGS=
3722 else
3723         MAKE_LOWER_TAGS="#"
3724 fi
3725
3726 echo "$as_me:3726: checking for makeflags variable" >&5
3727 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3728 if test "${cf_cv_makeflags+set}" = set; then
3729   echo $ECHO_N "(cached) $ECHO_C" >&6
3730 else
3731
3732         cf_cv_makeflags=''
3733         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3734         do
3735                 cat >cf_makeflags.tmp <<CF_EOF
3736 SHELL = $SHELL
3737 all :
3738         @ echo '.$cf_option'
3739 CF_EOF
3740                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3741                 case "$cf_result" in
3742                 (.*k|.*kw)
3743                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3744                         case "$cf_result" in
3745                         (.*CC=*)        cf_cv_makeflags=
3746                                 ;;
3747                         (*)     cf_cv_makeflags=$cf_option
3748                                 ;;
3749                         esac
3750                         break
3751                         ;;
3752                 (.-)
3753                         ;;
3754                 (*)
3755
3756 echo "${as_me:-configure}:3756: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3757
3758                         ;;
3759                 esac
3760         done
3761         rm -f cf_makeflags.tmp
3762
3763 fi
3764 echo "$as_me:3764: result: $cf_cv_makeflags" >&5
3765 echo "${ECHO_T}$cf_cv_makeflags" >&6
3766
3767 if test -n "$ac_tool_prefix"; then
3768   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3769 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3770 echo "$as_me:3770: checking for $ac_word" >&5
3771 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3772 if test "${ac_cv_prog_RANLIB+set}" = set; then
3773   echo $ECHO_N "(cached) $ECHO_C" >&6
3774 else
3775   if test -n "$RANLIB"; then
3776   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3777 else
3778   ac_save_IFS=$IFS; IFS=$ac_path_separator
3779 ac_dummy="$PATH"
3780 for ac_dir in $ac_dummy; do
3781   IFS=$ac_save_IFS
3782   test -z "$ac_dir" && ac_dir=.
3783   $as_executable_p "$ac_dir/$ac_word" || continue
3784 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3785 echo "$as_me:3785: found $ac_dir/$ac_word" >&5
3786 break
3787 done
3788
3789 fi
3790 fi
3791 RANLIB=$ac_cv_prog_RANLIB
3792 if test -n "$RANLIB"; then
3793   echo "$as_me:3793: result: $RANLIB" >&5
3794 echo "${ECHO_T}$RANLIB" >&6
3795 else
3796   echo "$as_me:3796: result: no" >&5
3797 echo "${ECHO_T}no" >&6
3798 fi
3799
3800 fi
3801 if test -z "$ac_cv_prog_RANLIB"; then
3802   ac_ct_RANLIB=$RANLIB
3803   # Extract the first word of "ranlib", so it can be a program name with args.
3804 set dummy ranlib; ac_word=$2
3805 echo "$as_me:3805: checking for $ac_word" >&5
3806 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3807 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3808   echo $ECHO_N "(cached) $ECHO_C" >&6
3809 else
3810   if test -n "$ac_ct_RANLIB"; then
3811   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3812 else
3813   ac_save_IFS=$IFS; IFS=$ac_path_separator
3814 ac_dummy="$PATH"
3815 for ac_dir in $ac_dummy; do
3816   IFS=$ac_save_IFS
3817   test -z "$ac_dir" && ac_dir=.
3818   $as_executable_p "$ac_dir/$ac_word" || continue
3819 ac_cv_prog_ac_ct_RANLIB="ranlib"
3820 echo "$as_me:3820: found $ac_dir/$ac_word" >&5
3821 break
3822 done
3823
3824   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3825 fi
3826 fi
3827 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3828 if test -n "$ac_ct_RANLIB"; then
3829   echo "$as_me:3829: result: $ac_ct_RANLIB" >&5
3830 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3831 else
3832   echo "$as_me:3832: result: no" >&5
3833 echo "${ECHO_T}no" >&6
3834 fi
3835
3836   RANLIB=$ac_ct_RANLIB
3837 else
3838   RANLIB="$ac_cv_prog_RANLIB"
3839 fi
3840
3841 if test -n "$ac_tool_prefix"; then
3842   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3843 set dummy ${ac_tool_prefix}ld; ac_word=$2
3844 echo "$as_me:3844: checking for $ac_word" >&5
3845 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3846 if test "${ac_cv_prog_LD+set}" = set; then
3847   echo $ECHO_N "(cached) $ECHO_C" >&6
3848 else
3849   if test -n "$LD"; then
3850   ac_cv_prog_LD="$LD" # Let the user override the test.
3851 else
3852   ac_save_IFS=$IFS; IFS=$ac_path_separator
3853 ac_dummy="$PATH"
3854 for ac_dir in $ac_dummy; do
3855   IFS=$ac_save_IFS
3856   test -z "$ac_dir" && ac_dir=.
3857   $as_executable_p "$ac_dir/$ac_word" || continue
3858 ac_cv_prog_LD="${ac_tool_prefix}ld"
3859 echo "$as_me:3859: found $ac_dir/$ac_word" >&5
3860 break
3861 done
3862
3863 fi
3864 fi
3865 LD=$ac_cv_prog_LD
3866 if test -n "$LD"; then
3867   echo "$as_me:3867: result: $LD" >&5
3868 echo "${ECHO_T}$LD" >&6
3869 else
3870   echo "$as_me:3870: result: no" >&5
3871 echo "${ECHO_T}no" >&6
3872 fi
3873
3874 fi
3875 if test -z "$ac_cv_prog_LD"; then
3876   ac_ct_LD=$LD
3877   # Extract the first word of "ld", so it can be a program name with args.
3878 set dummy ld; ac_word=$2
3879 echo "$as_me:3879: checking for $ac_word" >&5
3880 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3881 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3882   echo $ECHO_N "(cached) $ECHO_C" >&6
3883 else
3884   if test -n "$ac_ct_LD"; then
3885   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3886 else
3887   ac_save_IFS=$IFS; IFS=$ac_path_separator
3888 ac_dummy="$PATH"
3889 for ac_dir in $ac_dummy; do
3890   IFS=$ac_save_IFS
3891   test -z "$ac_dir" && ac_dir=.
3892   $as_executable_p "$ac_dir/$ac_word" || continue
3893 ac_cv_prog_ac_ct_LD="ld"
3894 echo "$as_me:3894: found $ac_dir/$ac_word" >&5
3895 break
3896 done
3897
3898   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3899 fi
3900 fi
3901 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3902 if test -n "$ac_ct_LD"; then
3903   echo "$as_me:3903: result: $ac_ct_LD" >&5
3904 echo "${ECHO_T}$ac_ct_LD" >&6
3905 else
3906   echo "$as_me:3906: result: no" >&5
3907 echo "${ECHO_T}no" >&6
3908 fi
3909
3910   LD=$ac_ct_LD
3911 else
3912   LD="$ac_cv_prog_LD"
3913 fi
3914
3915 if test -n "$ac_tool_prefix"; then
3916   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3917 set dummy ${ac_tool_prefix}ar; ac_word=$2
3918 echo "$as_me:3918: checking for $ac_word" >&5
3919 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3920 if test "${ac_cv_prog_AR+set}" = set; then
3921   echo $ECHO_N "(cached) $ECHO_C" >&6
3922 else
3923   if test -n "$AR"; then
3924   ac_cv_prog_AR="$AR" # Let the user override the test.
3925 else
3926   ac_save_IFS=$IFS; IFS=$ac_path_separator
3927 ac_dummy="$PATH"
3928 for ac_dir in $ac_dummy; do
3929   IFS=$ac_save_IFS
3930   test -z "$ac_dir" && ac_dir=.
3931   $as_executable_p "$ac_dir/$ac_word" || continue
3932 ac_cv_prog_AR="${ac_tool_prefix}ar"
3933 echo "$as_me:3933: found $ac_dir/$ac_word" >&5
3934 break
3935 done
3936
3937 fi
3938 fi
3939 AR=$ac_cv_prog_AR
3940 if test -n "$AR"; then
3941   echo "$as_me:3941: result: $AR" >&5
3942 echo "${ECHO_T}$AR" >&6
3943 else
3944   echo "$as_me:3944: result: no" >&5
3945 echo "${ECHO_T}no" >&6
3946 fi
3947
3948 fi
3949 if test -z "$ac_cv_prog_AR"; then
3950   ac_ct_AR=$AR
3951   # Extract the first word of "ar", so it can be a program name with args.
3952 set dummy ar; ac_word=$2
3953 echo "$as_me:3953: checking for $ac_word" >&5
3954 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3955 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958   if test -n "$ac_ct_AR"; then
3959   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3960 else
3961   ac_save_IFS=$IFS; IFS=$ac_path_separator
3962 ac_dummy="$PATH"
3963 for ac_dir in $ac_dummy; do
3964   IFS=$ac_save_IFS
3965   test -z "$ac_dir" && ac_dir=.
3966   $as_executable_p "$ac_dir/$ac_word" || continue
3967 ac_cv_prog_ac_ct_AR="ar"
3968 echo "$as_me:3968: found $ac_dir/$ac_word" >&5
3969 break
3970 done
3971
3972   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3973 fi
3974 fi
3975 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3976 if test -n "$ac_ct_AR"; then
3977   echo "$as_me:3977: result: $ac_ct_AR" >&5
3978 echo "${ECHO_T}$ac_ct_AR" >&6
3979 else
3980   echo "$as_me:3980: result: no" >&5
3981 echo "${ECHO_T}no" >&6
3982 fi
3983
3984   AR=$ac_ct_AR
3985 else
3986   AR="$ac_cv_prog_AR"
3987 fi
3988
3989 if test -n "$ac_tool_prefix"; then
3990   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3991 set dummy ${ac_tool_prefix}ar; ac_word=$2
3992 echo "$as_me:3992: checking for $ac_word" >&5
3993 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3994 if test "${ac_cv_prog_AR+set}" = set; then
3995   echo $ECHO_N "(cached) $ECHO_C" >&6
3996 else
3997   if test -n "$AR"; then
3998   ac_cv_prog_AR="$AR" # Let the user override the test.
3999 else
4000   ac_save_IFS=$IFS; IFS=$ac_path_separator
4001 ac_dummy="$PATH"
4002 for ac_dir in $ac_dummy; do
4003   IFS=$ac_save_IFS
4004   test -z "$ac_dir" && ac_dir=.
4005   $as_executable_p "$ac_dir/$ac_word" || continue
4006 ac_cv_prog_AR="${ac_tool_prefix}ar"
4007 echo "$as_me:4007: found $ac_dir/$ac_word" >&5
4008 break
4009 done
4010
4011 fi
4012 fi
4013 AR=$ac_cv_prog_AR
4014 if test -n "$AR"; then
4015   echo "$as_me:4015: result: $AR" >&5
4016 echo "${ECHO_T}$AR" >&6
4017 else
4018   echo "$as_me:4018: result: no" >&5
4019 echo "${ECHO_T}no" >&6
4020 fi
4021
4022 fi
4023 if test -z "$ac_cv_prog_AR"; then
4024   ac_ct_AR=$AR
4025   # Extract the first word of "ar", so it can be a program name with args.
4026 set dummy ar; ac_word=$2
4027 echo "$as_me:4027: checking for $ac_word" >&5
4028 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4029 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4030   echo $ECHO_N "(cached) $ECHO_C" >&6
4031 else
4032   if test -n "$ac_ct_AR"; then
4033   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4034 else
4035   ac_save_IFS=$IFS; IFS=$ac_path_separator
4036 ac_dummy="$PATH"
4037 for ac_dir in $ac_dummy; do
4038   IFS=$ac_save_IFS
4039   test -z "$ac_dir" && ac_dir=.
4040   $as_executable_p "$ac_dir/$ac_word" || continue
4041 ac_cv_prog_ac_ct_AR="ar"
4042 echo "$as_me:4042: found $ac_dir/$ac_word" >&5
4043 break
4044 done
4045
4046   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4047 fi
4048 fi
4049 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4050 if test -n "$ac_ct_AR"; then
4051   echo "$as_me:4051: result: $ac_ct_AR" >&5
4052 echo "${ECHO_T}$ac_ct_AR" >&6
4053 else
4054   echo "$as_me:4054: result: no" >&5
4055 echo "${ECHO_T}no" >&6
4056 fi
4057
4058   AR=$ac_ct_AR
4059 else
4060   AR="$ac_cv_prog_AR"
4061 fi
4062
4063 echo "$as_me:4063: checking for options to update archives" >&5
4064 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4065 if test "${cf_cv_ar_flags+set}" = set; then
4066   echo $ECHO_N "(cached) $ECHO_C" >&6
4067 else
4068
4069         case "$cf_cv_system_name" in
4070         (*-msvc*)
4071                 cf_cv_ar_flags=''
4072                 cat >mk_static_lib.sh <<-EOF
4073                 #!$SHELL
4074                 MSVC_BIN="$AR"
4075                 out="\$1"
4076                 shift
4077                 exec \$MSVC_BIN -out:"\$out" \$@
4078                 EOF
4079                 chmod +x mk_static_lib.sh
4080                 AR=`pwd`/mk_static_lib.sh
4081                 ;;
4082         (*)
4083                 cf_cv_ar_flags=unknown
4084                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4085                 do
4086
4087                         # check if $ARFLAGS already contains this choice
4088                         if test "x$ARFLAGS" != "x" ; then
4089                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4090                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4091                                         cf_cv_ar_flags=
4092                                         break
4093                                 fi
4094                         fi
4095
4096                         rm -f "conftest.$ac_cv_objext"
4097                         rm -f conftest.a
4098
4099                         cat >"conftest.$ac_ext" <<EOF
4100 #line 4100 "configure"
4101 int     testdata[3] = { 123, 456, 789 };
4102 EOF
4103                         if { (eval echo "$as_me:4103: \"$ac_compile\"") >&5
4104   (eval $ac_compile) 2>&5
4105   ac_status=$?
4106   echo "$as_me:4106: \$? = $ac_status" >&5
4107   (exit "$ac_status"); } ; then
4108                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4109                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4110                                 if test -f conftest.a ; then
4111                                         cf_cv_ar_flags="$cf_ar_flags"
4112                                         break
4113                                 fi
4114                         else
4115                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4116
4117 echo "${as_me:-configure}:4117: testing cannot compile test-program ..." 1>&5
4118
4119                                 break
4120                         fi
4121                 done
4122                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4123                 ;;
4124         esac
4125
4126 fi
4127 echo "$as_me:4127: result: $cf_cv_ar_flags" >&5
4128 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4129
4130 if test -n "$ARFLAGS" ; then
4131         if test -n "$cf_cv_ar_flags" ; then
4132                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4133         fi
4134 else
4135         ARFLAGS=$cf_cv_ar_flags
4136 fi
4137
4138         echo "$as_me:4138: checking for PATH separator" >&5
4139 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4140         case "$cf_cv_system_name" in
4141         (os2*)  PATH_SEPARATOR=';'  ;;
4142         (*)     ${PATH_SEPARATOR:=':'}  ;;
4143         esac
4144
4145         echo "$as_me:4145: result: $PATH_SEPARATOR" >&5
4146 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4147
4148 echo "$as_me:4148: checking if you have specified an install-prefix" >&5
4149 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4150
4151 # Check whether --with-install-prefix or --without-install-prefix was given.
4152 if test "${with_install_prefix+set}" = set; then
4153   withval="$with_install_prefix"
4154   case "$withval" in
4155         (yes|no)
4156                 ;;
4157         (*)     DESTDIR="$withval"
4158                 ;;
4159         esac
4160 fi;
4161 echo "$as_me:4161: result: $DESTDIR" >&5
4162 echo "${ECHO_T}$DESTDIR" >&6
4163
4164 ###############################################################################
4165
4166 # If we're cross-compiling, allow the user to override the tools and their
4167 # options.  The configure script is oriented toward identifying the host
4168 # compiler, etc., but we need a build compiler to generate parts of the source.
4169
4170 if test "$cross_compiling" = yes ; then
4171
4172         # defaults that we might want to override
4173         : ${BUILD_CFLAGS:=''}
4174         : ${BUILD_CPPFLAGS:=''}
4175         : ${BUILD_LDFLAGS:=''}
4176         : ${BUILD_LIBS:=''}
4177         : ${BUILD_EXEEXT:='$x'}
4178         : ${BUILD_OBJEXT:='o'}
4179
4180 # Check whether --with-build-cc or --without-build-cc was given.
4181 if test "${with_build_cc+set}" = set; then
4182   withval="$with_build_cc"
4183   BUILD_CC="$withval"
4184 else
4185   for ac_prog in gcc clang c99 c89 cc cl
4186 do
4187   # Extract the first word of "$ac_prog", so it can be a program name with args.
4188 set dummy $ac_prog; ac_word=$2
4189 echo "$as_me:4189: checking for $ac_word" >&5
4190 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4191 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4192   echo $ECHO_N "(cached) $ECHO_C" >&6
4193 else
4194   if test -n "$BUILD_CC"; then
4195   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4196 else
4197   ac_save_IFS=$IFS; IFS=$ac_path_separator
4198 ac_dummy="$PATH"
4199 for ac_dir in $ac_dummy; do
4200   IFS=$ac_save_IFS
4201   test -z "$ac_dir" && ac_dir=.
4202   $as_executable_p "$ac_dir/$ac_word" || continue
4203 ac_cv_prog_BUILD_CC="$ac_prog"
4204 echo "$as_me:4204: found $ac_dir/$ac_word" >&5
4205 break
4206 done
4207
4208 fi
4209 fi
4210 BUILD_CC=$ac_cv_prog_BUILD_CC
4211 if test -n "$BUILD_CC"; then
4212   echo "$as_me:4212: result: $BUILD_CC" >&5
4213 echo "${ECHO_T}$BUILD_CC" >&6
4214 else
4215   echo "$as_me:4215: result: no" >&5
4216 echo "${ECHO_T}no" >&6
4217 fi
4218
4219   test -n "$BUILD_CC" && break
4220 done
4221 test -n "$BUILD_CC" || BUILD_CC="none"
4222
4223 fi;
4224         echo "$as_me:4224: checking for native build C compiler" >&5
4225 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4226         echo "$as_me:4226: result: $BUILD_CC" >&5
4227 echo "${ECHO_T}$BUILD_CC" >&6
4228
4229         echo "$as_me:4229: checking for native build C preprocessor" >&5
4230 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4231
4232 # Check whether --with-build-cpp or --without-build-cpp was given.
4233 if test "${with_build_cpp+set}" = set; then
4234   withval="$with_build_cpp"
4235   BUILD_CPP="$withval"
4236 else
4237   BUILD_CPP='${BUILD_CC} -E'
4238 fi;
4239         echo "$as_me:4239: result: $BUILD_CPP" >&5
4240 echo "${ECHO_T}$BUILD_CPP" >&6
4241
4242         echo "$as_me:4242: checking for native build C flags" >&5
4243 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4244
4245 # Check whether --with-build-cflags or --without-build-cflags was given.
4246 if test "${with_build_cflags+set}" = set; then
4247   withval="$with_build_cflags"
4248   BUILD_CFLAGS="$withval"
4249 fi;
4250         echo "$as_me:4250: result: $BUILD_CFLAGS" >&5
4251 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4252
4253         echo "$as_me:4253: checking for native build C preprocessor-flags" >&5
4254 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4255
4256 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4257 if test "${with_build_cppflags+set}" = set; then
4258   withval="$with_build_cppflags"
4259   BUILD_CPPFLAGS="$withval"
4260 fi;
4261         echo "$as_me:4261: result: $BUILD_CPPFLAGS" >&5
4262 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4263
4264         echo "$as_me:4264: checking for native build linker-flags" >&5
4265 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4266
4267 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4268 if test "${with_build_ldflags+set}" = set; then
4269   withval="$with_build_ldflags"
4270   BUILD_LDFLAGS="$withval"
4271 fi;
4272         echo "$as_me:4272: result: $BUILD_LDFLAGS" >&5
4273 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4274
4275         echo "$as_me:4275: checking for native build linker-libraries" >&5
4276 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4277
4278 # Check whether --with-build-libs or --without-build-libs was given.
4279 if test "${with_build_libs+set}" = set; then
4280   withval="$with_build_libs"
4281   BUILD_LIBS="$withval"
4282 fi;
4283         echo "$as_me:4283: result: $BUILD_LIBS" >&5
4284 echo "${ECHO_T}$BUILD_LIBS" >&6
4285
4286         # this assumes we're on Unix.
4287         BUILD_EXEEXT=
4288         BUILD_OBJEXT=o
4289
4290         : ${BUILD_CC:='${CC}'}
4291
4292         echo "$as_me:4292: checking if the build-compiler \"$BUILD_CC\" works" >&5
4293 echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4294
4295         cf_save_crossed=$cross_compiling
4296         cf_save_ac_link=$ac_link
4297         cross_compiling=no
4298         ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $BUILD_CPPFLAGS $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4299
4300         if test "$cross_compiling" = yes; then
4301   cf_ok_build_cc=unknown
4302 else
4303   cat >"conftest.$ac_ext" <<_ACEOF
4304 #line 4304 "configure"
4305 #include "confdefs.h"
4306 #include <stdio.h>
4307                 int main(int argc, char *argv[])
4308                 {
4309                         ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4310                 }
4311
4312 _ACEOF
4313 rm -f "conftest$ac_exeext"
4314 if { (eval echo "$as_me:4314: \"$ac_link\"") >&5
4315   (eval $ac_link) 2>&5
4316   ac_status=$?
4317   echo "$as_me:4317: \$? = $ac_status" >&5
4318   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4319   { (eval echo "$as_me:4319: \"$ac_try\"") >&5
4320   (eval $ac_try) 2>&5
4321   ac_status=$?
4322   echo "$as_me:4322: \$? = $ac_status" >&5
4323   (exit "$ac_status"); }; }; then
4324   cf_ok_build_cc=yes
4325 else
4326   echo "$as_me: program exited with status $ac_status" >&5
4327 echo "$as_me: failed program was:" >&5
4328 cat "conftest.$ac_ext" >&5
4329 cf_ok_build_cc=no
4330 fi
4331 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4332 fi
4333
4334         cross_compiling=$cf_save_crossed
4335         ac_link=$cf_save_ac_link
4336
4337         echo "$as_me:4337: result: $cf_ok_build_cc" >&5
4338 echo "${ECHO_T}$cf_ok_build_cc" >&6
4339
4340         if test "$cf_ok_build_cc" != yes
4341         then
4342                 { { echo "$as_me:4342: error: Cross-build requires two compilers.
4343 Use --with-build-cc to specify the native compiler." >&5
4344 echo "$as_me: error: Cross-build requires two compilers.
4345 Use --with-build-cc to specify the native compiler." >&2;}
4346    { (exit 1); exit 1; }; }
4347         fi
4348
4349 else
4350         : ${BUILD_CC:='${CC}'}
4351         : ${BUILD_CPP:='${CPP}'}
4352         : ${BUILD_CFLAGS:='${CFLAGS}'}
4353         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4354         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4355         : ${BUILD_LIBS:='${LIBS}'}
4356         : ${BUILD_EXEEXT:='$x'}
4357         : ${BUILD_OBJEXT:='o'}
4358 fi
4359
4360 ###############################################################################
4361
4362 ### Options to allow the user to specify the set of libraries which are used.
4363 ### Use "--without-normal --with-shared" to allow the default model to be
4364 ### shared, for example.
4365 cf_list_models=""
4366
4367 echo "$as_me:4367: checking if you want to build shared C-objects" >&5
4368 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4369
4370 # Check whether --with-shared or --without-shared was given.
4371 if test "${with_shared+set}" = set; then
4372   withval="$with_shared"
4373   with_shared=$withval
4374 else
4375   with_shared=no
4376 fi;
4377 echo "$as_me:4377: result: $with_shared" >&5
4378 echo "${ECHO_T}$with_shared" >&6
4379 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4380
4381 echo "$as_me:4381: checking for specified models" >&5
4382 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4383 test -z "$cf_list_models" && cf_list_models=normal
4384 echo "$as_me:4384: result: $cf_list_models" >&5
4385 echo "${ECHO_T}$cf_list_models" >&6
4386
4387 ### Use the first model as the default, and save its suffix for use in building
4388 ### up test-applications.
4389 echo "$as_me:4389: checking for default model" >&5
4390 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4391 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4392 echo "$as_me:4392: result: $DFT_LWR_MODEL" >&5
4393 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4394
4395 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4396
4397 echo "$as_me:4397: checking for specific curses-directory" >&5
4398 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4399
4400 # Check whether --with-curses-dir or --without-curses-dir was given.
4401 if test "${with_curses_dir+set}" = set; then
4402   withval="$with_curses_dir"
4403   cf_cv_curses_dir=$withval
4404 else
4405   cf_cv_curses_dir=no
4406 fi;
4407 echo "$as_me:4407: result: $cf_cv_curses_dir" >&5
4408 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4409
4410 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4411 then
4412
4413 if test "x$prefix" != xNONE; then
4414         cf_path_syntax="$prefix"
4415 else
4416         cf_path_syntax="$ac_default_prefix"
4417 fi
4418
4419 case ".$withval" in
4420 (.\$\(*\)*|.\'*\'*)
4421         ;;
4422 (..|./*|.\\*)
4423         ;;
4424 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4425         ;;
4426 (.\$\{*prefix\}*|.\$\{*dir\}*)
4427         eval withval="$withval"
4428         case ".$withval" in
4429         (.NONE/*)
4430                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4431                 ;;
4432         esac
4433         ;;
4434 (.no|.NONE/*)
4435         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4436         ;;
4437 (*)
4438         { { echo "$as_me:4438: error: expected a pathname, not \"$withval\"" >&5
4439 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4440    { (exit 1); exit 1; }; }
4441         ;;
4442 esac
4443
4444         if test -d "$cf_cv_curses_dir"
4445         then
4446
4447 if test -n "$cf_cv_curses_dir/include" ; then
4448   for cf_add_incdir in $cf_cv_curses_dir/include
4449   do
4450         while test "$cf_add_incdir" != /usr/include
4451         do
4452           if test -d "$cf_add_incdir"
4453           then
4454                 cf_have_incdir=no
4455                 if test -n "$CFLAGS$CPPFLAGS" ; then
4456                   # a loop is needed to ensure we can add subdirs of existing dirs
4457                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4458                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4459                           cf_have_incdir=yes; break
4460                         fi
4461                   done
4462                 fi
4463
4464                 if test "$cf_have_incdir" = no ; then
4465                   if test "$cf_add_incdir" = /usr/local/include ; then
4466                         if test "$GCC" = yes
4467                         then
4468                           cf_save_CPPFLAGS=$CPPFLAGS
4469
4470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4471         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4472
4473                           cat >"conftest.$ac_ext" <<_ACEOF
4474 #line 4474 "configure"
4475 #include "confdefs.h"
4476 #include <stdio.h>
4477 int
4478 main (void)
4479 {
4480 printf("Hello")
4481   ;
4482   return 0;
4483 }
4484 _ACEOF
4485 rm -f "conftest.$ac_objext"
4486 if { (eval echo "$as_me:4486: \"$ac_compile\"") >&5
4487   (eval $ac_compile) 2>&5
4488   ac_status=$?
4489   echo "$as_me:4489: \$? = $ac_status" >&5
4490   (exit "$ac_status"); } &&
4491          { ac_try='test -s "conftest.$ac_objext"'
4492   { (eval echo "$as_me:4492: \"$ac_try\"") >&5
4493   (eval $ac_try) 2>&5
4494   ac_status=$?
4495   echo "$as_me:4495: \$? = $ac_status" >&5
4496   (exit "$ac_status"); }; }; then
4497   :
4498 else
4499   echo "$as_me: failed program was:" >&5
4500 cat "conftest.$ac_ext" >&5
4501 cf_have_incdir=yes
4502 fi
4503 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4504                           CPPFLAGS=$cf_save_CPPFLAGS
4505                         fi
4506                   fi
4507                 fi
4508
4509                 if test "$cf_have_incdir" = no ; then
4510                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4511
4512 echo "${as_me:-configure}:4512: testing adding $cf_add_incdir to include-path ..." 1>&5
4513
4514                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4515
4516                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4517                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4518                   cf_add_incdir="$cf_top_incdir"
4519                 else
4520                   break
4521                 fi
4522           else
4523                 break
4524           fi
4525         done
4526   done
4527 fi
4528
4529 if test -n "$cf_cv_curses_dir/lib" ; then
4530         for cf_add_libdir in $cf_cv_curses_dir/lib
4531         do
4532                 if test "$cf_add_libdir" = /usr/lib ; then
4533                         :
4534                 elif test -d "$cf_add_libdir"
4535                 then
4536                         cf_have_libdir=no
4537                         if test -n "$LDFLAGS$LIBS" ; then
4538                                 # a loop is needed to ensure we can add subdirs of existing dirs
4539                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4540                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4541                                                 cf_have_libdir=yes; break
4542                                         fi
4543                                 done
4544                         fi
4545                         if test "$cf_have_libdir" = no ; then
4546                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4547
4548 echo "${as_me:-configure}:4548: testing adding $cf_add_libdir to library-path ..." 1>&5
4549
4550                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4551                         fi
4552                 fi
4553         done
4554 fi
4555
4556         fi
4557 fi
4558
4559 cf_ncuconfig_root=ncurses
4560 cf_have_ncuconfig=no
4561
4562 if test "x${PKG_CONFIG:=none}" != xnone; then
4563         echo "$as_me:4563: checking pkg-config for $cf_ncuconfig_root" >&5
4564 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4565         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4566                 echo "$as_me:4566: result: yes" >&5
4567 echo "${ECHO_T}yes" >&6
4568
4569                 echo "$as_me:4569: checking if the $cf_ncuconfig_root package files work" >&5
4570 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4571                 cf_have_ncuconfig=unknown
4572
4573                 cf_save_CFLAGS="$CFLAGS"
4574                 cf_save_CPPFLAGS="$CPPFLAGS"
4575                 cf_save_LIBS="$LIBS"
4576
4577                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4578                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4579
4580                 # while -W for passing linker flags is prevalent, it is not "standard".
4581                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4582                 # incompatible _and_ non-standard -W option which gives an error.  Work
4583                 # around that pitfall.
4584                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4585                 (x*c[89]9@@*-W*)
4586
4587 cf_fix_cppflags=no
4588 cf_new_cflags=
4589 cf_new_cppflags=
4590 cf_new_extra_cppflags=
4591
4592 for cf_add_cflags in $cf_pkg_cflags
4593 do
4594 case "$cf_fix_cppflags" in
4595 (no)
4596         case "$cf_add_cflags" in
4597         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4598                 case "$cf_add_cflags" in
4599                 (-D*)
4600                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4601
4602                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4603                                 && test -z "${cf_tst_cflags}" \
4604                                 && cf_fix_cppflags=yes
4605
4606                         if test "$cf_fix_cppflags" = yes ; then
4607
4608         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4609         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4610
4611                                 continue
4612                         elif test "${cf_tst_cflags}" = "\"'" ; then
4613
4614         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4615         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4616
4617                                 continue
4618                         fi
4619                         ;;
4620                 esac
4621                 case "$CPPFLAGS" in
4622                 (*$cf_add_cflags)
4623                         ;;
4624                 (*)
4625                         case "$cf_add_cflags" in
4626                         (-D*)
4627                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4628
4629 CPPFLAGS=`echo "$CPPFLAGS" | \
4630         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4631                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4632
4633                                 ;;
4634                         esac
4635
4636         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4637         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4638
4639                         ;;
4640                 esac
4641                 ;;
4642         (*)
4643
4644         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4645         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4646
4647                 ;;
4648         esac
4649         ;;
4650 (yes)
4651
4652         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4653         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4654
4655         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4656
4657         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4658                 && test -z "${cf_tst_cflags}" \
4659                 && cf_fix_cppflags=no
4660         ;;
4661 esac
4662 done
4663
4664 if test -n "$cf_new_cflags" ; then
4665
4666         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4667         CFLAGS="${CFLAGS}$cf_new_cflags"
4668
4669 fi
4670
4671 if test -n "$cf_new_cppflags" ; then
4672
4673         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4674         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4675
4676 fi
4677
4678 if test -n "$cf_new_extra_cppflags" ; then
4679
4680         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4681         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4682
4683 fi
4684
4685 cf_add_libs="$LIBS"
4686 # reverse order
4687 cf_add_0lib=
4688 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4689 # filter duplicates
4690 for cf_add_1lib in $cf_add_0lib; do
4691         for cf_add_2lib in $cf_add_libs; do
4692                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4693                         cf_add_1lib=
4694                         break
4695                 fi
4696         done
4697         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4698 done
4699 LIBS="$cf_add_libs"
4700
4701                         cat >"conftest.$ac_ext" <<_ACEOF
4702 #line 4702 "configure"
4703 #include "confdefs.h"
4704 #include <${cf_cv_ncurses_header:-curses.h}>
4705 int
4706 main (void)
4707 {
4708 initscr(); mousemask(0,0); tigetstr((char *)0);
4709   ;
4710   return 0;
4711 }
4712 _ACEOF
4713 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4714 if { (eval echo "$as_me:4714: \"$ac_link\"") >&5
4715   (eval $ac_link) 2>&5
4716   ac_status=$?
4717   echo "$as_me:4717: \$? = $ac_status" >&5
4718   (exit "$ac_status"); } &&
4719          { ac_try='test -s "conftest$ac_exeext"'
4720   { (eval echo "$as_me:4720: \"$ac_try\"") >&5
4721   (eval $ac_try) 2>&5
4722   ac_status=$?
4723   echo "$as_me:4723: \$? = $ac_status" >&5
4724   (exit "$ac_status"); }; }; then
4725   if test "$cross_compiling" = yes; then
4726   cf_test_ncuconfig=maybe
4727 else
4728   cat >"conftest.$ac_ext" <<_ACEOF
4729 #line 4729 "configure"
4730 #include "confdefs.h"
4731 #include <${cf_cv_ncurses_header:-curses.h}>
4732                                         int main(void)
4733                                         { const char *xx = curses_version(); return (xx == 0); }
4734 _ACEOF
4735 rm -f "conftest$ac_exeext"
4736 if { (eval echo "$as_me:4736: \"$ac_link\"") >&5
4737   (eval $ac_link) 2>&5
4738   ac_status=$?
4739   echo "$as_me:4739: \$? = $ac_status" >&5
4740   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4741   { (eval echo "$as_me:4741: \"$ac_try\"") >&5
4742   (eval $ac_try) 2>&5
4743   ac_status=$?
4744   echo "$as_me:4744: \$? = $ac_status" >&5
4745   (exit "$ac_status"); }; }; then
4746   cf_test_ncuconfig=yes
4747 else
4748   echo "$as_me: program exited with status $ac_status" >&5
4749 echo "$as_me: failed program was:" >&5
4750 cat "conftest.$ac_ext" >&5
4751 cf_test_ncuconfig=no
4752 fi
4753 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4754 fi
4755 else
4756   echo "$as_me: failed program was:" >&5
4757 cat "conftest.$ac_ext" >&5
4758 cf_test_ncuconfig=no
4759 fi
4760 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4761
4762                         CFLAGS="$cf_save_CFLAGS"
4763                         CPPFLAGS="$cf_save_CPPFLAGS"
4764                         LIBS="$cf_save_LIBS"
4765
4766                         if test "x$cf_test_ncuconfig" != xyes; then
4767                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4768                                 cf_pkg_cflags="$cf_temp"
4769                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4770                                 cf_pkg_libs="$cf_temp"
4771                         fi
4772                         ;;
4773                 esac
4774
4775 for cf_add_cflags in $cf_pkg_cflags
4776 do
4777         case "x$cf_add_cflags" in
4778         (x-[DU]*)
4779
4780 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4781 while true
4782 do
4783         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4784         test "$CFLAGS" != "$cf_old_cflag" || break
4785
4786         CFLAGS="$cf_old_cflag"
4787 done
4788
4789 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4790 while true
4791 do
4792         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4793         test "$CPPFLAGS" != "$cf_old_cflag" || break
4794
4795         CPPFLAGS="$cf_old_cflag"
4796 done
4797
4798                 ;;
4799         esac
4800
4801 cf_fix_cppflags=no
4802 cf_new_cflags=
4803 cf_new_cppflags=
4804 cf_new_extra_cppflags=
4805
4806 for cf_add_cflags in $cf_add_cflags
4807 do
4808 case "$cf_fix_cppflags" in
4809 (no)
4810         case "$cf_add_cflags" in
4811         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4812                 case "$cf_add_cflags" in
4813                 (-D*)
4814                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4815
4816                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4817                                 && test -z "${cf_tst_cflags}" \
4818                                 && cf_fix_cppflags=yes
4819
4820                         if test "$cf_fix_cppflags" = yes ; then
4821
4822         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4823         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4824
4825                                 continue
4826                         elif test "${cf_tst_cflags}" = "\"'" ; then
4827
4828         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4829         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4830
4831                                 continue
4832                         fi
4833                         ;;
4834                 esac
4835                 case "$CPPFLAGS" in
4836                 (*$cf_add_cflags)
4837                         ;;
4838                 (*)
4839                         case "$cf_add_cflags" in
4840                         (-D*)
4841                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4842
4843 CPPFLAGS=`echo "$CPPFLAGS" | \
4844         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4845                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4846
4847                                 ;;
4848                         esac
4849
4850         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4851         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4852
4853                         ;;
4854                 esac
4855                 ;;
4856         (*)
4857
4858         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4859         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4860
4861                 ;;
4862         esac
4863         ;;
4864 (yes)
4865
4866         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4867         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4868
4869         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4870
4871         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4872                 && test -z "${cf_tst_cflags}" \
4873                 && cf_fix_cppflags=no
4874         ;;
4875 esac
4876 done
4877
4878 if test -n "$cf_new_cflags" ; then
4879
4880         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4881         CFLAGS="${CFLAGS}$cf_new_cflags"
4882
4883 fi
4884
4885 if test -n "$cf_new_cppflags" ; then
4886
4887         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4888         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4889
4890 fi
4891
4892 if test -n "$cf_new_extra_cppflags" ; then
4893
4894         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4895         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4896
4897 fi
4898
4899 done
4900
4901 cf_add_libs="$LIBS"
4902 # reverse order
4903 cf_add_0lib=
4904 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4905 # filter duplicates
4906 for cf_add_1lib in $cf_add_0lib; do
4907         for cf_add_2lib in $cf_add_libs; do
4908                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4909                         cf_add_1lib=
4910                         break
4911                 fi
4912         done
4913         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4914 done
4915 LIBS="$cf_add_libs"
4916
4917                 cat >"conftest.$ac_ext" <<_ACEOF
4918 #line 4918 "configure"
4919 #include "confdefs.h"
4920 #include <${cf_cv_ncurses_header:-curses.h}>
4921 int
4922 main (void)
4923 {
4924 initscr(); mousemask(0,0); tigetstr((char *)0);
4925   ;
4926   return 0;
4927 }
4928 _ACEOF
4929 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4930 if { (eval echo "$as_me:4930: \"$ac_link\"") >&5
4931   (eval $ac_link) 2>&5
4932   ac_status=$?
4933   echo "$as_me:4933: \$? = $ac_status" >&5
4934   (exit "$ac_status"); } &&
4935          { ac_try='test -s "conftest$ac_exeext"'
4936   { (eval echo "$as_me:4936: \"$ac_try\"") >&5
4937   (eval $ac_try) 2>&5
4938   ac_status=$?
4939   echo "$as_me:4939: \$? = $ac_status" >&5
4940   (exit "$ac_status"); }; }; then
4941   if test "$cross_compiling" = yes; then
4942   cf_have_ncuconfig=maybe
4943 else
4944   cat >"conftest.$ac_ext" <<_ACEOF
4945 #line 4945 "configure"
4946 #include "confdefs.h"
4947 #include <${cf_cv_ncurses_header:-curses.h}>
4948                                 int main(void)
4949                                 { const char *xx = curses_version(); return (xx == 0); }
4950 _ACEOF
4951 rm -f "conftest$ac_exeext"
4952 if { (eval echo "$as_me:4952: \"$ac_link\"") >&5
4953   (eval $ac_link) 2>&5
4954   ac_status=$?
4955   echo "$as_me:4955: \$? = $ac_status" >&5
4956   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4957   { (eval echo "$as_me:4957: \"$ac_try\"") >&5
4958   (eval $ac_try) 2>&5
4959   ac_status=$?
4960   echo "$as_me:4960: \$? = $ac_status" >&5
4961   (exit "$ac_status"); }; }; then
4962   cf_have_ncuconfig=yes
4963 else
4964   echo "$as_me: program exited with status $ac_status" >&5
4965 echo "$as_me: failed program was:" >&5
4966 cat "conftest.$ac_ext" >&5
4967 cf_have_ncuconfig=no
4968 fi
4969 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4970 fi
4971 else
4972   echo "$as_me: failed program was:" >&5
4973 cat "conftest.$ac_ext" >&5
4974 cf_have_ncuconfig=no
4975 fi
4976 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4977                 echo "$as_me:4977: result: $cf_have_ncuconfig" >&5
4978 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4979                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4980                 if test "$cf_have_ncuconfig" != "yes"
4981                 then
4982                         CPPFLAGS="$cf_save_CPPFLAGS"
4983                         LIBS="$cf_save_LIBS"
4984                         NCURSES_CONFIG_PKG=none
4985                 else
4986
4987 cat >>confdefs.h <<\EOF
4988 #define NCURSES 1
4989 EOF
4990
4991                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4992
4993 echo "$as_me:4993: checking for terminfo header" >&5
4994 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4995 if test "${cf_cv_term_header+set}" = set; then
4996   echo $ECHO_N "(cached) $ECHO_C" >&6
4997 else
4998
4999 case "${cf_cv_ncurses_header}" in
5000 (*/ncurses.h|*/ncursesw.h)
5001         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5002         ;;
5003 (*)
5004         cf_term_header=term.h
5005         ;;
5006 esac
5007
5008 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5009 do
5010 cat >"conftest.$ac_ext" <<_ACEOF
5011 #line 5011 "configure"
5012 #include "confdefs.h"
5013 #include <stdio.h>
5014 #include <${cf_cv_ncurses_header:-curses.h}>
5015 #include <$cf_test>
5016
5017 int
5018 main (void)
5019 {
5020 int x = auto_left_margin; (void)x
5021   ;
5022   return 0;
5023 }
5024 _ACEOF
5025 rm -f "conftest.$ac_objext"
5026 if { (eval echo "$as_me:5026: \"$ac_compile\"") >&5
5027   (eval $ac_compile) 2>&5
5028   ac_status=$?
5029   echo "$as_me:5029: \$? = $ac_status" >&5
5030   (exit "$ac_status"); } &&
5031          { ac_try='test -s "conftest.$ac_objext"'
5032   { (eval echo "$as_me:5032: \"$ac_try\"") >&5
5033   (eval $ac_try) 2>&5
5034   ac_status=$?
5035   echo "$as_me:5035: \$? = $ac_status" >&5
5036   (exit "$ac_status"); }; }; then
5037
5038         cf_cv_term_header="$cf_test"
5039 else
5040   echo "$as_me: failed program was:" >&5
5041 cat "conftest.$ac_ext" >&5
5042
5043         cf_cv_term_header=unknown
5044
5045 fi
5046 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5047         test "$cf_cv_term_header" != unknown && break
5048 done
5049
5050 fi
5051 echo "$as_me:5051: result: $cf_cv_term_header" >&5
5052 echo "${ECHO_T}$cf_cv_term_header" >&6
5053
5054 # Set definitions to allow ifdef'ing to accommodate subdirectories
5055
5056 case "$cf_cv_term_header" in
5057 (*term.h)
5058
5059 cat >>confdefs.h <<\EOF
5060 #define HAVE_TERM_H 1
5061 EOF
5062
5063         ;;
5064 esac
5065
5066 case "$cf_cv_term_header" in
5067 (ncurses/term.h)
5068
5069 cat >>confdefs.h <<\EOF
5070 #define HAVE_NCURSES_TERM_H 1
5071 EOF
5072
5073         ;;
5074 (ncursesw/term.h)
5075
5076 cat >>confdefs.h <<\EOF
5077 #define HAVE_NCURSESW_TERM_H 1
5078 EOF
5079
5080         ;;
5081 esac
5082
5083                 fi
5084
5085         else
5086                 echo "$as_me:5086: result: no" >&5
5087 echo "${ECHO_T}no" >&6
5088                 NCURSES_CONFIG_PKG=none
5089         fi
5090 else
5091         NCURSES_CONFIG_PKG=none
5092 fi
5093
5094 if test "x$cf_have_ncuconfig" = "xno"; then
5095         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5096
5097 if test -n "$ac_tool_prefix"; then
5098   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5099   do
5100     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5101 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5102 echo "$as_me:5102: checking for $ac_word" >&5
5103 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5104 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5105   echo $ECHO_N "(cached) $ECHO_C" >&6
5106 else
5107   if test -n "$NCURSES_CONFIG"; then
5108   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5109 else
5110   ac_save_IFS=$IFS; IFS=$ac_path_separator
5111 ac_dummy="$PATH"
5112 for ac_dir in $ac_dummy; do
5113   IFS=$ac_save_IFS
5114   test -z "$ac_dir" && ac_dir=.
5115   $as_executable_p "$ac_dir/$ac_word" || continue
5116 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5117 echo "$as_me:5117: found $ac_dir/$ac_word" >&5
5118 break
5119 done
5120
5121 fi
5122 fi
5123 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5124 if test -n "$NCURSES_CONFIG"; then
5125   echo "$as_me:5125: result: $NCURSES_CONFIG" >&5
5126 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5127 else
5128   echo "$as_me:5128: result: no" >&5
5129 echo "${ECHO_T}no" >&6
5130 fi
5131
5132     test -n "$NCURSES_CONFIG" && break
5133   done
5134 fi
5135 if test -z "$NCURSES_CONFIG"; then
5136   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5137   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5138 do
5139   # Extract the first word of "$ac_prog", so it can be a program name with args.
5140 set dummy $ac_prog; ac_word=$2
5141 echo "$as_me:5141: checking for $ac_word" >&5
5142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5143 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5144   echo $ECHO_N "(cached) $ECHO_C" >&6
5145 else
5146   if test -n "$ac_ct_NCURSES_CONFIG"; then
5147   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5148 else
5149   ac_save_IFS=$IFS; IFS=$ac_path_separator
5150 ac_dummy="$PATH"
5151 for ac_dir in $ac_dummy; do
5152   IFS=$ac_save_IFS
5153   test -z "$ac_dir" && ac_dir=.
5154   $as_executable_p "$ac_dir/$ac_word" || continue
5155 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5156 echo "$as_me:5156: found $ac_dir/$ac_word" >&5
5157 break
5158 done
5159
5160 fi
5161 fi
5162 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5163 if test -n "$ac_ct_NCURSES_CONFIG"; then
5164   echo "$as_me:5164: result: $ac_ct_NCURSES_CONFIG" >&5
5165 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5166 else
5167   echo "$as_me:5167: result: no" >&5
5168 echo "${ECHO_T}no" >&6
5169 fi
5170
5171   test -n "$ac_ct_NCURSES_CONFIG" && break
5172 done
5173 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5174
5175   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5176 fi
5177
5178         if test "$NCURSES_CONFIG" != none ; then
5179
5180 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5181 do
5182         case "x$cf_add_cflags" in
5183         (x-[DU]*)
5184
5185 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5186 while true
5187 do
5188         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5189         test "$CFLAGS" != "$cf_old_cflag" || break
5190
5191         CFLAGS="$cf_old_cflag"
5192 done
5193
5194 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5195 while true
5196 do
5197         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5198         test "$CPPFLAGS" != "$cf_old_cflag" || break
5199
5200         CPPFLAGS="$cf_old_cflag"
5201 done
5202
5203                 ;;
5204         esac
5205
5206 cf_fix_cppflags=no
5207 cf_new_cflags=
5208 cf_new_cppflags=
5209 cf_new_extra_cppflags=
5210
5211 for cf_add_cflags in $cf_add_cflags
5212 do
5213 case "$cf_fix_cppflags" in
5214 (no)
5215         case "$cf_add_cflags" in
5216         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5217                 case "$cf_add_cflags" in
5218                 (-D*)
5219                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5220
5221                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5222                                 && test -z "${cf_tst_cflags}" \
5223                                 && cf_fix_cppflags=yes
5224
5225                         if test "$cf_fix_cppflags" = yes ; then
5226
5227         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5228         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5229
5230                                 continue
5231                         elif test "${cf_tst_cflags}" = "\"'" ; then
5232
5233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5235
5236                                 continue
5237                         fi
5238                         ;;
5239                 esac
5240                 case "$CPPFLAGS" in
5241                 (*$cf_add_cflags)
5242                         ;;
5243                 (*)
5244                         case "$cf_add_cflags" in
5245                         (-D*)
5246                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5247
5248 CPPFLAGS=`echo "$CPPFLAGS" | \
5249         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5250                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5251
5252                                 ;;
5253                         esac
5254
5255         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5256         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5257
5258                         ;;
5259                 esac
5260                 ;;
5261         (*)
5262
5263         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5264         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5265
5266                 ;;
5267         esac
5268         ;;
5269 (yes)
5270
5271         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5272         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5273
5274         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5275
5276         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5277                 && test -z "${cf_tst_cflags}" \
5278                 && cf_fix_cppflags=no
5279         ;;
5280 esac
5281 done
5282
5283 if test -n "$cf_new_cflags" ; then
5284
5285         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5286         CFLAGS="${CFLAGS}$cf_new_cflags"
5287
5288 fi
5289
5290 if test -n "$cf_new_cppflags" ; then
5291
5292         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5293         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5294
5295 fi
5296
5297 if test -n "$cf_new_extra_cppflags" ; then
5298
5299         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5300         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5301
5302 fi
5303
5304 done
5305
5306 cf_add_libs="$LIBS"
5307 # reverse order
5308 cf_add_0lib=
5309 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5310 # filter duplicates
5311 for cf_add_1lib in $cf_add_0lib; do
5312         for cf_add_2lib in $cf_add_libs; do
5313                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5314                         cf_add_1lib=
5315                         break
5316                 fi
5317         done
5318         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5319 done
5320 LIBS="$cf_add_libs"
5321
5322                 # even with config script, some packages use no-override for curses.h
5323
5324 echo "$as_me:5324: checking if we have identified curses headers" >&5
5325 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5326 if test "${cf_cv_ncurses_header+set}" = set; then
5327   echo $ECHO_N "(cached) $ECHO_C" >&6
5328 else
5329
5330 cf_cv_ncurses_header=none
5331 for cf_header in \
5332         ncurses.h ncurses/ncurses.h \
5333         curses.h ncurses/curses.h
5334 do
5335 cat >"conftest.$ac_ext" <<_ACEOF
5336 #line 5336 "configure"
5337 #include "confdefs.h"
5338 #include <${cf_header}>
5339 int
5340 main (void)
5341 {
5342 initscr(); tgoto("?", 0,0)
5343   ;
5344   return 0;
5345 }
5346 _ACEOF
5347 rm -f "conftest.$ac_objext"
5348 if { (eval echo "$as_me:5348: \"$ac_compile\"") >&5
5349   (eval $ac_compile) 2>&5
5350   ac_status=$?
5351   echo "$as_me:5351: \$? = $ac_status" >&5
5352   (exit "$ac_status"); } &&
5353          { ac_try='test -s "conftest.$ac_objext"'
5354   { (eval echo "$as_me:5354: \"$ac_try\"") >&5
5355   (eval $ac_try) 2>&5
5356   ac_status=$?
5357   echo "$as_me:5357: \$? = $ac_status" >&5
5358   (exit "$ac_status"); }; }; then
5359   cf_cv_ncurses_header=$cf_header; break
5360 else
5361   echo "$as_me: failed program was:" >&5
5362 cat "conftest.$ac_ext" >&5
5363 fi
5364 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5365 done
5366
5367 fi
5368 echo "$as_me:5368: result: $cf_cv_ncurses_header" >&5
5369 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5370
5371 if test "$cf_cv_ncurses_header" = none ; then
5372         { { echo "$as_me:5372: error: No curses header-files found" >&5
5373 echo "$as_me: error: No curses header-files found" >&2;}
5374    { (exit 1); exit 1; }; }
5375 fi
5376
5377 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5378
5379 for ac_header in $cf_cv_ncurses_header
5380 do
5381 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5382 echo "$as_me:5382: checking for $ac_header" >&5
5383 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5384 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5385   echo $ECHO_N "(cached) $ECHO_C" >&6
5386 else
5387   cat >"conftest.$ac_ext" <<_ACEOF
5388 #line 5388 "configure"
5389 #include "confdefs.h"
5390 #include <$ac_header>
5391 _ACEOF
5392 if { (eval echo "$as_me:5392: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5393   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5394   ac_status=$?
5395   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5396   rm -f conftest.er1
5397   cat conftest.err >&5
5398   echo "$as_me:5398: \$? = $ac_status" >&5
5399   (exit "$ac_status"); } >/dev/null; then
5400   if test -s conftest.err; then
5401     ac_cpp_err=$ac_c_preproc_warn_flag
5402   else
5403     ac_cpp_err=
5404   fi
5405 else
5406   ac_cpp_err=yes
5407 fi
5408 if test -z "$ac_cpp_err"; then
5409   eval "$as_ac_Header=yes"
5410 else
5411   echo "$as_me: failed program was:" >&5
5412   cat "conftest.$ac_ext" >&5
5413   eval "$as_ac_Header=no"
5414 fi
5415 rm -f conftest.err "conftest.$ac_ext"
5416 fi
5417 echo "$as_me:5417: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5418 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5419 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5420   cat >>confdefs.h <<EOF
5421 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5422 EOF
5423
5424 fi
5425 done
5426
5427 cat >>confdefs.h <<\EOF
5428 #define NCURSES 1
5429 EOF
5430
5431 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5432
5433                 cat >>confdefs.h <<EOF
5434 #define $cf_nculib_ROOT 1
5435 EOF
5436
5437                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5438
5439         else
5440
5441 cf_ncuhdr_root=ncurses
5442
5443 test -n "$cf_cv_curses_dir" && \
5444 test "$cf_cv_curses_dir" != "no" && { \
5445
5446 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5447   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5448   do
5449         while test "$cf_add_incdir" != /usr/include
5450         do
5451           if test -d "$cf_add_incdir"
5452           then
5453                 cf_have_incdir=no
5454                 if test -n "$CFLAGS$CPPFLAGS" ; then
5455                   # a loop is needed to ensure we can add subdirs of existing dirs
5456                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5457                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5458                           cf_have_incdir=yes; break
5459                         fi
5460                   done
5461                 fi
5462
5463                 if test "$cf_have_incdir" = no ; then
5464                   if test "$cf_add_incdir" = /usr/local/include ; then
5465                         if test "$GCC" = yes
5466                         then
5467                           cf_save_CPPFLAGS=$CPPFLAGS
5468
5469         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5470         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5471
5472                           cat >"conftest.$ac_ext" <<_ACEOF
5473 #line 5473 "configure"
5474 #include "confdefs.h"
5475 #include <stdio.h>
5476 int
5477 main (void)
5478 {
5479 printf("Hello")
5480   ;
5481   return 0;
5482 }
5483 _ACEOF
5484 rm -f "conftest.$ac_objext"
5485 if { (eval echo "$as_me:5485: \"$ac_compile\"") >&5
5486   (eval $ac_compile) 2>&5
5487   ac_status=$?
5488   echo "$as_me:5488: \$? = $ac_status" >&5
5489   (exit "$ac_status"); } &&
5490          { ac_try='test -s "conftest.$ac_objext"'
5491   { (eval echo "$as_me:5491: \"$ac_try\"") >&5
5492   (eval $ac_try) 2>&5
5493   ac_status=$?
5494   echo "$as_me:5494: \$? = $ac_status" >&5
5495   (exit "$ac_status"); }; }; then
5496   :
5497 else
5498   echo "$as_me: failed program was:" >&5
5499 cat "conftest.$ac_ext" >&5
5500 cf_have_incdir=yes
5501 fi
5502 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5503                           CPPFLAGS=$cf_save_CPPFLAGS
5504                         fi
5505                   fi
5506                 fi
5507
5508                 if test "$cf_have_incdir" = no ; then
5509                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5510
5511 echo "${as_me:-configure}:5511: testing adding $cf_add_incdir to include-path ..." 1>&5
5512
5513                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5514
5515                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5516                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5517                   cf_add_incdir="$cf_top_incdir"
5518                 else
5519                   break
5520                 fi
5521           else
5522                 break
5523           fi
5524         done
5525   done
5526 fi
5527
5528 }
5529
5530 echo "$as_me:5530: checking for $cf_ncuhdr_root header in include-path" >&5
5531 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5532 if test "${cf_cv_ncurses_h+set}" = set; then
5533   echo $ECHO_N "(cached) $ECHO_C" >&6
5534 else
5535
5536         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5537         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5538         for cf_header in $cf_header_list
5539         do
5540
5541         cat >"conftest.$ac_ext" <<_ACEOF
5542 #line 5542 "configure"
5543 #include "confdefs.h"
5544
5545 #include <$cf_header>
5546 int
5547 main (void)
5548 {
5549
5550 #ifdef NCURSES_VERSION
5551
5552 printf("%s\\n", NCURSES_VERSION);
5553 #else
5554 #ifdef __NCURSES_H
5555 printf("old\\n");
5556 #else
5557         make an error
5558 #endif
5559 #endif
5560
5561   ;
5562   return 0;
5563 }
5564 _ACEOF
5565 rm -f "conftest.$ac_objext"
5566 if { (eval echo "$as_me:5566: \"$ac_compile\"") >&5
5567   (eval $ac_compile) 2>&5
5568   ac_status=$?
5569   echo "$as_me:5569: \$? = $ac_status" >&5
5570   (exit "$ac_status"); } &&
5571          { ac_try='test -s "conftest.$ac_objext"'
5572   { (eval echo "$as_me:5572: \"$ac_try\"") >&5
5573   (eval $ac_try) 2>&5
5574   ac_status=$?
5575   echo "$as_me:5575: \$? = $ac_status" >&5
5576   (exit "$ac_status"); }; }; then
5577   cf_cv_ncurses_h=$cf_header
5578
5579 else
5580   echo "$as_me: failed program was:" >&5
5581 cat "conftest.$ac_ext" >&5
5582 cf_cv_ncurses_h=no
5583 fi
5584 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5585
5586                 test "$cf_cv_ncurses_h" != no && break
5587         done
5588
5589 fi
5590 echo "$as_me:5590: result: $cf_cv_ncurses_h" >&5
5591 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5592
5593 if test "$cf_cv_ncurses_h" != no ; then
5594         cf_cv_ncurses_header=$cf_cv_ncurses_h
5595 else
5596
5597 echo "$as_me:5597: checking for $cf_ncuhdr_root include-path" >&5
5598 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5599 if test "${cf_cv_ncurses_h2+set}" = set; then
5600   echo $ECHO_N "(cached) $ECHO_C" >&6
5601 else
5602
5603         test -n "$verbose" && echo
5604
5605 cf_search=
5606
5607 # collect the current set of include-directories from compiler flags
5608 cf_header_path_list=""
5609 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5610         for cf_header_path in $CPPFLAGS $CFLAGS
5611         do
5612                 case "$cf_header_path" in
5613                 (-I*)
5614                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5615
5616 test "x$cf_header_path" != "xNONE" && \
5617 test -d "$cf_header_path" && \
5618  {
5619         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5620         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5621         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5622         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5623         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5624         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"
5625 }
5626
5627                         cf_header_path_list="$cf_header_path_list $cf_search"
5628                         ;;
5629                 esac
5630         done
5631 fi
5632
5633 # add the variations for the package we are looking for
5634
5635 cf_search=
5636
5637 test "x$prefix" != "xNONE" && \
5638 test -d "$prefix" && \
5639  {
5640         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5641         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5642         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5643         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5644         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5645         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5646 }
5647
5648 for cf_subdir_prefix in \
5649         /usr \
5650         /usr/local \
5651         /usr/pkg \
5652         /opt \
5653         /opt/local \
5654         $HOME
5655 do
5656
5657 test "x$cf_subdir_prefix" != "x$prefix" && \
5658 test -d "$cf_subdir_prefix" && \
5659 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5660         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5661         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5662         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5663         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5664         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5665         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"
5666 }
5667
5668 done
5669
5670 test "$includedir" != NONE && \
5671 test "$includedir" != "/usr/include" && \
5672 test -d "$includedir" && {
5673         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5674         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5675 }
5676
5677 test "$oldincludedir" != NONE && \
5678 test "$oldincludedir" != "/usr/include" && \
5679 test -d "$oldincludedir" && {
5680         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5681         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5682 }
5683
5684 cf_search="$cf_search $cf_header_path_list"
5685
5686         test -n "$verbose" && echo "search path $cf_search"
5687         cf_save2_CPPFLAGS="$CPPFLAGS"
5688         for cf_incdir in $cf_search
5689         do
5690
5691 if test -n "$cf_incdir" ; then
5692   for cf_add_incdir in $cf_incdir
5693   do
5694         while test "$cf_add_incdir" != /usr/include
5695         do
5696           if test -d "$cf_add_incdir"
5697           then
5698                 cf_have_incdir=no
5699                 if test -n "$CFLAGS$CPPFLAGS" ; then
5700                   # a loop is needed to ensure we can add subdirs of existing dirs
5701                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5702                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5703                           cf_have_incdir=yes; break
5704                         fi
5705                   done
5706                 fi
5707
5708                 if test "$cf_have_incdir" = no ; then
5709                   if test "$cf_add_incdir" = /usr/local/include ; then
5710                         if test "$GCC" = yes
5711                         then
5712                           cf_save_CPPFLAGS=$CPPFLAGS
5713
5714         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5715         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5716
5717                           cat >"conftest.$ac_ext" <<_ACEOF
5718 #line 5718 "configure"
5719 #include "confdefs.h"
5720 #include <stdio.h>
5721 int
5722 main (void)
5723 {
5724 printf("Hello")
5725   ;
5726   return 0;
5727 }
5728 _ACEOF
5729 rm -f "conftest.$ac_objext"
5730 if { (eval echo "$as_me:5730: \"$ac_compile\"") >&5
5731   (eval $ac_compile) 2>&5
5732   ac_status=$?
5733   echo "$as_me:5733: \$? = $ac_status" >&5
5734   (exit "$ac_status"); } &&
5735          { ac_try='test -s "conftest.$ac_objext"'
5736   { (eval echo "$as_me:5736: \"$ac_try\"") >&5
5737   (eval $ac_try) 2>&5
5738   ac_status=$?
5739   echo "$as_me:5739: \$? = $ac_status" >&5
5740   (exit "$ac_status"); }; }; then
5741   :
5742 else
5743   echo "$as_me: failed program was:" >&5
5744 cat "conftest.$ac_ext" >&5
5745 cf_have_incdir=yes
5746 fi
5747 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5748                           CPPFLAGS=$cf_save_CPPFLAGS
5749                         fi
5750                   fi
5751                 fi
5752
5753                 if test "$cf_have_incdir" = no ; then
5754                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5755
5756 echo "${as_me:-configure}:5756: testing adding $cf_add_incdir to include-path ..." 1>&5
5757
5758                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5759
5760                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5761                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5762                   cf_add_incdir="$cf_top_incdir"
5763                 else
5764                   break
5765                 fi
5766           else
5767                 break
5768           fi
5769         done
5770   done
5771 fi
5772
5773                 for cf_header in \
5774                         ncurses.h \
5775                         curses.h
5776                 do
5777
5778         cat >"conftest.$ac_ext" <<_ACEOF
5779 #line 5779 "configure"
5780 #include "confdefs.h"
5781
5782 #include <$cf_header>
5783 int
5784 main (void)
5785 {
5786
5787 #ifdef NCURSES_VERSION
5788
5789 printf("%s\\n", NCURSES_VERSION);
5790 #else
5791 #ifdef __NCURSES_H
5792 printf("old\\n");
5793 #else
5794         make an error
5795 #endif
5796 #endif
5797
5798   ;
5799   return 0;
5800 }
5801 _ACEOF
5802 rm -f "conftest.$ac_objext"
5803 if { (eval echo "$as_me:5803: \"$ac_compile\"") >&5
5804   (eval $ac_compile) 2>&5
5805   ac_status=$?
5806   echo "$as_me:5806: \$? = $ac_status" >&5
5807   (exit "$ac_status"); } &&
5808          { ac_try='test -s "conftest.$ac_objext"'
5809   { (eval echo "$as_me:5809: \"$ac_try\"") >&5
5810   (eval $ac_try) 2>&5
5811   ac_status=$?
5812   echo "$as_me:5812: \$? = $ac_status" >&5
5813   (exit "$ac_status"); }; }; then
5814   cf_cv_ncurses_h2=$cf_header
5815
5816 else
5817   echo "$as_me: failed program was:" >&5
5818 cat "conftest.$ac_ext" >&5
5819 cf_cv_ncurses_h2=no
5820 fi
5821 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5822
5823                         if test "$cf_cv_ncurses_h2" != no ; then
5824                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5825                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5826                                 break
5827                         fi
5828                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5829                 done
5830                 CPPFLAGS="$cf_save2_CPPFLAGS"
5831                 test "$cf_cv_ncurses_h2" != no && break
5832         done
5833         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5833: error: not found" >&5
5834 echo "$as_me: error: not found" >&2;}
5835    { (exit 1); exit 1; }; }
5836
5837 fi
5838 echo "$as_me:5838: result: $cf_cv_ncurses_h2" >&5
5839 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5840
5841         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5842         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5843         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5844                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5845         fi
5846
5847 if test -n "$cf_1st_incdir" ; then
5848   for cf_add_incdir in $cf_1st_incdir
5849   do
5850         while test "$cf_add_incdir" != /usr/include
5851         do
5852           if test -d "$cf_add_incdir"
5853           then
5854                 cf_have_incdir=no
5855                 if test -n "$CFLAGS$CPPFLAGS" ; then
5856                   # a loop is needed to ensure we can add subdirs of existing dirs
5857                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5858                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5859                           cf_have_incdir=yes; break
5860                         fi
5861                   done
5862                 fi
5863
5864                 if test "$cf_have_incdir" = no ; then
5865                   if test "$cf_add_incdir" = /usr/local/include ; then
5866                         if test "$GCC" = yes
5867                         then
5868                           cf_save_CPPFLAGS=$CPPFLAGS
5869
5870         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5871         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5872
5873                           cat >"conftest.$ac_ext" <<_ACEOF
5874 #line 5874 "configure"
5875 #include "confdefs.h"
5876 #include <stdio.h>
5877 int
5878 main (void)
5879 {
5880 printf("Hello")
5881   ;
5882   return 0;
5883 }
5884 _ACEOF
5885 rm -f "conftest.$ac_objext"
5886 if { (eval echo "$as_me:5886: \"$ac_compile\"") >&5
5887   (eval $ac_compile) 2>&5
5888   ac_status=$?
5889   echo "$as_me:5889: \$? = $ac_status" >&5
5890   (exit "$ac_status"); } &&
5891          { ac_try='test -s "conftest.$ac_objext"'
5892   { (eval echo "$as_me:5892: \"$ac_try\"") >&5
5893   (eval $ac_try) 2>&5
5894   ac_status=$?
5895   echo "$as_me:5895: \$? = $ac_status" >&5
5896   (exit "$ac_status"); }; }; then
5897   :
5898 else
5899   echo "$as_me: failed program was:" >&5
5900 cat "conftest.$ac_ext" >&5
5901 cf_have_incdir=yes
5902 fi
5903 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5904                           CPPFLAGS=$cf_save_CPPFLAGS
5905                         fi
5906                   fi
5907                 fi
5908
5909                 if test "$cf_have_incdir" = no ; then
5910                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5911
5912 echo "${as_me:-configure}:5912: testing adding $cf_add_incdir to include-path ..." 1>&5
5913
5914                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5915
5916                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5917                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5918                   cf_add_incdir="$cf_top_incdir"
5919                 else
5920                   break
5921                 fi
5922           else
5923                 break
5924           fi
5925         done
5926   done
5927 fi
5928
5929 fi
5930
5931 # Set definitions to allow ifdef'ing for ncurses.h
5932
5933 case "$cf_cv_ncurses_header" in
5934 (*ncurses.h)
5935
5936 cat >>confdefs.h <<\EOF
5937 #define HAVE_NCURSES_H 1
5938 EOF
5939
5940         ;;
5941 esac
5942
5943 case "$cf_cv_ncurses_header" in
5944 (ncurses/curses.h|ncurses/ncurses.h)
5945
5946 cat >>confdefs.h <<\EOF
5947 #define HAVE_NCURSES_NCURSES_H 1
5948 EOF
5949
5950         ;;
5951 (ncursesw/curses.h|ncursesw/ncurses.h)
5952
5953 cat >>confdefs.h <<\EOF
5954 #define HAVE_NCURSESW_NCURSES_H 1
5955 EOF
5956
5957         ;;
5958 esac
5959
5960 echo "$as_me:5960: checking for terminfo header" >&5
5961 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5962 if test "${cf_cv_term_header+set}" = set; then
5963   echo $ECHO_N "(cached) $ECHO_C" >&6
5964 else
5965
5966 case "${cf_cv_ncurses_header}" in
5967 (*/ncurses.h|*/ncursesw.h)
5968         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5969         ;;
5970 (*)
5971         cf_term_header=term.h
5972         ;;
5973 esac
5974
5975 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5976 do
5977 cat >"conftest.$ac_ext" <<_ACEOF
5978 #line 5978 "configure"
5979 #include "confdefs.h"
5980 #include <stdio.h>
5981 #include <${cf_cv_ncurses_header:-curses.h}>
5982 #include <$cf_test>
5983
5984 int
5985 main (void)
5986 {
5987 int x = auto_left_margin; (void)x
5988   ;
5989   return 0;
5990 }
5991 _ACEOF
5992 rm -f "conftest.$ac_objext"
5993 if { (eval echo "$as_me:5993: \"$ac_compile\"") >&5
5994   (eval $ac_compile) 2>&5
5995   ac_status=$?
5996   echo "$as_me:5996: \$? = $ac_status" >&5
5997   (exit "$ac_status"); } &&
5998          { ac_try='test -s "conftest.$ac_objext"'
5999   { (eval echo "$as_me:5999: \"$ac_try\"") >&5
6000   (eval $ac_try) 2>&5
6001   ac_status=$?
6002   echo "$as_me:6002: \$? = $ac_status" >&5
6003   (exit "$ac_status"); }; }; then
6004
6005         cf_cv_term_header="$cf_test"
6006 else
6007   echo "$as_me: failed program was:" >&5
6008 cat "conftest.$ac_ext" >&5
6009
6010         cf_cv_term_header=unknown
6011
6012 fi
6013 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6014         test "$cf_cv_term_header" != unknown && break
6015 done
6016
6017 fi
6018 echo "$as_me:6018: result: $cf_cv_term_header" >&5
6019 echo "${ECHO_T}$cf_cv_term_header" >&6
6020
6021 # Set definitions to allow ifdef'ing to accommodate subdirectories
6022
6023 case "$cf_cv_term_header" in
6024 (*term.h)
6025
6026 cat >>confdefs.h <<\EOF
6027 #define HAVE_TERM_H 1
6028 EOF
6029
6030         ;;
6031 esac
6032
6033 case "$cf_cv_term_header" in
6034 (ncurses/term.h)
6035
6036 cat >>confdefs.h <<\EOF
6037 #define HAVE_NCURSES_TERM_H 1
6038 EOF
6039
6040         ;;
6041 (ncursesw/term.h)
6042
6043 cat >>confdefs.h <<\EOF
6044 #define HAVE_NCURSESW_TERM_H 1
6045 EOF
6046
6047         ;;
6048 esac
6049
6050 # some applications need this, but should check for NCURSES_VERSION
6051
6052 cat >>confdefs.h <<\EOF
6053 #define NCURSES 1
6054 EOF
6055
6056 echo "$as_me:6056: checking for ncurses version" >&5
6057 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6058 if test "${cf_cv_ncurses_version+set}" = set; then
6059   echo $ECHO_N "(cached) $ECHO_C" >&6
6060 else
6061
6062         cf_cv_ncurses_version=no
6063         cf_tempfile=out$$
6064         rm -f "$cf_tempfile"
6065         if test "$cross_compiling" = yes; then
6066
6067         # This will not work if the preprocessor splits the line after the
6068         # Autoconf token.  The 'unproto' program does that.
6069         cat > "conftest.$ac_ext" <<EOF
6070 #include <${cf_cv_ncurses_header:-curses.h}>
6071 #undef Autoconf
6072 #ifdef NCURSES_VERSION
6073 Autoconf NCURSES_VERSION
6074 #else
6075 #ifdef __NCURSES_H
6076 Autoconf "old"
6077 #endif
6078 ;
6079 #endif
6080 EOF
6081         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6082         { (eval echo "$as_me:6082: \"$cf_try\"") >&5
6083   (eval $cf_try) 2>&5
6084   ac_status=$?
6085   echo "$as_me:6085: \$? = $ac_status" >&5
6086   (exit "$ac_status"); }
6087         if test -f conftest.out ; then
6088                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6089                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6090                 rm -f conftest.out
6091         fi
6092
6093 else
6094   cat >"conftest.$ac_ext" <<_ACEOF
6095 #line 6095 "configure"
6096 #include "confdefs.h"
6097
6098 #include <${cf_cv_ncurses_header:-curses.h}>
6099 #include <stdio.h>
6100 int main(void)
6101 {
6102         FILE *fp = fopen("$cf_tempfile", "w");
6103 #ifdef NCURSES_VERSION
6104 # ifdef NCURSES_VERSION_PATCH
6105         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6106 # else
6107         fprintf(fp, "%s\\n", NCURSES_VERSION);
6108 # endif
6109 #else
6110 # ifdef __NCURSES_H
6111         fprintf(fp, "old\\n");
6112 # else
6113         make an error
6114 # endif
6115 #endif
6116         ${cf_cv_main_return:-return}(0);
6117 }
6118 _ACEOF
6119 rm -f "conftest$ac_exeext"
6120 if { (eval echo "$as_me:6120: \"$ac_link\"") >&5
6121   (eval $ac_link) 2>&5
6122   ac_status=$?
6123   echo "$as_me:6123: \$? = $ac_status" >&5
6124   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6125   { (eval echo "$as_me:6125: \"$ac_try\"") >&5
6126   (eval $ac_try) 2>&5
6127   ac_status=$?
6128   echo "$as_me:6128: \$? = $ac_status" >&5
6129   (exit "$ac_status"); }; }; then
6130
6131         cf_cv_ncurses_version=`cat $cf_tempfile`
6132 else
6133   echo "$as_me: program exited with status $ac_status" >&5
6134 echo "$as_me: failed program was:" >&5
6135 cat "conftest.$ac_ext" >&5
6136 fi
6137 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6138 fi
6139         rm -f "$cf_tempfile"
6140
6141 fi
6142 echo "$as_me:6142: result: $cf_cv_ncurses_version" >&5
6143 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6144 test "$cf_cv_ncurses_version" = no ||
6145 cat >>confdefs.h <<\EOF
6146 #define NCURSES 1
6147 EOF
6148
6149 cf_nculib_root=ncurses
6150         # This works, except for the special case where we find gpm, but
6151         # ncurses is in a nonstandard location via $LIBS, and we really want
6152         # to link gpm.
6153 cf_ncurses_LIBS=""
6154 cf_ncurses_SAVE="$LIBS"
6155 echo "$as_me:6155: checking for Gpm_Open in -lgpm" >&5
6156 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6157 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6158   echo $ECHO_N "(cached) $ECHO_C" >&6
6159 else
6160   ac_check_lib_save_LIBS=$LIBS
6161 LIBS="-lgpm  $LIBS"
6162 cat >"conftest.$ac_ext" <<_ACEOF
6163 #line 6163 "configure"
6164 #include "confdefs.h"
6165
6166 /* Override any gcc2 internal prototype to avoid an error.  */
6167 #ifdef __cplusplus
6168 extern "C"
6169 #endif
6170 /* We use char because int might match the return type of a gcc2
6171    builtin and then its argument prototype would still apply.  */
6172 char Gpm_Open ();
6173 int
6174 main (void)
6175 {
6176 Gpm_Open ();
6177   ;
6178   return 0;
6179 }
6180 _ACEOF
6181 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6182 if { (eval echo "$as_me:6182: \"$ac_link\"") >&5
6183   (eval $ac_link) 2>&5
6184   ac_status=$?
6185   echo "$as_me:6185: \$? = $ac_status" >&5
6186   (exit "$ac_status"); } &&
6187          { ac_try='test -s "conftest$ac_exeext"'
6188   { (eval echo "$as_me:6188: \"$ac_try\"") >&5
6189   (eval $ac_try) 2>&5
6190   ac_status=$?
6191   echo "$as_me:6191: \$? = $ac_status" >&5
6192   (exit "$ac_status"); }; }; then
6193   ac_cv_lib_gpm_Gpm_Open=yes
6194 else
6195   echo "$as_me: failed program was:" >&5
6196 cat "conftest.$ac_ext" >&5
6197 ac_cv_lib_gpm_Gpm_Open=no
6198 fi
6199 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6200 LIBS=$ac_check_lib_save_LIBS
6201 fi
6202 echo "$as_me:6202: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6203 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6204 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6205   echo "$as_me:6205: checking for initscr in -lgpm" >&5
6206 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6207 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6208   echo $ECHO_N "(cached) $ECHO_C" >&6
6209 else
6210   ac_check_lib_save_LIBS=$LIBS
6211 LIBS="-lgpm  $LIBS"
6212 cat >"conftest.$ac_ext" <<_ACEOF
6213 #line 6213 "configure"
6214 #include "confdefs.h"
6215
6216 /* Override any gcc2 internal prototype to avoid an error.  */
6217 #ifdef __cplusplus
6218 extern "C"
6219 #endif
6220 /* We use char because int might match the return type of a gcc2
6221    builtin and then its argument prototype would still apply.  */
6222 char initscr ();
6223 int
6224 main (void)
6225 {
6226 initscr ();
6227   ;
6228   return 0;
6229 }
6230 _ACEOF
6231 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6232 if { (eval echo "$as_me:6232: \"$ac_link\"") >&5
6233   (eval $ac_link) 2>&5
6234   ac_status=$?
6235   echo "$as_me:6235: \$? = $ac_status" >&5
6236   (exit "$ac_status"); } &&
6237          { ac_try='test -s "conftest$ac_exeext"'
6238   { (eval echo "$as_me:6238: \"$ac_try\"") >&5
6239   (eval $ac_try) 2>&5
6240   ac_status=$?
6241   echo "$as_me:6241: \$? = $ac_status" >&5
6242   (exit "$ac_status"); }; }; then
6243   ac_cv_lib_gpm_initscr=yes
6244 else
6245   echo "$as_me: failed program was:" >&5
6246 cat "conftest.$ac_ext" >&5
6247 ac_cv_lib_gpm_initscr=no
6248 fi
6249 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6250 LIBS=$ac_check_lib_save_LIBS
6251 fi
6252 echo "$as_me:6252: result: $ac_cv_lib_gpm_initscr" >&5
6253 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6254 if test "$ac_cv_lib_gpm_initscr" = yes; then
6255   LIBS="$cf_ncurses_SAVE"
6256 else
6257   cf_ncurses_LIBS="-lgpm"
6258 fi
6259
6260 fi
6261
6262 case "$host_os" in
6263 (freebsd*)
6264         # This is only necessary if you are linking against an obsolete
6265         # version of ncurses (but it should do no harm, since it is static).
6266         if test "$cf_nculib_root" = ncurses ; then
6267                 echo "$as_me:6267: checking for tgoto in -lmytinfo" >&5
6268 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6269 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6270   echo $ECHO_N "(cached) $ECHO_C" >&6
6271 else
6272   ac_check_lib_save_LIBS=$LIBS
6273 LIBS="-lmytinfo  $LIBS"
6274 cat >"conftest.$ac_ext" <<_ACEOF
6275 #line 6275 "configure"
6276 #include "confdefs.h"
6277
6278 /* Override any gcc2 internal prototype to avoid an error.  */
6279 #ifdef __cplusplus
6280 extern "C"
6281 #endif
6282 /* We use char because int might match the return type of a gcc2
6283    builtin and then its argument prototype would still apply.  */
6284 char tgoto ();
6285 int
6286 main (void)
6287 {
6288 tgoto ();
6289   ;
6290   return 0;
6291 }
6292 _ACEOF
6293 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6294 if { (eval echo "$as_me:6294: \"$ac_link\"") >&5
6295   (eval $ac_link) 2>&5
6296   ac_status=$?
6297   echo "$as_me:6297: \$? = $ac_status" >&5
6298   (exit "$ac_status"); } &&
6299          { ac_try='test -s "conftest$ac_exeext"'
6300   { (eval echo "$as_me:6300: \"$ac_try\"") >&5
6301   (eval $ac_try) 2>&5
6302   ac_status=$?
6303   echo "$as_me:6303: \$? = $ac_status" >&5
6304   (exit "$ac_status"); }; }; then
6305   ac_cv_lib_mytinfo_tgoto=yes
6306 else
6307   echo "$as_me: failed program was:" >&5
6308 cat "conftest.$ac_ext" >&5
6309 ac_cv_lib_mytinfo_tgoto=no
6310 fi
6311 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6312 LIBS=$ac_check_lib_save_LIBS
6313 fi
6314 echo "$as_me:6314: result: $ac_cv_lib_mytinfo_tgoto" >&5
6315 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6316 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6317   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6318 fi
6319
6320         fi
6321         ;;
6322 esac
6323
6324 cf_add_libs="$LIBS"
6325 # reverse order
6326 cf_add_0lib=
6327 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6328 # filter duplicates
6329 for cf_add_1lib in $cf_add_0lib; do
6330         for cf_add_2lib in $cf_add_libs; do
6331                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6332                         cf_add_1lib=
6333                         break
6334                 fi
6335         done
6336         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6337 done
6338 LIBS="$cf_add_libs"
6339
6340 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6341 then
6342
6343 cf_add_libs="$LIBS"
6344 # reverse order
6345 cf_add_0lib=
6346 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6347 # filter duplicates
6348 for cf_add_1lib in $cf_add_0lib; do
6349         for cf_add_2lib in $cf_add_libs; do
6350                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6351                         cf_add_1lib=
6352                         break
6353                 fi
6354         done
6355         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6356 done
6357 LIBS="$cf_add_libs"
6358
6359 else
6360
6361         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6362         cf_libdir=""
6363         echo "$as_me:6363: checking for initscr" >&5
6364 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6365 if test "${ac_cv_func_initscr+set}" = set; then
6366   echo $ECHO_N "(cached) $ECHO_C" >&6
6367 else
6368   cat >"conftest.$ac_ext" <<_ACEOF
6369 #line 6369 "configure"
6370 #include "confdefs.h"
6371 #define initscr autoconf_temporary
6372 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6373 #undef initscr
6374
6375 #ifdef __cplusplus
6376 extern "C"
6377 #endif
6378
6379 /* We use char because int might match the return type of a gcc2
6380    builtin and then its argument prototype would still apply.  */
6381 char initscr (void);
6382
6383 int
6384 main (void)
6385 {
6386
6387 /* The GNU C library defines stubs for functions which it implements
6388     to always fail with ENOSYS.  Some functions are actually named
6389     something starting with __ and the normal name is an alias.  */
6390 #if defined (__stub_initscr) || defined (__stub___initscr)
6391 #error found stub for initscr
6392 #endif
6393
6394         return initscr ();
6395   ;
6396   return 0;
6397 }
6398 _ACEOF
6399 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6400 if { (eval echo "$as_me:6400: \"$ac_link\"") >&5
6401   (eval $ac_link) 2>&5
6402   ac_status=$?
6403   echo "$as_me:6403: \$? = $ac_status" >&5
6404   (exit "$ac_status"); } &&
6405          { ac_try='test -s "conftest$ac_exeext"'
6406   { (eval echo "$as_me:6406: \"$ac_try\"") >&5
6407   (eval $ac_try) 2>&5
6408   ac_status=$?
6409   echo "$as_me:6409: \$? = $ac_status" >&5
6410   (exit "$ac_status"); }; }; then
6411   ac_cv_func_initscr=yes
6412 else
6413   echo "$as_me: failed program was:" >&5
6414 cat "conftest.$ac_ext" >&5
6415 ac_cv_func_initscr=no
6416 fi
6417 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6418 fi
6419 echo "$as_me:6419: result: $ac_cv_func_initscr" >&5
6420 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6421 if test "$ac_cv_func_initscr" = yes; then
6422   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6423 else
6424
6425                 cf_save_LIBS="$LIBS"
6426                 echo "$as_me:6426: checking for initscr in -l$cf_nculib_root" >&5
6427 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6428                 LIBS="-l$cf_nculib_root $LIBS"
6429                 cat >"conftest.$ac_ext" <<_ACEOF
6430 #line 6430 "configure"
6431 #include "confdefs.h"
6432 #include <${cf_cv_ncurses_header:-curses.h}>
6433 int
6434 main (void)
6435 {
6436 initscr()
6437   ;
6438   return 0;
6439 }
6440 _ACEOF
6441 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6442 if { (eval echo "$as_me:6442: \"$ac_link\"") >&5
6443   (eval $ac_link) 2>&5
6444   ac_status=$?
6445   echo "$as_me:6445: \$? = $ac_status" >&5
6446   (exit "$ac_status"); } &&
6447          { ac_try='test -s "conftest$ac_exeext"'
6448   { (eval echo "$as_me:6448: \"$ac_try\"") >&5
6449   (eval $ac_try) 2>&5
6450   ac_status=$?
6451   echo "$as_me:6451: \$? = $ac_status" >&5
6452   (exit "$ac_status"); }; }; then
6453   echo "$as_me:6453: result: yes" >&5
6454 echo "${ECHO_T}yes" >&6
6455                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6456
6457 else
6458   echo "$as_me: failed program was:" >&5
6459 cat "conftest.$ac_ext" >&5
6460 echo "$as_me:6460: result: no" >&5
6461 echo "${ECHO_T}no" >&6
6462
6463 cf_search=
6464 cf_library_path_list=""
6465 if test -n "${LDFLAGS}${LIBS}" ; then
6466         for cf_library_path in $LDFLAGS $LIBS
6467         do
6468                 case "$cf_library_path" in
6469                 (-L*)
6470                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6471
6472 test "x$cf_library_path" != "xNONE" && \
6473 test -d "$cf_library_path" && \
6474  {
6475         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6476         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6477         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6478         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6479         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6480         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"
6481 }
6482
6483                         cf_library_path_list="$cf_library_path_list $cf_search"
6484                         ;;
6485                 esac
6486         done
6487 fi
6488
6489 cf_search=
6490
6491 test "x$prefix" != "xNONE" && \
6492 test -d "$prefix" && \
6493  {
6494         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6495         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6496         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6497         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6498         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6499         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6500 }
6501
6502 for cf_subdir_prefix in \
6503         /usr \
6504         /usr/local \
6505         /usr/pkg \
6506         /opt \
6507         /opt/local \
6508         $HOME
6509 do
6510
6511 test "x$cf_subdir_prefix" != "x$prefix" && \
6512 test -d "$cf_subdir_prefix" && \
6513 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6514         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6515         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6516         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6517         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6518         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6519         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"
6520 }
6521
6522 done
6523
6524 cf_search="$cf_library_path_list $cf_search"
6525
6526                         for cf_libdir in $cf_search
6527                         do
6528                                 echo "$as_me:6528: checking for -l$cf_nculib_root in $cf_libdir" >&5
6529 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6530                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6531                                 cat >"conftest.$ac_ext" <<_ACEOF
6532 #line 6532 "configure"
6533 #include "confdefs.h"
6534 #include <${cf_cv_ncurses_header:-curses.h}>
6535 int
6536 main (void)
6537 {
6538 initscr()
6539   ;
6540   return 0;
6541 }
6542 _ACEOF
6543 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6544 if { (eval echo "$as_me:6544: \"$ac_link\"") >&5
6545   (eval $ac_link) 2>&5
6546   ac_status=$?
6547   echo "$as_me:6547: \$? = $ac_status" >&5
6548   (exit "$ac_status"); } &&
6549          { ac_try='test -s "conftest$ac_exeext"'
6550   { (eval echo "$as_me:6550: \"$ac_try\"") >&5
6551   (eval $ac_try) 2>&5
6552   ac_status=$?
6553   echo "$as_me:6553: \$? = $ac_status" >&5
6554   (exit "$ac_status"); }; }; then
6555   echo "$as_me:6555: result: yes" >&5
6556 echo "${ECHO_T}yes" >&6
6557                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6558                                          break
6559 else
6560   echo "$as_me: failed program was:" >&5
6561 cat "conftest.$ac_ext" >&5
6562 echo "$as_me:6562: result: no" >&5
6563 echo "${ECHO_T}no" >&6
6564                                          LIBS="$cf_save_LIBS"
6565 fi
6566 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6567                         done
6568
6569 fi
6570 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6571
6572 fi
6573
6574 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6575
6576 if test "$cf_found_library" = no ; then
6577         { { echo "$as_me:6577: error: Cannot link $cf_nculib_root library" >&5
6578 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6579    { (exit 1); exit 1; }; }
6580 fi
6581
6582 fi
6583
6584 if test -n "$cf_ncurses_LIBS" ; then
6585         echo "$as_me:6585: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6586 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6587         cf_ncurses_SAVE="$LIBS"
6588         for p in $cf_ncurses_LIBS ; do
6589                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6590                 if test "$q" != "$LIBS" ; then
6591                         LIBS="$q"
6592                 fi
6593         done
6594         cat >"conftest.$ac_ext" <<_ACEOF
6595 #line 6595 "configure"
6596 #include "confdefs.h"
6597 #include <${cf_cv_ncurses_header:-curses.h}>
6598 int
6599 main (void)
6600 {
6601 initscr(); mousemask(0,0); tigetstr((char *)0);
6602   ;
6603   return 0;
6604 }
6605 _ACEOF
6606 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6607 if { (eval echo "$as_me:6607: \"$ac_link\"") >&5
6608   (eval $ac_link) 2>&5
6609   ac_status=$?
6610   echo "$as_me:6610: \$? = $ac_status" >&5
6611   (exit "$ac_status"); } &&
6612          { ac_try='test -s "conftest$ac_exeext"'
6613   { (eval echo "$as_me:6613: \"$ac_try\"") >&5
6614   (eval $ac_try) 2>&5
6615   ac_status=$?
6616   echo "$as_me:6616: \$? = $ac_status" >&5
6617   (exit "$ac_status"); }; }; then
6618   echo "$as_me:6618: result: yes" >&5
6619 echo "${ECHO_T}yes" >&6
6620 else
6621   echo "$as_me: failed program was:" >&5
6622 cat "conftest.$ac_ext" >&5
6623 echo "$as_me:6623: result: no" >&5
6624 echo "${ECHO_T}no" >&6
6625                  LIBS="$cf_ncurses_SAVE"
6626 fi
6627 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6628 fi
6629
6630 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6631
6632 cat >>confdefs.h <<EOF
6633 #define $cf_nculib_ROOT 1
6634 EOF
6635
6636         fi
6637 else
6638         NCURSES_CONFIG=none
6639 fi
6640
6641 echo "$as_me:6641: checking if you want wide-character code" >&5
6642 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6643
6644 # Check whether --enable-widec or --disable-widec was given.
6645 if test "${enable_widec+set}" = set; then
6646   enableval="$enable_widec"
6647   with_widec=$enableval
6648 else
6649   with_widec=no
6650 fi;
6651 echo "$as_me:6651: result: $with_widec" >&5
6652 echo "${ECHO_T}$with_widec" >&6
6653 if test "$with_widec" = yes ; then
6654
6655 for ac_header in wchar.h
6656 do
6657 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6658 echo "$as_me:6658: checking for $ac_header" >&5
6659 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6660 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6661   echo $ECHO_N "(cached) $ECHO_C" >&6
6662 else
6663   cat >"conftest.$ac_ext" <<_ACEOF
6664 #line 6664 "configure"
6665 #include "confdefs.h"
6666 #include <$ac_header>
6667 _ACEOF
6668 if { (eval echo "$as_me:6668: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6669   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6670   ac_status=$?
6671   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6672   rm -f conftest.er1
6673   cat conftest.err >&5
6674   echo "$as_me:6674: \$? = $ac_status" >&5
6675   (exit "$ac_status"); } >/dev/null; then
6676   if test -s conftest.err; then
6677     ac_cpp_err=$ac_c_preproc_warn_flag
6678   else
6679     ac_cpp_err=
6680   fi
6681 else
6682   ac_cpp_err=yes
6683 fi
6684 if test -z "$ac_cpp_err"; then
6685   eval "$as_ac_Header=yes"
6686 else
6687   echo "$as_me: failed program was:" >&5
6688   cat "conftest.$ac_ext" >&5
6689   eval "$as_ac_Header=no"
6690 fi
6691 rm -f conftest.err "conftest.$ac_ext"
6692 fi
6693 echo "$as_me:6693: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6694 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6695 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6696   cat >>confdefs.h <<EOF
6697 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6698 EOF
6699
6700 fi
6701 done
6702
6703 echo "$as_me:6703: checking for multibyte character support" >&5
6704 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6705 if test "${cf_cv_utf8_lib+set}" = set; then
6706   echo $ECHO_N "(cached) $ECHO_C" >&6
6707 else
6708
6709         cf_save_LIBS="$LIBS"
6710         cat >"conftest.$ac_ext" <<_ACEOF
6711 #line 6711 "configure"
6712 #include "confdefs.h"
6713
6714 #include <stdlib.h>
6715 #include <stdio.h>
6716 #ifdef HAVE_WCHAR_H
6717 #include <wchar.h>
6718 #endif
6719
6720 int
6721 main (void)
6722 {
6723 putwc(0,0);
6724   ;
6725   return 0;
6726 }
6727 _ACEOF
6728 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6729 if { (eval echo "$as_me:6729: \"$ac_link\"") >&5
6730   (eval $ac_link) 2>&5
6731   ac_status=$?
6732   echo "$as_me:6732: \$? = $ac_status" >&5
6733   (exit "$ac_status"); } &&
6734          { ac_try='test -s "conftest$ac_exeext"'
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   cf_cv_utf8_lib=yes
6741 else
6742   echo "$as_me: failed program was:" >&5
6743 cat "conftest.$ac_ext" >&5
6744
6745 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6746 # will be set on completion of the AC_TRY_LINK below.
6747 cf_cv_header_path_utf8=
6748 cf_cv_library_path_utf8=
6749
6750 echo "${as_me:-configure}:6750: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6751
6752 cf_save_LIBS="$LIBS"
6753
6754 cat >"conftest.$ac_ext" <<_ACEOF
6755 #line 6755 "configure"
6756 #include "confdefs.h"
6757
6758 #include <libutf8.h>
6759 int
6760 main (void)
6761 {
6762 putwc(0,0);
6763   ;
6764   return 0;
6765 }
6766 _ACEOF
6767 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6768 if { (eval echo "$as_me:6768: \"$ac_link\"") >&5
6769   (eval $ac_link) 2>&5
6770   ac_status=$?
6771   echo "$as_me:6771: \$? = $ac_status" >&5
6772   (exit "$ac_status"); } &&
6773          { ac_try='test -s "conftest$ac_exeext"'
6774   { (eval echo "$as_me:6774: \"$ac_try\"") >&5
6775   (eval $ac_try) 2>&5
6776   ac_status=$?
6777   echo "$as_me:6777: \$? = $ac_status" >&5
6778   (exit "$ac_status"); }; }; then
6779
6780         cf_cv_find_linkage_utf8=yes
6781         cf_cv_header_path_utf8=/usr/include
6782         cf_cv_library_path_utf8=/usr/lib
6783
6784 else
6785   echo "$as_me: failed program was:" >&5
6786 cat "conftest.$ac_ext" >&5
6787
6788 LIBS="-lutf8  $cf_save_LIBS"
6789
6790 cat >"conftest.$ac_ext" <<_ACEOF
6791 #line 6791 "configure"
6792 #include "confdefs.h"
6793
6794 #include <libutf8.h>
6795 int
6796 main (void)
6797 {
6798 putwc(0,0);
6799   ;
6800   return 0;
6801 }
6802 _ACEOF
6803 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6804 if { (eval echo "$as_me:6804: \"$ac_link\"") >&5
6805   (eval $ac_link) 2>&5
6806   ac_status=$?
6807   echo "$as_me:6807: \$? = $ac_status" >&5
6808   (exit "$ac_status"); } &&
6809          { ac_try='test -s "conftest$ac_exeext"'
6810   { (eval echo "$as_me:6810: \"$ac_try\"") >&5
6811   (eval $ac_try) 2>&5
6812   ac_status=$?
6813   echo "$as_me:6813: \$? = $ac_status" >&5
6814   (exit "$ac_status"); }; }; then
6815
6816         cf_cv_find_linkage_utf8=yes
6817         cf_cv_header_path_utf8=/usr/include
6818         cf_cv_library_path_utf8=/usr/lib
6819         cf_cv_library_file_utf8="-lutf8"
6820
6821 else
6822   echo "$as_me: failed program was:" >&5
6823 cat "conftest.$ac_ext" >&5
6824
6825         cf_cv_find_linkage_utf8=no
6826         LIBS="$cf_save_LIBS"
6827
6828         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6829
6830 echo "${as_me:-configure}:6830: testing find linkage for utf8 library ..." 1>&5
6831
6832 echo "${as_me:-configure}:6832: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6833
6834         cf_save_CPPFLAGS="$CPPFLAGS"
6835         cf_test_CPPFLAGS="$CPPFLAGS"
6836
6837 cf_search=
6838
6839 # collect the current set of include-directories from compiler flags
6840 cf_header_path_list=""
6841 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6842         for cf_header_path in $CPPFLAGS $CFLAGS
6843         do
6844                 case "$cf_header_path" in
6845                 (-I*)
6846                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6847
6848 test "x$cf_header_path" != "xNONE" && \
6849 test -d "$cf_header_path" && \
6850  {
6851         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6852         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6853         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6854         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6855         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6856         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6857 }
6858
6859                         cf_header_path_list="$cf_header_path_list $cf_search"
6860                         ;;
6861                 esac
6862         done
6863 fi
6864
6865 # add the variations for the package we are looking for
6866
6867 cf_search=
6868
6869 test "x$prefix" != "xNONE" && \
6870 test -d "$prefix" && \
6871  {
6872         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6873         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6874         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6875         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6876         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6877         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6878 }
6879
6880 for cf_subdir_prefix in \
6881         /usr \
6882         /usr/local \
6883         /usr/pkg \
6884         /opt \
6885         /opt/local \
6886         $HOME
6887 do
6888
6889 test "x$cf_subdir_prefix" != "x$prefix" && \
6890 test -d "$cf_subdir_prefix" && \
6891 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6892         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6893         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6894         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6895         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6896         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6897         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6898 }
6899
6900 done
6901
6902 test "$includedir" != NONE && \
6903 test "$includedir" != "/usr/include" && \
6904 test -d "$includedir" && {
6905         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6906         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6907 }
6908
6909 test "$oldincludedir" != NONE && \
6910 test "$oldincludedir" != "/usr/include" && \
6911 test -d "$oldincludedir" && {
6912         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6913         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6914 }
6915
6916 cf_search="$cf_search $cf_header_path_list"
6917
6918         for cf_cv_header_path_utf8 in $cf_search
6919         do
6920                 if test -d "$cf_cv_header_path_utf8" ; then
6921                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6922
6923 echo "${as_me:-configure}:6923: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6924
6925                         CPPFLAGS="$cf_save_CPPFLAGS"
6926
6927         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6928         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6929
6930                         cat >"conftest.$ac_ext" <<_ACEOF
6931 #line 6931 "configure"
6932 #include "confdefs.h"
6933
6934 #include <libutf8.h>
6935 int
6936 main (void)
6937 {
6938 putwc(0,0);
6939   ;
6940   return 0;
6941 }
6942 _ACEOF
6943 rm -f "conftest.$ac_objext"
6944 if { (eval echo "$as_me:6944: \"$ac_compile\"") >&5
6945   (eval $ac_compile) 2>&5
6946   ac_status=$?
6947   echo "$as_me:6947: \$? = $ac_status" >&5
6948   (exit "$ac_status"); } &&
6949          { ac_try='test -s "conftest.$ac_objext"'
6950   { (eval echo "$as_me:6950: \"$ac_try\"") >&5
6951   (eval $ac_try) 2>&5
6952   ac_status=$?
6953   echo "$as_me:6953: \$? = $ac_status" >&5
6954   (exit "$ac_status"); }; }; then
6955
6956                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6957
6958 echo "${as_me:-configure}:6958: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6959
6960                                 cf_cv_find_linkage_utf8=maybe
6961                                 cf_test_CPPFLAGS="$CPPFLAGS"
6962                                 break
6963 else
6964   echo "$as_me: failed program was:" >&5
6965 cat "conftest.$ac_ext" >&5
6966
6967                                 CPPFLAGS="$cf_save_CPPFLAGS"
6968
6969 fi
6970 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6971                 fi
6972         done
6973
6974         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6975
6976 echo "${as_me:-configure}:6976: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6977
6978                 cf_save_LIBS="$LIBS"
6979                 cf_save_LDFLAGS="$LDFLAGS"
6980
6981                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6982
6983 cf_search=
6984 cf_library_path_list=""
6985 if test -n "${LDFLAGS}${LIBS}" ; then
6986         for cf_library_path in $LDFLAGS $LIBS
6987         do
6988                 case "$cf_library_path" in
6989                 (-L*)
6990                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6991
6992 test "x$cf_library_path" != "xNONE" && \
6993 test -d "$cf_library_path" && \
6994  {
6995         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6996         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6997         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6998         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6999         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7000         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7001 }
7002
7003                         cf_library_path_list="$cf_library_path_list $cf_search"
7004                         ;;
7005                 esac
7006         done
7007 fi
7008
7009 cf_search=
7010
7011 test "x$prefix" != "xNONE" && \
7012 test -d "$prefix" && \
7013  {
7014         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7015         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7016         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7017         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7018         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7019         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7020 }
7021
7022 for cf_subdir_prefix in \
7023         /usr \
7024         /usr/local \
7025         /usr/pkg \
7026         /opt \
7027         /opt/local \
7028         $HOME
7029 do
7030
7031 test "x$cf_subdir_prefix" != "x$prefix" && \
7032 test -d "$cf_subdir_prefix" && \
7033 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7034         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7035         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7036         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7037         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7038         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7039         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7040 }
7041
7042 done
7043
7044 cf_search="$cf_library_path_list $cf_search"
7045
7046                         for cf_cv_library_path_utf8 in $cf_search
7047                         do
7048                                 if test -d "$cf_cv_library_path_utf8" ; then
7049                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7050
7051 echo "${as_me:-configure}:7051: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7052
7053                                         CPPFLAGS="$cf_test_CPPFLAGS"
7054                                         LIBS="-lutf8  $cf_save_LIBS"
7055                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7056                                         cat >"conftest.$ac_ext" <<_ACEOF
7057 #line 7057 "configure"
7058 #include "confdefs.h"
7059
7060 #include <libutf8.h>
7061 int
7062 main (void)
7063 {
7064 putwc(0,0);
7065   ;
7066   return 0;
7067 }
7068 _ACEOF
7069 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7070 if { (eval echo "$as_me:7070: \"$ac_link\"") >&5
7071   (eval $ac_link) 2>&5
7072   ac_status=$?
7073   echo "$as_me:7073: \$? = $ac_status" >&5
7074   (exit "$ac_status"); } &&
7075          { ac_try='test -s "conftest$ac_exeext"'
7076   { (eval echo "$as_me:7076: \"$ac_try\"") >&5
7077   (eval $ac_try) 2>&5
7078   ac_status=$?
7079   echo "$as_me:7079: \$? = $ac_status" >&5
7080   (exit "$ac_status"); }; }; then
7081
7082                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7083
7084 echo "${as_me:-configure}:7084: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7085
7086                                         cf_cv_find_linkage_utf8=yes
7087                                         cf_cv_library_file_utf8="-lutf8"
7088                                         break
7089 else
7090   echo "$as_me: failed program was:" >&5
7091 cat "conftest.$ac_ext" >&5
7092
7093                                         CPPFLAGS="$cf_save_CPPFLAGS"
7094                                         LIBS="$cf_save_LIBS"
7095                                         LDFLAGS="$cf_save_LDFLAGS"
7096
7097 fi
7098 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7099                                 fi
7100                         done
7101                         CPPFLAGS="$cf_save_CPPFLAGS"
7102                         LDFLAGS="$cf_save_LDFLAGS"
7103                 fi
7104
7105         else
7106                 cf_cv_find_linkage_utf8=no
7107         fi
7108
7109 fi
7110 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7111
7112 fi
7113 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7114
7115 LIBS="$cf_save_LIBS"
7116
7117 if test "$cf_cv_find_linkage_utf8" = yes ; then
7118 cf_cv_utf8_lib=add-on
7119 else
7120 cf_cv_utf8_lib=no
7121 fi
7122
7123 fi
7124 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7125 fi
7126 echo "$as_me:7126: result: $cf_cv_utf8_lib" >&5
7127 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7128
7129 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7130 # ncurses/ncursesw:
7131 if test "$cf_cv_utf8_lib" = "add-on" ; then
7132
7133 cat >>confdefs.h <<\EOF
7134 #define HAVE_LIBUTF8_H 1
7135 EOF
7136
7137 if test -n "$cf_cv_header_path_utf8" ; then
7138   for cf_add_incdir in $cf_cv_header_path_utf8
7139   do
7140         while test "$cf_add_incdir" != /usr/include
7141         do
7142           if test -d "$cf_add_incdir"
7143           then
7144                 cf_have_incdir=no
7145                 if test -n "$CFLAGS$CPPFLAGS" ; then
7146                   # a loop is needed to ensure we can add subdirs of existing dirs
7147                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7148                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7149                           cf_have_incdir=yes; break
7150                         fi
7151                   done
7152                 fi
7153
7154                 if test "$cf_have_incdir" = no ; then
7155                   if test "$cf_add_incdir" = /usr/local/include ; then
7156                         if test "$GCC" = yes
7157                         then
7158                           cf_save_CPPFLAGS=$CPPFLAGS
7159
7160         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7161         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7162
7163                           cat >"conftest.$ac_ext" <<_ACEOF
7164 #line 7164 "configure"
7165 #include "confdefs.h"
7166 #include <stdio.h>
7167 int
7168 main (void)
7169 {
7170 printf("Hello")
7171   ;
7172   return 0;
7173 }
7174 _ACEOF
7175 rm -f "conftest.$ac_objext"
7176 if { (eval echo "$as_me:7176: \"$ac_compile\"") >&5
7177   (eval $ac_compile) 2>&5
7178   ac_status=$?
7179   echo "$as_me:7179: \$? = $ac_status" >&5
7180   (exit "$ac_status"); } &&
7181          { ac_try='test -s "conftest.$ac_objext"'
7182   { (eval echo "$as_me:7182: \"$ac_try\"") >&5
7183   (eval $ac_try) 2>&5
7184   ac_status=$?
7185   echo "$as_me:7185: \$? = $ac_status" >&5
7186   (exit "$ac_status"); }; }; then
7187   :
7188 else
7189   echo "$as_me: failed program was:" >&5
7190 cat "conftest.$ac_ext" >&5
7191 cf_have_incdir=yes
7192 fi
7193 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7194                           CPPFLAGS=$cf_save_CPPFLAGS
7195                         fi
7196                   fi
7197                 fi
7198
7199                 if test "$cf_have_incdir" = no ; then
7200                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7201
7202 echo "${as_me:-configure}:7202: testing adding $cf_add_incdir to include-path ..." 1>&5
7203
7204                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7205
7206                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7207                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7208                   cf_add_incdir="$cf_top_incdir"
7209                 else
7210                   break
7211                 fi
7212           else
7213                 break
7214           fi
7215         done
7216   done
7217 fi
7218
7219 if test -n "$cf_cv_library_path_utf8" ; then
7220         for cf_add_libdir in $cf_cv_library_path_utf8
7221         do
7222                 if test "$cf_add_libdir" = /usr/lib ; then
7223                         :
7224                 elif test -d "$cf_add_libdir"
7225                 then
7226                         cf_have_libdir=no
7227                         if test -n "$LDFLAGS$LIBS" ; then
7228                                 # a loop is needed to ensure we can add subdirs of existing dirs
7229                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7230                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7231                                                 cf_have_libdir=yes; break
7232                                         fi
7233                                 done
7234                         fi
7235                         if test "$cf_have_libdir" = no ; then
7236                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7237
7238 echo "${as_me:-configure}:7238: testing adding $cf_add_libdir to library-path ..." 1>&5
7239
7240                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7241                         fi
7242                 fi
7243         done
7244 fi
7245
7246 cf_add_libs="$LIBS"
7247 # reverse order
7248 cf_add_0lib=
7249 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7250 # filter duplicates
7251 for cf_add_1lib in $cf_add_0lib; do
7252         for cf_add_2lib in $cf_add_libs; do
7253                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7254                         cf_add_1lib=
7255                         break
7256                 fi
7257         done
7258         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7259 done
7260 LIBS="$cf_add_libs"
7261
7262 fi
7263
7264 cf_ncuconfig_root=ncursesw
7265 cf_have_ncuconfig=no
7266
7267 if test "x${PKG_CONFIG:=none}" != xnone; then
7268         echo "$as_me:7268: checking pkg-config for $cf_ncuconfig_root" >&5
7269 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7270         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7271                 echo "$as_me:7271: result: yes" >&5
7272 echo "${ECHO_T}yes" >&6
7273
7274                 echo "$as_me:7274: checking if the $cf_ncuconfig_root package files work" >&5
7275 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7276                 cf_have_ncuconfig=unknown
7277
7278                 cf_save_CFLAGS="$CFLAGS"
7279                 cf_save_CPPFLAGS="$CPPFLAGS"
7280                 cf_save_LIBS="$LIBS"
7281
7282                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7283                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7284
7285                 # while -W for passing linker flags is prevalent, it is not "standard".
7286                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7287                 # incompatible _and_ non-standard -W option which gives an error.  Work
7288                 # around that pitfall.
7289                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7290                 (x*c[89]9@@*-W*)
7291
7292 cf_fix_cppflags=no
7293 cf_new_cflags=
7294 cf_new_cppflags=
7295 cf_new_extra_cppflags=
7296
7297 for cf_add_cflags in $cf_pkg_cflags
7298 do
7299 case "$cf_fix_cppflags" in
7300 (no)
7301         case "$cf_add_cflags" in
7302         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7303                 case "$cf_add_cflags" in
7304                 (-D*)
7305                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7306
7307                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7308                                 && test -z "${cf_tst_cflags}" \
7309                                 && cf_fix_cppflags=yes
7310
7311                         if test "$cf_fix_cppflags" = yes ; then
7312
7313         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7314         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7315
7316                                 continue
7317                         elif test "${cf_tst_cflags}" = "\"'" ; then
7318
7319         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7320         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7321
7322                                 continue
7323                         fi
7324                         ;;
7325                 esac
7326                 case "$CPPFLAGS" in
7327                 (*$cf_add_cflags)
7328                         ;;
7329                 (*)
7330                         case "$cf_add_cflags" in
7331                         (-D*)
7332                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7333
7334 CPPFLAGS=`echo "$CPPFLAGS" | \
7335         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7336                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7337
7338                                 ;;
7339                         esac
7340
7341         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7342         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7343
7344                         ;;
7345                 esac
7346                 ;;
7347         (*)
7348
7349         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7350         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7351
7352                 ;;
7353         esac
7354         ;;
7355 (yes)
7356
7357         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7358         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7359
7360         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7361
7362         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7363                 && test -z "${cf_tst_cflags}" \
7364                 && cf_fix_cppflags=no
7365         ;;
7366 esac
7367 done
7368
7369 if test -n "$cf_new_cflags" ; then
7370
7371         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7372         CFLAGS="${CFLAGS}$cf_new_cflags"
7373
7374 fi
7375
7376 if test -n "$cf_new_cppflags" ; then
7377
7378         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7379         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7380
7381 fi
7382
7383 if test -n "$cf_new_extra_cppflags" ; then
7384
7385         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7386         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7387
7388 fi
7389
7390 cf_add_libs="$LIBS"
7391 # reverse order
7392 cf_add_0lib=
7393 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7394 # filter duplicates
7395 for cf_add_1lib in $cf_add_0lib; do
7396         for cf_add_2lib in $cf_add_libs; do
7397                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7398                         cf_add_1lib=
7399                         break
7400                 fi
7401         done
7402         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7403 done
7404 LIBS="$cf_add_libs"
7405
7406                         cat >"conftest.$ac_ext" <<_ACEOF
7407 #line 7407 "configure"
7408 #include "confdefs.h"
7409 #include <${cf_cv_ncurses_header:-curses.h}>
7410 int
7411 main (void)
7412 {
7413 initscr(); mousemask(0,0); tigetstr((char *)0);
7414   ;
7415   return 0;
7416 }
7417 _ACEOF
7418 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7419 if { (eval echo "$as_me:7419: \"$ac_link\"") >&5
7420   (eval $ac_link) 2>&5
7421   ac_status=$?
7422   echo "$as_me:7422: \$? = $ac_status" >&5
7423   (exit "$ac_status"); } &&
7424          { ac_try='test -s "conftest$ac_exeext"'
7425   { (eval echo "$as_me:7425: \"$ac_try\"") >&5
7426   (eval $ac_try) 2>&5
7427   ac_status=$?
7428   echo "$as_me:7428: \$? = $ac_status" >&5
7429   (exit "$ac_status"); }; }; then
7430   if test "$cross_compiling" = yes; then
7431   cf_test_ncuconfig=maybe
7432 else
7433   cat >"conftest.$ac_ext" <<_ACEOF
7434 #line 7434 "configure"
7435 #include "confdefs.h"
7436 #include <${cf_cv_ncurses_header:-curses.h}>
7437                                         int main(void)
7438                                         { const char *xx = curses_version(); return (xx == 0); }
7439 _ACEOF
7440 rm -f "conftest$ac_exeext"
7441 if { (eval echo "$as_me:7441: \"$ac_link\"") >&5
7442   (eval $ac_link) 2>&5
7443   ac_status=$?
7444   echo "$as_me:7444: \$? = $ac_status" >&5
7445   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7446   { (eval echo "$as_me:7446: \"$ac_try\"") >&5
7447   (eval $ac_try) 2>&5
7448   ac_status=$?
7449   echo "$as_me:7449: \$? = $ac_status" >&5
7450   (exit "$ac_status"); }; }; then
7451   cf_test_ncuconfig=yes
7452 else
7453   echo "$as_me: program exited with status $ac_status" >&5
7454 echo "$as_me: failed program was:" >&5
7455 cat "conftest.$ac_ext" >&5
7456 cf_test_ncuconfig=no
7457 fi
7458 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7459 fi
7460 else
7461   echo "$as_me: failed program was:" >&5
7462 cat "conftest.$ac_ext" >&5
7463 cf_test_ncuconfig=no
7464 fi
7465 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7466
7467                         CFLAGS="$cf_save_CFLAGS"
7468                         CPPFLAGS="$cf_save_CPPFLAGS"
7469                         LIBS="$cf_save_LIBS"
7470
7471                         if test "x$cf_test_ncuconfig" != xyes; then
7472                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7473                                 cf_pkg_cflags="$cf_temp"
7474                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7475                                 cf_pkg_libs="$cf_temp"
7476                         fi
7477                         ;;
7478                 esac
7479
7480 for cf_add_cflags in $cf_pkg_cflags
7481 do
7482         case "x$cf_add_cflags" in
7483         (x-[DU]*)
7484
7485 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7486 while true
7487 do
7488         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7489         test "$CFLAGS" != "$cf_old_cflag" || break
7490
7491         CFLAGS="$cf_old_cflag"
7492 done
7493
7494 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7495 while true
7496 do
7497         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7498         test "$CPPFLAGS" != "$cf_old_cflag" || break
7499
7500         CPPFLAGS="$cf_old_cflag"
7501 done
7502
7503                 ;;
7504         esac
7505
7506 cf_fix_cppflags=no
7507 cf_new_cflags=
7508 cf_new_cppflags=
7509 cf_new_extra_cppflags=
7510
7511 for cf_add_cflags in $cf_add_cflags
7512 do
7513 case "$cf_fix_cppflags" in
7514 (no)
7515         case "$cf_add_cflags" in
7516         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7517                 case "$cf_add_cflags" in
7518                 (-D*)
7519                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7520
7521                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7522                                 && test -z "${cf_tst_cflags}" \
7523                                 && cf_fix_cppflags=yes
7524
7525                         if test "$cf_fix_cppflags" = yes ; then
7526
7527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7529
7530                                 continue
7531                         elif test "${cf_tst_cflags}" = "\"'" ; then
7532
7533         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7534         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7535
7536                                 continue
7537                         fi
7538                         ;;
7539                 esac
7540                 case "$CPPFLAGS" in
7541                 (*$cf_add_cflags)
7542                         ;;
7543                 (*)
7544                         case "$cf_add_cflags" in
7545                         (-D*)
7546                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7547
7548 CPPFLAGS=`echo "$CPPFLAGS" | \
7549         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7550                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7551
7552                                 ;;
7553                         esac
7554
7555         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7556         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7557
7558                         ;;
7559                 esac
7560                 ;;
7561         (*)
7562
7563         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7564         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7565
7566                 ;;
7567         esac
7568         ;;
7569 (yes)
7570
7571         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7572         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7573
7574         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7575
7576         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7577                 && test -z "${cf_tst_cflags}" \
7578                 && cf_fix_cppflags=no
7579         ;;
7580 esac
7581 done
7582
7583 if test -n "$cf_new_cflags" ; then
7584
7585         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7586         CFLAGS="${CFLAGS}$cf_new_cflags"
7587
7588 fi
7589
7590 if test -n "$cf_new_cppflags" ; then
7591
7592         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7593         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7594
7595 fi
7596
7597 if test -n "$cf_new_extra_cppflags" ; then
7598
7599         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7600         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7601
7602 fi
7603
7604 done
7605
7606 cf_add_libs="$LIBS"
7607 # reverse order
7608 cf_add_0lib=
7609 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7610 # filter duplicates
7611 for cf_add_1lib in $cf_add_0lib; do
7612         for cf_add_2lib in $cf_add_libs; do
7613                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7614                         cf_add_1lib=
7615                         break
7616                 fi
7617         done
7618         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7619 done
7620 LIBS="$cf_add_libs"
7621
7622                 cat >"conftest.$ac_ext" <<_ACEOF
7623 #line 7623 "configure"
7624 #include "confdefs.h"
7625 #include <${cf_cv_ncurses_header:-curses.h}>
7626 int
7627 main (void)
7628 {
7629 initscr(); mousemask(0,0); tigetstr((char *)0);
7630   ;
7631   return 0;
7632 }
7633 _ACEOF
7634 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7635 if { (eval echo "$as_me:7635: \"$ac_link\"") >&5
7636   (eval $ac_link) 2>&5
7637   ac_status=$?
7638   echo "$as_me:7638: \$? = $ac_status" >&5
7639   (exit "$ac_status"); } &&
7640          { ac_try='test -s "conftest$ac_exeext"'
7641   { (eval echo "$as_me:7641: \"$ac_try\"") >&5
7642   (eval $ac_try) 2>&5
7643   ac_status=$?
7644   echo "$as_me:7644: \$? = $ac_status" >&5
7645   (exit "$ac_status"); }; }; then
7646   if test "$cross_compiling" = yes; then
7647   cf_have_ncuconfig=maybe
7648 else
7649   cat >"conftest.$ac_ext" <<_ACEOF
7650 #line 7650 "configure"
7651 #include "confdefs.h"
7652 #include <${cf_cv_ncurses_header:-curses.h}>
7653                                 int main(void)
7654                                 { const char *xx = curses_version(); return (xx == 0); }
7655 _ACEOF
7656 rm -f "conftest$ac_exeext"
7657 if { (eval echo "$as_me:7657: \"$ac_link\"") >&5
7658   (eval $ac_link) 2>&5
7659   ac_status=$?
7660   echo "$as_me:7660: \$? = $ac_status" >&5
7661   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7662   { (eval echo "$as_me:7662: \"$ac_try\"") >&5
7663   (eval $ac_try) 2>&5
7664   ac_status=$?
7665   echo "$as_me:7665: \$? = $ac_status" >&5
7666   (exit "$ac_status"); }; }; then
7667   cf_have_ncuconfig=yes
7668 else
7669   echo "$as_me: program exited with status $ac_status" >&5
7670 echo "$as_me: failed program was:" >&5
7671 cat "conftest.$ac_ext" >&5
7672 cf_have_ncuconfig=no
7673 fi
7674 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7675 fi
7676 else
7677   echo "$as_me: failed program was:" >&5
7678 cat "conftest.$ac_ext" >&5
7679 cf_have_ncuconfig=no
7680 fi
7681 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7682                 echo "$as_me:7682: result: $cf_have_ncuconfig" >&5
7683 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7684                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7685                 if test "$cf_have_ncuconfig" != "yes"
7686                 then
7687                         CPPFLAGS="$cf_save_CPPFLAGS"
7688                         LIBS="$cf_save_LIBS"
7689                         NCURSES_CONFIG_PKG=none
7690                 else
7691
7692 cat >>confdefs.h <<\EOF
7693 #define NCURSES 1
7694 EOF
7695
7696                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7697
7698 echo "$as_me:7698: checking for terminfo header" >&5
7699 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7700 if test "${cf_cv_term_header+set}" = set; then
7701   echo $ECHO_N "(cached) $ECHO_C" >&6
7702 else
7703
7704 case "${cf_cv_ncurses_header}" in
7705 (*/ncurses.h|*/ncursesw.h)
7706         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7707         ;;
7708 (*)
7709         cf_term_header=term.h
7710         ;;
7711 esac
7712
7713 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7714 do
7715 cat >"conftest.$ac_ext" <<_ACEOF
7716 #line 7716 "configure"
7717 #include "confdefs.h"
7718 #include <stdio.h>
7719 #include <${cf_cv_ncurses_header:-curses.h}>
7720 #include <$cf_test>
7721
7722 int
7723 main (void)
7724 {
7725 int x = auto_left_margin; (void)x
7726   ;
7727   return 0;
7728 }
7729 _ACEOF
7730 rm -f "conftest.$ac_objext"
7731 if { (eval echo "$as_me:7731: \"$ac_compile\"") >&5
7732   (eval $ac_compile) 2>&5
7733   ac_status=$?
7734   echo "$as_me:7734: \$? = $ac_status" >&5
7735   (exit "$ac_status"); } &&
7736          { ac_try='test -s "conftest.$ac_objext"'
7737   { (eval echo "$as_me:7737: \"$ac_try\"") >&5
7738   (eval $ac_try) 2>&5
7739   ac_status=$?
7740   echo "$as_me:7740: \$? = $ac_status" >&5
7741   (exit "$ac_status"); }; }; then
7742
7743         cf_cv_term_header="$cf_test"
7744 else
7745   echo "$as_me: failed program was:" >&5
7746 cat "conftest.$ac_ext" >&5
7747
7748         cf_cv_term_header=unknown
7749
7750 fi
7751 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7752         test "$cf_cv_term_header" != unknown && break
7753 done
7754
7755 fi
7756 echo "$as_me:7756: result: $cf_cv_term_header" >&5
7757 echo "${ECHO_T}$cf_cv_term_header" >&6
7758
7759 # Set definitions to allow ifdef'ing to accommodate subdirectories
7760
7761 case "$cf_cv_term_header" in
7762 (*term.h)
7763
7764 cat >>confdefs.h <<\EOF
7765 #define HAVE_TERM_H 1
7766 EOF
7767
7768         ;;
7769 esac
7770
7771 case "$cf_cv_term_header" in
7772 (ncurses/term.h)
7773
7774 cat >>confdefs.h <<\EOF
7775 #define HAVE_NCURSES_TERM_H 1
7776 EOF
7777
7778         ;;
7779 (ncursesw/term.h)
7780
7781 cat >>confdefs.h <<\EOF
7782 #define HAVE_NCURSESW_TERM_H 1
7783 EOF
7784
7785         ;;
7786 esac
7787
7788                 fi
7789
7790         else
7791                 echo "$as_me:7791: result: no" >&5
7792 echo "${ECHO_T}no" >&6
7793                 NCURSES_CONFIG_PKG=none
7794         fi
7795 else
7796         NCURSES_CONFIG_PKG=none
7797 fi
7798
7799 if test "x$cf_have_ncuconfig" = "xno"; then
7800         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7801
7802 if test -n "$ac_tool_prefix"; then
7803   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7804   do
7805     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7806 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7807 echo "$as_me:7807: checking for $ac_word" >&5
7808 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7809 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7810   echo $ECHO_N "(cached) $ECHO_C" >&6
7811 else
7812   if test -n "$NCURSES_CONFIG"; then
7813   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7814 else
7815   ac_save_IFS=$IFS; IFS=$ac_path_separator
7816 ac_dummy="$PATH"
7817 for ac_dir in $ac_dummy; do
7818   IFS=$ac_save_IFS
7819   test -z "$ac_dir" && ac_dir=.
7820   $as_executable_p "$ac_dir/$ac_word" || continue
7821 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7822 echo "$as_me:7822: found $ac_dir/$ac_word" >&5
7823 break
7824 done
7825
7826 fi
7827 fi
7828 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7829 if test -n "$NCURSES_CONFIG"; then
7830   echo "$as_me:7830: result: $NCURSES_CONFIG" >&5
7831 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7832 else
7833   echo "$as_me:7833: result: no" >&5
7834 echo "${ECHO_T}no" >&6
7835 fi
7836
7837     test -n "$NCURSES_CONFIG" && break
7838   done
7839 fi
7840 if test -z "$NCURSES_CONFIG"; then
7841   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7842   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7843 do
7844   # Extract the first word of "$ac_prog", so it can be a program name with args.
7845 set dummy $ac_prog; ac_word=$2
7846 echo "$as_me:7846: checking for $ac_word" >&5
7847 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7848 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7849   echo $ECHO_N "(cached) $ECHO_C" >&6
7850 else
7851   if test -n "$ac_ct_NCURSES_CONFIG"; then
7852   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7853 else
7854   ac_save_IFS=$IFS; IFS=$ac_path_separator
7855 ac_dummy="$PATH"
7856 for ac_dir in $ac_dummy; do
7857   IFS=$ac_save_IFS
7858   test -z "$ac_dir" && ac_dir=.
7859   $as_executable_p "$ac_dir/$ac_word" || continue
7860 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7861 echo "$as_me:7861: found $ac_dir/$ac_word" >&5
7862 break
7863 done
7864
7865 fi
7866 fi
7867 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7868 if test -n "$ac_ct_NCURSES_CONFIG"; then
7869   echo "$as_me:7869: result: $ac_ct_NCURSES_CONFIG" >&5
7870 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7871 else
7872   echo "$as_me:7872: result: no" >&5
7873 echo "${ECHO_T}no" >&6
7874 fi
7875
7876   test -n "$ac_ct_NCURSES_CONFIG" && break
7877 done
7878 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7879
7880   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7881 fi
7882
7883         if test "$NCURSES_CONFIG" != none ; then
7884
7885 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7886 do
7887         case "x$cf_add_cflags" in
7888         (x-[DU]*)
7889
7890 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7891 while true
7892 do
7893         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7894         test "$CFLAGS" != "$cf_old_cflag" || break
7895
7896         CFLAGS="$cf_old_cflag"
7897 done
7898
7899 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7900 while true
7901 do
7902         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7903         test "$CPPFLAGS" != "$cf_old_cflag" || break
7904
7905         CPPFLAGS="$cf_old_cflag"
7906 done
7907
7908                 ;;
7909         esac
7910
7911 cf_fix_cppflags=no
7912 cf_new_cflags=
7913 cf_new_cppflags=
7914 cf_new_extra_cppflags=
7915
7916 for cf_add_cflags in $cf_add_cflags
7917 do
7918 case "$cf_fix_cppflags" in
7919 (no)
7920         case "$cf_add_cflags" in
7921         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7922                 case "$cf_add_cflags" in
7923                 (-D*)
7924                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7925
7926                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7927                                 && test -z "${cf_tst_cflags}" \
7928                                 && cf_fix_cppflags=yes
7929
7930                         if test "$cf_fix_cppflags" = yes ; then
7931
7932         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7933         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7934
7935                                 continue
7936                         elif test "${cf_tst_cflags}" = "\"'" ; then
7937
7938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7940
7941                                 continue
7942                         fi
7943                         ;;
7944                 esac
7945                 case "$CPPFLAGS" in
7946                 (*$cf_add_cflags)
7947                         ;;
7948                 (*)
7949                         case "$cf_add_cflags" in
7950                         (-D*)
7951                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7952
7953 CPPFLAGS=`echo "$CPPFLAGS" | \
7954         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7955                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7956
7957                                 ;;
7958                         esac
7959
7960         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7961         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7962
7963                         ;;
7964                 esac
7965                 ;;
7966         (*)
7967
7968         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7969         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7970
7971                 ;;
7972         esac
7973         ;;
7974 (yes)
7975
7976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7978
7979         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7980
7981         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7982                 && test -z "${cf_tst_cflags}" \
7983                 && cf_fix_cppflags=no
7984         ;;
7985 esac
7986 done
7987
7988 if test -n "$cf_new_cflags" ; then
7989
7990         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7991         CFLAGS="${CFLAGS}$cf_new_cflags"
7992
7993 fi
7994
7995 if test -n "$cf_new_cppflags" ; then
7996
7997         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7998         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7999
8000 fi
8001
8002 if test -n "$cf_new_extra_cppflags" ; then
8003
8004         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8005         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8006
8007 fi
8008
8009 done
8010
8011 cf_add_libs="$LIBS"
8012 # reverse order
8013 cf_add_0lib=
8014 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8015 # filter duplicates
8016 for cf_add_1lib in $cf_add_0lib; do
8017         for cf_add_2lib in $cf_add_libs; do
8018                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8019                         cf_add_1lib=
8020                         break
8021                 fi
8022         done
8023         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8024 done
8025 LIBS="$cf_add_libs"
8026
8027                 # even with config script, some packages use no-override for curses.h
8028
8029 echo "$as_me:8029: checking if we have identified curses headers" >&5
8030 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8031 if test "${cf_cv_ncurses_header+set}" = set; then
8032   echo $ECHO_N "(cached) $ECHO_C" >&6
8033 else
8034
8035 cf_cv_ncurses_header=none
8036 for cf_header in \
8037         ncurses.h ncursesw/ncurses.h \
8038         curses.h ncursesw/curses.h
8039 do
8040 cat >"conftest.$ac_ext" <<_ACEOF
8041 #line 8041 "configure"
8042 #include "confdefs.h"
8043 #include <${cf_header}>
8044 int
8045 main (void)
8046 {
8047 initscr(); tgoto("?", 0,0)
8048   ;
8049   return 0;
8050 }
8051 _ACEOF
8052 rm -f "conftest.$ac_objext"
8053 if { (eval echo "$as_me:8053: \"$ac_compile\"") >&5
8054   (eval $ac_compile) 2>&5
8055   ac_status=$?
8056   echo "$as_me:8056: \$? = $ac_status" >&5
8057   (exit "$ac_status"); } &&
8058          { ac_try='test -s "conftest.$ac_objext"'
8059   { (eval echo "$as_me:8059: \"$ac_try\"") >&5
8060   (eval $ac_try) 2>&5
8061   ac_status=$?
8062   echo "$as_me:8062: \$? = $ac_status" >&5
8063   (exit "$ac_status"); }; }; then
8064   cf_cv_ncurses_header=$cf_header; break
8065 else
8066   echo "$as_me: failed program was:" >&5
8067 cat "conftest.$ac_ext" >&5
8068 fi
8069 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8070 done
8071
8072 fi
8073 echo "$as_me:8073: result: $cf_cv_ncurses_header" >&5
8074 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8075
8076 if test "$cf_cv_ncurses_header" = none ; then
8077         { { echo "$as_me:8077: error: No curses header-files found" >&5
8078 echo "$as_me: error: No curses header-files found" >&2;}
8079    { (exit 1); exit 1; }; }
8080 fi
8081
8082 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8083
8084 for ac_header in $cf_cv_ncurses_header
8085 do
8086 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8087 echo "$as_me:8087: checking for $ac_header" >&5
8088 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8089 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8090   echo $ECHO_N "(cached) $ECHO_C" >&6
8091 else
8092   cat >"conftest.$ac_ext" <<_ACEOF
8093 #line 8093 "configure"
8094 #include "confdefs.h"
8095 #include <$ac_header>
8096 _ACEOF
8097 if { (eval echo "$as_me:8097: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8098   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8099   ac_status=$?
8100   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8101   rm -f conftest.er1
8102   cat conftest.err >&5
8103   echo "$as_me:8103: \$? = $ac_status" >&5
8104   (exit "$ac_status"); } >/dev/null; then
8105   if test -s conftest.err; then
8106     ac_cpp_err=$ac_c_preproc_warn_flag
8107   else
8108     ac_cpp_err=
8109   fi
8110 else
8111   ac_cpp_err=yes
8112 fi
8113 if test -z "$ac_cpp_err"; then
8114   eval "$as_ac_Header=yes"
8115 else
8116   echo "$as_me: failed program was:" >&5
8117   cat "conftest.$ac_ext" >&5
8118   eval "$as_ac_Header=no"
8119 fi
8120 rm -f conftest.err "conftest.$ac_ext"
8121 fi
8122 echo "$as_me:8122: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8123 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8124 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8125   cat >>confdefs.h <<EOF
8126 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8127 EOF
8128
8129 fi
8130 done
8131
8132 cat >>confdefs.h <<\EOF
8133 #define NCURSES 1
8134 EOF
8135
8136 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8137
8138                 cat >>confdefs.h <<EOF
8139 #define $cf_nculib_ROOT 1
8140 EOF
8141
8142                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8143
8144         else
8145
8146 cf_ncuhdr_root=ncursesw
8147
8148 test -n "$cf_cv_curses_dir" && \
8149 test "$cf_cv_curses_dir" != "no" && { \
8150
8151 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8152   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8153   do
8154         while test "$cf_add_incdir" != /usr/include
8155         do
8156           if test -d "$cf_add_incdir"
8157           then
8158                 cf_have_incdir=no
8159                 if test -n "$CFLAGS$CPPFLAGS" ; then
8160                   # a loop is needed to ensure we can add subdirs of existing dirs
8161                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8162                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8163                           cf_have_incdir=yes; break
8164                         fi
8165                   done
8166                 fi
8167
8168                 if test "$cf_have_incdir" = no ; then
8169                   if test "$cf_add_incdir" = /usr/local/include ; then
8170                         if test "$GCC" = yes
8171                         then
8172                           cf_save_CPPFLAGS=$CPPFLAGS
8173
8174         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8175         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8176
8177                           cat >"conftest.$ac_ext" <<_ACEOF
8178 #line 8178 "configure"
8179 #include "confdefs.h"
8180 #include <stdio.h>
8181 int
8182 main (void)
8183 {
8184 printf("Hello")
8185   ;
8186   return 0;
8187 }
8188 _ACEOF
8189 rm -f "conftest.$ac_objext"
8190 if { (eval echo "$as_me:8190: \"$ac_compile\"") >&5
8191   (eval $ac_compile) 2>&5
8192   ac_status=$?
8193   echo "$as_me:8193: \$? = $ac_status" >&5
8194   (exit "$ac_status"); } &&
8195          { ac_try='test -s "conftest.$ac_objext"'
8196   { (eval echo "$as_me:8196: \"$ac_try\"") >&5
8197   (eval $ac_try) 2>&5
8198   ac_status=$?
8199   echo "$as_me:8199: \$? = $ac_status" >&5
8200   (exit "$ac_status"); }; }; then
8201   :
8202 else
8203   echo "$as_me: failed program was:" >&5
8204 cat "conftest.$ac_ext" >&5
8205 cf_have_incdir=yes
8206 fi
8207 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8208                           CPPFLAGS=$cf_save_CPPFLAGS
8209                         fi
8210                   fi
8211                 fi
8212
8213                 if test "$cf_have_incdir" = no ; then
8214                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8215
8216 echo "${as_me:-configure}:8216: testing adding $cf_add_incdir to include-path ..." 1>&5
8217
8218                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8219
8220                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8221                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8222                   cf_add_incdir="$cf_top_incdir"
8223                 else
8224                   break
8225                 fi
8226           else
8227                 break
8228           fi
8229         done
8230   done
8231 fi
8232
8233 }
8234
8235 echo "$as_me:8235: checking for $cf_ncuhdr_root header in include-path" >&5
8236 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8237 if test "${cf_cv_ncurses_h+set}" = set; then
8238   echo $ECHO_N "(cached) $ECHO_C" >&6
8239 else
8240
8241         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8242         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8243         for cf_header in $cf_header_list
8244         do
8245
8246         cat >"conftest.$ac_ext" <<_ACEOF
8247 #line 8247 "configure"
8248 #include "confdefs.h"
8249
8250 #define _XOPEN_SOURCE_EXTENDED
8251 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8252 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8253
8254 #include <$cf_header>
8255 int
8256 main (void)
8257 {
8258
8259 #ifdef NCURSES_VERSION
8260
8261 #ifndef WACS_BSSB
8262         make an error
8263 #endif
8264
8265 printf("%s\\n", NCURSES_VERSION);
8266 #else
8267 #ifdef __NCURSES_H
8268 printf("old\\n");
8269 #else
8270         make an error
8271 #endif
8272 #endif
8273
8274   ;
8275   return 0;
8276 }
8277 _ACEOF
8278 rm -f "conftest.$ac_objext"
8279 if { (eval echo "$as_me:8279: \"$ac_compile\"") >&5
8280   (eval $ac_compile) 2>&5
8281   ac_status=$?
8282   echo "$as_me:8282: \$? = $ac_status" >&5
8283   (exit "$ac_status"); } &&
8284          { ac_try='test -s "conftest.$ac_objext"'
8285   { (eval echo "$as_me:8285: \"$ac_try\"") >&5
8286   (eval $ac_try) 2>&5
8287   ac_status=$?
8288   echo "$as_me:8288: \$? = $ac_status" >&5
8289   (exit "$ac_status"); }; }; then
8290   cf_cv_ncurses_h=$cf_header
8291
8292 else
8293   echo "$as_me: failed program was:" >&5
8294 cat "conftest.$ac_ext" >&5
8295 cf_cv_ncurses_h=no
8296 fi
8297 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8298
8299                 test "$cf_cv_ncurses_h" != no && break
8300         done
8301
8302 fi
8303 echo "$as_me:8303: result: $cf_cv_ncurses_h" >&5
8304 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8305
8306 if test "$cf_cv_ncurses_h" != no ; then
8307         cf_cv_ncurses_header=$cf_cv_ncurses_h
8308 else
8309
8310 echo "$as_me:8310: checking for $cf_ncuhdr_root include-path" >&5
8311 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8312 if test "${cf_cv_ncurses_h2+set}" = set; then
8313   echo $ECHO_N "(cached) $ECHO_C" >&6
8314 else
8315
8316         test -n "$verbose" && echo
8317
8318 cf_search=
8319
8320 # collect the current set of include-directories from compiler flags
8321 cf_header_path_list=""
8322 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8323         for cf_header_path in $CPPFLAGS $CFLAGS
8324         do
8325                 case "$cf_header_path" in
8326                 (-I*)
8327                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8328
8329 test "x$cf_header_path" != "xNONE" && \
8330 test -d "$cf_header_path" && \
8331  {
8332         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8333         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8334         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8335         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8336         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8337         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"
8338 }
8339
8340                         cf_header_path_list="$cf_header_path_list $cf_search"
8341                         ;;
8342                 esac
8343         done
8344 fi
8345
8346 # add the variations for the package we are looking for
8347
8348 cf_search=
8349
8350 test "x$prefix" != "xNONE" && \
8351 test -d "$prefix" && \
8352  {
8353         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8354         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8355         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8356         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8357         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8358         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8359 }
8360
8361 for cf_subdir_prefix in \
8362         /usr \
8363         /usr/local \
8364         /usr/pkg \
8365         /opt \
8366         /opt/local \
8367         $HOME
8368 do
8369
8370 test "x$cf_subdir_prefix" != "x$prefix" && \
8371 test -d "$cf_subdir_prefix" && \
8372 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8373         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8374         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8375         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8376         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8377         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8378         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"
8379 }
8380
8381 done
8382
8383 test "$includedir" != NONE && \
8384 test "$includedir" != "/usr/include" && \
8385 test -d "$includedir" && {
8386         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8387         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8388 }
8389
8390 test "$oldincludedir" != NONE && \
8391 test "$oldincludedir" != "/usr/include" && \
8392 test -d "$oldincludedir" && {
8393         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8394         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8395 }
8396
8397 cf_search="$cf_search $cf_header_path_list"
8398
8399         test -n "$verbose" && echo "search path $cf_search"
8400         cf_save2_CPPFLAGS="$CPPFLAGS"
8401         for cf_incdir in $cf_search
8402         do
8403
8404 if test -n "$cf_incdir" ; then
8405   for cf_add_incdir in $cf_incdir
8406   do
8407         while test "$cf_add_incdir" != /usr/include
8408         do
8409           if test -d "$cf_add_incdir"
8410           then
8411                 cf_have_incdir=no
8412                 if test -n "$CFLAGS$CPPFLAGS" ; then
8413                   # a loop is needed to ensure we can add subdirs of existing dirs
8414                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8415                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8416                           cf_have_incdir=yes; break
8417                         fi
8418                   done
8419                 fi
8420
8421                 if test "$cf_have_incdir" = no ; then
8422                   if test "$cf_add_incdir" = /usr/local/include ; then
8423                         if test "$GCC" = yes
8424                         then
8425                           cf_save_CPPFLAGS=$CPPFLAGS
8426
8427         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8428         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8429
8430                           cat >"conftest.$ac_ext" <<_ACEOF
8431 #line 8431 "configure"
8432 #include "confdefs.h"
8433 #include <stdio.h>
8434 int
8435 main (void)
8436 {
8437 printf("Hello")
8438   ;
8439   return 0;
8440 }
8441 _ACEOF
8442 rm -f "conftest.$ac_objext"
8443 if { (eval echo "$as_me:8443: \"$ac_compile\"") >&5
8444   (eval $ac_compile) 2>&5
8445   ac_status=$?
8446   echo "$as_me:8446: \$? = $ac_status" >&5
8447   (exit "$ac_status"); } &&
8448          { ac_try='test -s "conftest.$ac_objext"'
8449   { (eval echo "$as_me:8449: \"$ac_try\"") >&5
8450   (eval $ac_try) 2>&5
8451   ac_status=$?
8452   echo "$as_me:8452: \$? = $ac_status" >&5
8453   (exit "$ac_status"); }; }; then
8454   :
8455 else
8456   echo "$as_me: failed program was:" >&5
8457 cat "conftest.$ac_ext" >&5
8458 cf_have_incdir=yes
8459 fi
8460 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8461                           CPPFLAGS=$cf_save_CPPFLAGS
8462                         fi
8463                   fi
8464                 fi
8465
8466                 if test "$cf_have_incdir" = no ; then
8467                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8468
8469 echo "${as_me:-configure}:8469: testing adding $cf_add_incdir to include-path ..." 1>&5
8470
8471                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8472
8473                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8474                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8475                   cf_add_incdir="$cf_top_incdir"
8476                 else
8477                   break
8478                 fi
8479           else
8480                 break
8481           fi
8482         done
8483   done
8484 fi
8485
8486                 for cf_header in \
8487                         ncurses.h \
8488                         curses.h
8489                 do
8490
8491         cat >"conftest.$ac_ext" <<_ACEOF
8492 #line 8492 "configure"
8493 #include "confdefs.h"
8494
8495 #include <$cf_header>
8496 int
8497 main (void)
8498 {
8499
8500 #ifdef NCURSES_VERSION
8501
8502 printf("%s\\n", NCURSES_VERSION);
8503 #else
8504 #ifdef __NCURSES_H
8505 printf("old\\n");
8506 #else
8507         make an error
8508 #endif
8509 #endif
8510
8511   ;
8512   return 0;
8513 }
8514 _ACEOF
8515 rm -f "conftest.$ac_objext"
8516 if { (eval echo "$as_me:8516: \"$ac_compile\"") >&5
8517   (eval $ac_compile) 2>&5
8518   ac_status=$?
8519   echo "$as_me:8519: \$? = $ac_status" >&5
8520   (exit "$ac_status"); } &&
8521          { ac_try='test -s "conftest.$ac_objext"'
8522   { (eval echo "$as_me:8522: \"$ac_try\"") >&5
8523   (eval $ac_try) 2>&5
8524   ac_status=$?
8525   echo "$as_me:8525: \$? = $ac_status" >&5
8526   (exit "$ac_status"); }; }; then
8527   cf_cv_ncurses_h2=$cf_header
8528
8529 else
8530   echo "$as_me: failed program was:" >&5
8531 cat "conftest.$ac_ext" >&5
8532 cf_cv_ncurses_h2=no
8533 fi
8534 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8535
8536                         if test "$cf_cv_ncurses_h2" != no ; then
8537                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8538                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8539                                 break
8540                         fi
8541                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8542                 done
8543                 CPPFLAGS="$cf_save2_CPPFLAGS"
8544                 test "$cf_cv_ncurses_h2" != no && break
8545         done
8546         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8546: error: not found" >&5
8547 echo "$as_me: error: not found" >&2;}
8548    { (exit 1); exit 1; }; }
8549
8550 fi
8551 echo "$as_me:8551: result: $cf_cv_ncurses_h2" >&5
8552 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8553
8554         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8555         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8556         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8557                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8558         fi
8559
8560 if test -n "$cf_1st_incdir" ; then
8561   for cf_add_incdir in $cf_1st_incdir
8562   do
8563         while test "$cf_add_incdir" != /usr/include
8564         do
8565           if test -d "$cf_add_incdir"
8566           then
8567                 cf_have_incdir=no
8568                 if test -n "$CFLAGS$CPPFLAGS" ; then
8569                   # a loop is needed to ensure we can add subdirs of existing dirs
8570                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8571                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8572                           cf_have_incdir=yes; break
8573                         fi
8574                   done
8575                 fi
8576
8577                 if test "$cf_have_incdir" = no ; then
8578                   if test "$cf_add_incdir" = /usr/local/include ; then
8579                         if test "$GCC" = yes
8580                         then
8581                           cf_save_CPPFLAGS=$CPPFLAGS
8582
8583         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8584         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8585
8586                           cat >"conftest.$ac_ext" <<_ACEOF
8587 #line 8587 "configure"
8588 #include "confdefs.h"
8589 #include <stdio.h>
8590 int
8591 main (void)
8592 {
8593 printf("Hello")
8594   ;
8595   return 0;
8596 }
8597 _ACEOF
8598 rm -f "conftest.$ac_objext"
8599 if { (eval echo "$as_me:8599: \"$ac_compile\"") >&5
8600   (eval $ac_compile) 2>&5
8601   ac_status=$?
8602   echo "$as_me:8602: \$? = $ac_status" >&5
8603   (exit "$ac_status"); } &&
8604          { ac_try='test -s "conftest.$ac_objext"'
8605   { (eval echo "$as_me:8605: \"$ac_try\"") >&5
8606   (eval $ac_try) 2>&5
8607   ac_status=$?
8608   echo "$as_me:8608: \$? = $ac_status" >&5
8609   (exit "$ac_status"); }; }; then
8610   :
8611 else
8612   echo "$as_me: failed program was:" >&5
8613 cat "conftest.$ac_ext" >&5
8614 cf_have_incdir=yes
8615 fi
8616 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8617                           CPPFLAGS=$cf_save_CPPFLAGS
8618                         fi
8619                   fi
8620                 fi
8621
8622                 if test "$cf_have_incdir" = no ; then
8623                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8624
8625 echo "${as_me:-configure}:8625: testing adding $cf_add_incdir to include-path ..." 1>&5
8626
8627                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8628
8629                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8630                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8631                   cf_add_incdir="$cf_top_incdir"
8632                 else
8633                   break
8634                 fi
8635           else
8636                 break
8637           fi
8638         done
8639   done
8640 fi
8641
8642 fi
8643
8644 # Set definitions to allow ifdef'ing for ncurses.h
8645
8646 case "$cf_cv_ncurses_header" in
8647 (*ncurses.h)
8648
8649 cat >>confdefs.h <<\EOF
8650 #define HAVE_NCURSES_H 1
8651 EOF
8652
8653         ;;
8654 esac
8655
8656 case "$cf_cv_ncurses_header" in
8657 (ncurses/curses.h|ncurses/ncurses.h)
8658
8659 cat >>confdefs.h <<\EOF
8660 #define HAVE_NCURSES_NCURSES_H 1
8661 EOF
8662
8663         ;;
8664 (ncursesw/curses.h|ncursesw/ncurses.h)
8665
8666 cat >>confdefs.h <<\EOF
8667 #define HAVE_NCURSESW_NCURSES_H 1
8668 EOF
8669
8670         ;;
8671 esac
8672
8673 echo "$as_me:8673: checking for terminfo header" >&5
8674 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8675 if test "${cf_cv_term_header+set}" = set; then
8676   echo $ECHO_N "(cached) $ECHO_C" >&6
8677 else
8678
8679 case "${cf_cv_ncurses_header}" in
8680 (*/ncurses.h|*/ncursesw.h)
8681         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8682         ;;
8683 (*)
8684         cf_term_header=term.h
8685         ;;
8686 esac
8687
8688 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8689 do
8690 cat >"conftest.$ac_ext" <<_ACEOF
8691 #line 8691 "configure"
8692 #include "confdefs.h"
8693 #include <stdio.h>
8694 #include <${cf_cv_ncurses_header:-curses.h}>
8695 #include <$cf_test>
8696
8697 int
8698 main (void)
8699 {
8700 int x = auto_left_margin; (void)x
8701   ;
8702   return 0;
8703 }
8704 _ACEOF
8705 rm -f "conftest.$ac_objext"
8706 if { (eval echo "$as_me:8706: \"$ac_compile\"") >&5
8707   (eval $ac_compile) 2>&5
8708   ac_status=$?
8709   echo "$as_me:8709: \$? = $ac_status" >&5
8710   (exit "$ac_status"); } &&
8711          { ac_try='test -s "conftest.$ac_objext"'
8712   { (eval echo "$as_me:8712: \"$ac_try\"") >&5
8713   (eval $ac_try) 2>&5
8714   ac_status=$?
8715   echo "$as_me:8715: \$? = $ac_status" >&5
8716   (exit "$ac_status"); }; }; then
8717
8718         cf_cv_term_header="$cf_test"
8719 else
8720   echo "$as_me: failed program was:" >&5
8721 cat "conftest.$ac_ext" >&5
8722
8723         cf_cv_term_header=unknown
8724
8725 fi
8726 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8727         test "$cf_cv_term_header" != unknown && break
8728 done
8729
8730 fi
8731 echo "$as_me:8731: result: $cf_cv_term_header" >&5
8732 echo "${ECHO_T}$cf_cv_term_header" >&6
8733
8734 # Set definitions to allow ifdef'ing to accommodate subdirectories
8735
8736 case "$cf_cv_term_header" in
8737 (*term.h)
8738
8739 cat >>confdefs.h <<\EOF
8740 #define HAVE_TERM_H 1
8741 EOF
8742
8743         ;;
8744 esac
8745
8746 case "$cf_cv_term_header" in
8747 (ncurses/term.h)
8748
8749 cat >>confdefs.h <<\EOF
8750 #define HAVE_NCURSES_TERM_H 1
8751 EOF
8752
8753         ;;
8754 (ncursesw/term.h)
8755
8756 cat >>confdefs.h <<\EOF
8757 #define HAVE_NCURSESW_TERM_H 1
8758 EOF
8759
8760         ;;
8761 esac
8762
8763 # some applications need this, but should check for NCURSES_VERSION
8764
8765 cat >>confdefs.h <<\EOF
8766 #define NCURSES 1
8767 EOF
8768
8769 echo "$as_me:8769: checking for ncurses version" >&5
8770 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8771 if test "${cf_cv_ncurses_version+set}" = set; then
8772   echo $ECHO_N "(cached) $ECHO_C" >&6
8773 else
8774
8775         cf_cv_ncurses_version=no
8776         cf_tempfile=out$$
8777         rm -f "$cf_tempfile"
8778         if test "$cross_compiling" = yes; then
8779
8780         # This will not work if the preprocessor splits the line after the
8781         # Autoconf token.  The 'unproto' program does that.
8782         cat > "conftest.$ac_ext" <<EOF
8783 #include <${cf_cv_ncurses_header:-curses.h}>
8784 #undef Autoconf
8785 #ifdef NCURSES_VERSION
8786 Autoconf NCURSES_VERSION
8787 #else
8788 #ifdef __NCURSES_H
8789 Autoconf "old"
8790 #endif
8791 ;
8792 #endif
8793 EOF
8794         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8795         { (eval echo "$as_me:8795: \"$cf_try\"") >&5
8796   (eval $cf_try) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit "$ac_status"); }
8800         if test -f conftest.out ; then
8801                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8802                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8803                 rm -f conftest.out
8804         fi
8805
8806 else
8807   cat >"conftest.$ac_ext" <<_ACEOF
8808 #line 8808 "configure"
8809 #include "confdefs.h"
8810
8811 #include <${cf_cv_ncurses_header:-curses.h}>
8812 #include <stdio.h>
8813 int main(void)
8814 {
8815         FILE *fp = fopen("$cf_tempfile", "w");
8816 #ifdef NCURSES_VERSION
8817 # ifdef NCURSES_VERSION_PATCH
8818         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8819 # else
8820         fprintf(fp, "%s\\n", NCURSES_VERSION);
8821 # endif
8822 #else
8823 # ifdef __NCURSES_H
8824         fprintf(fp, "old\\n");
8825 # else
8826         make an error
8827 # endif
8828 #endif
8829         ${cf_cv_main_return:-return}(0);
8830 }
8831 _ACEOF
8832 rm -f "conftest$ac_exeext"
8833 if { (eval echo "$as_me:8833: \"$ac_link\"") >&5
8834   (eval $ac_link) 2>&5
8835   ac_status=$?
8836   echo "$as_me:8836: \$? = $ac_status" >&5
8837   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8838   { (eval echo "$as_me:8838: \"$ac_try\"") >&5
8839   (eval $ac_try) 2>&5
8840   ac_status=$?
8841   echo "$as_me:8841: \$? = $ac_status" >&5
8842   (exit "$ac_status"); }; }; then
8843
8844         cf_cv_ncurses_version=`cat $cf_tempfile`
8845 else
8846   echo "$as_me: program exited with status $ac_status" >&5
8847 echo "$as_me: failed program was:" >&5
8848 cat "conftest.$ac_ext" >&5
8849 fi
8850 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8851 fi
8852         rm -f "$cf_tempfile"
8853
8854 fi
8855 echo "$as_me:8855: result: $cf_cv_ncurses_version" >&5
8856 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8857 test "$cf_cv_ncurses_version" = no ||
8858 cat >>confdefs.h <<\EOF
8859 #define NCURSES 1
8860 EOF
8861
8862 cf_nculib_root=ncursesw
8863         # This works, except for the special case where we find gpm, but
8864         # ncurses is in a nonstandard location via $LIBS, and we really want
8865         # to link gpm.
8866 cf_ncurses_LIBS=""
8867 cf_ncurses_SAVE="$LIBS"
8868 echo "$as_me:8868: checking for Gpm_Open in -lgpm" >&5
8869 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8870 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8871   echo $ECHO_N "(cached) $ECHO_C" >&6
8872 else
8873   ac_check_lib_save_LIBS=$LIBS
8874 LIBS="-lgpm  $LIBS"
8875 cat >"conftest.$ac_ext" <<_ACEOF
8876 #line 8876 "configure"
8877 #include "confdefs.h"
8878
8879 /* Override any gcc2 internal prototype to avoid an error.  */
8880 #ifdef __cplusplus
8881 extern "C"
8882 #endif
8883 /* We use char because int might match the return type of a gcc2
8884    builtin and then its argument prototype would still apply.  */
8885 char Gpm_Open ();
8886 int
8887 main (void)
8888 {
8889 Gpm_Open ();
8890   ;
8891   return 0;
8892 }
8893 _ACEOF
8894 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8895 if { (eval echo "$as_me:8895: \"$ac_link\"") >&5
8896   (eval $ac_link) 2>&5
8897   ac_status=$?
8898   echo "$as_me:8898: \$? = $ac_status" >&5
8899   (exit "$ac_status"); } &&
8900          { ac_try='test -s "conftest$ac_exeext"'
8901   { (eval echo "$as_me:8901: \"$ac_try\"") >&5
8902   (eval $ac_try) 2>&5
8903   ac_status=$?
8904   echo "$as_me:8904: \$? = $ac_status" >&5
8905   (exit "$ac_status"); }; }; then
8906   ac_cv_lib_gpm_Gpm_Open=yes
8907 else
8908   echo "$as_me: failed program was:" >&5
8909 cat "conftest.$ac_ext" >&5
8910 ac_cv_lib_gpm_Gpm_Open=no
8911 fi
8912 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8913 LIBS=$ac_check_lib_save_LIBS
8914 fi
8915 echo "$as_me:8915: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8916 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8917 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8918   echo "$as_me:8918: checking for initscr in -lgpm" >&5
8919 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8920 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8921   echo $ECHO_N "(cached) $ECHO_C" >&6
8922 else
8923   ac_check_lib_save_LIBS=$LIBS
8924 LIBS="-lgpm  $LIBS"
8925 cat >"conftest.$ac_ext" <<_ACEOF
8926 #line 8926 "configure"
8927 #include "confdefs.h"
8928
8929 /* Override any gcc2 internal prototype to avoid an error.  */
8930 #ifdef __cplusplus
8931 extern "C"
8932 #endif
8933 /* We use char because int might match the return type of a gcc2
8934    builtin and then its argument prototype would still apply.  */
8935 char initscr ();
8936 int
8937 main (void)
8938 {
8939 initscr ();
8940   ;
8941   return 0;
8942 }
8943 _ACEOF
8944 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8945 if { (eval echo "$as_me:8945: \"$ac_link\"") >&5
8946   (eval $ac_link) 2>&5
8947   ac_status=$?
8948   echo "$as_me:8948: \$? = $ac_status" >&5
8949   (exit "$ac_status"); } &&
8950          { ac_try='test -s "conftest$ac_exeext"'
8951   { (eval echo "$as_me:8951: \"$ac_try\"") >&5
8952   (eval $ac_try) 2>&5
8953   ac_status=$?
8954   echo "$as_me:8954: \$? = $ac_status" >&5
8955   (exit "$ac_status"); }; }; then
8956   ac_cv_lib_gpm_initscr=yes
8957 else
8958   echo "$as_me: failed program was:" >&5
8959 cat "conftest.$ac_ext" >&5
8960 ac_cv_lib_gpm_initscr=no
8961 fi
8962 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8963 LIBS=$ac_check_lib_save_LIBS
8964 fi
8965 echo "$as_me:8965: result: $ac_cv_lib_gpm_initscr" >&5
8966 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8967 if test "$ac_cv_lib_gpm_initscr" = yes; then
8968   LIBS="$cf_ncurses_SAVE"
8969 else
8970   cf_ncurses_LIBS="-lgpm"
8971 fi
8972
8973 fi
8974
8975 case "$host_os" in
8976 (freebsd*)
8977         # This is only necessary if you are linking against an obsolete
8978         # version of ncurses (but it should do no harm, since it is static).
8979         if test "$cf_nculib_root" = ncurses ; then
8980                 echo "$as_me:8980: checking for tgoto in -lmytinfo" >&5
8981 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8982 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8983   echo $ECHO_N "(cached) $ECHO_C" >&6
8984 else
8985   ac_check_lib_save_LIBS=$LIBS
8986 LIBS="-lmytinfo  $LIBS"
8987 cat >"conftest.$ac_ext" <<_ACEOF
8988 #line 8988 "configure"
8989 #include "confdefs.h"
8990
8991 /* Override any gcc2 internal prototype to avoid an error.  */
8992 #ifdef __cplusplus
8993 extern "C"
8994 #endif
8995 /* We use char because int might match the return type of a gcc2
8996    builtin and then its argument prototype would still apply.  */
8997 char tgoto ();
8998 int
8999 main (void)
9000 {
9001 tgoto ();
9002   ;
9003   return 0;
9004 }
9005 _ACEOF
9006 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9007 if { (eval echo "$as_me:9007: \"$ac_link\"") >&5
9008   (eval $ac_link) 2>&5
9009   ac_status=$?
9010   echo "$as_me:9010: \$? = $ac_status" >&5
9011   (exit "$ac_status"); } &&
9012          { ac_try='test -s "conftest$ac_exeext"'
9013   { (eval echo "$as_me:9013: \"$ac_try\"") >&5
9014   (eval $ac_try) 2>&5
9015   ac_status=$?
9016   echo "$as_me:9016: \$? = $ac_status" >&5
9017   (exit "$ac_status"); }; }; then
9018   ac_cv_lib_mytinfo_tgoto=yes
9019 else
9020   echo "$as_me: failed program was:" >&5
9021 cat "conftest.$ac_ext" >&5
9022 ac_cv_lib_mytinfo_tgoto=no
9023 fi
9024 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9025 LIBS=$ac_check_lib_save_LIBS
9026 fi
9027 echo "$as_me:9027: result: $ac_cv_lib_mytinfo_tgoto" >&5
9028 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9029 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9030   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9031 fi
9032
9033         fi
9034         ;;
9035 esac
9036
9037 cf_add_libs="$LIBS"
9038 # reverse order
9039 cf_add_0lib=
9040 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9041 # filter duplicates
9042 for cf_add_1lib in $cf_add_0lib; do
9043         for cf_add_2lib in $cf_add_libs; do
9044                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9045                         cf_add_1lib=
9046                         break
9047                 fi
9048         done
9049         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9050 done
9051 LIBS="$cf_add_libs"
9052
9053 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9054 then
9055
9056 cf_add_libs="$LIBS"
9057 # reverse order
9058 cf_add_0lib=
9059 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9060 # filter duplicates
9061 for cf_add_1lib in $cf_add_0lib; do
9062         for cf_add_2lib in $cf_add_libs; do
9063                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9064                         cf_add_1lib=
9065                         break
9066                 fi
9067         done
9068         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9069 done
9070 LIBS="$cf_add_libs"
9071
9072 else
9073
9074         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9075         cf_libdir=""
9076         echo "$as_me:9076: checking for initscr" >&5
9077 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9078 if test "${ac_cv_func_initscr+set}" = set; then
9079   echo $ECHO_N "(cached) $ECHO_C" >&6
9080 else
9081   cat >"conftest.$ac_ext" <<_ACEOF
9082 #line 9082 "configure"
9083 #include "confdefs.h"
9084 #define initscr autoconf_temporary
9085 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9086 #undef initscr
9087
9088 #ifdef __cplusplus
9089 extern "C"
9090 #endif
9091
9092 /* We use char because int might match the return type of a gcc2
9093    builtin and then its argument prototype would still apply.  */
9094 char initscr (void);
9095
9096 int
9097 main (void)
9098 {
9099
9100 /* The GNU C library defines stubs for functions which it implements
9101     to always fail with ENOSYS.  Some functions are actually named
9102     something starting with __ and the normal name is an alias.  */
9103 #if defined (__stub_initscr) || defined (__stub___initscr)
9104 #error found stub for initscr
9105 #endif
9106
9107         return initscr ();
9108   ;
9109   return 0;
9110 }
9111 _ACEOF
9112 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9113 if { (eval echo "$as_me:9113: \"$ac_link\"") >&5
9114   (eval $ac_link) 2>&5
9115   ac_status=$?
9116   echo "$as_me:9116: \$? = $ac_status" >&5
9117   (exit "$ac_status"); } &&
9118          { ac_try='test -s "conftest$ac_exeext"'
9119   { (eval echo "$as_me:9119: \"$ac_try\"") >&5
9120   (eval $ac_try) 2>&5
9121   ac_status=$?
9122   echo "$as_me:9122: \$? = $ac_status" >&5
9123   (exit "$ac_status"); }; }; then
9124   ac_cv_func_initscr=yes
9125 else
9126   echo "$as_me: failed program was:" >&5
9127 cat "conftest.$ac_ext" >&5
9128 ac_cv_func_initscr=no
9129 fi
9130 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9131 fi
9132 echo "$as_me:9132: result: $ac_cv_func_initscr" >&5
9133 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9134 if test "$ac_cv_func_initscr" = yes; then
9135   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9136 else
9137
9138                 cf_save_LIBS="$LIBS"
9139                 echo "$as_me:9139: checking for initscr in -l$cf_nculib_root" >&5
9140 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9141                 LIBS="-l$cf_nculib_root $LIBS"
9142                 cat >"conftest.$ac_ext" <<_ACEOF
9143 #line 9143 "configure"
9144 #include "confdefs.h"
9145 #include <${cf_cv_ncurses_header:-curses.h}>
9146 int
9147 main (void)
9148 {
9149 initscr()
9150   ;
9151   return 0;
9152 }
9153 _ACEOF
9154 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9155 if { (eval echo "$as_me:9155: \"$ac_link\"") >&5
9156   (eval $ac_link) 2>&5
9157   ac_status=$?
9158   echo "$as_me:9158: \$? = $ac_status" >&5
9159   (exit "$ac_status"); } &&
9160          { ac_try='test -s "conftest$ac_exeext"'
9161   { (eval echo "$as_me:9161: \"$ac_try\"") >&5
9162   (eval $ac_try) 2>&5
9163   ac_status=$?
9164   echo "$as_me:9164: \$? = $ac_status" >&5
9165   (exit "$ac_status"); }; }; then
9166   echo "$as_me:9166: result: yes" >&5
9167 echo "${ECHO_T}yes" >&6
9168                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9169
9170 else
9171   echo "$as_me: failed program was:" >&5
9172 cat "conftest.$ac_ext" >&5
9173 echo "$as_me:9173: result: no" >&5
9174 echo "${ECHO_T}no" >&6
9175
9176 cf_search=
9177 cf_library_path_list=""
9178 if test -n "${LDFLAGS}${LIBS}" ; then
9179         for cf_library_path in $LDFLAGS $LIBS
9180         do
9181                 case "$cf_library_path" in
9182                 (-L*)
9183                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9184
9185 test "x$cf_library_path" != "xNONE" && \
9186 test -d "$cf_library_path" && \
9187  {
9188         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9189         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9190         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9191         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9192         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9193         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"
9194 }
9195
9196                         cf_library_path_list="$cf_library_path_list $cf_search"
9197                         ;;
9198                 esac
9199         done
9200 fi
9201
9202 cf_search=
9203
9204 test "x$prefix" != "xNONE" && \
9205 test -d "$prefix" && \
9206  {
9207         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9208         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9209         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9210         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9211         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9212         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9213 }
9214
9215 for cf_subdir_prefix in \
9216         /usr \
9217         /usr/local \
9218         /usr/pkg \
9219         /opt \
9220         /opt/local \
9221         $HOME
9222 do
9223
9224 test "x$cf_subdir_prefix" != "x$prefix" && \
9225 test -d "$cf_subdir_prefix" && \
9226 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9227         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9228         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9229         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9230         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9231         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9232         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"
9233 }
9234
9235 done
9236
9237 cf_search="$cf_library_path_list $cf_search"
9238
9239                         for cf_libdir in $cf_search
9240                         do
9241                                 echo "$as_me:9241: checking for -l$cf_nculib_root in $cf_libdir" >&5
9242 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9243                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9244                                 cat >"conftest.$ac_ext" <<_ACEOF
9245 #line 9245 "configure"
9246 #include "confdefs.h"
9247 #include <${cf_cv_ncurses_header:-curses.h}>
9248 int
9249 main (void)
9250 {
9251 initscr()
9252   ;
9253   return 0;
9254 }
9255 _ACEOF
9256 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9257 if { (eval echo "$as_me:9257: \"$ac_link\"") >&5
9258   (eval $ac_link) 2>&5
9259   ac_status=$?
9260   echo "$as_me:9260: \$? = $ac_status" >&5
9261   (exit "$ac_status"); } &&
9262          { ac_try='test -s "conftest$ac_exeext"'
9263   { (eval echo "$as_me:9263: \"$ac_try\"") >&5
9264   (eval $ac_try) 2>&5
9265   ac_status=$?
9266   echo "$as_me:9266: \$? = $ac_status" >&5
9267   (exit "$ac_status"); }; }; then
9268   echo "$as_me:9268: result: yes" >&5
9269 echo "${ECHO_T}yes" >&6
9270                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9271                                          break
9272 else
9273   echo "$as_me: failed program was:" >&5
9274 cat "conftest.$ac_ext" >&5
9275 echo "$as_me:9275: result: no" >&5
9276 echo "${ECHO_T}no" >&6
9277                                          LIBS="$cf_save_LIBS"
9278 fi
9279 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9280                         done
9281
9282 fi
9283 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9284
9285 fi
9286
9287 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9288
9289 if test "$cf_found_library" = no ; then
9290         { { echo "$as_me:9290: error: Cannot link $cf_nculib_root library" >&5
9291 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9292    { (exit 1); exit 1; }; }
9293 fi
9294
9295 fi
9296
9297 if test -n "$cf_ncurses_LIBS" ; then
9298         echo "$as_me:9298: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9299 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9300         cf_ncurses_SAVE="$LIBS"
9301         for p in $cf_ncurses_LIBS ; do
9302                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9303                 if test "$q" != "$LIBS" ; then
9304                         LIBS="$q"
9305                 fi
9306         done
9307         cat >"conftest.$ac_ext" <<_ACEOF
9308 #line 9308 "configure"
9309 #include "confdefs.h"
9310 #include <${cf_cv_ncurses_header:-curses.h}>
9311 int
9312 main (void)
9313 {
9314 initscr(); mousemask(0,0); tigetstr((char *)0);
9315   ;
9316   return 0;
9317 }
9318 _ACEOF
9319 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9320 if { (eval echo "$as_me:9320: \"$ac_link\"") >&5
9321   (eval $ac_link) 2>&5
9322   ac_status=$?
9323   echo "$as_me:9323: \$? = $ac_status" >&5
9324   (exit "$ac_status"); } &&
9325          { ac_try='test -s "conftest$ac_exeext"'
9326   { (eval echo "$as_me:9326: \"$ac_try\"") >&5
9327   (eval $ac_try) 2>&5
9328   ac_status=$?
9329   echo "$as_me:9329: \$? = $ac_status" >&5
9330   (exit "$ac_status"); }; }; then
9331   echo "$as_me:9331: result: yes" >&5
9332 echo "${ECHO_T}yes" >&6
9333 else
9334   echo "$as_me: failed program was:" >&5
9335 cat "conftest.$ac_ext" >&5
9336 echo "$as_me:9336: result: no" >&5
9337 echo "${ECHO_T}no" >&6
9338                  LIBS="$cf_ncurses_SAVE"
9339 fi
9340 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9341 fi
9342
9343 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9344
9345 cat >>confdefs.h <<EOF
9346 #define $cf_nculib_ROOT 1
9347 EOF
9348
9349         fi
9350 else
9351         NCURSES_CONFIG=none
9352 fi
9353
9354 else
9355
9356 cf_ncuconfig_root=ncurses
9357 cf_have_ncuconfig=no
9358
9359 if test "x${PKG_CONFIG:=none}" != xnone; then
9360         echo "$as_me:9360: checking pkg-config for $cf_ncuconfig_root" >&5
9361 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9362         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9363                 echo "$as_me:9363: result: yes" >&5
9364 echo "${ECHO_T}yes" >&6
9365
9366                 echo "$as_me:9366: checking if the $cf_ncuconfig_root package files work" >&5
9367 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9368                 cf_have_ncuconfig=unknown
9369
9370                 cf_save_CFLAGS="$CFLAGS"
9371                 cf_save_CPPFLAGS="$CPPFLAGS"
9372                 cf_save_LIBS="$LIBS"
9373
9374                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9375                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9376
9377                 # while -W for passing linker flags is prevalent, it is not "standard".
9378                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9379                 # incompatible _and_ non-standard -W option which gives an error.  Work
9380                 # around that pitfall.
9381                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9382                 (x*c[89]9@@*-W*)
9383
9384 cf_fix_cppflags=no
9385 cf_new_cflags=
9386 cf_new_cppflags=
9387 cf_new_extra_cppflags=
9388
9389 for cf_add_cflags in $cf_pkg_cflags
9390 do
9391 case "$cf_fix_cppflags" in
9392 (no)
9393         case "$cf_add_cflags" in
9394         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9395                 case "$cf_add_cflags" in
9396                 (-D*)
9397                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9398
9399                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9400                                 && test -z "${cf_tst_cflags}" \
9401                                 && cf_fix_cppflags=yes
9402
9403                         if test "$cf_fix_cppflags" = yes ; then
9404
9405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9407
9408                                 continue
9409                         elif test "${cf_tst_cflags}" = "\"'" ; then
9410
9411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9413
9414                                 continue
9415                         fi
9416                         ;;
9417                 esac
9418                 case "$CPPFLAGS" in
9419                 (*$cf_add_cflags)
9420                         ;;
9421                 (*)
9422                         case "$cf_add_cflags" in
9423                         (-D*)
9424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9425
9426 CPPFLAGS=`echo "$CPPFLAGS" | \
9427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9429
9430                                 ;;
9431                         esac
9432
9433         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9434         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9435
9436                         ;;
9437                 esac
9438                 ;;
9439         (*)
9440
9441         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9442         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9443
9444                 ;;
9445         esac
9446         ;;
9447 (yes)
9448
9449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9451
9452         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9453
9454         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9455                 && test -z "${cf_tst_cflags}" \
9456                 && cf_fix_cppflags=no
9457         ;;
9458 esac
9459 done
9460
9461 if test -n "$cf_new_cflags" ; then
9462
9463         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9464         CFLAGS="${CFLAGS}$cf_new_cflags"
9465
9466 fi
9467
9468 if test -n "$cf_new_cppflags" ; then
9469
9470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9471         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9472
9473 fi
9474
9475 if test -n "$cf_new_extra_cppflags" ; then
9476
9477         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9478         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9479
9480 fi
9481
9482 cf_add_libs="$LIBS"
9483 # reverse order
9484 cf_add_0lib=
9485 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9486 # filter duplicates
9487 for cf_add_1lib in $cf_add_0lib; do
9488         for cf_add_2lib in $cf_add_libs; do
9489                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9490                         cf_add_1lib=
9491                         break
9492                 fi
9493         done
9494         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9495 done
9496 LIBS="$cf_add_libs"
9497
9498                         cat >"conftest.$ac_ext" <<_ACEOF
9499 #line 9499 "configure"
9500 #include "confdefs.h"
9501 #include <${cf_cv_ncurses_header:-curses.h}>
9502 int
9503 main (void)
9504 {
9505 initscr(); mousemask(0,0); tigetstr((char *)0);
9506   ;
9507   return 0;
9508 }
9509 _ACEOF
9510 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9511 if { (eval echo "$as_me:9511: \"$ac_link\"") >&5
9512   (eval $ac_link) 2>&5
9513   ac_status=$?
9514   echo "$as_me:9514: \$? = $ac_status" >&5
9515   (exit "$ac_status"); } &&
9516          { ac_try='test -s "conftest$ac_exeext"'
9517   { (eval echo "$as_me:9517: \"$ac_try\"") >&5
9518   (eval $ac_try) 2>&5
9519   ac_status=$?
9520   echo "$as_me:9520: \$? = $ac_status" >&5
9521   (exit "$ac_status"); }; }; then
9522   if test "$cross_compiling" = yes; then
9523   cf_test_ncuconfig=maybe
9524 else
9525   cat >"conftest.$ac_ext" <<_ACEOF
9526 #line 9526 "configure"
9527 #include "confdefs.h"
9528 #include <${cf_cv_ncurses_header:-curses.h}>
9529                                         int main(void)
9530                                         { const char *xx = curses_version(); return (xx == 0); }
9531 _ACEOF
9532 rm -f "conftest$ac_exeext"
9533 if { (eval echo "$as_me:9533: \"$ac_link\"") >&5
9534   (eval $ac_link) 2>&5
9535   ac_status=$?
9536   echo "$as_me:9536: \$? = $ac_status" >&5
9537   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9538   { (eval echo "$as_me:9538: \"$ac_try\"") >&5
9539   (eval $ac_try) 2>&5
9540   ac_status=$?
9541   echo "$as_me:9541: \$? = $ac_status" >&5
9542   (exit "$ac_status"); }; }; then
9543   cf_test_ncuconfig=yes
9544 else
9545   echo "$as_me: program exited with status $ac_status" >&5
9546 echo "$as_me: failed program was:" >&5
9547 cat "conftest.$ac_ext" >&5
9548 cf_test_ncuconfig=no
9549 fi
9550 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9551 fi
9552 else
9553   echo "$as_me: failed program was:" >&5
9554 cat "conftest.$ac_ext" >&5
9555 cf_test_ncuconfig=no
9556 fi
9557 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9558
9559                         CFLAGS="$cf_save_CFLAGS"
9560                         CPPFLAGS="$cf_save_CPPFLAGS"
9561                         LIBS="$cf_save_LIBS"
9562
9563                         if test "x$cf_test_ncuconfig" != xyes; then
9564                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9565                                 cf_pkg_cflags="$cf_temp"
9566                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9567                                 cf_pkg_libs="$cf_temp"
9568                         fi
9569                         ;;
9570                 esac
9571
9572 for cf_add_cflags in $cf_pkg_cflags
9573 do
9574         case "x$cf_add_cflags" in
9575         (x-[DU]*)
9576
9577 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9578 while true
9579 do
9580         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9581         test "$CFLAGS" != "$cf_old_cflag" || break
9582
9583         CFLAGS="$cf_old_cflag"
9584 done
9585
9586 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9587 while true
9588 do
9589         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9590         test "$CPPFLAGS" != "$cf_old_cflag" || break
9591
9592         CPPFLAGS="$cf_old_cflag"
9593 done
9594
9595                 ;;
9596         esac
9597
9598 cf_fix_cppflags=no
9599 cf_new_cflags=
9600 cf_new_cppflags=
9601 cf_new_extra_cppflags=
9602
9603 for cf_add_cflags in $cf_add_cflags
9604 do
9605 case "$cf_fix_cppflags" in
9606 (no)
9607         case "$cf_add_cflags" in
9608         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9609                 case "$cf_add_cflags" in
9610                 (-D*)
9611                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9612
9613                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9614                                 && test -z "${cf_tst_cflags}" \
9615                                 && cf_fix_cppflags=yes
9616
9617                         if test "$cf_fix_cppflags" = yes ; then
9618
9619         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9620         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9621
9622                                 continue
9623                         elif test "${cf_tst_cflags}" = "\"'" ; then
9624
9625         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9626         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9627
9628                                 continue
9629                         fi
9630                         ;;
9631                 esac
9632                 case "$CPPFLAGS" in
9633                 (*$cf_add_cflags)
9634                         ;;
9635                 (*)
9636                         case "$cf_add_cflags" in
9637                         (-D*)
9638                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9639
9640 CPPFLAGS=`echo "$CPPFLAGS" | \
9641         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9642                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9643
9644                                 ;;
9645                         esac
9646
9647         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9648         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9649
9650                         ;;
9651                 esac
9652                 ;;
9653         (*)
9654
9655         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9656         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9657
9658                 ;;
9659         esac
9660         ;;
9661 (yes)
9662
9663         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9664         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9665
9666         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9667
9668         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9669                 && test -z "${cf_tst_cflags}" \
9670                 && cf_fix_cppflags=no
9671         ;;
9672 esac
9673 done
9674
9675 if test -n "$cf_new_cflags" ; then
9676
9677         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9678         CFLAGS="${CFLAGS}$cf_new_cflags"
9679
9680 fi
9681
9682 if test -n "$cf_new_cppflags" ; then
9683
9684         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9685         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9686
9687 fi
9688
9689 if test -n "$cf_new_extra_cppflags" ; then
9690
9691         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9692         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9693
9694 fi
9695
9696 done
9697
9698 cf_add_libs="$LIBS"
9699 # reverse order
9700 cf_add_0lib=
9701 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9702 # filter duplicates
9703 for cf_add_1lib in $cf_add_0lib; do
9704         for cf_add_2lib in $cf_add_libs; do
9705                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9706                         cf_add_1lib=
9707                         break
9708                 fi
9709         done
9710         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9711 done
9712 LIBS="$cf_add_libs"
9713
9714                 cat >"conftest.$ac_ext" <<_ACEOF
9715 #line 9715 "configure"
9716 #include "confdefs.h"
9717 #include <${cf_cv_ncurses_header:-curses.h}>
9718 int
9719 main (void)
9720 {
9721 initscr(); mousemask(0,0); tigetstr((char *)0);
9722   ;
9723   return 0;
9724 }
9725 _ACEOF
9726 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9727 if { (eval echo "$as_me:9727: \"$ac_link\"") >&5
9728   (eval $ac_link) 2>&5
9729   ac_status=$?
9730   echo "$as_me:9730: \$? = $ac_status" >&5
9731   (exit "$ac_status"); } &&
9732          { ac_try='test -s "conftest$ac_exeext"'
9733   { (eval echo "$as_me:9733: \"$ac_try\"") >&5
9734   (eval $ac_try) 2>&5
9735   ac_status=$?
9736   echo "$as_me:9736: \$? = $ac_status" >&5
9737   (exit "$ac_status"); }; }; then
9738   if test "$cross_compiling" = yes; then
9739   cf_have_ncuconfig=maybe
9740 else
9741   cat >"conftest.$ac_ext" <<_ACEOF
9742 #line 9742 "configure"
9743 #include "confdefs.h"
9744 #include <${cf_cv_ncurses_header:-curses.h}>
9745                                 int main(void)
9746                                 { const char *xx = curses_version(); return (xx == 0); }
9747 _ACEOF
9748 rm -f "conftest$ac_exeext"
9749 if { (eval echo "$as_me:9749: \"$ac_link\"") >&5
9750   (eval $ac_link) 2>&5
9751   ac_status=$?
9752   echo "$as_me:9752: \$? = $ac_status" >&5
9753   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9754   { (eval echo "$as_me:9754: \"$ac_try\"") >&5
9755   (eval $ac_try) 2>&5
9756   ac_status=$?
9757   echo "$as_me:9757: \$? = $ac_status" >&5
9758   (exit "$ac_status"); }; }; then
9759   cf_have_ncuconfig=yes
9760 else
9761   echo "$as_me: program exited with status $ac_status" >&5
9762 echo "$as_me: failed program was:" >&5
9763 cat "conftest.$ac_ext" >&5
9764 cf_have_ncuconfig=no
9765 fi
9766 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9767 fi
9768 else
9769   echo "$as_me: failed program was:" >&5
9770 cat "conftest.$ac_ext" >&5
9771 cf_have_ncuconfig=no
9772 fi
9773 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9774                 echo "$as_me:9774: result: $cf_have_ncuconfig" >&5
9775 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9776                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9777                 if test "$cf_have_ncuconfig" != "yes"
9778                 then
9779                         CPPFLAGS="$cf_save_CPPFLAGS"
9780                         LIBS="$cf_save_LIBS"
9781                         NCURSES_CONFIG_PKG=none
9782                 else
9783
9784 cat >>confdefs.h <<\EOF
9785 #define NCURSES 1
9786 EOF
9787
9788                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9789
9790 echo "$as_me:9790: checking for terminfo header" >&5
9791 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9792 if test "${cf_cv_term_header+set}" = set; then
9793   echo $ECHO_N "(cached) $ECHO_C" >&6
9794 else
9795
9796 case "${cf_cv_ncurses_header}" in
9797 (*/ncurses.h|*/ncursesw.h)
9798         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9799         ;;
9800 (*)
9801         cf_term_header=term.h
9802         ;;
9803 esac
9804
9805 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9806 do
9807 cat >"conftest.$ac_ext" <<_ACEOF
9808 #line 9808 "configure"
9809 #include "confdefs.h"
9810 #include <stdio.h>
9811 #include <${cf_cv_ncurses_header:-curses.h}>
9812 #include <$cf_test>
9813
9814 int
9815 main (void)
9816 {
9817 int x = auto_left_margin; (void)x
9818   ;
9819   return 0;
9820 }
9821 _ACEOF
9822 rm -f "conftest.$ac_objext"
9823 if { (eval echo "$as_me:9823: \"$ac_compile\"") >&5
9824   (eval $ac_compile) 2>&5
9825   ac_status=$?
9826   echo "$as_me:9826: \$? = $ac_status" >&5
9827   (exit "$ac_status"); } &&
9828          { ac_try='test -s "conftest.$ac_objext"'
9829   { (eval echo "$as_me:9829: \"$ac_try\"") >&5
9830   (eval $ac_try) 2>&5
9831   ac_status=$?
9832   echo "$as_me:9832: \$? = $ac_status" >&5
9833   (exit "$ac_status"); }; }; then
9834
9835         cf_cv_term_header="$cf_test"
9836 else
9837   echo "$as_me: failed program was:" >&5
9838 cat "conftest.$ac_ext" >&5
9839
9840         cf_cv_term_header=unknown
9841
9842 fi
9843 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9844         test "$cf_cv_term_header" != unknown && break
9845 done
9846
9847 fi
9848 echo "$as_me:9848: result: $cf_cv_term_header" >&5
9849 echo "${ECHO_T}$cf_cv_term_header" >&6
9850
9851 # Set definitions to allow ifdef'ing to accommodate subdirectories
9852
9853 case "$cf_cv_term_header" in
9854 (*term.h)
9855
9856 cat >>confdefs.h <<\EOF
9857 #define HAVE_TERM_H 1
9858 EOF
9859
9860         ;;
9861 esac
9862
9863 case "$cf_cv_term_header" in
9864 (ncurses/term.h)
9865
9866 cat >>confdefs.h <<\EOF
9867 #define HAVE_NCURSES_TERM_H 1
9868 EOF
9869
9870         ;;
9871 (ncursesw/term.h)
9872
9873 cat >>confdefs.h <<\EOF
9874 #define HAVE_NCURSESW_TERM_H 1
9875 EOF
9876
9877         ;;
9878 esac
9879
9880                 fi
9881
9882         else
9883                 echo "$as_me:9883: result: no" >&5
9884 echo "${ECHO_T}no" >&6
9885                 NCURSES_CONFIG_PKG=none
9886         fi
9887 else
9888         NCURSES_CONFIG_PKG=none
9889 fi
9890
9891 if test "x$cf_have_ncuconfig" = "xno"; then
9892         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9893
9894 if test -n "$ac_tool_prefix"; then
9895   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9896   do
9897     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9898 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9899 echo "$as_me:9899: checking for $ac_word" >&5
9900 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9901 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9902   echo $ECHO_N "(cached) $ECHO_C" >&6
9903 else
9904   if test -n "$NCURSES_CONFIG"; then
9905   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9906 else
9907   ac_save_IFS=$IFS; IFS=$ac_path_separator
9908 ac_dummy="$PATH"
9909 for ac_dir in $ac_dummy; do
9910   IFS=$ac_save_IFS
9911   test -z "$ac_dir" && ac_dir=.
9912   $as_executable_p "$ac_dir/$ac_word" || continue
9913 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9914 echo "$as_me:9914: found $ac_dir/$ac_word" >&5
9915 break
9916 done
9917
9918 fi
9919 fi
9920 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9921 if test -n "$NCURSES_CONFIG"; then
9922   echo "$as_me:9922: result: $NCURSES_CONFIG" >&5
9923 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9924 else
9925   echo "$as_me:9925: result: no" >&5
9926 echo "${ECHO_T}no" >&6
9927 fi
9928
9929     test -n "$NCURSES_CONFIG" && break
9930   done
9931 fi
9932 if test -z "$NCURSES_CONFIG"; then
9933   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9934   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9935 do
9936   # Extract the first word of "$ac_prog", so it can be a program name with args.
9937 set dummy $ac_prog; ac_word=$2
9938 echo "$as_me:9938: checking for $ac_word" >&5
9939 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9940 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9941   echo $ECHO_N "(cached) $ECHO_C" >&6
9942 else
9943   if test -n "$ac_ct_NCURSES_CONFIG"; then
9944   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9945 else
9946   ac_save_IFS=$IFS; IFS=$ac_path_separator
9947 ac_dummy="$PATH"
9948 for ac_dir in $ac_dummy; do
9949   IFS=$ac_save_IFS
9950   test -z "$ac_dir" && ac_dir=.
9951   $as_executable_p "$ac_dir/$ac_word" || continue
9952 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9953 echo "$as_me:9953: found $ac_dir/$ac_word" >&5
9954 break
9955 done
9956
9957 fi
9958 fi
9959 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9960 if test -n "$ac_ct_NCURSES_CONFIG"; then
9961   echo "$as_me:9961: result: $ac_ct_NCURSES_CONFIG" >&5
9962 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9963 else
9964   echo "$as_me:9964: result: no" >&5
9965 echo "${ECHO_T}no" >&6
9966 fi
9967
9968   test -n "$ac_ct_NCURSES_CONFIG" && break
9969 done
9970 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9971
9972   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9973 fi
9974
9975         if test "$NCURSES_CONFIG" != none ; then
9976
9977 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9978 do
9979         case "x$cf_add_cflags" in
9980         (x-[DU]*)
9981
9982 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9983 while true
9984 do
9985         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9986         test "$CFLAGS" != "$cf_old_cflag" || break
9987
9988         CFLAGS="$cf_old_cflag"
9989 done
9990
9991 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9992 while true
9993 do
9994         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9995         test "$CPPFLAGS" != "$cf_old_cflag" || break
9996
9997         CPPFLAGS="$cf_old_cflag"
9998 done
9999
10000                 ;;
10001         esac
10002
10003 cf_fix_cppflags=no
10004 cf_new_cflags=
10005 cf_new_cppflags=
10006 cf_new_extra_cppflags=
10007
10008 for cf_add_cflags in $cf_add_cflags
10009 do
10010 case "$cf_fix_cppflags" in
10011 (no)
10012         case "$cf_add_cflags" in
10013         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10014                 case "$cf_add_cflags" in
10015                 (-D*)
10016                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10017
10018                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10019                                 && test -z "${cf_tst_cflags}" \
10020                                 && cf_fix_cppflags=yes
10021
10022                         if test "$cf_fix_cppflags" = yes ; then
10023
10024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10026
10027                                 continue
10028                         elif test "${cf_tst_cflags}" = "\"'" ; then
10029
10030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10032
10033                                 continue
10034                         fi
10035                         ;;
10036                 esac
10037                 case "$CPPFLAGS" in
10038                 (*$cf_add_cflags)
10039                         ;;
10040                 (*)
10041                         case "$cf_add_cflags" in
10042                         (-D*)
10043                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10044
10045 CPPFLAGS=`echo "$CPPFLAGS" | \
10046         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10047                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10048
10049                                 ;;
10050                         esac
10051
10052         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10053         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10054
10055                         ;;
10056                 esac
10057                 ;;
10058         (*)
10059
10060         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10061         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10062
10063                 ;;
10064         esac
10065         ;;
10066 (yes)
10067
10068         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10069         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10070
10071         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10072
10073         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10074                 && test -z "${cf_tst_cflags}" \
10075                 && cf_fix_cppflags=no
10076         ;;
10077 esac
10078 done
10079
10080 if test -n "$cf_new_cflags" ; then
10081
10082         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10083         CFLAGS="${CFLAGS}$cf_new_cflags"
10084
10085 fi
10086
10087 if test -n "$cf_new_cppflags" ; then
10088
10089         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10090         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10091
10092 fi
10093
10094 if test -n "$cf_new_extra_cppflags" ; then
10095
10096         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10097         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10098
10099 fi
10100
10101 done
10102
10103 cf_add_libs="$LIBS"
10104 # reverse order
10105 cf_add_0lib=
10106 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10107 # filter duplicates
10108 for cf_add_1lib in $cf_add_0lib; do
10109         for cf_add_2lib in $cf_add_libs; do
10110                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10111                         cf_add_1lib=
10112                         break
10113                 fi
10114         done
10115         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10116 done
10117 LIBS="$cf_add_libs"
10118
10119                 # even with config script, some packages use no-override for curses.h
10120
10121 echo "$as_me:10121: checking if we have identified curses headers" >&5
10122 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10123 if test "${cf_cv_ncurses_header+set}" = set; then
10124   echo $ECHO_N "(cached) $ECHO_C" >&6
10125 else
10126
10127 cf_cv_ncurses_header=none
10128 for cf_header in \
10129         ncurses.h ncurses/ncurses.h \
10130         curses.h ncurses/curses.h
10131 do
10132 cat >"conftest.$ac_ext" <<_ACEOF
10133 #line 10133 "configure"
10134 #include "confdefs.h"
10135 #include <${cf_header}>
10136 int
10137 main (void)
10138 {
10139 initscr(); tgoto("?", 0,0)
10140   ;
10141   return 0;
10142 }
10143 _ACEOF
10144 rm -f "conftest.$ac_objext"
10145 if { (eval echo "$as_me:10145: \"$ac_compile\"") >&5
10146   (eval $ac_compile) 2>&5
10147   ac_status=$?
10148   echo "$as_me:10148: \$? = $ac_status" >&5
10149   (exit "$ac_status"); } &&
10150          { ac_try='test -s "conftest.$ac_objext"'
10151   { (eval echo "$as_me:10151: \"$ac_try\"") >&5
10152   (eval $ac_try) 2>&5
10153   ac_status=$?
10154   echo "$as_me:10154: \$? = $ac_status" >&5
10155   (exit "$ac_status"); }; }; then
10156   cf_cv_ncurses_header=$cf_header; break
10157 else
10158   echo "$as_me: failed program was:" >&5
10159 cat "conftest.$ac_ext" >&5
10160 fi
10161 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10162 done
10163
10164 fi
10165 echo "$as_me:10165: result: $cf_cv_ncurses_header" >&5
10166 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10167
10168 if test "$cf_cv_ncurses_header" = none ; then
10169         { { echo "$as_me:10169: error: No curses header-files found" >&5
10170 echo "$as_me: error: No curses header-files found" >&2;}
10171    { (exit 1); exit 1; }; }
10172 fi
10173
10174 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10175
10176 for ac_header in $cf_cv_ncurses_header
10177 do
10178 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10179 echo "$as_me:10179: checking for $ac_header" >&5
10180 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10181 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10182   echo $ECHO_N "(cached) $ECHO_C" >&6
10183 else
10184   cat >"conftest.$ac_ext" <<_ACEOF
10185 #line 10185 "configure"
10186 #include "confdefs.h"
10187 #include <$ac_header>
10188 _ACEOF
10189 if { (eval echo "$as_me:10189: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10190   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10191   ac_status=$?
10192   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10193   rm -f conftest.er1
10194   cat conftest.err >&5
10195   echo "$as_me:10195: \$? = $ac_status" >&5
10196   (exit "$ac_status"); } >/dev/null; then
10197   if test -s conftest.err; then
10198     ac_cpp_err=$ac_c_preproc_warn_flag
10199   else
10200     ac_cpp_err=
10201   fi
10202 else
10203   ac_cpp_err=yes
10204 fi
10205 if test -z "$ac_cpp_err"; then
10206   eval "$as_ac_Header=yes"
10207 else
10208   echo "$as_me: failed program was:" >&5
10209   cat "conftest.$ac_ext" >&5
10210   eval "$as_ac_Header=no"
10211 fi
10212 rm -f conftest.err "conftest.$ac_ext"
10213 fi
10214 echo "$as_me:10214: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10215 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10216 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10217   cat >>confdefs.h <<EOF
10218 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10219 EOF
10220
10221 fi
10222 done
10223
10224 cat >>confdefs.h <<\EOF
10225 #define NCURSES 1
10226 EOF
10227
10228 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10229
10230                 cat >>confdefs.h <<EOF
10231 #define $cf_nculib_ROOT 1
10232 EOF
10233
10234                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10235
10236         else
10237
10238 cf_ncuhdr_root=ncurses
10239
10240 test -n "$cf_cv_curses_dir" && \
10241 test "$cf_cv_curses_dir" != "no" && { \
10242
10243 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10244   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10245   do
10246         while test "$cf_add_incdir" != /usr/include
10247         do
10248           if test -d "$cf_add_incdir"
10249           then
10250                 cf_have_incdir=no
10251                 if test -n "$CFLAGS$CPPFLAGS" ; then
10252                   # a loop is needed to ensure we can add subdirs of existing dirs
10253                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10254                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10255                           cf_have_incdir=yes; break
10256                         fi
10257                   done
10258                 fi
10259
10260                 if test "$cf_have_incdir" = no ; then
10261                   if test "$cf_add_incdir" = /usr/local/include ; then
10262                         if test "$GCC" = yes
10263                         then
10264                           cf_save_CPPFLAGS=$CPPFLAGS
10265
10266         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10267         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10268
10269                           cat >"conftest.$ac_ext" <<_ACEOF
10270 #line 10270 "configure"
10271 #include "confdefs.h"
10272 #include <stdio.h>
10273 int
10274 main (void)
10275 {
10276 printf("Hello")
10277   ;
10278   return 0;
10279 }
10280 _ACEOF
10281 rm -f "conftest.$ac_objext"
10282 if { (eval echo "$as_me:10282: \"$ac_compile\"") >&5
10283   (eval $ac_compile) 2>&5
10284   ac_status=$?
10285   echo "$as_me:10285: \$? = $ac_status" >&5
10286   (exit "$ac_status"); } &&
10287          { ac_try='test -s "conftest.$ac_objext"'
10288   { (eval echo "$as_me:10288: \"$ac_try\"") >&5
10289   (eval $ac_try) 2>&5
10290   ac_status=$?
10291   echo "$as_me:10291: \$? = $ac_status" >&5
10292   (exit "$ac_status"); }; }; then
10293   :
10294 else
10295   echo "$as_me: failed program was:" >&5
10296 cat "conftest.$ac_ext" >&5
10297 cf_have_incdir=yes
10298 fi
10299 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10300                           CPPFLAGS=$cf_save_CPPFLAGS
10301                         fi
10302                   fi
10303                 fi
10304
10305                 if test "$cf_have_incdir" = no ; then
10306                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10307
10308 echo "${as_me:-configure}:10308: testing adding $cf_add_incdir to include-path ..." 1>&5
10309
10310                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10311
10312                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10313                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10314                   cf_add_incdir="$cf_top_incdir"
10315                 else
10316                   break
10317                 fi
10318           else
10319                 break
10320           fi
10321         done
10322   done
10323 fi
10324
10325 }
10326
10327 echo "$as_me:10327: checking for $cf_ncuhdr_root header in include-path" >&5
10328 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10329 if test "${cf_cv_ncurses_h+set}" = set; then
10330   echo $ECHO_N "(cached) $ECHO_C" >&6
10331 else
10332
10333         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10334         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10335         for cf_header in $cf_header_list
10336         do
10337
10338         cat >"conftest.$ac_ext" <<_ACEOF
10339 #line 10339 "configure"
10340 #include "confdefs.h"
10341
10342 #include <$cf_header>
10343 int
10344 main (void)
10345 {
10346
10347 #ifdef NCURSES_VERSION
10348
10349 printf("%s\\n", NCURSES_VERSION);
10350 #else
10351 #ifdef __NCURSES_H
10352 printf("old\\n");
10353 #else
10354         make an error
10355 #endif
10356 #endif
10357
10358   ;
10359   return 0;
10360 }
10361 _ACEOF
10362 rm -f "conftest.$ac_objext"
10363 if { (eval echo "$as_me:10363: \"$ac_compile\"") >&5
10364   (eval $ac_compile) 2>&5
10365   ac_status=$?
10366   echo "$as_me:10366: \$? = $ac_status" >&5
10367   (exit "$ac_status"); } &&
10368          { ac_try='test -s "conftest.$ac_objext"'
10369   { (eval echo "$as_me:10369: \"$ac_try\"") >&5
10370   (eval $ac_try) 2>&5
10371   ac_status=$?
10372   echo "$as_me:10372: \$? = $ac_status" >&5
10373   (exit "$ac_status"); }; }; then
10374   cf_cv_ncurses_h=$cf_header
10375
10376 else
10377   echo "$as_me: failed program was:" >&5
10378 cat "conftest.$ac_ext" >&5
10379 cf_cv_ncurses_h=no
10380 fi
10381 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10382
10383                 test "$cf_cv_ncurses_h" != no && break
10384         done
10385
10386 fi
10387 echo "$as_me:10387: result: $cf_cv_ncurses_h" >&5
10388 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10389
10390 if test "$cf_cv_ncurses_h" != no ; then
10391         cf_cv_ncurses_header=$cf_cv_ncurses_h
10392 else
10393
10394 echo "$as_me:10394: checking for $cf_ncuhdr_root include-path" >&5
10395 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10396 if test "${cf_cv_ncurses_h2+set}" = set; then
10397   echo $ECHO_N "(cached) $ECHO_C" >&6
10398 else
10399
10400         test -n "$verbose" && echo
10401
10402 cf_search=
10403
10404 # collect the current set of include-directories from compiler flags
10405 cf_header_path_list=""
10406 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10407         for cf_header_path in $CPPFLAGS $CFLAGS
10408         do
10409                 case "$cf_header_path" in
10410                 (-I*)
10411                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10412
10413 test "x$cf_header_path" != "xNONE" && \
10414 test -d "$cf_header_path" && \
10415  {
10416         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10417         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10418         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10419         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10420         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10421         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"
10422 }
10423
10424                         cf_header_path_list="$cf_header_path_list $cf_search"
10425                         ;;
10426                 esac
10427         done
10428 fi
10429
10430 # add the variations for the package we are looking for
10431
10432 cf_search=
10433
10434 test "x$prefix" != "xNONE" && \
10435 test -d "$prefix" && \
10436  {
10437         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10438         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10439         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10440         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10441         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10442         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10443 }
10444
10445 for cf_subdir_prefix in \
10446         /usr \
10447         /usr/local \
10448         /usr/pkg \
10449         /opt \
10450         /opt/local \
10451         $HOME
10452 do
10453
10454 test "x$cf_subdir_prefix" != "x$prefix" && \
10455 test -d "$cf_subdir_prefix" && \
10456 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10457         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10458         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10459         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10460         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10461         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10462         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"
10463 }
10464
10465 done
10466
10467 test "$includedir" != NONE && \
10468 test "$includedir" != "/usr/include" && \
10469 test -d "$includedir" && {
10470         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10471         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10472 }
10473
10474 test "$oldincludedir" != NONE && \
10475 test "$oldincludedir" != "/usr/include" && \
10476 test -d "$oldincludedir" && {
10477         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10478         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10479 }
10480
10481 cf_search="$cf_search $cf_header_path_list"
10482
10483         test -n "$verbose" && echo "search path $cf_search"
10484         cf_save2_CPPFLAGS="$CPPFLAGS"
10485         for cf_incdir in $cf_search
10486         do
10487
10488 if test -n "$cf_incdir" ; then
10489   for cf_add_incdir in $cf_incdir
10490   do
10491         while test "$cf_add_incdir" != /usr/include
10492         do
10493           if test -d "$cf_add_incdir"
10494           then
10495                 cf_have_incdir=no
10496                 if test -n "$CFLAGS$CPPFLAGS" ; then
10497                   # a loop is needed to ensure we can add subdirs of existing dirs
10498                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10499                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10500                           cf_have_incdir=yes; break
10501                         fi
10502                   done
10503                 fi
10504
10505                 if test "$cf_have_incdir" = no ; then
10506                   if test "$cf_add_incdir" = /usr/local/include ; then
10507                         if test "$GCC" = yes
10508                         then
10509                           cf_save_CPPFLAGS=$CPPFLAGS
10510
10511         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10512         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10513
10514                           cat >"conftest.$ac_ext" <<_ACEOF
10515 #line 10515 "configure"
10516 #include "confdefs.h"
10517 #include <stdio.h>
10518 int
10519 main (void)
10520 {
10521 printf("Hello")
10522   ;
10523   return 0;
10524 }
10525 _ACEOF
10526 rm -f "conftest.$ac_objext"
10527 if { (eval echo "$as_me:10527: \"$ac_compile\"") >&5
10528   (eval $ac_compile) 2>&5
10529   ac_status=$?
10530   echo "$as_me:10530: \$? = $ac_status" >&5
10531   (exit "$ac_status"); } &&
10532          { ac_try='test -s "conftest.$ac_objext"'
10533   { (eval echo "$as_me:10533: \"$ac_try\"") >&5
10534   (eval $ac_try) 2>&5
10535   ac_status=$?
10536   echo "$as_me:10536: \$? = $ac_status" >&5
10537   (exit "$ac_status"); }; }; then
10538   :
10539 else
10540   echo "$as_me: failed program was:" >&5
10541 cat "conftest.$ac_ext" >&5
10542 cf_have_incdir=yes
10543 fi
10544 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10545                           CPPFLAGS=$cf_save_CPPFLAGS
10546                         fi
10547                   fi
10548                 fi
10549
10550                 if test "$cf_have_incdir" = no ; then
10551                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10552
10553 echo "${as_me:-configure}:10553: testing adding $cf_add_incdir to include-path ..." 1>&5
10554
10555                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10556
10557                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10558                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10559                   cf_add_incdir="$cf_top_incdir"
10560                 else
10561                   break
10562                 fi
10563           else
10564                 break
10565           fi
10566         done
10567   done
10568 fi
10569
10570                 for cf_header in \
10571                         ncurses.h \
10572                         curses.h
10573                 do
10574
10575         cat >"conftest.$ac_ext" <<_ACEOF
10576 #line 10576 "configure"
10577 #include "confdefs.h"
10578
10579 #include <$cf_header>
10580 int
10581 main (void)
10582 {
10583
10584 #ifdef NCURSES_VERSION
10585
10586 printf("%s\\n", NCURSES_VERSION);
10587 #else
10588 #ifdef __NCURSES_H
10589 printf("old\\n");
10590 #else
10591         make an error
10592 #endif
10593 #endif
10594
10595   ;
10596   return 0;
10597 }
10598 _ACEOF
10599 rm -f "conftest.$ac_objext"
10600 if { (eval echo "$as_me:10600: \"$ac_compile\"") >&5
10601   (eval $ac_compile) 2>&5
10602   ac_status=$?
10603   echo "$as_me:10603: \$? = $ac_status" >&5
10604   (exit "$ac_status"); } &&
10605          { ac_try='test -s "conftest.$ac_objext"'
10606   { (eval echo "$as_me:10606: \"$ac_try\"") >&5
10607   (eval $ac_try) 2>&5
10608   ac_status=$?
10609   echo "$as_me:10609: \$? = $ac_status" >&5
10610   (exit "$ac_status"); }; }; then
10611   cf_cv_ncurses_h2=$cf_header
10612
10613 else
10614   echo "$as_me: failed program was:" >&5
10615 cat "conftest.$ac_ext" >&5
10616 cf_cv_ncurses_h2=no
10617 fi
10618 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10619
10620                         if test "$cf_cv_ncurses_h2" != no ; then
10621                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10622                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10623                                 break
10624                         fi
10625                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10626                 done
10627                 CPPFLAGS="$cf_save2_CPPFLAGS"
10628                 test "$cf_cv_ncurses_h2" != no && break
10629         done
10630         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10630: error: not found" >&5
10631 echo "$as_me: error: not found" >&2;}
10632    { (exit 1); exit 1; }; }
10633
10634 fi
10635 echo "$as_me:10635: result: $cf_cv_ncurses_h2" >&5
10636 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10637
10638         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10639         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10640         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10641                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10642         fi
10643
10644 if test -n "$cf_1st_incdir" ; then
10645   for cf_add_incdir in $cf_1st_incdir
10646   do
10647         while test "$cf_add_incdir" != /usr/include
10648         do
10649           if test -d "$cf_add_incdir"
10650           then
10651                 cf_have_incdir=no
10652                 if test -n "$CFLAGS$CPPFLAGS" ; then
10653                   # a loop is needed to ensure we can add subdirs of existing dirs
10654                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10655                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10656                           cf_have_incdir=yes; break
10657                         fi
10658                   done
10659                 fi
10660
10661                 if test "$cf_have_incdir" = no ; then
10662                   if test "$cf_add_incdir" = /usr/local/include ; then
10663                         if test "$GCC" = yes
10664                         then
10665                           cf_save_CPPFLAGS=$CPPFLAGS
10666
10667         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10668         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10669
10670                           cat >"conftest.$ac_ext" <<_ACEOF
10671 #line 10671 "configure"
10672 #include "confdefs.h"
10673 #include <stdio.h>
10674 int
10675 main (void)
10676 {
10677 printf("Hello")
10678   ;
10679   return 0;
10680 }
10681 _ACEOF
10682 rm -f "conftest.$ac_objext"
10683 if { (eval echo "$as_me:10683: \"$ac_compile\"") >&5
10684   (eval $ac_compile) 2>&5
10685   ac_status=$?
10686   echo "$as_me:10686: \$? = $ac_status" >&5
10687   (exit "$ac_status"); } &&
10688          { ac_try='test -s "conftest.$ac_objext"'
10689   { (eval echo "$as_me:10689: \"$ac_try\"") >&5
10690   (eval $ac_try) 2>&5
10691   ac_status=$?
10692   echo "$as_me:10692: \$? = $ac_status" >&5
10693   (exit "$ac_status"); }; }; then
10694   :
10695 else
10696   echo "$as_me: failed program was:" >&5
10697 cat "conftest.$ac_ext" >&5
10698 cf_have_incdir=yes
10699 fi
10700 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10701                           CPPFLAGS=$cf_save_CPPFLAGS
10702                         fi
10703                   fi
10704                 fi
10705
10706                 if test "$cf_have_incdir" = no ; then
10707                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10708
10709 echo "${as_me:-configure}:10709: testing adding $cf_add_incdir to include-path ..." 1>&5
10710
10711                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10712
10713                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10714                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10715                   cf_add_incdir="$cf_top_incdir"
10716                 else
10717                   break
10718                 fi
10719           else
10720                 break
10721           fi
10722         done
10723   done
10724 fi
10725
10726 fi
10727
10728 # Set definitions to allow ifdef'ing for ncurses.h
10729
10730 case "$cf_cv_ncurses_header" in
10731 (*ncurses.h)
10732
10733 cat >>confdefs.h <<\EOF
10734 #define HAVE_NCURSES_H 1
10735 EOF
10736
10737         ;;
10738 esac
10739
10740 case "$cf_cv_ncurses_header" in
10741 (ncurses/curses.h|ncurses/ncurses.h)
10742
10743 cat >>confdefs.h <<\EOF
10744 #define HAVE_NCURSES_NCURSES_H 1
10745 EOF
10746
10747         ;;
10748 (ncursesw/curses.h|ncursesw/ncurses.h)
10749
10750 cat >>confdefs.h <<\EOF
10751 #define HAVE_NCURSESW_NCURSES_H 1
10752 EOF
10753
10754         ;;
10755 esac
10756
10757 echo "$as_me:10757: checking for terminfo header" >&5
10758 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10759 if test "${cf_cv_term_header+set}" = set; then
10760   echo $ECHO_N "(cached) $ECHO_C" >&6
10761 else
10762
10763 case "${cf_cv_ncurses_header}" in
10764 (*/ncurses.h|*/ncursesw.h)
10765         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10766         ;;
10767 (*)
10768         cf_term_header=term.h
10769         ;;
10770 esac
10771
10772 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10773 do
10774 cat >"conftest.$ac_ext" <<_ACEOF
10775 #line 10775 "configure"
10776 #include "confdefs.h"
10777 #include <stdio.h>
10778 #include <${cf_cv_ncurses_header:-curses.h}>
10779 #include <$cf_test>
10780
10781 int
10782 main (void)
10783 {
10784 int x = auto_left_margin; (void)x
10785   ;
10786   return 0;
10787 }
10788 _ACEOF
10789 rm -f "conftest.$ac_objext"
10790 if { (eval echo "$as_me:10790: \"$ac_compile\"") >&5
10791   (eval $ac_compile) 2>&5
10792   ac_status=$?
10793   echo "$as_me:10793: \$? = $ac_status" >&5
10794   (exit "$ac_status"); } &&
10795          { ac_try='test -s "conftest.$ac_objext"'
10796   { (eval echo "$as_me:10796: \"$ac_try\"") >&5
10797   (eval $ac_try) 2>&5
10798   ac_status=$?
10799   echo "$as_me:10799: \$? = $ac_status" >&5
10800   (exit "$ac_status"); }; }; then
10801
10802         cf_cv_term_header="$cf_test"
10803 else
10804   echo "$as_me: failed program was:" >&5
10805 cat "conftest.$ac_ext" >&5
10806
10807         cf_cv_term_header=unknown
10808
10809 fi
10810 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10811         test "$cf_cv_term_header" != unknown && break
10812 done
10813
10814 fi
10815 echo "$as_me:10815: result: $cf_cv_term_header" >&5
10816 echo "${ECHO_T}$cf_cv_term_header" >&6
10817
10818 # Set definitions to allow ifdef'ing to accommodate subdirectories
10819
10820 case "$cf_cv_term_header" in
10821 (*term.h)
10822
10823 cat >>confdefs.h <<\EOF
10824 #define HAVE_TERM_H 1
10825 EOF
10826
10827         ;;
10828 esac
10829
10830 case "$cf_cv_term_header" in
10831 (ncurses/term.h)
10832
10833 cat >>confdefs.h <<\EOF
10834 #define HAVE_NCURSES_TERM_H 1
10835 EOF
10836
10837         ;;
10838 (ncursesw/term.h)
10839
10840 cat >>confdefs.h <<\EOF
10841 #define HAVE_NCURSESW_TERM_H 1
10842 EOF
10843
10844         ;;
10845 esac
10846
10847 # some applications need this, but should check for NCURSES_VERSION
10848
10849 cat >>confdefs.h <<\EOF
10850 #define NCURSES 1
10851 EOF
10852
10853 echo "$as_me:10853: checking for ncurses version" >&5
10854 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10855 if test "${cf_cv_ncurses_version+set}" = set; then
10856   echo $ECHO_N "(cached) $ECHO_C" >&6
10857 else
10858
10859         cf_cv_ncurses_version=no
10860         cf_tempfile=out$$
10861         rm -f "$cf_tempfile"
10862         if test "$cross_compiling" = yes; then
10863
10864         # This will not work if the preprocessor splits the line after the
10865         # Autoconf token.  The 'unproto' program does that.
10866         cat > "conftest.$ac_ext" <<EOF
10867 #include <${cf_cv_ncurses_header:-curses.h}>
10868 #undef Autoconf
10869 #ifdef NCURSES_VERSION
10870 Autoconf NCURSES_VERSION
10871 #else
10872 #ifdef __NCURSES_H
10873 Autoconf "old"
10874 #endif
10875 ;
10876 #endif
10877 EOF
10878         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10879         { (eval echo "$as_me:10879: \"$cf_try\"") >&5
10880   (eval $cf_try) 2>&5
10881   ac_status=$?
10882   echo "$as_me:10882: \$? = $ac_status" >&5
10883   (exit "$ac_status"); }
10884         if test -f conftest.out ; then
10885                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10886                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10887                 rm -f conftest.out
10888         fi
10889
10890 else
10891   cat >"conftest.$ac_ext" <<_ACEOF
10892 #line 10892 "configure"
10893 #include "confdefs.h"
10894
10895 #include <${cf_cv_ncurses_header:-curses.h}>
10896 #include <stdio.h>
10897 int main(void)
10898 {
10899         FILE *fp = fopen("$cf_tempfile", "w");
10900 #ifdef NCURSES_VERSION
10901 # ifdef NCURSES_VERSION_PATCH
10902         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10903 # else
10904         fprintf(fp, "%s\\n", NCURSES_VERSION);
10905 # endif
10906 #else
10907 # ifdef __NCURSES_H
10908         fprintf(fp, "old\\n");
10909 # else
10910         make an error
10911 # endif
10912 #endif
10913         ${cf_cv_main_return:-return}(0);
10914 }
10915 _ACEOF
10916 rm -f "conftest$ac_exeext"
10917 if { (eval echo "$as_me:10917: \"$ac_link\"") >&5
10918   (eval $ac_link) 2>&5
10919   ac_status=$?
10920   echo "$as_me:10920: \$? = $ac_status" >&5
10921   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10922   { (eval echo "$as_me:10922: \"$ac_try\"") >&5
10923   (eval $ac_try) 2>&5
10924   ac_status=$?
10925   echo "$as_me:10925: \$? = $ac_status" >&5
10926   (exit "$ac_status"); }; }; then
10927
10928         cf_cv_ncurses_version=`cat $cf_tempfile`
10929 else
10930   echo "$as_me: program exited with status $ac_status" >&5
10931 echo "$as_me: failed program was:" >&5
10932 cat "conftest.$ac_ext" >&5
10933 fi
10934 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10935 fi
10936         rm -f "$cf_tempfile"
10937
10938 fi
10939 echo "$as_me:10939: result: $cf_cv_ncurses_version" >&5
10940 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10941 test "$cf_cv_ncurses_version" = no ||
10942 cat >>confdefs.h <<\EOF
10943 #define NCURSES 1
10944 EOF
10945
10946 cf_nculib_root=ncurses
10947         # This works, except for the special case where we find gpm, but
10948         # ncurses is in a nonstandard location via $LIBS, and we really want
10949         # to link gpm.
10950 cf_ncurses_LIBS=""
10951 cf_ncurses_SAVE="$LIBS"
10952 echo "$as_me:10952: checking for Gpm_Open in -lgpm" >&5
10953 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10954 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10955   echo $ECHO_N "(cached) $ECHO_C" >&6
10956 else
10957   ac_check_lib_save_LIBS=$LIBS
10958 LIBS="-lgpm  $LIBS"
10959 cat >"conftest.$ac_ext" <<_ACEOF
10960 #line 10960 "configure"
10961 #include "confdefs.h"
10962
10963 /* Override any gcc2 internal prototype to avoid an error.  */
10964 #ifdef __cplusplus
10965 extern "C"
10966 #endif
10967 /* We use char because int might match the return type of a gcc2
10968    builtin and then its argument prototype would still apply.  */
10969 char Gpm_Open ();
10970 int
10971 main (void)
10972 {
10973 Gpm_Open ();
10974   ;
10975   return 0;
10976 }
10977 _ACEOF
10978 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10979 if { (eval echo "$as_me:10979: \"$ac_link\"") >&5
10980   (eval $ac_link) 2>&5
10981   ac_status=$?
10982   echo "$as_me:10982: \$? = $ac_status" >&5
10983   (exit "$ac_status"); } &&
10984          { ac_try='test -s "conftest$ac_exeext"'
10985   { (eval echo "$as_me:10985: \"$ac_try\"") >&5
10986   (eval $ac_try) 2>&5
10987   ac_status=$?
10988   echo "$as_me:10988: \$? = $ac_status" >&5
10989   (exit "$ac_status"); }; }; then
10990   ac_cv_lib_gpm_Gpm_Open=yes
10991 else
10992   echo "$as_me: failed program was:" >&5
10993 cat "conftest.$ac_ext" >&5
10994 ac_cv_lib_gpm_Gpm_Open=no
10995 fi
10996 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10997 LIBS=$ac_check_lib_save_LIBS
10998 fi
10999 echo "$as_me:10999: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11000 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11001 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11002   echo "$as_me:11002: checking for initscr in -lgpm" >&5
11003 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11004 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11005   echo $ECHO_N "(cached) $ECHO_C" >&6
11006 else
11007   ac_check_lib_save_LIBS=$LIBS
11008 LIBS="-lgpm  $LIBS"
11009 cat >"conftest.$ac_ext" <<_ACEOF
11010 #line 11010 "configure"
11011 #include "confdefs.h"
11012
11013 /* Override any gcc2 internal prototype to avoid an error.  */
11014 #ifdef __cplusplus
11015 extern "C"
11016 #endif
11017 /* We use char because int might match the return type of a gcc2
11018    builtin and then its argument prototype would still apply.  */
11019 char initscr ();
11020 int
11021 main (void)
11022 {
11023 initscr ();
11024   ;
11025   return 0;
11026 }
11027 _ACEOF
11028 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11029 if { (eval echo "$as_me:11029: \"$ac_link\"") >&5
11030   (eval $ac_link) 2>&5
11031   ac_status=$?
11032   echo "$as_me:11032: \$? = $ac_status" >&5
11033   (exit "$ac_status"); } &&
11034          { ac_try='test -s "conftest$ac_exeext"'
11035   { (eval echo "$as_me:11035: \"$ac_try\"") >&5
11036   (eval $ac_try) 2>&5
11037   ac_status=$?
11038   echo "$as_me:11038: \$? = $ac_status" >&5
11039   (exit "$ac_status"); }; }; then
11040   ac_cv_lib_gpm_initscr=yes
11041 else
11042   echo "$as_me: failed program was:" >&5
11043 cat "conftest.$ac_ext" >&5
11044 ac_cv_lib_gpm_initscr=no
11045 fi
11046 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11047 LIBS=$ac_check_lib_save_LIBS
11048 fi
11049 echo "$as_me:11049: result: $ac_cv_lib_gpm_initscr" >&5
11050 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11051 if test "$ac_cv_lib_gpm_initscr" = yes; then
11052   LIBS="$cf_ncurses_SAVE"
11053 else
11054   cf_ncurses_LIBS="-lgpm"
11055 fi
11056
11057 fi
11058
11059 case "$host_os" in
11060 (freebsd*)
11061         # This is only necessary if you are linking against an obsolete
11062         # version of ncurses (but it should do no harm, since it is static).
11063         if test "$cf_nculib_root" = ncurses ; then
11064                 echo "$as_me:11064: checking for tgoto in -lmytinfo" >&5
11065 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11066 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11067   echo $ECHO_N "(cached) $ECHO_C" >&6
11068 else
11069   ac_check_lib_save_LIBS=$LIBS
11070 LIBS="-lmytinfo  $LIBS"
11071 cat >"conftest.$ac_ext" <<_ACEOF
11072 #line 11072 "configure"
11073 #include "confdefs.h"
11074
11075 /* Override any gcc2 internal prototype to avoid an error.  */
11076 #ifdef __cplusplus
11077 extern "C"
11078 #endif
11079 /* We use char because int might match the return type of a gcc2
11080    builtin and then its argument prototype would still apply.  */
11081 char tgoto ();
11082 int
11083 main (void)
11084 {
11085 tgoto ();
11086   ;
11087   return 0;
11088 }
11089 _ACEOF
11090 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11091 if { (eval echo "$as_me:11091: \"$ac_link\"") >&5
11092   (eval $ac_link) 2>&5
11093   ac_status=$?
11094   echo "$as_me:11094: \$? = $ac_status" >&5
11095   (exit "$ac_status"); } &&
11096          { ac_try='test -s "conftest$ac_exeext"'
11097   { (eval echo "$as_me:11097: \"$ac_try\"") >&5
11098   (eval $ac_try) 2>&5
11099   ac_status=$?
11100   echo "$as_me:11100: \$? = $ac_status" >&5
11101   (exit "$ac_status"); }; }; then
11102   ac_cv_lib_mytinfo_tgoto=yes
11103 else
11104   echo "$as_me: failed program was:" >&5
11105 cat "conftest.$ac_ext" >&5
11106 ac_cv_lib_mytinfo_tgoto=no
11107 fi
11108 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11109 LIBS=$ac_check_lib_save_LIBS
11110 fi
11111 echo "$as_me:11111: result: $ac_cv_lib_mytinfo_tgoto" >&5
11112 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11113 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11114   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11115 fi
11116
11117         fi
11118         ;;
11119 esac
11120
11121 cf_add_libs="$LIBS"
11122 # reverse order
11123 cf_add_0lib=
11124 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11125 # filter duplicates
11126 for cf_add_1lib in $cf_add_0lib; do
11127         for cf_add_2lib in $cf_add_libs; do
11128                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11129                         cf_add_1lib=
11130                         break
11131                 fi
11132         done
11133         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11134 done
11135 LIBS="$cf_add_libs"
11136
11137 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11138 then
11139
11140 cf_add_libs="$LIBS"
11141 # reverse order
11142 cf_add_0lib=
11143 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11144 # filter duplicates
11145 for cf_add_1lib in $cf_add_0lib; do
11146         for cf_add_2lib in $cf_add_libs; do
11147                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11148                         cf_add_1lib=
11149                         break
11150                 fi
11151         done
11152         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11153 done
11154 LIBS="$cf_add_libs"
11155
11156 else
11157
11158         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11159         cf_libdir=""
11160         echo "$as_me:11160: checking for initscr" >&5
11161 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11162 if test "${ac_cv_func_initscr+set}" = set; then
11163   echo $ECHO_N "(cached) $ECHO_C" >&6
11164 else
11165   cat >"conftest.$ac_ext" <<_ACEOF
11166 #line 11166 "configure"
11167 #include "confdefs.h"
11168 #define initscr autoconf_temporary
11169 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11170 #undef initscr
11171
11172 #ifdef __cplusplus
11173 extern "C"
11174 #endif
11175
11176 /* We use char because int might match the return type of a gcc2
11177    builtin and then its argument prototype would still apply.  */
11178 char initscr (void);
11179
11180 int
11181 main (void)
11182 {
11183
11184 /* The GNU C library defines stubs for functions which it implements
11185     to always fail with ENOSYS.  Some functions are actually named
11186     something starting with __ and the normal name is an alias.  */
11187 #if defined (__stub_initscr) || defined (__stub___initscr)
11188 #error found stub for initscr
11189 #endif
11190
11191         return initscr ();
11192   ;
11193   return 0;
11194 }
11195 _ACEOF
11196 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11197 if { (eval echo "$as_me:11197: \"$ac_link\"") >&5
11198   (eval $ac_link) 2>&5
11199   ac_status=$?
11200   echo "$as_me:11200: \$? = $ac_status" >&5
11201   (exit "$ac_status"); } &&
11202          { ac_try='test -s "conftest$ac_exeext"'
11203   { (eval echo "$as_me:11203: \"$ac_try\"") >&5
11204   (eval $ac_try) 2>&5
11205   ac_status=$?
11206   echo "$as_me:11206: \$? = $ac_status" >&5
11207   (exit "$ac_status"); }; }; then
11208   ac_cv_func_initscr=yes
11209 else
11210   echo "$as_me: failed program was:" >&5
11211 cat "conftest.$ac_ext" >&5
11212 ac_cv_func_initscr=no
11213 fi
11214 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11215 fi
11216 echo "$as_me:11216: result: $ac_cv_func_initscr" >&5
11217 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11218 if test "$ac_cv_func_initscr" = yes; then
11219   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11220 else
11221
11222                 cf_save_LIBS="$LIBS"
11223                 echo "$as_me:11223: checking for initscr in -l$cf_nculib_root" >&5
11224 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11225                 LIBS="-l$cf_nculib_root $LIBS"
11226                 cat >"conftest.$ac_ext" <<_ACEOF
11227 #line 11227 "configure"
11228 #include "confdefs.h"
11229 #include <${cf_cv_ncurses_header:-curses.h}>
11230 int
11231 main (void)
11232 {
11233 initscr()
11234   ;
11235   return 0;
11236 }
11237 _ACEOF
11238 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11239 if { (eval echo "$as_me:11239: \"$ac_link\"") >&5
11240   (eval $ac_link) 2>&5
11241   ac_status=$?
11242   echo "$as_me:11242: \$? = $ac_status" >&5
11243   (exit "$ac_status"); } &&
11244          { ac_try='test -s "conftest$ac_exeext"'
11245   { (eval echo "$as_me:11245: \"$ac_try\"") >&5
11246   (eval $ac_try) 2>&5
11247   ac_status=$?
11248   echo "$as_me:11248: \$? = $ac_status" >&5
11249   (exit "$ac_status"); }; }; then
11250   echo "$as_me:11250: result: yes" >&5
11251 echo "${ECHO_T}yes" >&6
11252                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11253
11254 else
11255   echo "$as_me: failed program was:" >&5
11256 cat "conftest.$ac_ext" >&5
11257 echo "$as_me:11257: result: no" >&5
11258 echo "${ECHO_T}no" >&6
11259
11260 cf_search=
11261 cf_library_path_list=""
11262 if test -n "${LDFLAGS}${LIBS}" ; then
11263         for cf_library_path in $LDFLAGS $LIBS
11264         do
11265                 case "$cf_library_path" in
11266                 (-L*)
11267                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11268
11269 test "x$cf_library_path" != "xNONE" && \
11270 test -d "$cf_library_path" && \
11271  {
11272         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11273         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11274         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11275         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11276         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11277         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"
11278 }
11279
11280                         cf_library_path_list="$cf_library_path_list $cf_search"
11281                         ;;
11282                 esac
11283         done
11284 fi
11285
11286 cf_search=
11287
11288 test "x$prefix" != "xNONE" && \
11289 test -d "$prefix" && \
11290  {
11291         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11292         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11293         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11294         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11295         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11296         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11297 }
11298
11299 for cf_subdir_prefix in \
11300         /usr \
11301         /usr/local \
11302         /usr/pkg \
11303         /opt \
11304         /opt/local \
11305         $HOME
11306 do
11307
11308 test "x$cf_subdir_prefix" != "x$prefix" && \
11309 test -d "$cf_subdir_prefix" && \
11310 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11311         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11312         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11313         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11314         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11315         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11316         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"
11317 }
11318
11319 done
11320
11321 cf_search="$cf_library_path_list $cf_search"
11322
11323                         for cf_libdir in $cf_search
11324                         do
11325                                 echo "$as_me:11325: checking for -l$cf_nculib_root in $cf_libdir" >&5
11326 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11327                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11328                                 cat >"conftest.$ac_ext" <<_ACEOF
11329 #line 11329 "configure"
11330 #include "confdefs.h"
11331 #include <${cf_cv_ncurses_header:-curses.h}>
11332 int
11333 main (void)
11334 {
11335 initscr()
11336   ;
11337   return 0;
11338 }
11339 _ACEOF
11340 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11341 if { (eval echo "$as_me:11341: \"$ac_link\"") >&5
11342   (eval $ac_link) 2>&5
11343   ac_status=$?
11344   echo "$as_me:11344: \$? = $ac_status" >&5
11345   (exit "$ac_status"); } &&
11346          { ac_try='test -s "conftest$ac_exeext"'
11347   { (eval echo "$as_me:11347: \"$ac_try\"") >&5
11348   (eval $ac_try) 2>&5
11349   ac_status=$?
11350   echo "$as_me:11350: \$? = $ac_status" >&5
11351   (exit "$ac_status"); }; }; then
11352   echo "$as_me:11352: result: yes" >&5
11353 echo "${ECHO_T}yes" >&6
11354                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11355                                          break
11356 else
11357   echo "$as_me: failed program was:" >&5
11358 cat "conftest.$ac_ext" >&5
11359 echo "$as_me:11359: result: no" >&5
11360 echo "${ECHO_T}no" >&6
11361                                          LIBS="$cf_save_LIBS"
11362 fi
11363 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11364                         done
11365
11366 fi
11367 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11368
11369 fi
11370
11371 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11372
11373 if test "$cf_found_library" = no ; then
11374         { { echo "$as_me:11374: error: Cannot link $cf_nculib_root library" >&5
11375 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11376    { (exit 1); exit 1; }; }
11377 fi
11378
11379 fi
11380
11381 if test -n "$cf_ncurses_LIBS" ; then
11382         echo "$as_me:11382: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11383 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11384         cf_ncurses_SAVE="$LIBS"
11385         for p in $cf_ncurses_LIBS ; do
11386                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11387                 if test "$q" != "$LIBS" ; then
11388                         LIBS="$q"
11389                 fi
11390         done
11391         cat >"conftest.$ac_ext" <<_ACEOF
11392 #line 11392 "configure"
11393 #include "confdefs.h"
11394 #include <${cf_cv_ncurses_header:-curses.h}>
11395 int
11396 main (void)
11397 {
11398 initscr(); mousemask(0,0); tigetstr((char *)0);
11399   ;
11400   return 0;
11401 }
11402 _ACEOF
11403 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11404 if { (eval echo "$as_me:11404: \"$ac_link\"") >&5
11405   (eval $ac_link) 2>&5
11406   ac_status=$?
11407   echo "$as_me:11407: \$? = $ac_status" >&5
11408   (exit "$ac_status"); } &&
11409          { ac_try='test -s "conftest$ac_exeext"'
11410   { (eval echo "$as_me:11410: \"$ac_try\"") >&5
11411   (eval $ac_try) 2>&5
11412   ac_status=$?
11413   echo "$as_me:11413: \$? = $ac_status" >&5
11414   (exit "$ac_status"); }; }; then
11415   echo "$as_me:11415: result: yes" >&5
11416 echo "${ECHO_T}yes" >&6
11417 else
11418   echo "$as_me: failed program was:" >&5
11419 cat "conftest.$ac_ext" >&5
11420 echo "$as_me:11420: result: no" >&5
11421 echo "${ECHO_T}no" >&6
11422                  LIBS="$cf_ncurses_SAVE"
11423 fi
11424 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11425 fi
11426
11427 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11428
11429 cat >>confdefs.h <<EOF
11430 #define $cf_nculib_ROOT 1
11431 EOF
11432
11433         fi
11434 else
11435         NCURSES_CONFIG=none
11436 fi
11437
11438 fi
11439
11440 if test "$NCURSES_CONFIG_PKG" != none ; then
11441         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11442
11443         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11444         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11445         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11446
11447         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11448         if test -z "$cf_cv_abi_version"
11449         then
11450                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11451         fi
11452
11453 elif test "$NCURSES_CONFIG" != none ; then
11454
11455         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11456
11457         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11458         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11459         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11460
11461         # ABI version is not available from headers
11462         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11463
11464 else
11465
11466         for cf_name in MAJOR MINOR PATCH
11467         do
11468         cat >conftest.$ac_ext <<CF_EOF
11469         #include <${cf_cv_ncurses_header:-curses.h}>
11470         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11471 CF_EOF
11472                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11473                 { (eval echo "$as_me:11473: \"$cf_try\"") >&5
11474   (eval $cf_try) 2>&5
11475   ac_status=$?
11476   echo "$as_me:11476: \$? = $ac_status" >&5
11477   (exit "$ac_status"); }
11478                 if test -f conftest.out ; then
11479                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11480                         eval NCURSES_$cf_name=\"$cf_result\"
11481                         # cat conftest.$ac_ext
11482                         # cat conftest.out
11483                 fi
11484         done
11485
11486         cf_cv_abi_version=${NCURSES_MAJOR}
11487
11488 fi
11489
11490 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11491
11492 cf_cv_timestamp=`date`
11493
11494 echo "$as_me:11494: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11495 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11496
11497 echo "$as_me:11497: checking if you want to have a library-prefix" >&5
11498 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11499
11500 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11501 if test "${with_lib_prefix+set}" = set; then
11502   withval="$with_lib_prefix"
11503   with_lib_prefix=$withval
11504 else
11505   with_lib_prefix=auto
11506 fi;
11507 echo "$as_me:11507: result: $with_lib_prefix" >&5
11508 echo "${ECHO_T}$with_lib_prefix" >&6
11509
11510 if test "$with_lib_prefix" = auto
11511 then
11512
11513         case "$cf_cv_system_name" in
11514         (OS/2*|os2*)
11515                 if test "$DFT_LWR_MODEL" = libtool; then
11516                         LIB_PREFIX='lib'
11517                 else
11518                         LIB_PREFIX=''
11519                 fi
11520                 ;;
11521         (*-msvc*)
11522                 LIB_PREFIX=''
11523                 ;;
11524         (*)     LIB_PREFIX='lib'
11525                 ;;
11526         esac
11527 cf_prefix=$LIB_PREFIX
11528
11529 elif test "$with_lib_prefix" = no
11530 then
11531         LIB_PREFIX=
11532 else
11533         LIB_PREFIX=$with_lib_prefix
11534 fi
11535
11536 LIB_SUFFIX=
11537
11538 ###############################################################################
11539
11540 if test X"$CC_G_OPT" = X"" ; then
11541         CC_G_OPT='-g'
11542         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11543 fi
11544
11545 echo "$as_me:11545: checking for default loader flags" >&5
11546 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11547 case $DFT_LWR_MODEL in
11548 (normal)  LD_MODEL=''   ;;
11549 (debug)   LD_MODEL=$CC_G_OPT ;;
11550 (profile) LD_MODEL='-pg';;
11551 (shared)  LD_MODEL=''   ;;
11552 esac
11553 echo "$as_me:11553: result: $LD_MODEL" >&5
11554 echo "${ECHO_T}$LD_MODEL" >&6
11555
11556 LD_RPATH_OPT=
11557 if test "x$cf_cv_enable_rpath" != xno
11558 then
11559         echo "$as_me:11559: checking for an rpath option" >&5
11560 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11561         case "$cf_cv_system_name" in
11562         (irix*)
11563                 if test "$GCC" = yes; then
11564                         LD_RPATH_OPT="-Wl,-rpath,"
11565                 else
11566                         LD_RPATH_OPT="-rpath "
11567                 fi
11568                 ;;
11569         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11570                 LD_RPATH_OPT="-Wl,-rpath,"
11571                 ;;
11572         (openbsd[2-9].*|mirbsd*)
11573                 LD_RPATH_OPT="-Wl,-rpath,"
11574                 ;;
11575         (dragonfly*)
11576                 LD_RPATH_OPT="-rpath "
11577                 ;;
11578         (netbsd*)
11579                 LD_RPATH_OPT="-Wl,-rpath,"
11580                 ;;
11581         (osf*|mls+*)
11582                 LD_RPATH_OPT="-rpath "
11583                 ;;
11584         (solaris2*)
11585                 LD_RPATH_OPT="-R"
11586                 ;;
11587         (*)
11588                 ;;
11589         esac
11590         echo "$as_me:11590: result: $LD_RPATH_OPT" >&5
11591 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11592
11593         case "x$LD_RPATH_OPT" in
11594         (x-R*)
11595                 echo "$as_me:11595: checking if we need a space after rpath option" >&5
11596 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11597                 cf_save_LIBS="$LIBS"
11598
11599 cf_add_libs="$LIBS"
11600 # reverse order
11601 cf_add_0lib=
11602 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11603 # filter duplicates
11604 for cf_add_1lib in $cf_add_0lib; do
11605         for cf_add_2lib in $cf_add_libs; do
11606                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11607                         cf_add_1lib=
11608                         break
11609                 fi
11610         done
11611         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11612 done
11613 LIBS="$cf_add_libs"
11614
11615                 cat >"conftest.$ac_ext" <<_ACEOF
11616 #line 11616 "configure"
11617 #include "confdefs.h"
11618
11619 int
11620 main (void)
11621 {
11622
11623   ;
11624   return 0;
11625 }
11626 _ACEOF
11627 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11628 if { (eval echo "$as_me:11628: \"$ac_link\"") >&5
11629   (eval $ac_link) 2>&5
11630   ac_status=$?
11631   echo "$as_me:11631: \$? = $ac_status" >&5
11632   (exit "$ac_status"); } &&
11633          { ac_try='test -s "conftest$ac_exeext"'
11634   { (eval echo "$as_me:11634: \"$ac_try\"") >&5
11635   (eval $ac_try) 2>&5
11636   ac_status=$?
11637   echo "$as_me:11637: \$? = $ac_status" >&5
11638   (exit "$ac_status"); }; }; then
11639   cf_rpath_space=no
11640 else
11641   echo "$as_me: failed program was:" >&5
11642 cat "conftest.$ac_ext" >&5
11643 cf_rpath_space=yes
11644 fi
11645 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11646                 LIBS="$cf_save_LIBS"
11647                 echo "$as_me:11647: result: $cf_rpath_space" >&5
11648 echo "${ECHO_T}$cf_rpath_space" >&6
11649                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11650                 ;;
11651         esac
11652 fi
11653
11654         RM_SHARED_OPTS=
11655         LOCAL_LDFLAGS=
11656         LOCAL_LDFLAGS2=
11657         LD_SHARED_OPTS=
11658         INSTALL_LIB="-m 644"
11659         : ${rel_builddir:=.}
11660
11661         shlibdir=$libdir
11662
11663         MAKE_DLLS="#"
11664
11665         cf_cv_do_symlinks=no
11666         cf_ld_rpath_opt=
11667         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11668
11669         echo "$as_me:11669: checking if release/abi version should be used for shared libs" >&5
11670 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11671
11672 # Check whether --with-shlib-version or --without-shlib-version was given.
11673 if test "${with_shlib_version+set}" = set; then
11674   withval="$with_shlib_version"
11675   test -z "$withval" && withval=auto
11676         case "$withval" in
11677         (yes)
11678                 cf_cv_shlib_version=auto
11679                 ;;
11680         (rel|abi|auto)
11681                 cf_cv_shlib_version=$withval
11682                 ;;
11683         (*)
11684                 echo "$as_me:11684: result: $withval" >&5
11685 echo "${ECHO_T}$withval" >&6
11686                 { { echo "$as_me:11686: error: option value must be one of: rel, abi, or auto" >&5
11687 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11688    { (exit 1); exit 1; }; }
11689                 ;;
11690         esac
11691
11692 else
11693   cf_cv_shlib_version=auto
11694 fi;
11695         echo "$as_me:11695: result: $cf_cv_shlib_version" >&5
11696 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11697
11698         cf_cv_rm_so_locs=no
11699         cf_try_cflags=
11700
11701         # Some less-capable ports of gcc support only -fpic
11702         CC_SHARED_OPTS=
11703
11704         cf_try_fPIC=no
11705         if test "$GCC" = yes
11706         then
11707                 cf_try_fPIC=yes
11708         else
11709                 case "$cf_cv_system_name" in
11710                 (*linux*)       # e.g., PGI compiler
11711                         cf_try_fPIC=yes
11712                         ;;
11713                 esac
11714         fi
11715
11716         if test "$cf_try_fPIC" = yes
11717         then
11718                 echo "$as_me:11718: checking which $CC option to use" >&5
11719 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11720                 cf_save_CFLAGS="$CFLAGS"
11721                 for CC_SHARED_OPTS in -fPIC -fpic ''
11722                 do
11723                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11724                         cat >"conftest.$ac_ext" <<_ACEOF
11725 #line 11725 "configure"
11726 #include "confdefs.h"
11727 #include <stdio.h>
11728 int
11729 main (void)
11730 {
11731 int x = 1
11732   ;
11733   return 0;
11734 }
11735 _ACEOF
11736 rm -f "conftest.$ac_objext"
11737 if { (eval echo "$as_me:11737: \"$ac_compile\"") >&5
11738   (eval $ac_compile) 2>&5
11739   ac_status=$?
11740   echo "$as_me:11740: \$? = $ac_status" >&5
11741   (exit "$ac_status"); } &&
11742          { ac_try='test -s "conftest.$ac_objext"'
11743   { (eval echo "$as_me:11743: \"$ac_try\"") >&5
11744   (eval $ac_try) 2>&5
11745   ac_status=$?
11746   echo "$as_me:11746: \$? = $ac_status" >&5
11747   (exit "$ac_status"); }; }; then
11748   break
11749 else
11750   echo "$as_me: failed program was:" >&5
11751 cat "conftest.$ac_ext" >&5
11752 fi
11753 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11754                 done
11755                 echo "$as_me:11755: result: $CC_SHARED_OPTS" >&5
11756 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11757                 CFLAGS="$cf_save_CFLAGS"
11758         fi
11759
11760         cf_cv_shlib_version_infix=no
11761
11762         case "$cf_cv_system_name" in
11763         (aix4.3-9*|aix[5-7]*)
11764                 if test "$GCC" = yes; then
11765                         CC_SHARED_OPTS='-Wl,-brtl'
11766                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11767                 else
11768                         CC_SHARED_OPTS='-brtl'
11769                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11770                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11771                 fi
11772                 ;;
11773         (beos*)
11774                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11775                 ;;
11776         (cygwin*)
11777                 CC_SHARED_OPTS=
11778                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11779                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11780                 cf_cv_shlib_version=cygdll
11781                 cf_cv_shlib_version_infix=cygdll
11782                 shlibdir=$bindir
11783                 MAKE_DLLS=
11784                 cat >mk_shared_lib.sh <<-CF_EOF
11785                 #!$SHELL
11786                 SHARED_LIB=\$1
11787                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11788                 shift
11789                 cat <<-EOF
11790                 Linking shared library
11791                 ** SHARED_LIB \$SHARED_LIB
11792                 ** IMPORT_LIB \$IMPORT_LIB
11793 EOF
11794                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11795 CF_EOF
11796                 chmod +x mk_shared_lib.sh
11797                 ;;
11798         (msys*)
11799                 CC_SHARED_OPTS=
11800                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11801                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11802                 cf_cv_shlib_version=msysdll
11803                 cf_cv_shlib_version_infix=msysdll
11804                 shlibdir=$bindir
11805                 MAKE_DLLS=
11806                 cat >mk_shared_lib.sh <<-CF_EOF
11807                 #!$SHELL
11808                 SHARED_LIB=\$1
11809                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11810                 shift
11811                 cat <<-EOF
11812                 Linking shared library
11813                 ** SHARED_LIB \$SHARED_LIB
11814                 ** IMPORT_LIB \$IMPORT_LIB
11815 EOF
11816                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11817 CF_EOF
11818                 chmod +x mk_shared_lib.sh
11819                 ;;
11820         (darwin*)
11821                 cf_try_cflags="no-cpp-precomp"
11822                 CC_SHARED_OPTS="-dynamic"
11823                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11824                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11825                 cf_cv_shlib_version_infix=yes
11826                 echo "$as_me:11826: checking if ld -search_paths_first works" >&5
11827 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11828 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11829   echo $ECHO_N "(cached) $ECHO_C" >&6
11830 else
11831
11832                         cf_save_LDFLAGS=$LDFLAGS
11833                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11834                         cat >"conftest.$ac_ext" <<_ACEOF
11835 #line 11835 "configure"
11836 #include "confdefs.h"
11837
11838 int
11839 main (void)
11840 {
11841 int i;
11842   ;
11843   return 0;
11844 }
11845 _ACEOF
11846 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11847 if { (eval echo "$as_me:11847: \"$ac_link\"") >&5
11848   (eval $ac_link) 2>&5
11849   ac_status=$?
11850   echo "$as_me:11850: \$? = $ac_status" >&5
11851   (exit "$ac_status"); } &&
11852          { ac_try='test -s "conftest$ac_exeext"'
11853   { (eval echo "$as_me:11853: \"$ac_try\"") >&5
11854   (eval $ac_try) 2>&5
11855   ac_status=$?
11856   echo "$as_me:11856: \$? = $ac_status" >&5
11857   (exit "$ac_status"); }; }; then
11858   cf_cv_ldflags_search_paths_first=yes
11859 else
11860   echo "$as_me: failed program was:" >&5
11861 cat "conftest.$ac_ext" >&5
11862 cf_cv_ldflags_search_paths_first=no
11863 fi
11864 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11865                                 LDFLAGS=$cf_save_LDFLAGS
11866 fi
11867 echo "$as_me:11867: result: $cf_cv_ldflags_search_paths_first" >&5
11868 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11869                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11870                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11871                 fi
11872                 ;;
11873         (haiku*)
11874
11875         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11876         if test "$cf_cv_shlib_version" = rel; then
11877                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11878         else
11879                 cf_cv_shared_soname='`basename $@`'
11880         fi
11881
11882                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11883                 ;;
11884         (hpux[7-8]*)
11885                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11886                 if test "$GCC" != yes; then
11887                         CC_SHARED_OPTS='+Z'
11888                 fi
11889                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11890                 INSTALL_LIB="-m 555"
11891                 ;;
11892         (hpux*)
11893                 # (tested with gcc 2.7.2 -- I don't have c89)
11894                 if test "$GCC" = yes; then
11895                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11896                 else
11897                         CC_SHARED_OPTS='+Z'
11898                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11899                 fi
11900                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11901                 # HP-UX shared libraries must be executable, and should be
11902                 # readonly to exploit a quirk in the memory manager.
11903                 INSTALL_LIB="-m 555"
11904                 ;;
11905         (interix*)
11906                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11907                 if test "$cf_cv_shlib_version" = rel; then
11908                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11909                 else
11910                         cf_shared_soname='`basename $@`'
11911                 fi
11912                 CC_SHARED_OPTS=
11913                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11914                 ;;
11915         (irix*)
11916                 if test "$cf_cv_enable_rpath" = yes ; then
11917                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11918                 fi
11919                 # tested with IRIX 5.2 and 'cc'.
11920                 if test "$GCC" != yes; then
11921                         CC_SHARED_OPTS='-KPIC'
11922                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11923                 else
11924                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11925                 fi
11926                 cf_cv_rm_so_locs=yes
11927                 ;;
11928         (linux*|gnu*|k*bsd*-gnu)
11929                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11930                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11931                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11932                 fi
11933                 if test "$cf_cv_enable_rpath" = yes ; then
11934                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11935                 fi
11936
11937         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11938         if test "$cf_cv_shlib_version" = rel; then
11939                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11940         else
11941                 cf_cv_shared_soname='`basename $@`'
11942         fi
11943
11944                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11945                 ;;
11946         (mingw*msvc*)
11947                 cf_cv_shlib_version=msvcdll
11948                 cf_cv_shlib_version_infix=msvcdll
11949                 shlibdir=$bindir
11950                 MAKE_DLLS=
11951                 if test "$DFT_LWR_MODEL" = "shared" ; then
11952                         LOCAL_LDFLAGS="-link -dll"
11953                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11954                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11955                 fi
11956                 CC_SHARED_OPTS=
11957                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11958                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11959                 cat >mk_shared_lib.sh <<-CF_EOF
11960                 #!$SHELL
11961                 SHARED_LIB=\$1
11962                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11963                 shift
11964                 my_ld=\$1
11965                 shift
11966                 cat <<-EOF
11967                 Linking shared library
11968                 ** SHARED LIB \$SHARED_LIB
11969                 ** IMPORT_LIB \$IMPORT_LIB
11970 EOF
11971                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11972                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11973                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11974 CF_EOF
11975                 chmod +x mk_shared_lib.sh
11976                 cat >mk_prog.sh <<-CF_EOF
11977                 #!$SHELL
11978                 shift
11979                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11980                 LD="$LD"
11981                 clopts=()
11982                 ldopts=("/subsystem:console")
11983                 libs=()
11984                 isdll=0
11985                 while test \$# -gt 0; do
11986                         case "\$1" in
11987                                 -link)
11988                                         # ignore -link argument
11989                                         ;;
11990                                 -M[TD] | -M[TD]d)
11991                                         # ignore runtime-library option
11992                                         ;;
11993                                 -dll)
11994                                         isdll=1
11995                                         ;;
11996                                 -W* | -w*)
11997                                         # ignore warnings
11998                                         ;;
11999                                 -D*)
12000                                         clopts+=("\$1")
12001                                         ;;
12002                                 -I*)
12003                                         clopts+=("\$1")
12004                                         ;;
12005                                 -l*)
12006                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12007                                         ;;
12008                                 -L*)
12009                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12010                                         ;;
12011                                 *.obj | *.o)
12012                                         ldopts+=("\$1")
12013                                         ;;
12014                                 -Wl,*)
12015                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12016                                                 ldopts+=("\${linkarg}")
12017                                         done
12018                                         ;;
12019                                 *.lib)
12020                                         ldopts+=("\$1")
12021                                         ;;
12022                                 -o)
12023                                         shift
12024                                         ldopts+=("-out:\$1")
12025                                         ;;
12026                                 *)
12027                                         clopts+=("\$1")
12028                                         ldopts+=("\$1")
12029                                         ;;
12030                         esac
12031                         shift
12032                 done
12033                 if [ "\$isdll" -ne 0 ]; then
12034                         for lib in \${libs[*]}; do
12035                                 ldopts+=("\$lib.dll.lib")
12036                         done
12037                 else
12038                         for lib in \${libs[*]}; do
12039                                 ldopts+=("\$lib.lib")
12040                         done
12041                 fi
12042                 cat <<-EOF
12043                 Creating program
12044                 ** ld options:   "\${ldopts[@]}"
12045 EOF
12046                 exec \$LD \${ldopts[@]}
12047 CF_EOF
12048                 chmod +x mk_prog.sh
12049                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12050                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12051                 ;;
12052         (mingw*)
12053                 cf_cv_shlib_version=mingw
12054                 cf_cv_shlib_version_infix=mingw
12055                 shlibdir=$bindir
12056                 MAKE_DLLS=
12057                 if test "$DFT_LWR_MODEL" = "shared" ; then
12058                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12059                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12060                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12061                 fi
12062                 CC_SHARED_OPTS=
12063                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12064                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12065                 cat >mk_shared_lib.sh <<-CF_EOF
12066                 #!$SHELL
12067                 SHARED_LIB=\$1
12068                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12069                 shift
12070                 cat <<-EOF
12071                 Linking shared library
12072                 ** SHARED_LIB \$SHARED_LIB
12073                 ** IMPORT_LIB \$IMPORT_LIB
12074 EOF
12075                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12076 CF_EOF
12077                 chmod +x mk_shared_lib.sh
12078                 ;;
12079         (openbsd[2-9].*|mirbsd*)
12080                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12081                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12082                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12083                 fi
12084                 if test "$cf_cv_enable_rpath" = yes ; then
12085                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12086                 fi
12087                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12088
12089         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12090         if test "$cf_cv_shlib_version" = rel; then
12091                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12092         else
12093                 cf_cv_shared_soname='`basename $@`'
12094         fi
12095
12096                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12097                 ;;
12098         (nskJ*)
12099                 CC_SHARED_OPTS=
12100                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12101                 ;;
12102         (nskL*)
12103                 CC_SHARED_OPTS=
12104                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12105                 ;;
12106         (nto-qnx*|openbsd*|freebsd[12].*)
12107                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12108                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12109                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12110                 ;;
12111         (dragonfly*|freebsd*)
12112                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12113                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12114                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12115                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12116                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12117                 fi
12118
12119         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12120         if test "$cf_cv_shlib_version" = rel; then
12121                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12122         else
12123                 cf_cv_shared_soname='`basename $@`'
12124         fi
12125
12126                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12127                 ;;
12128         (netbsd*)
12129                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12130                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12131                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12132                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12133                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12134                         if test "$cf_cv_shlib_version" = auto; then
12135                         if test -f /usr/libexec/ld.elf_so; then
12136                                 cf_cv_shlib_version=abi
12137                         else
12138                                 cf_cv_shlib_version=rel
12139                         fi
12140                         fi
12141
12142         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12143         if test "$cf_cv_shlib_version" = rel; then
12144                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12145         else
12146                 cf_cv_shared_soname='`basename $@`'
12147         fi
12148
12149                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12150                 else
12151                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12152                 fi
12153                 ;;
12154         (osf*|mls+*)
12155                 # tested with OSF/1 V3.2 and 'cc'
12156                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12157                 # link with shared libs).
12158                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12159                 case "$host_os" in
12160                 (osf4*)
12161                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12162                         ;;
12163                 esac
12164                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12165                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12166                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12167                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12168                 fi
12169                 cf_cv_rm_so_locs=yes
12170                 ;;
12171         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12172                 # tested with osr5.0.5
12173                 if test "$GCC" != yes; then
12174                         CC_SHARED_OPTS='-belf -KPIC'
12175                 fi
12176                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12177                 if test "$cf_cv_enable_rpath" = yes ; then
12178                         # only way is to set LD_RUN_PATH but no switch for it
12179                         RUN_PATH=$libdir
12180                 fi
12181                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12182                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12183                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12184                 ;;
12185         (sunos4*)
12186                 # tested with SunOS 4.1.1 and gcc 2.7.0
12187                 if test "$GCC" != yes; then
12188                         CC_SHARED_OPTS='-KPIC'
12189                 fi
12190                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12191                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12192                 ;;
12193         (solaris2*)
12194                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12195                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12196                 if test "$DFT_LWR_MODEL" = "shared" ; then
12197                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12198                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12199                 fi
12200                 if test "$cf_cv_enable_rpath" = yes ; then
12201                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12202                 fi
12203
12204         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12205         if test "$cf_cv_shlib_version" = rel; then
12206                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12207         else
12208                 cf_cv_shared_soname='`basename $@`'
12209         fi
12210
12211                 if test "$GCC" != yes; then
12212                         cf_save_CFLAGS="$CFLAGS"
12213                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12214                         do
12215                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12216                                 cat >"conftest.$ac_ext" <<_ACEOF
12217 #line 12217 "configure"
12218 #include "confdefs.h"
12219 #include <stdio.h>
12220 int
12221 main (void)
12222 {
12223 printf("Hello\\n");
12224   ;
12225   return 0;
12226 }
12227 _ACEOF
12228 rm -f "conftest.$ac_objext"
12229 if { (eval echo "$as_me:12229: \"$ac_compile\"") >&5
12230   (eval $ac_compile) 2>&5
12231   ac_status=$?
12232   echo "$as_me:12232: \$? = $ac_status" >&5
12233   (exit "$ac_status"); } &&
12234          { ac_try='test -s "conftest.$ac_objext"'
12235   { (eval echo "$as_me:12235: \"$ac_try\"") >&5
12236   (eval $ac_try) 2>&5
12237   ac_status=$?
12238   echo "$as_me:12238: \$? = $ac_status" >&5
12239   (exit "$ac_status"); }; }; then
12240   break
12241 else
12242   echo "$as_me: failed program was:" >&5
12243 cat "conftest.$ac_ext" >&5
12244 fi
12245 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12246                         done
12247                         CFLAGS="$cf_save_CFLAGS"
12248                         CC_SHARED_OPTS=$cf_shared_opts
12249                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12250                 else
12251                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12252                 fi
12253                 ;;
12254         (sysv5uw7*|unix_sv*)
12255                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12256                 if test "$GCC" != yes; then
12257                         CC_SHARED_OPTS='-KPIC'
12258                 fi
12259                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12260                 ;;
12261         (*)
12262                 CC_SHARED_OPTS='unknown'
12263                 MK_SHARED_LIB='echo unknown'
12264                 ;;
12265         esac
12266
12267         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12268         case "$cf_cv_shlib_version" in
12269         (rel|abi)
12270                 case "$MK_SHARED_LIB" in
12271                 (*'-o $@')
12272                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12273                         ;;
12274                 (*)
12275                         { echo "$as_me:12275: WARNING: ignored --with-shlib-version" >&5
12276 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12277                         ;;
12278                 esac
12279                 ;;
12280         esac
12281
12282         if test -n "$cf_try_cflags"
12283         then
12284 cat > conftest.$ac_ext <<EOF
12285 #line 12285 "${as_me:-configure}"
12286 #include <stdio.h>
12287 int main(int argc, char *argv[])
12288 {
12289         printf("hello\\n");
12290         return (argv[argc-1] == 0) ;
12291 }
12292 EOF
12293                 cf_save_CFLAGS="$CFLAGS"
12294                 for cf_opt in $cf_try_cflags
12295                 do
12296                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12297                         echo "$as_me:12297: checking if CFLAGS option -$cf_opt works" >&5
12298 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12299                         if { (eval echo "$as_me:12299: \"$ac_compile\"") >&5
12300   (eval $ac_compile) 2>&5
12301   ac_status=$?
12302   echo "$as_me:12302: \$? = $ac_status" >&5
12303   (exit "$ac_status"); }; then
12304                                 echo "$as_me:12304: result: yes" >&5
12305 echo "${ECHO_T}yes" >&6
12306                                 cf_save_CFLAGS="$CFLAGS"
12307                         else
12308                                 echo "$as_me:12308: result: no" >&5
12309 echo "${ECHO_T}no" >&6
12310                         fi
12311                 done
12312                 CFLAGS="$cf_save_CFLAGS"
12313         fi
12314
12315         # RPATH_LIST is a colon-separated list of directories
12316         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12317         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12318
12319         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12320
12321         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12322
12323 echo "${as_me:-configure}:12323: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12324
12325         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12326
12327 echo "${as_me:-configure}:12327: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12328
12329 # The test/sample programs in the original tree link using rpath option.
12330 # Make it optional for packagers.
12331 if test -n "$LOCAL_LDFLAGS"
12332 then
12333         echo "$as_me:12333: checking if you want to link sample programs with rpath option" >&5
12334 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12335
12336 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12337 if test "${enable_rpath_link+set}" = set; then
12338   enableval="$enable_rpath_link"
12339   with_rpath_link=$enableval
12340 else
12341   with_rpath_link=yes
12342 fi;
12343         echo "$as_me:12343: result: $with_rpath_link" >&5
12344 echo "${ECHO_T}$with_rpath_link" >&6
12345         if test "$with_rpath_link" = no
12346         then
12347                 LOCAL_LDFLAGS=
12348                 LOCAL_LDFLAGS2=
12349         fi
12350 fi
12351
12352 ###############################################################################
12353
12354 ###   use option --enable-broken-linker to force on use of broken-linker support
12355
12356 echo "$as_me:12356: checking if you want broken-linker support code" >&5
12357 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12358
12359 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12360 if test "${enable_broken_linker+set}" = set; then
12361   enableval="$enable_broken_linker"
12362   with_broken_linker=$enableval
12363 else
12364   with_broken_linker=no
12365 fi;
12366 echo "$as_me:12366: result: $with_broken_linker" >&5
12367 echo "${ECHO_T}$with_broken_linker" >&6
12368
12369 : "${BROKEN_LINKER:=0}"
12370 if test "x$with_broken_linker" = xyes ; then
12371
12372 cat >>confdefs.h <<\EOF
12373 #define BROKEN_LINKER 1
12374 EOF
12375
12376         BROKEN_LINKER=1
12377 fi
12378
12379 # Check to define _XOPEN_SOURCE "automatically"
12380
12381 echo "$as_me:12381: checking if the POSIX test-macros are already defined" >&5
12382 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12383 if test "${cf_cv_posix_visible+set}" = set; then
12384   echo $ECHO_N "(cached) $ECHO_C" >&6
12385 else
12386
12387 cat >"conftest.$ac_ext" <<_ACEOF
12388 #line 12388 "configure"
12389 #include "confdefs.h"
12390 #include <stdio.h>
12391 int
12392 main (void)
12393 {
12394
12395 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12396         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12397         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12398         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12399 #error conflicting symbols found
12400 #endif
12401
12402   ;
12403   return 0;
12404 }
12405 _ACEOF
12406 rm -f "conftest.$ac_objext"
12407 if { (eval echo "$as_me:12407: \"$ac_compile\"") >&5
12408   (eval $ac_compile) 2>&5
12409   ac_status=$?
12410   echo "$as_me:12410: \$? = $ac_status" >&5
12411   (exit "$ac_status"); } &&
12412          { ac_try='test -s "conftest.$ac_objext"'
12413   { (eval echo "$as_me:12413: \"$ac_try\"") >&5
12414   (eval $ac_try) 2>&5
12415   ac_status=$?
12416   echo "$as_me:12416: \$? = $ac_status" >&5
12417   (exit "$ac_status"); }; }; then
12418   cf_cv_posix_visible=no
12419 else
12420   echo "$as_me: failed program was:" >&5
12421 cat "conftest.$ac_ext" >&5
12422 cf_cv_posix_visible=yes
12423 fi
12424 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12425
12426 fi
12427 echo "$as_me:12427: result: $cf_cv_posix_visible" >&5
12428 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12429
12430 if test "$cf_cv_posix_visible" = no; then
12431
12432 cf_XOPEN_SOURCE=600
12433 cf_POSIX_C_SOURCE=199506L
12434 cf_xopen_source=
12435
12436 case "$host_os" in
12437 (aix[4-7]*)
12438         cf_xopen_source="-D_ALL_SOURCE"
12439         ;;
12440 (msys)
12441         cf_XOPEN_SOURCE=600
12442         ;;
12443 (darwin[0-8].*)
12444         cf_xopen_source="-D_APPLE_C_SOURCE"
12445         ;;
12446 (darwin*)
12447         cf_xopen_source="-D_DARWIN_C_SOURCE"
12448         cf_XOPEN_SOURCE=
12449         ;;
12450 (freebsd*|dragonfly*|midnightbsd*)
12451         # 5.x headers associate
12452         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12453         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12454         cf_POSIX_C_SOURCE=200112L
12455         cf_XOPEN_SOURCE=600
12456         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12457         ;;
12458 (hpux11*)
12459         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12460         ;;
12461 (hpux*)
12462         cf_xopen_source="-D_HPUX_SOURCE"
12463         ;;
12464 (irix[56].*)
12465         cf_xopen_source="-D_SGI_SOURCE"
12466         cf_XOPEN_SOURCE=
12467         ;;
12468 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12469
12470 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12471
12472 echo "$as_me:12472: checking if this is the GNU C library" >&5
12473 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12474 if test "${cf_cv_gnu_library+set}" = set; then
12475   echo $ECHO_N "(cached) $ECHO_C" >&6
12476 else
12477
12478 cat >"conftest.$ac_ext" <<_ACEOF
12479 #line 12479 "configure"
12480 #include "confdefs.h"
12481 #include <sys/types.h>
12482 int
12483 main (void)
12484 {
12485
12486         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12487                 return 0;
12488         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12489                 return 0;
12490         #else
12491         #       error not GNU C library
12492         #endif
12493   ;
12494   return 0;
12495 }
12496 _ACEOF
12497 rm -f "conftest.$ac_objext"
12498 if { (eval echo "$as_me:12498: \"$ac_compile\"") >&5
12499   (eval $ac_compile) 2>&5
12500   ac_status=$?
12501   echo "$as_me:12501: \$? = $ac_status" >&5
12502   (exit "$ac_status"); } &&
12503          { ac_try='test -s "conftest.$ac_objext"'
12504   { (eval echo "$as_me:12504: \"$ac_try\"") >&5
12505   (eval $ac_try) 2>&5
12506   ac_status=$?
12507   echo "$as_me:12507: \$? = $ac_status" >&5
12508   (exit "$ac_status"); }; }; then
12509   cf_cv_gnu_library=yes
12510 else
12511   echo "$as_me: failed program was:" >&5
12512 cat "conftest.$ac_ext" >&5
12513 cf_cv_gnu_library=no
12514 fi
12515 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12516
12517 fi
12518 echo "$as_me:12518: result: $cf_cv_gnu_library" >&5
12519 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12520
12521 if test x$cf_cv_gnu_library = xyes; then
12522
12523         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12524         # was changed to help a little.  newlib incorporated the change about 4
12525         # years later.
12526         echo "$as_me:12526: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12527 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12528 if test "${cf_cv_gnu_library_219+set}" = set; then
12529   echo $ECHO_N "(cached) $ECHO_C" >&6
12530 else
12531
12532                 cf_save="$CPPFLAGS"
12533
12534         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12535         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12536
12537                 cat >"conftest.$ac_ext" <<_ACEOF
12538 #line 12538 "configure"
12539 #include "confdefs.h"
12540 #include <sys/types.h>
12541 int
12542 main (void)
12543 {
12544
12545                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12546                                 return 0;
12547                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12548                                 return 0;
12549                         #else
12550                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12551                         #endif
12552   ;
12553   return 0;
12554 }
12555 _ACEOF
12556 rm -f "conftest.$ac_objext"
12557 if { (eval echo "$as_me:12557: \"$ac_compile\"") >&5
12558   (eval $ac_compile) 2>&5
12559   ac_status=$?
12560   echo "$as_me:12560: \$? = $ac_status" >&5
12561   (exit "$ac_status"); } &&
12562          { ac_try='test -s "conftest.$ac_objext"'
12563   { (eval echo "$as_me:12563: \"$ac_try\"") >&5
12564   (eval $ac_try) 2>&5
12565   ac_status=$?
12566   echo "$as_me:12566: \$? = $ac_status" >&5
12567   (exit "$ac_status"); }; }; then
12568   cf_cv_gnu_library_219=yes
12569 else
12570   echo "$as_me: failed program was:" >&5
12571 cat "conftest.$ac_ext" >&5
12572 cf_cv_gnu_library_219=no
12573 fi
12574 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12575                 CPPFLAGS="$cf_save"
12576
12577 fi
12578 echo "$as_me:12578: result: $cf_cv_gnu_library_219" >&5
12579 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12580
12581         if test "x$cf_cv_gnu_library_219" = xyes; then
12582                 cf_save="$CPPFLAGS"
12583                 echo "$as_me:12583: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12584 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12585 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12586   echo $ECHO_N "(cached) $ECHO_C" >&6
12587 else
12588
12589 cf_fix_cppflags=no
12590 cf_new_cflags=
12591 cf_new_cppflags=
12592 cf_new_extra_cppflags=
12593
12594 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12595 do
12596 case "$cf_fix_cppflags" in
12597 (no)
12598         case "$cf_add_cflags" in
12599         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12600                 case "$cf_add_cflags" in
12601                 (-D*)
12602                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12603
12604                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12605                                 && test -z "${cf_tst_cflags}" \
12606                                 && cf_fix_cppflags=yes
12607
12608                         if test "$cf_fix_cppflags" = yes ; then
12609
12610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12612
12613                                 continue
12614                         elif test "${cf_tst_cflags}" = "\"'" ; then
12615
12616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12618
12619                                 continue
12620                         fi
12621                         ;;
12622                 esac
12623                 case "$CPPFLAGS" in
12624                 (*$cf_add_cflags)
12625                         ;;
12626                 (*)
12627                         case "$cf_add_cflags" in
12628                         (-D*)
12629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12630
12631 CPPFLAGS=`echo "$CPPFLAGS" | \
12632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12634
12635                                 ;;
12636                         esac
12637
12638         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12639         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12640
12641                         ;;
12642                 esac
12643                 ;;
12644         (*)
12645
12646         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12647         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12648
12649                 ;;
12650         esac
12651         ;;
12652 (yes)
12653
12654         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12655         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12656
12657         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12658
12659         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12660                 && test -z "${cf_tst_cflags}" \
12661                 && cf_fix_cppflags=no
12662         ;;
12663 esac
12664 done
12665
12666 if test -n "$cf_new_cflags" ; then
12667
12668         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12669         CFLAGS="${CFLAGS}$cf_new_cflags"
12670
12671 fi
12672
12673 if test -n "$cf_new_cppflags" ; then
12674
12675         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12676         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12677
12678 fi
12679
12680 if test -n "$cf_new_extra_cppflags" ; then
12681
12682         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12683         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12684
12685 fi
12686
12687                         cat >"conftest.$ac_ext" <<_ACEOF
12688 #line 12688 "configure"
12689 #include "confdefs.h"
12690
12691                                 #include <limits.h>
12692                                 #include <sys/types.h>
12693
12694 int
12695 main (void)
12696 {
12697
12698                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12699                                         return 0;
12700                                 #else
12701                                 #       error GNU C library is too old
12702                                 #endif
12703   ;
12704   return 0;
12705 }
12706 _ACEOF
12707 rm -f "conftest.$ac_objext"
12708 if { (eval echo "$as_me:12708: \"$ac_compile\"") >&5
12709   (eval $ac_compile) 2>&5
12710   ac_status=$?
12711   echo "$as_me:12711: \$? = $ac_status" >&5
12712   (exit "$ac_status"); } &&
12713          { ac_try='test -s "conftest.$ac_objext"'
12714   { (eval echo "$as_me:12714: \"$ac_try\"") >&5
12715   (eval $ac_try) 2>&5
12716   ac_status=$?
12717   echo "$as_me:12717: \$? = $ac_status" >&5
12718   (exit "$ac_status"); }; }; then
12719   cf_cv_gnu_dftsrc_219=yes
12720 else
12721   echo "$as_me: failed program was:" >&5
12722 cat "conftest.$ac_ext" >&5
12723 cf_cv_gnu_dftsrc_219=no
12724 fi
12725 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12726
12727 fi
12728 echo "$as_me:12728: result: $cf_cv_gnu_dftsrc_219" >&5
12729 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12730                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12731         else
12732                 cf_cv_gnu_dftsrc_219=maybe
12733         fi
12734
12735         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12736
12737                 echo "$as_me:12737: checking if we must define _GNU_SOURCE" >&5
12738 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12739 if test "${cf_cv_gnu_source+set}" = set; then
12740   echo $ECHO_N "(cached) $ECHO_C" >&6
12741 else
12742
12743                 cat >"conftest.$ac_ext" <<_ACEOF
12744 #line 12744 "configure"
12745 #include "confdefs.h"
12746 #include <sys/types.h>
12747 int
12748 main (void)
12749 {
12750
12751                         #ifndef _XOPEN_SOURCE
12752                         #error  expected _XOPEN_SOURCE to be defined
12753                         #endif
12754   ;
12755   return 0;
12756 }
12757 _ACEOF
12758 rm -f "conftest.$ac_objext"
12759 if { (eval echo "$as_me:12759: \"$ac_compile\"") >&5
12760   (eval $ac_compile) 2>&5
12761   ac_status=$?
12762   echo "$as_me:12762: \$? = $ac_status" >&5
12763   (exit "$ac_status"); } &&
12764          { ac_try='test -s "conftest.$ac_objext"'
12765   { (eval echo "$as_me:12765: \"$ac_try\"") >&5
12766   (eval $ac_try) 2>&5
12767   ac_status=$?
12768   echo "$as_me:12768: \$? = $ac_status" >&5
12769   (exit "$ac_status"); }; }; then
12770   cf_cv_gnu_source=no
12771 else
12772   echo "$as_me: failed program was:" >&5
12773 cat "conftest.$ac_ext" >&5
12774 cf_save="$CPPFLAGS"
12775
12776 cf_fix_cppflags=no
12777 cf_new_cflags=
12778 cf_new_cppflags=
12779 cf_new_extra_cppflags=
12780
12781 for cf_add_cflags in -D_GNU_SOURCE
12782 do
12783 case "$cf_fix_cppflags" in
12784 (no)
12785         case "$cf_add_cflags" in
12786         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12787                 case "$cf_add_cflags" in
12788                 (-D*)
12789                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12790
12791                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12792                                 && test -z "${cf_tst_cflags}" \
12793                                 && cf_fix_cppflags=yes
12794
12795                         if test "$cf_fix_cppflags" = yes ; then
12796
12797         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12798         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12799
12800                                 continue
12801                         elif test "${cf_tst_cflags}" = "\"'" ; then
12802
12803         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12804         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12805
12806                                 continue
12807                         fi
12808                         ;;
12809                 esac
12810                 case "$CPPFLAGS" in
12811                 (*$cf_add_cflags)
12812                         ;;
12813                 (*)
12814                         case "$cf_add_cflags" in
12815                         (-D*)
12816                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12817
12818 CPPFLAGS=`echo "$CPPFLAGS" | \
12819         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12820                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12821
12822                                 ;;
12823                         esac
12824
12825         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12826         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12827
12828                         ;;
12829                 esac
12830                 ;;
12831         (*)
12832
12833         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12834         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12835
12836                 ;;
12837         esac
12838         ;;
12839 (yes)
12840
12841         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12842         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12843
12844         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12845
12846         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12847                 && test -z "${cf_tst_cflags}" \
12848                 && cf_fix_cppflags=no
12849         ;;
12850 esac
12851 done
12852
12853 if test -n "$cf_new_cflags" ; then
12854
12855         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12856         CFLAGS="${CFLAGS}$cf_new_cflags"
12857
12858 fi
12859
12860 if test -n "$cf_new_cppflags" ; then
12861
12862         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12863         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12864
12865 fi
12866
12867 if test -n "$cf_new_extra_cppflags" ; then
12868
12869         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12870         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12871
12872 fi
12873
12874                          cat >"conftest.$ac_ext" <<_ACEOF
12875 #line 12875 "configure"
12876 #include "confdefs.h"
12877 #include <sys/types.h>
12878 int
12879 main (void)
12880 {
12881
12882                                 #ifdef _XOPEN_SOURCE
12883                                 #error  expected _XOPEN_SOURCE to be undefined
12884                                 #endif
12885   ;
12886   return 0;
12887 }
12888 _ACEOF
12889 rm -f "conftest.$ac_objext"
12890 if { (eval echo "$as_me:12890: \"$ac_compile\"") >&5
12891   (eval $ac_compile) 2>&5
12892   ac_status=$?
12893   echo "$as_me:12893: \$? = $ac_status" >&5
12894   (exit "$ac_status"); } &&
12895          { ac_try='test -s "conftest.$ac_objext"'
12896   { (eval echo "$as_me:12896: \"$ac_try\"") >&5
12897   (eval $ac_try) 2>&5
12898   ac_status=$?
12899   echo "$as_me:12899: \$? = $ac_status" >&5
12900   (exit "$ac_status"); }; }; then
12901   cf_cv_gnu_source=no
12902 else
12903   echo "$as_me: failed program was:" >&5
12904 cat "conftest.$ac_ext" >&5
12905 cf_cv_gnu_source=yes
12906 fi
12907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12908                         CPPFLAGS="$cf_save"
12909
12910 fi
12911 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12912
12913 fi
12914 echo "$as_me:12914: result: $cf_cv_gnu_source" >&5
12915 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12916
12917                 if test "$cf_cv_gnu_source" = yes
12918                 then
12919                 echo "$as_me:12919: checking if we should also define _DEFAULT_SOURCE" >&5
12920 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12921 if test "${cf_cv_default_source+set}" = set; then
12922   echo $ECHO_N "(cached) $ECHO_C" >&6
12923 else
12924
12925         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12926         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12927
12928                         cat >"conftest.$ac_ext" <<_ACEOF
12929 #line 12929 "configure"
12930 #include "confdefs.h"
12931 #include <sys/types.h>
12932 int
12933 main (void)
12934 {
12935
12936                                 #ifdef _DEFAULT_SOURCE
12937                                 #error  expected _DEFAULT_SOURCE to be undefined
12938                                 #endif
12939   ;
12940   return 0;
12941 }
12942 _ACEOF
12943 rm -f "conftest.$ac_objext"
12944 if { (eval echo "$as_me:12944: \"$ac_compile\"") >&5
12945   (eval $ac_compile) 2>&5
12946   ac_status=$?
12947   echo "$as_me:12947: \$? = $ac_status" >&5
12948   (exit "$ac_status"); } &&
12949          { ac_try='test -s "conftest.$ac_objext"'
12950   { (eval echo "$as_me:12950: \"$ac_try\"") >&5
12951   (eval $ac_try) 2>&5
12952   ac_status=$?
12953   echo "$as_me:12953: \$? = $ac_status" >&5
12954   (exit "$ac_status"); }; }; then
12955   cf_cv_default_source=no
12956 else
12957   echo "$as_me: failed program was:" >&5
12958 cat "conftest.$ac_ext" >&5
12959 cf_cv_default_source=yes
12960 fi
12961 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12962
12963 fi
12964 echo "$as_me:12964: result: $cf_cv_default_source" >&5
12965 echo "${ECHO_T}$cf_cv_default_source" >&6
12966                         if test "$cf_cv_default_source" = yes
12967                         then
12968
12969         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12970         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12971
12972                         fi
12973                 fi
12974         fi
12975
12976 fi
12977
12978         ;;
12979 (minix*)
12980         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12981         ;;
12982 (mirbsd*)
12983         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12984         cf_XOPEN_SOURCE=
12985
12986 if test "$cf_cv_posix_visible" = no; then
12987
12988 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12989
12990 cf_save_CFLAGS="$CFLAGS"
12991 cf_save_CPPFLAGS="$CPPFLAGS"
12992
12993 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12994         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12995                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12996
12997 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12998         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12999                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13000
13001 echo "$as_me:13001: checking if we should define _POSIX_C_SOURCE" >&5
13002 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13003 if test "${cf_cv_posix_c_source+set}" = set; then
13004   echo $ECHO_N "(cached) $ECHO_C" >&6
13005 else
13006
13007 echo "${as_me:-configure}:13007: testing if the symbol is already defined go no further ..." 1>&5
13008
13009         cat >"conftest.$ac_ext" <<_ACEOF
13010 #line 13010 "configure"
13011 #include "confdefs.h"
13012 #include <sys/types.h>
13013 int
13014 main (void)
13015 {
13016
13017 #ifndef _POSIX_C_SOURCE
13018 make an error
13019 #endif
13020   ;
13021   return 0;
13022 }
13023 _ACEOF
13024 rm -f "conftest.$ac_objext"
13025 if { (eval echo "$as_me:13025: \"$ac_compile\"") >&5
13026   (eval $ac_compile) 2>&5
13027   ac_status=$?
13028   echo "$as_me:13028: \$? = $ac_status" >&5
13029   (exit "$ac_status"); } &&
13030          { ac_try='test -s "conftest.$ac_objext"'
13031   { (eval echo "$as_me:13031: \"$ac_try\"") >&5
13032   (eval $ac_try) 2>&5
13033   ac_status=$?
13034   echo "$as_me:13034: \$? = $ac_status" >&5
13035   (exit "$ac_status"); }; }; then
13036   cf_cv_posix_c_source=no
13037 else
13038   echo "$as_me: failed program was:" >&5
13039 cat "conftest.$ac_ext" >&5
13040 cf_want_posix_source=no
13041          case .$cf_POSIX_C_SOURCE in
13042          (.[12]??*)
13043                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13044                 ;;
13045          (.2)
13046                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13047                 cf_want_posix_source=yes
13048                 ;;
13049          (.*)
13050                 cf_want_posix_source=yes
13051                 ;;
13052          esac
13053          if test "$cf_want_posix_source" = yes ; then
13054                 cat >"conftest.$ac_ext" <<_ACEOF
13055 #line 13055 "configure"
13056 #include "confdefs.h"
13057 #include <sys/types.h>
13058 int
13059 main (void)
13060 {
13061
13062 #ifdef _POSIX_SOURCE
13063 make an error
13064 #endif
13065   ;
13066   return 0;
13067 }
13068 _ACEOF
13069 rm -f "conftest.$ac_objext"
13070 if { (eval echo "$as_me:13070: \"$ac_compile\"") >&5
13071   (eval $ac_compile) 2>&5
13072   ac_status=$?
13073   echo "$as_me:13073: \$? = $ac_status" >&5
13074   (exit "$ac_status"); } &&
13075          { ac_try='test -s "conftest.$ac_objext"'
13076   { (eval echo "$as_me:13076: \"$ac_try\"") >&5
13077   (eval $ac_try) 2>&5
13078   ac_status=$?
13079   echo "$as_me:13079: \$? = $ac_status" >&5
13080   (exit "$ac_status"); }; }; then
13081   :
13082 else
13083   echo "$as_me: failed program was:" >&5
13084 cat "conftest.$ac_ext" >&5
13085 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13086 fi
13087 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13088          fi
13089
13090 echo "${as_me:-configure}:13090: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13091
13092          CFLAGS="$cf_trim_CFLAGS"
13093          CPPFLAGS="$cf_trim_CPPFLAGS"
13094
13095         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13096         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13097
13098 echo "${as_me:-configure}:13098: testing if the second compile does not leave our definition intact error ..." 1>&5
13099
13100          cat >"conftest.$ac_ext" <<_ACEOF
13101 #line 13101 "configure"
13102 #include "confdefs.h"
13103 #include <sys/types.h>
13104 int
13105 main (void)
13106 {
13107
13108 #ifndef _POSIX_C_SOURCE
13109 make an error
13110 #endif
13111   ;
13112   return 0;
13113 }
13114 _ACEOF
13115 rm -f "conftest.$ac_objext"
13116 if { (eval echo "$as_me:13116: \"$ac_compile\"") >&5
13117   (eval $ac_compile) 2>&5
13118   ac_status=$?
13119   echo "$as_me:13119: \$? = $ac_status" >&5
13120   (exit "$ac_status"); } &&
13121          { ac_try='test -s "conftest.$ac_objext"'
13122   { (eval echo "$as_me:13122: \"$ac_try\"") >&5
13123   (eval $ac_try) 2>&5
13124   ac_status=$?
13125   echo "$as_me:13125: \$? = $ac_status" >&5
13126   (exit "$ac_status"); }; }; then
13127   :
13128 else
13129   echo "$as_me: failed program was:" >&5
13130 cat "conftest.$ac_ext" >&5
13131 cf_cv_posix_c_source=no
13132 fi
13133 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13134          CFLAGS="$cf_save_CFLAGS"
13135          CPPFLAGS="$cf_save_CPPFLAGS"
13136
13137 fi
13138 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13139
13140 fi
13141 echo "$as_me:13141: result: $cf_cv_posix_c_source" >&5
13142 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13143
13144 if test "$cf_cv_posix_c_source" != no ; then
13145         CFLAGS="$cf_trim_CFLAGS"
13146         CPPFLAGS="$cf_trim_CPPFLAGS"
13147
13148 cf_fix_cppflags=no
13149 cf_new_cflags=
13150 cf_new_cppflags=
13151 cf_new_extra_cppflags=
13152
13153 for cf_add_cflags in $cf_cv_posix_c_source
13154 do
13155 case "$cf_fix_cppflags" in
13156 (no)
13157         case "$cf_add_cflags" in
13158         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13159                 case "$cf_add_cflags" in
13160                 (-D*)
13161                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13162
13163                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13164                                 && test -z "${cf_tst_cflags}" \
13165                                 && cf_fix_cppflags=yes
13166
13167                         if test "$cf_fix_cppflags" = yes ; then
13168
13169         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13170         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13171
13172                                 continue
13173                         elif test "${cf_tst_cflags}" = "\"'" ; then
13174
13175         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13176         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13177
13178                                 continue
13179                         fi
13180                         ;;
13181                 esac
13182                 case "$CPPFLAGS" in
13183                 (*$cf_add_cflags)
13184                         ;;
13185                 (*)
13186                         case "$cf_add_cflags" in
13187                         (-D*)
13188                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13189
13190 CPPFLAGS=`echo "$CPPFLAGS" | \
13191         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13192                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13193
13194                                 ;;
13195                         esac
13196
13197         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13198         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13199
13200                         ;;
13201                 esac
13202                 ;;
13203         (*)
13204
13205         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13206         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13207
13208                 ;;
13209         esac
13210         ;;
13211 (yes)
13212
13213         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13214         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13215
13216         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13217
13218         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13219                 && test -z "${cf_tst_cflags}" \
13220                 && cf_fix_cppflags=no
13221         ;;
13222 esac
13223 done
13224
13225 if test -n "$cf_new_cflags" ; then
13226
13227         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13228         CFLAGS="${CFLAGS}$cf_new_cflags"
13229
13230 fi
13231
13232 if test -n "$cf_new_cppflags" ; then
13233
13234         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13235         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13236
13237 fi
13238
13239 if test -n "$cf_new_extra_cppflags" ; then
13240
13241         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13242         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13243
13244 fi
13245
13246 fi
13247
13248 fi # cf_cv_posix_visible
13249
13250         ;;
13251 (netbsd*)
13252         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13253         ;;
13254 (openbsd[6-9]*)
13255         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13256         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13257         # Abusing the conformance level is a workaround.
13258         { echo "$as_me:13258: WARNING: this system does not provide usable locale support" >&5
13259 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13260         cf_xopen_source="-D_BSD_SOURCE"
13261         cf_XOPEN_SOURCE=700
13262         ;;
13263 (openbsd[4-5]*)
13264         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13265         cf_xopen_source="-D_BSD_SOURCE"
13266         cf_XOPEN_SOURCE=600
13267         ;;
13268 (openbsd*)
13269         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13270         ;;
13271 (osf[45]*)
13272         cf_xopen_source="-D_OSF_SOURCE"
13273         ;;
13274 (nto-qnx*)
13275         cf_xopen_source="-D_QNX_SOURCE"
13276         ;;
13277 (sco*)
13278         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13279         ;;
13280 (solaris2.*)
13281         cf_xopen_source="-D__EXTENSIONS__"
13282         cf_cv_xopen_source=broken
13283         ;;
13284 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13285         cf_XOPEN_SOURCE=
13286         cf_POSIX_C_SOURCE=
13287         ;;
13288 (*)
13289
13290 echo "$as_me:13290: checking if we should define _XOPEN_SOURCE" >&5
13291 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13292 if test "${cf_cv_xopen_source+set}" = set; then
13293   echo $ECHO_N "(cached) $ECHO_C" >&6
13294 else
13295
13296         cat >"conftest.$ac_ext" <<_ACEOF
13297 #line 13297 "configure"
13298 #include "confdefs.h"
13299
13300 #include <stdlib.h>
13301 #include <string.h>
13302 #include <sys/types.h>
13303
13304 int
13305 main (void)
13306 {
13307
13308 #ifndef _XOPEN_SOURCE
13309 make an error
13310 #endif
13311
13312   ;
13313   return 0;
13314 }
13315 _ACEOF
13316 rm -f "conftest.$ac_objext"
13317 if { (eval echo "$as_me:13317: \"$ac_compile\"") >&5
13318   (eval $ac_compile) 2>&5
13319   ac_status=$?
13320   echo "$as_me:13320: \$? = $ac_status" >&5
13321   (exit "$ac_status"); } &&
13322          { ac_try='test -s "conftest.$ac_objext"'
13323   { (eval echo "$as_me:13323: \"$ac_try\"") >&5
13324   (eval $ac_try) 2>&5
13325   ac_status=$?
13326   echo "$as_me:13326: \$? = $ac_status" >&5
13327   (exit "$ac_status"); }; }; then
13328   cf_cv_xopen_source=no
13329 else
13330   echo "$as_me: failed program was:" >&5
13331 cat "conftest.$ac_ext" >&5
13332 cf_save="$CPPFLAGS"
13333
13334         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13335         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13336
13337          cat >"conftest.$ac_ext" <<_ACEOF
13338 #line 13338 "configure"
13339 #include "confdefs.h"
13340
13341 #include <stdlib.h>
13342 #include <string.h>
13343 #include <sys/types.h>
13344
13345 int
13346 main (void)
13347 {
13348
13349 #ifndef _XOPEN_SOURCE
13350 make an error
13351 #endif
13352
13353   ;
13354   return 0;
13355 }
13356 _ACEOF
13357 rm -f "conftest.$ac_objext"
13358 if { (eval echo "$as_me:13358: \"$ac_compile\"") >&5
13359   (eval $ac_compile) 2>&5
13360   ac_status=$?
13361   echo "$as_me:13361: \$? = $ac_status" >&5
13362   (exit "$ac_status"); } &&
13363          { ac_try='test -s "conftest.$ac_objext"'
13364   { (eval echo "$as_me:13364: \"$ac_try\"") >&5
13365   (eval $ac_try) 2>&5
13366   ac_status=$?
13367   echo "$as_me:13367: \$? = $ac_status" >&5
13368   (exit "$ac_status"); }; }; then
13369   cf_cv_xopen_source=no
13370 else
13371   echo "$as_me: failed program was:" >&5
13372 cat "conftest.$ac_ext" >&5
13373 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13374 fi
13375 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13376                 CPPFLAGS="$cf_save"
13377
13378 fi
13379 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13380
13381 fi
13382 echo "$as_me:13382: result: $cf_cv_xopen_source" >&5
13383 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13384
13385 if test "$cf_cv_xopen_source" != no ; then
13386
13387 CFLAGS=`echo "$CFLAGS" | \
13388         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13389                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13390
13391 CPPFLAGS=`echo "$CPPFLAGS" | \
13392         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13393                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13394
13395         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13396
13397 for cf_add_cflags in $cf_temp_xopen_source
13398 do
13399         case "x$cf_add_cflags" in
13400         (x-[DU]*)
13401
13402 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13403 while true
13404 do
13405         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13406         test "$CFLAGS" != "$cf_old_cflag" || break
13407
13408         CFLAGS="$cf_old_cflag"
13409 done
13410
13411 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13412 while true
13413 do
13414         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13415         test "$CPPFLAGS" != "$cf_old_cflag" || break
13416
13417         CPPFLAGS="$cf_old_cflag"
13418 done
13419
13420                 ;;
13421         esac
13422
13423 cf_fix_cppflags=no
13424 cf_new_cflags=
13425 cf_new_cppflags=
13426 cf_new_extra_cppflags=
13427
13428 for cf_add_cflags in $cf_add_cflags
13429 do
13430 case "$cf_fix_cppflags" in
13431 (no)
13432         case "$cf_add_cflags" in
13433         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13434                 case "$cf_add_cflags" in
13435                 (-D*)
13436                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13437
13438                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13439                                 && test -z "${cf_tst_cflags}" \
13440                                 && cf_fix_cppflags=yes
13441
13442                         if test "$cf_fix_cppflags" = yes ; then
13443
13444         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13445         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13446
13447                                 continue
13448                         elif test "${cf_tst_cflags}" = "\"'" ; then
13449
13450         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13451         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13452
13453                                 continue
13454                         fi
13455                         ;;
13456                 esac
13457                 case "$CPPFLAGS" in
13458                 (*$cf_add_cflags)
13459                         ;;
13460                 (*)
13461                         case "$cf_add_cflags" in
13462                         (-D*)
13463                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13464
13465 CPPFLAGS=`echo "$CPPFLAGS" | \
13466         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13467                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13468
13469                                 ;;
13470                         esac
13471
13472         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13473         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13474
13475                         ;;
13476                 esac
13477                 ;;
13478         (*)
13479
13480         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13481         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13482
13483                 ;;
13484         esac
13485         ;;
13486 (yes)
13487
13488         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13489         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13490
13491         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13492
13493         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13494                 && test -z "${cf_tst_cflags}" \
13495                 && cf_fix_cppflags=no
13496         ;;
13497 esac
13498 done
13499
13500 if test -n "$cf_new_cflags" ; then
13501
13502         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13503         CFLAGS="${CFLAGS}$cf_new_cflags"
13504
13505 fi
13506
13507 if test -n "$cf_new_cppflags" ; then
13508
13509         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13510         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13511
13512 fi
13513
13514 if test -n "$cf_new_extra_cppflags" ; then
13515
13516         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13517         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13518
13519 fi
13520
13521 done
13522
13523 fi
13524
13525         cf_save_xopen_cppflags="$CPPFLAGS"
13526
13527 if test "$cf_cv_posix_visible" = no; then
13528
13529 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13530
13531 cf_save_CFLAGS="$CFLAGS"
13532 cf_save_CPPFLAGS="$CPPFLAGS"
13533
13534 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13535         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13536                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13537
13538 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13539         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13540                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13541
13542 echo "$as_me:13542: checking if we should define _POSIX_C_SOURCE" >&5
13543 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13544 if test "${cf_cv_posix_c_source+set}" = set; then
13545   echo $ECHO_N "(cached) $ECHO_C" >&6
13546 else
13547
13548 echo "${as_me:-configure}:13548: testing if the symbol is already defined go no further ..." 1>&5
13549
13550         cat >"conftest.$ac_ext" <<_ACEOF
13551 #line 13551 "configure"
13552 #include "confdefs.h"
13553 #include <sys/types.h>
13554 int
13555 main (void)
13556 {
13557
13558 #ifndef _POSIX_C_SOURCE
13559 make an error
13560 #endif
13561   ;
13562   return 0;
13563 }
13564 _ACEOF
13565 rm -f "conftest.$ac_objext"
13566 if { (eval echo "$as_me:13566: \"$ac_compile\"") >&5
13567   (eval $ac_compile) 2>&5
13568   ac_status=$?
13569   echo "$as_me:13569: \$? = $ac_status" >&5
13570   (exit "$ac_status"); } &&
13571          { ac_try='test -s "conftest.$ac_objext"'
13572   { (eval echo "$as_me:13572: \"$ac_try\"") >&5
13573   (eval $ac_try) 2>&5
13574   ac_status=$?
13575   echo "$as_me:13575: \$? = $ac_status" >&5
13576   (exit "$ac_status"); }; }; then
13577   cf_cv_posix_c_source=no
13578 else
13579   echo "$as_me: failed program was:" >&5
13580 cat "conftest.$ac_ext" >&5
13581 cf_want_posix_source=no
13582          case .$cf_POSIX_C_SOURCE in
13583          (.[12]??*)
13584                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13585                 ;;
13586          (.2)
13587                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13588                 cf_want_posix_source=yes
13589                 ;;
13590          (.*)
13591                 cf_want_posix_source=yes
13592                 ;;
13593          esac
13594          if test "$cf_want_posix_source" = yes ; then
13595                 cat >"conftest.$ac_ext" <<_ACEOF
13596 #line 13596 "configure"
13597 #include "confdefs.h"
13598 #include <sys/types.h>
13599 int
13600 main (void)
13601 {
13602
13603 #ifdef _POSIX_SOURCE
13604 make an error
13605 #endif
13606   ;
13607   return 0;
13608 }
13609 _ACEOF
13610 rm -f "conftest.$ac_objext"
13611 if { (eval echo "$as_me:13611: \"$ac_compile\"") >&5
13612   (eval $ac_compile) 2>&5
13613   ac_status=$?
13614   echo "$as_me:13614: \$? = $ac_status" >&5
13615   (exit "$ac_status"); } &&
13616          { ac_try='test -s "conftest.$ac_objext"'
13617   { (eval echo "$as_me:13617: \"$ac_try\"") >&5
13618   (eval $ac_try) 2>&5
13619   ac_status=$?
13620   echo "$as_me:13620: \$? = $ac_status" >&5
13621   (exit "$ac_status"); }; }; then
13622   :
13623 else
13624   echo "$as_me: failed program was:" >&5
13625 cat "conftest.$ac_ext" >&5
13626 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13627 fi
13628 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13629          fi
13630
13631 echo "${as_me:-configure}:13631: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13632
13633          CFLAGS="$cf_trim_CFLAGS"
13634          CPPFLAGS="$cf_trim_CPPFLAGS"
13635
13636         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13637         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13638
13639 echo "${as_me:-configure}:13639: testing if the second compile does not leave our definition intact error ..." 1>&5
13640
13641          cat >"conftest.$ac_ext" <<_ACEOF
13642 #line 13642 "configure"
13643 #include "confdefs.h"
13644 #include <sys/types.h>
13645 int
13646 main (void)
13647 {
13648
13649 #ifndef _POSIX_C_SOURCE
13650 make an error
13651 #endif
13652   ;
13653   return 0;
13654 }
13655 _ACEOF
13656 rm -f "conftest.$ac_objext"
13657 if { (eval echo "$as_me:13657: \"$ac_compile\"") >&5
13658   (eval $ac_compile) 2>&5
13659   ac_status=$?
13660   echo "$as_me:13660: \$? = $ac_status" >&5
13661   (exit "$ac_status"); } &&
13662          { ac_try='test -s "conftest.$ac_objext"'
13663   { (eval echo "$as_me:13663: \"$ac_try\"") >&5
13664   (eval $ac_try) 2>&5
13665   ac_status=$?
13666   echo "$as_me:13666: \$? = $ac_status" >&5
13667   (exit "$ac_status"); }; }; then
13668   :
13669 else
13670   echo "$as_me: failed program was:" >&5
13671 cat "conftest.$ac_ext" >&5
13672 cf_cv_posix_c_source=no
13673 fi
13674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13675          CFLAGS="$cf_save_CFLAGS"
13676          CPPFLAGS="$cf_save_CPPFLAGS"
13677
13678 fi
13679 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13680
13681 fi
13682 echo "$as_me:13682: result: $cf_cv_posix_c_source" >&5
13683 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13684
13685 if test "$cf_cv_posix_c_source" != no ; then
13686         CFLAGS="$cf_trim_CFLAGS"
13687         CPPFLAGS="$cf_trim_CPPFLAGS"
13688
13689 cf_fix_cppflags=no
13690 cf_new_cflags=
13691 cf_new_cppflags=
13692 cf_new_extra_cppflags=
13693
13694 for cf_add_cflags in $cf_cv_posix_c_source
13695 do
13696 case "$cf_fix_cppflags" in
13697 (no)
13698         case "$cf_add_cflags" in
13699         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13700                 case "$cf_add_cflags" in
13701                 (-D*)
13702                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13703
13704                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13705                                 && test -z "${cf_tst_cflags}" \
13706                                 && cf_fix_cppflags=yes
13707
13708                         if test "$cf_fix_cppflags" = yes ; then
13709
13710         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13711         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13712
13713                                 continue
13714                         elif test "${cf_tst_cflags}" = "\"'" ; then
13715
13716         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13717         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13718
13719                                 continue
13720                         fi
13721                         ;;
13722                 esac
13723                 case "$CPPFLAGS" in
13724                 (*$cf_add_cflags)
13725                         ;;
13726                 (*)
13727                         case "$cf_add_cflags" in
13728                         (-D*)
13729                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13730
13731 CPPFLAGS=`echo "$CPPFLAGS" | \
13732         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13733                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13734
13735                                 ;;
13736                         esac
13737
13738         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13739         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13740
13741                         ;;
13742                 esac
13743                 ;;
13744         (*)
13745
13746         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13747         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13748
13749                 ;;
13750         esac
13751         ;;
13752 (yes)
13753
13754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13756
13757         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13758
13759         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13760                 && test -z "${cf_tst_cflags}" \
13761                 && cf_fix_cppflags=no
13762         ;;
13763 esac
13764 done
13765
13766 if test -n "$cf_new_cflags" ; then
13767
13768         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13769         CFLAGS="${CFLAGS}$cf_new_cflags"
13770
13771 fi
13772
13773 if test -n "$cf_new_cppflags" ; then
13774
13775         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13776         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13777
13778 fi
13779
13780 if test -n "$cf_new_extra_cppflags" ; then
13781
13782         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13783         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13784
13785 fi
13786
13787 fi
13788
13789 fi # cf_cv_posix_visible
13790
13791         # Some of these niche implementations use copy/paste, double-check...
13792         test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
13793
13794 echo "${as_me:-configure}:13794: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
13795
13796         cat >"conftest.$ac_ext" <<_ACEOF
13797 #line 13797 "configure"
13798 #include "confdefs.h"
13799
13800 #include <stdlib.h>
13801 #include <string.h>
13802 #include <sys/types.h>
13803
13804 int
13805 main (void)
13806 {
13807
13808 #ifndef _XOPEN_SOURCE
13809 make an error
13810 #endif
13811
13812   ;
13813   return 0;
13814 }
13815 _ACEOF
13816 rm -f "conftest.$ac_objext"
13817 if { (eval echo "$as_me:13817: \"$ac_compile\"") >&5
13818   (eval $ac_compile) 2>&5
13819   ac_status=$?
13820   echo "$as_me:13820: \$? = $ac_status" >&5
13821   (exit "$ac_status"); } &&
13822          { ac_try='test -s "conftest.$ac_objext"'
13823   { (eval echo "$as_me:13823: \"$ac_try\"") >&5
13824   (eval $ac_try) 2>&5
13825   ac_status=$?
13826   echo "$as_me:13826: \$? = $ac_status" >&5
13827   (exit "$ac_status"); }; }; then
13828   :
13829 else
13830   echo "$as_me: failed program was:" >&5
13831 cat "conftest.$ac_ext" >&5
13832
13833                 { echo "$as_me:13833: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
13834 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
13835                 CPPFLAGS="$cf_save_xopen_cppflags"
13836 fi
13837 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13838         ;;
13839 esac
13840
13841 if test -n "$cf_xopen_source" ; then
13842
13843 for cf_add_cflags in $cf_xopen_source
13844 do
13845         case "x$cf_add_cflags" in
13846         (x-[DU]*)
13847
13848 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13849 while true
13850 do
13851         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13852         test "$CFLAGS" != "$cf_old_cflag" || break
13853         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13854
13855 echo "${as_me:-configure}:13855: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13856
13857         CFLAGS="$cf_old_cflag"
13858 done
13859
13860 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13861 while true
13862 do
13863         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13864         test "$CPPFLAGS" != "$cf_old_cflag" || break
13865         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13866
13867 echo "${as_me:-configure}:13867: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13868
13869         CPPFLAGS="$cf_old_cflag"
13870 done
13871
13872                 ;;
13873         esac
13874
13875 cf_fix_cppflags=no
13876 cf_new_cflags=
13877 cf_new_cppflags=
13878 cf_new_extra_cppflags=
13879
13880 for cf_add_cflags in $cf_add_cflags
13881 do
13882 case "$cf_fix_cppflags" in
13883 (no)
13884         case "$cf_add_cflags" in
13885         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13886                 case "$cf_add_cflags" in
13887                 (-D*)
13888                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13889
13890                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13891                                 && test -z "${cf_tst_cflags}" \
13892                                 && cf_fix_cppflags=yes
13893
13894                         if test "$cf_fix_cppflags" = yes ; then
13895
13896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13898
13899                                 continue
13900                         elif test "${cf_tst_cflags}" = "\"'" ; then
13901
13902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13904
13905                                 continue
13906                         fi
13907                         ;;
13908                 esac
13909                 case "$CPPFLAGS" in
13910                 (*$cf_add_cflags)
13911                         ;;
13912                 (*)
13913                         case "$cf_add_cflags" in
13914                         (-D*)
13915                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13916
13917 CPPFLAGS=`echo "$CPPFLAGS" | \
13918         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13919                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13920
13921                                 ;;
13922                         esac
13923
13924         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13925         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13926
13927                         ;;
13928                 esac
13929                 ;;
13930         (*)
13931
13932         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13933         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13934
13935                 ;;
13936         esac
13937         ;;
13938 (yes)
13939
13940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13942
13943         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13944
13945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13946                 && test -z "${cf_tst_cflags}" \
13947                 && cf_fix_cppflags=no
13948         ;;
13949 esac
13950 done
13951
13952 if test -n "$cf_new_cflags" ; then
13953         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13954
13955 echo "${as_me:-configure}:13955: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13956
13957         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13958         CFLAGS="${CFLAGS}$cf_new_cflags"
13959
13960 fi
13961
13962 if test -n "$cf_new_cppflags" ; then
13963         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13964
13965 echo "${as_me:-configure}:13965: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13966
13967         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13968         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13969
13970 fi
13971
13972 if test -n "$cf_new_extra_cppflags" ; then
13973         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13974
13975 echo "${as_me:-configure}:13975: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13976
13977         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13978         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13979
13980 fi
13981
13982 done
13983
13984 fi
13985
13986 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13987         echo "$as_me:13987: checking if _XOPEN_SOURCE really is set" >&5
13988 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13989         cat >"conftest.$ac_ext" <<_ACEOF
13990 #line 13990 "configure"
13991 #include "confdefs.h"
13992 #include <stdlib.h>
13993 int
13994 main (void)
13995 {
13996
13997 #ifndef _XOPEN_SOURCE
13998 make an error
13999 #endif
14000   ;
14001   return 0;
14002 }
14003 _ACEOF
14004 rm -f "conftest.$ac_objext"
14005 if { (eval echo "$as_me:14005: \"$ac_compile\"") >&5
14006   (eval $ac_compile) 2>&5
14007   ac_status=$?
14008   echo "$as_me:14008: \$? = $ac_status" >&5
14009   (exit "$ac_status"); } &&
14010          { ac_try='test -s "conftest.$ac_objext"'
14011   { (eval echo "$as_me:14011: \"$ac_try\"") >&5
14012   (eval $ac_try) 2>&5
14013   ac_status=$?
14014   echo "$as_me:14014: \$? = $ac_status" >&5
14015   (exit "$ac_status"); }; }; then
14016   cf_XOPEN_SOURCE_set=yes
14017 else
14018   echo "$as_me: failed program was:" >&5
14019 cat "conftest.$ac_ext" >&5
14020 cf_XOPEN_SOURCE_set=no
14021 fi
14022 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14023         echo "$as_me:14023: result: $cf_XOPEN_SOURCE_set" >&5
14024 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14025         if test "$cf_XOPEN_SOURCE_set" = yes
14026         then
14027                 cat >"conftest.$ac_ext" <<_ACEOF
14028 #line 14028 "configure"
14029 #include "confdefs.h"
14030 #include <stdlib.h>
14031 int
14032 main (void)
14033 {
14034
14035 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14036 make an error
14037 #endif
14038   ;
14039   return 0;
14040 }
14041 _ACEOF
14042 rm -f "conftest.$ac_objext"
14043 if { (eval echo "$as_me:14043: \"$ac_compile\"") >&5
14044   (eval $ac_compile) 2>&5
14045   ac_status=$?
14046   echo "$as_me:14046: \$? = $ac_status" >&5
14047   (exit "$ac_status"); } &&
14048          { ac_try='test -s "conftest.$ac_objext"'
14049   { (eval echo "$as_me:14049: \"$ac_try\"") >&5
14050   (eval $ac_try) 2>&5
14051   ac_status=$?
14052   echo "$as_me:14052: \$? = $ac_status" >&5
14053   (exit "$ac_status"); }; }; then
14054   cf_XOPEN_SOURCE_set_ok=yes
14055 else
14056   echo "$as_me: failed program was:" >&5
14057 cat "conftest.$ac_ext" >&5
14058 cf_XOPEN_SOURCE_set_ok=no
14059 fi
14060 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14061                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14062                 then
14063                         { echo "$as_me:14063: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14064 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14065                 fi
14066         else
14067
14068 echo "$as_me:14068: checking if we should define _XOPEN_SOURCE" >&5
14069 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14070 if test "${cf_cv_xopen_source+set}" = set; then
14071   echo $ECHO_N "(cached) $ECHO_C" >&6
14072 else
14073
14074         cat >"conftest.$ac_ext" <<_ACEOF
14075 #line 14075 "configure"
14076 #include "confdefs.h"
14077
14078 #include <stdlib.h>
14079 #include <string.h>
14080 #include <sys/types.h>
14081
14082 int
14083 main (void)
14084 {
14085
14086 #ifndef _XOPEN_SOURCE
14087 make an error
14088 #endif
14089
14090   ;
14091   return 0;
14092 }
14093 _ACEOF
14094 rm -f "conftest.$ac_objext"
14095 if { (eval echo "$as_me:14095: \"$ac_compile\"") >&5
14096   (eval $ac_compile) 2>&5
14097   ac_status=$?
14098   echo "$as_me:14098: \$? = $ac_status" >&5
14099   (exit "$ac_status"); } &&
14100          { ac_try='test -s "conftest.$ac_objext"'
14101   { (eval echo "$as_me:14101: \"$ac_try\"") >&5
14102   (eval $ac_try) 2>&5
14103   ac_status=$?
14104   echo "$as_me:14104: \$? = $ac_status" >&5
14105   (exit "$ac_status"); }; }; then
14106   cf_cv_xopen_source=no
14107 else
14108   echo "$as_me: failed program was:" >&5
14109 cat "conftest.$ac_ext" >&5
14110 cf_save="$CPPFLAGS"
14111
14112         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14113         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14114
14115          cat >"conftest.$ac_ext" <<_ACEOF
14116 #line 14116 "configure"
14117 #include "confdefs.h"
14118
14119 #include <stdlib.h>
14120 #include <string.h>
14121 #include <sys/types.h>
14122
14123 int
14124 main (void)
14125 {
14126
14127 #ifndef _XOPEN_SOURCE
14128 make an error
14129 #endif
14130
14131   ;
14132   return 0;
14133 }
14134 _ACEOF
14135 rm -f "conftest.$ac_objext"
14136 if { (eval echo "$as_me:14136: \"$ac_compile\"") >&5
14137   (eval $ac_compile) 2>&5
14138   ac_status=$?
14139   echo "$as_me:14139: \$? = $ac_status" >&5
14140   (exit "$ac_status"); } &&
14141          { ac_try='test -s "conftest.$ac_objext"'
14142   { (eval echo "$as_me:14142: \"$ac_try\"") >&5
14143   (eval $ac_try) 2>&5
14144   ac_status=$?
14145   echo "$as_me:14145: \$? = $ac_status" >&5
14146   (exit "$ac_status"); }; }; then
14147   cf_cv_xopen_source=no
14148 else
14149   echo "$as_me: failed program was:" >&5
14150 cat "conftest.$ac_ext" >&5
14151 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14152 fi
14153 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14154                 CPPFLAGS="$cf_save"
14155
14156 fi
14157 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14158
14159 fi
14160 echo "$as_me:14160: result: $cf_cv_xopen_source" >&5
14161 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14162
14163 if test "$cf_cv_xopen_source" != no ; then
14164
14165 CFLAGS=`echo "$CFLAGS" | \
14166         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14167                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14168
14169 CPPFLAGS=`echo "$CPPFLAGS" | \
14170         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14171                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14172
14173         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14174
14175 for cf_add_cflags in $cf_temp_xopen_source
14176 do
14177         case "x$cf_add_cflags" in
14178         (x-[DU]*)
14179
14180 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14181 while true
14182 do
14183         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14184         test "$CFLAGS" != "$cf_old_cflag" || break
14185
14186         CFLAGS="$cf_old_cflag"
14187 done
14188
14189 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14190 while true
14191 do
14192         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14193         test "$CPPFLAGS" != "$cf_old_cflag" || break
14194
14195         CPPFLAGS="$cf_old_cflag"
14196 done
14197
14198                 ;;
14199         esac
14200
14201 cf_fix_cppflags=no
14202 cf_new_cflags=
14203 cf_new_cppflags=
14204 cf_new_extra_cppflags=
14205
14206 for cf_add_cflags in $cf_add_cflags
14207 do
14208 case "$cf_fix_cppflags" in
14209 (no)
14210         case "$cf_add_cflags" in
14211         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14212                 case "$cf_add_cflags" in
14213                 (-D*)
14214                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14215
14216                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14217                                 && test -z "${cf_tst_cflags}" \
14218                                 && cf_fix_cppflags=yes
14219
14220                         if test "$cf_fix_cppflags" = yes ; then
14221
14222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14224
14225                                 continue
14226                         elif test "${cf_tst_cflags}" = "\"'" ; then
14227
14228         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14229         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14230
14231                                 continue
14232                         fi
14233                         ;;
14234                 esac
14235                 case "$CPPFLAGS" in
14236                 (*$cf_add_cflags)
14237                         ;;
14238                 (*)
14239                         case "$cf_add_cflags" in
14240                         (-D*)
14241                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14242
14243 CPPFLAGS=`echo "$CPPFLAGS" | \
14244         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14245                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14246
14247                                 ;;
14248                         esac
14249
14250         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14251         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14252
14253                         ;;
14254                 esac
14255                 ;;
14256         (*)
14257
14258         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14259         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14260
14261                 ;;
14262         esac
14263         ;;
14264 (yes)
14265
14266         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14267         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14268
14269         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14270
14271         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14272                 && test -z "${cf_tst_cflags}" \
14273                 && cf_fix_cppflags=no
14274         ;;
14275 esac
14276 done
14277
14278 if test -n "$cf_new_cflags" ; then
14279
14280         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14281         CFLAGS="${CFLAGS}$cf_new_cflags"
14282
14283 fi
14284
14285 if test -n "$cf_new_cppflags" ; then
14286
14287         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14288         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14289
14290 fi
14291
14292 if test -n "$cf_new_extra_cppflags" ; then
14293
14294         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14295         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14296
14297 fi
14298
14299 done
14300
14301 fi
14302
14303         fi
14304 fi
14305 fi # cf_cv_posix_visible
14306
14307 # Check whether --enable-largefile or --disable-largefile was given.
14308 if test "${enable_largefile+set}" = set; then
14309   enableval="$enable_largefile"
14310
14311 fi;
14312 if test "$enable_largefile" != no; then
14313
14314   echo "$as_me:14314: checking for special C compiler options needed for large files" >&5
14315 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14316 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14317   echo $ECHO_N "(cached) $ECHO_C" >&6
14318 else
14319   ac_cv_sys_largefile_CC=no
14320      if test "$GCC" != yes; then
14321        ac_save_CC=$CC
14322        while :; do
14323          # IRIX 6.2 and later do not support large files by default,
14324          # so use the C compiler's -n32 option if that helps.
14325          cat >"conftest.$ac_ext" <<_ACEOF
14326 #line 14326 "configure"
14327 #include "confdefs.h"
14328 #include <sys/types.h>
14329  /* Check that off_t can represent 2**63 - 1 correctly.
14330     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14331     since some C++ compilers masquerading as C compilers
14332     incorrectly reject 9223372036854775807.  */
14333 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14334   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14335                        && LARGE_OFF_T % 2147483647 == 1)
14336                       ? 1 : -1];
14337 int
14338 main (void)
14339 {
14340
14341   ;
14342   return 0;
14343 }
14344 _ACEOF
14345          rm -f "conftest.$ac_objext"
14346 if { (eval echo "$as_me:14346: \"$ac_compile\"") >&5
14347   (eval $ac_compile) 2>&5
14348   ac_status=$?
14349   echo "$as_me:14349: \$? = $ac_status" >&5
14350   (exit "$ac_status"); } &&
14351          { ac_try='test -s "conftest.$ac_objext"'
14352   { (eval echo "$as_me:14352: \"$ac_try\"") >&5
14353   (eval $ac_try) 2>&5
14354   ac_status=$?
14355   echo "$as_me:14355: \$? = $ac_status" >&5
14356   (exit "$ac_status"); }; }; then
14357   break
14358 else
14359   echo "$as_me: failed program was:" >&5
14360 cat "conftest.$ac_ext" >&5
14361 fi
14362 rm -f "conftest.$ac_objext"
14363          CC="$CC -n32"
14364          rm -f "conftest.$ac_objext"
14365 if { (eval echo "$as_me:14365: \"$ac_compile\"") >&5
14366   (eval $ac_compile) 2>&5
14367   ac_status=$?
14368   echo "$as_me:14368: \$? = $ac_status" >&5
14369   (exit "$ac_status"); } &&
14370          { ac_try='test -s "conftest.$ac_objext"'
14371   { (eval echo "$as_me:14371: \"$ac_try\"") >&5
14372   (eval $ac_try) 2>&5
14373   ac_status=$?
14374   echo "$as_me:14374: \$? = $ac_status" >&5
14375   (exit "$ac_status"); }; }; then
14376   ac_cv_sys_largefile_CC=' -n32'; break
14377 else
14378   echo "$as_me: failed program was:" >&5
14379 cat "conftest.$ac_ext" >&5
14380 fi
14381 rm -f "conftest.$ac_objext"
14382          break
14383        done
14384        CC=$ac_save_CC
14385        rm -f "conftest.$ac_ext"
14386     fi
14387 fi
14388 echo "$as_me:14388: result: $ac_cv_sys_largefile_CC" >&5
14389 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14390   if test "$ac_cv_sys_largefile_CC" != no; then
14391     CC=$CC$ac_cv_sys_largefile_CC
14392   fi
14393
14394   echo "$as_me:14394: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14395 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14396 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14397   echo $ECHO_N "(cached) $ECHO_C" >&6
14398 else
14399   while :; do
14400   ac_cv_sys_file_offset_bits=no
14401   cat >"conftest.$ac_ext" <<_ACEOF
14402 #line 14402 "configure"
14403 #include "confdefs.h"
14404 #include <sys/types.h>
14405  /* Check that off_t can represent 2**63 - 1 correctly.
14406     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14407     since some C++ compilers masquerading as C compilers
14408     incorrectly reject 9223372036854775807.  */
14409 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14410   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14411                        && LARGE_OFF_T % 2147483647 == 1)
14412                       ? 1 : -1];
14413 int
14414 main (void)
14415 {
14416
14417   ;
14418   return 0;
14419 }
14420 _ACEOF
14421 rm -f "conftest.$ac_objext"
14422 if { (eval echo "$as_me:14422: \"$ac_compile\"") >&5
14423   (eval $ac_compile) 2>&5
14424   ac_status=$?
14425   echo "$as_me:14425: \$? = $ac_status" >&5
14426   (exit "$ac_status"); } &&
14427          { ac_try='test -s "conftest.$ac_objext"'
14428   { (eval echo "$as_me:14428: \"$ac_try\"") >&5
14429   (eval $ac_try) 2>&5
14430   ac_status=$?
14431   echo "$as_me:14431: \$? = $ac_status" >&5
14432   (exit "$ac_status"); }; }; then
14433   break
14434 else
14435   echo "$as_me: failed program was:" >&5
14436 cat "conftest.$ac_ext" >&5
14437 fi
14438 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14439   cat >"conftest.$ac_ext" <<_ACEOF
14440 #line 14440 "configure"
14441 #include "confdefs.h"
14442 #define _FILE_OFFSET_BITS 64
14443 #include <sys/types.h>
14444  /* Check that off_t can represent 2**63 - 1 correctly.
14445     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14446     since some C++ compilers masquerading as C compilers
14447     incorrectly reject 9223372036854775807.  */
14448 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14449   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14450                        && LARGE_OFF_T % 2147483647 == 1)
14451                       ? 1 : -1];
14452 int
14453 main (void)
14454 {
14455
14456   ;
14457   return 0;
14458 }
14459 _ACEOF
14460 rm -f "conftest.$ac_objext"
14461 if { (eval echo "$as_me:14461: \"$ac_compile\"") >&5
14462   (eval $ac_compile) 2>&5
14463   ac_status=$?
14464   echo "$as_me:14464: \$? = $ac_status" >&5
14465   (exit "$ac_status"); } &&
14466          { ac_try='test -s "conftest.$ac_objext"'
14467   { (eval echo "$as_me:14467: \"$ac_try\"") >&5
14468   (eval $ac_try) 2>&5
14469   ac_status=$?
14470   echo "$as_me:14470: \$? = $ac_status" >&5
14471   (exit "$ac_status"); }; }; then
14472   ac_cv_sys_file_offset_bits=64; break
14473 else
14474   echo "$as_me: failed program was:" >&5
14475 cat "conftest.$ac_ext" >&5
14476 fi
14477 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14478   break
14479 done
14480 fi
14481 echo "$as_me:14481: result: $ac_cv_sys_file_offset_bits" >&5
14482 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14483 if test "$ac_cv_sys_file_offset_bits" != no; then
14484
14485 cat >>confdefs.h <<EOF
14486 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14487 EOF
14488
14489 fi
14490 rm -rf conftest*
14491   echo "$as_me:14491: checking for _LARGE_FILES value needed for large files" >&5
14492 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14493 if test "${ac_cv_sys_large_files+set}" = set; then
14494   echo $ECHO_N "(cached) $ECHO_C" >&6
14495 else
14496   while :; do
14497   ac_cv_sys_large_files=no
14498   cat >"conftest.$ac_ext" <<_ACEOF
14499 #line 14499 "configure"
14500 #include "confdefs.h"
14501 #include <sys/types.h>
14502  /* Check that off_t can represent 2**63 - 1 correctly.
14503     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14504     since some C++ compilers masquerading as C compilers
14505     incorrectly reject 9223372036854775807.  */
14506 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14507   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14508                        && LARGE_OFF_T % 2147483647 == 1)
14509                       ? 1 : -1];
14510 int
14511 main (void)
14512 {
14513
14514   ;
14515   return 0;
14516 }
14517 _ACEOF
14518 rm -f "conftest.$ac_objext"
14519 if { (eval echo "$as_me:14519: \"$ac_compile\"") >&5
14520   (eval $ac_compile) 2>&5
14521   ac_status=$?
14522   echo "$as_me:14522: \$? = $ac_status" >&5
14523   (exit "$ac_status"); } &&
14524          { ac_try='test -s "conftest.$ac_objext"'
14525   { (eval echo "$as_me:14525: \"$ac_try\"") >&5
14526   (eval $ac_try) 2>&5
14527   ac_status=$?
14528   echo "$as_me:14528: \$? = $ac_status" >&5
14529   (exit "$ac_status"); }; }; then
14530   break
14531 else
14532   echo "$as_me: failed program was:" >&5
14533 cat "conftest.$ac_ext" >&5
14534 fi
14535 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14536   cat >"conftest.$ac_ext" <<_ACEOF
14537 #line 14537 "configure"
14538 #include "confdefs.h"
14539 #define _LARGE_FILES 1
14540 #include <sys/types.h>
14541  /* Check that off_t can represent 2**63 - 1 correctly.
14542     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14543     since some C++ compilers masquerading as C compilers
14544     incorrectly reject 9223372036854775807.  */
14545 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14546   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14547                        && LARGE_OFF_T % 2147483647 == 1)
14548                       ? 1 : -1];
14549 int
14550 main (void)
14551 {
14552
14553   ;
14554   return 0;
14555 }
14556 _ACEOF
14557 rm -f "conftest.$ac_objext"
14558 if { (eval echo "$as_me:14558: \"$ac_compile\"") >&5
14559   (eval $ac_compile) 2>&5
14560   ac_status=$?
14561   echo "$as_me:14561: \$? = $ac_status" >&5
14562   (exit "$ac_status"); } &&
14563          { ac_try='test -s "conftest.$ac_objext"'
14564   { (eval echo "$as_me:14564: \"$ac_try\"") >&5
14565   (eval $ac_try) 2>&5
14566   ac_status=$?
14567   echo "$as_me:14567: \$? = $ac_status" >&5
14568   (exit "$ac_status"); }; }; then
14569   ac_cv_sys_large_files=1; break
14570 else
14571   echo "$as_me: failed program was:" >&5
14572 cat "conftest.$ac_ext" >&5
14573 fi
14574 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14575   break
14576 done
14577 fi
14578 echo "$as_me:14578: result: $ac_cv_sys_large_files" >&5
14579 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14580 if test "$ac_cv_sys_large_files" != no; then
14581
14582 cat >>confdefs.h <<EOF
14583 #define _LARGE_FILES $ac_cv_sys_large_files
14584 EOF
14585
14586 fi
14587 rm -rf conftest*
14588 fi
14589
14590         if test "$enable_largefile" != no ; then
14591         echo "$as_me:14591: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14592 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14593 if test "${ac_cv_sys_largefile_source+set}" = set; then
14594   echo $ECHO_N "(cached) $ECHO_C" >&6
14595 else
14596   while :; do
14597   ac_cv_sys_largefile_source=no
14598   cat >"conftest.$ac_ext" <<_ACEOF
14599 #line 14599 "configure"
14600 #include "confdefs.h"
14601 #include <stdio.h>
14602 int
14603 main (void)
14604 {
14605 return !fseeko;
14606   ;
14607   return 0;
14608 }
14609 _ACEOF
14610 rm -f "conftest.$ac_objext"
14611 if { (eval echo "$as_me:14611: \"$ac_compile\"") >&5
14612   (eval $ac_compile) 2>&5
14613   ac_status=$?
14614   echo "$as_me:14614: \$? = $ac_status" >&5
14615   (exit "$ac_status"); } &&
14616          { ac_try='test -s "conftest.$ac_objext"'
14617   { (eval echo "$as_me:14617: \"$ac_try\"") >&5
14618   (eval $ac_try) 2>&5
14619   ac_status=$?
14620   echo "$as_me:14620: \$? = $ac_status" >&5
14621   (exit "$ac_status"); }; }; then
14622   break
14623 else
14624   echo "$as_me: failed program was:" >&5
14625 cat "conftest.$ac_ext" >&5
14626 fi
14627 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14628   cat >"conftest.$ac_ext" <<_ACEOF
14629 #line 14629 "configure"
14630 #include "confdefs.h"
14631 #define _LARGEFILE_SOURCE 1
14632 #include <stdio.h>
14633 int
14634 main (void)
14635 {
14636 return !fseeko;
14637   ;
14638   return 0;
14639 }
14640 _ACEOF
14641 rm -f "conftest.$ac_objext"
14642 if { (eval echo "$as_me:14642: \"$ac_compile\"") >&5
14643   (eval $ac_compile) 2>&5
14644   ac_status=$?
14645   echo "$as_me:14645: \$? = $ac_status" >&5
14646   (exit "$ac_status"); } &&
14647          { ac_try='test -s "conftest.$ac_objext"'
14648   { (eval echo "$as_me:14648: \"$ac_try\"") >&5
14649   (eval $ac_try) 2>&5
14650   ac_status=$?
14651   echo "$as_me:14651: \$? = $ac_status" >&5
14652   (exit "$ac_status"); }; }; then
14653   ac_cv_sys_largefile_source=1; break
14654 else
14655   echo "$as_me: failed program was:" >&5
14656 cat "conftest.$ac_ext" >&5
14657 fi
14658 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14659   break
14660 done
14661 fi
14662 echo "$as_me:14662: result: $ac_cv_sys_largefile_source" >&5
14663 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14664 if test "$ac_cv_sys_largefile_source" != no; then
14665
14666 cat >>confdefs.h <<EOF
14667 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14668 EOF
14669
14670 fi
14671 rm -rf conftest*
14672
14673 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14674 # in glibc 2.1.3, but that breaks too many other things.
14675 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14676 echo "$as_me:14676: checking for fseeko" >&5
14677 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14678 if test "${ac_cv_func_fseeko+set}" = set; then
14679   echo $ECHO_N "(cached) $ECHO_C" >&6
14680 else
14681   cat >"conftest.$ac_ext" <<_ACEOF
14682 #line 14682 "configure"
14683 #include "confdefs.h"
14684 #include <stdio.h>
14685 int
14686 main (void)
14687 {
14688 return fseeko && fseeko (stdin, 0, 0);
14689   ;
14690   return 0;
14691 }
14692 _ACEOF
14693 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14694 if { (eval echo "$as_me:14694: \"$ac_link\"") >&5
14695   (eval $ac_link) 2>&5
14696   ac_status=$?
14697   echo "$as_me:14697: \$? = $ac_status" >&5
14698   (exit "$ac_status"); } &&
14699          { ac_try='test -s "conftest$ac_exeext"'
14700   { (eval echo "$as_me:14700: \"$ac_try\"") >&5
14701   (eval $ac_try) 2>&5
14702   ac_status=$?
14703   echo "$as_me:14703: \$? = $ac_status" >&5
14704   (exit "$ac_status"); }; }; then
14705   ac_cv_func_fseeko=yes
14706 else
14707   echo "$as_me: failed program was:" >&5
14708 cat "conftest.$ac_ext" >&5
14709 ac_cv_func_fseeko=no
14710 fi
14711 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14712 fi
14713 echo "$as_me:14713: result: $ac_cv_func_fseeko" >&5
14714 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14715 if test $ac_cv_func_fseeko = yes; then
14716
14717 cat >>confdefs.h <<\EOF
14718 #define HAVE_FSEEKO 1
14719 EOF
14720
14721 fi
14722
14723         # Normally we would collect these definitions in the config.h,
14724         # but (like _XOPEN_SOURCE), some environments rely on having these
14725         # defined before any of the system headers are included.  Another
14726         # case comes up with C++, e.g., on AIX the compiler compiles the
14727         # header files by themselves before looking at the body files it is
14728         # told to compile.  For ncurses, those header files do not include
14729         # the config.h
14730         if test "$ac_cv_sys_large_files" != no
14731         then
14732
14733         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14734         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14735
14736         fi
14737         if test "$ac_cv_sys_largefile_source" != no
14738         then
14739
14740         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14741         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14742
14743         fi
14744         if test "$ac_cv_sys_file_offset_bits" != no
14745         then
14746
14747         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14748         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14749
14750         fi
14751
14752         echo "$as_me:14752: checking whether to use struct dirent64" >&5
14753 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14754 if test "${cf_cv_struct_dirent64+set}" = set; then
14755   echo $ECHO_N "(cached) $ECHO_C" >&6
14756 else
14757
14758                 cat >"conftest.$ac_ext" <<_ACEOF
14759 #line 14759 "configure"
14760 #include "confdefs.h"
14761
14762 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14763 #include <sys/types.h>
14764 #include <dirent.h>
14765
14766 int
14767 main (void)
14768 {
14769
14770                 /* if transitional largefile support is setup, this is true */
14771                 extern struct dirent64 * readdir(DIR *);
14772                 struct dirent64 *x = readdir((DIR *)0);
14773                 struct dirent *y = readdir((DIR *)0);
14774                 int z = x - y;
14775                 (void)z;
14776
14777   ;
14778   return 0;
14779 }
14780 _ACEOF
14781 rm -f "conftest.$ac_objext"
14782 if { (eval echo "$as_me:14782: \"$ac_compile\"") >&5
14783   (eval $ac_compile) 2>&5
14784   ac_status=$?
14785   echo "$as_me:14785: \$? = $ac_status" >&5
14786   (exit "$ac_status"); } &&
14787          { ac_try='test -s "conftest.$ac_objext"'
14788   { (eval echo "$as_me:14788: \"$ac_try\"") >&5
14789   (eval $ac_try) 2>&5
14790   ac_status=$?
14791   echo "$as_me:14791: \$? = $ac_status" >&5
14792   (exit "$ac_status"); }; }; then
14793   cf_cv_struct_dirent64=yes
14794 else
14795   echo "$as_me: failed program was:" >&5
14796 cat "conftest.$ac_ext" >&5
14797 cf_cv_struct_dirent64=no
14798 fi
14799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14800
14801 fi
14802 echo "$as_me:14802: result: $cf_cv_struct_dirent64" >&5
14803 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14804         test "$cf_cv_struct_dirent64" = yes &&
14805 cat >>confdefs.h <<\EOF
14806 #define HAVE_STRUCT_DIRENT64 1
14807 EOF
14808
14809         fi
14810
14811 ### Enable compiling-in rcs id's
14812 echo "$as_me:14812: checking if RCS identifiers should be compiled-in" >&5
14813 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14814
14815 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14816 if test "${with_rcs_ids+set}" = set; then
14817   withval="$with_rcs_ids"
14818   with_rcs_ids=$withval
14819 else
14820   with_rcs_ids=no
14821 fi;
14822 echo "$as_me:14822: result: $with_rcs_ids" >&5
14823 echo "${ECHO_T}$with_rcs_ids" >&6
14824 test "$with_rcs_ids" = yes &&
14825 cat >>confdefs.h <<\EOF
14826 #define USE_RCS_IDS 1
14827 EOF
14828
14829 ###############################################################################
14830
14831 ### Note that some functions (such as const) are normally disabled anyway.
14832 echo "$as_me:14832: checking if you want to build with function extensions" >&5
14833 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14834
14835 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14836 if test "${enable_ext_funcs+set}" = set; then
14837   enableval="$enable_ext_funcs"
14838   with_ext_funcs=$enableval
14839 else
14840   with_ext_funcs=yes
14841 fi;
14842 echo "$as_me:14842: result: $with_ext_funcs" >&5
14843 echo "${ECHO_T}$with_ext_funcs" >&6
14844 if test "$with_ext_funcs" = yes ; then
14845         NCURSES_EXT_FUNCS=1
14846
14847 cat >>confdefs.h <<\EOF
14848 #define HAVE_USE_DEFAULT_COLORS 1
14849 EOF
14850
14851 cat >>confdefs.h <<\EOF
14852 #define NCURSES_EXT_FUNCS 1
14853 EOF
14854
14855 else
14856         NCURSES_EXT_FUNCS=0
14857 fi
14858
14859 ###   use option --enable-const to turn on use of const beyond that in XSI.
14860 echo "$as_me:14860: checking for extended use of const keyword" >&5
14861 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14862
14863 # Check whether --enable-const or --disable-const was given.
14864 if test "${enable_const+set}" = set; then
14865   enableval="$enable_const"
14866   with_ext_const=$enableval
14867 else
14868   with_ext_const=no
14869 fi;
14870 echo "$as_me:14870: result: $with_ext_const" >&5
14871 echo "${ECHO_T}$with_ext_const" >&6
14872 NCURSES_CONST='/*nothing*/'
14873 if test "$with_ext_const" = yes ; then
14874         NCURSES_CONST=const
14875 fi
14876
14877 ###############################################################################
14878 # These options are relatively safe to experiment with.
14879
14880 echo "$as_me:14880: checking if you want all development code" >&5
14881 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14882
14883 # Check whether --with-develop or --without-develop was given.
14884 if test "${with_develop+set}" = set; then
14885   withval="$with_develop"
14886   with_develop=$withval
14887 else
14888   with_develop=no
14889 fi;
14890 echo "$as_me:14890: result: $with_develop" >&5
14891 echo "${ECHO_T}$with_develop" >&6
14892
14893 ###############################################################################
14894 # These are just experimental, probably should not be in a package:
14895
14896 # This is still experimental (20080329), but should ultimately be moved to
14897 # the script-block --with-normal, etc.
14898
14899 echo "$as_me:14899: checking if you want to link with the pthread library" >&5
14900 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14901
14902 # Check whether --with-pthread or --without-pthread was given.
14903 if test "${with_pthread+set}" = set; then
14904   withval="$with_pthread"
14905   with_pthread=$withval
14906 else
14907   with_pthread=no
14908 fi;
14909 echo "$as_me:14909: result: $with_pthread" >&5
14910 echo "${ECHO_T}$with_pthread" >&6
14911
14912 if test "$with_pthread" != no ; then
14913         echo "$as_me:14913: checking for pthread.h" >&5
14914 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14915 if test "${ac_cv_header_pthread_h+set}" = set; then
14916   echo $ECHO_N "(cached) $ECHO_C" >&6
14917 else
14918   cat >"conftest.$ac_ext" <<_ACEOF
14919 #line 14919 "configure"
14920 #include "confdefs.h"
14921 #include <pthread.h>
14922 _ACEOF
14923 if { (eval echo "$as_me:14923: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14924   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14925   ac_status=$?
14926   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14927   rm -f conftest.er1
14928   cat conftest.err >&5
14929   echo "$as_me:14929: \$? = $ac_status" >&5
14930   (exit "$ac_status"); } >/dev/null; then
14931   if test -s conftest.err; then
14932     ac_cpp_err=$ac_c_preproc_warn_flag
14933   else
14934     ac_cpp_err=
14935   fi
14936 else
14937   ac_cpp_err=yes
14938 fi
14939 if test -z "$ac_cpp_err"; then
14940   ac_cv_header_pthread_h=yes
14941 else
14942   echo "$as_me: failed program was:" >&5
14943   cat "conftest.$ac_ext" >&5
14944   ac_cv_header_pthread_h=no
14945 fi
14946 rm -f conftest.err "conftest.$ac_ext"
14947 fi
14948 echo "$as_me:14948: result: $ac_cv_header_pthread_h" >&5
14949 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14950 if test "$ac_cv_header_pthread_h" = yes; then
14951
14952 cat >>confdefs.h <<\EOF
14953 #define HAVE_PTHREADS_H 1
14954 EOF
14955
14956         for cf_lib_pthread in pthread c_r
14957         do
14958             echo "$as_me:14958: checking if we can link with the $cf_lib_pthread library" >&5
14959 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14960             cf_save_LIBS="$LIBS"
14961
14962 cf_add_libs="$LIBS"
14963 # reverse order
14964 cf_add_0lib=
14965 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14966 # filter duplicates
14967 for cf_add_1lib in $cf_add_0lib; do
14968         for cf_add_2lib in $cf_add_libs; do
14969                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14970                         cf_add_1lib=
14971                         break
14972                 fi
14973         done
14974         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14975 done
14976 LIBS="$cf_add_libs"
14977
14978             cat >"conftest.$ac_ext" <<_ACEOF
14979 #line 14979 "configure"
14980 #include "confdefs.h"
14981
14982 #include <pthread.h>
14983
14984 int
14985 main (void)
14986 {
14987
14988                 int rc = pthread_create(0,0,0,0);
14989                 int r2 = pthread_mutexattr_settype(0, 0);
14990
14991   ;
14992   return 0;
14993 }
14994 _ACEOF
14995 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14996 if { (eval echo "$as_me:14996: \"$ac_link\"") >&5
14997   (eval $ac_link) 2>&5
14998   ac_status=$?
14999   echo "$as_me:14999: \$? = $ac_status" >&5
15000   (exit "$ac_status"); } &&
15001          { ac_try='test -s "conftest$ac_exeext"'
15002   { (eval echo "$as_me:15002: \"$ac_try\"") >&5
15003   (eval $ac_try) 2>&5
15004   ac_status=$?
15005   echo "$as_me:15005: \$? = $ac_status" >&5
15006   (exit "$ac_status"); }; }; then
15007   with_pthread=yes
15008 else
15009   echo "$as_me: failed program was:" >&5
15010 cat "conftest.$ac_ext" >&5
15011 with_pthread=no
15012 fi
15013 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15014             LIBS="$cf_save_LIBS"
15015             echo "$as_me:15015: result: $with_pthread" >&5
15016 echo "${ECHO_T}$with_pthread" >&6
15017             test "$with_pthread" = yes && break
15018         done
15019
15020         if test "$with_pthread" = yes ; then
15021
15022 cf_add_libs="$LIBS"
15023 # reverse order
15024 cf_add_0lib=
15025 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15026 # filter duplicates
15027 for cf_add_1lib in $cf_add_0lib; do
15028         for cf_add_2lib in $cf_add_libs; do
15029                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15030                         cf_add_1lib=
15031                         break
15032                 fi
15033         done
15034         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15035 done
15036 LIBS="$cf_add_libs"
15037
15038 cat >>confdefs.h <<\EOF
15039 #define HAVE_LIBPTHREADS 1
15040 EOF
15041
15042         else
15043             { { echo "$as_me:15043: error: Cannot link with pthread library" >&5
15044 echo "$as_me: error: Cannot link with pthread library" >&2;}
15045    { (exit 1); exit 1; }; }
15046         fi
15047
15048 fi
15049
15050 fi
15051
15052 echo "$as_me:15052: checking if you want to use weak-symbols for pthreads" >&5
15053 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15054
15055 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15056 if test "${enable_weak_symbols+set}" = set; then
15057   enableval="$enable_weak_symbols"
15058   use_weak_symbols=$withval
15059 else
15060   use_weak_symbols=no
15061 fi;
15062 echo "$as_me:15062: result: $use_weak_symbols" >&5
15063 echo "${ECHO_T}$use_weak_symbols" >&6
15064 if test "$use_weak_symbols" = yes ; then
15065
15066 echo "$as_me:15066: checking if $CC supports weak symbols" >&5
15067 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15068 if test "${cf_cv_weak_symbols+set}" = set; then
15069   echo $ECHO_N "(cached) $ECHO_C" >&6
15070 else
15071
15072 cat >"conftest.$ac_ext" <<_ACEOF
15073 #line 15073 "configure"
15074 #include "confdefs.h"
15075
15076 #include <stdio.h>
15077 int
15078 main (void)
15079 {
15080
15081 #if defined(__GNUC__)
15082 #  if defined __USE_ISOC99
15083 #    define _cat_pragma(exp)    _Pragma(#exp)
15084 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15085 #  else
15086 #    define _weak_pragma(exp)
15087 #  endif
15088 #  define _declare(name)        __extension__ extern __typeof__(name) name
15089 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15090 #endif
15091
15092 weak_symbol(fopen);
15093
15094   ;
15095   return 0;
15096 }
15097 _ACEOF
15098 rm -f "conftest.$ac_objext"
15099 if { (eval echo "$as_me:15099: \"$ac_compile\"") >&5
15100   (eval $ac_compile) 2>&5
15101   ac_status=$?
15102   echo "$as_me:15102: \$? = $ac_status" >&5
15103   (exit "$ac_status"); } &&
15104          { ac_try='test -s "conftest.$ac_objext"'
15105   { (eval echo "$as_me:15105: \"$ac_try\"") >&5
15106   (eval $ac_try) 2>&5
15107   ac_status=$?
15108   echo "$as_me:15108: \$? = $ac_status" >&5
15109   (exit "$ac_status"); }; }; then
15110   cf_cv_weak_symbols=yes
15111 else
15112   echo "$as_me: failed program was:" >&5
15113 cat "conftest.$ac_ext" >&5
15114 cf_cv_weak_symbols=no
15115 fi
15116 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15117
15118 fi
15119 echo "$as_me:15119: result: $cf_cv_weak_symbols" >&5
15120 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15121
15122 else
15123         cf_cv_weak_symbols=no
15124 fi
15125
15126 if test $cf_cv_weak_symbols = yes ; then
15127
15128 cat >>confdefs.h <<\EOF
15129 #define USE_WEAK_SYMBOLS 1
15130 EOF
15131
15132 fi
15133
15134 PTHREAD=
15135 if test "$with_pthread" = "yes" ; then
15136
15137 cat >>confdefs.h <<\EOF
15138 #define USE_PTHREADS 1
15139 EOF
15140
15141         enable_reentrant=yes
15142         if test $cf_cv_weak_symbols = yes ; then
15143                 PTHREAD=-lpthread
15144         fi
15145 fi
15146
15147 # OpenSUSE is installing ncurses6, using reentrant option.
15148 echo "$as_me:15148: checking for _nc_TABSIZE" >&5
15149 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15150 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15151   echo $ECHO_N "(cached) $ECHO_C" >&6
15152 else
15153   cat >"conftest.$ac_ext" <<_ACEOF
15154 #line 15154 "configure"
15155 #include "confdefs.h"
15156 #define _nc_TABSIZE autoconf_temporary
15157 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15158 #undef _nc_TABSIZE
15159
15160 #ifdef __cplusplus
15161 extern "C"
15162 #endif
15163
15164 /* We use char because int might match the return type of a gcc2
15165    builtin and then its argument prototype would still apply.  */
15166 char _nc_TABSIZE (void);
15167
15168 int
15169 main (void)
15170 {
15171
15172 /* The GNU C library defines stubs for functions which it implements
15173     to always fail with ENOSYS.  Some functions are actually named
15174     something starting with __ and the normal name is an alias.  */
15175 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15176 #error found stub for _nc_TABSIZE
15177 #endif
15178
15179         return _nc_TABSIZE ();
15180   ;
15181   return 0;
15182 }
15183 _ACEOF
15184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15185 if { (eval echo "$as_me:15185: \"$ac_link\"") >&5
15186   (eval $ac_link) 2>&5
15187   ac_status=$?
15188   echo "$as_me:15188: \$? = $ac_status" >&5
15189   (exit "$ac_status"); } &&
15190          { ac_try='test -s "conftest$ac_exeext"'
15191   { (eval echo "$as_me:15191: \"$ac_try\"") >&5
15192   (eval $ac_try) 2>&5
15193   ac_status=$?
15194   echo "$as_me:15194: \$? = $ac_status" >&5
15195   (exit "$ac_status"); }; }; then
15196   ac_cv_func__nc_TABSIZE=yes
15197 else
15198   echo "$as_me: failed program was:" >&5
15199 cat "conftest.$ac_ext" >&5
15200 ac_cv_func__nc_TABSIZE=no
15201 fi
15202 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15203 fi
15204 echo "$as_me:15204: result: $ac_cv_func__nc_TABSIZE" >&5
15205 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15206 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15207   assume_reentrant=yes
15208 else
15209   assume_reentrant=no
15210 fi
15211
15212 # Reentrant code has to be opaque; there's little advantage to making ncurses
15213 # opaque outside of that, so there is no --enable-opaque option.  We can use
15214 # this option without --with-pthreads, but this will be always set for
15215 # pthreads.
15216 echo "$as_me:15216: checking if you want experimental reentrant code" >&5
15217 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15218
15219 # Check whether --enable-reentrant or --disable-reentrant was given.
15220 if test "${enable_reentrant+set}" = set; then
15221   enableval="$enable_reentrant"
15222   with_reentrant=$enableval
15223 else
15224   with_reentrant=$assume_reentrant
15225 fi;
15226 echo "$as_me:15226: result: $with_reentrant" >&5
15227 echo "${ECHO_T}$with_reentrant" >&6
15228 if test "$with_reentrant" = yes ; then
15229         cf_cv_enable_reentrant=1
15230         if test $cf_cv_weak_symbols = yes ; then
15231
15232 # remove pthread library from $LIBS
15233 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15234
15235         elif test "$assume_reentrant" = no ; then
15236                 LIB_SUFFIX="t${LIB_SUFFIX}"
15237         fi
15238
15239 cat >>confdefs.h <<\EOF
15240 #define USE_REENTRANT 1
15241 EOF
15242
15243 else
15244         cf_cv_enable_reentrant=0
15245 fi
15246
15247 ### Allow using a different wrap-prefix
15248 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15249         echo "$as_me:15249: checking for prefix used to wrap public variables" >&5
15250 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15251
15252 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15253 if test "${with_wrap_prefix+set}" = set; then
15254   withval="$with_wrap_prefix"
15255   NCURSES_WRAP_PREFIX=$withval
15256 else
15257   NCURSES_WRAP_PREFIX=_nc_
15258 fi;
15259         echo "$as_me:15259: result: $NCURSES_WRAP_PREFIX" >&5
15260 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15261 else
15262         NCURSES_WRAP_PREFIX=_nc_
15263 fi
15264
15265 cat >>confdefs.h <<EOF
15266 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15267 EOF
15268
15269 ###############################################################################
15270
15271 ###     use option --disable-echo to suppress full display compiling commands
15272
15273 echo "$as_me:15273: checking if you want to see long compiling messages" >&5
15274 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15275
15276 # Check whether --enable-echo or --disable-echo was given.
15277 if test "${enable_echo+set}" = set; then
15278   enableval="$enable_echo"
15279   test "$enableval" != no && enableval=yes
15280         if test "$enableval" != "yes" ; then
15281
15282         ECHO_LT='--silent'
15283         ECHO_LD='@echo linking $@;'
15284         RULE_CC='@echo compiling $<'
15285         SHOW_CC='@echo compiling $@'
15286         ECHO_CC='@'
15287
15288         else
15289
15290         ECHO_LT=''
15291         ECHO_LD=''
15292         RULE_CC=''
15293         SHOW_CC=''
15294         ECHO_CC=''
15295
15296         fi
15297 else
15298   enableval=yes
15299
15300         ECHO_LT=''
15301         ECHO_LD=''
15302         RULE_CC=''
15303         SHOW_CC=''
15304         ECHO_CC=''
15305
15306 fi;
15307 echo "$as_me:15307: result: $enableval" >&5
15308 echo "${ECHO_T}$enableval" >&6
15309
15310 echo "$as_me:15310: checking if you want to use C11 _Noreturn feature" >&5
15311 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15312
15313 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15314 if test "${enable_stdnoreturn+set}" = set; then
15315   enableval="$enable_stdnoreturn"
15316   test "$enableval" != yes && enableval=no
15317         if test "$enableval" != "no" ; then
15318     enable_stdnoreturn=yes
15319         else
15320                 enable_stdnoreturn=no
15321         fi
15322 else
15323   enableval=no
15324         enable_stdnoreturn=no
15325
15326 fi;
15327 echo "$as_me:15327: result: $enable_stdnoreturn" >&5
15328 echo "${ECHO_T}$enable_stdnoreturn" >&6
15329
15330 if test $enable_stdnoreturn = yes; then
15331 echo "$as_me:15331: checking for C11 _Noreturn feature" >&5
15332 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15333 if test "${cf_cv_c11_noreturn+set}" = set; then
15334   echo $ECHO_N "(cached) $ECHO_C" >&6
15335 else
15336   cat >"conftest.$ac_ext" <<_ACEOF
15337 #line 15337 "configure"
15338 #include "confdefs.h"
15339
15340 #include <stdio.h>
15341 #include <stdlib.h>
15342 #include <stdnoreturn.h>
15343 static _Noreturn void giveup(void) { exit(0); }
15344
15345 int
15346 main (void)
15347 {
15348 if (feof(stdin)) giveup()
15349   ;
15350   return 0;
15351 }
15352 _ACEOF
15353 rm -f "conftest.$ac_objext"
15354 if { (eval echo "$as_me:15354: \"$ac_compile\"") >&5
15355   (eval $ac_compile) 2>&5
15356   ac_status=$?
15357   echo "$as_me:15357: \$? = $ac_status" >&5
15358   (exit "$ac_status"); } &&
15359          { ac_try='test -s "conftest.$ac_objext"'
15360   { (eval echo "$as_me:15360: \"$ac_try\"") >&5
15361   (eval $ac_try) 2>&5
15362   ac_status=$?
15363   echo "$as_me:15363: \$? = $ac_status" >&5
15364   (exit "$ac_status"); }; }; then
15365   cf_cv_c11_noreturn=yes
15366 else
15367   echo "$as_me: failed program was:" >&5
15368 cat "conftest.$ac_ext" >&5
15369 cf_cv_c11_noreturn=no
15370 fi
15371 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15372
15373 fi
15374 echo "$as_me:15374: result: $cf_cv_c11_noreturn" >&5
15375 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15376 else
15377         cf_cv_c11_noreturn=no,
15378 fi
15379
15380 if test "$cf_cv_c11_noreturn" = yes; then
15381
15382 cat >>confdefs.h <<\EOF
15383 #define HAVE_STDNORETURN_H 1
15384 EOF
15385
15386 cat >>confdefs.h <<EOF
15387 #define STDC_NORETURN _Noreturn
15388 EOF
15389
15390         HAVE_STDNORETURN_H=1
15391 else
15392         HAVE_STDNORETURN_H=0
15393 fi
15394
15395 if test "$GCC" = yes || test "$GXX" = yes
15396 then
15397
15398 if test "$GCC" = yes || test "$GXX" = yes
15399 then
15400         case $CFLAGS in
15401         (*-Werror=*)
15402                 cf_temp_flags=
15403                 for cf_temp_scan in $CFLAGS
15404                 do
15405                         case "x$cf_temp_scan" in
15406                         (x-Werror=format*)
15407
15408         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15409         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15410
15411                                 ;;
15412                         (x-Werror=*)
15413
15414         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15415         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15416
15417                                 ;;
15418                         (*)
15419
15420         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15421         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15422
15423                                 ;;
15424                         esac
15425                 done
15426                 if test "x$CFLAGS" != "x$cf_temp_flags"
15427                 then
15428                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15429
15430 echo "${as_me:-configure}:15430: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15431
15432                         CFLAGS="$cf_temp_flags"
15433                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15434
15435 echo "${as_me:-configure}:15435: testing ... fixed $CFLAGS ..." 1>&5
15436
15437                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15438
15439 echo "${as_me:-configure}:15439: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15440
15441                 fi
15442                 ;;
15443         esac
15444 fi
15445
15446 if test "$GCC" = yes || test "$GXX" = yes
15447 then
15448         case $CPPFLAGS in
15449         (*-Werror=*)
15450                 cf_temp_flags=
15451                 for cf_temp_scan in $CPPFLAGS
15452                 do
15453                         case "x$cf_temp_scan" in
15454                         (x-Werror=format*)
15455
15456         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15457         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15458
15459                                 ;;
15460                         (x-Werror=*)
15461
15462         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15463         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15464
15465                                 ;;
15466                         (*)
15467
15468         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15469         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15470
15471                                 ;;
15472                         esac
15473                 done
15474                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15475                 then
15476                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15477
15478 echo "${as_me:-configure}:15478: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15479
15480                         CPPFLAGS="$cf_temp_flags"
15481                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15482
15483 echo "${as_me:-configure}:15483: testing ... fixed $CPPFLAGS ..." 1>&5
15484
15485                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15486
15487 echo "${as_me:-configure}:15487: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15488
15489                 fi
15490                 ;;
15491         esac
15492 fi
15493
15494 if test "$GCC" = yes || test "$GXX" = yes
15495 then
15496         case $LDFLAGS in
15497         (*-Werror=*)
15498                 cf_temp_flags=
15499                 for cf_temp_scan in $LDFLAGS
15500                 do
15501                         case "x$cf_temp_scan" in
15502                         (x-Werror=format*)
15503
15504         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15505         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15506
15507                                 ;;
15508                         (x-Werror=*)
15509
15510         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15511         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15512
15513                                 ;;
15514                         (*)
15515
15516         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15517         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15518
15519                                 ;;
15520                         esac
15521                 done
15522                 if test "x$LDFLAGS" != "x$cf_temp_flags"
15523                 then
15524                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15525
15526 echo "${as_me:-configure}:15526: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15527
15528                         LDFLAGS="$cf_temp_flags"
15529                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15530
15531 echo "${as_me:-configure}:15531: testing ... fixed $LDFLAGS ..." 1>&5
15532
15533                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15534
15535 echo "${as_me:-configure}:15535: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15536
15537                 fi
15538                 ;;
15539         esac
15540 fi
15541
15542 echo "$as_me:15542: checking if you want to turn on gcc warnings" >&5
15543 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15544
15545 # Check whether --enable-warnings or --disable-warnings was given.
15546 if test "${enable_warnings+set}" = set; then
15547   enableval="$enable_warnings"
15548   test "$enableval" != yes && enableval=no
15549         if test "$enableval" != "no" ; then
15550     enable_warnings=yes
15551         else
15552                 enable_warnings=no
15553         fi
15554 else
15555   enableval=no
15556         enable_warnings=no
15557
15558 fi;
15559 echo "$as_me:15559: result: $enable_warnings" >&5
15560 echo "${ECHO_T}$enable_warnings" >&6
15561 if test "$enable_warnings" = "yes"
15562 then
15563
15564 if test "x$have_x" = xyes; then
15565
15566 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15567 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15568 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15569 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15570 for cf_X_CFLAGS in $X_CFLAGS
15571 do
15572         case "x$cf_X_CFLAGS" in
15573         x-[IUD]*)
15574                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15575                 ;;
15576         *)
15577                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15578                 ;;
15579         esac
15580 done
15581
15582 cat >"conftest.$ac_ext" <<_ACEOF
15583 #line 15583 "configure"
15584 #include "confdefs.h"
15585
15586 #include <stdlib.h>
15587 #include <X11/Intrinsic.h>
15588
15589 int
15590 main (void)
15591 {
15592 String foo = malloc(1); free((void*)foo)
15593   ;
15594   return 0;
15595 }
15596 _ACEOF
15597 rm -f "conftest.$ac_objext"
15598 if { (eval echo "$as_me:15598: \"$ac_compile\"") >&5
15599   (eval $ac_compile) 2>&5
15600   ac_status=$?
15601   echo "$as_me:15601: \$? = $ac_status" >&5
15602   (exit "$ac_status"); } &&
15603          { ac_try='test -s "conftest.$ac_objext"'
15604   { (eval echo "$as_me:15604: \"$ac_try\"") >&5
15605   (eval $ac_try) 2>&5
15606   ac_status=$?
15607   echo "$as_me:15607: \$? = $ac_status" >&5
15608   (exit "$ac_status"); }; }; then
15609
15610 echo "$as_me:15610: checking for X11/Xt const-feature" >&5
15611 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15612 if test "${cf_cv_const_x_string+set}" = set; then
15613   echo $ECHO_N "(cached) $ECHO_C" >&6
15614 else
15615
15616         cat >"conftest.$ac_ext" <<_ACEOF
15617 #line 15617 "configure"
15618 #include "confdefs.h"
15619
15620 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15621 #undef  XTSTRINGDEFINES /* X11R5 and later */
15622 #include <stdlib.h>
15623 #include <X11/Intrinsic.h>
15624
15625 int
15626 main (void)
15627 {
15628 String foo = malloc(1); *foo = 0
15629   ;
15630   return 0;
15631 }
15632 _ACEOF
15633 rm -f "conftest.$ac_objext"
15634 if { (eval echo "$as_me:15634: \"$ac_compile\"") >&5
15635   (eval $ac_compile) 2>&5
15636   ac_status=$?
15637   echo "$as_me:15637: \$? = $ac_status" >&5
15638   (exit "$ac_status"); } &&
15639          { ac_try='test -s "conftest.$ac_objext"'
15640   { (eval echo "$as_me:15640: \"$ac_try\"") >&5
15641   (eval $ac_try) 2>&5
15642   ac_status=$?
15643   echo "$as_me:15643: \$? = $ac_status" >&5
15644   (exit "$ac_status"); }; }; then
15645
15646                         cf_cv_const_x_string=no
15647
15648 else
15649   echo "$as_me: failed program was:" >&5
15650 cat "conftest.$ac_ext" >&5
15651
15652                         cf_cv_const_x_string=yes
15653
15654 fi
15655 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15656
15657 fi
15658 echo "$as_me:15658: result: $cf_cv_const_x_string" >&5
15659 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15660
15661 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15662 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15663 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15664
15665 case "$cf_cv_const_x_string" in
15666 (no)
15667
15668         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15669         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15670
15671         ;;
15672 (*)
15673
15674         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15675         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15676
15677         ;;
15678 esac
15679
15680 else
15681   echo "$as_me: failed program was:" >&5
15682 cat "conftest.$ac_ext" >&5
15683 fi
15684 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15685  fi
15686 cat > "conftest.$ac_ext" <<EOF
15687 #line 15687 "${as_me:-configure}"
15688 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15689 EOF
15690 if test "$INTEL_COMPILER" = yes
15691 then
15692 # The "-wdXXX" options suppress warnings:
15693 # remark #1419: external declaration in primary source file
15694 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15695 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15696 # remark #193: zero used for undefined preprocessing identifier
15697 # remark #593: variable "curs_sb_left_arrow" was set but never used
15698 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15699 # remark #869: parameter "tw" was never referenced
15700 # remark #981: operands are evaluated in unspecified order
15701 # warning #279: controlling expression is constant
15702
15703         { echo "$as_me:15703: checking for $CC warning options..." >&5
15704 echo "$as_me: checking for $CC warning options..." >&6;}
15705         cf_save_CFLAGS="$CFLAGS"
15706         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15707         for cf_opt in \
15708                 wd1419 \
15709                 wd1683 \
15710                 wd1684 \
15711                 wd193 \
15712                 wd593 \
15713                 wd279 \
15714                 wd810 \
15715                 wd869 \
15716                 wd981
15717         do
15718                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15719                 if { (eval echo "$as_me:15719: \"$ac_compile\"") >&5
15720   (eval $ac_compile) 2>&5
15721   ac_status=$?
15722   echo "$as_me:15722: \$? = $ac_status" >&5
15723   (exit "$ac_status"); }; then
15724                         test -n "$verbose" && echo "$as_me:15724: result: ... -$cf_opt" >&5
15725 echo "${ECHO_T}... -$cf_opt" >&6
15726                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15727                 fi
15728         done
15729         CFLAGS="$cf_save_CFLAGS"
15730 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15731 then
15732         { echo "$as_me:15732: checking for $CC warning options..." >&5
15733 echo "$as_me: checking for $CC warning options..." >&6;}
15734         cf_save_CFLAGS="$CFLAGS"
15735         cf_warn_CONST=""
15736         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15737         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15738         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15739         for cf_opt in W Wall \
15740                 Wbad-function-cast \
15741                 Wcast-align \
15742                 Wcast-qual \
15743                 Wdeclaration-after-statement \
15744                 Wextra \
15745                 Winline \
15746                 Wmissing-declarations \
15747                 Wmissing-prototypes \
15748                 Wnested-externs \
15749                 Wpointer-arith \
15750                 Wshadow \
15751                 Wstrict-prototypes \
15752                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15753         do
15754                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15755                 if { (eval echo "$as_me:15755: \"$ac_compile\"") >&5
15756   (eval $ac_compile) 2>&5
15757   ac_status=$?
15758   echo "$as_me:15758: \$? = $ac_status" >&5
15759   (exit "$ac_status"); }; then
15760                         test -n "$verbose" && echo "$as_me:15760: result: ... -$cf_opt" >&5
15761 echo "${ECHO_T}... -$cf_opt" >&6
15762                         case "$cf_opt" in
15763                         (Winline)
15764                                 case "$GCC_VERSION" in
15765                                 ([34].*)
15766                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15767
15768 echo "${as_me:-configure}:15768: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15769
15770                                         continue;;
15771                                 esac
15772                                 ;;
15773                         (Wpointer-arith)
15774                                 case "$GCC_VERSION" in
15775                                 ([12].*)
15776                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15777
15778 echo "${as_me:-configure}:15778: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15779
15780                                         continue;;
15781                                 esac
15782                                 ;;
15783                         esac
15784                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15785                 fi
15786         done
15787         CFLAGS="$cf_save_CFLAGS"
15788 fi
15789 rm -rf ./conftest*
15790
15791 fi
15792
15793 if test "$GCC" = yes || test "$GXX" = yes
15794 then
15795 cat > conftest.i <<EOF
15796 #ifndef GCC_PRINTF
15797 #define GCC_PRINTF 0
15798 #endif
15799 #ifndef GCC_SCANF
15800 #define GCC_SCANF 0
15801 #endif
15802 #ifndef GCC_NORETURN
15803 #define GCC_NORETURN /* nothing */
15804 #endif
15805 #ifndef GCC_UNUSED
15806 #define GCC_UNUSED /* nothing */
15807 #endif
15808 EOF
15809 if test "$GCC" = yes
15810 then
15811         { echo "$as_me:15811: checking for $CC __attribute__ directives..." >&5
15812 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15813 cat > "conftest.$ac_ext" <<EOF
15814 #line 15814 "${as_me:-configure}"
15815 #include "confdefs.h"
15816 #include "conftest.h"
15817 #include "conftest.i"
15818 #if     GCC_PRINTF
15819 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15820 #else
15821 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15822 #endif
15823 #if     GCC_SCANF
15824 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15825 #else
15826 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15827 #endif
15828 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15829 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15830 extern GCC_NORETURN void foo(void);
15831 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15832 EOF
15833         cf_printf_attribute=no
15834         cf_scanf_attribute=no
15835         for cf_attribute in scanf printf unused noreturn
15836         do
15837
15838 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15839
15840                 cf_directive="__attribute__(($cf_attribute))"
15841                 echo "checking for $CC $cf_directive" 1>&5
15842
15843                 case "$cf_attribute" in
15844                 (printf)
15845                         cf_printf_attribute=yes
15846                         cat >conftest.h <<EOF
15847 #define GCC_$cf_ATTRIBUTE 1
15848 EOF
15849                         ;;
15850                 (scanf)
15851                         cf_scanf_attribute=yes
15852                         cat >conftest.h <<EOF
15853 #define GCC_$cf_ATTRIBUTE 1
15854 EOF
15855                         ;;
15856                 (*)
15857                         cat >conftest.h <<EOF
15858 #define GCC_$cf_ATTRIBUTE $cf_directive
15859 EOF
15860                         ;;
15861                 esac
15862
15863                 if { (eval echo "$as_me:15863: \"$ac_compile\"") >&5
15864   (eval $ac_compile) 2>&5
15865   ac_status=$?
15866   echo "$as_me:15866: \$? = $ac_status" >&5
15867   (exit "$ac_status"); }; then
15868                         test -n "$verbose" && echo "$as_me:15868: result: ... $cf_attribute" >&5
15869 echo "${ECHO_T}... $cf_attribute" >&6
15870                         cat conftest.h >>confdefs.h
15871                         case "$cf_attribute" in
15872                         (noreturn)
15873
15874 cat >>confdefs.h <<EOF
15875 #define GCC_NORETURN $cf_directive
15876 EOF
15877
15878                                 ;;
15879                         (printf)
15880                                 cf_value='/* nothing */'
15881                                 if test "$cf_printf_attribute" != no ; then
15882                                         cf_value='__attribute__((format(printf,fmt,var)))'
15883
15884 cat >>confdefs.h <<\EOF
15885 #define GCC_PRINTF 1
15886 EOF
15887
15888                                 fi
15889
15890 cat >>confdefs.h <<EOF
15891 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15892 EOF
15893
15894                                 ;;
15895                         (scanf)
15896                                 cf_value='/* nothing */'
15897                                 if test "$cf_scanf_attribute" != no ; then
15898                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15899
15900 cat >>confdefs.h <<\EOF
15901 #define GCC_SCANF 1
15902 EOF
15903
15904                                 fi
15905
15906 cat >>confdefs.h <<EOF
15907 #define GCC_SCANFLIKE(fmt,var) $cf_value
15908 EOF
15909
15910                                 ;;
15911                         (unused)
15912
15913 cat >>confdefs.h <<EOF
15914 #define GCC_UNUSED $cf_directive
15915 EOF
15916
15917                                 ;;
15918                         esac
15919                 fi
15920         done
15921 else
15922         ${FGREP-fgrep} define conftest.i >>confdefs.h
15923 fi
15924 rm -rf ./conftest*
15925 fi
15926
15927 fi
15928
15929 if test "x$enable_warnings" = "xyes"; then
15930
15931         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
15932
15933 fi
15934
15935 ###     use option --enable-assertions to turn on generation of assertion code
15936 echo "$as_me:15936: checking if you want to enable runtime assertions" >&5
15937 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15938
15939 # Check whether --enable-assertions or --disable-assertions was given.
15940 if test "${enable_assertions+set}" = set; then
15941   enableval="$enable_assertions"
15942   with_assertions=$enableval
15943 else
15944   with_assertions=no
15945 fi;
15946 echo "$as_me:15946: result: $with_assertions" >&5
15947 echo "${ECHO_T}$with_assertions" >&6
15948 if test -n "$GCC"
15949 then
15950         if test "$with_assertions" = no
15951         then
15952                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15953         else
15954
15955         ADAFLAGS="$ADAFLAGS -gnata"
15956
15957         fi
15958 fi
15959
15960 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15961
15962 cat >>confdefs.h <<\EOF
15963 #define HAVE_NC_ALLOC_H 1
15964 EOF
15965
15966 ###     use option --enable-expanded to generate certain macros as functions
15967
15968 # Check whether --enable-expanded or --disable-expanded was given.
15969 if test "${enable_expanded+set}" = set; then
15970   enableval="$enable_expanded"
15971   test "$enableval" = yes &&
15972 cat >>confdefs.h <<\EOF
15973 #define NCURSES_EXPANDED 1
15974 EOF
15975
15976 fi;
15977
15978 ###     use option --disable-macros to suppress macros in favor of functions
15979
15980 # Check whether --enable-macros or --disable-macros was given.
15981 if test "${enable_macros+set}" = set; then
15982   enableval="$enable_macros"
15983   test "$enableval" = no &&
15984 cat >>confdefs.h <<\EOF
15985 #define NCURSES_NOMACROS 1
15986 EOF
15987
15988 fi;
15989
15990 # Normally we only add trace() to the debug-library.  Allow this to be
15991 # extended to all models of the ncurses library:
15992 cf_all_traces=no
15993 case "$CFLAGS $CPPFLAGS" in
15994 (*-DTRACE*)
15995         cf_all_traces=yes
15996         ;;
15997 esac
15998
15999 echo "$as_me:15999: checking whether to add trace feature to all models" >&5
16000 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16001
16002 # Check whether --with-trace or --without-trace was given.
16003 if test "${with_trace+set}" = set; then
16004   withval="$with_trace"
16005   cf_with_trace=$withval
16006 else
16007   cf_with_trace=$cf_all_traces
16008 fi;
16009 echo "$as_me:16009: result: $cf_with_trace" >&5
16010 echo "${ECHO_T}$cf_with_trace" >&6
16011
16012 if test "$cf_with_trace" = yes ; then
16013         ADA_TRACE=TRUE
16014
16015 cf_fix_cppflags=no
16016 cf_new_cflags=
16017 cf_new_cppflags=
16018 cf_new_extra_cppflags=
16019
16020 for cf_add_cflags in -DTRACE
16021 do
16022 case "$cf_fix_cppflags" in
16023 (no)
16024         case "$cf_add_cflags" in
16025         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16026                 case "$cf_add_cflags" in
16027                 (-D*)
16028                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16029
16030                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16031                                 && test -z "${cf_tst_cflags}" \
16032                                 && cf_fix_cppflags=yes
16033
16034                         if test "$cf_fix_cppflags" = yes ; then
16035
16036         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16037         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16038
16039                                 continue
16040                         elif test "${cf_tst_cflags}" = "\"'" ; then
16041
16042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16044
16045                                 continue
16046                         fi
16047                         ;;
16048                 esac
16049                 case "$CPPFLAGS" in
16050                 (*$cf_add_cflags)
16051                         ;;
16052                 (*)
16053                         case "$cf_add_cflags" in
16054                         (-D*)
16055                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16056
16057 CPPFLAGS=`echo "$CPPFLAGS" | \
16058         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16059                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16060
16061                                 ;;
16062                         esac
16063
16064         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16065         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16066
16067                         ;;
16068                 esac
16069                 ;;
16070         (*)
16071
16072         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16073         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16074
16075                 ;;
16076         esac
16077         ;;
16078 (yes)
16079
16080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16082
16083         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16084
16085         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16086                 && test -z "${cf_tst_cflags}" \
16087                 && cf_fix_cppflags=no
16088         ;;
16089 esac
16090 done
16091
16092 if test -n "$cf_new_cflags" ; then
16093
16094         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16095         CFLAGS="${CFLAGS}$cf_new_cflags"
16096
16097 fi
16098
16099 if test -n "$cf_new_cppflags" ; then
16100
16101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16102         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16103
16104 fi
16105
16106 if test -n "$cf_new_extra_cppflags" ; then
16107
16108         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16109         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16110
16111 fi
16112
16113 else
16114         ADA_TRACE=FALSE
16115 fi
16116
16117 echo "$as_me:16117: checking if we want to use GNAT projects" >&5
16118 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16119
16120 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16121 if test "${enable_gnat_projects+set}" = set; then
16122   enableval="$enable_gnat_projects"
16123   test "$enableval" != no && enableval=yes
16124         if test "$enableval" != "yes" ; then
16125     enable_gnat_projects=no
16126         else
16127                 enable_gnat_projects=yes
16128         fi
16129 else
16130   enableval=yes
16131         enable_gnat_projects=yes
16132
16133 fi;
16134 echo "$as_me:16134: result: $enable_gnat_projects" >&5
16135 echo "${ECHO_T}$enable_gnat_projects" >&6
16136
16137 ###     Checks for libraries.
16138 case $cf_cv_system_name in
16139 (*mingw32*)
16140
16141 echo "$as_me:16141: checking if ssp library is needed" >&5
16142 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16143 if test "${cf_cv_need_libssp+set}" = set; then
16144   echo $ECHO_N "(cached) $ECHO_C" >&6
16145 else
16146
16147 cat >"conftest.$ac_ext" <<_ACEOF
16148 #line 16148 "configure"
16149 #include "confdefs.h"
16150
16151 #include <sys/types.h>
16152 #include <dirent.h>
16153
16154 int
16155 main (void)
16156 {
16157
16158        DIR *dp = opendir(".");
16159
16160   ;
16161   return 0;
16162 }
16163 _ACEOF
16164 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16165 if { (eval echo "$as_me:16165: \"$ac_link\"") >&5
16166   (eval $ac_link) 2>&5
16167   ac_status=$?
16168   echo "$as_me:16168: \$? = $ac_status" >&5
16169   (exit "$ac_status"); } &&
16170          { ac_try='test -s "conftest$ac_exeext"'
16171   { (eval echo "$as_me:16171: \"$ac_try\"") >&5
16172   (eval $ac_try) 2>&5
16173   ac_status=$?
16174   echo "$as_me:16174: \$? = $ac_status" >&5
16175   (exit "$ac_status"); }; }; then
16176   cf_cv_need_libssp=no
16177 else
16178   echo "$as_me: failed program was:" >&5
16179 cat "conftest.$ac_ext" >&5
16180
16181         cf_save_LIBS="$LIBS"
16182         LIBS="$LIBS -lssp"
16183         cat >"conftest.$ac_ext" <<_ACEOF
16184 #line 16184 "configure"
16185 #include "confdefs.h"
16186
16187 #include <sys/types.h>
16188 #include <dirent.h>
16189
16190 int
16191 main (void)
16192 {
16193
16194                    DIR *dp = opendir(".");
16195
16196   ;
16197   return 0;
16198 }
16199 _ACEOF
16200 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16201 if { (eval echo "$as_me:16201: \"$ac_link\"") >&5
16202   (eval $ac_link) 2>&5
16203   ac_status=$?
16204   echo "$as_me:16204: \$? = $ac_status" >&5
16205   (exit "$ac_status"); } &&
16206          { ac_try='test -s "conftest$ac_exeext"'
16207   { (eval echo "$as_me:16207: \"$ac_try\"") >&5
16208   (eval $ac_try) 2>&5
16209   ac_status=$?
16210   echo "$as_me:16210: \$? = $ac_status" >&5
16211   (exit "$ac_status"); }; }; then
16212   cf_cv_need_libssp=yes
16213 else
16214   echo "$as_me: failed program was:" >&5
16215 cat "conftest.$ac_ext" >&5
16216 cf_cv_need_libssp=maybe
16217 fi
16218 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16219         LIBS="$cf_save_LIBS"
16220
16221 fi
16222 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16223 fi
16224 echo "$as_me:16224: result: $cf_cv_need_libssp" >&5
16225 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16226
16227 if test "x$cf_cv_need_libssp" = xyes
16228 then
16229
16230 cf_add_libs="$LIBS"
16231 # reverse order
16232 cf_add_0lib=
16233 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16234 # filter duplicates
16235 for cf_add_1lib in $cf_add_0lib; do
16236         for cf_add_2lib in $cf_add_libs; do
16237                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16238                         cf_add_1lib=
16239                         break
16240                 fi
16241         done
16242         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16243 done
16244 LIBS="$cf_add_libs"
16245
16246 fi
16247
16248         ;;
16249 (*)
16250 echo "$as_me:16250: checking for gettimeofday" >&5
16251 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16252 if test "${ac_cv_func_gettimeofday+set}" = set; then
16253   echo $ECHO_N "(cached) $ECHO_C" >&6
16254 else
16255   cat >"conftest.$ac_ext" <<_ACEOF
16256 #line 16256 "configure"
16257 #include "confdefs.h"
16258 #define gettimeofday autoconf_temporary
16259 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16260 #undef gettimeofday
16261
16262 #ifdef __cplusplus
16263 extern "C"
16264 #endif
16265
16266 /* We use char because int might match the return type of a gcc2
16267    builtin and then its argument prototype would still apply.  */
16268 char gettimeofday (void);
16269
16270 int
16271 main (void)
16272 {
16273
16274 /* The GNU C library defines stubs for functions which it implements
16275     to always fail with ENOSYS.  Some functions are actually named
16276     something starting with __ and the normal name is an alias.  */
16277 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16278 #error found stub for gettimeofday
16279 #endif
16280
16281         return gettimeofday ();
16282   ;
16283   return 0;
16284 }
16285 _ACEOF
16286 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16287 if { (eval echo "$as_me:16287: \"$ac_link\"") >&5
16288   (eval $ac_link) 2>&5
16289   ac_status=$?
16290   echo "$as_me:16290: \$? = $ac_status" >&5
16291   (exit "$ac_status"); } &&
16292          { ac_try='test -s "conftest$ac_exeext"'
16293   { (eval echo "$as_me:16293: \"$ac_try\"") >&5
16294   (eval $ac_try) 2>&5
16295   ac_status=$?
16296   echo "$as_me:16296: \$? = $ac_status" >&5
16297   (exit "$ac_status"); }; }; then
16298   ac_cv_func_gettimeofday=yes
16299 else
16300   echo "$as_me: failed program was:" >&5
16301 cat "conftest.$ac_ext" >&5
16302 ac_cv_func_gettimeofday=no
16303 fi
16304 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16305 fi
16306 echo "$as_me:16306: result: $ac_cv_func_gettimeofday" >&5
16307 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16308 if test "$ac_cv_func_gettimeofday" = yes; then
16309   cat >>confdefs.h <<\EOF
16310 #define HAVE_GETTIMEOFDAY 1
16311 EOF
16312
16313 else
16314
16315 echo "$as_me:16315: checking for gettimeofday in -lbsd" >&5
16316 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16317 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16318   echo $ECHO_N "(cached) $ECHO_C" >&6
16319 else
16320   ac_check_lib_save_LIBS=$LIBS
16321 LIBS="-lbsd  $LIBS"
16322 cat >"conftest.$ac_ext" <<_ACEOF
16323 #line 16323 "configure"
16324 #include "confdefs.h"
16325
16326 /* Override any gcc2 internal prototype to avoid an error.  */
16327 #ifdef __cplusplus
16328 extern "C"
16329 #endif
16330 /* We use char because int might match the return type of a gcc2
16331    builtin and then its argument prototype would still apply.  */
16332 char gettimeofday ();
16333 int
16334 main (void)
16335 {
16336 gettimeofday ();
16337   ;
16338   return 0;
16339 }
16340 _ACEOF
16341 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16342 if { (eval echo "$as_me:16342: \"$ac_link\"") >&5
16343   (eval $ac_link) 2>&5
16344   ac_status=$?
16345   echo "$as_me:16345: \$? = $ac_status" >&5
16346   (exit "$ac_status"); } &&
16347          { ac_try='test -s "conftest$ac_exeext"'
16348   { (eval echo "$as_me:16348: \"$ac_try\"") >&5
16349   (eval $ac_try) 2>&5
16350   ac_status=$?
16351   echo "$as_me:16351: \$? = $ac_status" >&5
16352   (exit "$ac_status"); }; }; then
16353   ac_cv_lib_bsd_gettimeofday=yes
16354 else
16355   echo "$as_me: failed program was:" >&5
16356 cat "conftest.$ac_ext" >&5
16357 ac_cv_lib_bsd_gettimeofday=no
16358 fi
16359 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16360 LIBS=$ac_check_lib_save_LIBS
16361 fi
16362 echo "$as_me:16362: result: $ac_cv_lib_bsd_gettimeofday" >&5
16363 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16364 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16365
16366 cat >>confdefs.h <<\EOF
16367 #define HAVE_GETTIMEOFDAY 1
16368 EOF
16369
16370         LIBS="$LIBS -lbsd"
16371 fi
16372
16373 fi
16374         ;;
16375 esac
16376
16377 ###     Checks for header files.
16378 echo "$as_me:16378: checking for ANSI C header files" >&5
16379 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16380 if test "${ac_cv_header_stdc+set}" = set; then
16381   echo $ECHO_N "(cached) $ECHO_C" >&6
16382 else
16383   cat >"conftest.$ac_ext" <<_ACEOF
16384 #line 16384 "configure"
16385 #include "confdefs.h"
16386 #include <stdlib.h>
16387 #include <stdarg.h>
16388 #include <string.h>
16389 #include <float.h>
16390
16391 _ACEOF
16392 if { (eval echo "$as_me:16392: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16393   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16394   ac_status=$?
16395   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16396   rm -f conftest.er1
16397   cat conftest.err >&5
16398   echo "$as_me:16398: \$? = $ac_status" >&5
16399   (exit "$ac_status"); } >/dev/null; then
16400   if test -s conftest.err; then
16401     ac_cpp_err=$ac_c_preproc_warn_flag
16402   else
16403     ac_cpp_err=
16404   fi
16405 else
16406   ac_cpp_err=yes
16407 fi
16408 if test -z "$ac_cpp_err"; then
16409   ac_cv_header_stdc=yes
16410 else
16411   echo "$as_me: failed program was:" >&5
16412   cat "conftest.$ac_ext" >&5
16413   ac_cv_header_stdc=no
16414 fi
16415 rm -f conftest.err "conftest.$ac_ext"
16416
16417 if test $ac_cv_header_stdc = yes; then
16418   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16419   cat >"conftest.$ac_ext" <<_ACEOF
16420 #line 16420 "configure"
16421 #include "confdefs.h"
16422 #include <string.h>
16423
16424 _ACEOF
16425 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16426   $EGREP "memchr" >/dev/null 2>&1; then
16427   :
16428 else
16429   ac_cv_header_stdc=no
16430 fi
16431 rm -rf conftest*
16432
16433 fi
16434
16435 if test $ac_cv_header_stdc = yes; then
16436   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16437   cat >"conftest.$ac_ext" <<_ACEOF
16438 #line 16438 "configure"
16439 #include "confdefs.h"
16440 #include <stdlib.h>
16441
16442 _ACEOF
16443 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16444   $EGREP "free" >/dev/null 2>&1; then
16445   :
16446 else
16447   ac_cv_header_stdc=no
16448 fi
16449 rm -rf conftest*
16450
16451 fi
16452
16453 if test $ac_cv_header_stdc = yes; then
16454   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16455   if test "$cross_compiling" = yes; then
16456   :
16457 else
16458   cat >"conftest.$ac_ext" <<_ACEOF
16459 #line 16459 "configure"
16460 #include "confdefs.h"
16461 #include <ctype.h>
16462 #if ((' ' & 0x0FF) == 0x020)
16463 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16464 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16465 #else
16466 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16467                      || ('j' <= (c) && (c) <= 'r') \
16468                      || ('s' <= (c) && (c) <= 'z'))
16469 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16470 #endif
16471
16472 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16473 int
16474 main (void)
16475 {
16476   int i;
16477   for (i = 0; i < 256; i++)
16478     if (XOR (islower (i), ISLOWER (i))
16479         || toupper (i) != TOUPPER (i))
16480       $ac_main_return(2);
16481   $ac_main_return (0);
16482 }
16483 _ACEOF
16484 rm -f "conftest$ac_exeext"
16485 if { (eval echo "$as_me:16485: \"$ac_link\"") >&5
16486   (eval $ac_link) 2>&5
16487   ac_status=$?
16488   echo "$as_me:16488: \$? = $ac_status" >&5
16489   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16490   { (eval echo "$as_me:16490: \"$ac_try\"") >&5
16491   (eval $ac_try) 2>&5
16492   ac_status=$?
16493   echo "$as_me:16493: \$? = $ac_status" >&5
16494   (exit "$ac_status"); }; }; then
16495   :
16496 else
16497   echo "$as_me: program exited with status $ac_status" >&5
16498 echo "$as_me: failed program was:" >&5
16499 cat "conftest.$ac_ext" >&5
16500 ac_cv_header_stdc=no
16501 fi
16502 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16503 fi
16504 fi
16505 fi
16506 echo "$as_me:16506: result: $ac_cv_header_stdc" >&5
16507 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16508 if test $ac_cv_header_stdc = yes; then
16509
16510 cat >>confdefs.h <<\EOF
16511 #define STDC_HEADERS 1
16512 EOF
16513
16514 fi
16515
16516 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16517
16518 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16519                   inttypes.h stdint.h unistd.h
16520 do
16521 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16522 echo "$as_me:16522: checking for $ac_header" >&5
16523 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16524 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16525   echo $ECHO_N "(cached) $ECHO_C" >&6
16526 else
16527   cat >"conftest.$ac_ext" <<_ACEOF
16528 #line 16528 "configure"
16529 #include "confdefs.h"
16530 $ac_includes_default
16531 #include <$ac_header>
16532 _ACEOF
16533 rm -f "conftest.$ac_objext"
16534 if { (eval echo "$as_me:16534: \"$ac_compile\"") >&5
16535   (eval $ac_compile) 2>&5
16536   ac_status=$?
16537   echo "$as_me:16537: \$? = $ac_status" >&5
16538   (exit "$ac_status"); } &&
16539          { ac_try='test -s "conftest.$ac_objext"'
16540   { (eval echo "$as_me:16540: \"$ac_try\"") >&5
16541   (eval $ac_try) 2>&5
16542   ac_status=$?
16543   echo "$as_me:16543: \$? = $ac_status" >&5
16544   (exit "$ac_status"); }; }; then
16545   eval "$as_ac_Header=yes"
16546 else
16547   echo "$as_me: failed program was:" >&5
16548 cat "conftest.$ac_ext" >&5
16549 eval "$as_ac_Header=no"
16550 fi
16551 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16552 fi
16553 echo "$as_me:16553: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16554 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16555 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16556   cat >>confdefs.h <<EOF
16557 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16558 EOF
16559
16560 fi
16561 done
16562
16563 echo "$as_me:16563: checking for signed char" >&5
16564 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16565 if test "${ac_cv_type_signed_char+set}" = set; then
16566   echo $ECHO_N "(cached) $ECHO_C" >&6
16567 else
16568   cat >"conftest.$ac_ext" <<_ACEOF
16569 #line 16569 "configure"
16570 #include "confdefs.h"
16571 $ac_includes_default
16572 int
16573 main (void)
16574 {
16575 if ((signed char *) 0)
16576   return 0;
16577 if (sizeof (signed char))
16578   return 0;
16579   ;
16580   return 0;
16581 }
16582 _ACEOF
16583 rm -f "conftest.$ac_objext"
16584 if { (eval echo "$as_me:16584: \"$ac_compile\"") >&5
16585   (eval $ac_compile) 2>&5
16586   ac_status=$?
16587   echo "$as_me:16587: \$? = $ac_status" >&5
16588   (exit "$ac_status"); } &&
16589          { ac_try='test -s "conftest.$ac_objext"'
16590   { (eval echo "$as_me:16590: \"$ac_try\"") >&5
16591   (eval $ac_try) 2>&5
16592   ac_status=$?
16593   echo "$as_me:16593: \$? = $ac_status" >&5
16594   (exit "$ac_status"); }; }; then
16595   ac_cv_type_signed_char=yes
16596 else
16597   echo "$as_me: failed program was:" >&5
16598 cat "conftest.$ac_ext" >&5
16599 ac_cv_type_signed_char=no
16600 fi
16601 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16602 fi
16603 echo "$as_me:16603: result: $ac_cv_type_signed_char" >&5
16604 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16605
16606 echo "$as_me:16606: checking size of signed char" >&5
16607 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16608 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16609   echo $ECHO_N "(cached) $ECHO_C" >&6
16610 else
16611   if test "$ac_cv_type_signed_char" = yes; then
16612   if test "$cross_compiling" = yes; then
16613   # Depending upon the size, compute the lo and hi bounds.
16614 cat >"conftest.$ac_ext" <<_ACEOF
16615 #line 16615 "configure"
16616 #include "confdefs.h"
16617 $ac_includes_default
16618 int
16619 main (void)
16620 {
16621 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16622   ;
16623   return 0;
16624 }
16625 _ACEOF
16626 rm -f "conftest.$ac_objext"
16627 if { (eval echo "$as_me:16627: \"$ac_compile\"") >&5
16628   (eval $ac_compile) 2>&5
16629   ac_status=$?
16630   echo "$as_me:16630: \$? = $ac_status" >&5
16631   (exit "$ac_status"); } &&
16632          { ac_try='test -s "conftest.$ac_objext"'
16633   { (eval echo "$as_me:16633: \"$ac_try\"") >&5
16634   (eval $ac_try) 2>&5
16635   ac_status=$?
16636   echo "$as_me:16636: \$? = $ac_status" >&5
16637   (exit "$ac_status"); }; }; then
16638   ac_lo=0 ac_mid=0
16639   while :; do
16640     cat >"conftest.$ac_ext" <<_ACEOF
16641 #line 16641 "configure"
16642 #include "confdefs.h"
16643 $ac_includes_default
16644 int
16645 main (void)
16646 {
16647 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16648   ;
16649   return 0;
16650 }
16651 _ACEOF
16652 rm -f "conftest.$ac_objext"
16653 if { (eval echo "$as_me:16653: \"$ac_compile\"") >&5
16654   (eval $ac_compile) 2>&5
16655   ac_status=$?
16656   echo "$as_me:16656: \$? = $ac_status" >&5
16657   (exit "$ac_status"); } &&
16658          { ac_try='test -s "conftest.$ac_objext"'
16659   { (eval echo "$as_me:16659: \"$ac_try\"") >&5
16660   (eval $ac_try) 2>&5
16661   ac_status=$?
16662   echo "$as_me:16662: \$? = $ac_status" >&5
16663   (exit "$ac_status"); }; }; then
16664   ac_hi=$ac_mid; break
16665 else
16666   echo "$as_me: failed program was:" >&5
16667 cat "conftest.$ac_ext" >&5
16668 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16669 fi
16670 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16671   done
16672 else
16673   echo "$as_me: failed program was:" >&5
16674 cat "conftest.$ac_ext" >&5
16675 ac_hi=-1 ac_mid=-1
16676   while :; do
16677     cat >"conftest.$ac_ext" <<_ACEOF
16678 #line 16678 "configure"
16679 #include "confdefs.h"
16680 $ac_includes_default
16681 int
16682 main (void)
16683 {
16684 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16685   ;
16686   return 0;
16687 }
16688 _ACEOF
16689 rm -f "conftest.$ac_objext"
16690 if { (eval echo "$as_me:16690: \"$ac_compile\"") >&5
16691   (eval $ac_compile) 2>&5
16692   ac_status=$?
16693   echo "$as_me:16693: \$? = $ac_status" >&5
16694   (exit "$ac_status"); } &&
16695          { ac_try='test -s "conftest.$ac_objext"'
16696   { (eval echo "$as_me:16696: \"$ac_try\"") >&5
16697   (eval $ac_try) 2>&5
16698   ac_status=$?
16699   echo "$as_me:16699: \$? = $ac_status" >&5
16700   (exit "$ac_status"); }; }; then
16701   ac_lo=$ac_mid; break
16702 else
16703   echo "$as_me: failed program was:" >&5
16704 cat "conftest.$ac_ext" >&5
16705 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16706 fi
16707 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16708   done
16709 fi
16710 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16711 # Binary search between lo and hi bounds.
16712 while test "x$ac_lo" != "x$ac_hi"; do
16713   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16714   cat >"conftest.$ac_ext" <<_ACEOF
16715 #line 16715 "configure"
16716 #include "confdefs.h"
16717 $ac_includes_default
16718 int
16719 main (void)
16720 {
16721 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16722   ;
16723   return 0;
16724 }
16725 _ACEOF
16726 rm -f "conftest.$ac_objext"
16727 if { (eval echo "$as_me:16727: \"$ac_compile\"") >&5
16728   (eval $ac_compile) 2>&5
16729   ac_status=$?
16730   echo "$as_me:16730: \$? = $ac_status" >&5
16731   (exit "$ac_status"); } &&
16732          { ac_try='test -s "conftest.$ac_objext"'
16733   { (eval echo "$as_me:16733: \"$ac_try\"") >&5
16734   (eval $ac_try) 2>&5
16735   ac_status=$?
16736   echo "$as_me:16736: \$? = $ac_status" >&5
16737   (exit "$ac_status"); }; }; then
16738   ac_hi=$ac_mid
16739 else
16740   echo "$as_me: failed program was:" >&5
16741 cat "conftest.$ac_ext" >&5
16742 ac_lo=`expr "$ac_mid" + 1`
16743 fi
16744 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16745 done
16746 ac_cv_sizeof_signed_char=$ac_lo
16747 else
16748   if test "$cross_compiling" = yes; then
16749   { { echo "$as_me:16749: error: cannot run test program while cross compiling" >&5
16750 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16751    { (exit 1); exit 1; }; }
16752 else
16753   cat >"conftest.$ac_ext" <<_ACEOF
16754 #line 16754 "configure"
16755 #include "confdefs.h"
16756 $ac_includes_default
16757 int
16758 main (void)
16759 {
16760 FILE *f = fopen ("conftest.val", "w");
16761 if (!f)
16762   $ac_main_return (1);
16763 fprintf (f, "%ld", (long)(sizeof (signed char)));
16764 fclose (f);
16765   ;
16766   return 0;
16767 }
16768 _ACEOF
16769 rm -f "conftest$ac_exeext"
16770 if { (eval echo "$as_me:16770: \"$ac_link\"") >&5
16771   (eval $ac_link) 2>&5
16772   ac_status=$?
16773   echo "$as_me:16773: \$? = $ac_status" >&5
16774   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16775   { (eval echo "$as_me:16775: \"$ac_try\"") >&5
16776   (eval $ac_try) 2>&5
16777   ac_status=$?
16778   echo "$as_me:16778: \$? = $ac_status" >&5
16779   (exit "$ac_status"); }; }; then
16780   ac_cv_sizeof_signed_char=`cat conftest.val`
16781 else
16782   echo "$as_me: program exited with status $ac_status" >&5
16783 echo "$as_me: failed program was:" >&5
16784 cat "conftest.$ac_ext" >&5
16785 fi
16786 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16787 fi
16788 fi
16789 rm -f conftest.val
16790 else
16791   ac_cv_sizeof_signed_char=0
16792 fi
16793 fi
16794 echo "$as_me:16794: result: $ac_cv_sizeof_signed_char" >&5
16795 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16796 cat >>confdefs.h <<EOF
16797 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16798 EOF
16799
16800 echo "$as_me:16800: checking for ANSI C header files" >&5
16801 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16802 if test "${ac_cv_header_stdc+set}" = set; then
16803   echo $ECHO_N "(cached) $ECHO_C" >&6
16804 else
16805   cat >"conftest.$ac_ext" <<_ACEOF
16806 #line 16806 "configure"
16807 #include "confdefs.h"
16808 #include <stdlib.h>
16809 #include <stdarg.h>
16810 #include <string.h>
16811 #include <float.h>
16812
16813 _ACEOF
16814 if { (eval echo "$as_me:16814: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16815   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16816   ac_status=$?
16817   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16818   rm -f conftest.er1
16819   cat conftest.err >&5
16820   echo "$as_me:16820: \$? = $ac_status" >&5
16821   (exit "$ac_status"); } >/dev/null; then
16822   if test -s conftest.err; then
16823     ac_cpp_err=$ac_c_preproc_warn_flag
16824   else
16825     ac_cpp_err=
16826   fi
16827 else
16828   ac_cpp_err=yes
16829 fi
16830 if test -z "$ac_cpp_err"; then
16831   ac_cv_header_stdc=yes
16832 else
16833   echo "$as_me: failed program was:" >&5
16834   cat "conftest.$ac_ext" >&5
16835   ac_cv_header_stdc=no
16836 fi
16837 rm -f conftest.err "conftest.$ac_ext"
16838
16839 if test $ac_cv_header_stdc = yes; then
16840   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16841   cat >"conftest.$ac_ext" <<_ACEOF
16842 #line 16842 "configure"
16843 #include "confdefs.h"
16844 #include <string.h>
16845
16846 _ACEOF
16847 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16848   $EGREP "memchr" >/dev/null 2>&1; then
16849   :
16850 else
16851   ac_cv_header_stdc=no
16852 fi
16853 rm -rf conftest*
16854
16855 fi
16856
16857 if test $ac_cv_header_stdc = yes; then
16858   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16859   cat >"conftest.$ac_ext" <<_ACEOF
16860 #line 16860 "configure"
16861 #include "confdefs.h"
16862 #include <stdlib.h>
16863
16864 _ACEOF
16865 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16866   $EGREP "free" >/dev/null 2>&1; then
16867   :
16868 else
16869   ac_cv_header_stdc=no
16870 fi
16871 rm -rf conftest*
16872
16873 fi
16874
16875 if test $ac_cv_header_stdc = yes; then
16876   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16877   if test "$cross_compiling" = yes; then
16878   :
16879 else
16880   cat >"conftest.$ac_ext" <<_ACEOF
16881 #line 16881 "configure"
16882 #include "confdefs.h"
16883 #include <ctype.h>
16884 #if ((' ' & 0x0FF) == 0x020)
16885 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16886 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16887 #else
16888 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16889                      || ('j' <= (c) && (c) <= 'r') \
16890                      || ('s' <= (c) && (c) <= 'z'))
16891 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16892 #endif
16893
16894 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16895 int
16896 main (void)
16897 {
16898   int i;
16899   for (i = 0; i < 256; i++)
16900     if (XOR (islower (i), ISLOWER (i))
16901         || toupper (i) != TOUPPER (i))
16902       $ac_main_return(2);
16903   $ac_main_return (0);
16904 }
16905 _ACEOF
16906 rm -f "conftest$ac_exeext"
16907 if { (eval echo "$as_me:16907: \"$ac_link\"") >&5
16908   (eval $ac_link) 2>&5
16909   ac_status=$?
16910   echo "$as_me:16910: \$? = $ac_status" >&5
16911   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16912   { (eval echo "$as_me:16912: \"$ac_try\"") >&5
16913   (eval $ac_try) 2>&5
16914   ac_status=$?
16915   echo "$as_me:16915: \$? = $ac_status" >&5
16916   (exit "$ac_status"); }; }; then
16917   :
16918 else
16919   echo "$as_me: program exited with status $ac_status" >&5
16920 echo "$as_me: failed program was:" >&5
16921 cat "conftest.$ac_ext" >&5
16922 ac_cv_header_stdc=no
16923 fi
16924 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16925 fi
16926 fi
16927 fi
16928 echo "$as_me:16928: result: $ac_cv_header_stdc" >&5
16929 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16930 if test $ac_cv_header_stdc = yes; then
16931
16932 cat >>confdefs.h <<\EOF
16933 #define STDC_HEADERS 1
16934 EOF
16935
16936 fi
16937
16938 ac_header_dirent=no
16939 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16940   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16941 echo "$as_me:16941: checking for $ac_hdr that defines DIR" >&5
16942 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16943 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16944   echo $ECHO_N "(cached) $ECHO_C" >&6
16945 else
16946   cat >"conftest.$ac_ext" <<_ACEOF
16947 #line 16947 "configure"
16948 #include "confdefs.h"
16949 #include <sys/types.h>
16950 #include <$ac_hdr>
16951
16952 int
16953 main (void)
16954 {
16955 if ((DIR *) 0)
16956 return 0;
16957   ;
16958   return 0;
16959 }
16960 _ACEOF
16961 rm -f "conftest.$ac_objext"
16962 if { (eval echo "$as_me:16962: \"$ac_compile\"") >&5
16963   (eval $ac_compile) 2>&5
16964   ac_status=$?
16965   echo "$as_me:16965: \$? = $ac_status" >&5
16966   (exit "$ac_status"); } &&
16967          { ac_try='test -s "conftest.$ac_objext"'
16968   { (eval echo "$as_me:16968: \"$ac_try\"") >&5
16969   (eval $ac_try) 2>&5
16970   ac_status=$?
16971   echo "$as_me:16971: \$? = $ac_status" >&5
16972   (exit "$ac_status"); }; }; then
16973   eval "$as_ac_Header=yes"
16974 else
16975   echo "$as_me: failed program was:" >&5
16976 cat "conftest.$ac_ext" >&5
16977 eval "$as_ac_Header=no"
16978 fi
16979 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16980 fi
16981 echo "$as_me:16981: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16982 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16983 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16984   cat >>confdefs.h <<EOF
16985 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16986 EOF
16987
16988 ac_header_dirent=$ac_hdr; break
16989 fi
16990
16991 done
16992 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16993 if test $ac_header_dirent = dirent.h; then
16994   echo "$as_me:16994: checking for opendir in -ldir" >&5
16995 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16996 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16997   echo $ECHO_N "(cached) $ECHO_C" >&6
16998 else
16999   ac_check_lib_save_LIBS=$LIBS
17000 LIBS="-ldir  $LIBS"
17001 cat >"conftest.$ac_ext" <<_ACEOF
17002 #line 17002 "configure"
17003 #include "confdefs.h"
17004
17005 /* Override any gcc2 internal prototype to avoid an error.  */
17006 #ifdef __cplusplus
17007 extern "C"
17008 #endif
17009 /* We use char because int might match the return type of a gcc2
17010    builtin and then its argument prototype would still apply.  */
17011 char opendir ();
17012 int
17013 main (void)
17014 {
17015 opendir ();
17016   ;
17017   return 0;
17018 }
17019 _ACEOF
17020 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17021 if { (eval echo "$as_me:17021: \"$ac_link\"") >&5
17022   (eval $ac_link) 2>&5
17023   ac_status=$?
17024   echo "$as_me:17024: \$? = $ac_status" >&5
17025   (exit "$ac_status"); } &&
17026          { ac_try='test -s "conftest$ac_exeext"'
17027   { (eval echo "$as_me:17027: \"$ac_try\"") >&5
17028   (eval $ac_try) 2>&5
17029   ac_status=$?
17030   echo "$as_me:17030: \$? = $ac_status" >&5
17031   (exit "$ac_status"); }; }; then
17032   ac_cv_lib_dir_opendir=yes
17033 else
17034   echo "$as_me: failed program was:" >&5
17035 cat "conftest.$ac_ext" >&5
17036 ac_cv_lib_dir_opendir=no
17037 fi
17038 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17039 LIBS=$ac_check_lib_save_LIBS
17040 fi
17041 echo "$as_me:17041: result: $ac_cv_lib_dir_opendir" >&5
17042 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17043 if test "$ac_cv_lib_dir_opendir" = yes; then
17044   LIBS="$LIBS -ldir"
17045 fi
17046
17047 else
17048   echo "$as_me:17048: checking for opendir in -lx" >&5
17049 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17050 if test "${ac_cv_lib_x_opendir+set}" = set; then
17051   echo $ECHO_N "(cached) $ECHO_C" >&6
17052 else
17053   ac_check_lib_save_LIBS=$LIBS
17054 LIBS="-lx  $LIBS"
17055 cat >"conftest.$ac_ext" <<_ACEOF
17056 #line 17056 "configure"
17057 #include "confdefs.h"
17058
17059 /* Override any gcc2 internal prototype to avoid an error.  */
17060 #ifdef __cplusplus
17061 extern "C"
17062 #endif
17063 /* We use char because int might match the return type of a gcc2
17064    builtin and then its argument prototype would still apply.  */
17065 char opendir ();
17066 int
17067 main (void)
17068 {
17069 opendir ();
17070   ;
17071   return 0;
17072 }
17073 _ACEOF
17074 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17075 if { (eval echo "$as_me:17075: \"$ac_link\"") >&5
17076   (eval $ac_link) 2>&5
17077   ac_status=$?
17078   echo "$as_me:17078: \$? = $ac_status" >&5
17079   (exit "$ac_status"); } &&
17080          { ac_try='test -s "conftest$ac_exeext"'
17081   { (eval echo "$as_me:17081: \"$ac_try\"") >&5
17082   (eval $ac_try) 2>&5
17083   ac_status=$?
17084   echo "$as_me:17084: \$? = $ac_status" >&5
17085   (exit "$ac_status"); }; }; then
17086   ac_cv_lib_x_opendir=yes
17087 else
17088   echo "$as_me: failed program was:" >&5
17089 cat "conftest.$ac_ext" >&5
17090 ac_cv_lib_x_opendir=no
17091 fi
17092 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17093 LIBS=$ac_check_lib_save_LIBS
17094 fi
17095 echo "$as_me:17095: result: $ac_cv_lib_x_opendir" >&5
17096 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17097 if test "$ac_cv_lib_x_opendir" = yes; then
17098   LIBS="$LIBS -lx"
17099 fi
17100
17101 fi
17102
17103 echo "$as_me:17103: checking whether time.h and sys/time.h may both be included" >&5
17104 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17105 if test "${ac_cv_header_time+set}" = set; then
17106   echo $ECHO_N "(cached) $ECHO_C" >&6
17107 else
17108   cat >"conftest.$ac_ext" <<_ACEOF
17109 #line 17109 "configure"
17110 #include "confdefs.h"
17111 #include <sys/types.h>
17112 #include <sys/time.h>
17113 #include <time.h>
17114
17115 int
17116 main (void)
17117 {
17118 if ((struct tm *) 0)
17119 return 0;
17120   ;
17121   return 0;
17122 }
17123 _ACEOF
17124 rm -f "conftest.$ac_objext"
17125 if { (eval echo "$as_me:17125: \"$ac_compile\"") >&5
17126   (eval $ac_compile) 2>&5
17127   ac_status=$?
17128   echo "$as_me:17128: \$? = $ac_status" >&5
17129   (exit "$ac_status"); } &&
17130          { ac_try='test -s "conftest.$ac_objext"'
17131   { (eval echo "$as_me:17131: \"$ac_try\"") >&5
17132   (eval $ac_try) 2>&5
17133   ac_status=$?
17134   echo "$as_me:17134: \$? = $ac_status" >&5
17135   (exit "$ac_status"); }; }; then
17136   ac_cv_header_time=yes
17137 else
17138   echo "$as_me: failed program was:" >&5
17139 cat "conftest.$ac_ext" >&5
17140 ac_cv_header_time=no
17141 fi
17142 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17143 fi
17144 echo "$as_me:17144: result: $ac_cv_header_time" >&5
17145 echo "${ECHO_T}$ac_cv_header_time" >&6
17146 if test $ac_cv_header_time = yes; then
17147
17148 cat >>confdefs.h <<\EOF
17149 #define TIME_WITH_SYS_TIME 1
17150 EOF
17151
17152 fi
17153
17154 ###     checks for compiler characteristics
17155 ac_ext=c
17156 ac_cpp='$CPP $CPPFLAGS'
17157 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17158 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17159 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17160 ac_main_return="return"
17161
17162 echo "$as_me:17162: checking for an ANSI C-conforming const" >&5
17163 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17164 if test "${ac_cv_c_const+set}" = set; then
17165   echo $ECHO_N "(cached) $ECHO_C" >&6
17166 else
17167   cat >"conftest.$ac_ext" <<_ACEOF
17168 #line 17168 "configure"
17169 #include "confdefs.h"
17170
17171 int
17172 main (void)
17173 {
17174 /* FIXME: Include the comments suggested by Paul. */
17175 #ifndef __cplusplus
17176   /* Ultrix mips cc rejects this.  */
17177   typedef int charset[2];
17178   const charset x;
17179   /* SunOS 4.1.1 cc rejects this.  */
17180   char const *const *ccp;
17181   char **p;
17182   /* NEC SVR4.0.2 mips cc rejects this.  */
17183   struct point {int x, y;};
17184   static struct point const zero = {0,0};
17185   /* AIX XL C 1.02.0.0 rejects this.
17186      It does not let you subtract one const X* pointer from another in
17187      an arm of an if-expression whose if-part is not a constant
17188      expression */
17189   const char *g = "string";
17190   ccp = &g + (g ? g-g : 0);
17191   /* HPUX 7.0 cc rejects these. */
17192   ++ccp;
17193   p = (char**) ccp;
17194   ccp = (char const *const *) p;
17195   { /* SCO 3.2v4 cc rejects this.  */
17196     char *t;
17197     char const *s = 0 ? (char *) 0 : (char const *) 0;
17198
17199     *t++ = 0;
17200   }
17201   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17202     int x[] = {25, 17};
17203     const int *foo = &x[0];
17204     ++foo;
17205   }
17206   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17207     typedef const int *iptr;
17208     iptr p = 0;
17209     ++p;
17210   }
17211   { /* AIX XL C 1.02.0.0 rejects this saying
17212        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17213     struct s { int j; const int *ap[3]; };
17214     struct s *b; b->j = 5;
17215   }
17216   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17217     const int foo = 10;
17218   }
17219 #endif
17220
17221   ;
17222   return 0;
17223 }
17224 _ACEOF
17225 rm -f "conftest.$ac_objext"
17226 if { (eval echo "$as_me:17226: \"$ac_compile\"") >&5
17227   (eval $ac_compile) 2>&5
17228   ac_status=$?
17229   echo "$as_me:17229: \$? = $ac_status" >&5
17230   (exit "$ac_status"); } &&
17231          { ac_try='test -s "conftest.$ac_objext"'
17232   { (eval echo "$as_me:17232: \"$ac_try\"") >&5
17233   (eval $ac_try) 2>&5
17234   ac_status=$?
17235   echo "$as_me:17235: \$? = $ac_status" >&5
17236   (exit "$ac_status"); }; }; then
17237   ac_cv_c_const=yes
17238 else
17239   echo "$as_me: failed program was:" >&5
17240 cat "conftest.$ac_ext" >&5
17241 ac_cv_c_const=no
17242 fi
17243 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17244 fi
17245 echo "$as_me:17245: result: $ac_cv_c_const" >&5
17246 echo "${ECHO_T}$ac_cv_c_const" >&6
17247 if test $ac_cv_c_const = no; then
17248
17249 cat >>confdefs.h <<\EOF
17250 #define const
17251 EOF
17252
17253 fi
17254
17255 ###     Checks for external-data
17256
17257 echo "$as_me:17257: checking if data-only library module links" >&5
17258 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17259 if test "${cf_cv_link_dataonly+set}" = set; then
17260   echo $ECHO_N "(cached) $ECHO_C" >&6
17261 else
17262
17263         rm -f conftest.a
17264         cat >conftest.$ac_ext <<EOF
17265 #line 17265 "configure"
17266 int     testdata[3] = { 123, 456, 789 };
17267 EOF
17268         if { (eval echo "$as_me:17268: \"$ac_compile\"") >&5
17269   (eval $ac_compile) 2>&5
17270   ac_status=$?
17271   echo "$as_me:17271: \$? = $ac_status" >&5
17272   (exit "$ac_status"); } ; then
17273                 mv conftest.o data.o && \
17274                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17275         fi
17276         rm -f conftest.$ac_ext data.o
17277         cat >conftest.$ac_ext <<EOF
17278 #line 17278 "configure"
17279 int     testfunc(void)
17280 {
17281 #if defined(NeXT)
17282         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17283 #else
17284         extern int testdata[3];
17285         return testdata[0] == 123
17286            &&  testdata[1] == 456
17287            &&  testdata[2] == 789;
17288 #endif
17289 }
17290 EOF
17291         if { (eval echo "$as_me:17291: \"$ac_compile\"") >&5
17292   (eval $ac_compile) 2>&5
17293   ac_status=$?
17294   echo "$as_me:17294: \$? = $ac_status" >&5
17295   (exit "$ac_status"); }; then
17296                 mv conftest.o func.o && \
17297                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17298         fi
17299         rm -f conftest.$ac_ext func.o
17300         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17301         cf_saveLIBS="$LIBS"
17302         LIBS="conftest.a $LIBS"
17303         if test "$cross_compiling" = yes; then
17304   cf_cv_link_dataonly=unknown
17305 else
17306   cat >"conftest.$ac_ext" <<_ACEOF
17307 #line 17307 "configure"
17308 #include "confdefs.h"
17309
17310         int main(void)
17311         {
17312                 extern int testfunc();
17313                 ${cf_cv_main_return:-return} (!testfunc());
17314         }
17315
17316 _ACEOF
17317 rm -f "conftest$ac_exeext"
17318 if { (eval echo "$as_me:17318: \"$ac_link\"") >&5
17319   (eval $ac_link) 2>&5
17320   ac_status=$?
17321   echo "$as_me:17321: \$? = $ac_status" >&5
17322   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17323   { (eval echo "$as_me:17323: \"$ac_try\"") >&5
17324   (eval $ac_try) 2>&5
17325   ac_status=$?
17326   echo "$as_me:17326: \$? = $ac_status" >&5
17327   (exit "$ac_status"); }; }; then
17328   cf_cv_link_dataonly=yes
17329 else
17330   echo "$as_me: program exited with status $ac_status" >&5
17331 echo "$as_me: failed program was:" >&5
17332 cat "conftest.$ac_ext" >&5
17333 cf_cv_link_dataonly=no
17334 fi
17335 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17336 fi
17337         LIBS="$cf_saveLIBS"
17338
17339 fi
17340
17341 echo "$as_me:17341: result: $cf_cv_link_dataonly" >&5
17342 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17343
17344 if test "$cf_cv_link_dataonly" = no ; then
17345
17346 cat >>confdefs.h <<\EOF
17347 #define BROKEN_LINKER 1
17348 EOF
17349
17350         BROKEN_LINKER=1
17351 fi
17352
17353 ###     Checks for library functions.
17354
17355 for ac_header in \
17356 unistd.h \
17357
17358 do
17359 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17360 echo "$as_me:17360: checking for $ac_header" >&5
17361 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17362 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17363   echo $ECHO_N "(cached) $ECHO_C" >&6
17364 else
17365   cat >"conftest.$ac_ext" <<_ACEOF
17366 #line 17366 "configure"
17367 #include "confdefs.h"
17368 #include <$ac_header>
17369 _ACEOF
17370 if { (eval echo "$as_me:17370: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17371   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17372   ac_status=$?
17373   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17374   rm -f conftest.er1
17375   cat conftest.err >&5
17376   echo "$as_me:17376: \$? = $ac_status" >&5
17377   (exit "$ac_status"); } >/dev/null; then
17378   if test -s conftest.err; then
17379     ac_cpp_err=$ac_c_preproc_warn_flag
17380   else
17381     ac_cpp_err=
17382   fi
17383 else
17384   ac_cpp_err=yes
17385 fi
17386 if test -z "$ac_cpp_err"; then
17387   eval "$as_ac_Header=yes"
17388 else
17389   echo "$as_me: failed program was:" >&5
17390   cat "conftest.$ac_ext" >&5
17391   eval "$as_ac_Header=no"
17392 fi
17393 rm -f conftest.err "conftest.$ac_ext"
17394 fi
17395 echo "$as_me:17395: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17396 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17397 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17398   cat >>confdefs.h <<EOF
17399 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17400 EOF
17401
17402 fi
17403 done
17404
17405 echo "$as_me:17405: checking for working mkstemp" >&5
17406 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17407 if test "${cf_cv_func_mkstemp+set}" = set; then
17408   echo $ECHO_N "(cached) $ECHO_C" >&6
17409 else
17410
17411 rm -rf ./conftest*
17412 if test "$cross_compiling" = yes; then
17413   cf_cv_func_mkstemp=maybe
17414 else
17415   cat >"conftest.$ac_ext" <<_ACEOF
17416 #line 17416 "configure"
17417 #include "confdefs.h"
17418
17419 #include <sys/types.h>
17420 #ifdef HAVE_UNISTD_H
17421 #include <unistd.h>
17422 #endif
17423 #include <stdlib.h>
17424 #include <stdio.h>
17425 #include <string.h>
17426 #include <sys/stat.h>
17427 int main(void)
17428 {
17429         char *tmpl = "conftestXXXXXX";
17430         char name[2][80];
17431         int n;
17432         int result = 0;
17433         int fd;
17434         struct stat sb;
17435
17436         umask(077);
17437         for (n = 0; n < 2; ++n) {
17438                 strcpy(name[n], tmpl);
17439                 if ((fd = mkstemp(name[n])) >= 0) {
17440                         if (!strcmp(name[n], tmpl)
17441                          || stat(name[n], &sb) != 0
17442                          || (sb.st_mode & S_IFMT) != S_IFREG
17443                          || (sb.st_mode & 077) != 0) {
17444                                 result = 1;
17445                         }
17446                         close(fd);
17447                 }
17448         }
17449         if (result == 0
17450          && !strcmp(name[0], name[1]))
17451                 result = 1;
17452         ${cf_cv_main_return:-return}(result);
17453 }
17454
17455 _ACEOF
17456 rm -f "conftest$ac_exeext"
17457 if { (eval echo "$as_me:17457: \"$ac_link\"") >&5
17458   (eval $ac_link) 2>&5
17459   ac_status=$?
17460   echo "$as_me:17460: \$? = $ac_status" >&5
17461   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17462   { (eval echo "$as_me:17462: \"$ac_try\"") >&5
17463   (eval $ac_try) 2>&5
17464   ac_status=$?
17465   echo "$as_me:17465: \$? = $ac_status" >&5
17466   (exit "$ac_status"); }; }; then
17467   cf_cv_func_mkstemp=yes
17468
17469 else
17470   echo "$as_me: program exited with status $ac_status" >&5
17471 echo "$as_me: failed program was:" >&5
17472 cat "conftest.$ac_ext" >&5
17473 cf_cv_func_mkstemp=no
17474
17475 fi
17476 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17477 fi
17478
17479 fi
17480 echo "$as_me:17480: result: $cf_cv_func_mkstemp" >&5
17481 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17482 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17483         echo "$as_me:17483: checking for mkstemp" >&5
17484 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17485 if test "${ac_cv_func_mkstemp+set}" = set; then
17486   echo $ECHO_N "(cached) $ECHO_C" >&6
17487 else
17488   cat >"conftest.$ac_ext" <<_ACEOF
17489 #line 17489 "configure"
17490 #include "confdefs.h"
17491 #define mkstemp autoconf_temporary
17492 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17493 #undef mkstemp
17494
17495 #ifdef __cplusplus
17496 extern "C"
17497 #endif
17498
17499 /* We use char because int might match the return type of a gcc2
17500    builtin and then its argument prototype would still apply.  */
17501 char mkstemp (void);
17502
17503 int
17504 main (void)
17505 {
17506
17507 /* The GNU C library defines stubs for functions which it implements
17508     to always fail with ENOSYS.  Some functions are actually named
17509     something starting with __ and the normal name is an alias.  */
17510 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17511 #error found stub for mkstemp
17512 #endif
17513
17514         return mkstemp ();
17515   ;
17516   return 0;
17517 }
17518 _ACEOF
17519 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17520 if { (eval echo "$as_me:17520: \"$ac_link\"") >&5
17521   (eval $ac_link) 2>&5
17522   ac_status=$?
17523   echo "$as_me:17523: \$? = $ac_status" >&5
17524   (exit "$ac_status"); } &&
17525          { ac_try='test -s "conftest$ac_exeext"'
17526   { (eval echo "$as_me:17526: \"$ac_try\"") >&5
17527   (eval $ac_try) 2>&5
17528   ac_status=$?
17529   echo "$as_me:17529: \$? = $ac_status" >&5
17530   (exit "$ac_status"); }; }; then
17531   ac_cv_func_mkstemp=yes
17532 else
17533   echo "$as_me: failed program was:" >&5
17534 cat "conftest.$ac_ext" >&5
17535 ac_cv_func_mkstemp=no
17536 fi
17537 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17538 fi
17539 echo "$as_me:17539: result: $ac_cv_func_mkstemp" >&5
17540 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17541
17542 fi
17543 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17544
17545 cat >>confdefs.h <<\EOF
17546 #define HAVE_MKSTEMP 1
17547 EOF
17548
17549 fi
17550
17551 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17552         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17553         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17554 fi
17555
17556 cf_with_ada=yes
17557 if test "$cf_with_ada" != "no" ; then
17558
17559 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17560 do
17561
17562 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17563
17564         unset ac_cv_path_cf_TEMP_gnat
17565         unset cf_TEMP_gnat
17566         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17567 set dummy $cf_prog_gnat; ac_word=$2
17568 echo "$as_me:17568: checking for $ac_word" >&5
17569 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17570 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17571   echo $ECHO_N "(cached) $ECHO_C" >&6
17572 else
17573   case $cf_TEMP_gnat in
17574   [\\/]* | ?:[\\/]*)
17575   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17576   ;;
17577   *)
17578   ac_save_IFS=$IFS; IFS=$ac_path_separator
17579 ac_dummy="$PATH"
17580 for ac_dir in $ac_dummy; do
17581   IFS=$ac_save_IFS
17582   test -z "$ac_dir" && ac_dir=.
17583   if $as_executable_p "$ac_dir/$ac_word"; then
17584    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17585    echo "$as_me:17585: found $ac_dir/$ac_word" >&5
17586    break
17587 fi
17588 done
17589
17590   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17591   ;;
17592 esac
17593 fi
17594 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17595
17596 if test -n "$cf_TEMP_gnat"; then
17597   echo "$as_me:17597: result: $cf_TEMP_gnat" >&5
17598 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17599 else
17600   echo "$as_me:17600: result: no" >&5
17601 echo "${ECHO_T}no" >&6
17602 fi
17603
17604         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17605
17606         if test "x$cf_TEMP_gnat" != xno; then
17607                 unset cf_cv_gnat_version
17608                 unset cf_TEMP_gnat
17609
17610 echo "$as_me:17610: checking for $cf_prog_gnat version" >&5
17611 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17612 if test "${cf_cv_gnat_version+set}" = set; then
17613   echo $ECHO_N "(cached) $ECHO_C" >&6
17614 else
17615
17616 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17617         grep '[0-9].[0-9][0-9]*' |\
17618         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17619
17620 fi
17621 echo "$as_me:17621: result: $cf_cv_gnat_version" >&5
17622 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17623 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17624 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17625
17626         fi
17627         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17628
17629         unset cf_TEMP_gnat
17630         unset cf_cv_gnat_version
17631         unset ac_cv_path_cf_TEMP_gnat
17632 done
17633
17634 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17635         cf_ada_make=
17636         cf_cv_prog_gnat_correct=no
17637 else
17638         cf_ada_make=gnatmake
17639         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17640                 # gprconfig is newer than gnatmake; we can continue...
17641                 cf_ada_config="##"
17642         else
17643                 rm -rf ./conftest* ./*~conftest*
17644                 if mkdir conftest.src
17645                 then
17646                         cf_ada_config=""
17647                         cd conftest.src
17648                         for cf_gprconfig in Ada C
17649                         do
17650                                 echo "$as_me:17650: checking for gprconfig name for $cf_gprconfig" >&5
17651 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17652                                 if test "$cf_gprconfig" = C
17653                                 then
17654                                         for cf_gprconfig_param in \
17655                                                 "$cf_gprconfig,,,,GNATGCC" \
17656                                                 "$cf_gprconfig,,,,GCC" \
17657                                                 "$cf_gprconfig"
17658                                         do
17659                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17660                                                 test -n "$cf_gprconfig_value" && break
17661                                         done
17662                                 else
17663                                         cf_gprconfig_param=$cf_gprconfig
17664                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17665                                 fi
17666                                 if test -n "$cf_gprconfig_value"
17667                                 then
17668                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17669                                         echo "$as_me:17669: result: $cf_gprconfig_value" >&5
17670 echo "${ECHO_T}$cf_gprconfig_value" >&6
17671                                 else
17672                                         echo "$as_me:17672: result: missing" >&5
17673 echo "${ECHO_T}missing" >&6
17674                                         cf_ada_config="#"
17675                                         break
17676                                 fi
17677                         done
17678                         cd ..
17679                         rm -rf ./conftest* ./*~conftest*
17680                 fi
17681         fi
17682         if test "x$cf_ada_config" != "x#"
17683         then
17684
17685 echo "$as_me:17685: checking for gnat version" >&5
17686 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17687 if test "${cf_cv_gnat_version+set}" = set; then
17688   echo $ECHO_N "(cached) $ECHO_C" >&6
17689 else
17690
17691 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17692         grep '[0-9].[0-9][0-9]*' |\
17693         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17694
17695 fi
17696 echo "$as_me:17696: result: $cf_cv_gnat_version" >&5
17697 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17698 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17699
17700 case "$cf_cv_gnat_version" in
17701 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17702         cf_cv_prog_gnat_correct=yes
17703         ;;
17704 (*)
17705         { echo "$as_me:17705: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17706 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17707         cf_cv_prog_gnat_correct=no
17708         ;;
17709 esac
17710
17711                 # Extract the first word of "m4", so it can be a program name with args.
17712 set dummy m4; ac_word=$2
17713 echo "$as_me:17713: checking for $ac_word" >&5
17714 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17715 if test "${ac_cv_prog_M4_exists+set}" = set; then
17716   echo $ECHO_N "(cached) $ECHO_C" >&6
17717 else
17718   if test -n "$M4_exists"; then
17719   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17720 else
17721   ac_save_IFS=$IFS; IFS=$ac_path_separator
17722 ac_dummy="$PATH"
17723 for ac_dir in $ac_dummy; do
17724   IFS=$ac_save_IFS
17725   test -z "$ac_dir" && ac_dir=.
17726   $as_executable_p "$ac_dir/$ac_word" || continue
17727 ac_cv_prog_M4_exists="yes"
17728 echo "$as_me:17728: found $ac_dir/$ac_word" >&5
17729 break
17730 done
17731
17732   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17733 fi
17734 fi
17735 M4_exists=$ac_cv_prog_M4_exists
17736 if test -n "$M4_exists"; then
17737   echo "$as_me:17737: result: $M4_exists" >&5
17738 echo "${ECHO_T}$M4_exists" >&6
17739 else
17740   echo "$as_me:17740: result: no" >&5
17741 echo "${ECHO_T}no" >&6
17742 fi
17743
17744                 if test "$ac_cv_prog_M4_exists" = no; then
17745                         cf_cv_prog_gnat_correct=no
17746                         { echo "$as_me:17746: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17747 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17748                 fi
17749                 if test "$cf_cv_prog_gnat_correct" = yes; then
17750                         echo "$as_me:17750: checking if GNAT works" >&5
17751 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17752
17753 rm -rf ./conftest* ./*~conftest*
17754 cat >>conftest.ads <<CF_EOF
17755 procedure conftest;
17756 CF_EOF
17757 cat >>conftest.adb <<CF_EOF
17758 with Text_IO;
17759 with GNAT.OS_Lib;
17760 procedure conftest is
17761 begin
17762    Text_IO.Put ("Hello World");
17763    Text_IO.New_Line;
17764    GNAT.OS_Lib.OS_Exit (0);
17765 end conftest;
17766 CF_EOF
17767 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17768    if ( ./conftest 1>&5 2>&1 ) ; then
17769       cf_cv_prog_gnat_correct=yes
17770    else
17771       cf_cv_prog_gnat_correct=no
17772    fi
17773 else
17774    cf_cv_prog_gnat_correct=no
17775 fi
17776 rm -rf ./conftest* ./*~conftest*
17777
17778                         echo "$as_me:17778: result: $cf_cv_prog_gnat_correct" >&5
17779 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17780                 fi
17781         else
17782                 cf_cv_prog_gnat_correct=no
17783         fi
17784 fi
17785
17786         if test "$cf_cv_prog_gnat_correct" = yes; then
17787
17788         echo "$as_me:17788: checking optimization options for ADAFLAGS" >&5
17789 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17790         case "$CFLAGS" in
17791         (*-g*)
17792
17793         ADAFLAGS="$ADAFLAGS -g"
17794
17795                 ;;
17796         esac
17797         case "$CFLAGS" in
17798         (*-O*)
17799                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17800
17801         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17802
17803                 ;;
17804         esac
17805         echo "$as_me:17805: result: $ADAFLAGS" >&5
17806 echo "${ECHO_T}$ADAFLAGS" >&6
17807
17808 echo "$as_me:17808: checking if GNATPREP supports -T option" >&5
17809 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17810 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17811   echo $ECHO_N "(cached) $ECHO_C" >&6
17812 else
17813
17814 cf_cv_gnatprep_opt_t=no
17815 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17816
17817 fi
17818 echo "$as_me:17818: result: $cf_cv_gnatprep_opt_t" >&5
17819 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17820 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17821
17822 echo "$as_me:17822: checking if GNAT supports generics" >&5
17823 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17824 case "$cf_cv_gnat_version" in
17825 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17826         cf_gnat_generics=yes
17827         ;;
17828 (*)
17829         cf_gnat_generics=no
17830         ;;
17831 esac
17832 echo "$as_me:17832: result: $cf_gnat_generics" >&5
17833 echo "${ECHO_T}$cf_gnat_generics" >&6
17834
17835 if test "$cf_gnat_generics" = yes
17836 then
17837         cf_compile_generics=generics
17838         cf_generic_objects="\${GENOBJS}"
17839 else
17840         cf_compile_generics=
17841         cf_generic_objects=
17842 fi
17843
17844 echo "$as_me:17844: checking if GNAT supports SIGINT" >&5
17845 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17846 if test "${cf_cv_gnat_sigint+set}" = set; then
17847   echo $ECHO_N "(cached) $ECHO_C" >&6
17848 else
17849
17850 rm -rf ./conftest* ./*~conftest*
17851 cat >>conftest.ads <<CF_EOF
17852 with Ada.Interrupts.Names;
17853
17854 package ConfTest is
17855
17856    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17857    pragma Unreserve_All_Interrupts;
17858    pragma Warnings (On);
17859
17860    protected Process is
17861       procedure Stop;
17862       function Continue return Boolean;
17863       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17864    private
17865       Done : Boolean := False;
17866    end Process;
17867
17868 end ConfTest;
17869 CF_EOF
17870 cat >>conftest.adb <<CF_EOF
17871 package body ConfTest is
17872    protected body Process is
17873       procedure Stop is
17874       begin
17875          Done := True;
17876       end Stop;
17877       function Continue return Boolean is
17878       begin
17879          return not Done;
17880       end Continue;
17881    end Process;
17882 end ConfTest;
17883 CF_EOF
17884 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17885       cf_cv_gnat_sigint=yes
17886 else
17887    cf_cv_gnat_sigint=no
17888 fi
17889 rm -rf ./conftest* ./*~conftest*
17890
17891 fi
17892 echo "$as_me:17892: result: $cf_cv_gnat_sigint" >&5
17893 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17894
17895 if test "$cf_cv_gnat_sigint" = yes ; then
17896         USE_GNAT_SIGINT=""
17897 else
17898         USE_GNAT_SIGINT="#"
17899 fi
17900
17901 cf_gnat_libraries=no
17902 cf_gnat_projects=no
17903
17904 if test "$enable_gnat_projects" != no ; then
17905 echo "$as_me:17905: checking if GNAT supports project files" >&5
17906 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17907 case "$cf_cv_gnat_version" in
17908 (3.[0-9]*)
17909         ;;
17910 (*)
17911         case "$cf_cv_system_name" in
17912         (cygwin*|msys*)
17913                 ;;
17914         (*)
17915                 rm -rf ./conftest* ./*~conftest*
17916                 if mkdir conftest.src conftest.bin conftest.lib
17917                 then
17918                         cd conftest.src
17919                         rm -rf ./conftest* ./*~conftest*
17920                         cat >>library.gpr <<CF_EOF
17921 project Library is
17922   Kind := External ("LIB_KIND");
17923   for Library_Name use "ConfTest";
17924   for Object_Dir use ".";
17925   for Library_ALI_Dir use External("LIBRARY_DIR");
17926   for Library_Version use External ("SONAME");
17927   for Library_Kind use Kind;
17928   for Library_Dir use External("BUILD_DIR");
17929   Source_Dir := External ("SOURCE_DIR");
17930   for Source_Dirs use (Source_Dir);
17931 end Library;
17932 CF_EOF
17933                         cat >>confpackage.ads <<CF_EOF
17934 package ConfPackage is
17935    procedure conftest;
17936 end ConfPackage;
17937 CF_EOF
17938                         cat >>confpackage.adb <<CF_EOF
17939 with Text_IO;
17940 package body ConfPackage is
17941    procedure conftest is
17942    begin
17943       Text_IO.Put ("Hello World");
17944       Text_IO.New_Line;
17945    end conftest;
17946 end ConfPackage;
17947 CF_EOF
17948                         if ( "$cf_ada_make" $ADAFLAGS \
17949                                         -Plibrary.gpr \
17950                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17951                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17952                                         -XSOURCE_DIR="`pwd`" \
17953                                         -XSONAME=libConfTest.so.1 \
17954                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17955                                 cf_gnat_projects=yes
17956                         fi
17957                         cd ..
17958                 fi
17959                 if test -f conftest.lib/confpackage.ali
17960                 then
17961                         cf_gnat_libraries=yes
17962                 fi
17963                 rm -rf ./conftest* ./*~conftest*
17964                 ;;
17965         esac
17966         ;;
17967 esac
17968 echo "$as_me:17968: result: $cf_gnat_projects" >&5
17969 echo "${ECHO_T}$cf_gnat_projects" >&6
17970 fi # enable_gnat_projects
17971
17972 if test "$cf_gnat_projects" = yes
17973 then
17974         echo "$as_me:17974: checking if GNAT supports libraries" >&5
17975 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17976         echo "$as_me:17976: result: $cf_gnat_libraries" >&5
17977 echo "${ECHO_T}$cf_gnat_libraries" >&6
17978 fi
17979
17980 USE_OLD_MAKERULES=""
17981 USE_GNAT_PROJECTS="#"
17982 USE_GNAT_MAKE_GPR="#"
17983 USE_GNAT_GPRBUILD="#"
17984
17985 if test "$cf_gnat_projects" = yes
17986 then
17987         USE_OLD_MAKERULES="#"
17988         USE_GNAT_PROJECTS=""
17989         if test "$cf_cv_VERSION_GPRBUILD" != no
17990         then
17991                 USE_GNAT_GPRBUILD=""
17992         elif test "$cf_cv_VERSION_GNATMAKE" != no
17993         then
17994                 USE_GNAT_MAKE_GPR=""
17995         else
17996                 { echo "$as_me:17996: WARNING: use old makefile rules since tools are missing" >&5
17997 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17998         fi
17999 fi
18000
18001 if test "$cf_gnat_libraries" = yes
18002 then
18003         USE_GNAT_LIBRARIES=""
18004 else
18005         USE_GNAT_LIBRARIES="#"
18006 fi
18007
18008 echo "$as_me:18008: checking for ada-compiler" >&5
18009 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
18010
18011 # Check whether --with-ada-compiler or --without-ada-compiler was given.
18012 if test "${with_ada_compiler+set}" = set; then
18013   withval="$with_ada_compiler"
18014   cf_ada_compiler=$withval
18015 else
18016   cf_ada_compiler=gnatmake
18017 fi;
18018
18019 echo "$as_me:18019: result: $cf_ada_compiler" >&5
18020 echo "${ECHO_T}$cf_ada_compiler" >&6
18021
18022                 cf_ada_package=terminal_interface
18023
18024 echo "$as_me:18024: checking for ada-include" >&5
18025 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
18026
18027 # Check whether --with-ada-include or --without-ada-include was given.
18028 if test "${with_ada_include+set}" = set; then
18029   withval="$with_ada_include"
18030
18031 else
18032   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18033 fi; if test -n "$prefix/share/ada/adainclude" ; then
18034
18035 if test "x$prefix" != xNONE; then
18036         cf_path_syntax="$prefix"
18037 else
18038         cf_path_syntax="$ac_default_prefix"
18039 fi
18040
18041 case ".$withval" in
18042 (.\$\(*\)*|.\'*\'*)
18043         ;;
18044 (..|./*|.\\*)
18045         ;;
18046 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18047         ;;
18048 (.\$\{*prefix\}*|.\$\{*dir\}*)
18049         eval withval="$withval"
18050         case ".$withval" in
18051         (.NONE/*)
18052                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18053                 ;;
18054         esac
18055         ;;
18056 (.no|.NONE/*)
18057         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18058         ;;
18059 (*)
18060         { { echo "$as_me:18060: error: expected a pathname, not \"$withval\"" >&5
18061 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18062    { (exit 1); exit 1; }; }
18063         ;;
18064 esac
18065
18066 fi
18067 eval ADA_INCLUDE="$withval"
18068
18069 echo "$as_me:18069: result: $ADA_INCLUDE" >&5
18070 echo "${ECHO_T}$ADA_INCLUDE" >&6
18071
18072 echo "$as_me:18072: checking for ada-objects" >&5
18073 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
18074
18075 # Check whether --with-ada-objects or --without-ada-objects was given.
18076 if test "${with_ada_objects+set}" = set; then
18077   withval="$with_ada_objects"
18078
18079 else
18080   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18081 fi; if test -n "$prefix/lib/ada/adalib" ; then
18082
18083 if test "x$prefix" != xNONE; then
18084         cf_path_syntax="$prefix"
18085 else
18086         cf_path_syntax="$ac_default_prefix"
18087 fi
18088
18089 case ".$withval" in
18090 (.\$\(*\)*|.\'*\'*)
18091         ;;
18092 (..|./*|.\\*)
18093         ;;
18094 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18095         ;;
18096 (.\$\{*prefix\}*|.\$\{*dir\}*)
18097         eval withval="$withval"
18098         case ".$withval" in
18099         (.NONE/*)
18100                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18101                 ;;
18102         esac
18103         ;;
18104 (.no|.NONE/*)
18105         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18106         ;;
18107 (*)
18108         { { echo "$as_me:18108: error: expected a pathname, not \"$withval\"" >&5
18109 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18110    { (exit 1); exit 1; }; }
18111         ;;
18112 esac
18113
18114 fi
18115 eval ADA_OBJECTS="$withval"
18116
18117 echo "$as_me:18117: result: $ADA_OBJECTS" >&5
18118 echo "${ECHO_T}$ADA_OBJECTS" >&6
18119
18120 echo "$as_me:18120: checking if an Ada95 shared-library should be built" >&5
18121 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18122
18123 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18124 if test "${with_ada_sharedlib+set}" = set; then
18125   withval="$with_ada_sharedlib"
18126   with_ada_sharedlib=$withval
18127 else
18128   with_ada_sharedlib=no
18129 fi;
18130 echo "$as_me:18130: result: $with_ada_sharedlib" >&5
18131 echo "${ECHO_T}$with_ada_sharedlib" >&6
18132
18133 if test "x$with_ada_sharedlib" != xno
18134 then
18135         if test "x$cf_gnat_projects" != xyes
18136         then
18137                 { echo "$as_me:18137: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18138 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18139                 with_ada_sharedlib=no
18140         fi
18141 fi
18142
18143 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18144 MAKE_ADA_SHAREDLIB="#"
18145
18146 if test "x$with_ada_sharedlib" != xno
18147 then
18148         MAKE_ADA_SHAREDLIB=
18149         if test "x$with_ada_sharedlib" != xyes
18150         then
18151                 ADA_SHAREDLIB="$with_ada_sharedlib"
18152         fi
18153 fi
18154
18155                 # allow the Ada binding to be renamed
18156
18157 echo "$as_me:18157: checking for ada-libname" >&5
18158 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18159
18160 # Check whether --with-ada-libname or --without-ada-libname was given.
18161 if test "${with_ada_libname+set}" = set; then
18162   withval="$with_ada_libname"
18163   ADA_LIBNAME=$withval
18164 else
18165   ADA_LIBNAME=AdaCurses
18166 fi;
18167 case "x$ADA_LIBNAME" in
18168 (x|xyes|xno)
18169         ADA_LIBNAME=AdaCurses
18170         ;;
18171 esac
18172
18173 echo "$as_me:18173: result: $ADA_LIBNAME" >&5
18174 echo "${ECHO_T}$ADA_LIBNAME" >&6
18175
18176         else
18177                 { { echo "$as_me:18177: error: No usable Ada compiler found" >&5
18178 echo "$as_me: error: No usable Ada compiler found" >&2;}
18179    { (exit 1); exit 1; }; }
18180         fi
18181 else
18182         { { echo "$as_me:18182: error: The Ada compiler is needed for this package" >&5
18183 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18184    { (exit 1); exit 1; }; }
18185 fi
18186
18187 ################################################################################
18188
18189 # not needed
18190 TINFO_LDFLAGS2=
18191
18192 TINFO_LIBS=
18193
18194 ### Construct the list of include-directories to be generated
18195
18196 if test "$srcdir" != "."; then
18197         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18198 fi
18199 CPPFLAGS="-I../include $CPPFLAGS"
18200 if test "$srcdir" != "."; then
18201         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18202 fi
18203 CPPFLAGS="-I. $CPPFLAGS"
18204
18205 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18206 if test "$srcdir" != "."; then
18207         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18208 fi
18209 if test "$GCC" != yes; then
18210         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18211 elif test "$includedir" != "/usr/include"; then
18212         if test "$includedir" = '${prefix}/include' ; then
18213                 if test x$prefix != x/usr ; then
18214                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18215                 fi
18216         else
18217                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18218         fi
18219 fi
18220
18221 ### Build up pieces for makefile rules
18222 echo "$as_me:18222: checking default library suffix" >&5
18223 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18224
18225         case $DFT_LWR_MODEL in
18226         (libtool) DFT_ARG_SUFFIX=''   ;;
18227         (normal)  DFT_ARG_SUFFIX=''   ;;
18228         (debug)   DFT_ARG_SUFFIX='_g' ;;
18229         (profile) DFT_ARG_SUFFIX='_p' ;;
18230         (shared)  DFT_ARG_SUFFIX=''   ;;
18231         esac
18232         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18233 echo "$as_me:18233: result: $DFT_ARG_SUFFIX" >&5
18234 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18235
18236 echo "$as_me:18236: checking default library-dependency suffix" >&5
18237 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18238
18239         case X$DFT_LWR_MODEL in
18240         (Xlibtool)
18241                 DFT_LIB_SUFFIX='.la'
18242                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18243                 ;;
18244         (Xdebug)
18245                 case "$cf_cv_system_name" in
18246                 (*-msvc*)
18247                         DFT_LIB_SUFFIX='_g.lib'
18248                         ;;
18249                 (*)
18250                         DFT_LIB_SUFFIX='_g.a'
18251                         ;;
18252                 esac
18253                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18254                 ;;
18255         (Xprofile)
18256                 case "$cf_cv_system_name" in
18257                 (*-msvc*)
18258                         DFT_LIB_SUFFIX='_p.lib'
18259                         ;;
18260                 (*)
18261                         DFT_LIB_SUFFIX='_p.a'
18262                         ;;
18263                 esac
18264                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18265                 ;;
18266         (Xshared)
18267                 case "$cf_cv_system_name" in
18268                 (aix[5-7]*)
18269                         DFT_LIB_SUFFIX='.so'
18270                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18271                         ;;
18272                 (*-msvc*)
18273                         DFT_LIB_SUFFIX='.dll'
18274                         DFT_DEP_SUFFIX='.dll.lib'
18275                         ;;
18276                 (cygwin*|msys*|mingw*)
18277                         DFT_LIB_SUFFIX='.dll'
18278                         DFT_DEP_SUFFIX='.dll.a'
18279                         ;;
18280                 (darwin*)
18281                         DFT_LIB_SUFFIX='.dylib'
18282                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18283                         ;;
18284                 (hpux*)
18285                         case "$target" in
18286                         (ia64*)
18287                                 DFT_LIB_SUFFIX='.so'
18288                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18289                                 ;;
18290                         (*)
18291                                 DFT_LIB_SUFFIX='.sl'
18292                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18293                                 ;;
18294                         esac
18295                         ;;
18296                 (*)
18297                         DFT_LIB_SUFFIX='.so'
18298                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18299                         ;;
18300                 esac
18301                 ;;
18302         (*)
18303                 case "$target" in
18304                 (*-msvc*)
18305                         DFT_LIB_SUFFIX='.lib'
18306                         ;;
18307                 (*)
18308                         DFT_LIB_SUFFIX='.a'
18309                         ;;
18310                 esac
18311                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18312                 ;;
18313         esac
18314         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18315         then
18316                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18317                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18318         fi
18319 echo "$as_me:18319: result: $DFT_DEP_SUFFIX" >&5
18320 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18321
18322 echo "$as_me:18322: checking default object directory" >&5
18323 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18324
18325         case $DFT_LWR_MODEL in
18326         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18327         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18328         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18329         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18330         (shared)
18331                 case "$cf_cv_system_name" in
18332                 (cygwin|msys)
18333                         DFT_OBJ_SUBDIR='objects' ;;
18334                 (*)
18335                         DFT_OBJ_SUBDIR='obj_s' ;;
18336                 esac
18337         esac
18338 echo "$as_me:18338: result: $DFT_OBJ_SUBDIR" >&5
18339 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18340
18341 ### Set up low-level terminfo dependencies for makefiles.
18342
18343 if test "$DFT_LWR_MODEL" = shared ; then
18344         case $cf_cv_system_name in
18345         (cygwin*)
18346                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18347                 ;;
18348         (msys*)
18349                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18350                 ;;
18351         esac
18352 fi
18353
18354 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18355
18356 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18357
18358 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18359
18360 ### Construct the list of subdirectories for which we'll customize makefiles
18361 ### with the appropriate compile-rules.
18362
18363 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18364
18365 cat >>confdefs.h <<EOF
18366 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18367 EOF
18368
18369 ################################################################################
18370
18371 TEST_ARG2=
18372
18373 TEST_LIBS2=
18374
18375 NCURSES_SHLIB2="sh -c"
18376
18377 ADA_SUBDIRS="include gen src doc"
18378 if test "x$cf_with_tests" != "xno" ; then
18379         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18380 fi
18381 for cf_dir in $ADA_SUBDIRS
18382 do
18383         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18384 done
18385
18386 NCURSES_TREE="#"
18387
18388 EXTERNAL_TREE=
18389
18390 # match layout used by make-tar.sh
18391 ADAHTML_DIR=../doc/ada
18392
18393 if test "x$cross_compiling" = xyes ; then
18394         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18395 else
18396         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18397 fi
18398
18399 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"
18400 ac_config_commands="$ac_config_commands default"
18401 cat >confcache <<\_ACEOF
18402 # This file is a shell script that caches the results of configure
18403 # tests run on this system so they can be shared between configure
18404 # scripts and configure runs, see configure's option --config-cache.
18405 # It is not useful on other systems.  If it contains results you don't
18406 # want to keep, you may remove or edit it.
18407 #
18408 # config.status only pays attention to the cache file if you give it
18409 # the --recheck option to rerun configure.
18410 #
18411 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18412 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18413 # following values.
18414
18415 _ACEOF
18416
18417 # The following way of writing the cache mishandles newlines in values,
18418 # but we know of no workaround that is simple, portable, and efficient.
18419 # So, don't put newlines in cache variables' values.
18420 # Ultrix sh set writes to stderr and can't be redirected directly,
18421 # and sets the high bit in the cache file unless we assign to the vars.
18422 {
18423   (set) 2>&1 |
18424     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18425     *ac_space=\ *)
18426       # `set' does not quote correctly, so add quotes (double-quote
18427       # substitution turns \\\\ into \\, and sed turns \\ into \).
18428       sed -n \
18429         "s/'/'\\\\''/g;
18430           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18431       ;;
18432     *)
18433       # `set' quotes correctly as required by POSIX, so do not add quotes.
18434       sed -n \
18435         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18436       ;;
18437     esac;
18438 } |
18439   sed '
18440      t clear
18441      : clear
18442      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18443      t end
18444      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18445      : end' >>confcache
18446 if cmp -s $cache_file confcache; then :; else
18447   if test -w $cache_file; then
18448     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18449     cat confcache >$cache_file
18450   else
18451     echo "not updating unwritable cache $cache_file"
18452   fi
18453 fi
18454 rm -f confcache
18455
18456 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18457 # Let make expand exec_prefix.
18458 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18459
18460 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18461 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18462 # trailing colons and then remove the whole line if VPATH becomes empty
18463 # (actually we leave an empty line to preserve line numbers).
18464 if test "x$srcdir" = x.; then
18465   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18466 s/:*\$(srcdir):*/:/;
18467 s/:*\${srcdir}:*/:/;
18468 s/:*@srcdir@:*/:/;
18469 s/^\([^=]*=[    ]*\):*/\1/;
18470 s/:*$//;
18471 s/^[^=]*=[      ]*$//;
18472 }'
18473 fi
18474
18475 DEFS=-DHAVE_CONFIG_H
18476
18477 : "${CONFIG_STATUS=./config.status}"
18478 ac_clean_files_save=$ac_clean_files
18479 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18480 { echo "$as_me:18480: creating $CONFIG_STATUS" >&5
18481 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18482 cat >"$CONFIG_STATUS" <<_ACEOF
18483 #! $SHELL
18484 # Generated automatically by configure.
18485 # Run this file to recreate the current configuration.
18486 # Compiler output produced by configure, useful for debugging
18487 # configure, is in config.log if it exists.
18488
18489 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18490
18491 debug=false
18492 SHELL=\${CONFIG_SHELL-$SHELL}
18493 ac_cs_invocation="\$0 \$@"
18494
18495 CLICOLOR_FORCE= GREP_OPTIONS=
18496 unset CLICOLOR_FORCE GREP_OPTIONS
18497 _ACEOF
18498
18499 cat >>"$CONFIG_STATUS" <<\_ACEOF
18500 # Be Bourne compatible
18501 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18502   emulate sh
18503   NULLCMD=:
18504 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18505   set -o posix
18506 fi
18507
18508 # Name of the executable.
18509 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18510
18511 if expr a : '\(a\)' >/dev/null 2>&1; then
18512   as_expr="expr"
18513 else
18514   as_expr="false"
18515 fi
18516
18517 rm -f conf$$ conf$$.exe conf$$.file
18518 echo >conf$$.file
18519 if ln -s conf$$.file conf$$ 2>/dev/null; then
18520   # We could just check for DJGPP; but this test a) works b) is more generic
18521   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18522   if test -f conf$$.exe; then
18523     # Don't use ln at all; we don't have any links
18524     as_ln_s='cp -p'
18525   else
18526     as_ln_s='ln -s'
18527   fi
18528 elif ln conf$$.file conf$$ 2>/dev/null; then
18529   as_ln_s='ln'
18530 else
18531   as_ln_s='cp -p'
18532 fi
18533 rm -f conf$$ conf$$.exe conf$$.file
18534
18535 as_executable_p="test -f"
18536
18537 # Support unset when possible.
18538 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18539   as_unset="unset"
18540 else
18541   as_unset="false"
18542 fi
18543
18544 # NLS nuisances.
18545 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18546 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18547 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18548 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18549 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18550 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18551 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18552 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18553
18554 # IFS
18555 # We need space, tab and new line, in precisely that order.
18556 as_nl='
18557 '
18558 IFS="   $as_nl"
18559
18560 # CDPATH.
18561 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18562
18563 exec 6>&1
18564
18565 _ACEOF
18566
18567 # Files that config.status was made for.
18568 if test -n "$ac_config_files"; then
18569   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18570 fi
18571
18572 if test -n "$ac_config_headers"; then
18573   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18574 fi
18575
18576 if test -n "$ac_config_links"; then
18577   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18578 fi
18579
18580 if test -n "$ac_config_commands"; then
18581   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18582 fi
18583
18584 cat >>"$CONFIG_STATUS" <<\EOF
18585
18586 ac_cs_usage="\
18587 \`$as_me' instantiates files from templates according to the
18588 current configuration.
18589
18590 Usage: $0 [OPTIONS] [FILE]...
18591
18592   -h, --help       print this help, then exit
18593   -V, --version    print version number, then exit
18594   -d, --debug      don't remove temporary files
18595       --recheck    update $as_me by reconfiguring in the same conditions
18596   --file=FILE[:TEMPLATE]
18597                    instantiate the configuration file FILE
18598   --header=FILE[:TEMPLATE]
18599                    instantiate the configuration header FILE
18600
18601 Configuration files:
18602 $config_files
18603
18604 Configuration headers:
18605 $config_headers
18606
18607 Configuration commands:
18608 $config_commands
18609
18610 Report bugs to <dickey@invisible-island.net>."
18611 EOF
18612
18613 cat >>"$CONFIG_STATUS" <<EOF
18614 ac_cs_version="\\
18615 config.status
18616 configured by $0, generated by GNU Autoconf 2.52.20221009,
18617   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18618
18619 Copyright 2003-2021,2022        Thomas E. Dickey
18620 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18621 Free Software Foundation, Inc.
18622 This config.status script is free software; the Free Software Foundation
18623 gives unlimited permission to copy, distribute and modify it."
18624 srcdir="$srcdir"
18625 INSTALL="$INSTALL"
18626 EOF
18627
18628 cat >>"$CONFIG_STATUS" <<\EOF
18629 # If no file are specified by the user, then we need to provide default
18630 # value.  By we need to know if files were specified by the user.
18631 ac_need_defaults=:
18632 while test $# != 0
18633 do
18634   case $1 in
18635   --*=*)
18636     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18637     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18638     shift
18639     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18640     shift
18641     ;;
18642   -*);;
18643   *) # This is not an option, so the user has probably given explicit
18644      # arguments.
18645      ac_need_defaults=false;;
18646   esac
18647
18648   case $1 in
18649   # Handling of the options.
18650 EOF
18651 cat >>"$CONFIG_STATUS" <<EOF
18652   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18653     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18654     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18655 EOF
18656 cat >>"$CONFIG_STATUS" <<\EOF
18657   --version | --vers* | -V )
18658     echo "$ac_cs_version"; exit 0 ;;
18659   --he | --h)
18660     # Conflict between --help and --header
18661     { { echo "$as_me:18661: error: ambiguous option: $1
18662 Try \`$0 --help' for more information." >&5
18663 echo "$as_me: error: ambiguous option: $1
18664 Try \`$0 --help' for more information." >&2;}
18665    { (exit 1); exit 1; }; };;
18666   --help | --hel | -h )
18667     echo "$ac_cs_usage"; exit 0 ;;
18668   --debug | --d* | -d )
18669     debug=: ;;
18670   --file | --fil | --fi | --f )
18671     shift
18672     CONFIG_FILES="$CONFIG_FILES $1"
18673     ac_need_defaults=false;;
18674   --header | --heade | --head | --hea )
18675     shift
18676     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18677     ac_need_defaults=false;;
18678
18679   # This is an error.
18680   -*) { { echo "$as_me:18680: error: unrecognized option: $1
18681 Try \`$0 --help' for more information." >&5
18682 echo "$as_me: error: unrecognized option: $1
18683 Try \`$0 --help' for more information." >&2;}
18684    { (exit 1); exit 1; }; } ;;
18685
18686   *) ac_config_targets="$ac_config_targets $1" ;;
18687
18688   esac
18689   shift
18690 done
18691
18692 exec 5>>config.log
18693 cat >&5 << _ACEOF
18694
18695 ## ----------------------- ##
18696 ## Running config.status.  ##
18697 ## ----------------------- ##
18698
18699 This file was extended by $as_me 2.52.20221009, executed with
18700   CONFIG_FILES    = $CONFIG_FILES
18701   CONFIG_HEADERS  = $CONFIG_HEADERS
18702   CONFIG_LINKS    = $CONFIG_LINKS
18703   CONFIG_COMMANDS = $CONFIG_COMMANDS
18704   > "$ac_cs_invocation"
18705 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18706
18707 _ACEOF
18708 EOF
18709
18710 cat >>"$CONFIG_STATUS" <<EOF
18711 #
18712 # INIT-COMMANDS section.
18713 #
18714
18715 ### Special initialization commands, used to pass information from the
18716 ### configuration-run into config.status
18717
18718 AWK="$AWK"
18719 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18720 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18721 LIB_NAME="$LIB_NAME"
18722 LIB_PREFIX="$LIB_PREFIX"
18723 LIB_SUFFIX="$LIB_SUFFIX"
18724 LN_S="$LN_S"
18725 NCURSES_MAJOR="$NCURSES_MAJOR"
18726 NCURSES_MINOR="$NCURSES_MINOR"
18727 NCURSES_PATCH="$NCURSES_PATCH"
18728 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18729 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18730 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18731 cf_cv_abi_version="$cf_cv_abi_version"
18732 cf_cv_rel_version="$cf_cv_rel_version"
18733 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18734 cf_cv_shared_soname='$cf_cv_shared_soname'
18735 cf_cv_shlib_version="$cf_cv_shlib_version"
18736 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18737 cf_cv_system_name="$cf_cv_system_name"
18738 host="$host"
18739 target="$target"
18740
18741 EOF
18742
18743 cat >>"$CONFIG_STATUS" <<\EOF
18744 for ac_config_target in $ac_config_targets
18745 do
18746   case "$ac_config_target" in
18747   # Handling of arguments.
18748   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18749   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18750   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18751   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18752   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18753   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18754   *) { { echo "$as_me:18754: error: invalid argument: $ac_config_target" >&5
18755 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18756    { (exit 1); exit 1; }; };;
18757   esac
18758 done
18759
18760 # If the user did not use the arguments to specify the items to instantiate,
18761 # then the envvar interface is used.  Set only those that are not.
18762 # We use the long form for the default assignment because of an extremely
18763 # bizarre bug on SunOS 4.1.3.
18764 if "$ac_need_defaults"; then
18765   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18766   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18767   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18768 fi
18769
18770 # Create a temporary directory, and hook for its removal unless debugging.
18771 $debug ||
18772 {
18773   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18774   trap '{ (exit 1); exit 1; }' 1 2 13 15
18775 }
18776
18777 # Create a (secure) tmp directory for tmp files.
18778 : "${TMPDIR=/tmp}"
18779 {
18780   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18781   test -n "$tmp" && test -d "$tmp"
18782 }  ||
18783 {
18784   tmp=$TMPDIR/cs$$-$RANDOM
18785   (umask 077 && mkdir "$tmp")
18786 } ||
18787 {
18788    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18789    { (exit 1); exit 1; }
18790 }
18791
18792 EOF
18793
18794 cat >>"$CONFIG_STATUS" <<EOF
18795
18796 #
18797 # CONFIG_FILES section.
18798 #
18799
18800 # No need to generate the scripts if there are no CONFIG_FILES.
18801 # This happens for instance when ./config.status config.h
18802 if test -n "\$CONFIG_FILES"; then
18803   # Protect against being on the right side of a sed subst in config.status.
18804   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18805    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
18806 s,@SHELL@,$SHELL,;t t
18807 s,@exec_prefix@,$exec_prefix,;t t
18808 s,@prefix@,$prefix,;t t
18809 s,@program_transform_name@,$program_transform_name,;t t
18810 s,@bindir@,$bindir,;t t
18811 s,@sbindir@,$sbindir,;t t
18812 s,@libexecdir@,$libexecdir,;t t
18813 s,@datarootdir@,$datarootdir,;t t
18814 s,@datadir@,$datadir,;t t
18815 s,@sysconfdir@,$sysconfdir,;t t
18816 s,@sharedstatedir@,$sharedstatedir,;t t
18817 s,@localstatedir@,$localstatedir,;t t
18818 s,@runstatedir@,$runstatedir,;t t
18819 s,@libdir@,$libdir,;t t
18820 s,@includedir@,$includedir,;t t
18821 s,@oldincludedir@,$oldincludedir,;t t
18822 s,@infodir@,$infodir,;t t
18823 s,@mandir@,$mandir,;t t
18824 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18825 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18826 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18827 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18828 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18829 s,@build_alias@,$build_alias,;t t
18830 s,@host_alias@,$host_alias,;t t
18831 s,@target_alias@,$target_alias,;t t
18832 s,@ECHO_C@,$ECHO_C,;t t
18833 s,@ECHO_N@,$ECHO_N,;t t
18834 s,@ECHO_T@,$ECHO_T,;t t
18835 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18836 s,@DEFS@,$DEFS,;t t
18837 s,@LIBS@,$LIBS,;t t
18838 s,@top_builddir@,$top_builddir,;t t
18839 s,@build@,$build,;t t
18840 s,@build_cpu@,$build_cpu,;t t
18841 s,@build_vendor@,$build_vendor,;t t
18842 s,@build_os@,$build_os,;t t
18843 s,@host@,$host,;t t
18844 s,@host_cpu@,$host_cpu,;t t
18845 s,@host_vendor@,$host_vendor,;t t
18846 s,@host_os@,$host_os,;t t
18847 s,@target@,$target,;t t
18848 s,@target_cpu@,$target_cpu,;t t
18849 s,@target_vendor@,$target_vendor,;t t
18850 s,@target_os@,$target_os,;t t
18851 s,@GREP@,$GREP,;t t
18852 s,@FGREP@,$FGREP,;t t
18853 s,@CC@,$CC,;t t
18854 s,@CFLAGS@,$CFLAGS,;t t
18855 s,@LDFLAGS@,$LDFLAGS,;t t
18856 s,@CPPFLAGS@,$CPPFLAGS,;t t
18857 s,@ac_ct_CC@,$ac_ct_CC,;t t
18858 s,@EXEEXT@,$EXEEXT,;t t
18859 s,@OBJEXT@,$OBJEXT,;t t
18860 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18861 s,@CPP@,$CPP,;t t
18862 s,@EGREP@,$EGREP,;t t
18863 s,@AWK@,$AWK,;t t
18864 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18865 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18866 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18867 s,@LN_S@,$LN_S,;t t
18868 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18869 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18870 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18871 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18872 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18873 s,@SET_MAKE@,$SET_MAKE,;t t
18874 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18875 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18876 s,@CTAGS@,$CTAGS,;t t
18877 s,@ETAGS@,$ETAGS,;t t
18878 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18879 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18880 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18881 s,@RANLIB@,$RANLIB,;t t
18882 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18883 s,@LD@,$LD,;t t
18884 s,@ac_ct_LD@,$ac_ct_LD,;t t
18885 s,@AR@,$AR,;t t
18886 s,@ac_ct_AR@,$ac_ct_AR,;t t
18887 s,@ARFLAGS@,$ARFLAGS,;t t
18888 s,@DESTDIR@,$DESTDIR,;t t
18889 s,@BUILD_CC@,$BUILD_CC,;t t
18890 s,@BUILD_CPP@,$BUILD_CPP,;t t
18891 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18892 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18893 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18894 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18895 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18896 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18897 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18898 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18899 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18900 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18901 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18902 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18903 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18904 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18905 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18906 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18907 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18908 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18909 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18910 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18911 s,@CC_G_OPT@,$CC_G_OPT,;t t
18912 s,@LD_MODEL@,$LD_MODEL,;t t
18913 s,@shlibdir@,$shlibdir,;t t
18914 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18915 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18916 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18917 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18918 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18919 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18920 s,@LINK_PROGS@,$LINK_PROGS,;t t
18921 s,@LINK_TESTS@,$LINK_TESTS,;t t
18922 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18923 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18924 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18925 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18926 s,@RPATH_LIST@,$RPATH_LIST,;t t
18927 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18928 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18929 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18930 s,@PTHREAD@,$PTHREAD,;t t
18931 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18932 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18933 s,@ECHO_LT@,$ECHO_LT,;t t
18934 s,@ECHO_LD@,$ECHO_LD,;t t
18935 s,@RULE_CC@,$RULE_CC,;t t
18936 s,@SHOW_CC@,$SHOW_CC,;t t
18937 s,@ECHO_CC@,$ECHO_CC,;t t
18938 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18939 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18940 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18941 s,@ADAFLAGS@,$ADAFLAGS,;t t
18942 s,@ADA_TRACE@,$ADA_TRACE,;t t
18943 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18944 s,@M4_exists@,$M4_exists,;t t
18945 s,@cf_ada_make@,$cf_ada_make,;t t
18946 s,@cf_ada_config@,$cf_ada_config,;t t
18947 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18948 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18949 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18950 s,@cf_compile_generics@,$cf_compile_generics,;t t
18951 s,@cf_generic_objects@,$cf_generic_objects,;t t
18952 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18953 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18954 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18955 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18956 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18957 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18958 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18959 s,@cf_ada_package@,$cf_ada_package,;t t
18960 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18961 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18962 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18963 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18964 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18965 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18966 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18967 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18968 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18969 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18970 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18971 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18972 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18973 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18974 s,@TEST_ARG2@,$TEST_ARG2,;t t
18975 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18976 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18977 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18978 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18979 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18980 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18981 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18982 CEOF
18983
18984 EOF
18985
18986   cat >>"$CONFIG_STATUS" <<\EOF
18987   # Split the substitutions into bite-sized pieces for seds with
18988   # small command number limits, like on Digital OSF/1 and HP-UX.
18989   ac_max_sed_lines=48
18990   ac_sed_frag=1 # Number of current file.
18991   ac_beg=1 # First line for current file.
18992   ac_end=$ac_max_sed_lines # Line after last line for current file.
18993   ac_more_lines=:
18994   ac_sed_cmds=
18995   while "$ac_more_lines"; do
18996     if test "$ac_beg" -gt 1; then
18997       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
18998     else
18999       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19000     fi
19001     if test ! -s "$tmp"/subs.frag; then
19002       ac_more_lines=false
19003     else
19004       # The purpose of the label and of the branching condition is to
19005       # speed up the sed processing (if there are no `@' at all, there
19006       # is no need to browse any of the substitutions).
19007       # These are the two extra sed commands mentioned above.
19008       (echo ':t
19009   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19010       # It is possible to make a multiline substitution using escaped newlines.
19011       # Ensure that we do not split the substitution between script fragments.
19012       ac_BEG=$ac_end
19013       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19014       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19015       if test -s "$tmp"/subs.next; then
19016         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19017         if test ! -s "$tmp"/subs.edit; then
19018           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19019           if test ! -s "$tmp"/subs.edit; then
19020             if test "$ac_beg" -gt 1; then
19021               ac_end=`expr "$ac_end" - 1`
19022               continue
19023             fi
19024           fi
19025         fi
19026       fi
19027
19028       if test -z "$ac_sed_cmds"; then
19029         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19030       else
19031         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19032       fi
19033       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19034       ac_beg=$ac_end
19035       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19036     fi
19037   done
19038   if test -z "$ac_sed_cmds"; then
19039     ac_sed_cmds="cat"
19040   fi
19041 fi # test -n "$CONFIG_FILES"
19042
19043 EOF
19044 cat >>"$CONFIG_STATUS" <<\EOF
19045 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19046   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19047   case "$ac_file" in
19048   - | *:- | *:-:* ) # input from stdin
19049         cat >"$tmp"/stdin
19050         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19051         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19052   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19053         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19054   * )   ac_file_in=$ac_file.in ;;
19055   esac
19056
19057   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19058   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19059          X"$ac_file" : 'X\(//\)[^/]' \| \
19060          X"$ac_file" : 'X\(//\)$' \| \
19061          X"$ac_file" : 'X\(/\)' \| \
19062          .     : '\(.\)' 2>/dev/null ||
19063 echo X"$ac_file" |
19064     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19065           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19066           /^X\(\/\/\)$/{ s//\1/; q; }
19067           /^X\(\/\).*/{ s//\1/; q; }
19068           s/.*/./; q'`
19069   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19070     { case "$ac_dir" in
19071   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19072   *)                      as_incr_dir=.;;
19073 esac
19074 as_dummy="$ac_dir"
19075 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19076   case $as_mkdir_dir in
19077     # Skip DOS drivespec
19078     ?:) as_incr_dir=$as_mkdir_dir ;;
19079     *)
19080       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19081       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19082     ;;
19083   esac
19084 done; }
19085
19086     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19087     # A "../" for each directory in $ac_dir_suffix.
19088     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19089   else
19090     ac_dir_suffix= ac_dots=
19091   fi
19092
19093   case "$srcdir" in
19094   .)  ac_srcdir=.
19095       if test -z "$ac_dots"; then
19096          ac_top_srcdir=.
19097       else
19098          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19099       fi ;;
19100   [\\/]* | ?:[\\/]* )
19101       ac_srcdir="$srcdir$ac_dir_suffix";
19102       ac_top_srcdir="$srcdir" ;;
19103   *) # Relative path.
19104     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19105     ac_top_srcdir="$ac_dots$srcdir" ;;
19106   esac
19107
19108   case $INSTALL in
19109   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19110   *) ac_INSTALL=$ac_dots$INSTALL ;;
19111   esac
19112
19113   if test x"$ac_file" != x-; then
19114     { echo "$as_me:19114: creating $ac_file" >&5
19115 echo "$as_me: creating $ac_file" >&6;}
19116     rm -f "$ac_file"
19117   fi
19118   # Let's still pretend it is `configure' which instantiates (i.e., don't
19119   # use $as_me), people would be surprised to read:
19120   #    /* config.h.  Generated automatically by config.status.  */
19121   configure_input="Generated automatically from `echo $ac_file_in |
19122                                                  sed 's,.*/,,'` by configure."
19123
19124   # First look for the input files in the build tree, otherwise in the
19125   # src tree.
19126   ac_file_inputs=`IFS=:
19127     for f in $ac_file_in; do
19128       case $f in
19129       -) echo "$tmp"/stdin ;;
19130       [\\/$]*)
19131          # Absolute (can't be DOS-style, as IFS=:)
19132          test -f "$f" || { { echo "$as_me:19132: error: cannot find input file: $f" >&5
19133 echo "$as_me: error: cannot find input file: $f" >&2;}
19134    { (exit 1); exit 1; }; }
19135          echo "$f";;
19136       *) # Relative
19137          if test -f "$f"; then
19138            # Build tree
19139            echo "$f"
19140          elif test -f "$srcdir/$f"; then
19141            # Source tree
19142            echo "$srcdir/$f"
19143          else
19144            # /dev/null tree
19145            { { echo "$as_me:19145: error: cannot find input file: $f" >&5
19146 echo "$as_me: error: cannot find input file: $f" >&2;}
19147    { (exit 1); exit 1; }; }
19148          fi;;
19149       esac
19150     done` || { (exit 1); exit 1; }
19151 EOF
19152 cat >>"$CONFIG_STATUS" <<\EOF
19153   ac_warn_datarootdir=no
19154   if test x"$ac_file" != x-; then
19155     for ac_item in $ac_file_inputs
19156     do
19157       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19158       if test -n "$ac_seen"; then
19159         ac_used=`grep '@datarootdir@' "$ac_item"`
19160         if test -z "$ac_used"; then
19161           { echo "$as_me:19161: WARNING: datarootdir was used implicitly but not set:
19162 $ac_seen" >&5
19163 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19164 $ac_seen" >&2;}
19165           ac_warn_datarootdir=yes
19166         fi
19167       fi
19168       ac_seen=`grep '${datarootdir}' "$ac_item"`
19169       if test -n "$ac_seen"; then
19170         { echo "$as_me:19170: WARNING: datarootdir was used explicitly but not set:
19171 $ac_seen" >&5
19172 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19173 $ac_seen" >&2;}
19174         ac_warn_datarootdir=yes
19175       fi
19176     done
19177   fi
19178
19179 if test "x$ac_warn_datarootdir" = xyes; then
19180   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19181 fi
19182
19183 EOF
19184 cat >>"$CONFIG_STATUS" <<EOF
19185   sed "$ac_vpsub
19186 $extrasub
19187 EOF
19188 cat >>"$CONFIG_STATUS" <<\EOF
19189 :t
19190 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19191 s,@configure_input@,$configure_input,;t t
19192 s,@srcdir@,$ac_srcdir,;t t
19193 s,@top_srcdir@,$ac_top_srcdir,;t t
19194 s,@INSTALL@,$ac_INSTALL,;t t
19195 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19196   rm -f "$tmp"/stdin
19197 EOF
19198 : "${FGREP:=grep -F}"
19199 : "${EGREP:=grep -E}"
19200 cat >>"$CONFIG_STATUS" <<EOF
19201   : "\${FGREP:=$FGREP}"
19202   : "\${EGREP:=$EGREP}"
19203 EOF
19204 cat >>"$CONFIG_STATUS" <<\EOF
19205   if test x"$ac_file" != x-; then
19206     cp "$tmp/out" "$ac_file"
19207
19208     for ac_name in prefix exec_prefix datarootdir
19209     do
19210         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19211         if test -n "$ac_seen"; then
19212             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19213             if test -z "$ac_init"; then
19214               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19215               { echo "$as_me:19215: WARNING: Variable $ac_name is used but was not set:
19216 $ac_seen" >&5
19217 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19218 $ac_seen" >&2;}
19219             fi
19220         fi
19221     done
19222     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19223     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19224     if test -s "$tmp"/out; then
19225       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19226       { echo "$as_me:19226: WARNING: Some variables may not be substituted:
19227 $ac_seen" >&5
19228 echo "$as_me: WARNING: Some variables may not be substituted:
19229 $ac_seen" >&2;}
19230     fi
19231   else
19232     cat "$tmp"/out
19233   fi
19234   rm -f "$tmp"/out
19235
19236 done
19237 EOF
19238 cat >>"$CONFIG_STATUS" <<\EOF
19239
19240 #
19241 # CONFIG_HEADER section.
19242 #
19243
19244 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19245 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19246 #
19247 # ac_d sets the value in "#define NAME VALUE" lines.
19248 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19249 ac_dB='[        ].*$,\1#\2'
19250 ac_dC=' '
19251 ac_dD=',;t'
19252 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19253 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19254 ac_iB='\([      ]\),\1#\2define\3'
19255 ac_iC=' '
19256 ac_iD='\4,;t'
19257 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19258 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19259 ac_uB='$,\1#\2define\3'
19260 ac_uC=' '
19261 ac_uD=',;t'
19262
19263 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19264   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19265   case "$ac_file" in
19266   - | *:- | *:-:* ) # input from stdin
19267         cat >"$tmp"/stdin
19268         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19269         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19270   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19271         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19272   * )   ac_file_in=$ac_file.in ;;
19273   esac
19274
19275   test x"$ac_file" != x- && { echo "$as_me:19275: creating $ac_file" >&5
19276 echo "$as_me: creating $ac_file" >&6;}
19277
19278   # First look for the input files in the build tree, otherwise in the
19279   # src tree.
19280   ac_file_inputs=`IFS=:
19281     for f in $ac_file_in; do
19282       case $f in
19283       -) echo "$tmp"/stdin ;;
19284       [\\/$]*)
19285          # Absolute (can't be DOS-style, as IFS=:)
19286          test -f "$f" || { { echo "$as_me:19286: error: cannot find input file: $f" >&5
19287 echo "$as_me: error: cannot find input file: $f" >&2;}
19288    { (exit 1); exit 1; }; }
19289          echo $f;;
19290       *) # Relative
19291          if test -f "$f"; then
19292            # Build tree
19293            echo $f
19294          elif test -f "$srcdir/$f"; then
19295            # Source tree
19296            echo "$srcdir/$f"
19297          else
19298            # /dev/null tree
19299            { { echo "$as_me:19299: error: cannot find input file: $f" >&5
19300 echo "$as_me: error: cannot find input file: $f" >&2;}
19301    { (exit 1); exit 1; }; }
19302          fi;;
19303       esac
19304     done` || { (exit 1); exit 1; }
19305   # Remove the trailing spaces.
19306   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19307
19308 EOF
19309
19310 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19311 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19312 # be either 'cat' or 'sort'.
19313 cat confdefs.h | uniq >conftest.vals
19314
19315 # Break up conftest.vals because some shells have a limit on
19316 # the size of here documents, and old seds have small limits too.
19317
19318 rm -f conftest.tail
19319 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19320 while grep . conftest.vals >/dev/null
19321 do
19322   # Write chunks of a limited-size here document to conftest.frag.
19323   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19324   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19325   echo 'CEOF' >> "$CONFIG_STATUS"
19326   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19327   rm -f conftest.vals
19328   mv conftest.tail conftest.vals
19329 done
19330 rm -f conftest.vals
19331
19332 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19333 # marker @DEFS@.
19334 echo '  cat >> conftest.edit <<CEOF
19335 /@DEFS@/r conftest.frag
19336 /@DEFS@/d
19337 CEOF
19338 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19339 rm -f "$tmp"/in
19340 mv "$tmp"/out "$tmp"/in
19341 rm -f conftest.edit conftest.frag
19342 ' >> "$CONFIG_STATUS"
19343
19344 cat >>"$CONFIG_STATUS" <<\EOF
19345   # Let's still pretend it is `configure' which instantiates (i.e., don't
19346   # use $as_me), people would be surprised to read:
19347   #    /* config.h.  Generated automatically by config.status.  */
19348   if test x"$ac_file" = x-; then
19349     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19350   else
19351     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19352   fi
19353   cat "$tmp"/in >>"$tmp"/config.h
19354   rm -f "$tmp"/in
19355   if test x"$ac_file" != x-; then
19356     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19357       { echo "$as_me:19357: $ac_file is unchanged" >&5
19358 echo "$as_me: $ac_file is unchanged" >&6;}
19359     else
19360       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19361          X"$ac_file" : 'X\(//\)[^/]' \| \
19362          X"$ac_file" : 'X\(//\)$' \| \
19363          X"$ac_file" : 'X\(/\)' \| \
19364          .     : '\(.\)' 2>/dev/null ||
19365 echo X"$ac_file" |
19366     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19367           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19368           /^X\(\/\/\)$/{ s//\1/; q; }
19369           /^X\(\/\).*/{ s//\1/; q; }
19370           s/.*/./; q'`
19371       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19372         { case "$ac_dir" in
19373   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19374   *)                      as_incr_dir=.;;
19375 esac
19376 as_dummy="$ac_dir"
19377 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19378   case $as_mkdir_dir in
19379     # Skip DOS drivespec
19380     ?:) as_incr_dir=$as_mkdir_dir ;;
19381     *)
19382       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19383       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19384     ;;
19385   esac
19386 done; }
19387
19388       fi
19389       rm -f "$ac_file"
19390       mv "$tmp/config.h" "$ac_file"
19391     fi
19392   else
19393     cat "$tmp"/config.h
19394     rm -f "$tmp"/config.h
19395   fi
19396 done
19397 EOF
19398 cat >>"$CONFIG_STATUS" <<\EOF
19399 #
19400 # CONFIG_COMMANDS section.
19401 #
19402 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19403   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19404   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19405
19406   case "$ac_dest" in
19407     default )
19408 if test -z "$USE_OLD_MAKERULES" ; then
19409         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19410 fi
19411  ;;
19412   esac
19413 done
19414 EOF
19415
19416 cat >>"$CONFIG_STATUS" <<\EOF
19417
19418 { (exit 0); exit 0; }
19419 EOF
19420 chmod +x "$CONFIG_STATUS"
19421 ac_clean_files=$ac_clean_files_save
19422
19423 # configure is writing to config.log, and then calls config.status.
19424 # config.status does its own redirection, appending to config.log.
19425 # Unfortunately, on DOS this fails, as config.log is still kept open
19426 # by configure, so config.status won't be able to write to it; its
19427 # output is simply discarded.  So we exec the FD to /dev/null,
19428 # effectively closing config.log, so it can be properly (re)opened and
19429 # appended to by config.status.  When coming back to configure, we
19430 # need to make the FD available again.
19431 if test "$no_create" != yes; then
19432   ac_cs_success=:
19433   exec 5>/dev/null
19434   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19435   exec 5>>config.log
19436   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19437   # would make configure fail if this is the last instruction.
19438   "$ac_cs_success" || { (exit 1); exit 1; }
19439 fi
19440 ${MAKE:-make} preinstall