]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.4 - patch 20230225
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.91 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20230114.
5 #
6 # Copyright 2003-2022,2023      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr="expr"
38 else
39   as_expr="false"
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s='ln'
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2022,2023        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20230114.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 PACKAGE="AdaCurses"
1063
1064 top_builddir=`pwd`
1065
1066 ac_aux_dir=
1067 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1068   if test -f "$ac_dir/install-sh"; then
1069     ac_aux_dir=$ac_dir
1070     ac_install_sh="$ac_aux_dir/install-sh -c"
1071     break
1072   elif test -f "$ac_dir/install.sh"; then
1073     ac_aux_dir=$ac_dir
1074     ac_install_sh="$ac_aux_dir/install.sh -c"
1075     break
1076   elif test -f "$ac_dir/shtool"; then
1077     ac_aux_dir=$ac_dir
1078     ac_install_sh="$ac_aux_dir/shtool install -c"
1079     break
1080   fi
1081 done
1082 if test -z "$ac_aux_dir"; then
1083   { { echo "$as_me:1083: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1084 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1085    { (exit 1); exit 1; }; }
1086 fi
1087 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1088 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1089 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1090
1091 # Make sure we can run config.sub.
1092 $ac_config_sub sun4 >/dev/null 2>&1 ||
1093   { { echo "$as_me:1093: error: cannot run $ac_config_sub" >&5
1094 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1095    { (exit 1); exit 1; }; }
1096
1097 echo "$as_me:1097: checking build system type" >&5
1098 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1099 if test "${ac_cv_build+set}" = set; then
1100   echo $ECHO_N "(cached) $ECHO_C" >&6
1101 else
1102   ac_cv_build_alias=$build_alias
1103 test -z "$ac_cv_build_alias" &&
1104   ac_cv_build_alias=`$ac_config_guess`
1105 test -z "$ac_cv_build_alias" &&
1106   { { echo "$as_me:1106: error: cannot guess build type; you must specify one" >&5
1107 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1108    { (exit 1); exit 1; }; }
1109 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1110   { { echo "$as_me:1110: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1111 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1112    { (exit 1); exit 1; }; }
1113
1114 fi
1115 echo "$as_me:1115: result: $ac_cv_build" >&5
1116 echo "${ECHO_T}$ac_cv_build" >&6
1117 build=$ac_cv_build
1118 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1119 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1120 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1121
1122 echo "$as_me:1122: checking host system type" >&5
1123 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1124 if test "${ac_cv_host+set}" = set; then
1125   echo $ECHO_N "(cached) $ECHO_C" >&6
1126 else
1127   ac_cv_host_alias=$host_alias
1128 test -z "$ac_cv_host_alias" &&
1129   ac_cv_host_alias=$ac_cv_build_alias
1130 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1131   { { echo "$as_me:1131: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1132 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1133    { (exit 1); exit 1; }; }
1134
1135 fi
1136 echo "$as_me:1136: result: $ac_cv_host" >&5
1137 echo "${ECHO_T}$ac_cv_host" >&6
1138 host=$ac_cv_host
1139 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1140 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1141 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1142
1143 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1144         echo "$as_me:1144: checking target system type" >&5
1145 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1146 if test "${ac_cv_target+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   ac_cv_target_alias=$target_alias
1150 test "x$ac_cv_target_alias" = "x" &&
1151   ac_cv_target_alias=$ac_cv_host_alias
1152 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1153   { { echo "$as_me:1153: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1154 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1155    { (exit 1); exit 1; }; }
1156
1157 fi
1158 echo "$as_me:1158: result: $ac_cv_target" >&5
1159 echo "${ECHO_T}$ac_cv_target" >&6
1160 target=$ac_cv_target
1161 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1162 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1163 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1164
1165 # The aliases save the names the user supplied, while $host etc.
1166 # will get canonicalized.
1167 test -n "$target_alias" &&
1168   test "$program_prefix$program_suffix$program_transform_name" = \
1169     NONENONEs,x,x, &&
1170   program_prefix=${target_alias}-
1171         system_name="$host_os"
1172 else
1173         system_name="`(uname -s -r) 2>/dev/null`"
1174         if test -z "$system_name" ; then
1175                 system_name="`(hostname) 2>/dev/null`"
1176         fi
1177 fi
1178 test -n "$system_name" &&
1179 cat >>confdefs.h <<EOF
1180 #define SYSTEM_NAME "$system_name"
1181 EOF
1182
1183 if test "${cf_cv_system_name+set}" = set; then
1184   echo $ECHO_N "(cached) $ECHO_C" >&6
1185 else
1186   cf_cv_system_name="$system_name"
1187 fi
1188
1189 test -z "$system_name" && system_name="$cf_cv_system_name"
1190 test -n "$cf_cv_system_name" && echo "$as_me:1190: result: Configuring for $cf_cv_system_name" >&5
1191 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1192
1193 if test ".$system_name" != ".$cf_cv_system_name" ; then
1194         echo "$as_me:1194: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1195 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1196         { { echo "$as_me:1196: error: \"Please remove config.cache and try again.\"" >&5
1197 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1198    { (exit 1); exit 1; }; }
1199 fi
1200
1201 # Check whether --with-system-type or --without-system-type was given.
1202 if test "${with_system_type+set}" = set; then
1203   withval="$with_system_type"
1204   { echo "$as_me:1204: WARNING: overriding system type to $withval" >&5
1205 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1206         cf_cv_system_name=$withval
1207         host_os=$withval
1208
1209 fi;
1210
1211 ###     Save the given $CFLAGS to allow user-override.
1212 cf_user_CFLAGS="$CFLAGS"
1213
1214 ###     Default install-location
1215 for ac_prog in ggrep grep
1216 do
1217   # Extract the first word of "$ac_prog", so it can be a program name with args.
1218 set dummy $ac_prog; ac_word=$2
1219 echo "$as_me:1219: checking for $ac_word" >&5
1220 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1221 if test "${ac_cv_prog_GREP+set}" = set; then
1222   echo $ECHO_N "(cached) $ECHO_C" >&6
1223 else
1224   if test -n "$GREP"; then
1225   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1226 else
1227   ac_save_IFS=$IFS; IFS=$ac_path_separator
1228 ac_dummy="$PATH"
1229 for ac_dir in $ac_dummy; do
1230   IFS=$ac_save_IFS
1231   test -z "$ac_dir" && ac_dir=.
1232   $as_executable_p "$ac_dir/$ac_word" || continue
1233 ac_cv_prog_GREP="$ac_prog"
1234 echo "$as_me:1234: found $ac_dir/$ac_word" >&5
1235 break
1236 done
1237
1238 fi
1239 fi
1240 GREP=$ac_cv_prog_GREP
1241 if test -n "$GREP"; then
1242   echo "$as_me:1242: result: $GREP" >&5
1243 echo "${ECHO_T}$GREP" >&6
1244 else
1245   echo "$as_me:1245: result: no" >&5
1246 echo "${ECHO_T}no" >&6
1247 fi
1248
1249   test -n "$GREP" && break
1250 done
1251 test -n "$GREP" || GREP=": "
1252
1253 echo "$as_me:1253: checking for fgrep" >&5
1254 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1255 if test "${ac_cv_path_FGREP+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1259    then ac_cv_path_FGREP="$GREP -F"
1260    else
1261      for ac_prog in gfgrep fgrep
1262 do
1263   # Extract the first word of "$ac_prog", so it can be a program name with args.
1264 set dummy $ac_prog; ac_word=$2
1265 echo "$as_me:1265: checking for $ac_word" >&5
1266 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1267 if test "${ac_cv_path_FGREP+set}" = set; then
1268   echo $ECHO_N "(cached) $ECHO_C" >&6
1269 else
1270   case $FGREP in
1271   [\\/]* | ?:[\\/]*)
1272   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1273   ;;
1274   *)
1275   ac_save_IFS=$IFS; IFS=$ac_path_separator
1276 ac_dummy="$PATH"
1277 for ac_dir in $ac_dummy; do
1278   IFS=$ac_save_IFS
1279   test -z "$ac_dir" && ac_dir=.
1280   if $as_executable_p "$ac_dir/$ac_word"; then
1281    ac_cv_path_FGREP="$ac_dir/$ac_word"
1282    echo "$as_me:1282: found $ac_dir/$ac_word" >&5
1283    break
1284 fi
1285 done
1286
1287   ;;
1288 esac
1289 fi
1290 FGREP=$ac_cv_path_FGREP
1291
1292 if test -n "$FGREP"; then
1293   echo "$as_me:1293: result: $FGREP" >&5
1294 echo "${ECHO_T}$FGREP" >&6
1295 else
1296   echo "$as_me:1296: result: no" >&5
1297 echo "${ECHO_T}no" >&6
1298 fi
1299
1300   test -n "$FGREP" && break
1301 done
1302 test -n "$FGREP" || FGREP=": "
1303
1304      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1304: error: cannot find workable fgrep" >&5
1305 echo "$as_me: error: cannot find workable fgrep" >&2;}
1306    { (exit 1); exit 1; }; }
1307    fi
1308 fi
1309 echo "$as_me:1309: result: $ac_cv_path_FGREP" >&5
1310 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1311  FGREP="$ac_cv_path_FGREP"
1312
1313 echo "$as_me:1313: checking for prefix" >&5
1314 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1315 if test "x$prefix" = "xNONE" ; then
1316         case "$cf_cv_system_name" in
1317                 # non-vendor systems don't have a conflict
1318         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1319                 prefix=/usr
1320                 ;;
1321         (*)     prefix=$ac_default_prefix
1322                 ;;
1323         esac
1324 fi
1325 echo "$as_me:1325: result: $prefix" >&5
1326 echo "${ECHO_T}$prefix" >&6
1327
1328 if test "x$prefix" = "xNONE" ; then
1329 echo "$as_me:1329: checking for default include-directory" >&5
1330 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1331 test -n "$verbose" && echo 1>&6
1332 for cf_symbol in \
1333         "$includedir" \
1334         "$includedir/ncurses" \
1335         "$prefix/include" \
1336         "$prefix/include/ncurses" \
1337         /usr/local/include \
1338         /usr/local/include/ncurses \
1339         /usr/include \
1340         /usr/include/ncurses
1341 do
1342         cf_dir=`eval echo "$cf_symbol"`
1343         if test -f "$cf_dir/curses.h" ; then
1344         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1345                 includedir="$cf_symbol"
1346                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1347                 break
1348         fi
1349         fi
1350         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1351 done
1352 echo "$as_me:1352: result: $includedir" >&5
1353 echo "${ECHO_T}$includedir" >&6
1354 fi
1355
1356 ###     Checks for programs.
1357
1358 ac_ext=c
1359 ac_cpp='$CPP $CPPFLAGS'
1360 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1361 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1362 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1363 ac_main_return="return"
1364 if test -n "$ac_tool_prefix"; then
1365   for ac_prog in gnatgcc gcc cc
1366   do
1367     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1368 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1369 echo "$as_me:1369: checking for $ac_word" >&5
1370 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1371 if test "${ac_cv_prog_CC+set}" = set; then
1372   echo $ECHO_N "(cached) $ECHO_C" >&6
1373 else
1374   if test -n "$CC"; then
1375   ac_cv_prog_CC="$CC" # Let the user override the test.
1376 else
1377   ac_save_IFS=$IFS; IFS=$ac_path_separator
1378 ac_dummy="$PATH"
1379 for ac_dir in $ac_dummy; do
1380   IFS=$ac_save_IFS
1381   test -z "$ac_dir" && ac_dir=.
1382   $as_executable_p "$ac_dir/$ac_word" || continue
1383 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1384 echo "$as_me:1384: found $ac_dir/$ac_word" >&5
1385 break
1386 done
1387
1388 fi
1389 fi
1390 CC=$ac_cv_prog_CC
1391 if test -n "$CC"; then
1392   echo "$as_me:1392: result: $CC" >&5
1393 echo "${ECHO_T}$CC" >&6
1394 else
1395   echo "$as_me:1395: result: no" >&5
1396 echo "${ECHO_T}no" >&6
1397 fi
1398
1399     test -n "$CC" && break
1400   done
1401 fi
1402 if test -z "$CC"; then
1403   ac_ct_CC=$CC
1404   for ac_prog in gnatgcc gcc cc
1405 do
1406   # Extract the first word of "$ac_prog", so it can be a program name with args.
1407 set dummy $ac_prog; ac_word=$2
1408 echo "$as_me:1408: checking for $ac_word" >&5
1409 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1410 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1411   echo $ECHO_N "(cached) $ECHO_C" >&6
1412 else
1413   if test -n "$ac_ct_CC"; then
1414   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1415 else
1416   ac_save_IFS=$IFS; IFS=$ac_path_separator
1417 ac_dummy="$PATH"
1418 for ac_dir in $ac_dummy; do
1419   IFS=$ac_save_IFS
1420   test -z "$ac_dir" && ac_dir=.
1421   $as_executable_p "$ac_dir/$ac_word" || continue
1422 ac_cv_prog_ac_ct_CC="$ac_prog"
1423 echo "$as_me:1423: found $ac_dir/$ac_word" >&5
1424 break
1425 done
1426
1427 fi
1428 fi
1429 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1430 if test -n "$ac_ct_CC"; then
1431   echo "$as_me:1431: result: $ac_ct_CC" >&5
1432 echo "${ECHO_T}$ac_ct_CC" >&6
1433 else
1434   echo "$as_me:1434: result: no" >&5
1435 echo "${ECHO_T}no" >&6
1436 fi
1437
1438   test -n "$ac_ct_CC" && break
1439 done
1440
1441   CC=$ac_ct_CC
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo "$2"`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit "$ac_status"); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit "$ac_status"); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit "$ac_status"); }
1467
1468 cat >"conftest.$ac_ext" <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit "$ac_status"); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat "conftest.$ac_ext" >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit "$ac_status"); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe "conftest$ac_cv_exeext"
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit "$ac_status"); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f "conftest$ac_cv_exeext"
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f "conftest.$ac_ext"
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >"conftest.$ac_ext" <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit "$ac_status"); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat "conftest.$ac_ext" >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >"conftest.$ac_ext" <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f "conftest.$ac_objext"
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit "$ac_status"); } &&
1664          { ac_try='test -s "conftest.$ac_objext"'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit "$ac_status"); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat "conftest.$ac_ext" >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >"conftest.$ac_ext" <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f "conftest.$ac_objext"
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit "$ac_status"); } &&
1709          { ac_try='test -s "conftest.$ac_objext"'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit "$ac_status"); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat "conftest.$ac_ext" >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >"conftest.$ac_ext" <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f "conftest.$ac_objext"
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit "$ac_status"); } &&
1755          { ac_try='test -s "conftest.$ac_objext"'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit "$ac_status"); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >"conftest.$ac_ext" <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f "conftest.$ac_objext"
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit "$ac_status"); } &&
1789          { ac_try='test -s "conftest.$ac_objext"'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit "$ac_status"); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat "conftest.$ac_ext" >&5
1799 continue
1800 fi
1801 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1802   cat >"conftest.$ac_ext" <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f "conftest.$ac_objext"
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit "$ac_status"); } &&
1820          { ac_try='test -s "conftest.$ac_objext"'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit "$ac_status"); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat "conftest.$ac_ext" >&5
1830 fi
1831 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo "$ac_declaration"    >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat "conftest.$ac_ext" >&5
1843 fi
1844 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1848 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return="return"
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case "$host_os" in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >"conftest.$ac_ext" <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 #error __INTEL_COMPILER is not defined
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 #error __clang__ is not defined
1932 #endif
1933
1934   ;
1935   return 0;
1936 }
1937 _ACEOF
1938 rm -f "conftest.$ac_objext"
1939 if { (eval echo "$as_me:1939: \"$ac_compile\"") >&5
1940   (eval $ac_compile) 2>&5
1941   ac_status=$?
1942   echo "$as_me:1942: \$? = $ac_status" >&5
1943   (exit "$ac_status"); } &&
1944          { ac_try='test -s "conftest.$ac_objext"'
1945   { (eval echo "$as_me:1945: \"$ac_try\"") >&5
1946   (eval $ac_try) 2>&5
1947   ac_status=$?
1948   echo "$as_me:1948: \$? = $ac_status" >&5
1949   (exit "$ac_status"); }; }; then
1950   CLANG_COMPILER=yes
1951
1952 else
1953   echo "$as_me: failed program was:" >&5
1954 cat "conftest.$ac_ext" >&5
1955 fi
1956 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1957         CFLAGS="$cf_save_CFLAGS"
1958         echo "$as_me:1958: result: $CLANG_COMPILER" >&5
1959 echo "${ECHO_T}$CLANG_COMPILER" >&6
1960 fi
1961
1962 CLANG_VERSION=none
1963
1964 if test "x$CLANG_COMPILER" = "xyes" ; then
1965         case "$CC" in
1966         (c[1-9][0-9]|*/c[1-9][0-9])
1967                 { echo "$as_me:1967: WARNING: replacing broken compiler alias $CC" >&5
1968 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1969                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1970                 CC=clang
1971                 ;;
1972         esac
1973
1974         echo "$as_me:1974: checking version of $CC" >&5
1975 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1976         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1977         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1978         echo "$as_me:1978: result: $CLANG_VERSION" >&5
1979 echo "${ECHO_T}$CLANG_VERSION" >&6
1980
1981         for cf_clang_opt in \
1982                 -Qunused-arguments \
1983                 -Wno-error=implicit-function-declaration
1984         do
1985                 echo "$as_me:1985: checking if option $cf_clang_opt works" >&5
1986 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1987                 cf_save_CFLAGS="$CFLAGS"
1988                 CFLAGS="$CFLAGS $cf_clang_opt"
1989                 cat >"conftest.$ac_ext" <<_ACEOF
1990 #line 1990 "configure"
1991 #include "confdefs.h"
1992
1993                         #include <stdio.h>
1994 int
1995 main (void)
1996 {
1997
1998                         printf("hello!\\n");
1999   ;
2000   return 0;
2001 }
2002 _ACEOF
2003 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2004 if { (eval echo "$as_me:2004: \"$ac_link\"") >&5
2005   (eval $ac_link) 2>&5
2006   ac_status=$?
2007   echo "$as_me:2007: \$? = $ac_status" >&5
2008   (exit "$ac_status"); } &&
2009          { ac_try='test -s "conftest$ac_exeext"'
2010   { (eval echo "$as_me:2010: \"$ac_try\"") >&5
2011   (eval $ac_try) 2>&5
2012   ac_status=$?
2013   echo "$as_me:2013: \$? = $ac_status" >&5
2014   (exit "$ac_status"); }; }; then
2015
2016                         cf_clang_optok=yes
2017 else
2018   echo "$as_me: failed program was:" >&5
2019 cat "conftest.$ac_ext" >&5
2020
2021                         cf_clang_optok=no
2022 fi
2023 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2024                 echo "$as_me:2024: result: $cf_clang_optok" >&5
2025 echo "${ECHO_T}$cf_clang_optok" >&6
2026                 CFLAGS="$cf_save_CFLAGS"
2027                 if test "$cf_clang_optok" = yes; then
2028                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2029
2030 echo "${as_me:-configure}:2030: testing adding option $cf_clang_opt ..." 1>&5
2031
2032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2033         CFLAGS="${CFLAGS}$cf_clang_opt"
2034
2035                 fi
2036         done
2037 fi
2038
2039 echo "$as_me:2039: checking for $CC option to accept ANSI C" >&5
2040 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2041 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2042   echo $ECHO_N "(cached) $ECHO_C" >&6
2043 else
2044   ac_cv_prog_cc_stdc=no
2045 ac_save_CC=$CC
2046 cat >"conftest.$ac_ext" <<_ACEOF
2047 #line 2047 "configure"
2048 #include "confdefs.h"
2049 #include <stdarg.h>
2050 #include <stdio.h>
2051 #include <sys/types.h>
2052 #include <sys/stat.h>
2053 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2054 struct buf { int x; };
2055 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2056 static char *e (char **p, int i)
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 # if $PKG_CONFIG_LIBDIR is set, try to use that
3283 if test -n "$PKG_CONFIG_PATH"; then
3284         cf_search_path=`echo "$PKG_CONFIG_PATH" | sed -e 's/:/ /g' -e 's,^[     ]*,,' -e 's,[   ]*$,,'`
3285 elif test -n "$PKG_CONFIG_LIBDIR"; then
3286         cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,' -e 's,[   ]*$,,'`
3287 else
3288         cf_search_path=auto
3289 fi
3290
3291 # if the option is used, let that override.  otherwise default to "libdir"
3292
3293 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3294 if test "${with_pkg_config_libdir+set}" = set; then
3295   withval="$with_pkg_config_libdir"
3296   cf_search_path=$withval
3297 else
3298   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3299 fi;
3300
3301 case "x$cf_search_path" in
3302 (xlibdir)
3303         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3304         echo "$as_me:3304: result: $PKG_CONFIG_LIBDIR" >&5
3305 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3306         cf_search_path=
3307         ;;
3308 (x)
3309         ;;
3310 (x/*\ *)
3311         PKG_CONFIG_LIBDIR=
3312         ;;
3313 (x/*)
3314         PKG_CONFIG_LIBDIR="$cf_search_path"
3315         echo "$as_me:3315: result: $PKG_CONFIG_LIBDIR" >&5
3316 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3317         cf_search_path=
3318         ;;
3319 (xyes|xauto)
3320         echo "$as_me:3320: result: auto" >&5
3321 echo "${ECHO_T}auto" >&6
3322         cf_search_path=
3323         # Look for the library directory using the same prefix as the executable
3324         echo "$as_me:3324: checking for search-list" >&5
3325 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3326         if test "x$PKG_CONFIG" != xnone
3327         then
3328                 # works for pkg-config since version 0.24 (2009)
3329                 # works for pkgconf since version 0.8.3 (2012)
3330                 for cf_pkg_program in \
3331                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3332                         pkg-config \
3333                         pkgconf
3334                 do
3335                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3336                         test -n "$cf_search_path" && break
3337                 done
3338
3339                 # works for pkg-config since import in 2005 of original 2001 HP code.
3340                 test -z "$cf_search_path" && \
3341                 cf_search_path=`
3342                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3343 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3344         sub(\"^[^']*'\",\"\"); \
3345         sub(\"'.*\",\"\"); \
3346         printf \" %s\", \\$0; } \
3347 { next; } \
3348 "`
3349         fi
3350
3351         echo "$as_me:3351: result: $cf_search_path" >&5
3352 echo "${ECHO_T}$cf_search_path" >&6
3353         ;;
3354 (*)
3355         { { echo "$as_me:3355: error: Unexpected option value: $cf_search_path" >&5
3356 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3357    { (exit 1); exit 1; }; }
3358         ;;
3359 esac
3360
3361 if test -n "$cf_search_path"
3362 then
3363         echo "$as_me:3363: checking for first directory" >&5
3364 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3365         cf_pkg_config_path=none
3366         for cf_config in $cf_search_path
3367         do
3368                 if test -d "$cf_config"
3369                 then
3370                         cf_pkg_config_path=$cf_config
3371                         break
3372                 fi
3373         done
3374         echo "$as_me:3374: result: $cf_pkg_config_path" >&5
3375 echo "${ECHO_T}$cf_pkg_config_path" >&6
3376
3377         if test "x$cf_pkg_config_path" != xnone ; then
3378                 # limit this to the first directory found
3379                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3380         fi
3381
3382         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3383         then
3384                 echo "$as_me:3384: checking for workaround" >&5
3385 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3386                 if test "$prefix" = "NONE" ; then
3387                         cf_prefix="$ac_default_prefix"
3388                 else
3389                         cf_prefix="$prefix"
3390                 fi
3391                 eval cf_libdir=$libdir
3392                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3393                 cf_backup=
3394                 for cf_config in $cf_search_path
3395                 do
3396                         case $cf_config in
3397                         $cf_libdir/pkgconfig)
3398                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3399                                 break
3400                                 ;;
3401                         *)
3402                                 test -z "$cf_backup" && cf_backup=$cf_config
3403                                 ;;
3404                         esac
3405                 done
3406                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3407                 echo "$as_me:3407: result: $PKG_CONFIG_LIBDIR" >&5
3408 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3409         fi
3410 fi
3411
3412 echo "$as_me:3412: checking if you want to build test-programs" >&5
3413 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3414
3415 # Check whether --with-tests or --without-tests was given.
3416 if test "${with_tests+set}" = set; then
3417   withval="$with_tests"
3418   cf_with_tests=$withval
3419 else
3420   cf_with_tests=yes
3421 fi;
3422 echo "$as_me:3422: result: $cf_with_tests" >&5
3423 echo "${ECHO_T}$cf_with_tests" >&6
3424
3425 echo "$as_me:3425: checking if we should assume mixed-case filenames" >&5
3426 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3427
3428 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3429 if test "${enable_mixed_case+set}" = set; then
3430   enableval="$enable_mixed_case"
3431   enable_mixedcase=$enableval
3432 else
3433   enable_mixedcase=auto
3434 fi;
3435 echo "$as_me:3435: result: $enable_mixedcase" >&5
3436 echo "${ECHO_T}$enable_mixedcase" >&6
3437 if test "$enable_mixedcase" = "auto" ; then
3438
3439 echo "$as_me:3439: checking if filesystem supports mixed-case filenames" >&5
3440 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3441 if test "${cf_cv_mixedcase+set}" = set; then
3442   echo $ECHO_N "(cached) $ECHO_C" >&6
3443 else
3444
3445 if test "$cross_compiling" = yes ; then
3446         case "$target_alias" in
3447         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3448                 cf_cv_mixedcase=no
3449                 ;;
3450         (*)
3451                 cf_cv_mixedcase=yes
3452                 ;;
3453         esac
3454 else
3455         rm -f conftest CONFTEST
3456         echo test >conftest
3457         if test -f CONFTEST ; then
3458                 cf_cv_mixedcase=no
3459         else
3460                 cf_cv_mixedcase=yes
3461         fi
3462         rm -f conftest CONFTEST
3463 fi
3464
3465 fi
3466 echo "$as_me:3466: result: $cf_cv_mixedcase" >&5
3467 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3468 test "$cf_cv_mixedcase" = yes &&
3469 cat >>confdefs.h <<\EOF
3470 #define MIXEDCASE_FILENAMES 1
3471 EOF
3472
3473 else
3474         cf_cv_mixedcase=$enable_mixedcase
3475         if test "$enable_mixedcase" = "yes" ; then
3476                 cat >>confdefs.h <<\EOF
3477 #define MIXEDCASE_FILENAMES 1
3478 EOF
3479
3480         fi
3481 fi
3482
3483 # do this after mixed-case option (tags/TAGS is not as important as tic).
3484 echo "$as_me:3484: checking whether ${MAKE-make} sets \${MAKE}" >&5
3485 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3486 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3487 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3488   echo $ECHO_N "(cached) $ECHO_C" >&6
3489 else
3490   cat >conftest.make <<\EOF
3491 all:
3492         @echo 'ac_maketemp="${MAKE}"'
3493 EOF
3494 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3495 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3496 if test -n "$ac_maketemp"; then
3497   eval ac_cv_prog_make_${ac_make}_set=yes
3498 else
3499   eval ac_cv_prog_make_${ac_make}_set=no
3500 fi
3501 rm -f conftest.make
3502 fi
3503 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3504   echo "$as_me:3504: result: yes" >&5
3505 echo "${ECHO_T}yes" >&6
3506   SET_MAKE=
3507 else
3508   echo "$as_me:3508: result: no" >&5
3509 echo "${ECHO_T}no" >&6
3510   SET_MAKE="MAKE=${MAKE-make}"
3511 fi
3512
3513 echo "$as_me:3513: checking for \".PHONY\" make-support" >&5
3514 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3515 if test "${cf_cv_make_PHONY+set}" = set; then
3516   echo $ECHO_N "(cached) $ECHO_C" >&6
3517 else
3518
3519         rm -rf conftest*
3520         (
3521                 mkdir conftest || exit 1
3522                 cd conftest
3523                 cat >makefile <<'CF_EOF'
3524 .PHONY: always
3525 DATA=0
3526 always: always.out
3527         @echo "** making $@ $(DATA)"
3528 once: once.out
3529         @echo "** making $@ $(DATA)"
3530 always.out:
3531         @echo "** making $@ $(DATA)"
3532         echo $(DATA) > $@
3533 once.out:
3534         @echo "** making $@ $(DATA)"
3535         echo $(DATA) > $@
3536 CF_EOF
3537                 for cf_data in 1 2 3
3538                 do
3539                         ${MAKE:-make} always DATA=$cf_data
3540                         ${MAKE:-make} once   DATA=$cf_data
3541                         ${MAKE:-make} -t always once
3542                         if test -f always ; then
3543                                 echo "no (case 1)" > ../conftest.tmp
3544                         elif test ! -f always.out ; then
3545                                 echo "no (case 2)" > ../conftest.tmp
3546                         elif test ! -f once.out ; then
3547                                 echo "no (case 3)" > ../conftest.tmp
3548                         elif ! cmp -s always.out once.out ; then
3549                                 echo "no (case 4)" > ../conftest.tmp
3550                                 diff always.out once.out
3551                         else
3552                                 cf_check="`cat always.out`"
3553                                 if test "x$cf_check" != "x$cf_data" ; then
3554                                         echo "no (case 5)" > ../conftest.tmp
3555                                 else
3556                                         echo yes > ../conftest.tmp
3557                                         rm -f ./*.out
3558                                         continue
3559                                 fi
3560                         fi
3561                         break
3562                 done
3563         ) >&5 2>&1
3564         cf_cv_make_PHONY="`cat conftest.tmp`"
3565         rm -rf conftest*
3566
3567 fi
3568 echo "$as_me:3568: result: $cf_cv_make_PHONY" >&5
3569 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3570 MAKE_NO_PHONY="#"
3571 MAKE_PHONY="#"
3572 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3573 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3574
3575 for ac_prog in exctags ctags
3576 do
3577   # Extract the first word of "$ac_prog", so it can be a program name with args.
3578 set dummy $ac_prog; ac_word=$2
3579 echo "$as_me:3579: checking for $ac_word" >&5
3580 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3581 if test "${ac_cv_prog_CTAGS+set}" = set; then
3582   echo $ECHO_N "(cached) $ECHO_C" >&6
3583 else
3584   if test -n "$CTAGS"; then
3585   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3586 else
3587   ac_save_IFS=$IFS; IFS=$ac_path_separator
3588 ac_dummy="$PATH"
3589 for ac_dir in $ac_dummy; do
3590   IFS=$ac_save_IFS
3591   test -z "$ac_dir" && ac_dir=.
3592   $as_executable_p "$ac_dir/$ac_word" || continue
3593 ac_cv_prog_CTAGS="$ac_prog"
3594 echo "$as_me:3594: found $ac_dir/$ac_word" >&5
3595 break
3596 done
3597
3598 fi
3599 fi
3600 CTAGS=$ac_cv_prog_CTAGS
3601 if test -n "$CTAGS"; then
3602   echo "$as_me:3602: result: $CTAGS" >&5
3603 echo "${ECHO_T}$CTAGS" >&6
3604 else
3605   echo "$as_me:3605: result: no" >&5
3606 echo "${ECHO_T}no" >&6
3607 fi
3608
3609   test -n "$CTAGS" && break
3610 done
3611
3612 for ac_prog in exetags etags
3613 do
3614   # Extract the first word of "$ac_prog", so it can be a program name with args.
3615 set dummy $ac_prog; ac_word=$2
3616 echo "$as_me:3616: checking for $ac_word" >&5
3617 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3618 if test "${ac_cv_prog_ETAGS+set}" = set; then
3619   echo $ECHO_N "(cached) $ECHO_C" >&6
3620 else
3621   if test -n "$ETAGS"; then
3622   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3623 else
3624   ac_save_IFS=$IFS; IFS=$ac_path_separator
3625 ac_dummy="$PATH"
3626 for ac_dir in $ac_dummy; do
3627   IFS=$ac_save_IFS
3628   test -z "$ac_dir" && ac_dir=.
3629   $as_executable_p "$ac_dir/$ac_word" || continue
3630 ac_cv_prog_ETAGS="$ac_prog"
3631 echo "$as_me:3631: found $ac_dir/$ac_word" >&5
3632 break
3633 done
3634
3635 fi
3636 fi
3637 ETAGS=$ac_cv_prog_ETAGS
3638 if test -n "$ETAGS"; then
3639   echo "$as_me:3639: result: $ETAGS" >&5
3640 echo "${ECHO_T}$ETAGS" >&6
3641 else
3642   echo "$as_me:3642: result: no" >&5
3643 echo "${ECHO_T}no" >&6
3644 fi
3645
3646   test -n "$ETAGS" && break
3647 done
3648
3649 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3650 set dummy ${CTAGS:-ctags}; ac_word=$2
3651 echo "$as_me:3651: checking for $ac_word" >&5
3652 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3653 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3654   echo $ECHO_N "(cached) $ECHO_C" >&6
3655 else
3656   if test -n "$MAKE_LOWER_TAGS"; then
3657   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3658 else
3659   ac_save_IFS=$IFS; IFS=$ac_path_separator
3660 ac_dummy="$PATH"
3661 for ac_dir in $ac_dummy; do
3662   IFS=$ac_save_IFS
3663   test -z "$ac_dir" && ac_dir=.
3664   $as_executable_p "$ac_dir/$ac_word" || continue
3665 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3666 echo "$as_me:3666: found $ac_dir/$ac_word" >&5
3667 break
3668 done
3669
3670   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3671 fi
3672 fi
3673 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3674 if test -n "$MAKE_LOWER_TAGS"; then
3675   echo "$as_me:3675: result: $MAKE_LOWER_TAGS" >&5
3676 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3677 else
3678   echo "$as_me:3678: result: no" >&5
3679 echo "${ECHO_T}no" >&6
3680 fi
3681
3682 if test "$cf_cv_mixedcase" = yes ; then
3683         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3684 set dummy ${ETAGS:-etags}; ac_word=$2
3685 echo "$as_me:3685: checking for $ac_word" >&5
3686 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3687 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3688   echo $ECHO_N "(cached) $ECHO_C" >&6
3689 else
3690   if test -n "$MAKE_UPPER_TAGS"; then
3691   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3692 else
3693   ac_save_IFS=$IFS; IFS=$ac_path_separator
3694 ac_dummy="$PATH"
3695 for ac_dir in $ac_dummy; do
3696   IFS=$ac_save_IFS
3697   test -z "$ac_dir" && ac_dir=.
3698   $as_executable_p "$ac_dir/$ac_word" || continue
3699 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3700 echo "$as_me:3700: found $ac_dir/$ac_word" >&5
3701 break
3702 done
3703
3704   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3705 fi
3706 fi
3707 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3708 if test -n "$MAKE_UPPER_TAGS"; then
3709   echo "$as_me:3709: result: $MAKE_UPPER_TAGS" >&5
3710 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3711 else
3712   echo "$as_me:3712: result: no" >&5
3713 echo "${ECHO_T}no" >&6
3714 fi
3715
3716 else
3717         MAKE_UPPER_TAGS=no
3718 fi
3719
3720 if test "$MAKE_UPPER_TAGS" = yes ; then
3721         MAKE_UPPER_TAGS=
3722 else
3723         MAKE_UPPER_TAGS="#"
3724 fi
3725
3726 if test "$MAKE_LOWER_TAGS" = yes ; then
3727         MAKE_LOWER_TAGS=
3728 else
3729         MAKE_LOWER_TAGS="#"
3730 fi
3731
3732 echo "$as_me:3732: checking for makeflags variable" >&5
3733 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3734 if test "${cf_cv_makeflags+set}" = set; then
3735   echo $ECHO_N "(cached) $ECHO_C" >&6
3736 else
3737
3738         cf_cv_makeflags=''
3739         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3740         do
3741                 cat >cf_makeflags.tmp <<CF_EOF
3742 SHELL = $SHELL
3743 all :
3744         @ echo '.$cf_option'
3745 CF_EOF
3746                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3747                 case "$cf_result" in
3748                 (.*k|.*kw)
3749                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3750                         case "$cf_result" in
3751                         (.*CC=*)        cf_cv_makeflags=
3752                                 ;;
3753                         (*)     cf_cv_makeflags=$cf_option
3754                                 ;;
3755                         esac
3756                         break
3757                         ;;
3758                 (.-)
3759                         ;;
3760                 (*)
3761
3762 echo "${as_me:-configure}:3762: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3763
3764                         ;;
3765                 esac
3766         done
3767         rm -f cf_makeflags.tmp
3768
3769 fi
3770 echo "$as_me:3770: result: $cf_cv_makeflags" >&5
3771 echo "${ECHO_T}$cf_cv_makeflags" >&6
3772
3773 if test -n "$ac_tool_prefix"; then
3774   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3775 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3776 echo "$as_me:3776: checking for $ac_word" >&5
3777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3778 if test "${ac_cv_prog_RANLIB+set}" = set; then
3779   echo $ECHO_N "(cached) $ECHO_C" >&6
3780 else
3781   if test -n "$RANLIB"; then
3782   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3783 else
3784   ac_save_IFS=$IFS; IFS=$ac_path_separator
3785 ac_dummy="$PATH"
3786 for ac_dir in $ac_dummy; do
3787   IFS=$ac_save_IFS
3788   test -z "$ac_dir" && ac_dir=.
3789   $as_executable_p "$ac_dir/$ac_word" || continue
3790 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3791 echo "$as_me:3791: found $ac_dir/$ac_word" >&5
3792 break
3793 done
3794
3795 fi
3796 fi
3797 RANLIB=$ac_cv_prog_RANLIB
3798 if test -n "$RANLIB"; then
3799   echo "$as_me:3799: result: $RANLIB" >&5
3800 echo "${ECHO_T}$RANLIB" >&6
3801 else
3802   echo "$as_me:3802: result: no" >&5
3803 echo "${ECHO_T}no" >&6
3804 fi
3805
3806 fi
3807 if test -z "$ac_cv_prog_RANLIB"; then
3808   ac_ct_RANLIB=$RANLIB
3809   # Extract the first word of "ranlib", so it can be a program name with args.
3810 set dummy ranlib; ac_word=$2
3811 echo "$as_me:3811: checking for $ac_word" >&5
3812 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3813 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3814   echo $ECHO_N "(cached) $ECHO_C" >&6
3815 else
3816   if test -n "$ac_ct_RANLIB"; then
3817   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3818 else
3819   ac_save_IFS=$IFS; IFS=$ac_path_separator
3820 ac_dummy="$PATH"
3821 for ac_dir in $ac_dummy; do
3822   IFS=$ac_save_IFS
3823   test -z "$ac_dir" && ac_dir=.
3824   $as_executable_p "$ac_dir/$ac_word" || continue
3825 ac_cv_prog_ac_ct_RANLIB="ranlib"
3826 echo "$as_me:3826: found $ac_dir/$ac_word" >&5
3827 break
3828 done
3829
3830   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3831 fi
3832 fi
3833 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3834 if test -n "$ac_ct_RANLIB"; then
3835   echo "$as_me:3835: result: $ac_ct_RANLIB" >&5
3836 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3837 else
3838   echo "$as_me:3838: result: no" >&5
3839 echo "${ECHO_T}no" >&6
3840 fi
3841
3842   RANLIB=$ac_ct_RANLIB
3843 else
3844   RANLIB="$ac_cv_prog_RANLIB"
3845 fi
3846
3847 if test -n "$ac_tool_prefix"; then
3848   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3849 set dummy ${ac_tool_prefix}ld; ac_word=$2
3850 echo "$as_me:3850: checking for $ac_word" >&5
3851 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3852 if test "${ac_cv_prog_LD+set}" = set; then
3853   echo $ECHO_N "(cached) $ECHO_C" >&6
3854 else
3855   if test -n "$LD"; then
3856   ac_cv_prog_LD="$LD" # Let the user override the test.
3857 else
3858   ac_save_IFS=$IFS; IFS=$ac_path_separator
3859 ac_dummy="$PATH"
3860 for ac_dir in $ac_dummy; do
3861   IFS=$ac_save_IFS
3862   test -z "$ac_dir" && ac_dir=.
3863   $as_executable_p "$ac_dir/$ac_word" || continue
3864 ac_cv_prog_LD="${ac_tool_prefix}ld"
3865 echo "$as_me:3865: found $ac_dir/$ac_word" >&5
3866 break
3867 done
3868
3869 fi
3870 fi
3871 LD=$ac_cv_prog_LD
3872 if test -n "$LD"; then
3873   echo "$as_me:3873: result: $LD" >&5
3874 echo "${ECHO_T}$LD" >&6
3875 else
3876   echo "$as_me:3876: result: no" >&5
3877 echo "${ECHO_T}no" >&6
3878 fi
3879
3880 fi
3881 if test -z "$ac_cv_prog_LD"; then
3882   ac_ct_LD=$LD
3883   # Extract the first word of "ld", so it can be a program name with args.
3884 set dummy ld; ac_word=$2
3885 echo "$as_me:3885: checking for $ac_word" >&5
3886 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3887 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3888   echo $ECHO_N "(cached) $ECHO_C" >&6
3889 else
3890   if test -n "$ac_ct_LD"; then
3891   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3892 else
3893   ac_save_IFS=$IFS; IFS=$ac_path_separator
3894 ac_dummy="$PATH"
3895 for ac_dir in $ac_dummy; do
3896   IFS=$ac_save_IFS
3897   test -z "$ac_dir" && ac_dir=.
3898   $as_executable_p "$ac_dir/$ac_word" || continue
3899 ac_cv_prog_ac_ct_LD="ld"
3900 echo "$as_me:3900: found $ac_dir/$ac_word" >&5
3901 break
3902 done
3903
3904   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3905 fi
3906 fi
3907 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3908 if test -n "$ac_ct_LD"; then
3909   echo "$as_me:3909: result: $ac_ct_LD" >&5
3910 echo "${ECHO_T}$ac_ct_LD" >&6
3911 else
3912   echo "$as_me:3912: result: no" >&5
3913 echo "${ECHO_T}no" >&6
3914 fi
3915
3916   LD=$ac_ct_LD
3917 else
3918   LD="$ac_cv_prog_LD"
3919 fi
3920
3921 if test -n "$ac_tool_prefix"; then
3922   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3923 set dummy ${ac_tool_prefix}ar; ac_word=$2
3924 echo "$as_me:3924: checking for $ac_word" >&5
3925 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3926 if test "${ac_cv_prog_AR+set}" = set; then
3927   echo $ECHO_N "(cached) $ECHO_C" >&6
3928 else
3929   if test -n "$AR"; then
3930   ac_cv_prog_AR="$AR" # Let the user override the test.
3931 else
3932   ac_save_IFS=$IFS; IFS=$ac_path_separator
3933 ac_dummy="$PATH"
3934 for ac_dir in $ac_dummy; do
3935   IFS=$ac_save_IFS
3936   test -z "$ac_dir" && ac_dir=.
3937   $as_executable_p "$ac_dir/$ac_word" || continue
3938 ac_cv_prog_AR="${ac_tool_prefix}ar"
3939 echo "$as_me:3939: found $ac_dir/$ac_word" >&5
3940 break
3941 done
3942
3943 fi
3944 fi
3945 AR=$ac_cv_prog_AR
3946 if test -n "$AR"; then
3947   echo "$as_me:3947: result: $AR" >&5
3948 echo "${ECHO_T}$AR" >&6
3949 else
3950   echo "$as_me:3950: result: no" >&5
3951 echo "${ECHO_T}no" >&6
3952 fi
3953
3954 fi
3955 if test -z "$ac_cv_prog_AR"; then
3956   ac_ct_AR=$AR
3957   # Extract the first word of "ar", so it can be a program name with args.
3958 set dummy ar; ac_word=$2
3959 echo "$as_me:3959: checking for $ac_word" >&5
3960 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3961 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3962   echo $ECHO_N "(cached) $ECHO_C" >&6
3963 else
3964   if test -n "$ac_ct_AR"; then
3965   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3966 else
3967   ac_save_IFS=$IFS; IFS=$ac_path_separator
3968 ac_dummy="$PATH"
3969 for ac_dir in $ac_dummy; do
3970   IFS=$ac_save_IFS
3971   test -z "$ac_dir" && ac_dir=.
3972   $as_executable_p "$ac_dir/$ac_word" || continue
3973 ac_cv_prog_ac_ct_AR="ar"
3974 echo "$as_me:3974: found $ac_dir/$ac_word" >&5
3975 break
3976 done
3977
3978   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3979 fi
3980 fi
3981 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3982 if test -n "$ac_ct_AR"; then
3983   echo "$as_me:3983: result: $ac_ct_AR" >&5
3984 echo "${ECHO_T}$ac_ct_AR" >&6
3985 else
3986   echo "$as_me:3986: result: no" >&5
3987 echo "${ECHO_T}no" >&6
3988 fi
3989
3990   AR=$ac_ct_AR
3991 else
3992   AR="$ac_cv_prog_AR"
3993 fi
3994
3995 if test -n "$ac_tool_prefix"; then
3996   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3997 set dummy ${ac_tool_prefix}ar; ac_word=$2
3998 echo "$as_me:3998: checking for $ac_word" >&5
3999 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4000 if test "${ac_cv_prog_AR+set}" = set; then
4001   echo $ECHO_N "(cached) $ECHO_C" >&6
4002 else
4003   if test -n "$AR"; then
4004   ac_cv_prog_AR="$AR" # Let the user override the test.
4005 else
4006   ac_save_IFS=$IFS; IFS=$ac_path_separator
4007 ac_dummy="$PATH"
4008 for ac_dir in $ac_dummy; do
4009   IFS=$ac_save_IFS
4010   test -z "$ac_dir" && ac_dir=.
4011   $as_executable_p "$ac_dir/$ac_word" || continue
4012 ac_cv_prog_AR="${ac_tool_prefix}ar"
4013 echo "$as_me:4013: found $ac_dir/$ac_word" >&5
4014 break
4015 done
4016
4017 fi
4018 fi
4019 AR=$ac_cv_prog_AR
4020 if test -n "$AR"; then
4021   echo "$as_me:4021: result: $AR" >&5
4022 echo "${ECHO_T}$AR" >&6
4023 else
4024   echo "$as_me:4024: result: no" >&5
4025 echo "${ECHO_T}no" >&6
4026 fi
4027
4028 fi
4029 if test -z "$ac_cv_prog_AR"; then
4030   ac_ct_AR=$AR
4031   # Extract the first word of "ar", so it can be a program name with args.
4032 set dummy ar; ac_word=$2
4033 echo "$as_me:4033: checking for $ac_word" >&5
4034 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4035 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4036   echo $ECHO_N "(cached) $ECHO_C" >&6
4037 else
4038   if test -n "$ac_ct_AR"; then
4039   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4040 else
4041   ac_save_IFS=$IFS; IFS=$ac_path_separator
4042 ac_dummy="$PATH"
4043 for ac_dir in $ac_dummy; do
4044   IFS=$ac_save_IFS
4045   test -z "$ac_dir" && ac_dir=.
4046   $as_executable_p "$ac_dir/$ac_word" || continue
4047 ac_cv_prog_ac_ct_AR="ar"
4048 echo "$as_me:4048: found $ac_dir/$ac_word" >&5
4049 break
4050 done
4051
4052   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4053 fi
4054 fi
4055 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4056 if test -n "$ac_ct_AR"; then
4057   echo "$as_me:4057: result: $ac_ct_AR" >&5
4058 echo "${ECHO_T}$ac_ct_AR" >&6
4059 else
4060   echo "$as_me:4060: result: no" >&5
4061 echo "${ECHO_T}no" >&6
4062 fi
4063
4064   AR=$ac_ct_AR
4065 else
4066   AR="$ac_cv_prog_AR"
4067 fi
4068
4069 echo "$as_me:4069: checking for options to update archives" >&5
4070 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4071 if test "${cf_cv_ar_flags+set}" = set; then
4072   echo $ECHO_N "(cached) $ECHO_C" >&6
4073 else
4074
4075         case "$cf_cv_system_name" in
4076         (*-msvc*)
4077                 cf_cv_ar_flags=''
4078                 cat >mk_static_lib.sh <<-EOF
4079                 #!$SHELL
4080                 MSVC_BIN="$AR"
4081                 out="\$1"
4082                 shift
4083                 exec \$MSVC_BIN -out:"\$out" \$@
4084                 EOF
4085                 chmod +x mk_static_lib.sh
4086                 AR=`pwd`/mk_static_lib.sh
4087                 ;;
4088         (*)
4089                 cf_cv_ar_flags=unknown
4090                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4091                 do
4092
4093                         # check if $ARFLAGS already contains this choice
4094                         if test "x$ARFLAGS" != "x" ; then
4095                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4096                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4097                                         cf_cv_ar_flags=
4098                                         break
4099                                 fi
4100                         fi
4101
4102                         rm -f "conftest.$ac_cv_objext"
4103                         rm -f conftest.a
4104
4105                         cat >"conftest.$ac_ext" <<EOF
4106 #line 4106 "configure"
4107 int     testdata[3] = { 123, 456, 789 };
4108 EOF
4109                         if { (eval echo "$as_me:4109: \"$ac_compile\"") >&5
4110   (eval $ac_compile) 2>&5
4111   ac_status=$?
4112   echo "$as_me:4112: \$? = $ac_status" >&5
4113   (exit "$ac_status"); } ; then
4114                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4115                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4116                                 if test -f conftest.a ; then
4117                                         cf_cv_ar_flags="$cf_ar_flags"
4118                                         break
4119                                 fi
4120                         else
4121                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4122
4123 echo "${as_me:-configure}:4123: testing cannot compile test-program ..." 1>&5
4124
4125                                 break
4126                         fi
4127                 done
4128                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4129                 ;;
4130         esac
4131
4132 fi
4133 echo "$as_me:4133: result: $cf_cv_ar_flags" >&5
4134 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4135
4136 if test -n "$ARFLAGS" ; then
4137         if test -n "$cf_cv_ar_flags" ; then
4138                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4139         fi
4140 else
4141         ARFLAGS=$cf_cv_ar_flags
4142 fi
4143
4144         echo "$as_me:4144: checking for PATH separator" >&5
4145 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4146         case "$cf_cv_system_name" in
4147         (os2*)  PATH_SEPARATOR=';'  ;;
4148         (*)     ${PATH_SEPARATOR:=':'}  ;;
4149         esac
4150
4151         echo "$as_me:4151: result: $PATH_SEPARATOR" >&5
4152 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4153
4154 echo "$as_me:4154: checking if you have specified an install-prefix" >&5
4155 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4156
4157 # Check whether --with-install-prefix or --without-install-prefix was given.
4158 if test "${with_install_prefix+set}" = set; then
4159   withval="$with_install_prefix"
4160   case "$withval" in
4161         (yes|no)
4162                 ;;
4163         (*)     DESTDIR="$withval"
4164                 ;;
4165         esac
4166 fi;
4167 echo "$as_me:4167: result: $DESTDIR" >&5
4168 echo "${ECHO_T}$DESTDIR" >&6
4169
4170 ###############################################################################
4171
4172 # If we're cross-compiling, allow the user to override the tools and their
4173 # options.  The configure script is oriented toward identifying the host
4174 # compiler, etc., but we need a build compiler to generate parts of the source.
4175
4176 if test "$cross_compiling" = yes ; then
4177
4178         # defaults that we might want to override
4179         : ${BUILD_CFLAGS:=''}
4180         : ${BUILD_CPPFLAGS:=''}
4181         : ${BUILD_LDFLAGS:=''}
4182         : ${BUILD_LIBS:=''}
4183         : ${BUILD_EXEEXT:='$x'}
4184         : ${BUILD_OBJEXT:='o'}
4185
4186 # Check whether --with-build-cc or --without-build-cc was given.
4187 if test "${with_build_cc+set}" = set; then
4188   withval="$with_build_cc"
4189   BUILD_CC="$withval"
4190 else
4191   for ac_prog in gcc clang c99 c89 cc cl
4192 do
4193   # Extract the first word of "$ac_prog", so it can be a program name with args.
4194 set dummy $ac_prog; ac_word=$2
4195 echo "$as_me:4195: checking for $ac_word" >&5
4196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4197 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4198   echo $ECHO_N "(cached) $ECHO_C" >&6
4199 else
4200   if test -n "$BUILD_CC"; then
4201   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4202 else
4203   ac_save_IFS=$IFS; IFS=$ac_path_separator
4204 ac_dummy="$PATH"
4205 for ac_dir in $ac_dummy; do
4206   IFS=$ac_save_IFS
4207   test -z "$ac_dir" && ac_dir=.
4208   $as_executable_p "$ac_dir/$ac_word" || continue
4209 ac_cv_prog_BUILD_CC="$ac_prog"
4210 echo "$as_me:4210: found $ac_dir/$ac_word" >&5
4211 break
4212 done
4213
4214 fi
4215 fi
4216 BUILD_CC=$ac_cv_prog_BUILD_CC
4217 if test -n "$BUILD_CC"; then
4218   echo "$as_me:4218: result: $BUILD_CC" >&5
4219 echo "${ECHO_T}$BUILD_CC" >&6
4220 else
4221   echo "$as_me:4221: result: no" >&5
4222 echo "${ECHO_T}no" >&6
4223 fi
4224
4225   test -n "$BUILD_CC" && break
4226 done
4227 test -n "$BUILD_CC" || BUILD_CC="none"
4228
4229 fi;
4230         echo "$as_me:4230: checking for native build C compiler" >&5
4231 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4232         echo "$as_me:4232: result: $BUILD_CC" >&5
4233 echo "${ECHO_T}$BUILD_CC" >&6
4234
4235         echo "$as_me:4235: checking for native build C preprocessor" >&5
4236 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4237
4238 # Check whether --with-build-cpp or --without-build-cpp was given.
4239 if test "${with_build_cpp+set}" = set; then
4240   withval="$with_build_cpp"
4241   BUILD_CPP="$withval"
4242 else
4243   BUILD_CPP='${BUILD_CC} -E'
4244 fi;
4245         echo "$as_me:4245: result: $BUILD_CPP" >&5
4246 echo "${ECHO_T}$BUILD_CPP" >&6
4247
4248         echo "$as_me:4248: checking for native build C flags" >&5
4249 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4250
4251 # Check whether --with-build-cflags or --without-build-cflags was given.
4252 if test "${with_build_cflags+set}" = set; then
4253   withval="$with_build_cflags"
4254   BUILD_CFLAGS="$withval"
4255 fi;
4256         echo "$as_me:4256: result: $BUILD_CFLAGS" >&5
4257 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4258
4259         echo "$as_me:4259: checking for native build C preprocessor-flags" >&5
4260 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4261
4262 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4263 if test "${with_build_cppflags+set}" = set; then
4264   withval="$with_build_cppflags"
4265   BUILD_CPPFLAGS="$withval"
4266 fi;
4267         echo "$as_me:4267: result: $BUILD_CPPFLAGS" >&5
4268 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4269
4270         echo "$as_me:4270: checking for native build linker-flags" >&5
4271 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4272
4273 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4274 if test "${with_build_ldflags+set}" = set; then
4275   withval="$with_build_ldflags"
4276   BUILD_LDFLAGS="$withval"
4277 fi;
4278         echo "$as_me:4278: result: $BUILD_LDFLAGS" >&5
4279 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4280
4281         echo "$as_me:4281: checking for native build linker-libraries" >&5
4282 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4283
4284 # Check whether --with-build-libs or --without-build-libs was given.
4285 if test "${with_build_libs+set}" = set; then
4286   withval="$with_build_libs"
4287   BUILD_LIBS="$withval"
4288 fi;
4289         echo "$as_me:4289: result: $BUILD_LIBS" >&5
4290 echo "${ECHO_T}$BUILD_LIBS" >&6
4291
4292         # this assumes we're on Unix.
4293         BUILD_EXEEXT=
4294         BUILD_OBJEXT=o
4295
4296         : ${BUILD_CC:='${CC}'}
4297
4298         echo "$as_me:4298: checking if the build-compiler \"$BUILD_CC\" works" >&5
4299 echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4300
4301         cf_save_crossed=$cross_compiling
4302         cf_save_ac_link=$ac_link
4303         cross_compiling=no
4304         cf_build_cppflags=$BUILD_CPPFLAGS
4305         test "$cf_build_cppflags" = "#" && cf_build_cppflags=
4306         ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $cf_build_cppflags $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4307
4308         if test "$cross_compiling" = yes; then
4309   cf_ok_build_cc=unknown
4310 else
4311   cat >"conftest.$ac_ext" <<_ACEOF
4312 #line 4312 "configure"
4313 #include "confdefs.h"
4314 #include <stdio.h>
4315                 int main(int argc, char *argv[])
4316                 {
4317                         ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4318                 }
4319
4320 _ACEOF
4321 rm -f "conftest$ac_exeext"
4322 if { (eval echo "$as_me:4322: \"$ac_link\"") >&5
4323   (eval $ac_link) 2>&5
4324   ac_status=$?
4325   echo "$as_me:4325: \$? = $ac_status" >&5
4326   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4327   { (eval echo "$as_me:4327: \"$ac_try\"") >&5
4328   (eval $ac_try) 2>&5
4329   ac_status=$?
4330   echo "$as_me:4330: \$? = $ac_status" >&5
4331   (exit "$ac_status"); }; }; then
4332   cf_ok_build_cc=yes
4333 else
4334   echo "$as_me: program exited with status $ac_status" >&5
4335 echo "$as_me: failed program was:" >&5
4336 cat "conftest.$ac_ext" >&5
4337 cf_ok_build_cc=no
4338 fi
4339 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4340 fi
4341
4342         cross_compiling=$cf_save_crossed
4343         ac_link=$cf_save_ac_link
4344
4345         echo "$as_me:4345: result: $cf_ok_build_cc" >&5
4346 echo "${ECHO_T}$cf_ok_build_cc" >&6
4347
4348         if test "$cf_ok_build_cc" != yes
4349         then
4350                 { { echo "$as_me:4350: error: Cross-build requires two compilers.
4351 Use --with-build-cc to specify the native compiler." >&5
4352 echo "$as_me: error: Cross-build requires two compilers.
4353 Use --with-build-cc to specify the native compiler." >&2;}
4354    { (exit 1); exit 1; }; }
4355         fi
4356
4357 else
4358         : ${BUILD_CC:='${CC}'}
4359         : ${BUILD_CPP:='${CPP}'}
4360         : ${BUILD_CFLAGS:='${CFLAGS}'}
4361         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4362         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4363         : ${BUILD_LIBS:='${LIBS}'}
4364         : ${BUILD_EXEEXT:='$x'}
4365         : ${BUILD_OBJEXT:='o'}
4366 fi
4367
4368 ###############################################################################
4369
4370 ### Options to allow the user to specify the set of libraries which are used.
4371 ### Use "--without-normal --with-shared" to allow the default model to be
4372 ### shared, for example.
4373 cf_list_models=""
4374
4375 echo "$as_me:4375: checking if you want to build shared C-objects" >&5
4376 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4377
4378 # Check whether --with-shared or --without-shared was given.
4379 if test "${with_shared+set}" = set; then
4380   withval="$with_shared"
4381   with_shared=$withval
4382 else
4383   with_shared=no
4384 fi;
4385 echo "$as_me:4385: result: $with_shared" >&5
4386 echo "${ECHO_T}$with_shared" >&6
4387 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4388
4389 echo "$as_me:4389: checking for specified models" >&5
4390 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4391 test -z "$cf_list_models" && cf_list_models=normal
4392 echo "$as_me:4392: result: $cf_list_models" >&5
4393 echo "${ECHO_T}$cf_list_models" >&6
4394
4395 ### Use the first model as the default, and save its suffix for use in building
4396 ### up test-applications.
4397 echo "$as_me:4397: checking for default model" >&5
4398 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4399 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4400 echo "$as_me:4400: result: $DFT_LWR_MODEL" >&5
4401 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4402
4403 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4404
4405 echo "$as_me:4405: checking for specific curses-directory" >&5
4406 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4407
4408 # Check whether --with-curses-dir or --without-curses-dir was given.
4409 if test "${with_curses_dir+set}" = set; then
4410   withval="$with_curses_dir"
4411   cf_cv_curses_dir=$withval
4412 else
4413   cf_cv_curses_dir=no
4414 fi;
4415 echo "$as_me:4415: result: $cf_cv_curses_dir" >&5
4416 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4417
4418 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4419 then
4420
4421 if test "x$prefix" != xNONE; then
4422         cf_path_syntax="$prefix"
4423 else
4424         cf_path_syntax="$ac_default_prefix"
4425 fi
4426
4427 case ".$withval" in
4428 (.\$\(*\)*|.\'*\'*)
4429         ;;
4430 (..|./*|.\\*)
4431         ;;
4432 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4433         ;;
4434 (.\$\{*prefix\}*|.\$\{*dir\}*)
4435         eval withval="$withval"
4436         case ".$withval" in
4437         (.NONE/*)
4438                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4439                 ;;
4440         esac
4441         ;;
4442 (.no|.NONE/*)
4443         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4444         ;;
4445 (*)
4446         { { echo "$as_me:4446: error: expected a pathname, not \"$withval\"" >&5
4447 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4448    { (exit 1); exit 1; }; }
4449         ;;
4450 esac
4451
4452         if test -d "$cf_cv_curses_dir"
4453         then
4454
4455 if test -n "$cf_cv_curses_dir/include" ; then
4456   for cf_add_incdir in $cf_cv_curses_dir/include
4457   do
4458         while test "$cf_add_incdir" != /usr/include
4459         do
4460           if test -d "$cf_add_incdir"
4461           then
4462                 cf_have_incdir=no
4463                 if test -n "$CFLAGS$CPPFLAGS" ; then
4464                   # a loop is needed to ensure we can add subdirs of existing dirs
4465                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4466                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4467                           cf_have_incdir=yes; break
4468                         fi
4469                   done
4470                 fi
4471
4472                 if test "$cf_have_incdir" = no ; then
4473                   if test "$cf_add_incdir" = /usr/local/include ; then
4474                         if test "$GCC" = yes
4475                         then
4476                           cf_save_CPPFLAGS=$CPPFLAGS
4477
4478         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4479         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4480
4481                           cat >"conftest.$ac_ext" <<_ACEOF
4482 #line 4482 "configure"
4483 #include "confdefs.h"
4484 #include <stdio.h>
4485 int
4486 main (void)
4487 {
4488 printf("Hello")
4489   ;
4490   return 0;
4491 }
4492 _ACEOF
4493 rm -f "conftest.$ac_objext"
4494 if { (eval echo "$as_me:4494: \"$ac_compile\"") >&5
4495   (eval $ac_compile) 2>&5
4496   ac_status=$?
4497   echo "$as_me:4497: \$? = $ac_status" >&5
4498   (exit "$ac_status"); } &&
4499          { ac_try='test -s "conftest.$ac_objext"'
4500   { (eval echo "$as_me:4500: \"$ac_try\"") >&5
4501   (eval $ac_try) 2>&5
4502   ac_status=$?
4503   echo "$as_me:4503: \$? = $ac_status" >&5
4504   (exit "$ac_status"); }; }; then
4505   :
4506 else
4507   echo "$as_me: failed program was:" >&5
4508 cat "conftest.$ac_ext" >&5
4509 cf_have_incdir=yes
4510 fi
4511 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4512                           CPPFLAGS=$cf_save_CPPFLAGS
4513                         fi
4514                   fi
4515                 fi
4516
4517                 if test "$cf_have_incdir" = no ; then
4518                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4519
4520 echo "${as_me:-configure}:4520: testing adding $cf_add_incdir to include-path ..." 1>&5
4521
4522                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4523
4524                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4525                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4526                   cf_add_incdir="$cf_top_incdir"
4527                 else
4528                   break
4529                 fi
4530           else
4531                 break
4532           fi
4533         done
4534   done
4535 fi
4536
4537 if test -n "$cf_cv_curses_dir/lib" ; then
4538         for cf_add_libdir in $cf_cv_curses_dir/lib
4539         do
4540                 if test "$cf_add_libdir" = /usr/lib ; then
4541                         :
4542                 elif test -d "$cf_add_libdir"
4543                 then
4544                         cf_have_libdir=no
4545                         if test -n "$LDFLAGS$LIBS" ; then
4546                                 # a loop is needed to ensure we can add subdirs of existing dirs
4547                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4548                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4549                                                 cf_have_libdir=yes; break
4550                                         fi
4551                                 done
4552                         fi
4553                         if test "$cf_have_libdir" = no ; then
4554                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4555
4556 echo "${as_me:-configure}:4556: testing adding $cf_add_libdir to library-path ..." 1>&5
4557
4558                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4559                         fi
4560                 fi
4561         done
4562 fi
4563
4564         fi
4565 fi
4566
4567 cf_ncuconfig_root=ncurses
4568 cf_have_ncuconfig=no
4569
4570 if test "x${PKG_CONFIG:=none}" != xnone; then
4571         echo "$as_me:4571: checking pkg-config for $cf_ncuconfig_root" >&5
4572 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4573         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4574                 echo "$as_me:4574: result: yes" >&5
4575 echo "${ECHO_T}yes" >&6
4576
4577                 echo "$as_me:4577: checking if the $cf_ncuconfig_root package files work" >&5
4578 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4579                 cf_have_ncuconfig=unknown
4580
4581                 cf_save_CFLAGS="$CFLAGS"
4582                 cf_save_CPPFLAGS="$CPPFLAGS"
4583                 cf_save_LIBS="$LIBS"
4584
4585                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4586                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4587
4588                 # while -W for passing linker flags is prevalent, it is not "standard".
4589                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4590                 # incompatible _and_ non-standard -W option which gives an error.  Work
4591                 # around that pitfall.
4592                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4593                 (x*c[89]9@@*-W*)
4594
4595 cf_fix_cppflags=no
4596 cf_new_cflags=
4597 cf_new_cppflags=
4598 cf_new_extra_cppflags=
4599
4600 for cf_add_cflags in $cf_pkg_cflags
4601 do
4602 case "$cf_fix_cppflags" in
4603 (no)
4604         case "$cf_add_cflags" in
4605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4606                 case "$cf_add_cflags" in
4607                 (-D*)
4608                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4609
4610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4611                                 && test -z "${cf_tst_cflags}" \
4612                                 && cf_fix_cppflags=yes
4613
4614                         if test "$cf_fix_cppflags" = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
4621
4622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4624
4625                                 continue
4626                         fi
4627                         ;;
4628                 esac
4629                 case "$CPPFLAGS" in
4630                 (*$cf_add_cflags)
4631                         ;;
4632                 (*)
4633                         case "$cf_add_cflags" in
4634                         (-D*)
4635                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4636
4637 CPPFLAGS=`echo "$CPPFLAGS" | \
4638         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4639                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4640
4641                                 ;;
4642                         esac
4643
4644         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4645         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4646
4647                         ;;
4648                 esac
4649                 ;;
4650         (*)
4651
4652         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4653         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4654
4655                 ;;
4656         esac
4657         ;;
4658 (yes)
4659
4660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4662
4663         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4664
4665         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4666                 && test -z "${cf_tst_cflags}" \
4667                 && cf_fix_cppflags=no
4668         ;;
4669 esac
4670 done
4671
4672 if test -n "$cf_new_cflags" ; then
4673
4674         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4675         CFLAGS="${CFLAGS}$cf_new_cflags"
4676
4677 fi
4678
4679 if test -n "$cf_new_cppflags" ; then
4680
4681         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4682         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4683
4684 fi
4685
4686 if test -n "$cf_new_extra_cppflags" ; then
4687
4688         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4689         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4690
4691 fi
4692
4693 cf_add_libs="$LIBS"
4694 # reverse order
4695 cf_add_0lib=
4696 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4697 # filter duplicates
4698 for cf_add_1lib in $cf_add_0lib; do
4699         for cf_add_2lib in $cf_add_libs; do
4700                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4701                         cf_add_1lib=
4702                         break
4703                 fi
4704         done
4705         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4706 done
4707 LIBS="$cf_add_libs"
4708
4709                         cat >"conftest.$ac_ext" <<_ACEOF
4710 #line 4710 "configure"
4711 #include "confdefs.h"
4712 #include <${cf_cv_ncurses_header:-curses.h}>
4713 int
4714 main (void)
4715 {
4716 initscr(); mousemask(0,0); tigetstr((char *)0);
4717   ;
4718   return 0;
4719 }
4720 _ACEOF
4721 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4722 if { (eval echo "$as_me:4722: \"$ac_link\"") >&5
4723   (eval $ac_link) 2>&5
4724   ac_status=$?
4725   echo "$as_me:4725: \$? = $ac_status" >&5
4726   (exit "$ac_status"); } &&
4727          { ac_try='test -s "conftest$ac_exeext"'
4728   { (eval echo "$as_me:4728: \"$ac_try\"") >&5
4729   (eval $ac_try) 2>&5
4730   ac_status=$?
4731   echo "$as_me:4731: \$? = $ac_status" >&5
4732   (exit "$ac_status"); }; }; then
4733   if test "$cross_compiling" = yes; then
4734   cf_test_ncuconfig=maybe
4735 else
4736   cat >"conftest.$ac_ext" <<_ACEOF
4737 #line 4737 "configure"
4738 #include "confdefs.h"
4739 #include <${cf_cv_ncurses_header:-curses.h}>
4740                                         int main(void)
4741                                         { const char *xx = curses_version(); return (xx == 0); }
4742 _ACEOF
4743 rm -f "conftest$ac_exeext"
4744 if { (eval echo "$as_me:4744: \"$ac_link\"") >&5
4745   (eval $ac_link) 2>&5
4746   ac_status=$?
4747   echo "$as_me:4747: \$? = $ac_status" >&5
4748   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4749   { (eval echo "$as_me:4749: \"$ac_try\"") >&5
4750   (eval $ac_try) 2>&5
4751   ac_status=$?
4752   echo "$as_me:4752: \$? = $ac_status" >&5
4753   (exit "$ac_status"); }; }; then
4754   cf_test_ncuconfig=yes
4755 else
4756   echo "$as_me: program exited with status $ac_status" >&5
4757 echo "$as_me: failed program was:" >&5
4758 cat "conftest.$ac_ext" >&5
4759 cf_test_ncuconfig=no
4760 fi
4761 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4762 fi
4763 else
4764   echo "$as_me: failed program was:" >&5
4765 cat "conftest.$ac_ext" >&5
4766 cf_test_ncuconfig=no
4767 fi
4768 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4769
4770                         CFLAGS="$cf_save_CFLAGS"
4771                         CPPFLAGS="$cf_save_CPPFLAGS"
4772                         LIBS="$cf_save_LIBS"
4773
4774                         if test "x$cf_test_ncuconfig" != xyes; then
4775                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4776                                 cf_pkg_cflags="$cf_temp"
4777                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4778                                 cf_pkg_libs="$cf_temp"
4779                         fi
4780                         ;;
4781                 esac
4782
4783 for cf_add_cflags in $cf_pkg_cflags
4784 do
4785         case "x$cf_add_cflags" in
4786         (x-[DU]*)
4787
4788 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4789 while true
4790 do
4791         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'`
4792         test "$CFLAGS" != "$cf_old_cflag" || break
4793
4794         CFLAGS="$cf_old_cflag"
4795 done
4796
4797 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4798 while true
4799 do
4800         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'`
4801         test "$CPPFLAGS" != "$cf_old_cflag" || break
4802
4803         CPPFLAGS="$cf_old_cflag"
4804 done
4805
4806                 ;;
4807         esac
4808
4809 cf_fix_cppflags=no
4810 cf_new_cflags=
4811 cf_new_cppflags=
4812 cf_new_extra_cppflags=
4813
4814 for cf_add_cflags in $cf_add_cflags
4815 do
4816 case "$cf_fix_cppflags" in
4817 (no)
4818         case "$cf_add_cflags" in
4819         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4820                 case "$cf_add_cflags" in
4821                 (-D*)
4822                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4823
4824                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4825                                 && test -z "${cf_tst_cflags}" \
4826                                 && cf_fix_cppflags=yes
4827
4828                         if test "$cf_fix_cppflags" = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
4835
4836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4838
4839                                 continue
4840                         fi
4841                         ;;
4842                 esac
4843                 case "$CPPFLAGS" in
4844                 (*$cf_add_cflags)
4845                         ;;
4846                 (*)
4847                         case "$cf_add_cflags" in
4848                         (-D*)
4849                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4850
4851 CPPFLAGS=`echo "$CPPFLAGS" | \
4852         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4853                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4854
4855                                 ;;
4856                         esac
4857
4858         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4859         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4860
4861                         ;;
4862                 esac
4863                 ;;
4864         (*)
4865
4866         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4867         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4868
4869                 ;;
4870         esac
4871         ;;
4872 (yes)
4873
4874         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4875         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4876
4877         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4878
4879         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4880                 && test -z "${cf_tst_cflags}" \
4881                 && cf_fix_cppflags=no
4882         ;;
4883 esac
4884 done
4885
4886 if test -n "$cf_new_cflags" ; then
4887
4888         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4889         CFLAGS="${CFLAGS}$cf_new_cflags"
4890
4891 fi
4892
4893 if test -n "$cf_new_cppflags" ; then
4894
4895         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4896         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4897
4898 fi
4899
4900 if test -n "$cf_new_extra_cppflags" ; then
4901
4902         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4903         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4904
4905 fi
4906
4907 done
4908
4909 cf_add_libs="$LIBS"
4910 # reverse order
4911 cf_add_0lib=
4912 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4913 # filter duplicates
4914 for cf_add_1lib in $cf_add_0lib; do
4915         for cf_add_2lib in $cf_add_libs; do
4916                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4917                         cf_add_1lib=
4918                         break
4919                 fi
4920         done
4921         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4922 done
4923 LIBS="$cf_add_libs"
4924
4925                 cat >"conftest.$ac_ext" <<_ACEOF
4926 #line 4926 "configure"
4927 #include "confdefs.h"
4928 #include <${cf_cv_ncurses_header:-curses.h}>
4929 int
4930 main (void)
4931 {
4932 initscr(); mousemask(0,0); tigetstr((char *)0);
4933   ;
4934   return 0;
4935 }
4936 _ACEOF
4937 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4938 if { (eval echo "$as_me:4938: \"$ac_link\"") >&5
4939   (eval $ac_link) 2>&5
4940   ac_status=$?
4941   echo "$as_me:4941: \$? = $ac_status" >&5
4942   (exit "$ac_status"); } &&
4943          { ac_try='test -s "conftest$ac_exeext"'
4944   { (eval echo "$as_me:4944: \"$ac_try\"") >&5
4945   (eval $ac_try) 2>&5
4946   ac_status=$?
4947   echo "$as_me:4947: \$? = $ac_status" >&5
4948   (exit "$ac_status"); }; }; then
4949   if test "$cross_compiling" = yes; then
4950   cf_have_ncuconfig=maybe
4951 else
4952   cat >"conftest.$ac_ext" <<_ACEOF
4953 #line 4953 "configure"
4954 #include "confdefs.h"
4955 #include <${cf_cv_ncurses_header:-curses.h}>
4956                                 int main(void)
4957                                 { const char *xx = curses_version(); return (xx == 0); }
4958 _ACEOF
4959 rm -f "conftest$ac_exeext"
4960 if { (eval echo "$as_me:4960: \"$ac_link\"") >&5
4961   (eval $ac_link) 2>&5
4962   ac_status=$?
4963   echo "$as_me:4963: \$? = $ac_status" >&5
4964   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4965   { (eval echo "$as_me:4965: \"$ac_try\"") >&5
4966   (eval $ac_try) 2>&5
4967   ac_status=$?
4968   echo "$as_me:4968: \$? = $ac_status" >&5
4969   (exit "$ac_status"); }; }; then
4970   cf_have_ncuconfig=yes
4971 else
4972   echo "$as_me: program exited with status $ac_status" >&5
4973 echo "$as_me: failed program was:" >&5
4974 cat "conftest.$ac_ext" >&5
4975 cf_have_ncuconfig=no
4976 fi
4977 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4978 fi
4979 else
4980   echo "$as_me: failed program was:" >&5
4981 cat "conftest.$ac_ext" >&5
4982 cf_have_ncuconfig=no
4983 fi
4984 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4985                 echo "$as_me:4985: result: $cf_have_ncuconfig" >&5
4986 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4987                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4988                 if test "$cf_have_ncuconfig" != "yes"
4989                 then
4990                         CPPFLAGS="$cf_save_CPPFLAGS"
4991                         LIBS="$cf_save_LIBS"
4992                         NCURSES_CONFIG_PKG=none
4993                 else
4994
4995 cat >>confdefs.h <<\EOF
4996 #define NCURSES 1
4997 EOF
4998
4999                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5000
5001 echo "$as_me:5001: checking for terminfo header" >&5
5002 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5003 if test "${cf_cv_term_header+set}" = set; then
5004   echo $ECHO_N "(cached) $ECHO_C" >&6
5005 else
5006
5007 case "${cf_cv_ncurses_header}" in
5008 (*/ncurses.h|*/ncursesw.h)
5009         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5010         ;;
5011 (*)
5012         cf_term_header=term.h
5013         ;;
5014 esac
5015
5016 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5017 do
5018 cat >"conftest.$ac_ext" <<_ACEOF
5019 #line 5019 "configure"
5020 #include "confdefs.h"
5021 #include <stdio.h>
5022 #include <${cf_cv_ncurses_header:-curses.h}>
5023 #include <$cf_test>
5024
5025 int
5026 main (void)
5027 {
5028 int x = auto_left_margin; (void)x
5029   ;
5030   return 0;
5031 }
5032 _ACEOF
5033 rm -f "conftest.$ac_objext"
5034 if { (eval echo "$as_me:5034: \"$ac_compile\"") >&5
5035   (eval $ac_compile) 2>&5
5036   ac_status=$?
5037   echo "$as_me:5037: \$? = $ac_status" >&5
5038   (exit "$ac_status"); } &&
5039          { ac_try='test -s "conftest.$ac_objext"'
5040   { (eval echo "$as_me:5040: \"$ac_try\"") >&5
5041   (eval $ac_try) 2>&5
5042   ac_status=$?
5043   echo "$as_me:5043: \$? = $ac_status" >&5
5044   (exit "$ac_status"); }; }; then
5045
5046         cf_cv_term_header="$cf_test"
5047 else
5048   echo "$as_me: failed program was:" >&5
5049 cat "conftest.$ac_ext" >&5
5050
5051         cf_cv_term_header=unknown
5052
5053 fi
5054 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5055         test "$cf_cv_term_header" != unknown && break
5056 done
5057
5058 fi
5059 echo "$as_me:5059: result: $cf_cv_term_header" >&5
5060 echo "${ECHO_T}$cf_cv_term_header" >&6
5061
5062 # Set definitions to allow ifdef'ing to accommodate subdirectories
5063
5064 case "$cf_cv_term_header" in
5065 (*term.h)
5066
5067 cat >>confdefs.h <<\EOF
5068 #define HAVE_TERM_H 1
5069 EOF
5070
5071         ;;
5072 esac
5073
5074 case "$cf_cv_term_header" in
5075 (ncurses/term.h)
5076
5077 cat >>confdefs.h <<\EOF
5078 #define HAVE_NCURSES_TERM_H 1
5079 EOF
5080
5081         ;;
5082 (ncursesw/term.h)
5083
5084 cat >>confdefs.h <<\EOF
5085 #define HAVE_NCURSESW_TERM_H 1
5086 EOF
5087
5088         ;;
5089 esac
5090
5091                 fi
5092
5093         else
5094                 echo "$as_me:5094: result: no" >&5
5095 echo "${ECHO_T}no" >&6
5096                 NCURSES_CONFIG_PKG=none
5097         fi
5098 else
5099         NCURSES_CONFIG_PKG=none
5100 fi
5101
5102 if test "x$cf_have_ncuconfig" = "xno"; then
5103         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5104
5105 if test -n "$ac_tool_prefix"; then
5106   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5107   do
5108     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5109 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5110 echo "$as_me:5110: checking for $ac_word" >&5
5111 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5112 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5113   echo $ECHO_N "(cached) $ECHO_C" >&6
5114 else
5115   if test -n "$NCURSES_CONFIG"; then
5116   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5117 else
5118   ac_save_IFS=$IFS; IFS=$ac_path_separator
5119 ac_dummy="$PATH"
5120 for ac_dir in $ac_dummy; do
5121   IFS=$ac_save_IFS
5122   test -z "$ac_dir" && ac_dir=.
5123   $as_executable_p "$ac_dir/$ac_word" || continue
5124 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5125 echo "$as_me:5125: found $ac_dir/$ac_word" >&5
5126 break
5127 done
5128
5129 fi
5130 fi
5131 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5132 if test -n "$NCURSES_CONFIG"; then
5133   echo "$as_me:5133: result: $NCURSES_CONFIG" >&5
5134 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5135 else
5136   echo "$as_me:5136: result: no" >&5
5137 echo "${ECHO_T}no" >&6
5138 fi
5139
5140     test -n "$NCURSES_CONFIG" && break
5141   done
5142 fi
5143 if test -z "$NCURSES_CONFIG"; then
5144   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5145   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5146 do
5147   # Extract the first word of "$ac_prog", so it can be a program name with args.
5148 set dummy $ac_prog; ac_word=$2
5149 echo "$as_me:5149: checking for $ac_word" >&5
5150 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5151 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5152   echo $ECHO_N "(cached) $ECHO_C" >&6
5153 else
5154   if test -n "$ac_ct_NCURSES_CONFIG"; then
5155   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5156 else
5157   ac_save_IFS=$IFS; IFS=$ac_path_separator
5158 ac_dummy="$PATH"
5159 for ac_dir in $ac_dummy; do
5160   IFS=$ac_save_IFS
5161   test -z "$ac_dir" && ac_dir=.
5162   $as_executable_p "$ac_dir/$ac_word" || continue
5163 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5164 echo "$as_me:5164: found $ac_dir/$ac_word" >&5
5165 break
5166 done
5167
5168 fi
5169 fi
5170 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5171 if test -n "$ac_ct_NCURSES_CONFIG"; then
5172   echo "$as_me:5172: result: $ac_ct_NCURSES_CONFIG" >&5
5173 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5174 else
5175   echo "$as_me:5175: result: no" >&5
5176 echo "${ECHO_T}no" >&6
5177 fi
5178
5179   test -n "$ac_ct_NCURSES_CONFIG" && break
5180 done
5181 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5182
5183   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5184 fi
5185
5186         if test "$NCURSES_CONFIG" != none ; then
5187
5188 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5189 do
5190         case "x$cf_add_cflags" in
5191         (x-[DU]*)
5192
5193 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5194 while true
5195 do
5196         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'`
5197         test "$CFLAGS" != "$cf_old_cflag" || break
5198
5199         CFLAGS="$cf_old_cflag"
5200 done
5201
5202 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5203 while true
5204 do
5205         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'`
5206         test "$CPPFLAGS" != "$cf_old_cflag" || break
5207
5208         CPPFLAGS="$cf_old_cflag"
5209 done
5210
5211                 ;;
5212         esac
5213
5214 cf_fix_cppflags=no
5215 cf_new_cflags=
5216 cf_new_cppflags=
5217 cf_new_extra_cppflags=
5218
5219 for cf_add_cflags in $cf_add_cflags
5220 do
5221 case "$cf_fix_cppflags" in
5222 (no)
5223         case "$cf_add_cflags" in
5224         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5225                 case "$cf_add_cflags" in
5226                 (-D*)
5227                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5228
5229                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5230                                 && test -z "${cf_tst_cflags}" \
5231                                 && cf_fix_cppflags=yes
5232
5233                         if test "$cf_fix_cppflags" = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
5240
5241         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5242         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5243
5244                                 continue
5245                         fi
5246                         ;;
5247                 esac
5248                 case "$CPPFLAGS" in
5249                 (*$cf_add_cflags)
5250                         ;;
5251                 (*)
5252                         case "$cf_add_cflags" in
5253                         (-D*)
5254                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5255
5256 CPPFLAGS=`echo "$CPPFLAGS" | \
5257         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5258                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5259
5260                                 ;;
5261                         esac
5262
5263         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5264         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5265
5266                         ;;
5267                 esac
5268                 ;;
5269         (*)
5270
5271         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5272         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5273
5274                 ;;
5275         esac
5276         ;;
5277 (yes)
5278
5279         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5280         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5281
5282         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5283
5284         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5285                 && test -z "${cf_tst_cflags}" \
5286                 && cf_fix_cppflags=no
5287         ;;
5288 esac
5289 done
5290
5291 if test -n "$cf_new_cflags" ; then
5292
5293         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5294         CFLAGS="${CFLAGS}$cf_new_cflags"
5295
5296 fi
5297
5298 if test -n "$cf_new_cppflags" ; then
5299
5300         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5301         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5302
5303 fi
5304
5305 if test -n "$cf_new_extra_cppflags" ; then
5306
5307         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5308         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5309
5310 fi
5311
5312 done
5313
5314 cf_add_libs="$LIBS"
5315 # reverse order
5316 cf_add_0lib=
5317 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5318 # filter duplicates
5319 for cf_add_1lib in $cf_add_0lib; do
5320         for cf_add_2lib in $cf_add_libs; do
5321                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5322                         cf_add_1lib=
5323                         break
5324                 fi
5325         done
5326         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5327 done
5328 LIBS="$cf_add_libs"
5329
5330                 # even with config script, some packages use no-override for curses.h
5331
5332 echo "$as_me:5332: checking if we have identified curses headers" >&5
5333 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5334 if test "${cf_cv_ncurses_header+set}" = set; then
5335   echo $ECHO_N "(cached) $ECHO_C" >&6
5336 else
5337
5338 cf_cv_ncurses_header=none
5339 for cf_header in \
5340         ncurses.h ncurses/ncurses.h \
5341         curses.h ncurses/curses.h
5342 do
5343 cat >"conftest.$ac_ext" <<_ACEOF
5344 #line 5344 "configure"
5345 #include "confdefs.h"
5346 #include <${cf_header}>
5347 int
5348 main (void)
5349 {
5350 initscr(); endwin()
5351   ;
5352   return 0;
5353 }
5354 _ACEOF
5355 rm -f "conftest.$ac_objext"
5356 if { (eval echo "$as_me:5356: \"$ac_compile\"") >&5
5357   (eval $ac_compile) 2>&5
5358   ac_status=$?
5359   echo "$as_me:5359: \$? = $ac_status" >&5
5360   (exit "$ac_status"); } &&
5361          { ac_try='test -s "conftest.$ac_objext"'
5362   { (eval echo "$as_me:5362: \"$ac_try\"") >&5
5363   (eval $ac_try) 2>&5
5364   ac_status=$?
5365   echo "$as_me:5365: \$? = $ac_status" >&5
5366   (exit "$ac_status"); }; }; then
5367   cf_cv_ncurses_header=$cf_header; break
5368 else
5369   echo "$as_me: failed program was:" >&5
5370 cat "conftest.$ac_ext" >&5
5371 fi
5372 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5373 done
5374
5375 fi
5376 echo "$as_me:5376: result: $cf_cv_ncurses_header" >&5
5377 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5378
5379 if test "$cf_cv_ncurses_header" = none ; then
5380         { { echo "$as_me:5380: error: No curses header-files found" >&5
5381 echo "$as_me: error: No curses header-files found" >&2;}
5382    { (exit 1); exit 1; }; }
5383 fi
5384
5385 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5386
5387 for ac_header in $cf_cv_ncurses_header
5388 do
5389 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5390 echo "$as_me:5390: checking for $ac_header" >&5
5391 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5392 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5393   echo $ECHO_N "(cached) $ECHO_C" >&6
5394 else
5395   cat >"conftest.$ac_ext" <<_ACEOF
5396 #line 5396 "configure"
5397 #include "confdefs.h"
5398 #include <$ac_header>
5399 _ACEOF
5400 if { (eval echo "$as_me:5400: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5401   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5402   ac_status=$?
5403   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5404   rm -f conftest.er1
5405   cat conftest.err >&5
5406   echo "$as_me:5406: \$? = $ac_status" >&5
5407   (exit "$ac_status"); } >/dev/null; then
5408   if test -s conftest.err; then
5409     ac_cpp_err=$ac_c_preproc_warn_flag
5410   else
5411     ac_cpp_err=
5412   fi
5413 else
5414   ac_cpp_err=yes
5415 fi
5416 if test -z "$ac_cpp_err"; then
5417   eval "$as_ac_Header=yes"
5418 else
5419   echo "$as_me: failed program was:" >&5
5420   cat "conftest.$ac_ext" >&5
5421   eval "$as_ac_Header=no"
5422 fi
5423 rm -f conftest.err "conftest.$ac_ext"
5424 fi
5425 echo "$as_me:5425: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5426 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5427 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5428   cat >>confdefs.h <<EOF
5429 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5430 EOF
5431
5432 fi
5433 done
5434
5435 cat >>confdefs.h <<\EOF
5436 #define NCURSES 1
5437 EOF
5438
5439 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5440
5441                 cat >>confdefs.h <<EOF
5442 #define $cf_nculib_ROOT 1
5443 EOF
5444
5445                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5446
5447         else
5448
5449 cf_ncuhdr_root=ncurses
5450
5451 test -n "$cf_cv_curses_dir" && \
5452 test "$cf_cv_curses_dir" != "no" && { \
5453
5454 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5455   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5456   do
5457         while test "$cf_add_incdir" != /usr/include
5458         do
5459           if test -d "$cf_add_incdir"
5460           then
5461                 cf_have_incdir=no
5462                 if test -n "$CFLAGS$CPPFLAGS" ; then
5463                   # a loop is needed to ensure we can add subdirs of existing dirs
5464                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5465                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5466                           cf_have_incdir=yes; break
5467                         fi
5468                   done
5469                 fi
5470
5471                 if test "$cf_have_incdir" = no ; then
5472                   if test "$cf_add_incdir" = /usr/local/include ; then
5473                         if test "$GCC" = yes
5474                         then
5475                           cf_save_CPPFLAGS=$CPPFLAGS
5476
5477         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5478         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5479
5480                           cat >"conftest.$ac_ext" <<_ACEOF
5481 #line 5481 "configure"
5482 #include "confdefs.h"
5483 #include <stdio.h>
5484 int
5485 main (void)
5486 {
5487 printf("Hello")
5488   ;
5489   return 0;
5490 }
5491 _ACEOF
5492 rm -f "conftest.$ac_objext"
5493 if { (eval echo "$as_me:5493: \"$ac_compile\"") >&5
5494   (eval $ac_compile) 2>&5
5495   ac_status=$?
5496   echo "$as_me:5496: \$? = $ac_status" >&5
5497   (exit "$ac_status"); } &&
5498          { ac_try='test -s "conftest.$ac_objext"'
5499   { (eval echo "$as_me:5499: \"$ac_try\"") >&5
5500   (eval $ac_try) 2>&5
5501   ac_status=$?
5502   echo "$as_me:5502: \$? = $ac_status" >&5
5503   (exit "$ac_status"); }; }; then
5504   :
5505 else
5506   echo "$as_me: failed program was:" >&5
5507 cat "conftest.$ac_ext" >&5
5508 cf_have_incdir=yes
5509 fi
5510 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5511                           CPPFLAGS=$cf_save_CPPFLAGS
5512                         fi
5513                   fi
5514                 fi
5515
5516                 if test "$cf_have_incdir" = no ; then
5517                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5518
5519 echo "${as_me:-configure}:5519: testing adding $cf_add_incdir to include-path ..." 1>&5
5520
5521                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5522
5523                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5524                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5525                   cf_add_incdir="$cf_top_incdir"
5526                 else
5527                   break
5528                 fi
5529           else
5530                 break
5531           fi
5532         done
5533   done
5534 fi
5535
5536 }
5537
5538 echo "$as_me:5538: checking for $cf_ncuhdr_root header in include-path" >&5
5539 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5540 if test "${cf_cv_ncurses_h+set}" = set; then
5541   echo $ECHO_N "(cached) $ECHO_C" >&6
5542 else
5543
5544         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5545         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5546         for cf_header in $cf_header_list
5547         do
5548
5549         cat >"conftest.$ac_ext" <<_ACEOF
5550 #line 5550 "configure"
5551 #include "confdefs.h"
5552
5553 #include <$cf_header>
5554 int
5555 main (void)
5556 {
5557
5558 #ifdef NCURSES_VERSION
5559
5560 printf("%s\\n", NCURSES_VERSION);
5561 #else
5562 #ifdef __NCURSES_H
5563 printf("old\\n");
5564 #else
5565         #error __NCURSES_H is not defined
5566 #endif
5567 #endif
5568
5569   ;
5570   return 0;
5571 }
5572 _ACEOF
5573 rm -f "conftest.$ac_objext"
5574 if { (eval echo "$as_me:5574: \"$ac_compile\"") >&5
5575   (eval $ac_compile) 2>&5
5576   ac_status=$?
5577   echo "$as_me:5577: \$? = $ac_status" >&5
5578   (exit "$ac_status"); } &&
5579          { ac_try='test -s "conftest.$ac_objext"'
5580   { (eval echo "$as_me:5580: \"$ac_try\"") >&5
5581   (eval $ac_try) 2>&5
5582   ac_status=$?
5583   echo "$as_me:5583: \$? = $ac_status" >&5
5584   (exit "$ac_status"); }; }; then
5585   cf_cv_ncurses_h=$cf_header
5586
5587 else
5588   echo "$as_me: failed program was:" >&5
5589 cat "conftest.$ac_ext" >&5
5590 cf_cv_ncurses_h=no
5591 fi
5592 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5593
5594                 test "$cf_cv_ncurses_h" != no && break
5595         done
5596
5597 fi
5598 echo "$as_me:5598: result: $cf_cv_ncurses_h" >&5
5599 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5600
5601 if test "$cf_cv_ncurses_h" != no ; then
5602         cf_cv_ncurses_header=$cf_cv_ncurses_h
5603 else
5604
5605 echo "$as_me:5605: checking for $cf_ncuhdr_root include-path" >&5
5606 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5607 if test "${cf_cv_ncurses_h2+set}" = set; then
5608   echo $ECHO_N "(cached) $ECHO_C" >&6
5609 else
5610
5611         test -n "$verbose" && echo
5612
5613 cf_search=
5614
5615 # collect the current set of include-directories from compiler flags
5616 cf_header_path_list=""
5617 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5618         for cf_header_path in $CPPFLAGS $CFLAGS
5619         do
5620                 case "$cf_header_path" in
5621                 (-I*)
5622                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5623
5624 test "x$cf_header_path" != "xNONE" && \
5625 test -d "$cf_header_path" && \
5626  {
5627         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5628         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5629         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5630         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5631         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5632         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"
5633 }
5634
5635                         cf_header_path_list="$cf_header_path_list $cf_search"
5636                         ;;
5637                 esac
5638         done
5639 fi
5640
5641 # add the variations for the package we are looking for
5642
5643 cf_search=
5644
5645 test "x$prefix" != "xNONE" && \
5646 test -d "$prefix" && \
5647  {
5648         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5649         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5650         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5651         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5652         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5653         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5654 }
5655
5656 for cf_subdir_prefix in \
5657         /usr \
5658         /usr/local \
5659         /usr/pkg \
5660         /opt \
5661         /opt/local \
5662         $HOME
5663 do
5664
5665 test "x$cf_subdir_prefix" != "x$prefix" && \
5666 test -d "$cf_subdir_prefix" && \
5667 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5668         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5669         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5670         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5671         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5672         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5673         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"
5674 }
5675
5676 done
5677
5678 test "$includedir" != NONE && \
5679 test "$includedir" != "/usr/include" && \
5680 test -d "$includedir" && {
5681         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5682         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5683 }
5684
5685 test "$oldincludedir" != NONE && \
5686 test "$oldincludedir" != "/usr/include" && \
5687 test -d "$oldincludedir" && {
5688         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5689         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5690 }
5691
5692 cf_search="$cf_search $cf_header_path_list"
5693
5694         test -n "$verbose" && echo "search path $cf_search"
5695         cf_save2_CPPFLAGS="$CPPFLAGS"
5696         for cf_incdir in $cf_search
5697         do
5698
5699 if test -n "$cf_incdir" ; then
5700   for cf_add_incdir in $cf_incdir
5701   do
5702         while test "$cf_add_incdir" != /usr/include
5703         do
5704           if test -d "$cf_add_incdir"
5705           then
5706                 cf_have_incdir=no
5707                 if test -n "$CFLAGS$CPPFLAGS" ; then
5708                   # a loop is needed to ensure we can add subdirs of existing dirs
5709                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5710                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5711                           cf_have_incdir=yes; break
5712                         fi
5713                   done
5714                 fi
5715
5716                 if test "$cf_have_incdir" = no ; then
5717                   if test "$cf_add_incdir" = /usr/local/include ; then
5718                         if test "$GCC" = yes
5719                         then
5720                           cf_save_CPPFLAGS=$CPPFLAGS
5721
5722         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5723         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5724
5725                           cat >"conftest.$ac_ext" <<_ACEOF
5726 #line 5726 "configure"
5727 #include "confdefs.h"
5728 #include <stdio.h>
5729 int
5730 main (void)
5731 {
5732 printf("Hello")
5733   ;
5734   return 0;
5735 }
5736 _ACEOF
5737 rm -f "conftest.$ac_objext"
5738 if { (eval echo "$as_me:5738: \"$ac_compile\"") >&5
5739   (eval $ac_compile) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit "$ac_status"); } &&
5743          { ac_try='test -s "conftest.$ac_objext"'
5744   { (eval echo "$as_me:5744: \"$ac_try\"") >&5
5745   (eval $ac_try) 2>&5
5746   ac_status=$?
5747   echo "$as_me:5747: \$? = $ac_status" >&5
5748   (exit "$ac_status"); }; }; then
5749   :
5750 else
5751   echo "$as_me: failed program was:" >&5
5752 cat "conftest.$ac_ext" >&5
5753 cf_have_incdir=yes
5754 fi
5755 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5756                           CPPFLAGS=$cf_save_CPPFLAGS
5757                         fi
5758                   fi
5759                 fi
5760
5761                 if test "$cf_have_incdir" = no ; then
5762                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5763
5764 echo "${as_me:-configure}:5764: testing adding $cf_add_incdir to include-path ..." 1>&5
5765
5766                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5767
5768                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5769                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5770                   cf_add_incdir="$cf_top_incdir"
5771                 else
5772                   break
5773                 fi
5774           else
5775                 break
5776           fi
5777         done
5778   done
5779 fi
5780
5781                 for cf_header in \
5782                         ncurses.h \
5783                         curses.h
5784                 do
5785
5786         cat >"conftest.$ac_ext" <<_ACEOF
5787 #line 5787 "configure"
5788 #include "confdefs.h"
5789
5790 #include <$cf_header>
5791 int
5792 main (void)
5793 {
5794
5795 #ifdef NCURSES_VERSION
5796
5797 printf("%s\\n", NCURSES_VERSION);
5798 #else
5799 #ifdef __NCURSES_H
5800 printf("old\\n");
5801 #else
5802         #error __NCURSES_H is not defined
5803 #endif
5804 #endif
5805
5806   ;
5807   return 0;
5808 }
5809 _ACEOF
5810 rm -f "conftest.$ac_objext"
5811 if { (eval echo "$as_me:5811: \"$ac_compile\"") >&5
5812   (eval $ac_compile) 2>&5
5813   ac_status=$?
5814   echo "$as_me:5814: \$? = $ac_status" >&5
5815   (exit "$ac_status"); } &&
5816          { ac_try='test -s "conftest.$ac_objext"'
5817   { (eval echo "$as_me:5817: \"$ac_try\"") >&5
5818   (eval $ac_try) 2>&5
5819   ac_status=$?
5820   echo "$as_me:5820: \$? = $ac_status" >&5
5821   (exit "$ac_status"); }; }; then
5822   cf_cv_ncurses_h2=$cf_header
5823
5824 else
5825   echo "$as_me: failed program was:" >&5
5826 cat "conftest.$ac_ext" >&5
5827 cf_cv_ncurses_h2=no
5828 fi
5829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5830
5831                         if test "$cf_cv_ncurses_h2" != no ; then
5832                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5833                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5834                                 break
5835                         fi
5836                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5837                 done
5838                 CPPFLAGS="$cf_save2_CPPFLAGS"
5839                 test "$cf_cv_ncurses_h2" != no && break
5840         done
5841         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5841: error: not found" >&5
5842 echo "$as_me: error: not found" >&2;}
5843    { (exit 1); exit 1; }; }
5844
5845 fi
5846 echo "$as_me:5846: result: $cf_cv_ncurses_h2" >&5
5847 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5848
5849         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5850         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5851         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5852                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5853         fi
5854
5855 if test -n "$cf_1st_incdir" ; then
5856   for cf_add_incdir in $cf_1st_incdir
5857   do
5858         while test "$cf_add_incdir" != /usr/include
5859         do
5860           if test -d "$cf_add_incdir"
5861           then
5862                 cf_have_incdir=no
5863                 if test -n "$CFLAGS$CPPFLAGS" ; then
5864                   # a loop is needed to ensure we can add subdirs of existing dirs
5865                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5866                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5867                           cf_have_incdir=yes; break
5868                         fi
5869                   done
5870                 fi
5871
5872                 if test "$cf_have_incdir" = no ; then
5873                   if test "$cf_add_incdir" = /usr/local/include ; then
5874                         if test "$GCC" = yes
5875                         then
5876                           cf_save_CPPFLAGS=$CPPFLAGS
5877
5878         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5879         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5880
5881                           cat >"conftest.$ac_ext" <<_ACEOF
5882 #line 5882 "configure"
5883 #include "confdefs.h"
5884 #include <stdio.h>
5885 int
5886 main (void)
5887 {
5888 printf("Hello")
5889   ;
5890   return 0;
5891 }
5892 _ACEOF
5893 rm -f "conftest.$ac_objext"
5894 if { (eval echo "$as_me:5894: \"$ac_compile\"") >&5
5895   (eval $ac_compile) 2>&5
5896   ac_status=$?
5897   echo "$as_me:5897: \$? = $ac_status" >&5
5898   (exit "$ac_status"); } &&
5899          { ac_try='test -s "conftest.$ac_objext"'
5900   { (eval echo "$as_me:5900: \"$ac_try\"") >&5
5901   (eval $ac_try) 2>&5
5902   ac_status=$?
5903   echo "$as_me:5903: \$? = $ac_status" >&5
5904   (exit "$ac_status"); }; }; then
5905   :
5906 else
5907   echo "$as_me: failed program was:" >&5
5908 cat "conftest.$ac_ext" >&5
5909 cf_have_incdir=yes
5910 fi
5911 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5912                           CPPFLAGS=$cf_save_CPPFLAGS
5913                         fi
5914                   fi
5915                 fi
5916
5917                 if test "$cf_have_incdir" = no ; then
5918                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5919
5920 echo "${as_me:-configure}:5920: testing adding $cf_add_incdir to include-path ..." 1>&5
5921
5922                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5923
5924                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5925                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5926                   cf_add_incdir="$cf_top_incdir"
5927                 else
5928                   break
5929                 fi
5930           else
5931                 break
5932           fi
5933         done
5934   done
5935 fi
5936
5937 fi
5938
5939 # Set definitions to allow ifdef'ing for ncurses.h
5940
5941 case "$cf_cv_ncurses_header" in
5942 (*ncurses.h)
5943
5944 cat >>confdefs.h <<\EOF
5945 #define HAVE_NCURSES_H 1
5946 EOF
5947
5948         ;;
5949 esac
5950
5951 case "$cf_cv_ncurses_header" in
5952 (ncurses/curses.h|ncurses/ncurses.h)
5953
5954 cat >>confdefs.h <<\EOF
5955 #define HAVE_NCURSES_NCURSES_H 1
5956 EOF
5957
5958         ;;
5959 (ncursesw/curses.h|ncursesw/ncurses.h)
5960
5961 cat >>confdefs.h <<\EOF
5962 #define HAVE_NCURSESW_NCURSES_H 1
5963 EOF
5964
5965         ;;
5966 esac
5967
5968 echo "$as_me:5968: checking for terminfo header" >&5
5969 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5970 if test "${cf_cv_term_header+set}" = set; then
5971   echo $ECHO_N "(cached) $ECHO_C" >&6
5972 else
5973
5974 case "${cf_cv_ncurses_header}" in
5975 (*/ncurses.h|*/ncursesw.h)
5976         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5977         ;;
5978 (*)
5979         cf_term_header=term.h
5980         ;;
5981 esac
5982
5983 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5984 do
5985 cat >"conftest.$ac_ext" <<_ACEOF
5986 #line 5986 "configure"
5987 #include "confdefs.h"
5988 #include <stdio.h>
5989 #include <${cf_cv_ncurses_header:-curses.h}>
5990 #include <$cf_test>
5991
5992 int
5993 main (void)
5994 {
5995 int x = auto_left_margin; (void)x
5996   ;
5997   return 0;
5998 }
5999 _ACEOF
6000 rm -f "conftest.$ac_objext"
6001 if { (eval echo "$as_me:6001: \"$ac_compile\"") >&5
6002   (eval $ac_compile) 2>&5
6003   ac_status=$?
6004   echo "$as_me:6004: \$? = $ac_status" >&5
6005   (exit "$ac_status"); } &&
6006          { ac_try='test -s "conftest.$ac_objext"'
6007   { (eval echo "$as_me:6007: \"$ac_try\"") >&5
6008   (eval $ac_try) 2>&5
6009   ac_status=$?
6010   echo "$as_me:6010: \$? = $ac_status" >&5
6011   (exit "$ac_status"); }; }; then
6012
6013         cf_cv_term_header="$cf_test"
6014 else
6015   echo "$as_me: failed program was:" >&5
6016 cat "conftest.$ac_ext" >&5
6017
6018         cf_cv_term_header=unknown
6019
6020 fi
6021 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6022         test "$cf_cv_term_header" != unknown && break
6023 done
6024
6025 fi
6026 echo "$as_me:6026: result: $cf_cv_term_header" >&5
6027 echo "${ECHO_T}$cf_cv_term_header" >&6
6028
6029 # Set definitions to allow ifdef'ing to accommodate subdirectories
6030
6031 case "$cf_cv_term_header" in
6032 (*term.h)
6033
6034 cat >>confdefs.h <<\EOF
6035 #define HAVE_TERM_H 1
6036 EOF
6037
6038         ;;
6039 esac
6040
6041 case "$cf_cv_term_header" in
6042 (ncurses/term.h)
6043
6044 cat >>confdefs.h <<\EOF
6045 #define HAVE_NCURSES_TERM_H 1
6046 EOF
6047
6048         ;;
6049 (ncursesw/term.h)
6050
6051 cat >>confdefs.h <<\EOF
6052 #define HAVE_NCURSESW_TERM_H 1
6053 EOF
6054
6055         ;;
6056 esac
6057
6058 # some applications need this, but should check for NCURSES_VERSION
6059
6060 cat >>confdefs.h <<\EOF
6061 #define NCURSES 1
6062 EOF
6063
6064 echo "$as_me:6064: checking for ncurses version" >&5
6065 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6066 if test "${cf_cv_ncurses_version+set}" = set; then
6067   echo $ECHO_N "(cached) $ECHO_C" >&6
6068 else
6069
6070         cf_cv_ncurses_version=no
6071         cf_tempfile=out$$
6072         rm -f "$cf_tempfile"
6073         if test "$cross_compiling" = yes; then
6074
6075         # This will not work if the preprocessor splits the line after the
6076         # Autoconf token.  The 'unproto' program does that.
6077         cat > "conftest.$ac_ext" <<EOF
6078 #include <${cf_cv_ncurses_header:-curses.h}>
6079 #undef Autoconf
6080 #ifdef NCURSES_VERSION
6081 Autoconf NCURSES_VERSION
6082 #else
6083 #ifdef __NCURSES_H
6084 Autoconf "old"
6085 #endif
6086 ;
6087 #endif
6088 EOF
6089         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6090         { (eval echo "$as_me:6090: \"$cf_try\"") >&5
6091   (eval $cf_try) 2>&5
6092   ac_status=$?
6093   echo "$as_me:6093: \$? = $ac_status" >&5
6094   (exit "$ac_status"); }
6095         if test -f conftest.out ; then
6096                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6097                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6098                 rm -f conftest.out
6099         fi
6100
6101 else
6102   cat >"conftest.$ac_ext" <<_ACEOF
6103 #line 6103 "configure"
6104 #include "confdefs.h"
6105
6106 $ac_includes_default
6107
6108 #include <${cf_cv_ncurses_header:-curses.h}>
6109
6110 int main(void)
6111 {
6112         FILE *fp = fopen("$cf_tempfile", "w");
6113 #ifdef NCURSES_VERSION
6114 # ifdef NCURSES_VERSION_PATCH
6115         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6116 # else
6117         fprintf(fp, "%s\\n", NCURSES_VERSION);
6118 # endif
6119 #else
6120 # ifdef __NCURSES_H
6121         fprintf(fp, "old\\n");
6122 # else
6123         make an error
6124 # endif
6125 #endif
6126         ${cf_cv_main_return:-return}(0);
6127 }
6128 _ACEOF
6129 rm -f "conftest$ac_exeext"
6130 if { (eval echo "$as_me:6130: \"$ac_link\"") >&5
6131   (eval $ac_link) 2>&5
6132   ac_status=$?
6133   echo "$as_me:6133: \$? = $ac_status" >&5
6134   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6135   { (eval echo "$as_me:6135: \"$ac_try\"") >&5
6136   (eval $ac_try) 2>&5
6137   ac_status=$?
6138   echo "$as_me:6138: \$? = $ac_status" >&5
6139   (exit "$ac_status"); }; }; then
6140
6141         cf_cv_ncurses_version=`cat $cf_tempfile`
6142 else
6143   echo "$as_me: program exited with status $ac_status" >&5
6144 echo "$as_me: failed program was:" >&5
6145 cat "conftest.$ac_ext" >&5
6146 fi
6147 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6148 fi
6149         rm -f "$cf_tempfile"
6150
6151 fi
6152 echo "$as_me:6152: result: $cf_cv_ncurses_version" >&5
6153 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6154 test "$cf_cv_ncurses_version" = no ||
6155 cat >>confdefs.h <<\EOF
6156 #define NCURSES 1
6157 EOF
6158
6159 cf_nculib_root=ncurses
6160         # This works, except for the special case where we find gpm, but
6161         # ncurses is in a nonstandard location via $LIBS, and we really want
6162         # to link gpm.
6163 cf_ncurses_LIBS=""
6164 cf_ncurses_SAVE="$LIBS"
6165 echo "$as_me:6165: checking for Gpm_Open in -lgpm" >&5
6166 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6167 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6168   echo $ECHO_N "(cached) $ECHO_C" >&6
6169 else
6170   ac_check_lib_save_LIBS=$LIBS
6171 LIBS="-lgpm  $LIBS"
6172 cat >"conftest.$ac_ext" <<_ACEOF
6173 #line 6173 "configure"
6174 #include "confdefs.h"
6175
6176 /* Override any gcc2 internal prototype to avoid an error.  */
6177 #ifdef __cplusplus
6178 extern "C"
6179 #endif
6180 /* We use char because int might match the return type of a gcc2
6181    builtin and then its argument prototype would still apply.  */
6182 char Gpm_Open ();
6183 int
6184 main (void)
6185 {
6186 Gpm_Open ();
6187   ;
6188   return 0;
6189 }
6190 _ACEOF
6191 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6192 if { (eval echo "$as_me:6192: \"$ac_link\"") >&5
6193   (eval $ac_link) 2>&5
6194   ac_status=$?
6195   echo "$as_me:6195: \$? = $ac_status" >&5
6196   (exit "$ac_status"); } &&
6197          { ac_try='test -s "conftest$ac_exeext"'
6198   { (eval echo "$as_me:6198: \"$ac_try\"") >&5
6199   (eval $ac_try) 2>&5
6200   ac_status=$?
6201   echo "$as_me:6201: \$? = $ac_status" >&5
6202   (exit "$ac_status"); }; }; then
6203   ac_cv_lib_gpm_Gpm_Open=yes
6204 else
6205   echo "$as_me: failed program was:" >&5
6206 cat "conftest.$ac_ext" >&5
6207 ac_cv_lib_gpm_Gpm_Open=no
6208 fi
6209 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6210 LIBS=$ac_check_lib_save_LIBS
6211 fi
6212 echo "$as_me:6212: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6213 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6214 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6215   echo "$as_me:6215: checking for initscr in -lgpm" >&5
6216 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6217 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6218   echo $ECHO_N "(cached) $ECHO_C" >&6
6219 else
6220   ac_check_lib_save_LIBS=$LIBS
6221 LIBS="-lgpm  $LIBS"
6222 cat >"conftest.$ac_ext" <<_ACEOF
6223 #line 6223 "configure"
6224 #include "confdefs.h"
6225
6226 /* Override any gcc2 internal prototype to avoid an error.  */
6227 #ifdef __cplusplus
6228 extern "C"
6229 #endif
6230 /* We use char because int might match the return type of a gcc2
6231    builtin and then its argument prototype would still apply.  */
6232 char initscr ();
6233 int
6234 main (void)
6235 {
6236 initscr ();
6237   ;
6238   return 0;
6239 }
6240 _ACEOF
6241 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6242 if { (eval echo "$as_me:6242: \"$ac_link\"") >&5
6243   (eval $ac_link) 2>&5
6244   ac_status=$?
6245   echo "$as_me:6245: \$? = $ac_status" >&5
6246   (exit "$ac_status"); } &&
6247          { ac_try='test -s "conftest$ac_exeext"'
6248   { (eval echo "$as_me:6248: \"$ac_try\"") >&5
6249   (eval $ac_try) 2>&5
6250   ac_status=$?
6251   echo "$as_me:6251: \$? = $ac_status" >&5
6252   (exit "$ac_status"); }; }; then
6253   ac_cv_lib_gpm_initscr=yes
6254 else
6255   echo "$as_me: failed program was:" >&5
6256 cat "conftest.$ac_ext" >&5
6257 ac_cv_lib_gpm_initscr=no
6258 fi
6259 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6260 LIBS=$ac_check_lib_save_LIBS
6261 fi
6262 echo "$as_me:6262: result: $ac_cv_lib_gpm_initscr" >&5
6263 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6264 if test "$ac_cv_lib_gpm_initscr" = yes; then
6265   LIBS="$cf_ncurses_SAVE"
6266 else
6267   cf_ncurses_LIBS="-lgpm"
6268 fi
6269
6270 fi
6271
6272 case "$host_os" in
6273 (freebsd*)
6274         # This is only necessary if you are linking against an obsolete
6275         # version of ncurses (but it should do no harm, since it is static).
6276         if test "$cf_nculib_root" = ncurses ; then
6277                 echo "$as_me:6277: checking for tgoto in -lmytinfo" >&5
6278 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6279 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6280   echo $ECHO_N "(cached) $ECHO_C" >&6
6281 else
6282   ac_check_lib_save_LIBS=$LIBS
6283 LIBS="-lmytinfo  $LIBS"
6284 cat >"conftest.$ac_ext" <<_ACEOF
6285 #line 6285 "configure"
6286 #include "confdefs.h"
6287
6288 /* Override any gcc2 internal prototype to avoid an error.  */
6289 #ifdef __cplusplus
6290 extern "C"
6291 #endif
6292 /* We use char because int might match the return type of a gcc2
6293    builtin and then its argument prototype would still apply.  */
6294 char tgoto ();
6295 int
6296 main (void)
6297 {
6298 tgoto ();
6299   ;
6300   return 0;
6301 }
6302 _ACEOF
6303 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6304 if { (eval echo "$as_me:6304: \"$ac_link\"") >&5
6305   (eval $ac_link) 2>&5
6306   ac_status=$?
6307   echo "$as_me:6307: \$? = $ac_status" >&5
6308   (exit "$ac_status"); } &&
6309          { ac_try='test -s "conftest$ac_exeext"'
6310   { (eval echo "$as_me:6310: \"$ac_try\"") >&5
6311   (eval $ac_try) 2>&5
6312   ac_status=$?
6313   echo "$as_me:6313: \$? = $ac_status" >&5
6314   (exit "$ac_status"); }; }; then
6315   ac_cv_lib_mytinfo_tgoto=yes
6316 else
6317   echo "$as_me: failed program was:" >&5
6318 cat "conftest.$ac_ext" >&5
6319 ac_cv_lib_mytinfo_tgoto=no
6320 fi
6321 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6322 LIBS=$ac_check_lib_save_LIBS
6323 fi
6324 echo "$as_me:6324: result: $ac_cv_lib_mytinfo_tgoto" >&5
6325 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6326 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6327   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6328 fi
6329
6330         fi
6331         ;;
6332 esac
6333
6334 cf_add_libs="$LIBS"
6335 # reverse order
6336 cf_add_0lib=
6337 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6338 # filter duplicates
6339 for cf_add_1lib in $cf_add_0lib; do
6340         for cf_add_2lib in $cf_add_libs; do
6341                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6342                         cf_add_1lib=
6343                         break
6344                 fi
6345         done
6346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6347 done
6348 LIBS="$cf_add_libs"
6349
6350 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6351 then
6352
6353 cf_add_libs="$LIBS"
6354 # reverse order
6355 cf_add_0lib=
6356 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6357 # filter duplicates
6358 for cf_add_1lib in $cf_add_0lib; do
6359         for cf_add_2lib in $cf_add_libs; do
6360                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6361                         cf_add_1lib=
6362                         break
6363                 fi
6364         done
6365         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6366 done
6367 LIBS="$cf_add_libs"
6368
6369 else
6370
6371         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6372         cf_libdir=""
6373         echo "$as_me:6373: checking for initscr" >&5
6374 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6375 if test "${ac_cv_func_initscr+set}" = set; then
6376   echo $ECHO_N "(cached) $ECHO_C" >&6
6377 else
6378   cat >"conftest.$ac_ext" <<_ACEOF
6379 #line 6379 "configure"
6380 #include "confdefs.h"
6381 #define initscr autoconf_temporary
6382 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6383 #undef initscr
6384
6385 #ifdef __cplusplus
6386 extern "C"
6387 #endif
6388
6389 /* We use char because int might match the return type of a gcc2
6390    builtin and then its argument prototype would still apply.  */
6391 char initscr (void);
6392
6393 int
6394 main (void)
6395 {
6396
6397 /* The GNU C library defines stubs for functions which it implements
6398     to always fail with ENOSYS.  Some functions are actually named
6399     something starting with __ and the normal name is an alias.  */
6400 #if defined (__stub_initscr) || defined (__stub___initscr)
6401 #error found stub for initscr
6402 #endif
6403
6404         return initscr ();
6405   ;
6406   return 0;
6407 }
6408 _ACEOF
6409 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6410 if { (eval echo "$as_me:6410: \"$ac_link\"") >&5
6411   (eval $ac_link) 2>&5
6412   ac_status=$?
6413   echo "$as_me:6413: \$? = $ac_status" >&5
6414   (exit "$ac_status"); } &&
6415          { ac_try='test -s "conftest$ac_exeext"'
6416   { (eval echo "$as_me:6416: \"$ac_try\"") >&5
6417   (eval $ac_try) 2>&5
6418   ac_status=$?
6419   echo "$as_me:6419: \$? = $ac_status" >&5
6420   (exit "$ac_status"); }; }; then
6421   ac_cv_func_initscr=yes
6422 else
6423   echo "$as_me: failed program was:" >&5
6424 cat "conftest.$ac_ext" >&5
6425 ac_cv_func_initscr=no
6426 fi
6427 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6428 fi
6429 echo "$as_me:6429: result: $ac_cv_func_initscr" >&5
6430 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6431 if test "$ac_cv_func_initscr" = yes; then
6432   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6433 else
6434
6435                 cf_save_LIBS="$LIBS"
6436                 echo "$as_me:6436: checking for initscr in -l$cf_nculib_root" >&5
6437 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6438                 LIBS="-l$cf_nculib_root $LIBS"
6439                 cat >"conftest.$ac_ext" <<_ACEOF
6440 #line 6440 "configure"
6441 #include "confdefs.h"
6442 #include <${cf_cv_ncurses_header:-curses.h}>
6443 int
6444 main (void)
6445 {
6446 initscr()
6447   ;
6448   return 0;
6449 }
6450 _ACEOF
6451 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6452 if { (eval echo "$as_me:6452: \"$ac_link\"") >&5
6453   (eval $ac_link) 2>&5
6454   ac_status=$?
6455   echo "$as_me:6455: \$? = $ac_status" >&5
6456   (exit "$ac_status"); } &&
6457          { ac_try='test -s "conftest$ac_exeext"'
6458   { (eval echo "$as_me:6458: \"$ac_try\"") >&5
6459   (eval $ac_try) 2>&5
6460   ac_status=$?
6461   echo "$as_me:6461: \$? = $ac_status" >&5
6462   (exit "$ac_status"); }; }; then
6463   echo "$as_me:6463: result: yes" >&5
6464 echo "${ECHO_T}yes" >&6
6465                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6466
6467 else
6468   echo "$as_me: failed program was:" >&5
6469 cat "conftest.$ac_ext" >&5
6470 echo "$as_me:6470: result: no" >&5
6471 echo "${ECHO_T}no" >&6
6472
6473 cf_search=
6474 cf_library_path_list=""
6475 if test -n "${LDFLAGS}${LIBS}" ; then
6476         for cf_library_path in $LDFLAGS $LIBS
6477         do
6478                 case "$cf_library_path" in
6479                 (-L*)
6480                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6481
6482 test "x$cf_library_path" != "xNONE" && \
6483 test -d "$cf_library_path" && \
6484  {
6485         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6486         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6487         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6488         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6489         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6490         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"
6491 }
6492
6493                         cf_library_path_list="$cf_library_path_list $cf_search"
6494                         ;;
6495                 esac
6496         done
6497 fi
6498
6499 cf_search=
6500
6501 test "x$prefix" != "xNONE" && \
6502 test -d "$prefix" && \
6503  {
6504         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6505         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6506         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6507         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6508         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6509         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6510 }
6511
6512 for cf_subdir_prefix in \
6513         /usr \
6514         /usr/local \
6515         /usr/pkg \
6516         /opt \
6517         /opt/local \
6518         $HOME
6519 do
6520
6521 test "x$cf_subdir_prefix" != "x$prefix" && \
6522 test -d "$cf_subdir_prefix" && \
6523 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6524         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6525         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6526         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6527         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6528         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6529         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"
6530 }
6531
6532 done
6533
6534 cf_search="$cf_library_path_list $cf_search"
6535
6536                         for cf_libdir in $cf_search
6537                         do
6538                                 echo "$as_me:6538: checking for -l$cf_nculib_root in $cf_libdir" >&5
6539 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6540                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6541                                 cat >"conftest.$ac_ext" <<_ACEOF
6542 #line 6542 "configure"
6543 #include "confdefs.h"
6544 #include <${cf_cv_ncurses_header:-curses.h}>
6545 int
6546 main (void)
6547 {
6548 initscr()
6549   ;
6550   return 0;
6551 }
6552 _ACEOF
6553 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6554 if { (eval echo "$as_me:6554: \"$ac_link\"") >&5
6555   (eval $ac_link) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit "$ac_status"); } &&
6559          { ac_try='test -s "conftest$ac_exeext"'
6560   { (eval echo "$as_me:6560: \"$ac_try\"") >&5
6561   (eval $ac_try) 2>&5
6562   ac_status=$?
6563   echo "$as_me:6563: \$? = $ac_status" >&5
6564   (exit "$ac_status"); }; }; then
6565   echo "$as_me:6565: result: yes" >&5
6566 echo "${ECHO_T}yes" >&6
6567                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6568                                          break
6569 else
6570   echo "$as_me: failed program was:" >&5
6571 cat "conftest.$ac_ext" >&5
6572 echo "$as_me:6572: result: no" >&5
6573 echo "${ECHO_T}no" >&6
6574                                          LIBS="$cf_save_LIBS"
6575 fi
6576 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6577                         done
6578
6579 fi
6580 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6581
6582 fi
6583
6584 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6585
6586 if test "$cf_found_library" = no ; then
6587         { { echo "$as_me:6587: error: Cannot link $cf_nculib_root library" >&5
6588 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6589    { (exit 1); exit 1; }; }
6590 fi
6591
6592 fi
6593
6594 if test -n "$cf_ncurses_LIBS" ; then
6595         echo "$as_me:6595: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6596 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6597         cf_ncurses_SAVE="$LIBS"
6598         for p in $cf_ncurses_LIBS ; do
6599                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6600                 if test "$q" != "$LIBS" ; then
6601                         LIBS="$q"
6602                 fi
6603         done
6604         cat >"conftest.$ac_ext" <<_ACEOF
6605 #line 6605 "configure"
6606 #include "confdefs.h"
6607 #include <${cf_cv_ncurses_header:-curses.h}>
6608 int
6609 main (void)
6610 {
6611 initscr(); mousemask(0,0); tigetstr((char *)0);
6612   ;
6613   return 0;
6614 }
6615 _ACEOF
6616 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6617 if { (eval echo "$as_me:6617: \"$ac_link\"") >&5
6618   (eval $ac_link) 2>&5
6619   ac_status=$?
6620   echo "$as_me:6620: \$? = $ac_status" >&5
6621   (exit "$ac_status"); } &&
6622          { ac_try='test -s "conftest$ac_exeext"'
6623   { (eval echo "$as_me:6623: \"$ac_try\"") >&5
6624   (eval $ac_try) 2>&5
6625   ac_status=$?
6626   echo "$as_me:6626: \$? = $ac_status" >&5
6627   (exit "$ac_status"); }; }; then
6628   echo "$as_me:6628: result: yes" >&5
6629 echo "${ECHO_T}yes" >&6
6630 else
6631   echo "$as_me: failed program was:" >&5
6632 cat "conftest.$ac_ext" >&5
6633 echo "$as_me:6633: result: no" >&5
6634 echo "${ECHO_T}no" >&6
6635                  LIBS="$cf_ncurses_SAVE"
6636 fi
6637 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6638 fi
6639
6640 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6641
6642 cat >>confdefs.h <<EOF
6643 #define $cf_nculib_ROOT 1
6644 EOF
6645
6646         fi
6647 else
6648         NCURSES_CONFIG=none
6649 fi
6650
6651 echo "$as_me:6651: checking if you want wide-character code" >&5
6652 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6653
6654 # Check whether --enable-widec or --disable-widec was given.
6655 if test "${enable_widec+set}" = set; then
6656   enableval="$enable_widec"
6657   with_widec=$enableval
6658 else
6659   with_widec=no
6660 fi;
6661 echo "$as_me:6661: result: $with_widec" >&5
6662 echo "${ECHO_T}$with_widec" >&6
6663 if test "$with_widec" = yes ; then
6664
6665 for ac_header in wchar.h
6666 do
6667 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6668 echo "$as_me:6668: checking for $ac_header" >&5
6669 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6670 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6671   echo $ECHO_N "(cached) $ECHO_C" >&6
6672 else
6673   cat >"conftest.$ac_ext" <<_ACEOF
6674 #line 6674 "configure"
6675 #include "confdefs.h"
6676 #include <$ac_header>
6677 _ACEOF
6678 if { (eval echo "$as_me:6678: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6679   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6680   ac_status=$?
6681   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6682   rm -f conftest.er1
6683   cat conftest.err >&5
6684   echo "$as_me:6684: \$? = $ac_status" >&5
6685   (exit "$ac_status"); } >/dev/null; then
6686   if test -s conftest.err; then
6687     ac_cpp_err=$ac_c_preproc_warn_flag
6688   else
6689     ac_cpp_err=
6690   fi
6691 else
6692   ac_cpp_err=yes
6693 fi
6694 if test -z "$ac_cpp_err"; then
6695   eval "$as_ac_Header=yes"
6696 else
6697   echo "$as_me: failed program was:" >&5
6698   cat "conftest.$ac_ext" >&5
6699   eval "$as_ac_Header=no"
6700 fi
6701 rm -f conftest.err "conftest.$ac_ext"
6702 fi
6703 echo "$as_me:6703: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6704 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6705 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6706   cat >>confdefs.h <<EOF
6707 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6708 EOF
6709
6710 fi
6711 done
6712
6713 echo "$as_me:6713: checking for multibyte character support" >&5
6714 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6715 if test "${cf_cv_utf8_lib+set}" = set; then
6716   echo $ECHO_N "(cached) $ECHO_C" >&6
6717 else
6718
6719         cf_save_LIBS="$LIBS"
6720         cat >"conftest.$ac_ext" <<_ACEOF
6721 #line 6721 "configure"
6722 #include "confdefs.h"
6723
6724 $ac_includes_default
6725 #ifdef HAVE_WCHAR_H
6726 #include <wchar.h>
6727 #endif
6728
6729 int
6730 main (void)
6731 {
6732 putwc(0,0);
6733   ;
6734   return 0;
6735 }
6736 _ACEOF
6737 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6738 if { (eval echo "$as_me:6738: \"$ac_link\"") >&5
6739   (eval $ac_link) 2>&5
6740   ac_status=$?
6741   echo "$as_me:6741: \$? = $ac_status" >&5
6742   (exit "$ac_status"); } &&
6743          { ac_try='test -s "conftest$ac_exeext"'
6744   { (eval echo "$as_me:6744: \"$ac_try\"") >&5
6745   (eval $ac_try) 2>&5
6746   ac_status=$?
6747   echo "$as_me:6747: \$? = $ac_status" >&5
6748   (exit "$ac_status"); }; }; then
6749   cf_cv_utf8_lib=yes
6750 else
6751   echo "$as_me: failed program was:" >&5
6752 cat "conftest.$ac_ext" >&5
6753
6754 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6755 # will be set on completion of the AC_TRY_LINK below.
6756 cf_cv_header_path_utf8=
6757 cf_cv_library_path_utf8=
6758
6759 echo "${as_me:-configure}:6759: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6760
6761 cf_save_LIBS="$LIBS"
6762
6763 cat >"conftest.$ac_ext" <<_ACEOF
6764 #line 6764 "configure"
6765 #include "confdefs.h"
6766
6767 #include <libutf8.h>
6768 int
6769 main (void)
6770 {
6771 putwc(0,0);
6772   ;
6773   return 0;
6774 }
6775 _ACEOF
6776 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6777 if { (eval echo "$as_me:6777: \"$ac_link\"") >&5
6778   (eval $ac_link) 2>&5
6779   ac_status=$?
6780   echo "$as_me:6780: \$? = $ac_status" >&5
6781   (exit "$ac_status"); } &&
6782          { ac_try='test -s "conftest$ac_exeext"'
6783   { (eval echo "$as_me:6783: \"$ac_try\"") >&5
6784   (eval $ac_try) 2>&5
6785   ac_status=$?
6786   echo "$as_me:6786: \$? = $ac_status" >&5
6787   (exit "$ac_status"); }; }; then
6788
6789         cf_cv_find_linkage_utf8=yes
6790         cf_cv_header_path_utf8=/usr/include
6791         cf_cv_library_path_utf8=/usr/lib
6792
6793 else
6794   echo "$as_me: failed program was:" >&5
6795 cat "conftest.$ac_ext" >&5
6796
6797 LIBS="-lutf8  $cf_save_LIBS"
6798
6799 cat >"conftest.$ac_ext" <<_ACEOF
6800 #line 6800 "configure"
6801 #include "confdefs.h"
6802
6803 #include <libutf8.h>
6804 int
6805 main (void)
6806 {
6807 putwc(0,0);
6808   ;
6809   return 0;
6810 }
6811 _ACEOF
6812 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6813 if { (eval echo "$as_me:6813: \"$ac_link\"") >&5
6814   (eval $ac_link) 2>&5
6815   ac_status=$?
6816   echo "$as_me:6816: \$? = $ac_status" >&5
6817   (exit "$ac_status"); } &&
6818          { ac_try='test -s "conftest$ac_exeext"'
6819   { (eval echo "$as_me:6819: \"$ac_try\"") >&5
6820   (eval $ac_try) 2>&5
6821   ac_status=$?
6822   echo "$as_me:6822: \$? = $ac_status" >&5
6823   (exit "$ac_status"); }; }; then
6824
6825         cf_cv_find_linkage_utf8=yes
6826         cf_cv_header_path_utf8=/usr/include
6827         cf_cv_library_path_utf8=/usr/lib
6828         cf_cv_library_file_utf8="-lutf8"
6829
6830 else
6831   echo "$as_me: failed program was:" >&5
6832 cat "conftest.$ac_ext" >&5
6833
6834         cf_cv_find_linkage_utf8=no
6835         LIBS="$cf_save_LIBS"
6836
6837         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6838
6839 echo "${as_me:-configure}:6839: testing find linkage for utf8 library ..." 1>&5
6840
6841 echo "${as_me:-configure}:6841: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6842
6843         cf_save_CPPFLAGS="$CPPFLAGS"
6844         cf_test_CPPFLAGS="$CPPFLAGS"
6845
6846 cf_search=
6847
6848 # collect the current set of include-directories from compiler flags
6849 cf_header_path_list=""
6850 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6851         for cf_header_path in $CPPFLAGS $CFLAGS
6852         do
6853                 case "$cf_header_path" in
6854                 (-I*)
6855                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6856
6857 test "x$cf_header_path" != "xNONE" && \
6858 test -d "$cf_header_path" && \
6859  {
6860         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6861         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6862         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6863         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6864         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6865         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6866 }
6867
6868                         cf_header_path_list="$cf_header_path_list $cf_search"
6869                         ;;
6870                 esac
6871         done
6872 fi
6873
6874 # add the variations for the package we are looking for
6875
6876 cf_search=
6877
6878 test "x$prefix" != "xNONE" && \
6879 test -d "$prefix" && \
6880  {
6881         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6882         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6883         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6884         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6885         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6886         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6887 }
6888
6889 for cf_subdir_prefix in \
6890         /usr \
6891         /usr/local \
6892         /usr/pkg \
6893         /opt \
6894         /opt/local \
6895         $HOME
6896 do
6897
6898 test "x$cf_subdir_prefix" != "x$prefix" && \
6899 test -d "$cf_subdir_prefix" && \
6900 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6901         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6902         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6903         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6904         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6905         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6906         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6907 }
6908
6909 done
6910
6911 test "$includedir" != NONE && \
6912 test "$includedir" != "/usr/include" && \
6913 test -d "$includedir" && {
6914         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6915         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6916 }
6917
6918 test "$oldincludedir" != NONE && \
6919 test "$oldincludedir" != "/usr/include" && \
6920 test -d "$oldincludedir" && {
6921         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6922         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6923 }
6924
6925 cf_search="$cf_search $cf_header_path_list"
6926
6927         for cf_cv_header_path_utf8 in $cf_search
6928         do
6929                 if test -d "$cf_cv_header_path_utf8" ; then
6930                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6931
6932 echo "${as_me:-configure}:6932: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6933
6934                         CPPFLAGS="$cf_save_CPPFLAGS"
6935
6936         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6937         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6938
6939                         cat >"conftest.$ac_ext" <<_ACEOF
6940 #line 6940 "configure"
6941 #include "confdefs.h"
6942
6943 #include <libutf8.h>
6944 int
6945 main (void)
6946 {
6947 putwc(0,0);
6948   ;
6949   return 0;
6950 }
6951 _ACEOF
6952 rm -f "conftest.$ac_objext"
6953 if { (eval echo "$as_me:6953: \"$ac_compile\"") >&5
6954   (eval $ac_compile) 2>&5
6955   ac_status=$?
6956   echo "$as_me:6956: \$? = $ac_status" >&5
6957   (exit "$ac_status"); } &&
6958          { ac_try='test -s "conftest.$ac_objext"'
6959   { (eval echo "$as_me:6959: \"$ac_try\"") >&5
6960   (eval $ac_try) 2>&5
6961   ac_status=$?
6962   echo "$as_me:6962: \$? = $ac_status" >&5
6963   (exit "$ac_status"); }; }; then
6964
6965                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6966
6967 echo "${as_me:-configure}:6967: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6968
6969                                 cf_cv_find_linkage_utf8=maybe
6970                                 cf_test_CPPFLAGS="$CPPFLAGS"
6971                                 break
6972 else
6973   echo "$as_me: failed program was:" >&5
6974 cat "conftest.$ac_ext" >&5
6975
6976                                 CPPFLAGS="$cf_save_CPPFLAGS"
6977
6978 fi
6979 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6980                 fi
6981         done
6982
6983         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6984
6985 echo "${as_me:-configure}:6985: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6986
6987                 cf_save_LIBS="$LIBS"
6988                 cf_save_LDFLAGS="$LDFLAGS"
6989
6990                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6991
6992 cf_search=
6993 cf_library_path_list=""
6994 if test -n "${LDFLAGS}${LIBS}" ; then
6995         for cf_library_path in $LDFLAGS $LIBS
6996         do
6997                 case "$cf_library_path" in
6998                 (-L*)
6999                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7000
7001 test "x$cf_library_path" != "xNONE" && \
7002 test -d "$cf_library_path" && \
7003  {
7004         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7005         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7006         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7007         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7008         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7009         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7010 }
7011
7012                         cf_library_path_list="$cf_library_path_list $cf_search"
7013                         ;;
7014                 esac
7015         done
7016 fi
7017
7018 cf_search=
7019
7020 test "x$prefix" != "xNONE" && \
7021 test -d "$prefix" && \
7022  {
7023         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7024         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7025         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7026         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7027         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7028         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7029 }
7030
7031 for cf_subdir_prefix in \
7032         /usr \
7033         /usr/local \
7034         /usr/pkg \
7035         /opt \
7036         /opt/local \
7037         $HOME
7038 do
7039
7040 test "x$cf_subdir_prefix" != "x$prefix" && \
7041 test -d "$cf_subdir_prefix" && \
7042 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7043         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7044         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7045         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7046         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7047         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7048         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7049 }
7050
7051 done
7052
7053 cf_search="$cf_library_path_list $cf_search"
7054
7055                         for cf_cv_library_path_utf8 in $cf_search
7056                         do
7057                                 if test -d "$cf_cv_library_path_utf8" ; then
7058                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7059
7060 echo "${as_me:-configure}:7060: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7061
7062                                         CPPFLAGS="$cf_test_CPPFLAGS"
7063                                         LIBS="-lutf8  $cf_save_LIBS"
7064                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7065                                         cat >"conftest.$ac_ext" <<_ACEOF
7066 #line 7066 "configure"
7067 #include "confdefs.h"
7068
7069 #include <libutf8.h>
7070 int
7071 main (void)
7072 {
7073 putwc(0,0);
7074   ;
7075   return 0;
7076 }
7077 _ACEOF
7078 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7079 if { (eval echo "$as_me:7079: \"$ac_link\"") >&5
7080   (eval $ac_link) 2>&5
7081   ac_status=$?
7082   echo "$as_me:7082: \$? = $ac_status" >&5
7083   (exit "$ac_status"); } &&
7084          { ac_try='test -s "conftest$ac_exeext"'
7085   { (eval echo "$as_me:7085: \"$ac_try\"") >&5
7086   (eval $ac_try) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit "$ac_status"); }; }; then
7090
7091                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7092
7093 echo "${as_me:-configure}:7093: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7094
7095                                         cf_cv_find_linkage_utf8=yes
7096                                         cf_cv_library_file_utf8="-lutf8"
7097                                         break
7098 else
7099   echo "$as_me: failed program was:" >&5
7100 cat "conftest.$ac_ext" >&5
7101
7102                                         CPPFLAGS="$cf_save_CPPFLAGS"
7103                                         LIBS="$cf_save_LIBS"
7104                                         LDFLAGS="$cf_save_LDFLAGS"
7105
7106 fi
7107 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7108                                 fi
7109                         done
7110                         CPPFLAGS="$cf_save_CPPFLAGS"
7111                         LDFLAGS="$cf_save_LDFLAGS"
7112                 fi
7113
7114         else
7115                 cf_cv_find_linkage_utf8=no
7116         fi
7117
7118 fi
7119 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7120
7121 fi
7122 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7123
7124 LIBS="$cf_save_LIBS"
7125
7126 if test "$cf_cv_find_linkage_utf8" = yes ; then
7127 cf_cv_utf8_lib=add-on
7128 else
7129 cf_cv_utf8_lib=no
7130 fi
7131
7132 fi
7133 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7134 fi
7135 echo "$as_me:7135: result: $cf_cv_utf8_lib" >&5
7136 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7137
7138 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7139 # ncurses/ncursesw:
7140 if test "$cf_cv_utf8_lib" = "add-on" ; then
7141
7142 cat >>confdefs.h <<\EOF
7143 #define HAVE_LIBUTF8_H 1
7144 EOF
7145
7146 if test -n "$cf_cv_header_path_utf8" ; then
7147   for cf_add_incdir in $cf_cv_header_path_utf8
7148   do
7149         while test "$cf_add_incdir" != /usr/include
7150         do
7151           if test -d "$cf_add_incdir"
7152           then
7153                 cf_have_incdir=no
7154                 if test -n "$CFLAGS$CPPFLAGS" ; then
7155                   # a loop is needed to ensure we can add subdirs of existing dirs
7156                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7157                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7158                           cf_have_incdir=yes; break
7159                         fi
7160                   done
7161                 fi
7162
7163                 if test "$cf_have_incdir" = no ; then
7164                   if test "$cf_add_incdir" = /usr/local/include ; then
7165                         if test "$GCC" = yes
7166                         then
7167                           cf_save_CPPFLAGS=$CPPFLAGS
7168
7169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7170         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7171
7172                           cat >"conftest.$ac_ext" <<_ACEOF
7173 #line 7173 "configure"
7174 #include "confdefs.h"
7175 #include <stdio.h>
7176 int
7177 main (void)
7178 {
7179 printf("Hello")
7180   ;
7181   return 0;
7182 }
7183 _ACEOF
7184 rm -f "conftest.$ac_objext"
7185 if { (eval echo "$as_me:7185: \"$ac_compile\"") >&5
7186   (eval $ac_compile) 2>&5
7187   ac_status=$?
7188   echo "$as_me:7188: \$? = $ac_status" >&5
7189   (exit "$ac_status"); } &&
7190          { ac_try='test -s "conftest.$ac_objext"'
7191   { (eval echo "$as_me:7191: \"$ac_try\"") >&5
7192   (eval $ac_try) 2>&5
7193   ac_status=$?
7194   echo "$as_me:7194: \$? = $ac_status" >&5
7195   (exit "$ac_status"); }; }; then
7196   :
7197 else
7198   echo "$as_me: failed program was:" >&5
7199 cat "conftest.$ac_ext" >&5
7200 cf_have_incdir=yes
7201 fi
7202 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7203                           CPPFLAGS=$cf_save_CPPFLAGS
7204                         fi
7205                   fi
7206                 fi
7207
7208                 if test "$cf_have_incdir" = no ; then
7209                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7210
7211 echo "${as_me:-configure}:7211: testing adding $cf_add_incdir to include-path ..." 1>&5
7212
7213                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7214
7215                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7216                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7217                   cf_add_incdir="$cf_top_incdir"
7218                 else
7219                   break
7220                 fi
7221           else
7222                 break
7223           fi
7224         done
7225   done
7226 fi
7227
7228 if test -n "$cf_cv_library_path_utf8" ; then
7229         for cf_add_libdir in $cf_cv_library_path_utf8
7230         do
7231                 if test "$cf_add_libdir" = /usr/lib ; then
7232                         :
7233                 elif test -d "$cf_add_libdir"
7234                 then
7235                         cf_have_libdir=no
7236                         if test -n "$LDFLAGS$LIBS" ; then
7237                                 # a loop is needed to ensure we can add subdirs of existing dirs
7238                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7239                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7240                                                 cf_have_libdir=yes; break
7241                                         fi
7242                                 done
7243                         fi
7244                         if test "$cf_have_libdir" = no ; then
7245                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7246
7247 echo "${as_me:-configure}:7247: testing adding $cf_add_libdir to library-path ..." 1>&5
7248
7249                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7250                         fi
7251                 fi
7252         done
7253 fi
7254
7255 cf_add_libs="$LIBS"
7256 # reverse order
7257 cf_add_0lib=
7258 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7259 # filter duplicates
7260 for cf_add_1lib in $cf_add_0lib; do
7261         for cf_add_2lib in $cf_add_libs; do
7262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7263                         cf_add_1lib=
7264                         break
7265                 fi
7266         done
7267         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7268 done
7269 LIBS="$cf_add_libs"
7270
7271 fi
7272
7273 cf_ncuconfig_root=ncursesw
7274 cf_have_ncuconfig=no
7275
7276 if test "x${PKG_CONFIG:=none}" != xnone; then
7277         echo "$as_me:7277: checking pkg-config for $cf_ncuconfig_root" >&5
7278 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7279         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7280                 echo "$as_me:7280: result: yes" >&5
7281 echo "${ECHO_T}yes" >&6
7282
7283                 echo "$as_me:7283: checking if the $cf_ncuconfig_root package files work" >&5
7284 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7285                 cf_have_ncuconfig=unknown
7286
7287                 cf_save_CFLAGS="$CFLAGS"
7288                 cf_save_CPPFLAGS="$CPPFLAGS"
7289                 cf_save_LIBS="$LIBS"
7290
7291                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7292                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7293
7294                 # while -W for passing linker flags is prevalent, it is not "standard".
7295                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7296                 # incompatible _and_ non-standard -W option which gives an error.  Work
7297                 # around that pitfall.
7298                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7299                 (x*c[89]9@@*-W*)
7300
7301 cf_fix_cppflags=no
7302 cf_new_cflags=
7303 cf_new_cppflags=
7304 cf_new_extra_cppflags=
7305
7306 for cf_add_cflags in $cf_pkg_cflags
7307 do
7308 case "$cf_fix_cppflags" in
7309 (no)
7310         case "$cf_add_cflags" in
7311         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7312                 case "$cf_add_cflags" in
7313                 (-D*)
7314                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7315
7316                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7317                                 && test -z "${cf_tst_cflags}" \
7318                                 && cf_fix_cppflags=yes
7319
7320                         if test "$cf_fix_cppflags" = yes ; then
7321
7322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7324
7325                                 continue
7326                         elif test "${cf_tst_cflags}" = "\"'" ; then
7327
7328         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7329         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7330
7331                                 continue
7332                         fi
7333                         ;;
7334                 esac
7335                 case "$CPPFLAGS" in
7336                 (*$cf_add_cflags)
7337                         ;;
7338                 (*)
7339                         case "$cf_add_cflags" in
7340                         (-D*)
7341                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7342
7343 CPPFLAGS=`echo "$CPPFLAGS" | \
7344         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7345                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7346
7347                                 ;;
7348                         esac
7349
7350         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7351         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7352
7353                         ;;
7354                 esac
7355                 ;;
7356         (*)
7357
7358         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7359         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7360
7361                 ;;
7362         esac
7363         ;;
7364 (yes)
7365
7366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7368
7369         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7370
7371         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7372                 && test -z "${cf_tst_cflags}" \
7373                 && cf_fix_cppflags=no
7374         ;;
7375 esac
7376 done
7377
7378 if test -n "$cf_new_cflags" ; then
7379
7380         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7381         CFLAGS="${CFLAGS}$cf_new_cflags"
7382
7383 fi
7384
7385 if test -n "$cf_new_cppflags" ; then
7386
7387         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7388         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7389
7390 fi
7391
7392 if test -n "$cf_new_extra_cppflags" ; then
7393
7394         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7395         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7396
7397 fi
7398
7399 cf_add_libs="$LIBS"
7400 # reverse order
7401 cf_add_0lib=
7402 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7403 # filter duplicates
7404 for cf_add_1lib in $cf_add_0lib; do
7405         for cf_add_2lib in $cf_add_libs; do
7406                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7407                         cf_add_1lib=
7408                         break
7409                 fi
7410         done
7411         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7412 done
7413 LIBS="$cf_add_libs"
7414
7415                         cat >"conftest.$ac_ext" <<_ACEOF
7416 #line 7416 "configure"
7417 #include "confdefs.h"
7418 #include <${cf_cv_ncurses_header:-curses.h}>
7419 int
7420 main (void)
7421 {
7422 initscr(); mousemask(0,0); tigetstr((char *)0);
7423   ;
7424   return 0;
7425 }
7426 _ACEOF
7427 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7428 if { (eval echo "$as_me:7428: \"$ac_link\"") >&5
7429   (eval $ac_link) 2>&5
7430   ac_status=$?
7431   echo "$as_me:7431: \$? = $ac_status" >&5
7432   (exit "$ac_status"); } &&
7433          { ac_try='test -s "conftest$ac_exeext"'
7434   { (eval echo "$as_me:7434: \"$ac_try\"") >&5
7435   (eval $ac_try) 2>&5
7436   ac_status=$?
7437   echo "$as_me:7437: \$? = $ac_status" >&5
7438   (exit "$ac_status"); }; }; then
7439   if test "$cross_compiling" = yes; then
7440   cf_test_ncuconfig=maybe
7441 else
7442   cat >"conftest.$ac_ext" <<_ACEOF
7443 #line 7443 "configure"
7444 #include "confdefs.h"
7445 #include <${cf_cv_ncurses_header:-curses.h}>
7446                                         int main(void)
7447                                         { const char *xx = curses_version(); return (xx == 0); }
7448 _ACEOF
7449 rm -f "conftest$ac_exeext"
7450 if { (eval echo "$as_me:7450: \"$ac_link\"") >&5
7451   (eval $ac_link) 2>&5
7452   ac_status=$?
7453   echo "$as_me:7453: \$? = $ac_status" >&5
7454   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7455   { (eval echo "$as_me:7455: \"$ac_try\"") >&5
7456   (eval $ac_try) 2>&5
7457   ac_status=$?
7458   echo "$as_me:7458: \$? = $ac_status" >&5
7459   (exit "$ac_status"); }; }; then
7460   cf_test_ncuconfig=yes
7461 else
7462   echo "$as_me: program exited with status $ac_status" >&5
7463 echo "$as_me: failed program was:" >&5
7464 cat "conftest.$ac_ext" >&5
7465 cf_test_ncuconfig=no
7466 fi
7467 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7468 fi
7469 else
7470   echo "$as_me: failed program was:" >&5
7471 cat "conftest.$ac_ext" >&5
7472 cf_test_ncuconfig=no
7473 fi
7474 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7475
7476                         CFLAGS="$cf_save_CFLAGS"
7477                         CPPFLAGS="$cf_save_CPPFLAGS"
7478                         LIBS="$cf_save_LIBS"
7479
7480                         if test "x$cf_test_ncuconfig" != xyes; then
7481                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7482                                 cf_pkg_cflags="$cf_temp"
7483                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7484                                 cf_pkg_libs="$cf_temp"
7485                         fi
7486                         ;;
7487                 esac
7488
7489 for cf_add_cflags in $cf_pkg_cflags
7490 do
7491         case "x$cf_add_cflags" in
7492         (x-[DU]*)
7493
7494 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7495 while true
7496 do
7497         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7498         test "$CFLAGS" != "$cf_old_cflag" || break
7499
7500         CFLAGS="$cf_old_cflag"
7501 done
7502
7503 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7504 while true
7505 do
7506         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'`
7507         test "$CPPFLAGS" != "$cf_old_cflag" || break
7508
7509         CPPFLAGS="$cf_old_cflag"
7510 done
7511
7512                 ;;
7513         esac
7514
7515 cf_fix_cppflags=no
7516 cf_new_cflags=
7517 cf_new_cppflags=
7518 cf_new_extra_cppflags=
7519
7520 for cf_add_cflags in $cf_add_cflags
7521 do
7522 case "$cf_fix_cppflags" in
7523 (no)
7524         case "$cf_add_cflags" in
7525         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7526                 case "$cf_add_cflags" in
7527                 (-D*)
7528                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7529
7530                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7531                                 && test -z "${cf_tst_cflags}" \
7532                                 && cf_fix_cppflags=yes
7533
7534                         if test "$cf_fix_cppflags" = yes ; then
7535
7536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7538
7539                                 continue
7540                         elif test "${cf_tst_cflags}" = "\"'" ; then
7541
7542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7544
7545                                 continue
7546                         fi
7547                         ;;
7548                 esac
7549                 case "$CPPFLAGS" in
7550                 (*$cf_add_cflags)
7551                         ;;
7552                 (*)
7553                         case "$cf_add_cflags" in
7554                         (-D*)
7555                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7556
7557 CPPFLAGS=`echo "$CPPFLAGS" | \
7558         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7559                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7560
7561                                 ;;
7562                         esac
7563
7564         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7565         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7566
7567                         ;;
7568                 esac
7569                 ;;
7570         (*)
7571
7572         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7573         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7574
7575                 ;;
7576         esac
7577         ;;
7578 (yes)
7579
7580         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7581         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7582
7583         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7584
7585         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7586                 && test -z "${cf_tst_cflags}" \
7587                 && cf_fix_cppflags=no
7588         ;;
7589 esac
7590 done
7591
7592 if test -n "$cf_new_cflags" ; then
7593
7594         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7595         CFLAGS="${CFLAGS}$cf_new_cflags"
7596
7597 fi
7598
7599 if test -n "$cf_new_cppflags" ; then
7600
7601         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7602         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7603
7604 fi
7605
7606 if test -n "$cf_new_extra_cppflags" ; then
7607
7608         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7609         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7610
7611 fi
7612
7613 done
7614
7615 cf_add_libs="$LIBS"
7616 # reverse order
7617 cf_add_0lib=
7618 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7619 # filter duplicates
7620 for cf_add_1lib in $cf_add_0lib; do
7621         for cf_add_2lib in $cf_add_libs; do
7622                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7623                         cf_add_1lib=
7624                         break
7625                 fi
7626         done
7627         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7628 done
7629 LIBS="$cf_add_libs"
7630
7631                 cat >"conftest.$ac_ext" <<_ACEOF
7632 #line 7632 "configure"
7633 #include "confdefs.h"
7634 #include <${cf_cv_ncurses_header:-curses.h}>
7635 int
7636 main (void)
7637 {
7638 initscr(); mousemask(0,0); tigetstr((char *)0);
7639   ;
7640   return 0;
7641 }
7642 _ACEOF
7643 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7644 if { (eval echo "$as_me:7644: \"$ac_link\"") >&5
7645   (eval $ac_link) 2>&5
7646   ac_status=$?
7647   echo "$as_me:7647: \$? = $ac_status" >&5
7648   (exit "$ac_status"); } &&
7649          { ac_try='test -s "conftest$ac_exeext"'
7650   { (eval echo "$as_me:7650: \"$ac_try\"") >&5
7651   (eval $ac_try) 2>&5
7652   ac_status=$?
7653   echo "$as_me:7653: \$? = $ac_status" >&5
7654   (exit "$ac_status"); }; }; then
7655   if test "$cross_compiling" = yes; then
7656   cf_have_ncuconfig=maybe
7657 else
7658   cat >"conftest.$ac_ext" <<_ACEOF
7659 #line 7659 "configure"
7660 #include "confdefs.h"
7661 #include <${cf_cv_ncurses_header:-curses.h}>
7662                                 int main(void)
7663                                 { const char *xx = curses_version(); return (xx == 0); }
7664 _ACEOF
7665 rm -f "conftest$ac_exeext"
7666 if { (eval echo "$as_me:7666: \"$ac_link\"") >&5
7667   (eval $ac_link) 2>&5
7668   ac_status=$?
7669   echo "$as_me:7669: \$? = $ac_status" >&5
7670   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7671   { (eval echo "$as_me:7671: \"$ac_try\"") >&5
7672   (eval $ac_try) 2>&5
7673   ac_status=$?
7674   echo "$as_me:7674: \$? = $ac_status" >&5
7675   (exit "$ac_status"); }; }; then
7676   cf_have_ncuconfig=yes
7677 else
7678   echo "$as_me: program exited with status $ac_status" >&5
7679 echo "$as_me: failed program was:" >&5
7680 cat "conftest.$ac_ext" >&5
7681 cf_have_ncuconfig=no
7682 fi
7683 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7684 fi
7685 else
7686   echo "$as_me: failed program was:" >&5
7687 cat "conftest.$ac_ext" >&5
7688 cf_have_ncuconfig=no
7689 fi
7690 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7691                 echo "$as_me:7691: result: $cf_have_ncuconfig" >&5
7692 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7693                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7694                 if test "$cf_have_ncuconfig" != "yes"
7695                 then
7696                         CPPFLAGS="$cf_save_CPPFLAGS"
7697                         LIBS="$cf_save_LIBS"
7698                         NCURSES_CONFIG_PKG=none
7699                 else
7700
7701 cat >>confdefs.h <<\EOF
7702 #define NCURSES 1
7703 EOF
7704
7705                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7706
7707 echo "$as_me:7707: checking for terminfo header" >&5
7708 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7709 if test "${cf_cv_term_header+set}" = set; then
7710   echo $ECHO_N "(cached) $ECHO_C" >&6
7711 else
7712
7713 case "${cf_cv_ncurses_header}" in
7714 (*/ncurses.h|*/ncursesw.h)
7715         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7716         ;;
7717 (*)
7718         cf_term_header=term.h
7719         ;;
7720 esac
7721
7722 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7723 do
7724 cat >"conftest.$ac_ext" <<_ACEOF
7725 #line 7725 "configure"
7726 #include "confdefs.h"
7727 #include <stdio.h>
7728 #include <${cf_cv_ncurses_header:-curses.h}>
7729 #include <$cf_test>
7730
7731 int
7732 main (void)
7733 {
7734 int x = auto_left_margin; (void)x
7735   ;
7736   return 0;
7737 }
7738 _ACEOF
7739 rm -f "conftest.$ac_objext"
7740 if { (eval echo "$as_me:7740: \"$ac_compile\"") >&5
7741   (eval $ac_compile) 2>&5
7742   ac_status=$?
7743   echo "$as_me:7743: \$? = $ac_status" >&5
7744   (exit "$ac_status"); } &&
7745          { ac_try='test -s "conftest.$ac_objext"'
7746   { (eval echo "$as_me:7746: \"$ac_try\"") >&5
7747   (eval $ac_try) 2>&5
7748   ac_status=$?
7749   echo "$as_me:7749: \$? = $ac_status" >&5
7750   (exit "$ac_status"); }; }; then
7751
7752         cf_cv_term_header="$cf_test"
7753 else
7754   echo "$as_me: failed program was:" >&5
7755 cat "conftest.$ac_ext" >&5
7756
7757         cf_cv_term_header=unknown
7758
7759 fi
7760 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7761         test "$cf_cv_term_header" != unknown && break
7762 done
7763
7764 fi
7765 echo "$as_me:7765: result: $cf_cv_term_header" >&5
7766 echo "${ECHO_T}$cf_cv_term_header" >&6
7767
7768 # Set definitions to allow ifdef'ing to accommodate subdirectories
7769
7770 case "$cf_cv_term_header" in
7771 (*term.h)
7772
7773 cat >>confdefs.h <<\EOF
7774 #define HAVE_TERM_H 1
7775 EOF
7776
7777         ;;
7778 esac
7779
7780 case "$cf_cv_term_header" in
7781 (ncurses/term.h)
7782
7783 cat >>confdefs.h <<\EOF
7784 #define HAVE_NCURSES_TERM_H 1
7785 EOF
7786
7787         ;;
7788 (ncursesw/term.h)
7789
7790 cat >>confdefs.h <<\EOF
7791 #define HAVE_NCURSESW_TERM_H 1
7792 EOF
7793
7794         ;;
7795 esac
7796
7797                 fi
7798
7799         else
7800                 echo "$as_me:7800: result: no" >&5
7801 echo "${ECHO_T}no" >&6
7802                 NCURSES_CONFIG_PKG=none
7803         fi
7804 else
7805         NCURSES_CONFIG_PKG=none
7806 fi
7807
7808 if test "x$cf_have_ncuconfig" = "xno"; then
7809         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7810
7811 if test -n "$ac_tool_prefix"; then
7812   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7813   do
7814     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7815 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7816 echo "$as_me:7816: checking for $ac_word" >&5
7817 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7818 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7819   echo $ECHO_N "(cached) $ECHO_C" >&6
7820 else
7821   if test -n "$NCURSES_CONFIG"; then
7822   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7823 else
7824   ac_save_IFS=$IFS; IFS=$ac_path_separator
7825 ac_dummy="$PATH"
7826 for ac_dir in $ac_dummy; do
7827   IFS=$ac_save_IFS
7828   test -z "$ac_dir" && ac_dir=.
7829   $as_executable_p "$ac_dir/$ac_word" || continue
7830 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7831 echo "$as_me:7831: found $ac_dir/$ac_word" >&5
7832 break
7833 done
7834
7835 fi
7836 fi
7837 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7838 if test -n "$NCURSES_CONFIG"; then
7839   echo "$as_me:7839: result: $NCURSES_CONFIG" >&5
7840 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7841 else
7842   echo "$as_me:7842: result: no" >&5
7843 echo "${ECHO_T}no" >&6
7844 fi
7845
7846     test -n "$NCURSES_CONFIG" && break
7847   done
7848 fi
7849 if test -z "$NCURSES_CONFIG"; then
7850   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7851   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7852 do
7853   # Extract the first word of "$ac_prog", so it can be a program name with args.
7854 set dummy $ac_prog; ac_word=$2
7855 echo "$as_me:7855: checking for $ac_word" >&5
7856 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7857 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7858   echo $ECHO_N "(cached) $ECHO_C" >&6
7859 else
7860   if test -n "$ac_ct_NCURSES_CONFIG"; then
7861   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7862 else
7863   ac_save_IFS=$IFS; IFS=$ac_path_separator
7864 ac_dummy="$PATH"
7865 for ac_dir in $ac_dummy; do
7866   IFS=$ac_save_IFS
7867   test -z "$ac_dir" && ac_dir=.
7868   $as_executable_p "$ac_dir/$ac_word" || continue
7869 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7870 echo "$as_me:7870: found $ac_dir/$ac_word" >&5
7871 break
7872 done
7873
7874 fi
7875 fi
7876 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7877 if test -n "$ac_ct_NCURSES_CONFIG"; then
7878   echo "$as_me:7878: result: $ac_ct_NCURSES_CONFIG" >&5
7879 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7880 else
7881   echo "$as_me:7881: result: no" >&5
7882 echo "${ECHO_T}no" >&6
7883 fi
7884
7885   test -n "$ac_ct_NCURSES_CONFIG" && break
7886 done
7887 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7888
7889   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7890 fi
7891
7892         if test "$NCURSES_CONFIG" != none ; then
7893
7894 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7895 do
7896         case "x$cf_add_cflags" in
7897         (x-[DU]*)
7898
7899 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7900 while true
7901 do
7902         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7903         test "$CFLAGS" != "$cf_old_cflag" || break
7904
7905         CFLAGS="$cf_old_cflag"
7906 done
7907
7908 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7909 while true
7910 do
7911         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'`
7912         test "$CPPFLAGS" != "$cf_old_cflag" || break
7913
7914         CPPFLAGS="$cf_old_cflag"
7915 done
7916
7917                 ;;
7918         esac
7919
7920 cf_fix_cppflags=no
7921 cf_new_cflags=
7922 cf_new_cppflags=
7923 cf_new_extra_cppflags=
7924
7925 for cf_add_cflags in $cf_add_cflags
7926 do
7927 case "$cf_fix_cppflags" in
7928 (no)
7929         case "$cf_add_cflags" in
7930         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7931                 case "$cf_add_cflags" in
7932                 (-D*)
7933                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7934
7935                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7936                                 && test -z "${cf_tst_cflags}" \
7937                                 && cf_fix_cppflags=yes
7938
7939                         if test "$cf_fix_cppflags" = yes ; then
7940
7941         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7942         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7943
7944                                 continue
7945                         elif test "${cf_tst_cflags}" = "\"'" ; then
7946
7947         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7948         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7949
7950                                 continue
7951                         fi
7952                         ;;
7953                 esac
7954                 case "$CPPFLAGS" in
7955                 (*$cf_add_cflags)
7956                         ;;
7957                 (*)
7958                         case "$cf_add_cflags" in
7959                         (-D*)
7960                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7961
7962 CPPFLAGS=`echo "$CPPFLAGS" | \
7963         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7964                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7965
7966                                 ;;
7967                         esac
7968
7969         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7970         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7971
7972                         ;;
7973                 esac
7974                 ;;
7975         (*)
7976
7977         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7978         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7979
7980                 ;;
7981         esac
7982         ;;
7983 (yes)
7984
7985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7987
7988         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7989
7990         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7991                 && test -z "${cf_tst_cflags}" \
7992                 && cf_fix_cppflags=no
7993         ;;
7994 esac
7995 done
7996
7997 if test -n "$cf_new_cflags" ; then
7998
7999         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8000         CFLAGS="${CFLAGS}$cf_new_cflags"
8001
8002 fi
8003
8004 if test -n "$cf_new_cppflags" ; then
8005
8006         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8007         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8008
8009 fi
8010
8011 if test -n "$cf_new_extra_cppflags" ; then
8012
8013         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8014         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8015
8016 fi
8017
8018 done
8019
8020 cf_add_libs="$LIBS"
8021 # reverse order
8022 cf_add_0lib=
8023 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8024 # filter duplicates
8025 for cf_add_1lib in $cf_add_0lib; do
8026         for cf_add_2lib in $cf_add_libs; do
8027                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8028                         cf_add_1lib=
8029                         break
8030                 fi
8031         done
8032         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8033 done
8034 LIBS="$cf_add_libs"
8035
8036                 # even with config script, some packages use no-override for curses.h
8037
8038 echo "$as_me:8038: checking if we have identified curses headers" >&5
8039 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8040 if test "${cf_cv_ncurses_header+set}" = set; then
8041   echo $ECHO_N "(cached) $ECHO_C" >&6
8042 else
8043
8044 cf_cv_ncurses_header=none
8045 for cf_header in \
8046         ncurses.h ncursesw/ncurses.h \
8047         curses.h ncursesw/curses.h
8048 do
8049 cat >"conftest.$ac_ext" <<_ACEOF
8050 #line 8050 "configure"
8051 #include "confdefs.h"
8052 #include <${cf_header}>
8053 int
8054 main (void)
8055 {
8056 initscr(); endwin()
8057   ;
8058   return 0;
8059 }
8060 _ACEOF
8061 rm -f "conftest.$ac_objext"
8062 if { (eval echo "$as_me:8062: \"$ac_compile\"") >&5
8063   (eval $ac_compile) 2>&5
8064   ac_status=$?
8065   echo "$as_me:8065: \$? = $ac_status" >&5
8066   (exit "$ac_status"); } &&
8067          { ac_try='test -s "conftest.$ac_objext"'
8068   { (eval echo "$as_me:8068: \"$ac_try\"") >&5
8069   (eval $ac_try) 2>&5
8070   ac_status=$?
8071   echo "$as_me:8071: \$? = $ac_status" >&5
8072   (exit "$ac_status"); }; }; then
8073   cf_cv_ncurses_header=$cf_header; break
8074 else
8075   echo "$as_me: failed program was:" >&5
8076 cat "conftest.$ac_ext" >&5
8077 fi
8078 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8079 done
8080
8081 fi
8082 echo "$as_me:8082: result: $cf_cv_ncurses_header" >&5
8083 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8084
8085 if test "$cf_cv_ncurses_header" = none ; then
8086         { { echo "$as_me:8086: error: No curses header-files found" >&5
8087 echo "$as_me: error: No curses header-files found" >&2;}
8088    { (exit 1); exit 1; }; }
8089 fi
8090
8091 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8092
8093 for ac_header in $cf_cv_ncurses_header
8094 do
8095 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8096 echo "$as_me:8096: checking for $ac_header" >&5
8097 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8098 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8099   echo $ECHO_N "(cached) $ECHO_C" >&6
8100 else
8101   cat >"conftest.$ac_ext" <<_ACEOF
8102 #line 8102 "configure"
8103 #include "confdefs.h"
8104 #include <$ac_header>
8105 _ACEOF
8106 if { (eval echo "$as_me:8106: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8107   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8108   ac_status=$?
8109   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8110   rm -f conftest.er1
8111   cat conftest.err >&5
8112   echo "$as_me:8112: \$? = $ac_status" >&5
8113   (exit "$ac_status"); } >/dev/null; then
8114   if test -s conftest.err; then
8115     ac_cpp_err=$ac_c_preproc_warn_flag
8116   else
8117     ac_cpp_err=
8118   fi
8119 else
8120   ac_cpp_err=yes
8121 fi
8122 if test -z "$ac_cpp_err"; then
8123   eval "$as_ac_Header=yes"
8124 else
8125   echo "$as_me: failed program was:" >&5
8126   cat "conftest.$ac_ext" >&5
8127   eval "$as_ac_Header=no"
8128 fi
8129 rm -f conftest.err "conftest.$ac_ext"
8130 fi
8131 echo "$as_me:8131: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8132 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8133 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8134   cat >>confdefs.h <<EOF
8135 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8136 EOF
8137
8138 fi
8139 done
8140
8141 cat >>confdefs.h <<\EOF
8142 #define NCURSES 1
8143 EOF
8144
8145 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8146
8147                 cat >>confdefs.h <<EOF
8148 #define $cf_nculib_ROOT 1
8149 EOF
8150
8151                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8152
8153         else
8154
8155 cf_ncuhdr_root=ncursesw
8156
8157 test -n "$cf_cv_curses_dir" && \
8158 test "$cf_cv_curses_dir" != "no" && { \
8159
8160 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8161   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8162   do
8163         while test "$cf_add_incdir" != /usr/include
8164         do
8165           if test -d "$cf_add_incdir"
8166           then
8167                 cf_have_incdir=no
8168                 if test -n "$CFLAGS$CPPFLAGS" ; then
8169                   # a loop is needed to ensure we can add subdirs of existing dirs
8170                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8171                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8172                           cf_have_incdir=yes; break
8173                         fi
8174                   done
8175                 fi
8176
8177                 if test "$cf_have_incdir" = no ; then
8178                   if test "$cf_add_incdir" = /usr/local/include ; then
8179                         if test "$GCC" = yes
8180                         then
8181                           cf_save_CPPFLAGS=$CPPFLAGS
8182
8183         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8184         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8185
8186                           cat >"conftest.$ac_ext" <<_ACEOF
8187 #line 8187 "configure"
8188 #include "confdefs.h"
8189 #include <stdio.h>
8190 int
8191 main (void)
8192 {
8193 printf("Hello")
8194   ;
8195   return 0;
8196 }
8197 _ACEOF
8198 rm -f "conftest.$ac_objext"
8199 if { (eval echo "$as_me:8199: \"$ac_compile\"") >&5
8200   (eval $ac_compile) 2>&5
8201   ac_status=$?
8202   echo "$as_me:8202: \$? = $ac_status" >&5
8203   (exit "$ac_status"); } &&
8204          { ac_try='test -s "conftest.$ac_objext"'
8205   { (eval echo "$as_me:8205: \"$ac_try\"") >&5
8206   (eval $ac_try) 2>&5
8207   ac_status=$?
8208   echo "$as_me:8208: \$? = $ac_status" >&5
8209   (exit "$ac_status"); }; }; then
8210   :
8211 else
8212   echo "$as_me: failed program was:" >&5
8213 cat "conftest.$ac_ext" >&5
8214 cf_have_incdir=yes
8215 fi
8216 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8217                           CPPFLAGS=$cf_save_CPPFLAGS
8218                         fi
8219                   fi
8220                 fi
8221
8222                 if test "$cf_have_incdir" = no ; then
8223                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8224
8225 echo "${as_me:-configure}:8225: testing adding $cf_add_incdir to include-path ..." 1>&5
8226
8227                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8228
8229                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8230                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8231                   cf_add_incdir="$cf_top_incdir"
8232                 else
8233                   break
8234                 fi
8235           else
8236                 break
8237           fi
8238         done
8239   done
8240 fi
8241
8242 }
8243
8244 echo "$as_me:8244: checking for $cf_ncuhdr_root header in include-path" >&5
8245 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8246 if test "${cf_cv_ncurses_h+set}" = set; then
8247   echo $ECHO_N "(cached) $ECHO_C" >&6
8248 else
8249
8250         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8251         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8252         for cf_header in $cf_header_list
8253         do
8254
8255         cat >"conftest.$ac_ext" <<_ACEOF
8256 #line 8256 "configure"
8257 #include "confdefs.h"
8258
8259 #define _XOPEN_SOURCE_EXTENDED
8260 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8261 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8262
8263 #include <$cf_header>
8264 int
8265 main (void)
8266 {
8267
8268 #ifdef NCURSES_VERSION
8269
8270 #ifndef WACS_BSSB
8271         #error WACS_BSSB is not defined
8272 #endif
8273
8274 printf("%s\\n", NCURSES_VERSION);
8275 #else
8276 #ifdef __NCURSES_H
8277 printf("old\\n");
8278 #else
8279         #error __NCURSES_H is not defined
8280 #endif
8281 #endif
8282
8283   ;
8284   return 0;
8285 }
8286 _ACEOF
8287 rm -f "conftest.$ac_objext"
8288 if { (eval echo "$as_me:8288: \"$ac_compile\"") >&5
8289   (eval $ac_compile) 2>&5
8290   ac_status=$?
8291   echo "$as_me:8291: \$? = $ac_status" >&5
8292   (exit "$ac_status"); } &&
8293          { ac_try='test -s "conftest.$ac_objext"'
8294   { (eval echo "$as_me:8294: \"$ac_try\"") >&5
8295   (eval $ac_try) 2>&5
8296   ac_status=$?
8297   echo "$as_me:8297: \$? = $ac_status" >&5
8298   (exit "$ac_status"); }; }; then
8299   cf_cv_ncurses_h=$cf_header
8300
8301 else
8302   echo "$as_me: failed program was:" >&5
8303 cat "conftest.$ac_ext" >&5
8304 cf_cv_ncurses_h=no
8305 fi
8306 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8307
8308                 test "$cf_cv_ncurses_h" != no && break
8309         done
8310
8311 fi
8312 echo "$as_me:8312: result: $cf_cv_ncurses_h" >&5
8313 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8314
8315 if test "$cf_cv_ncurses_h" != no ; then
8316         cf_cv_ncurses_header=$cf_cv_ncurses_h
8317 else
8318
8319 echo "$as_me:8319: checking for $cf_ncuhdr_root include-path" >&5
8320 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8321 if test "${cf_cv_ncurses_h2+set}" = set; then
8322   echo $ECHO_N "(cached) $ECHO_C" >&6
8323 else
8324
8325         test -n "$verbose" && echo
8326
8327 cf_search=
8328
8329 # collect the current set of include-directories from compiler flags
8330 cf_header_path_list=""
8331 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8332         for cf_header_path in $CPPFLAGS $CFLAGS
8333         do
8334                 case "$cf_header_path" in
8335                 (-I*)
8336                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8337
8338 test "x$cf_header_path" != "xNONE" && \
8339 test -d "$cf_header_path" && \
8340  {
8341         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8342         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8343         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8344         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8345         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8346         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"
8347 }
8348
8349                         cf_header_path_list="$cf_header_path_list $cf_search"
8350                         ;;
8351                 esac
8352         done
8353 fi
8354
8355 # add the variations for the package we are looking for
8356
8357 cf_search=
8358
8359 test "x$prefix" != "xNONE" && \
8360 test -d "$prefix" && \
8361  {
8362         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8363         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8364         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8365         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8366         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8367         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8368 }
8369
8370 for cf_subdir_prefix in \
8371         /usr \
8372         /usr/local \
8373         /usr/pkg \
8374         /opt \
8375         /opt/local \
8376         $HOME
8377 do
8378
8379 test "x$cf_subdir_prefix" != "x$prefix" && \
8380 test -d "$cf_subdir_prefix" && \
8381 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8382         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8383         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8384         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8385         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8386         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8387         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"
8388 }
8389
8390 done
8391
8392 test "$includedir" != NONE && \
8393 test "$includedir" != "/usr/include" && \
8394 test -d "$includedir" && {
8395         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8396         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8397 }
8398
8399 test "$oldincludedir" != NONE && \
8400 test "$oldincludedir" != "/usr/include" && \
8401 test -d "$oldincludedir" && {
8402         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8403         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8404 }
8405
8406 cf_search="$cf_search $cf_header_path_list"
8407
8408         test -n "$verbose" && echo "search path $cf_search"
8409         cf_save2_CPPFLAGS="$CPPFLAGS"
8410         for cf_incdir in $cf_search
8411         do
8412
8413 if test -n "$cf_incdir" ; then
8414   for cf_add_incdir in $cf_incdir
8415   do
8416         while test "$cf_add_incdir" != /usr/include
8417         do
8418           if test -d "$cf_add_incdir"
8419           then
8420                 cf_have_incdir=no
8421                 if test -n "$CFLAGS$CPPFLAGS" ; then
8422                   # a loop is needed to ensure we can add subdirs of existing dirs
8423                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8424                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8425                           cf_have_incdir=yes; break
8426                         fi
8427                   done
8428                 fi
8429
8430                 if test "$cf_have_incdir" = no ; then
8431                   if test "$cf_add_incdir" = /usr/local/include ; then
8432                         if test "$GCC" = yes
8433                         then
8434                           cf_save_CPPFLAGS=$CPPFLAGS
8435
8436         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8437         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8438
8439                           cat >"conftest.$ac_ext" <<_ACEOF
8440 #line 8440 "configure"
8441 #include "confdefs.h"
8442 #include <stdio.h>
8443 int
8444 main (void)
8445 {
8446 printf("Hello")
8447   ;
8448   return 0;
8449 }
8450 _ACEOF
8451 rm -f "conftest.$ac_objext"
8452 if { (eval echo "$as_me:8452: \"$ac_compile\"") >&5
8453   (eval $ac_compile) 2>&5
8454   ac_status=$?
8455   echo "$as_me:8455: \$? = $ac_status" >&5
8456   (exit "$ac_status"); } &&
8457          { ac_try='test -s "conftest.$ac_objext"'
8458   { (eval echo "$as_me:8458: \"$ac_try\"") >&5
8459   (eval $ac_try) 2>&5
8460   ac_status=$?
8461   echo "$as_me:8461: \$? = $ac_status" >&5
8462   (exit "$ac_status"); }; }; then
8463   :
8464 else
8465   echo "$as_me: failed program was:" >&5
8466 cat "conftest.$ac_ext" >&5
8467 cf_have_incdir=yes
8468 fi
8469 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8470                           CPPFLAGS=$cf_save_CPPFLAGS
8471                         fi
8472                   fi
8473                 fi
8474
8475                 if test "$cf_have_incdir" = no ; then
8476                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8477
8478 echo "${as_me:-configure}:8478: testing adding $cf_add_incdir to include-path ..." 1>&5
8479
8480                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8481
8482                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8483                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8484                   cf_add_incdir="$cf_top_incdir"
8485                 else
8486                   break
8487                 fi
8488           else
8489                 break
8490           fi
8491         done
8492   done
8493 fi
8494
8495                 for cf_header in \
8496                         ncurses.h \
8497                         curses.h
8498                 do
8499
8500         cat >"conftest.$ac_ext" <<_ACEOF
8501 #line 8501 "configure"
8502 #include "confdefs.h"
8503
8504 #include <$cf_header>
8505 int
8506 main (void)
8507 {
8508
8509 #ifdef NCURSES_VERSION
8510
8511 printf("%s\\n", NCURSES_VERSION);
8512 #else
8513 #ifdef __NCURSES_H
8514 printf("old\\n");
8515 #else
8516         #error __NCURSES_H is not defined
8517 #endif
8518 #endif
8519
8520   ;
8521   return 0;
8522 }
8523 _ACEOF
8524 rm -f "conftest.$ac_objext"
8525 if { (eval echo "$as_me:8525: \"$ac_compile\"") >&5
8526   (eval $ac_compile) 2>&5
8527   ac_status=$?
8528   echo "$as_me:8528: \$? = $ac_status" >&5
8529   (exit "$ac_status"); } &&
8530          { ac_try='test -s "conftest.$ac_objext"'
8531   { (eval echo "$as_me:8531: \"$ac_try\"") >&5
8532   (eval $ac_try) 2>&5
8533   ac_status=$?
8534   echo "$as_me:8534: \$? = $ac_status" >&5
8535   (exit "$ac_status"); }; }; then
8536   cf_cv_ncurses_h2=$cf_header
8537
8538 else
8539   echo "$as_me: failed program was:" >&5
8540 cat "conftest.$ac_ext" >&5
8541 cf_cv_ncurses_h2=no
8542 fi
8543 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8544
8545                         if test "$cf_cv_ncurses_h2" != no ; then
8546                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8547                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8548                                 break
8549                         fi
8550                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8551                 done
8552                 CPPFLAGS="$cf_save2_CPPFLAGS"
8553                 test "$cf_cv_ncurses_h2" != no && break
8554         done
8555         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8555: error: not found" >&5
8556 echo "$as_me: error: not found" >&2;}
8557    { (exit 1); exit 1; }; }
8558
8559 fi
8560 echo "$as_me:8560: result: $cf_cv_ncurses_h2" >&5
8561 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8562
8563         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8564         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8565         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8566                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8567         fi
8568
8569 if test -n "$cf_1st_incdir" ; then
8570   for cf_add_incdir in $cf_1st_incdir
8571   do
8572         while test "$cf_add_incdir" != /usr/include
8573         do
8574           if test -d "$cf_add_incdir"
8575           then
8576                 cf_have_incdir=no
8577                 if test -n "$CFLAGS$CPPFLAGS" ; then
8578                   # a loop is needed to ensure we can add subdirs of existing dirs
8579                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8580                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8581                           cf_have_incdir=yes; break
8582                         fi
8583                   done
8584                 fi
8585
8586                 if test "$cf_have_incdir" = no ; then
8587                   if test "$cf_add_incdir" = /usr/local/include ; then
8588                         if test "$GCC" = yes
8589                         then
8590                           cf_save_CPPFLAGS=$CPPFLAGS
8591
8592         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8593         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8594
8595                           cat >"conftest.$ac_ext" <<_ACEOF
8596 #line 8596 "configure"
8597 #include "confdefs.h"
8598 #include <stdio.h>
8599 int
8600 main (void)
8601 {
8602 printf("Hello")
8603   ;
8604   return 0;
8605 }
8606 _ACEOF
8607 rm -f "conftest.$ac_objext"
8608 if { (eval echo "$as_me:8608: \"$ac_compile\"") >&5
8609   (eval $ac_compile) 2>&5
8610   ac_status=$?
8611   echo "$as_me:8611: \$? = $ac_status" >&5
8612   (exit "$ac_status"); } &&
8613          { ac_try='test -s "conftest.$ac_objext"'
8614   { (eval echo "$as_me:8614: \"$ac_try\"") >&5
8615   (eval $ac_try) 2>&5
8616   ac_status=$?
8617   echo "$as_me:8617: \$? = $ac_status" >&5
8618   (exit "$ac_status"); }; }; then
8619   :
8620 else
8621   echo "$as_me: failed program was:" >&5
8622 cat "conftest.$ac_ext" >&5
8623 cf_have_incdir=yes
8624 fi
8625 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8626                           CPPFLAGS=$cf_save_CPPFLAGS
8627                         fi
8628                   fi
8629                 fi
8630
8631                 if test "$cf_have_incdir" = no ; then
8632                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8633
8634 echo "${as_me:-configure}:8634: testing adding $cf_add_incdir to include-path ..." 1>&5
8635
8636                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8637
8638                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8639                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8640                   cf_add_incdir="$cf_top_incdir"
8641                 else
8642                   break
8643                 fi
8644           else
8645                 break
8646           fi
8647         done
8648   done
8649 fi
8650
8651 fi
8652
8653 # Set definitions to allow ifdef'ing for ncurses.h
8654
8655 case "$cf_cv_ncurses_header" in
8656 (*ncurses.h)
8657
8658 cat >>confdefs.h <<\EOF
8659 #define HAVE_NCURSES_H 1
8660 EOF
8661
8662         ;;
8663 esac
8664
8665 case "$cf_cv_ncurses_header" in
8666 (ncurses/curses.h|ncurses/ncurses.h)
8667
8668 cat >>confdefs.h <<\EOF
8669 #define HAVE_NCURSES_NCURSES_H 1
8670 EOF
8671
8672         ;;
8673 (ncursesw/curses.h|ncursesw/ncurses.h)
8674
8675 cat >>confdefs.h <<\EOF
8676 #define HAVE_NCURSESW_NCURSES_H 1
8677 EOF
8678
8679         ;;
8680 esac
8681
8682 echo "$as_me:8682: checking for terminfo header" >&5
8683 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8684 if test "${cf_cv_term_header+set}" = set; then
8685   echo $ECHO_N "(cached) $ECHO_C" >&6
8686 else
8687
8688 case "${cf_cv_ncurses_header}" in
8689 (*/ncurses.h|*/ncursesw.h)
8690         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8691         ;;
8692 (*)
8693         cf_term_header=term.h
8694         ;;
8695 esac
8696
8697 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8698 do
8699 cat >"conftest.$ac_ext" <<_ACEOF
8700 #line 8700 "configure"
8701 #include "confdefs.h"
8702 #include <stdio.h>
8703 #include <${cf_cv_ncurses_header:-curses.h}>
8704 #include <$cf_test>
8705
8706 int
8707 main (void)
8708 {
8709 int x = auto_left_margin; (void)x
8710   ;
8711   return 0;
8712 }
8713 _ACEOF
8714 rm -f "conftest.$ac_objext"
8715 if { (eval echo "$as_me:8715: \"$ac_compile\"") >&5
8716   (eval $ac_compile) 2>&5
8717   ac_status=$?
8718   echo "$as_me:8718: \$? = $ac_status" >&5
8719   (exit "$ac_status"); } &&
8720          { ac_try='test -s "conftest.$ac_objext"'
8721   { (eval echo "$as_me:8721: \"$ac_try\"") >&5
8722   (eval $ac_try) 2>&5
8723   ac_status=$?
8724   echo "$as_me:8724: \$? = $ac_status" >&5
8725   (exit "$ac_status"); }; }; then
8726
8727         cf_cv_term_header="$cf_test"
8728 else
8729   echo "$as_me: failed program was:" >&5
8730 cat "conftest.$ac_ext" >&5
8731
8732         cf_cv_term_header=unknown
8733
8734 fi
8735 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8736         test "$cf_cv_term_header" != unknown && break
8737 done
8738
8739 fi
8740 echo "$as_me:8740: result: $cf_cv_term_header" >&5
8741 echo "${ECHO_T}$cf_cv_term_header" >&6
8742
8743 # Set definitions to allow ifdef'ing to accommodate subdirectories
8744
8745 case "$cf_cv_term_header" in
8746 (*term.h)
8747
8748 cat >>confdefs.h <<\EOF
8749 #define HAVE_TERM_H 1
8750 EOF
8751
8752         ;;
8753 esac
8754
8755 case "$cf_cv_term_header" in
8756 (ncurses/term.h)
8757
8758 cat >>confdefs.h <<\EOF
8759 #define HAVE_NCURSES_TERM_H 1
8760 EOF
8761
8762         ;;
8763 (ncursesw/term.h)
8764
8765 cat >>confdefs.h <<\EOF
8766 #define HAVE_NCURSESW_TERM_H 1
8767 EOF
8768
8769         ;;
8770 esac
8771
8772 # some applications need this, but should check for NCURSES_VERSION
8773
8774 cat >>confdefs.h <<\EOF
8775 #define NCURSES 1
8776 EOF
8777
8778 echo "$as_me:8778: checking for ncurses version" >&5
8779 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8780 if test "${cf_cv_ncurses_version+set}" = set; then
8781   echo $ECHO_N "(cached) $ECHO_C" >&6
8782 else
8783
8784         cf_cv_ncurses_version=no
8785         cf_tempfile=out$$
8786         rm -f "$cf_tempfile"
8787         if test "$cross_compiling" = yes; then
8788
8789         # This will not work if the preprocessor splits the line after the
8790         # Autoconf token.  The 'unproto' program does that.
8791         cat > "conftest.$ac_ext" <<EOF
8792 #include <${cf_cv_ncurses_header:-curses.h}>
8793 #undef Autoconf
8794 #ifdef NCURSES_VERSION
8795 Autoconf NCURSES_VERSION
8796 #else
8797 #ifdef __NCURSES_H
8798 Autoconf "old"
8799 #endif
8800 ;
8801 #endif
8802 EOF
8803         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8804         { (eval echo "$as_me:8804: \"$cf_try\"") >&5
8805   (eval $cf_try) 2>&5
8806   ac_status=$?
8807   echo "$as_me:8807: \$? = $ac_status" >&5
8808   (exit "$ac_status"); }
8809         if test -f conftest.out ; then
8810                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8811                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8812                 rm -f conftest.out
8813         fi
8814
8815 else
8816   cat >"conftest.$ac_ext" <<_ACEOF
8817 #line 8817 "configure"
8818 #include "confdefs.h"
8819
8820 $ac_includes_default
8821
8822 #include <${cf_cv_ncurses_header:-curses.h}>
8823
8824 int main(void)
8825 {
8826         FILE *fp = fopen("$cf_tempfile", "w");
8827 #ifdef NCURSES_VERSION
8828 # ifdef NCURSES_VERSION_PATCH
8829         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8830 # else
8831         fprintf(fp, "%s\\n", NCURSES_VERSION);
8832 # endif
8833 #else
8834 # ifdef __NCURSES_H
8835         fprintf(fp, "old\\n");
8836 # else
8837         make an error
8838 # endif
8839 #endif
8840         ${cf_cv_main_return:-return}(0);
8841 }
8842 _ACEOF
8843 rm -f "conftest$ac_exeext"
8844 if { (eval echo "$as_me:8844: \"$ac_link\"") >&5
8845   (eval $ac_link) 2>&5
8846   ac_status=$?
8847   echo "$as_me:8847: \$? = $ac_status" >&5
8848   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8849   { (eval echo "$as_me:8849: \"$ac_try\"") >&5
8850   (eval $ac_try) 2>&5
8851   ac_status=$?
8852   echo "$as_me:8852: \$? = $ac_status" >&5
8853   (exit "$ac_status"); }; }; then
8854
8855         cf_cv_ncurses_version=`cat $cf_tempfile`
8856 else
8857   echo "$as_me: program exited with status $ac_status" >&5
8858 echo "$as_me: failed program was:" >&5
8859 cat "conftest.$ac_ext" >&5
8860 fi
8861 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8862 fi
8863         rm -f "$cf_tempfile"
8864
8865 fi
8866 echo "$as_me:8866: result: $cf_cv_ncurses_version" >&5
8867 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8868 test "$cf_cv_ncurses_version" = no ||
8869 cat >>confdefs.h <<\EOF
8870 #define NCURSES 1
8871 EOF
8872
8873 cf_nculib_root=ncursesw
8874         # This works, except for the special case where we find gpm, but
8875         # ncurses is in a nonstandard location via $LIBS, and we really want
8876         # to link gpm.
8877 cf_ncurses_LIBS=""
8878 cf_ncurses_SAVE="$LIBS"
8879 echo "$as_me:8879: checking for Gpm_Open in -lgpm" >&5
8880 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8881 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8882   echo $ECHO_N "(cached) $ECHO_C" >&6
8883 else
8884   ac_check_lib_save_LIBS=$LIBS
8885 LIBS="-lgpm  $LIBS"
8886 cat >"conftest.$ac_ext" <<_ACEOF
8887 #line 8887 "configure"
8888 #include "confdefs.h"
8889
8890 /* Override any gcc2 internal prototype to avoid an error.  */
8891 #ifdef __cplusplus
8892 extern "C"
8893 #endif
8894 /* We use char because int might match the return type of a gcc2
8895    builtin and then its argument prototype would still apply.  */
8896 char Gpm_Open ();
8897 int
8898 main (void)
8899 {
8900 Gpm_Open ();
8901   ;
8902   return 0;
8903 }
8904 _ACEOF
8905 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8906 if { (eval echo "$as_me:8906: \"$ac_link\"") >&5
8907   (eval $ac_link) 2>&5
8908   ac_status=$?
8909   echo "$as_me:8909: \$? = $ac_status" >&5
8910   (exit "$ac_status"); } &&
8911          { ac_try='test -s "conftest$ac_exeext"'
8912   { (eval echo "$as_me:8912: \"$ac_try\"") >&5
8913   (eval $ac_try) 2>&5
8914   ac_status=$?
8915   echo "$as_me:8915: \$? = $ac_status" >&5
8916   (exit "$ac_status"); }; }; then
8917   ac_cv_lib_gpm_Gpm_Open=yes
8918 else
8919   echo "$as_me: failed program was:" >&5
8920 cat "conftest.$ac_ext" >&5
8921 ac_cv_lib_gpm_Gpm_Open=no
8922 fi
8923 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8924 LIBS=$ac_check_lib_save_LIBS
8925 fi
8926 echo "$as_me:8926: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8927 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8928 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8929   echo "$as_me:8929: checking for initscr in -lgpm" >&5
8930 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8931 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8932   echo $ECHO_N "(cached) $ECHO_C" >&6
8933 else
8934   ac_check_lib_save_LIBS=$LIBS
8935 LIBS="-lgpm  $LIBS"
8936 cat >"conftest.$ac_ext" <<_ACEOF
8937 #line 8937 "configure"
8938 #include "confdefs.h"
8939
8940 /* Override any gcc2 internal prototype to avoid an error.  */
8941 #ifdef __cplusplus
8942 extern "C"
8943 #endif
8944 /* We use char because int might match the return type of a gcc2
8945    builtin and then its argument prototype would still apply.  */
8946 char initscr ();
8947 int
8948 main (void)
8949 {
8950 initscr ();
8951   ;
8952   return 0;
8953 }
8954 _ACEOF
8955 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8956 if { (eval echo "$as_me:8956: \"$ac_link\"") >&5
8957   (eval $ac_link) 2>&5
8958   ac_status=$?
8959   echo "$as_me:8959: \$? = $ac_status" >&5
8960   (exit "$ac_status"); } &&
8961          { ac_try='test -s "conftest$ac_exeext"'
8962   { (eval echo "$as_me:8962: \"$ac_try\"") >&5
8963   (eval $ac_try) 2>&5
8964   ac_status=$?
8965   echo "$as_me:8965: \$? = $ac_status" >&5
8966   (exit "$ac_status"); }; }; then
8967   ac_cv_lib_gpm_initscr=yes
8968 else
8969   echo "$as_me: failed program was:" >&5
8970 cat "conftest.$ac_ext" >&5
8971 ac_cv_lib_gpm_initscr=no
8972 fi
8973 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8974 LIBS=$ac_check_lib_save_LIBS
8975 fi
8976 echo "$as_me:8976: result: $ac_cv_lib_gpm_initscr" >&5
8977 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8978 if test "$ac_cv_lib_gpm_initscr" = yes; then
8979   LIBS="$cf_ncurses_SAVE"
8980 else
8981   cf_ncurses_LIBS="-lgpm"
8982 fi
8983
8984 fi
8985
8986 case "$host_os" in
8987 (freebsd*)
8988         # This is only necessary if you are linking against an obsolete
8989         # version of ncurses (but it should do no harm, since it is static).
8990         if test "$cf_nculib_root" = ncurses ; then
8991                 echo "$as_me:8991: checking for tgoto in -lmytinfo" >&5
8992 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8993 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8994   echo $ECHO_N "(cached) $ECHO_C" >&6
8995 else
8996   ac_check_lib_save_LIBS=$LIBS
8997 LIBS="-lmytinfo  $LIBS"
8998 cat >"conftest.$ac_ext" <<_ACEOF
8999 #line 8999 "configure"
9000 #include "confdefs.h"
9001
9002 /* Override any gcc2 internal prototype to avoid an error.  */
9003 #ifdef __cplusplus
9004 extern "C"
9005 #endif
9006 /* We use char because int might match the return type of a gcc2
9007    builtin and then its argument prototype would still apply.  */
9008 char tgoto ();
9009 int
9010 main (void)
9011 {
9012 tgoto ();
9013   ;
9014   return 0;
9015 }
9016 _ACEOF
9017 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9018 if { (eval echo "$as_me:9018: \"$ac_link\"") >&5
9019   (eval $ac_link) 2>&5
9020   ac_status=$?
9021   echo "$as_me:9021: \$? = $ac_status" >&5
9022   (exit "$ac_status"); } &&
9023          { ac_try='test -s "conftest$ac_exeext"'
9024   { (eval echo "$as_me:9024: \"$ac_try\"") >&5
9025   (eval $ac_try) 2>&5
9026   ac_status=$?
9027   echo "$as_me:9027: \$? = $ac_status" >&5
9028   (exit "$ac_status"); }; }; then
9029   ac_cv_lib_mytinfo_tgoto=yes
9030 else
9031   echo "$as_me: failed program was:" >&5
9032 cat "conftest.$ac_ext" >&5
9033 ac_cv_lib_mytinfo_tgoto=no
9034 fi
9035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9036 LIBS=$ac_check_lib_save_LIBS
9037 fi
9038 echo "$as_me:9038: result: $ac_cv_lib_mytinfo_tgoto" >&5
9039 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9040 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9041   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9042 fi
9043
9044         fi
9045         ;;
9046 esac
9047
9048 cf_add_libs="$LIBS"
9049 # reverse order
9050 cf_add_0lib=
9051 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9052 # filter duplicates
9053 for cf_add_1lib in $cf_add_0lib; do
9054         for cf_add_2lib in $cf_add_libs; do
9055                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9056                         cf_add_1lib=
9057                         break
9058                 fi
9059         done
9060         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9061 done
9062 LIBS="$cf_add_libs"
9063
9064 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9065 then
9066
9067 cf_add_libs="$LIBS"
9068 # reverse order
9069 cf_add_0lib=
9070 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9071 # filter duplicates
9072 for cf_add_1lib in $cf_add_0lib; do
9073         for cf_add_2lib in $cf_add_libs; do
9074                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9075                         cf_add_1lib=
9076                         break
9077                 fi
9078         done
9079         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9080 done
9081 LIBS="$cf_add_libs"
9082
9083 else
9084
9085         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9086         cf_libdir=""
9087         echo "$as_me:9087: checking for initscr" >&5
9088 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9089 if test "${ac_cv_func_initscr+set}" = set; then
9090   echo $ECHO_N "(cached) $ECHO_C" >&6
9091 else
9092   cat >"conftest.$ac_ext" <<_ACEOF
9093 #line 9093 "configure"
9094 #include "confdefs.h"
9095 #define initscr autoconf_temporary
9096 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9097 #undef initscr
9098
9099 #ifdef __cplusplus
9100 extern "C"
9101 #endif
9102
9103 /* We use char because int might match the return type of a gcc2
9104    builtin and then its argument prototype would still apply.  */
9105 char initscr (void);
9106
9107 int
9108 main (void)
9109 {
9110
9111 /* The GNU C library defines stubs for functions which it implements
9112     to always fail with ENOSYS.  Some functions are actually named
9113     something starting with __ and the normal name is an alias.  */
9114 #if defined (__stub_initscr) || defined (__stub___initscr)
9115 #error found stub for initscr
9116 #endif
9117
9118         return initscr ();
9119   ;
9120   return 0;
9121 }
9122 _ACEOF
9123 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9124 if { (eval echo "$as_me:9124: \"$ac_link\"") >&5
9125   (eval $ac_link) 2>&5
9126   ac_status=$?
9127   echo "$as_me:9127: \$? = $ac_status" >&5
9128   (exit "$ac_status"); } &&
9129          { ac_try='test -s "conftest$ac_exeext"'
9130   { (eval echo "$as_me:9130: \"$ac_try\"") >&5
9131   (eval $ac_try) 2>&5
9132   ac_status=$?
9133   echo "$as_me:9133: \$? = $ac_status" >&5
9134   (exit "$ac_status"); }; }; then
9135   ac_cv_func_initscr=yes
9136 else
9137   echo "$as_me: failed program was:" >&5
9138 cat "conftest.$ac_ext" >&5
9139 ac_cv_func_initscr=no
9140 fi
9141 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9142 fi
9143 echo "$as_me:9143: result: $ac_cv_func_initscr" >&5
9144 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9145 if test "$ac_cv_func_initscr" = yes; then
9146   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9147 else
9148
9149                 cf_save_LIBS="$LIBS"
9150                 echo "$as_me:9150: checking for initscr in -l$cf_nculib_root" >&5
9151 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9152                 LIBS="-l$cf_nculib_root $LIBS"
9153                 cat >"conftest.$ac_ext" <<_ACEOF
9154 #line 9154 "configure"
9155 #include "confdefs.h"
9156 #include <${cf_cv_ncurses_header:-curses.h}>
9157 int
9158 main (void)
9159 {
9160 initscr()
9161   ;
9162   return 0;
9163 }
9164 _ACEOF
9165 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9166 if { (eval echo "$as_me:9166: \"$ac_link\"") >&5
9167   (eval $ac_link) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit "$ac_status"); } &&
9171          { ac_try='test -s "conftest$ac_exeext"'
9172   { (eval echo "$as_me:9172: \"$ac_try\"") >&5
9173   (eval $ac_try) 2>&5
9174   ac_status=$?
9175   echo "$as_me:9175: \$? = $ac_status" >&5
9176   (exit "$ac_status"); }; }; then
9177   echo "$as_me:9177: result: yes" >&5
9178 echo "${ECHO_T}yes" >&6
9179                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9180
9181 else
9182   echo "$as_me: failed program was:" >&5
9183 cat "conftest.$ac_ext" >&5
9184 echo "$as_me:9184: result: no" >&5
9185 echo "${ECHO_T}no" >&6
9186
9187 cf_search=
9188 cf_library_path_list=""
9189 if test -n "${LDFLAGS}${LIBS}" ; then
9190         for cf_library_path in $LDFLAGS $LIBS
9191         do
9192                 case "$cf_library_path" in
9193                 (-L*)
9194                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9195
9196 test "x$cf_library_path" != "xNONE" && \
9197 test -d "$cf_library_path" && \
9198  {
9199         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9200         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9201         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9202         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9203         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9204         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"
9205 }
9206
9207                         cf_library_path_list="$cf_library_path_list $cf_search"
9208                         ;;
9209                 esac
9210         done
9211 fi
9212
9213 cf_search=
9214
9215 test "x$prefix" != "xNONE" && \
9216 test -d "$prefix" && \
9217  {
9218         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9219         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9220         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9221         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9222         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9223         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9224 }
9225
9226 for cf_subdir_prefix in \
9227         /usr \
9228         /usr/local \
9229         /usr/pkg \
9230         /opt \
9231         /opt/local \
9232         $HOME
9233 do
9234
9235 test "x$cf_subdir_prefix" != "x$prefix" && \
9236 test -d "$cf_subdir_prefix" && \
9237 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9238         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9239         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9240         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9241         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9242         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9243         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"
9244 }
9245
9246 done
9247
9248 cf_search="$cf_library_path_list $cf_search"
9249
9250                         for cf_libdir in $cf_search
9251                         do
9252                                 echo "$as_me:9252: checking for -l$cf_nculib_root in $cf_libdir" >&5
9253 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9254                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9255                                 cat >"conftest.$ac_ext" <<_ACEOF
9256 #line 9256 "configure"
9257 #include "confdefs.h"
9258 #include <${cf_cv_ncurses_header:-curses.h}>
9259 int
9260 main (void)
9261 {
9262 initscr()
9263   ;
9264   return 0;
9265 }
9266 _ACEOF
9267 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9268 if { (eval echo "$as_me:9268: \"$ac_link\"") >&5
9269   (eval $ac_link) 2>&5
9270   ac_status=$?
9271   echo "$as_me:9271: \$? = $ac_status" >&5
9272   (exit "$ac_status"); } &&
9273          { ac_try='test -s "conftest$ac_exeext"'
9274   { (eval echo "$as_me:9274: \"$ac_try\"") >&5
9275   (eval $ac_try) 2>&5
9276   ac_status=$?
9277   echo "$as_me:9277: \$? = $ac_status" >&5
9278   (exit "$ac_status"); }; }; then
9279   echo "$as_me:9279: result: yes" >&5
9280 echo "${ECHO_T}yes" >&6
9281                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9282                                          break
9283 else
9284   echo "$as_me: failed program was:" >&5
9285 cat "conftest.$ac_ext" >&5
9286 echo "$as_me:9286: result: no" >&5
9287 echo "${ECHO_T}no" >&6
9288                                          LIBS="$cf_save_LIBS"
9289 fi
9290 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9291                         done
9292
9293 fi
9294 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9295
9296 fi
9297
9298 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9299
9300 if test "$cf_found_library" = no ; then
9301         { { echo "$as_me:9301: error: Cannot link $cf_nculib_root library" >&5
9302 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9303    { (exit 1); exit 1; }; }
9304 fi
9305
9306 fi
9307
9308 if test -n "$cf_ncurses_LIBS" ; then
9309         echo "$as_me:9309: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9310 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9311         cf_ncurses_SAVE="$LIBS"
9312         for p in $cf_ncurses_LIBS ; do
9313                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9314                 if test "$q" != "$LIBS" ; then
9315                         LIBS="$q"
9316                 fi
9317         done
9318         cat >"conftest.$ac_ext" <<_ACEOF
9319 #line 9319 "configure"
9320 #include "confdefs.h"
9321 #include <${cf_cv_ncurses_header:-curses.h}>
9322 int
9323 main (void)
9324 {
9325 initscr(); mousemask(0,0); tigetstr((char *)0);
9326   ;
9327   return 0;
9328 }
9329 _ACEOF
9330 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9331 if { (eval echo "$as_me:9331: \"$ac_link\"") >&5
9332   (eval $ac_link) 2>&5
9333   ac_status=$?
9334   echo "$as_me:9334: \$? = $ac_status" >&5
9335   (exit "$ac_status"); } &&
9336          { ac_try='test -s "conftest$ac_exeext"'
9337   { (eval echo "$as_me:9337: \"$ac_try\"") >&5
9338   (eval $ac_try) 2>&5
9339   ac_status=$?
9340   echo "$as_me:9340: \$? = $ac_status" >&5
9341   (exit "$ac_status"); }; }; then
9342   echo "$as_me:9342: result: yes" >&5
9343 echo "${ECHO_T}yes" >&6
9344 else
9345   echo "$as_me: failed program was:" >&5
9346 cat "conftest.$ac_ext" >&5
9347 echo "$as_me:9347: result: no" >&5
9348 echo "${ECHO_T}no" >&6
9349                  LIBS="$cf_ncurses_SAVE"
9350 fi
9351 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9352 fi
9353
9354 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9355
9356 cat >>confdefs.h <<EOF
9357 #define $cf_nculib_ROOT 1
9358 EOF
9359
9360         fi
9361 else
9362         NCURSES_CONFIG=none
9363 fi
9364
9365 else
9366
9367 cf_ncuconfig_root=ncurses
9368 cf_have_ncuconfig=no
9369
9370 if test "x${PKG_CONFIG:=none}" != xnone; then
9371         echo "$as_me:9371: checking pkg-config for $cf_ncuconfig_root" >&5
9372 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9373         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9374                 echo "$as_me:9374: result: yes" >&5
9375 echo "${ECHO_T}yes" >&6
9376
9377                 echo "$as_me:9377: checking if the $cf_ncuconfig_root package files work" >&5
9378 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9379                 cf_have_ncuconfig=unknown
9380
9381                 cf_save_CFLAGS="$CFLAGS"
9382                 cf_save_CPPFLAGS="$CPPFLAGS"
9383                 cf_save_LIBS="$LIBS"
9384
9385                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9386                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9387
9388                 # while -W for passing linker flags is prevalent, it is not "standard".
9389                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9390                 # incompatible _and_ non-standard -W option which gives an error.  Work
9391                 # around that pitfall.
9392                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9393                 (x*c[89]9@@*-W*)
9394
9395 cf_fix_cppflags=no
9396 cf_new_cflags=
9397 cf_new_cppflags=
9398 cf_new_extra_cppflags=
9399
9400 for cf_add_cflags in $cf_pkg_cflags
9401 do
9402 case "$cf_fix_cppflags" in
9403 (no)
9404         case "$cf_add_cflags" in
9405         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9406                 case "$cf_add_cflags" in
9407                 (-D*)
9408                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9409
9410                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9411                                 && test -z "${cf_tst_cflags}" \
9412                                 && cf_fix_cppflags=yes
9413
9414                         if test "$cf_fix_cppflags" = yes ; then
9415
9416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9418
9419                                 continue
9420                         elif test "${cf_tst_cflags}" = "\"'" ; then
9421
9422         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9423         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9424
9425                                 continue
9426                         fi
9427                         ;;
9428                 esac
9429                 case "$CPPFLAGS" in
9430                 (*$cf_add_cflags)
9431                         ;;
9432                 (*)
9433                         case "$cf_add_cflags" in
9434                         (-D*)
9435                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9436
9437 CPPFLAGS=`echo "$CPPFLAGS" | \
9438         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9439                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9440
9441                                 ;;
9442                         esac
9443
9444         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9445         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9446
9447                         ;;
9448                 esac
9449                 ;;
9450         (*)
9451
9452         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9453         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9454
9455                 ;;
9456         esac
9457         ;;
9458 (yes)
9459
9460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9462
9463         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9464
9465         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9466                 && test -z "${cf_tst_cflags}" \
9467                 && cf_fix_cppflags=no
9468         ;;
9469 esac
9470 done
9471
9472 if test -n "$cf_new_cflags" ; then
9473
9474         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9475         CFLAGS="${CFLAGS}$cf_new_cflags"
9476
9477 fi
9478
9479 if test -n "$cf_new_cppflags" ; then
9480
9481         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9482         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9483
9484 fi
9485
9486 if test -n "$cf_new_extra_cppflags" ; then
9487
9488         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9489         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9490
9491 fi
9492
9493 cf_add_libs="$LIBS"
9494 # reverse order
9495 cf_add_0lib=
9496 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9497 # filter duplicates
9498 for cf_add_1lib in $cf_add_0lib; do
9499         for cf_add_2lib in $cf_add_libs; do
9500                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9501                         cf_add_1lib=
9502                         break
9503                 fi
9504         done
9505         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9506 done
9507 LIBS="$cf_add_libs"
9508
9509                         cat >"conftest.$ac_ext" <<_ACEOF
9510 #line 9510 "configure"
9511 #include "confdefs.h"
9512 #include <${cf_cv_ncurses_header:-curses.h}>
9513 int
9514 main (void)
9515 {
9516 initscr(); mousemask(0,0); tigetstr((char *)0);
9517   ;
9518   return 0;
9519 }
9520 _ACEOF
9521 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9522 if { (eval echo "$as_me:9522: \"$ac_link\"") >&5
9523   (eval $ac_link) 2>&5
9524   ac_status=$?
9525   echo "$as_me:9525: \$? = $ac_status" >&5
9526   (exit "$ac_status"); } &&
9527          { ac_try='test -s "conftest$ac_exeext"'
9528   { (eval echo "$as_me:9528: \"$ac_try\"") >&5
9529   (eval $ac_try) 2>&5
9530   ac_status=$?
9531   echo "$as_me:9531: \$? = $ac_status" >&5
9532   (exit "$ac_status"); }; }; then
9533   if test "$cross_compiling" = yes; then
9534   cf_test_ncuconfig=maybe
9535 else
9536   cat >"conftest.$ac_ext" <<_ACEOF
9537 #line 9537 "configure"
9538 #include "confdefs.h"
9539 #include <${cf_cv_ncurses_header:-curses.h}>
9540                                         int main(void)
9541                                         { const char *xx = curses_version(); return (xx == 0); }
9542 _ACEOF
9543 rm -f "conftest$ac_exeext"
9544 if { (eval echo "$as_me:9544: \"$ac_link\"") >&5
9545   (eval $ac_link) 2>&5
9546   ac_status=$?
9547   echo "$as_me:9547: \$? = $ac_status" >&5
9548   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9549   { (eval echo "$as_me:9549: \"$ac_try\"") >&5
9550   (eval $ac_try) 2>&5
9551   ac_status=$?
9552   echo "$as_me:9552: \$? = $ac_status" >&5
9553   (exit "$ac_status"); }; }; then
9554   cf_test_ncuconfig=yes
9555 else
9556   echo "$as_me: program exited with status $ac_status" >&5
9557 echo "$as_me: failed program was:" >&5
9558 cat "conftest.$ac_ext" >&5
9559 cf_test_ncuconfig=no
9560 fi
9561 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9562 fi
9563 else
9564   echo "$as_me: failed program was:" >&5
9565 cat "conftest.$ac_ext" >&5
9566 cf_test_ncuconfig=no
9567 fi
9568 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9569
9570                         CFLAGS="$cf_save_CFLAGS"
9571                         CPPFLAGS="$cf_save_CPPFLAGS"
9572                         LIBS="$cf_save_LIBS"
9573
9574                         if test "x$cf_test_ncuconfig" != xyes; then
9575                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9576                                 cf_pkg_cflags="$cf_temp"
9577                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9578                                 cf_pkg_libs="$cf_temp"
9579                         fi
9580                         ;;
9581                 esac
9582
9583 for cf_add_cflags in $cf_pkg_cflags
9584 do
9585         case "x$cf_add_cflags" in
9586         (x-[DU]*)
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$CFLAGS" | 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 "$CFLAGS" != "$cf_old_cflag" || break
9593
9594         CFLAGS="$cf_old_cflag"
9595 done
9596
9597 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9598 while true
9599 do
9600         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'`
9601         test "$CPPFLAGS" != "$cf_old_cflag" || break
9602
9603         CPPFLAGS="$cf_old_cflag"
9604 done
9605
9606                 ;;
9607         esac
9608
9609 cf_fix_cppflags=no
9610 cf_new_cflags=
9611 cf_new_cppflags=
9612 cf_new_extra_cppflags=
9613
9614 for cf_add_cflags in $cf_add_cflags
9615 do
9616 case "$cf_fix_cppflags" in
9617 (no)
9618         case "$cf_add_cflags" in
9619         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9620                 case "$cf_add_cflags" in
9621                 (-D*)
9622                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9623
9624                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9625                                 && test -z "${cf_tst_cflags}" \
9626                                 && cf_fix_cppflags=yes
9627
9628                         if test "$cf_fix_cppflags" = yes ; then
9629
9630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9632
9633                                 continue
9634                         elif test "${cf_tst_cflags}" = "\"'" ; then
9635
9636         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9637         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9638
9639                                 continue
9640                         fi
9641                         ;;
9642                 esac
9643                 case "$CPPFLAGS" in
9644                 (*$cf_add_cflags)
9645                         ;;
9646                 (*)
9647                         case "$cf_add_cflags" in
9648                         (-D*)
9649                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9650
9651 CPPFLAGS=`echo "$CPPFLAGS" | \
9652         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9653                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9654
9655                                 ;;
9656                         esac
9657
9658         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9659         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9660
9661                         ;;
9662                 esac
9663                 ;;
9664         (*)
9665
9666         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9667         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9668
9669                 ;;
9670         esac
9671         ;;
9672 (yes)
9673
9674         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9675         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9676
9677         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9678
9679         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9680                 && test -z "${cf_tst_cflags}" \
9681                 && cf_fix_cppflags=no
9682         ;;
9683 esac
9684 done
9685
9686 if test -n "$cf_new_cflags" ; then
9687
9688         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9689         CFLAGS="${CFLAGS}$cf_new_cflags"
9690
9691 fi
9692
9693 if test -n "$cf_new_cppflags" ; then
9694
9695         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9696         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9697
9698 fi
9699
9700 if test -n "$cf_new_extra_cppflags" ; then
9701
9702         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9703         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9704
9705 fi
9706
9707 done
9708
9709 cf_add_libs="$LIBS"
9710 # reverse order
9711 cf_add_0lib=
9712 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9713 # filter duplicates
9714 for cf_add_1lib in $cf_add_0lib; do
9715         for cf_add_2lib in $cf_add_libs; do
9716                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9717                         cf_add_1lib=
9718                         break
9719                 fi
9720         done
9721         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9722 done
9723 LIBS="$cf_add_libs"
9724
9725                 cat >"conftest.$ac_ext" <<_ACEOF
9726 #line 9726 "configure"
9727 #include "confdefs.h"
9728 #include <${cf_cv_ncurses_header:-curses.h}>
9729 int
9730 main (void)
9731 {
9732 initscr(); mousemask(0,0); tigetstr((char *)0);
9733   ;
9734   return 0;
9735 }
9736 _ACEOF
9737 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9738 if { (eval echo "$as_me:9738: \"$ac_link\"") >&5
9739   (eval $ac_link) 2>&5
9740   ac_status=$?
9741   echo "$as_me:9741: \$? = $ac_status" >&5
9742   (exit "$ac_status"); } &&
9743          { ac_try='test -s "conftest$ac_exeext"'
9744   { (eval echo "$as_me:9744: \"$ac_try\"") >&5
9745   (eval $ac_try) 2>&5
9746   ac_status=$?
9747   echo "$as_me:9747: \$? = $ac_status" >&5
9748   (exit "$ac_status"); }; }; then
9749   if test "$cross_compiling" = yes; then
9750   cf_have_ncuconfig=maybe
9751 else
9752   cat >"conftest.$ac_ext" <<_ACEOF
9753 #line 9753 "configure"
9754 #include "confdefs.h"
9755 #include <${cf_cv_ncurses_header:-curses.h}>
9756                                 int main(void)
9757                                 { const char *xx = curses_version(); return (xx == 0); }
9758 _ACEOF
9759 rm -f "conftest$ac_exeext"
9760 if { (eval echo "$as_me:9760: \"$ac_link\"") >&5
9761   (eval $ac_link) 2>&5
9762   ac_status=$?
9763   echo "$as_me:9763: \$? = $ac_status" >&5
9764   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9765   { (eval echo "$as_me:9765: \"$ac_try\"") >&5
9766   (eval $ac_try) 2>&5
9767   ac_status=$?
9768   echo "$as_me:9768: \$? = $ac_status" >&5
9769   (exit "$ac_status"); }; }; then
9770   cf_have_ncuconfig=yes
9771 else
9772   echo "$as_me: program exited with status $ac_status" >&5
9773 echo "$as_me: failed program was:" >&5
9774 cat "conftest.$ac_ext" >&5
9775 cf_have_ncuconfig=no
9776 fi
9777 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9778 fi
9779 else
9780   echo "$as_me: failed program was:" >&5
9781 cat "conftest.$ac_ext" >&5
9782 cf_have_ncuconfig=no
9783 fi
9784 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9785                 echo "$as_me:9785: result: $cf_have_ncuconfig" >&5
9786 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9787                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9788                 if test "$cf_have_ncuconfig" != "yes"
9789                 then
9790                         CPPFLAGS="$cf_save_CPPFLAGS"
9791                         LIBS="$cf_save_LIBS"
9792                         NCURSES_CONFIG_PKG=none
9793                 else
9794
9795 cat >>confdefs.h <<\EOF
9796 #define NCURSES 1
9797 EOF
9798
9799                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9800
9801 echo "$as_me:9801: checking for terminfo header" >&5
9802 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9803 if test "${cf_cv_term_header+set}" = set; then
9804   echo $ECHO_N "(cached) $ECHO_C" >&6
9805 else
9806
9807 case "${cf_cv_ncurses_header}" in
9808 (*/ncurses.h|*/ncursesw.h)
9809         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9810         ;;
9811 (*)
9812         cf_term_header=term.h
9813         ;;
9814 esac
9815
9816 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9817 do
9818 cat >"conftest.$ac_ext" <<_ACEOF
9819 #line 9819 "configure"
9820 #include "confdefs.h"
9821 #include <stdio.h>
9822 #include <${cf_cv_ncurses_header:-curses.h}>
9823 #include <$cf_test>
9824
9825 int
9826 main (void)
9827 {
9828 int x = auto_left_margin; (void)x
9829   ;
9830   return 0;
9831 }
9832 _ACEOF
9833 rm -f "conftest.$ac_objext"
9834 if { (eval echo "$as_me:9834: \"$ac_compile\"") >&5
9835   (eval $ac_compile) 2>&5
9836   ac_status=$?
9837   echo "$as_me:9837: \$? = $ac_status" >&5
9838   (exit "$ac_status"); } &&
9839          { ac_try='test -s "conftest.$ac_objext"'
9840   { (eval echo "$as_me:9840: \"$ac_try\"") >&5
9841   (eval $ac_try) 2>&5
9842   ac_status=$?
9843   echo "$as_me:9843: \$? = $ac_status" >&5
9844   (exit "$ac_status"); }; }; then
9845
9846         cf_cv_term_header="$cf_test"
9847 else
9848   echo "$as_me: failed program was:" >&5
9849 cat "conftest.$ac_ext" >&5
9850
9851         cf_cv_term_header=unknown
9852
9853 fi
9854 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9855         test "$cf_cv_term_header" != unknown && break
9856 done
9857
9858 fi
9859 echo "$as_me:9859: result: $cf_cv_term_header" >&5
9860 echo "${ECHO_T}$cf_cv_term_header" >&6
9861
9862 # Set definitions to allow ifdef'ing to accommodate subdirectories
9863
9864 case "$cf_cv_term_header" in
9865 (*term.h)
9866
9867 cat >>confdefs.h <<\EOF
9868 #define HAVE_TERM_H 1
9869 EOF
9870
9871         ;;
9872 esac
9873
9874 case "$cf_cv_term_header" in
9875 (ncurses/term.h)
9876
9877 cat >>confdefs.h <<\EOF
9878 #define HAVE_NCURSES_TERM_H 1
9879 EOF
9880
9881         ;;
9882 (ncursesw/term.h)
9883
9884 cat >>confdefs.h <<\EOF
9885 #define HAVE_NCURSESW_TERM_H 1
9886 EOF
9887
9888         ;;
9889 esac
9890
9891                 fi
9892
9893         else
9894                 echo "$as_me:9894: result: no" >&5
9895 echo "${ECHO_T}no" >&6
9896                 NCURSES_CONFIG_PKG=none
9897         fi
9898 else
9899         NCURSES_CONFIG_PKG=none
9900 fi
9901
9902 if test "x$cf_have_ncuconfig" = "xno"; then
9903         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9904
9905 if test -n "$ac_tool_prefix"; then
9906   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9907   do
9908     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9909 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9910 echo "$as_me:9910: checking for $ac_word" >&5
9911 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9912 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9913   echo $ECHO_N "(cached) $ECHO_C" >&6
9914 else
9915   if test -n "$NCURSES_CONFIG"; then
9916   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9917 else
9918   ac_save_IFS=$IFS; IFS=$ac_path_separator
9919 ac_dummy="$PATH"
9920 for ac_dir in $ac_dummy; do
9921   IFS=$ac_save_IFS
9922   test -z "$ac_dir" && ac_dir=.
9923   $as_executable_p "$ac_dir/$ac_word" || continue
9924 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9925 echo "$as_me:9925: found $ac_dir/$ac_word" >&5
9926 break
9927 done
9928
9929 fi
9930 fi
9931 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9932 if test -n "$NCURSES_CONFIG"; then
9933   echo "$as_me:9933: result: $NCURSES_CONFIG" >&5
9934 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9935 else
9936   echo "$as_me:9936: result: no" >&5
9937 echo "${ECHO_T}no" >&6
9938 fi
9939
9940     test -n "$NCURSES_CONFIG" && break
9941   done
9942 fi
9943 if test -z "$NCURSES_CONFIG"; then
9944   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9945   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9946 do
9947   # Extract the first word of "$ac_prog", so it can be a program name with args.
9948 set dummy $ac_prog; ac_word=$2
9949 echo "$as_me:9949: checking for $ac_word" >&5
9950 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9951 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9952   echo $ECHO_N "(cached) $ECHO_C" >&6
9953 else
9954   if test -n "$ac_ct_NCURSES_CONFIG"; then
9955   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9956 else
9957   ac_save_IFS=$IFS; IFS=$ac_path_separator
9958 ac_dummy="$PATH"
9959 for ac_dir in $ac_dummy; do
9960   IFS=$ac_save_IFS
9961   test -z "$ac_dir" && ac_dir=.
9962   $as_executable_p "$ac_dir/$ac_word" || continue
9963 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9964 echo "$as_me:9964: found $ac_dir/$ac_word" >&5
9965 break
9966 done
9967
9968 fi
9969 fi
9970 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9971 if test -n "$ac_ct_NCURSES_CONFIG"; then
9972   echo "$as_me:9972: result: $ac_ct_NCURSES_CONFIG" >&5
9973 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9974 else
9975   echo "$as_me:9975: result: no" >&5
9976 echo "${ECHO_T}no" >&6
9977 fi
9978
9979   test -n "$ac_ct_NCURSES_CONFIG" && break
9980 done
9981 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9982
9983   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9984 fi
9985
9986         if test "$NCURSES_CONFIG" != none ; then
9987
9988 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9989 do
9990         case "x$cf_add_cflags" in
9991         (x-[DU]*)
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$CFLAGS" | 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 "$CFLAGS" != "$cf_old_cflag" || break
9998
9999         CFLAGS="$cf_old_cflag"
10000 done
10001
10002 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10003 while true
10004 do
10005         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'`
10006         test "$CPPFLAGS" != "$cf_old_cflag" || break
10007
10008         CPPFLAGS="$cf_old_cflag"
10009 done
10010
10011                 ;;
10012         esac
10013
10014 cf_fix_cppflags=no
10015 cf_new_cflags=
10016 cf_new_cppflags=
10017 cf_new_extra_cppflags=
10018
10019 for cf_add_cflags in $cf_add_cflags
10020 do
10021 case "$cf_fix_cppflags" in
10022 (no)
10023         case "$cf_add_cflags" in
10024         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10025                 case "$cf_add_cflags" in
10026                 (-D*)
10027                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10028
10029                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10030                                 && test -z "${cf_tst_cflags}" \
10031                                 && cf_fix_cppflags=yes
10032
10033                         if test "$cf_fix_cppflags" = yes ; then
10034
10035         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10036         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10037
10038                                 continue
10039                         elif test "${cf_tst_cflags}" = "\"'" ; then
10040
10041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10043
10044                                 continue
10045                         fi
10046                         ;;
10047                 esac
10048                 case "$CPPFLAGS" in
10049                 (*$cf_add_cflags)
10050                         ;;
10051                 (*)
10052                         case "$cf_add_cflags" in
10053                         (-D*)
10054                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10055
10056 CPPFLAGS=`echo "$CPPFLAGS" | \
10057         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10058                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10059
10060                                 ;;
10061                         esac
10062
10063         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10064         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10065
10066                         ;;
10067                 esac
10068                 ;;
10069         (*)
10070
10071         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10072         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10073
10074                 ;;
10075         esac
10076         ;;
10077 (yes)
10078
10079         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10080         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10081
10082         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10083
10084         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10085                 && test -z "${cf_tst_cflags}" \
10086                 && cf_fix_cppflags=no
10087         ;;
10088 esac
10089 done
10090
10091 if test -n "$cf_new_cflags" ; then
10092
10093         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10094         CFLAGS="${CFLAGS}$cf_new_cflags"
10095
10096 fi
10097
10098 if test -n "$cf_new_cppflags" ; then
10099
10100         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10101         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10102
10103 fi
10104
10105 if test -n "$cf_new_extra_cppflags" ; then
10106
10107         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10108         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10109
10110 fi
10111
10112 done
10113
10114 cf_add_libs="$LIBS"
10115 # reverse order
10116 cf_add_0lib=
10117 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10118 # filter duplicates
10119 for cf_add_1lib in $cf_add_0lib; do
10120         for cf_add_2lib in $cf_add_libs; do
10121                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10122                         cf_add_1lib=
10123                         break
10124                 fi
10125         done
10126         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10127 done
10128 LIBS="$cf_add_libs"
10129
10130                 # even with config script, some packages use no-override for curses.h
10131
10132 echo "$as_me:10132: checking if we have identified curses headers" >&5
10133 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10134 if test "${cf_cv_ncurses_header+set}" = set; then
10135   echo $ECHO_N "(cached) $ECHO_C" >&6
10136 else
10137
10138 cf_cv_ncurses_header=none
10139 for cf_header in \
10140         ncurses.h ncurses/ncurses.h \
10141         curses.h ncurses/curses.h
10142 do
10143 cat >"conftest.$ac_ext" <<_ACEOF
10144 #line 10144 "configure"
10145 #include "confdefs.h"
10146 #include <${cf_header}>
10147 int
10148 main (void)
10149 {
10150 initscr(); endwin()
10151   ;
10152   return 0;
10153 }
10154 _ACEOF
10155 rm -f "conftest.$ac_objext"
10156 if { (eval echo "$as_me:10156: \"$ac_compile\"") >&5
10157   (eval $ac_compile) 2>&5
10158   ac_status=$?
10159   echo "$as_me:10159: \$? = $ac_status" >&5
10160   (exit "$ac_status"); } &&
10161          { ac_try='test -s "conftest.$ac_objext"'
10162   { (eval echo "$as_me:10162: \"$ac_try\"") >&5
10163   (eval $ac_try) 2>&5
10164   ac_status=$?
10165   echo "$as_me:10165: \$? = $ac_status" >&5
10166   (exit "$ac_status"); }; }; then
10167   cf_cv_ncurses_header=$cf_header; break
10168 else
10169   echo "$as_me: failed program was:" >&5
10170 cat "conftest.$ac_ext" >&5
10171 fi
10172 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10173 done
10174
10175 fi
10176 echo "$as_me:10176: result: $cf_cv_ncurses_header" >&5
10177 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10178
10179 if test "$cf_cv_ncurses_header" = none ; then
10180         { { echo "$as_me:10180: error: No curses header-files found" >&5
10181 echo "$as_me: error: No curses header-files found" >&2;}
10182    { (exit 1); exit 1; }; }
10183 fi
10184
10185 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10186
10187 for ac_header in $cf_cv_ncurses_header
10188 do
10189 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10190 echo "$as_me:10190: checking for $ac_header" >&5
10191 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10192 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10193   echo $ECHO_N "(cached) $ECHO_C" >&6
10194 else
10195   cat >"conftest.$ac_ext" <<_ACEOF
10196 #line 10196 "configure"
10197 #include "confdefs.h"
10198 #include <$ac_header>
10199 _ACEOF
10200 if { (eval echo "$as_me:10200: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10201   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10202   ac_status=$?
10203   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10204   rm -f conftest.er1
10205   cat conftest.err >&5
10206   echo "$as_me:10206: \$? = $ac_status" >&5
10207   (exit "$ac_status"); } >/dev/null; then
10208   if test -s conftest.err; then
10209     ac_cpp_err=$ac_c_preproc_warn_flag
10210   else
10211     ac_cpp_err=
10212   fi
10213 else
10214   ac_cpp_err=yes
10215 fi
10216 if test -z "$ac_cpp_err"; then
10217   eval "$as_ac_Header=yes"
10218 else
10219   echo "$as_me: failed program was:" >&5
10220   cat "conftest.$ac_ext" >&5
10221   eval "$as_ac_Header=no"
10222 fi
10223 rm -f conftest.err "conftest.$ac_ext"
10224 fi
10225 echo "$as_me:10225: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10226 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10227 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10228   cat >>confdefs.h <<EOF
10229 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10230 EOF
10231
10232 fi
10233 done
10234
10235 cat >>confdefs.h <<\EOF
10236 #define NCURSES 1
10237 EOF
10238
10239 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10240
10241                 cat >>confdefs.h <<EOF
10242 #define $cf_nculib_ROOT 1
10243 EOF
10244
10245                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10246
10247         else
10248
10249 cf_ncuhdr_root=ncurses
10250
10251 test -n "$cf_cv_curses_dir" && \
10252 test "$cf_cv_curses_dir" != "no" && { \
10253
10254 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10255   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10256   do
10257         while test "$cf_add_incdir" != /usr/include
10258         do
10259           if test -d "$cf_add_incdir"
10260           then
10261                 cf_have_incdir=no
10262                 if test -n "$CFLAGS$CPPFLAGS" ; then
10263                   # a loop is needed to ensure we can add subdirs of existing dirs
10264                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10265                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10266                           cf_have_incdir=yes; break
10267                         fi
10268                   done
10269                 fi
10270
10271                 if test "$cf_have_incdir" = no ; then
10272                   if test "$cf_add_incdir" = /usr/local/include ; then
10273                         if test "$GCC" = yes
10274                         then
10275                           cf_save_CPPFLAGS=$CPPFLAGS
10276
10277         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10278         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10279
10280                           cat >"conftest.$ac_ext" <<_ACEOF
10281 #line 10281 "configure"
10282 #include "confdefs.h"
10283 #include <stdio.h>
10284 int
10285 main (void)
10286 {
10287 printf("Hello")
10288   ;
10289   return 0;
10290 }
10291 _ACEOF
10292 rm -f "conftest.$ac_objext"
10293 if { (eval echo "$as_me:10293: \"$ac_compile\"") >&5
10294   (eval $ac_compile) 2>&5
10295   ac_status=$?
10296   echo "$as_me:10296: \$? = $ac_status" >&5
10297   (exit "$ac_status"); } &&
10298          { ac_try='test -s "conftest.$ac_objext"'
10299   { (eval echo "$as_me:10299: \"$ac_try\"") >&5
10300   (eval $ac_try) 2>&5
10301   ac_status=$?
10302   echo "$as_me:10302: \$? = $ac_status" >&5
10303   (exit "$ac_status"); }; }; then
10304   :
10305 else
10306   echo "$as_me: failed program was:" >&5
10307 cat "conftest.$ac_ext" >&5
10308 cf_have_incdir=yes
10309 fi
10310 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10311                           CPPFLAGS=$cf_save_CPPFLAGS
10312                         fi
10313                   fi
10314                 fi
10315
10316                 if test "$cf_have_incdir" = no ; then
10317                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10318
10319 echo "${as_me:-configure}:10319: testing adding $cf_add_incdir to include-path ..." 1>&5
10320
10321                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10322
10323                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10324                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10325                   cf_add_incdir="$cf_top_incdir"
10326                 else
10327                   break
10328                 fi
10329           else
10330                 break
10331           fi
10332         done
10333   done
10334 fi
10335
10336 }
10337
10338 echo "$as_me:10338: checking for $cf_ncuhdr_root header in include-path" >&5
10339 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10340 if test "${cf_cv_ncurses_h+set}" = set; then
10341   echo $ECHO_N "(cached) $ECHO_C" >&6
10342 else
10343
10344         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10345         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10346         for cf_header in $cf_header_list
10347         do
10348
10349         cat >"conftest.$ac_ext" <<_ACEOF
10350 #line 10350 "configure"
10351 #include "confdefs.h"
10352
10353 #include <$cf_header>
10354 int
10355 main (void)
10356 {
10357
10358 #ifdef NCURSES_VERSION
10359
10360 printf("%s\\n", NCURSES_VERSION);
10361 #else
10362 #ifdef __NCURSES_H
10363 printf("old\\n");
10364 #else
10365         #error __NCURSES_H is not defined
10366 #endif
10367 #endif
10368
10369   ;
10370   return 0;
10371 }
10372 _ACEOF
10373 rm -f "conftest.$ac_objext"
10374 if { (eval echo "$as_me:10374: \"$ac_compile\"") >&5
10375   (eval $ac_compile) 2>&5
10376   ac_status=$?
10377   echo "$as_me:10377: \$? = $ac_status" >&5
10378   (exit "$ac_status"); } &&
10379          { ac_try='test -s "conftest.$ac_objext"'
10380   { (eval echo "$as_me:10380: \"$ac_try\"") >&5
10381   (eval $ac_try) 2>&5
10382   ac_status=$?
10383   echo "$as_me:10383: \$? = $ac_status" >&5
10384   (exit "$ac_status"); }; }; then
10385   cf_cv_ncurses_h=$cf_header
10386
10387 else
10388   echo "$as_me: failed program was:" >&5
10389 cat "conftest.$ac_ext" >&5
10390 cf_cv_ncurses_h=no
10391 fi
10392 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10393
10394                 test "$cf_cv_ncurses_h" != no && break
10395         done
10396
10397 fi
10398 echo "$as_me:10398: result: $cf_cv_ncurses_h" >&5
10399 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10400
10401 if test "$cf_cv_ncurses_h" != no ; then
10402         cf_cv_ncurses_header=$cf_cv_ncurses_h
10403 else
10404
10405 echo "$as_me:10405: checking for $cf_ncuhdr_root include-path" >&5
10406 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10407 if test "${cf_cv_ncurses_h2+set}" = set; then
10408   echo $ECHO_N "(cached) $ECHO_C" >&6
10409 else
10410
10411         test -n "$verbose" && echo
10412
10413 cf_search=
10414
10415 # collect the current set of include-directories from compiler flags
10416 cf_header_path_list=""
10417 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10418         for cf_header_path in $CPPFLAGS $CFLAGS
10419         do
10420                 case "$cf_header_path" in
10421                 (-I*)
10422                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10423
10424 test "x$cf_header_path" != "xNONE" && \
10425 test -d "$cf_header_path" && \
10426  {
10427         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10428         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10429         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10430         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10431         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10432         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"
10433 }
10434
10435                         cf_header_path_list="$cf_header_path_list $cf_search"
10436                         ;;
10437                 esac
10438         done
10439 fi
10440
10441 # add the variations for the package we are looking for
10442
10443 cf_search=
10444
10445 test "x$prefix" != "xNONE" && \
10446 test -d "$prefix" && \
10447  {
10448         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10449         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10450         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10451         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10452         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10453         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10454 }
10455
10456 for cf_subdir_prefix in \
10457         /usr \
10458         /usr/local \
10459         /usr/pkg \
10460         /opt \
10461         /opt/local \
10462         $HOME
10463 do
10464
10465 test "x$cf_subdir_prefix" != "x$prefix" && \
10466 test -d "$cf_subdir_prefix" && \
10467 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10468         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10469         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10470         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10471         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10472         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10473         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"
10474 }
10475
10476 done
10477
10478 test "$includedir" != NONE && \
10479 test "$includedir" != "/usr/include" && \
10480 test -d "$includedir" && {
10481         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10482         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10483 }
10484
10485 test "$oldincludedir" != NONE && \
10486 test "$oldincludedir" != "/usr/include" && \
10487 test -d "$oldincludedir" && {
10488         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10489         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10490 }
10491
10492 cf_search="$cf_search $cf_header_path_list"
10493
10494         test -n "$verbose" && echo "search path $cf_search"
10495         cf_save2_CPPFLAGS="$CPPFLAGS"
10496         for cf_incdir in $cf_search
10497         do
10498
10499 if test -n "$cf_incdir" ; then
10500   for cf_add_incdir in $cf_incdir
10501   do
10502         while test "$cf_add_incdir" != /usr/include
10503         do
10504           if test -d "$cf_add_incdir"
10505           then
10506                 cf_have_incdir=no
10507                 if test -n "$CFLAGS$CPPFLAGS" ; then
10508                   # a loop is needed to ensure we can add subdirs of existing dirs
10509                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10510                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10511                           cf_have_incdir=yes; break
10512                         fi
10513                   done
10514                 fi
10515
10516                 if test "$cf_have_incdir" = no ; then
10517                   if test "$cf_add_incdir" = /usr/local/include ; then
10518                         if test "$GCC" = yes
10519                         then
10520                           cf_save_CPPFLAGS=$CPPFLAGS
10521
10522         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10523         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10524
10525                           cat >"conftest.$ac_ext" <<_ACEOF
10526 #line 10526 "configure"
10527 #include "confdefs.h"
10528 #include <stdio.h>
10529 int
10530 main (void)
10531 {
10532 printf("Hello")
10533   ;
10534   return 0;
10535 }
10536 _ACEOF
10537 rm -f "conftest.$ac_objext"
10538 if { (eval echo "$as_me:10538: \"$ac_compile\"") >&5
10539   (eval $ac_compile) 2>&5
10540   ac_status=$?
10541   echo "$as_me:10541: \$? = $ac_status" >&5
10542   (exit "$ac_status"); } &&
10543          { ac_try='test -s "conftest.$ac_objext"'
10544   { (eval echo "$as_me:10544: \"$ac_try\"") >&5
10545   (eval $ac_try) 2>&5
10546   ac_status=$?
10547   echo "$as_me:10547: \$? = $ac_status" >&5
10548   (exit "$ac_status"); }; }; then
10549   :
10550 else
10551   echo "$as_me: failed program was:" >&5
10552 cat "conftest.$ac_ext" >&5
10553 cf_have_incdir=yes
10554 fi
10555 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10556                           CPPFLAGS=$cf_save_CPPFLAGS
10557                         fi
10558                   fi
10559                 fi
10560
10561                 if test "$cf_have_incdir" = no ; then
10562                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10563
10564 echo "${as_me:-configure}:10564: testing adding $cf_add_incdir to include-path ..." 1>&5
10565
10566                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10567
10568                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10569                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10570                   cf_add_incdir="$cf_top_incdir"
10571                 else
10572                   break
10573                 fi
10574           else
10575                 break
10576           fi
10577         done
10578   done
10579 fi
10580
10581                 for cf_header in \
10582                         ncurses.h \
10583                         curses.h
10584                 do
10585
10586         cat >"conftest.$ac_ext" <<_ACEOF
10587 #line 10587 "configure"
10588 #include "confdefs.h"
10589
10590 #include <$cf_header>
10591 int
10592 main (void)
10593 {
10594
10595 #ifdef NCURSES_VERSION
10596
10597 printf("%s\\n", NCURSES_VERSION);
10598 #else
10599 #ifdef __NCURSES_H
10600 printf("old\\n");
10601 #else
10602         #error __NCURSES_H is not defined
10603 #endif
10604 #endif
10605
10606   ;
10607   return 0;
10608 }
10609 _ACEOF
10610 rm -f "conftest.$ac_objext"
10611 if { (eval echo "$as_me:10611: \"$ac_compile\"") >&5
10612   (eval $ac_compile) 2>&5
10613   ac_status=$?
10614   echo "$as_me:10614: \$? = $ac_status" >&5
10615   (exit "$ac_status"); } &&
10616          { ac_try='test -s "conftest.$ac_objext"'
10617   { (eval echo "$as_me:10617: \"$ac_try\"") >&5
10618   (eval $ac_try) 2>&5
10619   ac_status=$?
10620   echo "$as_me:10620: \$? = $ac_status" >&5
10621   (exit "$ac_status"); }; }; then
10622   cf_cv_ncurses_h2=$cf_header
10623
10624 else
10625   echo "$as_me: failed program was:" >&5
10626 cat "conftest.$ac_ext" >&5
10627 cf_cv_ncurses_h2=no
10628 fi
10629 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10630
10631                         if test "$cf_cv_ncurses_h2" != no ; then
10632                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10633                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10634                                 break
10635                         fi
10636                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10637                 done
10638                 CPPFLAGS="$cf_save2_CPPFLAGS"
10639                 test "$cf_cv_ncurses_h2" != no && break
10640         done
10641         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10641: error: not found" >&5
10642 echo "$as_me: error: not found" >&2;}
10643    { (exit 1); exit 1; }; }
10644
10645 fi
10646 echo "$as_me:10646: result: $cf_cv_ncurses_h2" >&5
10647 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10648
10649         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10650         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10651         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10652                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10653         fi
10654
10655 if test -n "$cf_1st_incdir" ; then
10656   for cf_add_incdir in $cf_1st_incdir
10657   do
10658         while test "$cf_add_incdir" != /usr/include
10659         do
10660           if test -d "$cf_add_incdir"
10661           then
10662                 cf_have_incdir=no
10663                 if test -n "$CFLAGS$CPPFLAGS" ; then
10664                   # a loop is needed to ensure we can add subdirs of existing dirs
10665                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10666                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10667                           cf_have_incdir=yes; break
10668                         fi
10669                   done
10670                 fi
10671
10672                 if test "$cf_have_incdir" = no ; then
10673                   if test "$cf_add_incdir" = /usr/local/include ; then
10674                         if test "$GCC" = yes
10675                         then
10676                           cf_save_CPPFLAGS=$CPPFLAGS
10677
10678         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10679         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10680
10681                           cat >"conftest.$ac_ext" <<_ACEOF
10682 #line 10682 "configure"
10683 #include "confdefs.h"
10684 #include <stdio.h>
10685 int
10686 main (void)
10687 {
10688 printf("Hello")
10689   ;
10690   return 0;
10691 }
10692 _ACEOF
10693 rm -f "conftest.$ac_objext"
10694 if { (eval echo "$as_me:10694: \"$ac_compile\"") >&5
10695   (eval $ac_compile) 2>&5
10696   ac_status=$?
10697   echo "$as_me:10697: \$? = $ac_status" >&5
10698   (exit "$ac_status"); } &&
10699          { ac_try='test -s "conftest.$ac_objext"'
10700   { (eval echo "$as_me:10700: \"$ac_try\"") >&5
10701   (eval $ac_try) 2>&5
10702   ac_status=$?
10703   echo "$as_me:10703: \$? = $ac_status" >&5
10704   (exit "$ac_status"); }; }; then
10705   :
10706 else
10707   echo "$as_me: failed program was:" >&5
10708 cat "conftest.$ac_ext" >&5
10709 cf_have_incdir=yes
10710 fi
10711 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10712                           CPPFLAGS=$cf_save_CPPFLAGS
10713                         fi
10714                   fi
10715                 fi
10716
10717                 if test "$cf_have_incdir" = no ; then
10718                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10719
10720 echo "${as_me:-configure}:10720: testing adding $cf_add_incdir to include-path ..." 1>&5
10721
10722                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10723
10724                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10725                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10726                   cf_add_incdir="$cf_top_incdir"
10727                 else
10728                   break
10729                 fi
10730           else
10731                 break
10732           fi
10733         done
10734   done
10735 fi
10736
10737 fi
10738
10739 # Set definitions to allow ifdef'ing for ncurses.h
10740
10741 case "$cf_cv_ncurses_header" in
10742 (*ncurses.h)
10743
10744 cat >>confdefs.h <<\EOF
10745 #define HAVE_NCURSES_H 1
10746 EOF
10747
10748         ;;
10749 esac
10750
10751 case "$cf_cv_ncurses_header" in
10752 (ncurses/curses.h|ncurses/ncurses.h)
10753
10754 cat >>confdefs.h <<\EOF
10755 #define HAVE_NCURSES_NCURSES_H 1
10756 EOF
10757
10758         ;;
10759 (ncursesw/curses.h|ncursesw/ncurses.h)
10760
10761 cat >>confdefs.h <<\EOF
10762 #define HAVE_NCURSESW_NCURSES_H 1
10763 EOF
10764
10765         ;;
10766 esac
10767
10768 echo "$as_me:10768: checking for terminfo header" >&5
10769 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10770 if test "${cf_cv_term_header+set}" = set; then
10771   echo $ECHO_N "(cached) $ECHO_C" >&6
10772 else
10773
10774 case "${cf_cv_ncurses_header}" in
10775 (*/ncurses.h|*/ncursesw.h)
10776         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10777         ;;
10778 (*)
10779         cf_term_header=term.h
10780         ;;
10781 esac
10782
10783 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10784 do
10785 cat >"conftest.$ac_ext" <<_ACEOF
10786 #line 10786 "configure"
10787 #include "confdefs.h"
10788 #include <stdio.h>
10789 #include <${cf_cv_ncurses_header:-curses.h}>
10790 #include <$cf_test>
10791
10792 int
10793 main (void)
10794 {
10795 int x = auto_left_margin; (void)x
10796   ;
10797   return 0;
10798 }
10799 _ACEOF
10800 rm -f "conftest.$ac_objext"
10801 if { (eval echo "$as_me:10801: \"$ac_compile\"") >&5
10802   (eval $ac_compile) 2>&5
10803   ac_status=$?
10804   echo "$as_me:10804: \$? = $ac_status" >&5
10805   (exit "$ac_status"); } &&
10806          { ac_try='test -s "conftest.$ac_objext"'
10807   { (eval echo "$as_me:10807: \"$ac_try\"") >&5
10808   (eval $ac_try) 2>&5
10809   ac_status=$?
10810   echo "$as_me:10810: \$? = $ac_status" >&5
10811   (exit "$ac_status"); }; }; then
10812
10813         cf_cv_term_header="$cf_test"
10814 else
10815   echo "$as_me: failed program was:" >&5
10816 cat "conftest.$ac_ext" >&5
10817
10818         cf_cv_term_header=unknown
10819
10820 fi
10821 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10822         test "$cf_cv_term_header" != unknown && break
10823 done
10824
10825 fi
10826 echo "$as_me:10826: result: $cf_cv_term_header" >&5
10827 echo "${ECHO_T}$cf_cv_term_header" >&6
10828
10829 # Set definitions to allow ifdef'ing to accommodate subdirectories
10830
10831 case "$cf_cv_term_header" in
10832 (*term.h)
10833
10834 cat >>confdefs.h <<\EOF
10835 #define HAVE_TERM_H 1
10836 EOF
10837
10838         ;;
10839 esac
10840
10841 case "$cf_cv_term_header" in
10842 (ncurses/term.h)
10843
10844 cat >>confdefs.h <<\EOF
10845 #define HAVE_NCURSES_TERM_H 1
10846 EOF
10847
10848         ;;
10849 (ncursesw/term.h)
10850
10851 cat >>confdefs.h <<\EOF
10852 #define HAVE_NCURSESW_TERM_H 1
10853 EOF
10854
10855         ;;
10856 esac
10857
10858 # some applications need this, but should check for NCURSES_VERSION
10859
10860 cat >>confdefs.h <<\EOF
10861 #define NCURSES 1
10862 EOF
10863
10864 echo "$as_me:10864: checking for ncurses version" >&5
10865 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10866 if test "${cf_cv_ncurses_version+set}" = set; then
10867   echo $ECHO_N "(cached) $ECHO_C" >&6
10868 else
10869
10870         cf_cv_ncurses_version=no
10871         cf_tempfile=out$$
10872         rm -f "$cf_tempfile"
10873         if test "$cross_compiling" = yes; then
10874
10875         # This will not work if the preprocessor splits the line after the
10876         # Autoconf token.  The 'unproto' program does that.
10877         cat > "conftest.$ac_ext" <<EOF
10878 #include <${cf_cv_ncurses_header:-curses.h}>
10879 #undef Autoconf
10880 #ifdef NCURSES_VERSION
10881 Autoconf NCURSES_VERSION
10882 #else
10883 #ifdef __NCURSES_H
10884 Autoconf "old"
10885 #endif
10886 ;
10887 #endif
10888 EOF
10889         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10890         { (eval echo "$as_me:10890: \"$cf_try\"") >&5
10891   (eval $cf_try) 2>&5
10892   ac_status=$?
10893   echo "$as_me:10893: \$? = $ac_status" >&5
10894   (exit "$ac_status"); }
10895         if test -f conftest.out ; then
10896                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10897                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10898                 rm -f conftest.out
10899         fi
10900
10901 else
10902   cat >"conftest.$ac_ext" <<_ACEOF
10903 #line 10903 "configure"
10904 #include "confdefs.h"
10905
10906 $ac_includes_default
10907
10908 #include <${cf_cv_ncurses_header:-curses.h}>
10909
10910 int main(void)
10911 {
10912         FILE *fp = fopen("$cf_tempfile", "w");
10913 #ifdef NCURSES_VERSION
10914 # ifdef NCURSES_VERSION_PATCH
10915         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10916 # else
10917         fprintf(fp, "%s\\n", NCURSES_VERSION);
10918 # endif
10919 #else
10920 # ifdef __NCURSES_H
10921         fprintf(fp, "old\\n");
10922 # else
10923         make an error
10924 # endif
10925 #endif
10926         ${cf_cv_main_return:-return}(0);
10927 }
10928 _ACEOF
10929 rm -f "conftest$ac_exeext"
10930 if { (eval echo "$as_me:10930: \"$ac_link\"") >&5
10931   (eval $ac_link) 2>&5
10932   ac_status=$?
10933   echo "$as_me:10933: \$? = $ac_status" >&5
10934   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10935   { (eval echo "$as_me:10935: \"$ac_try\"") >&5
10936   (eval $ac_try) 2>&5
10937   ac_status=$?
10938   echo "$as_me:10938: \$? = $ac_status" >&5
10939   (exit "$ac_status"); }; }; then
10940
10941         cf_cv_ncurses_version=`cat $cf_tempfile`
10942 else
10943   echo "$as_me: program exited with status $ac_status" >&5
10944 echo "$as_me: failed program was:" >&5
10945 cat "conftest.$ac_ext" >&5
10946 fi
10947 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10948 fi
10949         rm -f "$cf_tempfile"
10950
10951 fi
10952 echo "$as_me:10952: result: $cf_cv_ncurses_version" >&5
10953 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10954 test "$cf_cv_ncurses_version" = no ||
10955 cat >>confdefs.h <<\EOF
10956 #define NCURSES 1
10957 EOF
10958
10959 cf_nculib_root=ncurses
10960         # This works, except for the special case where we find gpm, but
10961         # ncurses is in a nonstandard location via $LIBS, and we really want
10962         # to link gpm.
10963 cf_ncurses_LIBS=""
10964 cf_ncurses_SAVE="$LIBS"
10965 echo "$as_me:10965: checking for Gpm_Open in -lgpm" >&5
10966 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10967 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10968   echo $ECHO_N "(cached) $ECHO_C" >&6
10969 else
10970   ac_check_lib_save_LIBS=$LIBS
10971 LIBS="-lgpm  $LIBS"
10972 cat >"conftest.$ac_ext" <<_ACEOF
10973 #line 10973 "configure"
10974 #include "confdefs.h"
10975
10976 /* Override any gcc2 internal prototype to avoid an error.  */
10977 #ifdef __cplusplus
10978 extern "C"
10979 #endif
10980 /* We use char because int might match the return type of a gcc2
10981    builtin and then its argument prototype would still apply.  */
10982 char Gpm_Open ();
10983 int
10984 main (void)
10985 {
10986 Gpm_Open ();
10987   ;
10988   return 0;
10989 }
10990 _ACEOF
10991 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10992 if { (eval echo "$as_me:10992: \"$ac_link\"") >&5
10993   (eval $ac_link) 2>&5
10994   ac_status=$?
10995   echo "$as_me:10995: \$? = $ac_status" >&5
10996   (exit "$ac_status"); } &&
10997          { ac_try='test -s "conftest$ac_exeext"'
10998   { (eval echo "$as_me:10998: \"$ac_try\"") >&5
10999   (eval $ac_try) 2>&5
11000   ac_status=$?
11001   echo "$as_me:11001: \$? = $ac_status" >&5
11002   (exit "$ac_status"); }; }; then
11003   ac_cv_lib_gpm_Gpm_Open=yes
11004 else
11005   echo "$as_me: failed program was:" >&5
11006 cat "conftest.$ac_ext" >&5
11007 ac_cv_lib_gpm_Gpm_Open=no
11008 fi
11009 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11010 LIBS=$ac_check_lib_save_LIBS
11011 fi
11012 echo "$as_me:11012: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11013 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11014 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11015   echo "$as_me:11015: checking for initscr in -lgpm" >&5
11016 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11017 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11018   echo $ECHO_N "(cached) $ECHO_C" >&6
11019 else
11020   ac_check_lib_save_LIBS=$LIBS
11021 LIBS="-lgpm  $LIBS"
11022 cat >"conftest.$ac_ext" <<_ACEOF
11023 #line 11023 "configure"
11024 #include "confdefs.h"
11025
11026 /* Override any gcc2 internal prototype to avoid an error.  */
11027 #ifdef __cplusplus
11028 extern "C"
11029 #endif
11030 /* We use char because int might match the return type of a gcc2
11031    builtin and then its argument prototype would still apply.  */
11032 char initscr ();
11033 int
11034 main (void)
11035 {
11036 initscr ();
11037   ;
11038   return 0;
11039 }
11040 _ACEOF
11041 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11042 if { (eval echo "$as_me:11042: \"$ac_link\"") >&5
11043   (eval $ac_link) 2>&5
11044   ac_status=$?
11045   echo "$as_me:11045: \$? = $ac_status" >&5
11046   (exit "$ac_status"); } &&
11047          { ac_try='test -s "conftest$ac_exeext"'
11048   { (eval echo "$as_me:11048: \"$ac_try\"") >&5
11049   (eval $ac_try) 2>&5
11050   ac_status=$?
11051   echo "$as_me:11051: \$? = $ac_status" >&5
11052   (exit "$ac_status"); }; }; then
11053   ac_cv_lib_gpm_initscr=yes
11054 else
11055   echo "$as_me: failed program was:" >&5
11056 cat "conftest.$ac_ext" >&5
11057 ac_cv_lib_gpm_initscr=no
11058 fi
11059 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11060 LIBS=$ac_check_lib_save_LIBS
11061 fi
11062 echo "$as_me:11062: result: $ac_cv_lib_gpm_initscr" >&5
11063 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11064 if test "$ac_cv_lib_gpm_initscr" = yes; then
11065   LIBS="$cf_ncurses_SAVE"
11066 else
11067   cf_ncurses_LIBS="-lgpm"
11068 fi
11069
11070 fi
11071
11072 case "$host_os" in
11073 (freebsd*)
11074         # This is only necessary if you are linking against an obsolete
11075         # version of ncurses (but it should do no harm, since it is static).
11076         if test "$cf_nculib_root" = ncurses ; then
11077                 echo "$as_me:11077: checking for tgoto in -lmytinfo" >&5
11078 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11079 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11080   echo $ECHO_N "(cached) $ECHO_C" >&6
11081 else
11082   ac_check_lib_save_LIBS=$LIBS
11083 LIBS="-lmytinfo  $LIBS"
11084 cat >"conftest.$ac_ext" <<_ACEOF
11085 #line 11085 "configure"
11086 #include "confdefs.h"
11087
11088 /* Override any gcc2 internal prototype to avoid an error.  */
11089 #ifdef __cplusplus
11090 extern "C"
11091 #endif
11092 /* We use char because int might match the return type of a gcc2
11093    builtin and then its argument prototype would still apply.  */
11094 char tgoto ();
11095 int
11096 main (void)
11097 {
11098 tgoto ();
11099   ;
11100   return 0;
11101 }
11102 _ACEOF
11103 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11104 if { (eval echo "$as_me:11104: \"$ac_link\"") >&5
11105   (eval $ac_link) 2>&5
11106   ac_status=$?
11107   echo "$as_me:11107: \$? = $ac_status" >&5
11108   (exit "$ac_status"); } &&
11109          { ac_try='test -s "conftest$ac_exeext"'
11110   { (eval echo "$as_me:11110: \"$ac_try\"") >&5
11111   (eval $ac_try) 2>&5
11112   ac_status=$?
11113   echo "$as_me:11113: \$? = $ac_status" >&5
11114   (exit "$ac_status"); }; }; then
11115   ac_cv_lib_mytinfo_tgoto=yes
11116 else
11117   echo "$as_me: failed program was:" >&5
11118 cat "conftest.$ac_ext" >&5
11119 ac_cv_lib_mytinfo_tgoto=no
11120 fi
11121 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11122 LIBS=$ac_check_lib_save_LIBS
11123 fi
11124 echo "$as_me:11124: result: $ac_cv_lib_mytinfo_tgoto" >&5
11125 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11126 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11127   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11128 fi
11129
11130         fi
11131         ;;
11132 esac
11133
11134 cf_add_libs="$LIBS"
11135 # reverse order
11136 cf_add_0lib=
11137 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11138 # filter duplicates
11139 for cf_add_1lib in $cf_add_0lib; do
11140         for cf_add_2lib in $cf_add_libs; do
11141                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11142                         cf_add_1lib=
11143                         break
11144                 fi
11145         done
11146         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11147 done
11148 LIBS="$cf_add_libs"
11149
11150 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11151 then
11152
11153 cf_add_libs="$LIBS"
11154 # reverse order
11155 cf_add_0lib=
11156 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11157 # filter duplicates
11158 for cf_add_1lib in $cf_add_0lib; do
11159         for cf_add_2lib in $cf_add_libs; do
11160                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11161                         cf_add_1lib=
11162                         break
11163                 fi
11164         done
11165         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11166 done
11167 LIBS="$cf_add_libs"
11168
11169 else
11170
11171         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11172         cf_libdir=""
11173         echo "$as_me:11173: checking for initscr" >&5
11174 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11175 if test "${ac_cv_func_initscr+set}" = set; then
11176   echo $ECHO_N "(cached) $ECHO_C" >&6
11177 else
11178   cat >"conftest.$ac_ext" <<_ACEOF
11179 #line 11179 "configure"
11180 #include "confdefs.h"
11181 #define initscr autoconf_temporary
11182 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11183 #undef initscr
11184
11185 #ifdef __cplusplus
11186 extern "C"
11187 #endif
11188
11189 /* We use char because int might match the return type of a gcc2
11190    builtin and then its argument prototype would still apply.  */
11191 char initscr (void);
11192
11193 int
11194 main (void)
11195 {
11196
11197 /* The GNU C library defines stubs for functions which it implements
11198     to always fail with ENOSYS.  Some functions are actually named
11199     something starting with __ and the normal name is an alias.  */
11200 #if defined (__stub_initscr) || defined (__stub___initscr)
11201 #error found stub for initscr
11202 #endif
11203
11204         return initscr ();
11205   ;
11206   return 0;
11207 }
11208 _ACEOF
11209 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11210 if { (eval echo "$as_me:11210: \"$ac_link\"") >&5
11211   (eval $ac_link) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit "$ac_status"); } &&
11215          { ac_try='test -s "conftest$ac_exeext"'
11216   { (eval echo "$as_me:11216: \"$ac_try\"") >&5
11217   (eval $ac_try) 2>&5
11218   ac_status=$?
11219   echo "$as_me:11219: \$? = $ac_status" >&5
11220   (exit "$ac_status"); }; }; then
11221   ac_cv_func_initscr=yes
11222 else
11223   echo "$as_me: failed program was:" >&5
11224 cat "conftest.$ac_ext" >&5
11225 ac_cv_func_initscr=no
11226 fi
11227 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11228 fi
11229 echo "$as_me:11229: result: $ac_cv_func_initscr" >&5
11230 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11231 if test "$ac_cv_func_initscr" = yes; then
11232   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11233 else
11234
11235                 cf_save_LIBS="$LIBS"
11236                 echo "$as_me:11236: checking for initscr in -l$cf_nculib_root" >&5
11237 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11238                 LIBS="-l$cf_nculib_root $LIBS"
11239                 cat >"conftest.$ac_ext" <<_ACEOF
11240 #line 11240 "configure"
11241 #include "confdefs.h"
11242 #include <${cf_cv_ncurses_header:-curses.h}>
11243 int
11244 main (void)
11245 {
11246 initscr()
11247   ;
11248   return 0;
11249 }
11250 _ACEOF
11251 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11252 if { (eval echo "$as_me:11252: \"$ac_link\"") >&5
11253   (eval $ac_link) 2>&5
11254   ac_status=$?
11255   echo "$as_me:11255: \$? = $ac_status" >&5
11256   (exit "$ac_status"); } &&
11257          { ac_try='test -s "conftest$ac_exeext"'
11258   { (eval echo "$as_me:11258: \"$ac_try\"") >&5
11259   (eval $ac_try) 2>&5
11260   ac_status=$?
11261   echo "$as_me:11261: \$? = $ac_status" >&5
11262   (exit "$ac_status"); }; }; then
11263   echo "$as_me:11263: result: yes" >&5
11264 echo "${ECHO_T}yes" >&6
11265                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11266
11267 else
11268   echo "$as_me: failed program was:" >&5
11269 cat "conftest.$ac_ext" >&5
11270 echo "$as_me:11270: result: no" >&5
11271 echo "${ECHO_T}no" >&6
11272
11273 cf_search=
11274 cf_library_path_list=""
11275 if test -n "${LDFLAGS}${LIBS}" ; then
11276         for cf_library_path in $LDFLAGS $LIBS
11277         do
11278                 case "$cf_library_path" in
11279                 (-L*)
11280                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11281
11282 test "x$cf_library_path" != "xNONE" && \
11283 test -d "$cf_library_path" && \
11284  {
11285         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11286         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11287         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11288         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11289         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11290         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"
11291 }
11292
11293                         cf_library_path_list="$cf_library_path_list $cf_search"
11294                         ;;
11295                 esac
11296         done
11297 fi
11298
11299 cf_search=
11300
11301 test "x$prefix" != "xNONE" && \
11302 test -d "$prefix" && \
11303  {
11304         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11305         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11306         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11307         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11308         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11309         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11310 }
11311
11312 for cf_subdir_prefix in \
11313         /usr \
11314         /usr/local \
11315         /usr/pkg \
11316         /opt \
11317         /opt/local \
11318         $HOME
11319 do
11320
11321 test "x$cf_subdir_prefix" != "x$prefix" && \
11322 test -d "$cf_subdir_prefix" && \
11323 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11324         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11325         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11326         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11327         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11328         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11329         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"
11330 }
11331
11332 done
11333
11334 cf_search="$cf_library_path_list $cf_search"
11335
11336                         for cf_libdir in $cf_search
11337                         do
11338                                 echo "$as_me:11338: checking for -l$cf_nculib_root in $cf_libdir" >&5
11339 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11340                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11341                                 cat >"conftest.$ac_ext" <<_ACEOF
11342 #line 11342 "configure"
11343 #include "confdefs.h"
11344 #include <${cf_cv_ncurses_header:-curses.h}>
11345 int
11346 main (void)
11347 {
11348 initscr()
11349   ;
11350   return 0;
11351 }
11352 _ACEOF
11353 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11354 if { (eval echo "$as_me:11354: \"$ac_link\"") >&5
11355   (eval $ac_link) 2>&5
11356   ac_status=$?
11357   echo "$as_me:11357: \$? = $ac_status" >&5
11358   (exit "$ac_status"); } &&
11359          { ac_try='test -s "conftest$ac_exeext"'
11360   { (eval echo "$as_me:11360: \"$ac_try\"") >&5
11361   (eval $ac_try) 2>&5
11362   ac_status=$?
11363   echo "$as_me:11363: \$? = $ac_status" >&5
11364   (exit "$ac_status"); }; }; then
11365   echo "$as_me:11365: result: yes" >&5
11366 echo "${ECHO_T}yes" >&6
11367                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11368                                          break
11369 else
11370   echo "$as_me: failed program was:" >&5
11371 cat "conftest.$ac_ext" >&5
11372 echo "$as_me:11372: result: no" >&5
11373 echo "${ECHO_T}no" >&6
11374                                          LIBS="$cf_save_LIBS"
11375 fi
11376 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11377                         done
11378
11379 fi
11380 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11381
11382 fi
11383
11384 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11385
11386 if test "$cf_found_library" = no ; then
11387         { { echo "$as_me:11387: error: Cannot link $cf_nculib_root library" >&5
11388 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11389    { (exit 1); exit 1; }; }
11390 fi
11391
11392 fi
11393
11394 if test -n "$cf_ncurses_LIBS" ; then
11395         echo "$as_me:11395: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11396 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11397         cf_ncurses_SAVE="$LIBS"
11398         for p in $cf_ncurses_LIBS ; do
11399                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11400                 if test "$q" != "$LIBS" ; then
11401                         LIBS="$q"
11402                 fi
11403         done
11404         cat >"conftest.$ac_ext" <<_ACEOF
11405 #line 11405 "configure"
11406 #include "confdefs.h"
11407 #include <${cf_cv_ncurses_header:-curses.h}>
11408 int
11409 main (void)
11410 {
11411 initscr(); mousemask(0,0); tigetstr((char *)0);
11412   ;
11413   return 0;
11414 }
11415 _ACEOF
11416 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11417 if { (eval echo "$as_me:11417: \"$ac_link\"") >&5
11418   (eval $ac_link) 2>&5
11419   ac_status=$?
11420   echo "$as_me:11420: \$? = $ac_status" >&5
11421   (exit "$ac_status"); } &&
11422          { ac_try='test -s "conftest$ac_exeext"'
11423   { (eval echo "$as_me:11423: \"$ac_try\"") >&5
11424   (eval $ac_try) 2>&5
11425   ac_status=$?
11426   echo "$as_me:11426: \$? = $ac_status" >&5
11427   (exit "$ac_status"); }; }; then
11428   echo "$as_me:11428: result: yes" >&5
11429 echo "${ECHO_T}yes" >&6
11430 else
11431   echo "$as_me: failed program was:" >&5
11432 cat "conftest.$ac_ext" >&5
11433 echo "$as_me:11433: result: no" >&5
11434 echo "${ECHO_T}no" >&6
11435                  LIBS="$cf_ncurses_SAVE"
11436 fi
11437 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11438 fi
11439
11440 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11441
11442 cat >>confdefs.h <<EOF
11443 #define $cf_nculib_ROOT 1
11444 EOF
11445
11446         fi
11447 else
11448         NCURSES_CONFIG=none
11449 fi
11450
11451 fi
11452
11453 if test "$NCURSES_CONFIG_PKG" != none ; then
11454         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11455
11456         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11457         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11458         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11459
11460         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11461         if test -z "$cf_cv_abi_version"
11462         then
11463                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11464         fi
11465
11466 elif test "$NCURSES_CONFIG" != none ; then
11467
11468         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11469
11470         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11471         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11472         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11473
11474         # ABI version is not available from headers
11475         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11476
11477 else
11478
11479         for cf_name in MAJOR MINOR PATCH
11480         do
11481         cat >conftest.$ac_ext <<CF_EOF
11482         #include <${cf_cv_ncurses_header:-curses.h}>
11483         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11484 CF_EOF
11485                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11486                 { (eval echo "$as_me:11486: \"$cf_try\"") >&5
11487   (eval $cf_try) 2>&5
11488   ac_status=$?
11489   echo "$as_me:11489: \$? = $ac_status" >&5
11490   (exit "$ac_status"); }
11491                 if test -f conftest.out ; then
11492                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11493                         eval NCURSES_$cf_name=\"$cf_result\"
11494                         # cat conftest.$ac_ext
11495                         # cat conftest.out
11496                 fi
11497         done
11498
11499         cf_cv_abi_version=${NCURSES_MAJOR}
11500
11501 fi
11502
11503 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11504
11505 cf_cv_timestamp=`date`
11506
11507 echo "$as_me:11507: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11508 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11509
11510 echo "$as_me:11510: checking if you want to have a library-prefix" >&5
11511 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11512
11513 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11514 if test "${with_lib_prefix+set}" = set; then
11515   withval="$with_lib_prefix"
11516   with_lib_prefix=$withval
11517 else
11518   with_lib_prefix=auto
11519 fi;
11520 echo "$as_me:11520: result: $with_lib_prefix" >&5
11521 echo "${ECHO_T}$with_lib_prefix" >&6
11522
11523 if test "$with_lib_prefix" = auto
11524 then
11525
11526         case "$cf_cv_system_name" in
11527         (OS/2*|os2*)
11528                 if test "$DFT_LWR_MODEL" = libtool; then
11529                         LIB_PREFIX='lib'
11530                 else
11531                         LIB_PREFIX=''
11532                 fi
11533                 ;;
11534         (*-msvc*)
11535                 LIB_PREFIX=''
11536                 ;;
11537         (*)     LIB_PREFIX='lib'
11538                 ;;
11539         esac
11540 cf_prefix=$LIB_PREFIX
11541
11542 elif test "$with_lib_prefix" = no
11543 then
11544         LIB_PREFIX=
11545 else
11546         LIB_PREFIX=$with_lib_prefix
11547 fi
11548
11549 LIB_SUFFIX=
11550
11551 ###############################################################################
11552
11553 if test X"$CC_G_OPT" = X"" ; then
11554         CC_G_OPT='-g'
11555         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11556 fi
11557
11558 echo "$as_me:11558: checking for default loader flags" >&5
11559 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11560 case $DFT_LWR_MODEL in
11561 (normal)  LD_MODEL=''   ;;
11562 (debug)   LD_MODEL=$CC_G_OPT ;;
11563 (profile) LD_MODEL='-pg';;
11564 (shared)  LD_MODEL=''   ;;
11565 esac
11566 echo "$as_me:11566: result: $LD_MODEL" >&5
11567 echo "${ECHO_T}$LD_MODEL" >&6
11568
11569 LD_RPATH_OPT=
11570 if test "x$cf_cv_enable_rpath" != xno
11571 then
11572         echo "$as_me:11572: checking for an rpath option" >&5
11573 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11574         case "$cf_cv_system_name" in
11575         (irix*)
11576                 if test "$GCC" = yes; then
11577                         LD_RPATH_OPT="-Wl,-rpath,"
11578                 else
11579                         LD_RPATH_OPT="-rpath "
11580                 fi
11581                 ;;
11582         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11583                 LD_RPATH_OPT="-Wl,-rpath,"
11584                 ;;
11585         (openbsd[2-9].*|mirbsd*)
11586                 LD_RPATH_OPT="-Wl,-rpath,"
11587                 ;;
11588         (dragonfly*)
11589                 LD_RPATH_OPT="-rpath "
11590                 ;;
11591         (netbsd*)
11592                 LD_RPATH_OPT="-Wl,-rpath,"
11593                 ;;
11594         (osf*|mls+*)
11595                 LD_RPATH_OPT="-rpath "
11596                 ;;
11597         (solaris2*)
11598                 LD_RPATH_OPT="-R"
11599                 ;;
11600         (*)
11601                 ;;
11602         esac
11603         echo "$as_me:11603: result: $LD_RPATH_OPT" >&5
11604 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11605
11606         case "x$LD_RPATH_OPT" in
11607         (x-R*)
11608                 echo "$as_me:11608: checking if we need a space after rpath option" >&5
11609 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11610                 cf_save_LIBS="$LIBS"
11611
11612 cf_add_libs="$LIBS"
11613 # reverse order
11614 cf_add_0lib=
11615 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11616 # filter duplicates
11617 for cf_add_1lib in $cf_add_0lib; do
11618         for cf_add_2lib in $cf_add_libs; do
11619                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11620                         cf_add_1lib=
11621                         break
11622                 fi
11623         done
11624         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11625 done
11626 LIBS="$cf_add_libs"
11627
11628                 cat >"conftest.$ac_ext" <<_ACEOF
11629 #line 11629 "configure"
11630 #include "confdefs.h"
11631
11632 int
11633 main (void)
11634 {
11635
11636   ;
11637   return 0;
11638 }
11639 _ACEOF
11640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11641 if { (eval echo "$as_me:11641: \"$ac_link\"") >&5
11642   (eval $ac_link) 2>&5
11643   ac_status=$?
11644   echo "$as_me:11644: \$? = $ac_status" >&5
11645   (exit "$ac_status"); } &&
11646          { ac_try='test -s "conftest$ac_exeext"'
11647   { (eval echo "$as_me:11647: \"$ac_try\"") >&5
11648   (eval $ac_try) 2>&5
11649   ac_status=$?
11650   echo "$as_me:11650: \$? = $ac_status" >&5
11651   (exit "$ac_status"); }; }; then
11652   cf_rpath_space=no
11653 else
11654   echo "$as_me: failed program was:" >&5
11655 cat "conftest.$ac_ext" >&5
11656 cf_rpath_space=yes
11657 fi
11658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11659                 LIBS="$cf_save_LIBS"
11660                 echo "$as_me:11660: result: $cf_rpath_space" >&5
11661 echo "${ECHO_T}$cf_rpath_space" >&6
11662                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11663                 ;;
11664         esac
11665 fi
11666
11667         RM_SHARED_OPTS=
11668         LOCAL_LDFLAGS=
11669         LOCAL_LDFLAGS2=
11670         LD_SHARED_OPTS=
11671         INSTALL_LIB="-m 644"
11672         : ${rel_builddir:=.}
11673
11674         shlibdir=$libdir
11675
11676         MAKE_DLLS="#"
11677
11678         cf_cv_do_symlinks=no
11679         cf_ld_rpath_opt=
11680         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11681
11682         echo "$as_me:11682: checking if release/abi version should be used for shared libs" >&5
11683 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11684
11685 # Check whether --with-shlib-version or --without-shlib-version was given.
11686 if test "${with_shlib_version+set}" = set; then
11687   withval="$with_shlib_version"
11688   test -z "$withval" && withval=auto
11689         case "$withval" in
11690         (yes)
11691                 cf_cv_shlib_version=auto
11692                 ;;
11693         (rel|abi|auto)
11694                 cf_cv_shlib_version=$withval
11695                 ;;
11696         (*)
11697                 echo "$as_me:11697: result: $withval" >&5
11698 echo "${ECHO_T}$withval" >&6
11699                 { { echo "$as_me:11699: error: option value must be one of: rel, abi, or auto" >&5
11700 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11701    { (exit 1); exit 1; }; }
11702                 ;;
11703         esac
11704
11705 else
11706   cf_cv_shlib_version=auto
11707 fi;
11708         echo "$as_me:11708: result: $cf_cv_shlib_version" >&5
11709 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11710
11711         cf_cv_rm_so_locs=no
11712         cf_try_cflags=
11713
11714         # Some less-capable ports of gcc support only -fpic
11715         CC_SHARED_OPTS=
11716
11717         cf_try_fPIC=no
11718         if test "$GCC" = yes
11719         then
11720                 cf_try_fPIC=yes
11721         else
11722                 case "$cf_cv_system_name" in
11723                 (*linux*)       # e.g., PGI compiler
11724                         cf_try_fPIC=yes
11725                         ;;
11726                 esac
11727         fi
11728
11729         if test "$cf_try_fPIC" = yes
11730         then
11731                 echo "$as_me:11731: checking which $CC option to use" >&5
11732 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11733                 cf_save_CFLAGS="$CFLAGS"
11734                 for CC_SHARED_OPTS in -fPIC -fpic ''
11735                 do
11736                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11737                         cat >"conftest.$ac_ext" <<_ACEOF
11738 #line 11738 "configure"
11739 #include "confdefs.h"
11740 #include <stdio.h>
11741 int
11742 main (void)
11743 {
11744 int x = 1
11745   ;
11746   return 0;
11747 }
11748 _ACEOF
11749 rm -f "conftest.$ac_objext"
11750 if { (eval echo "$as_me:11750: \"$ac_compile\"") >&5
11751   (eval $ac_compile) 2>&5
11752   ac_status=$?
11753   echo "$as_me:11753: \$? = $ac_status" >&5
11754   (exit "$ac_status"); } &&
11755          { ac_try='test -s "conftest.$ac_objext"'
11756   { (eval echo "$as_me:11756: \"$ac_try\"") >&5
11757   (eval $ac_try) 2>&5
11758   ac_status=$?
11759   echo "$as_me:11759: \$? = $ac_status" >&5
11760   (exit "$ac_status"); }; }; then
11761   break
11762 else
11763   echo "$as_me: failed program was:" >&5
11764 cat "conftest.$ac_ext" >&5
11765 fi
11766 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11767                 done
11768                 echo "$as_me:11768: result: $CC_SHARED_OPTS" >&5
11769 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11770                 CFLAGS="$cf_save_CFLAGS"
11771         fi
11772
11773         cf_cv_shlib_version_infix=no
11774
11775         case "$cf_cv_system_name" in
11776         (aix4.3-9*|aix[5-7]*)
11777                 if test "$GCC" = yes; then
11778                         CC_SHARED_OPTS='-Wl,-brtl'
11779                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11780                 else
11781                         CC_SHARED_OPTS='-brtl'
11782                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11783                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11784                 fi
11785                 ;;
11786         (beos*)
11787                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11788                 ;;
11789         (cygwin*)
11790                 CC_SHARED_OPTS=
11791                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11792                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11793                 cf_cv_shlib_version=cygdll
11794                 cf_cv_shlib_version_infix=cygdll
11795                 shlibdir=$bindir
11796                 MAKE_DLLS=
11797                 cat >mk_shared_lib.sh <<-CF_EOF
11798                 #!$SHELL
11799                 SHARED_LIB=\$1
11800                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11801                 shift
11802                 cat <<-EOF
11803                 Linking shared library
11804                 ** SHARED_LIB \$SHARED_LIB
11805                 ** IMPORT_LIB \$IMPORT_LIB
11806 EOF
11807                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11808 CF_EOF
11809                 chmod +x mk_shared_lib.sh
11810                 ;;
11811         (msys*)
11812                 CC_SHARED_OPTS=
11813                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11814                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11815                 cf_cv_shlib_version=msysdll
11816                 cf_cv_shlib_version_infix=msysdll
11817                 shlibdir=$bindir
11818                 MAKE_DLLS=
11819                 cat >mk_shared_lib.sh <<-CF_EOF
11820                 #!$SHELL
11821                 SHARED_LIB=\$1
11822                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11823                 shift
11824                 cat <<-EOF
11825                 Linking shared library
11826                 ** SHARED_LIB \$SHARED_LIB
11827                 ** IMPORT_LIB \$IMPORT_LIB
11828 EOF
11829                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11830 CF_EOF
11831                 chmod +x mk_shared_lib.sh
11832                 ;;
11833         (darwin*)
11834                 cf_try_cflags="no-cpp-precomp"
11835                 CC_SHARED_OPTS="-dynamic"
11836                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11837                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11838                 cf_cv_shlib_version_infix=yes
11839                 echo "$as_me:11839: checking if ld -search_paths_first works" >&5
11840 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11841 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11842   echo $ECHO_N "(cached) $ECHO_C" >&6
11843 else
11844
11845                         cf_save_LDFLAGS=$LDFLAGS
11846                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11847                         cat >"conftest.$ac_ext" <<_ACEOF
11848 #line 11848 "configure"
11849 #include "confdefs.h"
11850
11851 int
11852 main (void)
11853 {
11854 int i;
11855   ;
11856   return 0;
11857 }
11858 _ACEOF
11859 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11860 if { (eval echo "$as_me:11860: \"$ac_link\"") >&5
11861   (eval $ac_link) 2>&5
11862   ac_status=$?
11863   echo "$as_me:11863: \$? = $ac_status" >&5
11864   (exit "$ac_status"); } &&
11865          { ac_try='test -s "conftest$ac_exeext"'
11866   { (eval echo "$as_me:11866: \"$ac_try\"") >&5
11867   (eval $ac_try) 2>&5
11868   ac_status=$?
11869   echo "$as_me:11869: \$? = $ac_status" >&5
11870   (exit "$ac_status"); }; }; then
11871   cf_cv_ldflags_search_paths_first=yes
11872 else
11873   echo "$as_me: failed program was:" >&5
11874 cat "conftest.$ac_ext" >&5
11875 cf_cv_ldflags_search_paths_first=no
11876 fi
11877 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11878                                 LDFLAGS=$cf_save_LDFLAGS
11879 fi
11880 echo "$as_me:11880: result: $cf_cv_ldflags_search_paths_first" >&5
11881 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11882                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11883                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11884                 fi
11885                 ;;
11886         (haiku*)
11887
11888         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11889         if test "$cf_cv_shlib_version" = rel; then
11890                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11891         else
11892                 cf_cv_shared_soname='`basename $@`'
11893         fi
11894
11895                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11896                 ;;
11897         (hpux[7-8]*)
11898                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11899                 if test "$GCC" != yes; then
11900                         CC_SHARED_OPTS='+Z'
11901                 fi
11902                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11903                 INSTALL_LIB="-m 555"
11904                 ;;
11905         (hpux*)
11906                 # (tested with gcc 2.7.2 -- I don't have c89)
11907                 if test "$GCC" = yes; then
11908                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11909                 else
11910                         CC_SHARED_OPTS='+Z'
11911                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11912                 fi
11913                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11914                 # HP-UX shared libraries must be executable, and should be
11915                 # readonly to exploit a quirk in the memory manager.
11916                 INSTALL_LIB="-m 555"
11917                 ;;
11918         (interix*)
11919                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11920                 if test "$cf_cv_shlib_version" = rel; then
11921                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11922                 else
11923                         cf_shared_soname='`basename $@`'
11924                 fi
11925                 CC_SHARED_OPTS=
11926                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11927                 ;;
11928         (irix*)
11929                 if test "$cf_cv_enable_rpath" = yes ; then
11930                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11931                 fi
11932                 # tested with IRIX 5.2 and 'cc'.
11933                 if test "$GCC" != yes; then
11934                         CC_SHARED_OPTS='-KPIC'
11935                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11936                 else
11937                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11938                 fi
11939                 cf_cv_rm_so_locs=yes
11940                 ;;
11941         (linux*|gnu*|k*bsd*-gnu)
11942                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11943                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11944                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11945                 fi
11946                 if test "$cf_cv_enable_rpath" = yes ; then
11947                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11948                 fi
11949
11950         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11951         if test "$cf_cv_shlib_version" = rel; then
11952                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11953         else
11954                 cf_cv_shared_soname='`basename $@`'
11955         fi
11956
11957                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11958                 ;;
11959         (mingw*msvc*)
11960                 cf_cv_shlib_version=msvcdll
11961                 cf_cv_shlib_version_infix=msvcdll
11962                 shlibdir=$bindir
11963                 MAKE_DLLS=
11964                 if test "$DFT_LWR_MODEL" = "shared" ; then
11965                         LOCAL_LDFLAGS="-link -dll"
11966                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11967                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11968                 fi
11969                 CC_SHARED_OPTS=
11970                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11971                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11972                 cat >mk_shared_lib.sh <<-CF_EOF
11973                 #!$SHELL
11974                 SHARED_LIB=\$1
11975                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11976                 shift
11977                 my_ld=\$1
11978                 shift
11979                 cat <<-EOF
11980                 Linking shared library
11981                 ** SHARED LIB \$SHARED_LIB
11982                 ** IMPORT_LIB \$IMPORT_LIB
11983 EOF
11984                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11985                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11986                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11987 CF_EOF
11988                 chmod +x mk_shared_lib.sh
11989                 cat >mk_prog.sh <<-CF_EOF
11990                 #!$SHELL
11991                 shift
11992                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11993                 LD="$LD"
11994                 clopts=()
11995                 ldopts=("/subsystem:console")
11996                 libs=()
11997                 isdll=0
11998                 while test \$# -gt 0; do
11999                         case "\$1" in
12000                                 -link)
12001                                         # ignore -link argument
12002                                         ;;
12003                                 -M[TD] | -M[TD]d)
12004                                         # ignore runtime-library option
12005                                         ;;
12006                                 -dll)
12007                                         isdll=1
12008                                         ;;
12009                                 -W* | -w*)
12010                                         # ignore warnings
12011                                         ;;
12012                                 -D*)
12013                                         clopts+=("\$1")
12014                                         ;;
12015                                 -I*)
12016                                         clopts+=("\$1")
12017                                         ;;
12018                                 -l*)
12019                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12020                                         ;;
12021                                 -L*)
12022                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12023                                         ;;
12024                                 *.obj | *.o)
12025                                         ldopts+=("\$1")
12026                                         ;;
12027                                 -Wl,*)
12028                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12029                                                 ldopts+=("\${linkarg}")
12030                                         done
12031                                         ;;
12032                                 *.lib)
12033                                         ldopts+=("\$1")
12034                                         ;;
12035                                 -o)
12036                                         shift
12037                                         ldopts+=("-out:\$1")
12038                                         ;;
12039                                 *)
12040                                         clopts+=("\$1")
12041                                         ldopts+=("\$1")
12042                                         ;;
12043                         esac
12044                         shift
12045                 done
12046                 if [ "\$isdll" -ne 0 ]; then
12047                         for lib in \${libs[*]}; do
12048                                 ldopts+=("\$lib.dll.lib")
12049                         done
12050                 else
12051                         for lib in \${libs[*]}; do
12052                                 ldopts+=("\$lib.lib")
12053                         done
12054                 fi
12055                 cat <<-EOF
12056                 Creating program
12057                 ** ld options:   "\${ldopts[@]}"
12058 EOF
12059                 exec \$LD \${ldopts[@]}
12060 CF_EOF
12061                 chmod +x mk_prog.sh
12062                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12063                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12064                 ;;
12065         (mingw*)
12066                 cf_cv_shlib_version=mingw
12067                 cf_cv_shlib_version_infix=mingw
12068                 shlibdir=$bindir
12069                 MAKE_DLLS=
12070                 if test "$DFT_LWR_MODEL" = "shared" ; then
12071                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12072                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12073                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12074                 fi
12075                 CC_SHARED_OPTS=
12076                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12077                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12078                 cat >mk_shared_lib.sh <<-CF_EOF
12079                 #!$SHELL
12080                 SHARED_LIB=\$1
12081                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12082                 shift
12083                 cat <<-EOF
12084                 Linking shared library
12085                 ** SHARED_LIB \$SHARED_LIB
12086                 ** IMPORT_LIB \$IMPORT_LIB
12087 EOF
12088                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12089 CF_EOF
12090                 chmod +x mk_shared_lib.sh
12091                 ;;
12092         (openbsd[2-9].*|mirbsd*)
12093                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12094                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12095                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12096                 fi
12097                 if test "$cf_cv_enable_rpath" = yes ; then
12098                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12099                 fi
12100                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12101
12102         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12103         if test "$cf_cv_shlib_version" = rel; then
12104                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12105         else
12106                 cf_cv_shared_soname='`basename $@`'
12107         fi
12108
12109                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12110                 ;;
12111         (nskJ*)
12112                 CC_SHARED_OPTS=
12113                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12114                 ;;
12115         (nskL*)
12116                 CC_SHARED_OPTS=
12117                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12118                 ;;
12119         (nto-qnx*|openbsd*|freebsd[12].*)
12120                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12121                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12122                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12123                 ;;
12124         (dragonfly*|freebsd*)
12125                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12126                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12127                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12128                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12129                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12130                 fi
12131
12132         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12133         if test "$cf_cv_shlib_version" = rel; then
12134                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12135         else
12136                 cf_cv_shared_soname='`basename $@`'
12137         fi
12138
12139                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12140                 ;;
12141         (netbsd*)
12142                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12143                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12144                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12145                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12146                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12147                         if test "$cf_cv_shlib_version" = auto; then
12148                         if test -f /usr/libexec/ld.elf_so; then
12149                                 cf_cv_shlib_version=abi
12150                         else
12151                                 cf_cv_shlib_version=rel
12152                         fi
12153                         fi
12154
12155         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12156         if test "$cf_cv_shlib_version" = rel; then
12157                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12158         else
12159                 cf_cv_shared_soname='`basename $@`'
12160         fi
12161
12162                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12163                 else
12164                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12165                 fi
12166                 ;;
12167         (osf*|mls+*)
12168                 # tested with OSF/1 V3.2 and 'cc'
12169                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12170                 # link with shared libs).
12171                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12172                 case "$host_os" in
12173                 (osf4*)
12174                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12175                         ;;
12176                 esac
12177                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12178                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12179                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12180                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12181                 fi
12182                 cf_cv_rm_so_locs=yes
12183                 ;;
12184         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12185                 # tested with osr5.0.5
12186                 if test "$GCC" != yes; then
12187                         CC_SHARED_OPTS='-belf -KPIC'
12188                 fi
12189                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12190                 if test "$cf_cv_enable_rpath" = yes ; then
12191                         # only way is to set LD_RUN_PATH but no switch for it
12192                         RUN_PATH=$libdir
12193                 fi
12194                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12195                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12196                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12197                 ;;
12198         (sunos4*)
12199                 # tested with SunOS 4.1.1 and gcc 2.7.0
12200                 if test "$GCC" != yes; then
12201                         CC_SHARED_OPTS='-KPIC'
12202                 fi
12203                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12204                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12205                 ;;
12206         (solaris2*)
12207                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12208                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12209                 if test "$DFT_LWR_MODEL" = "shared" ; then
12210                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12211                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12212                 fi
12213                 if test "$cf_cv_enable_rpath" = yes ; then
12214                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12215                 fi
12216
12217         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12218         if test "$cf_cv_shlib_version" = rel; then
12219                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12220         else
12221                 cf_cv_shared_soname='`basename $@`'
12222         fi
12223
12224                 if test "$GCC" != yes; then
12225                         cf_save_CFLAGS="$CFLAGS"
12226                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12227                         do
12228                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12229                                 cat >"conftest.$ac_ext" <<_ACEOF
12230 #line 12230 "configure"
12231 #include "confdefs.h"
12232 #include <stdio.h>
12233 int
12234 main (void)
12235 {
12236 printf("Hello\\n");
12237   ;
12238   return 0;
12239 }
12240 _ACEOF
12241 rm -f "conftest.$ac_objext"
12242 if { (eval echo "$as_me:12242: \"$ac_compile\"") >&5
12243   (eval $ac_compile) 2>&5
12244   ac_status=$?
12245   echo "$as_me:12245: \$? = $ac_status" >&5
12246   (exit "$ac_status"); } &&
12247          { ac_try='test -s "conftest.$ac_objext"'
12248   { (eval echo "$as_me:12248: \"$ac_try\"") >&5
12249   (eval $ac_try) 2>&5
12250   ac_status=$?
12251   echo "$as_me:12251: \$? = $ac_status" >&5
12252   (exit "$ac_status"); }; }; then
12253   break
12254 else
12255   echo "$as_me: failed program was:" >&5
12256 cat "conftest.$ac_ext" >&5
12257 fi
12258 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12259                         done
12260                         CFLAGS="$cf_save_CFLAGS"
12261                         CC_SHARED_OPTS=$cf_shared_opts
12262                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12263                 else
12264                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12265                 fi
12266                 ;;
12267         (sysv5uw7*|unix_sv*)
12268                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12269                 if test "$GCC" != yes; then
12270                         CC_SHARED_OPTS='-KPIC'
12271                 fi
12272                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12273                 ;;
12274         (*)
12275                 CC_SHARED_OPTS='unknown'
12276                 MK_SHARED_LIB='echo unknown'
12277                 ;;
12278         esac
12279
12280         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12281         case "$cf_cv_shlib_version" in
12282         (rel|abi)
12283                 case "$MK_SHARED_LIB" in
12284                 (*'-o $@')
12285                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12286                         ;;
12287                 (*)
12288                         { echo "$as_me:12288: WARNING: ignored --with-shlib-version" >&5
12289 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12290                         ;;
12291                 esac
12292                 ;;
12293         esac
12294
12295         if test -n "$cf_try_cflags"
12296         then
12297 cat > conftest.$ac_ext <<EOF
12298 #line 12298 "${as_me:-configure}"
12299 #include <stdio.h>
12300 int main(int argc, char *argv[])
12301 {
12302         printf("hello\\n");
12303         return (argv[argc-1] == 0) ;
12304 }
12305 EOF
12306                 cf_save_CFLAGS="$CFLAGS"
12307                 for cf_opt in $cf_try_cflags
12308                 do
12309                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12310                         echo "$as_me:12310: checking if CFLAGS option -$cf_opt works" >&5
12311 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12312                         if { (eval echo "$as_me:12312: \"$ac_compile\"") >&5
12313   (eval $ac_compile) 2>&5
12314   ac_status=$?
12315   echo "$as_me:12315: \$? = $ac_status" >&5
12316   (exit "$ac_status"); }; then
12317                                 echo "$as_me:12317: result: yes" >&5
12318 echo "${ECHO_T}yes" >&6
12319                                 cf_save_CFLAGS="$CFLAGS"
12320                         else
12321                                 echo "$as_me:12321: result: no" >&5
12322 echo "${ECHO_T}no" >&6
12323                         fi
12324                 done
12325                 CFLAGS="$cf_save_CFLAGS"
12326         fi
12327
12328         # RPATH_LIST is a colon-separated list of directories
12329         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12330         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12331
12332         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12333
12334         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12335
12336 echo "${as_me:-configure}:12336: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12337
12338         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12339
12340 echo "${as_me:-configure}:12340: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12341
12342 # The test/sample programs in the original tree link using rpath option.
12343 # Make it optional for packagers.
12344 if test -n "$LOCAL_LDFLAGS"
12345 then
12346         echo "$as_me:12346: checking if you want to link sample programs with rpath option" >&5
12347 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12348
12349 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12350 if test "${enable_rpath_link+set}" = set; then
12351   enableval="$enable_rpath_link"
12352   with_rpath_link=$enableval
12353 else
12354   with_rpath_link=yes
12355 fi;
12356         echo "$as_me:12356: result: $with_rpath_link" >&5
12357 echo "${ECHO_T}$with_rpath_link" >&6
12358         if test "$with_rpath_link" = no
12359         then
12360                 LOCAL_LDFLAGS=
12361                 LOCAL_LDFLAGS2=
12362         fi
12363 fi
12364
12365 ###############################################################################
12366
12367 ###   use option --enable-broken-linker to force on use of broken-linker support
12368
12369 echo "$as_me:12369: checking if you want broken-linker support code" >&5
12370 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12371
12372 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12373 if test "${enable_broken_linker+set}" = set; then
12374   enableval="$enable_broken_linker"
12375   with_broken_linker=$enableval
12376 else
12377   with_broken_linker=no
12378 fi;
12379 echo "$as_me:12379: result: $with_broken_linker" >&5
12380 echo "${ECHO_T}$with_broken_linker" >&6
12381
12382 : "${BROKEN_LINKER:=0}"
12383 if test "x$with_broken_linker" = xyes ; then
12384
12385 cat >>confdefs.h <<\EOF
12386 #define BROKEN_LINKER 1
12387 EOF
12388
12389         BROKEN_LINKER=1
12390 fi
12391
12392 # Check to define _XOPEN_SOURCE "automatically"
12393
12394 echo "$as_me:12394: checking if the POSIX test-macros are already defined" >&5
12395 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12396 if test "${cf_cv_posix_visible+set}" = set; then
12397   echo $ECHO_N "(cached) $ECHO_C" >&6
12398 else
12399
12400 cat >"conftest.$ac_ext" <<_ACEOF
12401 #line 12401 "configure"
12402 #include "confdefs.h"
12403 #include <stdio.h>
12404 int
12405 main (void)
12406 {
12407
12408 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12409         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12410         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12411         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12412 #error conflicting symbols found
12413 #endif
12414
12415   ;
12416   return 0;
12417 }
12418 _ACEOF
12419 rm -f "conftest.$ac_objext"
12420 if { (eval echo "$as_me:12420: \"$ac_compile\"") >&5
12421   (eval $ac_compile) 2>&5
12422   ac_status=$?
12423   echo "$as_me:12423: \$? = $ac_status" >&5
12424   (exit "$ac_status"); } &&
12425          { ac_try='test -s "conftest.$ac_objext"'
12426   { (eval echo "$as_me:12426: \"$ac_try\"") >&5
12427   (eval $ac_try) 2>&5
12428   ac_status=$?
12429   echo "$as_me:12429: \$? = $ac_status" >&5
12430   (exit "$ac_status"); }; }; then
12431   cf_cv_posix_visible=no
12432 else
12433   echo "$as_me: failed program was:" >&5
12434 cat "conftest.$ac_ext" >&5
12435 cf_cv_posix_visible=yes
12436 fi
12437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12438
12439 fi
12440 echo "$as_me:12440: result: $cf_cv_posix_visible" >&5
12441 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12442
12443 if test "$cf_cv_posix_visible" = no; then
12444
12445 cf_XOPEN_SOURCE=600
12446 cf_POSIX_C_SOURCE=199506L
12447 cf_xopen_source=
12448
12449 case "$host_os" in
12450 (aix[4-7]*)
12451         cf_xopen_source="-D_ALL_SOURCE"
12452         ;;
12453 (darwin[0-8].*)
12454         cf_xopen_source="-D_APPLE_C_SOURCE"
12455         ;;
12456 (darwin*)
12457         cf_xopen_source="-D_DARWIN_C_SOURCE"
12458         cf_XOPEN_SOURCE=
12459         ;;
12460 (freebsd*|dragonfly*|midnightbsd*)
12461         # 5.x headers associate
12462         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12463         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12464         cf_POSIX_C_SOURCE=200112L
12465         cf_XOPEN_SOURCE=600
12466         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12467         ;;
12468 (hpux11*)
12469         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12470         ;;
12471 (hpux*)
12472         cf_xopen_source="-D_HPUX_SOURCE"
12473         ;;
12474 (irix[56].*)
12475         cf_xopen_source="-D_SGI_SOURCE"
12476         cf_XOPEN_SOURCE=
12477         ;;
12478 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys)
12479
12480 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12481
12482 echo "$as_me:12482: checking if this is the GNU C library" >&5
12483 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12484 if test "${cf_cv_gnu_library+set}" = set; then
12485   echo $ECHO_N "(cached) $ECHO_C" >&6
12486 else
12487
12488 cat >"conftest.$ac_ext" <<_ACEOF
12489 #line 12489 "configure"
12490 #include "confdefs.h"
12491 #include <sys/types.h>
12492 int
12493 main (void)
12494 {
12495
12496         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12497                 return 0;
12498         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12499                 return 0;
12500         #else
12501         #       error not GNU C library
12502         #endif
12503   ;
12504   return 0;
12505 }
12506 _ACEOF
12507 rm -f "conftest.$ac_objext"
12508 if { (eval echo "$as_me:12508: \"$ac_compile\"") >&5
12509   (eval $ac_compile) 2>&5
12510   ac_status=$?
12511   echo "$as_me:12511: \$? = $ac_status" >&5
12512   (exit "$ac_status"); } &&
12513          { ac_try='test -s "conftest.$ac_objext"'
12514   { (eval echo "$as_me:12514: \"$ac_try\"") >&5
12515   (eval $ac_try) 2>&5
12516   ac_status=$?
12517   echo "$as_me:12517: \$? = $ac_status" >&5
12518   (exit "$ac_status"); }; }; then
12519   cf_cv_gnu_library=yes
12520 else
12521   echo "$as_me: failed program was:" >&5
12522 cat "conftest.$ac_ext" >&5
12523 cf_cv_gnu_library=no
12524 fi
12525 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12526
12527 fi
12528 echo "$as_me:12528: result: $cf_cv_gnu_library" >&5
12529 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12530
12531 if test x$cf_cv_gnu_library = xyes; then
12532
12533         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12534         # was changed to help a little.  newlib incorporated the change about 4
12535         # years later.
12536         echo "$as_me:12536: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12537 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12538 if test "${cf_cv_gnu_library_219+set}" = set; then
12539   echo $ECHO_N "(cached) $ECHO_C" >&6
12540 else
12541
12542                 cf_save="$CPPFLAGS"
12543
12544         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12545         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12546
12547                 cat >"conftest.$ac_ext" <<_ACEOF
12548 #line 12548 "configure"
12549 #include "confdefs.h"
12550 #include <sys/types.h>
12551 int
12552 main (void)
12553 {
12554
12555                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12556                                 return 0;
12557                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12558                                 return 0;
12559                         #else
12560                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12561                         #endif
12562   ;
12563   return 0;
12564 }
12565 _ACEOF
12566 rm -f "conftest.$ac_objext"
12567 if { (eval echo "$as_me:12567: \"$ac_compile\"") >&5
12568   (eval $ac_compile) 2>&5
12569   ac_status=$?
12570   echo "$as_me:12570: \$? = $ac_status" >&5
12571   (exit "$ac_status"); } &&
12572          { ac_try='test -s "conftest.$ac_objext"'
12573   { (eval echo "$as_me:12573: \"$ac_try\"") >&5
12574   (eval $ac_try) 2>&5
12575   ac_status=$?
12576   echo "$as_me:12576: \$? = $ac_status" >&5
12577   (exit "$ac_status"); }; }; then
12578   cf_cv_gnu_library_219=yes
12579 else
12580   echo "$as_me: failed program was:" >&5
12581 cat "conftest.$ac_ext" >&5
12582 cf_cv_gnu_library_219=no
12583 fi
12584 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12585                 CPPFLAGS="$cf_save"
12586
12587 fi
12588 echo "$as_me:12588: result: $cf_cv_gnu_library_219" >&5
12589 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12590
12591         if test "x$cf_cv_gnu_library_219" = xyes; then
12592                 cf_save="$CPPFLAGS"
12593                 echo "$as_me:12593: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12594 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12595 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12596   echo $ECHO_N "(cached) $ECHO_C" >&6
12597 else
12598
12599 cf_fix_cppflags=no
12600 cf_new_cflags=
12601 cf_new_cppflags=
12602 cf_new_extra_cppflags=
12603
12604 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12605 do
12606 case "$cf_fix_cppflags" in
12607 (no)
12608         case "$cf_add_cflags" in
12609         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12610                 case "$cf_add_cflags" in
12611                 (-D*)
12612                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12613
12614                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12615                                 && test -z "${cf_tst_cflags}" \
12616                                 && cf_fix_cppflags=yes
12617
12618                         if test "$cf_fix_cppflags" = yes ; then
12619
12620         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12621         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12622
12623                                 continue
12624                         elif test "${cf_tst_cflags}" = "\"'" ; then
12625
12626         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12627         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12628
12629                                 continue
12630                         fi
12631                         ;;
12632                 esac
12633                 case "$CPPFLAGS" in
12634                 (*$cf_add_cflags)
12635                         ;;
12636                 (*)
12637                         case "$cf_add_cflags" in
12638                         (-D*)
12639                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12640
12641 CPPFLAGS=`echo "$CPPFLAGS" | \
12642         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12643                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12644
12645                                 ;;
12646                         esac
12647
12648         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12649         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12650
12651                         ;;
12652                 esac
12653                 ;;
12654         (*)
12655
12656         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12657         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12658
12659                 ;;
12660         esac
12661         ;;
12662 (yes)
12663
12664         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12665         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12666
12667         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12668
12669         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12670                 && test -z "${cf_tst_cflags}" \
12671                 && cf_fix_cppflags=no
12672         ;;
12673 esac
12674 done
12675
12676 if test -n "$cf_new_cflags" ; then
12677
12678         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12679         CFLAGS="${CFLAGS}$cf_new_cflags"
12680
12681 fi
12682
12683 if test -n "$cf_new_cppflags" ; then
12684
12685         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12686         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12687
12688 fi
12689
12690 if test -n "$cf_new_extra_cppflags" ; then
12691
12692         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12693         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12694
12695 fi
12696
12697                         cat >"conftest.$ac_ext" <<_ACEOF
12698 #line 12698 "configure"
12699 #include "confdefs.h"
12700
12701                                 #include <limits.h>
12702                                 #include <sys/types.h>
12703
12704 int
12705 main (void)
12706 {
12707
12708                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12709                                         return 0;
12710                                 #else
12711                                 #       error GNU C library is too old
12712                                 #endif
12713   ;
12714   return 0;
12715 }
12716 _ACEOF
12717 rm -f "conftest.$ac_objext"
12718 if { (eval echo "$as_me:12718: \"$ac_compile\"") >&5
12719   (eval $ac_compile) 2>&5
12720   ac_status=$?
12721   echo "$as_me:12721: \$? = $ac_status" >&5
12722   (exit "$ac_status"); } &&
12723          { ac_try='test -s "conftest.$ac_objext"'
12724   { (eval echo "$as_me:12724: \"$ac_try\"") >&5
12725   (eval $ac_try) 2>&5
12726   ac_status=$?
12727   echo "$as_me:12727: \$? = $ac_status" >&5
12728   (exit "$ac_status"); }; }; then
12729   cf_cv_gnu_dftsrc_219=yes
12730 else
12731   echo "$as_me: failed program was:" >&5
12732 cat "conftest.$ac_ext" >&5
12733 cf_cv_gnu_dftsrc_219=no
12734 fi
12735 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12736
12737 fi
12738 echo "$as_me:12738: result: $cf_cv_gnu_dftsrc_219" >&5
12739 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12740                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12741         else
12742                 cf_cv_gnu_dftsrc_219=maybe
12743         fi
12744
12745         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12746
12747                 echo "$as_me:12747: checking if we must define _GNU_SOURCE" >&5
12748 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12749 if test "${cf_cv_gnu_source+set}" = set; then
12750   echo $ECHO_N "(cached) $ECHO_C" >&6
12751 else
12752
12753                 cat >"conftest.$ac_ext" <<_ACEOF
12754 #line 12754 "configure"
12755 #include "confdefs.h"
12756 #include <sys/types.h>
12757 int
12758 main (void)
12759 {
12760
12761                         #ifndef _XOPEN_SOURCE
12762                         #error  expected _XOPEN_SOURCE to be defined
12763                         #endif
12764   ;
12765   return 0;
12766 }
12767 _ACEOF
12768 rm -f "conftest.$ac_objext"
12769 if { (eval echo "$as_me:12769: \"$ac_compile\"") >&5
12770   (eval $ac_compile) 2>&5
12771   ac_status=$?
12772   echo "$as_me:12772: \$? = $ac_status" >&5
12773   (exit "$ac_status"); } &&
12774          { ac_try='test -s "conftest.$ac_objext"'
12775   { (eval echo "$as_me:12775: \"$ac_try\"") >&5
12776   (eval $ac_try) 2>&5
12777   ac_status=$?
12778   echo "$as_me:12778: \$? = $ac_status" >&5
12779   (exit "$ac_status"); }; }; then
12780   cf_cv_gnu_source=no
12781 else
12782   echo "$as_me: failed program was:" >&5
12783 cat "conftest.$ac_ext" >&5
12784 cf_save="$CPPFLAGS"
12785
12786 cf_fix_cppflags=no
12787 cf_new_cflags=
12788 cf_new_cppflags=
12789 cf_new_extra_cppflags=
12790
12791 for cf_add_cflags in -D_GNU_SOURCE
12792 do
12793 case "$cf_fix_cppflags" in
12794 (no)
12795         case "$cf_add_cflags" in
12796         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12797                 case "$cf_add_cflags" in
12798                 (-D*)
12799                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12800
12801                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12802                                 && test -z "${cf_tst_cflags}" \
12803                                 && cf_fix_cppflags=yes
12804
12805                         if test "$cf_fix_cppflags" = yes ; then
12806
12807         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12808         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12809
12810                                 continue
12811                         elif test "${cf_tst_cflags}" = "\"'" ; then
12812
12813         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12814         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12815
12816                                 continue
12817                         fi
12818                         ;;
12819                 esac
12820                 case "$CPPFLAGS" in
12821                 (*$cf_add_cflags)
12822                         ;;
12823                 (*)
12824                         case "$cf_add_cflags" in
12825                         (-D*)
12826                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12827
12828 CPPFLAGS=`echo "$CPPFLAGS" | \
12829         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12830                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12831
12832                                 ;;
12833                         esac
12834
12835         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12836         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12837
12838                         ;;
12839                 esac
12840                 ;;
12841         (*)
12842
12843         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12844         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12845
12846                 ;;
12847         esac
12848         ;;
12849 (yes)
12850
12851         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12852         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12853
12854         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12855
12856         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12857                 && test -z "${cf_tst_cflags}" \
12858                 && cf_fix_cppflags=no
12859         ;;
12860 esac
12861 done
12862
12863 if test -n "$cf_new_cflags" ; then
12864
12865         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12866         CFLAGS="${CFLAGS}$cf_new_cflags"
12867
12868 fi
12869
12870 if test -n "$cf_new_cppflags" ; then
12871
12872         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12873         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12874
12875 fi
12876
12877 if test -n "$cf_new_extra_cppflags" ; then
12878
12879         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12880         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12881
12882 fi
12883
12884                          cat >"conftest.$ac_ext" <<_ACEOF
12885 #line 12885 "configure"
12886 #include "confdefs.h"
12887 #include <sys/types.h>
12888 int
12889 main (void)
12890 {
12891
12892                                 #ifdef _XOPEN_SOURCE
12893                                 #error  expected _XOPEN_SOURCE to be undefined
12894                                 #endif
12895   ;
12896   return 0;
12897 }
12898 _ACEOF
12899 rm -f "conftest.$ac_objext"
12900 if { (eval echo "$as_me:12900: \"$ac_compile\"") >&5
12901   (eval $ac_compile) 2>&5
12902   ac_status=$?
12903   echo "$as_me:12903: \$? = $ac_status" >&5
12904   (exit "$ac_status"); } &&
12905          { ac_try='test -s "conftest.$ac_objext"'
12906   { (eval echo "$as_me:12906: \"$ac_try\"") >&5
12907   (eval $ac_try) 2>&5
12908   ac_status=$?
12909   echo "$as_me:12909: \$? = $ac_status" >&5
12910   (exit "$ac_status"); }; }; then
12911   cf_cv_gnu_source=no
12912 else
12913   echo "$as_me: failed program was:" >&5
12914 cat "conftest.$ac_ext" >&5
12915 cf_cv_gnu_source=yes
12916 fi
12917 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12918                         CPPFLAGS="$cf_save"
12919
12920 fi
12921 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12922
12923 fi
12924 echo "$as_me:12924: result: $cf_cv_gnu_source" >&5
12925 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12926
12927                 if test "$cf_cv_gnu_source" = yes
12928                 then
12929                 echo "$as_me:12929: checking if we should also define _DEFAULT_SOURCE" >&5
12930 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12931 if test "${cf_cv_default_source+set}" = set; then
12932   echo $ECHO_N "(cached) $ECHO_C" >&6
12933 else
12934
12935         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12936         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12937
12938                         cat >"conftest.$ac_ext" <<_ACEOF
12939 #line 12939 "configure"
12940 #include "confdefs.h"
12941 #include <sys/types.h>
12942 int
12943 main (void)
12944 {
12945
12946                                 #ifdef _DEFAULT_SOURCE
12947                                 #error  expected _DEFAULT_SOURCE to be undefined
12948                                 #endif
12949   ;
12950   return 0;
12951 }
12952 _ACEOF
12953 rm -f "conftest.$ac_objext"
12954 if { (eval echo "$as_me:12954: \"$ac_compile\"") >&5
12955   (eval $ac_compile) 2>&5
12956   ac_status=$?
12957   echo "$as_me:12957: \$? = $ac_status" >&5
12958   (exit "$ac_status"); } &&
12959          { ac_try='test -s "conftest.$ac_objext"'
12960   { (eval echo "$as_me:12960: \"$ac_try\"") >&5
12961   (eval $ac_try) 2>&5
12962   ac_status=$?
12963   echo "$as_me:12963: \$? = $ac_status" >&5
12964   (exit "$ac_status"); }; }; then
12965   cf_cv_default_source=no
12966 else
12967   echo "$as_me: failed program was:" >&5
12968 cat "conftest.$ac_ext" >&5
12969 cf_cv_default_source=yes
12970 fi
12971 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12972
12973 fi
12974 echo "$as_me:12974: result: $cf_cv_default_source" >&5
12975 echo "${ECHO_T}$cf_cv_default_source" >&6
12976                         if test "$cf_cv_default_source" = yes
12977                         then
12978
12979         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12980         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12981
12982                         fi
12983                 fi
12984         fi
12985
12986 fi
12987
12988         ;;
12989 (minix*)
12990         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12991         ;;
12992 (mirbsd*)
12993         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12994         cf_XOPEN_SOURCE=
12995
12996 if test "$cf_cv_posix_visible" = no; then
12997
12998 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12999
13000 cf_save_CFLAGS="$CFLAGS"
13001 cf_save_CPPFLAGS="$CPPFLAGS"
13002
13003 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13004         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13005                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13006
13007 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13008         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13009                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13010
13011 echo "$as_me:13011: checking if we should define _POSIX_C_SOURCE" >&5
13012 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13013 if test "${cf_cv_posix_c_source+set}" = set; then
13014   echo $ECHO_N "(cached) $ECHO_C" >&6
13015 else
13016
13017 echo "${as_me:-configure}:13017: testing if the symbol is already defined go no further ..." 1>&5
13018
13019         cat >"conftest.$ac_ext" <<_ACEOF
13020 #line 13020 "configure"
13021 #include "confdefs.h"
13022 #include <sys/types.h>
13023 int
13024 main (void)
13025 {
13026
13027 #ifndef _POSIX_C_SOURCE
13028 #error _POSIX_C_SOURCE is not defined
13029 #endif
13030   ;
13031   return 0;
13032 }
13033 _ACEOF
13034 rm -f "conftest.$ac_objext"
13035 if { (eval echo "$as_me:13035: \"$ac_compile\"") >&5
13036   (eval $ac_compile) 2>&5
13037   ac_status=$?
13038   echo "$as_me:13038: \$? = $ac_status" >&5
13039   (exit "$ac_status"); } &&
13040          { ac_try='test -s "conftest.$ac_objext"'
13041   { (eval echo "$as_me:13041: \"$ac_try\"") >&5
13042   (eval $ac_try) 2>&5
13043   ac_status=$?
13044   echo "$as_me:13044: \$? = $ac_status" >&5
13045   (exit "$ac_status"); }; }; then
13046   cf_cv_posix_c_source=no
13047 else
13048   echo "$as_me: failed program was:" >&5
13049 cat "conftest.$ac_ext" >&5
13050 cf_want_posix_source=no
13051          case .$cf_POSIX_C_SOURCE in
13052          (.[12]??*)
13053                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13054                 ;;
13055          (.2)
13056                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13057                 cf_want_posix_source=yes
13058                 ;;
13059          (.*)
13060                 cf_want_posix_source=yes
13061                 ;;
13062          esac
13063          if test "$cf_want_posix_source" = yes ; then
13064                 cat >"conftest.$ac_ext" <<_ACEOF
13065 #line 13065 "configure"
13066 #include "confdefs.h"
13067 #include <sys/types.h>
13068 int
13069 main (void)
13070 {
13071
13072 #ifdef _POSIX_SOURCE
13073 #error _POSIX_SOURCE is defined
13074 #endif
13075   ;
13076   return 0;
13077 }
13078 _ACEOF
13079 rm -f "conftest.$ac_objext"
13080 if { (eval echo "$as_me:13080: \"$ac_compile\"") >&5
13081   (eval $ac_compile) 2>&5
13082   ac_status=$?
13083   echo "$as_me:13083: \$? = $ac_status" >&5
13084   (exit "$ac_status"); } &&
13085          { ac_try='test -s "conftest.$ac_objext"'
13086   { (eval echo "$as_me:13086: \"$ac_try\"") >&5
13087   (eval $ac_try) 2>&5
13088   ac_status=$?
13089   echo "$as_me:13089: \$? = $ac_status" >&5
13090   (exit "$ac_status"); }; }; then
13091   :
13092 else
13093   echo "$as_me: failed program was:" >&5
13094 cat "conftest.$ac_ext" >&5
13095 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13096 fi
13097 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13098          fi
13099
13100 echo "${as_me:-configure}:13100: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13101
13102          CFLAGS="$cf_trim_CFLAGS"
13103          CPPFLAGS="$cf_trim_CPPFLAGS"
13104
13105         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13106         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13107
13108 echo "${as_me:-configure}:13108: testing if the second compile does not leave our definition intact error ..." 1>&5
13109
13110          cat >"conftest.$ac_ext" <<_ACEOF
13111 #line 13111 "configure"
13112 #include "confdefs.h"
13113 #include <sys/types.h>
13114 int
13115 main (void)
13116 {
13117
13118 #ifndef _POSIX_C_SOURCE
13119 #error _POSIX_C_SOURCE is not defined
13120 #endif
13121   ;
13122   return 0;
13123 }
13124 _ACEOF
13125 rm -f "conftest.$ac_objext"
13126 if { (eval echo "$as_me:13126: \"$ac_compile\"") >&5
13127   (eval $ac_compile) 2>&5
13128   ac_status=$?
13129   echo "$as_me:13129: \$? = $ac_status" >&5
13130   (exit "$ac_status"); } &&
13131          { ac_try='test -s "conftest.$ac_objext"'
13132   { (eval echo "$as_me:13132: \"$ac_try\"") >&5
13133   (eval $ac_try) 2>&5
13134   ac_status=$?
13135   echo "$as_me:13135: \$? = $ac_status" >&5
13136   (exit "$ac_status"); }; }; then
13137   :
13138 else
13139   echo "$as_me: failed program was:" >&5
13140 cat "conftest.$ac_ext" >&5
13141 cf_cv_posix_c_source=no
13142 fi
13143 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13144          CFLAGS="$cf_save_CFLAGS"
13145          CPPFLAGS="$cf_save_CPPFLAGS"
13146
13147 fi
13148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13149
13150 fi
13151 echo "$as_me:13151: result: $cf_cv_posix_c_source" >&5
13152 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13153
13154 if test "$cf_cv_posix_c_source" != no ; then
13155         CFLAGS="$cf_trim_CFLAGS"
13156         CPPFLAGS="$cf_trim_CPPFLAGS"
13157
13158 cf_fix_cppflags=no
13159 cf_new_cflags=
13160 cf_new_cppflags=
13161 cf_new_extra_cppflags=
13162
13163 for cf_add_cflags in $cf_cv_posix_c_source
13164 do
13165 case "$cf_fix_cppflags" in
13166 (no)
13167         case "$cf_add_cflags" in
13168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13169                 case "$cf_add_cflags" in
13170                 (-D*)
13171                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13172
13173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13174                                 && test -z "${cf_tst_cflags}" \
13175                                 && cf_fix_cppflags=yes
13176
13177                         if test "$cf_fix_cppflags" = yes ; then
13178
13179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13181
13182                                 continue
13183                         elif test "${cf_tst_cflags}" = "\"'" ; then
13184
13185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13187
13188                                 continue
13189                         fi
13190                         ;;
13191                 esac
13192                 case "$CPPFLAGS" in
13193                 (*$cf_add_cflags)
13194                         ;;
13195                 (*)
13196                         case "$cf_add_cflags" in
13197                         (-D*)
13198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13199
13200 CPPFLAGS=`echo "$CPPFLAGS" | \
13201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13203
13204                                 ;;
13205                         esac
13206
13207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13209
13210                         ;;
13211                 esac
13212                 ;;
13213         (*)
13214
13215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13217
13218                 ;;
13219         esac
13220         ;;
13221 (yes)
13222
13223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13225
13226         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13227
13228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13229                 && test -z "${cf_tst_cflags}" \
13230                 && cf_fix_cppflags=no
13231         ;;
13232 esac
13233 done
13234
13235 if test -n "$cf_new_cflags" ; then
13236
13237         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13238         CFLAGS="${CFLAGS}$cf_new_cflags"
13239
13240 fi
13241
13242 if test -n "$cf_new_cppflags" ; then
13243
13244         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13245         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13246
13247 fi
13248
13249 if test -n "$cf_new_extra_cppflags" ; then
13250
13251         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13252         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13253
13254 fi
13255
13256 fi
13257
13258 fi # cf_cv_posix_visible
13259
13260         ;;
13261 (netbsd*)
13262         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13263         ;;
13264 (openbsd[6-9]*)
13265         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13266         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13267         # Abusing the conformance level is a workaround.
13268         { echo "$as_me:13268: WARNING: this system does not provide usable locale support" >&5
13269 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13270         cf_xopen_source="-D_BSD_SOURCE"
13271         cf_XOPEN_SOURCE=700
13272         ;;
13273 (openbsd[4-5]*)
13274         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13275         cf_xopen_source="-D_BSD_SOURCE"
13276         cf_XOPEN_SOURCE=600
13277         ;;
13278 (openbsd*)
13279         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13280         ;;
13281 (osf[45]*)
13282         cf_xopen_source="-D_OSF_SOURCE"
13283         ;;
13284 (nto-qnx*)
13285         cf_xopen_source="-D_QNX_SOURCE"
13286         ;;
13287 (sco*)
13288         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13289         ;;
13290 (solaris2.*)
13291         cf_xopen_source="-D__EXTENSIONS__"
13292         cf_cv_xopen_source=broken
13293         ;;
13294 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13295         cf_XOPEN_SOURCE=
13296         cf_POSIX_C_SOURCE=
13297         ;;
13298 (*)
13299
13300 echo "$as_me:13300: checking if we should define _XOPEN_SOURCE" >&5
13301 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13302 if test "${cf_cv_xopen_source+set}" = set; then
13303   echo $ECHO_N "(cached) $ECHO_C" >&6
13304 else
13305
13306         cat >"conftest.$ac_ext" <<_ACEOF
13307 #line 13307 "configure"
13308 #include "confdefs.h"
13309
13310 $ac_includes_default
13311
13312 int
13313 main (void)
13314 {
13315
13316 #ifndef _XOPEN_SOURCE
13317 #error _XOPEN_SOURCE is not defined
13318 #endif
13319
13320   ;
13321   return 0;
13322 }
13323 _ACEOF
13324 rm -f "conftest.$ac_objext"
13325 if { (eval echo "$as_me:13325: \"$ac_compile\"") >&5
13326   (eval $ac_compile) 2>&5
13327   ac_status=$?
13328   echo "$as_me:13328: \$? = $ac_status" >&5
13329   (exit "$ac_status"); } &&
13330          { ac_try='test -s "conftest.$ac_objext"'
13331   { (eval echo "$as_me:13331: \"$ac_try\"") >&5
13332   (eval $ac_try) 2>&5
13333   ac_status=$?
13334   echo "$as_me:13334: \$? = $ac_status" >&5
13335   (exit "$ac_status"); }; }; then
13336   cf_cv_xopen_source=no
13337 else
13338   echo "$as_me: failed program was:" >&5
13339 cat "conftest.$ac_ext" >&5
13340 cf_save="$CPPFLAGS"
13341
13342         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13343         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13344
13345          cat >"conftest.$ac_ext" <<_ACEOF
13346 #line 13346 "configure"
13347 #include "confdefs.h"
13348
13349 $ac_includes_default
13350
13351 int
13352 main (void)
13353 {
13354
13355 #ifndef _XOPEN_SOURCE
13356 #error _XOPEN_SOURCE is not defined
13357 #endif
13358
13359   ;
13360   return 0;
13361 }
13362 _ACEOF
13363 rm -f "conftest.$ac_objext"
13364 if { (eval echo "$as_me:13364: \"$ac_compile\"") >&5
13365   (eval $ac_compile) 2>&5
13366   ac_status=$?
13367   echo "$as_me:13367: \$? = $ac_status" >&5
13368   (exit "$ac_status"); } &&
13369          { ac_try='test -s "conftest.$ac_objext"'
13370   { (eval echo "$as_me:13370: \"$ac_try\"") >&5
13371   (eval $ac_try) 2>&5
13372   ac_status=$?
13373   echo "$as_me:13373: \$? = $ac_status" >&5
13374   (exit "$ac_status"); }; }; then
13375   cf_cv_xopen_source=no
13376 else
13377   echo "$as_me: failed program was:" >&5
13378 cat "conftest.$ac_ext" >&5
13379 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13380 fi
13381 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13382                 CPPFLAGS="$cf_save"
13383
13384 fi
13385 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13386
13387 fi
13388 echo "$as_me:13388: result: $cf_cv_xopen_source" >&5
13389 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13390
13391 if test "$cf_cv_xopen_source" != no ; then
13392
13393 CFLAGS=`echo "$CFLAGS" | \
13394         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13395                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13396
13397 CPPFLAGS=`echo "$CPPFLAGS" | \
13398         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13399                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13400
13401         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13402
13403 for cf_add_cflags in $cf_temp_xopen_source
13404 do
13405         case "x$cf_add_cflags" in
13406         (x-[DU]*)
13407
13408 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13409 while true
13410 do
13411         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'`
13412         test "$CFLAGS" != "$cf_old_cflag" || break
13413
13414         CFLAGS="$cf_old_cflag"
13415 done
13416
13417 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13418 while true
13419 do
13420         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'`
13421         test "$CPPFLAGS" != "$cf_old_cflag" || break
13422
13423         CPPFLAGS="$cf_old_cflag"
13424 done
13425
13426                 ;;
13427         esac
13428
13429 cf_fix_cppflags=no
13430 cf_new_cflags=
13431 cf_new_cppflags=
13432 cf_new_extra_cppflags=
13433
13434 for cf_add_cflags in $cf_add_cflags
13435 do
13436 case "$cf_fix_cppflags" in
13437 (no)
13438         case "$cf_add_cflags" in
13439         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13440                 case "$cf_add_cflags" in
13441                 (-D*)
13442                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13443
13444                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13445                                 && test -z "${cf_tst_cflags}" \
13446                                 && cf_fix_cppflags=yes
13447
13448                         if test "$cf_fix_cppflags" = yes ; then
13449
13450         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13451         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13452
13453                                 continue
13454                         elif test "${cf_tst_cflags}" = "\"'" ; then
13455
13456         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13457         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13458
13459                                 continue
13460                         fi
13461                         ;;
13462                 esac
13463                 case "$CPPFLAGS" in
13464                 (*$cf_add_cflags)
13465                         ;;
13466                 (*)
13467                         case "$cf_add_cflags" in
13468                         (-D*)
13469                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13470
13471 CPPFLAGS=`echo "$CPPFLAGS" | \
13472         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13473                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13474
13475                                 ;;
13476                         esac
13477
13478         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13479         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13480
13481                         ;;
13482                 esac
13483                 ;;
13484         (*)
13485
13486         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13487         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13488
13489                 ;;
13490         esac
13491         ;;
13492 (yes)
13493
13494         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13495         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13496
13497         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13498
13499         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13500                 && test -z "${cf_tst_cflags}" \
13501                 && cf_fix_cppflags=no
13502         ;;
13503 esac
13504 done
13505
13506 if test -n "$cf_new_cflags" ; then
13507
13508         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13509         CFLAGS="${CFLAGS}$cf_new_cflags"
13510
13511 fi
13512
13513 if test -n "$cf_new_cppflags" ; then
13514
13515         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13516         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13517
13518 fi
13519
13520 if test -n "$cf_new_extra_cppflags" ; then
13521
13522         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13523         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13524
13525 fi
13526
13527 done
13528
13529 fi
13530
13531         cf_save_xopen_cppflags="$CPPFLAGS"
13532
13533 if test "$cf_cv_posix_visible" = no; then
13534
13535 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13536
13537 cf_save_CFLAGS="$CFLAGS"
13538 cf_save_CPPFLAGS="$CPPFLAGS"
13539
13540 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13541         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13542                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13543
13544 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13545         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13546                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13547
13548 echo "$as_me:13548: checking if we should define _POSIX_C_SOURCE" >&5
13549 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13550 if test "${cf_cv_posix_c_source+set}" = set; then
13551   echo $ECHO_N "(cached) $ECHO_C" >&6
13552 else
13553
13554 echo "${as_me:-configure}:13554: testing if the symbol is already defined go no further ..." 1>&5
13555
13556         cat >"conftest.$ac_ext" <<_ACEOF
13557 #line 13557 "configure"
13558 #include "confdefs.h"
13559 #include <sys/types.h>
13560 int
13561 main (void)
13562 {
13563
13564 #ifndef _POSIX_C_SOURCE
13565 #error _POSIX_C_SOURCE is not defined
13566 #endif
13567   ;
13568   return 0;
13569 }
13570 _ACEOF
13571 rm -f "conftest.$ac_objext"
13572 if { (eval echo "$as_me:13572: \"$ac_compile\"") >&5
13573   (eval $ac_compile) 2>&5
13574   ac_status=$?
13575   echo "$as_me:13575: \$? = $ac_status" >&5
13576   (exit "$ac_status"); } &&
13577          { ac_try='test -s "conftest.$ac_objext"'
13578   { (eval echo "$as_me:13578: \"$ac_try\"") >&5
13579   (eval $ac_try) 2>&5
13580   ac_status=$?
13581   echo "$as_me:13581: \$? = $ac_status" >&5
13582   (exit "$ac_status"); }; }; then
13583   cf_cv_posix_c_source=no
13584 else
13585   echo "$as_me: failed program was:" >&5
13586 cat "conftest.$ac_ext" >&5
13587 cf_want_posix_source=no
13588          case .$cf_POSIX_C_SOURCE in
13589          (.[12]??*)
13590                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13591                 ;;
13592          (.2)
13593                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13594                 cf_want_posix_source=yes
13595                 ;;
13596          (.*)
13597                 cf_want_posix_source=yes
13598                 ;;
13599          esac
13600          if test "$cf_want_posix_source" = yes ; then
13601                 cat >"conftest.$ac_ext" <<_ACEOF
13602 #line 13602 "configure"
13603 #include "confdefs.h"
13604 #include <sys/types.h>
13605 int
13606 main (void)
13607 {
13608
13609 #ifdef _POSIX_SOURCE
13610 #error _POSIX_SOURCE is defined
13611 #endif
13612   ;
13613   return 0;
13614 }
13615 _ACEOF
13616 rm -f "conftest.$ac_objext"
13617 if { (eval echo "$as_me:13617: \"$ac_compile\"") >&5
13618   (eval $ac_compile) 2>&5
13619   ac_status=$?
13620   echo "$as_me:13620: \$? = $ac_status" >&5
13621   (exit "$ac_status"); } &&
13622          { ac_try='test -s "conftest.$ac_objext"'
13623   { (eval echo "$as_me:13623: \"$ac_try\"") >&5
13624   (eval $ac_try) 2>&5
13625   ac_status=$?
13626   echo "$as_me:13626: \$? = $ac_status" >&5
13627   (exit "$ac_status"); }; }; then
13628   :
13629 else
13630   echo "$as_me: failed program was:" >&5
13631 cat "conftest.$ac_ext" >&5
13632 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13633 fi
13634 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13635          fi
13636
13637 echo "${as_me:-configure}:13637: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13638
13639          CFLAGS="$cf_trim_CFLAGS"
13640          CPPFLAGS="$cf_trim_CPPFLAGS"
13641
13642         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13643         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13644
13645 echo "${as_me:-configure}:13645: testing if the second compile does not leave our definition intact error ..." 1>&5
13646
13647          cat >"conftest.$ac_ext" <<_ACEOF
13648 #line 13648 "configure"
13649 #include "confdefs.h"
13650 #include <sys/types.h>
13651 int
13652 main (void)
13653 {
13654
13655 #ifndef _POSIX_C_SOURCE
13656 #error _POSIX_C_SOURCE is not defined
13657 #endif
13658   ;
13659   return 0;
13660 }
13661 _ACEOF
13662 rm -f "conftest.$ac_objext"
13663 if { (eval echo "$as_me:13663: \"$ac_compile\"") >&5
13664   (eval $ac_compile) 2>&5
13665   ac_status=$?
13666   echo "$as_me:13666: \$? = $ac_status" >&5
13667   (exit "$ac_status"); } &&
13668          { ac_try='test -s "conftest.$ac_objext"'
13669   { (eval echo "$as_me:13669: \"$ac_try\"") >&5
13670   (eval $ac_try) 2>&5
13671   ac_status=$?
13672   echo "$as_me:13672: \$? = $ac_status" >&5
13673   (exit "$ac_status"); }; }; then
13674   :
13675 else
13676   echo "$as_me: failed program was:" >&5
13677 cat "conftest.$ac_ext" >&5
13678 cf_cv_posix_c_source=no
13679 fi
13680 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13681          CFLAGS="$cf_save_CFLAGS"
13682          CPPFLAGS="$cf_save_CPPFLAGS"
13683
13684 fi
13685 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13686
13687 fi
13688 echo "$as_me:13688: result: $cf_cv_posix_c_source" >&5
13689 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13690
13691 if test "$cf_cv_posix_c_source" != no ; then
13692         CFLAGS="$cf_trim_CFLAGS"
13693         CPPFLAGS="$cf_trim_CPPFLAGS"
13694
13695 cf_fix_cppflags=no
13696 cf_new_cflags=
13697 cf_new_cppflags=
13698 cf_new_extra_cppflags=
13699
13700 for cf_add_cflags in $cf_cv_posix_c_source
13701 do
13702 case "$cf_fix_cppflags" in
13703 (no)
13704         case "$cf_add_cflags" in
13705         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13706                 case "$cf_add_cflags" in
13707                 (-D*)
13708                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13709
13710                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13711                                 && test -z "${cf_tst_cflags}" \
13712                                 && cf_fix_cppflags=yes
13713
13714                         if test "$cf_fix_cppflags" = yes ; then
13715
13716         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13717         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13718
13719                                 continue
13720                         elif test "${cf_tst_cflags}" = "\"'" ; then
13721
13722         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13723         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13724
13725                                 continue
13726                         fi
13727                         ;;
13728                 esac
13729                 case "$CPPFLAGS" in
13730                 (*$cf_add_cflags)
13731                         ;;
13732                 (*)
13733                         case "$cf_add_cflags" in
13734                         (-D*)
13735                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13736
13737 CPPFLAGS=`echo "$CPPFLAGS" | \
13738         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13739                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13740
13741                                 ;;
13742                         esac
13743
13744         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13745         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13746
13747                         ;;
13748                 esac
13749                 ;;
13750         (*)
13751
13752         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13753         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13754
13755                 ;;
13756         esac
13757         ;;
13758 (yes)
13759
13760         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13761         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13762
13763         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13764
13765         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13766                 && test -z "${cf_tst_cflags}" \
13767                 && cf_fix_cppflags=no
13768         ;;
13769 esac
13770 done
13771
13772 if test -n "$cf_new_cflags" ; then
13773
13774         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13775         CFLAGS="${CFLAGS}$cf_new_cflags"
13776
13777 fi
13778
13779 if test -n "$cf_new_cppflags" ; then
13780
13781         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13782         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13783
13784 fi
13785
13786 if test -n "$cf_new_extra_cppflags" ; then
13787
13788         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13789         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13790
13791 fi
13792
13793 fi
13794
13795 fi # cf_cv_posix_visible
13796
13797         # Some of these niche implementations use copy/paste, double-check...
13798         if test "$cf_cv_xopen_source" != no ; then
13799                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
13800
13801 echo "${as_me:-configure}:13801: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
13802
13803                 cat >"conftest.$ac_ext" <<_ACEOF
13804 #line 13804 "configure"
13805 #include "confdefs.h"
13806
13807 $ac_includes_default
13808
13809 int
13810 main (void)
13811 {
13812
13813 #ifndef _XOPEN_SOURCE
13814 #error _XOPEN_SOURCE is not defined
13815 #endif
13816
13817   ;
13818   return 0;
13819 }
13820 _ACEOF
13821 rm -f "conftest.$ac_objext"
13822 if { (eval echo "$as_me:13822: \"$ac_compile\"") >&5
13823   (eval $ac_compile) 2>&5
13824   ac_status=$?
13825   echo "$as_me:13825: \$? = $ac_status" >&5
13826   (exit "$ac_status"); } &&
13827          { ac_try='test -s "conftest.$ac_objext"'
13828   { (eval echo "$as_me:13828: \"$ac_try\"") >&5
13829   (eval $ac_try) 2>&5
13830   ac_status=$?
13831   echo "$as_me:13831: \$? = $ac_status" >&5
13832   (exit "$ac_status"); }; }; then
13833   :
13834 else
13835   echo "$as_me: failed program was:" >&5
13836 cat "conftest.$ac_ext" >&5
13837
13838                         { echo "$as_me:13838: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
13839 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
13840                         CPPFLAGS="$cf_save_xopen_cppflags"
13841 fi
13842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13843         fi
13844         ;;
13845 esac
13846
13847 if test -n "$cf_xopen_source" ; then
13848
13849 for cf_add_cflags in $cf_xopen_source
13850 do
13851         case "x$cf_add_cflags" in
13852         (x-[DU]*)
13853
13854 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13855 while true
13856 do
13857         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'`
13858         test "$CFLAGS" != "$cf_old_cflag" || break
13859         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13860
13861 echo "${as_me:-configure}:13861: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13862
13863         CFLAGS="$cf_old_cflag"
13864 done
13865
13866 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13867 while true
13868 do
13869         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'`
13870         test "$CPPFLAGS" != "$cf_old_cflag" || break
13871         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13872
13873 echo "${as_me:-configure}:13873: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13874
13875         CPPFLAGS="$cf_old_cflag"
13876 done
13877
13878                 ;;
13879         esac
13880
13881 cf_fix_cppflags=no
13882 cf_new_cflags=
13883 cf_new_cppflags=
13884 cf_new_extra_cppflags=
13885
13886 for cf_add_cflags in $cf_add_cflags
13887 do
13888 case "$cf_fix_cppflags" in
13889 (no)
13890         case "$cf_add_cflags" in
13891         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13892                 case "$cf_add_cflags" in
13893                 (-D*)
13894                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13895
13896                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13897                                 && test -z "${cf_tst_cflags}" \
13898                                 && cf_fix_cppflags=yes
13899
13900                         if test "$cf_fix_cppflags" = yes ; then
13901
13902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13904
13905                                 continue
13906                         elif test "${cf_tst_cflags}" = "\"'" ; then
13907
13908         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13909         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13910
13911                                 continue
13912                         fi
13913                         ;;
13914                 esac
13915                 case "$CPPFLAGS" in
13916                 (*$cf_add_cflags)
13917                         ;;
13918                 (*)
13919                         case "$cf_add_cflags" in
13920                         (-D*)
13921                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13922
13923 CPPFLAGS=`echo "$CPPFLAGS" | \
13924         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13925                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13926
13927                                 ;;
13928                         esac
13929
13930         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13931         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13932
13933                         ;;
13934                 esac
13935                 ;;
13936         (*)
13937
13938         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13939         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13940
13941                 ;;
13942         esac
13943         ;;
13944 (yes)
13945
13946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13948
13949         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13950
13951         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13952                 && test -z "${cf_tst_cflags}" \
13953                 && cf_fix_cppflags=no
13954         ;;
13955 esac
13956 done
13957
13958 if test -n "$cf_new_cflags" ; then
13959         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13960
13961 echo "${as_me:-configure}:13961: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13962
13963         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13964         CFLAGS="${CFLAGS}$cf_new_cflags"
13965
13966 fi
13967
13968 if test -n "$cf_new_cppflags" ; then
13969         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13970
13971 echo "${as_me:-configure}:13971: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13972
13973         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13974         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13975
13976 fi
13977
13978 if test -n "$cf_new_extra_cppflags" ; then
13979         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13980
13981 echo "${as_me:-configure}:13981: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13982
13983         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13984         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13985
13986 fi
13987
13988 done
13989
13990 fi
13991
13992 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13993         echo "$as_me:13993: checking if _XOPEN_SOURCE really is set" >&5
13994 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13995         cat >"conftest.$ac_ext" <<_ACEOF
13996 #line 13996 "configure"
13997 #include "confdefs.h"
13998 #include <stdlib.h>
13999 int
14000 main (void)
14001 {
14002
14003 #ifndef _XOPEN_SOURCE
14004 #error _XOPEN_SOURCE is not defined
14005 #endif
14006   ;
14007   return 0;
14008 }
14009 _ACEOF
14010 rm -f "conftest.$ac_objext"
14011 if { (eval echo "$as_me:14011: \"$ac_compile\"") >&5
14012   (eval $ac_compile) 2>&5
14013   ac_status=$?
14014   echo "$as_me:14014: \$? = $ac_status" >&5
14015   (exit "$ac_status"); } &&
14016          { ac_try='test -s "conftest.$ac_objext"'
14017   { (eval echo "$as_me:14017: \"$ac_try\"") >&5
14018   (eval $ac_try) 2>&5
14019   ac_status=$?
14020   echo "$as_me:14020: \$? = $ac_status" >&5
14021   (exit "$ac_status"); }; }; then
14022   cf_XOPEN_SOURCE_set=yes
14023 else
14024   echo "$as_me: failed program was:" >&5
14025 cat "conftest.$ac_ext" >&5
14026 cf_XOPEN_SOURCE_set=no
14027 fi
14028 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14029         echo "$as_me:14029: result: $cf_XOPEN_SOURCE_set" >&5
14030 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14031         if test "$cf_XOPEN_SOURCE_set" = yes
14032         then
14033                 cat >"conftest.$ac_ext" <<_ACEOF
14034 #line 14034 "configure"
14035 #include "confdefs.h"
14036 #include <stdlib.h>
14037 int
14038 main (void)
14039 {
14040
14041 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14042 #error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14043 #endif
14044   ;
14045   return 0;
14046 }
14047 _ACEOF
14048 rm -f "conftest.$ac_objext"
14049 if { (eval echo "$as_me:14049: \"$ac_compile\"") >&5
14050   (eval $ac_compile) 2>&5
14051   ac_status=$?
14052   echo "$as_me:14052: \$? = $ac_status" >&5
14053   (exit "$ac_status"); } &&
14054          { ac_try='test -s "conftest.$ac_objext"'
14055   { (eval echo "$as_me:14055: \"$ac_try\"") >&5
14056   (eval $ac_try) 2>&5
14057   ac_status=$?
14058   echo "$as_me:14058: \$? = $ac_status" >&5
14059   (exit "$ac_status"); }; }; then
14060   cf_XOPEN_SOURCE_set_ok=yes
14061 else
14062   echo "$as_me: failed program was:" >&5
14063 cat "conftest.$ac_ext" >&5
14064 cf_XOPEN_SOURCE_set_ok=no
14065 fi
14066 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14067                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14068                 then
14069                         { echo "$as_me:14069: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14070 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14071                 fi
14072         else
14073
14074 echo "$as_me:14074: checking if we should define _XOPEN_SOURCE" >&5
14075 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14076 if test "${cf_cv_xopen_source+set}" = set; then
14077   echo $ECHO_N "(cached) $ECHO_C" >&6
14078 else
14079
14080         cat >"conftest.$ac_ext" <<_ACEOF
14081 #line 14081 "configure"
14082 #include "confdefs.h"
14083
14084 $ac_includes_default
14085
14086 int
14087 main (void)
14088 {
14089
14090 #ifndef _XOPEN_SOURCE
14091 #error _XOPEN_SOURCE is not defined
14092 #endif
14093
14094   ;
14095   return 0;
14096 }
14097 _ACEOF
14098 rm -f "conftest.$ac_objext"
14099 if { (eval echo "$as_me:14099: \"$ac_compile\"") >&5
14100   (eval $ac_compile) 2>&5
14101   ac_status=$?
14102   echo "$as_me:14102: \$? = $ac_status" >&5
14103   (exit "$ac_status"); } &&
14104          { ac_try='test -s "conftest.$ac_objext"'
14105   { (eval echo "$as_me:14105: \"$ac_try\"") >&5
14106   (eval $ac_try) 2>&5
14107   ac_status=$?
14108   echo "$as_me:14108: \$? = $ac_status" >&5
14109   (exit "$ac_status"); }; }; then
14110   cf_cv_xopen_source=no
14111 else
14112   echo "$as_me: failed program was:" >&5
14113 cat "conftest.$ac_ext" >&5
14114 cf_save="$CPPFLAGS"
14115
14116         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14117         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14118
14119          cat >"conftest.$ac_ext" <<_ACEOF
14120 #line 14120 "configure"
14121 #include "confdefs.h"
14122
14123 $ac_includes_default
14124
14125 int
14126 main (void)
14127 {
14128
14129 #ifndef _XOPEN_SOURCE
14130 #error _XOPEN_SOURCE is not defined
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 echo "$as_me:14309: checking for ANSI C header files" >&5
14310 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14311 if test "${ac_cv_header_stdc+set}" = set; then
14312   echo $ECHO_N "(cached) $ECHO_C" >&6
14313 else
14314   cat >"conftest.$ac_ext" <<_ACEOF
14315 #line 14315 "configure"
14316 #include "confdefs.h"
14317 #include <stdlib.h>
14318 #include <stdarg.h>
14319 #include <string.h>
14320 #include <float.h>
14321
14322 _ACEOF
14323 if { (eval echo "$as_me:14323: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14324   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14325   ac_status=$?
14326   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14327   rm -f conftest.er1
14328   cat conftest.err >&5
14329   echo "$as_me:14329: \$? = $ac_status" >&5
14330   (exit "$ac_status"); } >/dev/null; then
14331   if test -s conftest.err; then
14332     ac_cpp_err=$ac_c_preproc_warn_flag
14333   else
14334     ac_cpp_err=
14335   fi
14336 else
14337   ac_cpp_err=yes
14338 fi
14339 if test -z "$ac_cpp_err"; then
14340   ac_cv_header_stdc=yes
14341 else
14342   echo "$as_me: failed program was:" >&5
14343   cat "conftest.$ac_ext" >&5
14344   ac_cv_header_stdc=no
14345 fi
14346 rm -f conftest.err "conftest.$ac_ext"
14347
14348 if test $ac_cv_header_stdc = yes; then
14349   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14350   cat >"conftest.$ac_ext" <<_ACEOF
14351 #line 14351 "configure"
14352 #include "confdefs.h"
14353 #include <string.h>
14354
14355 _ACEOF
14356 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14357   $EGREP "memchr" >/dev/null 2>&1; then
14358   :
14359 else
14360   ac_cv_header_stdc=no
14361 fi
14362 rm -rf conftest*
14363
14364 fi
14365
14366 if test $ac_cv_header_stdc = yes; then
14367   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14368   cat >"conftest.$ac_ext" <<_ACEOF
14369 #line 14369 "configure"
14370 #include "confdefs.h"
14371 #include <stdlib.h>
14372
14373 _ACEOF
14374 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14375   $EGREP "free" >/dev/null 2>&1; then
14376   :
14377 else
14378   ac_cv_header_stdc=no
14379 fi
14380 rm -rf conftest*
14381
14382 fi
14383
14384 if test $ac_cv_header_stdc = yes; then
14385   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14386   if test "$cross_compiling" = yes; then
14387   :
14388 else
14389   cat >"conftest.$ac_ext" <<_ACEOF
14390 #line 14390 "configure"
14391 #include "confdefs.h"
14392 #include <ctype.h>
14393 #if ((' ' & 0x0FF) == 0x020)
14394 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14395 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14396 #else
14397 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14398                      || ('j' <= (c) && (c) <= 'r') \
14399                      || ('s' <= (c) && (c) <= 'z'))
14400 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14401 #endif
14402
14403 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14404 int
14405 main (void)
14406 {
14407   int i;
14408   for (i = 0; i < 256; i++)
14409     if (XOR (islower (i), ISLOWER (i))
14410         || toupper (i) != TOUPPER (i))
14411       $ac_main_return(2);
14412   $ac_main_return (0);
14413 }
14414 _ACEOF
14415 rm -f "conftest$ac_exeext"
14416 if { (eval echo "$as_me:14416: \"$ac_link\"") >&5
14417   (eval $ac_link) 2>&5
14418   ac_status=$?
14419   echo "$as_me:14419: \$? = $ac_status" >&5
14420   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
14421   { (eval echo "$as_me:14421: \"$ac_try\"") >&5
14422   (eval $ac_try) 2>&5
14423   ac_status=$?
14424   echo "$as_me:14424: \$? = $ac_status" >&5
14425   (exit "$ac_status"); }; }; then
14426   :
14427 else
14428   echo "$as_me: program exited with status $ac_status" >&5
14429 echo "$as_me: failed program was:" >&5
14430 cat "conftest.$ac_ext" >&5
14431 ac_cv_header_stdc=no
14432 fi
14433 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
14434 fi
14435 fi
14436 fi
14437 echo "$as_me:14437: result: $ac_cv_header_stdc" >&5
14438 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14439 if test $ac_cv_header_stdc = yes; then
14440
14441 cat >>confdefs.h <<\EOF
14442 #define STDC_HEADERS 1
14443 EOF
14444
14445 fi
14446
14447 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14448
14449 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14450                   inttypes.h stdint.h unistd.h
14451 do
14452 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14453 echo "$as_me:14453: checking for $ac_header" >&5
14454 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14455 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14456   echo $ECHO_N "(cached) $ECHO_C" >&6
14457 else
14458   cat >"conftest.$ac_ext" <<_ACEOF
14459 #line 14459 "configure"
14460 #include "confdefs.h"
14461 $ac_includes_default
14462 #include <$ac_header>
14463 _ACEOF
14464 rm -f "conftest.$ac_objext"
14465 if { (eval echo "$as_me:14465: \"$ac_compile\"") >&5
14466   (eval $ac_compile) 2>&5
14467   ac_status=$?
14468   echo "$as_me:14468: \$? = $ac_status" >&5
14469   (exit "$ac_status"); } &&
14470          { ac_try='test -s "conftest.$ac_objext"'
14471   { (eval echo "$as_me:14471: \"$ac_try\"") >&5
14472   (eval $ac_try) 2>&5
14473   ac_status=$?
14474   echo "$as_me:14474: \$? = $ac_status" >&5
14475   (exit "$ac_status"); }; }; then
14476   eval "$as_ac_Header=yes"
14477 else
14478   echo "$as_me: failed program was:" >&5
14479 cat "conftest.$ac_ext" >&5
14480 eval "$as_ac_Header=no"
14481 fi
14482 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14483 fi
14484 echo "$as_me:14484: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
14485 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
14486 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
14487   cat >>confdefs.h <<EOF
14488 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14489 EOF
14490
14491 fi
14492 done
14493
14494 echo "$as_me:14494: checking whether exit is declared" >&5
14495 echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6
14496 if test "${ac_cv_have_decl_exit+set}" = set; then
14497   echo $ECHO_N "(cached) $ECHO_C" >&6
14498 else
14499   cat >"conftest.$ac_ext" <<_ACEOF
14500 #line 14500 "configure"
14501 #include "confdefs.h"
14502 $ac_includes_default
14503 int
14504 main (void)
14505 {
14506 #ifndef exit
14507   char *p = (char *) exit; (void) p;
14508 #endif
14509
14510   ;
14511   return 0;
14512 }
14513 _ACEOF
14514 rm -f "conftest.$ac_objext"
14515 if { (eval echo "$as_me:14515: \"$ac_compile\"") >&5
14516   (eval $ac_compile) 2>&5
14517   ac_status=$?
14518   echo "$as_me:14518: \$? = $ac_status" >&5
14519   (exit "$ac_status"); } &&
14520          { ac_try='test -s "conftest.$ac_objext"'
14521   { (eval echo "$as_me:14521: \"$ac_try\"") >&5
14522   (eval $ac_try) 2>&5
14523   ac_status=$?
14524   echo "$as_me:14524: \$? = $ac_status" >&5
14525   (exit "$ac_status"); }; }; then
14526   ac_cv_have_decl_exit=yes
14527 else
14528   echo "$as_me: failed program was:" >&5
14529 cat "conftest.$ac_ext" >&5
14530 ac_cv_have_decl_exit=no
14531 fi
14532 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14533 fi
14534 echo "$as_me:14534: result: $ac_cv_have_decl_exit" >&5
14535 echo "${ECHO_T}$ac_cv_have_decl_exit" >&6
14536
14537 # Check whether --enable-largefile or --disable-largefile was given.
14538 if test "${enable_largefile+set}" = set; then
14539   enableval="$enable_largefile"
14540
14541 fi;
14542 if test "$enable_largefile" != no; then
14543
14544   echo "$as_me:14544: checking for special C compiler options needed for large files" >&5
14545 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14546 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14547   echo $ECHO_N "(cached) $ECHO_C" >&6
14548 else
14549   ac_cv_sys_largefile_CC=no
14550      if test "$GCC" != yes; then
14551        ac_save_CC=$CC
14552        while :; do
14553          # IRIX 6.2 and later do not support large files by default,
14554          # so use the C compiler's -n32 option if that helps.
14555          cat >"conftest.$ac_ext" <<_ACEOF
14556 #line 14556 "configure"
14557 #include "confdefs.h"
14558 #include <sys/types.h>
14559  /* Check that off_t can represent 2**63 - 1 correctly.
14560     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14561     since some C++ compilers masquerading as C compilers
14562     incorrectly reject 9223372036854775807.  */
14563 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14564   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14565                        && LARGE_OFF_T % 2147483647 == 1)
14566                       ? 1 : -1];
14567 int
14568 main (void)
14569 {
14570
14571   ;
14572   return 0;
14573 }
14574 _ACEOF
14575          rm -f "conftest.$ac_objext"
14576 if { (eval echo "$as_me:14576: \"$ac_compile\"") >&5
14577   (eval $ac_compile) 2>&5
14578   ac_status=$?
14579   echo "$as_me:14579: \$? = $ac_status" >&5
14580   (exit "$ac_status"); } &&
14581          { ac_try='test -s "conftest.$ac_objext"'
14582   { (eval echo "$as_me:14582: \"$ac_try\"") >&5
14583   (eval $ac_try) 2>&5
14584   ac_status=$?
14585   echo "$as_me:14585: \$? = $ac_status" >&5
14586   (exit "$ac_status"); }; }; then
14587   break
14588 else
14589   echo "$as_me: failed program was:" >&5
14590 cat "conftest.$ac_ext" >&5
14591 fi
14592 rm -f "conftest.$ac_objext"
14593          CC="$CC -n32"
14594          rm -f "conftest.$ac_objext"
14595 if { (eval echo "$as_me:14595: \"$ac_compile\"") >&5
14596   (eval $ac_compile) 2>&5
14597   ac_status=$?
14598   echo "$as_me:14598: \$? = $ac_status" >&5
14599   (exit "$ac_status"); } &&
14600          { ac_try='test -s "conftest.$ac_objext"'
14601   { (eval echo "$as_me:14601: \"$ac_try\"") >&5
14602   (eval $ac_try) 2>&5
14603   ac_status=$?
14604   echo "$as_me:14604: \$? = $ac_status" >&5
14605   (exit "$ac_status"); }; }; then
14606   ac_cv_sys_largefile_CC=' -n32'; break
14607 else
14608   echo "$as_me: failed program was:" >&5
14609 cat "conftest.$ac_ext" >&5
14610 fi
14611 rm -f "conftest.$ac_objext"
14612          break
14613        done
14614        CC=$ac_save_CC
14615        rm -f "conftest.$ac_ext"
14616     fi
14617 fi
14618 echo "$as_me:14618: result: $ac_cv_sys_largefile_CC" >&5
14619 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14620   if test "$ac_cv_sys_largefile_CC" != no; then
14621     CC=$CC$ac_cv_sys_largefile_CC
14622   fi
14623
14624   echo "$as_me:14624: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14625 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14626 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14627   echo $ECHO_N "(cached) $ECHO_C" >&6
14628 else
14629   while :; do
14630   ac_cv_sys_file_offset_bits=no
14631   cat >"conftest.$ac_ext" <<_ACEOF
14632 #line 14632 "configure"
14633 #include "confdefs.h"
14634 #include <sys/types.h>
14635  /* Check that off_t can represent 2**63 - 1 correctly.
14636     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14637     since some C++ compilers masquerading as C compilers
14638     incorrectly reject 9223372036854775807.  */
14639 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14640   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14641                        && LARGE_OFF_T % 2147483647 == 1)
14642                       ? 1 : -1];
14643 int
14644 main (void)
14645 {
14646
14647   ;
14648   return 0;
14649 }
14650 _ACEOF
14651 rm -f "conftest.$ac_objext"
14652 if { (eval echo "$as_me:14652: \"$ac_compile\"") >&5
14653   (eval $ac_compile) 2>&5
14654   ac_status=$?
14655   echo "$as_me:14655: \$? = $ac_status" >&5
14656   (exit "$ac_status"); } &&
14657          { ac_try='test -s "conftest.$ac_objext"'
14658   { (eval echo "$as_me:14658: \"$ac_try\"") >&5
14659   (eval $ac_try) 2>&5
14660   ac_status=$?
14661   echo "$as_me:14661: \$? = $ac_status" >&5
14662   (exit "$ac_status"); }; }; then
14663   break
14664 else
14665   echo "$as_me: failed program was:" >&5
14666 cat "conftest.$ac_ext" >&5
14667 fi
14668 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14669   cat >"conftest.$ac_ext" <<_ACEOF
14670 #line 14670 "configure"
14671 #include "confdefs.h"
14672 #define _FILE_OFFSET_BITS 64
14673 #include <sys/types.h>
14674  /* Check that off_t can represent 2**63 - 1 correctly.
14675     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14676     since some C++ compilers masquerading as C compilers
14677     incorrectly reject 9223372036854775807.  */
14678 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14679   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14680                        && LARGE_OFF_T % 2147483647 == 1)
14681                       ? 1 : -1];
14682 int
14683 main (void)
14684 {
14685
14686   ;
14687   return 0;
14688 }
14689 _ACEOF
14690 rm -f "conftest.$ac_objext"
14691 if { (eval echo "$as_me:14691: \"$ac_compile\"") >&5
14692   (eval $ac_compile) 2>&5
14693   ac_status=$?
14694   echo "$as_me:14694: \$? = $ac_status" >&5
14695   (exit "$ac_status"); } &&
14696          { ac_try='test -s "conftest.$ac_objext"'
14697   { (eval echo "$as_me:14697: \"$ac_try\"") >&5
14698   (eval $ac_try) 2>&5
14699   ac_status=$?
14700   echo "$as_me:14700: \$? = $ac_status" >&5
14701   (exit "$ac_status"); }; }; then
14702   ac_cv_sys_file_offset_bits=64; break
14703 else
14704   echo "$as_me: failed program was:" >&5
14705 cat "conftest.$ac_ext" >&5
14706 fi
14707 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14708   break
14709 done
14710 fi
14711 echo "$as_me:14711: result: $ac_cv_sys_file_offset_bits" >&5
14712 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14713 if test "$ac_cv_sys_file_offset_bits" != no; then
14714
14715 cat >>confdefs.h <<EOF
14716 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14717 EOF
14718
14719 fi
14720 rm -rf conftest*
14721   echo "$as_me:14721: checking for _LARGE_FILES value needed for large files" >&5
14722 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14723 if test "${ac_cv_sys_large_files+set}" = set; then
14724   echo $ECHO_N "(cached) $ECHO_C" >&6
14725 else
14726   while :; do
14727   ac_cv_sys_large_files=no
14728   cat >"conftest.$ac_ext" <<_ACEOF
14729 #line 14729 "configure"
14730 #include "confdefs.h"
14731 #include <sys/types.h>
14732  /* Check that off_t can represent 2**63 - 1 correctly.
14733     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14734     since some C++ compilers masquerading as C compilers
14735     incorrectly reject 9223372036854775807.  */
14736 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14737   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14738                        && LARGE_OFF_T % 2147483647 == 1)
14739                       ? 1 : -1];
14740 int
14741 main (void)
14742 {
14743
14744   ;
14745   return 0;
14746 }
14747 _ACEOF
14748 rm -f "conftest.$ac_objext"
14749 if { (eval echo "$as_me:14749: \"$ac_compile\"") >&5
14750   (eval $ac_compile) 2>&5
14751   ac_status=$?
14752   echo "$as_me:14752: \$? = $ac_status" >&5
14753   (exit "$ac_status"); } &&
14754          { ac_try='test -s "conftest.$ac_objext"'
14755   { (eval echo "$as_me:14755: \"$ac_try\"") >&5
14756   (eval $ac_try) 2>&5
14757   ac_status=$?
14758   echo "$as_me:14758: \$? = $ac_status" >&5
14759   (exit "$ac_status"); }; }; then
14760   break
14761 else
14762   echo "$as_me: failed program was:" >&5
14763 cat "conftest.$ac_ext" >&5
14764 fi
14765 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14766   cat >"conftest.$ac_ext" <<_ACEOF
14767 #line 14767 "configure"
14768 #include "confdefs.h"
14769 #define _LARGE_FILES 1
14770 #include <sys/types.h>
14771  /* Check that off_t can represent 2**63 - 1 correctly.
14772     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14773     since some C++ compilers masquerading as C compilers
14774     incorrectly reject 9223372036854775807.  */
14775 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14776   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14777                        && LARGE_OFF_T % 2147483647 == 1)
14778                       ? 1 : -1];
14779 int
14780 main (void)
14781 {
14782
14783   ;
14784   return 0;
14785 }
14786 _ACEOF
14787 rm -f "conftest.$ac_objext"
14788 if { (eval echo "$as_me:14788: \"$ac_compile\"") >&5
14789   (eval $ac_compile) 2>&5
14790   ac_status=$?
14791   echo "$as_me:14791: \$? = $ac_status" >&5
14792   (exit "$ac_status"); } &&
14793          { ac_try='test -s "conftest.$ac_objext"'
14794   { (eval echo "$as_me:14794: \"$ac_try\"") >&5
14795   (eval $ac_try) 2>&5
14796   ac_status=$?
14797   echo "$as_me:14797: \$? = $ac_status" >&5
14798   (exit "$ac_status"); }; }; then
14799   ac_cv_sys_large_files=1; break
14800 else
14801   echo "$as_me: failed program was:" >&5
14802 cat "conftest.$ac_ext" >&5
14803 fi
14804 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14805   break
14806 done
14807 fi
14808 echo "$as_me:14808: result: $ac_cv_sys_large_files" >&5
14809 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14810 if test "$ac_cv_sys_large_files" != no; then
14811
14812 cat >>confdefs.h <<EOF
14813 #define _LARGE_FILES $ac_cv_sys_large_files
14814 EOF
14815
14816 fi
14817 rm -rf conftest*
14818 fi
14819
14820         if test "$enable_largefile" != no ; then
14821         echo "$as_me:14821: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14822 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14823 if test "${ac_cv_sys_largefile_source+set}" = set; then
14824   echo $ECHO_N "(cached) $ECHO_C" >&6
14825 else
14826   while :; do
14827   ac_cv_sys_largefile_source=no
14828   cat >"conftest.$ac_ext" <<_ACEOF
14829 #line 14829 "configure"
14830 #include "confdefs.h"
14831 #include <stdio.h>
14832 int
14833 main (void)
14834 {
14835 return !fseeko;
14836   ;
14837   return 0;
14838 }
14839 _ACEOF
14840 rm -f "conftest.$ac_objext"
14841 if { (eval echo "$as_me:14841: \"$ac_compile\"") >&5
14842   (eval $ac_compile) 2>&5
14843   ac_status=$?
14844   echo "$as_me:14844: \$? = $ac_status" >&5
14845   (exit "$ac_status"); } &&
14846          { ac_try='test -s "conftest.$ac_objext"'
14847   { (eval echo "$as_me:14847: \"$ac_try\"") >&5
14848   (eval $ac_try) 2>&5
14849   ac_status=$?
14850   echo "$as_me:14850: \$? = $ac_status" >&5
14851   (exit "$ac_status"); }; }; then
14852   break
14853 else
14854   echo "$as_me: failed program was:" >&5
14855 cat "conftest.$ac_ext" >&5
14856 fi
14857 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14858   cat >"conftest.$ac_ext" <<_ACEOF
14859 #line 14859 "configure"
14860 #include "confdefs.h"
14861 #define _LARGEFILE_SOURCE 1
14862 #include <stdio.h>
14863 int
14864 main (void)
14865 {
14866 return !fseeko;
14867   ;
14868   return 0;
14869 }
14870 _ACEOF
14871 rm -f "conftest.$ac_objext"
14872 if { (eval echo "$as_me:14872: \"$ac_compile\"") >&5
14873   (eval $ac_compile) 2>&5
14874   ac_status=$?
14875   echo "$as_me:14875: \$? = $ac_status" >&5
14876   (exit "$ac_status"); } &&
14877          { ac_try='test -s "conftest.$ac_objext"'
14878   { (eval echo "$as_me:14878: \"$ac_try\"") >&5
14879   (eval $ac_try) 2>&5
14880   ac_status=$?
14881   echo "$as_me:14881: \$? = $ac_status" >&5
14882   (exit "$ac_status"); }; }; then
14883   ac_cv_sys_largefile_source=1; break
14884 else
14885   echo "$as_me: failed program was:" >&5
14886 cat "conftest.$ac_ext" >&5
14887 fi
14888 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14889   break
14890 done
14891 fi
14892 echo "$as_me:14892: result: $ac_cv_sys_largefile_source" >&5
14893 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14894 if test "$ac_cv_sys_largefile_source" != no; then
14895
14896 cat >>confdefs.h <<EOF
14897 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14898 EOF
14899
14900 fi
14901 rm -rf conftest*
14902
14903 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14904 # in glibc 2.1.3, but that breaks too many other things.
14905 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14906 echo "$as_me:14906: checking for fseeko" >&5
14907 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14908 if test "${ac_cv_func_fseeko+set}" = set; then
14909   echo $ECHO_N "(cached) $ECHO_C" >&6
14910 else
14911   cat >"conftest.$ac_ext" <<_ACEOF
14912 #line 14912 "configure"
14913 #include "confdefs.h"
14914 #include <stdio.h>
14915 int
14916 main (void)
14917 {
14918 return fseeko && fseeko (stdin, 0, 0);
14919   ;
14920   return 0;
14921 }
14922 _ACEOF
14923 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14924 if { (eval echo "$as_me:14924: \"$ac_link\"") >&5
14925   (eval $ac_link) 2>&5
14926   ac_status=$?
14927   echo "$as_me:14927: \$? = $ac_status" >&5
14928   (exit "$ac_status"); } &&
14929          { ac_try='test -s "conftest$ac_exeext"'
14930   { (eval echo "$as_me:14930: \"$ac_try\"") >&5
14931   (eval $ac_try) 2>&5
14932   ac_status=$?
14933   echo "$as_me:14933: \$? = $ac_status" >&5
14934   (exit "$ac_status"); }; }; then
14935   ac_cv_func_fseeko=yes
14936 else
14937   echo "$as_me: failed program was:" >&5
14938 cat "conftest.$ac_ext" >&5
14939 ac_cv_func_fseeko=no
14940 fi
14941 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14942 fi
14943 echo "$as_me:14943: result: $ac_cv_func_fseeko" >&5
14944 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14945 if test $ac_cv_func_fseeko = yes; then
14946
14947 cat >>confdefs.h <<\EOF
14948 #define HAVE_FSEEKO 1
14949 EOF
14950
14951 fi
14952
14953         # Normally we would collect these definitions in the config.h,
14954         # but (like _XOPEN_SOURCE), some environments rely on having these
14955         # defined before any of the system headers are included.  Another
14956         # case comes up with C++, e.g., on AIX the compiler compiles the
14957         # header files by themselves before looking at the body files it is
14958         # told to compile.  For ncurses, those header files do not include
14959         # the config.h
14960         if test "$ac_cv_sys_large_files" != no
14961         then
14962
14963         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14964         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14965
14966         fi
14967         if test "$ac_cv_sys_largefile_source" != no
14968         then
14969
14970         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14971         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14972
14973         fi
14974         if test "$ac_cv_sys_file_offset_bits" != no
14975         then
14976
14977         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14978         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14979
14980         fi
14981
14982         echo "$as_me:14982: checking whether to use struct dirent64" >&5
14983 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14984 if test "${cf_cv_struct_dirent64+set}" = set; then
14985   echo $ECHO_N "(cached) $ECHO_C" >&6
14986 else
14987
14988                 cat >"conftest.$ac_ext" <<_ACEOF
14989 #line 14989 "configure"
14990 #include "confdefs.h"
14991
14992 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14993 #include <sys/types.h>
14994 #include <dirent.h>
14995
14996 int
14997 main (void)
14998 {
14999
15000                 /* if transitional largefile support is setup, this is true */
15001                 extern struct dirent64 * readdir(DIR *);
15002                 struct dirent64 *x = readdir((DIR *)0);
15003                 struct dirent *y = readdir((DIR *)0);
15004                 int z = x - y;
15005                 (void)z;
15006
15007   ;
15008   return 0;
15009 }
15010 _ACEOF
15011 rm -f "conftest.$ac_objext"
15012 if { (eval echo "$as_me:15012: \"$ac_compile\"") >&5
15013   (eval $ac_compile) 2>&5
15014   ac_status=$?
15015   echo "$as_me:15015: \$? = $ac_status" >&5
15016   (exit "$ac_status"); } &&
15017          { ac_try='test -s "conftest.$ac_objext"'
15018   { (eval echo "$as_me:15018: \"$ac_try\"") >&5
15019   (eval $ac_try) 2>&5
15020   ac_status=$?
15021   echo "$as_me:15021: \$? = $ac_status" >&5
15022   (exit "$ac_status"); }; }; then
15023   cf_cv_struct_dirent64=yes
15024 else
15025   echo "$as_me: failed program was:" >&5
15026 cat "conftest.$ac_ext" >&5
15027 cf_cv_struct_dirent64=no
15028 fi
15029 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15030
15031 fi
15032 echo "$as_me:15032: result: $cf_cv_struct_dirent64" >&5
15033 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
15034         test "$cf_cv_struct_dirent64" = yes &&
15035 cat >>confdefs.h <<\EOF
15036 #define HAVE_STRUCT_DIRENT64 1
15037 EOF
15038
15039         fi
15040
15041 ### Enable compiling-in rcs id's
15042 echo "$as_me:15042: checking if RCS identifiers should be compiled-in" >&5
15043 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
15044
15045 # Check whether --with-rcs-ids or --without-rcs-ids was given.
15046 if test "${with_rcs_ids+set}" = set; then
15047   withval="$with_rcs_ids"
15048   with_rcs_ids=$withval
15049 else
15050   with_rcs_ids=no
15051 fi;
15052 echo "$as_me:15052: result: $with_rcs_ids" >&5
15053 echo "${ECHO_T}$with_rcs_ids" >&6
15054 test "$with_rcs_ids" = yes &&
15055 cat >>confdefs.h <<\EOF
15056 #define USE_RCS_IDS 1
15057 EOF
15058
15059 ###############################################################################
15060
15061 ### Note that some functions (such as const) are normally disabled anyway.
15062 echo "$as_me:15062: checking if you want to build with function extensions" >&5
15063 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
15064
15065 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
15066 if test "${enable_ext_funcs+set}" = set; then
15067   enableval="$enable_ext_funcs"
15068   with_ext_funcs=$enableval
15069 else
15070   with_ext_funcs=yes
15071 fi;
15072 echo "$as_me:15072: result: $with_ext_funcs" >&5
15073 echo "${ECHO_T}$with_ext_funcs" >&6
15074 if test "$with_ext_funcs" = yes ; then
15075         NCURSES_EXT_FUNCS=1
15076
15077 cat >>confdefs.h <<\EOF
15078 #define HAVE_USE_DEFAULT_COLORS 1
15079 EOF
15080
15081 cat >>confdefs.h <<\EOF
15082 #define NCURSES_EXT_FUNCS 1
15083 EOF
15084
15085 else
15086         NCURSES_EXT_FUNCS=0
15087 fi
15088
15089 ###   use option --enable-const to turn on use of const beyond that in XSI.
15090 echo "$as_me:15090: checking for extended use of const keyword" >&5
15091 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
15092
15093 # Check whether --enable-const or --disable-const was given.
15094 if test "${enable_const+set}" = set; then
15095   enableval="$enable_const"
15096   with_ext_const=$enableval
15097 else
15098   with_ext_const=no
15099 fi;
15100 echo "$as_me:15100: result: $with_ext_const" >&5
15101 echo "${ECHO_T}$with_ext_const" >&6
15102 NCURSES_CONST='/*nothing*/'
15103 if test "$with_ext_const" = yes ; then
15104         NCURSES_CONST=const
15105 fi
15106
15107 ###############################################################################
15108 # These options are relatively safe to experiment with.
15109
15110 echo "$as_me:15110: checking if you want all development code" >&5
15111 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
15112
15113 # Check whether --with-develop or --without-develop was given.
15114 if test "${with_develop+set}" = set; then
15115   withval="$with_develop"
15116   with_develop=$withval
15117 else
15118   with_develop=no
15119 fi;
15120 echo "$as_me:15120: result: $with_develop" >&5
15121 echo "${ECHO_T}$with_develop" >&6
15122
15123 ###############################################################################
15124 # These are just experimental, probably should not be in a package:
15125
15126 # This is still experimental (20080329), but should ultimately be moved to
15127 # the script-block --with-normal, etc.
15128
15129 echo "$as_me:15129: checking if you want to link with the pthread library" >&5
15130 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
15131
15132 # Check whether --with-pthread or --without-pthread was given.
15133 if test "${with_pthread+set}" = set; then
15134   withval="$with_pthread"
15135   with_pthread=$withval
15136 else
15137   with_pthread=no
15138 fi;
15139 echo "$as_me:15139: result: $with_pthread" >&5
15140 echo "${ECHO_T}$with_pthread" >&6
15141
15142 if test "$with_pthread" != no ; then
15143         echo "$as_me:15143: checking for pthread.h" >&5
15144 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
15145 if test "${ac_cv_header_pthread_h+set}" = set; then
15146   echo $ECHO_N "(cached) $ECHO_C" >&6
15147 else
15148   cat >"conftest.$ac_ext" <<_ACEOF
15149 #line 15149 "configure"
15150 #include "confdefs.h"
15151 #include <pthread.h>
15152 _ACEOF
15153 if { (eval echo "$as_me:15153: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15154   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15155   ac_status=$?
15156   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15157   rm -f conftest.er1
15158   cat conftest.err >&5
15159   echo "$as_me:15159: \$? = $ac_status" >&5
15160   (exit "$ac_status"); } >/dev/null; then
15161   if test -s conftest.err; then
15162     ac_cpp_err=$ac_c_preproc_warn_flag
15163   else
15164     ac_cpp_err=
15165   fi
15166 else
15167   ac_cpp_err=yes
15168 fi
15169 if test -z "$ac_cpp_err"; then
15170   ac_cv_header_pthread_h=yes
15171 else
15172   echo "$as_me: failed program was:" >&5
15173   cat "conftest.$ac_ext" >&5
15174   ac_cv_header_pthread_h=no
15175 fi
15176 rm -f conftest.err "conftest.$ac_ext"
15177 fi
15178 echo "$as_me:15178: result: $ac_cv_header_pthread_h" >&5
15179 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
15180 if test "$ac_cv_header_pthread_h" = yes; then
15181
15182 cat >>confdefs.h <<\EOF
15183 #define HAVE_PTHREADS_H 1
15184 EOF
15185
15186         for cf_lib_pthread in pthread c_r
15187         do
15188             echo "$as_me:15188: checking if we can link with the $cf_lib_pthread library" >&5
15189 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
15190             cf_save_LIBS="$LIBS"
15191
15192 cf_add_libs="$LIBS"
15193 # reverse order
15194 cf_add_0lib=
15195 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15196 # filter duplicates
15197 for cf_add_1lib in $cf_add_0lib; do
15198         for cf_add_2lib in $cf_add_libs; do
15199                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15200                         cf_add_1lib=
15201                         break
15202                 fi
15203         done
15204         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15205 done
15206 LIBS="$cf_add_libs"
15207
15208             cat >"conftest.$ac_ext" <<_ACEOF
15209 #line 15209 "configure"
15210 #include "confdefs.h"
15211
15212 #include <pthread.h>
15213
15214 int
15215 main (void)
15216 {
15217
15218                 int rc = pthread_create(0,0,0,0);
15219                 int r2 = pthread_mutexattr_settype(0, 0);
15220
15221   ;
15222   return 0;
15223 }
15224 _ACEOF
15225 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15226 if { (eval echo "$as_me:15226: \"$ac_link\"") >&5
15227   (eval $ac_link) 2>&5
15228   ac_status=$?
15229   echo "$as_me:15229: \$? = $ac_status" >&5
15230   (exit "$ac_status"); } &&
15231          { ac_try='test -s "conftest$ac_exeext"'
15232   { (eval echo "$as_me:15232: \"$ac_try\"") >&5
15233   (eval $ac_try) 2>&5
15234   ac_status=$?
15235   echo "$as_me:15235: \$? = $ac_status" >&5
15236   (exit "$ac_status"); }; }; then
15237   with_pthread=yes
15238 else
15239   echo "$as_me: failed program was:" >&5
15240 cat "conftest.$ac_ext" >&5
15241 with_pthread=no
15242 fi
15243 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15244             LIBS="$cf_save_LIBS"
15245             echo "$as_me:15245: result: $with_pthread" >&5
15246 echo "${ECHO_T}$with_pthread" >&6
15247             test "$with_pthread" = yes && break
15248         done
15249
15250         if test "$with_pthread" = yes ; then
15251
15252 cf_add_libs="$LIBS"
15253 # reverse order
15254 cf_add_0lib=
15255 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15256 # filter duplicates
15257 for cf_add_1lib in $cf_add_0lib; do
15258         for cf_add_2lib in $cf_add_libs; do
15259                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15260                         cf_add_1lib=
15261                         break
15262                 fi
15263         done
15264         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15265 done
15266 LIBS="$cf_add_libs"
15267
15268 cat >>confdefs.h <<\EOF
15269 #define HAVE_LIBPTHREADS 1
15270 EOF
15271
15272         else
15273             { { echo "$as_me:15273: error: Cannot link with pthread library" >&5
15274 echo "$as_me: error: Cannot link with pthread library" >&2;}
15275    { (exit 1); exit 1; }; }
15276         fi
15277
15278 fi
15279
15280 fi
15281
15282 echo "$as_me:15282: checking if you want to use weak-symbols for pthreads" >&5
15283 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15284
15285 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15286 if test "${enable_weak_symbols+set}" = set; then
15287   enableval="$enable_weak_symbols"
15288   use_weak_symbols=$withval
15289 else
15290   use_weak_symbols=no
15291 fi;
15292 echo "$as_me:15292: result: $use_weak_symbols" >&5
15293 echo "${ECHO_T}$use_weak_symbols" >&6
15294 if test "$use_weak_symbols" = yes ; then
15295
15296 echo "$as_me:15296: checking if $CC supports weak symbols" >&5
15297 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15298 if test "${cf_cv_weak_symbols+set}" = set; then
15299   echo $ECHO_N "(cached) $ECHO_C" >&6
15300 else
15301
15302 cat >"conftest.$ac_ext" <<_ACEOF
15303 #line 15303 "configure"
15304 #include "confdefs.h"
15305
15306 #include <stdio.h>
15307 int
15308 main (void)
15309 {
15310
15311 #if defined(__GNUC__)
15312 #  if defined __USE_ISOC99
15313 #    define _cat_pragma(exp)    _Pragma(#exp)
15314 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15315 #  else
15316 #    define _weak_pragma(exp)
15317 #  endif
15318 #  define _declare(name)        __extension__ extern __typeof__(name) name
15319 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15320 #endif
15321
15322 weak_symbol(fopen);
15323
15324   ;
15325   return 0;
15326 }
15327 _ACEOF
15328 rm -f "conftest.$ac_objext"
15329 if { (eval echo "$as_me:15329: \"$ac_compile\"") >&5
15330   (eval $ac_compile) 2>&5
15331   ac_status=$?
15332   echo "$as_me:15332: \$? = $ac_status" >&5
15333   (exit "$ac_status"); } &&
15334          { ac_try='test -s "conftest.$ac_objext"'
15335   { (eval echo "$as_me:15335: \"$ac_try\"") >&5
15336   (eval $ac_try) 2>&5
15337   ac_status=$?
15338   echo "$as_me:15338: \$? = $ac_status" >&5
15339   (exit "$ac_status"); }; }; then
15340   cf_cv_weak_symbols=yes
15341 else
15342   echo "$as_me: failed program was:" >&5
15343 cat "conftest.$ac_ext" >&5
15344 cf_cv_weak_symbols=no
15345 fi
15346 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15347
15348 fi
15349 echo "$as_me:15349: result: $cf_cv_weak_symbols" >&5
15350 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15351
15352 else
15353         cf_cv_weak_symbols=no
15354 fi
15355
15356 if test $cf_cv_weak_symbols = yes ; then
15357
15358 cat >>confdefs.h <<\EOF
15359 #define USE_WEAK_SYMBOLS 1
15360 EOF
15361
15362 fi
15363
15364 PTHREAD=
15365 if test "$with_pthread" = "yes" ; then
15366
15367 cat >>confdefs.h <<\EOF
15368 #define USE_PTHREADS 1
15369 EOF
15370
15371         enable_reentrant=yes
15372         if test $cf_cv_weak_symbols = yes ; then
15373                 PTHREAD=-lpthread
15374         fi
15375 fi
15376
15377 # OpenSUSE is installing ncurses6, using reentrant option.
15378 echo "$as_me:15378: checking for _nc_TABSIZE" >&5
15379 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15380 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15381   echo $ECHO_N "(cached) $ECHO_C" >&6
15382 else
15383   cat >"conftest.$ac_ext" <<_ACEOF
15384 #line 15384 "configure"
15385 #include "confdefs.h"
15386 #define _nc_TABSIZE autoconf_temporary
15387 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15388 #undef _nc_TABSIZE
15389
15390 #ifdef __cplusplus
15391 extern "C"
15392 #endif
15393
15394 /* We use char because int might match the return type of a gcc2
15395    builtin and then its argument prototype would still apply.  */
15396 char _nc_TABSIZE (void);
15397
15398 int
15399 main (void)
15400 {
15401
15402 /* The GNU C library defines stubs for functions which it implements
15403     to always fail with ENOSYS.  Some functions are actually named
15404     something starting with __ and the normal name is an alias.  */
15405 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15406 #error found stub for _nc_TABSIZE
15407 #endif
15408
15409         return _nc_TABSIZE ();
15410   ;
15411   return 0;
15412 }
15413 _ACEOF
15414 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15415 if { (eval echo "$as_me:15415: \"$ac_link\"") >&5
15416   (eval $ac_link) 2>&5
15417   ac_status=$?
15418   echo "$as_me:15418: \$? = $ac_status" >&5
15419   (exit "$ac_status"); } &&
15420          { ac_try='test -s "conftest$ac_exeext"'
15421   { (eval echo "$as_me:15421: \"$ac_try\"") >&5
15422   (eval $ac_try) 2>&5
15423   ac_status=$?
15424   echo "$as_me:15424: \$? = $ac_status" >&5
15425   (exit "$ac_status"); }; }; then
15426   ac_cv_func__nc_TABSIZE=yes
15427 else
15428   echo "$as_me: failed program was:" >&5
15429 cat "conftest.$ac_ext" >&5
15430 ac_cv_func__nc_TABSIZE=no
15431 fi
15432 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15433 fi
15434 echo "$as_me:15434: result: $ac_cv_func__nc_TABSIZE" >&5
15435 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15436 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15437   assume_reentrant=yes
15438 else
15439   assume_reentrant=no
15440 fi
15441
15442 # Reentrant code has to be opaque; there's little advantage to making ncurses
15443 # opaque outside of that, so there is no --enable-opaque option.  We can use
15444 # this option without --with-pthreads, but this will be always set for
15445 # pthreads.
15446 echo "$as_me:15446: checking if you want experimental reentrant code" >&5
15447 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15448
15449 # Check whether --enable-reentrant or --disable-reentrant was given.
15450 if test "${enable_reentrant+set}" = set; then
15451   enableval="$enable_reentrant"
15452   with_reentrant=$enableval
15453 else
15454   with_reentrant=$assume_reentrant
15455 fi;
15456 echo "$as_me:15456: result: $with_reentrant" >&5
15457 echo "${ECHO_T}$with_reentrant" >&6
15458 if test "$with_reentrant" = yes ; then
15459         cf_cv_enable_reentrant=1
15460         if test $cf_cv_weak_symbols = yes ; then
15461
15462 # remove pthread library from $LIBS
15463 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15464
15465         elif test "$assume_reentrant" = no ; then
15466                 LIB_SUFFIX="t${LIB_SUFFIX}"
15467         fi
15468
15469 cat >>confdefs.h <<\EOF
15470 #define USE_REENTRANT 1
15471 EOF
15472
15473 else
15474         cf_cv_enable_reentrant=0
15475 fi
15476
15477 ### Allow using a different wrap-prefix
15478 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15479         echo "$as_me:15479: checking for prefix used to wrap public variables" >&5
15480 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15481
15482 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15483 if test "${with_wrap_prefix+set}" = set; then
15484   withval="$with_wrap_prefix"
15485   NCURSES_WRAP_PREFIX=$withval
15486 else
15487   NCURSES_WRAP_PREFIX=_nc_
15488 fi;
15489         echo "$as_me:15489: result: $NCURSES_WRAP_PREFIX" >&5
15490 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15491 else
15492         NCURSES_WRAP_PREFIX=_nc_
15493 fi
15494
15495 cat >>confdefs.h <<EOF
15496 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15497 EOF
15498
15499 ###############################################################################
15500
15501 ###     use option --disable-echo to suppress full display compiling commands
15502
15503 echo "$as_me:15503: checking if you want to see long compiling messages" >&5
15504 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15505
15506 # Check whether --enable-echo or --disable-echo was given.
15507 if test "${enable_echo+set}" = set; then
15508   enableval="$enable_echo"
15509   test "$enableval" != no && enableval=yes
15510         if test "$enableval" != "yes" ; then
15511
15512         ECHO_LT='--silent'
15513         ECHO_LD='@echo linking $@;'
15514         RULE_CC='@echo compiling $<'
15515         SHOW_CC='@echo compiling $@'
15516         ECHO_CC='@'
15517
15518         else
15519
15520         ECHO_LT=''
15521         ECHO_LD=''
15522         RULE_CC=''
15523         SHOW_CC=''
15524         ECHO_CC=''
15525
15526         fi
15527 else
15528   enableval=yes
15529
15530         ECHO_LT=''
15531         ECHO_LD=''
15532         RULE_CC=''
15533         SHOW_CC=''
15534         ECHO_CC=''
15535
15536 fi;
15537 echo "$as_me:15537: result: $enableval" >&5
15538 echo "${ECHO_T}$enableval" >&6
15539
15540 echo "$as_me:15540: checking if you want to use C11 _Noreturn feature" >&5
15541 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15542
15543 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15544 if test "${enable_stdnoreturn+set}" = set; then
15545   enableval="$enable_stdnoreturn"
15546   test "$enableval" != yes && enableval=no
15547         if test "$enableval" != "no" ; then
15548     enable_stdnoreturn=yes
15549         else
15550                 enable_stdnoreturn=no
15551         fi
15552 else
15553   enableval=no
15554         enable_stdnoreturn=no
15555
15556 fi;
15557 echo "$as_me:15557: result: $enable_stdnoreturn" >&5
15558 echo "${ECHO_T}$enable_stdnoreturn" >&6
15559
15560 if test $enable_stdnoreturn = yes; then
15561 echo "$as_me:15561: checking for C11 _Noreturn feature" >&5
15562 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15563 if test "${cf_cv_c11_noreturn+set}" = set; then
15564   echo $ECHO_N "(cached) $ECHO_C" >&6
15565 else
15566   cat >"conftest.$ac_ext" <<_ACEOF
15567 #line 15567 "configure"
15568 #include "confdefs.h"
15569
15570 $ac_includes_default
15571 #include <stdnoreturn.h>
15572 static _Noreturn void giveup(void) { exit(0); }
15573
15574 int
15575 main (void)
15576 {
15577 if (feof(stdin)) giveup()
15578   ;
15579   return 0;
15580 }
15581 _ACEOF
15582 rm -f "conftest.$ac_objext"
15583 if { (eval echo "$as_me:15583: \"$ac_compile\"") >&5
15584   (eval $ac_compile) 2>&5
15585   ac_status=$?
15586   echo "$as_me:15586: \$? = $ac_status" >&5
15587   (exit "$ac_status"); } &&
15588          { ac_try='test -s "conftest.$ac_objext"'
15589   { (eval echo "$as_me:15589: \"$ac_try\"") >&5
15590   (eval $ac_try) 2>&5
15591   ac_status=$?
15592   echo "$as_me:15592: \$? = $ac_status" >&5
15593   (exit "$ac_status"); }; }; then
15594   cf_cv_c11_noreturn=yes
15595 else
15596   echo "$as_me: failed program was:" >&5
15597 cat "conftest.$ac_ext" >&5
15598 cf_cv_c11_noreturn=no
15599 fi
15600 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15601
15602 fi
15603 echo "$as_me:15603: result: $cf_cv_c11_noreturn" >&5
15604 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15605 else
15606         cf_cv_c11_noreturn=no,
15607 fi
15608
15609 if test "$cf_cv_c11_noreturn" = yes; then
15610
15611 cat >>confdefs.h <<\EOF
15612 #define HAVE_STDNORETURN_H 1
15613 EOF
15614
15615 cat >>confdefs.h <<EOF
15616 #define STDC_NORETURN _Noreturn
15617 EOF
15618
15619         HAVE_STDNORETURN_H=1
15620 else
15621         HAVE_STDNORETURN_H=0
15622 fi
15623
15624 if test "$GCC" = yes || test "$GXX" = yes
15625 then
15626
15627 if test "$GCC" = yes || test "$GXX" = yes
15628 then
15629         case $CFLAGS in
15630         (*-Werror=*)
15631                 cf_temp_flags=
15632                 for cf_temp_scan in $CFLAGS
15633                 do
15634                         case "x$cf_temp_scan" in
15635                         (x-Werror=format*)
15636
15637         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15638         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15639
15640                                 ;;
15641                         (x-Werror=*)
15642
15643         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15644         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15645
15646                                 ;;
15647                         (*)
15648
15649         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15650         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15651
15652                                 ;;
15653                         esac
15654                 done
15655                 if test "x$CFLAGS" != "x$cf_temp_flags"
15656                 then
15657                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15658
15659 echo "${as_me:-configure}:15659: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15660
15661                         CFLAGS="$cf_temp_flags"
15662                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15663
15664 echo "${as_me:-configure}:15664: testing ... fixed $CFLAGS ..." 1>&5
15665
15666                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15667
15668 echo "${as_me:-configure}:15668: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15669
15670                 fi
15671                 ;;
15672         esac
15673 fi
15674
15675 if test "$GCC" = yes || test "$GXX" = yes
15676 then
15677         case $CPPFLAGS in
15678         (*-Werror=*)
15679                 cf_temp_flags=
15680                 for cf_temp_scan in $CPPFLAGS
15681                 do
15682                         case "x$cf_temp_scan" in
15683                         (x-Werror=format*)
15684
15685         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15686         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15687
15688                                 ;;
15689                         (x-Werror=*)
15690
15691         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15692         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15693
15694                                 ;;
15695                         (*)
15696
15697         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15698         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15699
15700                                 ;;
15701                         esac
15702                 done
15703                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15704                 then
15705                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15706
15707 echo "${as_me:-configure}:15707: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15708
15709                         CPPFLAGS="$cf_temp_flags"
15710                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15711
15712 echo "${as_me:-configure}:15712: testing ... fixed $CPPFLAGS ..." 1>&5
15713
15714                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15715
15716 echo "${as_me:-configure}:15716: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15717
15718                 fi
15719                 ;;
15720         esac
15721 fi
15722
15723 if test "$GCC" = yes || test "$GXX" = yes
15724 then
15725         case $LDFLAGS in
15726         (*-Werror=*)
15727                 cf_temp_flags=
15728                 for cf_temp_scan in $LDFLAGS
15729                 do
15730                         case "x$cf_temp_scan" in
15731                         (x-Werror=format*)
15732
15733         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15734         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15735
15736                                 ;;
15737                         (x-Werror=*)
15738
15739         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15740         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15741
15742                                 ;;
15743                         (*)
15744
15745         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15746         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15747
15748                                 ;;
15749                         esac
15750                 done
15751                 if test "x$LDFLAGS" != "x$cf_temp_flags"
15752                 then
15753                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15754
15755 echo "${as_me:-configure}:15755: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15756
15757                         LDFLAGS="$cf_temp_flags"
15758                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15759
15760 echo "${as_me:-configure}:15760: testing ... fixed $LDFLAGS ..." 1>&5
15761
15762                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15763
15764 echo "${as_me:-configure}:15764: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15765
15766                 fi
15767                 ;;
15768         esac
15769 fi
15770
15771 echo "$as_me:15771: checking if you want to turn on gcc warnings" >&5
15772 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15773
15774 # Check whether --enable-warnings or --disable-warnings was given.
15775 if test "${enable_warnings+set}" = set; then
15776   enableval="$enable_warnings"
15777   test "$enableval" != yes && enableval=no
15778         if test "$enableval" != "no" ; then
15779     enable_warnings=yes
15780         else
15781                 enable_warnings=no
15782         fi
15783 else
15784   enableval=no
15785         enable_warnings=no
15786
15787 fi;
15788 echo "$as_me:15788: result: $enable_warnings" >&5
15789 echo "${ECHO_T}$enable_warnings" >&6
15790 if test "$enable_warnings" = "yes"
15791 then
15792
15793 if test "x$have_x" = xyes; then
15794
15795 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15796 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15797 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15798 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15799 for cf_X_CFLAGS in $X_CFLAGS
15800 do
15801         case "x$cf_X_CFLAGS" in
15802         x-[IUD]*)
15803                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15804                 ;;
15805         *)
15806                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15807                 ;;
15808         esac
15809 done
15810
15811 cat >"conftest.$ac_ext" <<_ACEOF
15812 #line 15812 "configure"
15813 #include "confdefs.h"
15814
15815 #include <stdlib.h>
15816 #include <X11/Intrinsic.h>
15817
15818 int
15819 main (void)
15820 {
15821 String foo = malloc(1); free((void*)foo)
15822   ;
15823   return 0;
15824 }
15825 _ACEOF
15826 rm -f "conftest.$ac_objext"
15827 if { (eval echo "$as_me:15827: \"$ac_compile\"") >&5
15828   (eval $ac_compile) 2>&5
15829   ac_status=$?
15830   echo "$as_me:15830: \$? = $ac_status" >&5
15831   (exit "$ac_status"); } &&
15832          { ac_try='test -s "conftest.$ac_objext"'
15833   { (eval echo "$as_me:15833: \"$ac_try\"") >&5
15834   (eval $ac_try) 2>&5
15835   ac_status=$?
15836   echo "$as_me:15836: \$? = $ac_status" >&5
15837   (exit "$ac_status"); }; }; then
15838
15839 echo "$as_me:15839: checking for X11/Xt const-feature" >&5
15840 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15841 if test "${cf_cv_const_x_string+set}" = set; then
15842   echo $ECHO_N "(cached) $ECHO_C" >&6
15843 else
15844
15845         cat >"conftest.$ac_ext" <<_ACEOF
15846 #line 15846 "configure"
15847 #include "confdefs.h"
15848
15849 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15850 #undef  XTSTRINGDEFINES /* X11R5 and later */
15851 #include <stdlib.h>
15852 #include <X11/Intrinsic.h>
15853
15854 int
15855 main (void)
15856 {
15857 String foo = malloc(1); *foo = 0
15858   ;
15859   return 0;
15860 }
15861 _ACEOF
15862 rm -f "conftest.$ac_objext"
15863 if { (eval echo "$as_me:15863: \"$ac_compile\"") >&5
15864   (eval $ac_compile) 2>&5
15865   ac_status=$?
15866   echo "$as_me:15866: \$? = $ac_status" >&5
15867   (exit "$ac_status"); } &&
15868          { ac_try='test -s "conftest.$ac_objext"'
15869   { (eval echo "$as_me:15869: \"$ac_try\"") >&5
15870   (eval $ac_try) 2>&5
15871   ac_status=$?
15872   echo "$as_me:15872: \$? = $ac_status" >&5
15873   (exit "$ac_status"); }; }; then
15874
15875                         cf_cv_const_x_string=no
15876
15877 else
15878   echo "$as_me: failed program was:" >&5
15879 cat "conftest.$ac_ext" >&5
15880
15881                         cf_cv_const_x_string=yes
15882
15883 fi
15884 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15885
15886 fi
15887 echo "$as_me:15887: result: $cf_cv_const_x_string" >&5
15888 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15889
15890 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15891 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15892 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15893
15894 case "$cf_cv_const_x_string" in
15895 (no)
15896
15897         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15898         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15899
15900         ;;
15901 (*)
15902
15903         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15904         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15905
15906         ;;
15907 esac
15908
15909 else
15910   echo "$as_me: failed program was:" >&5
15911 cat "conftest.$ac_ext" >&5
15912 fi
15913 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15914  fi
15915 cat > "conftest.$ac_ext" <<EOF
15916 #line 15916 "${as_me:-configure}"
15917 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15918 EOF
15919 if test "$INTEL_COMPILER" = yes
15920 then
15921 # The "-wdXXX" options suppress warnings:
15922 # remark #1419: external declaration in primary source file
15923 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15924 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15925 # remark #193: zero used for undefined preprocessing identifier
15926 # remark #593: variable "curs_sb_left_arrow" was set but never used
15927 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15928 # remark #869: parameter "tw" was never referenced
15929 # remark #981: operands are evaluated in unspecified order
15930 # warning #279: controlling expression is constant
15931
15932         { echo "$as_me:15932: checking for $CC warning options..." >&5
15933 echo "$as_me: checking for $CC warning options..." >&6;}
15934         cf_save_CFLAGS="$CFLAGS"
15935         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15936         for cf_opt in \
15937                 wd1419 \
15938                 wd1683 \
15939                 wd1684 \
15940                 wd193 \
15941                 wd593 \
15942                 wd279 \
15943                 wd810 \
15944                 wd869 \
15945                 wd981
15946         do
15947                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15948                 if { (eval echo "$as_me:15948: \"$ac_compile\"") >&5
15949   (eval $ac_compile) 2>&5
15950   ac_status=$?
15951   echo "$as_me:15951: \$? = $ac_status" >&5
15952   (exit "$ac_status"); }; then
15953                         test -n "$verbose" && echo "$as_me:15953: result: ... -$cf_opt" >&5
15954 echo "${ECHO_T}... -$cf_opt" >&6
15955                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15956                 fi
15957         done
15958         CFLAGS="$cf_save_CFLAGS"
15959 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15960 then
15961         { echo "$as_me:15961: checking for $CC warning options..." >&5
15962 echo "$as_me: checking for $CC warning options..." >&6;}
15963         cf_save_CFLAGS="$CFLAGS"
15964         cf_warn_CONST=""
15965         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15966         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15967         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15968         for cf_opt in W Wall \
15969                 Wbad-function-cast \
15970                 Wcast-align \
15971                 Wcast-qual \
15972                 Wdeclaration-after-statement \
15973                 Wextra \
15974                 Winline \
15975                 Wmissing-declarations \
15976                 Wmissing-prototypes \
15977                 Wnested-externs \
15978                 Wpointer-arith \
15979                 Wshadow \
15980                 Wstrict-prototypes \
15981                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15982         do
15983                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15984                 if { (eval echo "$as_me:15984: \"$ac_compile\"") >&5
15985   (eval $ac_compile) 2>&5
15986   ac_status=$?
15987   echo "$as_me:15987: \$? = $ac_status" >&5
15988   (exit "$ac_status"); }; then
15989                         test -n "$verbose" && echo "$as_me:15989: result: ... -$cf_opt" >&5
15990 echo "${ECHO_T}... -$cf_opt" >&6
15991                         case "$cf_opt" in
15992                         (Winline)
15993                                 case "$GCC_VERSION" in
15994                                 ([34].*)
15995                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15996
15997 echo "${as_me:-configure}:15997: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15998
15999                                         continue;;
16000                                 esac
16001                                 ;;
16002                         (Wpointer-arith)
16003                                 case "$GCC_VERSION" in
16004                                 ([12].*)
16005                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16006
16007 echo "${as_me:-configure}:16007: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16008
16009                                         continue;;
16010                                 esac
16011                                 ;;
16012                         esac
16013                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16014                 fi
16015         done
16016         CFLAGS="$cf_save_CFLAGS"
16017 fi
16018 rm -rf ./conftest*
16019
16020 fi
16021
16022 if test "$GCC" = yes || test "$GXX" = yes
16023 then
16024 cat > conftest.i <<EOF
16025 #ifndef GCC_PRINTF
16026 #define GCC_PRINTF 0
16027 #endif
16028 #ifndef GCC_SCANF
16029 #define GCC_SCANF 0
16030 #endif
16031 #ifndef GCC_NORETURN
16032 #define GCC_NORETURN /* nothing */
16033 #endif
16034 #ifndef GCC_UNUSED
16035 #define GCC_UNUSED /* nothing */
16036 #endif
16037 EOF
16038 if test "$GCC" = yes
16039 then
16040         { echo "$as_me:16040: checking for $CC __attribute__ directives..." >&5
16041 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16042 cat > "conftest.$ac_ext" <<EOF
16043 #line 16043 "${as_me:-configure}"
16044 #include <stdio.h>
16045 #include "confdefs.h"
16046 #include "conftest.h"
16047 #include "conftest.i"
16048 #if     GCC_PRINTF
16049 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16050 #else
16051 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16052 #endif
16053 #if     GCC_SCANF
16054 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16055 #else
16056 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16057 #endif
16058 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16059 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
16060 extern GCC_NORETURN void foo(void);
16061 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
16062 EOF
16063         cf_printf_attribute=no
16064         cf_scanf_attribute=no
16065         for cf_attribute in scanf printf unused noreturn
16066         do
16067
16068 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16069
16070                 cf_directive="__attribute__(($cf_attribute))"
16071                 echo "checking for $CC $cf_directive" 1>&5
16072
16073                 case "$cf_attribute" in
16074                 (printf)
16075                         cf_printf_attribute=yes
16076                         cat >conftest.h <<EOF
16077 #define GCC_$cf_ATTRIBUTE 1
16078 EOF
16079                         ;;
16080                 (scanf)
16081                         cf_scanf_attribute=yes
16082                         cat >conftest.h <<EOF
16083 #define GCC_$cf_ATTRIBUTE 1
16084 EOF
16085                         ;;
16086                 (*)
16087                         cat >conftest.h <<EOF
16088 #define GCC_$cf_ATTRIBUTE $cf_directive
16089 EOF
16090                         ;;
16091                 esac
16092
16093                 if { (eval echo "$as_me:16093: \"$ac_compile\"") >&5
16094   (eval $ac_compile) 2>&5
16095   ac_status=$?
16096   echo "$as_me:16096: \$? = $ac_status" >&5
16097   (exit "$ac_status"); }; then
16098                         test -n "$verbose" && echo "$as_me:16098: result: ... $cf_attribute" >&5
16099 echo "${ECHO_T}... $cf_attribute" >&6
16100                         cat conftest.h >>confdefs.h
16101                         case "$cf_attribute" in
16102                         (noreturn)
16103
16104 cat >>confdefs.h <<EOF
16105 #define GCC_NORETURN $cf_directive
16106 EOF
16107
16108                                 ;;
16109                         (printf)
16110                                 cf_value='/* nothing */'
16111                                 if test "$cf_printf_attribute" != no ; then
16112                                         cf_value='__attribute__((format(printf,fmt,var)))'
16113
16114 cat >>confdefs.h <<\EOF
16115 #define GCC_PRINTF 1
16116 EOF
16117
16118                                 fi
16119
16120 cat >>confdefs.h <<EOF
16121 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16122 EOF
16123
16124                                 ;;
16125                         (scanf)
16126                                 cf_value='/* nothing */'
16127                                 if test "$cf_scanf_attribute" != no ; then
16128                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16129
16130 cat >>confdefs.h <<\EOF
16131 #define GCC_SCANF 1
16132 EOF
16133
16134                                 fi
16135
16136 cat >>confdefs.h <<EOF
16137 #define GCC_SCANFLIKE(fmt,var) $cf_value
16138 EOF
16139
16140                                 ;;
16141                         (unused)
16142
16143 cat >>confdefs.h <<EOF
16144 #define GCC_UNUSED $cf_directive
16145 EOF
16146
16147                                 ;;
16148                         esac
16149                 fi
16150         done
16151 else
16152         ${FGREP-fgrep} define conftest.i >>confdefs.h
16153 fi
16154 rm -rf ./conftest*
16155 fi
16156
16157 fi
16158
16159 if test "x$enable_warnings" = "xyes"; then
16160
16161         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
16162
16163 fi
16164
16165 ###     use option --enable-assertions to turn on generation of assertion code
16166 echo "$as_me:16166: checking if you want to enable runtime assertions" >&5
16167 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
16168
16169 # Check whether --enable-assertions or --disable-assertions was given.
16170 if test "${enable_assertions+set}" = set; then
16171   enableval="$enable_assertions"
16172   with_assertions=$enableval
16173 else
16174   with_assertions=no
16175 fi;
16176 echo "$as_me:16176: result: $with_assertions" >&5
16177 echo "${ECHO_T}$with_assertions" >&6
16178 if test -n "$GCC"
16179 then
16180         if test "$with_assertions" = no
16181         then
16182                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
16183         else
16184
16185         ADAFLAGS="$ADAFLAGS -gnata"
16186
16187         fi
16188 fi
16189
16190 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
16191
16192 cat >>confdefs.h <<\EOF
16193 #define HAVE_NC_ALLOC_H 1
16194 EOF
16195
16196 ###     use option --enable-expanded to generate certain macros as functions
16197
16198 # Check whether --enable-expanded or --disable-expanded was given.
16199 if test "${enable_expanded+set}" = set; then
16200   enableval="$enable_expanded"
16201   test "$enableval" = yes &&
16202 cat >>confdefs.h <<\EOF
16203 #define NCURSES_EXPANDED 1
16204 EOF
16205
16206 fi;
16207
16208 ###     use option --disable-macros to suppress macros in favor of functions
16209
16210 # Check whether --enable-macros or --disable-macros was given.
16211 if test "${enable_macros+set}" = set; then
16212   enableval="$enable_macros"
16213   test "$enableval" = no &&
16214 cat >>confdefs.h <<\EOF
16215 #define NCURSES_NOMACROS 1
16216 EOF
16217
16218 fi;
16219
16220 # Normally we only add trace() to the debug-library.  Allow this to be
16221 # extended to all models of the ncurses library:
16222 cf_all_traces=no
16223 case "$CFLAGS $CPPFLAGS" in
16224 (*-DTRACE*)
16225         cf_all_traces=yes
16226         ;;
16227 esac
16228
16229 echo "$as_me:16229: checking whether to add trace feature to all models" >&5
16230 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16231
16232 # Check whether --with-trace or --without-trace was given.
16233 if test "${with_trace+set}" = set; then
16234   withval="$with_trace"
16235   cf_with_trace=$withval
16236 else
16237   cf_with_trace=$cf_all_traces
16238 fi;
16239 echo "$as_me:16239: result: $cf_with_trace" >&5
16240 echo "${ECHO_T}$cf_with_trace" >&6
16241
16242 if test "$cf_with_trace" = yes ; then
16243         ADA_TRACE=TRUE
16244
16245 cf_fix_cppflags=no
16246 cf_new_cflags=
16247 cf_new_cppflags=
16248 cf_new_extra_cppflags=
16249
16250 for cf_add_cflags in -DTRACE
16251 do
16252 case "$cf_fix_cppflags" in
16253 (no)
16254         case "$cf_add_cflags" in
16255         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16256                 case "$cf_add_cflags" in
16257                 (-D*)
16258                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16259
16260                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16261                                 && test -z "${cf_tst_cflags}" \
16262                                 && cf_fix_cppflags=yes
16263
16264                         if test "$cf_fix_cppflags" = yes ; then
16265
16266         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16267         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16268
16269                                 continue
16270                         elif test "${cf_tst_cflags}" = "\"'" ; then
16271
16272         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16273         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16274
16275                                 continue
16276                         fi
16277                         ;;
16278                 esac
16279                 case "$CPPFLAGS" in
16280                 (*$cf_add_cflags)
16281                         ;;
16282                 (*)
16283                         case "$cf_add_cflags" in
16284                         (-D*)
16285                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16286
16287 CPPFLAGS=`echo "$CPPFLAGS" | \
16288         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16289                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16290
16291                                 ;;
16292                         esac
16293
16294         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16295         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16296
16297                         ;;
16298                 esac
16299                 ;;
16300         (*)
16301
16302         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16303         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16304
16305                 ;;
16306         esac
16307         ;;
16308 (yes)
16309
16310         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16311         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16312
16313         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16314
16315         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16316                 && test -z "${cf_tst_cflags}" \
16317                 && cf_fix_cppflags=no
16318         ;;
16319 esac
16320 done
16321
16322 if test -n "$cf_new_cflags" ; then
16323
16324         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16325         CFLAGS="${CFLAGS}$cf_new_cflags"
16326
16327 fi
16328
16329 if test -n "$cf_new_cppflags" ; then
16330
16331         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16332         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16333
16334 fi
16335
16336 if test -n "$cf_new_extra_cppflags" ; then
16337
16338         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16339         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16340
16341 fi
16342
16343 else
16344         ADA_TRACE=FALSE
16345 fi
16346
16347 echo "$as_me:16347: checking if we want to use GNAT projects" >&5
16348 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16349
16350 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16351 if test "${enable_gnat_projects+set}" = set; then
16352   enableval="$enable_gnat_projects"
16353   test "$enableval" != no && enableval=yes
16354         if test "$enableval" != "yes" ; then
16355     enable_gnat_projects=no
16356         else
16357                 enable_gnat_projects=yes
16358         fi
16359 else
16360   enableval=yes
16361         enable_gnat_projects=yes
16362
16363 fi;
16364 echo "$as_me:16364: result: $enable_gnat_projects" >&5
16365 echo "${ECHO_T}$enable_gnat_projects" >&6
16366
16367 ###     Checks for libraries.
16368 case $cf_cv_system_name in
16369 (*mingw32*)
16370
16371 echo "$as_me:16371: checking if ssp library is needed" >&5
16372 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16373 if test "${cf_cv_need_libssp+set}" = set; then
16374   echo $ECHO_N "(cached) $ECHO_C" >&6
16375 else
16376
16377 cat >"conftest.$ac_ext" <<_ACEOF
16378 #line 16378 "configure"
16379 #include "confdefs.h"
16380
16381 #include <sys/types.h>
16382 #include <dirent.h>
16383
16384 int
16385 main (void)
16386 {
16387
16388        DIR *dp = opendir(".");
16389
16390   ;
16391   return 0;
16392 }
16393 _ACEOF
16394 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16395 if { (eval echo "$as_me:16395: \"$ac_link\"") >&5
16396   (eval $ac_link) 2>&5
16397   ac_status=$?
16398   echo "$as_me:16398: \$? = $ac_status" >&5
16399   (exit "$ac_status"); } &&
16400          { ac_try='test -s "conftest$ac_exeext"'
16401   { (eval echo "$as_me:16401: \"$ac_try\"") >&5
16402   (eval $ac_try) 2>&5
16403   ac_status=$?
16404   echo "$as_me:16404: \$? = $ac_status" >&5
16405   (exit "$ac_status"); }; }; then
16406   cf_cv_need_libssp=no
16407 else
16408   echo "$as_me: failed program was:" >&5
16409 cat "conftest.$ac_ext" >&5
16410
16411         cf_save_LIBS="$LIBS"
16412         LIBS="$LIBS -lssp"
16413         cat >"conftest.$ac_ext" <<_ACEOF
16414 #line 16414 "configure"
16415 #include "confdefs.h"
16416
16417 #include <sys/types.h>
16418 #include <dirent.h>
16419
16420 int
16421 main (void)
16422 {
16423
16424                    DIR *dp = opendir(".");
16425
16426   ;
16427   return 0;
16428 }
16429 _ACEOF
16430 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16431 if { (eval echo "$as_me:16431: \"$ac_link\"") >&5
16432   (eval $ac_link) 2>&5
16433   ac_status=$?
16434   echo "$as_me:16434: \$? = $ac_status" >&5
16435   (exit "$ac_status"); } &&
16436          { ac_try='test -s "conftest$ac_exeext"'
16437   { (eval echo "$as_me:16437: \"$ac_try\"") >&5
16438   (eval $ac_try) 2>&5
16439   ac_status=$?
16440   echo "$as_me:16440: \$? = $ac_status" >&5
16441   (exit "$ac_status"); }; }; then
16442   cf_cv_need_libssp=yes
16443 else
16444   echo "$as_me: failed program was:" >&5
16445 cat "conftest.$ac_ext" >&5
16446 cf_cv_need_libssp=maybe
16447 fi
16448 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16449         LIBS="$cf_save_LIBS"
16450
16451 fi
16452 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16453 fi
16454 echo "$as_me:16454: result: $cf_cv_need_libssp" >&5
16455 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16456
16457 if test "x$cf_cv_need_libssp" = xyes
16458 then
16459
16460 cf_add_libs="$LIBS"
16461 # reverse order
16462 cf_add_0lib=
16463 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16464 # filter duplicates
16465 for cf_add_1lib in $cf_add_0lib; do
16466         for cf_add_2lib in $cf_add_libs; do
16467                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16468                         cf_add_1lib=
16469                         break
16470                 fi
16471         done
16472         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16473 done
16474 LIBS="$cf_add_libs"
16475
16476 fi
16477
16478         ;;
16479 (*)
16480
16481 echo "$as_me:16481: checking for clock_gettime" >&5
16482 echo $ECHO_N "checking for clock_gettime... $ECHO_C" >&6
16483 if test "${cf_cv_func_clock_gettime+set}" = set; then
16484   echo $ECHO_N "(cached) $ECHO_C" >&6
16485 else
16486
16487                 cat >"conftest.$ac_ext" <<_ACEOF
16488 #line 16488 "configure"
16489 #include "confdefs.h"
16490 #include <time.h>
16491 int
16492 main (void)
16493 {
16494 struct timespec ts;
16495                 int rc = clock_gettime(CLOCK_REALTIME, &ts); (void) rc; (void)ts
16496   ;
16497   return 0;
16498 }
16499 _ACEOF
16500 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16501 if { (eval echo "$as_me:16501: \"$ac_link\"") >&5
16502   (eval $ac_link) 2>&5
16503   ac_status=$?
16504   echo "$as_me:16504: \$? = $ac_status" >&5
16505   (exit "$ac_status"); } &&
16506          { ac_try='test -s "conftest$ac_exeext"'
16507   { (eval echo "$as_me:16507: \"$ac_try\"") >&5
16508   (eval $ac_try) 2>&5
16509   ac_status=$?
16510   echo "$as_me:16510: \$? = $ac_status" >&5
16511   (exit "$ac_status"); }; }; then
16512   cf_cv_func_clock_gettime=yes
16513 else
16514   echo "$as_me: failed program was:" >&5
16515 cat "conftest.$ac_ext" >&5
16516 cf_cv_func_clock_gettime=no
16517 fi
16518 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16519
16520 fi
16521 echo "$as_me:16521: result: $cf_cv_func_clock_gettime" >&5
16522 echo "${ECHO_T}$cf_cv_func_clock_gettime" >&6
16523
16524 if test "$cf_cv_func_clock_gettime" = yes
16525 then
16526
16527 cat >>confdefs.h <<\EOF
16528 #define HAVE_CLOCK_GETTIME 1
16529 EOF
16530
16531 else
16532 echo "$as_me:16532: checking for gettimeofday" >&5
16533 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16534 if test "${ac_cv_func_gettimeofday+set}" = set; then
16535   echo $ECHO_N "(cached) $ECHO_C" >&6
16536 else
16537   cat >"conftest.$ac_ext" <<_ACEOF
16538 #line 16538 "configure"
16539 #include "confdefs.h"
16540 #define gettimeofday autoconf_temporary
16541 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16542 #undef gettimeofday
16543
16544 #ifdef __cplusplus
16545 extern "C"
16546 #endif
16547
16548 /* We use char because int might match the return type of a gcc2
16549    builtin and then its argument prototype would still apply.  */
16550 char gettimeofday (void);
16551
16552 int
16553 main (void)
16554 {
16555
16556 /* The GNU C library defines stubs for functions which it implements
16557     to always fail with ENOSYS.  Some functions are actually named
16558     something starting with __ and the normal name is an alias.  */
16559 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16560 #error found stub for gettimeofday
16561 #endif
16562
16563         return gettimeofday ();
16564   ;
16565   return 0;
16566 }
16567 _ACEOF
16568 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16569 if { (eval echo "$as_me:16569: \"$ac_link\"") >&5
16570   (eval $ac_link) 2>&5
16571   ac_status=$?
16572   echo "$as_me:16572: \$? = $ac_status" >&5
16573   (exit "$ac_status"); } &&
16574          { ac_try='test -s "conftest$ac_exeext"'
16575   { (eval echo "$as_me:16575: \"$ac_try\"") >&5
16576   (eval $ac_try) 2>&5
16577   ac_status=$?
16578   echo "$as_me:16578: \$? = $ac_status" >&5
16579   (exit "$ac_status"); }; }; then
16580   ac_cv_func_gettimeofday=yes
16581 else
16582   echo "$as_me: failed program was:" >&5
16583 cat "conftest.$ac_ext" >&5
16584 ac_cv_func_gettimeofday=no
16585 fi
16586 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16587 fi
16588 echo "$as_me:16588: result: $ac_cv_func_gettimeofday" >&5
16589 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16590 if test "$ac_cv_func_gettimeofday" = yes; then
16591
16592 cat >>confdefs.h <<\EOF
16593 #define HAVE_GETTIMEOFDAY 1
16594 EOF
16595
16596 else
16597
16598 echo "$as_me:16598: checking for gettimeofday in -lbsd" >&5
16599 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16600 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16601   echo $ECHO_N "(cached) $ECHO_C" >&6
16602 else
16603   ac_check_lib_save_LIBS=$LIBS
16604 LIBS="-lbsd  $LIBS"
16605 cat >"conftest.$ac_ext" <<_ACEOF
16606 #line 16606 "configure"
16607 #include "confdefs.h"
16608
16609 /* Override any gcc2 internal prototype to avoid an error.  */
16610 #ifdef __cplusplus
16611 extern "C"
16612 #endif
16613 /* We use char because int might match the return type of a gcc2
16614    builtin and then its argument prototype would still apply.  */
16615 char gettimeofday ();
16616 int
16617 main (void)
16618 {
16619 gettimeofday ();
16620   ;
16621   return 0;
16622 }
16623 _ACEOF
16624 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16625 if { (eval echo "$as_me:16625: \"$ac_link\"") >&5
16626   (eval $ac_link) 2>&5
16627   ac_status=$?
16628   echo "$as_me:16628: \$? = $ac_status" >&5
16629   (exit "$ac_status"); } &&
16630          { ac_try='test -s "conftest$ac_exeext"'
16631   { (eval echo "$as_me:16631: \"$ac_try\"") >&5
16632   (eval $ac_try) 2>&5
16633   ac_status=$?
16634   echo "$as_me:16634: \$? = $ac_status" >&5
16635   (exit "$ac_status"); }; }; then
16636   ac_cv_lib_bsd_gettimeofday=yes
16637 else
16638   echo "$as_me: failed program was:" >&5
16639 cat "conftest.$ac_ext" >&5
16640 ac_cv_lib_bsd_gettimeofday=no
16641 fi
16642 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16643 LIBS=$ac_check_lib_save_LIBS
16644 fi
16645 echo "$as_me:16645: result: $ac_cv_lib_bsd_gettimeofday" >&5
16646 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16647 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16648
16649 cat >>confdefs.h <<\EOF
16650 #define HAVE_GETTIMEOFDAY 1
16651 EOF
16652
16653 cf_add_libs="$LIBS"
16654 # reverse order
16655 cf_add_0lib=
16656 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16657 # filter duplicates
16658 for cf_add_1lib in $cf_add_0lib; do
16659         for cf_add_2lib in $cf_add_libs; do
16660                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16661                         cf_add_1lib=
16662                         break
16663                 fi
16664         done
16665         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16666 done
16667 LIBS="$cf_add_libs"
16668
16669 fi
16670
16671 fi
16672 fi
16673
16674         ;;
16675 esac
16676
16677 ###     Checks for header files.
16678 echo "$as_me:16678: checking for signed char" >&5
16679 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16680 if test "${ac_cv_type_signed_char+set}" = set; then
16681   echo $ECHO_N "(cached) $ECHO_C" >&6
16682 else
16683   cat >"conftest.$ac_ext" <<_ACEOF
16684 #line 16684 "configure"
16685 #include "confdefs.h"
16686 $ac_includes_default
16687 int
16688 main (void)
16689 {
16690 if ((signed char *) 0)
16691   return 0;
16692 if (sizeof (signed char))
16693   return 0;
16694   ;
16695   return 0;
16696 }
16697 _ACEOF
16698 rm -f "conftest.$ac_objext"
16699 if { (eval echo "$as_me:16699: \"$ac_compile\"") >&5
16700   (eval $ac_compile) 2>&5
16701   ac_status=$?
16702   echo "$as_me:16702: \$? = $ac_status" >&5
16703   (exit "$ac_status"); } &&
16704          { ac_try='test -s "conftest.$ac_objext"'
16705   { (eval echo "$as_me:16705: \"$ac_try\"") >&5
16706   (eval $ac_try) 2>&5
16707   ac_status=$?
16708   echo "$as_me:16708: \$? = $ac_status" >&5
16709   (exit "$ac_status"); }; }; then
16710   ac_cv_type_signed_char=yes
16711 else
16712   echo "$as_me: failed program was:" >&5
16713 cat "conftest.$ac_ext" >&5
16714 ac_cv_type_signed_char=no
16715 fi
16716 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16717 fi
16718 echo "$as_me:16718: result: $ac_cv_type_signed_char" >&5
16719 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16720
16721 echo "$as_me:16721: checking size of signed char" >&5
16722 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16723 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16724   echo $ECHO_N "(cached) $ECHO_C" >&6
16725 else
16726   if test "$ac_cv_type_signed_char" = yes; then
16727   if test "$cross_compiling" = yes; then
16728   # Depending upon the size, compute the lo and hi bounds.
16729 cat >"conftest.$ac_ext" <<_ACEOF
16730 #line 16730 "configure"
16731 #include "confdefs.h"
16732 $ac_includes_default
16733 int
16734 main (void)
16735 {
16736 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16737   ;
16738   return 0;
16739 }
16740 _ACEOF
16741 rm -f "conftest.$ac_objext"
16742 if { (eval echo "$as_me:16742: \"$ac_compile\"") >&5
16743   (eval $ac_compile) 2>&5
16744   ac_status=$?
16745   echo "$as_me:16745: \$? = $ac_status" >&5
16746   (exit "$ac_status"); } &&
16747          { ac_try='test -s "conftest.$ac_objext"'
16748   { (eval echo "$as_me:16748: \"$ac_try\"") >&5
16749   (eval $ac_try) 2>&5
16750   ac_status=$?
16751   echo "$as_me:16751: \$? = $ac_status" >&5
16752   (exit "$ac_status"); }; }; then
16753   ac_lo=0 ac_mid=0
16754   while :; do
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 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16763   ;
16764   return 0;
16765 }
16766 _ACEOF
16767 rm -f "conftest.$ac_objext"
16768 if { (eval echo "$as_me:16768: \"$ac_compile\"") >&5
16769   (eval $ac_compile) 2>&5
16770   ac_status=$?
16771   echo "$as_me:16771: \$? = $ac_status" >&5
16772   (exit "$ac_status"); } &&
16773          { ac_try='test -s "conftest.$ac_objext"'
16774   { (eval echo "$as_me:16774: \"$ac_try\"") >&5
16775   (eval $ac_try) 2>&5
16776   ac_status=$?
16777   echo "$as_me:16777: \$? = $ac_status" >&5
16778   (exit "$ac_status"); }; }; then
16779   ac_hi=$ac_mid; break
16780 else
16781   echo "$as_me: failed program was:" >&5
16782 cat "conftest.$ac_ext" >&5
16783 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16784 fi
16785 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16786   done
16787 else
16788   echo "$as_me: failed program was:" >&5
16789 cat "conftest.$ac_ext" >&5
16790 ac_hi=-1 ac_mid=-1
16791   while :; do
16792     cat >"conftest.$ac_ext" <<_ACEOF
16793 #line 16793 "configure"
16794 #include "confdefs.h"
16795 $ac_includes_default
16796 int
16797 main (void)
16798 {
16799 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16800   ;
16801   return 0;
16802 }
16803 _ACEOF
16804 rm -f "conftest.$ac_objext"
16805 if { (eval echo "$as_me:16805: \"$ac_compile\"") >&5
16806   (eval $ac_compile) 2>&5
16807   ac_status=$?
16808   echo "$as_me:16808: \$? = $ac_status" >&5
16809   (exit "$ac_status"); } &&
16810          { ac_try='test -s "conftest.$ac_objext"'
16811   { (eval echo "$as_me:16811: \"$ac_try\"") >&5
16812   (eval $ac_try) 2>&5
16813   ac_status=$?
16814   echo "$as_me:16814: \$? = $ac_status" >&5
16815   (exit "$ac_status"); }; }; then
16816   ac_lo=$ac_mid; break
16817 else
16818   echo "$as_me: failed program was:" >&5
16819 cat "conftest.$ac_ext" >&5
16820 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16821 fi
16822 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16823   done
16824 fi
16825 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16826 # Binary search between lo and hi bounds.
16827 while test "x$ac_lo" != "x$ac_hi"; do
16828   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16829   cat >"conftest.$ac_ext" <<_ACEOF
16830 #line 16830 "configure"
16831 #include "confdefs.h"
16832 $ac_includes_default
16833 int
16834 main (void)
16835 {
16836 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16837   ;
16838   return 0;
16839 }
16840 _ACEOF
16841 rm -f "conftest.$ac_objext"
16842 if { (eval echo "$as_me:16842: \"$ac_compile\"") >&5
16843   (eval $ac_compile) 2>&5
16844   ac_status=$?
16845   echo "$as_me:16845: \$? = $ac_status" >&5
16846   (exit "$ac_status"); } &&
16847          { ac_try='test -s "conftest.$ac_objext"'
16848   { (eval echo "$as_me:16848: \"$ac_try\"") >&5
16849   (eval $ac_try) 2>&5
16850   ac_status=$?
16851   echo "$as_me:16851: \$? = $ac_status" >&5
16852   (exit "$ac_status"); }; }; then
16853   ac_hi=$ac_mid
16854 else
16855   echo "$as_me: failed program was:" >&5
16856 cat "conftest.$ac_ext" >&5
16857 ac_lo=`expr "$ac_mid" + 1`
16858 fi
16859 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16860 done
16861 ac_cv_sizeof_signed_char=$ac_lo
16862 else
16863   if test "$cross_compiling" = yes; then
16864   { { echo "$as_me:16864: error: cannot run test program while cross compiling" >&5
16865 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16866    { (exit 1); exit 1; }; }
16867 else
16868   cat >"conftest.$ac_ext" <<_ACEOF
16869 #line 16869 "configure"
16870 #include "confdefs.h"
16871 $ac_includes_default
16872 int
16873 main (void)
16874 {
16875 FILE *f = fopen ("conftest.val", "w");
16876 if (!f)
16877   $ac_main_return (1);
16878 fprintf (f, "%ld", (long)(sizeof (signed char)));
16879 fclose (f);
16880   ;
16881   return 0;
16882 }
16883 _ACEOF
16884 rm -f "conftest$ac_exeext"
16885 if { (eval echo "$as_me:16885: \"$ac_link\"") >&5
16886   (eval $ac_link) 2>&5
16887   ac_status=$?
16888   echo "$as_me:16888: \$? = $ac_status" >&5
16889   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16890   { (eval echo "$as_me:16890: \"$ac_try\"") >&5
16891   (eval $ac_try) 2>&5
16892   ac_status=$?
16893   echo "$as_me:16893: \$? = $ac_status" >&5
16894   (exit "$ac_status"); }; }; then
16895   ac_cv_sizeof_signed_char=`cat conftest.val`
16896 else
16897   echo "$as_me: program exited with status $ac_status" >&5
16898 echo "$as_me: failed program was:" >&5
16899 cat "conftest.$ac_ext" >&5
16900 fi
16901 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16902 fi
16903 fi
16904 rm -f conftest.val
16905 else
16906   ac_cv_sizeof_signed_char=0
16907 fi
16908 fi
16909 echo "$as_me:16909: result: $ac_cv_sizeof_signed_char" >&5
16910 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16911 cat >>confdefs.h <<EOF
16912 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16913 EOF
16914
16915 ac_header_dirent=no
16916 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16917   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16918 echo "$as_me:16918: checking for $ac_hdr that defines DIR" >&5
16919 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16920 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16921   echo $ECHO_N "(cached) $ECHO_C" >&6
16922 else
16923   cat >"conftest.$ac_ext" <<_ACEOF
16924 #line 16924 "configure"
16925 #include "confdefs.h"
16926 #include <sys/types.h>
16927 #include <$ac_hdr>
16928
16929 int
16930 main (void)
16931 {
16932 if ((DIR *) 0)
16933 return 0;
16934   ;
16935   return 0;
16936 }
16937 _ACEOF
16938 rm -f "conftest.$ac_objext"
16939 if { (eval echo "$as_me:16939: \"$ac_compile\"") >&5
16940   (eval $ac_compile) 2>&5
16941   ac_status=$?
16942   echo "$as_me:16942: \$? = $ac_status" >&5
16943   (exit "$ac_status"); } &&
16944          { ac_try='test -s "conftest.$ac_objext"'
16945   { (eval echo "$as_me:16945: \"$ac_try\"") >&5
16946   (eval $ac_try) 2>&5
16947   ac_status=$?
16948   echo "$as_me:16948: \$? = $ac_status" >&5
16949   (exit "$ac_status"); }; }; then
16950   eval "$as_ac_Header=yes"
16951 else
16952   echo "$as_me: failed program was:" >&5
16953 cat "conftest.$ac_ext" >&5
16954 eval "$as_ac_Header=no"
16955 fi
16956 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16957 fi
16958 echo "$as_me:16958: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16959 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16960 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16961   cat >>confdefs.h <<EOF
16962 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16963 EOF
16964
16965 ac_header_dirent=$ac_hdr; break
16966 fi
16967
16968 done
16969 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16970 if test $ac_header_dirent = dirent.h; then
16971   echo "$as_me:16971: checking for opendir in -ldir" >&5
16972 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16973 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16974   echo $ECHO_N "(cached) $ECHO_C" >&6
16975 else
16976   ac_check_lib_save_LIBS=$LIBS
16977 LIBS="-ldir  $LIBS"
16978 cat >"conftest.$ac_ext" <<_ACEOF
16979 #line 16979 "configure"
16980 #include "confdefs.h"
16981
16982 /* Override any gcc2 internal prototype to avoid an error.  */
16983 #ifdef __cplusplus
16984 extern "C"
16985 #endif
16986 /* We use char because int might match the return type of a gcc2
16987    builtin and then its argument prototype would still apply.  */
16988 char opendir ();
16989 int
16990 main (void)
16991 {
16992 opendir ();
16993   ;
16994   return 0;
16995 }
16996 _ACEOF
16997 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16998 if { (eval echo "$as_me:16998: \"$ac_link\"") >&5
16999   (eval $ac_link) 2>&5
17000   ac_status=$?
17001   echo "$as_me:17001: \$? = $ac_status" >&5
17002   (exit "$ac_status"); } &&
17003          { ac_try='test -s "conftest$ac_exeext"'
17004   { (eval echo "$as_me:17004: \"$ac_try\"") >&5
17005   (eval $ac_try) 2>&5
17006   ac_status=$?
17007   echo "$as_me:17007: \$? = $ac_status" >&5
17008   (exit "$ac_status"); }; }; then
17009   ac_cv_lib_dir_opendir=yes
17010 else
17011   echo "$as_me: failed program was:" >&5
17012 cat "conftest.$ac_ext" >&5
17013 ac_cv_lib_dir_opendir=no
17014 fi
17015 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17016 LIBS=$ac_check_lib_save_LIBS
17017 fi
17018 echo "$as_me:17018: result: $ac_cv_lib_dir_opendir" >&5
17019 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17020 if test "$ac_cv_lib_dir_opendir" = yes; then
17021   LIBS="$LIBS -ldir"
17022 fi
17023
17024 else
17025   echo "$as_me:17025: checking for opendir in -lx" >&5
17026 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17027 if test "${ac_cv_lib_x_opendir+set}" = set; then
17028   echo $ECHO_N "(cached) $ECHO_C" >&6
17029 else
17030   ac_check_lib_save_LIBS=$LIBS
17031 LIBS="-lx  $LIBS"
17032 cat >"conftest.$ac_ext" <<_ACEOF
17033 #line 17033 "configure"
17034 #include "confdefs.h"
17035
17036 /* Override any gcc2 internal prototype to avoid an error.  */
17037 #ifdef __cplusplus
17038 extern "C"
17039 #endif
17040 /* We use char because int might match the return type of a gcc2
17041    builtin and then its argument prototype would still apply.  */
17042 char opendir ();
17043 int
17044 main (void)
17045 {
17046 opendir ();
17047   ;
17048   return 0;
17049 }
17050 _ACEOF
17051 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17052 if { (eval echo "$as_me:17052: \"$ac_link\"") >&5
17053   (eval $ac_link) 2>&5
17054   ac_status=$?
17055   echo "$as_me:17055: \$? = $ac_status" >&5
17056   (exit "$ac_status"); } &&
17057          { ac_try='test -s "conftest$ac_exeext"'
17058   { (eval echo "$as_me:17058: \"$ac_try\"") >&5
17059   (eval $ac_try) 2>&5
17060   ac_status=$?
17061   echo "$as_me:17061: \$? = $ac_status" >&5
17062   (exit "$ac_status"); }; }; then
17063   ac_cv_lib_x_opendir=yes
17064 else
17065   echo "$as_me: failed program was:" >&5
17066 cat "conftest.$ac_ext" >&5
17067 ac_cv_lib_x_opendir=no
17068 fi
17069 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17070 LIBS=$ac_check_lib_save_LIBS
17071 fi
17072 echo "$as_me:17072: result: $ac_cv_lib_x_opendir" >&5
17073 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17074 if test "$ac_cv_lib_x_opendir" = yes; then
17075   LIBS="$LIBS -lx"
17076 fi
17077
17078 fi
17079
17080 echo "$as_me:17080: checking whether time.h and sys/time.h may both be included" >&5
17081 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17082 if test "${ac_cv_header_time+set}" = set; then
17083   echo $ECHO_N "(cached) $ECHO_C" >&6
17084 else
17085   cat >"conftest.$ac_ext" <<_ACEOF
17086 #line 17086 "configure"
17087 #include "confdefs.h"
17088 #include <sys/types.h>
17089 #include <sys/time.h>
17090 #include <time.h>
17091
17092 int
17093 main (void)
17094 {
17095 if ((struct tm *) 0)
17096 return 0;
17097   ;
17098   return 0;
17099 }
17100 _ACEOF
17101 rm -f "conftest.$ac_objext"
17102 if { (eval echo "$as_me:17102: \"$ac_compile\"") >&5
17103   (eval $ac_compile) 2>&5
17104   ac_status=$?
17105   echo "$as_me:17105: \$? = $ac_status" >&5
17106   (exit "$ac_status"); } &&
17107          { ac_try='test -s "conftest.$ac_objext"'
17108   { (eval echo "$as_me:17108: \"$ac_try\"") >&5
17109   (eval $ac_try) 2>&5
17110   ac_status=$?
17111   echo "$as_me:17111: \$? = $ac_status" >&5
17112   (exit "$ac_status"); }; }; then
17113   ac_cv_header_time=yes
17114 else
17115   echo "$as_me: failed program was:" >&5
17116 cat "conftest.$ac_ext" >&5
17117 ac_cv_header_time=no
17118 fi
17119 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17120 fi
17121 echo "$as_me:17121: result: $ac_cv_header_time" >&5
17122 echo "${ECHO_T}$ac_cv_header_time" >&6
17123 if test $ac_cv_header_time = yes; then
17124
17125 cat >>confdefs.h <<\EOF
17126 #define TIME_WITH_SYS_TIME 1
17127 EOF
17128
17129 fi
17130
17131 ###     checks for compiler characteristics
17132 ac_ext=c
17133 ac_cpp='$CPP $CPPFLAGS'
17134 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17135 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17136 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17137 ac_main_return="return"
17138
17139 echo "$as_me:17139: checking for an ANSI C-conforming const" >&5
17140 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17141 if test "${ac_cv_c_const+set}" = set; then
17142   echo $ECHO_N "(cached) $ECHO_C" >&6
17143 else
17144   cat >"conftest.$ac_ext" <<_ACEOF
17145 #line 17145 "configure"
17146 #include "confdefs.h"
17147
17148 int
17149 main (void)
17150 {
17151 /* FIXME: Include the comments suggested by Paul. */
17152 #ifndef __cplusplus
17153   /* Ultrix mips cc rejects this.  */
17154   typedef int charset[2];
17155   const charset x;
17156   /* SunOS 4.1.1 cc rejects this.  */
17157   char const *const *ccp;
17158   char **p;
17159   /* NEC SVR4.0.2 mips cc rejects this.  */
17160   struct point {int x, y;};
17161   static struct point const zero = {0,0};
17162   /* AIX XL C 1.02.0.0 rejects this.
17163      It does not let you subtract one const X* pointer from another in
17164      an arm of an if-expression whose if-part is not a constant
17165      expression */
17166   const char *g = "string";
17167   ccp = &g + (g ? g-g : 0);
17168   /* HPUX 7.0 cc rejects these. */
17169   ++ccp;
17170   p = (char**) ccp;
17171   ccp = (char const *const *) p;
17172   { /* SCO 3.2v4 cc rejects this.  */
17173     char *t;
17174     char const *s = 0 ? (char *) 0 : (char const *) 0;
17175
17176     *t++ = 0;
17177   }
17178   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17179     int x[] = {25, 17};
17180     const int *foo = &x[0];
17181     ++foo;
17182   }
17183   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17184     typedef const int *iptr;
17185     iptr p = 0;
17186     ++p;
17187   }
17188   { /* AIX XL C 1.02.0.0 rejects this saying
17189        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17190     struct s { int j; const int *ap[3]; };
17191     struct s *b; b->j = 5;
17192   }
17193   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17194     const int foo = 10;
17195   }
17196 #endif
17197
17198   ;
17199   return 0;
17200 }
17201 _ACEOF
17202 rm -f "conftest.$ac_objext"
17203 if { (eval echo "$as_me:17203: \"$ac_compile\"") >&5
17204   (eval $ac_compile) 2>&5
17205   ac_status=$?
17206   echo "$as_me:17206: \$? = $ac_status" >&5
17207   (exit "$ac_status"); } &&
17208          { ac_try='test -s "conftest.$ac_objext"'
17209   { (eval echo "$as_me:17209: \"$ac_try\"") >&5
17210   (eval $ac_try) 2>&5
17211   ac_status=$?
17212   echo "$as_me:17212: \$? = $ac_status" >&5
17213   (exit "$ac_status"); }; }; then
17214   ac_cv_c_const=yes
17215 else
17216   echo "$as_me: failed program was:" >&5
17217 cat "conftest.$ac_ext" >&5
17218 ac_cv_c_const=no
17219 fi
17220 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17221 fi
17222 echo "$as_me:17222: result: $ac_cv_c_const" >&5
17223 echo "${ECHO_T}$ac_cv_c_const" >&6
17224 if test $ac_cv_c_const = no; then
17225
17226 cat >>confdefs.h <<\EOF
17227 #define const
17228 EOF
17229
17230 fi
17231
17232 ###     Checks for external-data
17233
17234 echo "$as_me:17234: checking if data-only library module links" >&5
17235 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17236 if test "${cf_cv_link_dataonly+set}" = set; then
17237   echo $ECHO_N "(cached) $ECHO_C" >&6
17238 else
17239
17240         rm -f conftest.a
17241         cat >conftest.$ac_ext <<EOF
17242 #line 17242 "configure"
17243 int     testdata[3] = { 123, 456, 789 };
17244 EOF
17245         if { (eval echo "$as_me:17245: \"$ac_compile\"") >&5
17246   (eval $ac_compile) 2>&5
17247   ac_status=$?
17248   echo "$as_me:17248: \$? = $ac_status" >&5
17249   (exit "$ac_status"); } ; then
17250                 mv conftest.o data.o && \
17251                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17252         fi
17253         rm -f conftest.$ac_ext data.o
17254         cat >conftest.$ac_ext <<EOF
17255 #line 17255 "configure"
17256 int     testfunc(void)
17257 {
17258 #if defined(NeXT)
17259         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17260 #else
17261         extern int testdata[3];
17262         return testdata[0] == 123
17263            &&  testdata[1] == 456
17264            &&  testdata[2] == 789;
17265 #endif
17266 }
17267 EOF
17268         if { (eval echo "$as_me:17268: \"$ac_compile\"") >&5
17269   (eval $ac_compile) 2>&5
17270   ac_status=$?
17271   echo "$as_me:17271: \$? = $ac_status" >&5
17272   (exit "$ac_status"); }; then
17273                 mv conftest.o func.o && \
17274                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17275         fi
17276         rm -f conftest.$ac_ext func.o
17277         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17278         cf_saveLIBS="$LIBS"
17279         LIBS="conftest.a $LIBS"
17280         if test "$cross_compiling" = yes; then
17281   cf_cv_link_dataonly=unknown
17282 else
17283   cat >"conftest.$ac_ext" <<_ACEOF
17284 #line 17284 "configure"
17285 #include "confdefs.h"
17286
17287         int main(void)
17288         {
17289                 extern int testfunc();
17290                 ${cf_cv_main_return:-return} (!testfunc());
17291         }
17292
17293 _ACEOF
17294 rm -f "conftest$ac_exeext"
17295 if { (eval echo "$as_me:17295: \"$ac_link\"") >&5
17296   (eval $ac_link) 2>&5
17297   ac_status=$?
17298   echo "$as_me:17298: \$? = $ac_status" >&5
17299   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17300   { (eval echo "$as_me:17300: \"$ac_try\"") >&5
17301   (eval $ac_try) 2>&5
17302   ac_status=$?
17303   echo "$as_me:17303: \$? = $ac_status" >&5
17304   (exit "$ac_status"); }; }; then
17305   cf_cv_link_dataonly=yes
17306 else
17307   echo "$as_me: program exited with status $ac_status" >&5
17308 echo "$as_me: failed program was:" >&5
17309 cat "conftest.$ac_ext" >&5
17310 cf_cv_link_dataonly=no
17311 fi
17312 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17313 fi
17314         LIBS="$cf_saveLIBS"
17315
17316 fi
17317
17318 echo "$as_me:17318: result: $cf_cv_link_dataonly" >&5
17319 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17320
17321 if test "$cf_cv_link_dataonly" = no ; then
17322
17323 cat >>confdefs.h <<\EOF
17324 #define BROKEN_LINKER 1
17325 EOF
17326
17327         BROKEN_LINKER=1
17328 fi
17329
17330 ###     Checks for library functions.
17331
17332 for ac_header in \
17333 unistd.h \
17334
17335 do
17336 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17337 echo "$as_me:17337: checking for $ac_header" >&5
17338 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17339 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17340   echo $ECHO_N "(cached) $ECHO_C" >&6
17341 else
17342   cat >"conftest.$ac_ext" <<_ACEOF
17343 #line 17343 "configure"
17344 #include "confdefs.h"
17345 #include <$ac_header>
17346 _ACEOF
17347 if { (eval echo "$as_me:17347: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17348   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17349   ac_status=$?
17350   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17351   rm -f conftest.er1
17352   cat conftest.err >&5
17353   echo "$as_me:17353: \$? = $ac_status" >&5
17354   (exit "$ac_status"); } >/dev/null; then
17355   if test -s conftest.err; then
17356     ac_cpp_err=$ac_c_preproc_warn_flag
17357   else
17358     ac_cpp_err=
17359   fi
17360 else
17361   ac_cpp_err=yes
17362 fi
17363 if test -z "$ac_cpp_err"; then
17364   eval "$as_ac_Header=yes"
17365 else
17366   echo "$as_me: failed program was:" >&5
17367   cat "conftest.$ac_ext" >&5
17368   eval "$as_ac_Header=no"
17369 fi
17370 rm -f conftest.err "conftest.$ac_ext"
17371 fi
17372 echo "$as_me:17372: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17373 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17374 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17375   cat >>confdefs.h <<EOF
17376 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17377 EOF
17378
17379 fi
17380 done
17381
17382 echo "$as_me:17382: checking for working mkstemp" >&5
17383 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17384 if test "${cf_cv_func_mkstemp+set}" = set; then
17385   echo $ECHO_N "(cached) $ECHO_C" >&6
17386 else
17387
17388 rm -rf ./conftest*
17389 if test "$cross_compiling" = yes; then
17390   cf_cv_func_mkstemp=maybe
17391 else
17392   cat >"conftest.$ac_ext" <<_ACEOF
17393 #line 17393 "configure"
17394 #include "confdefs.h"
17395
17396 $ac_includes_default
17397
17398 int main(void)
17399 {
17400         char *tmpl = "conftestXXXXXX";
17401         char name[2][80];
17402         int n;
17403         int result = 0;
17404         int fd;
17405         struct stat sb;
17406
17407         umask(077);
17408         for (n = 0; n < 2; ++n) {
17409                 strcpy(name[n], tmpl);
17410                 if ((fd = mkstemp(name[n])) >= 0) {
17411                         if (!strcmp(name[n], tmpl)
17412                          || stat(name[n], &sb) != 0
17413                          || (sb.st_mode & S_IFMT) != S_IFREG
17414                          || (sb.st_mode & 077) != 0) {
17415                                 result = 1;
17416                         }
17417                         close(fd);
17418                 }
17419         }
17420         if (result == 0
17421          && !strcmp(name[0], name[1]))
17422                 result = 1;
17423         ${cf_cv_main_return:-return}(result);
17424 }
17425
17426 _ACEOF
17427 rm -f "conftest$ac_exeext"
17428 if { (eval echo "$as_me:17428: \"$ac_link\"") >&5
17429   (eval $ac_link) 2>&5
17430   ac_status=$?
17431   echo "$as_me:17431: \$? = $ac_status" >&5
17432   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17433   { (eval echo "$as_me:17433: \"$ac_try\"") >&5
17434   (eval $ac_try) 2>&5
17435   ac_status=$?
17436   echo "$as_me:17436: \$? = $ac_status" >&5
17437   (exit "$ac_status"); }; }; then
17438   cf_cv_func_mkstemp=yes
17439
17440 else
17441   echo "$as_me: program exited with status $ac_status" >&5
17442 echo "$as_me: failed program was:" >&5
17443 cat "conftest.$ac_ext" >&5
17444 cf_cv_func_mkstemp=no
17445
17446 fi
17447 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17448 fi
17449
17450 fi
17451 echo "$as_me:17451: result: $cf_cv_func_mkstemp" >&5
17452 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17453 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17454         echo "$as_me:17454: checking for mkstemp" >&5
17455 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17456 if test "${ac_cv_func_mkstemp+set}" = set; then
17457   echo $ECHO_N "(cached) $ECHO_C" >&6
17458 else
17459   cat >"conftest.$ac_ext" <<_ACEOF
17460 #line 17460 "configure"
17461 #include "confdefs.h"
17462 #define mkstemp autoconf_temporary
17463 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17464 #undef mkstemp
17465
17466 #ifdef __cplusplus
17467 extern "C"
17468 #endif
17469
17470 /* We use char because int might match the return type of a gcc2
17471    builtin and then its argument prototype would still apply.  */
17472 char mkstemp (void);
17473
17474 int
17475 main (void)
17476 {
17477
17478 /* The GNU C library defines stubs for functions which it implements
17479     to always fail with ENOSYS.  Some functions are actually named
17480     something starting with __ and the normal name is an alias.  */
17481 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17482 #error found stub for mkstemp
17483 #endif
17484
17485         return mkstemp ();
17486   ;
17487   return 0;
17488 }
17489 _ACEOF
17490 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17491 if { (eval echo "$as_me:17491: \"$ac_link\"") >&5
17492   (eval $ac_link) 2>&5
17493   ac_status=$?
17494   echo "$as_me:17494: \$? = $ac_status" >&5
17495   (exit "$ac_status"); } &&
17496          { ac_try='test -s "conftest$ac_exeext"'
17497   { (eval echo "$as_me:17497: \"$ac_try\"") >&5
17498   (eval $ac_try) 2>&5
17499   ac_status=$?
17500   echo "$as_me:17500: \$? = $ac_status" >&5
17501   (exit "$ac_status"); }; }; then
17502   ac_cv_func_mkstemp=yes
17503 else
17504   echo "$as_me: failed program was:" >&5
17505 cat "conftest.$ac_ext" >&5
17506 ac_cv_func_mkstemp=no
17507 fi
17508 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17509 fi
17510 echo "$as_me:17510: result: $ac_cv_func_mkstemp" >&5
17511 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17512
17513 fi
17514 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17515
17516 cat >>confdefs.h <<\EOF
17517 #define HAVE_MKSTEMP 1
17518 EOF
17519
17520 fi
17521
17522 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17523         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17524         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17525 fi
17526
17527 cf_with_ada=yes
17528 if test "$cf_with_ada" != "no" ; then
17529
17530 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17531 do
17532
17533 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17534
17535         unset ac_cv_path_cf_TEMP_gnat
17536         unset cf_TEMP_gnat
17537         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17538 set dummy $cf_prog_gnat; ac_word=$2
17539 echo "$as_me:17539: checking for $ac_word" >&5
17540 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17541 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17542   echo $ECHO_N "(cached) $ECHO_C" >&6
17543 else
17544   case $cf_TEMP_gnat in
17545   [\\/]* | ?:[\\/]*)
17546   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17547   ;;
17548   *)
17549   ac_save_IFS=$IFS; IFS=$ac_path_separator
17550 ac_dummy="$PATH"
17551 for ac_dir in $ac_dummy; do
17552   IFS=$ac_save_IFS
17553   test -z "$ac_dir" && ac_dir=.
17554   if $as_executable_p "$ac_dir/$ac_word"; then
17555    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17556    echo "$as_me:17556: found $ac_dir/$ac_word" >&5
17557    break
17558 fi
17559 done
17560
17561   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17562   ;;
17563 esac
17564 fi
17565 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17566
17567 if test -n "$cf_TEMP_gnat"; then
17568   echo "$as_me:17568: result: $cf_TEMP_gnat" >&5
17569 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17570 else
17571   echo "$as_me:17571: result: no" >&5
17572 echo "${ECHO_T}no" >&6
17573 fi
17574
17575         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17576
17577         if test "x$cf_TEMP_gnat" != xno; then
17578                 unset cf_cv_gnat_version
17579                 unset cf_TEMP_gnat
17580
17581 echo "$as_me:17581: checking for $cf_prog_gnat version" >&5
17582 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17583 if test "${cf_cv_gnat_version+set}" = set; then
17584   echo $ECHO_N "(cached) $ECHO_C" >&6
17585 else
17586
17587 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17588         grep '[0-9].[0-9][0-9]*' |\
17589         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17590
17591 fi
17592 echo "$as_me:17592: result: $cf_cv_gnat_version" >&5
17593 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17594 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17595 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17596
17597         fi
17598         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17599
17600         unset cf_TEMP_gnat
17601         unset cf_cv_gnat_version
17602         unset ac_cv_path_cf_TEMP_gnat
17603 done
17604
17605 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17606         cf_ada_make=
17607         cf_cv_prog_gnat_correct=no
17608 else
17609         cf_ada_make=gnatmake
17610         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17611                 # gprconfig is newer than gnatmake; we can continue...
17612                 cf_ada_config="##"
17613         else
17614                 rm -rf ./conftest* ./*~conftest*
17615                 if mkdir conftest.src
17616                 then
17617                         cf_ada_config=""
17618                         cd conftest.src
17619                         for cf_gprconfig in Ada C
17620                         do
17621                                 echo "$as_me:17621: checking for gprconfig name for $cf_gprconfig" >&5
17622 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17623                                 if test "$cf_gprconfig" = C
17624                                 then
17625                                         for cf_gprconfig_param in \
17626                                                 "$cf_gprconfig,,,,GNATGCC" \
17627                                                 "$cf_gprconfig,,,,GCC" \
17628                                                 "$cf_gprconfig"
17629                                         do
17630                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17631                                                 test -n "$cf_gprconfig_value" && break
17632                                         done
17633                                 else
17634                                         cf_gprconfig_param=$cf_gprconfig
17635                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17636                                 fi
17637                                 if test -n "$cf_gprconfig_value"
17638                                 then
17639                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17640                                         echo "$as_me:17640: result: $cf_gprconfig_value" >&5
17641 echo "${ECHO_T}$cf_gprconfig_value" >&6
17642                                 else
17643                                         echo "$as_me:17643: result: missing" >&5
17644 echo "${ECHO_T}missing" >&6
17645                                         cf_ada_config="#"
17646                                         break
17647                                 fi
17648                         done
17649                         cd ..
17650                         rm -rf ./conftest* ./*~conftest*
17651                 fi
17652         fi
17653         if test "x$cf_ada_config" != "x#"
17654         then
17655
17656 echo "$as_me:17656: checking for gnat version" >&5
17657 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17658 if test "${cf_cv_gnat_version+set}" = set; then
17659   echo $ECHO_N "(cached) $ECHO_C" >&6
17660 else
17661
17662 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17663         grep '[0-9].[0-9][0-9]*' |\
17664         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17665
17666 fi
17667 echo "$as_me:17667: result: $cf_cv_gnat_version" >&5
17668 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17669 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17670
17671 case "$cf_cv_gnat_version" in
17672 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17673         cf_cv_prog_gnat_correct=yes
17674         ;;
17675 (*)
17676         { echo "$as_me:17676: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17677 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17678         cf_cv_prog_gnat_correct=no
17679         ;;
17680 esac
17681
17682                 # Extract the first word of "m4", so it can be a program name with args.
17683 set dummy m4; ac_word=$2
17684 echo "$as_me:17684: checking for $ac_word" >&5
17685 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17686 if test "${ac_cv_prog_M4_exists+set}" = set; then
17687   echo $ECHO_N "(cached) $ECHO_C" >&6
17688 else
17689   if test -n "$M4_exists"; then
17690   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17691 else
17692   ac_save_IFS=$IFS; IFS=$ac_path_separator
17693 ac_dummy="$PATH"
17694 for ac_dir in $ac_dummy; do
17695   IFS=$ac_save_IFS
17696   test -z "$ac_dir" && ac_dir=.
17697   $as_executable_p "$ac_dir/$ac_word" || continue
17698 ac_cv_prog_M4_exists="yes"
17699 echo "$as_me:17699: found $ac_dir/$ac_word" >&5
17700 break
17701 done
17702
17703   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17704 fi
17705 fi
17706 M4_exists=$ac_cv_prog_M4_exists
17707 if test -n "$M4_exists"; then
17708   echo "$as_me:17708: result: $M4_exists" >&5
17709 echo "${ECHO_T}$M4_exists" >&6
17710 else
17711   echo "$as_me:17711: result: no" >&5
17712 echo "${ECHO_T}no" >&6
17713 fi
17714
17715                 if test "$ac_cv_prog_M4_exists" = no; then
17716                         cf_cv_prog_gnat_correct=no
17717                         { echo "$as_me:17717: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17718 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17719                 fi
17720                 if test "$cf_cv_prog_gnat_correct" = yes; then
17721                         echo "$as_me:17721: checking if GNAT works" >&5
17722 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17723
17724 rm -rf ./conftest* ./*~conftest*
17725 cat >>conftest.ads <<CF_EOF
17726 procedure conftest;
17727 CF_EOF
17728 cat >>conftest.adb <<CF_EOF
17729 with Text_IO;
17730 with GNAT.OS_Lib;
17731 procedure conftest is
17732 begin
17733    Text_IO.Put ("Hello World");
17734    Text_IO.New_Line;
17735    GNAT.OS_Lib.OS_Exit (0);
17736 end conftest;
17737 CF_EOF
17738 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17739    if ( ./conftest 1>&5 2>&1 ) ; then
17740       cf_cv_prog_gnat_correct=yes
17741    else
17742       cf_cv_prog_gnat_correct=no
17743    fi
17744 else
17745    cf_cv_prog_gnat_correct=no
17746 fi
17747 rm -rf ./conftest* ./*~conftest*
17748
17749                         echo "$as_me:17749: result: $cf_cv_prog_gnat_correct" >&5
17750 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17751                 fi
17752         else
17753                 cf_cv_prog_gnat_correct=no
17754         fi
17755 fi
17756
17757         if test "$cf_cv_prog_gnat_correct" = yes; then
17758
17759         echo "$as_me:17759: checking optimization options for ADAFLAGS" >&5
17760 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17761         case "$CFLAGS" in
17762         (*-g*)
17763
17764         ADAFLAGS="$ADAFLAGS -g"
17765
17766                 ;;
17767         esac
17768         case "$CFLAGS" in
17769         (*-O*)
17770                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17771
17772         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17773
17774                 ;;
17775         esac
17776         echo "$as_me:17776: result: $ADAFLAGS" >&5
17777 echo "${ECHO_T}$ADAFLAGS" >&6
17778
17779 echo "$as_me:17779: checking if GNATPREP supports -T option" >&5
17780 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17781 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17782   echo $ECHO_N "(cached) $ECHO_C" >&6
17783 else
17784
17785 cf_cv_gnatprep_opt_t=no
17786 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17787
17788 fi
17789 echo "$as_me:17789: result: $cf_cv_gnatprep_opt_t" >&5
17790 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17791 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17792
17793 echo "$as_me:17793: checking if GNAT supports generics" >&5
17794 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17795 case "$cf_cv_gnat_version" in
17796 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17797         cf_gnat_generics=yes
17798         ;;
17799 (*)
17800         cf_gnat_generics=no
17801         ;;
17802 esac
17803 echo "$as_me:17803: result: $cf_gnat_generics" >&5
17804 echo "${ECHO_T}$cf_gnat_generics" >&6
17805
17806 if test "$cf_gnat_generics" = yes
17807 then
17808         cf_compile_generics=generics
17809         cf_generic_objects="\${GENOBJS}"
17810 else
17811         cf_compile_generics=
17812         cf_generic_objects=
17813 fi
17814
17815 echo "$as_me:17815: checking if GNAT supports SIGINT" >&5
17816 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17817 if test "${cf_cv_gnat_sigint+set}" = set; then
17818   echo $ECHO_N "(cached) $ECHO_C" >&6
17819 else
17820
17821 rm -rf ./conftest* ./*~conftest*
17822 cat >>conftest.ads <<CF_EOF
17823 with Ada.Interrupts.Names;
17824
17825 package ConfTest is
17826
17827    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17828    pragma Unreserve_All_Interrupts;
17829    pragma Warnings (On);
17830
17831    protected Process is
17832       procedure Stop;
17833       function Continue return Boolean;
17834       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17835    private
17836       Done : Boolean := False;
17837    end Process;
17838
17839 end ConfTest;
17840 CF_EOF
17841 cat >>conftest.adb <<CF_EOF
17842 package body ConfTest is
17843    protected body Process is
17844       procedure Stop is
17845       begin
17846          Done := True;
17847       end Stop;
17848       function Continue return Boolean is
17849       begin
17850          return not Done;
17851       end Continue;
17852    end Process;
17853 end ConfTest;
17854 CF_EOF
17855 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17856       cf_cv_gnat_sigint=yes
17857 else
17858    cf_cv_gnat_sigint=no
17859 fi
17860 rm -rf ./conftest* ./*~conftest*
17861
17862 fi
17863 echo "$as_me:17863: result: $cf_cv_gnat_sigint" >&5
17864 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17865
17866 if test "$cf_cv_gnat_sigint" = yes ; then
17867         USE_GNAT_SIGINT=""
17868 else
17869         USE_GNAT_SIGINT="#"
17870 fi
17871
17872 cf_gnat_libraries=no
17873 cf_gnat_projects=no
17874
17875 if test "$enable_gnat_projects" != no ; then
17876 echo "$as_me:17876: checking if GNAT supports project files" >&5
17877 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17878 case "$cf_cv_gnat_version" in
17879 (3.[0-9]*)
17880         ;;
17881 (*)
17882         case "$cf_cv_system_name" in
17883         (cygwin*|msys*)
17884                 ;;
17885         (*)
17886                 rm -rf ./conftest* ./*~conftest*
17887                 if mkdir conftest.src conftest.bin conftest.lib
17888                 then
17889                         cd conftest.src
17890                         rm -rf ./conftest* ./*~conftest*
17891                         cat >>library.gpr <<CF_EOF
17892 project Library is
17893   Kind := External ("LIB_KIND");
17894   for Library_Name use "ConfTest";
17895   for Object_Dir use ".";
17896   for Library_ALI_Dir use External("LIBRARY_DIR");
17897   for Library_Version use External ("SONAME");
17898   for Library_Kind use Kind;
17899   for Library_Dir use External("BUILD_DIR");
17900   Source_Dir := External ("SOURCE_DIR");
17901   for Source_Dirs use (Source_Dir);
17902 end Library;
17903 CF_EOF
17904                         cat >>confpackage.ads <<CF_EOF
17905 package ConfPackage is
17906    procedure conftest;
17907 end ConfPackage;
17908 CF_EOF
17909                         cat >>confpackage.adb <<CF_EOF
17910 with Text_IO;
17911 package body ConfPackage is
17912    procedure conftest is
17913    begin
17914       Text_IO.Put ("Hello World");
17915       Text_IO.New_Line;
17916    end conftest;
17917 end ConfPackage;
17918 CF_EOF
17919                         if ( "$cf_ada_make" $ADAFLAGS \
17920                                         -Plibrary.gpr \
17921                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17922                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17923                                         -XSOURCE_DIR="`pwd`" \
17924                                         -XSONAME=libConfTest.so.1 \
17925                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17926                                 cf_gnat_projects=yes
17927                         fi
17928                         cd ..
17929                 fi
17930                 if test -f conftest.lib/confpackage.ali
17931                 then
17932                         cf_gnat_libraries=yes
17933                 fi
17934                 rm -rf ./conftest* ./*~conftest*
17935                 ;;
17936         esac
17937         ;;
17938 esac
17939 echo "$as_me:17939: result: $cf_gnat_projects" >&5
17940 echo "${ECHO_T}$cf_gnat_projects" >&6
17941 fi # enable_gnat_projects
17942
17943 if test "$cf_gnat_projects" = yes
17944 then
17945         echo "$as_me:17945: checking if GNAT supports libraries" >&5
17946 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17947         echo "$as_me:17947: result: $cf_gnat_libraries" >&5
17948 echo "${ECHO_T}$cf_gnat_libraries" >&6
17949 fi
17950
17951 USE_OLD_MAKERULES=""
17952 USE_GNAT_PROJECTS="#"
17953 USE_GNAT_MAKE_GPR="#"
17954 USE_GNAT_GPRBUILD="#"
17955
17956 if test "$cf_gnat_projects" = yes
17957 then
17958         USE_OLD_MAKERULES="#"
17959         USE_GNAT_PROJECTS=""
17960         if test "$cf_cv_VERSION_GPRBUILD" != no
17961         then
17962                 USE_GNAT_GPRBUILD=""
17963         elif test "$cf_cv_VERSION_GNATMAKE" != no
17964         then
17965                 USE_GNAT_MAKE_GPR=""
17966         else
17967                 { echo "$as_me:17967: WARNING: use old makefile rules since tools are missing" >&5
17968 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17969         fi
17970 fi
17971
17972 if test "$cf_gnat_libraries" = yes
17973 then
17974         USE_GNAT_LIBRARIES=""
17975 else
17976         USE_GNAT_LIBRARIES="#"
17977 fi
17978
17979 echo "$as_me:17979: checking for ada-compiler" >&5
17980 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17981
17982 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17983 if test "${with_ada_compiler+set}" = set; then
17984   withval="$with_ada_compiler"
17985   cf_ada_compiler=$withval
17986 else
17987   cf_ada_compiler=gnatmake
17988 fi;
17989
17990 echo "$as_me:17990: result: $cf_ada_compiler" >&5
17991 echo "${ECHO_T}$cf_ada_compiler" >&6
17992
17993                 cf_ada_package=terminal_interface
17994
17995 echo "$as_me:17995: checking for ada-include" >&5
17996 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17997
17998 # Check whether --with-ada-include or --without-ada-include was given.
17999 if test "${with_ada_include+set}" = set; then
18000   withval="$with_ada_include"
18001
18002 else
18003   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18004 fi; if test -n "$prefix/share/ada/adainclude" ; then
18005
18006 if test "x$prefix" != xNONE; then
18007         cf_path_syntax="$prefix"
18008 else
18009         cf_path_syntax="$ac_default_prefix"
18010 fi
18011
18012 case ".$withval" in
18013 (.\$\(*\)*|.\'*\'*)
18014         ;;
18015 (..|./*|.\\*)
18016         ;;
18017 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18018         ;;
18019 (.\$\{*prefix\}*|.\$\{*dir\}*)
18020         eval withval="$withval"
18021         case ".$withval" in
18022         (.NONE/*)
18023                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18024                 ;;
18025         esac
18026         ;;
18027 (.no|.NONE/*)
18028         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18029         ;;
18030 (*)
18031         { { echo "$as_me:18031: error: expected a pathname, not \"$withval\"" >&5
18032 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18033    { (exit 1); exit 1; }; }
18034         ;;
18035 esac
18036
18037 fi
18038 eval ADA_INCLUDE="$withval"
18039
18040 echo "$as_me:18040: result: $ADA_INCLUDE" >&5
18041 echo "${ECHO_T}$ADA_INCLUDE" >&6
18042
18043 echo "$as_me:18043: checking for ada-objects" >&5
18044 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
18045
18046 # Check whether --with-ada-objects or --without-ada-objects was given.
18047 if test "${with_ada_objects+set}" = set; then
18048   withval="$with_ada_objects"
18049
18050 else
18051   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18052 fi; if test -n "$prefix/lib/ada/adalib" ; then
18053
18054 if test "x$prefix" != xNONE; then
18055         cf_path_syntax="$prefix"
18056 else
18057         cf_path_syntax="$ac_default_prefix"
18058 fi
18059
18060 case ".$withval" in
18061 (.\$\(*\)*|.\'*\'*)
18062         ;;
18063 (..|./*|.\\*)
18064         ;;
18065 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18066         ;;
18067 (.\$\{*prefix\}*|.\$\{*dir\}*)
18068         eval withval="$withval"
18069         case ".$withval" in
18070         (.NONE/*)
18071                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18072                 ;;
18073         esac
18074         ;;
18075 (.no|.NONE/*)
18076         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18077         ;;
18078 (*)
18079         { { echo "$as_me:18079: error: expected a pathname, not \"$withval\"" >&5
18080 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18081    { (exit 1); exit 1; }; }
18082         ;;
18083 esac
18084
18085 fi
18086 eval ADA_OBJECTS="$withval"
18087
18088 echo "$as_me:18088: result: $ADA_OBJECTS" >&5
18089 echo "${ECHO_T}$ADA_OBJECTS" >&6
18090
18091 echo "$as_me:18091: checking if an Ada95 shared-library should be built" >&5
18092 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18093
18094 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18095 if test "${with_ada_sharedlib+set}" = set; then
18096   withval="$with_ada_sharedlib"
18097   with_ada_sharedlib=$withval
18098 else
18099   with_ada_sharedlib=no
18100 fi;
18101 echo "$as_me:18101: result: $with_ada_sharedlib" >&5
18102 echo "${ECHO_T}$with_ada_sharedlib" >&6
18103
18104 if test "x$with_ada_sharedlib" != xno
18105 then
18106         if test "x$cf_gnat_projects" != xyes
18107         then
18108                 { echo "$as_me:18108: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18109 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18110                 with_ada_sharedlib=no
18111         fi
18112 fi
18113
18114 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18115 MAKE_ADA_SHAREDLIB="#"
18116
18117 if test "x$with_ada_sharedlib" != xno
18118 then
18119         MAKE_ADA_SHAREDLIB=
18120         if test "x$with_ada_sharedlib" != xyes
18121         then
18122                 ADA_SHAREDLIB="$with_ada_sharedlib"
18123         fi
18124 fi
18125
18126                 # allow the Ada binding to be renamed
18127
18128 echo "$as_me:18128: checking for ada-libname" >&5
18129 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18130
18131 # Check whether --with-ada-libname or --without-ada-libname was given.
18132 if test "${with_ada_libname+set}" = set; then
18133   withval="$with_ada_libname"
18134   ADA_LIBNAME=$withval
18135 else
18136   ADA_LIBNAME=AdaCurses
18137 fi;
18138 case "x$ADA_LIBNAME" in
18139 (x|xyes|xno)
18140         ADA_LIBNAME=AdaCurses
18141         ;;
18142 esac
18143
18144 echo "$as_me:18144: result: $ADA_LIBNAME" >&5
18145 echo "${ECHO_T}$ADA_LIBNAME" >&6
18146
18147         else
18148                 { { echo "$as_me:18148: error: No usable Ada compiler found" >&5
18149 echo "$as_me: error: No usable Ada compiler found" >&2;}
18150    { (exit 1); exit 1; }; }
18151         fi
18152 else
18153         { { echo "$as_me:18153: error: The Ada compiler is needed for this package" >&5
18154 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18155    { (exit 1); exit 1; }; }
18156 fi
18157
18158 ################################################################################
18159
18160 # not needed
18161 TINFO_LDFLAGS2=
18162
18163 TINFO_LIBS=
18164
18165 ### Construct the list of include-directories to be generated
18166
18167 if test "$srcdir" != "."; then
18168         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18169 fi
18170 CPPFLAGS="-I../include $CPPFLAGS"
18171 if test "$srcdir" != "."; then
18172         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18173 fi
18174 CPPFLAGS="-I. $CPPFLAGS"
18175
18176 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18177 if test "$srcdir" != "."; then
18178         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18179 fi
18180 if test "$GCC" != yes; then
18181         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18182 elif test "$includedir" != "/usr/include"; then
18183         if test "$includedir" = '${prefix}/include' ; then
18184                 if test x$prefix != x/usr ; then
18185                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18186                 fi
18187         else
18188                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18189         fi
18190 fi
18191
18192 ### Build up pieces for makefile rules
18193 echo "$as_me:18193: checking default library suffix" >&5
18194 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18195
18196         case $DFT_LWR_MODEL in
18197         (libtool) DFT_ARG_SUFFIX=''   ;;
18198         (normal)  DFT_ARG_SUFFIX=''   ;;
18199         (debug)   DFT_ARG_SUFFIX='_g' ;;
18200         (profile) DFT_ARG_SUFFIX='_p' ;;
18201         (shared)  DFT_ARG_SUFFIX=''   ;;
18202         esac
18203         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18204 echo "$as_me:18204: result: $DFT_ARG_SUFFIX" >&5
18205 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18206
18207 echo "$as_me:18207: checking default library-dependency suffix" >&5
18208 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18209
18210         case X$DFT_LWR_MODEL in
18211         (Xlibtool)
18212                 DFT_LIB_SUFFIX='.la'
18213                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18214                 ;;
18215         (Xdebug)
18216                 case "$cf_cv_system_name" in
18217                 (*-msvc*)
18218                         DFT_LIB_SUFFIX='_g.lib'
18219                         ;;
18220                 (*)
18221                         DFT_LIB_SUFFIX='_g.a'
18222                         ;;
18223                 esac
18224                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18225                 ;;
18226         (Xprofile)
18227                 case "$cf_cv_system_name" in
18228                 (*-msvc*)
18229                         DFT_LIB_SUFFIX='_p.lib'
18230                         ;;
18231                 (*)
18232                         DFT_LIB_SUFFIX='_p.a'
18233                         ;;
18234                 esac
18235                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18236                 ;;
18237         (Xshared)
18238                 case "$cf_cv_system_name" in
18239                 (aix[5-7]*)
18240                         DFT_LIB_SUFFIX='.so'
18241                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18242                         ;;
18243                 (*-msvc*)
18244                         DFT_LIB_SUFFIX='.dll'
18245                         DFT_DEP_SUFFIX='.dll.lib'
18246                         ;;
18247                 (cygwin*|msys*|mingw*)
18248                         DFT_LIB_SUFFIX='.dll'
18249                         DFT_DEP_SUFFIX='.dll.a'
18250                         ;;
18251                 (darwin*)
18252                         DFT_LIB_SUFFIX='.dylib'
18253                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18254                         ;;
18255                 (hpux*)
18256                         case "$target" in
18257                         (ia64*)
18258                                 DFT_LIB_SUFFIX='.so'
18259                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18260                                 ;;
18261                         (*)
18262                                 DFT_LIB_SUFFIX='.sl'
18263                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18264                                 ;;
18265                         esac
18266                         ;;
18267                 (*)
18268                         DFT_LIB_SUFFIX='.so'
18269                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18270                         ;;
18271                 esac
18272                 ;;
18273         (*)
18274                 case "$target" in
18275                 (*-msvc*)
18276                         DFT_LIB_SUFFIX='.lib'
18277                         ;;
18278                 (*)
18279                         DFT_LIB_SUFFIX='.a'
18280                         ;;
18281                 esac
18282                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18283                 ;;
18284         esac
18285         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18286         then
18287                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18288                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18289         fi
18290 echo "$as_me:18290: result: $DFT_DEP_SUFFIX" >&5
18291 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18292
18293 echo "$as_me:18293: checking default object directory" >&5
18294 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18295
18296         case $DFT_LWR_MODEL in
18297         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18298         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18299         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18300         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18301         (shared)
18302                 case "$cf_cv_system_name" in
18303                 (cygwin|msys)
18304                         DFT_OBJ_SUBDIR='objects' ;;
18305                 (*)
18306                         DFT_OBJ_SUBDIR='obj_s' ;;
18307                 esac
18308         esac
18309 echo "$as_me:18309: result: $DFT_OBJ_SUBDIR" >&5
18310 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18311
18312 ### Set up low-level terminfo dependencies for makefiles.
18313
18314 if test "$DFT_LWR_MODEL" = shared ; then
18315         case $cf_cv_system_name in
18316         (cygwin*)
18317                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18318                 ;;
18319         (msys*)
18320                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18321                 ;;
18322         esac
18323 fi
18324
18325 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18326
18327 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18328
18329 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18330
18331 ### Construct the list of subdirectories for which we'll customize makefiles
18332 ### with the appropriate compile-rules.
18333
18334 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18335
18336 cat >>confdefs.h <<EOF
18337 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18338 EOF
18339
18340 ################################################################################
18341
18342 TEST_ARG2=
18343
18344 TEST_LIBS2=
18345
18346 NCURSES_SHLIB2="sh -c"
18347
18348 ADA_SUBDIRS="include gen src doc"
18349 if test "x$cf_with_tests" != "xno" ; then
18350         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18351 fi
18352 for cf_dir in $ADA_SUBDIRS
18353 do
18354         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18355 done
18356
18357 NCURSES_TREE="#"
18358
18359 EXTERNAL_TREE=
18360
18361 # match layout used by make-tar.sh
18362 ADAHTML_DIR=../doc/ada
18363
18364 if test "x$cross_compiling" = xyes ; then
18365         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18366 else
18367         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18368 fi
18369
18370 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"
18371 ac_config_commands="$ac_config_commands default"
18372 cat >confcache <<\_ACEOF
18373 # This file is a shell script that caches the results of configure
18374 # tests run on this system so they can be shared between configure
18375 # scripts and configure runs, see configure's option --config-cache.
18376 # It is not useful on other systems.  If it contains results you don't
18377 # want to keep, you may remove or edit it.
18378 #
18379 # config.status only pays attention to the cache file if you give it
18380 # the --recheck option to rerun configure.
18381 #
18382 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18383 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18384 # following values.
18385
18386 _ACEOF
18387
18388 # The following way of writing the cache mishandles newlines in values,
18389 # but we know of no workaround that is simple, portable, and efficient.
18390 # So, don't put newlines in cache variables' values.
18391 # Ultrix sh set writes to stderr and can't be redirected directly,
18392 # and sets the high bit in the cache file unless we assign to the vars.
18393 {
18394   (set) 2>&1 |
18395     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18396     *ac_space=\ *)
18397       # `set' does not quote correctly, so add quotes (double-quote
18398       # substitution turns \\\\ into \\, and sed turns \\ into \).
18399       sed -n \
18400         "s/'/'\\\\''/g;
18401           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18402       ;;
18403     *)
18404       # `set' quotes correctly as required by POSIX, so do not add quotes.
18405       sed -n \
18406         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18407       ;;
18408     esac;
18409 } |
18410   sed '
18411      t clear
18412      : clear
18413      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18414      t end
18415      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18416      : end' >>confcache
18417 if cmp -s $cache_file confcache; then :; else
18418   if test -w $cache_file; then
18419     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18420     cat confcache >$cache_file
18421   else
18422     echo "not updating unwritable cache $cache_file"
18423   fi
18424 fi
18425 rm -f confcache
18426
18427 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18428 # Let make expand exec_prefix.
18429 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18430
18431 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18432 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18433 # trailing colons and then remove the whole line if VPATH becomes empty
18434 # (actually we leave an empty line to preserve line numbers).
18435 if test "x$srcdir" = x.; then
18436   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18437 s/:*\$(srcdir):*/:/;
18438 s/:*\${srcdir}:*/:/;
18439 s/:*@srcdir@:*/:/;
18440 s/^\([^=]*=[    ]*\):*/\1/;
18441 s/:*$//;
18442 s/^[^=]*=[      ]*$//;
18443 }'
18444 fi
18445
18446 DEFS=-DHAVE_CONFIG_H
18447
18448 : "${CONFIG_STATUS=./config.status}"
18449 ac_clean_files_save=$ac_clean_files
18450 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18451 { echo "$as_me:18451: creating $CONFIG_STATUS" >&5
18452 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18453 cat >"$CONFIG_STATUS" <<_ACEOF
18454 #! $SHELL
18455 # Generated automatically by configure.
18456 # Run this file to recreate the current configuration.
18457 # Compiler output produced by configure, useful for debugging
18458 # configure, is in config.log if it exists.
18459
18460 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18461
18462 debug=false
18463 SHELL=\${CONFIG_SHELL-$SHELL}
18464 ac_cs_invocation="\$0 \$@"
18465
18466 CLICOLOR_FORCE= GREP_OPTIONS=
18467 unset CLICOLOR_FORCE GREP_OPTIONS
18468 _ACEOF
18469
18470 cat >>"$CONFIG_STATUS" <<\_ACEOF
18471 # Be Bourne compatible
18472 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18473   emulate sh
18474   NULLCMD=:
18475 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18476   set -o posix
18477 fi
18478
18479 # Name of the executable.
18480 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18481
18482 if expr a : '\(a\)' >/dev/null 2>&1; then
18483   as_expr="expr"
18484 else
18485   as_expr="false"
18486 fi
18487
18488 rm -f conf$$ conf$$.exe conf$$.file
18489 echo >conf$$.file
18490 if ln -s conf$$.file conf$$ 2>/dev/null; then
18491   # We could just check for DJGPP; but this test a) works b) is more generic
18492   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18493   if test -f conf$$.exe; then
18494     # Don't use ln at all; we don't have any links
18495     as_ln_s='cp -p'
18496   else
18497     as_ln_s='ln -s'
18498   fi
18499 elif ln conf$$.file conf$$ 2>/dev/null; then
18500   as_ln_s='ln'
18501 else
18502   as_ln_s='cp -p'
18503 fi
18504 rm -f conf$$ conf$$.exe conf$$.file
18505
18506 as_executable_p="test -f"
18507
18508 # Support unset when possible.
18509 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18510   as_unset="unset"
18511 else
18512   as_unset="false"
18513 fi
18514
18515 # NLS nuisances.
18516 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18517 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18518 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18519 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18520 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18521 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18522 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18523 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18524
18525 # IFS
18526 # We need space, tab and new line, in precisely that order.
18527 as_nl='
18528 '
18529 IFS="   $as_nl"
18530
18531 # CDPATH.
18532 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18533
18534 exec 6>&1
18535
18536 _ACEOF
18537
18538 # Files that config.status was made for.
18539 if test -n "$ac_config_files"; then
18540   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18541 fi
18542
18543 if test -n "$ac_config_headers"; then
18544   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18545 fi
18546
18547 if test -n "$ac_config_links"; then
18548   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18549 fi
18550
18551 if test -n "$ac_config_commands"; then
18552   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18553 fi
18554
18555 cat >>"$CONFIG_STATUS" <<\EOF
18556
18557 ac_cs_usage="\
18558 \`$as_me' instantiates files from templates according to the
18559 current configuration.
18560
18561 Usage: $0 [OPTIONS] [FILE]...
18562
18563   -h, --help       print this help, then exit
18564   -V, --version    print version number, then exit
18565   -d, --debug      don't remove temporary files
18566       --recheck    update $as_me by reconfiguring in the same conditions
18567   --file=FILE[:TEMPLATE]
18568                    instantiate the configuration file FILE
18569   --header=FILE[:TEMPLATE]
18570                    instantiate the configuration header FILE
18571
18572 Configuration files:
18573 $config_files
18574
18575 Configuration headers:
18576 $config_headers
18577
18578 Configuration commands:
18579 $config_commands
18580
18581 Report bugs to <dickey@invisible-island.net>."
18582 EOF
18583
18584 cat >>"$CONFIG_STATUS" <<EOF
18585 ac_cs_version="\\
18586 config.status
18587 configured by $0, generated by GNU Autoconf 2.52.20230114,
18588   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18589
18590 Copyright 2003-2022,2023        Thomas E. Dickey
18591 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18592 Free Software Foundation, Inc.
18593 This config.status script is free software; the Free Software Foundation
18594 gives unlimited permission to copy, distribute and modify it."
18595 srcdir="$srcdir"
18596 INSTALL="$INSTALL"
18597 EOF
18598
18599 cat >>"$CONFIG_STATUS" <<\EOF
18600 # If no file are specified by the user, then we need to provide default
18601 # value.  By we need to know if files were specified by the user.
18602 ac_need_defaults=:
18603 while test $# != 0
18604 do
18605   case $1 in
18606   --*=*)
18607     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18608     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18609     shift
18610     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18611     shift
18612     ;;
18613   -*);;
18614   *) # This is not an option, so the user has probably given explicit
18615      # arguments.
18616      ac_need_defaults=false;;
18617   esac
18618
18619   case $1 in
18620   # Handling of the options.
18621 EOF
18622 cat >>"$CONFIG_STATUS" <<EOF
18623   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18624     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18625     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18626 EOF
18627 cat >>"$CONFIG_STATUS" <<\EOF
18628   --version | --vers* | -V )
18629     echo "$ac_cs_version"; exit 0 ;;
18630   --he | --h)
18631     # Conflict between --help and --header
18632     { { echo "$as_me:18632: error: ambiguous option: $1
18633 Try \`$0 --help' for more information." >&5
18634 echo "$as_me: error: ambiguous option: $1
18635 Try \`$0 --help' for more information." >&2;}
18636    { (exit 1); exit 1; }; };;
18637   --help | --hel | -h )
18638     echo "$ac_cs_usage"; exit 0 ;;
18639   --debug | --d* | -d )
18640     debug=: ;;
18641   --file | --fil | --fi | --f )
18642     shift
18643     CONFIG_FILES="$CONFIG_FILES $1"
18644     ac_need_defaults=false;;
18645   --header | --heade | --head | --hea )
18646     shift
18647     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18648     ac_need_defaults=false;;
18649
18650   # This is an error.
18651   -*) { { echo "$as_me:18651: error: unrecognized option: $1
18652 Try \`$0 --help' for more information." >&5
18653 echo "$as_me: error: unrecognized option: $1
18654 Try \`$0 --help' for more information." >&2;}
18655    { (exit 1); exit 1; }; } ;;
18656
18657   *) ac_config_targets="$ac_config_targets $1" ;;
18658
18659   esac
18660   shift
18661 done
18662
18663 exec 5>>config.log
18664 cat >&5 << _ACEOF
18665
18666 ## ----------------------- ##
18667 ## Running config.status.  ##
18668 ## ----------------------- ##
18669
18670 This file was extended by $as_me 2.52.20230114, executed with
18671   CONFIG_FILES    = $CONFIG_FILES
18672   CONFIG_HEADERS  = $CONFIG_HEADERS
18673   CONFIG_LINKS    = $CONFIG_LINKS
18674   CONFIG_COMMANDS = $CONFIG_COMMANDS
18675   > "$ac_cs_invocation"
18676 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18677
18678 _ACEOF
18679 EOF
18680
18681 cat >>"$CONFIG_STATUS" <<EOF
18682 #
18683 # INIT-COMMANDS section.
18684 #
18685
18686 ### Special initialization commands, used to pass information from the
18687 ### configuration-run into config.status
18688
18689 AWK="$AWK"
18690 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18691 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18692 LIB_NAME="$LIB_NAME"
18693 LIB_PREFIX="$LIB_PREFIX"
18694 LIB_SUFFIX="$LIB_SUFFIX"
18695 LN_S="$LN_S"
18696 NCURSES_MAJOR="$NCURSES_MAJOR"
18697 NCURSES_MINOR="$NCURSES_MINOR"
18698 NCURSES_PATCH="$NCURSES_PATCH"
18699 PACKAGE="$PACKAGE"
18700 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18701 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18702 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18703 cf_cv_abi_version="$cf_cv_abi_version"
18704 cf_cv_rel_version="$cf_cv_rel_version"
18705 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18706 cf_cv_shared_soname='$cf_cv_shared_soname'
18707 cf_cv_shlib_version="$cf_cv_shlib_version"
18708 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18709 cf_cv_system_name="$cf_cv_system_name"
18710 host="$host"
18711 target="$target"
18712
18713 EOF
18714
18715 cat >>"$CONFIG_STATUS" <<\EOF
18716 for ac_config_target in $ac_config_targets
18717 do
18718   case "$ac_config_target" in
18719   # Handling of arguments.
18720   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18721   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18722   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18723   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18724   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18725   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18726   *) { { echo "$as_me:18726: error: invalid argument: $ac_config_target" >&5
18727 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18728    { (exit 1); exit 1; }; };;
18729   esac
18730 done
18731
18732 # If the user did not use the arguments to specify the items to instantiate,
18733 # then the envvar interface is used.  Set only those that are not.
18734 # We use the long form for the default assignment because of an extremely
18735 # bizarre bug on SunOS 4.1.3.
18736 if "$ac_need_defaults"; then
18737   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18738   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18739   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18740 fi
18741
18742 # Create a temporary directory, and hook for its removal unless debugging.
18743 $debug ||
18744 {
18745   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18746   trap '{ (exit 1); exit 1; }' 1 2 13 15
18747 }
18748
18749 # Create a (secure) tmp directory for tmp files.
18750 : "${TMPDIR=/tmp}"
18751 {
18752   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18753   test -n "$tmp" && test -d "$tmp"
18754 }  ||
18755 {
18756   tmp=$TMPDIR/cs$$-$RANDOM
18757   (umask 077 && mkdir "$tmp")
18758 } ||
18759 {
18760    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18761    { (exit 1); exit 1; }
18762 }
18763
18764 EOF
18765
18766 cat >>"$CONFIG_STATUS" <<EOF
18767
18768 #
18769 # CONFIG_FILES section.
18770 #
18771
18772 # No need to generate the scripts if there are no CONFIG_FILES.
18773 # This happens for instance when ./config.status config.h
18774 if test -n "\$CONFIG_FILES"; then
18775   # Protect against being on the right side of a sed subst in config.status.
18776   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18777    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
18778 s,@SHELL@,$SHELL,;t t
18779 s,@exec_prefix@,$exec_prefix,;t t
18780 s,@prefix@,$prefix,;t t
18781 s,@program_transform_name@,$program_transform_name,;t t
18782 s,@bindir@,$bindir,;t t
18783 s,@sbindir@,$sbindir,;t t
18784 s,@libexecdir@,$libexecdir,;t t
18785 s,@datarootdir@,$datarootdir,;t t
18786 s,@datadir@,$datadir,;t t
18787 s,@sysconfdir@,$sysconfdir,;t t
18788 s,@sharedstatedir@,$sharedstatedir,;t t
18789 s,@localstatedir@,$localstatedir,;t t
18790 s,@runstatedir@,$runstatedir,;t t
18791 s,@libdir@,$libdir,;t t
18792 s,@includedir@,$includedir,;t t
18793 s,@oldincludedir@,$oldincludedir,;t t
18794 s,@infodir@,$infodir,;t t
18795 s,@mandir@,$mandir,;t t
18796 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18797 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18798 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18799 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18800 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18801 s,@build_alias@,$build_alias,;t t
18802 s,@host_alias@,$host_alias,;t t
18803 s,@target_alias@,$target_alias,;t t
18804 s,@ECHO_C@,$ECHO_C,;t t
18805 s,@ECHO_N@,$ECHO_N,;t t
18806 s,@ECHO_T@,$ECHO_T,;t t
18807 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18808 s,@DEFS@,$DEFS,;t t
18809 s,@LIBS@,$LIBS,;t t
18810 s,@PACKAGE@,$PACKAGE,;t t
18811 s,@top_builddir@,$top_builddir,;t t
18812 s,@build@,$build,;t t
18813 s,@build_cpu@,$build_cpu,;t t
18814 s,@build_vendor@,$build_vendor,;t t
18815 s,@build_os@,$build_os,;t t
18816 s,@host@,$host,;t t
18817 s,@host_cpu@,$host_cpu,;t t
18818 s,@host_vendor@,$host_vendor,;t t
18819 s,@host_os@,$host_os,;t t
18820 s,@target@,$target,;t t
18821 s,@target_cpu@,$target_cpu,;t t
18822 s,@target_vendor@,$target_vendor,;t t
18823 s,@target_os@,$target_os,;t t
18824 s,@GREP@,$GREP,;t t
18825 s,@FGREP@,$FGREP,;t t
18826 s,@CC@,$CC,;t t
18827 s,@CFLAGS@,$CFLAGS,;t t
18828 s,@LDFLAGS@,$LDFLAGS,;t t
18829 s,@CPPFLAGS@,$CPPFLAGS,;t t
18830 s,@ac_ct_CC@,$ac_ct_CC,;t t
18831 s,@EXEEXT@,$EXEEXT,;t t
18832 s,@OBJEXT@,$OBJEXT,;t t
18833 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18834 s,@CPP@,$CPP,;t t
18835 s,@EGREP@,$EGREP,;t t
18836 s,@AWK@,$AWK,;t t
18837 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18838 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18839 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18840 s,@LN_S@,$LN_S,;t t
18841 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18842 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18843 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18844 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18845 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18846 s,@SET_MAKE@,$SET_MAKE,;t t
18847 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18848 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18849 s,@CTAGS@,$CTAGS,;t t
18850 s,@ETAGS@,$ETAGS,;t t
18851 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18852 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18853 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18854 s,@RANLIB@,$RANLIB,;t t
18855 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18856 s,@LD@,$LD,;t t
18857 s,@ac_ct_LD@,$ac_ct_LD,;t t
18858 s,@AR@,$AR,;t t
18859 s,@ac_ct_AR@,$ac_ct_AR,;t t
18860 s,@ARFLAGS@,$ARFLAGS,;t t
18861 s,@DESTDIR@,$DESTDIR,;t t
18862 s,@BUILD_CC@,$BUILD_CC,;t t
18863 s,@BUILD_CPP@,$BUILD_CPP,;t t
18864 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18865 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18866 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18867 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18868 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18869 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18870 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18871 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18872 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18873 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18874 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18875 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18876 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18877 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18878 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18879 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18880 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18881 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18882 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18883 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18884 s,@CC_G_OPT@,$CC_G_OPT,;t t
18885 s,@LD_MODEL@,$LD_MODEL,;t t
18886 s,@shlibdir@,$shlibdir,;t t
18887 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18888 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18889 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18890 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18891 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18892 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18893 s,@LINK_PROGS@,$LINK_PROGS,;t t
18894 s,@LINK_TESTS@,$LINK_TESTS,;t t
18895 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18896 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18897 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18898 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18899 s,@RPATH_LIST@,$RPATH_LIST,;t t
18900 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18901 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18902 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18903 s,@PTHREAD@,$PTHREAD,;t t
18904 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18905 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18906 s,@ECHO_LT@,$ECHO_LT,;t t
18907 s,@ECHO_LD@,$ECHO_LD,;t t
18908 s,@RULE_CC@,$RULE_CC,;t t
18909 s,@SHOW_CC@,$SHOW_CC,;t t
18910 s,@ECHO_CC@,$ECHO_CC,;t t
18911 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18912 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18913 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18914 s,@ADAFLAGS@,$ADAFLAGS,;t t
18915 s,@ADA_TRACE@,$ADA_TRACE,;t t
18916 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18917 s,@M4_exists@,$M4_exists,;t t
18918 s,@cf_ada_make@,$cf_ada_make,;t t
18919 s,@cf_ada_config@,$cf_ada_config,;t t
18920 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18921 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18922 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18923 s,@cf_compile_generics@,$cf_compile_generics,;t t
18924 s,@cf_generic_objects@,$cf_generic_objects,;t t
18925 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18926 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18927 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18928 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18929 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18930 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18931 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18932 s,@cf_ada_package@,$cf_ada_package,;t t
18933 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18934 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18935 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18936 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18937 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18938 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18939 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18940 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18941 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18942 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18943 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18944 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18945 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18946 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18947 s,@TEST_ARG2@,$TEST_ARG2,;t t
18948 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18949 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18950 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18951 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18952 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18953 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18954 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18955 CEOF
18956
18957 EOF
18958
18959   cat >>"$CONFIG_STATUS" <<\EOF
18960   # Split the substitutions into bite-sized pieces for seds with
18961   # small command number limits, like on Digital OSF/1 and HP-UX.
18962   ac_max_sed_lines=48
18963   ac_sed_frag=1 # Number of current file.
18964   ac_beg=1 # First line for current file.
18965   ac_end=$ac_max_sed_lines # Line after last line for current file.
18966   ac_more_lines=:
18967   ac_sed_cmds=
18968   while "$ac_more_lines"; do
18969     if test "$ac_beg" -gt 1; then
18970       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
18971     else
18972       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
18973     fi
18974     if test ! -s "$tmp"/subs.frag; then
18975       ac_more_lines=false
18976     else
18977       # The purpose of the label and of the branching condition is to
18978       # speed up the sed processing (if there are no `@' at all, there
18979       # is no need to browse any of the substitutions).
18980       # These are the two extra sed commands mentioned above.
18981       (echo ':t
18982   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
18983       # It is possible to make a multiline substitution using escaped newlines.
18984       # Ensure that we do not split the substitution between script fragments.
18985       ac_BEG=$ac_end
18986       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18987       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
18988       if test -s "$tmp"/subs.next; then
18989         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
18990         if test ! -s "$tmp"/subs.edit; then
18991           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
18992           if test ! -s "$tmp"/subs.edit; then
18993             if test "$ac_beg" -gt 1; then
18994               ac_end=`expr "$ac_end" - 1`
18995               continue
18996             fi
18997           fi
18998         fi
18999       fi
19000
19001       if test -z "$ac_sed_cmds"; then
19002         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19003       else
19004         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19005       fi
19006       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19007       ac_beg=$ac_end
19008       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19009     fi
19010   done
19011   if test -z "$ac_sed_cmds"; then
19012     ac_sed_cmds="cat"
19013   fi
19014 fi # test -n "$CONFIG_FILES"
19015
19016 EOF
19017 cat >>"$CONFIG_STATUS" <<\EOF
19018 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19019   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19020   case "$ac_file" in
19021   - | *:- | *:-:* ) # input from stdin
19022         cat >"$tmp"/stdin
19023         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19024         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19025   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19026         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19027   * )   ac_file_in=$ac_file.in ;;
19028   esac
19029
19030   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19031   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19032          X"$ac_file" : 'X\(//\)[^/]' \| \
19033          X"$ac_file" : 'X\(//\)$' \| \
19034          X"$ac_file" : 'X\(/\)' \| \
19035          .     : '\(.\)' 2>/dev/null ||
19036 echo X"$ac_file" |
19037     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19038           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19039           /^X\(\/\/\)$/{ s//\1/; q; }
19040           /^X\(\/\).*/{ s//\1/; q; }
19041           s/.*/./; q'`
19042   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19043     { case "$ac_dir" in
19044   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19045   *)                      as_incr_dir=.;;
19046 esac
19047 as_dummy="$ac_dir"
19048 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19049   case $as_mkdir_dir in
19050     # Skip DOS drivespec
19051     ?:) as_incr_dir=$as_mkdir_dir ;;
19052     *)
19053       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19054       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19055     ;;
19056   esac
19057 done; }
19058
19059     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19060     # A "../" for each directory in $ac_dir_suffix.
19061     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19062   else
19063     ac_dir_suffix= ac_dots=
19064   fi
19065
19066   case "$srcdir" in
19067   .)  ac_srcdir=.
19068       if test -z "$ac_dots"; then
19069          ac_top_srcdir=.
19070       else
19071          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19072       fi ;;
19073   [\\/]* | ?:[\\/]* )
19074       ac_srcdir="$srcdir$ac_dir_suffix";
19075       ac_top_srcdir="$srcdir" ;;
19076   *) # Relative path.
19077     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19078     ac_top_srcdir="$ac_dots$srcdir" ;;
19079   esac
19080
19081   case $INSTALL in
19082   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19083   *) ac_INSTALL=$ac_dots$INSTALL ;;
19084   esac
19085
19086   if test x"$ac_file" != x-; then
19087     { echo "$as_me:19087: creating $ac_file" >&5
19088 echo "$as_me: creating $ac_file" >&6;}
19089     rm -f "$ac_file"
19090   fi
19091   # Let's still pretend it is `configure' which instantiates (i.e., don't
19092   # use $as_me), people would be surprised to read:
19093   #    /* config.h.  Generated automatically by config.status.  */
19094   configure_input="Generated automatically from `echo $ac_file_in |
19095                                                  sed 's,.*/,,'` by configure."
19096
19097   # First look for the input files in the build tree, otherwise in the
19098   # src tree.
19099   ac_file_inputs=`IFS=:
19100     for f in $ac_file_in; do
19101       case $f in
19102       -) echo "$tmp"/stdin ;;
19103       [\\/$]*)
19104          # Absolute (can't be DOS-style, as IFS=:)
19105          test -f "$f" || { { echo "$as_me:19105: error: cannot find input file: $f" >&5
19106 echo "$as_me: error: cannot find input file: $f" >&2;}
19107    { (exit 1); exit 1; }; }
19108          echo "$f";;
19109       *) # Relative
19110          if test -f "$f"; then
19111            # Build tree
19112            echo "$f"
19113          elif test -f "$srcdir/$f"; then
19114            # Source tree
19115            echo "$srcdir/$f"
19116          else
19117            # /dev/null tree
19118            { { echo "$as_me:19118: error: cannot find input file: $f" >&5
19119 echo "$as_me: error: cannot find input file: $f" >&2;}
19120    { (exit 1); exit 1; }; }
19121          fi;;
19122       esac
19123     done` || { (exit 1); exit 1; }
19124 EOF
19125 cat >>"$CONFIG_STATUS" <<\EOF
19126   ac_warn_datarootdir=no
19127   if test x"$ac_file" != x-; then
19128     for ac_item in $ac_file_inputs
19129     do
19130       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19131       if test -n "$ac_seen"; then
19132         ac_used=`grep '@datarootdir@' "$ac_item"`
19133         if test -z "$ac_used"; then
19134           { echo "$as_me:19134: WARNING: datarootdir was used implicitly but not set:
19135 $ac_seen" >&5
19136 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19137 $ac_seen" >&2;}
19138           ac_warn_datarootdir=yes
19139         fi
19140       fi
19141       ac_seen=`grep '${datarootdir}' "$ac_item"`
19142       if test -n "$ac_seen"; then
19143         { echo "$as_me:19143: WARNING: datarootdir was used explicitly but not set:
19144 $ac_seen" >&5
19145 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19146 $ac_seen" >&2;}
19147         ac_warn_datarootdir=yes
19148       fi
19149     done
19150   fi
19151
19152 if test "x$ac_warn_datarootdir" = xyes; then
19153   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19154 fi
19155
19156 EOF
19157 cat >>"$CONFIG_STATUS" <<EOF
19158   sed "$ac_vpsub
19159 $extrasub
19160 EOF
19161 cat >>"$CONFIG_STATUS" <<\EOF
19162 :t
19163 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19164 s,@configure_input@,$configure_input,;t t
19165 s,@srcdir@,$ac_srcdir,;t t
19166 s,@top_srcdir@,$ac_top_srcdir,;t t
19167 s,@INSTALL@,$ac_INSTALL,;t t
19168 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19169   rm -f "$tmp"/stdin
19170 EOF
19171 : "${FGREP:=grep -F}"
19172 : "${EGREP:=grep -E}"
19173 cat >>"$CONFIG_STATUS" <<EOF
19174   : "\${FGREP:=$FGREP}"
19175   : "\${EGREP:=$EGREP}"
19176 EOF
19177 cat >>"$CONFIG_STATUS" <<\EOF
19178   if test x"$ac_file" != x-; then
19179     cp "$tmp/out" "$ac_file"
19180
19181     for ac_name in prefix exec_prefix datarootdir
19182     do
19183         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19184         if test -n "$ac_seen"; then
19185             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19186             if test -z "$ac_init"; then
19187               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19188               { echo "$as_me:19188: WARNING: Variable $ac_name is used but was not set:
19189 $ac_seen" >&5
19190 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19191 $ac_seen" >&2;}
19192             fi
19193         fi
19194     done
19195     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19196     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19197     if test -s "$tmp"/out; then
19198       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19199       { echo "$as_me:19199: WARNING: Some variables may not be substituted:
19200 $ac_seen" >&5
19201 echo "$as_me: WARNING: Some variables may not be substituted:
19202 $ac_seen" >&2;}
19203     fi
19204   else
19205     cat "$tmp"/out
19206   fi
19207   rm -f "$tmp"/out
19208
19209 done
19210 EOF
19211 cat >>"$CONFIG_STATUS" <<\EOF
19212
19213 #
19214 # CONFIG_HEADER section.
19215 #
19216
19217 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19218 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19219 #
19220 # ac_d sets the value in "#define NAME VALUE" lines.
19221 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19222 ac_dB='[        ].*$,\1#\2'
19223 ac_dC=' '
19224 ac_dD=',;t'
19225 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19226 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19227 ac_iB='\([      ]\),\1#\2define\3'
19228 ac_iC=' '
19229 ac_iD='\4,;t'
19230 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19231 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19232 ac_uB='$,\1#\2define\3'
19233 ac_uC=' '
19234 ac_uD=',;t'
19235
19236 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19237   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19238   case "$ac_file" in
19239   - | *:- | *:-:* ) # input from stdin
19240         cat >"$tmp"/stdin
19241         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19242         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19243   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19244         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19245   * )   ac_file_in=$ac_file.in ;;
19246   esac
19247
19248   test x"$ac_file" != x- && { echo "$as_me:19248: creating $ac_file" >&5
19249 echo "$as_me: creating $ac_file" >&6;}
19250
19251   # First look for the input files in the build tree, otherwise in the
19252   # src tree.
19253   ac_file_inputs=`IFS=:
19254     for f in $ac_file_in; do
19255       case $f in
19256       -) echo "$tmp"/stdin ;;
19257       [\\/$]*)
19258          # Absolute (can't be DOS-style, as IFS=:)
19259          test -f "$f" || { { echo "$as_me:19259: error: cannot find input file: $f" >&5
19260 echo "$as_me: error: cannot find input file: $f" >&2;}
19261    { (exit 1); exit 1; }; }
19262          echo $f;;
19263       *) # Relative
19264          if test -f "$f"; then
19265            # Build tree
19266            echo $f
19267          elif test -f "$srcdir/$f"; then
19268            # Source tree
19269            echo "$srcdir/$f"
19270          else
19271            # /dev/null tree
19272            { { echo "$as_me:19272: error: cannot find input file: $f" >&5
19273 echo "$as_me: error: cannot find input file: $f" >&2;}
19274    { (exit 1); exit 1; }; }
19275          fi;;
19276       esac
19277     done` || { (exit 1); exit 1; }
19278   # Remove the trailing spaces.
19279   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19280
19281 EOF
19282
19283 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19284 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19285 # be either 'cat' or 'sort'.
19286 cat confdefs.h | uniq >conftest.vals
19287
19288 # Break up conftest.vals because some shells have a limit on
19289 # the size of here documents, and old seds have small limits too.
19290
19291 rm -f conftest.tail
19292 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19293 while grep . conftest.vals >/dev/null
19294 do
19295   # Write chunks of a limited-size here document to conftest.frag.
19296   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19297   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19298   echo 'CEOF' >> "$CONFIG_STATUS"
19299   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19300   rm -f conftest.vals
19301   mv conftest.tail conftest.vals
19302 done
19303 rm -f conftest.vals
19304
19305 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19306 # marker @DEFS@.
19307 echo '  cat >> conftest.edit <<CEOF
19308 /@DEFS@/r conftest.frag
19309 /@DEFS@/d
19310 CEOF
19311 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19312 rm -f "$tmp"/in
19313 mv "$tmp"/out "$tmp"/in
19314 rm -f conftest.edit conftest.frag
19315 ' >> "$CONFIG_STATUS"
19316
19317 cat >>"$CONFIG_STATUS" <<\EOF
19318   # Let's still pretend it is `configure' which instantiates (i.e., don't
19319   # use $as_me), people would be surprised to read:
19320   #    /* config.h.  Generated automatically by config.status.  */
19321   if test x"$ac_file" = x-; then
19322     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19323   else
19324     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19325   fi
19326   cat "$tmp"/in >>"$tmp"/config.h
19327   rm -f "$tmp"/in
19328   if test x"$ac_file" != x-; then
19329     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19330       { echo "$as_me:19330: $ac_file is unchanged" >&5
19331 echo "$as_me: $ac_file is unchanged" >&6;}
19332     else
19333       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19334          X"$ac_file" : 'X\(//\)[^/]' \| \
19335          X"$ac_file" : 'X\(//\)$' \| \
19336          X"$ac_file" : 'X\(/\)' \| \
19337          .     : '\(.\)' 2>/dev/null ||
19338 echo X"$ac_file" |
19339     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19340           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19341           /^X\(\/\/\)$/{ s//\1/; q; }
19342           /^X\(\/\).*/{ s//\1/; q; }
19343           s/.*/./; q'`
19344       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19345         { case "$ac_dir" in
19346   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19347   *)                      as_incr_dir=.;;
19348 esac
19349 as_dummy="$ac_dir"
19350 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19351   case $as_mkdir_dir in
19352     # Skip DOS drivespec
19353     ?:) as_incr_dir=$as_mkdir_dir ;;
19354     *)
19355       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19356       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19357     ;;
19358   esac
19359 done; }
19360
19361       fi
19362       rm -f "$ac_file"
19363       mv "$tmp/config.h" "$ac_file"
19364     fi
19365   else
19366     cat "$tmp"/config.h
19367     rm -f "$tmp"/config.h
19368   fi
19369 done
19370 EOF
19371 cat >>"$CONFIG_STATUS" <<\EOF
19372 #
19373 # CONFIG_COMMANDS section.
19374 #
19375 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19376   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19377   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19378
19379   case "$ac_dest" in
19380     default )
19381 $AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
19382 if test -z "$USE_OLD_MAKERULES" ; then
19383         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19384 fi
19385  ;;
19386   esac
19387 done
19388 EOF
19389
19390 cat >>"$CONFIG_STATUS" <<\EOF
19391
19392 { (exit 0); exit 0; }
19393 EOF
19394 chmod +x "$CONFIG_STATUS"
19395 ac_clean_files=$ac_clean_files_save
19396
19397 # configure is writing to config.log, and then calls config.status.
19398 # config.status does its own redirection, appending to config.log.
19399 # Unfortunately, on DOS this fails, as config.log is still kept open
19400 # by configure, so config.status won't be able to write to it; its
19401 # output is simply discarded.  So we exec the FD to /dev/null,
19402 # effectively closing config.log, so it can be properly (re)opened and
19403 # appended to by config.status.  When coming back to configure, we
19404 # need to make the FD available again.
19405 if test "$no_create" != yes; then
19406   ac_cs_success=:
19407   exec 5>/dev/null
19408   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19409   exec 5>>config.log
19410   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19411   # would make configure fail if this is the last instruction.
19412   "$ac_cs_success" || { (exit 1); exit 1; }
19413 fi
19414 ${MAKE:-make} preinstall