]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.3 - patch 20221217
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.88 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20221202.
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.20221202.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 PACKAGE="AdaCurses"
1063
1064 top_builddir=`pwd`
1065
1066 ac_aux_dir=
1067 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1068   if test -f "$ac_dir/install-sh"; then
1069     ac_aux_dir=$ac_dir
1070     ac_install_sh="$ac_aux_dir/install-sh -c"
1071     break
1072   elif test -f "$ac_dir/install.sh"; then
1073     ac_aux_dir=$ac_dir
1074     ac_install_sh="$ac_aux_dir/install.sh -c"
1075     break
1076   elif test -f "$ac_dir/shtool"; then
1077     ac_aux_dir=$ac_dir
1078     ac_install_sh="$ac_aux_dir/shtool install -c"
1079     break
1080   fi
1081 done
1082 if test -z "$ac_aux_dir"; then
1083   { { echo "$as_me:1083: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1084 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1085    { (exit 1); exit 1; }; }
1086 fi
1087 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1088 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1089 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1090
1091 # Make sure we can run config.sub.
1092 $ac_config_sub sun4 >/dev/null 2>&1 ||
1093   { { echo "$as_me:1093: error: cannot run $ac_config_sub" >&5
1094 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1095    { (exit 1); exit 1; }; }
1096
1097 echo "$as_me:1097: checking build system type" >&5
1098 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1099 if test "${ac_cv_build+set}" = set; then
1100   echo $ECHO_N "(cached) $ECHO_C" >&6
1101 else
1102   ac_cv_build_alias=$build_alias
1103 test -z "$ac_cv_build_alias" &&
1104   ac_cv_build_alias=`$ac_config_guess`
1105 test -z "$ac_cv_build_alias" &&
1106   { { echo "$as_me:1106: error: cannot guess build type; you must specify one" >&5
1107 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1108    { (exit 1); exit 1; }; }
1109 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1110   { { echo "$as_me:1110: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1111 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1112    { (exit 1); exit 1; }; }
1113
1114 fi
1115 echo "$as_me:1115: result: $ac_cv_build" >&5
1116 echo "${ECHO_T}$ac_cv_build" >&6
1117 build=$ac_cv_build
1118 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1119 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1120 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1121
1122 echo "$as_me:1122: checking host system type" >&5
1123 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1124 if test "${ac_cv_host+set}" = set; then
1125   echo $ECHO_N "(cached) $ECHO_C" >&6
1126 else
1127   ac_cv_host_alias=$host_alias
1128 test -z "$ac_cv_host_alias" &&
1129   ac_cv_host_alias=$ac_cv_build_alias
1130 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1131   { { echo "$as_me:1131: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1132 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1133    { (exit 1); exit 1; }; }
1134
1135 fi
1136 echo "$as_me:1136: result: $ac_cv_host" >&5
1137 echo "${ECHO_T}$ac_cv_host" >&6
1138 host=$ac_cv_host
1139 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1140 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1141 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1142
1143 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1144         echo "$as_me:1144: checking target system type" >&5
1145 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1146 if test "${ac_cv_target+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   ac_cv_target_alias=$target_alias
1150 test "x$ac_cv_target_alias" = "x" &&
1151   ac_cv_target_alias=$ac_cv_host_alias
1152 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1153   { { echo "$as_me:1153: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1154 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1155    { (exit 1); exit 1; }; }
1156
1157 fi
1158 echo "$as_me:1158: result: $ac_cv_target" >&5
1159 echo "${ECHO_T}$ac_cv_target" >&6
1160 target=$ac_cv_target
1161 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1162 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1163 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1164
1165 # The aliases save the names the user supplied, while $host etc.
1166 # will get canonicalized.
1167 test -n "$target_alias" &&
1168   test "$program_prefix$program_suffix$program_transform_name" = \
1169     NONENONEs,x,x, &&
1170   program_prefix=${target_alias}-
1171         system_name="$host_os"
1172 else
1173         system_name="`(uname -s -r) 2>/dev/null`"
1174         if test -z "$system_name" ; then
1175                 system_name="`(hostname) 2>/dev/null`"
1176         fi
1177 fi
1178 test -n "$system_name" &&
1179 cat >>confdefs.h <<EOF
1180 #define SYSTEM_NAME "$system_name"
1181 EOF
1182
1183 if test "${cf_cv_system_name+set}" = set; then
1184   echo $ECHO_N "(cached) $ECHO_C" >&6
1185 else
1186   cf_cv_system_name="$system_name"
1187 fi
1188
1189 test -z "$system_name" && system_name="$cf_cv_system_name"
1190 test -n "$cf_cv_system_name" && echo "$as_me:1190: result: Configuring for $cf_cv_system_name" >&5
1191 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1192
1193 if test ".$system_name" != ".$cf_cv_system_name" ; then
1194         echo "$as_me:1194: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1195 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1196         { { echo "$as_me:1196: error: \"Please remove config.cache and try again.\"" >&5
1197 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1198    { (exit 1); exit 1; }; }
1199 fi
1200
1201 # Check whether --with-system-type or --without-system-type was given.
1202 if test "${with_system_type+set}" = set; then
1203   withval="$with_system_type"
1204   { echo "$as_me:1204: WARNING: overriding system type to $withval" >&5
1205 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1206         cf_cv_system_name=$withval
1207         host_os=$withval
1208
1209 fi;
1210
1211 ###     Save the given $CFLAGS to allow user-override.
1212 cf_user_CFLAGS="$CFLAGS"
1213
1214 ###     Default install-location
1215 for ac_prog in ggrep grep
1216 do
1217   # Extract the first word of "$ac_prog", so it can be a program name with args.
1218 set dummy $ac_prog; ac_word=$2
1219 echo "$as_me:1219: checking for $ac_word" >&5
1220 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1221 if test "${ac_cv_prog_GREP+set}" = set; then
1222   echo $ECHO_N "(cached) $ECHO_C" >&6
1223 else
1224   if test -n "$GREP"; then
1225   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1226 else
1227   ac_save_IFS=$IFS; IFS=$ac_path_separator
1228 ac_dummy="$PATH"
1229 for ac_dir in $ac_dummy; do
1230   IFS=$ac_save_IFS
1231   test -z "$ac_dir" && ac_dir=.
1232   $as_executable_p "$ac_dir/$ac_word" || continue
1233 ac_cv_prog_GREP="$ac_prog"
1234 echo "$as_me:1234: found $ac_dir/$ac_word" >&5
1235 break
1236 done
1237
1238 fi
1239 fi
1240 GREP=$ac_cv_prog_GREP
1241 if test -n "$GREP"; then
1242   echo "$as_me:1242: result: $GREP" >&5
1243 echo "${ECHO_T}$GREP" >&6
1244 else
1245   echo "$as_me:1245: result: no" >&5
1246 echo "${ECHO_T}no" >&6
1247 fi
1248
1249   test -n "$GREP" && break
1250 done
1251 test -n "$GREP" || GREP=": "
1252
1253 echo "$as_me:1253: checking for fgrep" >&5
1254 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1255 if test "${ac_cv_path_FGREP+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1259    then ac_cv_path_FGREP="$GREP -F"
1260    else
1261      for ac_prog in gfgrep fgrep
1262 do
1263   # Extract the first word of "$ac_prog", so it can be a program name with args.
1264 set dummy $ac_prog; ac_word=$2
1265 echo "$as_me:1265: checking for $ac_word" >&5
1266 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1267 if test "${ac_cv_path_FGREP+set}" = set; then
1268   echo $ECHO_N "(cached) $ECHO_C" >&6
1269 else
1270   case $FGREP in
1271   [\\/]* | ?:[\\/]*)
1272   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1273   ;;
1274   *)
1275   ac_save_IFS=$IFS; IFS=$ac_path_separator
1276 ac_dummy="$PATH"
1277 for ac_dir in $ac_dummy; do
1278   IFS=$ac_save_IFS
1279   test -z "$ac_dir" && ac_dir=.
1280   if $as_executable_p "$ac_dir/$ac_word"; then
1281    ac_cv_path_FGREP="$ac_dir/$ac_word"
1282    echo "$as_me:1282: found $ac_dir/$ac_word" >&5
1283    break
1284 fi
1285 done
1286
1287   ;;
1288 esac
1289 fi
1290 FGREP=$ac_cv_path_FGREP
1291
1292 if test -n "$FGREP"; then
1293   echo "$as_me:1293: result: $FGREP" >&5
1294 echo "${ECHO_T}$FGREP" >&6
1295 else
1296   echo "$as_me:1296: result: no" >&5
1297 echo "${ECHO_T}no" >&6
1298 fi
1299
1300   test -n "$FGREP" && break
1301 done
1302 test -n "$FGREP" || FGREP=": "
1303
1304      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1304: error: cannot find workable fgrep" >&5
1305 echo "$as_me: error: cannot find workable fgrep" >&2;}
1306    { (exit 1); exit 1; }; }
1307    fi
1308 fi
1309 echo "$as_me:1309: result: $ac_cv_path_FGREP" >&5
1310 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1311  FGREP="$ac_cv_path_FGREP"
1312
1313 echo "$as_me:1313: checking for prefix" >&5
1314 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1315 if test "x$prefix" = "xNONE" ; then
1316         case "$cf_cv_system_name" in
1317                 # non-vendor systems don't have a conflict
1318         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1319                 prefix=/usr
1320                 ;;
1321         (*)     prefix=$ac_default_prefix
1322                 ;;
1323         esac
1324 fi
1325 echo "$as_me:1325: result: $prefix" >&5
1326 echo "${ECHO_T}$prefix" >&6
1327
1328 if test "x$prefix" = "xNONE" ; then
1329 echo "$as_me:1329: checking for default include-directory" >&5
1330 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1331 test -n "$verbose" && echo 1>&6
1332 for cf_symbol in \
1333         "$includedir" \
1334         "$includedir/ncurses" \
1335         "$prefix/include" \
1336         "$prefix/include/ncurses" \
1337         /usr/local/include \
1338         /usr/local/include/ncurses \
1339         /usr/include \
1340         /usr/include/ncurses
1341 do
1342         cf_dir=`eval echo "$cf_symbol"`
1343         if test -f "$cf_dir/curses.h" ; then
1344         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1345                 includedir="$cf_symbol"
1346                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1347                 break
1348         fi
1349         fi
1350         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1351 done
1352 echo "$as_me:1352: result: $includedir" >&5
1353 echo "${ECHO_T}$includedir" >&6
1354 fi
1355
1356 ###     Checks for programs.
1357
1358 ac_ext=c
1359 ac_cpp='$CPP $CPPFLAGS'
1360 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1361 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1362 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1363 ac_main_return="return"
1364 if test -n "$ac_tool_prefix"; then
1365   for ac_prog in gnatgcc gcc cc
1366   do
1367     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1368 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1369 echo "$as_me:1369: checking for $ac_word" >&5
1370 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1371 if test "${ac_cv_prog_CC+set}" = set; then
1372   echo $ECHO_N "(cached) $ECHO_C" >&6
1373 else
1374   if test -n "$CC"; then
1375   ac_cv_prog_CC="$CC" # Let the user override the test.
1376 else
1377   ac_save_IFS=$IFS; IFS=$ac_path_separator
1378 ac_dummy="$PATH"
1379 for ac_dir in $ac_dummy; do
1380   IFS=$ac_save_IFS
1381   test -z "$ac_dir" && ac_dir=.
1382   $as_executable_p "$ac_dir/$ac_word" || continue
1383 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1384 echo "$as_me:1384: found $ac_dir/$ac_word" >&5
1385 break
1386 done
1387
1388 fi
1389 fi
1390 CC=$ac_cv_prog_CC
1391 if test -n "$CC"; then
1392   echo "$as_me:1392: result: $CC" >&5
1393 echo "${ECHO_T}$CC" >&6
1394 else
1395   echo "$as_me:1395: result: no" >&5
1396 echo "${ECHO_T}no" >&6
1397 fi
1398
1399     test -n "$CC" && break
1400   done
1401 fi
1402 if test -z "$CC"; then
1403   ac_ct_CC=$CC
1404   for ac_prog in gnatgcc gcc cc
1405 do
1406   # Extract the first word of "$ac_prog", so it can be a program name with args.
1407 set dummy $ac_prog; ac_word=$2
1408 echo "$as_me:1408: checking for $ac_word" >&5
1409 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1410 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1411   echo $ECHO_N "(cached) $ECHO_C" >&6
1412 else
1413   if test -n "$ac_ct_CC"; then
1414   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1415 else
1416   ac_save_IFS=$IFS; IFS=$ac_path_separator
1417 ac_dummy="$PATH"
1418 for ac_dir in $ac_dummy; do
1419   IFS=$ac_save_IFS
1420   test -z "$ac_dir" && ac_dir=.
1421   $as_executable_p "$ac_dir/$ac_word" || continue
1422 ac_cv_prog_ac_ct_CC="$ac_prog"
1423 echo "$as_me:1423: found $ac_dir/$ac_word" >&5
1424 break
1425 done
1426
1427 fi
1428 fi
1429 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1430 if test -n "$ac_ct_CC"; then
1431   echo "$as_me:1431: result: $ac_ct_CC" >&5
1432 echo "${ECHO_T}$ac_ct_CC" >&6
1433 else
1434   echo "$as_me:1434: result: no" >&5
1435 echo "${ECHO_T}no" >&6
1436 fi
1437
1438   test -n "$ac_ct_CC" && break
1439 done
1440
1441   CC=$ac_ct_CC
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo "$2"`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit "$ac_status"); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit "$ac_status"); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit "$ac_status"); }
1467
1468 cat >"conftest.$ac_ext" <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit "$ac_status"); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat "conftest.$ac_ext" >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit "$ac_status"); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe "conftest$ac_cv_exeext"
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit "$ac_status"); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f "conftest$ac_cv_exeext"
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f "conftest.$ac_ext"
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >"conftest.$ac_ext" <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit "$ac_status"); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat "conftest.$ac_ext" >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >"conftest.$ac_ext" <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f "conftest.$ac_objext"
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit "$ac_status"); } &&
1664          { ac_try='test -s "conftest.$ac_objext"'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit "$ac_status"); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat "conftest.$ac_ext" >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >"conftest.$ac_ext" <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f "conftest.$ac_objext"
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit "$ac_status"); } &&
1709          { ac_try='test -s "conftest.$ac_objext"'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit "$ac_status"); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat "conftest.$ac_ext" >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >"conftest.$ac_ext" <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f "conftest.$ac_objext"
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit "$ac_status"); } &&
1755          { ac_try='test -s "conftest.$ac_objext"'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit "$ac_status"); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >"conftest.$ac_ext" <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f "conftest.$ac_objext"
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit "$ac_status"); } &&
1789          { ac_try='test -s "conftest.$ac_objext"'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit "$ac_status"); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat "conftest.$ac_ext" >&5
1799 continue
1800 fi
1801 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1802   cat >"conftest.$ac_ext" <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f "conftest.$ac_objext"
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit "$ac_status"); } &&
1820          { ac_try='test -s "conftest.$ac_objext"'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit "$ac_status"); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat "conftest.$ac_ext" >&5
1830 fi
1831 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo "$ac_declaration"    >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat "conftest.$ac_ext" >&5
1843 fi
1844 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1848 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return="return"
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case "$host_os" in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >"conftest.$ac_ext" <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f "conftest.$ac_objext"
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit "$ac_status"); } &&
1894          { ac_try='test -s "conftest.$ac_objext"'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit "$ac_status"); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat "conftest.$ac_ext" >&5
1906 fi
1907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         cat >"conftest.$ac_ext" <<_ACEOF
1922 #line 1922 "configure"
1923 #include "confdefs.h"
1924
1925 int
1926 main (void)
1927 {
1928
1929 #ifdef __clang__
1930 #else
1931 make an error
1932 #endif
1933
1934   ;
1935   return 0;
1936 }
1937 _ACEOF
1938 rm -f "conftest.$ac_objext"
1939 if { (eval echo "$as_me:1939: \"$ac_compile\"") >&5
1940   (eval $ac_compile) 2>&5
1941   ac_status=$?
1942   echo "$as_me:1942: \$? = $ac_status" >&5
1943   (exit "$ac_status"); } &&
1944          { ac_try='test -s "conftest.$ac_objext"'
1945   { (eval echo "$as_me:1945: \"$ac_try\"") >&5
1946   (eval $ac_try) 2>&5
1947   ac_status=$?
1948   echo "$as_me:1948: \$? = $ac_status" >&5
1949   (exit "$ac_status"); }; }; then
1950   CLANG_COMPILER=yes
1951
1952 else
1953   echo "$as_me: failed program was:" >&5
1954 cat "conftest.$ac_ext" >&5
1955 fi
1956 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1957         CFLAGS="$cf_save_CFLAGS"
1958         echo "$as_me:1958: result: $CLANG_COMPILER" >&5
1959 echo "${ECHO_T}$CLANG_COMPILER" >&6
1960 fi
1961
1962 CLANG_VERSION=none
1963
1964 if test "x$CLANG_COMPILER" = "xyes" ; then
1965         case "$CC" in
1966         (c[1-9][0-9]|*/c[1-9][0-9])
1967                 { echo "$as_me:1967: WARNING: replacing broken compiler alias $CC" >&5
1968 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1969                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1970                 CC=clang
1971                 ;;
1972         esac
1973
1974         echo "$as_me:1974: checking version of $CC" >&5
1975 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1976         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1977         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1978         echo "$as_me:1978: result: $CLANG_VERSION" >&5
1979 echo "${ECHO_T}$CLANG_VERSION" >&6
1980
1981         for cf_clang_opt in \
1982                 -Qunused-arguments \
1983                 -Wno-error=implicit-function-declaration
1984         do
1985                 echo "$as_me:1985: checking if option $cf_clang_opt works" >&5
1986 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1987                 cf_save_CFLAGS="$CFLAGS"
1988                 CFLAGS="$CFLAGS $cf_clang_opt"
1989                 cat >"conftest.$ac_ext" <<_ACEOF
1990 #line 1990 "configure"
1991 #include "confdefs.h"
1992
1993                         #include <stdio.h>
1994 int
1995 main (void)
1996 {
1997
1998                         printf("hello!\\n");
1999   ;
2000   return 0;
2001 }
2002 _ACEOF
2003 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2004 if { (eval echo "$as_me:2004: \"$ac_link\"") >&5
2005   (eval $ac_link) 2>&5
2006   ac_status=$?
2007   echo "$as_me:2007: \$? = $ac_status" >&5
2008   (exit "$ac_status"); } &&
2009          { ac_try='test -s "conftest$ac_exeext"'
2010   { (eval echo "$as_me:2010: \"$ac_try\"") >&5
2011   (eval $ac_try) 2>&5
2012   ac_status=$?
2013   echo "$as_me:2013: \$? = $ac_status" >&5
2014   (exit "$ac_status"); }; }; then
2015
2016                         cf_clang_optok=yes
2017 else
2018   echo "$as_me: failed program was:" >&5
2019 cat "conftest.$ac_ext" >&5
2020
2021                         cf_clang_optok=no
2022 fi
2023 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2024                 echo "$as_me:2024: result: $cf_clang_optok" >&5
2025 echo "${ECHO_T}$cf_clang_optok" >&6
2026                 CFLAGS="$cf_save_CFLAGS"
2027                 if test "$cf_clang_optok" = yes; then
2028                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2029
2030 echo "${as_me:-configure}:2030: testing adding option $cf_clang_opt ..." 1>&5
2031
2032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2033         CFLAGS="${CFLAGS}$cf_clang_opt"
2034
2035                 fi
2036         done
2037 fi
2038
2039 echo "$as_me:2039: checking for $CC option to accept ANSI C" >&5
2040 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2041 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2042   echo $ECHO_N "(cached) $ECHO_C" >&6
2043 else
2044   ac_cv_prog_cc_stdc=no
2045 ac_save_CC=$CC
2046 cat >"conftest.$ac_ext" <<_ACEOF
2047 #line 2047 "configure"
2048 #include "confdefs.h"
2049 #include <stdarg.h>
2050 #include <stdio.h>
2051 #include <sys/types.h>
2052 #include <sys/stat.h>
2053 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2054 struct buf { int x; };
2055 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2056 static char *e (p, i)
2057      char **p;
2058      int i;
2059 {
2060   return p[i];
2061 }
2062 static char *f (char * (*g) (char **, int), char **p, ...)
2063 {
2064   char *s;
2065   va_list v;
2066   va_start (v,p);
2067   s = g (p, va_arg (v,int));
2068   va_end (v);
2069   return s;
2070 }
2071 int test (int i, double x);
2072 struct s1 {int (*f) (int a);};
2073 struct s2 {int (*f) (double a);};
2074 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2075 int argc;
2076 char **argv;
2077 int
2078 main (void)
2079 {
2080 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2081   ;
2082   return 0;
2083 }
2084 _ACEOF
2085 # Don't try gcc -ansi; that turns off useful extensions and
2086 # breaks some systems' header files.
2087 # AIX                   -qlanglvl=ansi
2088 # Ultrix and OSF/1      -std1
2089 # HP-UX 10.20 and later -Ae
2090 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2091 # SVR4                  -Xc -D__EXTENSIONS__
2092 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2093 do
2094   CC="$ac_save_CC $ac_arg"
2095   rm -f "conftest.$ac_objext"
2096 if { (eval echo "$as_me:2096: \"$ac_compile\"") >&5
2097   (eval $ac_compile) 2>&5
2098   ac_status=$?
2099   echo "$as_me:2099: \$? = $ac_status" >&5
2100   (exit "$ac_status"); } &&
2101          { ac_try='test -s "conftest.$ac_objext"'
2102   { (eval echo "$as_me:2102: \"$ac_try\"") >&5
2103   (eval $ac_try) 2>&5
2104   ac_status=$?
2105   echo "$as_me:2105: \$? = $ac_status" >&5
2106   (exit "$ac_status"); }; }; then
2107   ac_cv_prog_cc_stdc=$ac_arg
2108 break
2109 else
2110   echo "$as_me: failed program was:" >&5
2111 cat "conftest.$ac_ext" >&5
2112 fi
2113 rm -f "conftest.$ac_objext"
2114 done
2115 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2116 CC=$ac_save_CC
2117
2118 fi
2119
2120 case "x$ac_cv_prog_cc_stdc" in
2121   x|xno)
2122     echo "$as_me:2122: result: none needed" >&5
2123 echo "${ECHO_T}none needed" >&6 ;;
2124   *)
2125     echo "$as_me:2125: result: $ac_cv_prog_cc_stdc" >&5
2126 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2127     CC="$CC $ac_cv_prog_cc_stdc" ;;
2128 esac
2129
2130 # This should have been defined by AC_PROG_CC
2131 : "${CC:=cc}"
2132
2133 echo "$as_me:2133: checking \$CFLAGS variable" >&5
2134 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2135 case "x$CFLAGS" in
2136 (*-[IUD]*)
2137         echo "$as_me:2137: result: broken" >&5
2138 echo "${ECHO_T}broken" >&6
2139         { echo "$as_me:2139: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2140 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2141         cf_flags="$CFLAGS"
2142         CFLAGS=
2143         for cf_arg in $cf_flags
2144         do
2145
2146 cf_fix_cppflags=no
2147 cf_new_cflags=
2148 cf_new_cppflags=
2149 cf_new_extra_cppflags=
2150
2151 for cf_add_cflags in $cf_arg
2152 do
2153 case "$cf_fix_cppflags" in
2154 (no)
2155         case "$cf_add_cflags" in
2156         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2157                 case "$cf_add_cflags" in
2158                 (-D*)
2159                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2160
2161                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2162                                 && test -z "${cf_tst_cflags}" \
2163                                 && cf_fix_cppflags=yes
2164
2165                         if test "$cf_fix_cppflags" = yes ; then
2166
2167         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2168         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2169
2170                                 continue
2171                         elif test "${cf_tst_cflags}" = "\"'" ; then
2172
2173         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2174         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2175
2176                                 continue
2177                         fi
2178                         ;;
2179                 esac
2180                 case "$CPPFLAGS" in
2181                 (*$cf_add_cflags)
2182                         ;;
2183                 (*)
2184                         case "$cf_add_cflags" in
2185                         (-D*)
2186                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2187
2188 CPPFLAGS=`echo "$CPPFLAGS" | \
2189         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2190                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2191
2192                                 ;;
2193                         esac
2194
2195         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2196         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2197
2198                         ;;
2199                 esac
2200                 ;;
2201         (*)
2202
2203         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2204         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2205
2206                 ;;
2207         esac
2208         ;;
2209 (yes)
2210
2211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2213
2214         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2215
2216         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2217                 && test -z "${cf_tst_cflags}" \
2218                 && cf_fix_cppflags=no
2219         ;;
2220 esac
2221 done
2222
2223 if test -n "$cf_new_cflags" ; then
2224
2225         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2226         CFLAGS="${CFLAGS}$cf_new_cflags"
2227
2228 fi
2229
2230 if test -n "$cf_new_cppflags" ; then
2231
2232         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2233         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2234
2235 fi
2236
2237 if test -n "$cf_new_extra_cppflags" ; then
2238
2239         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2240         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2241
2242 fi
2243
2244         done
2245         ;;
2246 (*)
2247         echo "$as_me:2247: result: ok" >&5
2248 echo "${ECHO_T}ok" >&6
2249         ;;
2250 esac
2251
2252 echo "$as_me:2252: checking \$CC variable" >&5
2253 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2254 case "$CC" in
2255 (*[\ \  ]-*)
2256         echo "$as_me:2256: result: broken" >&5
2257 echo "${ECHO_T}broken" >&6
2258         { echo "$as_me:2258: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2259 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2260         # humor him...
2261         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2262         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2263         CC="$cf_prog"
2264         for cf_arg in $cf_flags
2265         do
2266                 case "x$cf_arg" in
2267                 (x-[IUDfgOW]*)
2268
2269 cf_fix_cppflags=no
2270 cf_new_cflags=
2271 cf_new_cppflags=
2272 cf_new_extra_cppflags=
2273
2274 for cf_add_cflags in $cf_arg
2275 do
2276 case "$cf_fix_cppflags" in
2277 (no)
2278         case "$cf_add_cflags" in
2279         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2280                 case "$cf_add_cflags" in
2281                 (-D*)
2282                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2283
2284                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2285                                 && test -z "${cf_tst_cflags}" \
2286                                 && cf_fix_cppflags=yes
2287
2288                         if test "$cf_fix_cppflags" = yes ; then
2289
2290         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2291         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2292
2293                                 continue
2294                         elif test "${cf_tst_cflags}" = "\"'" ; then
2295
2296         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2297         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2298
2299                                 continue
2300                         fi
2301                         ;;
2302                 esac
2303                 case "$CPPFLAGS" in
2304                 (*$cf_add_cflags)
2305                         ;;
2306                 (*)
2307                         case "$cf_add_cflags" in
2308                         (-D*)
2309                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2310
2311 CPPFLAGS=`echo "$CPPFLAGS" | \
2312         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2313                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2314
2315                                 ;;
2316                         esac
2317
2318         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2319         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2320
2321                         ;;
2322                 esac
2323                 ;;
2324         (*)
2325
2326         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2327         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2328
2329                 ;;
2330         esac
2331         ;;
2332 (yes)
2333
2334         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2335         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2336
2337         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2338
2339         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2340                 && test -z "${cf_tst_cflags}" \
2341                 && cf_fix_cppflags=no
2342         ;;
2343 esac
2344 done
2345
2346 if test -n "$cf_new_cflags" ; then
2347
2348         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2349         CFLAGS="${CFLAGS}$cf_new_cflags"
2350
2351 fi
2352
2353 if test -n "$cf_new_cppflags" ; then
2354
2355         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2356         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2357
2358 fi
2359
2360 if test -n "$cf_new_extra_cppflags" ; then
2361
2362         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2363         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2364
2365 fi
2366
2367                         ;;
2368                 (*)
2369                         CC="$CC $cf_arg"
2370                         ;;
2371                 esac
2372         done
2373         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2374
2375 echo "${as_me:-configure}:2375: testing resulting CC: '$CC' ..." 1>&5
2376
2377         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2378
2379 echo "${as_me:-configure}:2379: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2380
2381         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2382
2383 echo "${as_me:-configure}:2383: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2384
2385         ;;
2386 (*)
2387         echo "$as_me:2387: result: ok" >&5
2388 echo "${ECHO_T}ok" >&6
2389         ;;
2390 esac
2391
2392 echo "$as_me:2392: checking for egrep" >&5
2393 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2394 if test "${ac_cv_path_EGREP+set}" = set; then
2395   echo $ECHO_N "(cached) $ECHO_C" >&6
2396 else
2397   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2398    then ac_cv_path_EGREP="$GREP -E"
2399    else
2400      for ac_prog in gegrep egrep
2401 do
2402   # Extract the first word of "$ac_prog", so it can be a program name with args.
2403 set dummy $ac_prog; ac_word=$2
2404 echo "$as_me:2404: checking for $ac_word" >&5
2405 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2406 if test "${ac_cv_path_EGREP+set}" = set; then
2407   echo $ECHO_N "(cached) $ECHO_C" >&6
2408 else
2409   case $EGREP in
2410   [\\/]* | ?:[\\/]*)
2411   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2412   ;;
2413   *)
2414   ac_save_IFS=$IFS; IFS=$ac_path_separator
2415 ac_dummy="$PATH"
2416 for ac_dir in $ac_dummy; do
2417   IFS=$ac_save_IFS
2418   test -z "$ac_dir" && ac_dir=.
2419   if $as_executable_p "$ac_dir/$ac_word"; then
2420    ac_cv_path_EGREP="$ac_dir/$ac_word"
2421    echo "$as_me:2421: found $ac_dir/$ac_word" >&5
2422    break
2423 fi
2424 done
2425
2426   ;;
2427 esac
2428 fi
2429 EGREP=$ac_cv_path_EGREP
2430
2431 if test -n "$EGREP"; then
2432   echo "$as_me:2432: result: $EGREP" >&5
2433 echo "${ECHO_T}$EGREP" >&6
2434 else
2435   echo "$as_me:2435: result: no" >&5
2436 echo "${ECHO_T}no" >&6
2437 fi
2438
2439   test -n "$EGREP" && break
2440 done
2441 test -n "$EGREP" || EGREP=": "
2442
2443      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2443: error: cannot find workable egrep" >&5
2444 echo "$as_me: error: cannot find workable egrep" >&2;}
2445    { (exit 1); exit 1; }; }
2446    fi
2447 fi
2448 echo "$as_me:2448: result: $ac_cv_path_EGREP" >&5
2449 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2450  EGREP="$ac_cv_path_EGREP"
2451
2452 ac_ext=c
2453 ac_cpp='$CPP $CPPFLAGS'
2454 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2455 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2456 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2457 ac_main_return="return"
2458 echo "$as_me:2458: checking how to run the C preprocessor" >&5
2459 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2460 # On Suns, sometimes $CPP names a directory.
2461 if test -n "$CPP" && test -d "$CPP"; then
2462   CPP=
2463 fi
2464 if test -z "$CPP"; then
2465   if test "${ac_cv_prog_CPP+set}" = set; then
2466   echo $ECHO_N "(cached) $ECHO_C" >&6
2467 else
2468       # Double quotes because CPP needs to be expanded
2469     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2470     do
2471       ac_preproc_ok=false
2472 for ac_c_preproc_warn_flag in '' yes
2473 do
2474   # Use a header file that comes with gcc, so configuring glibc
2475   # with a fresh cross-compiler works.
2476   # On the NeXT, cc -E runs the code through the compiler's parser,
2477   # not just through cpp. "Syntax error" is here to catch this case.
2478   cat >"conftest.$ac_ext" <<_ACEOF
2479 #line 2479 "configure"
2480 #include "confdefs.h"
2481 #include <assert.h>
2482                      Syntax error
2483 _ACEOF
2484 if { (eval echo "$as_me:2484: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2485   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2486   ac_status=$?
2487   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2488   rm -f conftest.er1
2489   cat conftest.err >&5
2490   echo "$as_me:2490: \$? = $ac_status" >&5
2491   (exit "$ac_status"); } >/dev/null; then
2492   if test -s conftest.err; then
2493     ac_cpp_err=$ac_c_preproc_warn_flag
2494   else
2495     ac_cpp_err=
2496   fi
2497 else
2498   ac_cpp_err=yes
2499 fi
2500 if test -z "$ac_cpp_err"; then
2501   :
2502 else
2503   echo "$as_me: failed program was:" >&5
2504   cat "conftest.$ac_ext" >&5
2505   # Broken: fails on valid input.
2506 continue
2507 fi
2508 rm -f conftest.err "conftest.$ac_ext"
2509
2510   # OK, works on sane cases.  Now check whether non-existent headers
2511   # can be detected and how.
2512   cat >"conftest.$ac_ext" <<_ACEOF
2513 #line 2513 "configure"
2514 #include "confdefs.h"
2515 #include <ac_nonexistent.h>
2516 _ACEOF
2517 if { (eval echo "$as_me:2517: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2518   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2519   ac_status=$?
2520   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2521   rm -f conftest.er1
2522   cat conftest.err >&5
2523   echo "$as_me:2523: \$? = $ac_status" >&5
2524   (exit "$ac_status"); } >/dev/null; then
2525   if test -s conftest.err; then
2526     ac_cpp_err=$ac_c_preproc_warn_flag
2527   else
2528     ac_cpp_err=
2529   fi
2530 else
2531   ac_cpp_err=yes
2532 fi
2533 if test -z "$ac_cpp_err"; then
2534   # Broken: success on invalid input.
2535 continue
2536 else
2537   echo "$as_me: failed program was:" >&5
2538   cat "conftest.$ac_ext" >&5
2539   # Passes both tests.
2540 ac_preproc_ok=:
2541 break
2542 fi
2543 rm -f conftest.err "conftest.$ac_ext"
2544
2545 done
2546 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2547 rm -f conftest.err "conftest.$ac_ext"
2548 if $ac_preproc_ok; then
2549   break
2550 fi
2551
2552     done
2553     ac_cv_prog_CPP=$CPP
2554
2555 fi
2556   CPP=$ac_cv_prog_CPP
2557 else
2558   ac_cv_prog_CPP=$CPP
2559 fi
2560 echo "$as_me:2560: result: $CPP" >&5
2561 echo "${ECHO_T}$CPP" >&6
2562 ac_preproc_ok=false
2563 for ac_c_preproc_warn_flag in '' yes
2564 do
2565   # Use a header file that comes with gcc, so configuring glibc
2566   # with a fresh cross-compiler works.
2567   # On the NeXT, cc -E runs the code through the compiler's parser,
2568   # not just through cpp. "Syntax error" is here to catch this case.
2569   cat >"conftest.$ac_ext" <<_ACEOF
2570 #line 2570 "configure"
2571 #include "confdefs.h"
2572 #include <assert.h>
2573                      Syntax error
2574 _ACEOF
2575 if { (eval echo "$as_me:2575: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2576   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2577   ac_status=$?
2578   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2579   rm -f conftest.er1
2580   cat conftest.err >&5
2581   echo "$as_me:2581: \$? = $ac_status" >&5
2582   (exit "$ac_status"); } >/dev/null; then
2583   if test -s conftest.err; then
2584     ac_cpp_err=$ac_c_preproc_warn_flag
2585   else
2586     ac_cpp_err=
2587   fi
2588 else
2589   ac_cpp_err=yes
2590 fi
2591 if test -z "$ac_cpp_err"; then
2592   :
2593 else
2594   echo "$as_me: failed program was:" >&5
2595   cat "conftest.$ac_ext" >&5
2596   # Broken: fails on valid input.
2597 continue
2598 fi
2599 rm -f conftest.err "conftest.$ac_ext"
2600
2601   # OK, works on sane cases.  Now check whether non-existent headers
2602   # can be detected and how.
2603   cat >"conftest.$ac_ext" <<_ACEOF
2604 #line 2604 "configure"
2605 #include "confdefs.h"
2606 #include <ac_nonexistent.h>
2607 _ACEOF
2608 if { (eval echo "$as_me:2608: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2609   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2610   ac_status=$?
2611   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2612   rm -f conftest.er1
2613   cat conftest.err >&5
2614   echo "$as_me:2614: \$? = $ac_status" >&5
2615   (exit "$ac_status"); } >/dev/null; then
2616   if test -s conftest.err; then
2617     ac_cpp_err=$ac_c_preproc_warn_flag
2618   else
2619     ac_cpp_err=
2620   fi
2621 else
2622   ac_cpp_err=yes
2623 fi
2624 if test -z "$ac_cpp_err"; then
2625   # Broken: success on invalid input.
2626 continue
2627 else
2628   echo "$as_me: failed program was:" >&5
2629   cat "conftest.$ac_ext" >&5
2630   # Passes both tests.
2631 ac_preproc_ok=:
2632 break
2633 fi
2634 rm -f conftest.err "conftest.$ac_ext"
2635
2636 done
2637 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2638 rm -f conftest.err "conftest.$ac_ext"
2639 if $ac_preproc_ok; then
2640   :
2641 else
2642   { { echo "$as_me:2642: error: C preprocessor \"$CPP\" fails sanity check" >&5
2643 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2644    { (exit 1); exit 1; }; }
2645 fi
2646
2647 ac_ext=c
2648 ac_cpp='$CPP $CPPFLAGS'
2649 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2650 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2651 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2652 ac_main_return="return"
2653
2654 if test $ac_cv_c_compiler_gnu = yes; then
2655     echo "$as_me:2655: checking whether $CC needs -traditional" >&5
2656 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2657 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2658   echo $ECHO_N "(cached) $ECHO_C" >&6
2659 else
2660     ac_pattern="Autoconf.*'x'"
2661   cat >"conftest.$ac_ext" <<_ACEOF
2662 #line 2662 "configure"
2663 #include "confdefs.h"
2664 #include <sgtty.h>
2665 int Autoconf = TIOCGETP;
2666 _ACEOF
2667 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2668   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2669   ac_cv_prog_gcc_traditional=yes
2670 else
2671   ac_cv_prog_gcc_traditional=no
2672 fi
2673 rm -rf conftest*
2674
2675   if test $ac_cv_prog_gcc_traditional = no; then
2676     cat >"conftest.$ac_ext" <<_ACEOF
2677 #line 2677 "configure"
2678 #include "confdefs.h"
2679 #include <termio.h>
2680 int Autoconf = TCGETA;
2681 _ACEOF
2682 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2683   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2684   ac_cv_prog_gcc_traditional=yes
2685 fi
2686 rm -rf conftest*
2687
2688   fi
2689 fi
2690 echo "$as_me:2690: result: $ac_cv_prog_gcc_traditional" >&5
2691 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2692   if test $ac_cv_prog_gcc_traditional = yes; then
2693     CC="$CC -traditional"
2694   fi
2695 fi
2696
2697 echo "$as_me:2697: checking whether $CC understands -c and -o together" >&5
2698 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2699 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2700   echo $ECHO_N "(cached) $ECHO_C" >&6
2701 else
2702
2703 cat > conftest.$ac_ext <<CF_EOF
2704 int main(void)
2705 {
2706         ${cf_cv_main_return:-return}(0);
2707 }
2708 CF_EOF
2709 # We do the test twice because some compilers refuse to overwrite an
2710 # existing .o file with -o, though they will create one.
2711 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2712 if { (eval echo "$as_me:2712: \"$ac_try\"") >&5
2713   (eval $ac_try) 2>&5
2714   ac_status=$?
2715   echo "$as_me:2715: \$? = $ac_status" >&5
2716   (exit "$ac_status"); } &&
2717   test -f conftest2.$ac_objext && { (eval echo "$as_me:2717: \"$ac_try\"") >&5
2718   (eval $ac_try) 2>&5
2719   ac_status=$?
2720   echo "$as_me:2720: \$? = $ac_status" >&5
2721   (exit "$ac_status"); };
2722 then
2723   eval cf_cv_prog_CC_c_o=yes
2724 else
2725   eval cf_cv_prog_CC_c_o=no
2726 fi
2727 rm -rf ./conftest*
2728
2729 fi
2730 if test "$cf_cv_prog_CC_c_o" = yes; then
2731   echo "$as_me:2731: result: yes" >&5
2732 echo "${ECHO_T}yes" >&6
2733 else
2734   echo "$as_me:2734: result: no" >&5
2735 echo "${ECHO_T}no" >&6
2736 fi
2737
2738 test "$program_prefix" != NONE &&
2739   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2740 # Use a double $ so make ignores it.
2741 test "$program_suffix" != NONE &&
2742   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2743 # Double any \ or $.  echo might interpret backslashes.
2744 # By default was `s,x,x', remove it if useless.
2745 cat <<\_ACEOF >conftest.sed
2746 s/[\\$]/&&/g;s/;s,x,x,$//
2747 _ACEOF
2748 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2749 rm conftest.sed
2750
2751 for ac_prog in mawk gawk nawk awk
2752 do
2753   # Extract the first word of "$ac_prog", so it can be a program name with args.
2754 set dummy $ac_prog; ac_word=$2
2755 echo "$as_me:2755: checking for $ac_word" >&5
2756 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2757 if test "${ac_cv_prog_AWK+set}" = set; then
2758   echo $ECHO_N "(cached) $ECHO_C" >&6
2759 else
2760   if test -n "$AWK"; then
2761   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2762 else
2763   ac_save_IFS=$IFS; IFS=$ac_path_separator
2764 ac_dummy="$PATH"
2765 for ac_dir in $ac_dummy; do
2766   IFS=$ac_save_IFS
2767   test -z "$ac_dir" && ac_dir=.
2768   $as_executable_p "$ac_dir/$ac_word" || continue
2769 ac_cv_prog_AWK="$ac_prog"
2770 echo "$as_me:2770: found $ac_dir/$ac_word" >&5
2771 break
2772 done
2773
2774 fi
2775 fi
2776 AWK=$ac_cv_prog_AWK
2777 if test -n "$AWK"; then
2778   echo "$as_me:2778: result: $AWK" >&5
2779 echo "${ECHO_T}$AWK" >&6
2780 else
2781   echo "$as_me:2781: result: no" >&5
2782 echo "${ECHO_T}no" >&6
2783 fi
2784
2785   test -n "$AWK" && break
2786 done
2787
2788 test -z "$AWK" && { { echo "$as_me:2788: error: No awk program found" >&5
2789 echo "$as_me: error: No awk program found" >&2;}
2790    { (exit 1); exit 1; }; }
2791
2792 echo "$as_me:2792: checking for egrep" >&5
2793 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2794 if test "${ac_cv_prog_egrep+set}" = set; then
2795   echo $ECHO_N "(cached) $ECHO_C" >&6
2796 else
2797   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2798                 then ac_cv_prog_egrep='grep -E'
2799                 else ac_cv_prog_egrep='egrep'
2800         fi
2801 fi
2802 echo "$as_me:2802: result: $ac_cv_prog_egrep" >&5
2803 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2804         EGREP=$ac_cv_prog_egrep
2805
2806         test -z "$EGREP" && { { echo "$as_me:2806: error: No egrep program found" >&5
2807 echo "$as_me: error: No egrep program found" >&2;}
2808    { (exit 1); exit 1; }; }
2809
2810 # Find a good install program.  We prefer a C program (faster),
2811 # so one script is as good as another.  But avoid the broken or
2812 # incompatible versions:
2813 # SysV /etc/install, /usr/sbin/install
2814 # SunOS /usr/etc/install
2815 # IRIX /sbin/install
2816 # AIX /bin/install
2817 # AmigaOS /C/install, which installs bootblocks on floppy discs
2818 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2819 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2820 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2821 # ./install, which can be erroneously created by make from ./install.sh.
2822 echo "$as_me:2822: checking for a BSD compatible install" >&5
2823 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2824 if test -z "$INSTALL"; then
2825 if test "${ac_cv_path_install+set}" = set; then
2826   echo $ECHO_N "(cached) $ECHO_C" >&6
2827 else
2828     ac_save_IFS=$IFS; IFS=$ac_path_separator
2829   for ac_dir in $PATH; do
2830     IFS=$ac_save_IFS
2831     # Account for people who put trailing slashes in PATH elements.
2832     case $ac_dir/ in
2833     / | ./ | .// | /cC/* \
2834     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2835     | /usr/ucb/* ) ;;
2836     *)
2837       # OSF1 and SCO ODT 3.0 have their own names for install.
2838       # Don't use installbsd from OSF since it installs stuff as root
2839       # by default.
2840       for ac_prog in ginstall scoinst install; do
2841         if $as_executable_p "$ac_dir/$ac_prog"; then
2842           if test $ac_prog = install &&
2843             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2844             # AIX install.  It has an incompatible calling convention.
2845             :
2846           elif test $ac_prog = install &&
2847             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2848             # program-specific install script used by HP pwplus--don't use.
2849             :
2850           else
2851             ac_cv_path_install="$ac_dir/$ac_prog -c"
2852             break 2
2853           fi
2854         fi
2855       done
2856       ;;
2857     esac
2858   done
2859
2860 fi
2861   if test "${ac_cv_path_install+set}" = set; then
2862     INSTALL=$ac_cv_path_install
2863   else
2864     # As a last resort, use the slow shell script.  We don't cache a
2865     # path for INSTALL within a source directory, because that will
2866     # break other packages using the cache if that directory is
2867     # removed, or if the path is relative.
2868     INSTALL=$ac_install_sh
2869   fi
2870 fi
2871 echo "$as_me:2871: result: $INSTALL" >&5
2872 echo "${ECHO_T}$INSTALL" >&6
2873
2874 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2875 # It thinks the first close brace ends the variable substitution.
2876 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2877
2878 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2879
2880 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2881
2882 echo "$as_me:2882: checking whether ln -s works" >&5
2883 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2884 LN_S=$as_ln_s
2885 if test "$LN_S" = "ln -s"; then
2886   echo "$as_me:2886: result: yes" >&5
2887 echo "${ECHO_T}yes" >&6
2888 else
2889   echo "$as_me:2889: result: no, using $LN_S" >&5
2890 echo "${ECHO_T}no, using $LN_S" >&6
2891 fi
2892
2893 echo "$as_me:2893: checking if $LN_S -f options work" >&5
2894 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2895
2896 rm -f conf$$.src conf$$dst
2897 echo >conf$$.dst
2898 echo first >conf$$.src
2899 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2900         cf_prog_ln_sf=yes
2901 else
2902         cf_prog_ln_sf=no
2903 fi
2904 rm -f conf$$.dst conf$$src
2905 echo "$as_me:2905: result: $cf_prog_ln_sf" >&5
2906 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2907
2908 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2909
2910 # Find a good install program.  We prefer a C program (faster),
2911 # so one script is as good as another.  But avoid the broken or
2912 # incompatible versions:
2913 # SysV /etc/install, /usr/sbin/install
2914 # SunOS /usr/etc/install
2915 # IRIX /sbin/install
2916 # AIX /bin/install
2917 # AmigaOS /C/install, which installs bootblocks on floppy discs
2918 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2919 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2920 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2921 # ./install, which can be erroneously created by make from ./install.sh.
2922 echo "$as_me:2922: checking for a BSD compatible install" >&5
2923 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2924 if test -z "$INSTALL"; then
2925 if test "${ac_cv_path_install+set}" = set; then
2926   echo $ECHO_N "(cached) $ECHO_C" >&6
2927 else
2928     ac_save_IFS=$IFS; IFS=$ac_path_separator
2929   for ac_dir in $PATH; do
2930     IFS=$ac_save_IFS
2931     # Account for people who put trailing slashes in PATH elements.
2932     case $ac_dir/ in
2933     / | ./ | .// | /cC/* \
2934     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2935     | /usr/ucb/* ) ;;
2936     *)
2937       # OSF1 and SCO ODT 3.0 have their own names for install.
2938       # Don't use installbsd from OSF since it installs stuff as root
2939       # by default.
2940       for ac_prog in ginstall scoinst install; do
2941         if $as_executable_p "$ac_dir/$ac_prog"; then
2942           if test $ac_prog = install &&
2943             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2944             # AIX install.  It has an incompatible calling convention.
2945             :
2946           elif test $ac_prog = install &&
2947             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2948             # program-specific install script used by HP pwplus--don't use.
2949             :
2950           else
2951             ac_cv_path_install="$ac_dir/$ac_prog -c"
2952             break 2
2953           fi
2954         fi
2955       done
2956       ;;
2957     esac
2958   done
2959
2960 fi
2961   if test "${ac_cv_path_install+set}" = set; then
2962     INSTALL=$ac_cv_path_install
2963   else
2964     # As a last resort, use the slow shell script.  We don't cache a
2965     # path for INSTALL within a source directory, because that will
2966     # break other packages using the cache if that directory is
2967     # removed, or if the path is relative.
2968     INSTALL=$ac_install_sh
2969   fi
2970 fi
2971 echo "$as_me:2971: result: $INSTALL" >&5
2972 echo "${ECHO_T}$INSTALL" >&6
2973
2974 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2975 # It thinks the first close brace ends the variable substitution.
2976 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2977
2978 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2979
2980 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2981
2982 case $INSTALL in
2983 (/*)
2984         ;;
2985 (*)
2986         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2987         test -z "$cf_dir" && cf_dir=.
2988         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2989         ;;
2990 esac
2991
2992 echo "$as_me:2992: checking if you want to install stripped executables" >&5
2993 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2994
2995 # Check whether --enable-stripping or --disable-stripping was given.
2996 if test "${enable_stripping+set}" = set; then
2997   enableval="$enable_stripping"
2998   test "$enableval" != no && enableval=yes
2999         if test "$enableval" != "yes" ; then
3000     enable_stripping=no
3001         else
3002                 enable_stripping=yes
3003         fi
3004 else
3005   enableval=yes
3006         enable_stripping=yes
3007
3008 fi;
3009 echo "$as_me:3009: result: $enable_stripping" >&5
3010 echo "${ECHO_T}$enable_stripping" >&6
3011
3012 if test "$enable_stripping" = yes
3013 then
3014         INSTALL_OPT_S="-s"
3015 else
3016         INSTALL_OPT_S=
3017 fi
3018
3019 : "${INSTALL:=install}"
3020 echo "$as_me:3020: checking if install accepts -p option" >&5
3021 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3022 if test "${cf_cv_install_p+set}" = set; then
3023   echo $ECHO_N "(cached) $ECHO_C" >&6
3024 else
3025
3026         rm -rf ./conftest*
3027         date >conftest.in
3028         mkdir conftest.out
3029         sleep 3
3030         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3031         then
3032                 if test -f conftest.out/conftest.in
3033                 then
3034                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3035                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3036                         if test -s conftest.err
3037                         then
3038                                 cf_cv_install_p=no
3039                         else
3040                                 cf_cv_install_p=yes
3041                         fi
3042                 else
3043                         cf_cv_install_p=no
3044                 fi
3045         else
3046                 cf_cv_install_p=no
3047         fi
3048         rm -rf ./conftest*
3049
3050 fi
3051 echo "$as_me:3051: result: $cf_cv_install_p" >&5
3052 echo "${ECHO_T}$cf_cv_install_p" >&6
3053
3054 echo "$as_me:3054: checking if install needs to be told about ownership" >&5
3055 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3056 case `$ac_config_guess` in
3057 (*minix)
3058         with_install_o=yes
3059         ;;
3060 (*)
3061         with_install_o=no
3062         ;;
3063 esac
3064
3065 echo "$as_me:3065: result: $with_install_o" >&5
3066 echo "${ECHO_T}$with_install_o" >&6
3067 if test "x$with_install_o" = xyes
3068 then
3069         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'`"
3070 else
3071         INSTALL_OPT_O=
3072 fi
3073
3074 echo "$as_me:3074: checking for long file names" >&5
3075 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3076 if test "${ac_cv_sys_long_file_names+set}" = set; then
3077   echo $ECHO_N "(cached) $ECHO_C" >&6
3078 else
3079   ac_cv_sys_long_file_names=yes
3080 # Test for long file names in all the places we know might matter:
3081 #      .                the current directory, where building will happen
3082 #      $prefix/lib      where we will be installing things
3083 #      $exec_prefix/lib likewise
3084 # eval it to expand exec_prefix.
3085 #      $TMPDIR          if set, where it might want to write temporary files
3086 # if $TMPDIR is not set:
3087 #      /tmp             where it might want to write temporary files
3088 #      /var/tmp         likewise
3089 #      /usr/tmp         likewise
3090 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3091   ac_tmpdirs=$TMPDIR
3092 else
3093   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3094 fi
3095 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3096   test -d "$ac_dir" || continue
3097   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3098   ac_xdir=$ac_dir/cf$$
3099   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3100   ac_tf1=$ac_xdir/conftest9012345
3101   ac_tf2=$ac_xdir/conftest9012346
3102   (echo 1 >"$ac_tf1") 2>/dev/null
3103   (echo 2 >"$ac_tf2") 2>/dev/null
3104   ac_val=`cat "$ac_tf1" 2>/dev/null`
3105   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3106     ac_cv_sys_long_file_names=no
3107     rm -rf "$ac_xdir" 2>/dev/null
3108     break
3109   fi
3110   rm -rf "$ac_xdir" 2>/dev/null
3111 done
3112 fi
3113 echo "$as_me:3113: result: $ac_cv_sys_long_file_names" >&5
3114 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3115 if test "$ac_cv_sys_long_file_names" = yes; then
3116
3117 cat >>confdefs.h <<\EOF
3118 #define HAVE_LONG_FILE_NAMES 1
3119 EOF
3120
3121 fi
3122
3123 # if we find pkg-config, check if we should install the ".pc" files.
3124
3125 echo "$as_me:3125: checking if you want to use pkg-config" >&5
3126 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3127
3128 # Check whether --with-pkg-config or --without-pkg-config was given.
3129 if test "${with_pkg_config+set}" = set; then
3130   withval="$with_pkg_config"
3131   cf_pkg_config=$withval
3132 else
3133   cf_pkg_config=yes
3134 fi;
3135 echo "$as_me:3135: result: $cf_pkg_config" >&5
3136 echo "${ECHO_T}$cf_pkg_config" >&6
3137
3138 case "$cf_pkg_config" in
3139 (no)
3140         PKG_CONFIG=none
3141         ;;
3142 (yes)
3143
3144 if test -n "$ac_tool_prefix"; then
3145   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3146 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3147 echo "$as_me:3147: checking for $ac_word" >&5
3148 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3149 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3150   echo $ECHO_N "(cached) $ECHO_C" >&6
3151 else
3152   case $PKG_CONFIG in
3153   [\\/]* | ?:[\\/]*)
3154   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3155   ;;
3156   *)
3157   ac_save_IFS=$IFS; IFS=$ac_path_separator
3158 ac_dummy="$PATH"
3159 for ac_dir in $ac_dummy; do
3160   IFS=$ac_save_IFS
3161   test -z "$ac_dir" && ac_dir=.
3162   if $as_executable_p "$ac_dir/$ac_word"; then
3163    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3164    echo "$as_me:3164: found $ac_dir/$ac_word" >&5
3165    break
3166 fi
3167 done
3168
3169   ;;
3170 esac
3171 fi
3172 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3173
3174 if test -n "$PKG_CONFIG"; then
3175   echo "$as_me:3175: result: $PKG_CONFIG" >&5
3176 echo "${ECHO_T}$PKG_CONFIG" >&6
3177 else
3178   echo "$as_me:3178: result: no" >&5
3179 echo "${ECHO_T}no" >&6
3180 fi
3181
3182 fi
3183 if test -z "$ac_cv_path_PKG_CONFIG"; then
3184   ac_pt_PKG_CONFIG=$PKG_CONFIG
3185   # Extract the first word of "pkg-config", so it can be a program name with args.
3186 set dummy pkg-config; ac_word=$2
3187 echo "$as_me:3187: checking for $ac_word" >&5
3188 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3189 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3190   echo $ECHO_N "(cached) $ECHO_C" >&6
3191 else
3192   case $ac_pt_PKG_CONFIG in
3193   [\\/]* | ?:[\\/]*)
3194   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3195   ;;
3196   *)
3197   ac_save_IFS=$IFS; IFS=$ac_path_separator
3198 ac_dummy="$PATH"
3199 for ac_dir in $ac_dummy; do
3200   IFS=$ac_save_IFS
3201   test -z "$ac_dir" && ac_dir=.
3202   if $as_executable_p "$ac_dir/$ac_word"; then
3203    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3204    echo "$as_me:3204: found $ac_dir/$ac_word" >&5
3205    break
3206 fi
3207 done
3208
3209   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3210   ;;
3211 esac
3212 fi
3213 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3214
3215 if test -n "$ac_pt_PKG_CONFIG"; then
3216   echo "$as_me:3216: result: $ac_pt_PKG_CONFIG" >&5
3217 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3218 else
3219   echo "$as_me:3219: result: no" >&5
3220 echo "${ECHO_T}no" >&6
3221 fi
3222
3223   PKG_CONFIG=$ac_pt_PKG_CONFIG
3224 else
3225   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3226 fi
3227
3228         ;;
3229 (*)
3230         PKG_CONFIG=$withval
3231         ;;
3232 esac
3233
3234 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3235 if test "$PKG_CONFIG" != none ; then
3236
3237 if test "x$prefix" != xNONE; then
3238         cf_path_syntax="$prefix"
3239 else
3240         cf_path_syntax="$ac_default_prefix"
3241 fi
3242
3243 case ".$PKG_CONFIG" in
3244 (.\$\(*\)*|.\'*\'*)
3245         ;;
3246 (..|./*|.\\*)
3247         ;;
3248 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3249         ;;
3250 (.\$\{*prefix\}*|.\$\{*dir\}*)
3251         eval PKG_CONFIG="$PKG_CONFIG"
3252         case ".$PKG_CONFIG" in
3253         (.NONE/*)
3254                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3255                 ;;
3256         esac
3257         ;;
3258 (.no|.NONE/*)
3259         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3260         ;;
3261 (*)
3262         { { echo "$as_me:3262: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3263 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3264    { (exit 1); exit 1; }; }
3265         ;;
3266 esac
3267
3268 elif test "x$cf_pkg_config" != xno ; then
3269         { echo "$as_me:3269: WARNING: pkg-config is not installed" >&5
3270 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3271 fi
3272
3273 case "$PKG_CONFIG" in
3274 (no|none|yes)
3275         echo "$as_me:3275: checking for pkg-config library directory" >&5
3276 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3277         ;;
3278 (*)
3279         echo "$as_me:3279: checking for $PKG_CONFIG library directory" >&5
3280 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3281         ;;
3282 esac
3283
3284 # if $PKG_CONFIG_LIBDIR is set, try to use that
3285 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,'`
3286
3287 # if the option is used, let that override.  otherwise default to "libdir"
3288
3289 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3290 if test "${with_pkg_config_libdir+set}" = set; then
3291   withval="$with_pkg_config_libdir"
3292   cf_search_path=$withval
3293 else
3294   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3295 fi;
3296
3297 case "x$cf_search_path" in
3298 (xlibdir)
3299         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3300         echo "$as_me:3300: result: $PKG_CONFIG_LIBDIR" >&5
3301 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3302         cf_search_path=
3303         ;;
3304 (x)
3305         ;;
3306 (x/*\ *)
3307         PKG_CONFIG_LIBDIR=
3308         ;;
3309 (x/*)
3310         PKG_CONFIG_LIBDIR="$cf_search_path"
3311         echo "$as_me:3311: result: $PKG_CONFIG_LIBDIR" >&5
3312 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3313         cf_search_path=
3314         ;;
3315 (xyes|xauto)
3316         echo "$as_me:3316: result: auto" >&5
3317 echo "${ECHO_T}auto" >&6
3318         cf_search_path=
3319         # Look for the library directory using the same prefix as the executable
3320         echo "$as_me:3320: checking for search-list" >&5
3321 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3322         if test "x$PKG_CONFIG" != xnone
3323         then
3324                 # works for pkg-config since version 0.24 (2009)
3325                 # works for pkgconf since version 0.8.3 (2012)
3326                 for cf_pkg_program in \
3327                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3328                         pkg-config \
3329                         pkgconf
3330                 do
3331                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3332                         test -n "$cf_search_path" && break
3333                 done
3334
3335                 # works for pkg-config since import in 2005 of original 2001 HP code.
3336                 test -z "$cf_search_path" && \
3337                 cf_search_path=`
3338                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3339 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3340         sub(\"^[^']*'\",\"\"); \
3341         sub(\"'.*\",\"\"); \
3342         printf \" %s\", \\$0; } \
3343 { next; } \
3344 "`
3345         fi
3346
3347         echo "$as_me:3347: result: $cf_search_path" >&5
3348 echo "${ECHO_T}$cf_search_path" >&6
3349         ;;
3350 (*)
3351         { { echo "$as_me:3351: error: Unexpected option value: $cf_search_path" >&5
3352 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3353    { (exit 1); exit 1; }; }
3354         ;;
3355 esac
3356
3357 if test -n "$cf_search_path"
3358 then
3359         echo "$as_me:3359: checking for first directory" >&5
3360 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3361         cf_pkg_config_path=none
3362         for cf_config in $cf_search_path
3363         do
3364                 if test -d "$cf_config"
3365                 then
3366                         cf_pkg_config_path=$cf_config
3367                         break
3368                 fi
3369         done
3370         echo "$as_me:3370: result: $cf_pkg_config_path" >&5
3371 echo "${ECHO_T}$cf_pkg_config_path" >&6
3372
3373         if test "x$cf_pkg_config_path" != xnone ; then
3374                 # limit this to the first directory found
3375                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3376         fi
3377
3378         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3379         then
3380                 echo "$as_me:3380: checking for workaround" >&5
3381 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3382                 if test "$prefix" = "NONE" ; then
3383                         cf_prefix="$ac_default_prefix"
3384                 else
3385                         cf_prefix="$prefix"
3386                 fi
3387                 eval cf_libdir=$libdir
3388                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3389                 cf_backup=
3390                 for cf_config in $cf_search_path
3391                 do
3392                         case $cf_config in
3393                         $cf_libdir/pkgconfig)
3394                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3395                                 break
3396                                 ;;
3397                         *)
3398                                 test -z "$cf_backup" && cf_backup=$cf_config
3399                                 ;;
3400                         esac
3401                 done
3402                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3403                 echo "$as_me:3403: result: $PKG_CONFIG_LIBDIR" >&5
3404 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3405         fi
3406 fi
3407
3408 echo "$as_me:3408: checking if you want to build test-programs" >&5
3409 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3410
3411 # Check whether --with-tests or --without-tests was given.
3412 if test "${with_tests+set}" = set; then
3413   withval="$with_tests"
3414   cf_with_tests=$withval
3415 else
3416   cf_with_tests=yes
3417 fi;
3418 echo "$as_me:3418: result: $cf_with_tests" >&5
3419 echo "${ECHO_T}$cf_with_tests" >&6
3420
3421 echo "$as_me:3421: checking if we should assume mixed-case filenames" >&5
3422 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3423
3424 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3425 if test "${enable_mixed_case+set}" = set; then
3426   enableval="$enable_mixed_case"
3427   enable_mixedcase=$enableval
3428 else
3429   enable_mixedcase=auto
3430 fi;
3431 echo "$as_me:3431: result: $enable_mixedcase" >&5
3432 echo "${ECHO_T}$enable_mixedcase" >&6
3433 if test "$enable_mixedcase" = "auto" ; then
3434
3435 echo "$as_me:3435: checking if filesystem supports mixed-case filenames" >&5
3436 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3437 if test "${cf_cv_mixedcase+set}" = set; then
3438   echo $ECHO_N "(cached) $ECHO_C" >&6
3439 else
3440
3441 if test "$cross_compiling" = yes ; then
3442         case "$target_alias" in
3443         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3444                 cf_cv_mixedcase=no
3445                 ;;
3446         (*)
3447                 cf_cv_mixedcase=yes
3448                 ;;
3449         esac
3450 else
3451         rm -f conftest CONFTEST
3452         echo test >conftest
3453         if test -f CONFTEST ; then
3454                 cf_cv_mixedcase=no
3455         else
3456                 cf_cv_mixedcase=yes
3457         fi
3458         rm -f conftest CONFTEST
3459 fi
3460
3461 fi
3462 echo "$as_me:3462: result: $cf_cv_mixedcase" >&5
3463 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3464 test "$cf_cv_mixedcase" = yes &&
3465 cat >>confdefs.h <<\EOF
3466 #define MIXEDCASE_FILENAMES 1
3467 EOF
3468
3469 else
3470         cf_cv_mixedcase=$enable_mixedcase
3471         if test "$enable_mixedcase" = "yes" ; then
3472                 cat >>confdefs.h <<\EOF
3473 #define MIXEDCASE_FILENAMES 1
3474 EOF
3475
3476         fi
3477 fi
3478
3479 # do this after mixed-case option (tags/TAGS is not as important as tic).
3480 echo "$as_me:3480: checking whether ${MAKE-make} sets \${MAKE}" >&5
3481 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3482 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3483 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3484   echo $ECHO_N "(cached) $ECHO_C" >&6
3485 else
3486   cat >conftest.make <<\EOF
3487 all:
3488         @echo 'ac_maketemp="${MAKE}"'
3489 EOF
3490 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3491 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3492 if test -n "$ac_maketemp"; then
3493   eval ac_cv_prog_make_${ac_make}_set=yes
3494 else
3495   eval ac_cv_prog_make_${ac_make}_set=no
3496 fi
3497 rm -f conftest.make
3498 fi
3499 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3500   echo "$as_me:3500: result: yes" >&5
3501 echo "${ECHO_T}yes" >&6
3502   SET_MAKE=
3503 else
3504   echo "$as_me:3504: result: no" >&5
3505 echo "${ECHO_T}no" >&6
3506   SET_MAKE="MAKE=${MAKE-make}"
3507 fi
3508
3509 echo "$as_me:3509: checking for \".PHONY\" make-support" >&5
3510 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3511 if test "${cf_cv_make_PHONY+set}" = set; then
3512   echo $ECHO_N "(cached) $ECHO_C" >&6
3513 else
3514
3515         rm -rf conftest*
3516         (
3517                 mkdir conftest || exit 1
3518                 cd conftest
3519                 cat >makefile <<'CF_EOF'
3520 .PHONY: always
3521 DATA=0
3522 always: always.out
3523         @echo "** making $@ $(DATA)"
3524 once: once.out
3525         @echo "** making $@ $(DATA)"
3526 always.out:
3527         @echo "** making $@ $(DATA)"
3528         echo $(DATA) > $@
3529 once.out:
3530         @echo "** making $@ $(DATA)"
3531         echo $(DATA) > $@
3532 CF_EOF
3533                 for cf_data in 1 2 3
3534                 do
3535                         ${MAKE:-make} always DATA=$cf_data
3536                         ${MAKE:-make} once   DATA=$cf_data
3537                         ${MAKE:-make} -t always once
3538                         if test -f always ; then
3539                                 echo "no (case 1)" > ../conftest.tmp
3540                         elif test ! -f always.out ; then
3541                                 echo "no (case 2)" > ../conftest.tmp
3542                         elif test ! -f once.out ; then
3543                                 echo "no (case 3)" > ../conftest.tmp
3544                         elif ! cmp -s always.out once.out ; then
3545                                 echo "no (case 4)" > ../conftest.tmp
3546                                 diff always.out once.out
3547                         else
3548                                 cf_check="`cat always.out`"
3549                                 if test "x$cf_check" != "x$cf_data" ; then
3550                                         echo "no (case 5)" > ../conftest.tmp
3551                                 else
3552                                         echo yes > ../conftest.tmp
3553                                         rm -f ./*.out
3554                                         continue
3555                                 fi
3556                         fi
3557                         break
3558                 done
3559         ) >&5 2>&1
3560         cf_cv_make_PHONY="`cat conftest.tmp`"
3561         rm -rf conftest*
3562
3563 fi
3564 echo "$as_me:3564: result: $cf_cv_make_PHONY" >&5
3565 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3566 MAKE_NO_PHONY="#"
3567 MAKE_PHONY="#"
3568 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3569 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3570
3571 for ac_prog in exctags ctags
3572 do
3573   # Extract the first word of "$ac_prog", so it can be a program name with args.
3574 set dummy $ac_prog; ac_word=$2
3575 echo "$as_me:3575: checking for $ac_word" >&5
3576 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3577 if test "${ac_cv_prog_CTAGS+set}" = set; then
3578   echo $ECHO_N "(cached) $ECHO_C" >&6
3579 else
3580   if test -n "$CTAGS"; then
3581   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3582 else
3583   ac_save_IFS=$IFS; IFS=$ac_path_separator
3584 ac_dummy="$PATH"
3585 for ac_dir in $ac_dummy; do
3586   IFS=$ac_save_IFS
3587   test -z "$ac_dir" && ac_dir=.
3588   $as_executable_p "$ac_dir/$ac_word" || continue
3589 ac_cv_prog_CTAGS="$ac_prog"
3590 echo "$as_me:3590: found $ac_dir/$ac_word" >&5
3591 break
3592 done
3593
3594 fi
3595 fi
3596 CTAGS=$ac_cv_prog_CTAGS
3597 if test -n "$CTAGS"; then
3598   echo "$as_me:3598: result: $CTAGS" >&5
3599 echo "${ECHO_T}$CTAGS" >&6
3600 else
3601   echo "$as_me:3601: result: no" >&5
3602 echo "${ECHO_T}no" >&6
3603 fi
3604
3605   test -n "$CTAGS" && break
3606 done
3607
3608 for ac_prog in exetags etags
3609 do
3610   # Extract the first word of "$ac_prog", so it can be a program name with args.
3611 set dummy $ac_prog; ac_word=$2
3612 echo "$as_me:3612: checking for $ac_word" >&5
3613 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3614 if test "${ac_cv_prog_ETAGS+set}" = set; then
3615   echo $ECHO_N "(cached) $ECHO_C" >&6
3616 else
3617   if test -n "$ETAGS"; then
3618   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3619 else
3620   ac_save_IFS=$IFS; IFS=$ac_path_separator
3621 ac_dummy="$PATH"
3622 for ac_dir in $ac_dummy; do
3623   IFS=$ac_save_IFS
3624   test -z "$ac_dir" && ac_dir=.
3625   $as_executable_p "$ac_dir/$ac_word" || continue
3626 ac_cv_prog_ETAGS="$ac_prog"
3627 echo "$as_me:3627: found $ac_dir/$ac_word" >&5
3628 break
3629 done
3630
3631 fi
3632 fi
3633 ETAGS=$ac_cv_prog_ETAGS
3634 if test -n "$ETAGS"; then
3635   echo "$as_me:3635: result: $ETAGS" >&5
3636 echo "${ECHO_T}$ETAGS" >&6
3637 else
3638   echo "$as_me:3638: result: no" >&5
3639 echo "${ECHO_T}no" >&6
3640 fi
3641
3642   test -n "$ETAGS" && break
3643 done
3644
3645 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3646 set dummy ${CTAGS:-ctags}; ac_word=$2
3647 echo "$as_me:3647: checking for $ac_word" >&5
3648 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3649 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3650   echo $ECHO_N "(cached) $ECHO_C" >&6
3651 else
3652   if test -n "$MAKE_LOWER_TAGS"; then
3653   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3654 else
3655   ac_save_IFS=$IFS; IFS=$ac_path_separator
3656 ac_dummy="$PATH"
3657 for ac_dir in $ac_dummy; do
3658   IFS=$ac_save_IFS
3659   test -z "$ac_dir" && ac_dir=.
3660   $as_executable_p "$ac_dir/$ac_word" || continue
3661 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3662 echo "$as_me:3662: found $ac_dir/$ac_word" >&5
3663 break
3664 done
3665
3666   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3667 fi
3668 fi
3669 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3670 if test -n "$MAKE_LOWER_TAGS"; then
3671   echo "$as_me:3671: result: $MAKE_LOWER_TAGS" >&5
3672 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3673 else
3674   echo "$as_me:3674: result: no" >&5
3675 echo "${ECHO_T}no" >&6
3676 fi
3677
3678 if test "$cf_cv_mixedcase" = yes ; then
3679         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3680 set dummy ${ETAGS:-etags}; ac_word=$2
3681 echo "$as_me:3681: checking for $ac_word" >&5
3682 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3683 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3684   echo $ECHO_N "(cached) $ECHO_C" >&6
3685 else
3686   if test -n "$MAKE_UPPER_TAGS"; then
3687   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3688 else
3689   ac_save_IFS=$IFS; IFS=$ac_path_separator
3690 ac_dummy="$PATH"
3691 for ac_dir in $ac_dummy; do
3692   IFS=$ac_save_IFS
3693   test -z "$ac_dir" && ac_dir=.
3694   $as_executable_p "$ac_dir/$ac_word" || continue
3695 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3696 echo "$as_me:3696: found $ac_dir/$ac_word" >&5
3697 break
3698 done
3699
3700   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3701 fi
3702 fi
3703 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3704 if test -n "$MAKE_UPPER_TAGS"; then
3705   echo "$as_me:3705: result: $MAKE_UPPER_TAGS" >&5
3706 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3707 else
3708   echo "$as_me:3708: result: no" >&5
3709 echo "${ECHO_T}no" >&6
3710 fi
3711
3712 else
3713         MAKE_UPPER_TAGS=no
3714 fi
3715
3716 if test "$MAKE_UPPER_TAGS" = yes ; then
3717         MAKE_UPPER_TAGS=
3718 else
3719         MAKE_UPPER_TAGS="#"
3720 fi
3721
3722 if test "$MAKE_LOWER_TAGS" = yes ; then
3723         MAKE_LOWER_TAGS=
3724 else
3725         MAKE_LOWER_TAGS="#"
3726 fi
3727
3728 echo "$as_me:3728: checking for makeflags variable" >&5
3729 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3730 if test "${cf_cv_makeflags+set}" = set; then
3731   echo $ECHO_N "(cached) $ECHO_C" >&6
3732 else
3733
3734         cf_cv_makeflags=''
3735         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3736         do
3737                 cat >cf_makeflags.tmp <<CF_EOF
3738 SHELL = $SHELL
3739 all :
3740         @ echo '.$cf_option'
3741 CF_EOF
3742                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3743                 case "$cf_result" in
3744                 (.*k|.*kw)
3745                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3746                         case "$cf_result" in
3747                         (.*CC=*)        cf_cv_makeflags=
3748                                 ;;
3749                         (*)     cf_cv_makeflags=$cf_option
3750                                 ;;
3751                         esac
3752                         break
3753                         ;;
3754                 (.-)
3755                         ;;
3756                 (*)
3757
3758 echo "${as_me:-configure}:3758: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3759
3760                         ;;
3761                 esac
3762         done
3763         rm -f cf_makeflags.tmp
3764
3765 fi
3766 echo "$as_me:3766: result: $cf_cv_makeflags" >&5
3767 echo "${ECHO_T}$cf_cv_makeflags" >&6
3768
3769 if test -n "$ac_tool_prefix"; then
3770   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3771 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3772 echo "$as_me:3772: checking for $ac_word" >&5
3773 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3774 if test "${ac_cv_prog_RANLIB+set}" = set; then
3775   echo $ECHO_N "(cached) $ECHO_C" >&6
3776 else
3777   if test -n "$RANLIB"; then
3778   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3779 else
3780   ac_save_IFS=$IFS; IFS=$ac_path_separator
3781 ac_dummy="$PATH"
3782 for ac_dir in $ac_dummy; do
3783   IFS=$ac_save_IFS
3784   test -z "$ac_dir" && ac_dir=.
3785   $as_executable_p "$ac_dir/$ac_word" || continue
3786 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3787 echo "$as_me:3787: found $ac_dir/$ac_word" >&5
3788 break
3789 done
3790
3791 fi
3792 fi
3793 RANLIB=$ac_cv_prog_RANLIB
3794 if test -n "$RANLIB"; then
3795   echo "$as_me:3795: result: $RANLIB" >&5
3796 echo "${ECHO_T}$RANLIB" >&6
3797 else
3798   echo "$as_me:3798: result: no" >&5
3799 echo "${ECHO_T}no" >&6
3800 fi
3801
3802 fi
3803 if test -z "$ac_cv_prog_RANLIB"; then
3804   ac_ct_RANLIB=$RANLIB
3805   # Extract the first word of "ranlib", so it can be a program name with args.
3806 set dummy ranlib; ac_word=$2
3807 echo "$as_me:3807: checking for $ac_word" >&5
3808 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3809 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3810   echo $ECHO_N "(cached) $ECHO_C" >&6
3811 else
3812   if test -n "$ac_ct_RANLIB"; then
3813   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3814 else
3815   ac_save_IFS=$IFS; IFS=$ac_path_separator
3816 ac_dummy="$PATH"
3817 for ac_dir in $ac_dummy; do
3818   IFS=$ac_save_IFS
3819   test -z "$ac_dir" && ac_dir=.
3820   $as_executable_p "$ac_dir/$ac_word" || continue
3821 ac_cv_prog_ac_ct_RANLIB="ranlib"
3822 echo "$as_me:3822: found $ac_dir/$ac_word" >&5
3823 break
3824 done
3825
3826   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3827 fi
3828 fi
3829 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3830 if test -n "$ac_ct_RANLIB"; then
3831   echo "$as_me:3831: result: $ac_ct_RANLIB" >&5
3832 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3833 else
3834   echo "$as_me:3834: result: no" >&5
3835 echo "${ECHO_T}no" >&6
3836 fi
3837
3838   RANLIB=$ac_ct_RANLIB
3839 else
3840   RANLIB="$ac_cv_prog_RANLIB"
3841 fi
3842
3843 if test -n "$ac_tool_prefix"; then
3844   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3845 set dummy ${ac_tool_prefix}ld; ac_word=$2
3846 echo "$as_me:3846: checking for $ac_word" >&5
3847 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3848 if test "${ac_cv_prog_LD+set}" = set; then
3849   echo $ECHO_N "(cached) $ECHO_C" >&6
3850 else
3851   if test -n "$LD"; then
3852   ac_cv_prog_LD="$LD" # Let the user override the test.
3853 else
3854   ac_save_IFS=$IFS; IFS=$ac_path_separator
3855 ac_dummy="$PATH"
3856 for ac_dir in $ac_dummy; do
3857   IFS=$ac_save_IFS
3858   test -z "$ac_dir" && ac_dir=.
3859   $as_executable_p "$ac_dir/$ac_word" || continue
3860 ac_cv_prog_LD="${ac_tool_prefix}ld"
3861 echo "$as_me:3861: found $ac_dir/$ac_word" >&5
3862 break
3863 done
3864
3865 fi
3866 fi
3867 LD=$ac_cv_prog_LD
3868 if test -n "$LD"; then
3869   echo "$as_me:3869: result: $LD" >&5
3870 echo "${ECHO_T}$LD" >&6
3871 else
3872   echo "$as_me:3872: result: no" >&5
3873 echo "${ECHO_T}no" >&6
3874 fi
3875
3876 fi
3877 if test -z "$ac_cv_prog_LD"; then
3878   ac_ct_LD=$LD
3879   # Extract the first word of "ld", so it can be a program name with args.
3880 set dummy ld; ac_word=$2
3881 echo "$as_me:3881: checking for $ac_word" >&5
3882 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3883 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3884   echo $ECHO_N "(cached) $ECHO_C" >&6
3885 else
3886   if test -n "$ac_ct_LD"; then
3887   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3888 else
3889   ac_save_IFS=$IFS; IFS=$ac_path_separator
3890 ac_dummy="$PATH"
3891 for ac_dir in $ac_dummy; do
3892   IFS=$ac_save_IFS
3893   test -z "$ac_dir" && ac_dir=.
3894   $as_executable_p "$ac_dir/$ac_word" || continue
3895 ac_cv_prog_ac_ct_LD="ld"
3896 echo "$as_me:3896: found $ac_dir/$ac_word" >&5
3897 break
3898 done
3899
3900   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3901 fi
3902 fi
3903 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3904 if test -n "$ac_ct_LD"; then
3905   echo "$as_me:3905: result: $ac_ct_LD" >&5
3906 echo "${ECHO_T}$ac_ct_LD" >&6
3907 else
3908   echo "$as_me:3908: result: no" >&5
3909 echo "${ECHO_T}no" >&6
3910 fi
3911
3912   LD=$ac_ct_LD
3913 else
3914   LD="$ac_cv_prog_LD"
3915 fi
3916
3917 if test -n "$ac_tool_prefix"; then
3918   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3919 set dummy ${ac_tool_prefix}ar; ac_word=$2
3920 echo "$as_me:3920: checking for $ac_word" >&5
3921 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3922 if test "${ac_cv_prog_AR+set}" = set; then
3923   echo $ECHO_N "(cached) $ECHO_C" >&6
3924 else
3925   if test -n "$AR"; then
3926   ac_cv_prog_AR="$AR" # Let the user override the test.
3927 else
3928   ac_save_IFS=$IFS; IFS=$ac_path_separator
3929 ac_dummy="$PATH"
3930 for ac_dir in $ac_dummy; do
3931   IFS=$ac_save_IFS
3932   test -z "$ac_dir" && ac_dir=.
3933   $as_executable_p "$ac_dir/$ac_word" || continue
3934 ac_cv_prog_AR="${ac_tool_prefix}ar"
3935 echo "$as_me:3935: found $ac_dir/$ac_word" >&5
3936 break
3937 done
3938
3939 fi
3940 fi
3941 AR=$ac_cv_prog_AR
3942 if test -n "$AR"; then
3943   echo "$as_me:3943: result: $AR" >&5
3944 echo "${ECHO_T}$AR" >&6
3945 else
3946   echo "$as_me:3946: result: no" >&5
3947 echo "${ECHO_T}no" >&6
3948 fi
3949
3950 fi
3951 if test -z "$ac_cv_prog_AR"; then
3952   ac_ct_AR=$AR
3953   # Extract the first word of "ar", so it can be a program name with args.
3954 set dummy ar; ac_word=$2
3955 echo "$as_me:3955: checking for $ac_word" >&5
3956 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3957 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3958   echo $ECHO_N "(cached) $ECHO_C" >&6
3959 else
3960   if test -n "$ac_ct_AR"; then
3961   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3962 else
3963   ac_save_IFS=$IFS; IFS=$ac_path_separator
3964 ac_dummy="$PATH"
3965 for ac_dir in $ac_dummy; do
3966   IFS=$ac_save_IFS
3967   test -z "$ac_dir" && ac_dir=.
3968   $as_executable_p "$ac_dir/$ac_word" || continue
3969 ac_cv_prog_ac_ct_AR="ar"
3970 echo "$as_me:3970: found $ac_dir/$ac_word" >&5
3971 break
3972 done
3973
3974   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3975 fi
3976 fi
3977 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3978 if test -n "$ac_ct_AR"; then
3979   echo "$as_me:3979: result: $ac_ct_AR" >&5
3980 echo "${ECHO_T}$ac_ct_AR" >&6
3981 else
3982   echo "$as_me:3982: result: no" >&5
3983 echo "${ECHO_T}no" >&6
3984 fi
3985
3986   AR=$ac_ct_AR
3987 else
3988   AR="$ac_cv_prog_AR"
3989 fi
3990
3991 if test -n "$ac_tool_prefix"; then
3992   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3993 set dummy ${ac_tool_prefix}ar; ac_word=$2
3994 echo "$as_me:3994: checking for $ac_word" >&5
3995 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3996 if test "${ac_cv_prog_AR+set}" = set; then
3997   echo $ECHO_N "(cached) $ECHO_C" >&6
3998 else
3999   if test -n "$AR"; then
4000   ac_cv_prog_AR="$AR" # Let the user override the test.
4001 else
4002   ac_save_IFS=$IFS; IFS=$ac_path_separator
4003 ac_dummy="$PATH"
4004 for ac_dir in $ac_dummy; do
4005   IFS=$ac_save_IFS
4006   test -z "$ac_dir" && ac_dir=.
4007   $as_executable_p "$ac_dir/$ac_word" || continue
4008 ac_cv_prog_AR="${ac_tool_prefix}ar"
4009 echo "$as_me:4009: found $ac_dir/$ac_word" >&5
4010 break
4011 done
4012
4013 fi
4014 fi
4015 AR=$ac_cv_prog_AR
4016 if test -n "$AR"; then
4017   echo "$as_me:4017: result: $AR" >&5
4018 echo "${ECHO_T}$AR" >&6
4019 else
4020   echo "$as_me:4020: result: no" >&5
4021 echo "${ECHO_T}no" >&6
4022 fi
4023
4024 fi
4025 if test -z "$ac_cv_prog_AR"; then
4026   ac_ct_AR=$AR
4027   # Extract the first word of "ar", so it can be a program name with args.
4028 set dummy ar; ac_word=$2
4029 echo "$as_me:4029: checking for $ac_word" >&5
4030 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4031 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4032   echo $ECHO_N "(cached) $ECHO_C" >&6
4033 else
4034   if test -n "$ac_ct_AR"; then
4035   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4036 else
4037   ac_save_IFS=$IFS; IFS=$ac_path_separator
4038 ac_dummy="$PATH"
4039 for ac_dir in $ac_dummy; do
4040   IFS=$ac_save_IFS
4041   test -z "$ac_dir" && ac_dir=.
4042   $as_executable_p "$ac_dir/$ac_word" || continue
4043 ac_cv_prog_ac_ct_AR="ar"
4044 echo "$as_me:4044: found $ac_dir/$ac_word" >&5
4045 break
4046 done
4047
4048   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4049 fi
4050 fi
4051 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4052 if test -n "$ac_ct_AR"; then
4053   echo "$as_me:4053: result: $ac_ct_AR" >&5
4054 echo "${ECHO_T}$ac_ct_AR" >&6
4055 else
4056   echo "$as_me:4056: result: no" >&5
4057 echo "${ECHO_T}no" >&6
4058 fi
4059
4060   AR=$ac_ct_AR
4061 else
4062   AR="$ac_cv_prog_AR"
4063 fi
4064
4065 echo "$as_me:4065: checking for options to update archives" >&5
4066 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4067 if test "${cf_cv_ar_flags+set}" = set; then
4068   echo $ECHO_N "(cached) $ECHO_C" >&6
4069 else
4070
4071         case "$cf_cv_system_name" in
4072         (*-msvc*)
4073                 cf_cv_ar_flags=''
4074                 cat >mk_static_lib.sh <<-EOF
4075                 #!$SHELL
4076                 MSVC_BIN="$AR"
4077                 out="\$1"
4078                 shift
4079                 exec \$MSVC_BIN -out:"\$out" \$@
4080                 EOF
4081                 chmod +x mk_static_lib.sh
4082                 AR=`pwd`/mk_static_lib.sh
4083                 ;;
4084         (*)
4085                 cf_cv_ar_flags=unknown
4086                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4087                 do
4088
4089                         # check if $ARFLAGS already contains this choice
4090                         if test "x$ARFLAGS" != "x" ; then
4091                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4092                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4093                                         cf_cv_ar_flags=
4094                                         break
4095                                 fi
4096                         fi
4097
4098                         rm -f "conftest.$ac_cv_objext"
4099                         rm -f conftest.a
4100
4101                         cat >"conftest.$ac_ext" <<EOF
4102 #line 4102 "configure"
4103 int     testdata[3] = { 123, 456, 789 };
4104 EOF
4105                         if { (eval echo "$as_me:4105: \"$ac_compile\"") >&5
4106   (eval $ac_compile) 2>&5
4107   ac_status=$?
4108   echo "$as_me:4108: \$? = $ac_status" >&5
4109   (exit "$ac_status"); } ; then
4110                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4111                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4112                                 if test -f conftest.a ; then
4113                                         cf_cv_ar_flags="$cf_ar_flags"
4114                                         break
4115                                 fi
4116                         else
4117                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4118
4119 echo "${as_me:-configure}:4119: testing cannot compile test-program ..." 1>&5
4120
4121                                 break
4122                         fi
4123                 done
4124                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4125                 ;;
4126         esac
4127
4128 fi
4129 echo "$as_me:4129: result: $cf_cv_ar_flags" >&5
4130 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4131
4132 if test -n "$ARFLAGS" ; then
4133         if test -n "$cf_cv_ar_flags" ; then
4134                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4135         fi
4136 else
4137         ARFLAGS=$cf_cv_ar_flags
4138 fi
4139
4140         echo "$as_me:4140: checking for PATH separator" >&5
4141 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4142         case "$cf_cv_system_name" in
4143         (os2*)  PATH_SEPARATOR=';'  ;;
4144         (*)     ${PATH_SEPARATOR:=':'}  ;;
4145         esac
4146
4147         echo "$as_me:4147: result: $PATH_SEPARATOR" >&5
4148 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4149
4150 echo "$as_me:4150: checking if you have specified an install-prefix" >&5
4151 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4152
4153 # Check whether --with-install-prefix or --without-install-prefix was given.
4154 if test "${with_install_prefix+set}" = set; then
4155   withval="$with_install_prefix"
4156   case "$withval" in
4157         (yes|no)
4158                 ;;
4159         (*)     DESTDIR="$withval"
4160                 ;;
4161         esac
4162 fi;
4163 echo "$as_me:4163: result: $DESTDIR" >&5
4164 echo "${ECHO_T}$DESTDIR" >&6
4165
4166 ###############################################################################
4167
4168 # If we're cross-compiling, allow the user to override the tools and their
4169 # options.  The configure script is oriented toward identifying the host
4170 # compiler, etc., but we need a build compiler to generate parts of the source.
4171
4172 if test "$cross_compiling" = yes ; then
4173
4174         # defaults that we might want to override
4175         : ${BUILD_CFLAGS:=''}
4176         : ${BUILD_CPPFLAGS:=''}
4177         : ${BUILD_LDFLAGS:=''}
4178         : ${BUILD_LIBS:=''}
4179         : ${BUILD_EXEEXT:='$x'}
4180         : ${BUILD_OBJEXT:='o'}
4181
4182 # Check whether --with-build-cc or --without-build-cc was given.
4183 if test "${with_build_cc+set}" = set; then
4184   withval="$with_build_cc"
4185   BUILD_CC="$withval"
4186 else
4187   for ac_prog in gcc clang c99 c89 cc cl
4188 do
4189   # Extract the first word of "$ac_prog", so it can be a program name with args.
4190 set dummy $ac_prog; ac_word=$2
4191 echo "$as_me:4191: checking for $ac_word" >&5
4192 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4193 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4194   echo $ECHO_N "(cached) $ECHO_C" >&6
4195 else
4196   if test -n "$BUILD_CC"; then
4197   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4198 else
4199   ac_save_IFS=$IFS; IFS=$ac_path_separator
4200 ac_dummy="$PATH"
4201 for ac_dir in $ac_dummy; do
4202   IFS=$ac_save_IFS
4203   test -z "$ac_dir" && ac_dir=.
4204   $as_executable_p "$ac_dir/$ac_word" || continue
4205 ac_cv_prog_BUILD_CC="$ac_prog"
4206 echo "$as_me:4206: found $ac_dir/$ac_word" >&5
4207 break
4208 done
4209
4210 fi
4211 fi
4212 BUILD_CC=$ac_cv_prog_BUILD_CC
4213 if test -n "$BUILD_CC"; then
4214   echo "$as_me:4214: result: $BUILD_CC" >&5
4215 echo "${ECHO_T}$BUILD_CC" >&6
4216 else
4217   echo "$as_me:4217: result: no" >&5
4218 echo "${ECHO_T}no" >&6
4219 fi
4220
4221   test -n "$BUILD_CC" && break
4222 done
4223 test -n "$BUILD_CC" || BUILD_CC="none"
4224
4225 fi;
4226         echo "$as_me:4226: checking for native build C compiler" >&5
4227 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4228         echo "$as_me:4228: result: $BUILD_CC" >&5
4229 echo "${ECHO_T}$BUILD_CC" >&6
4230
4231         echo "$as_me:4231: checking for native build C preprocessor" >&5
4232 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4233
4234 # Check whether --with-build-cpp or --without-build-cpp was given.
4235 if test "${with_build_cpp+set}" = set; then
4236   withval="$with_build_cpp"
4237   BUILD_CPP="$withval"
4238 else
4239   BUILD_CPP='${BUILD_CC} -E'
4240 fi;
4241         echo "$as_me:4241: result: $BUILD_CPP" >&5
4242 echo "${ECHO_T}$BUILD_CPP" >&6
4243
4244         echo "$as_me:4244: checking for native build C flags" >&5
4245 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4246
4247 # Check whether --with-build-cflags or --without-build-cflags was given.
4248 if test "${with_build_cflags+set}" = set; then
4249   withval="$with_build_cflags"
4250   BUILD_CFLAGS="$withval"
4251 fi;
4252         echo "$as_me:4252: result: $BUILD_CFLAGS" >&5
4253 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4254
4255         echo "$as_me:4255: checking for native build C preprocessor-flags" >&5
4256 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4257
4258 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4259 if test "${with_build_cppflags+set}" = set; then
4260   withval="$with_build_cppflags"
4261   BUILD_CPPFLAGS="$withval"
4262 fi;
4263         echo "$as_me:4263: result: $BUILD_CPPFLAGS" >&5
4264 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4265
4266         echo "$as_me:4266: checking for native build linker-flags" >&5
4267 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4268
4269 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4270 if test "${with_build_ldflags+set}" = set; then
4271   withval="$with_build_ldflags"
4272   BUILD_LDFLAGS="$withval"
4273 fi;
4274         echo "$as_me:4274: result: $BUILD_LDFLAGS" >&5
4275 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4276
4277         echo "$as_me:4277: checking for native build linker-libraries" >&5
4278 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4279
4280 # Check whether --with-build-libs or --without-build-libs was given.
4281 if test "${with_build_libs+set}" = set; then
4282   withval="$with_build_libs"
4283   BUILD_LIBS="$withval"
4284 fi;
4285         echo "$as_me:4285: result: $BUILD_LIBS" >&5
4286 echo "${ECHO_T}$BUILD_LIBS" >&6
4287
4288         # this assumes we're on Unix.
4289         BUILD_EXEEXT=
4290         BUILD_OBJEXT=o
4291
4292         : ${BUILD_CC:='${CC}'}
4293
4294         echo "$as_me:4294: checking if the build-compiler \"$BUILD_CC\" works" >&5
4295 echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4296
4297         cf_save_crossed=$cross_compiling
4298         cf_save_ac_link=$ac_link
4299         cross_compiling=no
4300         ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $BUILD_CPPFLAGS $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4301
4302         if test "$cross_compiling" = yes; then
4303   cf_ok_build_cc=unknown
4304 else
4305   cat >"conftest.$ac_ext" <<_ACEOF
4306 #line 4306 "configure"
4307 #include "confdefs.h"
4308 #include <stdio.h>
4309                 int main(int argc, char *argv[])
4310                 {
4311                         ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4312                 }
4313
4314 _ACEOF
4315 rm -f "conftest$ac_exeext"
4316 if { (eval echo "$as_me:4316: \"$ac_link\"") >&5
4317   (eval $ac_link) 2>&5
4318   ac_status=$?
4319   echo "$as_me:4319: \$? = $ac_status" >&5
4320   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4321   { (eval echo "$as_me:4321: \"$ac_try\"") >&5
4322   (eval $ac_try) 2>&5
4323   ac_status=$?
4324   echo "$as_me:4324: \$? = $ac_status" >&5
4325   (exit "$ac_status"); }; }; then
4326   cf_ok_build_cc=yes
4327 else
4328   echo "$as_me: program exited with status $ac_status" >&5
4329 echo "$as_me: failed program was:" >&5
4330 cat "conftest.$ac_ext" >&5
4331 cf_ok_build_cc=no
4332 fi
4333 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4334 fi
4335
4336         cross_compiling=$cf_save_crossed
4337         ac_link=$cf_save_ac_link
4338
4339         echo "$as_me:4339: result: $cf_ok_build_cc" >&5
4340 echo "${ECHO_T}$cf_ok_build_cc" >&6
4341
4342         if test "$cf_ok_build_cc" != yes
4343         then
4344                 { { echo "$as_me:4344: error: Cross-build requires two compilers.
4345 Use --with-build-cc to specify the native compiler." >&5
4346 echo "$as_me: error: Cross-build requires two compilers.
4347 Use --with-build-cc to specify the native compiler." >&2;}
4348    { (exit 1); exit 1; }; }
4349         fi
4350
4351 else
4352         : ${BUILD_CC:='${CC}'}
4353         : ${BUILD_CPP:='${CPP}'}
4354         : ${BUILD_CFLAGS:='${CFLAGS}'}
4355         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4356         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4357         : ${BUILD_LIBS:='${LIBS}'}
4358         : ${BUILD_EXEEXT:='$x'}
4359         : ${BUILD_OBJEXT:='o'}
4360 fi
4361
4362 ###############################################################################
4363
4364 ### Options to allow the user to specify the set of libraries which are used.
4365 ### Use "--without-normal --with-shared" to allow the default model to be
4366 ### shared, for example.
4367 cf_list_models=""
4368
4369 echo "$as_me:4369: checking if you want to build shared C-objects" >&5
4370 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4371
4372 # Check whether --with-shared or --without-shared was given.
4373 if test "${with_shared+set}" = set; then
4374   withval="$with_shared"
4375   with_shared=$withval
4376 else
4377   with_shared=no
4378 fi;
4379 echo "$as_me:4379: result: $with_shared" >&5
4380 echo "${ECHO_T}$with_shared" >&6
4381 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4382
4383 echo "$as_me:4383: checking for specified models" >&5
4384 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4385 test -z "$cf_list_models" && cf_list_models=normal
4386 echo "$as_me:4386: result: $cf_list_models" >&5
4387 echo "${ECHO_T}$cf_list_models" >&6
4388
4389 ### Use the first model as the default, and save its suffix for use in building
4390 ### up test-applications.
4391 echo "$as_me:4391: checking for default model" >&5
4392 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4393 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4394 echo "$as_me:4394: result: $DFT_LWR_MODEL" >&5
4395 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4396
4397 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4398
4399 echo "$as_me:4399: checking for specific curses-directory" >&5
4400 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4401
4402 # Check whether --with-curses-dir or --without-curses-dir was given.
4403 if test "${with_curses_dir+set}" = set; then
4404   withval="$with_curses_dir"
4405   cf_cv_curses_dir=$withval
4406 else
4407   cf_cv_curses_dir=no
4408 fi;
4409 echo "$as_me:4409: result: $cf_cv_curses_dir" >&5
4410 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4411
4412 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4413 then
4414
4415 if test "x$prefix" != xNONE; then
4416         cf_path_syntax="$prefix"
4417 else
4418         cf_path_syntax="$ac_default_prefix"
4419 fi
4420
4421 case ".$withval" in
4422 (.\$\(*\)*|.\'*\'*)
4423         ;;
4424 (..|./*|.\\*)
4425         ;;
4426 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4427         ;;
4428 (.\$\{*prefix\}*|.\$\{*dir\}*)
4429         eval withval="$withval"
4430         case ".$withval" in
4431         (.NONE/*)
4432                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4433                 ;;
4434         esac
4435         ;;
4436 (.no|.NONE/*)
4437         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4438         ;;
4439 (*)
4440         { { echo "$as_me:4440: error: expected a pathname, not \"$withval\"" >&5
4441 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4442    { (exit 1); exit 1; }; }
4443         ;;
4444 esac
4445
4446         if test -d "$cf_cv_curses_dir"
4447         then
4448
4449 if test -n "$cf_cv_curses_dir/include" ; then
4450   for cf_add_incdir in $cf_cv_curses_dir/include
4451   do
4452         while test "$cf_add_incdir" != /usr/include
4453         do
4454           if test -d "$cf_add_incdir"
4455           then
4456                 cf_have_incdir=no
4457                 if test -n "$CFLAGS$CPPFLAGS" ; then
4458                   # a loop is needed to ensure we can add subdirs of existing dirs
4459                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4460                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4461                           cf_have_incdir=yes; break
4462                         fi
4463                   done
4464                 fi
4465
4466                 if test "$cf_have_incdir" = no ; then
4467                   if test "$cf_add_incdir" = /usr/local/include ; then
4468                         if test "$GCC" = yes
4469                         then
4470                           cf_save_CPPFLAGS=$CPPFLAGS
4471
4472         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4473         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4474
4475                           cat >"conftest.$ac_ext" <<_ACEOF
4476 #line 4476 "configure"
4477 #include "confdefs.h"
4478 #include <stdio.h>
4479 int
4480 main (void)
4481 {
4482 printf("Hello")
4483   ;
4484   return 0;
4485 }
4486 _ACEOF
4487 rm -f "conftest.$ac_objext"
4488 if { (eval echo "$as_me:4488: \"$ac_compile\"") >&5
4489   (eval $ac_compile) 2>&5
4490   ac_status=$?
4491   echo "$as_me:4491: \$? = $ac_status" >&5
4492   (exit "$ac_status"); } &&
4493          { ac_try='test -s "conftest.$ac_objext"'
4494   { (eval echo "$as_me:4494: \"$ac_try\"") >&5
4495   (eval $ac_try) 2>&5
4496   ac_status=$?
4497   echo "$as_me:4497: \$? = $ac_status" >&5
4498   (exit "$ac_status"); }; }; then
4499   :
4500 else
4501   echo "$as_me: failed program was:" >&5
4502 cat "conftest.$ac_ext" >&5
4503 cf_have_incdir=yes
4504 fi
4505 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4506                           CPPFLAGS=$cf_save_CPPFLAGS
4507                         fi
4508                   fi
4509                 fi
4510
4511                 if test "$cf_have_incdir" = no ; then
4512                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4513
4514 echo "${as_me:-configure}:4514: testing adding $cf_add_incdir to include-path ..." 1>&5
4515
4516                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4517
4518                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4519                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4520                   cf_add_incdir="$cf_top_incdir"
4521                 else
4522                   break
4523                 fi
4524           else
4525                 break
4526           fi
4527         done
4528   done
4529 fi
4530
4531 if test -n "$cf_cv_curses_dir/lib" ; then
4532         for cf_add_libdir in $cf_cv_curses_dir/lib
4533         do
4534                 if test "$cf_add_libdir" = /usr/lib ; then
4535                         :
4536                 elif test -d "$cf_add_libdir"
4537                 then
4538                         cf_have_libdir=no
4539                         if test -n "$LDFLAGS$LIBS" ; then
4540                                 # a loop is needed to ensure we can add subdirs of existing dirs
4541                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4542                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4543                                                 cf_have_libdir=yes; break
4544                                         fi
4545                                 done
4546                         fi
4547                         if test "$cf_have_libdir" = no ; then
4548                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4549
4550 echo "${as_me:-configure}:4550: testing adding $cf_add_libdir to library-path ..." 1>&5
4551
4552                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4553                         fi
4554                 fi
4555         done
4556 fi
4557
4558         fi
4559 fi
4560
4561 cf_ncuconfig_root=ncurses
4562 cf_have_ncuconfig=no
4563
4564 if test "x${PKG_CONFIG:=none}" != xnone; then
4565         echo "$as_me:4565: checking pkg-config for $cf_ncuconfig_root" >&5
4566 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4567         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4568                 echo "$as_me:4568: result: yes" >&5
4569 echo "${ECHO_T}yes" >&6
4570
4571                 echo "$as_me:4571: checking if the $cf_ncuconfig_root package files work" >&5
4572 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4573                 cf_have_ncuconfig=unknown
4574
4575                 cf_save_CFLAGS="$CFLAGS"
4576                 cf_save_CPPFLAGS="$CPPFLAGS"
4577                 cf_save_LIBS="$LIBS"
4578
4579                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4580                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4581
4582                 # while -W for passing linker flags is prevalent, it is not "standard".
4583                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4584                 # incompatible _and_ non-standard -W option which gives an error.  Work
4585                 # around that pitfall.
4586                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4587                 (x*c[89]9@@*-W*)
4588
4589 cf_fix_cppflags=no
4590 cf_new_cflags=
4591 cf_new_cppflags=
4592 cf_new_extra_cppflags=
4593
4594 for cf_add_cflags in $cf_pkg_cflags
4595 do
4596 case "$cf_fix_cppflags" in
4597 (no)
4598         case "$cf_add_cflags" in
4599         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4600                 case "$cf_add_cflags" in
4601                 (-D*)
4602                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4603
4604                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4605                                 && test -z "${cf_tst_cflags}" \
4606                                 && cf_fix_cppflags=yes
4607
4608                         if test "$cf_fix_cppflags" = yes ; then
4609
4610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4612
4613                                 continue
4614                         elif test "${cf_tst_cflags}" = "\"'" ; then
4615
4616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4618
4619                                 continue
4620                         fi
4621                         ;;
4622                 esac
4623                 case "$CPPFLAGS" in
4624                 (*$cf_add_cflags)
4625                         ;;
4626                 (*)
4627                         case "$cf_add_cflags" in
4628                         (-D*)
4629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4630
4631 CPPFLAGS=`echo "$CPPFLAGS" | \
4632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4634
4635                                 ;;
4636                         esac
4637
4638         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4639         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4640
4641                         ;;
4642                 esac
4643                 ;;
4644         (*)
4645
4646         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4647         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4648
4649                 ;;
4650         esac
4651         ;;
4652 (yes)
4653
4654         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4655         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4656
4657         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4658
4659         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4660                 && test -z "${cf_tst_cflags}" \
4661                 && cf_fix_cppflags=no
4662         ;;
4663 esac
4664 done
4665
4666 if test -n "$cf_new_cflags" ; then
4667
4668         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4669         CFLAGS="${CFLAGS}$cf_new_cflags"
4670
4671 fi
4672
4673 if test -n "$cf_new_cppflags" ; then
4674
4675         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4676         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4677
4678 fi
4679
4680 if test -n "$cf_new_extra_cppflags" ; then
4681
4682         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4683         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4684
4685 fi
4686
4687 cf_add_libs="$LIBS"
4688 # reverse order
4689 cf_add_0lib=
4690 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4691 # filter duplicates
4692 for cf_add_1lib in $cf_add_0lib; do
4693         for cf_add_2lib in $cf_add_libs; do
4694                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4695                         cf_add_1lib=
4696                         break
4697                 fi
4698         done
4699         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4700 done
4701 LIBS="$cf_add_libs"
4702
4703                         cat >"conftest.$ac_ext" <<_ACEOF
4704 #line 4704 "configure"
4705 #include "confdefs.h"
4706 #include <${cf_cv_ncurses_header:-curses.h}>
4707 int
4708 main (void)
4709 {
4710 initscr(); mousemask(0,0); tigetstr((char *)0);
4711   ;
4712   return 0;
4713 }
4714 _ACEOF
4715 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4716 if { (eval echo "$as_me:4716: \"$ac_link\"") >&5
4717   (eval $ac_link) 2>&5
4718   ac_status=$?
4719   echo "$as_me:4719: \$? = $ac_status" >&5
4720   (exit "$ac_status"); } &&
4721          { ac_try='test -s "conftest$ac_exeext"'
4722   { (eval echo "$as_me:4722: \"$ac_try\"") >&5
4723   (eval $ac_try) 2>&5
4724   ac_status=$?
4725   echo "$as_me:4725: \$? = $ac_status" >&5
4726   (exit "$ac_status"); }; }; then
4727   if test "$cross_compiling" = yes; then
4728   cf_test_ncuconfig=maybe
4729 else
4730   cat >"conftest.$ac_ext" <<_ACEOF
4731 #line 4731 "configure"
4732 #include "confdefs.h"
4733 #include <${cf_cv_ncurses_header:-curses.h}>
4734                                         int main(void)
4735                                         { const char *xx = curses_version(); return (xx == 0); }
4736 _ACEOF
4737 rm -f "conftest$ac_exeext"
4738 if { (eval echo "$as_me:4738: \"$ac_link\"") >&5
4739   (eval $ac_link) 2>&5
4740   ac_status=$?
4741   echo "$as_me:4741: \$? = $ac_status" >&5
4742   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4743   { (eval echo "$as_me:4743: \"$ac_try\"") >&5
4744   (eval $ac_try) 2>&5
4745   ac_status=$?
4746   echo "$as_me:4746: \$? = $ac_status" >&5
4747   (exit "$ac_status"); }; }; then
4748   cf_test_ncuconfig=yes
4749 else
4750   echo "$as_me: program exited with status $ac_status" >&5
4751 echo "$as_me: failed program was:" >&5
4752 cat "conftest.$ac_ext" >&5
4753 cf_test_ncuconfig=no
4754 fi
4755 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4756 fi
4757 else
4758   echo "$as_me: failed program was:" >&5
4759 cat "conftest.$ac_ext" >&5
4760 cf_test_ncuconfig=no
4761 fi
4762 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4763
4764                         CFLAGS="$cf_save_CFLAGS"
4765                         CPPFLAGS="$cf_save_CPPFLAGS"
4766                         LIBS="$cf_save_LIBS"
4767
4768                         if test "x$cf_test_ncuconfig" != xyes; then
4769                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4770                                 cf_pkg_cflags="$cf_temp"
4771                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4772                                 cf_pkg_libs="$cf_temp"
4773                         fi
4774                         ;;
4775                 esac
4776
4777 for cf_add_cflags in $cf_pkg_cflags
4778 do
4779         case "x$cf_add_cflags" in
4780         (x-[DU]*)
4781
4782 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4783 while true
4784 do
4785         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4786         test "$CFLAGS" != "$cf_old_cflag" || break
4787
4788         CFLAGS="$cf_old_cflag"
4789 done
4790
4791 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4792 while true
4793 do
4794         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4795         test "$CPPFLAGS" != "$cf_old_cflag" || break
4796
4797         CPPFLAGS="$cf_old_cflag"
4798 done
4799
4800                 ;;
4801         esac
4802
4803 cf_fix_cppflags=no
4804 cf_new_cflags=
4805 cf_new_cppflags=
4806 cf_new_extra_cppflags=
4807
4808 for cf_add_cflags in $cf_add_cflags
4809 do
4810 case "$cf_fix_cppflags" in
4811 (no)
4812         case "$cf_add_cflags" in
4813         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4814                 case "$cf_add_cflags" in
4815                 (-D*)
4816                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4817
4818                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4819                                 && test -z "${cf_tst_cflags}" \
4820                                 && cf_fix_cppflags=yes
4821
4822                         if test "$cf_fix_cppflags" = yes ; then
4823
4824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4826
4827                                 continue
4828                         elif test "${cf_tst_cflags}" = "\"'" ; then
4829
4830         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4831         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4832
4833                                 continue
4834                         fi
4835                         ;;
4836                 esac
4837                 case "$CPPFLAGS" in
4838                 (*$cf_add_cflags)
4839                         ;;
4840                 (*)
4841                         case "$cf_add_cflags" in
4842                         (-D*)
4843                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4844
4845 CPPFLAGS=`echo "$CPPFLAGS" | \
4846         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4847                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4848
4849                                 ;;
4850                         esac
4851
4852         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4853         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4854
4855                         ;;
4856                 esac
4857                 ;;
4858         (*)
4859
4860         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4861         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4862
4863                 ;;
4864         esac
4865         ;;
4866 (yes)
4867
4868         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4869         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4870
4871         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4872
4873         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4874                 && test -z "${cf_tst_cflags}" \
4875                 && cf_fix_cppflags=no
4876         ;;
4877 esac
4878 done
4879
4880 if test -n "$cf_new_cflags" ; then
4881
4882         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4883         CFLAGS="${CFLAGS}$cf_new_cflags"
4884
4885 fi
4886
4887 if test -n "$cf_new_cppflags" ; then
4888
4889         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4890         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4891
4892 fi
4893
4894 if test -n "$cf_new_extra_cppflags" ; then
4895
4896         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4897         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4898
4899 fi
4900
4901 done
4902
4903 cf_add_libs="$LIBS"
4904 # reverse order
4905 cf_add_0lib=
4906 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4907 # filter duplicates
4908 for cf_add_1lib in $cf_add_0lib; do
4909         for cf_add_2lib in $cf_add_libs; do
4910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4911                         cf_add_1lib=
4912                         break
4913                 fi
4914         done
4915         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4916 done
4917 LIBS="$cf_add_libs"
4918
4919                 cat >"conftest.$ac_ext" <<_ACEOF
4920 #line 4920 "configure"
4921 #include "confdefs.h"
4922 #include <${cf_cv_ncurses_header:-curses.h}>
4923 int
4924 main (void)
4925 {
4926 initscr(); mousemask(0,0); tigetstr((char *)0);
4927   ;
4928   return 0;
4929 }
4930 _ACEOF
4931 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4932 if { (eval echo "$as_me:4932: \"$ac_link\"") >&5
4933   (eval $ac_link) 2>&5
4934   ac_status=$?
4935   echo "$as_me:4935: \$? = $ac_status" >&5
4936   (exit "$ac_status"); } &&
4937          { ac_try='test -s "conftest$ac_exeext"'
4938   { (eval echo "$as_me:4938: \"$ac_try\"") >&5
4939   (eval $ac_try) 2>&5
4940   ac_status=$?
4941   echo "$as_me:4941: \$? = $ac_status" >&5
4942   (exit "$ac_status"); }; }; then
4943   if test "$cross_compiling" = yes; then
4944   cf_have_ncuconfig=maybe
4945 else
4946   cat >"conftest.$ac_ext" <<_ACEOF
4947 #line 4947 "configure"
4948 #include "confdefs.h"
4949 #include <${cf_cv_ncurses_header:-curses.h}>
4950                                 int main(void)
4951                                 { const char *xx = curses_version(); return (xx == 0); }
4952 _ACEOF
4953 rm -f "conftest$ac_exeext"
4954 if { (eval echo "$as_me:4954: \"$ac_link\"") >&5
4955   (eval $ac_link) 2>&5
4956   ac_status=$?
4957   echo "$as_me:4957: \$? = $ac_status" >&5
4958   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4959   { (eval echo "$as_me:4959: \"$ac_try\"") >&5
4960   (eval $ac_try) 2>&5
4961   ac_status=$?
4962   echo "$as_me:4962: \$? = $ac_status" >&5
4963   (exit "$ac_status"); }; }; then
4964   cf_have_ncuconfig=yes
4965 else
4966   echo "$as_me: program exited with status $ac_status" >&5
4967 echo "$as_me: failed program was:" >&5
4968 cat "conftest.$ac_ext" >&5
4969 cf_have_ncuconfig=no
4970 fi
4971 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4972 fi
4973 else
4974   echo "$as_me: failed program was:" >&5
4975 cat "conftest.$ac_ext" >&5
4976 cf_have_ncuconfig=no
4977 fi
4978 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4979                 echo "$as_me:4979: result: $cf_have_ncuconfig" >&5
4980 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4981                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4982                 if test "$cf_have_ncuconfig" != "yes"
4983                 then
4984                         CPPFLAGS="$cf_save_CPPFLAGS"
4985                         LIBS="$cf_save_LIBS"
4986                         NCURSES_CONFIG_PKG=none
4987                 else
4988
4989 cat >>confdefs.h <<\EOF
4990 #define NCURSES 1
4991 EOF
4992
4993                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4994
4995 echo "$as_me:4995: checking for terminfo header" >&5
4996 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4997 if test "${cf_cv_term_header+set}" = set; then
4998   echo $ECHO_N "(cached) $ECHO_C" >&6
4999 else
5000
5001 case "${cf_cv_ncurses_header}" in
5002 (*/ncurses.h|*/ncursesw.h)
5003         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5004         ;;
5005 (*)
5006         cf_term_header=term.h
5007         ;;
5008 esac
5009
5010 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5011 do
5012 cat >"conftest.$ac_ext" <<_ACEOF
5013 #line 5013 "configure"
5014 #include "confdefs.h"
5015 #include <stdio.h>
5016 #include <${cf_cv_ncurses_header:-curses.h}>
5017 #include <$cf_test>
5018
5019 int
5020 main (void)
5021 {
5022 int x = auto_left_margin; (void)x
5023   ;
5024   return 0;
5025 }
5026 _ACEOF
5027 rm -f "conftest.$ac_objext"
5028 if { (eval echo "$as_me:5028: \"$ac_compile\"") >&5
5029   (eval $ac_compile) 2>&5
5030   ac_status=$?
5031   echo "$as_me:5031: \$? = $ac_status" >&5
5032   (exit "$ac_status"); } &&
5033          { ac_try='test -s "conftest.$ac_objext"'
5034   { (eval echo "$as_me:5034: \"$ac_try\"") >&5
5035   (eval $ac_try) 2>&5
5036   ac_status=$?
5037   echo "$as_me:5037: \$? = $ac_status" >&5
5038   (exit "$ac_status"); }; }; then
5039
5040         cf_cv_term_header="$cf_test"
5041 else
5042   echo "$as_me: failed program was:" >&5
5043 cat "conftest.$ac_ext" >&5
5044
5045         cf_cv_term_header=unknown
5046
5047 fi
5048 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5049         test "$cf_cv_term_header" != unknown && break
5050 done
5051
5052 fi
5053 echo "$as_me:5053: result: $cf_cv_term_header" >&5
5054 echo "${ECHO_T}$cf_cv_term_header" >&6
5055
5056 # Set definitions to allow ifdef'ing to accommodate subdirectories
5057
5058 case "$cf_cv_term_header" in
5059 (*term.h)
5060
5061 cat >>confdefs.h <<\EOF
5062 #define HAVE_TERM_H 1
5063 EOF
5064
5065         ;;
5066 esac
5067
5068 case "$cf_cv_term_header" in
5069 (ncurses/term.h)
5070
5071 cat >>confdefs.h <<\EOF
5072 #define HAVE_NCURSES_TERM_H 1
5073 EOF
5074
5075         ;;
5076 (ncursesw/term.h)
5077
5078 cat >>confdefs.h <<\EOF
5079 #define HAVE_NCURSESW_TERM_H 1
5080 EOF
5081
5082         ;;
5083 esac
5084
5085                 fi
5086
5087         else
5088                 echo "$as_me:5088: result: no" >&5
5089 echo "${ECHO_T}no" >&6
5090                 NCURSES_CONFIG_PKG=none
5091         fi
5092 else
5093         NCURSES_CONFIG_PKG=none
5094 fi
5095
5096 if test "x$cf_have_ncuconfig" = "xno"; then
5097         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5098
5099 if test -n "$ac_tool_prefix"; then
5100   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5101   do
5102     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5103 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5104 echo "$as_me:5104: checking for $ac_word" >&5
5105 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5106 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5107   echo $ECHO_N "(cached) $ECHO_C" >&6
5108 else
5109   if test -n "$NCURSES_CONFIG"; then
5110   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5111 else
5112   ac_save_IFS=$IFS; IFS=$ac_path_separator
5113 ac_dummy="$PATH"
5114 for ac_dir in $ac_dummy; do
5115   IFS=$ac_save_IFS
5116   test -z "$ac_dir" && ac_dir=.
5117   $as_executable_p "$ac_dir/$ac_word" || continue
5118 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5119 echo "$as_me:5119: found $ac_dir/$ac_word" >&5
5120 break
5121 done
5122
5123 fi
5124 fi
5125 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5126 if test -n "$NCURSES_CONFIG"; then
5127   echo "$as_me:5127: result: $NCURSES_CONFIG" >&5
5128 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5129 else
5130   echo "$as_me:5130: result: no" >&5
5131 echo "${ECHO_T}no" >&6
5132 fi
5133
5134     test -n "$NCURSES_CONFIG" && break
5135   done
5136 fi
5137 if test -z "$NCURSES_CONFIG"; then
5138   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5139   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5140 do
5141   # Extract the first word of "$ac_prog", so it can be a program name with args.
5142 set dummy $ac_prog; ac_word=$2
5143 echo "$as_me:5143: checking for $ac_word" >&5
5144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5145 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5146   echo $ECHO_N "(cached) $ECHO_C" >&6
5147 else
5148   if test -n "$ac_ct_NCURSES_CONFIG"; then
5149   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5150 else
5151   ac_save_IFS=$IFS; IFS=$ac_path_separator
5152 ac_dummy="$PATH"
5153 for ac_dir in $ac_dummy; do
5154   IFS=$ac_save_IFS
5155   test -z "$ac_dir" && ac_dir=.
5156   $as_executable_p "$ac_dir/$ac_word" || continue
5157 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5158 echo "$as_me:5158: found $ac_dir/$ac_word" >&5
5159 break
5160 done
5161
5162 fi
5163 fi
5164 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5165 if test -n "$ac_ct_NCURSES_CONFIG"; then
5166   echo "$as_me:5166: result: $ac_ct_NCURSES_CONFIG" >&5
5167 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5168 else
5169   echo "$as_me:5169: result: no" >&5
5170 echo "${ECHO_T}no" >&6
5171 fi
5172
5173   test -n "$ac_ct_NCURSES_CONFIG" && break
5174 done
5175 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5176
5177   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5178 fi
5179
5180         if test "$NCURSES_CONFIG" != none ; then
5181
5182 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5183 do
5184         case "x$cf_add_cflags" in
5185         (x-[DU]*)
5186
5187 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5188 while true
5189 do
5190         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5191         test "$CFLAGS" != "$cf_old_cflag" || break
5192
5193         CFLAGS="$cf_old_cflag"
5194 done
5195
5196 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5197 while true
5198 do
5199         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5200         test "$CPPFLAGS" != "$cf_old_cflag" || break
5201
5202         CPPFLAGS="$cf_old_cflag"
5203 done
5204
5205                 ;;
5206         esac
5207
5208 cf_fix_cppflags=no
5209 cf_new_cflags=
5210 cf_new_cppflags=
5211 cf_new_extra_cppflags=
5212
5213 for cf_add_cflags in $cf_add_cflags
5214 do
5215 case "$cf_fix_cppflags" in
5216 (no)
5217         case "$cf_add_cflags" in
5218         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5219                 case "$cf_add_cflags" in
5220                 (-D*)
5221                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5222
5223                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5224                                 && test -z "${cf_tst_cflags}" \
5225                                 && cf_fix_cppflags=yes
5226
5227                         if test "$cf_fix_cppflags" = yes ; then
5228
5229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5231
5232                                 continue
5233                         elif test "${cf_tst_cflags}" = "\"'" ; then
5234
5235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5237
5238                                 continue
5239                         fi
5240                         ;;
5241                 esac
5242                 case "$CPPFLAGS" in
5243                 (*$cf_add_cflags)
5244                         ;;
5245                 (*)
5246                         case "$cf_add_cflags" in
5247                         (-D*)
5248                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5249
5250 CPPFLAGS=`echo "$CPPFLAGS" | \
5251         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5252                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5253
5254                                 ;;
5255                         esac
5256
5257         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5258         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5259
5260                         ;;
5261                 esac
5262                 ;;
5263         (*)
5264
5265         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5266         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5267
5268                 ;;
5269         esac
5270         ;;
5271 (yes)
5272
5273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5275
5276         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5277
5278         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5279                 && test -z "${cf_tst_cflags}" \
5280                 && cf_fix_cppflags=no
5281         ;;
5282 esac
5283 done
5284
5285 if test -n "$cf_new_cflags" ; then
5286
5287         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5288         CFLAGS="${CFLAGS}$cf_new_cflags"
5289
5290 fi
5291
5292 if test -n "$cf_new_cppflags" ; then
5293
5294         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5295         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5296
5297 fi
5298
5299 if test -n "$cf_new_extra_cppflags" ; then
5300
5301         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5302         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5303
5304 fi
5305
5306 done
5307
5308 cf_add_libs="$LIBS"
5309 # reverse order
5310 cf_add_0lib=
5311 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5312 # filter duplicates
5313 for cf_add_1lib in $cf_add_0lib; do
5314         for cf_add_2lib in $cf_add_libs; do
5315                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5316                         cf_add_1lib=
5317                         break
5318                 fi
5319         done
5320         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5321 done
5322 LIBS="$cf_add_libs"
5323
5324                 # even with config script, some packages use no-override for curses.h
5325
5326 echo "$as_me:5326: checking if we have identified curses headers" >&5
5327 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5328 if test "${cf_cv_ncurses_header+set}" = set; then
5329   echo $ECHO_N "(cached) $ECHO_C" >&6
5330 else
5331
5332 cf_cv_ncurses_header=none
5333 for cf_header in \
5334         ncurses.h ncurses/ncurses.h \
5335         curses.h ncurses/curses.h
5336 do
5337 cat >"conftest.$ac_ext" <<_ACEOF
5338 #line 5338 "configure"
5339 #include "confdefs.h"
5340 #include <${cf_header}>
5341 int
5342 main (void)
5343 {
5344 initscr(); tgoto("?", 0,0)
5345   ;
5346   return 0;
5347 }
5348 _ACEOF
5349 rm -f "conftest.$ac_objext"
5350 if { (eval echo "$as_me:5350: \"$ac_compile\"") >&5
5351   (eval $ac_compile) 2>&5
5352   ac_status=$?
5353   echo "$as_me:5353: \$? = $ac_status" >&5
5354   (exit "$ac_status"); } &&
5355          { ac_try='test -s "conftest.$ac_objext"'
5356   { (eval echo "$as_me:5356: \"$ac_try\"") >&5
5357   (eval $ac_try) 2>&5
5358   ac_status=$?
5359   echo "$as_me:5359: \$? = $ac_status" >&5
5360   (exit "$ac_status"); }; }; then
5361   cf_cv_ncurses_header=$cf_header; break
5362 else
5363   echo "$as_me: failed program was:" >&5
5364 cat "conftest.$ac_ext" >&5
5365 fi
5366 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5367 done
5368
5369 fi
5370 echo "$as_me:5370: result: $cf_cv_ncurses_header" >&5
5371 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5372
5373 if test "$cf_cv_ncurses_header" = none ; then
5374         { { echo "$as_me:5374: error: No curses header-files found" >&5
5375 echo "$as_me: error: No curses header-files found" >&2;}
5376    { (exit 1); exit 1; }; }
5377 fi
5378
5379 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5380
5381 for ac_header in $cf_cv_ncurses_header
5382 do
5383 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5384 echo "$as_me:5384: checking for $ac_header" >&5
5385 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5386 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5387   echo $ECHO_N "(cached) $ECHO_C" >&6
5388 else
5389   cat >"conftest.$ac_ext" <<_ACEOF
5390 #line 5390 "configure"
5391 #include "confdefs.h"
5392 #include <$ac_header>
5393 _ACEOF
5394 if { (eval echo "$as_me:5394: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5395   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5396   ac_status=$?
5397   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5398   rm -f conftest.er1
5399   cat conftest.err >&5
5400   echo "$as_me:5400: \$? = $ac_status" >&5
5401   (exit "$ac_status"); } >/dev/null; then
5402   if test -s conftest.err; then
5403     ac_cpp_err=$ac_c_preproc_warn_flag
5404   else
5405     ac_cpp_err=
5406   fi
5407 else
5408   ac_cpp_err=yes
5409 fi
5410 if test -z "$ac_cpp_err"; then
5411   eval "$as_ac_Header=yes"
5412 else
5413   echo "$as_me: failed program was:" >&5
5414   cat "conftest.$ac_ext" >&5
5415   eval "$as_ac_Header=no"
5416 fi
5417 rm -f conftest.err "conftest.$ac_ext"
5418 fi
5419 echo "$as_me:5419: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5420 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5421 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5422   cat >>confdefs.h <<EOF
5423 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5424 EOF
5425
5426 fi
5427 done
5428
5429 cat >>confdefs.h <<\EOF
5430 #define NCURSES 1
5431 EOF
5432
5433 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5434
5435                 cat >>confdefs.h <<EOF
5436 #define $cf_nculib_ROOT 1
5437 EOF
5438
5439                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5440
5441         else
5442
5443 cf_ncuhdr_root=ncurses
5444
5445 test -n "$cf_cv_curses_dir" && \
5446 test "$cf_cv_curses_dir" != "no" && { \
5447
5448 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5449   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5450   do
5451         while test "$cf_add_incdir" != /usr/include
5452         do
5453           if test -d "$cf_add_incdir"
5454           then
5455                 cf_have_incdir=no
5456                 if test -n "$CFLAGS$CPPFLAGS" ; then
5457                   # a loop is needed to ensure we can add subdirs of existing dirs
5458                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5459                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5460                           cf_have_incdir=yes; break
5461                         fi
5462                   done
5463                 fi
5464
5465                 if test "$cf_have_incdir" = no ; then
5466                   if test "$cf_add_incdir" = /usr/local/include ; then
5467                         if test "$GCC" = yes
5468                         then
5469                           cf_save_CPPFLAGS=$CPPFLAGS
5470
5471         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5472         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5473
5474                           cat >"conftest.$ac_ext" <<_ACEOF
5475 #line 5475 "configure"
5476 #include "confdefs.h"
5477 #include <stdio.h>
5478 int
5479 main (void)
5480 {
5481 printf("Hello")
5482   ;
5483   return 0;
5484 }
5485 _ACEOF
5486 rm -f "conftest.$ac_objext"
5487 if { (eval echo "$as_me:5487: \"$ac_compile\"") >&5
5488   (eval $ac_compile) 2>&5
5489   ac_status=$?
5490   echo "$as_me:5490: \$? = $ac_status" >&5
5491   (exit "$ac_status"); } &&
5492          { ac_try='test -s "conftest.$ac_objext"'
5493   { (eval echo "$as_me:5493: \"$ac_try\"") >&5
5494   (eval $ac_try) 2>&5
5495   ac_status=$?
5496   echo "$as_me:5496: \$? = $ac_status" >&5
5497   (exit "$ac_status"); }; }; then
5498   :
5499 else
5500   echo "$as_me: failed program was:" >&5
5501 cat "conftest.$ac_ext" >&5
5502 cf_have_incdir=yes
5503 fi
5504 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5505                           CPPFLAGS=$cf_save_CPPFLAGS
5506                         fi
5507                   fi
5508                 fi
5509
5510                 if test "$cf_have_incdir" = no ; then
5511                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5512
5513 echo "${as_me:-configure}:5513: testing adding $cf_add_incdir to include-path ..." 1>&5
5514
5515                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5516
5517                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5518                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5519                   cf_add_incdir="$cf_top_incdir"
5520                 else
5521                   break
5522                 fi
5523           else
5524                 break
5525           fi
5526         done
5527   done
5528 fi
5529
5530 }
5531
5532 echo "$as_me:5532: checking for $cf_ncuhdr_root header in include-path" >&5
5533 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5534 if test "${cf_cv_ncurses_h+set}" = set; then
5535   echo $ECHO_N "(cached) $ECHO_C" >&6
5536 else
5537
5538         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5539         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5540         for cf_header in $cf_header_list
5541         do
5542
5543         cat >"conftest.$ac_ext" <<_ACEOF
5544 #line 5544 "configure"
5545 #include "confdefs.h"
5546
5547 #include <$cf_header>
5548 int
5549 main (void)
5550 {
5551
5552 #ifdef NCURSES_VERSION
5553
5554 printf("%s\\n", NCURSES_VERSION);
5555 #else
5556 #ifdef __NCURSES_H
5557 printf("old\\n");
5558 #else
5559         make an error
5560 #endif
5561 #endif
5562
5563   ;
5564   return 0;
5565 }
5566 _ACEOF
5567 rm -f "conftest.$ac_objext"
5568 if { (eval echo "$as_me:5568: \"$ac_compile\"") >&5
5569   (eval $ac_compile) 2>&5
5570   ac_status=$?
5571   echo "$as_me:5571: \$? = $ac_status" >&5
5572   (exit "$ac_status"); } &&
5573          { ac_try='test -s "conftest.$ac_objext"'
5574   { (eval echo "$as_me:5574: \"$ac_try\"") >&5
5575   (eval $ac_try) 2>&5
5576   ac_status=$?
5577   echo "$as_me:5577: \$? = $ac_status" >&5
5578   (exit "$ac_status"); }; }; then
5579   cf_cv_ncurses_h=$cf_header
5580
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat "conftest.$ac_ext" >&5
5584 cf_cv_ncurses_h=no
5585 fi
5586 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5587
5588                 test "$cf_cv_ncurses_h" != no && break
5589         done
5590
5591 fi
5592 echo "$as_me:5592: result: $cf_cv_ncurses_h" >&5
5593 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5594
5595 if test "$cf_cv_ncurses_h" != no ; then
5596         cf_cv_ncurses_header=$cf_cv_ncurses_h
5597 else
5598
5599 echo "$as_me:5599: checking for $cf_ncuhdr_root include-path" >&5
5600 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5601 if test "${cf_cv_ncurses_h2+set}" = set; then
5602   echo $ECHO_N "(cached) $ECHO_C" >&6
5603 else
5604
5605         test -n "$verbose" && echo
5606
5607 cf_search=
5608
5609 # collect the current set of include-directories from compiler flags
5610 cf_header_path_list=""
5611 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5612         for cf_header_path in $CPPFLAGS $CFLAGS
5613         do
5614                 case "$cf_header_path" in
5615                 (-I*)
5616                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5617
5618 test "x$cf_header_path" != "xNONE" && \
5619 test -d "$cf_header_path" && \
5620  {
5621         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5622         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5623         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5624         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5625         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5626         test -d "$cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5627 }
5628
5629                         cf_header_path_list="$cf_header_path_list $cf_search"
5630                         ;;
5631                 esac
5632         done
5633 fi
5634
5635 # add the variations for the package we are looking for
5636
5637 cf_search=
5638
5639 test "x$prefix" != "xNONE" && \
5640 test -d "$prefix" && \
5641  {
5642         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5643         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5644         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5645         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5646         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5647         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5648 }
5649
5650 for cf_subdir_prefix in \
5651         /usr \
5652         /usr/local \
5653         /usr/pkg \
5654         /opt \
5655         /opt/local \
5656         $HOME
5657 do
5658
5659 test "x$cf_subdir_prefix" != "x$prefix" && \
5660 test -d "$cf_subdir_prefix" && \
5661 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5662         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5663         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5664         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5665         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5666         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5667         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5668 }
5669
5670 done
5671
5672 test "$includedir" != NONE && \
5673 test "$includedir" != "/usr/include" && \
5674 test -d "$includedir" && {
5675         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5676         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5677 }
5678
5679 test "$oldincludedir" != NONE && \
5680 test "$oldincludedir" != "/usr/include" && \
5681 test -d "$oldincludedir" && {
5682         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5683         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5684 }
5685
5686 cf_search="$cf_search $cf_header_path_list"
5687
5688         test -n "$verbose" && echo "search path $cf_search"
5689         cf_save2_CPPFLAGS="$CPPFLAGS"
5690         for cf_incdir in $cf_search
5691         do
5692
5693 if test -n "$cf_incdir" ; then
5694   for cf_add_incdir in $cf_incdir
5695   do
5696         while test "$cf_add_incdir" != /usr/include
5697         do
5698           if test -d "$cf_add_incdir"
5699           then
5700                 cf_have_incdir=no
5701                 if test -n "$CFLAGS$CPPFLAGS" ; then
5702                   # a loop is needed to ensure we can add subdirs of existing dirs
5703                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5704                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5705                           cf_have_incdir=yes; break
5706                         fi
5707                   done
5708                 fi
5709
5710                 if test "$cf_have_incdir" = no ; then
5711                   if test "$cf_add_incdir" = /usr/local/include ; then
5712                         if test "$GCC" = yes
5713                         then
5714                           cf_save_CPPFLAGS=$CPPFLAGS
5715
5716         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5717         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5718
5719                           cat >"conftest.$ac_ext" <<_ACEOF
5720 #line 5720 "configure"
5721 #include "confdefs.h"
5722 #include <stdio.h>
5723 int
5724 main (void)
5725 {
5726 printf("Hello")
5727   ;
5728   return 0;
5729 }
5730 _ACEOF
5731 rm -f "conftest.$ac_objext"
5732 if { (eval echo "$as_me:5732: \"$ac_compile\"") >&5
5733   (eval $ac_compile) 2>&5
5734   ac_status=$?
5735   echo "$as_me:5735: \$? = $ac_status" >&5
5736   (exit "$ac_status"); } &&
5737          { ac_try='test -s "conftest.$ac_objext"'
5738   { (eval echo "$as_me:5738: \"$ac_try\"") >&5
5739   (eval $ac_try) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit "$ac_status"); }; }; then
5743   :
5744 else
5745   echo "$as_me: failed program was:" >&5
5746 cat "conftest.$ac_ext" >&5
5747 cf_have_incdir=yes
5748 fi
5749 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5750                           CPPFLAGS=$cf_save_CPPFLAGS
5751                         fi
5752                   fi
5753                 fi
5754
5755                 if test "$cf_have_incdir" = no ; then
5756                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5757
5758 echo "${as_me:-configure}:5758: testing adding $cf_add_incdir to include-path ..." 1>&5
5759
5760                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5761
5762                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5763                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5764                   cf_add_incdir="$cf_top_incdir"
5765                 else
5766                   break
5767                 fi
5768           else
5769                 break
5770           fi
5771         done
5772   done
5773 fi
5774
5775                 for cf_header in \
5776                         ncurses.h \
5777                         curses.h
5778                 do
5779
5780         cat >"conftest.$ac_ext" <<_ACEOF
5781 #line 5781 "configure"
5782 #include "confdefs.h"
5783
5784 #include <$cf_header>
5785 int
5786 main (void)
5787 {
5788
5789 #ifdef NCURSES_VERSION
5790
5791 printf("%s\\n", NCURSES_VERSION);
5792 #else
5793 #ifdef __NCURSES_H
5794 printf("old\\n");
5795 #else
5796         make an error
5797 #endif
5798 #endif
5799
5800   ;
5801   return 0;
5802 }
5803 _ACEOF
5804 rm -f "conftest.$ac_objext"
5805 if { (eval echo "$as_me:5805: \"$ac_compile\"") >&5
5806   (eval $ac_compile) 2>&5
5807   ac_status=$?
5808   echo "$as_me:5808: \$? = $ac_status" >&5
5809   (exit "$ac_status"); } &&
5810          { ac_try='test -s "conftest.$ac_objext"'
5811   { (eval echo "$as_me:5811: \"$ac_try\"") >&5
5812   (eval $ac_try) 2>&5
5813   ac_status=$?
5814   echo "$as_me:5814: \$? = $ac_status" >&5
5815   (exit "$ac_status"); }; }; then
5816   cf_cv_ncurses_h2=$cf_header
5817
5818 else
5819   echo "$as_me: failed program was:" >&5
5820 cat "conftest.$ac_ext" >&5
5821 cf_cv_ncurses_h2=no
5822 fi
5823 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5824
5825                         if test "$cf_cv_ncurses_h2" != no ; then
5826                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5827                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5828                                 break
5829                         fi
5830                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5831                 done
5832                 CPPFLAGS="$cf_save2_CPPFLAGS"
5833                 test "$cf_cv_ncurses_h2" != no && break
5834         done
5835         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5835: error: not found" >&5
5836 echo "$as_me: error: not found" >&2;}
5837    { (exit 1); exit 1; }; }
5838
5839 fi
5840 echo "$as_me:5840: result: $cf_cv_ncurses_h2" >&5
5841 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5842
5843         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5844         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5845         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5846                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5847         fi
5848
5849 if test -n "$cf_1st_incdir" ; then
5850   for cf_add_incdir in $cf_1st_incdir
5851   do
5852         while test "$cf_add_incdir" != /usr/include
5853         do
5854           if test -d "$cf_add_incdir"
5855           then
5856                 cf_have_incdir=no
5857                 if test -n "$CFLAGS$CPPFLAGS" ; then
5858                   # a loop is needed to ensure we can add subdirs of existing dirs
5859                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5860                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5861                           cf_have_incdir=yes; break
5862                         fi
5863                   done
5864                 fi
5865
5866                 if test "$cf_have_incdir" = no ; then
5867                   if test "$cf_add_incdir" = /usr/local/include ; then
5868                         if test "$GCC" = yes
5869                         then
5870                           cf_save_CPPFLAGS=$CPPFLAGS
5871
5872         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5873         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5874
5875                           cat >"conftest.$ac_ext" <<_ACEOF
5876 #line 5876 "configure"
5877 #include "confdefs.h"
5878 #include <stdio.h>
5879 int
5880 main (void)
5881 {
5882 printf("Hello")
5883   ;
5884   return 0;
5885 }
5886 _ACEOF
5887 rm -f "conftest.$ac_objext"
5888 if { (eval echo "$as_me:5888: \"$ac_compile\"") >&5
5889   (eval $ac_compile) 2>&5
5890   ac_status=$?
5891   echo "$as_me:5891: \$? = $ac_status" >&5
5892   (exit "$ac_status"); } &&
5893          { ac_try='test -s "conftest.$ac_objext"'
5894   { (eval echo "$as_me:5894: \"$ac_try\"") >&5
5895   (eval $ac_try) 2>&5
5896   ac_status=$?
5897   echo "$as_me:5897: \$? = $ac_status" >&5
5898   (exit "$ac_status"); }; }; then
5899   :
5900 else
5901   echo "$as_me: failed program was:" >&5
5902 cat "conftest.$ac_ext" >&5
5903 cf_have_incdir=yes
5904 fi
5905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5906                           CPPFLAGS=$cf_save_CPPFLAGS
5907                         fi
5908                   fi
5909                 fi
5910
5911                 if test "$cf_have_incdir" = no ; then
5912                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5913
5914 echo "${as_me:-configure}:5914: testing adding $cf_add_incdir to include-path ..." 1>&5
5915
5916                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5917
5918                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5919                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5920                   cf_add_incdir="$cf_top_incdir"
5921                 else
5922                   break
5923                 fi
5924           else
5925                 break
5926           fi
5927         done
5928   done
5929 fi
5930
5931 fi
5932
5933 # Set definitions to allow ifdef'ing for ncurses.h
5934
5935 case "$cf_cv_ncurses_header" in
5936 (*ncurses.h)
5937
5938 cat >>confdefs.h <<\EOF
5939 #define HAVE_NCURSES_H 1
5940 EOF
5941
5942         ;;
5943 esac
5944
5945 case "$cf_cv_ncurses_header" in
5946 (ncurses/curses.h|ncurses/ncurses.h)
5947
5948 cat >>confdefs.h <<\EOF
5949 #define HAVE_NCURSES_NCURSES_H 1
5950 EOF
5951
5952         ;;
5953 (ncursesw/curses.h|ncursesw/ncurses.h)
5954
5955 cat >>confdefs.h <<\EOF
5956 #define HAVE_NCURSESW_NCURSES_H 1
5957 EOF
5958
5959         ;;
5960 esac
5961
5962 echo "$as_me:5962: checking for terminfo header" >&5
5963 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5964 if test "${cf_cv_term_header+set}" = set; then
5965   echo $ECHO_N "(cached) $ECHO_C" >&6
5966 else
5967
5968 case "${cf_cv_ncurses_header}" in
5969 (*/ncurses.h|*/ncursesw.h)
5970         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5971         ;;
5972 (*)
5973         cf_term_header=term.h
5974         ;;
5975 esac
5976
5977 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5978 do
5979 cat >"conftest.$ac_ext" <<_ACEOF
5980 #line 5980 "configure"
5981 #include "confdefs.h"
5982 #include <stdio.h>
5983 #include <${cf_cv_ncurses_header:-curses.h}>
5984 #include <$cf_test>
5985
5986 int
5987 main (void)
5988 {
5989 int x = auto_left_margin; (void)x
5990   ;
5991   return 0;
5992 }
5993 _ACEOF
5994 rm -f "conftest.$ac_objext"
5995 if { (eval echo "$as_me:5995: \"$ac_compile\"") >&5
5996   (eval $ac_compile) 2>&5
5997   ac_status=$?
5998   echo "$as_me:5998: \$? = $ac_status" >&5
5999   (exit "$ac_status"); } &&
6000          { ac_try='test -s "conftest.$ac_objext"'
6001   { (eval echo "$as_me:6001: \"$ac_try\"") >&5
6002   (eval $ac_try) 2>&5
6003   ac_status=$?
6004   echo "$as_me:6004: \$? = $ac_status" >&5
6005   (exit "$ac_status"); }; }; then
6006
6007         cf_cv_term_header="$cf_test"
6008 else
6009   echo "$as_me: failed program was:" >&5
6010 cat "conftest.$ac_ext" >&5
6011
6012         cf_cv_term_header=unknown
6013
6014 fi
6015 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6016         test "$cf_cv_term_header" != unknown && break
6017 done
6018
6019 fi
6020 echo "$as_me:6020: result: $cf_cv_term_header" >&5
6021 echo "${ECHO_T}$cf_cv_term_header" >&6
6022
6023 # Set definitions to allow ifdef'ing to accommodate subdirectories
6024
6025 case "$cf_cv_term_header" in
6026 (*term.h)
6027
6028 cat >>confdefs.h <<\EOF
6029 #define HAVE_TERM_H 1
6030 EOF
6031
6032         ;;
6033 esac
6034
6035 case "$cf_cv_term_header" in
6036 (ncurses/term.h)
6037
6038 cat >>confdefs.h <<\EOF
6039 #define HAVE_NCURSES_TERM_H 1
6040 EOF
6041
6042         ;;
6043 (ncursesw/term.h)
6044
6045 cat >>confdefs.h <<\EOF
6046 #define HAVE_NCURSESW_TERM_H 1
6047 EOF
6048
6049         ;;
6050 esac
6051
6052 # some applications need this, but should check for NCURSES_VERSION
6053
6054 cat >>confdefs.h <<\EOF
6055 #define NCURSES 1
6056 EOF
6057
6058 echo "$as_me:6058: checking for ncurses version" >&5
6059 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6060 if test "${cf_cv_ncurses_version+set}" = set; then
6061   echo $ECHO_N "(cached) $ECHO_C" >&6
6062 else
6063
6064         cf_cv_ncurses_version=no
6065         cf_tempfile=out$$
6066         rm -f "$cf_tempfile"
6067         if test "$cross_compiling" = yes; then
6068
6069         # This will not work if the preprocessor splits the line after the
6070         # Autoconf token.  The 'unproto' program does that.
6071         cat > "conftest.$ac_ext" <<EOF
6072 #include <${cf_cv_ncurses_header:-curses.h}>
6073 #undef Autoconf
6074 #ifdef NCURSES_VERSION
6075 Autoconf NCURSES_VERSION
6076 #else
6077 #ifdef __NCURSES_H
6078 Autoconf "old"
6079 #endif
6080 ;
6081 #endif
6082 EOF
6083         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6084         { (eval echo "$as_me:6084: \"$cf_try\"") >&5
6085   (eval $cf_try) 2>&5
6086   ac_status=$?
6087   echo "$as_me:6087: \$? = $ac_status" >&5
6088   (exit "$ac_status"); }
6089         if test -f conftest.out ; then
6090                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6091                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6092                 rm -f conftest.out
6093         fi
6094
6095 else
6096   cat >"conftest.$ac_ext" <<_ACEOF
6097 #line 6097 "configure"
6098 #include "confdefs.h"
6099
6100 #include <${cf_cv_ncurses_header:-curses.h}>
6101 #include <stdio.h>
6102 int main(void)
6103 {
6104         FILE *fp = fopen("$cf_tempfile", "w");
6105 #ifdef NCURSES_VERSION
6106 # ifdef NCURSES_VERSION_PATCH
6107         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6108 # else
6109         fprintf(fp, "%s\\n", NCURSES_VERSION);
6110 # endif
6111 #else
6112 # ifdef __NCURSES_H
6113         fprintf(fp, "old\\n");
6114 # else
6115         make an error
6116 # endif
6117 #endif
6118         ${cf_cv_main_return:-return}(0);
6119 }
6120 _ACEOF
6121 rm -f "conftest$ac_exeext"
6122 if { (eval echo "$as_me:6122: \"$ac_link\"") >&5
6123   (eval $ac_link) 2>&5
6124   ac_status=$?
6125   echo "$as_me:6125: \$? = $ac_status" >&5
6126   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6127   { (eval echo "$as_me:6127: \"$ac_try\"") >&5
6128   (eval $ac_try) 2>&5
6129   ac_status=$?
6130   echo "$as_me:6130: \$? = $ac_status" >&5
6131   (exit "$ac_status"); }; }; then
6132
6133         cf_cv_ncurses_version=`cat $cf_tempfile`
6134 else
6135   echo "$as_me: program exited with status $ac_status" >&5
6136 echo "$as_me: failed program was:" >&5
6137 cat "conftest.$ac_ext" >&5
6138 fi
6139 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6140 fi
6141         rm -f "$cf_tempfile"
6142
6143 fi
6144 echo "$as_me:6144: result: $cf_cv_ncurses_version" >&5
6145 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6146 test "$cf_cv_ncurses_version" = no ||
6147 cat >>confdefs.h <<\EOF
6148 #define NCURSES 1
6149 EOF
6150
6151 cf_nculib_root=ncurses
6152         # This works, except for the special case where we find gpm, but
6153         # ncurses is in a nonstandard location via $LIBS, and we really want
6154         # to link gpm.
6155 cf_ncurses_LIBS=""
6156 cf_ncurses_SAVE="$LIBS"
6157 echo "$as_me:6157: checking for Gpm_Open in -lgpm" >&5
6158 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6159 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6160   echo $ECHO_N "(cached) $ECHO_C" >&6
6161 else
6162   ac_check_lib_save_LIBS=$LIBS
6163 LIBS="-lgpm  $LIBS"
6164 cat >"conftest.$ac_ext" <<_ACEOF
6165 #line 6165 "configure"
6166 #include "confdefs.h"
6167
6168 /* Override any gcc2 internal prototype to avoid an error.  */
6169 #ifdef __cplusplus
6170 extern "C"
6171 #endif
6172 /* We use char because int might match the return type of a gcc2
6173    builtin and then its argument prototype would still apply.  */
6174 char Gpm_Open ();
6175 int
6176 main (void)
6177 {
6178 Gpm_Open ();
6179   ;
6180   return 0;
6181 }
6182 _ACEOF
6183 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6184 if { (eval echo "$as_me:6184: \"$ac_link\"") >&5
6185   (eval $ac_link) 2>&5
6186   ac_status=$?
6187   echo "$as_me:6187: \$? = $ac_status" >&5
6188   (exit "$ac_status"); } &&
6189          { ac_try='test -s "conftest$ac_exeext"'
6190   { (eval echo "$as_me:6190: \"$ac_try\"") >&5
6191   (eval $ac_try) 2>&5
6192   ac_status=$?
6193   echo "$as_me:6193: \$? = $ac_status" >&5
6194   (exit "$ac_status"); }; }; then
6195   ac_cv_lib_gpm_Gpm_Open=yes
6196 else
6197   echo "$as_me: failed program was:" >&5
6198 cat "conftest.$ac_ext" >&5
6199 ac_cv_lib_gpm_Gpm_Open=no
6200 fi
6201 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6202 LIBS=$ac_check_lib_save_LIBS
6203 fi
6204 echo "$as_me:6204: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6205 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6206 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6207   echo "$as_me:6207: checking for initscr in -lgpm" >&5
6208 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6209 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6210   echo $ECHO_N "(cached) $ECHO_C" >&6
6211 else
6212   ac_check_lib_save_LIBS=$LIBS
6213 LIBS="-lgpm  $LIBS"
6214 cat >"conftest.$ac_ext" <<_ACEOF
6215 #line 6215 "configure"
6216 #include "confdefs.h"
6217
6218 /* Override any gcc2 internal prototype to avoid an error.  */
6219 #ifdef __cplusplus
6220 extern "C"
6221 #endif
6222 /* We use char because int might match the return type of a gcc2
6223    builtin and then its argument prototype would still apply.  */
6224 char initscr ();
6225 int
6226 main (void)
6227 {
6228 initscr ();
6229   ;
6230   return 0;
6231 }
6232 _ACEOF
6233 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6234 if { (eval echo "$as_me:6234: \"$ac_link\"") >&5
6235   (eval $ac_link) 2>&5
6236   ac_status=$?
6237   echo "$as_me:6237: \$? = $ac_status" >&5
6238   (exit "$ac_status"); } &&
6239          { ac_try='test -s "conftest$ac_exeext"'
6240   { (eval echo "$as_me:6240: \"$ac_try\"") >&5
6241   (eval $ac_try) 2>&5
6242   ac_status=$?
6243   echo "$as_me:6243: \$? = $ac_status" >&5
6244   (exit "$ac_status"); }; }; then
6245   ac_cv_lib_gpm_initscr=yes
6246 else
6247   echo "$as_me: failed program was:" >&5
6248 cat "conftest.$ac_ext" >&5
6249 ac_cv_lib_gpm_initscr=no
6250 fi
6251 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6252 LIBS=$ac_check_lib_save_LIBS
6253 fi
6254 echo "$as_me:6254: result: $ac_cv_lib_gpm_initscr" >&5
6255 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6256 if test "$ac_cv_lib_gpm_initscr" = yes; then
6257   LIBS="$cf_ncurses_SAVE"
6258 else
6259   cf_ncurses_LIBS="-lgpm"
6260 fi
6261
6262 fi
6263
6264 case "$host_os" in
6265 (freebsd*)
6266         # This is only necessary if you are linking against an obsolete
6267         # version of ncurses (but it should do no harm, since it is static).
6268         if test "$cf_nculib_root" = ncurses ; then
6269                 echo "$as_me:6269: checking for tgoto in -lmytinfo" >&5
6270 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6271 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6272   echo $ECHO_N "(cached) $ECHO_C" >&6
6273 else
6274   ac_check_lib_save_LIBS=$LIBS
6275 LIBS="-lmytinfo  $LIBS"
6276 cat >"conftest.$ac_ext" <<_ACEOF
6277 #line 6277 "configure"
6278 #include "confdefs.h"
6279
6280 /* Override any gcc2 internal prototype to avoid an error.  */
6281 #ifdef __cplusplus
6282 extern "C"
6283 #endif
6284 /* We use char because int might match the return type of a gcc2
6285    builtin and then its argument prototype would still apply.  */
6286 char tgoto ();
6287 int
6288 main (void)
6289 {
6290 tgoto ();
6291   ;
6292   return 0;
6293 }
6294 _ACEOF
6295 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6296 if { (eval echo "$as_me:6296: \"$ac_link\"") >&5
6297   (eval $ac_link) 2>&5
6298   ac_status=$?
6299   echo "$as_me:6299: \$? = $ac_status" >&5
6300   (exit "$ac_status"); } &&
6301          { ac_try='test -s "conftest$ac_exeext"'
6302   { (eval echo "$as_me:6302: \"$ac_try\"") >&5
6303   (eval $ac_try) 2>&5
6304   ac_status=$?
6305   echo "$as_me:6305: \$? = $ac_status" >&5
6306   (exit "$ac_status"); }; }; then
6307   ac_cv_lib_mytinfo_tgoto=yes
6308 else
6309   echo "$as_me: failed program was:" >&5
6310 cat "conftest.$ac_ext" >&5
6311 ac_cv_lib_mytinfo_tgoto=no
6312 fi
6313 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6314 LIBS=$ac_check_lib_save_LIBS
6315 fi
6316 echo "$as_me:6316: result: $ac_cv_lib_mytinfo_tgoto" >&5
6317 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6318 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6319   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6320 fi
6321
6322         fi
6323         ;;
6324 esac
6325
6326 cf_add_libs="$LIBS"
6327 # reverse order
6328 cf_add_0lib=
6329 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6330 # filter duplicates
6331 for cf_add_1lib in $cf_add_0lib; do
6332         for cf_add_2lib in $cf_add_libs; do
6333                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6334                         cf_add_1lib=
6335                         break
6336                 fi
6337         done
6338         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6339 done
6340 LIBS="$cf_add_libs"
6341
6342 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6343 then
6344
6345 cf_add_libs="$LIBS"
6346 # reverse order
6347 cf_add_0lib=
6348 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6349 # filter duplicates
6350 for cf_add_1lib in $cf_add_0lib; do
6351         for cf_add_2lib in $cf_add_libs; do
6352                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6353                         cf_add_1lib=
6354                         break
6355                 fi
6356         done
6357         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6358 done
6359 LIBS="$cf_add_libs"
6360
6361 else
6362
6363         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6364         cf_libdir=""
6365         echo "$as_me:6365: checking for initscr" >&5
6366 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6367 if test "${ac_cv_func_initscr+set}" = set; then
6368   echo $ECHO_N "(cached) $ECHO_C" >&6
6369 else
6370   cat >"conftest.$ac_ext" <<_ACEOF
6371 #line 6371 "configure"
6372 #include "confdefs.h"
6373 #define initscr autoconf_temporary
6374 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6375 #undef initscr
6376
6377 #ifdef __cplusplus
6378 extern "C"
6379 #endif
6380
6381 /* We use char because int might match the return type of a gcc2
6382    builtin and then its argument prototype would still apply.  */
6383 char initscr (void);
6384
6385 int
6386 main (void)
6387 {
6388
6389 /* The GNU C library defines stubs for functions which it implements
6390     to always fail with ENOSYS.  Some functions are actually named
6391     something starting with __ and the normal name is an alias.  */
6392 #if defined (__stub_initscr) || defined (__stub___initscr)
6393 #error found stub for initscr
6394 #endif
6395
6396         return initscr ();
6397   ;
6398   return 0;
6399 }
6400 _ACEOF
6401 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6402 if { (eval echo "$as_me:6402: \"$ac_link\"") >&5
6403   (eval $ac_link) 2>&5
6404   ac_status=$?
6405   echo "$as_me:6405: \$? = $ac_status" >&5
6406   (exit "$ac_status"); } &&
6407          { ac_try='test -s "conftest$ac_exeext"'
6408   { (eval echo "$as_me:6408: \"$ac_try\"") >&5
6409   (eval $ac_try) 2>&5
6410   ac_status=$?
6411   echo "$as_me:6411: \$? = $ac_status" >&5
6412   (exit "$ac_status"); }; }; then
6413   ac_cv_func_initscr=yes
6414 else
6415   echo "$as_me: failed program was:" >&5
6416 cat "conftest.$ac_ext" >&5
6417 ac_cv_func_initscr=no
6418 fi
6419 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6420 fi
6421 echo "$as_me:6421: result: $ac_cv_func_initscr" >&5
6422 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6423 if test "$ac_cv_func_initscr" = yes; then
6424   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6425 else
6426
6427                 cf_save_LIBS="$LIBS"
6428                 echo "$as_me:6428: checking for initscr in -l$cf_nculib_root" >&5
6429 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6430                 LIBS="-l$cf_nculib_root $LIBS"
6431                 cat >"conftest.$ac_ext" <<_ACEOF
6432 #line 6432 "configure"
6433 #include "confdefs.h"
6434 #include <${cf_cv_ncurses_header:-curses.h}>
6435 int
6436 main (void)
6437 {
6438 initscr()
6439   ;
6440   return 0;
6441 }
6442 _ACEOF
6443 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6444 if { (eval echo "$as_me:6444: \"$ac_link\"") >&5
6445   (eval $ac_link) 2>&5
6446   ac_status=$?
6447   echo "$as_me:6447: \$? = $ac_status" >&5
6448   (exit "$ac_status"); } &&
6449          { ac_try='test -s "conftest$ac_exeext"'
6450   { (eval echo "$as_me:6450: \"$ac_try\"") >&5
6451   (eval $ac_try) 2>&5
6452   ac_status=$?
6453   echo "$as_me:6453: \$? = $ac_status" >&5
6454   (exit "$ac_status"); }; }; then
6455   echo "$as_me:6455: result: yes" >&5
6456 echo "${ECHO_T}yes" >&6
6457                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6458
6459 else
6460   echo "$as_me: failed program was:" >&5
6461 cat "conftest.$ac_ext" >&5
6462 echo "$as_me:6462: result: no" >&5
6463 echo "${ECHO_T}no" >&6
6464
6465 cf_search=
6466 cf_library_path_list=""
6467 if test -n "${LDFLAGS}${LIBS}" ; then
6468         for cf_library_path in $LDFLAGS $LIBS
6469         do
6470                 case "$cf_library_path" in
6471                 (-L*)
6472                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6473
6474 test "x$cf_library_path" != "xNONE" && \
6475 test -d "$cf_library_path" && \
6476  {
6477         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6478         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6479         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6480         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6481         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6482         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"
6483 }
6484
6485                         cf_library_path_list="$cf_library_path_list $cf_search"
6486                         ;;
6487                 esac
6488         done
6489 fi
6490
6491 cf_search=
6492
6493 test "x$prefix" != "xNONE" && \
6494 test -d "$prefix" && \
6495  {
6496         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6497         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6498         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6499         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6500         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6501         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6502 }
6503
6504 for cf_subdir_prefix in \
6505         /usr \
6506         /usr/local \
6507         /usr/pkg \
6508         /opt \
6509         /opt/local \
6510         $HOME
6511 do
6512
6513 test "x$cf_subdir_prefix" != "x$prefix" && \
6514 test -d "$cf_subdir_prefix" && \
6515 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6516         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6517         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6518         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6519         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6520         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6521         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"
6522 }
6523
6524 done
6525
6526 cf_search="$cf_library_path_list $cf_search"
6527
6528                         for cf_libdir in $cf_search
6529                         do
6530                                 echo "$as_me:6530: checking for -l$cf_nculib_root in $cf_libdir" >&5
6531 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6532                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6533                                 cat >"conftest.$ac_ext" <<_ACEOF
6534 #line 6534 "configure"
6535 #include "confdefs.h"
6536 #include <${cf_cv_ncurses_header:-curses.h}>
6537 int
6538 main (void)
6539 {
6540 initscr()
6541   ;
6542   return 0;
6543 }
6544 _ACEOF
6545 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6546 if { (eval echo "$as_me:6546: \"$ac_link\"") >&5
6547   (eval $ac_link) 2>&5
6548   ac_status=$?
6549   echo "$as_me:6549: \$? = $ac_status" >&5
6550   (exit "$ac_status"); } &&
6551          { ac_try='test -s "conftest$ac_exeext"'
6552   { (eval echo "$as_me:6552: \"$ac_try\"") >&5
6553   (eval $ac_try) 2>&5
6554   ac_status=$?
6555   echo "$as_me:6555: \$? = $ac_status" >&5
6556   (exit "$ac_status"); }; }; then
6557   echo "$as_me:6557: result: yes" >&5
6558 echo "${ECHO_T}yes" >&6
6559                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6560                                          break
6561 else
6562   echo "$as_me: failed program was:" >&5
6563 cat "conftest.$ac_ext" >&5
6564 echo "$as_me:6564: result: no" >&5
6565 echo "${ECHO_T}no" >&6
6566                                          LIBS="$cf_save_LIBS"
6567 fi
6568 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6569                         done
6570
6571 fi
6572 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6573
6574 fi
6575
6576 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6577
6578 if test "$cf_found_library" = no ; then
6579         { { echo "$as_me:6579: error: Cannot link $cf_nculib_root library" >&5
6580 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6581    { (exit 1); exit 1; }; }
6582 fi
6583
6584 fi
6585
6586 if test -n "$cf_ncurses_LIBS" ; then
6587         echo "$as_me:6587: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6588 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6589         cf_ncurses_SAVE="$LIBS"
6590         for p in $cf_ncurses_LIBS ; do
6591                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6592                 if test "$q" != "$LIBS" ; then
6593                         LIBS="$q"
6594                 fi
6595         done
6596         cat >"conftest.$ac_ext" <<_ACEOF
6597 #line 6597 "configure"
6598 #include "confdefs.h"
6599 #include <${cf_cv_ncurses_header:-curses.h}>
6600 int
6601 main (void)
6602 {
6603 initscr(); mousemask(0,0); tigetstr((char *)0);
6604   ;
6605   return 0;
6606 }
6607 _ACEOF
6608 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6609 if { (eval echo "$as_me:6609: \"$ac_link\"") >&5
6610   (eval $ac_link) 2>&5
6611   ac_status=$?
6612   echo "$as_me:6612: \$? = $ac_status" >&5
6613   (exit "$ac_status"); } &&
6614          { ac_try='test -s "conftest$ac_exeext"'
6615   { (eval echo "$as_me:6615: \"$ac_try\"") >&5
6616   (eval $ac_try) 2>&5
6617   ac_status=$?
6618   echo "$as_me:6618: \$? = $ac_status" >&5
6619   (exit "$ac_status"); }; }; then
6620   echo "$as_me:6620: result: yes" >&5
6621 echo "${ECHO_T}yes" >&6
6622 else
6623   echo "$as_me: failed program was:" >&5
6624 cat "conftest.$ac_ext" >&5
6625 echo "$as_me:6625: result: no" >&5
6626 echo "${ECHO_T}no" >&6
6627                  LIBS="$cf_ncurses_SAVE"
6628 fi
6629 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6630 fi
6631
6632 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6633
6634 cat >>confdefs.h <<EOF
6635 #define $cf_nculib_ROOT 1
6636 EOF
6637
6638         fi
6639 else
6640         NCURSES_CONFIG=none
6641 fi
6642
6643 echo "$as_me:6643: checking if you want wide-character code" >&5
6644 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6645
6646 # Check whether --enable-widec or --disable-widec was given.
6647 if test "${enable_widec+set}" = set; then
6648   enableval="$enable_widec"
6649   with_widec=$enableval
6650 else
6651   with_widec=no
6652 fi;
6653 echo "$as_me:6653: result: $with_widec" >&5
6654 echo "${ECHO_T}$with_widec" >&6
6655 if test "$with_widec" = yes ; then
6656
6657 for ac_header in wchar.h
6658 do
6659 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6660 echo "$as_me:6660: checking for $ac_header" >&5
6661 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6662 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6663   echo $ECHO_N "(cached) $ECHO_C" >&6
6664 else
6665   cat >"conftest.$ac_ext" <<_ACEOF
6666 #line 6666 "configure"
6667 #include "confdefs.h"
6668 #include <$ac_header>
6669 _ACEOF
6670 if { (eval echo "$as_me:6670: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6671   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6672   ac_status=$?
6673   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6674   rm -f conftest.er1
6675   cat conftest.err >&5
6676   echo "$as_me:6676: \$? = $ac_status" >&5
6677   (exit "$ac_status"); } >/dev/null; then
6678   if test -s conftest.err; then
6679     ac_cpp_err=$ac_c_preproc_warn_flag
6680   else
6681     ac_cpp_err=
6682   fi
6683 else
6684   ac_cpp_err=yes
6685 fi
6686 if test -z "$ac_cpp_err"; then
6687   eval "$as_ac_Header=yes"
6688 else
6689   echo "$as_me: failed program was:" >&5
6690   cat "conftest.$ac_ext" >&5
6691   eval "$as_ac_Header=no"
6692 fi
6693 rm -f conftest.err "conftest.$ac_ext"
6694 fi
6695 echo "$as_me:6695: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6696 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6697 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6698   cat >>confdefs.h <<EOF
6699 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6700 EOF
6701
6702 fi
6703 done
6704
6705 echo "$as_me:6705: checking for multibyte character support" >&5
6706 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6707 if test "${cf_cv_utf8_lib+set}" = set; then
6708   echo $ECHO_N "(cached) $ECHO_C" >&6
6709 else
6710
6711         cf_save_LIBS="$LIBS"
6712         cat >"conftest.$ac_ext" <<_ACEOF
6713 #line 6713 "configure"
6714 #include "confdefs.h"
6715
6716 #include <stdlib.h>
6717 #include <stdio.h>
6718 #ifdef HAVE_WCHAR_H
6719 #include <wchar.h>
6720 #endif
6721
6722 int
6723 main (void)
6724 {
6725 putwc(0,0);
6726   ;
6727   return 0;
6728 }
6729 _ACEOF
6730 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6731 if { (eval echo "$as_me:6731: \"$ac_link\"") >&5
6732   (eval $ac_link) 2>&5
6733   ac_status=$?
6734   echo "$as_me:6734: \$? = $ac_status" >&5
6735   (exit "$ac_status"); } &&
6736          { ac_try='test -s "conftest$ac_exeext"'
6737   { (eval echo "$as_me:6737: \"$ac_try\"") >&5
6738   (eval $ac_try) 2>&5
6739   ac_status=$?
6740   echo "$as_me:6740: \$? = $ac_status" >&5
6741   (exit "$ac_status"); }; }; then
6742   cf_cv_utf8_lib=yes
6743 else
6744   echo "$as_me: failed program was:" >&5
6745 cat "conftest.$ac_ext" >&5
6746
6747 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6748 # will be set on completion of the AC_TRY_LINK below.
6749 cf_cv_header_path_utf8=
6750 cf_cv_library_path_utf8=
6751
6752 echo "${as_me:-configure}:6752: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6753
6754 cf_save_LIBS="$LIBS"
6755
6756 cat >"conftest.$ac_ext" <<_ACEOF
6757 #line 6757 "configure"
6758 #include "confdefs.h"
6759
6760 #include <libutf8.h>
6761 int
6762 main (void)
6763 {
6764 putwc(0,0);
6765   ;
6766   return 0;
6767 }
6768 _ACEOF
6769 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6770 if { (eval echo "$as_me:6770: \"$ac_link\"") >&5
6771   (eval $ac_link) 2>&5
6772   ac_status=$?
6773   echo "$as_me:6773: \$? = $ac_status" >&5
6774   (exit "$ac_status"); } &&
6775          { ac_try='test -s "conftest$ac_exeext"'
6776   { (eval echo "$as_me:6776: \"$ac_try\"") >&5
6777   (eval $ac_try) 2>&5
6778   ac_status=$?
6779   echo "$as_me:6779: \$? = $ac_status" >&5
6780   (exit "$ac_status"); }; }; then
6781
6782         cf_cv_find_linkage_utf8=yes
6783         cf_cv_header_path_utf8=/usr/include
6784         cf_cv_library_path_utf8=/usr/lib
6785
6786 else
6787   echo "$as_me: failed program was:" >&5
6788 cat "conftest.$ac_ext" >&5
6789
6790 LIBS="-lutf8  $cf_save_LIBS"
6791
6792 cat >"conftest.$ac_ext" <<_ACEOF
6793 #line 6793 "configure"
6794 #include "confdefs.h"
6795
6796 #include <libutf8.h>
6797 int
6798 main (void)
6799 {
6800 putwc(0,0);
6801   ;
6802   return 0;
6803 }
6804 _ACEOF
6805 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6806 if { (eval echo "$as_me:6806: \"$ac_link\"") >&5
6807   (eval $ac_link) 2>&5
6808   ac_status=$?
6809   echo "$as_me:6809: \$? = $ac_status" >&5
6810   (exit "$ac_status"); } &&
6811          { ac_try='test -s "conftest$ac_exeext"'
6812   { (eval echo "$as_me:6812: \"$ac_try\"") >&5
6813   (eval $ac_try) 2>&5
6814   ac_status=$?
6815   echo "$as_me:6815: \$? = $ac_status" >&5
6816   (exit "$ac_status"); }; }; then
6817
6818         cf_cv_find_linkage_utf8=yes
6819         cf_cv_header_path_utf8=/usr/include
6820         cf_cv_library_path_utf8=/usr/lib
6821         cf_cv_library_file_utf8="-lutf8"
6822
6823 else
6824   echo "$as_me: failed program was:" >&5
6825 cat "conftest.$ac_ext" >&5
6826
6827         cf_cv_find_linkage_utf8=no
6828         LIBS="$cf_save_LIBS"
6829
6830         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6831
6832 echo "${as_me:-configure}:6832: testing find linkage for utf8 library ..." 1>&5
6833
6834 echo "${as_me:-configure}:6834: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6835
6836         cf_save_CPPFLAGS="$CPPFLAGS"
6837         cf_test_CPPFLAGS="$CPPFLAGS"
6838
6839 cf_search=
6840
6841 # collect the current set of include-directories from compiler flags
6842 cf_header_path_list=""
6843 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6844         for cf_header_path in $CPPFLAGS $CFLAGS
6845         do
6846                 case "$cf_header_path" in
6847                 (-I*)
6848                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6849
6850 test "x$cf_header_path" != "xNONE" && \
6851 test -d "$cf_header_path" && \
6852  {
6853         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6854         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6855         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6856         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6857         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6858         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6859 }
6860
6861                         cf_header_path_list="$cf_header_path_list $cf_search"
6862                         ;;
6863                 esac
6864         done
6865 fi
6866
6867 # add the variations for the package we are looking for
6868
6869 cf_search=
6870
6871 test "x$prefix" != "xNONE" && \
6872 test -d "$prefix" && \
6873  {
6874         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6875         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6876         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6877         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6878         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6879         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6880 }
6881
6882 for cf_subdir_prefix in \
6883         /usr \
6884         /usr/local \
6885         /usr/pkg \
6886         /opt \
6887         /opt/local \
6888         $HOME
6889 do
6890
6891 test "x$cf_subdir_prefix" != "x$prefix" && \
6892 test -d "$cf_subdir_prefix" && \
6893 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6894         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6895         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6896         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6897         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6898         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6899         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6900 }
6901
6902 done
6903
6904 test "$includedir" != NONE && \
6905 test "$includedir" != "/usr/include" && \
6906 test -d "$includedir" && {
6907         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6908         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6909 }
6910
6911 test "$oldincludedir" != NONE && \
6912 test "$oldincludedir" != "/usr/include" && \
6913 test -d "$oldincludedir" && {
6914         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6915         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6916 }
6917
6918 cf_search="$cf_search $cf_header_path_list"
6919
6920         for cf_cv_header_path_utf8 in $cf_search
6921         do
6922                 if test -d "$cf_cv_header_path_utf8" ; then
6923                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6924
6925 echo "${as_me:-configure}:6925: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6926
6927                         CPPFLAGS="$cf_save_CPPFLAGS"
6928
6929         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6930         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6931
6932                         cat >"conftest.$ac_ext" <<_ACEOF
6933 #line 6933 "configure"
6934 #include "confdefs.h"
6935
6936 #include <libutf8.h>
6937 int
6938 main (void)
6939 {
6940 putwc(0,0);
6941   ;
6942   return 0;
6943 }
6944 _ACEOF
6945 rm -f "conftest.$ac_objext"
6946 if { (eval echo "$as_me:6946: \"$ac_compile\"") >&5
6947   (eval $ac_compile) 2>&5
6948   ac_status=$?
6949   echo "$as_me:6949: \$? = $ac_status" >&5
6950   (exit "$ac_status"); } &&
6951          { ac_try='test -s "conftest.$ac_objext"'
6952   { (eval echo "$as_me:6952: \"$ac_try\"") >&5
6953   (eval $ac_try) 2>&5
6954   ac_status=$?
6955   echo "$as_me:6955: \$? = $ac_status" >&5
6956   (exit "$ac_status"); }; }; then
6957
6958                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6959
6960 echo "${as_me:-configure}:6960: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6961
6962                                 cf_cv_find_linkage_utf8=maybe
6963                                 cf_test_CPPFLAGS="$CPPFLAGS"
6964                                 break
6965 else
6966   echo "$as_me: failed program was:" >&5
6967 cat "conftest.$ac_ext" >&5
6968
6969                                 CPPFLAGS="$cf_save_CPPFLAGS"
6970
6971 fi
6972 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6973                 fi
6974         done
6975
6976         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6977
6978 echo "${as_me:-configure}:6978: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6979
6980                 cf_save_LIBS="$LIBS"
6981                 cf_save_LDFLAGS="$LDFLAGS"
6982
6983                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6984
6985 cf_search=
6986 cf_library_path_list=""
6987 if test -n "${LDFLAGS}${LIBS}" ; then
6988         for cf_library_path in $LDFLAGS $LIBS
6989         do
6990                 case "$cf_library_path" in
6991                 (-L*)
6992                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6993
6994 test "x$cf_library_path" != "xNONE" && \
6995 test -d "$cf_library_path" && \
6996  {
6997         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6998         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6999         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7000         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7001         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7002         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7003 }
7004
7005                         cf_library_path_list="$cf_library_path_list $cf_search"
7006                         ;;
7007                 esac
7008         done
7009 fi
7010
7011 cf_search=
7012
7013 test "x$prefix" != "xNONE" && \
7014 test -d "$prefix" && \
7015  {
7016         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7017         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7018         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7019         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7020         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7021         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7022 }
7023
7024 for cf_subdir_prefix in \
7025         /usr \
7026         /usr/local \
7027         /usr/pkg \
7028         /opt \
7029         /opt/local \
7030         $HOME
7031 do
7032
7033 test "x$cf_subdir_prefix" != "x$prefix" && \
7034 test -d "$cf_subdir_prefix" && \
7035 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7036         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7037         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7038         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7039         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7040         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7041         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7042 }
7043
7044 done
7045
7046 cf_search="$cf_library_path_list $cf_search"
7047
7048                         for cf_cv_library_path_utf8 in $cf_search
7049                         do
7050                                 if test -d "$cf_cv_library_path_utf8" ; then
7051                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7052
7053 echo "${as_me:-configure}:7053: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7054
7055                                         CPPFLAGS="$cf_test_CPPFLAGS"
7056                                         LIBS="-lutf8  $cf_save_LIBS"
7057                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7058                                         cat >"conftest.$ac_ext" <<_ACEOF
7059 #line 7059 "configure"
7060 #include "confdefs.h"
7061
7062 #include <libutf8.h>
7063 int
7064 main (void)
7065 {
7066 putwc(0,0);
7067   ;
7068   return 0;
7069 }
7070 _ACEOF
7071 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7072 if { (eval echo "$as_me:7072: \"$ac_link\"") >&5
7073   (eval $ac_link) 2>&5
7074   ac_status=$?
7075   echo "$as_me:7075: \$? = $ac_status" >&5
7076   (exit "$ac_status"); } &&
7077          { ac_try='test -s "conftest$ac_exeext"'
7078   { (eval echo "$as_me:7078: \"$ac_try\"") >&5
7079   (eval $ac_try) 2>&5
7080   ac_status=$?
7081   echo "$as_me:7081: \$? = $ac_status" >&5
7082   (exit "$ac_status"); }; }; then
7083
7084                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7085
7086 echo "${as_me:-configure}:7086: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7087
7088                                         cf_cv_find_linkage_utf8=yes
7089                                         cf_cv_library_file_utf8="-lutf8"
7090                                         break
7091 else
7092   echo "$as_me: failed program was:" >&5
7093 cat "conftest.$ac_ext" >&5
7094
7095                                         CPPFLAGS="$cf_save_CPPFLAGS"
7096                                         LIBS="$cf_save_LIBS"
7097                                         LDFLAGS="$cf_save_LDFLAGS"
7098
7099 fi
7100 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7101                                 fi
7102                         done
7103                         CPPFLAGS="$cf_save_CPPFLAGS"
7104                         LDFLAGS="$cf_save_LDFLAGS"
7105                 fi
7106
7107         else
7108                 cf_cv_find_linkage_utf8=no
7109         fi
7110
7111 fi
7112 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7113
7114 fi
7115 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7116
7117 LIBS="$cf_save_LIBS"
7118
7119 if test "$cf_cv_find_linkage_utf8" = yes ; then
7120 cf_cv_utf8_lib=add-on
7121 else
7122 cf_cv_utf8_lib=no
7123 fi
7124
7125 fi
7126 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7127 fi
7128 echo "$as_me:7128: result: $cf_cv_utf8_lib" >&5
7129 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7130
7131 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7132 # ncurses/ncursesw:
7133 if test "$cf_cv_utf8_lib" = "add-on" ; then
7134
7135 cat >>confdefs.h <<\EOF
7136 #define HAVE_LIBUTF8_H 1
7137 EOF
7138
7139 if test -n "$cf_cv_header_path_utf8" ; then
7140   for cf_add_incdir in $cf_cv_header_path_utf8
7141   do
7142         while test "$cf_add_incdir" != /usr/include
7143         do
7144           if test -d "$cf_add_incdir"
7145           then
7146                 cf_have_incdir=no
7147                 if test -n "$CFLAGS$CPPFLAGS" ; then
7148                   # a loop is needed to ensure we can add subdirs of existing dirs
7149                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7150                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7151                           cf_have_incdir=yes; break
7152                         fi
7153                   done
7154                 fi
7155
7156                 if test "$cf_have_incdir" = no ; then
7157                   if test "$cf_add_incdir" = /usr/local/include ; then
7158                         if test "$GCC" = yes
7159                         then
7160                           cf_save_CPPFLAGS=$CPPFLAGS
7161
7162         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7163         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7164
7165                           cat >"conftest.$ac_ext" <<_ACEOF
7166 #line 7166 "configure"
7167 #include "confdefs.h"
7168 #include <stdio.h>
7169 int
7170 main (void)
7171 {
7172 printf("Hello")
7173   ;
7174   return 0;
7175 }
7176 _ACEOF
7177 rm -f "conftest.$ac_objext"
7178 if { (eval echo "$as_me:7178: \"$ac_compile\"") >&5
7179   (eval $ac_compile) 2>&5
7180   ac_status=$?
7181   echo "$as_me:7181: \$? = $ac_status" >&5
7182   (exit "$ac_status"); } &&
7183          { ac_try='test -s "conftest.$ac_objext"'
7184   { (eval echo "$as_me:7184: \"$ac_try\"") >&5
7185   (eval $ac_try) 2>&5
7186   ac_status=$?
7187   echo "$as_me:7187: \$? = $ac_status" >&5
7188   (exit "$ac_status"); }; }; then
7189   :
7190 else
7191   echo "$as_me: failed program was:" >&5
7192 cat "conftest.$ac_ext" >&5
7193 cf_have_incdir=yes
7194 fi
7195 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7196                           CPPFLAGS=$cf_save_CPPFLAGS
7197                         fi
7198                   fi
7199                 fi
7200
7201                 if test "$cf_have_incdir" = no ; then
7202                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7203
7204 echo "${as_me:-configure}:7204: testing adding $cf_add_incdir to include-path ..." 1>&5
7205
7206                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7207
7208                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7209                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7210                   cf_add_incdir="$cf_top_incdir"
7211                 else
7212                   break
7213                 fi
7214           else
7215                 break
7216           fi
7217         done
7218   done
7219 fi
7220
7221 if test -n "$cf_cv_library_path_utf8" ; then
7222         for cf_add_libdir in $cf_cv_library_path_utf8
7223         do
7224                 if test "$cf_add_libdir" = /usr/lib ; then
7225                         :
7226                 elif test -d "$cf_add_libdir"
7227                 then
7228                         cf_have_libdir=no
7229                         if test -n "$LDFLAGS$LIBS" ; then
7230                                 # a loop is needed to ensure we can add subdirs of existing dirs
7231                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7232                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7233                                                 cf_have_libdir=yes; break
7234                                         fi
7235                                 done
7236                         fi
7237                         if test "$cf_have_libdir" = no ; then
7238                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7239
7240 echo "${as_me:-configure}:7240: testing adding $cf_add_libdir to library-path ..." 1>&5
7241
7242                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7243                         fi
7244                 fi
7245         done
7246 fi
7247
7248 cf_add_libs="$LIBS"
7249 # reverse order
7250 cf_add_0lib=
7251 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7252 # filter duplicates
7253 for cf_add_1lib in $cf_add_0lib; do
7254         for cf_add_2lib in $cf_add_libs; do
7255                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7256                         cf_add_1lib=
7257                         break
7258                 fi
7259         done
7260         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7261 done
7262 LIBS="$cf_add_libs"
7263
7264 fi
7265
7266 cf_ncuconfig_root=ncursesw
7267 cf_have_ncuconfig=no
7268
7269 if test "x${PKG_CONFIG:=none}" != xnone; then
7270         echo "$as_me:7270: checking pkg-config for $cf_ncuconfig_root" >&5
7271 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7272         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7273                 echo "$as_me:7273: result: yes" >&5
7274 echo "${ECHO_T}yes" >&6
7275
7276                 echo "$as_me:7276: checking if the $cf_ncuconfig_root package files work" >&5
7277 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7278                 cf_have_ncuconfig=unknown
7279
7280                 cf_save_CFLAGS="$CFLAGS"
7281                 cf_save_CPPFLAGS="$CPPFLAGS"
7282                 cf_save_LIBS="$LIBS"
7283
7284                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7285                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7286
7287                 # while -W for passing linker flags is prevalent, it is not "standard".
7288                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7289                 # incompatible _and_ non-standard -W option which gives an error.  Work
7290                 # around that pitfall.
7291                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7292                 (x*c[89]9@@*-W*)
7293
7294 cf_fix_cppflags=no
7295 cf_new_cflags=
7296 cf_new_cppflags=
7297 cf_new_extra_cppflags=
7298
7299 for cf_add_cflags in $cf_pkg_cflags
7300 do
7301 case "$cf_fix_cppflags" in
7302 (no)
7303         case "$cf_add_cflags" in
7304         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7305                 case "$cf_add_cflags" in
7306                 (-D*)
7307                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7308
7309                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7310                                 && test -z "${cf_tst_cflags}" \
7311                                 && cf_fix_cppflags=yes
7312
7313                         if test "$cf_fix_cppflags" = yes ; then
7314
7315         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7316         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7317
7318                                 continue
7319                         elif test "${cf_tst_cflags}" = "\"'" ; then
7320
7321         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7322         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7323
7324                                 continue
7325                         fi
7326                         ;;
7327                 esac
7328                 case "$CPPFLAGS" in
7329                 (*$cf_add_cflags)
7330                         ;;
7331                 (*)
7332                         case "$cf_add_cflags" in
7333                         (-D*)
7334                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7335
7336 CPPFLAGS=`echo "$CPPFLAGS" | \
7337         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7338                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7339
7340                                 ;;
7341                         esac
7342
7343         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7344         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7345
7346                         ;;
7347                 esac
7348                 ;;
7349         (*)
7350
7351         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7352         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7353
7354                 ;;
7355         esac
7356         ;;
7357 (yes)
7358
7359         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7360         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7361
7362         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7363
7364         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7365                 && test -z "${cf_tst_cflags}" \
7366                 && cf_fix_cppflags=no
7367         ;;
7368 esac
7369 done
7370
7371 if test -n "$cf_new_cflags" ; then
7372
7373         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7374         CFLAGS="${CFLAGS}$cf_new_cflags"
7375
7376 fi
7377
7378 if test -n "$cf_new_cppflags" ; then
7379
7380         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7381         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7382
7383 fi
7384
7385 if test -n "$cf_new_extra_cppflags" ; then
7386
7387         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7388         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7389
7390 fi
7391
7392 cf_add_libs="$LIBS"
7393 # reverse order
7394 cf_add_0lib=
7395 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7396 # filter duplicates
7397 for cf_add_1lib in $cf_add_0lib; do
7398         for cf_add_2lib in $cf_add_libs; do
7399                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7400                         cf_add_1lib=
7401                         break
7402                 fi
7403         done
7404         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7405 done
7406 LIBS="$cf_add_libs"
7407
7408                         cat >"conftest.$ac_ext" <<_ACEOF
7409 #line 7409 "configure"
7410 #include "confdefs.h"
7411 #include <${cf_cv_ncurses_header:-curses.h}>
7412 int
7413 main (void)
7414 {
7415 initscr(); mousemask(0,0); tigetstr((char *)0);
7416   ;
7417   return 0;
7418 }
7419 _ACEOF
7420 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7421 if { (eval echo "$as_me:7421: \"$ac_link\"") >&5
7422   (eval $ac_link) 2>&5
7423   ac_status=$?
7424   echo "$as_me:7424: \$? = $ac_status" >&5
7425   (exit "$ac_status"); } &&
7426          { ac_try='test -s "conftest$ac_exeext"'
7427   { (eval echo "$as_me:7427: \"$ac_try\"") >&5
7428   (eval $ac_try) 2>&5
7429   ac_status=$?
7430   echo "$as_me:7430: \$? = $ac_status" >&5
7431   (exit "$ac_status"); }; }; then
7432   if test "$cross_compiling" = yes; then
7433   cf_test_ncuconfig=maybe
7434 else
7435   cat >"conftest.$ac_ext" <<_ACEOF
7436 #line 7436 "configure"
7437 #include "confdefs.h"
7438 #include <${cf_cv_ncurses_header:-curses.h}>
7439                                         int main(void)
7440                                         { const char *xx = curses_version(); return (xx == 0); }
7441 _ACEOF
7442 rm -f "conftest$ac_exeext"
7443 if { (eval echo "$as_me:7443: \"$ac_link\"") >&5
7444   (eval $ac_link) 2>&5
7445   ac_status=$?
7446   echo "$as_me:7446: \$? = $ac_status" >&5
7447   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7448   { (eval echo "$as_me:7448: \"$ac_try\"") >&5
7449   (eval $ac_try) 2>&5
7450   ac_status=$?
7451   echo "$as_me:7451: \$? = $ac_status" >&5
7452   (exit "$ac_status"); }; }; then
7453   cf_test_ncuconfig=yes
7454 else
7455   echo "$as_me: program exited with status $ac_status" >&5
7456 echo "$as_me: failed program was:" >&5
7457 cat "conftest.$ac_ext" >&5
7458 cf_test_ncuconfig=no
7459 fi
7460 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7461 fi
7462 else
7463   echo "$as_me: failed program was:" >&5
7464 cat "conftest.$ac_ext" >&5
7465 cf_test_ncuconfig=no
7466 fi
7467 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7468
7469                         CFLAGS="$cf_save_CFLAGS"
7470                         CPPFLAGS="$cf_save_CPPFLAGS"
7471                         LIBS="$cf_save_LIBS"
7472
7473                         if test "x$cf_test_ncuconfig" != xyes; then
7474                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7475                                 cf_pkg_cflags="$cf_temp"
7476                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7477                                 cf_pkg_libs="$cf_temp"
7478                         fi
7479                         ;;
7480                 esac
7481
7482 for cf_add_cflags in $cf_pkg_cflags
7483 do
7484         case "x$cf_add_cflags" in
7485         (x-[DU]*)
7486
7487 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7488 while true
7489 do
7490         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'`
7491         test "$CFLAGS" != "$cf_old_cflag" || break
7492
7493         CFLAGS="$cf_old_cflag"
7494 done
7495
7496 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7497 while true
7498 do
7499         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'`
7500         test "$CPPFLAGS" != "$cf_old_cflag" || break
7501
7502         CPPFLAGS="$cf_old_cflag"
7503 done
7504
7505                 ;;
7506         esac
7507
7508 cf_fix_cppflags=no
7509 cf_new_cflags=
7510 cf_new_cppflags=
7511 cf_new_extra_cppflags=
7512
7513 for cf_add_cflags in $cf_add_cflags
7514 do
7515 case "$cf_fix_cppflags" in
7516 (no)
7517         case "$cf_add_cflags" in
7518         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7519                 case "$cf_add_cflags" in
7520                 (-D*)
7521                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7522
7523                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7524                                 && test -z "${cf_tst_cflags}" \
7525                                 && cf_fix_cppflags=yes
7526
7527                         if test "$cf_fix_cppflags" = yes ; then
7528
7529         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7530         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7531
7532                                 continue
7533                         elif test "${cf_tst_cflags}" = "\"'" ; then
7534
7535         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7536         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7537
7538                                 continue
7539                         fi
7540                         ;;
7541                 esac
7542                 case "$CPPFLAGS" in
7543                 (*$cf_add_cflags)
7544                         ;;
7545                 (*)
7546                         case "$cf_add_cflags" in
7547                         (-D*)
7548                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7549
7550 CPPFLAGS=`echo "$CPPFLAGS" | \
7551         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7552                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7553
7554                                 ;;
7555                         esac
7556
7557         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7558         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7559
7560                         ;;
7561                 esac
7562                 ;;
7563         (*)
7564
7565         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7566         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7567
7568                 ;;
7569         esac
7570         ;;
7571 (yes)
7572
7573         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7574         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7575
7576         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7577
7578         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7579                 && test -z "${cf_tst_cflags}" \
7580                 && cf_fix_cppflags=no
7581         ;;
7582 esac
7583 done
7584
7585 if test -n "$cf_new_cflags" ; then
7586
7587         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7588         CFLAGS="${CFLAGS}$cf_new_cflags"
7589
7590 fi
7591
7592 if test -n "$cf_new_cppflags" ; then
7593
7594         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7595         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7596
7597 fi
7598
7599 if test -n "$cf_new_extra_cppflags" ; then
7600
7601         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7602         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7603
7604 fi
7605
7606 done
7607
7608 cf_add_libs="$LIBS"
7609 # reverse order
7610 cf_add_0lib=
7611 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7612 # filter duplicates
7613 for cf_add_1lib in $cf_add_0lib; do
7614         for cf_add_2lib in $cf_add_libs; do
7615                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7616                         cf_add_1lib=
7617                         break
7618                 fi
7619         done
7620         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7621 done
7622 LIBS="$cf_add_libs"
7623
7624                 cat >"conftest.$ac_ext" <<_ACEOF
7625 #line 7625 "configure"
7626 #include "confdefs.h"
7627 #include <${cf_cv_ncurses_header:-curses.h}>
7628 int
7629 main (void)
7630 {
7631 initscr(); mousemask(0,0); tigetstr((char *)0);
7632   ;
7633   return 0;
7634 }
7635 _ACEOF
7636 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7637 if { (eval echo "$as_me:7637: \"$ac_link\"") >&5
7638   (eval $ac_link) 2>&5
7639   ac_status=$?
7640   echo "$as_me:7640: \$? = $ac_status" >&5
7641   (exit "$ac_status"); } &&
7642          { ac_try='test -s "conftest$ac_exeext"'
7643   { (eval echo "$as_me:7643: \"$ac_try\"") >&5
7644   (eval $ac_try) 2>&5
7645   ac_status=$?
7646   echo "$as_me:7646: \$? = $ac_status" >&5
7647   (exit "$ac_status"); }; }; then
7648   if test "$cross_compiling" = yes; then
7649   cf_have_ncuconfig=maybe
7650 else
7651   cat >"conftest.$ac_ext" <<_ACEOF
7652 #line 7652 "configure"
7653 #include "confdefs.h"
7654 #include <${cf_cv_ncurses_header:-curses.h}>
7655                                 int main(void)
7656                                 { const char *xx = curses_version(); return (xx == 0); }
7657 _ACEOF
7658 rm -f "conftest$ac_exeext"
7659 if { (eval echo "$as_me:7659: \"$ac_link\"") >&5
7660   (eval $ac_link) 2>&5
7661   ac_status=$?
7662   echo "$as_me:7662: \$? = $ac_status" >&5
7663   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7664   { (eval echo "$as_me:7664: \"$ac_try\"") >&5
7665   (eval $ac_try) 2>&5
7666   ac_status=$?
7667   echo "$as_me:7667: \$? = $ac_status" >&5
7668   (exit "$ac_status"); }; }; then
7669   cf_have_ncuconfig=yes
7670 else
7671   echo "$as_me: program exited with status $ac_status" >&5
7672 echo "$as_me: failed program was:" >&5
7673 cat "conftest.$ac_ext" >&5
7674 cf_have_ncuconfig=no
7675 fi
7676 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7677 fi
7678 else
7679   echo "$as_me: failed program was:" >&5
7680 cat "conftest.$ac_ext" >&5
7681 cf_have_ncuconfig=no
7682 fi
7683 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7684                 echo "$as_me:7684: result: $cf_have_ncuconfig" >&5
7685 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7686                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7687                 if test "$cf_have_ncuconfig" != "yes"
7688                 then
7689                         CPPFLAGS="$cf_save_CPPFLAGS"
7690                         LIBS="$cf_save_LIBS"
7691                         NCURSES_CONFIG_PKG=none
7692                 else
7693
7694 cat >>confdefs.h <<\EOF
7695 #define NCURSES 1
7696 EOF
7697
7698                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7699
7700 echo "$as_me:7700: checking for terminfo header" >&5
7701 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7702 if test "${cf_cv_term_header+set}" = set; then
7703   echo $ECHO_N "(cached) $ECHO_C" >&6
7704 else
7705
7706 case "${cf_cv_ncurses_header}" in
7707 (*/ncurses.h|*/ncursesw.h)
7708         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7709         ;;
7710 (*)
7711         cf_term_header=term.h
7712         ;;
7713 esac
7714
7715 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7716 do
7717 cat >"conftest.$ac_ext" <<_ACEOF
7718 #line 7718 "configure"
7719 #include "confdefs.h"
7720 #include <stdio.h>
7721 #include <${cf_cv_ncurses_header:-curses.h}>
7722 #include <$cf_test>
7723
7724 int
7725 main (void)
7726 {
7727 int x = auto_left_margin; (void)x
7728   ;
7729   return 0;
7730 }
7731 _ACEOF
7732 rm -f "conftest.$ac_objext"
7733 if { (eval echo "$as_me:7733: \"$ac_compile\"") >&5
7734   (eval $ac_compile) 2>&5
7735   ac_status=$?
7736   echo "$as_me:7736: \$? = $ac_status" >&5
7737   (exit "$ac_status"); } &&
7738          { ac_try='test -s "conftest.$ac_objext"'
7739   { (eval echo "$as_me:7739: \"$ac_try\"") >&5
7740   (eval $ac_try) 2>&5
7741   ac_status=$?
7742   echo "$as_me:7742: \$? = $ac_status" >&5
7743   (exit "$ac_status"); }; }; then
7744
7745         cf_cv_term_header="$cf_test"
7746 else
7747   echo "$as_me: failed program was:" >&5
7748 cat "conftest.$ac_ext" >&5
7749
7750         cf_cv_term_header=unknown
7751
7752 fi
7753 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7754         test "$cf_cv_term_header" != unknown && break
7755 done
7756
7757 fi
7758 echo "$as_me:7758: result: $cf_cv_term_header" >&5
7759 echo "${ECHO_T}$cf_cv_term_header" >&6
7760
7761 # Set definitions to allow ifdef'ing to accommodate subdirectories
7762
7763 case "$cf_cv_term_header" in
7764 (*term.h)
7765
7766 cat >>confdefs.h <<\EOF
7767 #define HAVE_TERM_H 1
7768 EOF
7769
7770         ;;
7771 esac
7772
7773 case "$cf_cv_term_header" in
7774 (ncurses/term.h)
7775
7776 cat >>confdefs.h <<\EOF
7777 #define HAVE_NCURSES_TERM_H 1
7778 EOF
7779
7780         ;;
7781 (ncursesw/term.h)
7782
7783 cat >>confdefs.h <<\EOF
7784 #define HAVE_NCURSESW_TERM_H 1
7785 EOF
7786
7787         ;;
7788 esac
7789
7790                 fi
7791
7792         else
7793                 echo "$as_me:7793: result: no" >&5
7794 echo "${ECHO_T}no" >&6
7795                 NCURSES_CONFIG_PKG=none
7796         fi
7797 else
7798         NCURSES_CONFIG_PKG=none
7799 fi
7800
7801 if test "x$cf_have_ncuconfig" = "xno"; then
7802         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7803
7804 if test -n "$ac_tool_prefix"; then
7805   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7806   do
7807     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7808 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7809 echo "$as_me:7809: checking for $ac_word" >&5
7810 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7811 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7812   echo $ECHO_N "(cached) $ECHO_C" >&6
7813 else
7814   if test -n "$NCURSES_CONFIG"; then
7815   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7816 else
7817   ac_save_IFS=$IFS; IFS=$ac_path_separator
7818 ac_dummy="$PATH"
7819 for ac_dir in $ac_dummy; do
7820   IFS=$ac_save_IFS
7821   test -z "$ac_dir" && ac_dir=.
7822   $as_executable_p "$ac_dir/$ac_word" || continue
7823 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7824 echo "$as_me:7824: found $ac_dir/$ac_word" >&5
7825 break
7826 done
7827
7828 fi
7829 fi
7830 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7831 if test -n "$NCURSES_CONFIG"; then
7832   echo "$as_me:7832: result: $NCURSES_CONFIG" >&5
7833 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7834 else
7835   echo "$as_me:7835: result: no" >&5
7836 echo "${ECHO_T}no" >&6
7837 fi
7838
7839     test -n "$NCURSES_CONFIG" && break
7840   done
7841 fi
7842 if test -z "$NCURSES_CONFIG"; then
7843   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7844   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7845 do
7846   # Extract the first word of "$ac_prog", so it can be a program name with args.
7847 set dummy $ac_prog; ac_word=$2
7848 echo "$as_me:7848: checking for $ac_word" >&5
7849 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7850 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7851   echo $ECHO_N "(cached) $ECHO_C" >&6
7852 else
7853   if test -n "$ac_ct_NCURSES_CONFIG"; then
7854   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7855 else
7856   ac_save_IFS=$IFS; IFS=$ac_path_separator
7857 ac_dummy="$PATH"
7858 for ac_dir in $ac_dummy; do
7859   IFS=$ac_save_IFS
7860   test -z "$ac_dir" && ac_dir=.
7861   $as_executable_p "$ac_dir/$ac_word" || continue
7862 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7863 echo "$as_me:7863: found $ac_dir/$ac_word" >&5
7864 break
7865 done
7866
7867 fi
7868 fi
7869 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7870 if test -n "$ac_ct_NCURSES_CONFIG"; then
7871   echo "$as_me:7871: result: $ac_ct_NCURSES_CONFIG" >&5
7872 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7873 else
7874   echo "$as_me:7874: result: no" >&5
7875 echo "${ECHO_T}no" >&6
7876 fi
7877
7878   test -n "$ac_ct_NCURSES_CONFIG" && break
7879 done
7880 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7881
7882   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7883 fi
7884
7885         if test "$NCURSES_CONFIG" != none ; then
7886
7887 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7888 do
7889         case "x$cf_add_cflags" in
7890         (x-[DU]*)
7891
7892 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7893 while true
7894 do
7895         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'`
7896         test "$CFLAGS" != "$cf_old_cflag" || break
7897
7898         CFLAGS="$cf_old_cflag"
7899 done
7900
7901 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7902 while true
7903 do
7904         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'`
7905         test "$CPPFLAGS" != "$cf_old_cflag" || break
7906
7907         CPPFLAGS="$cf_old_cflag"
7908 done
7909
7910                 ;;
7911         esac
7912
7913 cf_fix_cppflags=no
7914 cf_new_cflags=
7915 cf_new_cppflags=
7916 cf_new_extra_cppflags=
7917
7918 for cf_add_cflags in $cf_add_cflags
7919 do
7920 case "$cf_fix_cppflags" in
7921 (no)
7922         case "$cf_add_cflags" in
7923         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7924                 case "$cf_add_cflags" in
7925                 (-D*)
7926                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7927
7928                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7929                                 && test -z "${cf_tst_cflags}" \
7930                                 && cf_fix_cppflags=yes
7931
7932                         if test "$cf_fix_cppflags" = yes ; then
7933
7934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7936
7937                                 continue
7938                         elif test "${cf_tst_cflags}" = "\"'" ; then
7939
7940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7942
7943                                 continue
7944                         fi
7945                         ;;
7946                 esac
7947                 case "$CPPFLAGS" in
7948                 (*$cf_add_cflags)
7949                         ;;
7950                 (*)
7951                         case "$cf_add_cflags" in
7952                         (-D*)
7953                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7954
7955 CPPFLAGS=`echo "$CPPFLAGS" | \
7956         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7957                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7958
7959                                 ;;
7960                         esac
7961
7962         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7963         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7964
7965                         ;;
7966                 esac
7967                 ;;
7968         (*)
7969
7970         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7971         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7972
7973                 ;;
7974         esac
7975         ;;
7976 (yes)
7977
7978         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7979         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7980
7981         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7982
7983         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7984                 && test -z "${cf_tst_cflags}" \
7985                 && cf_fix_cppflags=no
7986         ;;
7987 esac
7988 done
7989
7990 if test -n "$cf_new_cflags" ; then
7991
7992         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7993         CFLAGS="${CFLAGS}$cf_new_cflags"
7994
7995 fi
7996
7997 if test -n "$cf_new_cppflags" ; then
7998
7999         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8000         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8001
8002 fi
8003
8004 if test -n "$cf_new_extra_cppflags" ; then
8005
8006         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8007         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8008
8009 fi
8010
8011 done
8012
8013 cf_add_libs="$LIBS"
8014 # reverse order
8015 cf_add_0lib=
8016 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8017 # filter duplicates
8018 for cf_add_1lib in $cf_add_0lib; do
8019         for cf_add_2lib in $cf_add_libs; do
8020                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8021                         cf_add_1lib=
8022                         break
8023                 fi
8024         done
8025         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8026 done
8027 LIBS="$cf_add_libs"
8028
8029                 # even with config script, some packages use no-override for curses.h
8030
8031 echo "$as_me:8031: checking if we have identified curses headers" >&5
8032 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8033 if test "${cf_cv_ncurses_header+set}" = set; then
8034   echo $ECHO_N "(cached) $ECHO_C" >&6
8035 else
8036
8037 cf_cv_ncurses_header=none
8038 for cf_header in \
8039         ncurses.h ncursesw/ncurses.h \
8040         curses.h ncursesw/curses.h
8041 do
8042 cat >"conftest.$ac_ext" <<_ACEOF
8043 #line 8043 "configure"
8044 #include "confdefs.h"
8045 #include <${cf_header}>
8046 int
8047 main (void)
8048 {
8049 initscr(); tgoto("?", 0,0)
8050   ;
8051   return 0;
8052 }
8053 _ACEOF
8054 rm -f "conftest.$ac_objext"
8055 if { (eval echo "$as_me:8055: \"$ac_compile\"") >&5
8056   (eval $ac_compile) 2>&5
8057   ac_status=$?
8058   echo "$as_me:8058: \$? = $ac_status" >&5
8059   (exit "$ac_status"); } &&
8060          { ac_try='test -s "conftest.$ac_objext"'
8061   { (eval echo "$as_me:8061: \"$ac_try\"") >&5
8062   (eval $ac_try) 2>&5
8063   ac_status=$?
8064   echo "$as_me:8064: \$? = $ac_status" >&5
8065   (exit "$ac_status"); }; }; then
8066   cf_cv_ncurses_header=$cf_header; break
8067 else
8068   echo "$as_me: failed program was:" >&5
8069 cat "conftest.$ac_ext" >&5
8070 fi
8071 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8072 done
8073
8074 fi
8075 echo "$as_me:8075: result: $cf_cv_ncurses_header" >&5
8076 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8077
8078 if test "$cf_cv_ncurses_header" = none ; then
8079         { { echo "$as_me:8079: error: No curses header-files found" >&5
8080 echo "$as_me: error: No curses header-files found" >&2;}
8081    { (exit 1); exit 1; }; }
8082 fi
8083
8084 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8085
8086 for ac_header in $cf_cv_ncurses_header
8087 do
8088 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8089 echo "$as_me:8089: checking for $ac_header" >&5
8090 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8091 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8092   echo $ECHO_N "(cached) $ECHO_C" >&6
8093 else
8094   cat >"conftest.$ac_ext" <<_ACEOF
8095 #line 8095 "configure"
8096 #include "confdefs.h"
8097 #include <$ac_header>
8098 _ACEOF
8099 if { (eval echo "$as_me:8099: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8100   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8101   ac_status=$?
8102   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8103   rm -f conftest.er1
8104   cat conftest.err >&5
8105   echo "$as_me:8105: \$? = $ac_status" >&5
8106   (exit "$ac_status"); } >/dev/null; then
8107   if test -s conftest.err; then
8108     ac_cpp_err=$ac_c_preproc_warn_flag
8109   else
8110     ac_cpp_err=
8111   fi
8112 else
8113   ac_cpp_err=yes
8114 fi
8115 if test -z "$ac_cpp_err"; then
8116   eval "$as_ac_Header=yes"
8117 else
8118   echo "$as_me: failed program was:" >&5
8119   cat "conftest.$ac_ext" >&5
8120   eval "$as_ac_Header=no"
8121 fi
8122 rm -f conftest.err "conftest.$ac_ext"
8123 fi
8124 echo "$as_me:8124: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8125 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8126 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8127   cat >>confdefs.h <<EOF
8128 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8129 EOF
8130
8131 fi
8132 done
8133
8134 cat >>confdefs.h <<\EOF
8135 #define NCURSES 1
8136 EOF
8137
8138 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8139
8140                 cat >>confdefs.h <<EOF
8141 #define $cf_nculib_ROOT 1
8142 EOF
8143
8144                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8145
8146         else
8147
8148 cf_ncuhdr_root=ncursesw
8149
8150 test -n "$cf_cv_curses_dir" && \
8151 test "$cf_cv_curses_dir" != "no" && { \
8152
8153 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8154   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8155   do
8156         while test "$cf_add_incdir" != /usr/include
8157         do
8158           if test -d "$cf_add_incdir"
8159           then
8160                 cf_have_incdir=no
8161                 if test -n "$CFLAGS$CPPFLAGS" ; then
8162                   # a loop is needed to ensure we can add subdirs of existing dirs
8163                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8164                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8165                           cf_have_incdir=yes; break
8166                         fi
8167                   done
8168                 fi
8169
8170                 if test "$cf_have_incdir" = no ; then
8171                   if test "$cf_add_incdir" = /usr/local/include ; then
8172                         if test "$GCC" = yes
8173                         then
8174                           cf_save_CPPFLAGS=$CPPFLAGS
8175
8176         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8177         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8178
8179                           cat >"conftest.$ac_ext" <<_ACEOF
8180 #line 8180 "configure"
8181 #include "confdefs.h"
8182 #include <stdio.h>
8183 int
8184 main (void)
8185 {
8186 printf("Hello")
8187   ;
8188   return 0;
8189 }
8190 _ACEOF
8191 rm -f "conftest.$ac_objext"
8192 if { (eval echo "$as_me:8192: \"$ac_compile\"") >&5
8193   (eval $ac_compile) 2>&5
8194   ac_status=$?
8195   echo "$as_me:8195: \$? = $ac_status" >&5
8196   (exit "$ac_status"); } &&
8197          { ac_try='test -s "conftest.$ac_objext"'
8198   { (eval echo "$as_me:8198: \"$ac_try\"") >&5
8199   (eval $ac_try) 2>&5
8200   ac_status=$?
8201   echo "$as_me:8201: \$? = $ac_status" >&5
8202   (exit "$ac_status"); }; }; then
8203   :
8204 else
8205   echo "$as_me: failed program was:" >&5
8206 cat "conftest.$ac_ext" >&5
8207 cf_have_incdir=yes
8208 fi
8209 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8210                           CPPFLAGS=$cf_save_CPPFLAGS
8211                         fi
8212                   fi
8213                 fi
8214
8215                 if test "$cf_have_incdir" = no ; then
8216                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8217
8218 echo "${as_me:-configure}:8218: testing adding $cf_add_incdir to include-path ..." 1>&5
8219
8220                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8221
8222                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8223                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8224                   cf_add_incdir="$cf_top_incdir"
8225                 else
8226                   break
8227                 fi
8228           else
8229                 break
8230           fi
8231         done
8232   done
8233 fi
8234
8235 }
8236
8237 echo "$as_me:8237: checking for $cf_ncuhdr_root header in include-path" >&5
8238 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8239 if test "${cf_cv_ncurses_h+set}" = set; then
8240   echo $ECHO_N "(cached) $ECHO_C" >&6
8241 else
8242
8243         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8244         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8245         for cf_header in $cf_header_list
8246         do
8247
8248         cat >"conftest.$ac_ext" <<_ACEOF
8249 #line 8249 "configure"
8250 #include "confdefs.h"
8251
8252 #define _XOPEN_SOURCE_EXTENDED
8253 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8254 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8255
8256 #include <$cf_header>
8257 int
8258 main (void)
8259 {
8260
8261 #ifdef NCURSES_VERSION
8262
8263 #ifndef WACS_BSSB
8264         make an error
8265 #endif
8266
8267 printf("%s\\n", NCURSES_VERSION);
8268 #else
8269 #ifdef __NCURSES_H
8270 printf("old\\n");
8271 #else
8272         make an error
8273 #endif
8274 #endif
8275
8276   ;
8277   return 0;
8278 }
8279 _ACEOF
8280 rm -f "conftest.$ac_objext"
8281 if { (eval echo "$as_me:8281: \"$ac_compile\"") >&5
8282   (eval $ac_compile) 2>&5
8283   ac_status=$?
8284   echo "$as_me:8284: \$? = $ac_status" >&5
8285   (exit "$ac_status"); } &&
8286          { ac_try='test -s "conftest.$ac_objext"'
8287   { (eval echo "$as_me:8287: \"$ac_try\"") >&5
8288   (eval $ac_try) 2>&5
8289   ac_status=$?
8290   echo "$as_me:8290: \$? = $ac_status" >&5
8291   (exit "$ac_status"); }; }; then
8292   cf_cv_ncurses_h=$cf_header
8293
8294 else
8295   echo "$as_me: failed program was:" >&5
8296 cat "conftest.$ac_ext" >&5
8297 cf_cv_ncurses_h=no
8298 fi
8299 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8300
8301                 test "$cf_cv_ncurses_h" != no && break
8302         done
8303
8304 fi
8305 echo "$as_me:8305: result: $cf_cv_ncurses_h" >&5
8306 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8307
8308 if test "$cf_cv_ncurses_h" != no ; then
8309         cf_cv_ncurses_header=$cf_cv_ncurses_h
8310 else
8311
8312 echo "$as_me:8312: checking for $cf_ncuhdr_root include-path" >&5
8313 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8314 if test "${cf_cv_ncurses_h2+set}" = set; then
8315   echo $ECHO_N "(cached) $ECHO_C" >&6
8316 else
8317
8318         test -n "$verbose" && echo
8319
8320 cf_search=
8321
8322 # collect the current set of include-directories from compiler flags
8323 cf_header_path_list=""
8324 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8325         for cf_header_path in $CPPFLAGS $CFLAGS
8326         do
8327                 case "$cf_header_path" in
8328                 (-I*)
8329                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8330
8331 test "x$cf_header_path" != "xNONE" && \
8332 test -d "$cf_header_path" && \
8333  {
8334         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8335         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8336         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8337         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8338         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8339         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"
8340 }
8341
8342                         cf_header_path_list="$cf_header_path_list $cf_search"
8343                         ;;
8344                 esac
8345         done
8346 fi
8347
8348 # add the variations for the package we are looking for
8349
8350 cf_search=
8351
8352 test "x$prefix" != "xNONE" && \
8353 test -d "$prefix" && \
8354  {
8355         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8356         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8357         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8358         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8359         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8360         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8361 }
8362
8363 for cf_subdir_prefix in \
8364         /usr \
8365         /usr/local \
8366         /usr/pkg \
8367         /opt \
8368         /opt/local \
8369         $HOME
8370 do
8371
8372 test "x$cf_subdir_prefix" != "x$prefix" && \
8373 test -d "$cf_subdir_prefix" && \
8374 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8375         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8376         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8377         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8378         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8379         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8380         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"
8381 }
8382
8383 done
8384
8385 test "$includedir" != NONE && \
8386 test "$includedir" != "/usr/include" && \
8387 test -d "$includedir" && {
8388         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8389         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8390 }
8391
8392 test "$oldincludedir" != NONE && \
8393 test "$oldincludedir" != "/usr/include" && \
8394 test -d "$oldincludedir" && {
8395         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8396         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8397 }
8398
8399 cf_search="$cf_search $cf_header_path_list"
8400
8401         test -n "$verbose" && echo "search path $cf_search"
8402         cf_save2_CPPFLAGS="$CPPFLAGS"
8403         for cf_incdir in $cf_search
8404         do
8405
8406 if test -n "$cf_incdir" ; then
8407   for cf_add_incdir in $cf_incdir
8408   do
8409         while test "$cf_add_incdir" != /usr/include
8410         do
8411           if test -d "$cf_add_incdir"
8412           then
8413                 cf_have_incdir=no
8414                 if test -n "$CFLAGS$CPPFLAGS" ; then
8415                   # a loop is needed to ensure we can add subdirs of existing dirs
8416                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8417                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8418                           cf_have_incdir=yes; break
8419                         fi
8420                   done
8421                 fi
8422
8423                 if test "$cf_have_incdir" = no ; then
8424                   if test "$cf_add_incdir" = /usr/local/include ; then
8425                         if test "$GCC" = yes
8426                         then
8427                           cf_save_CPPFLAGS=$CPPFLAGS
8428
8429         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8430         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8431
8432                           cat >"conftest.$ac_ext" <<_ACEOF
8433 #line 8433 "configure"
8434 #include "confdefs.h"
8435 #include <stdio.h>
8436 int
8437 main (void)
8438 {
8439 printf("Hello")
8440   ;
8441   return 0;
8442 }
8443 _ACEOF
8444 rm -f "conftest.$ac_objext"
8445 if { (eval echo "$as_me:8445: \"$ac_compile\"") >&5
8446   (eval $ac_compile) 2>&5
8447   ac_status=$?
8448   echo "$as_me:8448: \$? = $ac_status" >&5
8449   (exit "$ac_status"); } &&
8450          { ac_try='test -s "conftest.$ac_objext"'
8451   { (eval echo "$as_me:8451: \"$ac_try\"") >&5
8452   (eval $ac_try) 2>&5
8453   ac_status=$?
8454   echo "$as_me:8454: \$? = $ac_status" >&5
8455   (exit "$ac_status"); }; }; then
8456   :
8457 else
8458   echo "$as_me: failed program was:" >&5
8459 cat "conftest.$ac_ext" >&5
8460 cf_have_incdir=yes
8461 fi
8462 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8463                           CPPFLAGS=$cf_save_CPPFLAGS
8464                         fi
8465                   fi
8466                 fi
8467
8468                 if test "$cf_have_incdir" = no ; then
8469                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8470
8471 echo "${as_me:-configure}:8471: testing adding $cf_add_incdir to include-path ..." 1>&5
8472
8473                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8474
8475                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8476                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8477                   cf_add_incdir="$cf_top_incdir"
8478                 else
8479                   break
8480                 fi
8481           else
8482                 break
8483           fi
8484         done
8485   done
8486 fi
8487
8488                 for cf_header in \
8489                         ncurses.h \
8490                         curses.h
8491                 do
8492
8493         cat >"conftest.$ac_ext" <<_ACEOF
8494 #line 8494 "configure"
8495 #include "confdefs.h"
8496
8497 #include <$cf_header>
8498 int
8499 main (void)
8500 {
8501
8502 #ifdef NCURSES_VERSION
8503
8504 printf("%s\\n", NCURSES_VERSION);
8505 #else
8506 #ifdef __NCURSES_H
8507 printf("old\\n");
8508 #else
8509         make an error
8510 #endif
8511 #endif
8512
8513   ;
8514   return 0;
8515 }
8516 _ACEOF
8517 rm -f "conftest.$ac_objext"
8518 if { (eval echo "$as_me:8518: \"$ac_compile\"") >&5
8519   (eval $ac_compile) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit "$ac_status"); } &&
8523          { ac_try='test -s "conftest.$ac_objext"'
8524   { (eval echo "$as_me:8524: \"$ac_try\"") >&5
8525   (eval $ac_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit "$ac_status"); }; }; then
8529   cf_cv_ncurses_h2=$cf_header
8530
8531 else
8532   echo "$as_me: failed program was:" >&5
8533 cat "conftest.$ac_ext" >&5
8534 cf_cv_ncurses_h2=no
8535 fi
8536 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8537
8538                         if test "$cf_cv_ncurses_h2" != no ; then
8539                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8540                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8541                                 break
8542                         fi
8543                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8544                 done
8545                 CPPFLAGS="$cf_save2_CPPFLAGS"
8546                 test "$cf_cv_ncurses_h2" != no && break
8547         done
8548         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8548: error: not found" >&5
8549 echo "$as_me: error: not found" >&2;}
8550    { (exit 1); exit 1; }; }
8551
8552 fi
8553 echo "$as_me:8553: result: $cf_cv_ncurses_h2" >&5
8554 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8555
8556         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8557         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8558         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8559                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8560         fi
8561
8562 if test -n "$cf_1st_incdir" ; then
8563   for cf_add_incdir in $cf_1st_incdir
8564   do
8565         while test "$cf_add_incdir" != /usr/include
8566         do
8567           if test -d "$cf_add_incdir"
8568           then
8569                 cf_have_incdir=no
8570                 if test -n "$CFLAGS$CPPFLAGS" ; then
8571                   # a loop is needed to ensure we can add subdirs of existing dirs
8572                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8573                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8574                           cf_have_incdir=yes; break
8575                         fi
8576                   done
8577                 fi
8578
8579                 if test "$cf_have_incdir" = no ; then
8580                   if test "$cf_add_incdir" = /usr/local/include ; then
8581                         if test "$GCC" = yes
8582                         then
8583                           cf_save_CPPFLAGS=$CPPFLAGS
8584
8585         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8586         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8587
8588                           cat >"conftest.$ac_ext" <<_ACEOF
8589 #line 8589 "configure"
8590 #include "confdefs.h"
8591 #include <stdio.h>
8592 int
8593 main (void)
8594 {
8595 printf("Hello")
8596   ;
8597   return 0;
8598 }
8599 _ACEOF
8600 rm -f "conftest.$ac_objext"
8601 if { (eval echo "$as_me:8601: \"$ac_compile\"") >&5
8602   (eval $ac_compile) 2>&5
8603   ac_status=$?
8604   echo "$as_me:8604: \$? = $ac_status" >&5
8605   (exit "$ac_status"); } &&
8606          { ac_try='test -s "conftest.$ac_objext"'
8607   { (eval echo "$as_me:8607: \"$ac_try\"") >&5
8608   (eval $ac_try) 2>&5
8609   ac_status=$?
8610   echo "$as_me:8610: \$? = $ac_status" >&5
8611   (exit "$ac_status"); }; }; then
8612   :
8613 else
8614   echo "$as_me: failed program was:" >&5
8615 cat "conftest.$ac_ext" >&5
8616 cf_have_incdir=yes
8617 fi
8618 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8619                           CPPFLAGS=$cf_save_CPPFLAGS
8620                         fi
8621                   fi
8622                 fi
8623
8624                 if test "$cf_have_incdir" = no ; then
8625                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8626
8627 echo "${as_me:-configure}:8627: testing adding $cf_add_incdir to include-path ..." 1>&5
8628
8629                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8630
8631                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8632                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8633                   cf_add_incdir="$cf_top_incdir"
8634                 else
8635                   break
8636                 fi
8637           else
8638                 break
8639           fi
8640         done
8641   done
8642 fi
8643
8644 fi
8645
8646 # Set definitions to allow ifdef'ing for ncurses.h
8647
8648 case "$cf_cv_ncurses_header" in
8649 (*ncurses.h)
8650
8651 cat >>confdefs.h <<\EOF
8652 #define HAVE_NCURSES_H 1
8653 EOF
8654
8655         ;;
8656 esac
8657
8658 case "$cf_cv_ncurses_header" in
8659 (ncurses/curses.h|ncurses/ncurses.h)
8660
8661 cat >>confdefs.h <<\EOF
8662 #define HAVE_NCURSES_NCURSES_H 1
8663 EOF
8664
8665         ;;
8666 (ncursesw/curses.h|ncursesw/ncurses.h)
8667
8668 cat >>confdefs.h <<\EOF
8669 #define HAVE_NCURSESW_NCURSES_H 1
8670 EOF
8671
8672         ;;
8673 esac
8674
8675 echo "$as_me:8675: checking for terminfo header" >&5
8676 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8677 if test "${cf_cv_term_header+set}" = set; then
8678   echo $ECHO_N "(cached) $ECHO_C" >&6
8679 else
8680
8681 case "${cf_cv_ncurses_header}" in
8682 (*/ncurses.h|*/ncursesw.h)
8683         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8684         ;;
8685 (*)
8686         cf_term_header=term.h
8687         ;;
8688 esac
8689
8690 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8691 do
8692 cat >"conftest.$ac_ext" <<_ACEOF
8693 #line 8693 "configure"
8694 #include "confdefs.h"
8695 #include <stdio.h>
8696 #include <${cf_cv_ncurses_header:-curses.h}>
8697 #include <$cf_test>
8698
8699 int
8700 main (void)
8701 {
8702 int x = auto_left_margin; (void)x
8703   ;
8704   return 0;
8705 }
8706 _ACEOF
8707 rm -f "conftest.$ac_objext"
8708 if { (eval echo "$as_me:8708: \"$ac_compile\"") >&5
8709   (eval $ac_compile) 2>&5
8710   ac_status=$?
8711   echo "$as_me:8711: \$? = $ac_status" >&5
8712   (exit "$ac_status"); } &&
8713          { ac_try='test -s "conftest.$ac_objext"'
8714   { (eval echo "$as_me:8714: \"$ac_try\"") >&5
8715   (eval $ac_try) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit "$ac_status"); }; }; then
8719
8720         cf_cv_term_header="$cf_test"
8721 else
8722   echo "$as_me: failed program was:" >&5
8723 cat "conftest.$ac_ext" >&5
8724
8725         cf_cv_term_header=unknown
8726
8727 fi
8728 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8729         test "$cf_cv_term_header" != unknown && break
8730 done
8731
8732 fi
8733 echo "$as_me:8733: result: $cf_cv_term_header" >&5
8734 echo "${ECHO_T}$cf_cv_term_header" >&6
8735
8736 # Set definitions to allow ifdef'ing to accommodate subdirectories
8737
8738 case "$cf_cv_term_header" in
8739 (*term.h)
8740
8741 cat >>confdefs.h <<\EOF
8742 #define HAVE_TERM_H 1
8743 EOF
8744
8745         ;;
8746 esac
8747
8748 case "$cf_cv_term_header" in
8749 (ncurses/term.h)
8750
8751 cat >>confdefs.h <<\EOF
8752 #define HAVE_NCURSES_TERM_H 1
8753 EOF
8754
8755         ;;
8756 (ncursesw/term.h)
8757
8758 cat >>confdefs.h <<\EOF
8759 #define HAVE_NCURSESW_TERM_H 1
8760 EOF
8761
8762         ;;
8763 esac
8764
8765 # some applications need this, but should check for NCURSES_VERSION
8766
8767 cat >>confdefs.h <<\EOF
8768 #define NCURSES 1
8769 EOF
8770
8771 echo "$as_me:8771: checking for ncurses version" >&5
8772 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8773 if test "${cf_cv_ncurses_version+set}" = set; then
8774   echo $ECHO_N "(cached) $ECHO_C" >&6
8775 else
8776
8777         cf_cv_ncurses_version=no
8778         cf_tempfile=out$$
8779         rm -f "$cf_tempfile"
8780         if test "$cross_compiling" = yes; then
8781
8782         # This will not work if the preprocessor splits the line after the
8783         # Autoconf token.  The 'unproto' program does that.
8784         cat > "conftest.$ac_ext" <<EOF
8785 #include <${cf_cv_ncurses_header:-curses.h}>
8786 #undef Autoconf
8787 #ifdef NCURSES_VERSION
8788 Autoconf NCURSES_VERSION
8789 #else
8790 #ifdef __NCURSES_H
8791 Autoconf "old"
8792 #endif
8793 ;
8794 #endif
8795 EOF
8796         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8797         { (eval echo "$as_me:8797: \"$cf_try\"") >&5
8798   (eval $cf_try) 2>&5
8799   ac_status=$?
8800   echo "$as_me:8800: \$? = $ac_status" >&5
8801   (exit "$ac_status"); }
8802         if test -f conftest.out ; then
8803                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8804                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8805                 rm -f conftest.out
8806         fi
8807
8808 else
8809   cat >"conftest.$ac_ext" <<_ACEOF
8810 #line 8810 "configure"
8811 #include "confdefs.h"
8812
8813 #include <${cf_cv_ncurses_header:-curses.h}>
8814 #include <stdio.h>
8815 int main(void)
8816 {
8817         FILE *fp = fopen("$cf_tempfile", "w");
8818 #ifdef NCURSES_VERSION
8819 # ifdef NCURSES_VERSION_PATCH
8820         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8821 # else
8822         fprintf(fp, "%s\\n", NCURSES_VERSION);
8823 # endif
8824 #else
8825 # ifdef __NCURSES_H
8826         fprintf(fp, "old\\n");
8827 # else
8828         make an error
8829 # endif
8830 #endif
8831         ${cf_cv_main_return:-return}(0);
8832 }
8833 _ACEOF
8834 rm -f "conftest$ac_exeext"
8835 if { (eval echo "$as_me:8835: \"$ac_link\"") >&5
8836   (eval $ac_link) 2>&5
8837   ac_status=$?
8838   echo "$as_me:8838: \$? = $ac_status" >&5
8839   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8840   { (eval echo "$as_me:8840: \"$ac_try\"") >&5
8841   (eval $ac_try) 2>&5
8842   ac_status=$?
8843   echo "$as_me:8843: \$? = $ac_status" >&5
8844   (exit "$ac_status"); }; }; then
8845
8846         cf_cv_ncurses_version=`cat $cf_tempfile`
8847 else
8848   echo "$as_me: program exited with status $ac_status" >&5
8849 echo "$as_me: failed program was:" >&5
8850 cat "conftest.$ac_ext" >&5
8851 fi
8852 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8853 fi
8854         rm -f "$cf_tempfile"
8855
8856 fi
8857 echo "$as_me:8857: result: $cf_cv_ncurses_version" >&5
8858 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8859 test "$cf_cv_ncurses_version" = no ||
8860 cat >>confdefs.h <<\EOF
8861 #define NCURSES 1
8862 EOF
8863
8864 cf_nculib_root=ncursesw
8865         # This works, except for the special case where we find gpm, but
8866         # ncurses is in a nonstandard location via $LIBS, and we really want
8867         # to link gpm.
8868 cf_ncurses_LIBS=""
8869 cf_ncurses_SAVE="$LIBS"
8870 echo "$as_me:8870: checking for Gpm_Open in -lgpm" >&5
8871 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8872 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8873   echo $ECHO_N "(cached) $ECHO_C" >&6
8874 else
8875   ac_check_lib_save_LIBS=$LIBS
8876 LIBS="-lgpm  $LIBS"
8877 cat >"conftest.$ac_ext" <<_ACEOF
8878 #line 8878 "configure"
8879 #include "confdefs.h"
8880
8881 /* Override any gcc2 internal prototype to avoid an error.  */
8882 #ifdef __cplusplus
8883 extern "C"
8884 #endif
8885 /* We use char because int might match the return type of a gcc2
8886    builtin and then its argument prototype would still apply.  */
8887 char Gpm_Open ();
8888 int
8889 main (void)
8890 {
8891 Gpm_Open ();
8892   ;
8893   return 0;
8894 }
8895 _ACEOF
8896 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8897 if { (eval echo "$as_me:8897: \"$ac_link\"") >&5
8898   (eval $ac_link) 2>&5
8899   ac_status=$?
8900   echo "$as_me:8900: \$? = $ac_status" >&5
8901   (exit "$ac_status"); } &&
8902          { ac_try='test -s "conftest$ac_exeext"'
8903   { (eval echo "$as_me:8903: \"$ac_try\"") >&5
8904   (eval $ac_try) 2>&5
8905   ac_status=$?
8906   echo "$as_me:8906: \$? = $ac_status" >&5
8907   (exit "$ac_status"); }; }; then
8908   ac_cv_lib_gpm_Gpm_Open=yes
8909 else
8910   echo "$as_me: failed program was:" >&5
8911 cat "conftest.$ac_ext" >&5
8912 ac_cv_lib_gpm_Gpm_Open=no
8913 fi
8914 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8915 LIBS=$ac_check_lib_save_LIBS
8916 fi
8917 echo "$as_me:8917: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8918 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8919 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8920   echo "$as_me:8920: checking for initscr in -lgpm" >&5
8921 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8922 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8923   echo $ECHO_N "(cached) $ECHO_C" >&6
8924 else
8925   ac_check_lib_save_LIBS=$LIBS
8926 LIBS="-lgpm  $LIBS"
8927 cat >"conftest.$ac_ext" <<_ACEOF
8928 #line 8928 "configure"
8929 #include "confdefs.h"
8930
8931 /* Override any gcc2 internal prototype to avoid an error.  */
8932 #ifdef __cplusplus
8933 extern "C"
8934 #endif
8935 /* We use char because int might match the return type of a gcc2
8936    builtin and then its argument prototype would still apply.  */
8937 char initscr ();
8938 int
8939 main (void)
8940 {
8941 initscr ();
8942   ;
8943   return 0;
8944 }
8945 _ACEOF
8946 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8947 if { (eval echo "$as_me:8947: \"$ac_link\"") >&5
8948   (eval $ac_link) 2>&5
8949   ac_status=$?
8950   echo "$as_me:8950: \$? = $ac_status" >&5
8951   (exit "$ac_status"); } &&
8952          { ac_try='test -s "conftest$ac_exeext"'
8953   { (eval echo "$as_me:8953: \"$ac_try\"") >&5
8954   (eval $ac_try) 2>&5
8955   ac_status=$?
8956   echo "$as_me:8956: \$? = $ac_status" >&5
8957   (exit "$ac_status"); }; }; then
8958   ac_cv_lib_gpm_initscr=yes
8959 else
8960   echo "$as_me: failed program was:" >&5
8961 cat "conftest.$ac_ext" >&5
8962 ac_cv_lib_gpm_initscr=no
8963 fi
8964 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8965 LIBS=$ac_check_lib_save_LIBS
8966 fi
8967 echo "$as_me:8967: result: $ac_cv_lib_gpm_initscr" >&5
8968 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8969 if test "$ac_cv_lib_gpm_initscr" = yes; then
8970   LIBS="$cf_ncurses_SAVE"
8971 else
8972   cf_ncurses_LIBS="-lgpm"
8973 fi
8974
8975 fi
8976
8977 case "$host_os" in
8978 (freebsd*)
8979         # This is only necessary if you are linking against an obsolete
8980         # version of ncurses (but it should do no harm, since it is static).
8981         if test "$cf_nculib_root" = ncurses ; then
8982                 echo "$as_me:8982: checking for tgoto in -lmytinfo" >&5
8983 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8984 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8985   echo $ECHO_N "(cached) $ECHO_C" >&6
8986 else
8987   ac_check_lib_save_LIBS=$LIBS
8988 LIBS="-lmytinfo  $LIBS"
8989 cat >"conftest.$ac_ext" <<_ACEOF
8990 #line 8990 "configure"
8991 #include "confdefs.h"
8992
8993 /* Override any gcc2 internal prototype to avoid an error.  */
8994 #ifdef __cplusplus
8995 extern "C"
8996 #endif
8997 /* We use char because int might match the return type of a gcc2
8998    builtin and then its argument prototype would still apply.  */
8999 char tgoto ();
9000 int
9001 main (void)
9002 {
9003 tgoto ();
9004   ;
9005   return 0;
9006 }
9007 _ACEOF
9008 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9009 if { (eval echo "$as_me:9009: \"$ac_link\"") >&5
9010   (eval $ac_link) 2>&5
9011   ac_status=$?
9012   echo "$as_me:9012: \$? = $ac_status" >&5
9013   (exit "$ac_status"); } &&
9014          { ac_try='test -s "conftest$ac_exeext"'
9015   { (eval echo "$as_me:9015: \"$ac_try\"") >&5
9016   (eval $ac_try) 2>&5
9017   ac_status=$?
9018   echo "$as_me:9018: \$? = $ac_status" >&5
9019   (exit "$ac_status"); }; }; then
9020   ac_cv_lib_mytinfo_tgoto=yes
9021 else
9022   echo "$as_me: failed program was:" >&5
9023 cat "conftest.$ac_ext" >&5
9024 ac_cv_lib_mytinfo_tgoto=no
9025 fi
9026 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9027 LIBS=$ac_check_lib_save_LIBS
9028 fi
9029 echo "$as_me:9029: result: $ac_cv_lib_mytinfo_tgoto" >&5
9030 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9031 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9032   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9033 fi
9034
9035         fi
9036         ;;
9037 esac
9038
9039 cf_add_libs="$LIBS"
9040 # reverse order
9041 cf_add_0lib=
9042 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9043 # filter duplicates
9044 for cf_add_1lib in $cf_add_0lib; do
9045         for cf_add_2lib in $cf_add_libs; do
9046                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9047                         cf_add_1lib=
9048                         break
9049                 fi
9050         done
9051         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9052 done
9053 LIBS="$cf_add_libs"
9054
9055 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9056 then
9057
9058 cf_add_libs="$LIBS"
9059 # reverse order
9060 cf_add_0lib=
9061 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9062 # filter duplicates
9063 for cf_add_1lib in $cf_add_0lib; do
9064         for cf_add_2lib in $cf_add_libs; do
9065                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9066                         cf_add_1lib=
9067                         break
9068                 fi
9069         done
9070         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9071 done
9072 LIBS="$cf_add_libs"
9073
9074 else
9075
9076         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9077         cf_libdir=""
9078         echo "$as_me:9078: checking for initscr" >&5
9079 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9080 if test "${ac_cv_func_initscr+set}" = set; then
9081   echo $ECHO_N "(cached) $ECHO_C" >&6
9082 else
9083   cat >"conftest.$ac_ext" <<_ACEOF
9084 #line 9084 "configure"
9085 #include "confdefs.h"
9086 #define initscr autoconf_temporary
9087 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9088 #undef initscr
9089
9090 #ifdef __cplusplus
9091 extern "C"
9092 #endif
9093
9094 /* We use char because int might match the return type of a gcc2
9095    builtin and then its argument prototype would still apply.  */
9096 char initscr (void);
9097
9098 int
9099 main (void)
9100 {
9101
9102 /* The GNU C library defines stubs for functions which it implements
9103     to always fail with ENOSYS.  Some functions are actually named
9104     something starting with __ and the normal name is an alias.  */
9105 #if defined (__stub_initscr) || defined (__stub___initscr)
9106 #error found stub for initscr
9107 #endif
9108
9109         return initscr ();
9110   ;
9111   return 0;
9112 }
9113 _ACEOF
9114 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9115 if { (eval echo "$as_me:9115: \"$ac_link\"") >&5
9116   (eval $ac_link) 2>&5
9117   ac_status=$?
9118   echo "$as_me:9118: \$? = $ac_status" >&5
9119   (exit "$ac_status"); } &&
9120          { ac_try='test -s "conftest$ac_exeext"'
9121   { (eval echo "$as_me:9121: \"$ac_try\"") >&5
9122   (eval $ac_try) 2>&5
9123   ac_status=$?
9124   echo "$as_me:9124: \$? = $ac_status" >&5
9125   (exit "$ac_status"); }; }; then
9126   ac_cv_func_initscr=yes
9127 else
9128   echo "$as_me: failed program was:" >&5
9129 cat "conftest.$ac_ext" >&5
9130 ac_cv_func_initscr=no
9131 fi
9132 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9133 fi
9134 echo "$as_me:9134: result: $ac_cv_func_initscr" >&5
9135 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9136 if test "$ac_cv_func_initscr" = yes; then
9137   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9138 else
9139
9140                 cf_save_LIBS="$LIBS"
9141                 echo "$as_me:9141: checking for initscr in -l$cf_nculib_root" >&5
9142 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9143                 LIBS="-l$cf_nculib_root $LIBS"
9144                 cat >"conftest.$ac_ext" <<_ACEOF
9145 #line 9145 "configure"
9146 #include "confdefs.h"
9147 #include <${cf_cv_ncurses_header:-curses.h}>
9148 int
9149 main (void)
9150 {
9151 initscr()
9152   ;
9153   return 0;
9154 }
9155 _ACEOF
9156 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9157 if { (eval echo "$as_me:9157: \"$ac_link\"") >&5
9158   (eval $ac_link) 2>&5
9159   ac_status=$?
9160   echo "$as_me:9160: \$? = $ac_status" >&5
9161   (exit "$ac_status"); } &&
9162          { ac_try='test -s "conftest$ac_exeext"'
9163   { (eval echo "$as_me:9163: \"$ac_try\"") >&5
9164   (eval $ac_try) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit "$ac_status"); }; }; then
9168   echo "$as_me:9168: result: yes" >&5
9169 echo "${ECHO_T}yes" >&6
9170                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9171
9172 else
9173   echo "$as_me: failed program was:" >&5
9174 cat "conftest.$ac_ext" >&5
9175 echo "$as_me:9175: result: no" >&5
9176 echo "${ECHO_T}no" >&6
9177
9178 cf_search=
9179 cf_library_path_list=""
9180 if test -n "${LDFLAGS}${LIBS}" ; then
9181         for cf_library_path in $LDFLAGS $LIBS
9182         do
9183                 case "$cf_library_path" in
9184                 (-L*)
9185                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9186
9187 test "x$cf_library_path" != "xNONE" && \
9188 test -d "$cf_library_path" && \
9189  {
9190         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9191         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9192         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9193         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9194         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9195         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"
9196 }
9197
9198                         cf_library_path_list="$cf_library_path_list $cf_search"
9199                         ;;
9200                 esac
9201         done
9202 fi
9203
9204 cf_search=
9205
9206 test "x$prefix" != "xNONE" && \
9207 test -d "$prefix" && \
9208  {
9209         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9210         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9211         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9212         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9213         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9214         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9215 }
9216
9217 for cf_subdir_prefix in \
9218         /usr \
9219         /usr/local \
9220         /usr/pkg \
9221         /opt \
9222         /opt/local \
9223         $HOME
9224 do
9225
9226 test "x$cf_subdir_prefix" != "x$prefix" && \
9227 test -d "$cf_subdir_prefix" && \
9228 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9229         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9230         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9231         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9232         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9233         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9234         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"
9235 }
9236
9237 done
9238
9239 cf_search="$cf_library_path_list $cf_search"
9240
9241                         for cf_libdir in $cf_search
9242                         do
9243                                 echo "$as_me:9243: checking for -l$cf_nculib_root in $cf_libdir" >&5
9244 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9245                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9246                                 cat >"conftest.$ac_ext" <<_ACEOF
9247 #line 9247 "configure"
9248 #include "confdefs.h"
9249 #include <${cf_cv_ncurses_header:-curses.h}>
9250 int
9251 main (void)
9252 {
9253 initscr()
9254   ;
9255   return 0;
9256 }
9257 _ACEOF
9258 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9259 if { (eval echo "$as_me:9259: \"$ac_link\"") >&5
9260   (eval $ac_link) 2>&5
9261   ac_status=$?
9262   echo "$as_me:9262: \$? = $ac_status" >&5
9263   (exit "$ac_status"); } &&
9264          { ac_try='test -s "conftest$ac_exeext"'
9265   { (eval echo "$as_me:9265: \"$ac_try\"") >&5
9266   (eval $ac_try) 2>&5
9267   ac_status=$?
9268   echo "$as_me:9268: \$? = $ac_status" >&5
9269   (exit "$ac_status"); }; }; then
9270   echo "$as_me:9270: result: yes" >&5
9271 echo "${ECHO_T}yes" >&6
9272                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9273                                          break
9274 else
9275   echo "$as_me: failed program was:" >&5
9276 cat "conftest.$ac_ext" >&5
9277 echo "$as_me:9277: result: no" >&5
9278 echo "${ECHO_T}no" >&6
9279                                          LIBS="$cf_save_LIBS"
9280 fi
9281 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9282                         done
9283
9284 fi
9285 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9286
9287 fi
9288
9289 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9290
9291 if test "$cf_found_library" = no ; then
9292         { { echo "$as_me:9292: error: Cannot link $cf_nculib_root library" >&5
9293 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9294    { (exit 1); exit 1; }; }
9295 fi
9296
9297 fi
9298
9299 if test -n "$cf_ncurses_LIBS" ; then
9300         echo "$as_me:9300: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9301 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9302         cf_ncurses_SAVE="$LIBS"
9303         for p in $cf_ncurses_LIBS ; do
9304                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9305                 if test "$q" != "$LIBS" ; then
9306                         LIBS="$q"
9307                 fi
9308         done
9309         cat >"conftest.$ac_ext" <<_ACEOF
9310 #line 9310 "configure"
9311 #include "confdefs.h"
9312 #include <${cf_cv_ncurses_header:-curses.h}>
9313 int
9314 main (void)
9315 {
9316 initscr(); mousemask(0,0); tigetstr((char *)0);
9317   ;
9318   return 0;
9319 }
9320 _ACEOF
9321 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9322 if { (eval echo "$as_me:9322: \"$ac_link\"") >&5
9323   (eval $ac_link) 2>&5
9324   ac_status=$?
9325   echo "$as_me:9325: \$? = $ac_status" >&5
9326   (exit "$ac_status"); } &&
9327          { ac_try='test -s "conftest$ac_exeext"'
9328   { (eval echo "$as_me:9328: \"$ac_try\"") >&5
9329   (eval $ac_try) 2>&5
9330   ac_status=$?
9331   echo "$as_me:9331: \$? = $ac_status" >&5
9332   (exit "$ac_status"); }; }; then
9333   echo "$as_me:9333: result: yes" >&5
9334 echo "${ECHO_T}yes" >&6
9335 else
9336   echo "$as_me: failed program was:" >&5
9337 cat "conftest.$ac_ext" >&5
9338 echo "$as_me:9338: result: no" >&5
9339 echo "${ECHO_T}no" >&6
9340                  LIBS="$cf_ncurses_SAVE"
9341 fi
9342 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9343 fi
9344
9345 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9346
9347 cat >>confdefs.h <<EOF
9348 #define $cf_nculib_ROOT 1
9349 EOF
9350
9351         fi
9352 else
9353         NCURSES_CONFIG=none
9354 fi
9355
9356 else
9357
9358 cf_ncuconfig_root=ncurses
9359 cf_have_ncuconfig=no
9360
9361 if test "x${PKG_CONFIG:=none}" != xnone; then
9362         echo "$as_me:9362: checking pkg-config for $cf_ncuconfig_root" >&5
9363 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9364         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9365                 echo "$as_me:9365: result: yes" >&5
9366 echo "${ECHO_T}yes" >&6
9367
9368                 echo "$as_me:9368: checking if the $cf_ncuconfig_root package files work" >&5
9369 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9370                 cf_have_ncuconfig=unknown
9371
9372                 cf_save_CFLAGS="$CFLAGS"
9373                 cf_save_CPPFLAGS="$CPPFLAGS"
9374                 cf_save_LIBS="$LIBS"
9375
9376                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9377                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9378
9379                 # while -W for passing linker flags is prevalent, it is not "standard".
9380                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9381                 # incompatible _and_ non-standard -W option which gives an error.  Work
9382                 # around that pitfall.
9383                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9384                 (x*c[89]9@@*-W*)
9385
9386 cf_fix_cppflags=no
9387 cf_new_cflags=
9388 cf_new_cppflags=
9389 cf_new_extra_cppflags=
9390
9391 for cf_add_cflags in $cf_pkg_cflags
9392 do
9393 case "$cf_fix_cppflags" in
9394 (no)
9395         case "$cf_add_cflags" in
9396         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9397                 case "$cf_add_cflags" in
9398                 (-D*)
9399                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9400
9401                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9402                                 && test -z "${cf_tst_cflags}" \
9403                                 && cf_fix_cppflags=yes
9404
9405                         if test "$cf_fix_cppflags" = yes ; then
9406
9407         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9408         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9409
9410                                 continue
9411                         elif test "${cf_tst_cflags}" = "\"'" ; then
9412
9413         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9414         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9415
9416                                 continue
9417                         fi
9418                         ;;
9419                 esac
9420                 case "$CPPFLAGS" in
9421                 (*$cf_add_cflags)
9422                         ;;
9423                 (*)
9424                         case "$cf_add_cflags" in
9425                         (-D*)
9426                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9427
9428 CPPFLAGS=`echo "$CPPFLAGS" | \
9429         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9430                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9431
9432                                 ;;
9433                         esac
9434
9435         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9436         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9437
9438                         ;;
9439                 esac
9440                 ;;
9441         (*)
9442
9443         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9444         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9445
9446                 ;;
9447         esac
9448         ;;
9449 (yes)
9450
9451         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9452         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9453
9454         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9455
9456         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9457                 && test -z "${cf_tst_cflags}" \
9458                 && cf_fix_cppflags=no
9459         ;;
9460 esac
9461 done
9462
9463 if test -n "$cf_new_cflags" ; then
9464
9465         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9466         CFLAGS="${CFLAGS}$cf_new_cflags"
9467
9468 fi
9469
9470 if test -n "$cf_new_cppflags" ; then
9471
9472         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9473         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9474
9475 fi
9476
9477 if test -n "$cf_new_extra_cppflags" ; then
9478
9479         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9480         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9481
9482 fi
9483
9484 cf_add_libs="$LIBS"
9485 # reverse order
9486 cf_add_0lib=
9487 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9488 # filter duplicates
9489 for cf_add_1lib in $cf_add_0lib; do
9490         for cf_add_2lib in $cf_add_libs; do
9491                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9492                         cf_add_1lib=
9493                         break
9494                 fi
9495         done
9496         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9497 done
9498 LIBS="$cf_add_libs"
9499
9500                         cat >"conftest.$ac_ext" <<_ACEOF
9501 #line 9501 "configure"
9502 #include "confdefs.h"
9503 #include <${cf_cv_ncurses_header:-curses.h}>
9504 int
9505 main (void)
9506 {
9507 initscr(); mousemask(0,0); tigetstr((char *)0);
9508   ;
9509   return 0;
9510 }
9511 _ACEOF
9512 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9513 if { (eval echo "$as_me:9513: \"$ac_link\"") >&5
9514   (eval $ac_link) 2>&5
9515   ac_status=$?
9516   echo "$as_me:9516: \$? = $ac_status" >&5
9517   (exit "$ac_status"); } &&
9518          { ac_try='test -s "conftest$ac_exeext"'
9519   { (eval echo "$as_me:9519: \"$ac_try\"") >&5
9520   (eval $ac_try) 2>&5
9521   ac_status=$?
9522   echo "$as_me:9522: \$? = $ac_status" >&5
9523   (exit "$ac_status"); }; }; then
9524   if test "$cross_compiling" = yes; then
9525   cf_test_ncuconfig=maybe
9526 else
9527   cat >"conftest.$ac_ext" <<_ACEOF
9528 #line 9528 "configure"
9529 #include "confdefs.h"
9530 #include <${cf_cv_ncurses_header:-curses.h}>
9531                                         int main(void)
9532                                         { const char *xx = curses_version(); return (xx == 0); }
9533 _ACEOF
9534 rm -f "conftest$ac_exeext"
9535 if { (eval echo "$as_me:9535: \"$ac_link\"") >&5
9536   (eval $ac_link) 2>&5
9537   ac_status=$?
9538   echo "$as_me:9538: \$? = $ac_status" >&5
9539   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9540   { (eval echo "$as_me:9540: \"$ac_try\"") >&5
9541   (eval $ac_try) 2>&5
9542   ac_status=$?
9543   echo "$as_me:9543: \$? = $ac_status" >&5
9544   (exit "$ac_status"); }; }; then
9545   cf_test_ncuconfig=yes
9546 else
9547   echo "$as_me: program exited with status $ac_status" >&5
9548 echo "$as_me: failed program was:" >&5
9549 cat "conftest.$ac_ext" >&5
9550 cf_test_ncuconfig=no
9551 fi
9552 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9553 fi
9554 else
9555   echo "$as_me: failed program was:" >&5
9556 cat "conftest.$ac_ext" >&5
9557 cf_test_ncuconfig=no
9558 fi
9559 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9560
9561                         CFLAGS="$cf_save_CFLAGS"
9562                         CPPFLAGS="$cf_save_CPPFLAGS"
9563                         LIBS="$cf_save_LIBS"
9564
9565                         if test "x$cf_test_ncuconfig" != xyes; then
9566                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9567                                 cf_pkg_cflags="$cf_temp"
9568                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9569                                 cf_pkg_libs="$cf_temp"
9570                         fi
9571                         ;;
9572                 esac
9573
9574 for cf_add_cflags in $cf_pkg_cflags
9575 do
9576         case "x$cf_add_cflags" in
9577         (x-[DU]*)
9578
9579 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9580 while true
9581 do
9582         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'`
9583         test "$CFLAGS" != "$cf_old_cflag" || break
9584
9585         CFLAGS="$cf_old_cflag"
9586 done
9587
9588 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9589 while true
9590 do
9591         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'`
9592         test "$CPPFLAGS" != "$cf_old_cflag" || break
9593
9594         CPPFLAGS="$cf_old_cflag"
9595 done
9596
9597                 ;;
9598         esac
9599
9600 cf_fix_cppflags=no
9601 cf_new_cflags=
9602 cf_new_cppflags=
9603 cf_new_extra_cppflags=
9604
9605 for cf_add_cflags in $cf_add_cflags
9606 do
9607 case "$cf_fix_cppflags" in
9608 (no)
9609         case "$cf_add_cflags" in
9610         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9611                 case "$cf_add_cflags" in
9612                 (-D*)
9613                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9614
9615                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9616                                 && test -z "${cf_tst_cflags}" \
9617                                 && cf_fix_cppflags=yes
9618
9619                         if test "$cf_fix_cppflags" = yes ; then
9620
9621         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9622         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9623
9624                                 continue
9625                         elif test "${cf_tst_cflags}" = "\"'" ; then
9626
9627         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9628         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9629
9630                                 continue
9631                         fi
9632                         ;;
9633                 esac
9634                 case "$CPPFLAGS" in
9635                 (*$cf_add_cflags)
9636                         ;;
9637                 (*)
9638                         case "$cf_add_cflags" in
9639                         (-D*)
9640                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9641
9642 CPPFLAGS=`echo "$CPPFLAGS" | \
9643         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9644                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9645
9646                                 ;;
9647                         esac
9648
9649         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9650         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9651
9652                         ;;
9653                 esac
9654                 ;;
9655         (*)
9656
9657         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9658         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9659
9660                 ;;
9661         esac
9662         ;;
9663 (yes)
9664
9665         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9666         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9667
9668         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9669
9670         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9671                 && test -z "${cf_tst_cflags}" \
9672                 && cf_fix_cppflags=no
9673         ;;
9674 esac
9675 done
9676
9677 if test -n "$cf_new_cflags" ; then
9678
9679         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9680         CFLAGS="${CFLAGS}$cf_new_cflags"
9681
9682 fi
9683
9684 if test -n "$cf_new_cppflags" ; then
9685
9686         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9687         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9688
9689 fi
9690
9691 if test -n "$cf_new_extra_cppflags" ; then
9692
9693         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9694         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9695
9696 fi
9697
9698 done
9699
9700 cf_add_libs="$LIBS"
9701 # reverse order
9702 cf_add_0lib=
9703 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9704 # filter duplicates
9705 for cf_add_1lib in $cf_add_0lib; do
9706         for cf_add_2lib in $cf_add_libs; do
9707                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9708                         cf_add_1lib=
9709                         break
9710                 fi
9711         done
9712         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9713 done
9714 LIBS="$cf_add_libs"
9715
9716                 cat >"conftest.$ac_ext" <<_ACEOF
9717 #line 9717 "configure"
9718 #include "confdefs.h"
9719 #include <${cf_cv_ncurses_header:-curses.h}>
9720 int
9721 main (void)
9722 {
9723 initscr(); mousemask(0,0); tigetstr((char *)0);
9724   ;
9725   return 0;
9726 }
9727 _ACEOF
9728 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9729 if { (eval echo "$as_me:9729: \"$ac_link\"") >&5
9730   (eval $ac_link) 2>&5
9731   ac_status=$?
9732   echo "$as_me:9732: \$? = $ac_status" >&5
9733   (exit "$ac_status"); } &&
9734          { ac_try='test -s "conftest$ac_exeext"'
9735   { (eval echo "$as_me:9735: \"$ac_try\"") >&5
9736   (eval $ac_try) 2>&5
9737   ac_status=$?
9738   echo "$as_me:9738: \$? = $ac_status" >&5
9739   (exit "$ac_status"); }; }; then
9740   if test "$cross_compiling" = yes; then
9741   cf_have_ncuconfig=maybe
9742 else
9743   cat >"conftest.$ac_ext" <<_ACEOF
9744 #line 9744 "configure"
9745 #include "confdefs.h"
9746 #include <${cf_cv_ncurses_header:-curses.h}>
9747                                 int main(void)
9748                                 { const char *xx = curses_version(); return (xx == 0); }
9749 _ACEOF
9750 rm -f "conftest$ac_exeext"
9751 if { (eval echo "$as_me:9751: \"$ac_link\"") >&5
9752   (eval $ac_link) 2>&5
9753   ac_status=$?
9754   echo "$as_me:9754: \$? = $ac_status" >&5
9755   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9756   { (eval echo "$as_me:9756: \"$ac_try\"") >&5
9757   (eval $ac_try) 2>&5
9758   ac_status=$?
9759   echo "$as_me:9759: \$? = $ac_status" >&5
9760   (exit "$ac_status"); }; }; then
9761   cf_have_ncuconfig=yes
9762 else
9763   echo "$as_me: program exited with status $ac_status" >&5
9764 echo "$as_me: failed program was:" >&5
9765 cat "conftest.$ac_ext" >&5
9766 cf_have_ncuconfig=no
9767 fi
9768 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9769 fi
9770 else
9771   echo "$as_me: failed program was:" >&5
9772 cat "conftest.$ac_ext" >&5
9773 cf_have_ncuconfig=no
9774 fi
9775 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9776                 echo "$as_me:9776: result: $cf_have_ncuconfig" >&5
9777 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9778                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9779                 if test "$cf_have_ncuconfig" != "yes"
9780                 then
9781                         CPPFLAGS="$cf_save_CPPFLAGS"
9782                         LIBS="$cf_save_LIBS"
9783                         NCURSES_CONFIG_PKG=none
9784                 else
9785
9786 cat >>confdefs.h <<\EOF
9787 #define NCURSES 1
9788 EOF
9789
9790                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9791
9792 echo "$as_me:9792: checking for terminfo header" >&5
9793 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9794 if test "${cf_cv_term_header+set}" = set; then
9795   echo $ECHO_N "(cached) $ECHO_C" >&6
9796 else
9797
9798 case "${cf_cv_ncurses_header}" in
9799 (*/ncurses.h|*/ncursesw.h)
9800         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9801         ;;
9802 (*)
9803         cf_term_header=term.h
9804         ;;
9805 esac
9806
9807 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9808 do
9809 cat >"conftest.$ac_ext" <<_ACEOF
9810 #line 9810 "configure"
9811 #include "confdefs.h"
9812 #include <stdio.h>
9813 #include <${cf_cv_ncurses_header:-curses.h}>
9814 #include <$cf_test>
9815
9816 int
9817 main (void)
9818 {
9819 int x = auto_left_margin; (void)x
9820   ;
9821   return 0;
9822 }
9823 _ACEOF
9824 rm -f "conftest.$ac_objext"
9825 if { (eval echo "$as_me:9825: \"$ac_compile\"") >&5
9826   (eval $ac_compile) 2>&5
9827   ac_status=$?
9828   echo "$as_me:9828: \$? = $ac_status" >&5
9829   (exit "$ac_status"); } &&
9830          { ac_try='test -s "conftest.$ac_objext"'
9831   { (eval echo "$as_me:9831: \"$ac_try\"") >&5
9832   (eval $ac_try) 2>&5
9833   ac_status=$?
9834   echo "$as_me:9834: \$? = $ac_status" >&5
9835   (exit "$ac_status"); }; }; then
9836
9837         cf_cv_term_header="$cf_test"
9838 else
9839   echo "$as_me: failed program was:" >&5
9840 cat "conftest.$ac_ext" >&5
9841
9842         cf_cv_term_header=unknown
9843
9844 fi
9845 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9846         test "$cf_cv_term_header" != unknown && break
9847 done
9848
9849 fi
9850 echo "$as_me:9850: result: $cf_cv_term_header" >&5
9851 echo "${ECHO_T}$cf_cv_term_header" >&6
9852
9853 # Set definitions to allow ifdef'ing to accommodate subdirectories
9854
9855 case "$cf_cv_term_header" in
9856 (*term.h)
9857
9858 cat >>confdefs.h <<\EOF
9859 #define HAVE_TERM_H 1
9860 EOF
9861
9862         ;;
9863 esac
9864
9865 case "$cf_cv_term_header" in
9866 (ncurses/term.h)
9867
9868 cat >>confdefs.h <<\EOF
9869 #define HAVE_NCURSES_TERM_H 1
9870 EOF
9871
9872         ;;
9873 (ncursesw/term.h)
9874
9875 cat >>confdefs.h <<\EOF
9876 #define HAVE_NCURSESW_TERM_H 1
9877 EOF
9878
9879         ;;
9880 esac
9881
9882                 fi
9883
9884         else
9885                 echo "$as_me:9885: result: no" >&5
9886 echo "${ECHO_T}no" >&6
9887                 NCURSES_CONFIG_PKG=none
9888         fi
9889 else
9890         NCURSES_CONFIG_PKG=none
9891 fi
9892
9893 if test "x$cf_have_ncuconfig" = "xno"; then
9894         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9895
9896 if test -n "$ac_tool_prefix"; then
9897   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9898   do
9899     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9900 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9901 echo "$as_me:9901: checking for $ac_word" >&5
9902 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9903 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9904   echo $ECHO_N "(cached) $ECHO_C" >&6
9905 else
9906   if test -n "$NCURSES_CONFIG"; then
9907   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9908 else
9909   ac_save_IFS=$IFS; IFS=$ac_path_separator
9910 ac_dummy="$PATH"
9911 for ac_dir in $ac_dummy; do
9912   IFS=$ac_save_IFS
9913   test -z "$ac_dir" && ac_dir=.
9914   $as_executable_p "$ac_dir/$ac_word" || continue
9915 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9916 echo "$as_me:9916: found $ac_dir/$ac_word" >&5
9917 break
9918 done
9919
9920 fi
9921 fi
9922 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9923 if test -n "$NCURSES_CONFIG"; then
9924   echo "$as_me:9924: result: $NCURSES_CONFIG" >&5
9925 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9926 else
9927   echo "$as_me:9927: result: no" >&5
9928 echo "${ECHO_T}no" >&6
9929 fi
9930
9931     test -n "$NCURSES_CONFIG" && break
9932   done
9933 fi
9934 if test -z "$NCURSES_CONFIG"; then
9935   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9936   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9937 do
9938   # Extract the first word of "$ac_prog", so it can be a program name with args.
9939 set dummy $ac_prog; ac_word=$2
9940 echo "$as_me:9940: checking for $ac_word" >&5
9941 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9942 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9943   echo $ECHO_N "(cached) $ECHO_C" >&6
9944 else
9945   if test -n "$ac_ct_NCURSES_CONFIG"; then
9946   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9947 else
9948   ac_save_IFS=$IFS; IFS=$ac_path_separator
9949 ac_dummy="$PATH"
9950 for ac_dir in $ac_dummy; do
9951   IFS=$ac_save_IFS
9952   test -z "$ac_dir" && ac_dir=.
9953   $as_executable_p "$ac_dir/$ac_word" || continue
9954 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9955 echo "$as_me:9955: found $ac_dir/$ac_word" >&5
9956 break
9957 done
9958
9959 fi
9960 fi
9961 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9962 if test -n "$ac_ct_NCURSES_CONFIG"; then
9963   echo "$as_me:9963: result: $ac_ct_NCURSES_CONFIG" >&5
9964 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9965 else
9966   echo "$as_me:9966: result: no" >&5
9967 echo "${ECHO_T}no" >&6
9968 fi
9969
9970   test -n "$ac_ct_NCURSES_CONFIG" && break
9971 done
9972 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9973
9974   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9975 fi
9976
9977         if test "$NCURSES_CONFIG" != none ; then
9978
9979 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9980 do
9981         case "x$cf_add_cflags" in
9982         (x-[DU]*)
9983
9984 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9985 while true
9986 do
9987         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'`
9988         test "$CFLAGS" != "$cf_old_cflag" || break
9989
9990         CFLAGS="$cf_old_cflag"
9991 done
9992
9993 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9994 while true
9995 do
9996         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'`
9997         test "$CPPFLAGS" != "$cf_old_cflag" || break
9998
9999         CPPFLAGS="$cf_old_cflag"
10000 done
10001
10002                 ;;
10003         esac
10004
10005 cf_fix_cppflags=no
10006 cf_new_cflags=
10007 cf_new_cppflags=
10008 cf_new_extra_cppflags=
10009
10010 for cf_add_cflags in $cf_add_cflags
10011 do
10012 case "$cf_fix_cppflags" in
10013 (no)
10014         case "$cf_add_cflags" in
10015         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10016                 case "$cf_add_cflags" in
10017                 (-D*)
10018                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10019
10020                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10021                                 && test -z "${cf_tst_cflags}" \
10022                                 && cf_fix_cppflags=yes
10023
10024                         if test "$cf_fix_cppflags" = yes ; then
10025
10026         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10027         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10028
10029                                 continue
10030                         elif test "${cf_tst_cflags}" = "\"'" ; then
10031
10032         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10033         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10034
10035                                 continue
10036                         fi
10037                         ;;
10038                 esac
10039                 case "$CPPFLAGS" in
10040                 (*$cf_add_cflags)
10041                         ;;
10042                 (*)
10043                         case "$cf_add_cflags" in
10044                         (-D*)
10045                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10046
10047 CPPFLAGS=`echo "$CPPFLAGS" | \
10048         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10049                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10050
10051                                 ;;
10052                         esac
10053
10054         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10055         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10056
10057                         ;;
10058                 esac
10059                 ;;
10060         (*)
10061
10062         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10063         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10064
10065                 ;;
10066         esac
10067         ;;
10068 (yes)
10069
10070         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10071         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10072
10073         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10074
10075         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10076                 && test -z "${cf_tst_cflags}" \
10077                 && cf_fix_cppflags=no
10078         ;;
10079 esac
10080 done
10081
10082 if test -n "$cf_new_cflags" ; then
10083
10084         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10085         CFLAGS="${CFLAGS}$cf_new_cflags"
10086
10087 fi
10088
10089 if test -n "$cf_new_cppflags" ; then
10090
10091         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10092         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10093
10094 fi
10095
10096 if test -n "$cf_new_extra_cppflags" ; then
10097
10098         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10099         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10100
10101 fi
10102
10103 done
10104
10105 cf_add_libs="$LIBS"
10106 # reverse order
10107 cf_add_0lib=
10108 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10109 # filter duplicates
10110 for cf_add_1lib in $cf_add_0lib; do
10111         for cf_add_2lib in $cf_add_libs; do
10112                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10113                         cf_add_1lib=
10114                         break
10115                 fi
10116         done
10117         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10118 done
10119 LIBS="$cf_add_libs"
10120
10121                 # even with config script, some packages use no-override for curses.h
10122
10123 echo "$as_me:10123: checking if we have identified curses headers" >&5
10124 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10125 if test "${cf_cv_ncurses_header+set}" = set; then
10126   echo $ECHO_N "(cached) $ECHO_C" >&6
10127 else
10128
10129 cf_cv_ncurses_header=none
10130 for cf_header in \
10131         ncurses.h ncurses/ncurses.h \
10132         curses.h ncurses/curses.h
10133 do
10134 cat >"conftest.$ac_ext" <<_ACEOF
10135 #line 10135 "configure"
10136 #include "confdefs.h"
10137 #include <${cf_header}>
10138 int
10139 main (void)
10140 {
10141 initscr(); tgoto("?", 0,0)
10142   ;
10143   return 0;
10144 }
10145 _ACEOF
10146 rm -f "conftest.$ac_objext"
10147 if { (eval echo "$as_me:10147: \"$ac_compile\"") >&5
10148   (eval $ac_compile) 2>&5
10149   ac_status=$?
10150   echo "$as_me:10150: \$? = $ac_status" >&5
10151   (exit "$ac_status"); } &&
10152          { ac_try='test -s "conftest.$ac_objext"'
10153   { (eval echo "$as_me:10153: \"$ac_try\"") >&5
10154   (eval $ac_try) 2>&5
10155   ac_status=$?
10156   echo "$as_me:10156: \$? = $ac_status" >&5
10157   (exit "$ac_status"); }; }; then
10158   cf_cv_ncurses_header=$cf_header; break
10159 else
10160   echo "$as_me: failed program was:" >&5
10161 cat "conftest.$ac_ext" >&5
10162 fi
10163 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10164 done
10165
10166 fi
10167 echo "$as_me:10167: result: $cf_cv_ncurses_header" >&5
10168 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10169
10170 if test "$cf_cv_ncurses_header" = none ; then
10171         { { echo "$as_me:10171: error: No curses header-files found" >&5
10172 echo "$as_me: error: No curses header-files found" >&2;}
10173    { (exit 1); exit 1; }; }
10174 fi
10175
10176 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10177
10178 for ac_header in $cf_cv_ncurses_header
10179 do
10180 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10181 echo "$as_me:10181: checking for $ac_header" >&5
10182 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10183 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10184   echo $ECHO_N "(cached) $ECHO_C" >&6
10185 else
10186   cat >"conftest.$ac_ext" <<_ACEOF
10187 #line 10187 "configure"
10188 #include "confdefs.h"
10189 #include <$ac_header>
10190 _ACEOF
10191 if { (eval echo "$as_me:10191: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10192   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10193   ac_status=$?
10194   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10195   rm -f conftest.er1
10196   cat conftest.err >&5
10197   echo "$as_me:10197: \$? = $ac_status" >&5
10198   (exit "$ac_status"); } >/dev/null; then
10199   if test -s conftest.err; then
10200     ac_cpp_err=$ac_c_preproc_warn_flag
10201   else
10202     ac_cpp_err=
10203   fi
10204 else
10205   ac_cpp_err=yes
10206 fi
10207 if test -z "$ac_cpp_err"; then
10208   eval "$as_ac_Header=yes"
10209 else
10210   echo "$as_me: failed program was:" >&5
10211   cat "conftest.$ac_ext" >&5
10212   eval "$as_ac_Header=no"
10213 fi
10214 rm -f conftest.err "conftest.$ac_ext"
10215 fi
10216 echo "$as_me:10216: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10217 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10218 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10219   cat >>confdefs.h <<EOF
10220 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10221 EOF
10222
10223 fi
10224 done
10225
10226 cat >>confdefs.h <<\EOF
10227 #define NCURSES 1
10228 EOF
10229
10230 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10231
10232                 cat >>confdefs.h <<EOF
10233 #define $cf_nculib_ROOT 1
10234 EOF
10235
10236                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10237
10238         else
10239
10240 cf_ncuhdr_root=ncurses
10241
10242 test -n "$cf_cv_curses_dir" && \
10243 test "$cf_cv_curses_dir" != "no" && { \
10244
10245 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10246   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10247   do
10248         while test "$cf_add_incdir" != /usr/include
10249         do
10250           if test -d "$cf_add_incdir"
10251           then
10252                 cf_have_incdir=no
10253                 if test -n "$CFLAGS$CPPFLAGS" ; then
10254                   # a loop is needed to ensure we can add subdirs of existing dirs
10255                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10256                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10257                           cf_have_incdir=yes; break
10258                         fi
10259                   done
10260                 fi
10261
10262                 if test "$cf_have_incdir" = no ; then
10263                   if test "$cf_add_incdir" = /usr/local/include ; then
10264                         if test "$GCC" = yes
10265                         then
10266                           cf_save_CPPFLAGS=$CPPFLAGS
10267
10268         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10269         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10270
10271                           cat >"conftest.$ac_ext" <<_ACEOF
10272 #line 10272 "configure"
10273 #include "confdefs.h"
10274 #include <stdio.h>
10275 int
10276 main (void)
10277 {
10278 printf("Hello")
10279   ;
10280   return 0;
10281 }
10282 _ACEOF
10283 rm -f "conftest.$ac_objext"
10284 if { (eval echo "$as_me:10284: \"$ac_compile\"") >&5
10285   (eval $ac_compile) 2>&5
10286   ac_status=$?
10287   echo "$as_me:10287: \$? = $ac_status" >&5
10288   (exit "$ac_status"); } &&
10289          { ac_try='test -s "conftest.$ac_objext"'
10290   { (eval echo "$as_me:10290: \"$ac_try\"") >&5
10291   (eval $ac_try) 2>&5
10292   ac_status=$?
10293   echo "$as_me:10293: \$? = $ac_status" >&5
10294   (exit "$ac_status"); }; }; then
10295   :
10296 else
10297   echo "$as_me: failed program was:" >&5
10298 cat "conftest.$ac_ext" >&5
10299 cf_have_incdir=yes
10300 fi
10301 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10302                           CPPFLAGS=$cf_save_CPPFLAGS
10303                         fi
10304                   fi
10305                 fi
10306
10307                 if test "$cf_have_incdir" = no ; then
10308                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10309
10310 echo "${as_me:-configure}:10310: testing adding $cf_add_incdir to include-path ..." 1>&5
10311
10312                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10313
10314                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10315                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10316                   cf_add_incdir="$cf_top_incdir"
10317                 else
10318                   break
10319                 fi
10320           else
10321                 break
10322           fi
10323         done
10324   done
10325 fi
10326
10327 }
10328
10329 echo "$as_me:10329: checking for $cf_ncuhdr_root header in include-path" >&5
10330 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10331 if test "${cf_cv_ncurses_h+set}" = set; then
10332   echo $ECHO_N "(cached) $ECHO_C" >&6
10333 else
10334
10335         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10336         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10337         for cf_header in $cf_header_list
10338         do
10339
10340         cat >"conftest.$ac_ext" <<_ACEOF
10341 #line 10341 "configure"
10342 #include "confdefs.h"
10343
10344 #include <$cf_header>
10345 int
10346 main (void)
10347 {
10348
10349 #ifdef NCURSES_VERSION
10350
10351 printf("%s\\n", NCURSES_VERSION);
10352 #else
10353 #ifdef __NCURSES_H
10354 printf("old\\n");
10355 #else
10356         make an error
10357 #endif
10358 #endif
10359
10360   ;
10361   return 0;
10362 }
10363 _ACEOF
10364 rm -f "conftest.$ac_objext"
10365 if { (eval echo "$as_me:10365: \"$ac_compile\"") >&5
10366   (eval $ac_compile) 2>&5
10367   ac_status=$?
10368   echo "$as_me:10368: \$? = $ac_status" >&5
10369   (exit "$ac_status"); } &&
10370          { ac_try='test -s "conftest.$ac_objext"'
10371   { (eval echo "$as_me:10371: \"$ac_try\"") >&5
10372   (eval $ac_try) 2>&5
10373   ac_status=$?
10374   echo "$as_me:10374: \$? = $ac_status" >&5
10375   (exit "$ac_status"); }; }; then
10376   cf_cv_ncurses_h=$cf_header
10377
10378 else
10379   echo "$as_me: failed program was:" >&5
10380 cat "conftest.$ac_ext" >&5
10381 cf_cv_ncurses_h=no
10382 fi
10383 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10384
10385                 test "$cf_cv_ncurses_h" != no && break
10386         done
10387
10388 fi
10389 echo "$as_me:10389: result: $cf_cv_ncurses_h" >&5
10390 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10391
10392 if test "$cf_cv_ncurses_h" != no ; then
10393         cf_cv_ncurses_header=$cf_cv_ncurses_h
10394 else
10395
10396 echo "$as_me:10396: checking for $cf_ncuhdr_root include-path" >&5
10397 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10398 if test "${cf_cv_ncurses_h2+set}" = set; then
10399   echo $ECHO_N "(cached) $ECHO_C" >&6
10400 else
10401
10402         test -n "$verbose" && echo
10403
10404 cf_search=
10405
10406 # collect the current set of include-directories from compiler flags
10407 cf_header_path_list=""
10408 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10409         for cf_header_path in $CPPFLAGS $CFLAGS
10410         do
10411                 case "$cf_header_path" in
10412                 (-I*)
10413                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10414
10415 test "x$cf_header_path" != "xNONE" && \
10416 test -d "$cf_header_path" && \
10417  {
10418         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10419         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10420         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10421         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10422         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10423         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"
10424 }
10425
10426                         cf_header_path_list="$cf_header_path_list $cf_search"
10427                         ;;
10428                 esac
10429         done
10430 fi
10431
10432 # add the variations for the package we are looking for
10433
10434 cf_search=
10435
10436 test "x$prefix" != "xNONE" && \
10437 test -d "$prefix" && \
10438  {
10439         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10440         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10441         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10442         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10443         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10444         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10445 }
10446
10447 for cf_subdir_prefix in \
10448         /usr \
10449         /usr/local \
10450         /usr/pkg \
10451         /opt \
10452         /opt/local \
10453         $HOME
10454 do
10455
10456 test "x$cf_subdir_prefix" != "x$prefix" && \
10457 test -d "$cf_subdir_prefix" && \
10458 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10459         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10460         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10461         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10462         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10463         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10464         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"
10465 }
10466
10467 done
10468
10469 test "$includedir" != NONE && \
10470 test "$includedir" != "/usr/include" && \
10471 test -d "$includedir" && {
10472         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10473         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10474 }
10475
10476 test "$oldincludedir" != NONE && \
10477 test "$oldincludedir" != "/usr/include" && \
10478 test -d "$oldincludedir" && {
10479         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10480         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10481 }
10482
10483 cf_search="$cf_search $cf_header_path_list"
10484
10485         test -n "$verbose" && echo "search path $cf_search"
10486         cf_save2_CPPFLAGS="$CPPFLAGS"
10487         for cf_incdir in $cf_search
10488         do
10489
10490 if test -n "$cf_incdir" ; then
10491   for cf_add_incdir in $cf_incdir
10492   do
10493         while test "$cf_add_incdir" != /usr/include
10494         do
10495           if test -d "$cf_add_incdir"
10496           then
10497                 cf_have_incdir=no
10498                 if test -n "$CFLAGS$CPPFLAGS" ; then
10499                   # a loop is needed to ensure we can add subdirs of existing dirs
10500                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10501                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10502                           cf_have_incdir=yes; break
10503                         fi
10504                   done
10505                 fi
10506
10507                 if test "$cf_have_incdir" = no ; then
10508                   if test "$cf_add_incdir" = /usr/local/include ; then
10509                         if test "$GCC" = yes
10510                         then
10511                           cf_save_CPPFLAGS=$CPPFLAGS
10512
10513         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10514         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10515
10516                           cat >"conftest.$ac_ext" <<_ACEOF
10517 #line 10517 "configure"
10518 #include "confdefs.h"
10519 #include <stdio.h>
10520 int
10521 main (void)
10522 {
10523 printf("Hello")
10524   ;
10525   return 0;
10526 }
10527 _ACEOF
10528 rm -f "conftest.$ac_objext"
10529 if { (eval echo "$as_me:10529: \"$ac_compile\"") >&5
10530   (eval $ac_compile) 2>&5
10531   ac_status=$?
10532   echo "$as_me:10532: \$? = $ac_status" >&5
10533   (exit "$ac_status"); } &&
10534          { ac_try='test -s "conftest.$ac_objext"'
10535   { (eval echo "$as_me:10535: \"$ac_try\"") >&5
10536   (eval $ac_try) 2>&5
10537   ac_status=$?
10538   echo "$as_me:10538: \$? = $ac_status" >&5
10539   (exit "$ac_status"); }; }; then
10540   :
10541 else
10542   echo "$as_me: failed program was:" >&5
10543 cat "conftest.$ac_ext" >&5
10544 cf_have_incdir=yes
10545 fi
10546 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10547                           CPPFLAGS=$cf_save_CPPFLAGS
10548                         fi
10549                   fi
10550                 fi
10551
10552                 if test "$cf_have_incdir" = no ; then
10553                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10554
10555 echo "${as_me:-configure}:10555: testing adding $cf_add_incdir to include-path ..." 1>&5
10556
10557                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10558
10559                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10560                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10561                   cf_add_incdir="$cf_top_incdir"
10562                 else
10563                   break
10564                 fi
10565           else
10566                 break
10567           fi
10568         done
10569   done
10570 fi
10571
10572                 for cf_header in \
10573                         ncurses.h \
10574                         curses.h
10575                 do
10576
10577         cat >"conftest.$ac_ext" <<_ACEOF
10578 #line 10578 "configure"
10579 #include "confdefs.h"
10580
10581 #include <$cf_header>
10582 int
10583 main (void)
10584 {
10585
10586 #ifdef NCURSES_VERSION
10587
10588 printf("%s\\n", NCURSES_VERSION);
10589 #else
10590 #ifdef __NCURSES_H
10591 printf("old\\n");
10592 #else
10593         make an error
10594 #endif
10595 #endif
10596
10597   ;
10598   return 0;
10599 }
10600 _ACEOF
10601 rm -f "conftest.$ac_objext"
10602 if { (eval echo "$as_me:10602: \"$ac_compile\"") >&5
10603   (eval $ac_compile) 2>&5
10604   ac_status=$?
10605   echo "$as_me:10605: \$? = $ac_status" >&5
10606   (exit "$ac_status"); } &&
10607          { ac_try='test -s "conftest.$ac_objext"'
10608   { (eval echo "$as_me:10608: \"$ac_try\"") >&5
10609   (eval $ac_try) 2>&5
10610   ac_status=$?
10611   echo "$as_me:10611: \$? = $ac_status" >&5
10612   (exit "$ac_status"); }; }; then
10613   cf_cv_ncurses_h2=$cf_header
10614
10615 else
10616   echo "$as_me: failed program was:" >&5
10617 cat "conftest.$ac_ext" >&5
10618 cf_cv_ncurses_h2=no
10619 fi
10620 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10621
10622                         if test "$cf_cv_ncurses_h2" != no ; then
10623                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10624                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10625                                 break
10626                         fi
10627                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10628                 done
10629                 CPPFLAGS="$cf_save2_CPPFLAGS"
10630                 test "$cf_cv_ncurses_h2" != no && break
10631         done
10632         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10632: error: not found" >&5
10633 echo "$as_me: error: not found" >&2;}
10634    { (exit 1); exit 1; }; }
10635
10636 fi
10637 echo "$as_me:10637: result: $cf_cv_ncurses_h2" >&5
10638 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10639
10640         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10641         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10642         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10643                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10644         fi
10645
10646 if test -n "$cf_1st_incdir" ; then
10647   for cf_add_incdir in $cf_1st_incdir
10648   do
10649         while test "$cf_add_incdir" != /usr/include
10650         do
10651           if test -d "$cf_add_incdir"
10652           then
10653                 cf_have_incdir=no
10654                 if test -n "$CFLAGS$CPPFLAGS" ; then
10655                   # a loop is needed to ensure we can add subdirs of existing dirs
10656                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10657                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10658                           cf_have_incdir=yes; break
10659                         fi
10660                   done
10661                 fi
10662
10663                 if test "$cf_have_incdir" = no ; then
10664                   if test "$cf_add_incdir" = /usr/local/include ; then
10665                         if test "$GCC" = yes
10666                         then
10667                           cf_save_CPPFLAGS=$CPPFLAGS
10668
10669         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10670         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10671
10672                           cat >"conftest.$ac_ext" <<_ACEOF
10673 #line 10673 "configure"
10674 #include "confdefs.h"
10675 #include <stdio.h>
10676 int
10677 main (void)
10678 {
10679 printf("Hello")
10680   ;
10681   return 0;
10682 }
10683 _ACEOF
10684 rm -f "conftest.$ac_objext"
10685 if { (eval echo "$as_me:10685: \"$ac_compile\"") >&5
10686   (eval $ac_compile) 2>&5
10687   ac_status=$?
10688   echo "$as_me:10688: \$? = $ac_status" >&5
10689   (exit "$ac_status"); } &&
10690          { ac_try='test -s "conftest.$ac_objext"'
10691   { (eval echo "$as_me:10691: \"$ac_try\"") >&5
10692   (eval $ac_try) 2>&5
10693   ac_status=$?
10694   echo "$as_me:10694: \$? = $ac_status" >&5
10695   (exit "$ac_status"); }; }; then
10696   :
10697 else
10698   echo "$as_me: failed program was:" >&5
10699 cat "conftest.$ac_ext" >&5
10700 cf_have_incdir=yes
10701 fi
10702 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10703                           CPPFLAGS=$cf_save_CPPFLAGS
10704                         fi
10705                   fi
10706                 fi
10707
10708                 if test "$cf_have_incdir" = no ; then
10709                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10710
10711 echo "${as_me:-configure}:10711: testing adding $cf_add_incdir to include-path ..." 1>&5
10712
10713                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10714
10715                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10716                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10717                   cf_add_incdir="$cf_top_incdir"
10718                 else
10719                   break
10720                 fi
10721           else
10722                 break
10723           fi
10724         done
10725   done
10726 fi
10727
10728 fi
10729
10730 # Set definitions to allow ifdef'ing for ncurses.h
10731
10732 case "$cf_cv_ncurses_header" in
10733 (*ncurses.h)
10734
10735 cat >>confdefs.h <<\EOF
10736 #define HAVE_NCURSES_H 1
10737 EOF
10738
10739         ;;
10740 esac
10741
10742 case "$cf_cv_ncurses_header" in
10743 (ncurses/curses.h|ncurses/ncurses.h)
10744
10745 cat >>confdefs.h <<\EOF
10746 #define HAVE_NCURSES_NCURSES_H 1
10747 EOF
10748
10749         ;;
10750 (ncursesw/curses.h|ncursesw/ncurses.h)
10751
10752 cat >>confdefs.h <<\EOF
10753 #define HAVE_NCURSESW_NCURSES_H 1
10754 EOF
10755
10756         ;;
10757 esac
10758
10759 echo "$as_me:10759: checking for terminfo header" >&5
10760 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10761 if test "${cf_cv_term_header+set}" = set; then
10762   echo $ECHO_N "(cached) $ECHO_C" >&6
10763 else
10764
10765 case "${cf_cv_ncurses_header}" in
10766 (*/ncurses.h|*/ncursesw.h)
10767         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10768         ;;
10769 (*)
10770         cf_term_header=term.h
10771         ;;
10772 esac
10773
10774 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10775 do
10776 cat >"conftest.$ac_ext" <<_ACEOF
10777 #line 10777 "configure"
10778 #include "confdefs.h"
10779 #include <stdio.h>
10780 #include <${cf_cv_ncurses_header:-curses.h}>
10781 #include <$cf_test>
10782
10783 int
10784 main (void)
10785 {
10786 int x = auto_left_margin; (void)x
10787   ;
10788   return 0;
10789 }
10790 _ACEOF
10791 rm -f "conftest.$ac_objext"
10792 if { (eval echo "$as_me:10792: \"$ac_compile\"") >&5
10793   (eval $ac_compile) 2>&5
10794   ac_status=$?
10795   echo "$as_me:10795: \$? = $ac_status" >&5
10796   (exit "$ac_status"); } &&
10797          { ac_try='test -s "conftest.$ac_objext"'
10798   { (eval echo "$as_me:10798: \"$ac_try\"") >&5
10799   (eval $ac_try) 2>&5
10800   ac_status=$?
10801   echo "$as_me:10801: \$? = $ac_status" >&5
10802   (exit "$ac_status"); }; }; then
10803
10804         cf_cv_term_header="$cf_test"
10805 else
10806   echo "$as_me: failed program was:" >&5
10807 cat "conftest.$ac_ext" >&5
10808
10809         cf_cv_term_header=unknown
10810
10811 fi
10812 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10813         test "$cf_cv_term_header" != unknown && break
10814 done
10815
10816 fi
10817 echo "$as_me:10817: result: $cf_cv_term_header" >&5
10818 echo "${ECHO_T}$cf_cv_term_header" >&6
10819
10820 # Set definitions to allow ifdef'ing to accommodate subdirectories
10821
10822 case "$cf_cv_term_header" in
10823 (*term.h)
10824
10825 cat >>confdefs.h <<\EOF
10826 #define HAVE_TERM_H 1
10827 EOF
10828
10829         ;;
10830 esac
10831
10832 case "$cf_cv_term_header" in
10833 (ncurses/term.h)
10834
10835 cat >>confdefs.h <<\EOF
10836 #define HAVE_NCURSES_TERM_H 1
10837 EOF
10838
10839         ;;
10840 (ncursesw/term.h)
10841
10842 cat >>confdefs.h <<\EOF
10843 #define HAVE_NCURSESW_TERM_H 1
10844 EOF
10845
10846         ;;
10847 esac
10848
10849 # some applications need this, but should check for NCURSES_VERSION
10850
10851 cat >>confdefs.h <<\EOF
10852 #define NCURSES 1
10853 EOF
10854
10855 echo "$as_me:10855: checking for ncurses version" >&5
10856 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10857 if test "${cf_cv_ncurses_version+set}" = set; then
10858   echo $ECHO_N "(cached) $ECHO_C" >&6
10859 else
10860
10861         cf_cv_ncurses_version=no
10862         cf_tempfile=out$$
10863         rm -f "$cf_tempfile"
10864         if test "$cross_compiling" = yes; then
10865
10866         # This will not work if the preprocessor splits the line after the
10867         # Autoconf token.  The 'unproto' program does that.
10868         cat > "conftest.$ac_ext" <<EOF
10869 #include <${cf_cv_ncurses_header:-curses.h}>
10870 #undef Autoconf
10871 #ifdef NCURSES_VERSION
10872 Autoconf NCURSES_VERSION
10873 #else
10874 #ifdef __NCURSES_H
10875 Autoconf "old"
10876 #endif
10877 ;
10878 #endif
10879 EOF
10880         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10881         { (eval echo "$as_me:10881: \"$cf_try\"") >&5
10882   (eval $cf_try) 2>&5
10883   ac_status=$?
10884   echo "$as_me:10884: \$? = $ac_status" >&5
10885   (exit "$ac_status"); }
10886         if test -f conftest.out ; then
10887                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10888                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10889                 rm -f conftest.out
10890         fi
10891
10892 else
10893   cat >"conftest.$ac_ext" <<_ACEOF
10894 #line 10894 "configure"
10895 #include "confdefs.h"
10896
10897 #include <${cf_cv_ncurses_header:-curses.h}>
10898 #include <stdio.h>
10899 int main(void)
10900 {
10901         FILE *fp = fopen("$cf_tempfile", "w");
10902 #ifdef NCURSES_VERSION
10903 # ifdef NCURSES_VERSION_PATCH
10904         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10905 # else
10906         fprintf(fp, "%s\\n", NCURSES_VERSION);
10907 # endif
10908 #else
10909 # ifdef __NCURSES_H
10910         fprintf(fp, "old\\n");
10911 # else
10912         make an error
10913 # endif
10914 #endif
10915         ${cf_cv_main_return:-return}(0);
10916 }
10917 _ACEOF
10918 rm -f "conftest$ac_exeext"
10919 if { (eval echo "$as_me:10919: \"$ac_link\"") >&5
10920   (eval $ac_link) 2>&5
10921   ac_status=$?
10922   echo "$as_me:10922: \$? = $ac_status" >&5
10923   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10924   { (eval echo "$as_me:10924: \"$ac_try\"") >&5
10925   (eval $ac_try) 2>&5
10926   ac_status=$?
10927   echo "$as_me:10927: \$? = $ac_status" >&5
10928   (exit "$ac_status"); }; }; then
10929
10930         cf_cv_ncurses_version=`cat $cf_tempfile`
10931 else
10932   echo "$as_me: program exited with status $ac_status" >&5
10933 echo "$as_me: failed program was:" >&5
10934 cat "conftest.$ac_ext" >&5
10935 fi
10936 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10937 fi
10938         rm -f "$cf_tempfile"
10939
10940 fi
10941 echo "$as_me:10941: result: $cf_cv_ncurses_version" >&5
10942 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10943 test "$cf_cv_ncurses_version" = no ||
10944 cat >>confdefs.h <<\EOF
10945 #define NCURSES 1
10946 EOF
10947
10948 cf_nculib_root=ncurses
10949         # This works, except for the special case where we find gpm, but
10950         # ncurses is in a nonstandard location via $LIBS, and we really want
10951         # to link gpm.
10952 cf_ncurses_LIBS=""
10953 cf_ncurses_SAVE="$LIBS"
10954 echo "$as_me:10954: checking for Gpm_Open in -lgpm" >&5
10955 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10956 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10957   echo $ECHO_N "(cached) $ECHO_C" >&6
10958 else
10959   ac_check_lib_save_LIBS=$LIBS
10960 LIBS="-lgpm  $LIBS"
10961 cat >"conftest.$ac_ext" <<_ACEOF
10962 #line 10962 "configure"
10963 #include "confdefs.h"
10964
10965 /* Override any gcc2 internal prototype to avoid an error.  */
10966 #ifdef __cplusplus
10967 extern "C"
10968 #endif
10969 /* We use char because int might match the return type of a gcc2
10970    builtin and then its argument prototype would still apply.  */
10971 char Gpm_Open ();
10972 int
10973 main (void)
10974 {
10975 Gpm_Open ();
10976   ;
10977   return 0;
10978 }
10979 _ACEOF
10980 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10981 if { (eval echo "$as_me:10981: \"$ac_link\"") >&5
10982   (eval $ac_link) 2>&5
10983   ac_status=$?
10984   echo "$as_me:10984: \$? = $ac_status" >&5
10985   (exit "$ac_status"); } &&
10986          { ac_try='test -s "conftest$ac_exeext"'
10987   { (eval echo "$as_me:10987: \"$ac_try\"") >&5
10988   (eval $ac_try) 2>&5
10989   ac_status=$?
10990   echo "$as_me:10990: \$? = $ac_status" >&5
10991   (exit "$ac_status"); }; }; then
10992   ac_cv_lib_gpm_Gpm_Open=yes
10993 else
10994   echo "$as_me: failed program was:" >&5
10995 cat "conftest.$ac_ext" >&5
10996 ac_cv_lib_gpm_Gpm_Open=no
10997 fi
10998 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10999 LIBS=$ac_check_lib_save_LIBS
11000 fi
11001 echo "$as_me:11001: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11002 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11003 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11004   echo "$as_me:11004: checking for initscr in -lgpm" >&5
11005 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11006 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11007   echo $ECHO_N "(cached) $ECHO_C" >&6
11008 else
11009   ac_check_lib_save_LIBS=$LIBS
11010 LIBS="-lgpm  $LIBS"
11011 cat >"conftest.$ac_ext" <<_ACEOF
11012 #line 11012 "configure"
11013 #include "confdefs.h"
11014
11015 /* Override any gcc2 internal prototype to avoid an error.  */
11016 #ifdef __cplusplus
11017 extern "C"
11018 #endif
11019 /* We use char because int might match the return type of a gcc2
11020    builtin and then its argument prototype would still apply.  */
11021 char initscr ();
11022 int
11023 main (void)
11024 {
11025 initscr ();
11026   ;
11027   return 0;
11028 }
11029 _ACEOF
11030 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11031 if { (eval echo "$as_me:11031: \"$ac_link\"") >&5
11032   (eval $ac_link) 2>&5
11033   ac_status=$?
11034   echo "$as_me:11034: \$? = $ac_status" >&5
11035   (exit "$ac_status"); } &&
11036          { ac_try='test -s "conftest$ac_exeext"'
11037   { (eval echo "$as_me:11037: \"$ac_try\"") >&5
11038   (eval $ac_try) 2>&5
11039   ac_status=$?
11040   echo "$as_me:11040: \$? = $ac_status" >&5
11041   (exit "$ac_status"); }; }; then
11042   ac_cv_lib_gpm_initscr=yes
11043 else
11044   echo "$as_me: failed program was:" >&5
11045 cat "conftest.$ac_ext" >&5
11046 ac_cv_lib_gpm_initscr=no
11047 fi
11048 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11049 LIBS=$ac_check_lib_save_LIBS
11050 fi
11051 echo "$as_me:11051: result: $ac_cv_lib_gpm_initscr" >&5
11052 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11053 if test "$ac_cv_lib_gpm_initscr" = yes; then
11054   LIBS="$cf_ncurses_SAVE"
11055 else
11056   cf_ncurses_LIBS="-lgpm"
11057 fi
11058
11059 fi
11060
11061 case "$host_os" in
11062 (freebsd*)
11063         # This is only necessary if you are linking against an obsolete
11064         # version of ncurses (but it should do no harm, since it is static).
11065         if test "$cf_nculib_root" = ncurses ; then
11066                 echo "$as_me:11066: checking for tgoto in -lmytinfo" >&5
11067 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11068 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11069   echo $ECHO_N "(cached) $ECHO_C" >&6
11070 else
11071   ac_check_lib_save_LIBS=$LIBS
11072 LIBS="-lmytinfo  $LIBS"
11073 cat >"conftest.$ac_ext" <<_ACEOF
11074 #line 11074 "configure"
11075 #include "confdefs.h"
11076
11077 /* Override any gcc2 internal prototype to avoid an error.  */
11078 #ifdef __cplusplus
11079 extern "C"
11080 #endif
11081 /* We use char because int might match the return type of a gcc2
11082    builtin and then its argument prototype would still apply.  */
11083 char tgoto ();
11084 int
11085 main (void)
11086 {
11087 tgoto ();
11088   ;
11089   return 0;
11090 }
11091 _ACEOF
11092 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11093 if { (eval echo "$as_me:11093: \"$ac_link\"") >&5
11094   (eval $ac_link) 2>&5
11095   ac_status=$?
11096   echo "$as_me:11096: \$? = $ac_status" >&5
11097   (exit "$ac_status"); } &&
11098          { ac_try='test -s "conftest$ac_exeext"'
11099   { (eval echo "$as_me:11099: \"$ac_try\"") >&5
11100   (eval $ac_try) 2>&5
11101   ac_status=$?
11102   echo "$as_me:11102: \$? = $ac_status" >&5
11103   (exit "$ac_status"); }; }; then
11104   ac_cv_lib_mytinfo_tgoto=yes
11105 else
11106   echo "$as_me: failed program was:" >&5
11107 cat "conftest.$ac_ext" >&5
11108 ac_cv_lib_mytinfo_tgoto=no
11109 fi
11110 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11111 LIBS=$ac_check_lib_save_LIBS
11112 fi
11113 echo "$as_me:11113: result: $ac_cv_lib_mytinfo_tgoto" >&5
11114 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11115 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11116   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11117 fi
11118
11119         fi
11120         ;;
11121 esac
11122
11123 cf_add_libs="$LIBS"
11124 # reverse order
11125 cf_add_0lib=
11126 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11127 # filter duplicates
11128 for cf_add_1lib in $cf_add_0lib; do
11129         for cf_add_2lib in $cf_add_libs; do
11130                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11131                         cf_add_1lib=
11132                         break
11133                 fi
11134         done
11135         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11136 done
11137 LIBS="$cf_add_libs"
11138
11139 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11140 then
11141
11142 cf_add_libs="$LIBS"
11143 # reverse order
11144 cf_add_0lib=
11145 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11146 # filter duplicates
11147 for cf_add_1lib in $cf_add_0lib; do
11148         for cf_add_2lib in $cf_add_libs; do
11149                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11150                         cf_add_1lib=
11151                         break
11152                 fi
11153         done
11154         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11155 done
11156 LIBS="$cf_add_libs"
11157
11158 else
11159
11160         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11161         cf_libdir=""
11162         echo "$as_me:11162: checking for initscr" >&5
11163 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11164 if test "${ac_cv_func_initscr+set}" = set; then
11165   echo $ECHO_N "(cached) $ECHO_C" >&6
11166 else
11167   cat >"conftest.$ac_ext" <<_ACEOF
11168 #line 11168 "configure"
11169 #include "confdefs.h"
11170 #define initscr autoconf_temporary
11171 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11172 #undef initscr
11173
11174 #ifdef __cplusplus
11175 extern "C"
11176 #endif
11177
11178 /* We use char because int might match the return type of a gcc2
11179    builtin and then its argument prototype would still apply.  */
11180 char initscr (void);
11181
11182 int
11183 main (void)
11184 {
11185
11186 /* The GNU C library defines stubs for functions which it implements
11187     to always fail with ENOSYS.  Some functions are actually named
11188     something starting with __ and the normal name is an alias.  */
11189 #if defined (__stub_initscr) || defined (__stub___initscr)
11190 #error found stub for initscr
11191 #endif
11192
11193         return initscr ();
11194   ;
11195   return 0;
11196 }
11197 _ACEOF
11198 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11199 if { (eval echo "$as_me:11199: \"$ac_link\"") >&5
11200   (eval $ac_link) 2>&5
11201   ac_status=$?
11202   echo "$as_me:11202: \$? = $ac_status" >&5
11203   (exit "$ac_status"); } &&
11204          { ac_try='test -s "conftest$ac_exeext"'
11205   { (eval echo "$as_me:11205: \"$ac_try\"") >&5
11206   (eval $ac_try) 2>&5
11207   ac_status=$?
11208   echo "$as_me:11208: \$? = $ac_status" >&5
11209   (exit "$ac_status"); }; }; then
11210   ac_cv_func_initscr=yes
11211 else
11212   echo "$as_me: failed program was:" >&5
11213 cat "conftest.$ac_ext" >&5
11214 ac_cv_func_initscr=no
11215 fi
11216 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11217 fi
11218 echo "$as_me:11218: result: $ac_cv_func_initscr" >&5
11219 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11220 if test "$ac_cv_func_initscr" = yes; then
11221   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11222 else
11223
11224                 cf_save_LIBS="$LIBS"
11225                 echo "$as_me:11225: checking for initscr in -l$cf_nculib_root" >&5
11226 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11227                 LIBS="-l$cf_nculib_root $LIBS"
11228                 cat >"conftest.$ac_ext" <<_ACEOF
11229 #line 11229 "configure"
11230 #include "confdefs.h"
11231 #include <${cf_cv_ncurses_header:-curses.h}>
11232 int
11233 main (void)
11234 {
11235 initscr()
11236   ;
11237   return 0;
11238 }
11239 _ACEOF
11240 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11241 if { (eval echo "$as_me:11241: \"$ac_link\"") >&5
11242   (eval $ac_link) 2>&5
11243   ac_status=$?
11244   echo "$as_me:11244: \$? = $ac_status" >&5
11245   (exit "$ac_status"); } &&
11246          { ac_try='test -s "conftest$ac_exeext"'
11247   { (eval echo "$as_me:11247: \"$ac_try\"") >&5
11248   (eval $ac_try) 2>&5
11249   ac_status=$?
11250   echo "$as_me:11250: \$? = $ac_status" >&5
11251   (exit "$ac_status"); }; }; then
11252   echo "$as_me:11252: result: yes" >&5
11253 echo "${ECHO_T}yes" >&6
11254                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11255
11256 else
11257   echo "$as_me: failed program was:" >&5
11258 cat "conftest.$ac_ext" >&5
11259 echo "$as_me:11259: result: no" >&5
11260 echo "${ECHO_T}no" >&6
11261
11262 cf_search=
11263 cf_library_path_list=""
11264 if test -n "${LDFLAGS}${LIBS}" ; then
11265         for cf_library_path in $LDFLAGS $LIBS
11266         do
11267                 case "$cf_library_path" in
11268                 (-L*)
11269                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11270
11271 test "x$cf_library_path" != "xNONE" && \
11272 test -d "$cf_library_path" && \
11273  {
11274         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11275         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11276         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11277         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11278         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11279         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"
11280 }
11281
11282                         cf_library_path_list="$cf_library_path_list $cf_search"
11283                         ;;
11284                 esac
11285         done
11286 fi
11287
11288 cf_search=
11289
11290 test "x$prefix" != "xNONE" && \
11291 test -d "$prefix" && \
11292  {
11293         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11294         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11295         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11296         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11297         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11298         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11299 }
11300
11301 for cf_subdir_prefix in \
11302         /usr \
11303         /usr/local \
11304         /usr/pkg \
11305         /opt \
11306         /opt/local \
11307         $HOME
11308 do
11309
11310 test "x$cf_subdir_prefix" != "x$prefix" && \
11311 test -d "$cf_subdir_prefix" && \
11312 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11313         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11314         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11315         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11316         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11317         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11318         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"
11319 }
11320
11321 done
11322
11323 cf_search="$cf_library_path_list $cf_search"
11324
11325                         for cf_libdir in $cf_search
11326                         do
11327                                 echo "$as_me:11327: checking for -l$cf_nculib_root in $cf_libdir" >&5
11328 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11329                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11330                                 cat >"conftest.$ac_ext" <<_ACEOF
11331 #line 11331 "configure"
11332 #include "confdefs.h"
11333 #include <${cf_cv_ncurses_header:-curses.h}>
11334 int
11335 main (void)
11336 {
11337 initscr()
11338   ;
11339   return 0;
11340 }
11341 _ACEOF
11342 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11343 if { (eval echo "$as_me:11343: \"$ac_link\"") >&5
11344   (eval $ac_link) 2>&5
11345   ac_status=$?
11346   echo "$as_me:11346: \$? = $ac_status" >&5
11347   (exit "$ac_status"); } &&
11348          { ac_try='test -s "conftest$ac_exeext"'
11349   { (eval echo "$as_me:11349: \"$ac_try\"") >&5
11350   (eval $ac_try) 2>&5
11351   ac_status=$?
11352   echo "$as_me:11352: \$? = $ac_status" >&5
11353   (exit "$ac_status"); }; }; then
11354   echo "$as_me:11354: result: yes" >&5
11355 echo "${ECHO_T}yes" >&6
11356                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11357                                          break
11358 else
11359   echo "$as_me: failed program was:" >&5
11360 cat "conftest.$ac_ext" >&5
11361 echo "$as_me:11361: result: no" >&5
11362 echo "${ECHO_T}no" >&6
11363                                          LIBS="$cf_save_LIBS"
11364 fi
11365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11366                         done
11367
11368 fi
11369 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11370
11371 fi
11372
11373 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11374
11375 if test "$cf_found_library" = no ; then
11376         { { echo "$as_me:11376: error: Cannot link $cf_nculib_root library" >&5
11377 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11378    { (exit 1); exit 1; }; }
11379 fi
11380
11381 fi
11382
11383 if test -n "$cf_ncurses_LIBS" ; then
11384         echo "$as_me:11384: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11385 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11386         cf_ncurses_SAVE="$LIBS"
11387         for p in $cf_ncurses_LIBS ; do
11388                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11389                 if test "$q" != "$LIBS" ; then
11390                         LIBS="$q"
11391                 fi
11392         done
11393         cat >"conftest.$ac_ext" <<_ACEOF
11394 #line 11394 "configure"
11395 #include "confdefs.h"
11396 #include <${cf_cv_ncurses_header:-curses.h}>
11397 int
11398 main (void)
11399 {
11400 initscr(); mousemask(0,0); tigetstr((char *)0);
11401   ;
11402   return 0;
11403 }
11404 _ACEOF
11405 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11406 if { (eval echo "$as_me:11406: \"$ac_link\"") >&5
11407   (eval $ac_link) 2>&5
11408   ac_status=$?
11409   echo "$as_me:11409: \$? = $ac_status" >&5
11410   (exit "$ac_status"); } &&
11411          { ac_try='test -s "conftest$ac_exeext"'
11412   { (eval echo "$as_me:11412: \"$ac_try\"") >&5
11413   (eval $ac_try) 2>&5
11414   ac_status=$?
11415   echo "$as_me:11415: \$? = $ac_status" >&5
11416   (exit "$ac_status"); }; }; then
11417   echo "$as_me:11417: result: yes" >&5
11418 echo "${ECHO_T}yes" >&6
11419 else
11420   echo "$as_me: failed program was:" >&5
11421 cat "conftest.$ac_ext" >&5
11422 echo "$as_me:11422: result: no" >&5
11423 echo "${ECHO_T}no" >&6
11424                  LIBS="$cf_ncurses_SAVE"
11425 fi
11426 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11427 fi
11428
11429 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11430
11431 cat >>confdefs.h <<EOF
11432 #define $cf_nculib_ROOT 1
11433 EOF
11434
11435         fi
11436 else
11437         NCURSES_CONFIG=none
11438 fi
11439
11440 fi
11441
11442 if test "$NCURSES_CONFIG_PKG" != none ; then
11443         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11444
11445         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11446         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11447         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11448
11449         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11450         if test -z "$cf_cv_abi_version"
11451         then
11452                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11453         fi
11454
11455 elif test "$NCURSES_CONFIG" != none ; then
11456
11457         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11458
11459         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11460         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11461         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11462
11463         # ABI version is not available from headers
11464         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11465
11466 else
11467
11468         for cf_name in MAJOR MINOR PATCH
11469         do
11470         cat >conftest.$ac_ext <<CF_EOF
11471         #include <${cf_cv_ncurses_header:-curses.h}>
11472         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11473 CF_EOF
11474                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11475                 { (eval echo "$as_me:11475: \"$cf_try\"") >&5
11476   (eval $cf_try) 2>&5
11477   ac_status=$?
11478   echo "$as_me:11478: \$? = $ac_status" >&5
11479   (exit "$ac_status"); }
11480                 if test -f conftest.out ; then
11481                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11482                         eval NCURSES_$cf_name=\"$cf_result\"
11483                         # cat conftest.$ac_ext
11484                         # cat conftest.out
11485                 fi
11486         done
11487
11488         cf_cv_abi_version=${NCURSES_MAJOR}
11489
11490 fi
11491
11492 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11493
11494 cf_cv_timestamp=`date`
11495
11496 echo "$as_me:11496: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11497 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11498
11499 echo "$as_me:11499: checking if you want to have a library-prefix" >&5
11500 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11501
11502 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11503 if test "${with_lib_prefix+set}" = set; then
11504   withval="$with_lib_prefix"
11505   with_lib_prefix=$withval
11506 else
11507   with_lib_prefix=auto
11508 fi;
11509 echo "$as_me:11509: result: $with_lib_prefix" >&5
11510 echo "${ECHO_T}$with_lib_prefix" >&6
11511
11512 if test "$with_lib_prefix" = auto
11513 then
11514
11515         case "$cf_cv_system_name" in
11516         (OS/2*|os2*)
11517                 if test "$DFT_LWR_MODEL" = libtool; then
11518                         LIB_PREFIX='lib'
11519                 else
11520                         LIB_PREFIX=''
11521                 fi
11522                 ;;
11523         (*-msvc*)
11524                 LIB_PREFIX=''
11525                 ;;
11526         (*)     LIB_PREFIX='lib'
11527                 ;;
11528         esac
11529 cf_prefix=$LIB_PREFIX
11530
11531 elif test "$with_lib_prefix" = no
11532 then
11533         LIB_PREFIX=
11534 else
11535         LIB_PREFIX=$with_lib_prefix
11536 fi
11537
11538 LIB_SUFFIX=
11539
11540 ###############################################################################
11541
11542 if test X"$CC_G_OPT" = X"" ; then
11543         CC_G_OPT='-g'
11544         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11545 fi
11546
11547 echo "$as_me:11547: checking for default loader flags" >&5
11548 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11549 case $DFT_LWR_MODEL in
11550 (normal)  LD_MODEL=''   ;;
11551 (debug)   LD_MODEL=$CC_G_OPT ;;
11552 (profile) LD_MODEL='-pg';;
11553 (shared)  LD_MODEL=''   ;;
11554 esac
11555 echo "$as_me:11555: result: $LD_MODEL" >&5
11556 echo "${ECHO_T}$LD_MODEL" >&6
11557
11558 LD_RPATH_OPT=
11559 if test "x$cf_cv_enable_rpath" != xno
11560 then
11561         echo "$as_me:11561: checking for an rpath option" >&5
11562 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11563         case "$cf_cv_system_name" in
11564         (irix*)
11565                 if test "$GCC" = yes; then
11566                         LD_RPATH_OPT="-Wl,-rpath,"
11567                 else
11568                         LD_RPATH_OPT="-rpath "
11569                 fi
11570                 ;;
11571         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11572                 LD_RPATH_OPT="-Wl,-rpath,"
11573                 ;;
11574         (openbsd[2-9].*|mirbsd*)
11575                 LD_RPATH_OPT="-Wl,-rpath,"
11576                 ;;
11577         (dragonfly*)
11578                 LD_RPATH_OPT="-rpath "
11579                 ;;
11580         (netbsd*)
11581                 LD_RPATH_OPT="-Wl,-rpath,"
11582                 ;;
11583         (osf*|mls+*)
11584                 LD_RPATH_OPT="-rpath "
11585                 ;;
11586         (solaris2*)
11587                 LD_RPATH_OPT="-R"
11588                 ;;
11589         (*)
11590                 ;;
11591         esac
11592         echo "$as_me:11592: result: $LD_RPATH_OPT" >&5
11593 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11594
11595         case "x$LD_RPATH_OPT" in
11596         (x-R*)
11597                 echo "$as_me:11597: checking if we need a space after rpath option" >&5
11598 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11599                 cf_save_LIBS="$LIBS"
11600
11601 cf_add_libs="$LIBS"
11602 # reverse order
11603 cf_add_0lib=
11604 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11605 # filter duplicates
11606 for cf_add_1lib in $cf_add_0lib; do
11607         for cf_add_2lib in $cf_add_libs; do
11608                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11609                         cf_add_1lib=
11610                         break
11611                 fi
11612         done
11613         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11614 done
11615 LIBS="$cf_add_libs"
11616
11617                 cat >"conftest.$ac_ext" <<_ACEOF
11618 #line 11618 "configure"
11619 #include "confdefs.h"
11620
11621 int
11622 main (void)
11623 {
11624
11625   ;
11626   return 0;
11627 }
11628 _ACEOF
11629 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11630 if { (eval echo "$as_me:11630: \"$ac_link\"") >&5
11631   (eval $ac_link) 2>&5
11632   ac_status=$?
11633   echo "$as_me:11633: \$? = $ac_status" >&5
11634   (exit "$ac_status"); } &&
11635          { ac_try='test -s "conftest$ac_exeext"'
11636   { (eval echo "$as_me:11636: \"$ac_try\"") >&5
11637   (eval $ac_try) 2>&5
11638   ac_status=$?
11639   echo "$as_me:11639: \$? = $ac_status" >&5
11640   (exit "$ac_status"); }; }; then
11641   cf_rpath_space=no
11642 else
11643   echo "$as_me: failed program was:" >&5
11644 cat "conftest.$ac_ext" >&5
11645 cf_rpath_space=yes
11646 fi
11647 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11648                 LIBS="$cf_save_LIBS"
11649                 echo "$as_me:11649: result: $cf_rpath_space" >&5
11650 echo "${ECHO_T}$cf_rpath_space" >&6
11651                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11652                 ;;
11653         esac
11654 fi
11655
11656         RM_SHARED_OPTS=
11657         LOCAL_LDFLAGS=
11658         LOCAL_LDFLAGS2=
11659         LD_SHARED_OPTS=
11660         INSTALL_LIB="-m 644"
11661         : ${rel_builddir:=.}
11662
11663         shlibdir=$libdir
11664
11665         MAKE_DLLS="#"
11666
11667         cf_cv_do_symlinks=no
11668         cf_ld_rpath_opt=
11669         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11670
11671         echo "$as_me:11671: checking if release/abi version should be used for shared libs" >&5
11672 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11673
11674 # Check whether --with-shlib-version or --without-shlib-version was given.
11675 if test "${with_shlib_version+set}" = set; then
11676   withval="$with_shlib_version"
11677   test -z "$withval" && withval=auto
11678         case "$withval" in
11679         (yes)
11680                 cf_cv_shlib_version=auto
11681                 ;;
11682         (rel|abi|auto)
11683                 cf_cv_shlib_version=$withval
11684                 ;;
11685         (*)
11686                 echo "$as_me:11686: result: $withval" >&5
11687 echo "${ECHO_T}$withval" >&6
11688                 { { echo "$as_me:11688: error: option value must be one of: rel, abi, or auto" >&5
11689 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11690    { (exit 1); exit 1; }; }
11691                 ;;
11692         esac
11693
11694 else
11695   cf_cv_shlib_version=auto
11696 fi;
11697         echo "$as_me:11697: result: $cf_cv_shlib_version" >&5
11698 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11699
11700         cf_cv_rm_so_locs=no
11701         cf_try_cflags=
11702
11703         # Some less-capable ports of gcc support only -fpic
11704         CC_SHARED_OPTS=
11705
11706         cf_try_fPIC=no
11707         if test "$GCC" = yes
11708         then
11709                 cf_try_fPIC=yes
11710         else
11711                 case "$cf_cv_system_name" in
11712                 (*linux*)       # e.g., PGI compiler
11713                         cf_try_fPIC=yes
11714                         ;;
11715                 esac
11716         fi
11717
11718         if test "$cf_try_fPIC" = yes
11719         then
11720                 echo "$as_me:11720: checking which $CC option to use" >&5
11721 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11722                 cf_save_CFLAGS="$CFLAGS"
11723                 for CC_SHARED_OPTS in -fPIC -fpic ''
11724                 do
11725                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11726                         cat >"conftest.$ac_ext" <<_ACEOF
11727 #line 11727 "configure"
11728 #include "confdefs.h"
11729 #include <stdio.h>
11730 int
11731 main (void)
11732 {
11733 int x = 1
11734   ;
11735   return 0;
11736 }
11737 _ACEOF
11738 rm -f "conftest.$ac_objext"
11739 if { (eval echo "$as_me:11739: \"$ac_compile\"") >&5
11740   (eval $ac_compile) 2>&5
11741   ac_status=$?
11742   echo "$as_me:11742: \$? = $ac_status" >&5
11743   (exit "$ac_status"); } &&
11744          { ac_try='test -s "conftest.$ac_objext"'
11745   { (eval echo "$as_me:11745: \"$ac_try\"") >&5
11746   (eval $ac_try) 2>&5
11747   ac_status=$?
11748   echo "$as_me:11748: \$? = $ac_status" >&5
11749   (exit "$ac_status"); }; }; then
11750   break
11751 else
11752   echo "$as_me: failed program was:" >&5
11753 cat "conftest.$ac_ext" >&5
11754 fi
11755 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11756                 done
11757                 echo "$as_me:11757: result: $CC_SHARED_OPTS" >&5
11758 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11759                 CFLAGS="$cf_save_CFLAGS"
11760         fi
11761
11762         cf_cv_shlib_version_infix=no
11763
11764         case "$cf_cv_system_name" in
11765         (aix4.3-9*|aix[5-7]*)
11766                 if test "$GCC" = yes; then
11767                         CC_SHARED_OPTS='-Wl,-brtl'
11768                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11769                 else
11770                         CC_SHARED_OPTS='-brtl'
11771                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11772                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11773                 fi
11774                 ;;
11775         (beos*)
11776                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11777                 ;;
11778         (cygwin*)
11779                 CC_SHARED_OPTS=
11780                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11781                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11782                 cf_cv_shlib_version=cygdll
11783                 cf_cv_shlib_version_infix=cygdll
11784                 shlibdir=$bindir
11785                 MAKE_DLLS=
11786                 cat >mk_shared_lib.sh <<-CF_EOF
11787                 #!$SHELL
11788                 SHARED_LIB=\$1
11789                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11790                 shift
11791                 cat <<-EOF
11792                 Linking shared library
11793                 ** SHARED_LIB \$SHARED_LIB
11794                 ** IMPORT_LIB \$IMPORT_LIB
11795 EOF
11796                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11797 CF_EOF
11798                 chmod +x mk_shared_lib.sh
11799                 ;;
11800         (msys*)
11801                 CC_SHARED_OPTS=
11802                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11803                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11804                 cf_cv_shlib_version=msysdll
11805                 cf_cv_shlib_version_infix=msysdll
11806                 shlibdir=$bindir
11807                 MAKE_DLLS=
11808                 cat >mk_shared_lib.sh <<-CF_EOF
11809                 #!$SHELL
11810                 SHARED_LIB=\$1
11811                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11812                 shift
11813                 cat <<-EOF
11814                 Linking shared library
11815                 ** SHARED_LIB \$SHARED_LIB
11816                 ** IMPORT_LIB \$IMPORT_LIB
11817 EOF
11818                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11819 CF_EOF
11820                 chmod +x mk_shared_lib.sh
11821                 ;;
11822         (darwin*)
11823                 cf_try_cflags="no-cpp-precomp"
11824                 CC_SHARED_OPTS="-dynamic"
11825                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11826                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11827                 cf_cv_shlib_version_infix=yes
11828                 echo "$as_me:11828: checking if ld -search_paths_first works" >&5
11829 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11830 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11831   echo $ECHO_N "(cached) $ECHO_C" >&6
11832 else
11833
11834                         cf_save_LDFLAGS=$LDFLAGS
11835                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11836                         cat >"conftest.$ac_ext" <<_ACEOF
11837 #line 11837 "configure"
11838 #include "confdefs.h"
11839
11840 int
11841 main (void)
11842 {
11843 int i;
11844   ;
11845   return 0;
11846 }
11847 _ACEOF
11848 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11849 if { (eval echo "$as_me:11849: \"$ac_link\"") >&5
11850   (eval $ac_link) 2>&5
11851   ac_status=$?
11852   echo "$as_me:11852: \$? = $ac_status" >&5
11853   (exit "$ac_status"); } &&
11854          { ac_try='test -s "conftest$ac_exeext"'
11855   { (eval echo "$as_me:11855: \"$ac_try\"") >&5
11856   (eval $ac_try) 2>&5
11857   ac_status=$?
11858   echo "$as_me:11858: \$? = $ac_status" >&5
11859   (exit "$ac_status"); }; }; then
11860   cf_cv_ldflags_search_paths_first=yes
11861 else
11862   echo "$as_me: failed program was:" >&5
11863 cat "conftest.$ac_ext" >&5
11864 cf_cv_ldflags_search_paths_first=no
11865 fi
11866 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11867                                 LDFLAGS=$cf_save_LDFLAGS
11868 fi
11869 echo "$as_me:11869: result: $cf_cv_ldflags_search_paths_first" >&5
11870 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11871                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11872                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11873                 fi
11874                 ;;
11875         (haiku*)
11876
11877         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11878         if test "$cf_cv_shlib_version" = rel; then
11879                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11880         else
11881                 cf_cv_shared_soname='`basename $@`'
11882         fi
11883
11884                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11885                 ;;
11886         (hpux[7-8]*)
11887                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11888                 if test "$GCC" != yes; then
11889                         CC_SHARED_OPTS='+Z'
11890                 fi
11891                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11892                 INSTALL_LIB="-m 555"
11893                 ;;
11894         (hpux*)
11895                 # (tested with gcc 2.7.2 -- I don't have c89)
11896                 if test "$GCC" = yes; then
11897                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11898                 else
11899                         CC_SHARED_OPTS='+Z'
11900                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11901                 fi
11902                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11903                 # HP-UX shared libraries must be executable, and should be
11904                 # readonly to exploit a quirk in the memory manager.
11905                 INSTALL_LIB="-m 555"
11906                 ;;
11907         (interix*)
11908                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11909                 if test "$cf_cv_shlib_version" = rel; then
11910                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11911                 else
11912                         cf_shared_soname='`basename $@`'
11913                 fi
11914                 CC_SHARED_OPTS=
11915                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11916                 ;;
11917         (irix*)
11918                 if test "$cf_cv_enable_rpath" = yes ; then
11919                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11920                 fi
11921                 # tested with IRIX 5.2 and 'cc'.
11922                 if test "$GCC" != yes; then
11923                         CC_SHARED_OPTS='-KPIC'
11924                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11925                 else
11926                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11927                 fi
11928                 cf_cv_rm_so_locs=yes
11929                 ;;
11930         (linux*|gnu*|k*bsd*-gnu)
11931                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11932                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11933                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11934                 fi
11935                 if test "$cf_cv_enable_rpath" = yes ; then
11936                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11937                 fi
11938
11939         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11940         if test "$cf_cv_shlib_version" = rel; then
11941                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11942         else
11943                 cf_cv_shared_soname='`basename $@`'
11944         fi
11945
11946                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11947                 ;;
11948         (mingw*msvc*)
11949                 cf_cv_shlib_version=msvcdll
11950                 cf_cv_shlib_version_infix=msvcdll
11951                 shlibdir=$bindir
11952                 MAKE_DLLS=
11953                 if test "$DFT_LWR_MODEL" = "shared" ; then
11954                         LOCAL_LDFLAGS="-link -dll"
11955                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11956                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11957                 fi
11958                 CC_SHARED_OPTS=
11959                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11960                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11961                 cat >mk_shared_lib.sh <<-CF_EOF
11962                 #!$SHELL
11963                 SHARED_LIB=\$1
11964                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11965                 shift
11966                 my_ld=\$1
11967                 shift
11968                 cat <<-EOF
11969                 Linking shared library
11970                 ** SHARED LIB \$SHARED_LIB
11971                 ** IMPORT_LIB \$IMPORT_LIB
11972 EOF
11973                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11974                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11975                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11976 CF_EOF
11977                 chmod +x mk_shared_lib.sh
11978                 cat >mk_prog.sh <<-CF_EOF
11979                 #!$SHELL
11980                 shift
11981                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11982                 LD="$LD"
11983                 clopts=()
11984                 ldopts=("/subsystem:console")
11985                 libs=()
11986                 isdll=0
11987                 while test \$# -gt 0; do
11988                         case "\$1" in
11989                                 -link)
11990                                         # ignore -link argument
11991                                         ;;
11992                                 -M[TD] | -M[TD]d)
11993                                         # ignore runtime-library option
11994                                         ;;
11995                                 -dll)
11996                                         isdll=1
11997                                         ;;
11998                                 -W* | -w*)
11999                                         # ignore warnings
12000                                         ;;
12001                                 -D*)
12002                                         clopts+=("\$1")
12003                                         ;;
12004                                 -I*)
12005                                         clopts+=("\$1")
12006                                         ;;
12007                                 -l*)
12008                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12009                                         ;;
12010                                 -L*)
12011                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12012                                         ;;
12013                                 *.obj | *.o)
12014                                         ldopts+=("\$1")
12015                                         ;;
12016                                 -Wl,*)
12017                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12018                                                 ldopts+=("\${linkarg}")
12019                                         done
12020                                         ;;
12021                                 *.lib)
12022                                         ldopts+=("\$1")
12023                                         ;;
12024                                 -o)
12025                                         shift
12026                                         ldopts+=("-out:\$1")
12027                                         ;;
12028                                 *)
12029                                         clopts+=("\$1")
12030                                         ldopts+=("\$1")
12031                                         ;;
12032                         esac
12033                         shift
12034                 done
12035                 if [ "\$isdll" -ne 0 ]; then
12036                         for lib in \${libs[*]}; do
12037                                 ldopts+=("\$lib.dll.lib")
12038                         done
12039                 else
12040                         for lib in \${libs[*]}; do
12041                                 ldopts+=("\$lib.lib")
12042                         done
12043                 fi
12044                 cat <<-EOF
12045                 Creating program
12046                 ** ld options:   "\${ldopts[@]}"
12047 EOF
12048                 exec \$LD \${ldopts[@]}
12049 CF_EOF
12050                 chmod +x mk_prog.sh
12051                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12052                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12053                 ;;
12054         (mingw*)
12055                 cf_cv_shlib_version=mingw
12056                 cf_cv_shlib_version_infix=mingw
12057                 shlibdir=$bindir
12058                 MAKE_DLLS=
12059                 if test "$DFT_LWR_MODEL" = "shared" ; then
12060                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12061                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12062                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12063                 fi
12064                 CC_SHARED_OPTS=
12065                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12066                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12067                 cat >mk_shared_lib.sh <<-CF_EOF
12068                 #!$SHELL
12069                 SHARED_LIB=\$1
12070                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12071                 shift
12072                 cat <<-EOF
12073                 Linking shared library
12074                 ** SHARED_LIB \$SHARED_LIB
12075                 ** IMPORT_LIB \$IMPORT_LIB
12076 EOF
12077                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12078 CF_EOF
12079                 chmod +x mk_shared_lib.sh
12080                 ;;
12081         (openbsd[2-9].*|mirbsd*)
12082                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12083                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12084                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12085                 fi
12086                 if test "$cf_cv_enable_rpath" = yes ; then
12087                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12088                 fi
12089                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12090
12091         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12092         if test "$cf_cv_shlib_version" = rel; then
12093                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12094         else
12095                 cf_cv_shared_soname='`basename $@`'
12096         fi
12097
12098                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12099                 ;;
12100         (nskJ*)
12101                 CC_SHARED_OPTS=
12102                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12103                 ;;
12104         (nskL*)
12105                 CC_SHARED_OPTS=
12106                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12107                 ;;
12108         (nto-qnx*|openbsd*|freebsd[12].*)
12109                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12110                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12111                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12112                 ;;
12113         (dragonfly*|freebsd*)
12114                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12115                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12116                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12117                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12118                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12119                 fi
12120
12121         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12122         if test "$cf_cv_shlib_version" = rel; then
12123                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12124         else
12125                 cf_cv_shared_soname='`basename $@`'
12126         fi
12127
12128                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12129                 ;;
12130         (netbsd*)
12131                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12132                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12133                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12134                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12135                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12136                         if test "$cf_cv_shlib_version" = auto; then
12137                         if test -f /usr/libexec/ld.elf_so; then
12138                                 cf_cv_shlib_version=abi
12139                         else
12140                                 cf_cv_shlib_version=rel
12141                         fi
12142                         fi
12143
12144         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12145         if test "$cf_cv_shlib_version" = rel; then
12146                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12147         else
12148                 cf_cv_shared_soname='`basename $@`'
12149         fi
12150
12151                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12152                 else
12153                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12154                 fi
12155                 ;;
12156         (osf*|mls+*)
12157                 # tested with OSF/1 V3.2 and 'cc'
12158                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12159                 # link with shared libs).
12160                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12161                 case "$host_os" in
12162                 (osf4*)
12163                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12164                         ;;
12165                 esac
12166                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12167                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12168                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12169                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12170                 fi
12171                 cf_cv_rm_so_locs=yes
12172                 ;;
12173         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12174                 # tested with osr5.0.5
12175                 if test "$GCC" != yes; then
12176                         CC_SHARED_OPTS='-belf -KPIC'
12177                 fi
12178                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12179                 if test "$cf_cv_enable_rpath" = yes ; then
12180                         # only way is to set LD_RUN_PATH but no switch for it
12181                         RUN_PATH=$libdir
12182                 fi
12183                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12184                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12185                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12186                 ;;
12187         (sunos4*)
12188                 # tested with SunOS 4.1.1 and gcc 2.7.0
12189                 if test "$GCC" != yes; then
12190                         CC_SHARED_OPTS='-KPIC'
12191                 fi
12192                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12193                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12194                 ;;
12195         (solaris2*)
12196                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12197                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12198                 if test "$DFT_LWR_MODEL" = "shared" ; then
12199                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12200                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12201                 fi
12202                 if test "$cf_cv_enable_rpath" = yes ; then
12203                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12204                 fi
12205
12206         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12207         if test "$cf_cv_shlib_version" = rel; then
12208                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12209         else
12210                 cf_cv_shared_soname='`basename $@`'
12211         fi
12212
12213                 if test "$GCC" != yes; then
12214                         cf_save_CFLAGS="$CFLAGS"
12215                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12216                         do
12217                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12218                                 cat >"conftest.$ac_ext" <<_ACEOF
12219 #line 12219 "configure"
12220 #include "confdefs.h"
12221 #include <stdio.h>
12222 int
12223 main (void)
12224 {
12225 printf("Hello\\n");
12226   ;
12227   return 0;
12228 }
12229 _ACEOF
12230 rm -f "conftest.$ac_objext"
12231 if { (eval echo "$as_me:12231: \"$ac_compile\"") >&5
12232   (eval $ac_compile) 2>&5
12233   ac_status=$?
12234   echo "$as_me:12234: \$? = $ac_status" >&5
12235   (exit "$ac_status"); } &&
12236          { ac_try='test -s "conftest.$ac_objext"'
12237   { (eval echo "$as_me:12237: \"$ac_try\"") >&5
12238   (eval $ac_try) 2>&5
12239   ac_status=$?
12240   echo "$as_me:12240: \$? = $ac_status" >&5
12241   (exit "$ac_status"); }; }; then
12242   break
12243 else
12244   echo "$as_me: failed program was:" >&5
12245 cat "conftest.$ac_ext" >&5
12246 fi
12247 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12248                         done
12249                         CFLAGS="$cf_save_CFLAGS"
12250                         CC_SHARED_OPTS=$cf_shared_opts
12251                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12252                 else
12253                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12254                 fi
12255                 ;;
12256         (sysv5uw7*|unix_sv*)
12257                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12258                 if test "$GCC" != yes; then
12259                         CC_SHARED_OPTS='-KPIC'
12260                 fi
12261                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12262                 ;;
12263         (*)
12264                 CC_SHARED_OPTS='unknown'
12265                 MK_SHARED_LIB='echo unknown'
12266                 ;;
12267         esac
12268
12269         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12270         case "$cf_cv_shlib_version" in
12271         (rel|abi)
12272                 case "$MK_SHARED_LIB" in
12273                 (*'-o $@')
12274                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12275                         ;;
12276                 (*)
12277                         { echo "$as_me:12277: WARNING: ignored --with-shlib-version" >&5
12278 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12279                         ;;
12280                 esac
12281                 ;;
12282         esac
12283
12284         if test -n "$cf_try_cflags"
12285         then
12286 cat > conftest.$ac_ext <<EOF
12287 #line 12287 "${as_me:-configure}"
12288 #include <stdio.h>
12289 int main(int argc, char *argv[])
12290 {
12291         printf("hello\\n");
12292         return (argv[argc-1] == 0) ;
12293 }
12294 EOF
12295                 cf_save_CFLAGS="$CFLAGS"
12296                 for cf_opt in $cf_try_cflags
12297                 do
12298                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12299                         echo "$as_me:12299: checking if CFLAGS option -$cf_opt works" >&5
12300 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12301                         if { (eval echo "$as_me:12301: \"$ac_compile\"") >&5
12302   (eval $ac_compile) 2>&5
12303   ac_status=$?
12304   echo "$as_me:12304: \$? = $ac_status" >&5
12305   (exit "$ac_status"); }; then
12306                                 echo "$as_me:12306: result: yes" >&5
12307 echo "${ECHO_T}yes" >&6
12308                                 cf_save_CFLAGS="$CFLAGS"
12309                         else
12310                                 echo "$as_me:12310: result: no" >&5
12311 echo "${ECHO_T}no" >&6
12312                         fi
12313                 done
12314                 CFLAGS="$cf_save_CFLAGS"
12315         fi
12316
12317         # RPATH_LIST is a colon-separated list of directories
12318         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12319         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12320
12321         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12322
12323         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12324
12325 echo "${as_me:-configure}:12325: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12326
12327         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12328
12329 echo "${as_me:-configure}:12329: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12330
12331 # The test/sample programs in the original tree link using rpath option.
12332 # Make it optional for packagers.
12333 if test -n "$LOCAL_LDFLAGS"
12334 then
12335         echo "$as_me:12335: checking if you want to link sample programs with rpath option" >&5
12336 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12337
12338 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12339 if test "${enable_rpath_link+set}" = set; then
12340   enableval="$enable_rpath_link"
12341   with_rpath_link=$enableval
12342 else
12343   with_rpath_link=yes
12344 fi;
12345         echo "$as_me:12345: result: $with_rpath_link" >&5
12346 echo "${ECHO_T}$with_rpath_link" >&6
12347         if test "$with_rpath_link" = no
12348         then
12349                 LOCAL_LDFLAGS=
12350                 LOCAL_LDFLAGS2=
12351         fi
12352 fi
12353
12354 ###############################################################################
12355
12356 ###   use option --enable-broken-linker to force on use of broken-linker support
12357
12358 echo "$as_me:12358: checking if you want broken-linker support code" >&5
12359 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12360
12361 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12362 if test "${enable_broken_linker+set}" = set; then
12363   enableval="$enable_broken_linker"
12364   with_broken_linker=$enableval
12365 else
12366   with_broken_linker=no
12367 fi;
12368 echo "$as_me:12368: result: $with_broken_linker" >&5
12369 echo "${ECHO_T}$with_broken_linker" >&6
12370
12371 : "${BROKEN_LINKER:=0}"
12372 if test "x$with_broken_linker" = xyes ; then
12373
12374 cat >>confdefs.h <<\EOF
12375 #define BROKEN_LINKER 1
12376 EOF
12377
12378         BROKEN_LINKER=1
12379 fi
12380
12381 # Check to define _XOPEN_SOURCE "automatically"
12382
12383 echo "$as_me:12383: checking if the POSIX test-macros are already defined" >&5
12384 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12385 if test "${cf_cv_posix_visible+set}" = set; then
12386   echo $ECHO_N "(cached) $ECHO_C" >&6
12387 else
12388
12389 cat >"conftest.$ac_ext" <<_ACEOF
12390 #line 12390 "configure"
12391 #include "confdefs.h"
12392 #include <stdio.h>
12393 int
12394 main (void)
12395 {
12396
12397 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12398         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12399         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12400         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12401 #error conflicting symbols found
12402 #endif
12403
12404   ;
12405   return 0;
12406 }
12407 _ACEOF
12408 rm -f "conftest.$ac_objext"
12409 if { (eval echo "$as_me:12409: \"$ac_compile\"") >&5
12410   (eval $ac_compile) 2>&5
12411   ac_status=$?
12412   echo "$as_me:12412: \$? = $ac_status" >&5
12413   (exit "$ac_status"); } &&
12414          { ac_try='test -s "conftest.$ac_objext"'
12415   { (eval echo "$as_me:12415: \"$ac_try\"") >&5
12416   (eval $ac_try) 2>&5
12417   ac_status=$?
12418   echo "$as_me:12418: \$? = $ac_status" >&5
12419   (exit "$ac_status"); }; }; then
12420   cf_cv_posix_visible=no
12421 else
12422   echo "$as_me: failed program was:" >&5
12423 cat "conftest.$ac_ext" >&5
12424 cf_cv_posix_visible=yes
12425 fi
12426 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12427
12428 fi
12429 echo "$as_me:12429: result: $cf_cv_posix_visible" >&5
12430 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12431
12432 if test "$cf_cv_posix_visible" = no; then
12433
12434 cf_XOPEN_SOURCE=600
12435 cf_POSIX_C_SOURCE=199506L
12436 cf_xopen_source=
12437
12438 case "$host_os" in
12439 (aix[4-7]*)
12440         cf_xopen_source="-D_ALL_SOURCE"
12441         ;;
12442 (msys)
12443         cf_XOPEN_SOURCE=600
12444         ;;
12445 (darwin[0-8].*)
12446         cf_xopen_source="-D_APPLE_C_SOURCE"
12447         ;;
12448 (darwin*)
12449         cf_xopen_source="-D_DARWIN_C_SOURCE"
12450         cf_XOPEN_SOURCE=
12451         ;;
12452 (freebsd*|dragonfly*|midnightbsd*)
12453         # 5.x headers associate
12454         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12455         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12456         cf_POSIX_C_SOURCE=200112L
12457         cf_XOPEN_SOURCE=600
12458         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12459         ;;
12460 (hpux11*)
12461         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12462         ;;
12463 (hpux*)
12464         cf_xopen_source="-D_HPUX_SOURCE"
12465         ;;
12466 (irix[56].*)
12467         cf_xopen_source="-D_SGI_SOURCE"
12468         cf_XOPEN_SOURCE=
12469         ;;
12470 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12471
12472 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12473
12474 echo "$as_me:12474: checking if this is the GNU C library" >&5
12475 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12476 if test "${cf_cv_gnu_library+set}" = set; then
12477   echo $ECHO_N "(cached) $ECHO_C" >&6
12478 else
12479
12480 cat >"conftest.$ac_ext" <<_ACEOF
12481 #line 12481 "configure"
12482 #include "confdefs.h"
12483 #include <sys/types.h>
12484 int
12485 main (void)
12486 {
12487
12488         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12489                 return 0;
12490         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12491                 return 0;
12492         #else
12493         #       error not GNU C library
12494         #endif
12495   ;
12496   return 0;
12497 }
12498 _ACEOF
12499 rm -f "conftest.$ac_objext"
12500 if { (eval echo "$as_me:12500: \"$ac_compile\"") >&5
12501   (eval $ac_compile) 2>&5
12502   ac_status=$?
12503   echo "$as_me:12503: \$? = $ac_status" >&5
12504   (exit "$ac_status"); } &&
12505          { ac_try='test -s "conftest.$ac_objext"'
12506   { (eval echo "$as_me:12506: \"$ac_try\"") >&5
12507   (eval $ac_try) 2>&5
12508   ac_status=$?
12509   echo "$as_me:12509: \$? = $ac_status" >&5
12510   (exit "$ac_status"); }; }; then
12511   cf_cv_gnu_library=yes
12512 else
12513   echo "$as_me: failed program was:" >&5
12514 cat "conftest.$ac_ext" >&5
12515 cf_cv_gnu_library=no
12516 fi
12517 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12518
12519 fi
12520 echo "$as_me:12520: result: $cf_cv_gnu_library" >&5
12521 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12522
12523 if test x$cf_cv_gnu_library = xyes; then
12524
12525         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12526         # was changed to help a little.  newlib incorporated the change about 4
12527         # years later.
12528         echo "$as_me:12528: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12529 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12530 if test "${cf_cv_gnu_library_219+set}" = set; then
12531   echo $ECHO_N "(cached) $ECHO_C" >&6
12532 else
12533
12534                 cf_save="$CPPFLAGS"
12535
12536         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12537         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12538
12539                 cat >"conftest.$ac_ext" <<_ACEOF
12540 #line 12540 "configure"
12541 #include "confdefs.h"
12542 #include <sys/types.h>
12543 int
12544 main (void)
12545 {
12546
12547                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12548                                 return 0;
12549                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12550                                 return 0;
12551                         #else
12552                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12553                         #endif
12554   ;
12555   return 0;
12556 }
12557 _ACEOF
12558 rm -f "conftest.$ac_objext"
12559 if { (eval echo "$as_me:12559: \"$ac_compile\"") >&5
12560   (eval $ac_compile) 2>&5
12561   ac_status=$?
12562   echo "$as_me:12562: \$? = $ac_status" >&5
12563   (exit "$ac_status"); } &&
12564          { ac_try='test -s "conftest.$ac_objext"'
12565   { (eval echo "$as_me:12565: \"$ac_try\"") >&5
12566   (eval $ac_try) 2>&5
12567   ac_status=$?
12568   echo "$as_me:12568: \$? = $ac_status" >&5
12569   (exit "$ac_status"); }; }; then
12570   cf_cv_gnu_library_219=yes
12571 else
12572   echo "$as_me: failed program was:" >&5
12573 cat "conftest.$ac_ext" >&5
12574 cf_cv_gnu_library_219=no
12575 fi
12576 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12577                 CPPFLAGS="$cf_save"
12578
12579 fi
12580 echo "$as_me:12580: result: $cf_cv_gnu_library_219" >&5
12581 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12582
12583         if test "x$cf_cv_gnu_library_219" = xyes; then
12584                 cf_save="$CPPFLAGS"
12585                 echo "$as_me:12585: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12586 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12587 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12588   echo $ECHO_N "(cached) $ECHO_C" >&6
12589 else
12590
12591 cf_fix_cppflags=no
12592 cf_new_cflags=
12593 cf_new_cppflags=
12594 cf_new_extra_cppflags=
12595
12596 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12597 do
12598 case "$cf_fix_cppflags" in
12599 (no)
12600         case "$cf_add_cflags" in
12601         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12602                 case "$cf_add_cflags" in
12603                 (-D*)
12604                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12605
12606                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12607                                 && test -z "${cf_tst_cflags}" \
12608                                 && cf_fix_cppflags=yes
12609
12610                         if test "$cf_fix_cppflags" = yes ; then
12611
12612         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12613         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12614
12615                                 continue
12616                         elif test "${cf_tst_cflags}" = "\"'" ; then
12617
12618         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12619         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12620
12621                                 continue
12622                         fi
12623                         ;;
12624                 esac
12625                 case "$CPPFLAGS" in
12626                 (*$cf_add_cflags)
12627                         ;;
12628                 (*)
12629                         case "$cf_add_cflags" in
12630                         (-D*)
12631                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12632
12633 CPPFLAGS=`echo "$CPPFLAGS" | \
12634         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12635                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12636
12637                                 ;;
12638                         esac
12639
12640         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12641         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12642
12643                         ;;
12644                 esac
12645                 ;;
12646         (*)
12647
12648         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12649         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12650
12651                 ;;
12652         esac
12653         ;;
12654 (yes)
12655
12656         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12657         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12658
12659         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12660
12661         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12662                 && test -z "${cf_tst_cflags}" \
12663                 && cf_fix_cppflags=no
12664         ;;
12665 esac
12666 done
12667
12668 if test -n "$cf_new_cflags" ; then
12669
12670         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12671         CFLAGS="${CFLAGS}$cf_new_cflags"
12672
12673 fi
12674
12675 if test -n "$cf_new_cppflags" ; then
12676
12677         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12678         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12679
12680 fi
12681
12682 if test -n "$cf_new_extra_cppflags" ; then
12683
12684         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12685         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12686
12687 fi
12688
12689                         cat >"conftest.$ac_ext" <<_ACEOF
12690 #line 12690 "configure"
12691 #include "confdefs.h"
12692
12693                                 #include <limits.h>
12694                                 #include <sys/types.h>
12695
12696 int
12697 main (void)
12698 {
12699
12700                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12701                                         return 0;
12702                                 #else
12703                                 #       error GNU C library is too old
12704                                 #endif
12705   ;
12706   return 0;
12707 }
12708 _ACEOF
12709 rm -f "conftest.$ac_objext"
12710 if { (eval echo "$as_me:12710: \"$ac_compile\"") >&5
12711   (eval $ac_compile) 2>&5
12712   ac_status=$?
12713   echo "$as_me:12713: \$? = $ac_status" >&5
12714   (exit "$ac_status"); } &&
12715          { ac_try='test -s "conftest.$ac_objext"'
12716   { (eval echo "$as_me:12716: \"$ac_try\"") >&5
12717   (eval $ac_try) 2>&5
12718   ac_status=$?
12719   echo "$as_me:12719: \$? = $ac_status" >&5
12720   (exit "$ac_status"); }; }; then
12721   cf_cv_gnu_dftsrc_219=yes
12722 else
12723   echo "$as_me: failed program was:" >&5
12724 cat "conftest.$ac_ext" >&5
12725 cf_cv_gnu_dftsrc_219=no
12726 fi
12727 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12728
12729 fi
12730 echo "$as_me:12730: result: $cf_cv_gnu_dftsrc_219" >&5
12731 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12732                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12733         else
12734                 cf_cv_gnu_dftsrc_219=maybe
12735         fi
12736
12737         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12738
12739                 echo "$as_me:12739: checking if we must define _GNU_SOURCE" >&5
12740 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12741 if test "${cf_cv_gnu_source+set}" = set; then
12742   echo $ECHO_N "(cached) $ECHO_C" >&6
12743 else
12744
12745                 cat >"conftest.$ac_ext" <<_ACEOF
12746 #line 12746 "configure"
12747 #include "confdefs.h"
12748 #include <sys/types.h>
12749 int
12750 main (void)
12751 {
12752
12753                         #ifndef _XOPEN_SOURCE
12754                         #error  expected _XOPEN_SOURCE to be defined
12755                         #endif
12756   ;
12757   return 0;
12758 }
12759 _ACEOF
12760 rm -f "conftest.$ac_objext"
12761 if { (eval echo "$as_me:12761: \"$ac_compile\"") >&5
12762   (eval $ac_compile) 2>&5
12763   ac_status=$?
12764   echo "$as_me:12764: \$? = $ac_status" >&5
12765   (exit "$ac_status"); } &&
12766          { ac_try='test -s "conftest.$ac_objext"'
12767   { (eval echo "$as_me:12767: \"$ac_try\"") >&5
12768   (eval $ac_try) 2>&5
12769   ac_status=$?
12770   echo "$as_me:12770: \$? = $ac_status" >&5
12771   (exit "$ac_status"); }; }; then
12772   cf_cv_gnu_source=no
12773 else
12774   echo "$as_me: failed program was:" >&5
12775 cat "conftest.$ac_ext" >&5
12776 cf_save="$CPPFLAGS"
12777
12778 cf_fix_cppflags=no
12779 cf_new_cflags=
12780 cf_new_cppflags=
12781 cf_new_extra_cppflags=
12782
12783 for cf_add_cflags in -D_GNU_SOURCE
12784 do
12785 case "$cf_fix_cppflags" in
12786 (no)
12787         case "$cf_add_cflags" in
12788         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12789                 case "$cf_add_cflags" in
12790                 (-D*)
12791                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12792
12793                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12794                                 && test -z "${cf_tst_cflags}" \
12795                                 && cf_fix_cppflags=yes
12796
12797                         if test "$cf_fix_cppflags" = yes ; then
12798
12799         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12800         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12801
12802                                 continue
12803                         elif test "${cf_tst_cflags}" = "\"'" ; then
12804
12805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12807
12808                                 continue
12809                         fi
12810                         ;;
12811                 esac
12812                 case "$CPPFLAGS" in
12813                 (*$cf_add_cflags)
12814                         ;;
12815                 (*)
12816                         case "$cf_add_cflags" in
12817                         (-D*)
12818                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12819
12820 CPPFLAGS=`echo "$CPPFLAGS" | \
12821         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12822                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12823
12824                                 ;;
12825                         esac
12826
12827         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12828         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12829
12830                         ;;
12831                 esac
12832                 ;;
12833         (*)
12834
12835         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12836         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12837
12838                 ;;
12839         esac
12840         ;;
12841 (yes)
12842
12843         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12844         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12845
12846         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12847
12848         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12849                 && test -z "${cf_tst_cflags}" \
12850                 && cf_fix_cppflags=no
12851         ;;
12852 esac
12853 done
12854
12855 if test -n "$cf_new_cflags" ; then
12856
12857         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12858         CFLAGS="${CFLAGS}$cf_new_cflags"
12859
12860 fi
12861
12862 if test -n "$cf_new_cppflags" ; then
12863
12864         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12865         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12866
12867 fi
12868
12869 if test -n "$cf_new_extra_cppflags" ; then
12870
12871         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12872         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12873
12874 fi
12875
12876                          cat >"conftest.$ac_ext" <<_ACEOF
12877 #line 12877 "configure"
12878 #include "confdefs.h"
12879 #include <sys/types.h>
12880 int
12881 main (void)
12882 {
12883
12884                                 #ifdef _XOPEN_SOURCE
12885                                 #error  expected _XOPEN_SOURCE to be undefined
12886                                 #endif
12887   ;
12888   return 0;
12889 }
12890 _ACEOF
12891 rm -f "conftest.$ac_objext"
12892 if { (eval echo "$as_me:12892: \"$ac_compile\"") >&5
12893   (eval $ac_compile) 2>&5
12894   ac_status=$?
12895   echo "$as_me:12895: \$? = $ac_status" >&5
12896   (exit "$ac_status"); } &&
12897          { ac_try='test -s "conftest.$ac_objext"'
12898   { (eval echo "$as_me:12898: \"$ac_try\"") >&5
12899   (eval $ac_try) 2>&5
12900   ac_status=$?
12901   echo "$as_me:12901: \$? = $ac_status" >&5
12902   (exit "$ac_status"); }; }; then
12903   cf_cv_gnu_source=no
12904 else
12905   echo "$as_me: failed program was:" >&5
12906 cat "conftest.$ac_ext" >&5
12907 cf_cv_gnu_source=yes
12908 fi
12909 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12910                         CPPFLAGS="$cf_save"
12911
12912 fi
12913 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12914
12915 fi
12916 echo "$as_me:12916: result: $cf_cv_gnu_source" >&5
12917 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12918
12919                 if test "$cf_cv_gnu_source" = yes
12920                 then
12921                 echo "$as_me:12921: checking if we should also define _DEFAULT_SOURCE" >&5
12922 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12923 if test "${cf_cv_default_source+set}" = set; then
12924   echo $ECHO_N "(cached) $ECHO_C" >&6
12925 else
12926
12927         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12928         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12929
12930                         cat >"conftest.$ac_ext" <<_ACEOF
12931 #line 12931 "configure"
12932 #include "confdefs.h"
12933 #include <sys/types.h>
12934 int
12935 main (void)
12936 {
12937
12938                                 #ifdef _DEFAULT_SOURCE
12939                                 #error  expected _DEFAULT_SOURCE to be undefined
12940                                 #endif
12941   ;
12942   return 0;
12943 }
12944 _ACEOF
12945 rm -f "conftest.$ac_objext"
12946 if { (eval echo "$as_me:12946: \"$ac_compile\"") >&5
12947   (eval $ac_compile) 2>&5
12948   ac_status=$?
12949   echo "$as_me:12949: \$? = $ac_status" >&5
12950   (exit "$ac_status"); } &&
12951          { ac_try='test -s "conftest.$ac_objext"'
12952   { (eval echo "$as_me:12952: \"$ac_try\"") >&5
12953   (eval $ac_try) 2>&5
12954   ac_status=$?
12955   echo "$as_me:12955: \$? = $ac_status" >&5
12956   (exit "$ac_status"); }; }; then
12957   cf_cv_default_source=no
12958 else
12959   echo "$as_me: failed program was:" >&5
12960 cat "conftest.$ac_ext" >&5
12961 cf_cv_default_source=yes
12962 fi
12963 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12964
12965 fi
12966 echo "$as_me:12966: result: $cf_cv_default_source" >&5
12967 echo "${ECHO_T}$cf_cv_default_source" >&6
12968                         if test "$cf_cv_default_source" = yes
12969                         then
12970
12971         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12972         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12973
12974                         fi
12975                 fi
12976         fi
12977
12978 fi
12979
12980         ;;
12981 (minix*)
12982         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12983         ;;
12984 (mirbsd*)
12985         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12986         cf_XOPEN_SOURCE=
12987
12988 if test "$cf_cv_posix_visible" = no; then
12989
12990 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12991
12992 cf_save_CFLAGS="$CFLAGS"
12993 cf_save_CPPFLAGS="$CPPFLAGS"
12994
12995 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12996         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12997                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12998
12999 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13000         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13001                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13002
13003 echo "$as_me:13003: checking if we should define _POSIX_C_SOURCE" >&5
13004 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13005 if test "${cf_cv_posix_c_source+set}" = set; then
13006   echo $ECHO_N "(cached) $ECHO_C" >&6
13007 else
13008
13009 echo "${as_me:-configure}:13009: testing if the symbol is already defined go no further ..." 1>&5
13010
13011         cat >"conftest.$ac_ext" <<_ACEOF
13012 #line 13012 "configure"
13013 #include "confdefs.h"
13014 #include <sys/types.h>
13015 int
13016 main (void)
13017 {
13018
13019 #ifndef _POSIX_C_SOURCE
13020 make an error
13021 #endif
13022   ;
13023   return 0;
13024 }
13025 _ACEOF
13026 rm -f "conftest.$ac_objext"
13027 if { (eval echo "$as_me:13027: \"$ac_compile\"") >&5
13028   (eval $ac_compile) 2>&5
13029   ac_status=$?
13030   echo "$as_me:13030: \$? = $ac_status" >&5
13031   (exit "$ac_status"); } &&
13032          { ac_try='test -s "conftest.$ac_objext"'
13033   { (eval echo "$as_me:13033: \"$ac_try\"") >&5
13034   (eval $ac_try) 2>&5
13035   ac_status=$?
13036   echo "$as_me:13036: \$? = $ac_status" >&5
13037   (exit "$ac_status"); }; }; then
13038   cf_cv_posix_c_source=no
13039 else
13040   echo "$as_me: failed program was:" >&5
13041 cat "conftest.$ac_ext" >&5
13042 cf_want_posix_source=no
13043          case .$cf_POSIX_C_SOURCE in
13044          (.[12]??*)
13045                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13046                 ;;
13047          (.2)
13048                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13049                 cf_want_posix_source=yes
13050                 ;;
13051          (.*)
13052                 cf_want_posix_source=yes
13053                 ;;
13054          esac
13055          if test "$cf_want_posix_source" = yes ; then
13056                 cat >"conftest.$ac_ext" <<_ACEOF
13057 #line 13057 "configure"
13058 #include "confdefs.h"
13059 #include <sys/types.h>
13060 int
13061 main (void)
13062 {
13063
13064 #ifdef _POSIX_SOURCE
13065 make an error
13066 #endif
13067   ;
13068   return 0;
13069 }
13070 _ACEOF
13071 rm -f "conftest.$ac_objext"
13072 if { (eval echo "$as_me:13072: \"$ac_compile\"") >&5
13073   (eval $ac_compile) 2>&5
13074   ac_status=$?
13075   echo "$as_me:13075: \$? = $ac_status" >&5
13076   (exit "$ac_status"); } &&
13077          { ac_try='test -s "conftest.$ac_objext"'
13078   { (eval echo "$as_me:13078: \"$ac_try\"") >&5
13079   (eval $ac_try) 2>&5
13080   ac_status=$?
13081   echo "$as_me:13081: \$? = $ac_status" >&5
13082   (exit "$ac_status"); }; }; then
13083   :
13084 else
13085   echo "$as_me: failed program was:" >&5
13086 cat "conftest.$ac_ext" >&5
13087 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13088 fi
13089 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13090          fi
13091
13092 echo "${as_me:-configure}:13092: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13093
13094          CFLAGS="$cf_trim_CFLAGS"
13095          CPPFLAGS="$cf_trim_CPPFLAGS"
13096
13097         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13098         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13099
13100 echo "${as_me:-configure}:13100: testing if the second compile does not leave our definition intact error ..." 1>&5
13101
13102          cat >"conftest.$ac_ext" <<_ACEOF
13103 #line 13103 "configure"
13104 #include "confdefs.h"
13105 #include <sys/types.h>
13106 int
13107 main (void)
13108 {
13109
13110 #ifndef _POSIX_C_SOURCE
13111 make an error
13112 #endif
13113   ;
13114   return 0;
13115 }
13116 _ACEOF
13117 rm -f "conftest.$ac_objext"
13118 if { (eval echo "$as_me:13118: \"$ac_compile\"") >&5
13119   (eval $ac_compile) 2>&5
13120   ac_status=$?
13121   echo "$as_me:13121: \$? = $ac_status" >&5
13122   (exit "$ac_status"); } &&
13123          { ac_try='test -s "conftest.$ac_objext"'
13124   { (eval echo "$as_me:13124: \"$ac_try\"") >&5
13125   (eval $ac_try) 2>&5
13126   ac_status=$?
13127   echo "$as_me:13127: \$? = $ac_status" >&5
13128   (exit "$ac_status"); }; }; then
13129   :
13130 else
13131   echo "$as_me: failed program was:" >&5
13132 cat "conftest.$ac_ext" >&5
13133 cf_cv_posix_c_source=no
13134 fi
13135 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13136          CFLAGS="$cf_save_CFLAGS"
13137          CPPFLAGS="$cf_save_CPPFLAGS"
13138
13139 fi
13140 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13141
13142 fi
13143 echo "$as_me:13143: result: $cf_cv_posix_c_source" >&5
13144 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13145
13146 if test "$cf_cv_posix_c_source" != no ; then
13147         CFLAGS="$cf_trim_CFLAGS"
13148         CPPFLAGS="$cf_trim_CPPFLAGS"
13149
13150 cf_fix_cppflags=no
13151 cf_new_cflags=
13152 cf_new_cppflags=
13153 cf_new_extra_cppflags=
13154
13155 for cf_add_cflags in $cf_cv_posix_c_source
13156 do
13157 case "$cf_fix_cppflags" in
13158 (no)
13159         case "$cf_add_cflags" in
13160         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13161                 case "$cf_add_cflags" in
13162                 (-D*)
13163                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13164
13165                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13166                                 && test -z "${cf_tst_cflags}" \
13167                                 && cf_fix_cppflags=yes
13168
13169                         if test "$cf_fix_cppflags" = yes ; then
13170
13171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13173
13174                                 continue
13175                         elif test "${cf_tst_cflags}" = "\"'" ; then
13176
13177         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13178         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13179
13180                                 continue
13181                         fi
13182                         ;;
13183                 esac
13184                 case "$CPPFLAGS" in
13185                 (*$cf_add_cflags)
13186                         ;;
13187                 (*)
13188                         case "$cf_add_cflags" in
13189                         (-D*)
13190                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13191
13192 CPPFLAGS=`echo "$CPPFLAGS" | \
13193         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13194                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13195
13196                                 ;;
13197                         esac
13198
13199         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13200         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13201
13202                         ;;
13203                 esac
13204                 ;;
13205         (*)
13206
13207         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13208         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13209
13210                 ;;
13211         esac
13212         ;;
13213 (yes)
13214
13215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13217
13218         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13219
13220         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13221                 && test -z "${cf_tst_cflags}" \
13222                 && cf_fix_cppflags=no
13223         ;;
13224 esac
13225 done
13226
13227 if test -n "$cf_new_cflags" ; then
13228
13229         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13230         CFLAGS="${CFLAGS}$cf_new_cflags"
13231
13232 fi
13233
13234 if test -n "$cf_new_cppflags" ; then
13235
13236         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13237         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13238
13239 fi
13240
13241 if test -n "$cf_new_extra_cppflags" ; then
13242
13243         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13244         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13245
13246 fi
13247
13248 fi
13249
13250 fi # cf_cv_posix_visible
13251
13252         ;;
13253 (netbsd*)
13254         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13255         ;;
13256 (openbsd[6-9]*)
13257         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13258         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13259         # Abusing the conformance level is a workaround.
13260         { echo "$as_me:13260: WARNING: this system does not provide usable locale support" >&5
13261 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13262         cf_xopen_source="-D_BSD_SOURCE"
13263         cf_XOPEN_SOURCE=700
13264         ;;
13265 (openbsd[4-5]*)
13266         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13267         cf_xopen_source="-D_BSD_SOURCE"
13268         cf_XOPEN_SOURCE=600
13269         ;;
13270 (openbsd*)
13271         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13272         ;;
13273 (osf[45]*)
13274         cf_xopen_source="-D_OSF_SOURCE"
13275         ;;
13276 (nto-qnx*)
13277         cf_xopen_source="-D_QNX_SOURCE"
13278         ;;
13279 (sco*)
13280         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13281         ;;
13282 (solaris2.*)
13283         cf_xopen_source="-D__EXTENSIONS__"
13284         cf_cv_xopen_source=broken
13285         ;;
13286 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13287         cf_XOPEN_SOURCE=
13288         cf_POSIX_C_SOURCE=
13289         ;;
13290 (*)
13291
13292 echo "$as_me:13292: checking if we should define _XOPEN_SOURCE" >&5
13293 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13294 if test "${cf_cv_xopen_source+set}" = set; then
13295   echo $ECHO_N "(cached) $ECHO_C" >&6
13296 else
13297
13298         cat >"conftest.$ac_ext" <<_ACEOF
13299 #line 13299 "configure"
13300 #include "confdefs.h"
13301
13302 #include <stdlib.h>
13303 #include <string.h>
13304 #include <sys/types.h>
13305
13306 int
13307 main (void)
13308 {
13309
13310 #ifndef _XOPEN_SOURCE
13311 make an error
13312 #endif
13313
13314   ;
13315   return 0;
13316 }
13317 _ACEOF
13318 rm -f "conftest.$ac_objext"
13319 if { (eval echo "$as_me:13319: \"$ac_compile\"") >&5
13320   (eval $ac_compile) 2>&5
13321   ac_status=$?
13322   echo "$as_me:13322: \$? = $ac_status" >&5
13323   (exit "$ac_status"); } &&
13324          { ac_try='test -s "conftest.$ac_objext"'
13325   { (eval echo "$as_me:13325: \"$ac_try\"") >&5
13326   (eval $ac_try) 2>&5
13327   ac_status=$?
13328   echo "$as_me:13328: \$? = $ac_status" >&5
13329   (exit "$ac_status"); }; }; then
13330   cf_cv_xopen_source=no
13331 else
13332   echo "$as_me: failed program was:" >&5
13333 cat "conftest.$ac_ext" >&5
13334 cf_save="$CPPFLAGS"
13335
13336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13337         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13338
13339          cat >"conftest.$ac_ext" <<_ACEOF
13340 #line 13340 "configure"
13341 #include "confdefs.h"
13342
13343 #include <stdlib.h>
13344 #include <string.h>
13345 #include <sys/types.h>
13346
13347 int
13348 main (void)
13349 {
13350
13351 #ifndef _XOPEN_SOURCE
13352 make an error
13353 #endif
13354
13355   ;
13356   return 0;
13357 }
13358 _ACEOF
13359 rm -f "conftest.$ac_objext"
13360 if { (eval echo "$as_me:13360: \"$ac_compile\"") >&5
13361   (eval $ac_compile) 2>&5
13362   ac_status=$?
13363   echo "$as_me:13363: \$? = $ac_status" >&5
13364   (exit "$ac_status"); } &&
13365          { ac_try='test -s "conftest.$ac_objext"'
13366   { (eval echo "$as_me:13366: \"$ac_try\"") >&5
13367   (eval $ac_try) 2>&5
13368   ac_status=$?
13369   echo "$as_me:13369: \$? = $ac_status" >&5
13370   (exit "$ac_status"); }; }; then
13371   cf_cv_xopen_source=no
13372 else
13373   echo "$as_me: failed program was:" >&5
13374 cat "conftest.$ac_ext" >&5
13375 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13376 fi
13377 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13378                 CPPFLAGS="$cf_save"
13379
13380 fi
13381 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13382
13383 fi
13384 echo "$as_me:13384: result: $cf_cv_xopen_source" >&5
13385 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13386
13387 if test "$cf_cv_xopen_source" != no ; then
13388
13389 CFLAGS=`echo "$CFLAGS" | \
13390         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13391                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13392
13393 CPPFLAGS=`echo "$CPPFLAGS" | \
13394         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13395                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13396
13397         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13398
13399 for cf_add_cflags in $cf_temp_xopen_source
13400 do
13401         case "x$cf_add_cflags" in
13402         (x-[DU]*)
13403
13404 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13405 while true
13406 do
13407         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'`
13408         test "$CFLAGS" != "$cf_old_cflag" || break
13409
13410         CFLAGS="$cf_old_cflag"
13411 done
13412
13413 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13414 while true
13415 do
13416         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'`
13417         test "$CPPFLAGS" != "$cf_old_cflag" || break
13418
13419         CPPFLAGS="$cf_old_cflag"
13420 done
13421
13422                 ;;
13423         esac
13424
13425 cf_fix_cppflags=no
13426 cf_new_cflags=
13427 cf_new_cppflags=
13428 cf_new_extra_cppflags=
13429
13430 for cf_add_cflags in $cf_add_cflags
13431 do
13432 case "$cf_fix_cppflags" in
13433 (no)
13434         case "$cf_add_cflags" in
13435         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13436                 case "$cf_add_cflags" in
13437                 (-D*)
13438                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13439
13440                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13441                                 && test -z "${cf_tst_cflags}" \
13442                                 && cf_fix_cppflags=yes
13443
13444                         if test "$cf_fix_cppflags" = yes ; then
13445
13446         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13447         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13448
13449                                 continue
13450                         elif test "${cf_tst_cflags}" = "\"'" ; then
13451
13452         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13453         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13454
13455                                 continue
13456                         fi
13457                         ;;
13458                 esac
13459                 case "$CPPFLAGS" in
13460                 (*$cf_add_cflags)
13461                         ;;
13462                 (*)
13463                         case "$cf_add_cflags" in
13464                         (-D*)
13465                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13466
13467 CPPFLAGS=`echo "$CPPFLAGS" | \
13468         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13469                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13470
13471                                 ;;
13472                         esac
13473
13474         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13475         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13476
13477                         ;;
13478                 esac
13479                 ;;
13480         (*)
13481
13482         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13483         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13484
13485                 ;;
13486         esac
13487         ;;
13488 (yes)
13489
13490         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13491         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13492
13493         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13494
13495         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13496                 && test -z "${cf_tst_cflags}" \
13497                 && cf_fix_cppflags=no
13498         ;;
13499 esac
13500 done
13501
13502 if test -n "$cf_new_cflags" ; then
13503
13504         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13505         CFLAGS="${CFLAGS}$cf_new_cflags"
13506
13507 fi
13508
13509 if test -n "$cf_new_cppflags" ; then
13510
13511         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13512         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13513
13514 fi
13515
13516 if test -n "$cf_new_extra_cppflags" ; then
13517
13518         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13519         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13520
13521 fi
13522
13523 done
13524
13525 fi
13526
13527         cf_save_xopen_cppflags="$CPPFLAGS"
13528
13529 if test "$cf_cv_posix_visible" = no; then
13530
13531 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13532
13533 cf_save_CFLAGS="$CFLAGS"
13534 cf_save_CPPFLAGS="$CPPFLAGS"
13535
13536 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13537         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13538                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13539
13540 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13541         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13542                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13543
13544 echo "$as_me:13544: checking if we should define _POSIX_C_SOURCE" >&5
13545 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13546 if test "${cf_cv_posix_c_source+set}" = set; then
13547   echo $ECHO_N "(cached) $ECHO_C" >&6
13548 else
13549
13550 echo "${as_me:-configure}:13550: testing if the symbol is already defined go no further ..." 1>&5
13551
13552         cat >"conftest.$ac_ext" <<_ACEOF
13553 #line 13553 "configure"
13554 #include "confdefs.h"
13555 #include <sys/types.h>
13556 int
13557 main (void)
13558 {
13559
13560 #ifndef _POSIX_C_SOURCE
13561 make an error
13562 #endif
13563   ;
13564   return 0;
13565 }
13566 _ACEOF
13567 rm -f "conftest.$ac_objext"
13568 if { (eval echo "$as_me:13568: \"$ac_compile\"") >&5
13569   (eval $ac_compile) 2>&5
13570   ac_status=$?
13571   echo "$as_me:13571: \$? = $ac_status" >&5
13572   (exit "$ac_status"); } &&
13573          { ac_try='test -s "conftest.$ac_objext"'
13574   { (eval echo "$as_me:13574: \"$ac_try\"") >&5
13575   (eval $ac_try) 2>&5
13576   ac_status=$?
13577   echo "$as_me:13577: \$? = $ac_status" >&5
13578   (exit "$ac_status"); }; }; then
13579   cf_cv_posix_c_source=no
13580 else
13581   echo "$as_me: failed program was:" >&5
13582 cat "conftest.$ac_ext" >&5
13583 cf_want_posix_source=no
13584          case .$cf_POSIX_C_SOURCE in
13585          (.[12]??*)
13586                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13587                 ;;
13588          (.2)
13589                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13590                 cf_want_posix_source=yes
13591                 ;;
13592          (.*)
13593                 cf_want_posix_source=yes
13594                 ;;
13595          esac
13596          if test "$cf_want_posix_source" = yes ; then
13597                 cat >"conftest.$ac_ext" <<_ACEOF
13598 #line 13598 "configure"
13599 #include "confdefs.h"
13600 #include <sys/types.h>
13601 int
13602 main (void)
13603 {
13604
13605 #ifdef _POSIX_SOURCE
13606 make an error
13607 #endif
13608   ;
13609   return 0;
13610 }
13611 _ACEOF
13612 rm -f "conftest.$ac_objext"
13613 if { (eval echo "$as_me:13613: \"$ac_compile\"") >&5
13614   (eval $ac_compile) 2>&5
13615   ac_status=$?
13616   echo "$as_me:13616: \$? = $ac_status" >&5
13617   (exit "$ac_status"); } &&
13618          { ac_try='test -s "conftest.$ac_objext"'
13619   { (eval echo "$as_me:13619: \"$ac_try\"") >&5
13620   (eval $ac_try) 2>&5
13621   ac_status=$?
13622   echo "$as_me:13622: \$? = $ac_status" >&5
13623   (exit "$ac_status"); }; }; then
13624   :
13625 else
13626   echo "$as_me: failed program was:" >&5
13627 cat "conftest.$ac_ext" >&5
13628 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13629 fi
13630 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13631          fi
13632
13633 echo "${as_me:-configure}:13633: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13634
13635          CFLAGS="$cf_trim_CFLAGS"
13636          CPPFLAGS="$cf_trim_CPPFLAGS"
13637
13638         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13639         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13640
13641 echo "${as_me:-configure}:13641: testing if the second compile does not leave our definition intact error ..." 1>&5
13642
13643          cat >"conftest.$ac_ext" <<_ACEOF
13644 #line 13644 "configure"
13645 #include "confdefs.h"
13646 #include <sys/types.h>
13647 int
13648 main (void)
13649 {
13650
13651 #ifndef _POSIX_C_SOURCE
13652 make an error
13653 #endif
13654   ;
13655   return 0;
13656 }
13657 _ACEOF
13658 rm -f "conftest.$ac_objext"
13659 if { (eval echo "$as_me:13659: \"$ac_compile\"") >&5
13660   (eval $ac_compile) 2>&5
13661   ac_status=$?
13662   echo "$as_me:13662: \$? = $ac_status" >&5
13663   (exit "$ac_status"); } &&
13664          { ac_try='test -s "conftest.$ac_objext"'
13665   { (eval echo "$as_me:13665: \"$ac_try\"") >&5
13666   (eval $ac_try) 2>&5
13667   ac_status=$?
13668   echo "$as_me:13668: \$? = $ac_status" >&5
13669   (exit "$ac_status"); }; }; then
13670   :
13671 else
13672   echo "$as_me: failed program was:" >&5
13673 cat "conftest.$ac_ext" >&5
13674 cf_cv_posix_c_source=no
13675 fi
13676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13677          CFLAGS="$cf_save_CFLAGS"
13678          CPPFLAGS="$cf_save_CPPFLAGS"
13679
13680 fi
13681 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13682
13683 fi
13684 echo "$as_me:13684: result: $cf_cv_posix_c_source" >&5
13685 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13686
13687 if test "$cf_cv_posix_c_source" != no ; then
13688         CFLAGS="$cf_trim_CFLAGS"
13689         CPPFLAGS="$cf_trim_CPPFLAGS"
13690
13691 cf_fix_cppflags=no
13692 cf_new_cflags=
13693 cf_new_cppflags=
13694 cf_new_extra_cppflags=
13695
13696 for cf_add_cflags in $cf_cv_posix_c_source
13697 do
13698 case "$cf_fix_cppflags" in
13699 (no)
13700         case "$cf_add_cflags" in
13701         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13702                 case "$cf_add_cflags" in
13703                 (-D*)
13704                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13705
13706                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13707                                 && test -z "${cf_tst_cflags}" \
13708                                 && cf_fix_cppflags=yes
13709
13710                         if test "$cf_fix_cppflags" = yes ; then
13711
13712         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13713         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13714
13715                                 continue
13716                         elif test "${cf_tst_cflags}" = "\"'" ; then
13717
13718         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13719         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13720
13721                                 continue
13722                         fi
13723                         ;;
13724                 esac
13725                 case "$CPPFLAGS" in
13726                 (*$cf_add_cflags)
13727                         ;;
13728                 (*)
13729                         case "$cf_add_cflags" in
13730                         (-D*)
13731                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13732
13733 CPPFLAGS=`echo "$CPPFLAGS" | \
13734         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13735                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13736
13737                                 ;;
13738                         esac
13739
13740         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13741         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13742
13743                         ;;
13744                 esac
13745                 ;;
13746         (*)
13747
13748         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13749         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13750
13751                 ;;
13752         esac
13753         ;;
13754 (yes)
13755
13756         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13757         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13758
13759         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13760
13761         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13762                 && test -z "${cf_tst_cflags}" \
13763                 && cf_fix_cppflags=no
13764         ;;
13765 esac
13766 done
13767
13768 if test -n "$cf_new_cflags" ; then
13769
13770         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13771         CFLAGS="${CFLAGS}$cf_new_cflags"
13772
13773 fi
13774
13775 if test -n "$cf_new_cppflags" ; then
13776
13777         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13778         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13779
13780 fi
13781
13782 if test -n "$cf_new_extra_cppflags" ; then
13783
13784         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13785         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13786
13787 fi
13788
13789 fi
13790
13791 fi # cf_cv_posix_visible
13792
13793         # Some of these niche implementations use copy/paste, double-check...
13794         test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
13795
13796 echo "${as_me:-configure}:13796: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
13797
13798         cat >"conftest.$ac_ext" <<_ACEOF
13799 #line 13799 "configure"
13800 #include "confdefs.h"
13801
13802 #include <stdlib.h>
13803 #include <string.h>
13804 #include <sys/types.h>
13805
13806 int
13807 main (void)
13808 {
13809
13810 #ifndef _XOPEN_SOURCE
13811 make an error
13812 #endif
13813
13814   ;
13815   return 0;
13816 }
13817 _ACEOF
13818 rm -f "conftest.$ac_objext"
13819 if { (eval echo "$as_me:13819: \"$ac_compile\"") >&5
13820   (eval $ac_compile) 2>&5
13821   ac_status=$?
13822   echo "$as_me:13822: \$? = $ac_status" >&5
13823   (exit "$ac_status"); } &&
13824          { ac_try='test -s "conftest.$ac_objext"'
13825   { (eval echo "$as_me:13825: \"$ac_try\"") >&5
13826   (eval $ac_try) 2>&5
13827   ac_status=$?
13828   echo "$as_me:13828: \$? = $ac_status" >&5
13829   (exit "$ac_status"); }; }; then
13830   :
13831 else
13832   echo "$as_me: failed program was:" >&5
13833 cat "conftest.$ac_ext" >&5
13834
13835                 { echo "$as_me:13835: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
13836 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
13837                 CPPFLAGS="$cf_save_xopen_cppflags"
13838 fi
13839 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13840         ;;
13841 esac
13842
13843 if test -n "$cf_xopen_source" ; then
13844
13845 for cf_add_cflags in $cf_xopen_source
13846 do
13847         case "x$cf_add_cflags" in
13848         (x-[DU]*)
13849
13850 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13851 while true
13852 do
13853         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'`
13854         test "$CFLAGS" != "$cf_old_cflag" || break
13855         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13856
13857 echo "${as_me:-configure}:13857: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13858
13859         CFLAGS="$cf_old_cflag"
13860 done
13861
13862 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13863 while true
13864 do
13865         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'`
13866         test "$CPPFLAGS" != "$cf_old_cflag" || break
13867         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13868
13869 echo "${as_me:-configure}:13869: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13870
13871         CPPFLAGS="$cf_old_cflag"
13872 done
13873
13874                 ;;
13875         esac
13876
13877 cf_fix_cppflags=no
13878 cf_new_cflags=
13879 cf_new_cppflags=
13880 cf_new_extra_cppflags=
13881
13882 for cf_add_cflags in $cf_add_cflags
13883 do
13884 case "$cf_fix_cppflags" in
13885 (no)
13886         case "$cf_add_cflags" in
13887         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13888                 case "$cf_add_cflags" in
13889                 (-D*)
13890                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13891
13892                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13893                                 && test -z "${cf_tst_cflags}" \
13894                                 && cf_fix_cppflags=yes
13895
13896                         if test "$cf_fix_cppflags" = yes ; then
13897
13898         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13899         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13900
13901                                 continue
13902                         elif test "${cf_tst_cflags}" = "\"'" ; then
13903
13904         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13905         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13906
13907                                 continue
13908                         fi
13909                         ;;
13910                 esac
13911                 case "$CPPFLAGS" in
13912                 (*$cf_add_cflags)
13913                         ;;
13914                 (*)
13915                         case "$cf_add_cflags" in
13916                         (-D*)
13917                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13918
13919 CPPFLAGS=`echo "$CPPFLAGS" | \
13920         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13921                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13922
13923                                 ;;
13924                         esac
13925
13926         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13927         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13928
13929                         ;;
13930                 esac
13931                 ;;
13932         (*)
13933
13934         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13935         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13936
13937                 ;;
13938         esac
13939         ;;
13940 (yes)
13941
13942         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13943         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13944
13945         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13946
13947         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13948                 && test -z "${cf_tst_cflags}" \
13949                 && cf_fix_cppflags=no
13950         ;;
13951 esac
13952 done
13953
13954 if test -n "$cf_new_cflags" ; then
13955         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13956
13957 echo "${as_me:-configure}:13957: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13958
13959         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13960         CFLAGS="${CFLAGS}$cf_new_cflags"
13961
13962 fi
13963
13964 if test -n "$cf_new_cppflags" ; then
13965         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13966
13967 echo "${as_me:-configure}:13967: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13968
13969         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13970         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13971
13972 fi
13973
13974 if test -n "$cf_new_extra_cppflags" ; then
13975         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13976
13977 echo "${as_me:-configure}:13977: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13978
13979         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13980         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13981
13982 fi
13983
13984 done
13985
13986 fi
13987
13988 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13989         echo "$as_me:13989: checking if _XOPEN_SOURCE really is set" >&5
13990 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13991         cat >"conftest.$ac_ext" <<_ACEOF
13992 #line 13992 "configure"
13993 #include "confdefs.h"
13994 #include <stdlib.h>
13995 int
13996 main (void)
13997 {
13998
13999 #ifndef _XOPEN_SOURCE
14000 make an error
14001 #endif
14002   ;
14003   return 0;
14004 }
14005 _ACEOF
14006 rm -f "conftest.$ac_objext"
14007 if { (eval echo "$as_me:14007: \"$ac_compile\"") >&5
14008   (eval $ac_compile) 2>&5
14009   ac_status=$?
14010   echo "$as_me:14010: \$? = $ac_status" >&5
14011   (exit "$ac_status"); } &&
14012          { ac_try='test -s "conftest.$ac_objext"'
14013   { (eval echo "$as_me:14013: \"$ac_try\"") >&5
14014   (eval $ac_try) 2>&5
14015   ac_status=$?
14016   echo "$as_me:14016: \$? = $ac_status" >&5
14017   (exit "$ac_status"); }; }; then
14018   cf_XOPEN_SOURCE_set=yes
14019 else
14020   echo "$as_me: failed program was:" >&5
14021 cat "conftest.$ac_ext" >&5
14022 cf_XOPEN_SOURCE_set=no
14023 fi
14024 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14025         echo "$as_me:14025: result: $cf_XOPEN_SOURCE_set" >&5
14026 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14027         if test "$cf_XOPEN_SOURCE_set" = yes
14028         then
14029                 cat >"conftest.$ac_ext" <<_ACEOF
14030 #line 14030 "configure"
14031 #include "confdefs.h"
14032 #include <stdlib.h>
14033 int
14034 main (void)
14035 {
14036
14037 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14038 make an error
14039 #endif
14040   ;
14041   return 0;
14042 }
14043 _ACEOF
14044 rm -f "conftest.$ac_objext"
14045 if { (eval echo "$as_me:14045: \"$ac_compile\"") >&5
14046   (eval $ac_compile) 2>&5
14047   ac_status=$?
14048   echo "$as_me:14048: \$? = $ac_status" >&5
14049   (exit "$ac_status"); } &&
14050          { ac_try='test -s "conftest.$ac_objext"'
14051   { (eval echo "$as_me:14051: \"$ac_try\"") >&5
14052   (eval $ac_try) 2>&5
14053   ac_status=$?
14054   echo "$as_me:14054: \$? = $ac_status" >&5
14055   (exit "$ac_status"); }; }; then
14056   cf_XOPEN_SOURCE_set_ok=yes
14057 else
14058   echo "$as_me: failed program was:" >&5
14059 cat "conftest.$ac_ext" >&5
14060 cf_XOPEN_SOURCE_set_ok=no
14061 fi
14062 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14063                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14064                 then
14065                         { echo "$as_me:14065: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14066 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14067                 fi
14068         else
14069
14070 echo "$as_me:14070: checking if we should define _XOPEN_SOURCE" >&5
14071 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14072 if test "${cf_cv_xopen_source+set}" = set; then
14073   echo $ECHO_N "(cached) $ECHO_C" >&6
14074 else
14075
14076         cat >"conftest.$ac_ext" <<_ACEOF
14077 #line 14077 "configure"
14078 #include "confdefs.h"
14079
14080 #include <stdlib.h>
14081 #include <string.h>
14082 #include <sys/types.h>
14083
14084 int
14085 main (void)
14086 {
14087
14088 #ifndef _XOPEN_SOURCE
14089 make an error
14090 #endif
14091
14092   ;
14093   return 0;
14094 }
14095 _ACEOF
14096 rm -f "conftest.$ac_objext"
14097 if { (eval echo "$as_me:14097: \"$ac_compile\"") >&5
14098   (eval $ac_compile) 2>&5
14099   ac_status=$?
14100   echo "$as_me:14100: \$? = $ac_status" >&5
14101   (exit "$ac_status"); } &&
14102          { ac_try='test -s "conftest.$ac_objext"'
14103   { (eval echo "$as_me:14103: \"$ac_try\"") >&5
14104   (eval $ac_try) 2>&5
14105   ac_status=$?
14106   echo "$as_me:14106: \$? = $ac_status" >&5
14107   (exit "$ac_status"); }; }; then
14108   cf_cv_xopen_source=no
14109 else
14110   echo "$as_me: failed program was:" >&5
14111 cat "conftest.$ac_ext" >&5
14112 cf_save="$CPPFLAGS"
14113
14114         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14115         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14116
14117          cat >"conftest.$ac_ext" <<_ACEOF
14118 #line 14118 "configure"
14119 #include "confdefs.h"
14120
14121 #include <stdlib.h>
14122 #include <string.h>
14123 #include <sys/types.h>
14124
14125 int
14126 main (void)
14127 {
14128
14129 #ifndef _XOPEN_SOURCE
14130 make an error
14131 #endif
14132
14133   ;
14134   return 0;
14135 }
14136 _ACEOF
14137 rm -f "conftest.$ac_objext"
14138 if { (eval echo "$as_me:14138: \"$ac_compile\"") >&5
14139   (eval $ac_compile) 2>&5
14140   ac_status=$?
14141   echo "$as_me:14141: \$? = $ac_status" >&5
14142   (exit "$ac_status"); } &&
14143          { ac_try='test -s "conftest.$ac_objext"'
14144   { (eval echo "$as_me:14144: \"$ac_try\"") >&5
14145   (eval $ac_try) 2>&5
14146   ac_status=$?
14147   echo "$as_me:14147: \$? = $ac_status" >&5
14148   (exit "$ac_status"); }; }; then
14149   cf_cv_xopen_source=no
14150 else
14151   echo "$as_me: failed program was:" >&5
14152 cat "conftest.$ac_ext" >&5
14153 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14154 fi
14155 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14156                 CPPFLAGS="$cf_save"
14157
14158 fi
14159 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14160
14161 fi
14162 echo "$as_me:14162: result: $cf_cv_xopen_source" >&5
14163 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14164
14165 if test "$cf_cv_xopen_source" != no ; then
14166
14167 CFLAGS=`echo "$CFLAGS" | \
14168         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14169                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14170
14171 CPPFLAGS=`echo "$CPPFLAGS" | \
14172         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14173                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14174
14175         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14176
14177 for cf_add_cflags in $cf_temp_xopen_source
14178 do
14179         case "x$cf_add_cflags" in
14180         (x-[DU]*)
14181
14182 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14183 while true
14184 do
14185         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'`
14186         test "$CFLAGS" != "$cf_old_cflag" || break
14187
14188         CFLAGS="$cf_old_cflag"
14189 done
14190
14191 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14192 while true
14193 do
14194         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'`
14195         test "$CPPFLAGS" != "$cf_old_cflag" || break
14196
14197         CPPFLAGS="$cf_old_cflag"
14198 done
14199
14200                 ;;
14201         esac
14202
14203 cf_fix_cppflags=no
14204 cf_new_cflags=
14205 cf_new_cppflags=
14206 cf_new_extra_cppflags=
14207
14208 for cf_add_cflags in $cf_add_cflags
14209 do
14210 case "$cf_fix_cppflags" in
14211 (no)
14212         case "$cf_add_cflags" in
14213         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14214                 case "$cf_add_cflags" in
14215                 (-D*)
14216                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14217
14218                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14219                                 && test -z "${cf_tst_cflags}" \
14220                                 && cf_fix_cppflags=yes
14221
14222                         if test "$cf_fix_cppflags" = yes ; then
14223
14224         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14225         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14226
14227                                 continue
14228                         elif test "${cf_tst_cflags}" = "\"'" ; then
14229
14230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14232
14233                                 continue
14234                         fi
14235                         ;;
14236                 esac
14237                 case "$CPPFLAGS" in
14238                 (*$cf_add_cflags)
14239                         ;;
14240                 (*)
14241                         case "$cf_add_cflags" in
14242                         (-D*)
14243                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14244
14245 CPPFLAGS=`echo "$CPPFLAGS" | \
14246         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14247                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14248
14249                                 ;;
14250                         esac
14251
14252         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14253         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14254
14255                         ;;
14256                 esac
14257                 ;;
14258         (*)
14259
14260         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14261         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14262
14263                 ;;
14264         esac
14265         ;;
14266 (yes)
14267
14268         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14269         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14270
14271         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14272
14273         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14274                 && test -z "${cf_tst_cflags}" \
14275                 && cf_fix_cppflags=no
14276         ;;
14277 esac
14278 done
14279
14280 if test -n "$cf_new_cflags" ; then
14281
14282         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14283         CFLAGS="${CFLAGS}$cf_new_cflags"
14284
14285 fi
14286
14287 if test -n "$cf_new_cppflags" ; then
14288
14289         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14290         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14291
14292 fi
14293
14294 if test -n "$cf_new_extra_cppflags" ; then
14295
14296         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14297         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14298
14299 fi
14300
14301 done
14302
14303 fi
14304
14305         fi
14306 fi
14307 fi # cf_cv_posix_visible
14308
14309 # Check whether --enable-largefile or --disable-largefile was given.
14310 if test "${enable_largefile+set}" = set; then
14311   enableval="$enable_largefile"
14312
14313 fi;
14314 if test "$enable_largefile" != no; then
14315
14316   echo "$as_me:14316: checking for special C compiler options needed for large files" >&5
14317 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14318 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14319   echo $ECHO_N "(cached) $ECHO_C" >&6
14320 else
14321   ac_cv_sys_largefile_CC=no
14322      if test "$GCC" != yes; then
14323        ac_save_CC=$CC
14324        while :; do
14325          # IRIX 6.2 and later do not support large files by default,
14326          # so use the C compiler's -n32 option if that helps.
14327          cat >"conftest.$ac_ext" <<_ACEOF
14328 #line 14328 "configure"
14329 #include "confdefs.h"
14330 #include <sys/types.h>
14331  /* Check that off_t can represent 2**63 - 1 correctly.
14332     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14333     since some C++ compilers masquerading as C compilers
14334     incorrectly reject 9223372036854775807.  */
14335 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14336   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14337                        && LARGE_OFF_T % 2147483647 == 1)
14338                       ? 1 : -1];
14339 int
14340 main (void)
14341 {
14342
14343   ;
14344   return 0;
14345 }
14346 _ACEOF
14347          rm -f "conftest.$ac_objext"
14348 if { (eval echo "$as_me:14348: \"$ac_compile\"") >&5
14349   (eval $ac_compile) 2>&5
14350   ac_status=$?
14351   echo "$as_me:14351: \$? = $ac_status" >&5
14352   (exit "$ac_status"); } &&
14353          { ac_try='test -s "conftest.$ac_objext"'
14354   { (eval echo "$as_me:14354: \"$ac_try\"") >&5
14355   (eval $ac_try) 2>&5
14356   ac_status=$?
14357   echo "$as_me:14357: \$? = $ac_status" >&5
14358   (exit "$ac_status"); }; }; then
14359   break
14360 else
14361   echo "$as_me: failed program was:" >&5
14362 cat "conftest.$ac_ext" >&5
14363 fi
14364 rm -f "conftest.$ac_objext"
14365          CC="$CC -n32"
14366          rm -f "conftest.$ac_objext"
14367 if { (eval echo "$as_me:14367: \"$ac_compile\"") >&5
14368   (eval $ac_compile) 2>&5
14369   ac_status=$?
14370   echo "$as_me:14370: \$? = $ac_status" >&5
14371   (exit "$ac_status"); } &&
14372          { ac_try='test -s "conftest.$ac_objext"'
14373   { (eval echo "$as_me:14373: \"$ac_try\"") >&5
14374   (eval $ac_try) 2>&5
14375   ac_status=$?
14376   echo "$as_me:14376: \$? = $ac_status" >&5
14377   (exit "$ac_status"); }; }; then
14378   ac_cv_sys_largefile_CC=' -n32'; break
14379 else
14380   echo "$as_me: failed program was:" >&5
14381 cat "conftest.$ac_ext" >&5
14382 fi
14383 rm -f "conftest.$ac_objext"
14384          break
14385        done
14386        CC=$ac_save_CC
14387        rm -f "conftest.$ac_ext"
14388     fi
14389 fi
14390 echo "$as_me:14390: result: $ac_cv_sys_largefile_CC" >&5
14391 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14392   if test "$ac_cv_sys_largefile_CC" != no; then
14393     CC=$CC$ac_cv_sys_largefile_CC
14394   fi
14395
14396   echo "$as_me:14396: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14397 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14398 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14399   echo $ECHO_N "(cached) $ECHO_C" >&6
14400 else
14401   while :; do
14402   ac_cv_sys_file_offset_bits=no
14403   cat >"conftest.$ac_ext" <<_ACEOF
14404 #line 14404 "configure"
14405 #include "confdefs.h"
14406 #include <sys/types.h>
14407  /* Check that off_t can represent 2**63 - 1 correctly.
14408     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14409     since some C++ compilers masquerading as C compilers
14410     incorrectly reject 9223372036854775807.  */
14411 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14412   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14413                        && LARGE_OFF_T % 2147483647 == 1)
14414                       ? 1 : -1];
14415 int
14416 main (void)
14417 {
14418
14419   ;
14420   return 0;
14421 }
14422 _ACEOF
14423 rm -f "conftest.$ac_objext"
14424 if { (eval echo "$as_me:14424: \"$ac_compile\"") >&5
14425   (eval $ac_compile) 2>&5
14426   ac_status=$?
14427   echo "$as_me:14427: \$? = $ac_status" >&5
14428   (exit "$ac_status"); } &&
14429          { ac_try='test -s "conftest.$ac_objext"'
14430   { (eval echo "$as_me:14430: \"$ac_try\"") >&5
14431   (eval $ac_try) 2>&5
14432   ac_status=$?
14433   echo "$as_me:14433: \$? = $ac_status" >&5
14434   (exit "$ac_status"); }; }; then
14435   break
14436 else
14437   echo "$as_me: failed program was:" >&5
14438 cat "conftest.$ac_ext" >&5
14439 fi
14440 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14441   cat >"conftest.$ac_ext" <<_ACEOF
14442 #line 14442 "configure"
14443 #include "confdefs.h"
14444 #define _FILE_OFFSET_BITS 64
14445 #include <sys/types.h>
14446  /* Check that off_t can represent 2**63 - 1 correctly.
14447     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14448     since some C++ compilers masquerading as C compilers
14449     incorrectly reject 9223372036854775807.  */
14450 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14451   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14452                        && LARGE_OFF_T % 2147483647 == 1)
14453                       ? 1 : -1];
14454 int
14455 main (void)
14456 {
14457
14458   ;
14459   return 0;
14460 }
14461 _ACEOF
14462 rm -f "conftest.$ac_objext"
14463 if { (eval echo "$as_me:14463: \"$ac_compile\"") >&5
14464   (eval $ac_compile) 2>&5
14465   ac_status=$?
14466   echo "$as_me:14466: \$? = $ac_status" >&5
14467   (exit "$ac_status"); } &&
14468          { ac_try='test -s "conftest.$ac_objext"'
14469   { (eval echo "$as_me:14469: \"$ac_try\"") >&5
14470   (eval $ac_try) 2>&5
14471   ac_status=$?
14472   echo "$as_me:14472: \$? = $ac_status" >&5
14473   (exit "$ac_status"); }; }; then
14474   ac_cv_sys_file_offset_bits=64; break
14475 else
14476   echo "$as_me: failed program was:" >&5
14477 cat "conftest.$ac_ext" >&5
14478 fi
14479 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14480   break
14481 done
14482 fi
14483 echo "$as_me:14483: result: $ac_cv_sys_file_offset_bits" >&5
14484 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14485 if test "$ac_cv_sys_file_offset_bits" != no; then
14486
14487 cat >>confdefs.h <<EOF
14488 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14489 EOF
14490
14491 fi
14492 rm -rf conftest*
14493   echo "$as_me:14493: checking for _LARGE_FILES value needed for large files" >&5
14494 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14495 if test "${ac_cv_sys_large_files+set}" = set; then
14496   echo $ECHO_N "(cached) $ECHO_C" >&6
14497 else
14498   while :; do
14499   ac_cv_sys_large_files=no
14500   cat >"conftest.$ac_ext" <<_ACEOF
14501 #line 14501 "configure"
14502 #include "confdefs.h"
14503 #include <sys/types.h>
14504  /* Check that off_t can represent 2**63 - 1 correctly.
14505     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14506     since some C++ compilers masquerading as C compilers
14507     incorrectly reject 9223372036854775807.  */
14508 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14509   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14510                        && LARGE_OFF_T % 2147483647 == 1)
14511                       ? 1 : -1];
14512 int
14513 main (void)
14514 {
14515
14516   ;
14517   return 0;
14518 }
14519 _ACEOF
14520 rm -f "conftest.$ac_objext"
14521 if { (eval echo "$as_me:14521: \"$ac_compile\"") >&5
14522   (eval $ac_compile) 2>&5
14523   ac_status=$?
14524   echo "$as_me:14524: \$? = $ac_status" >&5
14525   (exit "$ac_status"); } &&
14526          { ac_try='test -s "conftest.$ac_objext"'
14527   { (eval echo "$as_me:14527: \"$ac_try\"") >&5
14528   (eval $ac_try) 2>&5
14529   ac_status=$?
14530   echo "$as_me:14530: \$? = $ac_status" >&5
14531   (exit "$ac_status"); }; }; then
14532   break
14533 else
14534   echo "$as_me: failed program was:" >&5
14535 cat "conftest.$ac_ext" >&5
14536 fi
14537 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14538   cat >"conftest.$ac_ext" <<_ACEOF
14539 #line 14539 "configure"
14540 #include "confdefs.h"
14541 #define _LARGE_FILES 1
14542 #include <sys/types.h>
14543  /* Check that off_t can represent 2**63 - 1 correctly.
14544     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14545     since some C++ compilers masquerading as C compilers
14546     incorrectly reject 9223372036854775807.  */
14547 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14548   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14549                        && LARGE_OFF_T % 2147483647 == 1)
14550                       ? 1 : -1];
14551 int
14552 main (void)
14553 {
14554
14555   ;
14556   return 0;
14557 }
14558 _ACEOF
14559 rm -f "conftest.$ac_objext"
14560 if { (eval echo "$as_me:14560: \"$ac_compile\"") >&5
14561   (eval $ac_compile) 2>&5
14562   ac_status=$?
14563   echo "$as_me:14563: \$? = $ac_status" >&5
14564   (exit "$ac_status"); } &&
14565          { ac_try='test -s "conftest.$ac_objext"'
14566   { (eval echo "$as_me:14566: \"$ac_try\"") >&5
14567   (eval $ac_try) 2>&5
14568   ac_status=$?
14569   echo "$as_me:14569: \$? = $ac_status" >&5
14570   (exit "$ac_status"); }; }; then
14571   ac_cv_sys_large_files=1; break
14572 else
14573   echo "$as_me: failed program was:" >&5
14574 cat "conftest.$ac_ext" >&5
14575 fi
14576 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14577   break
14578 done
14579 fi
14580 echo "$as_me:14580: result: $ac_cv_sys_large_files" >&5
14581 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14582 if test "$ac_cv_sys_large_files" != no; then
14583
14584 cat >>confdefs.h <<EOF
14585 #define _LARGE_FILES $ac_cv_sys_large_files
14586 EOF
14587
14588 fi
14589 rm -rf conftest*
14590 fi
14591
14592         if test "$enable_largefile" != no ; then
14593         echo "$as_me:14593: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14594 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14595 if test "${ac_cv_sys_largefile_source+set}" = set; then
14596   echo $ECHO_N "(cached) $ECHO_C" >&6
14597 else
14598   while :; do
14599   ac_cv_sys_largefile_source=no
14600   cat >"conftest.$ac_ext" <<_ACEOF
14601 #line 14601 "configure"
14602 #include "confdefs.h"
14603 #include <stdio.h>
14604 int
14605 main (void)
14606 {
14607 return !fseeko;
14608   ;
14609   return 0;
14610 }
14611 _ACEOF
14612 rm -f "conftest.$ac_objext"
14613 if { (eval echo "$as_me:14613: \"$ac_compile\"") >&5
14614   (eval $ac_compile) 2>&5
14615   ac_status=$?
14616   echo "$as_me:14616: \$? = $ac_status" >&5
14617   (exit "$ac_status"); } &&
14618          { ac_try='test -s "conftest.$ac_objext"'
14619   { (eval echo "$as_me:14619: \"$ac_try\"") >&5
14620   (eval $ac_try) 2>&5
14621   ac_status=$?
14622   echo "$as_me:14622: \$? = $ac_status" >&5
14623   (exit "$ac_status"); }; }; then
14624   break
14625 else
14626   echo "$as_me: failed program was:" >&5
14627 cat "conftest.$ac_ext" >&5
14628 fi
14629 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14630   cat >"conftest.$ac_ext" <<_ACEOF
14631 #line 14631 "configure"
14632 #include "confdefs.h"
14633 #define _LARGEFILE_SOURCE 1
14634 #include <stdio.h>
14635 int
14636 main (void)
14637 {
14638 return !fseeko;
14639   ;
14640   return 0;
14641 }
14642 _ACEOF
14643 rm -f "conftest.$ac_objext"
14644 if { (eval echo "$as_me:14644: \"$ac_compile\"") >&5
14645   (eval $ac_compile) 2>&5
14646   ac_status=$?
14647   echo "$as_me:14647: \$? = $ac_status" >&5
14648   (exit "$ac_status"); } &&
14649          { ac_try='test -s "conftest.$ac_objext"'
14650   { (eval echo "$as_me:14650: \"$ac_try\"") >&5
14651   (eval $ac_try) 2>&5
14652   ac_status=$?
14653   echo "$as_me:14653: \$? = $ac_status" >&5
14654   (exit "$ac_status"); }; }; then
14655   ac_cv_sys_largefile_source=1; break
14656 else
14657   echo "$as_me: failed program was:" >&5
14658 cat "conftest.$ac_ext" >&5
14659 fi
14660 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14661   break
14662 done
14663 fi
14664 echo "$as_me:14664: result: $ac_cv_sys_largefile_source" >&5
14665 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14666 if test "$ac_cv_sys_largefile_source" != no; then
14667
14668 cat >>confdefs.h <<EOF
14669 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14670 EOF
14671
14672 fi
14673 rm -rf conftest*
14674
14675 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14676 # in glibc 2.1.3, but that breaks too many other things.
14677 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14678 echo "$as_me:14678: checking for fseeko" >&5
14679 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14680 if test "${ac_cv_func_fseeko+set}" = set; then
14681   echo $ECHO_N "(cached) $ECHO_C" >&6
14682 else
14683   cat >"conftest.$ac_ext" <<_ACEOF
14684 #line 14684 "configure"
14685 #include "confdefs.h"
14686 #include <stdio.h>
14687 int
14688 main (void)
14689 {
14690 return fseeko && fseeko (stdin, 0, 0);
14691   ;
14692   return 0;
14693 }
14694 _ACEOF
14695 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14696 if { (eval echo "$as_me:14696: \"$ac_link\"") >&5
14697   (eval $ac_link) 2>&5
14698   ac_status=$?
14699   echo "$as_me:14699: \$? = $ac_status" >&5
14700   (exit "$ac_status"); } &&
14701          { ac_try='test -s "conftest$ac_exeext"'
14702   { (eval echo "$as_me:14702: \"$ac_try\"") >&5
14703   (eval $ac_try) 2>&5
14704   ac_status=$?
14705   echo "$as_me:14705: \$? = $ac_status" >&5
14706   (exit "$ac_status"); }; }; then
14707   ac_cv_func_fseeko=yes
14708 else
14709   echo "$as_me: failed program was:" >&5
14710 cat "conftest.$ac_ext" >&5
14711 ac_cv_func_fseeko=no
14712 fi
14713 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14714 fi
14715 echo "$as_me:14715: result: $ac_cv_func_fseeko" >&5
14716 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14717 if test $ac_cv_func_fseeko = yes; then
14718
14719 cat >>confdefs.h <<\EOF
14720 #define HAVE_FSEEKO 1
14721 EOF
14722
14723 fi
14724
14725         # Normally we would collect these definitions in the config.h,
14726         # but (like _XOPEN_SOURCE), some environments rely on having these
14727         # defined before any of the system headers are included.  Another
14728         # case comes up with C++, e.g., on AIX the compiler compiles the
14729         # header files by themselves before looking at the body files it is
14730         # told to compile.  For ncurses, those header files do not include
14731         # the config.h
14732         if test "$ac_cv_sys_large_files" != no
14733         then
14734
14735         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14736         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14737
14738         fi
14739         if test "$ac_cv_sys_largefile_source" != no
14740         then
14741
14742         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14743         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14744
14745         fi
14746         if test "$ac_cv_sys_file_offset_bits" != no
14747         then
14748
14749         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14750         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14751
14752         fi
14753
14754         echo "$as_me:14754: checking whether to use struct dirent64" >&5
14755 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14756 if test "${cf_cv_struct_dirent64+set}" = set; then
14757   echo $ECHO_N "(cached) $ECHO_C" >&6
14758 else
14759
14760                 cat >"conftest.$ac_ext" <<_ACEOF
14761 #line 14761 "configure"
14762 #include "confdefs.h"
14763
14764 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14765 #include <sys/types.h>
14766 #include <dirent.h>
14767
14768 int
14769 main (void)
14770 {
14771
14772                 /* if transitional largefile support is setup, this is true */
14773                 extern struct dirent64 * readdir(DIR *);
14774                 struct dirent64 *x = readdir((DIR *)0);
14775                 struct dirent *y = readdir((DIR *)0);
14776                 int z = x - y;
14777                 (void)z;
14778
14779   ;
14780   return 0;
14781 }
14782 _ACEOF
14783 rm -f "conftest.$ac_objext"
14784 if { (eval echo "$as_me:14784: \"$ac_compile\"") >&5
14785   (eval $ac_compile) 2>&5
14786   ac_status=$?
14787   echo "$as_me:14787: \$? = $ac_status" >&5
14788   (exit "$ac_status"); } &&
14789          { ac_try='test -s "conftest.$ac_objext"'
14790   { (eval echo "$as_me:14790: \"$ac_try\"") >&5
14791   (eval $ac_try) 2>&5
14792   ac_status=$?
14793   echo "$as_me:14793: \$? = $ac_status" >&5
14794   (exit "$ac_status"); }; }; then
14795   cf_cv_struct_dirent64=yes
14796 else
14797   echo "$as_me: failed program was:" >&5
14798 cat "conftest.$ac_ext" >&5
14799 cf_cv_struct_dirent64=no
14800 fi
14801 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14802
14803 fi
14804 echo "$as_me:14804: result: $cf_cv_struct_dirent64" >&5
14805 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14806         test "$cf_cv_struct_dirent64" = yes &&
14807 cat >>confdefs.h <<\EOF
14808 #define HAVE_STRUCT_DIRENT64 1
14809 EOF
14810
14811         fi
14812
14813 ### Enable compiling-in rcs id's
14814 echo "$as_me:14814: checking if RCS identifiers should be compiled-in" >&5
14815 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14816
14817 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14818 if test "${with_rcs_ids+set}" = set; then
14819   withval="$with_rcs_ids"
14820   with_rcs_ids=$withval
14821 else
14822   with_rcs_ids=no
14823 fi;
14824 echo "$as_me:14824: result: $with_rcs_ids" >&5
14825 echo "${ECHO_T}$with_rcs_ids" >&6
14826 test "$with_rcs_ids" = yes &&
14827 cat >>confdefs.h <<\EOF
14828 #define USE_RCS_IDS 1
14829 EOF
14830
14831 ###############################################################################
14832
14833 ### Note that some functions (such as const) are normally disabled anyway.
14834 echo "$as_me:14834: checking if you want to build with function extensions" >&5
14835 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14836
14837 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14838 if test "${enable_ext_funcs+set}" = set; then
14839   enableval="$enable_ext_funcs"
14840   with_ext_funcs=$enableval
14841 else
14842   with_ext_funcs=yes
14843 fi;
14844 echo "$as_me:14844: result: $with_ext_funcs" >&5
14845 echo "${ECHO_T}$with_ext_funcs" >&6
14846 if test "$with_ext_funcs" = yes ; then
14847         NCURSES_EXT_FUNCS=1
14848
14849 cat >>confdefs.h <<\EOF
14850 #define HAVE_USE_DEFAULT_COLORS 1
14851 EOF
14852
14853 cat >>confdefs.h <<\EOF
14854 #define NCURSES_EXT_FUNCS 1
14855 EOF
14856
14857 else
14858         NCURSES_EXT_FUNCS=0
14859 fi
14860
14861 ###   use option --enable-const to turn on use of const beyond that in XSI.
14862 echo "$as_me:14862: checking for extended use of const keyword" >&5
14863 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14864
14865 # Check whether --enable-const or --disable-const was given.
14866 if test "${enable_const+set}" = set; then
14867   enableval="$enable_const"
14868   with_ext_const=$enableval
14869 else
14870   with_ext_const=no
14871 fi;
14872 echo "$as_me:14872: result: $with_ext_const" >&5
14873 echo "${ECHO_T}$with_ext_const" >&6
14874 NCURSES_CONST='/*nothing*/'
14875 if test "$with_ext_const" = yes ; then
14876         NCURSES_CONST=const
14877 fi
14878
14879 ###############################################################################
14880 # These options are relatively safe to experiment with.
14881
14882 echo "$as_me:14882: checking if you want all development code" >&5
14883 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14884
14885 # Check whether --with-develop or --without-develop was given.
14886 if test "${with_develop+set}" = set; then
14887   withval="$with_develop"
14888   with_develop=$withval
14889 else
14890   with_develop=no
14891 fi;
14892 echo "$as_me:14892: result: $with_develop" >&5
14893 echo "${ECHO_T}$with_develop" >&6
14894
14895 ###############################################################################
14896 # These are just experimental, probably should not be in a package:
14897
14898 # This is still experimental (20080329), but should ultimately be moved to
14899 # the script-block --with-normal, etc.
14900
14901 echo "$as_me:14901: checking if you want to link with the pthread library" >&5
14902 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14903
14904 # Check whether --with-pthread or --without-pthread was given.
14905 if test "${with_pthread+set}" = set; then
14906   withval="$with_pthread"
14907   with_pthread=$withval
14908 else
14909   with_pthread=no
14910 fi;
14911 echo "$as_me:14911: result: $with_pthread" >&5
14912 echo "${ECHO_T}$with_pthread" >&6
14913
14914 if test "$with_pthread" != no ; then
14915         echo "$as_me:14915: checking for pthread.h" >&5
14916 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14917 if test "${ac_cv_header_pthread_h+set}" = set; then
14918   echo $ECHO_N "(cached) $ECHO_C" >&6
14919 else
14920   cat >"conftest.$ac_ext" <<_ACEOF
14921 #line 14921 "configure"
14922 #include "confdefs.h"
14923 #include <pthread.h>
14924 _ACEOF
14925 if { (eval echo "$as_me:14925: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14926   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14927   ac_status=$?
14928   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14929   rm -f conftest.er1
14930   cat conftest.err >&5
14931   echo "$as_me:14931: \$? = $ac_status" >&5
14932   (exit "$ac_status"); } >/dev/null; then
14933   if test -s conftest.err; then
14934     ac_cpp_err=$ac_c_preproc_warn_flag
14935   else
14936     ac_cpp_err=
14937   fi
14938 else
14939   ac_cpp_err=yes
14940 fi
14941 if test -z "$ac_cpp_err"; then
14942   ac_cv_header_pthread_h=yes
14943 else
14944   echo "$as_me: failed program was:" >&5
14945   cat "conftest.$ac_ext" >&5
14946   ac_cv_header_pthread_h=no
14947 fi
14948 rm -f conftest.err "conftest.$ac_ext"
14949 fi
14950 echo "$as_me:14950: result: $ac_cv_header_pthread_h" >&5
14951 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14952 if test "$ac_cv_header_pthread_h" = yes; then
14953
14954 cat >>confdefs.h <<\EOF
14955 #define HAVE_PTHREADS_H 1
14956 EOF
14957
14958         for cf_lib_pthread in pthread c_r
14959         do
14960             echo "$as_me:14960: checking if we can link with the $cf_lib_pthread library" >&5
14961 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14962             cf_save_LIBS="$LIBS"
14963
14964 cf_add_libs="$LIBS"
14965 # reverse order
14966 cf_add_0lib=
14967 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14968 # filter duplicates
14969 for cf_add_1lib in $cf_add_0lib; do
14970         for cf_add_2lib in $cf_add_libs; do
14971                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14972                         cf_add_1lib=
14973                         break
14974                 fi
14975         done
14976         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14977 done
14978 LIBS="$cf_add_libs"
14979
14980             cat >"conftest.$ac_ext" <<_ACEOF
14981 #line 14981 "configure"
14982 #include "confdefs.h"
14983
14984 #include <pthread.h>
14985
14986 int
14987 main (void)
14988 {
14989
14990                 int rc = pthread_create(0,0,0,0);
14991                 int r2 = pthread_mutexattr_settype(0, 0);
14992
14993   ;
14994   return 0;
14995 }
14996 _ACEOF
14997 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14998 if { (eval echo "$as_me:14998: \"$ac_link\"") >&5
14999   (eval $ac_link) 2>&5
15000   ac_status=$?
15001   echo "$as_me:15001: \$? = $ac_status" >&5
15002   (exit "$ac_status"); } &&
15003          { ac_try='test -s "conftest$ac_exeext"'
15004   { (eval echo "$as_me:15004: \"$ac_try\"") >&5
15005   (eval $ac_try) 2>&5
15006   ac_status=$?
15007   echo "$as_me:15007: \$? = $ac_status" >&5
15008   (exit "$ac_status"); }; }; then
15009   with_pthread=yes
15010 else
15011   echo "$as_me: failed program was:" >&5
15012 cat "conftest.$ac_ext" >&5
15013 with_pthread=no
15014 fi
15015 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15016             LIBS="$cf_save_LIBS"
15017             echo "$as_me:15017: result: $with_pthread" >&5
15018 echo "${ECHO_T}$with_pthread" >&6
15019             test "$with_pthread" = yes && break
15020         done
15021
15022         if test "$with_pthread" = yes ; then
15023
15024 cf_add_libs="$LIBS"
15025 # reverse order
15026 cf_add_0lib=
15027 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15028 # filter duplicates
15029 for cf_add_1lib in $cf_add_0lib; do
15030         for cf_add_2lib in $cf_add_libs; do
15031                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15032                         cf_add_1lib=
15033                         break
15034                 fi
15035         done
15036         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15037 done
15038 LIBS="$cf_add_libs"
15039
15040 cat >>confdefs.h <<\EOF
15041 #define HAVE_LIBPTHREADS 1
15042 EOF
15043
15044         else
15045             { { echo "$as_me:15045: error: Cannot link with pthread library" >&5
15046 echo "$as_me: error: Cannot link with pthread library" >&2;}
15047    { (exit 1); exit 1; }; }
15048         fi
15049
15050 fi
15051
15052 fi
15053
15054 echo "$as_me:15054: checking if you want to use weak-symbols for pthreads" >&5
15055 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15056
15057 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15058 if test "${enable_weak_symbols+set}" = set; then
15059   enableval="$enable_weak_symbols"
15060   use_weak_symbols=$withval
15061 else
15062   use_weak_symbols=no
15063 fi;
15064 echo "$as_me:15064: result: $use_weak_symbols" >&5
15065 echo "${ECHO_T}$use_weak_symbols" >&6
15066 if test "$use_weak_symbols" = yes ; then
15067
15068 echo "$as_me:15068: checking if $CC supports weak symbols" >&5
15069 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15070 if test "${cf_cv_weak_symbols+set}" = set; then
15071   echo $ECHO_N "(cached) $ECHO_C" >&6
15072 else
15073
15074 cat >"conftest.$ac_ext" <<_ACEOF
15075 #line 15075 "configure"
15076 #include "confdefs.h"
15077
15078 #include <stdio.h>
15079 int
15080 main (void)
15081 {
15082
15083 #if defined(__GNUC__)
15084 #  if defined __USE_ISOC99
15085 #    define _cat_pragma(exp)    _Pragma(#exp)
15086 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15087 #  else
15088 #    define _weak_pragma(exp)
15089 #  endif
15090 #  define _declare(name)        __extension__ extern __typeof__(name) name
15091 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15092 #endif
15093
15094 weak_symbol(fopen);
15095
15096   ;
15097   return 0;
15098 }
15099 _ACEOF
15100 rm -f "conftest.$ac_objext"
15101 if { (eval echo "$as_me:15101: \"$ac_compile\"") >&5
15102   (eval $ac_compile) 2>&5
15103   ac_status=$?
15104   echo "$as_me:15104: \$? = $ac_status" >&5
15105   (exit "$ac_status"); } &&
15106          { ac_try='test -s "conftest.$ac_objext"'
15107   { (eval echo "$as_me:15107: \"$ac_try\"") >&5
15108   (eval $ac_try) 2>&5
15109   ac_status=$?
15110   echo "$as_me:15110: \$? = $ac_status" >&5
15111   (exit "$ac_status"); }; }; then
15112   cf_cv_weak_symbols=yes
15113 else
15114   echo "$as_me: failed program was:" >&5
15115 cat "conftest.$ac_ext" >&5
15116 cf_cv_weak_symbols=no
15117 fi
15118 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15119
15120 fi
15121 echo "$as_me:15121: result: $cf_cv_weak_symbols" >&5
15122 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15123
15124 else
15125         cf_cv_weak_symbols=no
15126 fi
15127
15128 if test $cf_cv_weak_symbols = yes ; then
15129
15130 cat >>confdefs.h <<\EOF
15131 #define USE_WEAK_SYMBOLS 1
15132 EOF
15133
15134 fi
15135
15136 PTHREAD=
15137 if test "$with_pthread" = "yes" ; then
15138
15139 cat >>confdefs.h <<\EOF
15140 #define USE_PTHREADS 1
15141 EOF
15142
15143         enable_reentrant=yes
15144         if test $cf_cv_weak_symbols = yes ; then
15145                 PTHREAD=-lpthread
15146         fi
15147 fi
15148
15149 # OpenSUSE is installing ncurses6, using reentrant option.
15150 echo "$as_me:15150: checking for _nc_TABSIZE" >&5
15151 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15152 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15153   echo $ECHO_N "(cached) $ECHO_C" >&6
15154 else
15155   cat >"conftest.$ac_ext" <<_ACEOF
15156 #line 15156 "configure"
15157 #include "confdefs.h"
15158 #define _nc_TABSIZE autoconf_temporary
15159 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15160 #undef _nc_TABSIZE
15161
15162 #ifdef __cplusplus
15163 extern "C"
15164 #endif
15165
15166 /* We use char because int might match the return type of a gcc2
15167    builtin and then its argument prototype would still apply.  */
15168 char _nc_TABSIZE (void);
15169
15170 int
15171 main (void)
15172 {
15173
15174 /* The GNU C library defines stubs for functions which it implements
15175     to always fail with ENOSYS.  Some functions are actually named
15176     something starting with __ and the normal name is an alias.  */
15177 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15178 #error found stub for _nc_TABSIZE
15179 #endif
15180
15181         return _nc_TABSIZE ();
15182   ;
15183   return 0;
15184 }
15185 _ACEOF
15186 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15187 if { (eval echo "$as_me:15187: \"$ac_link\"") >&5
15188   (eval $ac_link) 2>&5
15189   ac_status=$?
15190   echo "$as_me:15190: \$? = $ac_status" >&5
15191   (exit "$ac_status"); } &&
15192          { ac_try='test -s "conftest$ac_exeext"'
15193   { (eval echo "$as_me:15193: \"$ac_try\"") >&5
15194   (eval $ac_try) 2>&5
15195   ac_status=$?
15196   echo "$as_me:15196: \$? = $ac_status" >&5
15197   (exit "$ac_status"); }; }; then
15198   ac_cv_func__nc_TABSIZE=yes
15199 else
15200   echo "$as_me: failed program was:" >&5
15201 cat "conftest.$ac_ext" >&5
15202 ac_cv_func__nc_TABSIZE=no
15203 fi
15204 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15205 fi
15206 echo "$as_me:15206: result: $ac_cv_func__nc_TABSIZE" >&5
15207 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15208 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15209   assume_reentrant=yes
15210 else
15211   assume_reentrant=no
15212 fi
15213
15214 # Reentrant code has to be opaque; there's little advantage to making ncurses
15215 # opaque outside of that, so there is no --enable-opaque option.  We can use
15216 # this option without --with-pthreads, but this will be always set for
15217 # pthreads.
15218 echo "$as_me:15218: checking if you want experimental reentrant code" >&5
15219 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15220
15221 # Check whether --enable-reentrant or --disable-reentrant was given.
15222 if test "${enable_reentrant+set}" = set; then
15223   enableval="$enable_reentrant"
15224   with_reentrant=$enableval
15225 else
15226   with_reentrant=$assume_reentrant
15227 fi;
15228 echo "$as_me:15228: result: $with_reentrant" >&5
15229 echo "${ECHO_T}$with_reentrant" >&6
15230 if test "$with_reentrant" = yes ; then
15231         cf_cv_enable_reentrant=1
15232         if test $cf_cv_weak_symbols = yes ; then
15233
15234 # remove pthread library from $LIBS
15235 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15236
15237         elif test "$assume_reentrant" = no ; then
15238                 LIB_SUFFIX="t${LIB_SUFFIX}"
15239         fi
15240
15241 cat >>confdefs.h <<\EOF
15242 #define USE_REENTRANT 1
15243 EOF
15244
15245 else
15246         cf_cv_enable_reentrant=0
15247 fi
15248
15249 ### Allow using a different wrap-prefix
15250 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15251         echo "$as_me:15251: checking for prefix used to wrap public variables" >&5
15252 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15253
15254 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15255 if test "${with_wrap_prefix+set}" = set; then
15256   withval="$with_wrap_prefix"
15257   NCURSES_WRAP_PREFIX=$withval
15258 else
15259   NCURSES_WRAP_PREFIX=_nc_
15260 fi;
15261         echo "$as_me:15261: result: $NCURSES_WRAP_PREFIX" >&5
15262 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15263 else
15264         NCURSES_WRAP_PREFIX=_nc_
15265 fi
15266
15267 cat >>confdefs.h <<EOF
15268 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15269 EOF
15270
15271 ###############################################################################
15272
15273 ###     use option --disable-echo to suppress full display compiling commands
15274
15275 echo "$as_me:15275: checking if you want to see long compiling messages" >&5
15276 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15277
15278 # Check whether --enable-echo or --disable-echo was given.
15279 if test "${enable_echo+set}" = set; then
15280   enableval="$enable_echo"
15281   test "$enableval" != no && enableval=yes
15282         if test "$enableval" != "yes" ; then
15283
15284         ECHO_LT='--silent'
15285         ECHO_LD='@echo linking $@;'
15286         RULE_CC='@echo compiling $<'
15287         SHOW_CC='@echo compiling $@'
15288         ECHO_CC='@'
15289
15290         else
15291
15292         ECHO_LT=''
15293         ECHO_LD=''
15294         RULE_CC=''
15295         SHOW_CC=''
15296         ECHO_CC=''
15297
15298         fi
15299 else
15300   enableval=yes
15301
15302         ECHO_LT=''
15303         ECHO_LD=''
15304         RULE_CC=''
15305         SHOW_CC=''
15306         ECHO_CC=''
15307
15308 fi;
15309 echo "$as_me:15309: result: $enableval" >&5
15310 echo "${ECHO_T}$enableval" >&6
15311
15312 echo "$as_me:15312: checking if you want to use C11 _Noreturn feature" >&5
15313 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15314
15315 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15316 if test "${enable_stdnoreturn+set}" = set; then
15317   enableval="$enable_stdnoreturn"
15318   test "$enableval" != yes && enableval=no
15319         if test "$enableval" != "no" ; then
15320     enable_stdnoreturn=yes
15321         else
15322                 enable_stdnoreturn=no
15323         fi
15324 else
15325   enableval=no
15326         enable_stdnoreturn=no
15327
15328 fi;
15329 echo "$as_me:15329: result: $enable_stdnoreturn" >&5
15330 echo "${ECHO_T}$enable_stdnoreturn" >&6
15331
15332 if test $enable_stdnoreturn = yes; then
15333 echo "$as_me:15333: checking for C11 _Noreturn feature" >&5
15334 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15335 if test "${cf_cv_c11_noreturn+set}" = set; then
15336   echo $ECHO_N "(cached) $ECHO_C" >&6
15337 else
15338   cat >"conftest.$ac_ext" <<_ACEOF
15339 #line 15339 "configure"
15340 #include "confdefs.h"
15341
15342 #include <stdio.h>
15343 #include <stdlib.h>
15344 #include <stdnoreturn.h>
15345 static _Noreturn void giveup(void) { exit(0); }
15346
15347 int
15348 main (void)
15349 {
15350 if (feof(stdin)) giveup()
15351   ;
15352   return 0;
15353 }
15354 _ACEOF
15355 rm -f "conftest.$ac_objext"
15356 if { (eval echo "$as_me:15356: \"$ac_compile\"") >&5
15357   (eval $ac_compile) 2>&5
15358   ac_status=$?
15359   echo "$as_me:15359: \$? = $ac_status" >&5
15360   (exit "$ac_status"); } &&
15361          { ac_try='test -s "conftest.$ac_objext"'
15362   { (eval echo "$as_me:15362: \"$ac_try\"") >&5
15363   (eval $ac_try) 2>&5
15364   ac_status=$?
15365   echo "$as_me:15365: \$? = $ac_status" >&5
15366   (exit "$ac_status"); }; }; then
15367   cf_cv_c11_noreturn=yes
15368 else
15369   echo "$as_me: failed program was:" >&5
15370 cat "conftest.$ac_ext" >&5
15371 cf_cv_c11_noreturn=no
15372 fi
15373 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15374
15375 fi
15376 echo "$as_me:15376: result: $cf_cv_c11_noreturn" >&5
15377 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15378 else
15379         cf_cv_c11_noreturn=no,
15380 fi
15381
15382 if test "$cf_cv_c11_noreturn" = yes; then
15383
15384 cat >>confdefs.h <<\EOF
15385 #define HAVE_STDNORETURN_H 1
15386 EOF
15387
15388 cat >>confdefs.h <<EOF
15389 #define STDC_NORETURN _Noreturn
15390 EOF
15391
15392         HAVE_STDNORETURN_H=1
15393 else
15394         HAVE_STDNORETURN_H=0
15395 fi
15396
15397 if test "$GCC" = yes || test "$GXX" = yes
15398 then
15399
15400 if test "$GCC" = yes || test "$GXX" = yes
15401 then
15402         case $CFLAGS in
15403         (*-Werror=*)
15404                 cf_temp_flags=
15405                 for cf_temp_scan in $CFLAGS
15406                 do
15407                         case "x$cf_temp_scan" in
15408                         (x-Werror=format*)
15409
15410         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15411         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15412
15413                                 ;;
15414                         (x-Werror=*)
15415
15416         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15417         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15418
15419                                 ;;
15420                         (*)
15421
15422         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15423         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15424
15425                                 ;;
15426                         esac
15427                 done
15428                 if test "x$CFLAGS" != "x$cf_temp_flags"
15429                 then
15430                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15431
15432 echo "${as_me:-configure}:15432: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15433
15434                         CFLAGS="$cf_temp_flags"
15435                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15436
15437 echo "${as_me:-configure}:15437: testing ... fixed $CFLAGS ..." 1>&5
15438
15439                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15440
15441 echo "${as_me:-configure}:15441: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15442
15443                 fi
15444                 ;;
15445         esac
15446 fi
15447
15448 if test "$GCC" = yes || test "$GXX" = yes
15449 then
15450         case $CPPFLAGS in
15451         (*-Werror=*)
15452                 cf_temp_flags=
15453                 for cf_temp_scan in $CPPFLAGS
15454                 do
15455                         case "x$cf_temp_scan" in
15456                         (x-Werror=format*)
15457
15458         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15459         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15460
15461                                 ;;
15462                         (x-Werror=*)
15463
15464         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15465         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15466
15467                                 ;;
15468                         (*)
15469
15470         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15471         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15472
15473                                 ;;
15474                         esac
15475                 done
15476                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15477                 then
15478                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15479
15480 echo "${as_me:-configure}:15480: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15481
15482                         CPPFLAGS="$cf_temp_flags"
15483                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15484
15485 echo "${as_me:-configure}:15485: testing ... fixed $CPPFLAGS ..." 1>&5
15486
15487                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15488
15489 echo "${as_me:-configure}:15489: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15490
15491                 fi
15492                 ;;
15493         esac
15494 fi
15495
15496 if test "$GCC" = yes || test "$GXX" = yes
15497 then
15498         case $LDFLAGS in
15499         (*-Werror=*)
15500                 cf_temp_flags=
15501                 for cf_temp_scan in $LDFLAGS
15502                 do
15503                         case "x$cf_temp_scan" in
15504                         (x-Werror=format*)
15505
15506         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15507         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15508
15509                                 ;;
15510                         (x-Werror=*)
15511
15512         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15513         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15514
15515                                 ;;
15516                         (*)
15517
15518         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15519         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15520
15521                                 ;;
15522                         esac
15523                 done
15524                 if test "x$LDFLAGS" != "x$cf_temp_flags"
15525                 then
15526                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15527
15528 echo "${as_me:-configure}:15528: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15529
15530                         LDFLAGS="$cf_temp_flags"
15531                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15532
15533 echo "${as_me:-configure}:15533: testing ... fixed $LDFLAGS ..." 1>&5
15534
15535                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15536
15537 echo "${as_me:-configure}:15537: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15538
15539                 fi
15540                 ;;
15541         esac
15542 fi
15543
15544 echo "$as_me:15544: checking if you want to turn on gcc warnings" >&5
15545 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15546
15547 # Check whether --enable-warnings or --disable-warnings was given.
15548 if test "${enable_warnings+set}" = set; then
15549   enableval="$enable_warnings"
15550   test "$enableval" != yes && enableval=no
15551         if test "$enableval" != "no" ; then
15552     enable_warnings=yes
15553         else
15554                 enable_warnings=no
15555         fi
15556 else
15557   enableval=no
15558         enable_warnings=no
15559
15560 fi;
15561 echo "$as_me:15561: result: $enable_warnings" >&5
15562 echo "${ECHO_T}$enable_warnings" >&6
15563 if test "$enable_warnings" = "yes"
15564 then
15565
15566 if test "x$have_x" = xyes; then
15567
15568 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15569 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15570 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15571 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15572 for cf_X_CFLAGS in $X_CFLAGS
15573 do
15574         case "x$cf_X_CFLAGS" in
15575         x-[IUD]*)
15576                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15577                 ;;
15578         *)
15579                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15580                 ;;
15581         esac
15582 done
15583
15584 cat >"conftest.$ac_ext" <<_ACEOF
15585 #line 15585 "configure"
15586 #include "confdefs.h"
15587
15588 #include <stdlib.h>
15589 #include <X11/Intrinsic.h>
15590
15591 int
15592 main (void)
15593 {
15594 String foo = malloc(1); free((void*)foo)
15595   ;
15596   return 0;
15597 }
15598 _ACEOF
15599 rm -f "conftest.$ac_objext"
15600 if { (eval echo "$as_me:15600: \"$ac_compile\"") >&5
15601   (eval $ac_compile) 2>&5
15602   ac_status=$?
15603   echo "$as_me:15603: \$? = $ac_status" >&5
15604   (exit "$ac_status"); } &&
15605          { ac_try='test -s "conftest.$ac_objext"'
15606   { (eval echo "$as_me:15606: \"$ac_try\"") >&5
15607   (eval $ac_try) 2>&5
15608   ac_status=$?
15609   echo "$as_me:15609: \$? = $ac_status" >&5
15610   (exit "$ac_status"); }; }; then
15611
15612 echo "$as_me:15612: checking for X11/Xt const-feature" >&5
15613 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15614 if test "${cf_cv_const_x_string+set}" = set; then
15615   echo $ECHO_N "(cached) $ECHO_C" >&6
15616 else
15617
15618         cat >"conftest.$ac_ext" <<_ACEOF
15619 #line 15619 "configure"
15620 #include "confdefs.h"
15621
15622 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15623 #undef  XTSTRINGDEFINES /* X11R5 and later */
15624 #include <stdlib.h>
15625 #include <X11/Intrinsic.h>
15626
15627 int
15628 main (void)
15629 {
15630 String foo = malloc(1); *foo = 0
15631   ;
15632   return 0;
15633 }
15634 _ACEOF
15635 rm -f "conftest.$ac_objext"
15636 if { (eval echo "$as_me:15636: \"$ac_compile\"") >&5
15637   (eval $ac_compile) 2>&5
15638   ac_status=$?
15639   echo "$as_me:15639: \$? = $ac_status" >&5
15640   (exit "$ac_status"); } &&
15641          { ac_try='test -s "conftest.$ac_objext"'
15642   { (eval echo "$as_me:15642: \"$ac_try\"") >&5
15643   (eval $ac_try) 2>&5
15644   ac_status=$?
15645   echo "$as_me:15645: \$? = $ac_status" >&5
15646   (exit "$ac_status"); }; }; then
15647
15648                         cf_cv_const_x_string=no
15649
15650 else
15651   echo "$as_me: failed program was:" >&5
15652 cat "conftest.$ac_ext" >&5
15653
15654                         cf_cv_const_x_string=yes
15655
15656 fi
15657 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15658
15659 fi
15660 echo "$as_me:15660: result: $cf_cv_const_x_string" >&5
15661 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15662
15663 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15664 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15665 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15666
15667 case "$cf_cv_const_x_string" in
15668 (no)
15669
15670         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15671         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15672
15673         ;;
15674 (*)
15675
15676         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15677         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15678
15679         ;;
15680 esac
15681
15682 else
15683   echo "$as_me: failed program was:" >&5
15684 cat "conftest.$ac_ext" >&5
15685 fi
15686 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15687  fi
15688 cat > "conftest.$ac_ext" <<EOF
15689 #line 15689 "${as_me:-configure}"
15690 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15691 EOF
15692 if test "$INTEL_COMPILER" = yes
15693 then
15694 # The "-wdXXX" options suppress warnings:
15695 # remark #1419: external declaration in primary source file
15696 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15697 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15698 # remark #193: zero used for undefined preprocessing identifier
15699 # remark #593: variable "curs_sb_left_arrow" was set but never used
15700 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15701 # remark #869: parameter "tw" was never referenced
15702 # remark #981: operands are evaluated in unspecified order
15703 # warning #279: controlling expression is constant
15704
15705         { echo "$as_me:15705: checking for $CC warning options..." >&5
15706 echo "$as_me: checking for $CC warning options..." >&6;}
15707         cf_save_CFLAGS="$CFLAGS"
15708         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15709         for cf_opt in \
15710                 wd1419 \
15711                 wd1683 \
15712                 wd1684 \
15713                 wd193 \
15714                 wd593 \
15715                 wd279 \
15716                 wd810 \
15717                 wd869 \
15718                 wd981
15719         do
15720                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15721                 if { (eval echo "$as_me:15721: \"$ac_compile\"") >&5
15722   (eval $ac_compile) 2>&5
15723   ac_status=$?
15724   echo "$as_me:15724: \$? = $ac_status" >&5
15725   (exit "$ac_status"); }; then
15726                         test -n "$verbose" && echo "$as_me:15726: result: ... -$cf_opt" >&5
15727 echo "${ECHO_T}... -$cf_opt" >&6
15728                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15729                 fi
15730         done
15731         CFLAGS="$cf_save_CFLAGS"
15732 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15733 then
15734         { echo "$as_me:15734: checking for $CC warning options..." >&5
15735 echo "$as_me: checking for $CC warning options..." >&6;}
15736         cf_save_CFLAGS="$CFLAGS"
15737         cf_warn_CONST=""
15738         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15739         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15740         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15741         for cf_opt in W Wall \
15742                 Wbad-function-cast \
15743                 Wcast-align \
15744                 Wcast-qual \
15745                 Wdeclaration-after-statement \
15746                 Wextra \
15747                 Winline \
15748                 Wmissing-declarations \
15749                 Wmissing-prototypes \
15750                 Wnested-externs \
15751                 Wpointer-arith \
15752                 Wshadow \
15753                 Wstrict-prototypes \
15754                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15755         do
15756                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15757                 if { (eval echo "$as_me:15757: \"$ac_compile\"") >&5
15758   (eval $ac_compile) 2>&5
15759   ac_status=$?
15760   echo "$as_me:15760: \$? = $ac_status" >&5
15761   (exit "$ac_status"); }; then
15762                         test -n "$verbose" && echo "$as_me:15762: result: ... -$cf_opt" >&5
15763 echo "${ECHO_T}... -$cf_opt" >&6
15764                         case "$cf_opt" in
15765                         (Winline)
15766                                 case "$GCC_VERSION" in
15767                                 ([34].*)
15768                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15769
15770 echo "${as_me:-configure}:15770: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15771
15772                                         continue;;
15773                                 esac
15774                                 ;;
15775                         (Wpointer-arith)
15776                                 case "$GCC_VERSION" in
15777                                 ([12].*)
15778                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15779
15780 echo "${as_me:-configure}:15780: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15781
15782                                         continue;;
15783                                 esac
15784                                 ;;
15785                         esac
15786                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15787                 fi
15788         done
15789         CFLAGS="$cf_save_CFLAGS"
15790 fi
15791 rm -rf ./conftest*
15792
15793 fi
15794
15795 if test "$GCC" = yes || test "$GXX" = yes
15796 then
15797 cat > conftest.i <<EOF
15798 #ifndef GCC_PRINTF
15799 #define GCC_PRINTF 0
15800 #endif
15801 #ifndef GCC_SCANF
15802 #define GCC_SCANF 0
15803 #endif
15804 #ifndef GCC_NORETURN
15805 #define GCC_NORETURN /* nothing */
15806 #endif
15807 #ifndef GCC_UNUSED
15808 #define GCC_UNUSED /* nothing */
15809 #endif
15810 EOF
15811 if test "$GCC" = yes
15812 then
15813         { echo "$as_me:15813: checking for $CC __attribute__ directives..." >&5
15814 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15815 cat > "conftest.$ac_ext" <<EOF
15816 #line 15816 "${as_me:-configure}"
15817 #include "confdefs.h"
15818 #include "conftest.h"
15819 #include "conftest.i"
15820 #if     GCC_PRINTF
15821 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15822 #else
15823 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15824 #endif
15825 #if     GCC_SCANF
15826 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15827 #else
15828 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15829 #endif
15830 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15831 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15832 extern GCC_NORETURN void foo(void);
15833 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15834 EOF
15835         cf_printf_attribute=no
15836         cf_scanf_attribute=no
15837         for cf_attribute in scanf printf unused noreturn
15838         do
15839
15840 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15841
15842                 cf_directive="__attribute__(($cf_attribute))"
15843                 echo "checking for $CC $cf_directive" 1>&5
15844
15845                 case "$cf_attribute" in
15846                 (printf)
15847                         cf_printf_attribute=yes
15848                         cat >conftest.h <<EOF
15849 #define GCC_$cf_ATTRIBUTE 1
15850 EOF
15851                         ;;
15852                 (scanf)
15853                         cf_scanf_attribute=yes
15854                         cat >conftest.h <<EOF
15855 #define GCC_$cf_ATTRIBUTE 1
15856 EOF
15857                         ;;
15858                 (*)
15859                         cat >conftest.h <<EOF
15860 #define GCC_$cf_ATTRIBUTE $cf_directive
15861 EOF
15862                         ;;
15863                 esac
15864
15865                 if { (eval echo "$as_me:15865: \"$ac_compile\"") >&5
15866   (eval $ac_compile) 2>&5
15867   ac_status=$?
15868   echo "$as_me:15868: \$? = $ac_status" >&5
15869   (exit "$ac_status"); }; then
15870                         test -n "$verbose" && echo "$as_me:15870: result: ... $cf_attribute" >&5
15871 echo "${ECHO_T}... $cf_attribute" >&6
15872                         cat conftest.h >>confdefs.h
15873                         case "$cf_attribute" in
15874                         (noreturn)
15875
15876 cat >>confdefs.h <<EOF
15877 #define GCC_NORETURN $cf_directive
15878 EOF
15879
15880                                 ;;
15881                         (printf)
15882                                 cf_value='/* nothing */'
15883                                 if test "$cf_printf_attribute" != no ; then
15884                                         cf_value='__attribute__((format(printf,fmt,var)))'
15885
15886 cat >>confdefs.h <<\EOF
15887 #define GCC_PRINTF 1
15888 EOF
15889
15890                                 fi
15891
15892 cat >>confdefs.h <<EOF
15893 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15894 EOF
15895
15896                                 ;;
15897                         (scanf)
15898                                 cf_value='/* nothing */'
15899                                 if test "$cf_scanf_attribute" != no ; then
15900                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15901
15902 cat >>confdefs.h <<\EOF
15903 #define GCC_SCANF 1
15904 EOF
15905
15906                                 fi
15907
15908 cat >>confdefs.h <<EOF
15909 #define GCC_SCANFLIKE(fmt,var) $cf_value
15910 EOF
15911
15912                                 ;;
15913                         (unused)
15914
15915 cat >>confdefs.h <<EOF
15916 #define GCC_UNUSED $cf_directive
15917 EOF
15918
15919                                 ;;
15920                         esac
15921                 fi
15922         done
15923 else
15924         ${FGREP-fgrep} define conftest.i >>confdefs.h
15925 fi
15926 rm -rf ./conftest*
15927 fi
15928
15929 fi
15930
15931 if test "x$enable_warnings" = "xyes"; then
15932
15933         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
15934
15935 fi
15936
15937 ###     use option --enable-assertions to turn on generation of assertion code
15938 echo "$as_me:15938: checking if you want to enable runtime assertions" >&5
15939 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15940
15941 # Check whether --enable-assertions or --disable-assertions was given.
15942 if test "${enable_assertions+set}" = set; then
15943   enableval="$enable_assertions"
15944   with_assertions=$enableval
15945 else
15946   with_assertions=no
15947 fi;
15948 echo "$as_me:15948: result: $with_assertions" >&5
15949 echo "${ECHO_T}$with_assertions" >&6
15950 if test -n "$GCC"
15951 then
15952         if test "$with_assertions" = no
15953         then
15954                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15955         else
15956
15957         ADAFLAGS="$ADAFLAGS -gnata"
15958
15959         fi
15960 fi
15961
15962 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15963
15964 cat >>confdefs.h <<\EOF
15965 #define HAVE_NC_ALLOC_H 1
15966 EOF
15967
15968 ###     use option --enable-expanded to generate certain macros as functions
15969
15970 # Check whether --enable-expanded or --disable-expanded was given.
15971 if test "${enable_expanded+set}" = set; then
15972   enableval="$enable_expanded"
15973   test "$enableval" = yes &&
15974 cat >>confdefs.h <<\EOF
15975 #define NCURSES_EXPANDED 1
15976 EOF
15977
15978 fi;
15979
15980 ###     use option --disable-macros to suppress macros in favor of functions
15981
15982 # Check whether --enable-macros or --disable-macros was given.
15983 if test "${enable_macros+set}" = set; then
15984   enableval="$enable_macros"
15985   test "$enableval" = no &&
15986 cat >>confdefs.h <<\EOF
15987 #define NCURSES_NOMACROS 1
15988 EOF
15989
15990 fi;
15991
15992 # Normally we only add trace() to the debug-library.  Allow this to be
15993 # extended to all models of the ncurses library:
15994 cf_all_traces=no
15995 case "$CFLAGS $CPPFLAGS" in
15996 (*-DTRACE*)
15997         cf_all_traces=yes
15998         ;;
15999 esac
16000
16001 echo "$as_me:16001: checking whether to add trace feature to all models" >&5
16002 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16003
16004 # Check whether --with-trace or --without-trace was given.
16005 if test "${with_trace+set}" = set; then
16006   withval="$with_trace"
16007   cf_with_trace=$withval
16008 else
16009   cf_with_trace=$cf_all_traces
16010 fi;
16011 echo "$as_me:16011: result: $cf_with_trace" >&5
16012 echo "${ECHO_T}$cf_with_trace" >&6
16013
16014 if test "$cf_with_trace" = yes ; then
16015         ADA_TRACE=TRUE
16016
16017 cf_fix_cppflags=no
16018 cf_new_cflags=
16019 cf_new_cppflags=
16020 cf_new_extra_cppflags=
16021
16022 for cf_add_cflags in -DTRACE
16023 do
16024 case "$cf_fix_cppflags" in
16025 (no)
16026         case "$cf_add_cflags" in
16027         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16028                 case "$cf_add_cflags" in
16029                 (-D*)
16030                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16031
16032                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16033                                 && test -z "${cf_tst_cflags}" \
16034                                 && cf_fix_cppflags=yes
16035
16036                         if test "$cf_fix_cppflags" = yes ; then
16037
16038         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16039         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16040
16041                                 continue
16042                         elif test "${cf_tst_cflags}" = "\"'" ; then
16043
16044         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16045         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16046
16047                                 continue
16048                         fi
16049                         ;;
16050                 esac
16051                 case "$CPPFLAGS" in
16052                 (*$cf_add_cflags)
16053                         ;;
16054                 (*)
16055                         case "$cf_add_cflags" in
16056                         (-D*)
16057                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16058
16059 CPPFLAGS=`echo "$CPPFLAGS" | \
16060         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16061                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16062
16063                                 ;;
16064                         esac
16065
16066         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16067         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16068
16069                         ;;
16070                 esac
16071                 ;;
16072         (*)
16073
16074         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16075         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16076
16077                 ;;
16078         esac
16079         ;;
16080 (yes)
16081
16082         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16083         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16084
16085         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16086
16087         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16088                 && test -z "${cf_tst_cflags}" \
16089                 && cf_fix_cppflags=no
16090         ;;
16091 esac
16092 done
16093
16094 if test -n "$cf_new_cflags" ; then
16095
16096         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16097         CFLAGS="${CFLAGS}$cf_new_cflags"
16098
16099 fi
16100
16101 if test -n "$cf_new_cppflags" ; then
16102
16103         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16104         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16105
16106 fi
16107
16108 if test -n "$cf_new_extra_cppflags" ; then
16109
16110         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16111         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16112
16113 fi
16114
16115 else
16116         ADA_TRACE=FALSE
16117 fi
16118
16119 echo "$as_me:16119: checking if we want to use GNAT projects" >&5
16120 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16121
16122 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16123 if test "${enable_gnat_projects+set}" = set; then
16124   enableval="$enable_gnat_projects"
16125   test "$enableval" != no && enableval=yes
16126         if test "$enableval" != "yes" ; then
16127     enable_gnat_projects=no
16128         else
16129                 enable_gnat_projects=yes
16130         fi
16131 else
16132   enableval=yes
16133         enable_gnat_projects=yes
16134
16135 fi;
16136 echo "$as_me:16136: result: $enable_gnat_projects" >&5
16137 echo "${ECHO_T}$enable_gnat_projects" >&6
16138
16139 ###     Checks for libraries.
16140 case $cf_cv_system_name in
16141 (*mingw32*)
16142
16143 echo "$as_me:16143: checking if ssp library is needed" >&5
16144 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16145 if test "${cf_cv_need_libssp+set}" = set; then
16146   echo $ECHO_N "(cached) $ECHO_C" >&6
16147 else
16148
16149 cat >"conftest.$ac_ext" <<_ACEOF
16150 #line 16150 "configure"
16151 #include "confdefs.h"
16152
16153 #include <sys/types.h>
16154 #include <dirent.h>
16155
16156 int
16157 main (void)
16158 {
16159
16160        DIR *dp = opendir(".");
16161
16162   ;
16163   return 0;
16164 }
16165 _ACEOF
16166 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16167 if { (eval echo "$as_me:16167: \"$ac_link\"") >&5
16168   (eval $ac_link) 2>&5
16169   ac_status=$?
16170   echo "$as_me:16170: \$? = $ac_status" >&5
16171   (exit "$ac_status"); } &&
16172          { ac_try='test -s "conftest$ac_exeext"'
16173   { (eval echo "$as_me:16173: \"$ac_try\"") >&5
16174   (eval $ac_try) 2>&5
16175   ac_status=$?
16176   echo "$as_me:16176: \$? = $ac_status" >&5
16177   (exit "$ac_status"); }; }; then
16178   cf_cv_need_libssp=no
16179 else
16180   echo "$as_me: failed program was:" >&5
16181 cat "conftest.$ac_ext" >&5
16182
16183         cf_save_LIBS="$LIBS"
16184         LIBS="$LIBS -lssp"
16185         cat >"conftest.$ac_ext" <<_ACEOF
16186 #line 16186 "configure"
16187 #include "confdefs.h"
16188
16189 #include <sys/types.h>
16190 #include <dirent.h>
16191
16192 int
16193 main (void)
16194 {
16195
16196                    DIR *dp = opendir(".");
16197
16198   ;
16199   return 0;
16200 }
16201 _ACEOF
16202 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16203 if { (eval echo "$as_me:16203: \"$ac_link\"") >&5
16204   (eval $ac_link) 2>&5
16205   ac_status=$?
16206   echo "$as_me:16206: \$? = $ac_status" >&5
16207   (exit "$ac_status"); } &&
16208          { ac_try='test -s "conftest$ac_exeext"'
16209   { (eval echo "$as_me:16209: \"$ac_try\"") >&5
16210   (eval $ac_try) 2>&5
16211   ac_status=$?
16212   echo "$as_me:16212: \$? = $ac_status" >&5
16213   (exit "$ac_status"); }; }; then
16214   cf_cv_need_libssp=yes
16215 else
16216   echo "$as_me: failed program was:" >&5
16217 cat "conftest.$ac_ext" >&5
16218 cf_cv_need_libssp=maybe
16219 fi
16220 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16221         LIBS="$cf_save_LIBS"
16222
16223 fi
16224 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16225 fi
16226 echo "$as_me:16226: result: $cf_cv_need_libssp" >&5
16227 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16228
16229 if test "x$cf_cv_need_libssp" = xyes
16230 then
16231
16232 cf_add_libs="$LIBS"
16233 # reverse order
16234 cf_add_0lib=
16235 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16236 # filter duplicates
16237 for cf_add_1lib in $cf_add_0lib; do
16238         for cf_add_2lib in $cf_add_libs; do
16239                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16240                         cf_add_1lib=
16241                         break
16242                 fi
16243         done
16244         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16245 done
16246 LIBS="$cf_add_libs"
16247
16248 fi
16249
16250         ;;
16251 (*)
16252 echo "$as_me:16252: checking for gettimeofday" >&5
16253 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16254 if test "${ac_cv_func_gettimeofday+set}" = set; then
16255   echo $ECHO_N "(cached) $ECHO_C" >&6
16256 else
16257   cat >"conftest.$ac_ext" <<_ACEOF
16258 #line 16258 "configure"
16259 #include "confdefs.h"
16260 #define gettimeofday autoconf_temporary
16261 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16262 #undef gettimeofday
16263
16264 #ifdef __cplusplus
16265 extern "C"
16266 #endif
16267
16268 /* We use char because int might match the return type of a gcc2
16269    builtin and then its argument prototype would still apply.  */
16270 char gettimeofday (void);
16271
16272 int
16273 main (void)
16274 {
16275
16276 /* The GNU C library defines stubs for functions which it implements
16277     to always fail with ENOSYS.  Some functions are actually named
16278     something starting with __ and the normal name is an alias.  */
16279 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16280 #error found stub for gettimeofday
16281 #endif
16282
16283         return gettimeofday ();
16284   ;
16285   return 0;
16286 }
16287 _ACEOF
16288 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16289 if { (eval echo "$as_me:16289: \"$ac_link\"") >&5
16290   (eval $ac_link) 2>&5
16291   ac_status=$?
16292   echo "$as_me:16292: \$? = $ac_status" >&5
16293   (exit "$ac_status"); } &&
16294          { ac_try='test -s "conftest$ac_exeext"'
16295   { (eval echo "$as_me:16295: \"$ac_try\"") >&5
16296   (eval $ac_try) 2>&5
16297   ac_status=$?
16298   echo "$as_me:16298: \$? = $ac_status" >&5
16299   (exit "$ac_status"); }; }; then
16300   ac_cv_func_gettimeofday=yes
16301 else
16302   echo "$as_me: failed program was:" >&5
16303 cat "conftest.$ac_ext" >&5
16304 ac_cv_func_gettimeofday=no
16305 fi
16306 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16307 fi
16308 echo "$as_me:16308: result: $ac_cv_func_gettimeofday" >&5
16309 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16310 if test "$ac_cv_func_gettimeofday" = yes; then
16311   cat >>confdefs.h <<\EOF
16312 #define HAVE_GETTIMEOFDAY 1
16313 EOF
16314
16315 else
16316
16317 echo "$as_me:16317: checking for gettimeofday in -lbsd" >&5
16318 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16319 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16320   echo $ECHO_N "(cached) $ECHO_C" >&6
16321 else
16322   ac_check_lib_save_LIBS=$LIBS
16323 LIBS="-lbsd  $LIBS"
16324 cat >"conftest.$ac_ext" <<_ACEOF
16325 #line 16325 "configure"
16326 #include "confdefs.h"
16327
16328 /* Override any gcc2 internal prototype to avoid an error.  */
16329 #ifdef __cplusplus
16330 extern "C"
16331 #endif
16332 /* We use char because int might match the return type of a gcc2
16333    builtin and then its argument prototype would still apply.  */
16334 char gettimeofday ();
16335 int
16336 main (void)
16337 {
16338 gettimeofday ();
16339   ;
16340   return 0;
16341 }
16342 _ACEOF
16343 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16344 if { (eval echo "$as_me:16344: \"$ac_link\"") >&5
16345   (eval $ac_link) 2>&5
16346   ac_status=$?
16347   echo "$as_me:16347: \$? = $ac_status" >&5
16348   (exit "$ac_status"); } &&
16349          { ac_try='test -s "conftest$ac_exeext"'
16350   { (eval echo "$as_me:16350: \"$ac_try\"") >&5
16351   (eval $ac_try) 2>&5
16352   ac_status=$?
16353   echo "$as_me:16353: \$? = $ac_status" >&5
16354   (exit "$ac_status"); }; }; then
16355   ac_cv_lib_bsd_gettimeofday=yes
16356 else
16357   echo "$as_me: failed program was:" >&5
16358 cat "conftest.$ac_ext" >&5
16359 ac_cv_lib_bsd_gettimeofday=no
16360 fi
16361 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16362 LIBS=$ac_check_lib_save_LIBS
16363 fi
16364 echo "$as_me:16364: result: $ac_cv_lib_bsd_gettimeofday" >&5
16365 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16366 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16367
16368 cat >>confdefs.h <<\EOF
16369 #define HAVE_GETTIMEOFDAY 1
16370 EOF
16371
16372         LIBS="$LIBS -lbsd"
16373 fi
16374
16375 fi
16376         ;;
16377 esac
16378
16379 ###     Checks for header files.
16380 echo "$as_me:16380: checking for ANSI C header files" >&5
16381 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16382 if test "${ac_cv_header_stdc+set}" = set; then
16383   echo $ECHO_N "(cached) $ECHO_C" >&6
16384 else
16385   cat >"conftest.$ac_ext" <<_ACEOF
16386 #line 16386 "configure"
16387 #include "confdefs.h"
16388 #include <stdlib.h>
16389 #include <stdarg.h>
16390 #include <string.h>
16391 #include <float.h>
16392
16393 _ACEOF
16394 if { (eval echo "$as_me:16394: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16395   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16396   ac_status=$?
16397   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16398   rm -f conftest.er1
16399   cat conftest.err >&5
16400   echo "$as_me:16400: \$? = $ac_status" >&5
16401   (exit "$ac_status"); } >/dev/null; then
16402   if test -s conftest.err; then
16403     ac_cpp_err=$ac_c_preproc_warn_flag
16404   else
16405     ac_cpp_err=
16406   fi
16407 else
16408   ac_cpp_err=yes
16409 fi
16410 if test -z "$ac_cpp_err"; then
16411   ac_cv_header_stdc=yes
16412 else
16413   echo "$as_me: failed program was:" >&5
16414   cat "conftest.$ac_ext" >&5
16415   ac_cv_header_stdc=no
16416 fi
16417 rm -f conftest.err "conftest.$ac_ext"
16418
16419 if test $ac_cv_header_stdc = yes; then
16420   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16421   cat >"conftest.$ac_ext" <<_ACEOF
16422 #line 16422 "configure"
16423 #include "confdefs.h"
16424 #include <string.h>
16425
16426 _ACEOF
16427 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16428   $EGREP "memchr" >/dev/null 2>&1; then
16429   :
16430 else
16431   ac_cv_header_stdc=no
16432 fi
16433 rm -rf conftest*
16434
16435 fi
16436
16437 if test $ac_cv_header_stdc = yes; then
16438   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16439   cat >"conftest.$ac_ext" <<_ACEOF
16440 #line 16440 "configure"
16441 #include "confdefs.h"
16442 #include <stdlib.h>
16443
16444 _ACEOF
16445 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16446   $EGREP "free" >/dev/null 2>&1; then
16447   :
16448 else
16449   ac_cv_header_stdc=no
16450 fi
16451 rm -rf conftest*
16452
16453 fi
16454
16455 if test $ac_cv_header_stdc = yes; then
16456   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16457   if test "$cross_compiling" = yes; then
16458   :
16459 else
16460   cat >"conftest.$ac_ext" <<_ACEOF
16461 #line 16461 "configure"
16462 #include "confdefs.h"
16463 #include <ctype.h>
16464 #if ((' ' & 0x0FF) == 0x020)
16465 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16466 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16467 #else
16468 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16469                      || ('j' <= (c) && (c) <= 'r') \
16470                      || ('s' <= (c) && (c) <= 'z'))
16471 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16472 #endif
16473
16474 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16475 int
16476 main (void)
16477 {
16478   int i;
16479   for (i = 0; i < 256; i++)
16480     if (XOR (islower (i), ISLOWER (i))
16481         || toupper (i) != TOUPPER (i))
16482       $ac_main_return(2);
16483   $ac_main_return (0);
16484 }
16485 _ACEOF
16486 rm -f "conftest$ac_exeext"
16487 if { (eval echo "$as_me:16487: \"$ac_link\"") >&5
16488   (eval $ac_link) 2>&5
16489   ac_status=$?
16490   echo "$as_me:16490: \$? = $ac_status" >&5
16491   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16492   { (eval echo "$as_me:16492: \"$ac_try\"") >&5
16493   (eval $ac_try) 2>&5
16494   ac_status=$?
16495   echo "$as_me:16495: \$? = $ac_status" >&5
16496   (exit "$ac_status"); }; }; then
16497   :
16498 else
16499   echo "$as_me: program exited with status $ac_status" >&5
16500 echo "$as_me: failed program was:" >&5
16501 cat "conftest.$ac_ext" >&5
16502 ac_cv_header_stdc=no
16503 fi
16504 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16505 fi
16506 fi
16507 fi
16508 echo "$as_me:16508: result: $ac_cv_header_stdc" >&5
16509 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16510 if test $ac_cv_header_stdc = yes; then
16511
16512 cat >>confdefs.h <<\EOF
16513 #define STDC_HEADERS 1
16514 EOF
16515
16516 fi
16517
16518 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16519
16520 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16521                   inttypes.h stdint.h unistd.h
16522 do
16523 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16524 echo "$as_me:16524: checking for $ac_header" >&5
16525 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16526 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16527   echo $ECHO_N "(cached) $ECHO_C" >&6
16528 else
16529   cat >"conftest.$ac_ext" <<_ACEOF
16530 #line 16530 "configure"
16531 #include "confdefs.h"
16532 $ac_includes_default
16533 #include <$ac_header>
16534 _ACEOF
16535 rm -f "conftest.$ac_objext"
16536 if { (eval echo "$as_me:16536: \"$ac_compile\"") >&5
16537   (eval $ac_compile) 2>&5
16538   ac_status=$?
16539   echo "$as_me:16539: \$? = $ac_status" >&5
16540   (exit "$ac_status"); } &&
16541          { ac_try='test -s "conftest.$ac_objext"'
16542   { (eval echo "$as_me:16542: \"$ac_try\"") >&5
16543   (eval $ac_try) 2>&5
16544   ac_status=$?
16545   echo "$as_me:16545: \$? = $ac_status" >&5
16546   (exit "$ac_status"); }; }; then
16547   eval "$as_ac_Header=yes"
16548 else
16549   echo "$as_me: failed program was:" >&5
16550 cat "conftest.$ac_ext" >&5
16551 eval "$as_ac_Header=no"
16552 fi
16553 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16554 fi
16555 echo "$as_me:16555: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16556 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16557 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16558   cat >>confdefs.h <<EOF
16559 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16560 EOF
16561
16562 fi
16563 done
16564
16565 echo "$as_me:16565: checking for signed char" >&5
16566 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16567 if test "${ac_cv_type_signed_char+set}" = set; then
16568   echo $ECHO_N "(cached) $ECHO_C" >&6
16569 else
16570   cat >"conftest.$ac_ext" <<_ACEOF
16571 #line 16571 "configure"
16572 #include "confdefs.h"
16573 $ac_includes_default
16574 int
16575 main (void)
16576 {
16577 if ((signed char *) 0)
16578   return 0;
16579 if (sizeof (signed char))
16580   return 0;
16581   ;
16582   return 0;
16583 }
16584 _ACEOF
16585 rm -f "conftest.$ac_objext"
16586 if { (eval echo "$as_me:16586: \"$ac_compile\"") >&5
16587   (eval $ac_compile) 2>&5
16588   ac_status=$?
16589   echo "$as_me:16589: \$? = $ac_status" >&5
16590   (exit "$ac_status"); } &&
16591          { ac_try='test -s "conftest.$ac_objext"'
16592   { (eval echo "$as_me:16592: \"$ac_try\"") >&5
16593   (eval $ac_try) 2>&5
16594   ac_status=$?
16595   echo "$as_me:16595: \$? = $ac_status" >&5
16596   (exit "$ac_status"); }; }; then
16597   ac_cv_type_signed_char=yes
16598 else
16599   echo "$as_me: failed program was:" >&5
16600 cat "conftest.$ac_ext" >&5
16601 ac_cv_type_signed_char=no
16602 fi
16603 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16604 fi
16605 echo "$as_me:16605: result: $ac_cv_type_signed_char" >&5
16606 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16607
16608 echo "$as_me:16608: checking size of signed char" >&5
16609 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16610 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16611   echo $ECHO_N "(cached) $ECHO_C" >&6
16612 else
16613   if test "$ac_cv_type_signed_char" = yes; then
16614   if test "$cross_compiling" = yes; then
16615   # Depending upon the size, compute the lo and hi bounds.
16616 cat >"conftest.$ac_ext" <<_ACEOF
16617 #line 16617 "configure"
16618 #include "confdefs.h"
16619 $ac_includes_default
16620 int
16621 main (void)
16622 {
16623 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16624   ;
16625   return 0;
16626 }
16627 _ACEOF
16628 rm -f "conftest.$ac_objext"
16629 if { (eval echo "$as_me:16629: \"$ac_compile\"") >&5
16630   (eval $ac_compile) 2>&5
16631   ac_status=$?
16632   echo "$as_me:16632: \$? = $ac_status" >&5
16633   (exit "$ac_status"); } &&
16634          { ac_try='test -s "conftest.$ac_objext"'
16635   { (eval echo "$as_me:16635: \"$ac_try\"") >&5
16636   (eval $ac_try) 2>&5
16637   ac_status=$?
16638   echo "$as_me:16638: \$? = $ac_status" >&5
16639   (exit "$ac_status"); }; }; then
16640   ac_lo=0 ac_mid=0
16641   while :; do
16642     cat >"conftest.$ac_ext" <<_ACEOF
16643 #line 16643 "configure"
16644 #include "confdefs.h"
16645 $ac_includes_default
16646 int
16647 main (void)
16648 {
16649 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16650   ;
16651   return 0;
16652 }
16653 _ACEOF
16654 rm -f "conftest.$ac_objext"
16655 if { (eval echo "$as_me:16655: \"$ac_compile\"") >&5
16656   (eval $ac_compile) 2>&5
16657   ac_status=$?
16658   echo "$as_me:16658: \$? = $ac_status" >&5
16659   (exit "$ac_status"); } &&
16660          { ac_try='test -s "conftest.$ac_objext"'
16661   { (eval echo "$as_me:16661: \"$ac_try\"") >&5
16662   (eval $ac_try) 2>&5
16663   ac_status=$?
16664   echo "$as_me:16664: \$? = $ac_status" >&5
16665   (exit "$ac_status"); }; }; then
16666   ac_hi=$ac_mid; break
16667 else
16668   echo "$as_me: failed program was:" >&5
16669 cat "conftest.$ac_ext" >&5
16670 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16671 fi
16672 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16673   done
16674 else
16675   echo "$as_me: failed program was:" >&5
16676 cat "conftest.$ac_ext" >&5
16677 ac_hi=-1 ac_mid=-1
16678   while :; do
16679     cat >"conftest.$ac_ext" <<_ACEOF
16680 #line 16680 "configure"
16681 #include "confdefs.h"
16682 $ac_includes_default
16683 int
16684 main (void)
16685 {
16686 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16687   ;
16688   return 0;
16689 }
16690 _ACEOF
16691 rm -f "conftest.$ac_objext"
16692 if { (eval echo "$as_me:16692: \"$ac_compile\"") >&5
16693   (eval $ac_compile) 2>&5
16694   ac_status=$?
16695   echo "$as_me:16695: \$? = $ac_status" >&5
16696   (exit "$ac_status"); } &&
16697          { ac_try='test -s "conftest.$ac_objext"'
16698   { (eval echo "$as_me:16698: \"$ac_try\"") >&5
16699   (eval $ac_try) 2>&5
16700   ac_status=$?
16701   echo "$as_me:16701: \$? = $ac_status" >&5
16702   (exit "$ac_status"); }; }; then
16703   ac_lo=$ac_mid; break
16704 else
16705   echo "$as_me: failed program was:" >&5
16706 cat "conftest.$ac_ext" >&5
16707 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16708 fi
16709 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16710   done
16711 fi
16712 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16713 # Binary search between lo and hi bounds.
16714 while test "x$ac_lo" != "x$ac_hi"; do
16715   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16716   cat >"conftest.$ac_ext" <<_ACEOF
16717 #line 16717 "configure"
16718 #include "confdefs.h"
16719 $ac_includes_default
16720 int
16721 main (void)
16722 {
16723 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16724   ;
16725   return 0;
16726 }
16727 _ACEOF
16728 rm -f "conftest.$ac_objext"
16729 if { (eval echo "$as_me:16729: \"$ac_compile\"") >&5
16730   (eval $ac_compile) 2>&5
16731   ac_status=$?
16732   echo "$as_me:16732: \$? = $ac_status" >&5
16733   (exit "$ac_status"); } &&
16734          { ac_try='test -s "conftest.$ac_objext"'
16735   { (eval echo "$as_me:16735: \"$ac_try\"") >&5
16736   (eval $ac_try) 2>&5
16737   ac_status=$?
16738   echo "$as_me:16738: \$? = $ac_status" >&5
16739   (exit "$ac_status"); }; }; then
16740   ac_hi=$ac_mid
16741 else
16742   echo "$as_me: failed program was:" >&5
16743 cat "conftest.$ac_ext" >&5
16744 ac_lo=`expr "$ac_mid" + 1`
16745 fi
16746 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16747 done
16748 ac_cv_sizeof_signed_char=$ac_lo
16749 else
16750   if test "$cross_compiling" = yes; then
16751   { { echo "$as_me:16751: error: cannot run test program while cross compiling" >&5
16752 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16753    { (exit 1); exit 1; }; }
16754 else
16755   cat >"conftest.$ac_ext" <<_ACEOF
16756 #line 16756 "configure"
16757 #include "confdefs.h"
16758 $ac_includes_default
16759 int
16760 main (void)
16761 {
16762 FILE *f = fopen ("conftest.val", "w");
16763 if (!f)
16764   $ac_main_return (1);
16765 fprintf (f, "%ld", (long)(sizeof (signed char)));
16766 fclose (f);
16767   ;
16768   return 0;
16769 }
16770 _ACEOF
16771 rm -f "conftest$ac_exeext"
16772 if { (eval echo "$as_me:16772: \"$ac_link\"") >&5
16773   (eval $ac_link) 2>&5
16774   ac_status=$?
16775   echo "$as_me:16775: \$? = $ac_status" >&5
16776   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16777   { (eval echo "$as_me:16777: \"$ac_try\"") >&5
16778   (eval $ac_try) 2>&5
16779   ac_status=$?
16780   echo "$as_me:16780: \$? = $ac_status" >&5
16781   (exit "$ac_status"); }; }; then
16782   ac_cv_sizeof_signed_char=`cat conftest.val`
16783 else
16784   echo "$as_me: program exited with status $ac_status" >&5
16785 echo "$as_me: failed program was:" >&5
16786 cat "conftest.$ac_ext" >&5
16787 fi
16788 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16789 fi
16790 fi
16791 rm -f conftest.val
16792 else
16793   ac_cv_sizeof_signed_char=0
16794 fi
16795 fi
16796 echo "$as_me:16796: result: $ac_cv_sizeof_signed_char" >&5
16797 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16798 cat >>confdefs.h <<EOF
16799 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16800 EOF
16801
16802 echo "$as_me:16802: checking for ANSI C header files" >&5
16803 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16804 if test "${ac_cv_header_stdc+set}" = set; then
16805   echo $ECHO_N "(cached) $ECHO_C" >&6
16806 else
16807   cat >"conftest.$ac_ext" <<_ACEOF
16808 #line 16808 "configure"
16809 #include "confdefs.h"
16810 #include <stdlib.h>
16811 #include <stdarg.h>
16812 #include <string.h>
16813 #include <float.h>
16814
16815 _ACEOF
16816 if { (eval echo "$as_me:16816: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16817   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16818   ac_status=$?
16819   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16820   rm -f conftest.er1
16821   cat conftest.err >&5
16822   echo "$as_me:16822: \$? = $ac_status" >&5
16823   (exit "$ac_status"); } >/dev/null; then
16824   if test -s conftest.err; then
16825     ac_cpp_err=$ac_c_preproc_warn_flag
16826   else
16827     ac_cpp_err=
16828   fi
16829 else
16830   ac_cpp_err=yes
16831 fi
16832 if test -z "$ac_cpp_err"; then
16833   ac_cv_header_stdc=yes
16834 else
16835   echo "$as_me: failed program was:" >&5
16836   cat "conftest.$ac_ext" >&5
16837   ac_cv_header_stdc=no
16838 fi
16839 rm -f conftest.err "conftest.$ac_ext"
16840
16841 if test $ac_cv_header_stdc = yes; then
16842   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16843   cat >"conftest.$ac_ext" <<_ACEOF
16844 #line 16844 "configure"
16845 #include "confdefs.h"
16846 #include <string.h>
16847
16848 _ACEOF
16849 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16850   $EGREP "memchr" >/dev/null 2>&1; then
16851   :
16852 else
16853   ac_cv_header_stdc=no
16854 fi
16855 rm -rf conftest*
16856
16857 fi
16858
16859 if test $ac_cv_header_stdc = yes; then
16860   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16861   cat >"conftest.$ac_ext" <<_ACEOF
16862 #line 16862 "configure"
16863 #include "confdefs.h"
16864 #include <stdlib.h>
16865
16866 _ACEOF
16867 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16868   $EGREP "free" >/dev/null 2>&1; then
16869   :
16870 else
16871   ac_cv_header_stdc=no
16872 fi
16873 rm -rf conftest*
16874
16875 fi
16876
16877 if test $ac_cv_header_stdc = yes; then
16878   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16879   if test "$cross_compiling" = yes; then
16880   :
16881 else
16882   cat >"conftest.$ac_ext" <<_ACEOF
16883 #line 16883 "configure"
16884 #include "confdefs.h"
16885 #include <ctype.h>
16886 #if ((' ' & 0x0FF) == 0x020)
16887 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16888 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16889 #else
16890 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16891                      || ('j' <= (c) && (c) <= 'r') \
16892                      || ('s' <= (c) && (c) <= 'z'))
16893 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16894 #endif
16895
16896 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16897 int
16898 main (void)
16899 {
16900   int i;
16901   for (i = 0; i < 256; i++)
16902     if (XOR (islower (i), ISLOWER (i))
16903         || toupper (i) != TOUPPER (i))
16904       $ac_main_return(2);
16905   $ac_main_return (0);
16906 }
16907 _ACEOF
16908 rm -f "conftest$ac_exeext"
16909 if { (eval echo "$as_me:16909: \"$ac_link\"") >&5
16910   (eval $ac_link) 2>&5
16911   ac_status=$?
16912   echo "$as_me:16912: \$? = $ac_status" >&5
16913   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16914   { (eval echo "$as_me:16914: \"$ac_try\"") >&5
16915   (eval $ac_try) 2>&5
16916   ac_status=$?
16917   echo "$as_me:16917: \$? = $ac_status" >&5
16918   (exit "$ac_status"); }; }; then
16919   :
16920 else
16921   echo "$as_me: program exited with status $ac_status" >&5
16922 echo "$as_me: failed program was:" >&5
16923 cat "conftest.$ac_ext" >&5
16924 ac_cv_header_stdc=no
16925 fi
16926 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16927 fi
16928 fi
16929 fi
16930 echo "$as_me:16930: result: $ac_cv_header_stdc" >&5
16931 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16932 if test $ac_cv_header_stdc = yes; then
16933
16934 cat >>confdefs.h <<\EOF
16935 #define STDC_HEADERS 1
16936 EOF
16937
16938 fi
16939
16940 ac_header_dirent=no
16941 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16942   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16943 echo "$as_me:16943: checking for $ac_hdr that defines DIR" >&5
16944 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16945 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16946   echo $ECHO_N "(cached) $ECHO_C" >&6
16947 else
16948   cat >"conftest.$ac_ext" <<_ACEOF
16949 #line 16949 "configure"
16950 #include "confdefs.h"
16951 #include <sys/types.h>
16952 #include <$ac_hdr>
16953
16954 int
16955 main (void)
16956 {
16957 if ((DIR *) 0)
16958 return 0;
16959   ;
16960   return 0;
16961 }
16962 _ACEOF
16963 rm -f "conftest.$ac_objext"
16964 if { (eval echo "$as_me:16964: \"$ac_compile\"") >&5
16965   (eval $ac_compile) 2>&5
16966   ac_status=$?
16967   echo "$as_me:16967: \$? = $ac_status" >&5
16968   (exit "$ac_status"); } &&
16969          { ac_try='test -s "conftest.$ac_objext"'
16970   { (eval echo "$as_me:16970: \"$ac_try\"") >&5
16971   (eval $ac_try) 2>&5
16972   ac_status=$?
16973   echo "$as_me:16973: \$? = $ac_status" >&5
16974   (exit "$ac_status"); }; }; then
16975   eval "$as_ac_Header=yes"
16976 else
16977   echo "$as_me: failed program was:" >&5
16978 cat "conftest.$ac_ext" >&5
16979 eval "$as_ac_Header=no"
16980 fi
16981 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16982 fi
16983 echo "$as_me:16983: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16984 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16985 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16986   cat >>confdefs.h <<EOF
16987 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16988 EOF
16989
16990 ac_header_dirent=$ac_hdr; break
16991 fi
16992
16993 done
16994 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16995 if test $ac_header_dirent = dirent.h; then
16996   echo "$as_me:16996: checking for opendir in -ldir" >&5
16997 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16998 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16999   echo $ECHO_N "(cached) $ECHO_C" >&6
17000 else
17001   ac_check_lib_save_LIBS=$LIBS
17002 LIBS="-ldir  $LIBS"
17003 cat >"conftest.$ac_ext" <<_ACEOF
17004 #line 17004 "configure"
17005 #include "confdefs.h"
17006
17007 /* Override any gcc2 internal prototype to avoid an error.  */
17008 #ifdef __cplusplus
17009 extern "C"
17010 #endif
17011 /* We use char because int might match the return type of a gcc2
17012    builtin and then its argument prototype would still apply.  */
17013 char opendir ();
17014 int
17015 main (void)
17016 {
17017 opendir ();
17018   ;
17019   return 0;
17020 }
17021 _ACEOF
17022 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17023 if { (eval echo "$as_me:17023: \"$ac_link\"") >&5
17024   (eval $ac_link) 2>&5
17025   ac_status=$?
17026   echo "$as_me:17026: \$? = $ac_status" >&5
17027   (exit "$ac_status"); } &&
17028          { ac_try='test -s "conftest$ac_exeext"'
17029   { (eval echo "$as_me:17029: \"$ac_try\"") >&5
17030   (eval $ac_try) 2>&5
17031   ac_status=$?
17032   echo "$as_me:17032: \$? = $ac_status" >&5
17033   (exit "$ac_status"); }; }; then
17034   ac_cv_lib_dir_opendir=yes
17035 else
17036   echo "$as_me: failed program was:" >&5
17037 cat "conftest.$ac_ext" >&5
17038 ac_cv_lib_dir_opendir=no
17039 fi
17040 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17041 LIBS=$ac_check_lib_save_LIBS
17042 fi
17043 echo "$as_me:17043: result: $ac_cv_lib_dir_opendir" >&5
17044 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17045 if test "$ac_cv_lib_dir_opendir" = yes; then
17046   LIBS="$LIBS -ldir"
17047 fi
17048
17049 else
17050   echo "$as_me:17050: checking for opendir in -lx" >&5
17051 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17052 if test "${ac_cv_lib_x_opendir+set}" = set; then
17053   echo $ECHO_N "(cached) $ECHO_C" >&6
17054 else
17055   ac_check_lib_save_LIBS=$LIBS
17056 LIBS="-lx  $LIBS"
17057 cat >"conftest.$ac_ext" <<_ACEOF
17058 #line 17058 "configure"
17059 #include "confdefs.h"
17060
17061 /* Override any gcc2 internal prototype to avoid an error.  */
17062 #ifdef __cplusplus
17063 extern "C"
17064 #endif
17065 /* We use char because int might match the return type of a gcc2
17066    builtin and then its argument prototype would still apply.  */
17067 char opendir ();
17068 int
17069 main (void)
17070 {
17071 opendir ();
17072   ;
17073   return 0;
17074 }
17075 _ACEOF
17076 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17077 if { (eval echo "$as_me:17077: \"$ac_link\"") >&5
17078   (eval $ac_link) 2>&5
17079   ac_status=$?
17080   echo "$as_me:17080: \$? = $ac_status" >&5
17081   (exit "$ac_status"); } &&
17082          { ac_try='test -s "conftest$ac_exeext"'
17083   { (eval echo "$as_me:17083: \"$ac_try\"") >&5
17084   (eval $ac_try) 2>&5
17085   ac_status=$?
17086   echo "$as_me:17086: \$? = $ac_status" >&5
17087   (exit "$ac_status"); }; }; then
17088   ac_cv_lib_x_opendir=yes
17089 else
17090   echo "$as_me: failed program was:" >&5
17091 cat "conftest.$ac_ext" >&5
17092 ac_cv_lib_x_opendir=no
17093 fi
17094 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17095 LIBS=$ac_check_lib_save_LIBS
17096 fi
17097 echo "$as_me:17097: result: $ac_cv_lib_x_opendir" >&5
17098 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17099 if test "$ac_cv_lib_x_opendir" = yes; then
17100   LIBS="$LIBS -lx"
17101 fi
17102
17103 fi
17104
17105 echo "$as_me:17105: checking whether time.h and sys/time.h may both be included" >&5
17106 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17107 if test "${ac_cv_header_time+set}" = set; then
17108   echo $ECHO_N "(cached) $ECHO_C" >&6
17109 else
17110   cat >"conftest.$ac_ext" <<_ACEOF
17111 #line 17111 "configure"
17112 #include "confdefs.h"
17113 #include <sys/types.h>
17114 #include <sys/time.h>
17115 #include <time.h>
17116
17117 int
17118 main (void)
17119 {
17120 if ((struct tm *) 0)
17121 return 0;
17122   ;
17123   return 0;
17124 }
17125 _ACEOF
17126 rm -f "conftest.$ac_objext"
17127 if { (eval echo "$as_me:17127: \"$ac_compile\"") >&5
17128   (eval $ac_compile) 2>&5
17129   ac_status=$?
17130   echo "$as_me:17130: \$? = $ac_status" >&5
17131   (exit "$ac_status"); } &&
17132          { ac_try='test -s "conftest.$ac_objext"'
17133   { (eval echo "$as_me:17133: \"$ac_try\"") >&5
17134   (eval $ac_try) 2>&5
17135   ac_status=$?
17136   echo "$as_me:17136: \$? = $ac_status" >&5
17137   (exit "$ac_status"); }; }; then
17138   ac_cv_header_time=yes
17139 else
17140   echo "$as_me: failed program was:" >&5
17141 cat "conftest.$ac_ext" >&5
17142 ac_cv_header_time=no
17143 fi
17144 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17145 fi
17146 echo "$as_me:17146: result: $ac_cv_header_time" >&5
17147 echo "${ECHO_T}$ac_cv_header_time" >&6
17148 if test $ac_cv_header_time = yes; then
17149
17150 cat >>confdefs.h <<\EOF
17151 #define TIME_WITH_SYS_TIME 1
17152 EOF
17153
17154 fi
17155
17156 ###     checks for compiler characteristics
17157 ac_ext=c
17158 ac_cpp='$CPP $CPPFLAGS'
17159 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17160 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17161 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17162 ac_main_return="return"
17163
17164 echo "$as_me:17164: checking for an ANSI C-conforming const" >&5
17165 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17166 if test "${ac_cv_c_const+set}" = set; then
17167   echo $ECHO_N "(cached) $ECHO_C" >&6
17168 else
17169   cat >"conftest.$ac_ext" <<_ACEOF
17170 #line 17170 "configure"
17171 #include "confdefs.h"
17172
17173 int
17174 main (void)
17175 {
17176 /* FIXME: Include the comments suggested by Paul. */
17177 #ifndef __cplusplus
17178   /* Ultrix mips cc rejects this.  */
17179   typedef int charset[2];
17180   const charset x;
17181   /* SunOS 4.1.1 cc rejects this.  */
17182   char const *const *ccp;
17183   char **p;
17184   /* NEC SVR4.0.2 mips cc rejects this.  */
17185   struct point {int x, y;};
17186   static struct point const zero = {0,0};
17187   /* AIX XL C 1.02.0.0 rejects this.
17188      It does not let you subtract one const X* pointer from another in
17189      an arm of an if-expression whose if-part is not a constant
17190      expression */
17191   const char *g = "string";
17192   ccp = &g + (g ? g-g : 0);
17193   /* HPUX 7.0 cc rejects these. */
17194   ++ccp;
17195   p = (char**) ccp;
17196   ccp = (char const *const *) p;
17197   { /* SCO 3.2v4 cc rejects this.  */
17198     char *t;
17199     char const *s = 0 ? (char *) 0 : (char const *) 0;
17200
17201     *t++ = 0;
17202   }
17203   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17204     int x[] = {25, 17};
17205     const int *foo = &x[0];
17206     ++foo;
17207   }
17208   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17209     typedef const int *iptr;
17210     iptr p = 0;
17211     ++p;
17212   }
17213   { /* AIX XL C 1.02.0.0 rejects this saying
17214        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17215     struct s { int j; const int *ap[3]; };
17216     struct s *b; b->j = 5;
17217   }
17218   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17219     const int foo = 10;
17220   }
17221 #endif
17222
17223   ;
17224   return 0;
17225 }
17226 _ACEOF
17227 rm -f "conftest.$ac_objext"
17228 if { (eval echo "$as_me:17228: \"$ac_compile\"") >&5
17229   (eval $ac_compile) 2>&5
17230   ac_status=$?
17231   echo "$as_me:17231: \$? = $ac_status" >&5
17232   (exit "$ac_status"); } &&
17233          { ac_try='test -s "conftest.$ac_objext"'
17234   { (eval echo "$as_me:17234: \"$ac_try\"") >&5
17235   (eval $ac_try) 2>&5
17236   ac_status=$?
17237   echo "$as_me:17237: \$? = $ac_status" >&5
17238   (exit "$ac_status"); }; }; then
17239   ac_cv_c_const=yes
17240 else
17241   echo "$as_me: failed program was:" >&5
17242 cat "conftest.$ac_ext" >&5
17243 ac_cv_c_const=no
17244 fi
17245 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17246 fi
17247 echo "$as_me:17247: result: $ac_cv_c_const" >&5
17248 echo "${ECHO_T}$ac_cv_c_const" >&6
17249 if test $ac_cv_c_const = no; then
17250
17251 cat >>confdefs.h <<\EOF
17252 #define const
17253 EOF
17254
17255 fi
17256
17257 ###     Checks for external-data
17258
17259 echo "$as_me:17259: checking if data-only library module links" >&5
17260 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17261 if test "${cf_cv_link_dataonly+set}" = set; then
17262   echo $ECHO_N "(cached) $ECHO_C" >&6
17263 else
17264
17265         rm -f conftest.a
17266         cat >conftest.$ac_ext <<EOF
17267 #line 17267 "configure"
17268 int     testdata[3] = { 123, 456, 789 };
17269 EOF
17270         if { (eval echo "$as_me:17270: \"$ac_compile\"") >&5
17271   (eval $ac_compile) 2>&5
17272   ac_status=$?
17273   echo "$as_me:17273: \$? = $ac_status" >&5
17274   (exit "$ac_status"); } ; then
17275                 mv conftest.o data.o && \
17276                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17277         fi
17278         rm -f conftest.$ac_ext data.o
17279         cat >conftest.$ac_ext <<EOF
17280 #line 17280 "configure"
17281 int     testfunc(void)
17282 {
17283 #if defined(NeXT)
17284         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17285 #else
17286         extern int testdata[3];
17287         return testdata[0] == 123
17288            &&  testdata[1] == 456
17289            &&  testdata[2] == 789;
17290 #endif
17291 }
17292 EOF
17293         if { (eval echo "$as_me:17293: \"$ac_compile\"") >&5
17294   (eval $ac_compile) 2>&5
17295   ac_status=$?
17296   echo "$as_me:17296: \$? = $ac_status" >&5
17297   (exit "$ac_status"); }; then
17298                 mv conftest.o func.o && \
17299                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17300         fi
17301         rm -f conftest.$ac_ext func.o
17302         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17303         cf_saveLIBS="$LIBS"
17304         LIBS="conftest.a $LIBS"
17305         if test "$cross_compiling" = yes; then
17306   cf_cv_link_dataonly=unknown
17307 else
17308   cat >"conftest.$ac_ext" <<_ACEOF
17309 #line 17309 "configure"
17310 #include "confdefs.h"
17311
17312         int main(void)
17313         {
17314                 extern int testfunc();
17315                 ${cf_cv_main_return:-return} (!testfunc());
17316         }
17317
17318 _ACEOF
17319 rm -f "conftest$ac_exeext"
17320 if { (eval echo "$as_me:17320: \"$ac_link\"") >&5
17321   (eval $ac_link) 2>&5
17322   ac_status=$?
17323   echo "$as_me:17323: \$? = $ac_status" >&5
17324   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17325   { (eval echo "$as_me:17325: \"$ac_try\"") >&5
17326   (eval $ac_try) 2>&5
17327   ac_status=$?
17328   echo "$as_me:17328: \$? = $ac_status" >&5
17329   (exit "$ac_status"); }; }; then
17330   cf_cv_link_dataonly=yes
17331 else
17332   echo "$as_me: program exited with status $ac_status" >&5
17333 echo "$as_me: failed program was:" >&5
17334 cat "conftest.$ac_ext" >&5
17335 cf_cv_link_dataonly=no
17336 fi
17337 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17338 fi
17339         LIBS="$cf_saveLIBS"
17340
17341 fi
17342
17343 echo "$as_me:17343: result: $cf_cv_link_dataonly" >&5
17344 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17345
17346 if test "$cf_cv_link_dataonly" = no ; then
17347
17348 cat >>confdefs.h <<\EOF
17349 #define BROKEN_LINKER 1
17350 EOF
17351
17352         BROKEN_LINKER=1
17353 fi
17354
17355 ###     Checks for library functions.
17356
17357 for ac_header in \
17358 unistd.h \
17359
17360 do
17361 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17362 echo "$as_me:17362: checking for $ac_header" >&5
17363 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17364 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17365   echo $ECHO_N "(cached) $ECHO_C" >&6
17366 else
17367   cat >"conftest.$ac_ext" <<_ACEOF
17368 #line 17368 "configure"
17369 #include "confdefs.h"
17370 #include <$ac_header>
17371 _ACEOF
17372 if { (eval echo "$as_me:17372: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17373   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17374   ac_status=$?
17375   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17376   rm -f conftest.er1
17377   cat conftest.err >&5
17378   echo "$as_me:17378: \$? = $ac_status" >&5
17379   (exit "$ac_status"); } >/dev/null; then
17380   if test -s conftest.err; then
17381     ac_cpp_err=$ac_c_preproc_warn_flag
17382   else
17383     ac_cpp_err=
17384   fi
17385 else
17386   ac_cpp_err=yes
17387 fi
17388 if test -z "$ac_cpp_err"; then
17389   eval "$as_ac_Header=yes"
17390 else
17391   echo "$as_me: failed program was:" >&5
17392   cat "conftest.$ac_ext" >&5
17393   eval "$as_ac_Header=no"
17394 fi
17395 rm -f conftest.err "conftest.$ac_ext"
17396 fi
17397 echo "$as_me:17397: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17398 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17399 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17400   cat >>confdefs.h <<EOF
17401 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17402 EOF
17403
17404 fi
17405 done
17406
17407 echo "$as_me:17407: checking for working mkstemp" >&5
17408 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17409 if test "${cf_cv_func_mkstemp+set}" = set; then
17410   echo $ECHO_N "(cached) $ECHO_C" >&6
17411 else
17412
17413 rm -rf ./conftest*
17414 if test "$cross_compiling" = yes; then
17415   cf_cv_func_mkstemp=maybe
17416 else
17417   cat >"conftest.$ac_ext" <<_ACEOF
17418 #line 17418 "configure"
17419 #include "confdefs.h"
17420
17421 #include <sys/types.h>
17422 #ifdef HAVE_UNISTD_H
17423 #include <unistd.h>
17424 #endif
17425 #include <stdlib.h>
17426 #include <stdio.h>
17427 #include <string.h>
17428 #include <sys/stat.h>
17429 int main(void)
17430 {
17431         char *tmpl = "conftestXXXXXX";
17432         char name[2][80];
17433         int n;
17434         int result = 0;
17435         int fd;
17436         struct stat sb;
17437
17438         umask(077);
17439         for (n = 0; n < 2; ++n) {
17440                 strcpy(name[n], tmpl);
17441                 if ((fd = mkstemp(name[n])) >= 0) {
17442                         if (!strcmp(name[n], tmpl)
17443                          || stat(name[n], &sb) != 0
17444                          || (sb.st_mode & S_IFMT) != S_IFREG
17445                          || (sb.st_mode & 077) != 0) {
17446                                 result = 1;
17447                         }
17448                         close(fd);
17449                 }
17450         }
17451         if (result == 0
17452          && !strcmp(name[0], name[1]))
17453                 result = 1;
17454         ${cf_cv_main_return:-return}(result);
17455 }
17456
17457 _ACEOF
17458 rm -f "conftest$ac_exeext"
17459 if { (eval echo "$as_me:17459: \"$ac_link\"") >&5
17460   (eval $ac_link) 2>&5
17461   ac_status=$?
17462   echo "$as_me:17462: \$? = $ac_status" >&5
17463   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17464   { (eval echo "$as_me:17464: \"$ac_try\"") >&5
17465   (eval $ac_try) 2>&5
17466   ac_status=$?
17467   echo "$as_me:17467: \$? = $ac_status" >&5
17468   (exit "$ac_status"); }; }; then
17469   cf_cv_func_mkstemp=yes
17470
17471 else
17472   echo "$as_me: program exited with status $ac_status" >&5
17473 echo "$as_me: failed program was:" >&5
17474 cat "conftest.$ac_ext" >&5
17475 cf_cv_func_mkstemp=no
17476
17477 fi
17478 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17479 fi
17480
17481 fi
17482 echo "$as_me:17482: result: $cf_cv_func_mkstemp" >&5
17483 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17484 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17485         echo "$as_me:17485: checking for mkstemp" >&5
17486 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17487 if test "${ac_cv_func_mkstemp+set}" = set; then
17488   echo $ECHO_N "(cached) $ECHO_C" >&6
17489 else
17490   cat >"conftest.$ac_ext" <<_ACEOF
17491 #line 17491 "configure"
17492 #include "confdefs.h"
17493 #define mkstemp autoconf_temporary
17494 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17495 #undef mkstemp
17496
17497 #ifdef __cplusplus
17498 extern "C"
17499 #endif
17500
17501 /* We use char because int might match the return type of a gcc2
17502    builtin and then its argument prototype would still apply.  */
17503 char mkstemp (void);
17504
17505 int
17506 main (void)
17507 {
17508
17509 /* The GNU C library defines stubs for functions which it implements
17510     to always fail with ENOSYS.  Some functions are actually named
17511     something starting with __ and the normal name is an alias.  */
17512 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17513 #error found stub for mkstemp
17514 #endif
17515
17516         return mkstemp ();
17517   ;
17518   return 0;
17519 }
17520 _ACEOF
17521 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17522 if { (eval echo "$as_me:17522: \"$ac_link\"") >&5
17523   (eval $ac_link) 2>&5
17524   ac_status=$?
17525   echo "$as_me:17525: \$? = $ac_status" >&5
17526   (exit "$ac_status"); } &&
17527          { ac_try='test -s "conftest$ac_exeext"'
17528   { (eval echo "$as_me:17528: \"$ac_try\"") >&5
17529   (eval $ac_try) 2>&5
17530   ac_status=$?
17531   echo "$as_me:17531: \$? = $ac_status" >&5
17532   (exit "$ac_status"); }; }; then
17533   ac_cv_func_mkstemp=yes
17534 else
17535   echo "$as_me: failed program was:" >&5
17536 cat "conftest.$ac_ext" >&5
17537 ac_cv_func_mkstemp=no
17538 fi
17539 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17540 fi
17541 echo "$as_me:17541: result: $ac_cv_func_mkstemp" >&5
17542 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17543
17544 fi
17545 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17546
17547 cat >>confdefs.h <<\EOF
17548 #define HAVE_MKSTEMP 1
17549 EOF
17550
17551 fi
17552
17553 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17554         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17555         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17556 fi
17557
17558 cf_with_ada=yes
17559 if test "$cf_with_ada" != "no" ; then
17560
17561 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17562 do
17563
17564 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17565
17566         unset ac_cv_path_cf_TEMP_gnat
17567         unset cf_TEMP_gnat
17568         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17569 set dummy $cf_prog_gnat; ac_word=$2
17570 echo "$as_me:17570: checking for $ac_word" >&5
17571 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17572 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17573   echo $ECHO_N "(cached) $ECHO_C" >&6
17574 else
17575   case $cf_TEMP_gnat in
17576   [\\/]* | ?:[\\/]*)
17577   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17578   ;;
17579   *)
17580   ac_save_IFS=$IFS; IFS=$ac_path_separator
17581 ac_dummy="$PATH"
17582 for ac_dir in $ac_dummy; do
17583   IFS=$ac_save_IFS
17584   test -z "$ac_dir" && ac_dir=.
17585   if $as_executable_p "$ac_dir/$ac_word"; then
17586    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17587    echo "$as_me:17587: found $ac_dir/$ac_word" >&5
17588    break
17589 fi
17590 done
17591
17592   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17593   ;;
17594 esac
17595 fi
17596 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17597
17598 if test -n "$cf_TEMP_gnat"; then
17599   echo "$as_me:17599: result: $cf_TEMP_gnat" >&5
17600 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17601 else
17602   echo "$as_me:17602: result: no" >&5
17603 echo "${ECHO_T}no" >&6
17604 fi
17605
17606         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17607
17608         if test "x$cf_TEMP_gnat" != xno; then
17609                 unset cf_cv_gnat_version
17610                 unset cf_TEMP_gnat
17611
17612 echo "$as_me:17612: checking for $cf_prog_gnat version" >&5
17613 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17614 if test "${cf_cv_gnat_version+set}" = set; then
17615   echo $ECHO_N "(cached) $ECHO_C" >&6
17616 else
17617
17618 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17619         grep '[0-9].[0-9][0-9]*' |\
17620         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17621
17622 fi
17623 echo "$as_me:17623: result: $cf_cv_gnat_version" >&5
17624 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17625 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17626 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17627
17628         fi
17629         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17630
17631         unset cf_TEMP_gnat
17632         unset cf_cv_gnat_version
17633         unset ac_cv_path_cf_TEMP_gnat
17634 done
17635
17636 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17637         cf_ada_make=
17638         cf_cv_prog_gnat_correct=no
17639 else
17640         cf_ada_make=gnatmake
17641         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17642                 # gprconfig is newer than gnatmake; we can continue...
17643                 cf_ada_config="##"
17644         else
17645                 rm -rf ./conftest* ./*~conftest*
17646                 if mkdir conftest.src
17647                 then
17648                         cf_ada_config=""
17649                         cd conftest.src
17650                         for cf_gprconfig in Ada C
17651                         do
17652                                 echo "$as_me:17652: checking for gprconfig name for $cf_gprconfig" >&5
17653 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17654                                 if test "$cf_gprconfig" = C
17655                                 then
17656                                         for cf_gprconfig_param in \
17657                                                 "$cf_gprconfig,,,,GNATGCC" \
17658                                                 "$cf_gprconfig,,,,GCC" \
17659                                                 "$cf_gprconfig"
17660                                         do
17661                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17662                                                 test -n "$cf_gprconfig_value" && break
17663                                         done
17664                                 else
17665                                         cf_gprconfig_param=$cf_gprconfig
17666                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17667                                 fi
17668                                 if test -n "$cf_gprconfig_value"
17669                                 then
17670                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17671                                         echo "$as_me:17671: result: $cf_gprconfig_value" >&5
17672 echo "${ECHO_T}$cf_gprconfig_value" >&6
17673                                 else
17674                                         echo "$as_me:17674: result: missing" >&5
17675 echo "${ECHO_T}missing" >&6
17676                                         cf_ada_config="#"
17677                                         break
17678                                 fi
17679                         done
17680                         cd ..
17681                         rm -rf ./conftest* ./*~conftest*
17682                 fi
17683         fi
17684         if test "x$cf_ada_config" != "x#"
17685         then
17686
17687 echo "$as_me:17687: checking for gnat version" >&5
17688 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17689 if test "${cf_cv_gnat_version+set}" = set; then
17690   echo $ECHO_N "(cached) $ECHO_C" >&6
17691 else
17692
17693 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17694         grep '[0-9].[0-9][0-9]*' |\
17695         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17696
17697 fi
17698 echo "$as_me:17698: result: $cf_cv_gnat_version" >&5
17699 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17700 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17701
17702 case "$cf_cv_gnat_version" in
17703 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17704         cf_cv_prog_gnat_correct=yes
17705         ;;
17706 (*)
17707         { echo "$as_me:17707: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17708 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17709         cf_cv_prog_gnat_correct=no
17710         ;;
17711 esac
17712
17713                 # Extract the first word of "m4", so it can be a program name with args.
17714 set dummy m4; ac_word=$2
17715 echo "$as_me:17715: checking for $ac_word" >&5
17716 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17717 if test "${ac_cv_prog_M4_exists+set}" = set; then
17718   echo $ECHO_N "(cached) $ECHO_C" >&6
17719 else
17720   if test -n "$M4_exists"; then
17721   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17722 else
17723   ac_save_IFS=$IFS; IFS=$ac_path_separator
17724 ac_dummy="$PATH"
17725 for ac_dir in $ac_dummy; do
17726   IFS=$ac_save_IFS
17727   test -z "$ac_dir" && ac_dir=.
17728   $as_executable_p "$ac_dir/$ac_word" || continue
17729 ac_cv_prog_M4_exists="yes"
17730 echo "$as_me:17730: found $ac_dir/$ac_word" >&5
17731 break
17732 done
17733
17734   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17735 fi
17736 fi
17737 M4_exists=$ac_cv_prog_M4_exists
17738 if test -n "$M4_exists"; then
17739   echo "$as_me:17739: result: $M4_exists" >&5
17740 echo "${ECHO_T}$M4_exists" >&6
17741 else
17742   echo "$as_me:17742: result: no" >&5
17743 echo "${ECHO_T}no" >&6
17744 fi
17745
17746                 if test "$ac_cv_prog_M4_exists" = no; then
17747                         cf_cv_prog_gnat_correct=no
17748                         { echo "$as_me:17748: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17749 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17750                 fi
17751                 if test "$cf_cv_prog_gnat_correct" = yes; then
17752                         echo "$as_me:17752: checking if GNAT works" >&5
17753 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17754
17755 rm -rf ./conftest* ./*~conftest*
17756 cat >>conftest.ads <<CF_EOF
17757 procedure conftest;
17758 CF_EOF
17759 cat >>conftest.adb <<CF_EOF
17760 with Text_IO;
17761 with GNAT.OS_Lib;
17762 procedure conftest is
17763 begin
17764    Text_IO.Put ("Hello World");
17765    Text_IO.New_Line;
17766    GNAT.OS_Lib.OS_Exit (0);
17767 end conftest;
17768 CF_EOF
17769 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17770    if ( ./conftest 1>&5 2>&1 ) ; then
17771       cf_cv_prog_gnat_correct=yes
17772    else
17773       cf_cv_prog_gnat_correct=no
17774    fi
17775 else
17776    cf_cv_prog_gnat_correct=no
17777 fi
17778 rm -rf ./conftest* ./*~conftest*
17779
17780                         echo "$as_me:17780: result: $cf_cv_prog_gnat_correct" >&5
17781 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17782                 fi
17783         else
17784                 cf_cv_prog_gnat_correct=no
17785         fi
17786 fi
17787
17788         if test "$cf_cv_prog_gnat_correct" = yes; then
17789
17790         echo "$as_me:17790: checking optimization options for ADAFLAGS" >&5
17791 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17792         case "$CFLAGS" in
17793         (*-g*)
17794
17795         ADAFLAGS="$ADAFLAGS -g"
17796
17797                 ;;
17798         esac
17799         case "$CFLAGS" in
17800         (*-O*)
17801                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17802
17803         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17804
17805                 ;;
17806         esac
17807         echo "$as_me:17807: result: $ADAFLAGS" >&5
17808 echo "${ECHO_T}$ADAFLAGS" >&6
17809
17810 echo "$as_me:17810: checking if GNATPREP supports -T option" >&5
17811 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17812 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17813   echo $ECHO_N "(cached) $ECHO_C" >&6
17814 else
17815
17816 cf_cv_gnatprep_opt_t=no
17817 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17818
17819 fi
17820 echo "$as_me:17820: result: $cf_cv_gnatprep_opt_t" >&5
17821 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17822 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17823
17824 echo "$as_me:17824: checking if GNAT supports generics" >&5
17825 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17826 case "$cf_cv_gnat_version" in
17827 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17828         cf_gnat_generics=yes
17829         ;;
17830 (*)
17831         cf_gnat_generics=no
17832         ;;
17833 esac
17834 echo "$as_me:17834: result: $cf_gnat_generics" >&5
17835 echo "${ECHO_T}$cf_gnat_generics" >&6
17836
17837 if test "$cf_gnat_generics" = yes
17838 then
17839         cf_compile_generics=generics
17840         cf_generic_objects="\${GENOBJS}"
17841 else
17842         cf_compile_generics=
17843         cf_generic_objects=
17844 fi
17845
17846 echo "$as_me:17846: checking if GNAT supports SIGINT" >&5
17847 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17848 if test "${cf_cv_gnat_sigint+set}" = set; then
17849   echo $ECHO_N "(cached) $ECHO_C" >&6
17850 else
17851
17852 rm -rf ./conftest* ./*~conftest*
17853 cat >>conftest.ads <<CF_EOF
17854 with Ada.Interrupts.Names;
17855
17856 package ConfTest is
17857
17858    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17859    pragma Unreserve_All_Interrupts;
17860    pragma Warnings (On);
17861
17862    protected Process is
17863       procedure Stop;
17864       function Continue return Boolean;
17865       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17866    private
17867       Done : Boolean := False;
17868    end Process;
17869
17870 end ConfTest;
17871 CF_EOF
17872 cat >>conftest.adb <<CF_EOF
17873 package body ConfTest is
17874    protected body Process is
17875       procedure Stop is
17876       begin
17877          Done := True;
17878       end Stop;
17879       function Continue return Boolean is
17880       begin
17881          return not Done;
17882       end Continue;
17883    end Process;
17884 end ConfTest;
17885 CF_EOF
17886 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17887       cf_cv_gnat_sigint=yes
17888 else
17889    cf_cv_gnat_sigint=no
17890 fi
17891 rm -rf ./conftest* ./*~conftest*
17892
17893 fi
17894 echo "$as_me:17894: result: $cf_cv_gnat_sigint" >&5
17895 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17896
17897 if test "$cf_cv_gnat_sigint" = yes ; then
17898         USE_GNAT_SIGINT=""
17899 else
17900         USE_GNAT_SIGINT="#"
17901 fi
17902
17903 cf_gnat_libraries=no
17904 cf_gnat_projects=no
17905
17906 if test "$enable_gnat_projects" != no ; then
17907 echo "$as_me:17907: checking if GNAT supports project files" >&5
17908 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17909 case "$cf_cv_gnat_version" in
17910 (3.[0-9]*)
17911         ;;
17912 (*)
17913         case "$cf_cv_system_name" in
17914         (cygwin*|msys*)
17915                 ;;
17916         (*)
17917                 rm -rf ./conftest* ./*~conftest*
17918                 if mkdir conftest.src conftest.bin conftest.lib
17919                 then
17920                         cd conftest.src
17921                         rm -rf ./conftest* ./*~conftest*
17922                         cat >>library.gpr <<CF_EOF
17923 project Library is
17924   Kind := External ("LIB_KIND");
17925   for Library_Name use "ConfTest";
17926   for Object_Dir use ".";
17927   for Library_ALI_Dir use External("LIBRARY_DIR");
17928   for Library_Version use External ("SONAME");
17929   for Library_Kind use Kind;
17930   for Library_Dir use External("BUILD_DIR");
17931   Source_Dir := External ("SOURCE_DIR");
17932   for Source_Dirs use (Source_Dir);
17933 end Library;
17934 CF_EOF
17935                         cat >>confpackage.ads <<CF_EOF
17936 package ConfPackage is
17937    procedure conftest;
17938 end ConfPackage;
17939 CF_EOF
17940                         cat >>confpackage.adb <<CF_EOF
17941 with Text_IO;
17942 package body ConfPackage is
17943    procedure conftest is
17944    begin
17945       Text_IO.Put ("Hello World");
17946       Text_IO.New_Line;
17947    end conftest;
17948 end ConfPackage;
17949 CF_EOF
17950                         if ( "$cf_ada_make" $ADAFLAGS \
17951                                         -Plibrary.gpr \
17952                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17953                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17954                                         -XSOURCE_DIR="`pwd`" \
17955                                         -XSONAME=libConfTest.so.1 \
17956                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17957                                 cf_gnat_projects=yes
17958                         fi
17959                         cd ..
17960                 fi
17961                 if test -f conftest.lib/confpackage.ali
17962                 then
17963                         cf_gnat_libraries=yes
17964                 fi
17965                 rm -rf ./conftest* ./*~conftest*
17966                 ;;
17967         esac
17968         ;;
17969 esac
17970 echo "$as_me:17970: result: $cf_gnat_projects" >&5
17971 echo "${ECHO_T}$cf_gnat_projects" >&6
17972 fi # enable_gnat_projects
17973
17974 if test "$cf_gnat_projects" = yes
17975 then
17976         echo "$as_me:17976: checking if GNAT supports libraries" >&5
17977 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17978         echo "$as_me:17978: result: $cf_gnat_libraries" >&5
17979 echo "${ECHO_T}$cf_gnat_libraries" >&6
17980 fi
17981
17982 USE_OLD_MAKERULES=""
17983 USE_GNAT_PROJECTS="#"
17984 USE_GNAT_MAKE_GPR="#"
17985 USE_GNAT_GPRBUILD="#"
17986
17987 if test "$cf_gnat_projects" = yes
17988 then
17989         USE_OLD_MAKERULES="#"
17990         USE_GNAT_PROJECTS=""
17991         if test "$cf_cv_VERSION_GPRBUILD" != no
17992         then
17993                 USE_GNAT_GPRBUILD=""
17994         elif test "$cf_cv_VERSION_GNATMAKE" != no
17995         then
17996                 USE_GNAT_MAKE_GPR=""
17997         else
17998                 { echo "$as_me:17998: WARNING: use old makefile rules since tools are missing" >&5
17999 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
18000         fi
18001 fi
18002
18003 if test "$cf_gnat_libraries" = yes
18004 then
18005         USE_GNAT_LIBRARIES=""
18006 else
18007         USE_GNAT_LIBRARIES="#"
18008 fi
18009
18010 echo "$as_me:18010: checking for ada-compiler" >&5
18011 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
18012
18013 # Check whether --with-ada-compiler or --without-ada-compiler was given.
18014 if test "${with_ada_compiler+set}" = set; then
18015   withval="$with_ada_compiler"
18016   cf_ada_compiler=$withval
18017 else
18018   cf_ada_compiler=gnatmake
18019 fi;
18020
18021 echo "$as_me:18021: result: $cf_ada_compiler" >&5
18022 echo "${ECHO_T}$cf_ada_compiler" >&6
18023
18024                 cf_ada_package=terminal_interface
18025
18026 echo "$as_me:18026: checking for ada-include" >&5
18027 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
18028
18029 # Check whether --with-ada-include or --without-ada-include was given.
18030 if test "${with_ada_include+set}" = set; then
18031   withval="$with_ada_include"
18032
18033 else
18034   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18035 fi; if test -n "$prefix/share/ada/adainclude" ; then
18036
18037 if test "x$prefix" != xNONE; then
18038         cf_path_syntax="$prefix"
18039 else
18040         cf_path_syntax="$ac_default_prefix"
18041 fi
18042
18043 case ".$withval" in
18044 (.\$\(*\)*|.\'*\'*)
18045         ;;
18046 (..|./*|.\\*)
18047         ;;
18048 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18049         ;;
18050 (.\$\{*prefix\}*|.\$\{*dir\}*)
18051         eval withval="$withval"
18052         case ".$withval" in
18053         (.NONE/*)
18054                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18055                 ;;
18056         esac
18057         ;;
18058 (.no|.NONE/*)
18059         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18060         ;;
18061 (*)
18062         { { echo "$as_me:18062: error: expected a pathname, not \"$withval\"" >&5
18063 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18064    { (exit 1); exit 1; }; }
18065         ;;
18066 esac
18067
18068 fi
18069 eval ADA_INCLUDE="$withval"
18070
18071 echo "$as_me:18071: result: $ADA_INCLUDE" >&5
18072 echo "${ECHO_T}$ADA_INCLUDE" >&6
18073
18074 echo "$as_me:18074: checking for ada-objects" >&5
18075 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
18076
18077 # Check whether --with-ada-objects or --without-ada-objects was given.
18078 if test "${with_ada_objects+set}" = set; then
18079   withval="$with_ada_objects"
18080
18081 else
18082   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18083 fi; if test -n "$prefix/lib/ada/adalib" ; then
18084
18085 if test "x$prefix" != xNONE; then
18086         cf_path_syntax="$prefix"
18087 else
18088         cf_path_syntax="$ac_default_prefix"
18089 fi
18090
18091 case ".$withval" in
18092 (.\$\(*\)*|.\'*\'*)
18093         ;;
18094 (..|./*|.\\*)
18095         ;;
18096 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18097         ;;
18098 (.\$\{*prefix\}*|.\$\{*dir\}*)
18099         eval withval="$withval"
18100         case ".$withval" in
18101         (.NONE/*)
18102                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18103                 ;;
18104         esac
18105         ;;
18106 (.no|.NONE/*)
18107         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18108         ;;
18109 (*)
18110         { { echo "$as_me:18110: error: expected a pathname, not \"$withval\"" >&5
18111 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18112    { (exit 1); exit 1; }; }
18113         ;;
18114 esac
18115
18116 fi
18117 eval ADA_OBJECTS="$withval"
18118
18119 echo "$as_me:18119: result: $ADA_OBJECTS" >&5
18120 echo "${ECHO_T}$ADA_OBJECTS" >&6
18121
18122 echo "$as_me:18122: checking if an Ada95 shared-library should be built" >&5
18123 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18124
18125 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18126 if test "${with_ada_sharedlib+set}" = set; then
18127   withval="$with_ada_sharedlib"
18128   with_ada_sharedlib=$withval
18129 else
18130   with_ada_sharedlib=no
18131 fi;
18132 echo "$as_me:18132: result: $with_ada_sharedlib" >&5
18133 echo "${ECHO_T}$with_ada_sharedlib" >&6
18134
18135 if test "x$with_ada_sharedlib" != xno
18136 then
18137         if test "x$cf_gnat_projects" != xyes
18138         then
18139                 { echo "$as_me:18139: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18140 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18141                 with_ada_sharedlib=no
18142         fi
18143 fi
18144
18145 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18146 MAKE_ADA_SHAREDLIB="#"
18147
18148 if test "x$with_ada_sharedlib" != xno
18149 then
18150         MAKE_ADA_SHAREDLIB=
18151         if test "x$with_ada_sharedlib" != xyes
18152         then
18153                 ADA_SHAREDLIB="$with_ada_sharedlib"
18154         fi
18155 fi
18156
18157                 # allow the Ada binding to be renamed
18158
18159 echo "$as_me:18159: checking for ada-libname" >&5
18160 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18161
18162 # Check whether --with-ada-libname or --without-ada-libname was given.
18163 if test "${with_ada_libname+set}" = set; then
18164   withval="$with_ada_libname"
18165   ADA_LIBNAME=$withval
18166 else
18167   ADA_LIBNAME=AdaCurses
18168 fi;
18169 case "x$ADA_LIBNAME" in
18170 (x|xyes|xno)
18171         ADA_LIBNAME=AdaCurses
18172         ;;
18173 esac
18174
18175 echo "$as_me:18175: result: $ADA_LIBNAME" >&5
18176 echo "${ECHO_T}$ADA_LIBNAME" >&6
18177
18178         else
18179                 { { echo "$as_me:18179: error: No usable Ada compiler found" >&5
18180 echo "$as_me: error: No usable Ada compiler found" >&2;}
18181    { (exit 1); exit 1; }; }
18182         fi
18183 else
18184         { { echo "$as_me:18184: error: The Ada compiler is needed for this package" >&5
18185 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18186    { (exit 1); exit 1; }; }
18187 fi
18188
18189 ################################################################################
18190
18191 # not needed
18192 TINFO_LDFLAGS2=
18193
18194 TINFO_LIBS=
18195
18196 ### Construct the list of include-directories to be generated
18197
18198 if test "$srcdir" != "."; then
18199         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18200 fi
18201 CPPFLAGS="-I../include $CPPFLAGS"
18202 if test "$srcdir" != "."; then
18203         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18204 fi
18205 CPPFLAGS="-I. $CPPFLAGS"
18206
18207 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18208 if test "$srcdir" != "."; then
18209         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18210 fi
18211 if test "$GCC" != yes; then
18212         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18213 elif test "$includedir" != "/usr/include"; then
18214         if test "$includedir" = '${prefix}/include' ; then
18215                 if test x$prefix != x/usr ; then
18216                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18217                 fi
18218         else
18219                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18220         fi
18221 fi
18222
18223 ### Build up pieces for makefile rules
18224 echo "$as_me:18224: checking default library suffix" >&5
18225 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18226
18227         case $DFT_LWR_MODEL in
18228         (libtool) DFT_ARG_SUFFIX=''   ;;
18229         (normal)  DFT_ARG_SUFFIX=''   ;;
18230         (debug)   DFT_ARG_SUFFIX='_g' ;;
18231         (profile) DFT_ARG_SUFFIX='_p' ;;
18232         (shared)  DFT_ARG_SUFFIX=''   ;;
18233         esac
18234         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18235 echo "$as_me:18235: result: $DFT_ARG_SUFFIX" >&5
18236 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18237
18238 echo "$as_me:18238: checking default library-dependency suffix" >&5
18239 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18240
18241         case X$DFT_LWR_MODEL in
18242         (Xlibtool)
18243                 DFT_LIB_SUFFIX='.la'
18244                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18245                 ;;
18246         (Xdebug)
18247                 case "$cf_cv_system_name" in
18248                 (*-msvc*)
18249                         DFT_LIB_SUFFIX='_g.lib'
18250                         ;;
18251                 (*)
18252                         DFT_LIB_SUFFIX='_g.a'
18253                         ;;
18254                 esac
18255                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18256                 ;;
18257         (Xprofile)
18258                 case "$cf_cv_system_name" in
18259                 (*-msvc*)
18260                         DFT_LIB_SUFFIX='_p.lib'
18261                         ;;
18262                 (*)
18263                         DFT_LIB_SUFFIX='_p.a'
18264                         ;;
18265                 esac
18266                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18267                 ;;
18268         (Xshared)
18269                 case "$cf_cv_system_name" in
18270                 (aix[5-7]*)
18271                         DFT_LIB_SUFFIX='.so'
18272                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18273                         ;;
18274                 (*-msvc*)
18275                         DFT_LIB_SUFFIX='.dll'
18276                         DFT_DEP_SUFFIX='.dll.lib'
18277                         ;;
18278                 (cygwin*|msys*|mingw*)
18279                         DFT_LIB_SUFFIX='.dll'
18280                         DFT_DEP_SUFFIX='.dll.a'
18281                         ;;
18282                 (darwin*)
18283                         DFT_LIB_SUFFIX='.dylib'
18284                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18285                         ;;
18286                 (hpux*)
18287                         case "$target" in
18288                         (ia64*)
18289                                 DFT_LIB_SUFFIX='.so'
18290                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18291                                 ;;
18292                         (*)
18293                                 DFT_LIB_SUFFIX='.sl'
18294                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18295                                 ;;
18296                         esac
18297                         ;;
18298                 (*)
18299                         DFT_LIB_SUFFIX='.so'
18300                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18301                         ;;
18302                 esac
18303                 ;;
18304         (*)
18305                 case "$target" in
18306                 (*-msvc*)
18307                         DFT_LIB_SUFFIX='.lib'
18308                         ;;
18309                 (*)
18310                         DFT_LIB_SUFFIX='.a'
18311                         ;;
18312                 esac
18313                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18314                 ;;
18315         esac
18316         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18317         then
18318                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18319                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18320         fi
18321 echo "$as_me:18321: result: $DFT_DEP_SUFFIX" >&5
18322 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18323
18324 echo "$as_me:18324: checking default object directory" >&5
18325 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18326
18327         case $DFT_LWR_MODEL in
18328         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18329         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18330         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18331         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18332         (shared)
18333                 case "$cf_cv_system_name" in
18334                 (cygwin|msys)
18335                         DFT_OBJ_SUBDIR='objects' ;;
18336                 (*)
18337                         DFT_OBJ_SUBDIR='obj_s' ;;
18338                 esac
18339         esac
18340 echo "$as_me:18340: result: $DFT_OBJ_SUBDIR" >&5
18341 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18342
18343 ### Set up low-level terminfo dependencies for makefiles.
18344
18345 if test "$DFT_LWR_MODEL" = shared ; then
18346         case $cf_cv_system_name in
18347         (cygwin*)
18348                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18349                 ;;
18350         (msys*)
18351                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18352                 ;;
18353         esac
18354 fi
18355
18356 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18357
18358 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18359
18360 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18361
18362 ### Construct the list of subdirectories for which we'll customize makefiles
18363 ### with the appropriate compile-rules.
18364
18365 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18366
18367 cat >>confdefs.h <<EOF
18368 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18369 EOF
18370
18371 ################################################################################
18372
18373 TEST_ARG2=
18374
18375 TEST_LIBS2=
18376
18377 NCURSES_SHLIB2="sh -c"
18378
18379 ADA_SUBDIRS="include gen src doc"
18380 if test "x$cf_with_tests" != "xno" ; then
18381         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18382 fi
18383 for cf_dir in $ADA_SUBDIRS
18384 do
18385         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18386 done
18387
18388 NCURSES_TREE="#"
18389
18390 EXTERNAL_TREE=
18391
18392 # match layout used by make-tar.sh
18393 ADAHTML_DIR=../doc/ada
18394
18395 if test "x$cross_compiling" = xyes ; then
18396         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18397 else
18398         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18399 fi
18400
18401 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"
18402 ac_config_commands="$ac_config_commands default"
18403 cat >confcache <<\_ACEOF
18404 # This file is a shell script that caches the results of configure
18405 # tests run on this system so they can be shared between configure
18406 # scripts and configure runs, see configure's option --config-cache.
18407 # It is not useful on other systems.  If it contains results you don't
18408 # want to keep, you may remove or edit it.
18409 #
18410 # config.status only pays attention to the cache file if you give it
18411 # the --recheck option to rerun configure.
18412 #
18413 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18414 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18415 # following values.
18416
18417 _ACEOF
18418
18419 # The following way of writing the cache mishandles newlines in values,
18420 # but we know of no workaround that is simple, portable, and efficient.
18421 # So, don't put newlines in cache variables' values.
18422 # Ultrix sh set writes to stderr and can't be redirected directly,
18423 # and sets the high bit in the cache file unless we assign to the vars.
18424 {
18425   (set) 2>&1 |
18426     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18427     *ac_space=\ *)
18428       # `set' does not quote correctly, so add quotes (double-quote
18429       # substitution turns \\\\ into \\, and sed turns \\ into \).
18430       sed -n \
18431         "s/'/'\\\\''/g;
18432           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18433       ;;
18434     *)
18435       # `set' quotes correctly as required by POSIX, so do not add quotes.
18436       sed -n \
18437         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18438       ;;
18439     esac;
18440 } |
18441   sed '
18442      t clear
18443      : clear
18444      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18445      t end
18446      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18447      : end' >>confcache
18448 if cmp -s $cache_file confcache; then :; else
18449   if test -w $cache_file; then
18450     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18451     cat confcache >$cache_file
18452   else
18453     echo "not updating unwritable cache $cache_file"
18454   fi
18455 fi
18456 rm -f confcache
18457
18458 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18459 # Let make expand exec_prefix.
18460 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18461
18462 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18463 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18464 # trailing colons and then remove the whole line if VPATH becomes empty
18465 # (actually we leave an empty line to preserve line numbers).
18466 if test "x$srcdir" = x.; then
18467   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18468 s/:*\$(srcdir):*/:/;
18469 s/:*\${srcdir}:*/:/;
18470 s/:*@srcdir@:*/:/;
18471 s/^\([^=]*=[    ]*\):*/\1/;
18472 s/:*$//;
18473 s/^[^=]*=[      ]*$//;
18474 }'
18475 fi
18476
18477 DEFS=-DHAVE_CONFIG_H
18478
18479 : "${CONFIG_STATUS=./config.status}"
18480 ac_clean_files_save=$ac_clean_files
18481 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18482 { echo "$as_me:18482: creating $CONFIG_STATUS" >&5
18483 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18484 cat >"$CONFIG_STATUS" <<_ACEOF
18485 #! $SHELL
18486 # Generated automatically by configure.
18487 # Run this file to recreate the current configuration.
18488 # Compiler output produced by configure, useful for debugging
18489 # configure, is in config.log if it exists.
18490
18491 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18492
18493 debug=false
18494 SHELL=\${CONFIG_SHELL-$SHELL}
18495 ac_cs_invocation="\$0 \$@"
18496
18497 CLICOLOR_FORCE= GREP_OPTIONS=
18498 unset CLICOLOR_FORCE GREP_OPTIONS
18499 _ACEOF
18500
18501 cat >>"$CONFIG_STATUS" <<\_ACEOF
18502 # Be Bourne compatible
18503 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18504   emulate sh
18505   NULLCMD=:
18506 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18507   set -o posix
18508 fi
18509
18510 # Name of the executable.
18511 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18512
18513 if expr a : '\(a\)' >/dev/null 2>&1; then
18514   as_expr="expr"
18515 else
18516   as_expr="false"
18517 fi
18518
18519 rm -f conf$$ conf$$.exe conf$$.file
18520 echo >conf$$.file
18521 if ln -s conf$$.file conf$$ 2>/dev/null; then
18522   # We could just check for DJGPP; but this test a) works b) is more generic
18523   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18524   if test -f conf$$.exe; then
18525     # Don't use ln at all; we don't have any links
18526     as_ln_s='cp -p'
18527   else
18528     as_ln_s='ln -s'
18529   fi
18530 elif ln conf$$.file conf$$ 2>/dev/null; then
18531   as_ln_s='ln'
18532 else
18533   as_ln_s='cp -p'
18534 fi
18535 rm -f conf$$ conf$$.exe conf$$.file
18536
18537 as_executable_p="test -f"
18538
18539 # Support unset when possible.
18540 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18541   as_unset="unset"
18542 else
18543   as_unset="false"
18544 fi
18545
18546 # NLS nuisances.
18547 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18548 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18549 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18550 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18551 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18552 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18553 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18554 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18555
18556 # IFS
18557 # We need space, tab and new line, in precisely that order.
18558 as_nl='
18559 '
18560 IFS="   $as_nl"
18561
18562 # CDPATH.
18563 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18564
18565 exec 6>&1
18566
18567 _ACEOF
18568
18569 # Files that config.status was made for.
18570 if test -n "$ac_config_files"; then
18571   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18572 fi
18573
18574 if test -n "$ac_config_headers"; then
18575   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18576 fi
18577
18578 if test -n "$ac_config_links"; then
18579   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18580 fi
18581
18582 if test -n "$ac_config_commands"; then
18583   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18584 fi
18585
18586 cat >>"$CONFIG_STATUS" <<\EOF
18587
18588 ac_cs_usage="\
18589 \`$as_me' instantiates files from templates according to the
18590 current configuration.
18591
18592 Usage: $0 [OPTIONS] [FILE]...
18593
18594   -h, --help       print this help, then exit
18595   -V, --version    print version number, then exit
18596   -d, --debug      don't remove temporary files
18597       --recheck    update $as_me by reconfiguring in the same conditions
18598   --file=FILE[:TEMPLATE]
18599                    instantiate the configuration file FILE
18600   --header=FILE[:TEMPLATE]
18601                    instantiate the configuration header FILE
18602
18603 Configuration files:
18604 $config_files
18605
18606 Configuration headers:
18607 $config_headers
18608
18609 Configuration commands:
18610 $config_commands
18611
18612 Report bugs to <dickey@invisible-island.net>."
18613 EOF
18614
18615 cat >>"$CONFIG_STATUS" <<EOF
18616 ac_cs_version="\\
18617 config.status
18618 configured by $0, generated by GNU Autoconf 2.52.20221202,
18619   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18620
18621 Copyright 2003-2021,2022        Thomas E. Dickey
18622 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18623 Free Software Foundation, Inc.
18624 This config.status script is free software; the Free Software Foundation
18625 gives unlimited permission to copy, distribute and modify it."
18626 srcdir="$srcdir"
18627 INSTALL="$INSTALL"
18628 EOF
18629
18630 cat >>"$CONFIG_STATUS" <<\EOF
18631 # If no file are specified by the user, then we need to provide default
18632 # value.  By we need to know if files were specified by the user.
18633 ac_need_defaults=:
18634 while test $# != 0
18635 do
18636   case $1 in
18637   --*=*)
18638     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18639     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18640     shift
18641     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18642     shift
18643     ;;
18644   -*);;
18645   *) # This is not an option, so the user has probably given explicit
18646      # arguments.
18647      ac_need_defaults=false;;
18648   esac
18649
18650   case $1 in
18651   # Handling of the options.
18652 EOF
18653 cat >>"$CONFIG_STATUS" <<EOF
18654   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18655     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18656     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18657 EOF
18658 cat >>"$CONFIG_STATUS" <<\EOF
18659   --version | --vers* | -V )
18660     echo "$ac_cs_version"; exit 0 ;;
18661   --he | --h)
18662     # Conflict between --help and --header
18663     { { echo "$as_me:18663: error: ambiguous option: $1
18664 Try \`$0 --help' for more information." >&5
18665 echo "$as_me: error: ambiguous option: $1
18666 Try \`$0 --help' for more information." >&2;}
18667    { (exit 1); exit 1; }; };;
18668   --help | --hel | -h )
18669     echo "$ac_cs_usage"; exit 0 ;;
18670   --debug | --d* | -d )
18671     debug=: ;;
18672   --file | --fil | --fi | --f )
18673     shift
18674     CONFIG_FILES="$CONFIG_FILES $1"
18675     ac_need_defaults=false;;
18676   --header | --heade | --head | --hea )
18677     shift
18678     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18679     ac_need_defaults=false;;
18680
18681   # This is an error.
18682   -*) { { echo "$as_me:18682: error: unrecognized option: $1
18683 Try \`$0 --help' for more information." >&5
18684 echo "$as_me: error: unrecognized option: $1
18685 Try \`$0 --help' for more information." >&2;}
18686    { (exit 1); exit 1; }; } ;;
18687
18688   *) ac_config_targets="$ac_config_targets $1" ;;
18689
18690   esac
18691   shift
18692 done
18693
18694 exec 5>>config.log
18695 cat >&5 << _ACEOF
18696
18697 ## ----------------------- ##
18698 ## Running config.status.  ##
18699 ## ----------------------- ##
18700
18701 This file was extended by $as_me 2.52.20221202, executed with
18702   CONFIG_FILES    = $CONFIG_FILES
18703   CONFIG_HEADERS  = $CONFIG_HEADERS
18704   CONFIG_LINKS    = $CONFIG_LINKS
18705   CONFIG_COMMANDS = $CONFIG_COMMANDS
18706   > "$ac_cs_invocation"
18707 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18708
18709 _ACEOF
18710 EOF
18711
18712 cat >>"$CONFIG_STATUS" <<EOF
18713 #
18714 # INIT-COMMANDS section.
18715 #
18716
18717 ### Special initialization commands, used to pass information from the
18718 ### configuration-run into config.status
18719
18720 AWK="$AWK"
18721 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18722 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18723 LIB_NAME="$LIB_NAME"
18724 LIB_PREFIX="$LIB_PREFIX"
18725 LIB_SUFFIX="$LIB_SUFFIX"
18726 LN_S="$LN_S"
18727 NCURSES_MAJOR="$NCURSES_MAJOR"
18728 NCURSES_MINOR="$NCURSES_MINOR"
18729 NCURSES_PATCH="$NCURSES_PATCH"
18730 PACKAGE="$PACKAGE"
18731 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18732 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18733 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18734 cf_cv_abi_version="$cf_cv_abi_version"
18735 cf_cv_rel_version="$cf_cv_rel_version"
18736 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18737 cf_cv_shared_soname='$cf_cv_shared_soname'
18738 cf_cv_shlib_version="$cf_cv_shlib_version"
18739 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18740 cf_cv_system_name="$cf_cv_system_name"
18741 host="$host"
18742 target="$target"
18743
18744 EOF
18745
18746 cat >>"$CONFIG_STATUS" <<\EOF
18747 for ac_config_target in $ac_config_targets
18748 do
18749   case "$ac_config_target" in
18750   # Handling of arguments.
18751   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18752   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18753   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18754   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18755   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18756   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18757   *) { { echo "$as_me:18757: error: invalid argument: $ac_config_target" >&5
18758 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18759    { (exit 1); exit 1; }; };;
18760   esac
18761 done
18762
18763 # If the user did not use the arguments to specify the items to instantiate,
18764 # then the envvar interface is used.  Set only those that are not.
18765 # We use the long form for the default assignment because of an extremely
18766 # bizarre bug on SunOS 4.1.3.
18767 if "$ac_need_defaults"; then
18768   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18769   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18770   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18771 fi
18772
18773 # Create a temporary directory, and hook for its removal unless debugging.
18774 $debug ||
18775 {
18776   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18777   trap '{ (exit 1); exit 1; }' 1 2 13 15
18778 }
18779
18780 # Create a (secure) tmp directory for tmp files.
18781 : "${TMPDIR=/tmp}"
18782 {
18783   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18784   test -n "$tmp" && test -d "$tmp"
18785 }  ||
18786 {
18787   tmp=$TMPDIR/cs$$-$RANDOM
18788   (umask 077 && mkdir "$tmp")
18789 } ||
18790 {
18791    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18792    { (exit 1); exit 1; }
18793 }
18794
18795 EOF
18796
18797 cat >>"$CONFIG_STATUS" <<EOF
18798
18799 #
18800 # CONFIG_FILES section.
18801 #
18802
18803 # No need to generate the scripts if there are no CONFIG_FILES.
18804 # This happens for instance when ./config.status config.h
18805 if test -n "\$CONFIG_FILES"; then
18806   # Protect against being on the right side of a sed subst in config.status.
18807   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18808    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
18809 s,@SHELL@,$SHELL,;t t
18810 s,@exec_prefix@,$exec_prefix,;t t
18811 s,@prefix@,$prefix,;t t
18812 s,@program_transform_name@,$program_transform_name,;t t
18813 s,@bindir@,$bindir,;t t
18814 s,@sbindir@,$sbindir,;t t
18815 s,@libexecdir@,$libexecdir,;t t
18816 s,@datarootdir@,$datarootdir,;t t
18817 s,@datadir@,$datadir,;t t
18818 s,@sysconfdir@,$sysconfdir,;t t
18819 s,@sharedstatedir@,$sharedstatedir,;t t
18820 s,@localstatedir@,$localstatedir,;t t
18821 s,@runstatedir@,$runstatedir,;t t
18822 s,@libdir@,$libdir,;t t
18823 s,@includedir@,$includedir,;t t
18824 s,@oldincludedir@,$oldincludedir,;t t
18825 s,@infodir@,$infodir,;t t
18826 s,@mandir@,$mandir,;t t
18827 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18828 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18829 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18830 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18831 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18832 s,@build_alias@,$build_alias,;t t
18833 s,@host_alias@,$host_alias,;t t
18834 s,@target_alias@,$target_alias,;t t
18835 s,@ECHO_C@,$ECHO_C,;t t
18836 s,@ECHO_N@,$ECHO_N,;t t
18837 s,@ECHO_T@,$ECHO_T,;t t
18838 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18839 s,@DEFS@,$DEFS,;t t
18840 s,@LIBS@,$LIBS,;t t
18841 s,@PACKAGE@,$PACKAGE,;t t
18842 s,@top_builddir@,$top_builddir,;t t
18843 s,@build@,$build,;t t
18844 s,@build_cpu@,$build_cpu,;t t
18845 s,@build_vendor@,$build_vendor,;t t
18846 s,@build_os@,$build_os,;t t
18847 s,@host@,$host,;t t
18848 s,@host_cpu@,$host_cpu,;t t
18849 s,@host_vendor@,$host_vendor,;t t
18850 s,@host_os@,$host_os,;t t
18851 s,@target@,$target,;t t
18852 s,@target_cpu@,$target_cpu,;t t
18853 s,@target_vendor@,$target_vendor,;t t
18854 s,@target_os@,$target_os,;t t
18855 s,@GREP@,$GREP,;t t
18856 s,@FGREP@,$FGREP,;t t
18857 s,@CC@,$CC,;t t
18858 s,@CFLAGS@,$CFLAGS,;t t
18859 s,@LDFLAGS@,$LDFLAGS,;t t
18860 s,@CPPFLAGS@,$CPPFLAGS,;t t
18861 s,@ac_ct_CC@,$ac_ct_CC,;t t
18862 s,@EXEEXT@,$EXEEXT,;t t
18863 s,@OBJEXT@,$OBJEXT,;t t
18864 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18865 s,@CPP@,$CPP,;t t
18866 s,@EGREP@,$EGREP,;t t
18867 s,@AWK@,$AWK,;t t
18868 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18869 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18870 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18871 s,@LN_S@,$LN_S,;t t
18872 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18873 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18874 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18875 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18876 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18877 s,@SET_MAKE@,$SET_MAKE,;t t
18878 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18879 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18880 s,@CTAGS@,$CTAGS,;t t
18881 s,@ETAGS@,$ETAGS,;t t
18882 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18883 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18884 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18885 s,@RANLIB@,$RANLIB,;t t
18886 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18887 s,@LD@,$LD,;t t
18888 s,@ac_ct_LD@,$ac_ct_LD,;t t
18889 s,@AR@,$AR,;t t
18890 s,@ac_ct_AR@,$ac_ct_AR,;t t
18891 s,@ARFLAGS@,$ARFLAGS,;t t
18892 s,@DESTDIR@,$DESTDIR,;t t
18893 s,@BUILD_CC@,$BUILD_CC,;t t
18894 s,@BUILD_CPP@,$BUILD_CPP,;t t
18895 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18896 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18897 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18898 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18899 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18900 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18901 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18902 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18903 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18904 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18905 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18906 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18907 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18908 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18909 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18910 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18911 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18912 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18913 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18914 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18915 s,@CC_G_OPT@,$CC_G_OPT,;t t
18916 s,@LD_MODEL@,$LD_MODEL,;t t
18917 s,@shlibdir@,$shlibdir,;t t
18918 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18919 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18920 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18921 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18922 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18923 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18924 s,@LINK_PROGS@,$LINK_PROGS,;t t
18925 s,@LINK_TESTS@,$LINK_TESTS,;t t
18926 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18927 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18928 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18929 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18930 s,@RPATH_LIST@,$RPATH_LIST,;t t
18931 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18932 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18933 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18934 s,@PTHREAD@,$PTHREAD,;t t
18935 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18936 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18937 s,@ECHO_LT@,$ECHO_LT,;t t
18938 s,@ECHO_LD@,$ECHO_LD,;t t
18939 s,@RULE_CC@,$RULE_CC,;t t
18940 s,@SHOW_CC@,$SHOW_CC,;t t
18941 s,@ECHO_CC@,$ECHO_CC,;t t
18942 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18943 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18944 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18945 s,@ADAFLAGS@,$ADAFLAGS,;t t
18946 s,@ADA_TRACE@,$ADA_TRACE,;t t
18947 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18948 s,@M4_exists@,$M4_exists,;t t
18949 s,@cf_ada_make@,$cf_ada_make,;t t
18950 s,@cf_ada_config@,$cf_ada_config,;t t
18951 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18952 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18953 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18954 s,@cf_compile_generics@,$cf_compile_generics,;t t
18955 s,@cf_generic_objects@,$cf_generic_objects,;t t
18956 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18957 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18958 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18959 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18960 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18961 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18962 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18963 s,@cf_ada_package@,$cf_ada_package,;t t
18964 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18965 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18966 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18967 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18968 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18969 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18970 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18971 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18972 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18973 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18974 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18975 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18976 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18977 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18978 s,@TEST_ARG2@,$TEST_ARG2,;t t
18979 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18980 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18981 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18982 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18983 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18984 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18985 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18986 CEOF
18987
18988 EOF
18989
18990   cat >>"$CONFIG_STATUS" <<\EOF
18991   # Split the substitutions into bite-sized pieces for seds with
18992   # small command number limits, like on Digital OSF/1 and HP-UX.
18993   ac_max_sed_lines=48
18994   ac_sed_frag=1 # Number of current file.
18995   ac_beg=1 # First line for current file.
18996   ac_end=$ac_max_sed_lines # Line after last line for current file.
18997   ac_more_lines=:
18998   ac_sed_cmds=
18999   while "$ac_more_lines"; do
19000     if test "$ac_beg" -gt 1; then
19001       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19002     else
19003       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19004     fi
19005     if test ! -s "$tmp"/subs.frag; then
19006       ac_more_lines=false
19007     else
19008       # The purpose of the label and of the branching condition is to
19009       # speed up the sed processing (if there are no `@' at all, there
19010       # is no need to browse any of the substitutions).
19011       # These are the two extra sed commands mentioned above.
19012       (echo ':t
19013   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19014       # It is possible to make a multiline substitution using escaped newlines.
19015       # Ensure that we do not split the substitution between script fragments.
19016       ac_BEG=$ac_end
19017       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19018       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19019       if test -s "$tmp"/subs.next; then
19020         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19021         if test ! -s "$tmp"/subs.edit; then
19022           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19023           if test ! -s "$tmp"/subs.edit; then
19024             if test "$ac_beg" -gt 1; then
19025               ac_end=`expr "$ac_end" - 1`
19026               continue
19027             fi
19028           fi
19029         fi
19030       fi
19031
19032       if test -z "$ac_sed_cmds"; then
19033         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19034       else
19035         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19036       fi
19037       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19038       ac_beg=$ac_end
19039       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19040     fi
19041   done
19042   if test -z "$ac_sed_cmds"; then
19043     ac_sed_cmds="cat"
19044   fi
19045 fi # test -n "$CONFIG_FILES"
19046
19047 EOF
19048 cat >>"$CONFIG_STATUS" <<\EOF
19049 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19050   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19051   case "$ac_file" in
19052   - | *:- | *:-:* ) # input from stdin
19053         cat >"$tmp"/stdin
19054         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19055         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19056   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19057         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19058   * )   ac_file_in=$ac_file.in ;;
19059   esac
19060
19061   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19062   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19063          X"$ac_file" : 'X\(//\)[^/]' \| \
19064          X"$ac_file" : 'X\(//\)$' \| \
19065          X"$ac_file" : 'X\(/\)' \| \
19066          .     : '\(.\)' 2>/dev/null ||
19067 echo X"$ac_file" |
19068     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19069           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19070           /^X\(\/\/\)$/{ s//\1/; q; }
19071           /^X\(\/\).*/{ s//\1/; q; }
19072           s/.*/./; q'`
19073   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19074     { case "$ac_dir" in
19075   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19076   *)                      as_incr_dir=.;;
19077 esac
19078 as_dummy="$ac_dir"
19079 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19080   case $as_mkdir_dir in
19081     # Skip DOS drivespec
19082     ?:) as_incr_dir=$as_mkdir_dir ;;
19083     *)
19084       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19085       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19086     ;;
19087   esac
19088 done; }
19089
19090     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19091     # A "../" for each directory in $ac_dir_suffix.
19092     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19093   else
19094     ac_dir_suffix= ac_dots=
19095   fi
19096
19097   case "$srcdir" in
19098   .)  ac_srcdir=.
19099       if test -z "$ac_dots"; then
19100          ac_top_srcdir=.
19101       else
19102          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19103       fi ;;
19104   [\\/]* | ?:[\\/]* )
19105       ac_srcdir="$srcdir$ac_dir_suffix";
19106       ac_top_srcdir="$srcdir" ;;
19107   *) # Relative path.
19108     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19109     ac_top_srcdir="$ac_dots$srcdir" ;;
19110   esac
19111
19112   case $INSTALL in
19113   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19114   *) ac_INSTALL=$ac_dots$INSTALL ;;
19115   esac
19116
19117   if test x"$ac_file" != x-; then
19118     { echo "$as_me:19118: creating $ac_file" >&5
19119 echo "$as_me: creating $ac_file" >&6;}
19120     rm -f "$ac_file"
19121   fi
19122   # Let's still pretend it is `configure' which instantiates (i.e., don't
19123   # use $as_me), people would be surprised to read:
19124   #    /* config.h.  Generated automatically by config.status.  */
19125   configure_input="Generated automatically from `echo $ac_file_in |
19126                                                  sed 's,.*/,,'` by configure."
19127
19128   # First look for the input files in the build tree, otherwise in the
19129   # src tree.
19130   ac_file_inputs=`IFS=:
19131     for f in $ac_file_in; do
19132       case $f in
19133       -) echo "$tmp"/stdin ;;
19134       [\\/$]*)
19135          # Absolute (can't be DOS-style, as IFS=:)
19136          test -f "$f" || { { echo "$as_me:19136: error: cannot find input file: $f" >&5
19137 echo "$as_me: error: cannot find input file: $f" >&2;}
19138    { (exit 1); exit 1; }; }
19139          echo "$f";;
19140       *) # Relative
19141          if test -f "$f"; then
19142            # Build tree
19143            echo "$f"
19144          elif test -f "$srcdir/$f"; then
19145            # Source tree
19146            echo "$srcdir/$f"
19147          else
19148            # /dev/null tree
19149            { { echo "$as_me:19149: error: cannot find input file: $f" >&5
19150 echo "$as_me: error: cannot find input file: $f" >&2;}
19151    { (exit 1); exit 1; }; }
19152          fi;;
19153       esac
19154     done` || { (exit 1); exit 1; }
19155 EOF
19156 cat >>"$CONFIG_STATUS" <<\EOF
19157   ac_warn_datarootdir=no
19158   if test x"$ac_file" != x-; then
19159     for ac_item in $ac_file_inputs
19160     do
19161       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19162       if test -n "$ac_seen"; then
19163         ac_used=`grep '@datarootdir@' "$ac_item"`
19164         if test -z "$ac_used"; then
19165           { echo "$as_me:19165: WARNING: datarootdir was used implicitly but not set:
19166 $ac_seen" >&5
19167 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19168 $ac_seen" >&2;}
19169           ac_warn_datarootdir=yes
19170         fi
19171       fi
19172       ac_seen=`grep '${datarootdir}' "$ac_item"`
19173       if test -n "$ac_seen"; then
19174         { echo "$as_me:19174: WARNING: datarootdir was used explicitly but not set:
19175 $ac_seen" >&5
19176 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19177 $ac_seen" >&2;}
19178         ac_warn_datarootdir=yes
19179       fi
19180     done
19181   fi
19182
19183 if test "x$ac_warn_datarootdir" = xyes; then
19184   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19185 fi
19186
19187 EOF
19188 cat >>"$CONFIG_STATUS" <<EOF
19189   sed "$ac_vpsub
19190 $extrasub
19191 EOF
19192 cat >>"$CONFIG_STATUS" <<\EOF
19193 :t
19194 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19195 s,@configure_input@,$configure_input,;t t
19196 s,@srcdir@,$ac_srcdir,;t t
19197 s,@top_srcdir@,$ac_top_srcdir,;t t
19198 s,@INSTALL@,$ac_INSTALL,;t t
19199 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19200   rm -f "$tmp"/stdin
19201 EOF
19202 : "${FGREP:=grep -F}"
19203 : "${EGREP:=grep -E}"
19204 cat >>"$CONFIG_STATUS" <<EOF
19205   : "\${FGREP:=$FGREP}"
19206   : "\${EGREP:=$EGREP}"
19207 EOF
19208 cat >>"$CONFIG_STATUS" <<\EOF
19209   if test x"$ac_file" != x-; then
19210     cp "$tmp/out" "$ac_file"
19211
19212     for ac_name in prefix exec_prefix datarootdir
19213     do
19214         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19215         if test -n "$ac_seen"; then
19216             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19217             if test -z "$ac_init"; then
19218               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19219               { echo "$as_me:19219: WARNING: Variable $ac_name is used but was not set:
19220 $ac_seen" >&5
19221 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19222 $ac_seen" >&2;}
19223             fi
19224         fi
19225     done
19226     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19227     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19228     if test -s "$tmp"/out; then
19229       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19230       { echo "$as_me:19230: WARNING: Some variables may not be substituted:
19231 $ac_seen" >&5
19232 echo "$as_me: WARNING: Some variables may not be substituted:
19233 $ac_seen" >&2;}
19234     fi
19235   else
19236     cat "$tmp"/out
19237   fi
19238   rm -f "$tmp"/out
19239
19240 done
19241 EOF
19242 cat >>"$CONFIG_STATUS" <<\EOF
19243
19244 #
19245 # CONFIG_HEADER section.
19246 #
19247
19248 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19249 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19250 #
19251 # ac_d sets the value in "#define NAME VALUE" lines.
19252 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19253 ac_dB='[        ].*$,\1#\2'
19254 ac_dC=' '
19255 ac_dD=',;t'
19256 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19257 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19258 ac_iB='\([      ]\),\1#\2define\3'
19259 ac_iC=' '
19260 ac_iD='\4,;t'
19261 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19262 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19263 ac_uB='$,\1#\2define\3'
19264 ac_uC=' '
19265 ac_uD=',;t'
19266
19267 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19268   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19269   case "$ac_file" in
19270   - | *:- | *:-:* ) # input from stdin
19271         cat >"$tmp"/stdin
19272         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19273         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19274   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19275         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19276   * )   ac_file_in=$ac_file.in ;;
19277   esac
19278
19279   test x"$ac_file" != x- && { echo "$as_me:19279: creating $ac_file" >&5
19280 echo "$as_me: creating $ac_file" >&6;}
19281
19282   # First look for the input files in the build tree, otherwise in the
19283   # src tree.
19284   ac_file_inputs=`IFS=:
19285     for f in $ac_file_in; do
19286       case $f in
19287       -) echo "$tmp"/stdin ;;
19288       [\\/$]*)
19289          # Absolute (can't be DOS-style, as IFS=:)
19290          test -f "$f" || { { echo "$as_me:19290: error: cannot find input file: $f" >&5
19291 echo "$as_me: error: cannot find input file: $f" >&2;}
19292    { (exit 1); exit 1; }; }
19293          echo $f;;
19294       *) # Relative
19295          if test -f "$f"; then
19296            # Build tree
19297            echo $f
19298          elif test -f "$srcdir/$f"; then
19299            # Source tree
19300            echo "$srcdir/$f"
19301          else
19302            # /dev/null tree
19303            { { echo "$as_me:19303: error: cannot find input file: $f" >&5
19304 echo "$as_me: error: cannot find input file: $f" >&2;}
19305    { (exit 1); exit 1; }; }
19306          fi;;
19307       esac
19308     done` || { (exit 1); exit 1; }
19309   # Remove the trailing spaces.
19310   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19311
19312 EOF
19313
19314 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19315 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19316 # be either 'cat' or 'sort'.
19317 cat confdefs.h | uniq >conftest.vals
19318
19319 # Break up conftest.vals because some shells have a limit on
19320 # the size of here documents, and old seds have small limits too.
19321
19322 rm -f conftest.tail
19323 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19324 while grep . conftest.vals >/dev/null
19325 do
19326   # Write chunks of a limited-size here document to conftest.frag.
19327   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19328   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19329   echo 'CEOF' >> "$CONFIG_STATUS"
19330   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19331   rm -f conftest.vals
19332   mv conftest.tail conftest.vals
19333 done
19334 rm -f conftest.vals
19335
19336 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19337 # marker @DEFS@.
19338 echo '  cat >> conftest.edit <<CEOF
19339 /@DEFS@/r conftest.frag
19340 /@DEFS@/d
19341 CEOF
19342 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19343 rm -f "$tmp"/in
19344 mv "$tmp"/out "$tmp"/in
19345 rm -f conftest.edit conftest.frag
19346 ' >> "$CONFIG_STATUS"
19347
19348 cat >>"$CONFIG_STATUS" <<\EOF
19349   # Let's still pretend it is `configure' which instantiates (i.e., don't
19350   # use $as_me), people would be surprised to read:
19351   #    /* config.h.  Generated automatically by config.status.  */
19352   if test x"$ac_file" = x-; then
19353     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19354   else
19355     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19356   fi
19357   cat "$tmp"/in >>"$tmp"/config.h
19358   rm -f "$tmp"/in
19359   if test x"$ac_file" != x-; then
19360     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19361       { echo "$as_me:19361: $ac_file is unchanged" >&5
19362 echo "$as_me: $ac_file is unchanged" >&6;}
19363     else
19364       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19365          X"$ac_file" : 'X\(//\)[^/]' \| \
19366          X"$ac_file" : 'X\(//\)$' \| \
19367          X"$ac_file" : 'X\(/\)' \| \
19368          .     : '\(.\)' 2>/dev/null ||
19369 echo X"$ac_file" |
19370     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19371           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19372           /^X\(\/\/\)$/{ s//\1/; q; }
19373           /^X\(\/\).*/{ s//\1/; q; }
19374           s/.*/./; q'`
19375       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19376         { case "$ac_dir" in
19377   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19378   *)                      as_incr_dir=.;;
19379 esac
19380 as_dummy="$ac_dir"
19381 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19382   case $as_mkdir_dir in
19383     # Skip DOS drivespec
19384     ?:) as_incr_dir=$as_mkdir_dir ;;
19385     *)
19386       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19387       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19388     ;;
19389   esac
19390 done; }
19391
19392       fi
19393       rm -f "$ac_file"
19394       mv "$tmp/config.h" "$ac_file"
19395     fi
19396   else
19397     cat "$tmp"/config.h
19398     rm -f "$tmp"/config.h
19399   fi
19400 done
19401 EOF
19402 cat >>"$CONFIG_STATUS" <<\EOF
19403 #
19404 # CONFIG_COMMANDS section.
19405 #
19406 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19407   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19408   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19409
19410   case "$ac_dest" in
19411     default )
19412 $AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
19413 if test -z "$USE_OLD_MAKERULES" ; then
19414         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19415 fi
19416  ;;
19417   esac
19418 done
19419 EOF
19420
19421 cat >>"$CONFIG_STATUS" <<\EOF
19422
19423 { (exit 0); exit 0; }
19424 EOF
19425 chmod +x "$CONFIG_STATUS"
19426 ac_clean_files=$ac_clean_files_save
19427
19428 # configure is writing to config.log, and then calls config.status.
19429 # config.status does its own redirection, appending to config.log.
19430 # Unfortunately, on DOS this fails, as config.log is still kept open
19431 # by configure, so config.status won't be able to write to it; its
19432 # output is simply discarded.  So we exec the FD to /dev/null,
19433 # effectively closing config.log, so it can be properly (re)opened and
19434 # appended to by config.status.  When coming back to configure, we
19435 # need to make the FD available again.
19436 if test "$no_create" != yes; then
19437   ac_cs_success=:
19438   exec 5>/dev/null
19439   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19440   exec 5>>config.log
19441   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19442   # would make configure fail if this is the last instruction.
19443   "$ac_cs_success" || { (exit 1); exit 1; }
19444 fi
19445 ${MAKE:-make} preinstall