]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.4 - patch 20240420
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.88 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.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 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f "conftest.$ac_objext"
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit "$ac_status"); } &&
1894          { ac_try='test -s "conftest.$ac_objext"'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit "$ac_status"); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat "conftest.$ac_ext" >&5
1906 fi
1907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         cat >"conftest.$ac_ext" <<_ACEOF
1922 #line 1922 "configure"
1923 #include "confdefs.h"
1924
1925 int
1926 main (void)
1927 {
1928
1929 #ifdef __clang__
1930 #else
1931 make an error
1932 #endif
1933
1934   ;
1935   return 0;
1936 }
1937 _ACEOF
1938 rm -f "conftest.$ac_objext"
1939 if { (eval echo "$as_me:1939: \"$ac_compile\"") >&5
1940   (eval $ac_compile) 2>&5
1941   ac_status=$?
1942   echo "$as_me:1942: \$? = $ac_status" >&5
1943   (exit "$ac_status"); } &&
1944          { ac_try='test -s "conftest.$ac_objext"'
1945   { (eval echo "$as_me:1945: \"$ac_try\"") >&5
1946   (eval $ac_try) 2>&5
1947   ac_status=$?
1948   echo "$as_me:1948: \$? = $ac_status" >&5
1949   (exit "$ac_status"); }; }; then
1950   CLANG_COMPILER=yes
1951
1952 else
1953   echo "$as_me: failed program was:" >&5
1954 cat "conftest.$ac_ext" >&5
1955 fi
1956 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1957         CFLAGS="$cf_save_CFLAGS"
1958         echo "$as_me:1958: result: $CLANG_COMPILER" >&5
1959 echo "${ECHO_T}$CLANG_COMPILER" >&6
1960 fi
1961
1962 CLANG_VERSION=none
1963
1964 if test "x$CLANG_COMPILER" = "xyes" ; then
1965         case "$CC" in
1966         (c[1-9][0-9]|*/c[1-9][0-9])
1967                 { echo "$as_me:1967: WARNING: replacing broken compiler alias $CC" >&5
1968 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1969                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1970                 CC=clang
1971                 ;;
1972         esac
1973
1974         echo "$as_me:1974: checking version of $CC" >&5
1975 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1976         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1977         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1978         echo "$as_me:1978: result: $CLANG_VERSION" >&5
1979 echo "${ECHO_T}$CLANG_VERSION" >&6
1980
1981         for cf_clang_opt in \
1982                 -Qunused-arguments \
1983                 -Wno-error=implicit-function-declaration
1984         do
1985                 echo "$as_me:1985: checking if option $cf_clang_opt works" >&5
1986 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1987                 cf_save_CFLAGS="$CFLAGS"
1988                 CFLAGS="$CFLAGS $cf_clang_opt"
1989                 cat >"conftest.$ac_ext" <<_ACEOF
1990 #line 1990 "configure"
1991 #include "confdefs.h"
1992
1993                         #include <stdio.h>
1994 int
1995 main (void)
1996 {
1997
1998                         printf("hello!\\n");
1999   ;
2000   return 0;
2001 }
2002 _ACEOF
2003 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2004 if { (eval echo "$as_me:2004: \"$ac_link\"") >&5
2005   (eval $ac_link) 2>&5
2006   ac_status=$?
2007   echo "$as_me:2007: \$? = $ac_status" >&5
2008   (exit "$ac_status"); } &&
2009          { ac_try='test -s "conftest$ac_exeext"'
2010   { (eval echo "$as_me:2010: \"$ac_try\"") >&5
2011   (eval $ac_try) 2>&5
2012   ac_status=$?
2013   echo "$as_me:2013: \$? = $ac_status" >&5
2014   (exit "$ac_status"); }; }; then
2015
2016                         cf_clang_optok=yes
2017 else
2018   echo "$as_me: failed program was:" >&5
2019 cat "conftest.$ac_ext" >&5
2020
2021                         cf_clang_optok=no
2022 fi
2023 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2024                 echo "$as_me:2024: result: $cf_clang_optok" >&5
2025 echo "${ECHO_T}$cf_clang_optok" >&6
2026                 CFLAGS="$cf_save_CFLAGS"
2027                 if test "$cf_clang_optok" = yes; then
2028                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2029
2030 echo "${as_me:-configure}:2030: testing adding option $cf_clang_opt ..." 1>&5
2031
2032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2033         CFLAGS="${CFLAGS}$cf_clang_opt"
2034
2035                 fi
2036         done
2037 fi
2038
2039 echo "$as_me:2039: checking for $CC option to accept ANSI C" >&5
2040 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2041 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2042   echo $ECHO_N "(cached) $ECHO_C" >&6
2043 else
2044   ac_cv_prog_cc_stdc=no
2045 ac_save_CC=$CC
2046 cat >"conftest.$ac_ext" <<_ACEOF
2047 #line 2047 "configure"
2048 #include "confdefs.h"
2049 #include <stdarg.h>
2050 #include <stdio.h>
2051 #include <sys/types.h>
2052 #include <sys/stat.h>
2053 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2054 struct buf { int x; };
2055 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2056 static char *e (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" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 # if $PKG_CONFIG_LIBDIR is set, try to use that
3283 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         make an error
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         make an error
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         make an error
8272 #endif
8273
8274 printf("%s\\n", NCURSES_VERSION);
8275 #else
8276 #ifdef __NCURSES_H
8277 printf("old\\n");
8278 #else
8279         make an error
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         make an error
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         make an error
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         make an error
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 (msys)
12454         cf_XOPEN_SOURCE=600
12455         ;;
12456 (darwin[0-8].*)
12457         cf_xopen_source="-D_APPLE_C_SOURCE"
12458         ;;
12459 (darwin*)
12460         cf_xopen_source="-D_DARWIN_C_SOURCE"
12461         cf_XOPEN_SOURCE=
12462         ;;
12463 (freebsd*|dragonfly*|midnightbsd*)
12464         # 5.x headers associate
12465         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12466         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12467         cf_POSIX_C_SOURCE=200112L
12468         cf_XOPEN_SOURCE=600
12469         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12470         ;;
12471 (hpux11*)
12472         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12473         ;;
12474 (hpux*)
12475         cf_xopen_source="-D_HPUX_SOURCE"
12476         ;;
12477 (irix[56].*)
12478         cf_xopen_source="-D_SGI_SOURCE"
12479         cf_XOPEN_SOURCE=
12480         ;;
12481 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12482
12483 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12484
12485 echo "$as_me:12485: checking if this is the GNU C library" >&5
12486 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12487 if test "${cf_cv_gnu_library+set}" = set; then
12488   echo $ECHO_N "(cached) $ECHO_C" >&6
12489 else
12490
12491 cat >"conftest.$ac_ext" <<_ACEOF
12492 #line 12492 "configure"
12493 #include "confdefs.h"
12494 #include <sys/types.h>
12495 int
12496 main (void)
12497 {
12498
12499         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12500                 return 0;
12501         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12502                 return 0;
12503         #else
12504         #       error not GNU C library
12505         #endif
12506   ;
12507   return 0;
12508 }
12509 _ACEOF
12510 rm -f "conftest.$ac_objext"
12511 if { (eval echo "$as_me:12511: \"$ac_compile\"") >&5
12512   (eval $ac_compile) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit "$ac_status"); } &&
12516          { ac_try='test -s "conftest.$ac_objext"'
12517   { (eval echo "$as_me:12517: \"$ac_try\"") >&5
12518   (eval $ac_try) 2>&5
12519   ac_status=$?
12520   echo "$as_me:12520: \$? = $ac_status" >&5
12521   (exit "$ac_status"); }; }; then
12522   cf_cv_gnu_library=yes
12523 else
12524   echo "$as_me: failed program was:" >&5
12525 cat "conftest.$ac_ext" >&5
12526 cf_cv_gnu_library=no
12527 fi
12528 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12529
12530 fi
12531 echo "$as_me:12531: result: $cf_cv_gnu_library" >&5
12532 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12533
12534 if test x$cf_cv_gnu_library = xyes; then
12535
12536         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12537         # was changed to help a little.  newlib incorporated the change about 4
12538         # years later.
12539         echo "$as_me:12539: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12540 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12541 if test "${cf_cv_gnu_library_219+set}" = set; then
12542   echo $ECHO_N "(cached) $ECHO_C" >&6
12543 else
12544
12545                 cf_save="$CPPFLAGS"
12546
12547         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12548         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12549
12550                 cat >"conftest.$ac_ext" <<_ACEOF
12551 #line 12551 "configure"
12552 #include "confdefs.h"
12553 #include <sys/types.h>
12554 int
12555 main (void)
12556 {
12557
12558                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12559                                 return 0;
12560                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12561                                 return 0;
12562                         #else
12563                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12564                         #endif
12565   ;
12566   return 0;
12567 }
12568 _ACEOF
12569 rm -f "conftest.$ac_objext"
12570 if { (eval echo "$as_me:12570: \"$ac_compile\"") >&5
12571   (eval $ac_compile) 2>&5
12572   ac_status=$?
12573   echo "$as_me:12573: \$? = $ac_status" >&5
12574   (exit "$ac_status"); } &&
12575          { ac_try='test -s "conftest.$ac_objext"'
12576   { (eval echo "$as_me:12576: \"$ac_try\"") >&5
12577   (eval $ac_try) 2>&5
12578   ac_status=$?
12579   echo "$as_me:12579: \$? = $ac_status" >&5
12580   (exit "$ac_status"); }; }; then
12581   cf_cv_gnu_library_219=yes
12582 else
12583   echo "$as_me: failed program was:" >&5
12584 cat "conftest.$ac_ext" >&5
12585 cf_cv_gnu_library_219=no
12586 fi
12587 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12588                 CPPFLAGS="$cf_save"
12589
12590 fi
12591 echo "$as_me:12591: result: $cf_cv_gnu_library_219" >&5
12592 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12593
12594         if test "x$cf_cv_gnu_library_219" = xyes; then
12595                 cf_save="$CPPFLAGS"
12596                 echo "$as_me:12596: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12597 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12598 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12599   echo $ECHO_N "(cached) $ECHO_C" >&6
12600 else
12601
12602 cf_fix_cppflags=no
12603 cf_new_cflags=
12604 cf_new_cppflags=
12605 cf_new_extra_cppflags=
12606
12607 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12608 do
12609 case "$cf_fix_cppflags" in
12610 (no)
12611         case "$cf_add_cflags" in
12612         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12613                 case "$cf_add_cflags" in
12614                 (-D*)
12615                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12616
12617                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12618                                 && test -z "${cf_tst_cflags}" \
12619                                 && cf_fix_cppflags=yes
12620
12621                         if test "$cf_fix_cppflags" = yes ; then
12622
12623         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12624         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12625
12626                                 continue
12627                         elif test "${cf_tst_cflags}" = "\"'" ; then
12628
12629         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12630         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12631
12632                                 continue
12633                         fi
12634                         ;;
12635                 esac
12636                 case "$CPPFLAGS" in
12637                 (*$cf_add_cflags)
12638                         ;;
12639                 (*)
12640                         case "$cf_add_cflags" in
12641                         (-D*)
12642                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12643
12644 CPPFLAGS=`echo "$CPPFLAGS" | \
12645         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12646                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12647
12648                                 ;;
12649                         esac
12650
12651         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12652         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12653
12654                         ;;
12655                 esac
12656                 ;;
12657         (*)
12658
12659         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12660         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12661
12662                 ;;
12663         esac
12664         ;;
12665 (yes)
12666
12667         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12668         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12669
12670         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12671
12672         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12673                 && test -z "${cf_tst_cflags}" \
12674                 && cf_fix_cppflags=no
12675         ;;
12676 esac
12677 done
12678
12679 if test -n "$cf_new_cflags" ; then
12680
12681         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12682         CFLAGS="${CFLAGS}$cf_new_cflags"
12683
12684 fi
12685
12686 if test -n "$cf_new_cppflags" ; then
12687
12688         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12689         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12690
12691 fi
12692
12693 if test -n "$cf_new_extra_cppflags" ; then
12694
12695         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12696         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12697
12698 fi
12699
12700                         cat >"conftest.$ac_ext" <<_ACEOF
12701 #line 12701 "configure"
12702 #include "confdefs.h"
12703
12704                                 #include <limits.h>
12705                                 #include <sys/types.h>
12706
12707 int
12708 main (void)
12709 {
12710
12711                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12712                                         return 0;
12713                                 #else
12714                                 #       error GNU C library is too old
12715                                 #endif
12716   ;
12717   return 0;
12718 }
12719 _ACEOF
12720 rm -f "conftest.$ac_objext"
12721 if { (eval echo "$as_me:12721: \"$ac_compile\"") >&5
12722   (eval $ac_compile) 2>&5
12723   ac_status=$?
12724   echo "$as_me:12724: \$? = $ac_status" >&5
12725   (exit "$ac_status"); } &&
12726          { ac_try='test -s "conftest.$ac_objext"'
12727   { (eval echo "$as_me:12727: \"$ac_try\"") >&5
12728   (eval $ac_try) 2>&5
12729   ac_status=$?
12730   echo "$as_me:12730: \$? = $ac_status" >&5
12731   (exit "$ac_status"); }; }; then
12732   cf_cv_gnu_dftsrc_219=yes
12733 else
12734   echo "$as_me: failed program was:" >&5
12735 cat "conftest.$ac_ext" >&5
12736 cf_cv_gnu_dftsrc_219=no
12737 fi
12738 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12739
12740 fi
12741 echo "$as_me:12741: result: $cf_cv_gnu_dftsrc_219" >&5
12742 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12743                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12744         else
12745                 cf_cv_gnu_dftsrc_219=maybe
12746         fi
12747
12748         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12749
12750                 echo "$as_me:12750: checking if we must define _GNU_SOURCE" >&5
12751 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12752 if test "${cf_cv_gnu_source+set}" = set; then
12753   echo $ECHO_N "(cached) $ECHO_C" >&6
12754 else
12755
12756                 cat >"conftest.$ac_ext" <<_ACEOF
12757 #line 12757 "configure"
12758 #include "confdefs.h"
12759 #include <sys/types.h>
12760 int
12761 main (void)
12762 {
12763
12764                         #ifndef _XOPEN_SOURCE
12765                         #error  expected _XOPEN_SOURCE to be defined
12766                         #endif
12767   ;
12768   return 0;
12769 }
12770 _ACEOF
12771 rm -f "conftest.$ac_objext"
12772 if { (eval echo "$as_me:12772: \"$ac_compile\"") >&5
12773   (eval $ac_compile) 2>&5
12774   ac_status=$?
12775   echo "$as_me:12775: \$? = $ac_status" >&5
12776   (exit "$ac_status"); } &&
12777          { ac_try='test -s "conftest.$ac_objext"'
12778   { (eval echo "$as_me:12778: \"$ac_try\"") >&5
12779   (eval $ac_try) 2>&5
12780   ac_status=$?
12781   echo "$as_me:12781: \$? = $ac_status" >&5
12782   (exit "$ac_status"); }; }; then
12783   cf_cv_gnu_source=no
12784 else
12785   echo "$as_me: failed program was:" >&5
12786 cat "conftest.$ac_ext" >&5
12787 cf_save="$CPPFLAGS"
12788
12789 cf_fix_cppflags=no
12790 cf_new_cflags=
12791 cf_new_cppflags=
12792 cf_new_extra_cppflags=
12793
12794 for cf_add_cflags in -D_GNU_SOURCE
12795 do
12796 case "$cf_fix_cppflags" in
12797 (no)
12798         case "$cf_add_cflags" in
12799         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12800                 case "$cf_add_cflags" in
12801                 (-D*)
12802                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12803
12804                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12805                                 && test -z "${cf_tst_cflags}" \
12806                                 && cf_fix_cppflags=yes
12807
12808                         if test "$cf_fix_cppflags" = yes ; then
12809
12810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12812
12813                                 continue
12814                         elif test "${cf_tst_cflags}" = "\"'" ; then
12815
12816         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12817         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12818
12819                                 continue
12820                         fi
12821                         ;;
12822                 esac
12823                 case "$CPPFLAGS" in
12824                 (*$cf_add_cflags)
12825                         ;;
12826                 (*)
12827                         case "$cf_add_cflags" in
12828                         (-D*)
12829                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12830
12831 CPPFLAGS=`echo "$CPPFLAGS" | \
12832         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12833                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12834
12835                                 ;;
12836                         esac
12837
12838         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12839         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12840
12841                         ;;
12842                 esac
12843                 ;;
12844         (*)
12845
12846         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12847         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12848
12849                 ;;
12850         esac
12851         ;;
12852 (yes)
12853
12854         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12855         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12856
12857         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12858
12859         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12860                 && test -z "${cf_tst_cflags}" \
12861                 && cf_fix_cppflags=no
12862         ;;
12863 esac
12864 done
12865
12866 if test -n "$cf_new_cflags" ; then
12867
12868         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12869         CFLAGS="${CFLAGS}$cf_new_cflags"
12870
12871 fi
12872
12873 if test -n "$cf_new_cppflags" ; then
12874
12875         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12876         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12877
12878 fi
12879
12880 if test -n "$cf_new_extra_cppflags" ; then
12881
12882         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12883         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12884
12885 fi
12886
12887                          cat >"conftest.$ac_ext" <<_ACEOF
12888 #line 12888 "configure"
12889 #include "confdefs.h"
12890 #include <sys/types.h>
12891 int
12892 main (void)
12893 {
12894
12895                                 #ifdef _XOPEN_SOURCE
12896                                 #error  expected _XOPEN_SOURCE to be undefined
12897                                 #endif
12898   ;
12899   return 0;
12900 }
12901 _ACEOF
12902 rm -f "conftest.$ac_objext"
12903 if { (eval echo "$as_me:12903: \"$ac_compile\"") >&5
12904   (eval $ac_compile) 2>&5
12905   ac_status=$?
12906   echo "$as_me:12906: \$? = $ac_status" >&5
12907   (exit "$ac_status"); } &&
12908          { ac_try='test -s "conftest.$ac_objext"'
12909   { (eval echo "$as_me:12909: \"$ac_try\"") >&5
12910   (eval $ac_try) 2>&5
12911   ac_status=$?
12912   echo "$as_me:12912: \$? = $ac_status" >&5
12913   (exit "$ac_status"); }; }; then
12914   cf_cv_gnu_source=no
12915 else
12916   echo "$as_me: failed program was:" >&5
12917 cat "conftest.$ac_ext" >&5
12918 cf_cv_gnu_source=yes
12919 fi
12920 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12921                         CPPFLAGS="$cf_save"
12922
12923 fi
12924 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12925
12926 fi
12927 echo "$as_me:12927: result: $cf_cv_gnu_source" >&5
12928 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12929
12930                 if test "$cf_cv_gnu_source" = yes
12931                 then
12932                 echo "$as_me:12932: checking if we should also define _DEFAULT_SOURCE" >&5
12933 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12934 if test "${cf_cv_default_source+set}" = set; then
12935   echo $ECHO_N "(cached) $ECHO_C" >&6
12936 else
12937
12938         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12939         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12940
12941                         cat >"conftest.$ac_ext" <<_ACEOF
12942 #line 12942 "configure"
12943 #include "confdefs.h"
12944 #include <sys/types.h>
12945 int
12946 main (void)
12947 {
12948
12949                                 #ifdef _DEFAULT_SOURCE
12950                                 #error  expected _DEFAULT_SOURCE to be undefined
12951                                 #endif
12952   ;
12953   return 0;
12954 }
12955 _ACEOF
12956 rm -f "conftest.$ac_objext"
12957 if { (eval echo "$as_me:12957: \"$ac_compile\"") >&5
12958   (eval $ac_compile) 2>&5
12959   ac_status=$?
12960   echo "$as_me:12960: \$? = $ac_status" >&5
12961   (exit "$ac_status"); } &&
12962          { ac_try='test -s "conftest.$ac_objext"'
12963   { (eval echo "$as_me:12963: \"$ac_try\"") >&5
12964   (eval $ac_try) 2>&5
12965   ac_status=$?
12966   echo "$as_me:12966: \$? = $ac_status" >&5
12967   (exit "$ac_status"); }; }; then
12968   cf_cv_default_source=no
12969 else
12970   echo "$as_me: failed program was:" >&5
12971 cat "conftest.$ac_ext" >&5
12972 cf_cv_default_source=yes
12973 fi
12974 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12975
12976 fi
12977 echo "$as_me:12977: result: $cf_cv_default_source" >&5
12978 echo "${ECHO_T}$cf_cv_default_source" >&6
12979                         if test "$cf_cv_default_source" = yes
12980                         then
12981
12982         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12983         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12984
12985                         fi
12986                 fi
12987         fi
12988
12989 fi
12990
12991         ;;
12992 (minix*)
12993         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12994         ;;
12995 (mirbsd*)
12996         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12997         cf_XOPEN_SOURCE=
12998
12999 if test "$cf_cv_posix_visible" = no; then
13000
13001 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13002
13003 cf_save_CFLAGS="$CFLAGS"
13004 cf_save_CPPFLAGS="$CPPFLAGS"
13005
13006 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13007         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13008                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13009
13010 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13011         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13012                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13013
13014 echo "$as_me:13014: checking if we should define _POSIX_C_SOURCE" >&5
13015 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13016 if test "${cf_cv_posix_c_source+set}" = set; then
13017   echo $ECHO_N "(cached) $ECHO_C" >&6
13018 else
13019
13020 echo "${as_me:-configure}:13020: testing if the symbol is already defined go no further ..." 1>&5
13021
13022         cat >"conftest.$ac_ext" <<_ACEOF
13023 #line 13023 "configure"
13024 #include "confdefs.h"
13025 #include <sys/types.h>
13026 int
13027 main (void)
13028 {
13029
13030 #ifndef _POSIX_C_SOURCE
13031 make an error
13032 #endif
13033   ;
13034   return 0;
13035 }
13036 _ACEOF
13037 rm -f "conftest.$ac_objext"
13038 if { (eval echo "$as_me:13038: \"$ac_compile\"") >&5
13039   (eval $ac_compile) 2>&5
13040   ac_status=$?
13041   echo "$as_me:13041: \$? = $ac_status" >&5
13042   (exit "$ac_status"); } &&
13043          { ac_try='test -s "conftest.$ac_objext"'
13044   { (eval echo "$as_me:13044: \"$ac_try\"") >&5
13045   (eval $ac_try) 2>&5
13046   ac_status=$?
13047   echo "$as_me:13047: \$? = $ac_status" >&5
13048   (exit "$ac_status"); }; }; then
13049   cf_cv_posix_c_source=no
13050 else
13051   echo "$as_me: failed program was:" >&5
13052 cat "conftest.$ac_ext" >&5
13053 cf_want_posix_source=no
13054          case .$cf_POSIX_C_SOURCE in
13055          (.[12]??*)
13056                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13057                 ;;
13058          (.2)
13059                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13060                 cf_want_posix_source=yes
13061                 ;;
13062          (.*)
13063                 cf_want_posix_source=yes
13064                 ;;
13065          esac
13066          if test "$cf_want_posix_source" = yes ; then
13067                 cat >"conftest.$ac_ext" <<_ACEOF
13068 #line 13068 "configure"
13069 #include "confdefs.h"
13070 #include <sys/types.h>
13071 int
13072 main (void)
13073 {
13074
13075 #ifdef _POSIX_SOURCE
13076 make an error
13077 #endif
13078   ;
13079   return 0;
13080 }
13081 _ACEOF
13082 rm -f "conftest.$ac_objext"
13083 if { (eval echo "$as_me:13083: \"$ac_compile\"") >&5
13084   (eval $ac_compile) 2>&5
13085   ac_status=$?
13086   echo "$as_me:13086: \$? = $ac_status" >&5
13087   (exit "$ac_status"); } &&
13088          { ac_try='test -s "conftest.$ac_objext"'
13089   { (eval echo "$as_me:13089: \"$ac_try\"") >&5
13090   (eval $ac_try) 2>&5
13091   ac_status=$?
13092   echo "$as_me:13092: \$? = $ac_status" >&5
13093   (exit "$ac_status"); }; }; then
13094   :
13095 else
13096   echo "$as_me: failed program was:" >&5
13097 cat "conftest.$ac_ext" >&5
13098 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13099 fi
13100 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13101          fi
13102
13103 echo "${as_me:-configure}:13103: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13104
13105          CFLAGS="$cf_trim_CFLAGS"
13106          CPPFLAGS="$cf_trim_CPPFLAGS"
13107
13108         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13109         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13110
13111 echo "${as_me:-configure}:13111: testing if the second compile does not leave our definition intact error ..." 1>&5
13112
13113          cat >"conftest.$ac_ext" <<_ACEOF
13114 #line 13114 "configure"
13115 #include "confdefs.h"
13116 #include <sys/types.h>
13117 int
13118 main (void)
13119 {
13120
13121 #ifndef _POSIX_C_SOURCE
13122 make an error
13123 #endif
13124   ;
13125   return 0;
13126 }
13127 _ACEOF
13128 rm -f "conftest.$ac_objext"
13129 if { (eval echo "$as_me:13129: \"$ac_compile\"") >&5
13130   (eval $ac_compile) 2>&5
13131   ac_status=$?
13132   echo "$as_me:13132: \$? = $ac_status" >&5
13133   (exit "$ac_status"); } &&
13134          { ac_try='test -s "conftest.$ac_objext"'
13135   { (eval echo "$as_me:13135: \"$ac_try\"") >&5
13136   (eval $ac_try) 2>&5
13137   ac_status=$?
13138   echo "$as_me:13138: \$? = $ac_status" >&5
13139   (exit "$ac_status"); }; }; then
13140   :
13141 else
13142   echo "$as_me: failed program was:" >&5
13143 cat "conftest.$ac_ext" >&5
13144 cf_cv_posix_c_source=no
13145 fi
13146 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13147          CFLAGS="$cf_save_CFLAGS"
13148          CPPFLAGS="$cf_save_CPPFLAGS"
13149
13150 fi
13151 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13152
13153 fi
13154 echo "$as_me:13154: result: $cf_cv_posix_c_source" >&5
13155 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13156
13157 if test "$cf_cv_posix_c_source" != no ; then
13158         CFLAGS="$cf_trim_CFLAGS"
13159         CPPFLAGS="$cf_trim_CPPFLAGS"
13160
13161 cf_fix_cppflags=no
13162 cf_new_cflags=
13163 cf_new_cppflags=
13164 cf_new_extra_cppflags=
13165
13166 for cf_add_cflags in $cf_cv_posix_c_source
13167 do
13168 case "$cf_fix_cppflags" in
13169 (no)
13170         case "$cf_add_cflags" in
13171         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13172                 case "$cf_add_cflags" in
13173                 (-D*)
13174                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13175
13176                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13177                                 && test -z "${cf_tst_cflags}" \
13178                                 && cf_fix_cppflags=yes
13179
13180                         if test "$cf_fix_cppflags" = yes ; then
13181
13182         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13183         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13184
13185                                 continue
13186                         elif test "${cf_tst_cflags}" = "\"'" ; then
13187
13188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13190
13191                                 continue
13192                         fi
13193                         ;;
13194                 esac
13195                 case "$CPPFLAGS" in
13196                 (*$cf_add_cflags)
13197                         ;;
13198                 (*)
13199                         case "$cf_add_cflags" in
13200                         (-D*)
13201                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13202
13203 CPPFLAGS=`echo "$CPPFLAGS" | \
13204         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13205                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13206
13207                                 ;;
13208                         esac
13209
13210         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13211         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13212
13213                         ;;
13214                 esac
13215                 ;;
13216         (*)
13217
13218         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13219         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13220
13221                 ;;
13222         esac
13223         ;;
13224 (yes)
13225
13226         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13227         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13228
13229         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13230
13231         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13232                 && test -z "${cf_tst_cflags}" \
13233                 && cf_fix_cppflags=no
13234         ;;
13235 esac
13236 done
13237
13238 if test -n "$cf_new_cflags" ; then
13239
13240         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13241         CFLAGS="${CFLAGS}$cf_new_cflags"
13242
13243 fi
13244
13245 if test -n "$cf_new_cppflags" ; then
13246
13247         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13248         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13249
13250 fi
13251
13252 if test -n "$cf_new_extra_cppflags" ; then
13253
13254         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13255         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13256
13257 fi
13258
13259 fi
13260
13261 fi # cf_cv_posix_visible
13262
13263         ;;
13264 (netbsd*)
13265         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13266         ;;
13267 (openbsd[6-9]*)
13268         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13269         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13270         # Abusing the conformance level is a workaround.
13271         { echo "$as_me:13271: WARNING: this system does not provide usable locale support" >&5
13272 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13273         cf_xopen_source="-D_BSD_SOURCE"
13274         cf_XOPEN_SOURCE=700
13275         ;;
13276 (openbsd[4-5]*)
13277         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13278         cf_xopen_source="-D_BSD_SOURCE"
13279         cf_XOPEN_SOURCE=600
13280         ;;
13281 (openbsd*)
13282         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13283         ;;
13284 (osf[45]*)
13285         cf_xopen_source="-D_OSF_SOURCE"
13286         ;;
13287 (nto-qnx*)
13288         cf_xopen_source="-D_QNX_SOURCE"
13289         ;;
13290 (sco*)
13291         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13292         ;;
13293 (solaris2.*)
13294         cf_xopen_source="-D__EXTENSIONS__"
13295         cf_cv_xopen_source=broken
13296         ;;
13297 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13298         cf_XOPEN_SOURCE=
13299         cf_POSIX_C_SOURCE=
13300         ;;
13301 (*)
13302
13303 echo "$as_me:13303: checking if we should define _XOPEN_SOURCE" >&5
13304 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13305 if test "${cf_cv_xopen_source+set}" = set; then
13306   echo $ECHO_N "(cached) $ECHO_C" >&6
13307 else
13308
13309         cat >"conftest.$ac_ext" <<_ACEOF
13310 #line 13310 "configure"
13311 #include "confdefs.h"
13312
13313 #include <stdlib.h>
13314 #include <string.h>
13315 #include <sys/types.h>
13316
13317 int
13318 main (void)
13319 {
13320
13321 #ifndef _XOPEN_SOURCE
13322 make an error
13323 #endif
13324
13325   ;
13326   return 0;
13327 }
13328 _ACEOF
13329 rm -f "conftest.$ac_objext"
13330 if { (eval echo "$as_me:13330: \"$ac_compile\"") >&5
13331   (eval $ac_compile) 2>&5
13332   ac_status=$?
13333   echo "$as_me:13333: \$? = $ac_status" >&5
13334   (exit "$ac_status"); } &&
13335          { ac_try='test -s "conftest.$ac_objext"'
13336   { (eval echo "$as_me:13336: \"$ac_try\"") >&5
13337   (eval $ac_try) 2>&5
13338   ac_status=$?
13339   echo "$as_me:13339: \$? = $ac_status" >&5
13340   (exit "$ac_status"); }; }; then
13341   cf_cv_xopen_source=no
13342 else
13343   echo "$as_me: failed program was:" >&5
13344 cat "conftest.$ac_ext" >&5
13345 cf_save="$CPPFLAGS"
13346
13347         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13348         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13349
13350          cat >"conftest.$ac_ext" <<_ACEOF
13351 #line 13351 "configure"
13352 #include "confdefs.h"
13353
13354 #include <stdlib.h>
13355 #include <string.h>
13356 #include <sys/types.h>
13357
13358 int
13359 main (void)
13360 {
13361
13362 #ifndef _XOPEN_SOURCE
13363 make an error
13364 #endif
13365
13366   ;
13367   return 0;
13368 }
13369 _ACEOF
13370 rm -f "conftest.$ac_objext"
13371 if { (eval echo "$as_me:13371: \"$ac_compile\"") >&5
13372   (eval $ac_compile) 2>&5
13373   ac_status=$?
13374   echo "$as_me:13374: \$? = $ac_status" >&5
13375   (exit "$ac_status"); } &&
13376          { ac_try='test -s "conftest.$ac_objext"'
13377   { (eval echo "$as_me:13377: \"$ac_try\"") >&5
13378   (eval $ac_try) 2>&5
13379   ac_status=$?
13380   echo "$as_me:13380: \$? = $ac_status" >&5
13381   (exit "$ac_status"); }; }; then
13382   cf_cv_xopen_source=no
13383 else
13384   echo "$as_me: failed program was:" >&5
13385 cat "conftest.$ac_ext" >&5
13386 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13387 fi
13388 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13389                 CPPFLAGS="$cf_save"
13390
13391 fi
13392 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13393
13394 fi
13395 echo "$as_me:13395: result: $cf_cv_xopen_source" >&5
13396 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13397
13398 if test "$cf_cv_xopen_source" != no ; then
13399
13400 CFLAGS=`echo "$CFLAGS" | \
13401         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13402                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13403
13404 CPPFLAGS=`echo "$CPPFLAGS" | \
13405         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13406                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13407
13408         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13409
13410 for cf_add_cflags in $cf_temp_xopen_source
13411 do
13412         case "x$cf_add_cflags" in
13413         (x-[DU]*)
13414
13415 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13416 while true
13417 do
13418         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'`
13419         test "$CFLAGS" != "$cf_old_cflag" || break
13420
13421         CFLAGS="$cf_old_cflag"
13422 done
13423
13424 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13425 while true
13426 do
13427         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'`
13428         test "$CPPFLAGS" != "$cf_old_cflag" || break
13429
13430         CPPFLAGS="$cf_old_cflag"
13431 done
13432
13433                 ;;
13434         esac
13435
13436 cf_fix_cppflags=no
13437 cf_new_cflags=
13438 cf_new_cppflags=
13439 cf_new_extra_cppflags=
13440
13441 for cf_add_cflags in $cf_add_cflags
13442 do
13443 case "$cf_fix_cppflags" in
13444 (no)
13445         case "$cf_add_cflags" in
13446         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13447                 case "$cf_add_cflags" in
13448                 (-D*)
13449                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13450
13451                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13452                                 && test -z "${cf_tst_cflags}" \
13453                                 && cf_fix_cppflags=yes
13454
13455                         if test "$cf_fix_cppflags" = yes ; then
13456
13457         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13458         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13459
13460                                 continue
13461                         elif test "${cf_tst_cflags}" = "\"'" ; then
13462
13463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13465
13466                                 continue
13467                         fi
13468                         ;;
13469                 esac
13470                 case "$CPPFLAGS" in
13471                 (*$cf_add_cflags)
13472                         ;;
13473                 (*)
13474                         case "$cf_add_cflags" in
13475                         (-D*)
13476                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13477
13478 CPPFLAGS=`echo "$CPPFLAGS" | \
13479         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13480                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13481
13482                                 ;;
13483                         esac
13484
13485         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13486         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13487
13488                         ;;
13489                 esac
13490                 ;;
13491         (*)
13492
13493         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13494         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13495
13496                 ;;
13497         esac
13498         ;;
13499 (yes)
13500
13501         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13502         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13503
13504         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13505
13506         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13507                 && test -z "${cf_tst_cflags}" \
13508                 && cf_fix_cppflags=no
13509         ;;
13510 esac
13511 done
13512
13513 if test -n "$cf_new_cflags" ; then
13514
13515         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13516         CFLAGS="${CFLAGS}$cf_new_cflags"
13517
13518 fi
13519
13520 if test -n "$cf_new_cppflags" ; then
13521
13522         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13523         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13524
13525 fi
13526
13527 if test -n "$cf_new_extra_cppflags" ; then
13528
13529         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13530         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13531
13532 fi
13533
13534 done
13535
13536 fi
13537
13538         cf_save_xopen_cppflags="$CPPFLAGS"
13539
13540 if test "$cf_cv_posix_visible" = no; then
13541
13542 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13543
13544 cf_save_CFLAGS="$CFLAGS"
13545 cf_save_CPPFLAGS="$CPPFLAGS"
13546
13547 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13548         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13549                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13550
13551 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13552         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13553                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13554
13555 echo "$as_me:13555: checking if we should define _POSIX_C_SOURCE" >&5
13556 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13557 if test "${cf_cv_posix_c_source+set}" = set; then
13558   echo $ECHO_N "(cached) $ECHO_C" >&6
13559 else
13560
13561 echo "${as_me:-configure}:13561: testing if the symbol is already defined go no further ..." 1>&5
13562
13563         cat >"conftest.$ac_ext" <<_ACEOF
13564 #line 13564 "configure"
13565 #include "confdefs.h"
13566 #include <sys/types.h>
13567 int
13568 main (void)
13569 {
13570
13571 #ifndef _POSIX_C_SOURCE
13572 make an error
13573 #endif
13574   ;
13575   return 0;
13576 }
13577 _ACEOF
13578 rm -f "conftest.$ac_objext"
13579 if { (eval echo "$as_me:13579: \"$ac_compile\"") >&5
13580   (eval $ac_compile) 2>&5
13581   ac_status=$?
13582   echo "$as_me:13582: \$? = $ac_status" >&5
13583   (exit "$ac_status"); } &&
13584          { ac_try='test -s "conftest.$ac_objext"'
13585   { (eval echo "$as_me:13585: \"$ac_try\"") >&5
13586   (eval $ac_try) 2>&5
13587   ac_status=$?
13588   echo "$as_me:13588: \$? = $ac_status" >&5
13589   (exit "$ac_status"); }; }; then
13590   cf_cv_posix_c_source=no
13591 else
13592   echo "$as_me: failed program was:" >&5
13593 cat "conftest.$ac_ext" >&5
13594 cf_want_posix_source=no
13595          case .$cf_POSIX_C_SOURCE in
13596          (.[12]??*)
13597                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13598                 ;;
13599          (.2)
13600                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13601                 cf_want_posix_source=yes
13602                 ;;
13603          (.*)
13604                 cf_want_posix_source=yes
13605                 ;;
13606          esac
13607          if test "$cf_want_posix_source" = yes ; then
13608                 cat >"conftest.$ac_ext" <<_ACEOF
13609 #line 13609 "configure"
13610 #include "confdefs.h"
13611 #include <sys/types.h>
13612 int
13613 main (void)
13614 {
13615
13616 #ifdef _POSIX_SOURCE
13617 make an error
13618 #endif
13619   ;
13620   return 0;
13621 }
13622 _ACEOF
13623 rm -f "conftest.$ac_objext"
13624 if { (eval echo "$as_me:13624: \"$ac_compile\"") >&5
13625   (eval $ac_compile) 2>&5
13626   ac_status=$?
13627   echo "$as_me:13627: \$? = $ac_status" >&5
13628   (exit "$ac_status"); } &&
13629          { ac_try='test -s "conftest.$ac_objext"'
13630   { (eval echo "$as_me:13630: \"$ac_try\"") >&5
13631   (eval $ac_try) 2>&5
13632   ac_status=$?
13633   echo "$as_me:13633: \$? = $ac_status" >&5
13634   (exit "$ac_status"); }; }; then
13635   :
13636 else
13637   echo "$as_me: failed program was:" >&5
13638 cat "conftest.$ac_ext" >&5
13639 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13640 fi
13641 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13642          fi
13643
13644 echo "${as_me:-configure}:13644: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13645
13646          CFLAGS="$cf_trim_CFLAGS"
13647          CPPFLAGS="$cf_trim_CPPFLAGS"
13648
13649         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13650         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13651
13652 echo "${as_me:-configure}:13652: testing if the second compile does not leave our definition intact error ..." 1>&5
13653
13654          cat >"conftest.$ac_ext" <<_ACEOF
13655 #line 13655 "configure"
13656 #include "confdefs.h"
13657 #include <sys/types.h>
13658 int
13659 main (void)
13660 {
13661
13662 #ifndef _POSIX_C_SOURCE
13663 make an error
13664 #endif
13665   ;
13666   return 0;
13667 }
13668 _ACEOF
13669 rm -f "conftest.$ac_objext"
13670 if { (eval echo "$as_me:13670: \"$ac_compile\"") >&5
13671   (eval $ac_compile) 2>&5
13672   ac_status=$?
13673   echo "$as_me:13673: \$? = $ac_status" >&5
13674   (exit "$ac_status"); } &&
13675          { ac_try='test -s "conftest.$ac_objext"'
13676   { (eval echo "$as_me:13676: \"$ac_try\"") >&5
13677   (eval $ac_try) 2>&5
13678   ac_status=$?
13679   echo "$as_me:13679: \$? = $ac_status" >&5
13680   (exit "$ac_status"); }; }; then
13681   :
13682 else
13683   echo "$as_me: failed program was:" >&5
13684 cat "conftest.$ac_ext" >&5
13685 cf_cv_posix_c_source=no
13686 fi
13687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13688          CFLAGS="$cf_save_CFLAGS"
13689          CPPFLAGS="$cf_save_CPPFLAGS"
13690
13691 fi
13692 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13693
13694 fi
13695 echo "$as_me:13695: result: $cf_cv_posix_c_source" >&5
13696 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13697
13698 if test "$cf_cv_posix_c_source" != no ; then
13699         CFLAGS="$cf_trim_CFLAGS"
13700         CPPFLAGS="$cf_trim_CPPFLAGS"
13701
13702 cf_fix_cppflags=no
13703 cf_new_cflags=
13704 cf_new_cppflags=
13705 cf_new_extra_cppflags=
13706
13707 for cf_add_cflags in $cf_cv_posix_c_source
13708 do
13709 case "$cf_fix_cppflags" in
13710 (no)
13711         case "$cf_add_cflags" in
13712         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13713                 case "$cf_add_cflags" in
13714                 (-D*)
13715                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13716
13717                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13718                                 && test -z "${cf_tst_cflags}" \
13719                                 && cf_fix_cppflags=yes
13720
13721                         if test "$cf_fix_cppflags" = yes ; then
13722
13723         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13724         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13725
13726                                 continue
13727                         elif test "${cf_tst_cflags}" = "\"'" ; then
13728
13729         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13730         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13731
13732                                 continue
13733                         fi
13734                         ;;
13735                 esac
13736                 case "$CPPFLAGS" in
13737                 (*$cf_add_cflags)
13738                         ;;
13739                 (*)
13740                         case "$cf_add_cflags" in
13741                         (-D*)
13742                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13743
13744 CPPFLAGS=`echo "$CPPFLAGS" | \
13745         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13746                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13747
13748                                 ;;
13749                         esac
13750
13751         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13752         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13753
13754                         ;;
13755                 esac
13756                 ;;
13757         (*)
13758
13759         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13760         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13761
13762                 ;;
13763         esac
13764         ;;
13765 (yes)
13766
13767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13769
13770         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13771
13772         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13773                 && test -z "${cf_tst_cflags}" \
13774                 && cf_fix_cppflags=no
13775         ;;
13776 esac
13777 done
13778
13779 if test -n "$cf_new_cflags" ; then
13780
13781         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13782         CFLAGS="${CFLAGS}$cf_new_cflags"
13783
13784 fi
13785
13786 if test -n "$cf_new_cppflags" ; then
13787
13788         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13789         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13790
13791 fi
13792
13793 if test -n "$cf_new_extra_cppflags" ; then
13794
13795         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13796         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13797
13798 fi
13799
13800 fi
13801
13802 fi # cf_cv_posix_visible
13803
13804         # Some of these niche implementations use copy/paste, double-check...
13805         if test "$cf_cv_xopen_source" != no ; then
13806                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
13807
13808 echo "${as_me:-configure}:13808: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
13809
13810                 cat >"conftest.$ac_ext" <<_ACEOF
13811 #line 13811 "configure"
13812 #include "confdefs.h"
13813
13814 #include <stdlib.h>
13815 #include <string.h>
13816 #include <sys/types.h>
13817
13818 int
13819 main (void)
13820 {
13821
13822 #ifndef _XOPEN_SOURCE
13823 make an error
13824 #endif
13825
13826   ;
13827   return 0;
13828 }
13829 _ACEOF
13830 rm -f "conftest.$ac_objext"
13831 if { (eval echo "$as_me:13831: \"$ac_compile\"") >&5
13832   (eval $ac_compile) 2>&5
13833   ac_status=$?
13834   echo "$as_me:13834: \$? = $ac_status" >&5
13835   (exit "$ac_status"); } &&
13836          { ac_try='test -s "conftest.$ac_objext"'
13837   { (eval echo "$as_me:13837: \"$ac_try\"") >&5
13838   (eval $ac_try) 2>&5
13839   ac_status=$?
13840   echo "$as_me:13840: \$? = $ac_status" >&5
13841   (exit "$ac_status"); }; }; then
13842   :
13843 else
13844   echo "$as_me: failed program was:" >&5
13845 cat "conftest.$ac_ext" >&5
13846
13847                         { echo "$as_me:13847: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
13848 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
13849                         CPPFLAGS="$cf_save_xopen_cppflags"
13850 fi
13851 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13852         fi
13853         ;;
13854 esac
13855
13856 if test -n "$cf_xopen_source" ; then
13857
13858 for cf_add_cflags in $cf_xopen_source
13859 do
13860         case "x$cf_add_cflags" in
13861         (x-[DU]*)
13862
13863 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13864 while true
13865 do
13866         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'`
13867         test "$CFLAGS" != "$cf_old_cflag" || break
13868         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13869
13870 echo "${as_me:-configure}:13870: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13871
13872         CFLAGS="$cf_old_cflag"
13873 done
13874
13875 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13876 while true
13877 do
13878         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'`
13879         test "$CPPFLAGS" != "$cf_old_cflag" || break
13880         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13881
13882 echo "${as_me:-configure}:13882: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13883
13884         CPPFLAGS="$cf_old_cflag"
13885 done
13886
13887                 ;;
13888         esac
13889
13890 cf_fix_cppflags=no
13891 cf_new_cflags=
13892 cf_new_cppflags=
13893 cf_new_extra_cppflags=
13894
13895 for cf_add_cflags in $cf_add_cflags
13896 do
13897 case "$cf_fix_cppflags" in
13898 (no)
13899         case "$cf_add_cflags" in
13900         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13901                 case "$cf_add_cflags" in
13902                 (-D*)
13903                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13904
13905                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13906                                 && test -z "${cf_tst_cflags}" \
13907                                 && cf_fix_cppflags=yes
13908
13909                         if test "$cf_fix_cppflags" = yes ; then
13910
13911         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13912         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13913
13914                                 continue
13915                         elif test "${cf_tst_cflags}" = "\"'" ; then
13916
13917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13919
13920                                 continue
13921                         fi
13922                         ;;
13923                 esac
13924                 case "$CPPFLAGS" in
13925                 (*$cf_add_cflags)
13926                         ;;
13927                 (*)
13928                         case "$cf_add_cflags" in
13929                         (-D*)
13930                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13931
13932 CPPFLAGS=`echo "$CPPFLAGS" | \
13933         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13934                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13935
13936                                 ;;
13937                         esac
13938
13939         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13940         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13941
13942                         ;;
13943                 esac
13944                 ;;
13945         (*)
13946
13947         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13948         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13949
13950                 ;;
13951         esac
13952         ;;
13953 (yes)
13954
13955         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13956         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13957
13958         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13959
13960         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13961                 && test -z "${cf_tst_cflags}" \
13962                 && cf_fix_cppflags=no
13963         ;;
13964 esac
13965 done
13966
13967 if test -n "$cf_new_cflags" ; then
13968         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13969
13970 echo "${as_me:-configure}:13970: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13971
13972         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13973         CFLAGS="${CFLAGS}$cf_new_cflags"
13974
13975 fi
13976
13977 if test -n "$cf_new_cppflags" ; then
13978         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13979
13980 echo "${as_me:-configure}:13980: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13981
13982         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13983         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13984
13985 fi
13986
13987 if test -n "$cf_new_extra_cppflags" ; then
13988         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13989
13990 echo "${as_me:-configure}:13990: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13991
13992         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13993         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13994
13995 fi
13996
13997 done
13998
13999 fi
14000
14001 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
14002         echo "$as_me:14002: checking if _XOPEN_SOURCE really is set" >&5
14003 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
14004         cat >"conftest.$ac_ext" <<_ACEOF
14005 #line 14005 "configure"
14006 #include "confdefs.h"
14007 #include <stdlib.h>
14008 int
14009 main (void)
14010 {
14011
14012 #ifndef _XOPEN_SOURCE
14013 make an error
14014 #endif
14015   ;
14016   return 0;
14017 }
14018 _ACEOF
14019 rm -f "conftest.$ac_objext"
14020 if { (eval echo "$as_me:14020: \"$ac_compile\"") >&5
14021   (eval $ac_compile) 2>&5
14022   ac_status=$?
14023   echo "$as_me:14023: \$? = $ac_status" >&5
14024   (exit "$ac_status"); } &&
14025          { ac_try='test -s "conftest.$ac_objext"'
14026   { (eval echo "$as_me:14026: \"$ac_try\"") >&5
14027   (eval $ac_try) 2>&5
14028   ac_status=$?
14029   echo "$as_me:14029: \$? = $ac_status" >&5
14030   (exit "$ac_status"); }; }; then
14031   cf_XOPEN_SOURCE_set=yes
14032 else
14033   echo "$as_me: failed program was:" >&5
14034 cat "conftest.$ac_ext" >&5
14035 cf_XOPEN_SOURCE_set=no
14036 fi
14037 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14038         echo "$as_me:14038: result: $cf_XOPEN_SOURCE_set" >&5
14039 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14040         if test "$cf_XOPEN_SOURCE_set" = yes
14041         then
14042                 cat >"conftest.$ac_ext" <<_ACEOF
14043 #line 14043 "configure"
14044 #include "confdefs.h"
14045 #include <stdlib.h>
14046 int
14047 main (void)
14048 {
14049
14050 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14051 make an error
14052 #endif
14053   ;
14054   return 0;
14055 }
14056 _ACEOF
14057 rm -f "conftest.$ac_objext"
14058 if { (eval echo "$as_me:14058: \"$ac_compile\"") >&5
14059   (eval $ac_compile) 2>&5
14060   ac_status=$?
14061   echo "$as_me:14061: \$? = $ac_status" >&5
14062   (exit "$ac_status"); } &&
14063          { ac_try='test -s "conftest.$ac_objext"'
14064   { (eval echo "$as_me:14064: \"$ac_try\"") >&5
14065   (eval $ac_try) 2>&5
14066   ac_status=$?
14067   echo "$as_me:14067: \$? = $ac_status" >&5
14068   (exit "$ac_status"); }; }; then
14069   cf_XOPEN_SOURCE_set_ok=yes
14070 else
14071   echo "$as_me: failed program was:" >&5
14072 cat "conftest.$ac_ext" >&5
14073 cf_XOPEN_SOURCE_set_ok=no
14074 fi
14075 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14076                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14077                 then
14078                         { echo "$as_me:14078: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14079 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14080                 fi
14081         else
14082
14083 echo "$as_me:14083: checking if we should define _XOPEN_SOURCE" >&5
14084 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14085 if test "${cf_cv_xopen_source+set}" = set; then
14086   echo $ECHO_N "(cached) $ECHO_C" >&6
14087 else
14088
14089         cat >"conftest.$ac_ext" <<_ACEOF
14090 #line 14090 "configure"
14091 #include "confdefs.h"
14092
14093 #include <stdlib.h>
14094 #include <string.h>
14095 #include <sys/types.h>
14096
14097 int
14098 main (void)
14099 {
14100
14101 #ifndef _XOPEN_SOURCE
14102 make an error
14103 #endif
14104
14105   ;
14106   return 0;
14107 }
14108 _ACEOF
14109 rm -f "conftest.$ac_objext"
14110 if { (eval echo "$as_me:14110: \"$ac_compile\"") >&5
14111   (eval $ac_compile) 2>&5
14112   ac_status=$?
14113   echo "$as_me:14113: \$? = $ac_status" >&5
14114   (exit "$ac_status"); } &&
14115          { ac_try='test -s "conftest.$ac_objext"'
14116   { (eval echo "$as_me:14116: \"$ac_try\"") >&5
14117   (eval $ac_try) 2>&5
14118   ac_status=$?
14119   echo "$as_me:14119: \$? = $ac_status" >&5
14120   (exit "$ac_status"); }; }; then
14121   cf_cv_xopen_source=no
14122 else
14123   echo "$as_me: failed program was:" >&5
14124 cat "conftest.$ac_ext" >&5
14125 cf_save="$CPPFLAGS"
14126
14127         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14128         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14129
14130          cat >"conftest.$ac_ext" <<_ACEOF
14131 #line 14131 "configure"
14132 #include "confdefs.h"
14133
14134 #include <stdlib.h>
14135 #include <string.h>
14136 #include <sys/types.h>
14137
14138 int
14139 main (void)
14140 {
14141
14142 #ifndef _XOPEN_SOURCE
14143 make an error
14144 #endif
14145
14146   ;
14147   return 0;
14148 }
14149 _ACEOF
14150 rm -f "conftest.$ac_objext"
14151 if { (eval echo "$as_me:14151: \"$ac_compile\"") >&5
14152   (eval $ac_compile) 2>&5
14153   ac_status=$?
14154   echo "$as_me:14154: \$? = $ac_status" >&5
14155   (exit "$ac_status"); } &&
14156          { ac_try='test -s "conftest.$ac_objext"'
14157   { (eval echo "$as_me:14157: \"$ac_try\"") >&5
14158   (eval $ac_try) 2>&5
14159   ac_status=$?
14160   echo "$as_me:14160: \$? = $ac_status" >&5
14161   (exit "$ac_status"); }; }; then
14162   cf_cv_xopen_source=no
14163 else
14164   echo "$as_me: failed program was:" >&5
14165 cat "conftest.$ac_ext" >&5
14166 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14167 fi
14168 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14169                 CPPFLAGS="$cf_save"
14170
14171 fi
14172 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14173
14174 fi
14175 echo "$as_me:14175: result: $cf_cv_xopen_source" >&5
14176 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14177
14178 if test "$cf_cv_xopen_source" != no ; then
14179
14180 CFLAGS=`echo "$CFLAGS" | \
14181         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14182                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14183
14184 CPPFLAGS=`echo "$CPPFLAGS" | \
14185         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14186                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14187
14188         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14189
14190 for cf_add_cflags in $cf_temp_xopen_source
14191 do
14192         case "x$cf_add_cflags" in
14193         (x-[DU]*)
14194
14195 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14196 while true
14197 do
14198         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'`
14199         test "$CFLAGS" != "$cf_old_cflag" || break
14200
14201         CFLAGS="$cf_old_cflag"
14202 done
14203
14204 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14205 while true
14206 do
14207         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'`
14208         test "$CPPFLAGS" != "$cf_old_cflag" || break
14209
14210         CPPFLAGS="$cf_old_cflag"
14211 done
14212
14213                 ;;
14214         esac
14215
14216 cf_fix_cppflags=no
14217 cf_new_cflags=
14218 cf_new_cppflags=
14219 cf_new_extra_cppflags=
14220
14221 for cf_add_cflags in $cf_add_cflags
14222 do
14223 case "$cf_fix_cppflags" in
14224 (no)
14225         case "$cf_add_cflags" in
14226         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14227                 case "$cf_add_cflags" in
14228                 (-D*)
14229                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14230
14231                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14232                                 && test -z "${cf_tst_cflags}" \
14233                                 && cf_fix_cppflags=yes
14234
14235                         if test "$cf_fix_cppflags" = yes ; then
14236
14237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14239
14240                                 continue
14241                         elif test "${cf_tst_cflags}" = "\"'" ; then
14242
14243         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14244         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14245
14246                                 continue
14247                         fi
14248                         ;;
14249                 esac
14250                 case "$CPPFLAGS" in
14251                 (*$cf_add_cflags)
14252                         ;;
14253                 (*)
14254                         case "$cf_add_cflags" in
14255                         (-D*)
14256                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14257
14258 CPPFLAGS=`echo "$CPPFLAGS" | \
14259         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14260                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14261
14262                                 ;;
14263                         esac
14264
14265         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14266         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14267
14268                         ;;
14269                 esac
14270                 ;;
14271         (*)
14272
14273         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14274         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14275
14276                 ;;
14277         esac
14278         ;;
14279 (yes)
14280
14281         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14282         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14283
14284         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14285
14286         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14287                 && test -z "${cf_tst_cflags}" \
14288                 && cf_fix_cppflags=no
14289         ;;
14290 esac
14291 done
14292
14293 if test -n "$cf_new_cflags" ; then
14294
14295         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14296         CFLAGS="${CFLAGS}$cf_new_cflags"
14297
14298 fi
14299
14300 if test -n "$cf_new_cppflags" ; then
14301
14302         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14303         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14304
14305 fi
14306
14307 if test -n "$cf_new_extra_cppflags" ; then
14308
14309         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14310         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14311
14312 fi
14313
14314 done
14315
14316 fi
14317
14318         fi
14319 fi
14320 fi # cf_cv_posix_visible
14321
14322 # Check whether --enable-largefile or --disable-largefile was given.
14323 if test "${enable_largefile+set}" = set; then
14324   enableval="$enable_largefile"
14325
14326 fi;
14327 if test "$enable_largefile" != no; then
14328
14329   echo "$as_me:14329: checking for special C compiler options needed for large files" >&5
14330 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14331 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14332   echo $ECHO_N "(cached) $ECHO_C" >&6
14333 else
14334   ac_cv_sys_largefile_CC=no
14335      if test "$GCC" != yes; then
14336        ac_save_CC=$CC
14337        while :; do
14338          # IRIX 6.2 and later do not support large files by default,
14339          # so use the C compiler's -n32 option if that helps.
14340          cat >"conftest.$ac_ext" <<_ACEOF
14341 #line 14341 "configure"
14342 #include "confdefs.h"
14343 #include <sys/types.h>
14344  /* Check that off_t can represent 2**63 - 1 correctly.
14345     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14346     since some C++ compilers masquerading as C compilers
14347     incorrectly reject 9223372036854775807.  */
14348 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14349   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14350                        && LARGE_OFF_T % 2147483647 == 1)
14351                       ? 1 : -1];
14352 int
14353 main (void)
14354 {
14355
14356   ;
14357   return 0;
14358 }
14359 _ACEOF
14360          rm -f "conftest.$ac_objext"
14361 if { (eval echo "$as_me:14361: \"$ac_compile\"") >&5
14362   (eval $ac_compile) 2>&5
14363   ac_status=$?
14364   echo "$as_me:14364: \$? = $ac_status" >&5
14365   (exit "$ac_status"); } &&
14366          { ac_try='test -s "conftest.$ac_objext"'
14367   { (eval echo "$as_me:14367: \"$ac_try\"") >&5
14368   (eval $ac_try) 2>&5
14369   ac_status=$?
14370   echo "$as_me:14370: \$? = $ac_status" >&5
14371   (exit "$ac_status"); }; }; then
14372   break
14373 else
14374   echo "$as_me: failed program was:" >&5
14375 cat "conftest.$ac_ext" >&5
14376 fi
14377 rm -f "conftest.$ac_objext"
14378          CC="$CC -n32"
14379          rm -f "conftest.$ac_objext"
14380 if { (eval echo "$as_me:14380: \"$ac_compile\"") >&5
14381   (eval $ac_compile) 2>&5
14382   ac_status=$?
14383   echo "$as_me:14383: \$? = $ac_status" >&5
14384   (exit "$ac_status"); } &&
14385          { ac_try='test -s "conftest.$ac_objext"'
14386   { (eval echo "$as_me:14386: \"$ac_try\"") >&5
14387   (eval $ac_try) 2>&5
14388   ac_status=$?
14389   echo "$as_me:14389: \$? = $ac_status" >&5
14390   (exit "$ac_status"); }; }; then
14391   ac_cv_sys_largefile_CC=' -n32'; break
14392 else
14393   echo "$as_me: failed program was:" >&5
14394 cat "conftest.$ac_ext" >&5
14395 fi
14396 rm -f "conftest.$ac_objext"
14397          break
14398        done
14399        CC=$ac_save_CC
14400        rm -f "conftest.$ac_ext"
14401     fi
14402 fi
14403 echo "$as_me:14403: result: $ac_cv_sys_largefile_CC" >&5
14404 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14405   if test "$ac_cv_sys_largefile_CC" != no; then
14406     CC=$CC$ac_cv_sys_largefile_CC
14407   fi
14408
14409   echo "$as_me:14409: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14410 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14411 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14412   echo $ECHO_N "(cached) $ECHO_C" >&6
14413 else
14414   while :; do
14415   ac_cv_sys_file_offset_bits=no
14416   cat >"conftest.$ac_ext" <<_ACEOF
14417 #line 14417 "configure"
14418 #include "confdefs.h"
14419 #include <sys/types.h>
14420  /* Check that off_t can represent 2**63 - 1 correctly.
14421     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14422     since some C++ compilers masquerading as C compilers
14423     incorrectly reject 9223372036854775807.  */
14424 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14425   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14426                        && LARGE_OFF_T % 2147483647 == 1)
14427                       ? 1 : -1];
14428 int
14429 main (void)
14430 {
14431
14432   ;
14433   return 0;
14434 }
14435 _ACEOF
14436 rm -f "conftest.$ac_objext"
14437 if { (eval echo "$as_me:14437: \"$ac_compile\"") >&5
14438   (eval $ac_compile) 2>&5
14439   ac_status=$?
14440   echo "$as_me:14440: \$? = $ac_status" >&5
14441   (exit "$ac_status"); } &&
14442          { ac_try='test -s "conftest.$ac_objext"'
14443   { (eval echo "$as_me:14443: \"$ac_try\"") >&5
14444   (eval $ac_try) 2>&5
14445   ac_status=$?
14446   echo "$as_me:14446: \$? = $ac_status" >&5
14447   (exit "$ac_status"); }; }; then
14448   break
14449 else
14450   echo "$as_me: failed program was:" >&5
14451 cat "conftest.$ac_ext" >&5
14452 fi
14453 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14454   cat >"conftest.$ac_ext" <<_ACEOF
14455 #line 14455 "configure"
14456 #include "confdefs.h"
14457 #define _FILE_OFFSET_BITS 64
14458 #include <sys/types.h>
14459  /* Check that off_t can represent 2**63 - 1 correctly.
14460     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14461     since some C++ compilers masquerading as C compilers
14462     incorrectly reject 9223372036854775807.  */
14463 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14464   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14465                        && LARGE_OFF_T % 2147483647 == 1)
14466                       ? 1 : -1];
14467 int
14468 main (void)
14469 {
14470
14471   ;
14472   return 0;
14473 }
14474 _ACEOF
14475 rm -f "conftest.$ac_objext"
14476 if { (eval echo "$as_me:14476: \"$ac_compile\"") >&5
14477   (eval $ac_compile) 2>&5
14478   ac_status=$?
14479   echo "$as_me:14479: \$? = $ac_status" >&5
14480   (exit "$ac_status"); } &&
14481          { ac_try='test -s "conftest.$ac_objext"'
14482   { (eval echo "$as_me:14482: \"$ac_try\"") >&5
14483   (eval $ac_try) 2>&5
14484   ac_status=$?
14485   echo "$as_me:14485: \$? = $ac_status" >&5
14486   (exit "$ac_status"); }; }; then
14487   ac_cv_sys_file_offset_bits=64; break
14488 else
14489   echo "$as_me: failed program was:" >&5
14490 cat "conftest.$ac_ext" >&5
14491 fi
14492 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14493   break
14494 done
14495 fi
14496 echo "$as_me:14496: result: $ac_cv_sys_file_offset_bits" >&5
14497 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14498 if test "$ac_cv_sys_file_offset_bits" != no; then
14499
14500 cat >>confdefs.h <<EOF
14501 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14502 EOF
14503
14504 fi
14505 rm -rf conftest*
14506   echo "$as_me:14506: checking for _LARGE_FILES value needed for large files" >&5
14507 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14508 if test "${ac_cv_sys_large_files+set}" = set; then
14509   echo $ECHO_N "(cached) $ECHO_C" >&6
14510 else
14511   while :; do
14512   ac_cv_sys_large_files=no
14513   cat >"conftest.$ac_ext" <<_ACEOF
14514 #line 14514 "configure"
14515 #include "confdefs.h"
14516 #include <sys/types.h>
14517  /* Check that off_t can represent 2**63 - 1 correctly.
14518     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14519     since some C++ compilers masquerading as C compilers
14520     incorrectly reject 9223372036854775807.  */
14521 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14522   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14523                        && LARGE_OFF_T % 2147483647 == 1)
14524                       ? 1 : -1];
14525 int
14526 main (void)
14527 {
14528
14529   ;
14530   return 0;
14531 }
14532 _ACEOF
14533 rm -f "conftest.$ac_objext"
14534 if { (eval echo "$as_me:14534: \"$ac_compile\"") >&5
14535   (eval $ac_compile) 2>&5
14536   ac_status=$?
14537   echo "$as_me:14537: \$? = $ac_status" >&5
14538   (exit "$ac_status"); } &&
14539          { ac_try='test -s "conftest.$ac_objext"'
14540   { (eval echo "$as_me:14540: \"$ac_try\"") >&5
14541   (eval $ac_try) 2>&5
14542   ac_status=$?
14543   echo "$as_me:14543: \$? = $ac_status" >&5
14544   (exit "$ac_status"); }; }; then
14545   break
14546 else
14547   echo "$as_me: failed program was:" >&5
14548 cat "conftest.$ac_ext" >&5
14549 fi
14550 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14551   cat >"conftest.$ac_ext" <<_ACEOF
14552 #line 14552 "configure"
14553 #include "confdefs.h"
14554 #define _LARGE_FILES 1
14555 #include <sys/types.h>
14556  /* Check that off_t can represent 2**63 - 1 correctly.
14557     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14558     since some C++ compilers masquerading as C compilers
14559     incorrectly reject 9223372036854775807.  */
14560 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14561   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14562                        && LARGE_OFF_T % 2147483647 == 1)
14563                       ? 1 : -1];
14564 int
14565 main (void)
14566 {
14567
14568   ;
14569   return 0;
14570 }
14571 _ACEOF
14572 rm -f "conftest.$ac_objext"
14573 if { (eval echo "$as_me:14573: \"$ac_compile\"") >&5
14574   (eval $ac_compile) 2>&5
14575   ac_status=$?
14576   echo "$as_me:14576: \$? = $ac_status" >&5
14577   (exit "$ac_status"); } &&
14578          { ac_try='test -s "conftest.$ac_objext"'
14579   { (eval echo "$as_me:14579: \"$ac_try\"") >&5
14580   (eval $ac_try) 2>&5
14581   ac_status=$?
14582   echo "$as_me:14582: \$? = $ac_status" >&5
14583   (exit "$ac_status"); }; }; then
14584   ac_cv_sys_large_files=1; break
14585 else
14586   echo "$as_me: failed program was:" >&5
14587 cat "conftest.$ac_ext" >&5
14588 fi
14589 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14590   break
14591 done
14592 fi
14593 echo "$as_me:14593: result: $ac_cv_sys_large_files" >&5
14594 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14595 if test "$ac_cv_sys_large_files" != no; then
14596
14597 cat >>confdefs.h <<EOF
14598 #define _LARGE_FILES $ac_cv_sys_large_files
14599 EOF
14600
14601 fi
14602 rm -rf conftest*
14603 fi
14604
14605         if test "$enable_largefile" != no ; then
14606         echo "$as_me:14606: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14607 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14608 if test "${ac_cv_sys_largefile_source+set}" = set; then
14609   echo $ECHO_N "(cached) $ECHO_C" >&6
14610 else
14611   while :; do
14612   ac_cv_sys_largefile_source=no
14613   cat >"conftest.$ac_ext" <<_ACEOF
14614 #line 14614 "configure"
14615 #include "confdefs.h"
14616 #include <stdio.h>
14617 int
14618 main (void)
14619 {
14620 return !fseeko;
14621   ;
14622   return 0;
14623 }
14624 _ACEOF
14625 rm -f "conftest.$ac_objext"
14626 if { (eval echo "$as_me:14626: \"$ac_compile\"") >&5
14627   (eval $ac_compile) 2>&5
14628   ac_status=$?
14629   echo "$as_me:14629: \$? = $ac_status" >&5
14630   (exit "$ac_status"); } &&
14631          { ac_try='test -s "conftest.$ac_objext"'
14632   { (eval echo "$as_me:14632: \"$ac_try\"") >&5
14633   (eval $ac_try) 2>&5
14634   ac_status=$?
14635   echo "$as_me:14635: \$? = $ac_status" >&5
14636   (exit "$ac_status"); }; }; then
14637   break
14638 else
14639   echo "$as_me: failed program was:" >&5
14640 cat "conftest.$ac_ext" >&5
14641 fi
14642 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14643   cat >"conftest.$ac_ext" <<_ACEOF
14644 #line 14644 "configure"
14645 #include "confdefs.h"
14646 #define _LARGEFILE_SOURCE 1
14647 #include <stdio.h>
14648 int
14649 main (void)
14650 {
14651 return !fseeko;
14652   ;
14653   return 0;
14654 }
14655 _ACEOF
14656 rm -f "conftest.$ac_objext"
14657 if { (eval echo "$as_me:14657: \"$ac_compile\"") >&5
14658   (eval $ac_compile) 2>&5
14659   ac_status=$?
14660   echo "$as_me:14660: \$? = $ac_status" >&5
14661   (exit "$ac_status"); } &&
14662          { ac_try='test -s "conftest.$ac_objext"'
14663   { (eval echo "$as_me:14663: \"$ac_try\"") >&5
14664   (eval $ac_try) 2>&5
14665   ac_status=$?
14666   echo "$as_me:14666: \$? = $ac_status" >&5
14667   (exit "$ac_status"); }; }; then
14668   ac_cv_sys_largefile_source=1; break
14669 else
14670   echo "$as_me: failed program was:" >&5
14671 cat "conftest.$ac_ext" >&5
14672 fi
14673 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14674   break
14675 done
14676 fi
14677 echo "$as_me:14677: result: $ac_cv_sys_largefile_source" >&5
14678 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14679 if test "$ac_cv_sys_largefile_source" != no; then
14680
14681 cat >>confdefs.h <<EOF
14682 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14683 EOF
14684
14685 fi
14686 rm -rf conftest*
14687
14688 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14689 # in glibc 2.1.3, but that breaks too many other things.
14690 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14691 echo "$as_me:14691: checking for fseeko" >&5
14692 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14693 if test "${ac_cv_func_fseeko+set}" = set; then
14694   echo $ECHO_N "(cached) $ECHO_C" >&6
14695 else
14696   cat >"conftest.$ac_ext" <<_ACEOF
14697 #line 14697 "configure"
14698 #include "confdefs.h"
14699 #include <stdio.h>
14700 int
14701 main (void)
14702 {
14703 return fseeko && fseeko (stdin, 0, 0);
14704   ;
14705   return 0;
14706 }
14707 _ACEOF
14708 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14709 if { (eval echo "$as_me:14709: \"$ac_link\"") >&5
14710   (eval $ac_link) 2>&5
14711   ac_status=$?
14712   echo "$as_me:14712: \$? = $ac_status" >&5
14713   (exit "$ac_status"); } &&
14714          { ac_try='test -s "conftest$ac_exeext"'
14715   { (eval echo "$as_me:14715: \"$ac_try\"") >&5
14716   (eval $ac_try) 2>&5
14717   ac_status=$?
14718   echo "$as_me:14718: \$? = $ac_status" >&5
14719   (exit "$ac_status"); }; }; then
14720   ac_cv_func_fseeko=yes
14721 else
14722   echo "$as_me: failed program was:" >&5
14723 cat "conftest.$ac_ext" >&5
14724 ac_cv_func_fseeko=no
14725 fi
14726 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14727 fi
14728 echo "$as_me:14728: result: $ac_cv_func_fseeko" >&5
14729 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14730 if test $ac_cv_func_fseeko = yes; then
14731
14732 cat >>confdefs.h <<\EOF
14733 #define HAVE_FSEEKO 1
14734 EOF
14735
14736 fi
14737
14738         # Normally we would collect these definitions in the config.h,
14739         # but (like _XOPEN_SOURCE), some environments rely on having these
14740         # defined before any of the system headers are included.  Another
14741         # case comes up with C++, e.g., on AIX the compiler compiles the
14742         # header files by themselves before looking at the body files it is
14743         # told to compile.  For ncurses, those header files do not include
14744         # the config.h
14745         if test "$ac_cv_sys_large_files" != no
14746         then
14747
14748         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14749         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14750
14751         fi
14752         if test "$ac_cv_sys_largefile_source" != no
14753         then
14754
14755         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14756         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14757
14758         fi
14759         if test "$ac_cv_sys_file_offset_bits" != no
14760         then
14761
14762         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14763         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14764
14765         fi
14766
14767         echo "$as_me:14767: checking whether to use struct dirent64" >&5
14768 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14769 if test "${cf_cv_struct_dirent64+set}" = set; then
14770   echo $ECHO_N "(cached) $ECHO_C" >&6
14771 else
14772
14773                 cat >"conftest.$ac_ext" <<_ACEOF
14774 #line 14774 "configure"
14775 #include "confdefs.h"
14776
14777 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14778 #include <sys/types.h>
14779 #include <dirent.h>
14780
14781 int
14782 main (void)
14783 {
14784
14785                 /* if transitional largefile support is setup, this is true */
14786                 extern struct dirent64 * readdir(DIR *);
14787                 struct dirent64 *x = readdir((DIR *)0);
14788                 struct dirent *y = readdir((DIR *)0);
14789                 int z = x - y;
14790                 (void)z;
14791
14792   ;
14793   return 0;
14794 }
14795 _ACEOF
14796 rm -f "conftest.$ac_objext"
14797 if { (eval echo "$as_me:14797: \"$ac_compile\"") >&5
14798   (eval $ac_compile) 2>&5
14799   ac_status=$?
14800   echo "$as_me:14800: \$? = $ac_status" >&5
14801   (exit "$ac_status"); } &&
14802          { ac_try='test -s "conftest.$ac_objext"'
14803   { (eval echo "$as_me:14803: \"$ac_try\"") >&5
14804   (eval $ac_try) 2>&5
14805   ac_status=$?
14806   echo "$as_me:14806: \$? = $ac_status" >&5
14807   (exit "$ac_status"); }; }; then
14808   cf_cv_struct_dirent64=yes
14809 else
14810   echo "$as_me: failed program was:" >&5
14811 cat "conftest.$ac_ext" >&5
14812 cf_cv_struct_dirent64=no
14813 fi
14814 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14815
14816 fi
14817 echo "$as_me:14817: result: $cf_cv_struct_dirent64" >&5
14818 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14819         test "$cf_cv_struct_dirent64" = yes &&
14820 cat >>confdefs.h <<\EOF
14821 #define HAVE_STRUCT_DIRENT64 1
14822 EOF
14823
14824         fi
14825
14826 ### Enable compiling-in rcs id's
14827 echo "$as_me:14827: checking if RCS identifiers should be compiled-in" >&5
14828 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14829
14830 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14831 if test "${with_rcs_ids+set}" = set; then
14832   withval="$with_rcs_ids"
14833   with_rcs_ids=$withval
14834 else
14835   with_rcs_ids=no
14836 fi;
14837 echo "$as_me:14837: result: $with_rcs_ids" >&5
14838 echo "${ECHO_T}$with_rcs_ids" >&6
14839 test "$with_rcs_ids" = yes &&
14840 cat >>confdefs.h <<\EOF
14841 #define USE_RCS_IDS 1
14842 EOF
14843
14844 ###############################################################################
14845
14846 ### Note that some functions (such as const) are normally disabled anyway.
14847 echo "$as_me:14847: checking if you want to build with function extensions" >&5
14848 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14849
14850 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14851 if test "${enable_ext_funcs+set}" = set; then
14852   enableval="$enable_ext_funcs"
14853   with_ext_funcs=$enableval
14854 else
14855   with_ext_funcs=yes
14856 fi;
14857 echo "$as_me:14857: result: $with_ext_funcs" >&5
14858 echo "${ECHO_T}$with_ext_funcs" >&6
14859 if test "$with_ext_funcs" = yes ; then
14860         NCURSES_EXT_FUNCS=1
14861
14862 cat >>confdefs.h <<\EOF
14863 #define HAVE_USE_DEFAULT_COLORS 1
14864 EOF
14865
14866 cat >>confdefs.h <<\EOF
14867 #define NCURSES_EXT_FUNCS 1
14868 EOF
14869
14870 else
14871         NCURSES_EXT_FUNCS=0
14872 fi
14873
14874 ###   use option --enable-const to turn on use of const beyond that in XSI.
14875 echo "$as_me:14875: checking for extended use of const keyword" >&5
14876 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14877
14878 # Check whether --enable-const or --disable-const was given.
14879 if test "${enable_const+set}" = set; then
14880   enableval="$enable_const"
14881   with_ext_const=$enableval
14882 else
14883   with_ext_const=no
14884 fi;
14885 echo "$as_me:14885: result: $with_ext_const" >&5
14886 echo "${ECHO_T}$with_ext_const" >&6
14887 NCURSES_CONST='/*nothing*/'
14888 if test "$with_ext_const" = yes ; then
14889         NCURSES_CONST=const
14890 fi
14891
14892 ###############################################################################
14893 # These options are relatively safe to experiment with.
14894
14895 echo "$as_me:14895: checking if you want all development code" >&5
14896 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14897
14898 # Check whether --with-develop or --without-develop was given.
14899 if test "${with_develop+set}" = set; then
14900   withval="$with_develop"
14901   with_develop=$withval
14902 else
14903   with_develop=no
14904 fi;
14905 echo "$as_me:14905: result: $with_develop" >&5
14906 echo "${ECHO_T}$with_develop" >&6
14907
14908 ###############################################################################
14909 # These are just experimental, probably should not be in a package:
14910
14911 # This is still experimental (20080329), but should ultimately be moved to
14912 # the script-block --with-normal, etc.
14913
14914 echo "$as_me:14914: checking if you want to link with the pthread library" >&5
14915 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14916
14917 # Check whether --with-pthread or --without-pthread was given.
14918 if test "${with_pthread+set}" = set; then
14919   withval="$with_pthread"
14920   with_pthread=$withval
14921 else
14922   with_pthread=no
14923 fi;
14924 echo "$as_me:14924: result: $with_pthread" >&5
14925 echo "${ECHO_T}$with_pthread" >&6
14926
14927 if test "$with_pthread" != no ; then
14928         echo "$as_me:14928: checking for pthread.h" >&5
14929 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14930 if test "${ac_cv_header_pthread_h+set}" = set; then
14931   echo $ECHO_N "(cached) $ECHO_C" >&6
14932 else
14933   cat >"conftest.$ac_ext" <<_ACEOF
14934 #line 14934 "configure"
14935 #include "confdefs.h"
14936 #include <pthread.h>
14937 _ACEOF
14938 if { (eval echo "$as_me:14938: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14939   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14940   ac_status=$?
14941   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14942   rm -f conftest.er1
14943   cat conftest.err >&5
14944   echo "$as_me:14944: \$? = $ac_status" >&5
14945   (exit "$ac_status"); } >/dev/null; then
14946   if test -s conftest.err; then
14947     ac_cpp_err=$ac_c_preproc_warn_flag
14948   else
14949     ac_cpp_err=
14950   fi
14951 else
14952   ac_cpp_err=yes
14953 fi
14954 if test -z "$ac_cpp_err"; then
14955   ac_cv_header_pthread_h=yes
14956 else
14957   echo "$as_me: failed program was:" >&5
14958   cat "conftest.$ac_ext" >&5
14959   ac_cv_header_pthread_h=no
14960 fi
14961 rm -f conftest.err "conftest.$ac_ext"
14962 fi
14963 echo "$as_me:14963: result: $ac_cv_header_pthread_h" >&5
14964 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14965 if test "$ac_cv_header_pthread_h" = yes; then
14966
14967 cat >>confdefs.h <<\EOF
14968 #define HAVE_PTHREADS_H 1
14969 EOF
14970
14971         for cf_lib_pthread in pthread c_r
14972         do
14973             echo "$as_me:14973: checking if we can link with the $cf_lib_pthread library" >&5
14974 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14975             cf_save_LIBS="$LIBS"
14976
14977 cf_add_libs="$LIBS"
14978 # reverse order
14979 cf_add_0lib=
14980 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14981 # filter duplicates
14982 for cf_add_1lib in $cf_add_0lib; do
14983         for cf_add_2lib in $cf_add_libs; do
14984                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14985                         cf_add_1lib=
14986                         break
14987                 fi
14988         done
14989         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14990 done
14991 LIBS="$cf_add_libs"
14992
14993             cat >"conftest.$ac_ext" <<_ACEOF
14994 #line 14994 "configure"
14995 #include "confdefs.h"
14996
14997 #include <pthread.h>
14998
14999 int
15000 main (void)
15001 {
15002
15003                 int rc = pthread_create(0,0,0,0);
15004                 int r2 = pthread_mutexattr_settype(0, 0);
15005
15006   ;
15007   return 0;
15008 }
15009 _ACEOF
15010 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15011 if { (eval echo "$as_me:15011: \"$ac_link\"") >&5
15012   (eval $ac_link) 2>&5
15013   ac_status=$?
15014   echo "$as_me:15014: \$? = $ac_status" >&5
15015   (exit "$ac_status"); } &&
15016          { ac_try='test -s "conftest$ac_exeext"'
15017   { (eval echo "$as_me:15017: \"$ac_try\"") >&5
15018   (eval $ac_try) 2>&5
15019   ac_status=$?
15020   echo "$as_me:15020: \$? = $ac_status" >&5
15021   (exit "$ac_status"); }; }; then
15022   with_pthread=yes
15023 else
15024   echo "$as_me: failed program was:" >&5
15025 cat "conftest.$ac_ext" >&5
15026 with_pthread=no
15027 fi
15028 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15029             LIBS="$cf_save_LIBS"
15030             echo "$as_me:15030: result: $with_pthread" >&5
15031 echo "${ECHO_T}$with_pthread" >&6
15032             test "$with_pthread" = yes && break
15033         done
15034
15035         if test "$with_pthread" = yes ; then
15036
15037 cf_add_libs="$LIBS"
15038 # reverse order
15039 cf_add_0lib=
15040 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15041 # filter duplicates
15042 for cf_add_1lib in $cf_add_0lib; do
15043         for cf_add_2lib in $cf_add_libs; do
15044                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15045                         cf_add_1lib=
15046                         break
15047                 fi
15048         done
15049         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15050 done
15051 LIBS="$cf_add_libs"
15052
15053 cat >>confdefs.h <<\EOF
15054 #define HAVE_LIBPTHREADS 1
15055 EOF
15056
15057         else
15058             { { echo "$as_me:15058: error: Cannot link with pthread library" >&5
15059 echo "$as_me: error: Cannot link with pthread library" >&2;}
15060    { (exit 1); exit 1; }; }
15061         fi
15062
15063 fi
15064
15065 fi
15066
15067 echo "$as_me:15067: checking if you want to use weak-symbols for pthreads" >&5
15068 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15069
15070 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15071 if test "${enable_weak_symbols+set}" = set; then
15072   enableval="$enable_weak_symbols"
15073   use_weak_symbols=$withval
15074 else
15075   use_weak_symbols=no
15076 fi;
15077 echo "$as_me:15077: result: $use_weak_symbols" >&5
15078 echo "${ECHO_T}$use_weak_symbols" >&6
15079 if test "$use_weak_symbols" = yes ; then
15080
15081 echo "$as_me:15081: checking if $CC supports weak symbols" >&5
15082 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15083 if test "${cf_cv_weak_symbols+set}" = set; then
15084   echo $ECHO_N "(cached) $ECHO_C" >&6
15085 else
15086
15087 cat >"conftest.$ac_ext" <<_ACEOF
15088 #line 15088 "configure"
15089 #include "confdefs.h"
15090
15091 #include <stdio.h>
15092 int
15093 main (void)
15094 {
15095
15096 #if defined(__GNUC__)
15097 #  if defined __USE_ISOC99
15098 #    define _cat_pragma(exp)    _Pragma(#exp)
15099 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15100 #  else
15101 #    define _weak_pragma(exp)
15102 #  endif
15103 #  define _declare(name)        __extension__ extern __typeof__(name) name
15104 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15105 #endif
15106
15107 weak_symbol(fopen);
15108
15109   ;
15110   return 0;
15111 }
15112 _ACEOF
15113 rm -f "conftest.$ac_objext"
15114 if { (eval echo "$as_me:15114: \"$ac_compile\"") >&5
15115   (eval $ac_compile) 2>&5
15116   ac_status=$?
15117   echo "$as_me:15117: \$? = $ac_status" >&5
15118   (exit "$ac_status"); } &&
15119          { ac_try='test -s "conftest.$ac_objext"'
15120   { (eval echo "$as_me:15120: \"$ac_try\"") >&5
15121   (eval $ac_try) 2>&5
15122   ac_status=$?
15123   echo "$as_me:15123: \$? = $ac_status" >&5
15124   (exit "$ac_status"); }; }; then
15125   cf_cv_weak_symbols=yes
15126 else
15127   echo "$as_me: failed program was:" >&5
15128 cat "conftest.$ac_ext" >&5
15129 cf_cv_weak_symbols=no
15130 fi
15131 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15132
15133 fi
15134 echo "$as_me:15134: result: $cf_cv_weak_symbols" >&5
15135 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15136
15137 else
15138         cf_cv_weak_symbols=no
15139 fi
15140
15141 if test $cf_cv_weak_symbols = yes ; then
15142
15143 cat >>confdefs.h <<\EOF
15144 #define USE_WEAK_SYMBOLS 1
15145 EOF
15146
15147 fi
15148
15149 PTHREAD=
15150 if test "$with_pthread" = "yes" ; then
15151
15152 cat >>confdefs.h <<\EOF
15153 #define USE_PTHREADS 1
15154 EOF
15155
15156         enable_reentrant=yes
15157         if test $cf_cv_weak_symbols = yes ; then
15158                 PTHREAD=-lpthread
15159         fi
15160 fi
15161
15162 # OpenSUSE is installing ncurses6, using reentrant option.
15163 echo "$as_me:15163: checking for _nc_TABSIZE" >&5
15164 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15165 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15166   echo $ECHO_N "(cached) $ECHO_C" >&6
15167 else
15168   cat >"conftest.$ac_ext" <<_ACEOF
15169 #line 15169 "configure"
15170 #include "confdefs.h"
15171 #define _nc_TABSIZE autoconf_temporary
15172 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15173 #undef _nc_TABSIZE
15174
15175 #ifdef __cplusplus
15176 extern "C"
15177 #endif
15178
15179 /* We use char because int might match the return type of a gcc2
15180    builtin and then its argument prototype would still apply.  */
15181 char _nc_TABSIZE (void);
15182
15183 int
15184 main (void)
15185 {
15186
15187 /* The GNU C library defines stubs for functions which it implements
15188     to always fail with ENOSYS.  Some functions are actually named
15189     something starting with __ and the normal name is an alias.  */
15190 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15191 #error found stub for _nc_TABSIZE
15192 #endif
15193
15194         return _nc_TABSIZE ();
15195   ;
15196   return 0;
15197 }
15198 _ACEOF
15199 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15200 if { (eval echo "$as_me:15200: \"$ac_link\"") >&5
15201   (eval $ac_link) 2>&5
15202   ac_status=$?
15203   echo "$as_me:15203: \$? = $ac_status" >&5
15204   (exit "$ac_status"); } &&
15205          { ac_try='test -s "conftest$ac_exeext"'
15206   { (eval echo "$as_me:15206: \"$ac_try\"") >&5
15207   (eval $ac_try) 2>&5
15208   ac_status=$?
15209   echo "$as_me:15209: \$? = $ac_status" >&5
15210   (exit "$ac_status"); }; }; then
15211   ac_cv_func__nc_TABSIZE=yes
15212 else
15213   echo "$as_me: failed program was:" >&5
15214 cat "conftest.$ac_ext" >&5
15215 ac_cv_func__nc_TABSIZE=no
15216 fi
15217 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15218 fi
15219 echo "$as_me:15219: result: $ac_cv_func__nc_TABSIZE" >&5
15220 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15221 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15222   assume_reentrant=yes
15223 else
15224   assume_reentrant=no
15225 fi
15226
15227 # Reentrant code has to be opaque; there's little advantage to making ncurses
15228 # opaque outside of that, so there is no --enable-opaque option.  We can use
15229 # this option without --with-pthreads, but this will be always set for
15230 # pthreads.
15231 echo "$as_me:15231: checking if you want experimental reentrant code" >&5
15232 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15233
15234 # Check whether --enable-reentrant or --disable-reentrant was given.
15235 if test "${enable_reentrant+set}" = set; then
15236   enableval="$enable_reentrant"
15237   with_reentrant=$enableval
15238 else
15239   with_reentrant=$assume_reentrant
15240 fi;
15241 echo "$as_me:15241: result: $with_reentrant" >&5
15242 echo "${ECHO_T}$with_reentrant" >&6
15243 if test "$with_reentrant" = yes ; then
15244         cf_cv_enable_reentrant=1
15245         if test $cf_cv_weak_symbols = yes ; then
15246
15247 # remove pthread library from $LIBS
15248 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15249
15250         elif test "$assume_reentrant" = no ; then
15251                 LIB_SUFFIX="t${LIB_SUFFIX}"
15252         fi
15253
15254 cat >>confdefs.h <<\EOF
15255 #define USE_REENTRANT 1
15256 EOF
15257
15258 else
15259         cf_cv_enable_reentrant=0
15260 fi
15261
15262 ### Allow using a different wrap-prefix
15263 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15264         echo "$as_me:15264: checking for prefix used to wrap public variables" >&5
15265 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15266
15267 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15268 if test "${with_wrap_prefix+set}" = set; then
15269   withval="$with_wrap_prefix"
15270   NCURSES_WRAP_PREFIX=$withval
15271 else
15272   NCURSES_WRAP_PREFIX=_nc_
15273 fi;
15274         echo "$as_me:15274: result: $NCURSES_WRAP_PREFIX" >&5
15275 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15276 else
15277         NCURSES_WRAP_PREFIX=_nc_
15278 fi
15279
15280 cat >>confdefs.h <<EOF
15281 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15282 EOF
15283
15284 ###############################################################################
15285
15286 ###     use option --disable-echo to suppress full display compiling commands
15287
15288 echo "$as_me:15288: checking if you want to see long compiling messages" >&5
15289 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15290
15291 # Check whether --enable-echo or --disable-echo was given.
15292 if test "${enable_echo+set}" = set; then
15293   enableval="$enable_echo"
15294   test "$enableval" != no && enableval=yes
15295         if test "$enableval" != "yes" ; then
15296
15297         ECHO_LT='--silent'
15298         ECHO_LD='@echo linking $@;'
15299         RULE_CC='@echo compiling $<'
15300         SHOW_CC='@echo compiling $@'
15301         ECHO_CC='@'
15302
15303         else
15304
15305         ECHO_LT=''
15306         ECHO_LD=''
15307         RULE_CC=''
15308         SHOW_CC=''
15309         ECHO_CC=''
15310
15311         fi
15312 else
15313   enableval=yes
15314
15315         ECHO_LT=''
15316         ECHO_LD=''
15317         RULE_CC=''
15318         SHOW_CC=''
15319         ECHO_CC=''
15320
15321 fi;
15322 echo "$as_me:15322: result: $enableval" >&5
15323 echo "${ECHO_T}$enableval" >&6
15324
15325 echo "$as_me:15325: checking if you want to use C11 _Noreturn feature" >&5
15326 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15327
15328 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15329 if test "${enable_stdnoreturn+set}" = set; then
15330   enableval="$enable_stdnoreturn"
15331   test "$enableval" != yes && enableval=no
15332         if test "$enableval" != "no" ; then
15333     enable_stdnoreturn=yes
15334         else
15335                 enable_stdnoreturn=no
15336         fi
15337 else
15338   enableval=no
15339         enable_stdnoreturn=no
15340
15341 fi;
15342 echo "$as_me:15342: result: $enable_stdnoreturn" >&5
15343 echo "${ECHO_T}$enable_stdnoreturn" >&6
15344
15345 if test $enable_stdnoreturn = yes; then
15346 echo "$as_me:15346: checking for C11 _Noreturn feature" >&5
15347 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15348 if test "${cf_cv_c11_noreturn+set}" = set; then
15349   echo $ECHO_N "(cached) $ECHO_C" >&6
15350 else
15351   cat >"conftest.$ac_ext" <<_ACEOF
15352 #line 15352 "configure"
15353 #include "confdefs.h"
15354
15355 #include <stdio.h>
15356 #include <stdlib.h>
15357 #include <stdnoreturn.h>
15358 static _Noreturn void giveup(void) { exit(0); }
15359
15360 int
15361 main (void)
15362 {
15363 if (feof(stdin)) giveup()
15364   ;
15365   return 0;
15366 }
15367 _ACEOF
15368 rm -f "conftest.$ac_objext"
15369 if { (eval echo "$as_me:15369: \"$ac_compile\"") >&5
15370   (eval $ac_compile) 2>&5
15371   ac_status=$?
15372   echo "$as_me:15372: \$? = $ac_status" >&5
15373   (exit "$ac_status"); } &&
15374          { ac_try='test -s "conftest.$ac_objext"'
15375   { (eval echo "$as_me:15375: \"$ac_try\"") >&5
15376   (eval $ac_try) 2>&5
15377   ac_status=$?
15378   echo "$as_me:15378: \$? = $ac_status" >&5
15379   (exit "$ac_status"); }; }; then
15380   cf_cv_c11_noreturn=yes
15381 else
15382   echo "$as_me: failed program was:" >&5
15383 cat "conftest.$ac_ext" >&5
15384 cf_cv_c11_noreturn=no
15385 fi
15386 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15387
15388 fi
15389 echo "$as_me:15389: result: $cf_cv_c11_noreturn" >&5
15390 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15391 else
15392         cf_cv_c11_noreturn=no,
15393 fi
15394
15395 if test "$cf_cv_c11_noreturn" = yes; then
15396
15397 cat >>confdefs.h <<\EOF
15398 #define HAVE_STDNORETURN_H 1
15399 EOF
15400
15401 cat >>confdefs.h <<EOF
15402 #define STDC_NORETURN _Noreturn
15403 EOF
15404
15405         HAVE_STDNORETURN_H=1
15406 else
15407         HAVE_STDNORETURN_H=0
15408 fi
15409
15410 if test "$GCC" = yes || test "$GXX" = yes
15411 then
15412
15413 if test "$GCC" = yes || test "$GXX" = yes
15414 then
15415         case $CFLAGS in
15416         (*-Werror=*)
15417                 cf_temp_flags=
15418                 for cf_temp_scan in $CFLAGS
15419                 do
15420                         case "x$cf_temp_scan" in
15421                         (x-Werror=format*)
15422
15423         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15424         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15425
15426                                 ;;
15427                         (x-Werror=*)
15428
15429         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15430         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15431
15432                                 ;;
15433                         (*)
15434
15435         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15436         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15437
15438                                 ;;
15439                         esac
15440                 done
15441                 if test "x$CFLAGS" != "x$cf_temp_flags"
15442                 then
15443                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15444
15445 echo "${as_me:-configure}:15445: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15446
15447                         CFLAGS="$cf_temp_flags"
15448                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15449
15450 echo "${as_me:-configure}:15450: testing ... fixed $CFLAGS ..." 1>&5
15451
15452                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15453
15454 echo "${as_me:-configure}:15454: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15455
15456                 fi
15457                 ;;
15458         esac
15459 fi
15460
15461 if test "$GCC" = yes || test "$GXX" = yes
15462 then
15463         case $CPPFLAGS in
15464         (*-Werror=*)
15465                 cf_temp_flags=
15466                 for cf_temp_scan in $CPPFLAGS
15467                 do
15468                         case "x$cf_temp_scan" in
15469                         (x-Werror=format*)
15470
15471         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15472         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15473
15474                                 ;;
15475                         (x-Werror=*)
15476
15477         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15478         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15479
15480                                 ;;
15481                         (*)
15482
15483         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15484         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15485
15486                                 ;;
15487                         esac
15488                 done
15489                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15490                 then
15491                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15492
15493 echo "${as_me:-configure}:15493: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15494
15495                         CPPFLAGS="$cf_temp_flags"
15496                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15497
15498 echo "${as_me:-configure}:15498: testing ... fixed $CPPFLAGS ..." 1>&5
15499
15500                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15501
15502 echo "${as_me:-configure}:15502: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15503
15504                 fi
15505                 ;;
15506         esac
15507 fi
15508
15509 if test "$GCC" = yes || test "$GXX" = yes
15510 then
15511         case $LDFLAGS in
15512         (*-Werror=*)
15513                 cf_temp_flags=
15514                 for cf_temp_scan in $LDFLAGS
15515                 do
15516                         case "x$cf_temp_scan" in
15517                         (x-Werror=format*)
15518
15519         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15520         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15521
15522                                 ;;
15523                         (x-Werror=*)
15524
15525         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15526         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15527
15528                                 ;;
15529                         (*)
15530
15531         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15532         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15533
15534                                 ;;
15535                         esac
15536                 done
15537                 if test "x$LDFLAGS" != "x$cf_temp_flags"
15538                 then
15539                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15540
15541 echo "${as_me:-configure}:15541: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15542
15543                         LDFLAGS="$cf_temp_flags"
15544                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15545
15546 echo "${as_me:-configure}:15546: testing ... fixed $LDFLAGS ..." 1>&5
15547
15548                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15549
15550 echo "${as_me:-configure}:15550: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15551
15552                 fi
15553                 ;;
15554         esac
15555 fi
15556
15557 echo "$as_me:15557: checking if you want to turn on gcc warnings" >&5
15558 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15559
15560 # Check whether --enable-warnings or --disable-warnings was given.
15561 if test "${enable_warnings+set}" = set; then
15562   enableval="$enable_warnings"
15563   test "$enableval" != yes && enableval=no
15564         if test "$enableval" != "no" ; then
15565     enable_warnings=yes
15566         else
15567                 enable_warnings=no
15568         fi
15569 else
15570   enableval=no
15571         enable_warnings=no
15572
15573 fi;
15574 echo "$as_me:15574: result: $enable_warnings" >&5
15575 echo "${ECHO_T}$enable_warnings" >&6
15576 if test "$enable_warnings" = "yes"
15577 then
15578
15579 if test "x$have_x" = xyes; then
15580
15581 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15582 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15583 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15584 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15585 for cf_X_CFLAGS in $X_CFLAGS
15586 do
15587         case "x$cf_X_CFLAGS" in
15588         x-[IUD]*)
15589                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15590                 ;;
15591         *)
15592                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15593                 ;;
15594         esac
15595 done
15596
15597 cat >"conftest.$ac_ext" <<_ACEOF
15598 #line 15598 "configure"
15599 #include "confdefs.h"
15600
15601 #include <stdlib.h>
15602 #include <X11/Intrinsic.h>
15603
15604 int
15605 main (void)
15606 {
15607 String foo = malloc(1); free((void*)foo)
15608   ;
15609   return 0;
15610 }
15611 _ACEOF
15612 rm -f "conftest.$ac_objext"
15613 if { (eval echo "$as_me:15613: \"$ac_compile\"") >&5
15614   (eval $ac_compile) 2>&5
15615   ac_status=$?
15616   echo "$as_me:15616: \$? = $ac_status" >&5
15617   (exit "$ac_status"); } &&
15618          { ac_try='test -s "conftest.$ac_objext"'
15619   { (eval echo "$as_me:15619: \"$ac_try\"") >&5
15620   (eval $ac_try) 2>&5
15621   ac_status=$?
15622   echo "$as_me:15622: \$? = $ac_status" >&5
15623   (exit "$ac_status"); }; }; then
15624
15625 echo "$as_me:15625: checking for X11/Xt const-feature" >&5
15626 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15627 if test "${cf_cv_const_x_string+set}" = set; then
15628   echo $ECHO_N "(cached) $ECHO_C" >&6
15629 else
15630
15631         cat >"conftest.$ac_ext" <<_ACEOF
15632 #line 15632 "configure"
15633 #include "confdefs.h"
15634
15635 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15636 #undef  XTSTRINGDEFINES /* X11R5 and later */
15637 #include <stdlib.h>
15638 #include <X11/Intrinsic.h>
15639
15640 int
15641 main (void)
15642 {
15643 String foo = malloc(1); *foo = 0
15644   ;
15645   return 0;
15646 }
15647 _ACEOF
15648 rm -f "conftest.$ac_objext"
15649 if { (eval echo "$as_me:15649: \"$ac_compile\"") >&5
15650   (eval $ac_compile) 2>&5
15651   ac_status=$?
15652   echo "$as_me:15652: \$? = $ac_status" >&5
15653   (exit "$ac_status"); } &&
15654          { ac_try='test -s "conftest.$ac_objext"'
15655   { (eval echo "$as_me:15655: \"$ac_try\"") >&5
15656   (eval $ac_try) 2>&5
15657   ac_status=$?
15658   echo "$as_me:15658: \$? = $ac_status" >&5
15659   (exit "$ac_status"); }; }; then
15660
15661                         cf_cv_const_x_string=no
15662
15663 else
15664   echo "$as_me: failed program was:" >&5
15665 cat "conftest.$ac_ext" >&5
15666
15667                         cf_cv_const_x_string=yes
15668
15669 fi
15670 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15671
15672 fi
15673 echo "$as_me:15673: result: $cf_cv_const_x_string" >&5
15674 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15675
15676 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15677 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15678 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15679
15680 case "$cf_cv_const_x_string" in
15681 (no)
15682
15683         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15684         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15685
15686         ;;
15687 (*)
15688
15689         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15690         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15691
15692         ;;
15693 esac
15694
15695 else
15696   echo "$as_me: failed program was:" >&5
15697 cat "conftest.$ac_ext" >&5
15698 fi
15699 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15700  fi
15701 cat > "conftest.$ac_ext" <<EOF
15702 #line 15702 "${as_me:-configure}"
15703 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15704 EOF
15705 if test "$INTEL_COMPILER" = yes
15706 then
15707 # The "-wdXXX" options suppress warnings:
15708 # remark #1419: external declaration in primary source file
15709 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15710 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15711 # remark #193: zero used for undefined preprocessing identifier
15712 # remark #593: variable "curs_sb_left_arrow" was set but never used
15713 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15714 # remark #869: parameter "tw" was never referenced
15715 # remark #981: operands are evaluated in unspecified order
15716 # warning #279: controlling expression is constant
15717
15718         { echo "$as_me:15718: checking for $CC warning options..." >&5
15719 echo "$as_me: checking for $CC warning options..." >&6;}
15720         cf_save_CFLAGS="$CFLAGS"
15721         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15722         for cf_opt in \
15723                 wd1419 \
15724                 wd1683 \
15725                 wd1684 \
15726                 wd193 \
15727                 wd593 \
15728                 wd279 \
15729                 wd810 \
15730                 wd869 \
15731                 wd981
15732         do
15733                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15734                 if { (eval echo "$as_me:15734: \"$ac_compile\"") >&5
15735   (eval $ac_compile) 2>&5
15736   ac_status=$?
15737   echo "$as_me:15737: \$? = $ac_status" >&5
15738   (exit "$ac_status"); }; then
15739                         test -n "$verbose" && echo "$as_me:15739: result: ... -$cf_opt" >&5
15740 echo "${ECHO_T}... -$cf_opt" >&6
15741                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15742                 fi
15743         done
15744         CFLAGS="$cf_save_CFLAGS"
15745 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15746 then
15747         { echo "$as_me:15747: checking for $CC warning options..." >&5
15748 echo "$as_me: checking for $CC warning options..." >&6;}
15749         cf_save_CFLAGS="$CFLAGS"
15750         cf_warn_CONST=""
15751         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15752         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15753         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15754         for cf_opt in W Wall \
15755                 Wbad-function-cast \
15756                 Wcast-align \
15757                 Wcast-qual \
15758                 Wdeclaration-after-statement \
15759                 Wextra \
15760                 Winline \
15761                 Wmissing-declarations \
15762                 Wmissing-prototypes \
15763                 Wnested-externs \
15764                 Wpointer-arith \
15765                 Wshadow \
15766                 Wstrict-prototypes \
15767                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15768         do
15769                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15770                 if { (eval echo "$as_me:15770: \"$ac_compile\"") >&5
15771   (eval $ac_compile) 2>&5
15772   ac_status=$?
15773   echo "$as_me:15773: \$? = $ac_status" >&5
15774   (exit "$ac_status"); }; then
15775                         test -n "$verbose" && echo "$as_me:15775: result: ... -$cf_opt" >&5
15776 echo "${ECHO_T}... -$cf_opt" >&6
15777                         case "$cf_opt" in
15778                         (Winline)
15779                                 case "$GCC_VERSION" in
15780                                 ([34].*)
15781                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15782
15783 echo "${as_me:-configure}:15783: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15784
15785                                         continue;;
15786                                 esac
15787                                 ;;
15788                         (Wpointer-arith)
15789                                 case "$GCC_VERSION" in
15790                                 ([12].*)
15791                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15792
15793 echo "${as_me:-configure}:15793: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15794
15795                                         continue;;
15796                                 esac
15797                                 ;;
15798                         esac
15799                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15800                 fi
15801         done
15802         CFLAGS="$cf_save_CFLAGS"
15803 fi
15804 rm -rf ./conftest*
15805
15806 fi
15807
15808 if test "$GCC" = yes || test "$GXX" = yes
15809 then
15810 cat > conftest.i <<EOF
15811 #ifndef GCC_PRINTF
15812 #define GCC_PRINTF 0
15813 #endif
15814 #ifndef GCC_SCANF
15815 #define GCC_SCANF 0
15816 #endif
15817 #ifndef GCC_NORETURN
15818 #define GCC_NORETURN /* nothing */
15819 #endif
15820 #ifndef GCC_UNUSED
15821 #define GCC_UNUSED /* nothing */
15822 #endif
15823 EOF
15824 if test "$GCC" = yes
15825 then
15826         { echo "$as_me:15826: checking for $CC __attribute__ directives..." >&5
15827 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15828 cat > "conftest.$ac_ext" <<EOF
15829 #line 15829 "${as_me:-configure}"
15830 #include <stdio.h>
15831 #include "confdefs.h"
15832 #include "conftest.h"
15833 #include "conftest.i"
15834 #if     GCC_PRINTF
15835 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15836 #else
15837 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15838 #endif
15839 #if     GCC_SCANF
15840 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15841 #else
15842 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15843 #endif
15844 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15845 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15846 extern GCC_NORETURN void foo(void);
15847 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15848 EOF
15849         cf_printf_attribute=no
15850         cf_scanf_attribute=no
15851         for cf_attribute in scanf printf unused noreturn
15852         do
15853
15854 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15855
15856                 cf_directive="__attribute__(($cf_attribute))"
15857                 echo "checking for $CC $cf_directive" 1>&5
15858
15859                 case "$cf_attribute" in
15860                 (printf)
15861                         cf_printf_attribute=yes
15862                         cat >conftest.h <<EOF
15863 #define GCC_$cf_ATTRIBUTE 1
15864 EOF
15865                         ;;
15866                 (scanf)
15867                         cf_scanf_attribute=yes
15868                         cat >conftest.h <<EOF
15869 #define GCC_$cf_ATTRIBUTE 1
15870 EOF
15871                         ;;
15872                 (*)
15873                         cat >conftest.h <<EOF
15874 #define GCC_$cf_ATTRIBUTE $cf_directive
15875 EOF
15876                         ;;
15877                 esac
15878
15879                 if { (eval echo "$as_me:15879: \"$ac_compile\"") >&5
15880   (eval $ac_compile) 2>&5
15881   ac_status=$?
15882   echo "$as_me:15882: \$? = $ac_status" >&5
15883   (exit "$ac_status"); }; then
15884                         test -n "$verbose" && echo "$as_me:15884: result: ... $cf_attribute" >&5
15885 echo "${ECHO_T}... $cf_attribute" >&6
15886                         cat conftest.h >>confdefs.h
15887                         case "$cf_attribute" in
15888                         (noreturn)
15889
15890 cat >>confdefs.h <<EOF
15891 #define GCC_NORETURN $cf_directive
15892 EOF
15893
15894                                 ;;
15895                         (printf)
15896                                 cf_value='/* nothing */'
15897                                 if test "$cf_printf_attribute" != no ; then
15898                                         cf_value='__attribute__((format(printf,fmt,var)))'
15899
15900 cat >>confdefs.h <<\EOF
15901 #define GCC_PRINTF 1
15902 EOF
15903
15904                                 fi
15905
15906 cat >>confdefs.h <<EOF
15907 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15908 EOF
15909
15910                                 ;;
15911                         (scanf)
15912                                 cf_value='/* nothing */'
15913                                 if test "$cf_scanf_attribute" != no ; then
15914                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15915
15916 cat >>confdefs.h <<\EOF
15917 #define GCC_SCANF 1
15918 EOF
15919
15920                                 fi
15921
15922 cat >>confdefs.h <<EOF
15923 #define GCC_SCANFLIKE(fmt,var) $cf_value
15924 EOF
15925
15926                                 ;;
15927                         (unused)
15928
15929 cat >>confdefs.h <<EOF
15930 #define GCC_UNUSED $cf_directive
15931 EOF
15932
15933                                 ;;
15934                         esac
15935                 fi
15936         done
15937 else
15938         ${FGREP-fgrep} define conftest.i >>confdefs.h
15939 fi
15940 rm -rf ./conftest*
15941 fi
15942
15943 fi
15944
15945 if test "x$enable_warnings" = "xyes"; then
15946
15947         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
15948
15949 fi
15950
15951 ###     use option --enable-assertions to turn on generation of assertion code
15952 echo "$as_me:15952: checking if you want to enable runtime assertions" >&5
15953 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15954
15955 # Check whether --enable-assertions or --disable-assertions was given.
15956 if test "${enable_assertions+set}" = set; then
15957   enableval="$enable_assertions"
15958   with_assertions=$enableval
15959 else
15960   with_assertions=no
15961 fi;
15962 echo "$as_me:15962: result: $with_assertions" >&5
15963 echo "${ECHO_T}$with_assertions" >&6
15964 if test -n "$GCC"
15965 then
15966         if test "$with_assertions" = no
15967         then
15968                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15969         else
15970
15971         ADAFLAGS="$ADAFLAGS -gnata"
15972
15973         fi
15974 fi
15975
15976 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15977
15978 cat >>confdefs.h <<\EOF
15979 #define HAVE_NC_ALLOC_H 1
15980 EOF
15981
15982 ###     use option --enable-expanded to generate certain macros as functions
15983
15984 # Check whether --enable-expanded or --disable-expanded was given.
15985 if test "${enable_expanded+set}" = set; then
15986   enableval="$enable_expanded"
15987   test "$enableval" = yes &&
15988 cat >>confdefs.h <<\EOF
15989 #define NCURSES_EXPANDED 1
15990 EOF
15991
15992 fi;
15993
15994 ###     use option --disable-macros to suppress macros in favor of functions
15995
15996 # Check whether --enable-macros or --disable-macros was given.
15997 if test "${enable_macros+set}" = set; then
15998   enableval="$enable_macros"
15999   test "$enableval" = no &&
16000 cat >>confdefs.h <<\EOF
16001 #define NCURSES_NOMACROS 1
16002 EOF
16003
16004 fi;
16005
16006 # Normally we only add trace() to the debug-library.  Allow this to be
16007 # extended to all models of the ncurses library:
16008 cf_all_traces=no
16009 case "$CFLAGS $CPPFLAGS" in
16010 (*-DTRACE*)
16011         cf_all_traces=yes
16012         ;;
16013 esac
16014
16015 echo "$as_me:16015: checking whether to add trace feature to all models" >&5
16016 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16017
16018 # Check whether --with-trace or --without-trace was given.
16019 if test "${with_trace+set}" = set; then
16020   withval="$with_trace"
16021   cf_with_trace=$withval
16022 else
16023   cf_with_trace=$cf_all_traces
16024 fi;
16025 echo "$as_me:16025: result: $cf_with_trace" >&5
16026 echo "${ECHO_T}$cf_with_trace" >&6
16027
16028 if test "$cf_with_trace" = yes ; then
16029         ADA_TRACE=TRUE
16030
16031 cf_fix_cppflags=no
16032 cf_new_cflags=
16033 cf_new_cppflags=
16034 cf_new_extra_cppflags=
16035
16036 for cf_add_cflags in -DTRACE
16037 do
16038 case "$cf_fix_cppflags" in
16039 (no)
16040         case "$cf_add_cflags" in
16041         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16042                 case "$cf_add_cflags" in
16043                 (-D*)
16044                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16045
16046                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16047                                 && test -z "${cf_tst_cflags}" \
16048                                 && cf_fix_cppflags=yes
16049
16050                         if test "$cf_fix_cppflags" = yes ; then
16051
16052         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16053         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16054
16055                                 continue
16056                         elif test "${cf_tst_cflags}" = "\"'" ; then
16057
16058         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16059         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16060
16061                                 continue
16062                         fi
16063                         ;;
16064                 esac
16065                 case "$CPPFLAGS" in
16066                 (*$cf_add_cflags)
16067                         ;;
16068                 (*)
16069                         case "$cf_add_cflags" in
16070                         (-D*)
16071                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16072
16073 CPPFLAGS=`echo "$CPPFLAGS" | \
16074         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16075                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16076
16077                                 ;;
16078                         esac
16079
16080         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16081         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16082
16083                         ;;
16084                 esac
16085                 ;;
16086         (*)
16087
16088         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16089         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16090
16091                 ;;
16092         esac
16093         ;;
16094 (yes)
16095
16096         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16097         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16098
16099         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16100
16101         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16102                 && test -z "${cf_tst_cflags}" \
16103                 && cf_fix_cppflags=no
16104         ;;
16105 esac
16106 done
16107
16108 if test -n "$cf_new_cflags" ; then
16109
16110         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16111         CFLAGS="${CFLAGS}$cf_new_cflags"
16112
16113 fi
16114
16115 if test -n "$cf_new_cppflags" ; then
16116
16117         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16118         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16119
16120 fi
16121
16122 if test -n "$cf_new_extra_cppflags" ; then
16123
16124         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16125         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16126
16127 fi
16128
16129 else
16130         ADA_TRACE=FALSE
16131 fi
16132
16133 echo "$as_me:16133: checking if we want to use GNAT projects" >&5
16134 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16135
16136 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16137 if test "${enable_gnat_projects+set}" = set; then
16138   enableval="$enable_gnat_projects"
16139   test "$enableval" != no && enableval=yes
16140         if test "$enableval" != "yes" ; then
16141     enable_gnat_projects=no
16142         else
16143                 enable_gnat_projects=yes
16144         fi
16145 else
16146   enableval=yes
16147         enable_gnat_projects=yes
16148
16149 fi;
16150 echo "$as_me:16150: result: $enable_gnat_projects" >&5
16151 echo "${ECHO_T}$enable_gnat_projects" >&6
16152
16153 ###     Checks for libraries.
16154 case $cf_cv_system_name in
16155 (*mingw32*)
16156
16157 echo "$as_me:16157: checking if ssp library is needed" >&5
16158 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16159 if test "${cf_cv_need_libssp+set}" = set; then
16160   echo $ECHO_N "(cached) $ECHO_C" >&6
16161 else
16162
16163 cat >"conftest.$ac_ext" <<_ACEOF
16164 #line 16164 "configure"
16165 #include "confdefs.h"
16166
16167 #include <sys/types.h>
16168 #include <dirent.h>
16169
16170 int
16171 main (void)
16172 {
16173
16174        DIR *dp = opendir(".");
16175
16176   ;
16177   return 0;
16178 }
16179 _ACEOF
16180 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16181 if { (eval echo "$as_me:16181: \"$ac_link\"") >&5
16182   (eval $ac_link) 2>&5
16183   ac_status=$?
16184   echo "$as_me:16184: \$? = $ac_status" >&5
16185   (exit "$ac_status"); } &&
16186          { ac_try='test -s "conftest$ac_exeext"'
16187   { (eval echo "$as_me:16187: \"$ac_try\"") >&5
16188   (eval $ac_try) 2>&5
16189   ac_status=$?
16190   echo "$as_me:16190: \$? = $ac_status" >&5
16191   (exit "$ac_status"); }; }; then
16192   cf_cv_need_libssp=no
16193 else
16194   echo "$as_me: failed program was:" >&5
16195 cat "conftest.$ac_ext" >&5
16196
16197         cf_save_LIBS="$LIBS"
16198         LIBS="$LIBS -lssp"
16199         cat >"conftest.$ac_ext" <<_ACEOF
16200 #line 16200 "configure"
16201 #include "confdefs.h"
16202
16203 #include <sys/types.h>
16204 #include <dirent.h>
16205
16206 int
16207 main (void)
16208 {
16209
16210                    DIR *dp = opendir(".");
16211
16212   ;
16213   return 0;
16214 }
16215 _ACEOF
16216 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16217 if { (eval echo "$as_me:16217: \"$ac_link\"") >&5
16218   (eval $ac_link) 2>&5
16219   ac_status=$?
16220   echo "$as_me:16220: \$? = $ac_status" >&5
16221   (exit "$ac_status"); } &&
16222          { ac_try='test -s "conftest$ac_exeext"'
16223   { (eval echo "$as_me:16223: \"$ac_try\"") >&5
16224   (eval $ac_try) 2>&5
16225   ac_status=$?
16226   echo "$as_me:16226: \$? = $ac_status" >&5
16227   (exit "$ac_status"); }; }; then
16228   cf_cv_need_libssp=yes
16229 else
16230   echo "$as_me: failed program was:" >&5
16231 cat "conftest.$ac_ext" >&5
16232 cf_cv_need_libssp=maybe
16233 fi
16234 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16235         LIBS="$cf_save_LIBS"
16236
16237 fi
16238 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16239 fi
16240 echo "$as_me:16240: result: $cf_cv_need_libssp" >&5
16241 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16242
16243 if test "x$cf_cv_need_libssp" = xyes
16244 then
16245
16246 cf_add_libs="$LIBS"
16247 # reverse order
16248 cf_add_0lib=
16249 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16250 # filter duplicates
16251 for cf_add_1lib in $cf_add_0lib; do
16252         for cf_add_2lib in $cf_add_libs; do
16253                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16254                         cf_add_1lib=
16255                         break
16256                 fi
16257         done
16258         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16259 done
16260 LIBS="$cf_add_libs"
16261
16262 fi
16263
16264         ;;
16265 (*)
16266 echo "$as_me:16266: checking for gettimeofday" >&5
16267 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16268 if test "${ac_cv_func_gettimeofday+set}" = set; then
16269   echo $ECHO_N "(cached) $ECHO_C" >&6
16270 else
16271   cat >"conftest.$ac_ext" <<_ACEOF
16272 #line 16272 "configure"
16273 #include "confdefs.h"
16274 #define gettimeofday autoconf_temporary
16275 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16276 #undef gettimeofday
16277
16278 #ifdef __cplusplus
16279 extern "C"
16280 #endif
16281
16282 /* We use char because int might match the return type of a gcc2
16283    builtin and then its argument prototype would still apply.  */
16284 char gettimeofday (void);
16285
16286 int
16287 main (void)
16288 {
16289
16290 /* The GNU C library defines stubs for functions which it implements
16291     to always fail with ENOSYS.  Some functions are actually named
16292     something starting with __ and the normal name is an alias.  */
16293 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16294 #error found stub for gettimeofday
16295 #endif
16296
16297         return gettimeofday ();
16298   ;
16299   return 0;
16300 }
16301 _ACEOF
16302 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16303 if { (eval echo "$as_me:16303: \"$ac_link\"") >&5
16304   (eval $ac_link) 2>&5
16305   ac_status=$?
16306   echo "$as_me:16306: \$? = $ac_status" >&5
16307   (exit "$ac_status"); } &&
16308          { ac_try='test -s "conftest$ac_exeext"'
16309   { (eval echo "$as_me:16309: \"$ac_try\"") >&5
16310   (eval $ac_try) 2>&5
16311   ac_status=$?
16312   echo "$as_me:16312: \$? = $ac_status" >&5
16313   (exit "$ac_status"); }; }; then
16314   ac_cv_func_gettimeofday=yes
16315 else
16316   echo "$as_me: failed program was:" >&5
16317 cat "conftest.$ac_ext" >&5
16318 ac_cv_func_gettimeofday=no
16319 fi
16320 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16321 fi
16322 echo "$as_me:16322: result: $ac_cv_func_gettimeofday" >&5
16323 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16324 if test "$ac_cv_func_gettimeofday" = yes; then
16325   cat >>confdefs.h <<\EOF
16326 #define HAVE_GETTIMEOFDAY 1
16327 EOF
16328
16329 else
16330
16331 echo "$as_me:16331: checking for gettimeofday in -lbsd" >&5
16332 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16333 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16334   echo $ECHO_N "(cached) $ECHO_C" >&6
16335 else
16336   ac_check_lib_save_LIBS=$LIBS
16337 LIBS="-lbsd  $LIBS"
16338 cat >"conftest.$ac_ext" <<_ACEOF
16339 #line 16339 "configure"
16340 #include "confdefs.h"
16341
16342 /* Override any gcc2 internal prototype to avoid an error.  */
16343 #ifdef __cplusplus
16344 extern "C"
16345 #endif
16346 /* We use char because int might match the return type of a gcc2
16347    builtin and then its argument prototype would still apply.  */
16348 char gettimeofday ();
16349 int
16350 main (void)
16351 {
16352 gettimeofday ();
16353   ;
16354   return 0;
16355 }
16356 _ACEOF
16357 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16358 if { (eval echo "$as_me:16358: \"$ac_link\"") >&5
16359   (eval $ac_link) 2>&5
16360   ac_status=$?
16361   echo "$as_me:16361: \$? = $ac_status" >&5
16362   (exit "$ac_status"); } &&
16363          { ac_try='test -s "conftest$ac_exeext"'
16364   { (eval echo "$as_me:16364: \"$ac_try\"") >&5
16365   (eval $ac_try) 2>&5
16366   ac_status=$?
16367   echo "$as_me:16367: \$? = $ac_status" >&5
16368   (exit "$ac_status"); }; }; then
16369   ac_cv_lib_bsd_gettimeofday=yes
16370 else
16371   echo "$as_me: failed program was:" >&5
16372 cat "conftest.$ac_ext" >&5
16373 ac_cv_lib_bsd_gettimeofday=no
16374 fi
16375 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16376 LIBS=$ac_check_lib_save_LIBS
16377 fi
16378 echo "$as_me:16378: result: $ac_cv_lib_bsd_gettimeofday" >&5
16379 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16380 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16381
16382 cat >>confdefs.h <<\EOF
16383 #define HAVE_GETTIMEOFDAY 1
16384 EOF
16385
16386         LIBS="$LIBS -lbsd"
16387 fi
16388
16389 fi
16390         ;;
16391 esac
16392
16393 ###     Checks for header files.
16394 echo "$as_me:16394: checking for ANSI C header files" >&5
16395 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16396 if test "${ac_cv_header_stdc+set}" = set; then
16397   echo $ECHO_N "(cached) $ECHO_C" >&6
16398 else
16399   cat >"conftest.$ac_ext" <<_ACEOF
16400 #line 16400 "configure"
16401 #include "confdefs.h"
16402 #include <stdlib.h>
16403 #include <stdarg.h>
16404 #include <string.h>
16405 #include <float.h>
16406
16407 _ACEOF
16408 if { (eval echo "$as_me:16408: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16409   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16410   ac_status=$?
16411   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16412   rm -f conftest.er1
16413   cat conftest.err >&5
16414   echo "$as_me:16414: \$? = $ac_status" >&5
16415   (exit "$ac_status"); } >/dev/null; then
16416   if test -s conftest.err; then
16417     ac_cpp_err=$ac_c_preproc_warn_flag
16418   else
16419     ac_cpp_err=
16420   fi
16421 else
16422   ac_cpp_err=yes
16423 fi
16424 if test -z "$ac_cpp_err"; then
16425   ac_cv_header_stdc=yes
16426 else
16427   echo "$as_me: failed program was:" >&5
16428   cat "conftest.$ac_ext" >&5
16429   ac_cv_header_stdc=no
16430 fi
16431 rm -f conftest.err "conftest.$ac_ext"
16432
16433 if test $ac_cv_header_stdc = yes; then
16434   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16435   cat >"conftest.$ac_ext" <<_ACEOF
16436 #line 16436 "configure"
16437 #include "confdefs.h"
16438 #include <string.h>
16439
16440 _ACEOF
16441 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16442   $EGREP "memchr" >/dev/null 2>&1; then
16443   :
16444 else
16445   ac_cv_header_stdc=no
16446 fi
16447 rm -rf conftest*
16448
16449 fi
16450
16451 if test $ac_cv_header_stdc = yes; then
16452   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16453   cat >"conftest.$ac_ext" <<_ACEOF
16454 #line 16454 "configure"
16455 #include "confdefs.h"
16456 #include <stdlib.h>
16457
16458 _ACEOF
16459 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16460   $EGREP "free" >/dev/null 2>&1; then
16461   :
16462 else
16463   ac_cv_header_stdc=no
16464 fi
16465 rm -rf conftest*
16466
16467 fi
16468
16469 if test $ac_cv_header_stdc = yes; then
16470   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16471   if test "$cross_compiling" = yes; then
16472   :
16473 else
16474   cat >"conftest.$ac_ext" <<_ACEOF
16475 #line 16475 "configure"
16476 #include "confdefs.h"
16477 #include <ctype.h>
16478 #if ((' ' & 0x0FF) == 0x020)
16479 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16480 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16481 #else
16482 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16483                      || ('j' <= (c) && (c) <= 'r') \
16484                      || ('s' <= (c) && (c) <= 'z'))
16485 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16486 #endif
16487
16488 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16489 int
16490 main (void)
16491 {
16492   int i;
16493   for (i = 0; i < 256; i++)
16494     if (XOR (islower (i), ISLOWER (i))
16495         || toupper (i) != TOUPPER (i))
16496       $ac_main_return(2);
16497   $ac_main_return (0);
16498 }
16499 _ACEOF
16500 rm -f "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"); } && { ac_try='"./conftest$ac_exeext"'
16506   { (eval echo "$as_me:16506: \"$ac_try\"") >&5
16507   (eval $ac_try) 2>&5
16508   ac_status=$?
16509   echo "$as_me:16509: \$? = $ac_status" >&5
16510   (exit "$ac_status"); }; }; then
16511   :
16512 else
16513   echo "$as_me: program exited with status $ac_status" >&5
16514 echo "$as_me: failed program was:" >&5
16515 cat "conftest.$ac_ext" >&5
16516 ac_cv_header_stdc=no
16517 fi
16518 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16519 fi
16520 fi
16521 fi
16522 echo "$as_me:16522: result: $ac_cv_header_stdc" >&5
16523 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16524 if test $ac_cv_header_stdc = yes; then
16525
16526 cat >>confdefs.h <<\EOF
16527 #define STDC_HEADERS 1
16528 EOF
16529
16530 fi
16531
16532 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16533
16534 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16535                   inttypes.h stdint.h unistd.h
16536 do
16537 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16538 echo "$as_me:16538: checking for $ac_header" >&5
16539 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16540 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16541   echo $ECHO_N "(cached) $ECHO_C" >&6
16542 else
16543   cat >"conftest.$ac_ext" <<_ACEOF
16544 #line 16544 "configure"
16545 #include "confdefs.h"
16546 $ac_includes_default
16547 #include <$ac_header>
16548 _ACEOF
16549 rm -f "conftest.$ac_objext"
16550 if { (eval echo "$as_me:16550: \"$ac_compile\"") >&5
16551   (eval $ac_compile) 2>&5
16552   ac_status=$?
16553   echo "$as_me:16553: \$? = $ac_status" >&5
16554   (exit "$ac_status"); } &&
16555          { ac_try='test -s "conftest.$ac_objext"'
16556   { (eval echo "$as_me:16556: \"$ac_try\"") >&5
16557   (eval $ac_try) 2>&5
16558   ac_status=$?
16559   echo "$as_me:16559: \$? = $ac_status" >&5
16560   (exit "$ac_status"); }; }; then
16561   eval "$as_ac_Header=yes"
16562 else
16563   echo "$as_me: failed program was:" >&5
16564 cat "conftest.$ac_ext" >&5
16565 eval "$as_ac_Header=no"
16566 fi
16567 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16568 fi
16569 echo "$as_me:16569: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16570 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16571 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16572   cat >>confdefs.h <<EOF
16573 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16574 EOF
16575
16576 fi
16577 done
16578
16579 echo "$as_me:16579: checking for signed char" >&5
16580 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16581 if test "${ac_cv_type_signed_char+set}" = set; then
16582   echo $ECHO_N "(cached) $ECHO_C" >&6
16583 else
16584   cat >"conftest.$ac_ext" <<_ACEOF
16585 #line 16585 "configure"
16586 #include "confdefs.h"
16587 $ac_includes_default
16588 int
16589 main (void)
16590 {
16591 if ((signed char *) 0)
16592   return 0;
16593 if (sizeof (signed char))
16594   return 0;
16595   ;
16596   return 0;
16597 }
16598 _ACEOF
16599 rm -f "conftest.$ac_objext"
16600 if { (eval echo "$as_me:16600: \"$ac_compile\"") >&5
16601   (eval $ac_compile) 2>&5
16602   ac_status=$?
16603   echo "$as_me:16603: \$? = $ac_status" >&5
16604   (exit "$ac_status"); } &&
16605          { ac_try='test -s "conftest.$ac_objext"'
16606   { (eval echo "$as_me:16606: \"$ac_try\"") >&5
16607   (eval $ac_try) 2>&5
16608   ac_status=$?
16609   echo "$as_me:16609: \$? = $ac_status" >&5
16610   (exit "$ac_status"); }; }; then
16611   ac_cv_type_signed_char=yes
16612 else
16613   echo "$as_me: failed program was:" >&5
16614 cat "conftest.$ac_ext" >&5
16615 ac_cv_type_signed_char=no
16616 fi
16617 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16618 fi
16619 echo "$as_me:16619: result: $ac_cv_type_signed_char" >&5
16620 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16621
16622 echo "$as_me:16622: checking size of signed char" >&5
16623 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16624 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16625   echo $ECHO_N "(cached) $ECHO_C" >&6
16626 else
16627   if test "$ac_cv_type_signed_char" = yes; then
16628   if test "$cross_compiling" = yes; then
16629   # Depending upon the size, compute the lo and hi bounds.
16630 cat >"conftest.$ac_ext" <<_ACEOF
16631 #line 16631 "configure"
16632 #include "confdefs.h"
16633 $ac_includes_default
16634 int
16635 main (void)
16636 {
16637 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16638   ;
16639   return 0;
16640 }
16641 _ACEOF
16642 rm -f "conftest.$ac_objext"
16643 if { (eval echo "$as_me:16643: \"$ac_compile\"") >&5
16644   (eval $ac_compile) 2>&5
16645   ac_status=$?
16646   echo "$as_me:16646: \$? = $ac_status" >&5
16647   (exit "$ac_status"); } &&
16648          { ac_try='test -s "conftest.$ac_objext"'
16649   { (eval echo "$as_me:16649: \"$ac_try\"") >&5
16650   (eval $ac_try) 2>&5
16651   ac_status=$?
16652   echo "$as_me:16652: \$? = $ac_status" >&5
16653   (exit "$ac_status"); }; }; then
16654   ac_lo=0 ac_mid=0
16655   while :; do
16656     cat >"conftest.$ac_ext" <<_ACEOF
16657 #line 16657 "configure"
16658 #include "confdefs.h"
16659 $ac_includes_default
16660 int
16661 main (void)
16662 {
16663 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16664   ;
16665   return 0;
16666 }
16667 _ACEOF
16668 rm -f "conftest.$ac_objext"
16669 if { (eval echo "$as_me:16669: \"$ac_compile\"") >&5
16670   (eval $ac_compile) 2>&5
16671   ac_status=$?
16672   echo "$as_me:16672: \$? = $ac_status" >&5
16673   (exit "$ac_status"); } &&
16674          { ac_try='test -s "conftest.$ac_objext"'
16675   { (eval echo "$as_me:16675: \"$ac_try\"") >&5
16676   (eval $ac_try) 2>&5
16677   ac_status=$?
16678   echo "$as_me:16678: \$? = $ac_status" >&5
16679   (exit "$ac_status"); }; }; then
16680   ac_hi=$ac_mid; break
16681 else
16682   echo "$as_me: failed program was:" >&5
16683 cat "conftest.$ac_ext" >&5
16684 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16685 fi
16686 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16687   done
16688 else
16689   echo "$as_me: failed program was:" >&5
16690 cat "conftest.$ac_ext" >&5
16691 ac_hi=-1 ac_mid=-1
16692   while :; do
16693     cat >"conftest.$ac_ext" <<_ACEOF
16694 #line 16694 "configure"
16695 #include "confdefs.h"
16696 $ac_includes_default
16697 int
16698 main (void)
16699 {
16700 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16701   ;
16702   return 0;
16703 }
16704 _ACEOF
16705 rm -f "conftest.$ac_objext"
16706 if { (eval echo "$as_me:16706: \"$ac_compile\"") >&5
16707   (eval $ac_compile) 2>&5
16708   ac_status=$?
16709   echo "$as_me:16709: \$? = $ac_status" >&5
16710   (exit "$ac_status"); } &&
16711          { ac_try='test -s "conftest.$ac_objext"'
16712   { (eval echo "$as_me:16712: \"$ac_try\"") >&5
16713   (eval $ac_try) 2>&5
16714   ac_status=$?
16715   echo "$as_me:16715: \$? = $ac_status" >&5
16716   (exit "$ac_status"); }; }; then
16717   ac_lo=$ac_mid; break
16718 else
16719   echo "$as_me: failed program was:" >&5
16720 cat "conftest.$ac_ext" >&5
16721 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16722 fi
16723 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16724   done
16725 fi
16726 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16727 # Binary search between lo and hi bounds.
16728 while test "x$ac_lo" != "x$ac_hi"; do
16729   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16730   cat >"conftest.$ac_ext" <<_ACEOF
16731 #line 16731 "configure"
16732 #include "confdefs.h"
16733 $ac_includes_default
16734 int
16735 main (void)
16736 {
16737 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16738   ;
16739   return 0;
16740 }
16741 _ACEOF
16742 rm -f "conftest.$ac_objext"
16743 if { (eval echo "$as_me:16743: \"$ac_compile\"") >&5
16744   (eval $ac_compile) 2>&5
16745   ac_status=$?
16746   echo "$as_me:16746: \$? = $ac_status" >&5
16747   (exit "$ac_status"); } &&
16748          { ac_try='test -s "conftest.$ac_objext"'
16749   { (eval echo "$as_me:16749: \"$ac_try\"") >&5
16750   (eval $ac_try) 2>&5
16751   ac_status=$?
16752   echo "$as_me:16752: \$? = $ac_status" >&5
16753   (exit "$ac_status"); }; }; then
16754   ac_hi=$ac_mid
16755 else
16756   echo "$as_me: failed program was:" >&5
16757 cat "conftest.$ac_ext" >&5
16758 ac_lo=`expr "$ac_mid" + 1`
16759 fi
16760 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16761 done
16762 ac_cv_sizeof_signed_char=$ac_lo
16763 else
16764   if test "$cross_compiling" = yes; then
16765   { { echo "$as_me:16765: error: cannot run test program while cross compiling" >&5
16766 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16767    { (exit 1); exit 1; }; }
16768 else
16769   cat >"conftest.$ac_ext" <<_ACEOF
16770 #line 16770 "configure"
16771 #include "confdefs.h"
16772 $ac_includes_default
16773 int
16774 main (void)
16775 {
16776 FILE *f = fopen ("conftest.val", "w");
16777 if (!f)
16778   $ac_main_return (1);
16779 fprintf (f, "%ld", (long)(sizeof (signed char)));
16780 fclose (f);
16781   ;
16782   return 0;
16783 }
16784 _ACEOF
16785 rm -f "conftest$ac_exeext"
16786 if { (eval echo "$as_me:16786: \"$ac_link\"") >&5
16787   (eval $ac_link) 2>&5
16788   ac_status=$?
16789   echo "$as_me:16789: \$? = $ac_status" >&5
16790   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16791   { (eval echo "$as_me:16791: \"$ac_try\"") >&5
16792   (eval $ac_try) 2>&5
16793   ac_status=$?
16794   echo "$as_me:16794: \$? = $ac_status" >&5
16795   (exit "$ac_status"); }; }; then
16796   ac_cv_sizeof_signed_char=`cat conftest.val`
16797 else
16798   echo "$as_me: program exited with status $ac_status" >&5
16799 echo "$as_me: failed program was:" >&5
16800 cat "conftest.$ac_ext" >&5
16801 fi
16802 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16803 fi
16804 fi
16805 rm -f conftest.val
16806 else
16807   ac_cv_sizeof_signed_char=0
16808 fi
16809 fi
16810 echo "$as_me:16810: result: $ac_cv_sizeof_signed_char" >&5
16811 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16812 cat >>confdefs.h <<EOF
16813 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16814 EOF
16815
16816 echo "$as_me:16816: checking for ANSI C header files" >&5
16817 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16818 if test "${ac_cv_header_stdc+set}" = set; then
16819   echo $ECHO_N "(cached) $ECHO_C" >&6
16820 else
16821   cat >"conftest.$ac_ext" <<_ACEOF
16822 #line 16822 "configure"
16823 #include "confdefs.h"
16824 #include <stdlib.h>
16825 #include <stdarg.h>
16826 #include <string.h>
16827 #include <float.h>
16828
16829 _ACEOF
16830 if { (eval echo "$as_me:16830: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16831   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16832   ac_status=$?
16833   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16834   rm -f conftest.er1
16835   cat conftest.err >&5
16836   echo "$as_me:16836: \$? = $ac_status" >&5
16837   (exit "$ac_status"); } >/dev/null; then
16838   if test -s conftest.err; then
16839     ac_cpp_err=$ac_c_preproc_warn_flag
16840   else
16841     ac_cpp_err=
16842   fi
16843 else
16844   ac_cpp_err=yes
16845 fi
16846 if test -z "$ac_cpp_err"; then
16847   ac_cv_header_stdc=yes
16848 else
16849   echo "$as_me: failed program was:" >&5
16850   cat "conftest.$ac_ext" >&5
16851   ac_cv_header_stdc=no
16852 fi
16853 rm -f conftest.err "conftest.$ac_ext"
16854
16855 if test $ac_cv_header_stdc = yes; then
16856   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16857   cat >"conftest.$ac_ext" <<_ACEOF
16858 #line 16858 "configure"
16859 #include "confdefs.h"
16860 #include <string.h>
16861
16862 _ACEOF
16863 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16864   $EGREP "memchr" >/dev/null 2>&1; then
16865   :
16866 else
16867   ac_cv_header_stdc=no
16868 fi
16869 rm -rf conftest*
16870
16871 fi
16872
16873 if test $ac_cv_header_stdc = yes; then
16874   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16875   cat >"conftest.$ac_ext" <<_ACEOF
16876 #line 16876 "configure"
16877 #include "confdefs.h"
16878 #include <stdlib.h>
16879
16880 _ACEOF
16881 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16882   $EGREP "free" >/dev/null 2>&1; then
16883   :
16884 else
16885   ac_cv_header_stdc=no
16886 fi
16887 rm -rf conftest*
16888
16889 fi
16890
16891 if test $ac_cv_header_stdc = yes; then
16892   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16893   if test "$cross_compiling" = yes; then
16894   :
16895 else
16896   cat >"conftest.$ac_ext" <<_ACEOF
16897 #line 16897 "configure"
16898 #include "confdefs.h"
16899 #include <ctype.h>
16900 #if ((' ' & 0x0FF) == 0x020)
16901 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16902 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16903 #else
16904 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16905                      || ('j' <= (c) && (c) <= 'r') \
16906                      || ('s' <= (c) && (c) <= 'z'))
16907 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16908 #endif
16909
16910 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16911 int
16912 main (void)
16913 {
16914   int i;
16915   for (i = 0; i < 256; i++)
16916     if (XOR (islower (i), ISLOWER (i))
16917         || toupper (i) != TOUPPER (i))
16918       $ac_main_return(2);
16919   $ac_main_return (0);
16920 }
16921 _ACEOF
16922 rm -f "conftest$ac_exeext"
16923 if { (eval echo "$as_me:16923: \"$ac_link\"") >&5
16924   (eval $ac_link) 2>&5
16925   ac_status=$?
16926   echo "$as_me:16926: \$? = $ac_status" >&5
16927   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16928   { (eval echo "$as_me:16928: \"$ac_try\"") >&5
16929   (eval $ac_try) 2>&5
16930   ac_status=$?
16931   echo "$as_me:16931: \$? = $ac_status" >&5
16932   (exit "$ac_status"); }; }; then
16933   :
16934 else
16935   echo "$as_me: program exited with status $ac_status" >&5
16936 echo "$as_me: failed program was:" >&5
16937 cat "conftest.$ac_ext" >&5
16938 ac_cv_header_stdc=no
16939 fi
16940 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16941 fi
16942 fi
16943 fi
16944 echo "$as_me:16944: result: $ac_cv_header_stdc" >&5
16945 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16946 if test $ac_cv_header_stdc = yes; then
16947
16948 cat >>confdefs.h <<\EOF
16949 #define STDC_HEADERS 1
16950 EOF
16951
16952 fi
16953
16954 ac_header_dirent=no
16955 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16956   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16957 echo "$as_me:16957: checking for $ac_hdr that defines DIR" >&5
16958 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16959 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16960   echo $ECHO_N "(cached) $ECHO_C" >&6
16961 else
16962   cat >"conftest.$ac_ext" <<_ACEOF
16963 #line 16963 "configure"
16964 #include "confdefs.h"
16965 #include <sys/types.h>
16966 #include <$ac_hdr>
16967
16968 int
16969 main (void)
16970 {
16971 if ((DIR *) 0)
16972 return 0;
16973   ;
16974   return 0;
16975 }
16976 _ACEOF
16977 rm -f "conftest.$ac_objext"
16978 if { (eval echo "$as_me:16978: \"$ac_compile\"") >&5
16979   (eval $ac_compile) 2>&5
16980   ac_status=$?
16981   echo "$as_me:16981: \$? = $ac_status" >&5
16982   (exit "$ac_status"); } &&
16983          { ac_try='test -s "conftest.$ac_objext"'
16984   { (eval echo "$as_me:16984: \"$ac_try\"") >&5
16985   (eval $ac_try) 2>&5
16986   ac_status=$?
16987   echo "$as_me:16987: \$? = $ac_status" >&5
16988   (exit "$ac_status"); }; }; then
16989   eval "$as_ac_Header=yes"
16990 else
16991   echo "$as_me: failed program was:" >&5
16992 cat "conftest.$ac_ext" >&5
16993 eval "$as_ac_Header=no"
16994 fi
16995 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16996 fi
16997 echo "$as_me:16997: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16998 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16999 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17000   cat >>confdefs.h <<EOF
17001 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
17002 EOF
17003
17004 ac_header_dirent=$ac_hdr; break
17005 fi
17006
17007 done
17008 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
17009 if test $ac_header_dirent = dirent.h; then
17010   echo "$as_me:17010: checking for opendir in -ldir" >&5
17011 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
17012 if test "${ac_cv_lib_dir_opendir+set}" = set; then
17013   echo $ECHO_N "(cached) $ECHO_C" >&6
17014 else
17015   ac_check_lib_save_LIBS=$LIBS
17016 LIBS="-ldir  $LIBS"
17017 cat >"conftest.$ac_ext" <<_ACEOF
17018 #line 17018 "configure"
17019 #include "confdefs.h"
17020
17021 /* Override any gcc2 internal prototype to avoid an error.  */
17022 #ifdef __cplusplus
17023 extern "C"
17024 #endif
17025 /* We use char because int might match the return type of a gcc2
17026    builtin and then its argument prototype would still apply.  */
17027 char opendir ();
17028 int
17029 main (void)
17030 {
17031 opendir ();
17032   ;
17033   return 0;
17034 }
17035 _ACEOF
17036 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17037 if { (eval echo "$as_me:17037: \"$ac_link\"") >&5
17038   (eval $ac_link) 2>&5
17039   ac_status=$?
17040   echo "$as_me:17040: \$? = $ac_status" >&5
17041   (exit "$ac_status"); } &&
17042          { ac_try='test -s "conftest$ac_exeext"'
17043   { (eval echo "$as_me:17043: \"$ac_try\"") >&5
17044   (eval $ac_try) 2>&5
17045   ac_status=$?
17046   echo "$as_me:17046: \$? = $ac_status" >&5
17047   (exit "$ac_status"); }; }; then
17048   ac_cv_lib_dir_opendir=yes
17049 else
17050   echo "$as_me: failed program was:" >&5
17051 cat "conftest.$ac_ext" >&5
17052 ac_cv_lib_dir_opendir=no
17053 fi
17054 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17055 LIBS=$ac_check_lib_save_LIBS
17056 fi
17057 echo "$as_me:17057: result: $ac_cv_lib_dir_opendir" >&5
17058 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17059 if test "$ac_cv_lib_dir_opendir" = yes; then
17060   LIBS="$LIBS -ldir"
17061 fi
17062
17063 else
17064   echo "$as_me:17064: checking for opendir in -lx" >&5
17065 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17066 if test "${ac_cv_lib_x_opendir+set}" = set; then
17067   echo $ECHO_N "(cached) $ECHO_C" >&6
17068 else
17069   ac_check_lib_save_LIBS=$LIBS
17070 LIBS="-lx  $LIBS"
17071 cat >"conftest.$ac_ext" <<_ACEOF
17072 #line 17072 "configure"
17073 #include "confdefs.h"
17074
17075 /* Override any gcc2 internal prototype to avoid an error.  */
17076 #ifdef __cplusplus
17077 extern "C"
17078 #endif
17079 /* We use char because int might match the return type of a gcc2
17080    builtin and then its argument prototype would still apply.  */
17081 char opendir ();
17082 int
17083 main (void)
17084 {
17085 opendir ();
17086   ;
17087   return 0;
17088 }
17089 _ACEOF
17090 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17091 if { (eval echo "$as_me:17091: \"$ac_link\"") >&5
17092   (eval $ac_link) 2>&5
17093   ac_status=$?
17094   echo "$as_me:17094: \$? = $ac_status" >&5
17095   (exit "$ac_status"); } &&
17096          { ac_try='test -s "conftest$ac_exeext"'
17097   { (eval echo "$as_me:17097: \"$ac_try\"") >&5
17098   (eval $ac_try) 2>&5
17099   ac_status=$?
17100   echo "$as_me:17100: \$? = $ac_status" >&5
17101   (exit "$ac_status"); }; }; then
17102   ac_cv_lib_x_opendir=yes
17103 else
17104   echo "$as_me: failed program was:" >&5
17105 cat "conftest.$ac_ext" >&5
17106 ac_cv_lib_x_opendir=no
17107 fi
17108 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17109 LIBS=$ac_check_lib_save_LIBS
17110 fi
17111 echo "$as_me:17111: result: $ac_cv_lib_x_opendir" >&5
17112 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17113 if test "$ac_cv_lib_x_opendir" = yes; then
17114   LIBS="$LIBS -lx"
17115 fi
17116
17117 fi
17118
17119 echo "$as_me:17119: checking whether time.h and sys/time.h may both be included" >&5
17120 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17121 if test "${ac_cv_header_time+set}" = set; then
17122   echo $ECHO_N "(cached) $ECHO_C" >&6
17123 else
17124   cat >"conftest.$ac_ext" <<_ACEOF
17125 #line 17125 "configure"
17126 #include "confdefs.h"
17127 #include <sys/types.h>
17128 #include <sys/time.h>
17129 #include <time.h>
17130
17131 int
17132 main (void)
17133 {
17134 if ((struct tm *) 0)
17135 return 0;
17136   ;
17137   return 0;
17138 }
17139 _ACEOF
17140 rm -f "conftest.$ac_objext"
17141 if { (eval echo "$as_me:17141: \"$ac_compile\"") >&5
17142   (eval $ac_compile) 2>&5
17143   ac_status=$?
17144   echo "$as_me:17144: \$? = $ac_status" >&5
17145   (exit "$ac_status"); } &&
17146          { ac_try='test -s "conftest.$ac_objext"'
17147   { (eval echo "$as_me:17147: \"$ac_try\"") >&5
17148   (eval $ac_try) 2>&5
17149   ac_status=$?
17150   echo "$as_me:17150: \$? = $ac_status" >&5
17151   (exit "$ac_status"); }; }; then
17152   ac_cv_header_time=yes
17153 else
17154   echo "$as_me: failed program was:" >&5
17155 cat "conftest.$ac_ext" >&5
17156 ac_cv_header_time=no
17157 fi
17158 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17159 fi
17160 echo "$as_me:17160: result: $ac_cv_header_time" >&5
17161 echo "${ECHO_T}$ac_cv_header_time" >&6
17162 if test $ac_cv_header_time = yes; then
17163
17164 cat >>confdefs.h <<\EOF
17165 #define TIME_WITH_SYS_TIME 1
17166 EOF
17167
17168 fi
17169
17170 ###     checks for compiler characteristics
17171 ac_ext=c
17172 ac_cpp='$CPP $CPPFLAGS'
17173 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17174 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17175 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17176 ac_main_return="return"
17177
17178 echo "$as_me:17178: checking for an ANSI C-conforming const" >&5
17179 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17180 if test "${ac_cv_c_const+set}" = set; then
17181   echo $ECHO_N "(cached) $ECHO_C" >&6
17182 else
17183   cat >"conftest.$ac_ext" <<_ACEOF
17184 #line 17184 "configure"
17185 #include "confdefs.h"
17186
17187 int
17188 main (void)
17189 {
17190 /* FIXME: Include the comments suggested by Paul. */
17191 #ifndef __cplusplus
17192   /* Ultrix mips cc rejects this.  */
17193   typedef int charset[2];
17194   const charset x;
17195   /* SunOS 4.1.1 cc rejects this.  */
17196   char const *const *ccp;
17197   char **p;
17198   /* NEC SVR4.0.2 mips cc rejects this.  */
17199   struct point {int x, y;};
17200   static struct point const zero = {0,0};
17201   /* AIX XL C 1.02.0.0 rejects this.
17202      It does not let you subtract one const X* pointer from another in
17203      an arm of an if-expression whose if-part is not a constant
17204      expression */
17205   const char *g = "string";
17206   ccp = &g + (g ? g-g : 0);
17207   /* HPUX 7.0 cc rejects these. */
17208   ++ccp;
17209   p = (char**) ccp;
17210   ccp = (char const *const *) p;
17211   { /* SCO 3.2v4 cc rejects this.  */
17212     char *t;
17213     char const *s = 0 ? (char *) 0 : (char const *) 0;
17214
17215     *t++ = 0;
17216   }
17217   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17218     int x[] = {25, 17};
17219     const int *foo = &x[0];
17220     ++foo;
17221   }
17222   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17223     typedef const int *iptr;
17224     iptr p = 0;
17225     ++p;
17226   }
17227   { /* AIX XL C 1.02.0.0 rejects this saying
17228        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17229     struct s { int j; const int *ap[3]; };
17230     struct s *b; b->j = 5;
17231   }
17232   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17233     const int foo = 10;
17234   }
17235 #endif
17236
17237   ;
17238   return 0;
17239 }
17240 _ACEOF
17241 rm -f "conftest.$ac_objext"
17242 if { (eval echo "$as_me:17242: \"$ac_compile\"") >&5
17243   (eval $ac_compile) 2>&5
17244   ac_status=$?
17245   echo "$as_me:17245: \$? = $ac_status" >&5
17246   (exit "$ac_status"); } &&
17247          { ac_try='test -s "conftest.$ac_objext"'
17248   { (eval echo "$as_me:17248: \"$ac_try\"") >&5
17249   (eval $ac_try) 2>&5
17250   ac_status=$?
17251   echo "$as_me:17251: \$? = $ac_status" >&5
17252   (exit "$ac_status"); }; }; then
17253   ac_cv_c_const=yes
17254 else
17255   echo "$as_me: failed program was:" >&5
17256 cat "conftest.$ac_ext" >&5
17257 ac_cv_c_const=no
17258 fi
17259 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17260 fi
17261 echo "$as_me:17261: result: $ac_cv_c_const" >&5
17262 echo "${ECHO_T}$ac_cv_c_const" >&6
17263 if test $ac_cv_c_const = no; then
17264
17265 cat >>confdefs.h <<\EOF
17266 #define const
17267 EOF
17268
17269 fi
17270
17271 ###     Checks for external-data
17272
17273 echo "$as_me:17273: checking if data-only library module links" >&5
17274 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17275 if test "${cf_cv_link_dataonly+set}" = set; then
17276   echo $ECHO_N "(cached) $ECHO_C" >&6
17277 else
17278
17279         rm -f conftest.a
17280         cat >conftest.$ac_ext <<EOF
17281 #line 17281 "configure"
17282 int     testdata[3] = { 123, 456, 789 };
17283 EOF
17284         if { (eval echo "$as_me:17284: \"$ac_compile\"") >&5
17285   (eval $ac_compile) 2>&5
17286   ac_status=$?
17287   echo "$as_me:17287: \$? = $ac_status" >&5
17288   (exit "$ac_status"); } ; then
17289                 mv conftest.o data.o && \
17290                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17291         fi
17292         rm -f conftest.$ac_ext data.o
17293         cat >conftest.$ac_ext <<EOF
17294 #line 17294 "configure"
17295 int     testfunc(void)
17296 {
17297 #if defined(NeXT)
17298         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17299 #else
17300         extern int testdata[3];
17301         return testdata[0] == 123
17302            &&  testdata[1] == 456
17303            &&  testdata[2] == 789;
17304 #endif
17305 }
17306 EOF
17307         if { (eval echo "$as_me:17307: \"$ac_compile\"") >&5
17308   (eval $ac_compile) 2>&5
17309   ac_status=$?
17310   echo "$as_me:17310: \$? = $ac_status" >&5
17311   (exit "$ac_status"); }; then
17312                 mv conftest.o func.o && \
17313                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17314         fi
17315         rm -f conftest.$ac_ext func.o
17316         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17317         cf_saveLIBS="$LIBS"
17318         LIBS="conftest.a $LIBS"
17319         if test "$cross_compiling" = yes; then
17320   cf_cv_link_dataonly=unknown
17321 else
17322   cat >"conftest.$ac_ext" <<_ACEOF
17323 #line 17323 "configure"
17324 #include "confdefs.h"
17325
17326         int main(void)
17327         {
17328                 extern int testfunc();
17329                 ${cf_cv_main_return:-return} (!testfunc());
17330         }
17331
17332 _ACEOF
17333 rm -f "conftest$ac_exeext"
17334 if { (eval echo "$as_me:17334: \"$ac_link\"") >&5
17335   (eval $ac_link) 2>&5
17336   ac_status=$?
17337   echo "$as_me:17337: \$? = $ac_status" >&5
17338   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17339   { (eval echo "$as_me:17339: \"$ac_try\"") >&5
17340   (eval $ac_try) 2>&5
17341   ac_status=$?
17342   echo "$as_me:17342: \$? = $ac_status" >&5
17343   (exit "$ac_status"); }; }; then
17344   cf_cv_link_dataonly=yes
17345 else
17346   echo "$as_me: program exited with status $ac_status" >&5
17347 echo "$as_me: failed program was:" >&5
17348 cat "conftest.$ac_ext" >&5
17349 cf_cv_link_dataonly=no
17350 fi
17351 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17352 fi
17353         LIBS="$cf_saveLIBS"
17354
17355 fi
17356
17357 echo "$as_me:17357: result: $cf_cv_link_dataonly" >&5
17358 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17359
17360 if test "$cf_cv_link_dataonly" = no ; then
17361
17362 cat >>confdefs.h <<\EOF
17363 #define BROKEN_LINKER 1
17364 EOF
17365
17366         BROKEN_LINKER=1
17367 fi
17368
17369 ###     Checks for library functions.
17370
17371 for ac_header in \
17372 unistd.h \
17373
17374 do
17375 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17376 echo "$as_me:17376: checking for $ac_header" >&5
17377 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17378 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17379   echo $ECHO_N "(cached) $ECHO_C" >&6
17380 else
17381   cat >"conftest.$ac_ext" <<_ACEOF
17382 #line 17382 "configure"
17383 #include "confdefs.h"
17384 #include <$ac_header>
17385 _ACEOF
17386 if { (eval echo "$as_me:17386: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17387   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17388   ac_status=$?
17389   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17390   rm -f conftest.er1
17391   cat conftest.err >&5
17392   echo "$as_me:17392: \$? = $ac_status" >&5
17393   (exit "$ac_status"); } >/dev/null; then
17394   if test -s conftest.err; then
17395     ac_cpp_err=$ac_c_preproc_warn_flag
17396   else
17397     ac_cpp_err=
17398   fi
17399 else
17400   ac_cpp_err=yes
17401 fi
17402 if test -z "$ac_cpp_err"; then
17403   eval "$as_ac_Header=yes"
17404 else
17405   echo "$as_me: failed program was:" >&5
17406   cat "conftest.$ac_ext" >&5
17407   eval "$as_ac_Header=no"
17408 fi
17409 rm -f conftest.err "conftest.$ac_ext"
17410 fi
17411 echo "$as_me:17411: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17412 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17413 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17414   cat >>confdefs.h <<EOF
17415 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17416 EOF
17417
17418 fi
17419 done
17420
17421 echo "$as_me:17421: checking for working mkstemp" >&5
17422 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17423 if test "${cf_cv_func_mkstemp+set}" = set; then
17424   echo $ECHO_N "(cached) $ECHO_C" >&6
17425 else
17426
17427 rm -rf ./conftest*
17428 if test "$cross_compiling" = yes; then
17429   cf_cv_func_mkstemp=maybe
17430 else
17431   cat >"conftest.$ac_ext" <<_ACEOF
17432 #line 17432 "configure"
17433 #include "confdefs.h"
17434
17435 $ac_includes_default
17436
17437 int main(void)
17438 {
17439         char *tmpl = "conftestXXXXXX";
17440         char name[2][80];
17441         int n;
17442         int result = 0;
17443         int fd;
17444         struct stat sb;
17445
17446         umask(077);
17447         for (n = 0; n < 2; ++n) {
17448                 strcpy(name[n], tmpl);
17449                 if ((fd = mkstemp(name[n])) >= 0) {
17450                         if (!strcmp(name[n], tmpl)
17451                          || stat(name[n], &sb) != 0
17452                          || (sb.st_mode & S_IFMT) != S_IFREG
17453                          || (sb.st_mode & 077) != 0) {
17454                                 result = 1;
17455                         }
17456                         close(fd);
17457                 }
17458         }
17459         if (result == 0
17460          && !strcmp(name[0], name[1]))
17461                 result = 1;
17462         ${cf_cv_main_return:-return}(result);
17463 }
17464
17465 _ACEOF
17466 rm -f "conftest$ac_exeext"
17467 if { (eval echo "$as_me:17467: \"$ac_link\"") >&5
17468   (eval $ac_link) 2>&5
17469   ac_status=$?
17470   echo "$as_me:17470: \$? = $ac_status" >&5
17471   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17472   { (eval echo "$as_me:17472: \"$ac_try\"") >&5
17473   (eval $ac_try) 2>&5
17474   ac_status=$?
17475   echo "$as_me:17475: \$? = $ac_status" >&5
17476   (exit "$ac_status"); }; }; then
17477   cf_cv_func_mkstemp=yes
17478
17479 else
17480   echo "$as_me: program exited with status $ac_status" >&5
17481 echo "$as_me: failed program was:" >&5
17482 cat "conftest.$ac_ext" >&5
17483 cf_cv_func_mkstemp=no
17484
17485 fi
17486 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17487 fi
17488
17489 fi
17490 echo "$as_me:17490: result: $cf_cv_func_mkstemp" >&5
17491 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17492 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17493         echo "$as_me:17493: checking for mkstemp" >&5
17494 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17495 if test "${ac_cv_func_mkstemp+set}" = set; then
17496   echo $ECHO_N "(cached) $ECHO_C" >&6
17497 else
17498   cat >"conftest.$ac_ext" <<_ACEOF
17499 #line 17499 "configure"
17500 #include "confdefs.h"
17501 #define mkstemp autoconf_temporary
17502 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17503 #undef mkstemp
17504
17505 #ifdef __cplusplus
17506 extern "C"
17507 #endif
17508
17509 /* We use char because int might match the return type of a gcc2
17510    builtin and then its argument prototype would still apply.  */
17511 char mkstemp (void);
17512
17513 int
17514 main (void)
17515 {
17516
17517 /* The GNU C library defines stubs for functions which it implements
17518     to always fail with ENOSYS.  Some functions are actually named
17519     something starting with __ and the normal name is an alias.  */
17520 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17521 #error found stub for mkstemp
17522 #endif
17523
17524         return mkstemp ();
17525   ;
17526   return 0;
17527 }
17528 _ACEOF
17529 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17530 if { (eval echo "$as_me:17530: \"$ac_link\"") >&5
17531   (eval $ac_link) 2>&5
17532   ac_status=$?
17533   echo "$as_me:17533: \$? = $ac_status" >&5
17534   (exit "$ac_status"); } &&
17535          { ac_try='test -s "conftest$ac_exeext"'
17536   { (eval echo "$as_me:17536: \"$ac_try\"") >&5
17537   (eval $ac_try) 2>&5
17538   ac_status=$?
17539   echo "$as_me:17539: \$? = $ac_status" >&5
17540   (exit "$ac_status"); }; }; then
17541   ac_cv_func_mkstemp=yes
17542 else
17543   echo "$as_me: failed program was:" >&5
17544 cat "conftest.$ac_ext" >&5
17545 ac_cv_func_mkstemp=no
17546 fi
17547 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17548 fi
17549 echo "$as_me:17549: result: $ac_cv_func_mkstemp" >&5
17550 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17551
17552 fi
17553 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17554
17555 cat >>confdefs.h <<\EOF
17556 #define HAVE_MKSTEMP 1
17557 EOF
17558
17559 fi
17560
17561 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17562         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17563         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17564 fi
17565
17566 cf_with_ada=yes
17567 if test "$cf_with_ada" != "no" ; then
17568
17569 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17570 do
17571
17572 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17573
17574         unset ac_cv_path_cf_TEMP_gnat
17575         unset cf_TEMP_gnat
17576         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17577 set dummy $cf_prog_gnat; ac_word=$2
17578 echo "$as_me:17578: checking for $ac_word" >&5
17579 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17580 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17581   echo $ECHO_N "(cached) $ECHO_C" >&6
17582 else
17583   case $cf_TEMP_gnat in
17584   [\\/]* | ?:[\\/]*)
17585   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17586   ;;
17587   *)
17588   ac_save_IFS=$IFS; IFS=$ac_path_separator
17589 ac_dummy="$PATH"
17590 for ac_dir in $ac_dummy; do
17591   IFS=$ac_save_IFS
17592   test -z "$ac_dir" && ac_dir=.
17593   if $as_executable_p "$ac_dir/$ac_word"; then
17594    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17595    echo "$as_me:17595: found $ac_dir/$ac_word" >&5
17596    break
17597 fi
17598 done
17599
17600   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17601   ;;
17602 esac
17603 fi
17604 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17605
17606 if test -n "$cf_TEMP_gnat"; then
17607   echo "$as_me:17607: result: $cf_TEMP_gnat" >&5
17608 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17609 else
17610   echo "$as_me:17610: result: no" >&5
17611 echo "${ECHO_T}no" >&6
17612 fi
17613
17614         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17615
17616         if test "x$cf_TEMP_gnat" != xno; then
17617                 unset cf_cv_gnat_version
17618                 unset cf_TEMP_gnat
17619
17620 echo "$as_me:17620: checking for $cf_prog_gnat version" >&5
17621 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17622 if test "${cf_cv_gnat_version+set}" = set; then
17623   echo $ECHO_N "(cached) $ECHO_C" >&6
17624 else
17625
17626 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17627         grep '[0-9].[0-9][0-9]*' |\
17628         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17629
17630 fi
17631 echo "$as_me:17631: result: $cf_cv_gnat_version" >&5
17632 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17633 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17634 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17635
17636         fi
17637         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17638
17639         unset cf_TEMP_gnat
17640         unset cf_cv_gnat_version
17641         unset ac_cv_path_cf_TEMP_gnat
17642 done
17643
17644 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17645         cf_ada_make=
17646         cf_cv_prog_gnat_correct=no
17647 else
17648         cf_ada_make=gnatmake
17649         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17650                 # gprconfig is newer than gnatmake; we can continue...
17651                 cf_ada_config="##"
17652         else
17653                 rm -rf ./conftest* ./*~conftest*
17654                 if mkdir conftest.src
17655                 then
17656                         cf_ada_config=""
17657                         cd conftest.src
17658                         for cf_gprconfig in Ada C
17659                         do
17660                                 echo "$as_me:17660: checking for gprconfig name for $cf_gprconfig" >&5
17661 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17662                                 if test "$cf_gprconfig" = C
17663                                 then
17664                                         for cf_gprconfig_param in \
17665                                                 "$cf_gprconfig,,,,GNATGCC" \
17666                                                 "$cf_gprconfig,,,,GCC" \
17667                                                 "$cf_gprconfig"
17668                                         do
17669                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17670                                                 test -n "$cf_gprconfig_value" && break
17671                                         done
17672                                 else
17673                                         cf_gprconfig_param=$cf_gprconfig
17674                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17675                                 fi
17676                                 if test -n "$cf_gprconfig_value"
17677                                 then
17678                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17679                                         echo "$as_me:17679: result: $cf_gprconfig_value" >&5
17680 echo "${ECHO_T}$cf_gprconfig_value" >&6
17681                                 else
17682                                         echo "$as_me:17682: result: missing" >&5
17683 echo "${ECHO_T}missing" >&6
17684                                         cf_ada_config="#"
17685                                         break
17686                                 fi
17687                         done
17688                         cd ..
17689                         rm -rf ./conftest* ./*~conftest*
17690                 fi
17691         fi
17692         if test "x$cf_ada_config" != "x#"
17693         then
17694
17695 echo "$as_me:17695: checking for gnat version" >&5
17696 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17697 if test "${cf_cv_gnat_version+set}" = set; then
17698   echo $ECHO_N "(cached) $ECHO_C" >&6
17699 else
17700
17701 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17702         grep '[0-9].[0-9][0-9]*' |\
17703         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17704
17705 fi
17706 echo "$as_me:17706: result: $cf_cv_gnat_version" >&5
17707 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17708 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17709
17710 case "$cf_cv_gnat_version" in
17711 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17712         cf_cv_prog_gnat_correct=yes
17713         ;;
17714 (*)
17715         { echo "$as_me:17715: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17716 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17717         cf_cv_prog_gnat_correct=no
17718         ;;
17719 esac
17720
17721                 # Extract the first word of "m4", so it can be a program name with args.
17722 set dummy m4; ac_word=$2
17723 echo "$as_me:17723: checking for $ac_word" >&5
17724 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17725 if test "${ac_cv_prog_M4_exists+set}" = set; then
17726   echo $ECHO_N "(cached) $ECHO_C" >&6
17727 else
17728   if test -n "$M4_exists"; then
17729   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17730 else
17731   ac_save_IFS=$IFS; IFS=$ac_path_separator
17732 ac_dummy="$PATH"
17733 for ac_dir in $ac_dummy; do
17734   IFS=$ac_save_IFS
17735   test -z "$ac_dir" && ac_dir=.
17736   $as_executable_p "$ac_dir/$ac_word" || continue
17737 ac_cv_prog_M4_exists="yes"
17738 echo "$as_me:17738: found $ac_dir/$ac_word" >&5
17739 break
17740 done
17741
17742   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17743 fi
17744 fi
17745 M4_exists=$ac_cv_prog_M4_exists
17746 if test -n "$M4_exists"; then
17747   echo "$as_me:17747: result: $M4_exists" >&5
17748 echo "${ECHO_T}$M4_exists" >&6
17749 else
17750   echo "$as_me:17750: result: no" >&5
17751 echo "${ECHO_T}no" >&6
17752 fi
17753
17754                 if test "$ac_cv_prog_M4_exists" = no; then
17755                         cf_cv_prog_gnat_correct=no
17756                         { echo "$as_me:17756: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17757 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17758                 fi
17759                 if test "$cf_cv_prog_gnat_correct" = yes; then
17760                         echo "$as_me:17760: checking if GNAT works" >&5
17761 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17762
17763 rm -rf ./conftest* ./*~conftest*
17764 cat >>conftest.ads <<CF_EOF
17765 procedure conftest;
17766 CF_EOF
17767 cat >>conftest.adb <<CF_EOF
17768 with Text_IO;
17769 with GNAT.OS_Lib;
17770 procedure conftest is
17771 begin
17772    Text_IO.Put ("Hello World");
17773    Text_IO.New_Line;
17774    GNAT.OS_Lib.OS_Exit (0);
17775 end conftest;
17776 CF_EOF
17777 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17778    if ( ./conftest 1>&5 2>&1 ) ; then
17779       cf_cv_prog_gnat_correct=yes
17780    else
17781       cf_cv_prog_gnat_correct=no
17782    fi
17783 else
17784    cf_cv_prog_gnat_correct=no
17785 fi
17786 rm -rf ./conftest* ./*~conftest*
17787
17788                         echo "$as_me:17788: result: $cf_cv_prog_gnat_correct" >&5
17789 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17790                 fi
17791         else
17792                 cf_cv_prog_gnat_correct=no
17793         fi
17794 fi
17795
17796         if test "$cf_cv_prog_gnat_correct" = yes; then
17797
17798         echo "$as_me:17798: checking optimization options for ADAFLAGS" >&5
17799 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17800         case "$CFLAGS" in
17801         (*-g*)
17802
17803         ADAFLAGS="$ADAFLAGS -g"
17804
17805                 ;;
17806         esac
17807         case "$CFLAGS" in
17808         (*-O*)
17809                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17810
17811         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17812
17813                 ;;
17814         esac
17815         echo "$as_me:17815: result: $ADAFLAGS" >&5
17816 echo "${ECHO_T}$ADAFLAGS" >&6
17817
17818 echo "$as_me:17818: checking if GNATPREP supports -T option" >&5
17819 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17820 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17821   echo $ECHO_N "(cached) $ECHO_C" >&6
17822 else
17823
17824 cf_cv_gnatprep_opt_t=no
17825 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17826
17827 fi
17828 echo "$as_me:17828: result: $cf_cv_gnatprep_opt_t" >&5
17829 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17830 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17831
17832 echo "$as_me:17832: checking if GNAT supports generics" >&5
17833 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17834 case "$cf_cv_gnat_version" in
17835 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17836         cf_gnat_generics=yes
17837         ;;
17838 (*)
17839         cf_gnat_generics=no
17840         ;;
17841 esac
17842 echo "$as_me:17842: result: $cf_gnat_generics" >&5
17843 echo "${ECHO_T}$cf_gnat_generics" >&6
17844
17845 if test "$cf_gnat_generics" = yes
17846 then
17847         cf_compile_generics=generics
17848         cf_generic_objects="\${GENOBJS}"
17849 else
17850         cf_compile_generics=
17851         cf_generic_objects=
17852 fi
17853
17854 echo "$as_me:17854: checking if GNAT supports SIGINT" >&5
17855 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17856 if test "${cf_cv_gnat_sigint+set}" = set; then
17857   echo $ECHO_N "(cached) $ECHO_C" >&6
17858 else
17859
17860 rm -rf ./conftest* ./*~conftest*
17861 cat >>conftest.ads <<CF_EOF
17862 with Ada.Interrupts.Names;
17863
17864 package ConfTest is
17865
17866    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17867    pragma Unreserve_All_Interrupts;
17868    pragma Warnings (On);
17869
17870    protected Process is
17871       procedure Stop;
17872       function Continue return Boolean;
17873       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17874    private
17875       Done : Boolean := False;
17876    end Process;
17877
17878 end ConfTest;
17879 CF_EOF
17880 cat >>conftest.adb <<CF_EOF
17881 package body ConfTest is
17882    protected body Process is
17883       procedure Stop is
17884       begin
17885          Done := True;
17886       end Stop;
17887       function Continue return Boolean is
17888       begin
17889          return not Done;
17890       end Continue;
17891    end Process;
17892 end ConfTest;
17893 CF_EOF
17894 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17895       cf_cv_gnat_sigint=yes
17896 else
17897    cf_cv_gnat_sigint=no
17898 fi
17899 rm -rf ./conftest* ./*~conftest*
17900
17901 fi
17902 echo "$as_me:17902: result: $cf_cv_gnat_sigint" >&5
17903 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17904
17905 if test "$cf_cv_gnat_sigint" = yes ; then
17906         USE_GNAT_SIGINT=""
17907 else
17908         USE_GNAT_SIGINT="#"
17909 fi
17910
17911 cf_gnat_libraries=no
17912 cf_gnat_projects=no
17913
17914 if test "$enable_gnat_projects" != no ; then
17915 echo "$as_me:17915: checking if GNAT supports project files" >&5
17916 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17917 case "$cf_cv_gnat_version" in
17918 (3.[0-9]*)
17919         ;;
17920 (*)
17921         case "$cf_cv_system_name" in
17922         (cygwin*|msys*)
17923                 ;;
17924         (*)
17925                 rm -rf ./conftest* ./*~conftest*
17926                 if mkdir conftest.src conftest.bin conftest.lib
17927                 then
17928                         cd conftest.src
17929                         rm -rf ./conftest* ./*~conftest*
17930                         cat >>library.gpr <<CF_EOF
17931 project Library is
17932   Kind := External ("LIB_KIND");
17933   for Library_Name use "ConfTest";
17934   for Object_Dir use ".";
17935   for Library_ALI_Dir use External("LIBRARY_DIR");
17936   for Library_Version use External ("SONAME");
17937   for Library_Kind use Kind;
17938   for Library_Dir use External("BUILD_DIR");
17939   Source_Dir := External ("SOURCE_DIR");
17940   for Source_Dirs use (Source_Dir);
17941 end Library;
17942 CF_EOF
17943                         cat >>confpackage.ads <<CF_EOF
17944 package ConfPackage is
17945    procedure conftest;
17946 end ConfPackage;
17947 CF_EOF
17948                         cat >>confpackage.adb <<CF_EOF
17949 with Text_IO;
17950 package body ConfPackage is
17951    procedure conftest is
17952    begin
17953       Text_IO.Put ("Hello World");
17954       Text_IO.New_Line;
17955    end conftest;
17956 end ConfPackage;
17957 CF_EOF
17958                         if ( "$cf_ada_make" $ADAFLAGS \
17959                                         -Plibrary.gpr \
17960                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17961                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17962                                         -XSOURCE_DIR="`pwd`" \
17963                                         -XSONAME=libConfTest.so.1 \
17964                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17965                                 cf_gnat_projects=yes
17966                         fi
17967                         cd ..
17968                 fi
17969                 if test -f conftest.lib/confpackage.ali
17970                 then
17971                         cf_gnat_libraries=yes
17972                 fi
17973                 rm -rf ./conftest* ./*~conftest*
17974                 ;;
17975         esac
17976         ;;
17977 esac
17978 echo "$as_me:17978: result: $cf_gnat_projects" >&5
17979 echo "${ECHO_T}$cf_gnat_projects" >&6
17980 fi # enable_gnat_projects
17981
17982 if test "$cf_gnat_projects" = yes
17983 then
17984         echo "$as_me:17984: checking if GNAT supports libraries" >&5
17985 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17986         echo "$as_me:17986: result: $cf_gnat_libraries" >&5
17987 echo "${ECHO_T}$cf_gnat_libraries" >&6
17988 fi
17989
17990 USE_OLD_MAKERULES=""
17991 USE_GNAT_PROJECTS="#"
17992 USE_GNAT_MAKE_GPR="#"
17993 USE_GNAT_GPRBUILD="#"
17994
17995 if test "$cf_gnat_projects" = yes
17996 then
17997         USE_OLD_MAKERULES="#"
17998         USE_GNAT_PROJECTS=""
17999         if test "$cf_cv_VERSION_GPRBUILD" != no
18000         then
18001                 USE_GNAT_GPRBUILD=""
18002         elif test "$cf_cv_VERSION_GNATMAKE" != no
18003         then
18004                 USE_GNAT_MAKE_GPR=""
18005         else
18006                 { echo "$as_me:18006: WARNING: use old makefile rules since tools are missing" >&5
18007 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
18008         fi
18009 fi
18010
18011 if test "$cf_gnat_libraries" = yes
18012 then
18013         USE_GNAT_LIBRARIES=""
18014 else
18015         USE_GNAT_LIBRARIES="#"
18016 fi
18017
18018 echo "$as_me:18018: checking for ada-compiler" >&5
18019 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
18020
18021 # Check whether --with-ada-compiler or --without-ada-compiler was given.
18022 if test "${with_ada_compiler+set}" = set; then
18023   withval="$with_ada_compiler"
18024   cf_ada_compiler=$withval
18025 else
18026   cf_ada_compiler=gnatmake
18027 fi;
18028
18029 echo "$as_me:18029: result: $cf_ada_compiler" >&5
18030 echo "${ECHO_T}$cf_ada_compiler" >&6
18031
18032                 cf_ada_package=terminal_interface
18033
18034 echo "$as_me:18034: checking for ada-include" >&5
18035 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
18036
18037 # Check whether --with-ada-include or --without-ada-include was given.
18038 if test "${with_ada_include+set}" = set; then
18039   withval="$with_ada_include"
18040
18041 else
18042   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18043 fi; if test -n "$prefix/share/ada/adainclude" ; then
18044
18045 if test "x$prefix" != xNONE; then
18046         cf_path_syntax="$prefix"
18047 else
18048         cf_path_syntax="$ac_default_prefix"
18049 fi
18050
18051 case ".$withval" in
18052 (.\$\(*\)*|.\'*\'*)
18053         ;;
18054 (..|./*|.\\*)
18055         ;;
18056 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18057         ;;
18058 (.\$\{*prefix\}*|.\$\{*dir\}*)
18059         eval withval="$withval"
18060         case ".$withval" in
18061         (.NONE/*)
18062                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18063                 ;;
18064         esac
18065         ;;
18066 (.no|.NONE/*)
18067         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18068         ;;
18069 (*)
18070         { { echo "$as_me:18070: error: expected a pathname, not \"$withval\"" >&5
18071 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18072    { (exit 1); exit 1; }; }
18073         ;;
18074 esac
18075
18076 fi
18077 eval ADA_INCLUDE="$withval"
18078
18079 echo "$as_me:18079: result: $ADA_INCLUDE" >&5
18080 echo "${ECHO_T}$ADA_INCLUDE" >&6
18081
18082 echo "$as_me:18082: checking for ada-objects" >&5
18083 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
18084
18085 # Check whether --with-ada-objects or --without-ada-objects was given.
18086 if test "${with_ada_objects+set}" = set; then
18087   withval="$with_ada_objects"
18088
18089 else
18090   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18091 fi; if test -n "$prefix/lib/ada/adalib" ; then
18092
18093 if test "x$prefix" != xNONE; then
18094         cf_path_syntax="$prefix"
18095 else
18096         cf_path_syntax="$ac_default_prefix"
18097 fi
18098
18099 case ".$withval" in
18100 (.\$\(*\)*|.\'*\'*)
18101         ;;
18102 (..|./*|.\\*)
18103         ;;
18104 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18105         ;;
18106 (.\$\{*prefix\}*|.\$\{*dir\}*)
18107         eval withval="$withval"
18108         case ".$withval" in
18109         (.NONE/*)
18110                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18111                 ;;
18112         esac
18113         ;;
18114 (.no|.NONE/*)
18115         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18116         ;;
18117 (*)
18118         { { echo "$as_me:18118: error: expected a pathname, not \"$withval\"" >&5
18119 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18120    { (exit 1); exit 1; }; }
18121         ;;
18122 esac
18123
18124 fi
18125 eval ADA_OBJECTS="$withval"
18126
18127 echo "$as_me:18127: result: $ADA_OBJECTS" >&5
18128 echo "${ECHO_T}$ADA_OBJECTS" >&6
18129
18130 echo "$as_me:18130: checking if an Ada95 shared-library should be built" >&5
18131 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18132
18133 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18134 if test "${with_ada_sharedlib+set}" = set; then
18135   withval="$with_ada_sharedlib"
18136   with_ada_sharedlib=$withval
18137 else
18138   with_ada_sharedlib=no
18139 fi;
18140 echo "$as_me:18140: result: $with_ada_sharedlib" >&5
18141 echo "${ECHO_T}$with_ada_sharedlib" >&6
18142
18143 if test "x$with_ada_sharedlib" != xno
18144 then
18145         if test "x$cf_gnat_projects" != xyes
18146         then
18147                 { echo "$as_me:18147: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18148 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18149                 with_ada_sharedlib=no
18150         fi
18151 fi
18152
18153 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18154 MAKE_ADA_SHAREDLIB="#"
18155
18156 if test "x$with_ada_sharedlib" != xno
18157 then
18158         MAKE_ADA_SHAREDLIB=
18159         if test "x$with_ada_sharedlib" != xyes
18160         then
18161                 ADA_SHAREDLIB="$with_ada_sharedlib"
18162         fi
18163 fi
18164
18165                 # allow the Ada binding to be renamed
18166
18167 echo "$as_me:18167: checking for ada-libname" >&5
18168 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18169
18170 # Check whether --with-ada-libname or --without-ada-libname was given.
18171 if test "${with_ada_libname+set}" = set; then
18172   withval="$with_ada_libname"
18173   ADA_LIBNAME=$withval
18174 else
18175   ADA_LIBNAME=AdaCurses
18176 fi;
18177 case "x$ADA_LIBNAME" in
18178 (x|xyes|xno)
18179         ADA_LIBNAME=AdaCurses
18180         ;;
18181 esac
18182
18183 echo "$as_me:18183: result: $ADA_LIBNAME" >&5
18184 echo "${ECHO_T}$ADA_LIBNAME" >&6
18185
18186         else
18187                 { { echo "$as_me:18187: error: No usable Ada compiler found" >&5
18188 echo "$as_me: error: No usable Ada compiler found" >&2;}
18189    { (exit 1); exit 1; }; }
18190         fi
18191 else
18192         { { echo "$as_me:18192: error: The Ada compiler is needed for this package" >&5
18193 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18194    { (exit 1); exit 1; }; }
18195 fi
18196
18197 ################################################################################
18198
18199 # not needed
18200 TINFO_LDFLAGS2=
18201
18202 TINFO_LIBS=
18203
18204 ### Construct the list of include-directories to be generated
18205
18206 if test "$srcdir" != "."; then
18207         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18208 fi
18209 CPPFLAGS="-I../include $CPPFLAGS"
18210 if test "$srcdir" != "."; then
18211         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18212 fi
18213 CPPFLAGS="-I. $CPPFLAGS"
18214
18215 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18216 if test "$srcdir" != "."; then
18217         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18218 fi
18219 if test "$GCC" != yes; then
18220         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18221 elif test "$includedir" != "/usr/include"; then
18222         if test "$includedir" = '${prefix}/include' ; then
18223                 if test x$prefix != x/usr ; then
18224                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18225                 fi
18226         else
18227                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18228         fi
18229 fi
18230
18231 ### Build up pieces for makefile rules
18232 echo "$as_me:18232: checking default library suffix" >&5
18233 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18234
18235         case $DFT_LWR_MODEL in
18236         (libtool) DFT_ARG_SUFFIX=''   ;;
18237         (normal)  DFT_ARG_SUFFIX=''   ;;
18238         (debug)   DFT_ARG_SUFFIX='_g' ;;
18239         (profile) DFT_ARG_SUFFIX='_p' ;;
18240         (shared)  DFT_ARG_SUFFIX=''   ;;
18241         esac
18242         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18243 echo "$as_me:18243: result: $DFT_ARG_SUFFIX" >&5
18244 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18245
18246 echo "$as_me:18246: checking default library-dependency suffix" >&5
18247 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18248
18249         case X$DFT_LWR_MODEL in
18250         (Xlibtool)
18251                 DFT_LIB_SUFFIX='.la'
18252                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18253                 ;;
18254         (Xdebug)
18255                 case "$cf_cv_system_name" in
18256                 (*-msvc*)
18257                         DFT_LIB_SUFFIX='_g.lib'
18258                         ;;
18259                 (*)
18260                         DFT_LIB_SUFFIX='_g.a'
18261                         ;;
18262                 esac
18263                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18264                 ;;
18265         (Xprofile)
18266                 case "$cf_cv_system_name" in
18267                 (*-msvc*)
18268                         DFT_LIB_SUFFIX='_p.lib'
18269                         ;;
18270                 (*)
18271                         DFT_LIB_SUFFIX='_p.a'
18272                         ;;
18273                 esac
18274                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18275                 ;;
18276         (Xshared)
18277                 case "$cf_cv_system_name" in
18278                 (aix[5-7]*)
18279                         DFT_LIB_SUFFIX='.so'
18280                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18281                         ;;
18282                 (*-msvc*)
18283                         DFT_LIB_SUFFIX='.dll'
18284                         DFT_DEP_SUFFIX='.dll.lib'
18285                         ;;
18286                 (cygwin*|msys*|mingw*)
18287                         DFT_LIB_SUFFIX='.dll'
18288                         DFT_DEP_SUFFIX='.dll.a'
18289                         ;;
18290                 (darwin*)
18291                         DFT_LIB_SUFFIX='.dylib'
18292                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18293                         ;;
18294                 (hpux*)
18295                         case "$target" in
18296                         (ia64*)
18297                                 DFT_LIB_SUFFIX='.so'
18298                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18299                                 ;;
18300                         (*)
18301                                 DFT_LIB_SUFFIX='.sl'
18302                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18303                                 ;;
18304                         esac
18305                         ;;
18306                 (*)
18307                         DFT_LIB_SUFFIX='.so'
18308                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18309                         ;;
18310                 esac
18311                 ;;
18312         (*)
18313                 case "$target" in
18314                 (*-msvc*)
18315                         DFT_LIB_SUFFIX='.lib'
18316                         ;;
18317                 (*)
18318                         DFT_LIB_SUFFIX='.a'
18319                         ;;
18320                 esac
18321                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18322                 ;;
18323         esac
18324         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18325         then
18326                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18327                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18328         fi
18329 echo "$as_me:18329: result: $DFT_DEP_SUFFIX" >&5
18330 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18331
18332 echo "$as_me:18332: checking default object directory" >&5
18333 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18334
18335         case $DFT_LWR_MODEL in
18336         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18337         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18338         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18339         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18340         (shared)
18341                 case "$cf_cv_system_name" in
18342                 (cygwin|msys)
18343                         DFT_OBJ_SUBDIR='objects' ;;
18344                 (*)
18345                         DFT_OBJ_SUBDIR='obj_s' ;;
18346                 esac
18347         esac
18348 echo "$as_me:18348: result: $DFT_OBJ_SUBDIR" >&5
18349 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18350
18351 ### Set up low-level terminfo dependencies for makefiles.
18352
18353 if test "$DFT_LWR_MODEL" = shared ; then
18354         case $cf_cv_system_name in
18355         (cygwin*)
18356                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18357                 ;;
18358         (msys*)
18359                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18360                 ;;
18361         esac
18362 fi
18363
18364 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18365
18366 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18367
18368 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18369
18370 ### Construct the list of subdirectories for which we'll customize makefiles
18371 ### with the appropriate compile-rules.
18372
18373 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18374
18375 cat >>confdefs.h <<EOF
18376 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18377 EOF
18378
18379 ################################################################################
18380
18381 TEST_ARG2=
18382
18383 TEST_LIBS2=
18384
18385 NCURSES_SHLIB2="sh -c"
18386
18387 ADA_SUBDIRS="include gen src doc"
18388 if test "x$cf_with_tests" != "xno" ; then
18389         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18390 fi
18391 for cf_dir in $ADA_SUBDIRS
18392 do
18393         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18394 done
18395
18396 NCURSES_TREE="#"
18397
18398 EXTERNAL_TREE=
18399
18400 # match layout used by make-tar.sh
18401 ADAHTML_DIR=../doc/ada
18402
18403 if test "x$cross_compiling" = xyes ; then
18404         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18405 else
18406         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18407 fi
18408
18409 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"
18410 ac_config_commands="$ac_config_commands default"
18411 cat >confcache <<\_ACEOF
18412 # This file is a shell script that caches the results of configure
18413 # tests run on this system so they can be shared between configure
18414 # scripts and configure runs, see configure's option --config-cache.
18415 # It is not useful on other systems.  If it contains results you don't
18416 # want to keep, you may remove or edit it.
18417 #
18418 # config.status only pays attention to the cache file if you give it
18419 # the --recheck option to rerun configure.
18420 #
18421 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18422 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18423 # following values.
18424
18425 _ACEOF
18426
18427 # The following way of writing the cache mishandles newlines in values,
18428 # but we know of no workaround that is simple, portable, and efficient.
18429 # So, don't put newlines in cache variables' values.
18430 # Ultrix sh set writes to stderr and can't be redirected directly,
18431 # and sets the high bit in the cache file unless we assign to the vars.
18432 {
18433   (set) 2>&1 |
18434     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18435     *ac_space=\ *)
18436       # `set' does not quote correctly, so add quotes (double-quote
18437       # substitution turns \\\\ into \\, and sed turns \\ into \).
18438       sed -n \
18439         "s/'/'\\\\''/g;
18440           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18441       ;;
18442     *)
18443       # `set' quotes correctly as required by POSIX, so do not add quotes.
18444       sed -n \
18445         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18446       ;;
18447     esac;
18448 } |
18449   sed '
18450      t clear
18451      : clear
18452      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18453      t end
18454      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18455      : end' >>confcache
18456 if cmp -s $cache_file confcache; then :; else
18457   if test -w $cache_file; then
18458     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18459     cat confcache >$cache_file
18460   else
18461     echo "not updating unwritable cache $cache_file"
18462   fi
18463 fi
18464 rm -f confcache
18465
18466 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18467 # Let make expand exec_prefix.
18468 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18469
18470 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18471 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18472 # trailing colons and then remove the whole line if VPATH becomes empty
18473 # (actually we leave an empty line to preserve line numbers).
18474 if test "x$srcdir" = x.; then
18475   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18476 s/:*\$(srcdir):*/:/;
18477 s/:*\${srcdir}:*/:/;
18478 s/:*@srcdir@:*/:/;
18479 s/^\([^=]*=[    ]*\):*/\1/;
18480 s/:*$//;
18481 s/^[^=]*=[      ]*$//;
18482 }'
18483 fi
18484
18485 DEFS=-DHAVE_CONFIG_H
18486
18487 : "${CONFIG_STATUS=./config.status}"
18488 ac_clean_files_save=$ac_clean_files
18489 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18490 { echo "$as_me:18490: creating $CONFIG_STATUS" >&5
18491 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18492 cat >"$CONFIG_STATUS" <<_ACEOF
18493 #! $SHELL
18494 # Generated automatically by configure.
18495 # Run this file to recreate the current configuration.
18496 # Compiler output produced by configure, useful for debugging
18497 # configure, is in config.log if it exists.
18498
18499 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18500
18501 debug=false
18502 SHELL=\${CONFIG_SHELL-$SHELL}
18503 ac_cs_invocation="\$0 \$@"
18504
18505 CLICOLOR_FORCE= GREP_OPTIONS=
18506 unset CLICOLOR_FORCE GREP_OPTIONS
18507 _ACEOF
18508
18509 cat >>"$CONFIG_STATUS" <<\_ACEOF
18510 # Be Bourne compatible
18511 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18512   emulate sh
18513   NULLCMD=:
18514 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18515   set -o posix
18516 fi
18517
18518 # Name of the executable.
18519 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18520
18521 if expr a : '\(a\)' >/dev/null 2>&1; then
18522   as_expr="expr"
18523 else
18524   as_expr="false"
18525 fi
18526
18527 rm -f conf$$ conf$$.exe conf$$.file
18528 echo >conf$$.file
18529 if ln -s conf$$.file conf$$ 2>/dev/null; then
18530   # We could just check for DJGPP; but this test a) works b) is more generic
18531   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18532   if test -f conf$$.exe; then
18533     # Don't use ln at all; we don't have any links
18534     as_ln_s='cp -p'
18535   else
18536     as_ln_s='ln -s'
18537   fi
18538 elif ln conf$$.file conf$$ 2>/dev/null; then
18539   as_ln_s='ln'
18540 else
18541   as_ln_s='cp -p'
18542 fi
18543 rm -f conf$$ conf$$.exe conf$$.file
18544
18545 as_executable_p="test -f"
18546
18547 # Support unset when possible.
18548 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18549   as_unset="unset"
18550 else
18551   as_unset="false"
18552 fi
18553
18554 # NLS nuisances.
18555 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18556 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18557 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18558 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18559 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18560 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18561 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18562 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18563
18564 # IFS
18565 # We need space, tab and new line, in precisely that order.
18566 as_nl='
18567 '
18568 IFS="   $as_nl"
18569
18570 # CDPATH.
18571 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18572
18573 exec 6>&1
18574
18575 _ACEOF
18576
18577 # Files that config.status was made for.
18578 if test -n "$ac_config_files"; then
18579   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18580 fi
18581
18582 if test -n "$ac_config_headers"; then
18583   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18584 fi
18585
18586 if test -n "$ac_config_links"; then
18587   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18588 fi
18589
18590 if test -n "$ac_config_commands"; then
18591   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18592 fi
18593
18594 cat >>"$CONFIG_STATUS" <<\EOF
18595
18596 ac_cs_usage="\
18597 \`$as_me' instantiates files from templates according to the
18598 current configuration.
18599
18600 Usage: $0 [OPTIONS] [FILE]...
18601
18602   -h, --help       print this help, then exit
18603   -V, --version    print version number, then exit
18604   -d, --debug      don't remove temporary files
18605       --recheck    update $as_me by reconfiguring in the same conditions
18606   --file=FILE[:TEMPLATE]
18607                    instantiate the configuration file FILE
18608   --header=FILE[:TEMPLATE]
18609                    instantiate the configuration header FILE
18610
18611 Configuration files:
18612 $config_files
18613
18614 Configuration headers:
18615 $config_headers
18616
18617 Configuration commands:
18618 $config_commands
18619
18620 Report bugs to <dickey@invisible-island.net>."
18621 EOF
18622
18623 cat >>"$CONFIG_STATUS" <<EOF
18624 ac_cs_version="\\
18625 config.status
18626 configured by $0, generated by GNU Autoconf 2.52.20230114,
18627   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18628
18629 Copyright 2003-2022,2023        Thomas E. Dickey
18630 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18631 Free Software Foundation, Inc.
18632 This config.status script is free software; the Free Software Foundation
18633 gives unlimited permission to copy, distribute and modify it."
18634 srcdir="$srcdir"
18635 INSTALL="$INSTALL"
18636 EOF
18637
18638 cat >>"$CONFIG_STATUS" <<\EOF
18639 # If no file are specified by the user, then we need to provide default
18640 # value.  By we need to know if files were specified by the user.
18641 ac_need_defaults=:
18642 while test $# != 0
18643 do
18644   case $1 in
18645   --*=*)
18646     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18647     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18648     shift
18649     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18650     shift
18651     ;;
18652   -*);;
18653   *) # This is not an option, so the user has probably given explicit
18654      # arguments.
18655      ac_need_defaults=false;;
18656   esac
18657
18658   case $1 in
18659   # Handling of the options.
18660 EOF
18661 cat >>"$CONFIG_STATUS" <<EOF
18662   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18663     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18664     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18665 EOF
18666 cat >>"$CONFIG_STATUS" <<\EOF
18667   --version | --vers* | -V )
18668     echo "$ac_cs_version"; exit 0 ;;
18669   --he | --h)
18670     # Conflict between --help and --header
18671     { { echo "$as_me:18671: error: ambiguous option: $1
18672 Try \`$0 --help' for more information." >&5
18673 echo "$as_me: error: ambiguous option: $1
18674 Try \`$0 --help' for more information." >&2;}
18675    { (exit 1); exit 1; }; };;
18676   --help | --hel | -h )
18677     echo "$ac_cs_usage"; exit 0 ;;
18678   --debug | --d* | -d )
18679     debug=: ;;
18680   --file | --fil | --fi | --f )
18681     shift
18682     CONFIG_FILES="$CONFIG_FILES $1"
18683     ac_need_defaults=false;;
18684   --header | --heade | --head | --hea )
18685     shift
18686     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18687     ac_need_defaults=false;;
18688
18689   # This is an error.
18690   -*) { { echo "$as_me:18690: error: unrecognized option: $1
18691 Try \`$0 --help' for more information." >&5
18692 echo "$as_me: error: unrecognized option: $1
18693 Try \`$0 --help' for more information." >&2;}
18694    { (exit 1); exit 1; }; } ;;
18695
18696   *) ac_config_targets="$ac_config_targets $1" ;;
18697
18698   esac
18699   shift
18700 done
18701
18702 exec 5>>config.log
18703 cat >&5 << _ACEOF
18704
18705 ## ----------------------- ##
18706 ## Running config.status.  ##
18707 ## ----------------------- ##
18708
18709 This file was extended by $as_me 2.52.20230114, executed with
18710   CONFIG_FILES    = $CONFIG_FILES
18711   CONFIG_HEADERS  = $CONFIG_HEADERS
18712   CONFIG_LINKS    = $CONFIG_LINKS
18713   CONFIG_COMMANDS = $CONFIG_COMMANDS
18714   > "$ac_cs_invocation"
18715 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18716
18717 _ACEOF
18718 EOF
18719
18720 cat >>"$CONFIG_STATUS" <<EOF
18721 #
18722 # INIT-COMMANDS section.
18723 #
18724
18725 ### Special initialization commands, used to pass information from the
18726 ### configuration-run into config.status
18727
18728 AWK="$AWK"
18729 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18730 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18731 LIB_NAME="$LIB_NAME"
18732 LIB_PREFIX="$LIB_PREFIX"
18733 LIB_SUFFIX="$LIB_SUFFIX"
18734 LN_S="$LN_S"
18735 NCURSES_MAJOR="$NCURSES_MAJOR"
18736 NCURSES_MINOR="$NCURSES_MINOR"
18737 NCURSES_PATCH="$NCURSES_PATCH"
18738 PACKAGE="$PACKAGE"
18739 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18740 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18741 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18742 cf_cv_abi_version="$cf_cv_abi_version"
18743 cf_cv_rel_version="$cf_cv_rel_version"
18744 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18745 cf_cv_shared_soname='$cf_cv_shared_soname'
18746 cf_cv_shlib_version="$cf_cv_shlib_version"
18747 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18748 cf_cv_system_name="$cf_cv_system_name"
18749 host="$host"
18750 target="$target"
18751
18752 EOF
18753
18754 cat >>"$CONFIG_STATUS" <<\EOF
18755 for ac_config_target in $ac_config_targets
18756 do
18757   case "$ac_config_target" in
18758   # Handling of arguments.
18759   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18760   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18761   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18762   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18763   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18764   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18765   *) { { echo "$as_me:18765: error: invalid argument: $ac_config_target" >&5
18766 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18767    { (exit 1); exit 1; }; };;
18768   esac
18769 done
18770
18771 # If the user did not use the arguments to specify the items to instantiate,
18772 # then the envvar interface is used.  Set only those that are not.
18773 # We use the long form for the default assignment because of an extremely
18774 # bizarre bug on SunOS 4.1.3.
18775 if "$ac_need_defaults"; then
18776   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18777   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18778   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18779 fi
18780
18781 # Create a temporary directory, and hook for its removal unless debugging.
18782 $debug ||
18783 {
18784   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18785   trap '{ (exit 1); exit 1; }' 1 2 13 15
18786 }
18787
18788 # Create a (secure) tmp directory for tmp files.
18789 : "${TMPDIR=/tmp}"
18790 {
18791   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18792   test -n "$tmp" && test -d "$tmp"
18793 }  ||
18794 {
18795   tmp=$TMPDIR/cs$$-$RANDOM
18796   (umask 077 && mkdir "$tmp")
18797 } ||
18798 {
18799    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18800    { (exit 1); exit 1; }
18801 }
18802
18803 EOF
18804
18805 cat >>"$CONFIG_STATUS" <<EOF
18806
18807 #
18808 # CONFIG_FILES section.
18809 #
18810
18811 # No need to generate the scripts if there are no CONFIG_FILES.
18812 # This happens for instance when ./config.status config.h
18813 if test -n "\$CONFIG_FILES"; then
18814   # Protect against being on the right side of a sed subst in config.status.
18815   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18816    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
18817 s,@SHELL@,$SHELL,;t t
18818 s,@exec_prefix@,$exec_prefix,;t t
18819 s,@prefix@,$prefix,;t t
18820 s,@program_transform_name@,$program_transform_name,;t t
18821 s,@bindir@,$bindir,;t t
18822 s,@sbindir@,$sbindir,;t t
18823 s,@libexecdir@,$libexecdir,;t t
18824 s,@datarootdir@,$datarootdir,;t t
18825 s,@datadir@,$datadir,;t t
18826 s,@sysconfdir@,$sysconfdir,;t t
18827 s,@sharedstatedir@,$sharedstatedir,;t t
18828 s,@localstatedir@,$localstatedir,;t t
18829 s,@runstatedir@,$runstatedir,;t t
18830 s,@libdir@,$libdir,;t t
18831 s,@includedir@,$includedir,;t t
18832 s,@oldincludedir@,$oldincludedir,;t t
18833 s,@infodir@,$infodir,;t t
18834 s,@mandir@,$mandir,;t t
18835 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18836 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18837 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18838 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18839 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18840 s,@build_alias@,$build_alias,;t t
18841 s,@host_alias@,$host_alias,;t t
18842 s,@target_alias@,$target_alias,;t t
18843 s,@ECHO_C@,$ECHO_C,;t t
18844 s,@ECHO_N@,$ECHO_N,;t t
18845 s,@ECHO_T@,$ECHO_T,;t t
18846 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18847 s,@DEFS@,$DEFS,;t t
18848 s,@LIBS@,$LIBS,;t t
18849 s,@PACKAGE@,$PACKAGE,;t t
18850 s,@top_builddir@,$top_builddir,;t t
18851 s,@build@,$build,;t t
18852 s,@build_cpu@,$build_cpu,;t t
18853 s,@build_vendor@,$build_vendor,;t t
18854 s,@build_os@,$build_os,;t t
18855 s,@host@,$host,;t t
18856 s,@host_cpu@,$host_cpu,;t t
18857 s,@host_vendor@,$host_vendor,;t t
18858 s,@host_os@,$host_os,;t t
18859 s,@target@,$target,;t t
18860 s,@target_cpu@,$target_cpu,;t t
18861 s,@target_vendor@,$target_vendor,;t t
18862 s,@target_os@,$target_os,;t t
18863 s,@GREP@,$GREP,;t t
18864 s,@FGREP@,$FGREP,;t t
18865 s,@CC@,$CC,;t t
18866 s,@CFLAGS@,$CFLAGS,;t t
18867 s,@LDFLAGS@,$LDFLAGS,;t t
18868 s,@CPPFLAGS@,$CPPFLAGS,;t t
18869 s,@ac_ct_CC@,$ac_ct_CC,;t t
18870 s,@EXEEXT@,$EXEEXT,;t t
18871 s,@OBJEXT@,$OBJEXT,;t t
18872 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18873 s,@CPP@,$CPP,;t t
18874 s,@EGREP@,$EGREP,;t t
18875 s,@AWK@,$AWK,;t t
18876 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18877 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18878 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18879 s,@LN_S@,$LN_S,;t t
18880 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18881 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18882 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18883 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18884 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18885 s,@SET_MAKE@,$SET_MAKE,;t t
18886 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18887 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18888 s,@CTAGS@,$CTAGS,;t t
18889 s,@ETAGS@,$ETAGS,;t t
18890 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18891 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18892 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18893 s,@RANLIB@,$RANLIB,;t t
18894 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18895 s,@LD@,$LD,;t t
18896 s,@ac_ct_LD@,$ac_ct_LD,;t t
18897 s,@AR@,$AR,;t t
18898 s,@ac_ct_AR@,$ac_ct_AR,;t t
18899 s,@ARFLAGS@,$ARFLAGS,;t t
18900 s,@DESTDIR@,$DESTDIR,;t t
18901 s,@BUILD_CC@,$BUILD_CC,;t t
18902 s,@BUILD_CPP@,$BUILD_CPP,;t t
18903 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18904 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18905 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18906 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18907 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18908 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18909 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18910 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18911 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18912 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18913 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18914 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18915 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18916 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18917 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18918 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18919 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18920 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18921 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18922 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18923 s,@CC_G_OPT@,$CC_G_OPT,;t t
18924 s,@LD_MODEL@,$LD_MODEL,;t t
18925 s,@shlibdir@,$shlibdir,;t t
18926 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18927 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18928 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18929 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18930 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18931 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18932 s,@LINK_PROGS@,$LINK_PROGS,;t t
18933 s,@LINK_TESTS@,$LINK_TESTS,;t t
18934 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18935 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18936 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18937 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18938 s,@RPATH_LIST@,$RPATH_LIST,;t t
18939 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18940 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18941 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18942 s,@PTHREAD@,$PTHREAD,;t t
18943 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18944 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18945 s,@ECHO_LT@,$ECHO_LT,;t t
18946 s,@ECHO_LD@,$ECHO_LD,;t t
18947 s,@RULE_CC@,$RULE_CC,;t t
18948 s,@SHOW_CC@,$SHOW_CC,;t t
18949 s,@ECHO_CC@,$ECHO_CC,;t t
18950 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18951 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18952 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18953 s,@ADAFLAGS@,$ADAFLAGS,;t t
18954 s,@ADA_TRACE@,$ADA_TRACE,;t t
18955 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18956 s,@M4_exists@,$M4_exists,;t t
18957 s,@cf_ada_make@,$cf_ada_make,;t t
18958 s,@cf_ada_config@,$cf_ada_config,;t t
18959 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18960 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18961 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18962 s,@cf_compile_generics@,$cf_compile_generics,;t t
18963 s,@cf_generic_objects@,$cf_generic_objects,;t t
18964 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18965 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18966 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18967 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18968 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18969 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18970 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18971 s,@cf_ada_package@,$cf_ada_package,;t t
18972 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18973 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18974 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18975 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18976 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18977 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18978 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18979 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18980 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18981 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18982 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18983 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18984 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18985 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18986 s,@TEST_ARG2@,$TEST_ARG2,;t t
18987 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18988 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18989 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18990 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18991 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18992 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18993 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18994 CEOF
18995
18996 EOF
18997
18998   cat >>"$CONFIG_STATUS" <<\EOF
18999   # Split the substitutions into bite-sized pieces for seds with
19000   # small command number limits, like on Digital OSF/1 and HP-UX.
19001   ac_max_sed_lines=48
19002   ac_sed_frag=1 # Number of current file.
19003   ac_beg=1 # First line for current file.
19004   ac_end=$ac_max_sed_lines # Line after last line for current file.
19005   ac_more_lines=:
19006   ac_sed_cmds=
19007   while "$ac_more_lines"; do
19008     if test "$ac_beg" -gt 1; then
19009       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19010     else
19011       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19012     fi
19013     if test ! -s "$tmp"/subs.frag; then
19014       ac_more_lines=false
19015     else
19016       # The purpose of the label and of the branching condition is to
19017       # speed up the sed processing (if there are no `@' at all, there
19018       # is no need to browse any of the substitutions).
19019       # These are the two extra sed commands mentioned above.
19020       (echo ':t
19021   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19022       # It is possible to make a multiline substitution using escaped newlines.
19023       # Ensure that we do not split the substitution between script fragments.
19024       ac_BEG=$ac_end
19025       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19026       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19027       if test -s "$tmp"/subs.next; then
19028         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19029         if test ! -s "$tmp"/subs.edit; then
19030           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19031           if test ! -s "$tmp"/subs.edit; then
19032             if test "$ac_beg" -gt 1; then
19033               ac_end=`expr "$ac_end" - 1`
19034               continue
19035             fi
19036           fi
19037         fi
19038       fi
19039
19040       if test -z "$ac_sed_cmds"; then
19041         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19042       else
19043         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19044       fi
19045       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19046       ac_beg=$ac_end
19047       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19048     fi
19049   done
19050   if test -z "$ac_sed_cmds"; then
19051     ac_sed_cmds="cat"
19052   fi
19053 fi # test -n "$CONFIG_FILES"
19054
19055 EOF
19056 cat >>"$CONFIG_STATUS" <<\EOF
19057 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19058   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19059   case "$ac_file" in
19060   - | *:- | *:-:* ) # input from stdin
19061         cat >"$tmp"/stdin
19062         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19063         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19064   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19065         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19066   * )   ac_file_in=$ac_file.in ;;
19067   esac
19068
19069   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19070   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19071          X"$ac_file" : 'X\(//\)[^/]' \| \
19072          X"$ac_file" : 'X\(//\)$' \| \
19073          X"$ac_file" : 'X\(/\)' \| \
19074          .     : '\(.\)' 2>/dev/null ||
19075 echo X"$ac_file" |
19076     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19077           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19078           /^X\(\/\/\)$/{ s//\1/; q; }
19079           /^X\(\/\).*/{ s//\1/; q; }
19080           s/.*/./; q'`
19081   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19082     { case "$ac_dir" in
19083   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19084   *)                      as_incr_dir=.;;
19085 esac
19086 as_dummy="$ac_dir"
19087 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19088   case $as_mkdir_dir in
19089     # Skip DOS drivespec
19090     ?:) as_incr_dir=$as_mkdir_dir ;;
19091     *)
19092       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19093       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19094     ;;
19095   esac
19096 done; }
19097
19098     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19099     # A "../" for each directory in $ac_dir_suffix.
19100     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19101   else
19102     ac_dir_suffix= ac_dots=
19103   fi
19104
19105   case "$srcdir" in
19106   .)  ac_srcdir=.
19107       if test -z "$ac_dots"; then
19108          ac_top_srcdir=.
19109       else
19110          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19111       fi ;;
19112   [\\/]* | ?:[\\/]* )
19113       ac_srcdir="$srcdir$ac_dir_suffix";
19114       ac_top_srcdir="$srcdir" ;;
19115   *) # Relative path.
19116     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19117     ac_top_srcdir="$ac_dots$srcdir" ;;
19118   esac
19119
19120   case $INSTALL in
19121   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19122   *) ac_INSTALL=$ac_dots$INSTALL ;;
19123   esac
19124
19125   if test x"$ac_file" != x-; then
19126     { echo "$as_me:19126: creating $ac_file" >&5
19127 echo "$as_me: creating $ac_file" >&6;}
19128     rm -f "$ac_file"
19129   fi
19130   # Let's still pretend it is `configure' which instantiates (i.e., don't
19131   # use $as_me), people would be surprised to read:
19132   #    /* config.h.  Generated automatically by config.status.  */
19133   configure_input="Generated automatically from `echo $ac_file_in |
19134                                                  sed 's,.*/,,'` by configure."
19135
19136   # First look for the input files in the build tree, otherwise in the
19137   # src tree.
19138   ac_file_inputs=`IFS=:
19139     for f in $ac_file_in; do
19140       case $f in
19141       -) echo "$tmp"/stdin ;;
19142       [\\/$]*)
19143          # Absolute (can't be DOS-style, as IFS=:)
19144          test -f "$f" || { { echo "$as_me:19144: error: cannot find input file: $f" >&5
19145 echo "$as_me: error: cannot find input file: $f" >&2;}
19146    { (exit 1); exit 1; }; }
19147          echo "$f";;
19148       *) # Relative
19149          if test -f "$f"; then
19150            # Build tree
19151            echo "$f"
19152          elif test -f "$srcdir/$f"; then
19153            # Source tree
19154            echo "$srcdir/$f"
19155          else
19156            # /dev/null tree
19157            { { echo "$as_me:19157: error: cannot find input file: $f" >&5
19158 echo "$as_me: error: cannot find input file: $f" >&2;}
19159    { (exit 1); exit 1; }; }
19160          fi;;
19161       esac
19162     done` || { (exit 1); exit 1; }
19163 EOF
19164 cat >>"$CONFIG_STATUS" <<\EOF
19165   ac_warn_datarootdir=no
19166   if test x"$ac_file" != x-; then
19167     for ac_item in $ac_file_inputs
19168     do
19169       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19170       if test -n "$ac_seen"; then
19171         ac_used=`grep '@datarootdir@' "$ac_item"`
19172         if test -z "$ac_used"; then
19173           { echo "$as_me:19173: WARNING: datarootdir was used implicitly but not set:
19174 $ac_seen" >&5
19175 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19176 $ac_seen" >&2;}
19177           ac_warn_datarootdir=yes
19178         fi
19179       fi
19180       ac_seen=`grep '${datarootdir}' "$ac_item"`
19181       if test -n "$ac_seen"; then
19182         { echo "$as_me:19182: WARNING: datarootdir was used explicitly but not set:
19183 $ac_seen" >&5
19184 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19185 $ac_seen" >&2;}
19186         ac_warn_datarootdir=yes
19187       fi
19188     done
19189   fi
19190
19191 if test "x$ac_warn_datarootdir" = xyes; then
19192   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19193 fi
19194
19195 EOF
19196 cat >>"$CONFIG_STATUS" <<EOF
19197   sed "$ac_vpsub
19198 $extrasub
19199 EOF
19200 cat >>"$CONFIG_STATUS" <<\EOF
19201 :t
19202 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19203 s,@configure_input@,$configure_input,;t t
19204 s,@srcdir@,$ac_srcdir,;t t
19205 s,@top_srcdir@,$ac_top_srcdir,;t t
19206 s,@INSTALL@,$ac_INSTALL,;t t
19207 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19208   rm -f "$tmp"/stdin
19209 EOF
19210 : "${FGREP:=grep -F}"
19211 : "${EGREP:=grep -E}"
19212 cat >>"$CONFIG_STATUS" <<EOF
19213   : "\${FGREP:=$FGREP}"
19214   : "\${EGREP:=$EGREP}"
19215 EOF
19216 cat >>"$CONFIG_STATUS" <<\EOF
19217   if test x"$ac_file" != x-; then
19218     cp "$tmp/out" "$ac_file"
19219
19220     for ac_name in prefix exec_prefix datarootdir
19221     do
19222         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19223         if test -n "$ac_seen"; then
19224             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19225             if test -z "$ac_init"; then
19226               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19227               { echo "$as_me:19227: WARNING: Variable $ac_name is used but was not set:
19228 $ac_seen" >&5
19229 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19230 $ac_seen" >&2;}
19231             fi
19232         fi
19233     done
19234     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19235     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19236     if test -s "$tmp"/out; then
19237       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19238       { echo "$as_me:19238: WARNING: Some variables may not be substituted:
19239 $ac_seen" >&5
19240 echo "$as_me: WARNING: Some variables may not be substituted:
19241 $ac_seen" >&2;}
19242     fi
19243   else
19244     cat "$tmp"/out
19245   fi
19246   rm -f "$tmp"/out
19247
19248 done
19249 EOF
19250 cat >>"$CONFIG_STATUS" <<\EOF
19251
19252 #
19253 # CONFIG_HEADER section.
19254 #
19255
19256 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19257 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19258 #
19259 # ac_d sets the value in "#define NAME VALUE" lines.
19260 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19261 ac_dB='[        ].*$,\1#\2'
19262 ac_dC=' '
19263 ac_dD=',;t'
19264 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19265 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19266 ac_iB='\([      ]\),\1#\2define\3'
19267 ac_iC=' '
19268 ac_iD='\4,;t'
19269 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19270 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19271 ac_uB='$,\1#\2define\3'
19272 ac_uC=' '
19273 ac_uD=',;t'
19274
19275 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19276   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19277   case "$ac_file" in
19278   - | *:- | *:-:* ) # input from stdin
19279         cat >"$tmp"/stdin
19280         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19281         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19282   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19283         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19284   * )   ac_file_in=$ac_file.in ;;
19285   esac
19286
19287   test x"$ac_file" != x- && { echo "$as_me:19287: creating $ac_file" >&5
19288 echo "$as_me: creating $ac_file" >&6;}
19289
19290   # First look for the input files in the build tree, otherwise in the
19291   # src tree.
19292   ac_file_inputs=`IFS=:
19293     for f in $ac_file_in; do
19294       case $f in
19295       -) echo "$tmp"/stdin ;;
19296       [\\/$]*)
19297          # Absolute (can't be DOS-style, as IFS=:)
19298          test -f "$f" || { { echo "$as_me:19298: error: cannot find input file: $f" >&5
19299 echo "$as_me: error: cannot find input file: $f" >&2;}
19300    { (exit 1); exit 1; }; }
19301          echo $f;;
19302       *) # Relative
19303          if test -f "$f"; then
19304            # Build tree
19305            echo $f
19306          elif test -f "$srcdir/$f"; then
19307            # Source tree
19308            echo "$srcdir/$f"
19309          else
19310            # /dev/null tree
19311            { { echo "$as_me:19311: error: cannot find input file: $f" >&5
19312 echo "$as_me: error: cannot find input file: $f" >&2;}
19313    { (exit 1); exit 1; }; }
19314          fi;;
19315       esac
19316     done` || { (exit 1); exit 1; }
19317   # Remove the trailing spaces.
19318   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19319
19320 EOF
19321
19322 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19323 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19324 # be either 'cat' or 'sort'.
19325 cat confdefs.h | uniq >conftest.vals
19326
19327 # Break up conftest.vals because some shells have a limit on
19328 # the size of here documents, and old seds have small limits too.
19329
19330 rm -f conftest.tail
19331 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19332 while grep . conftest.vals >/dev/null
19333 do
19334   # Write chunks of a limited-size here document to conftest.frag.
19335   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19336   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19337   echo 'CEOF' >> "$CONFIG_STATUS"
19338   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19339   rm -f conftest.vals
19340   mv conftest.tail conftest.vals
19341 done
19342 rm -f conftest.vals
19343
19344 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19345 # marker @DEFS@.
19346 echo '  cat >> conftest.edit <<CEOF
19347 /@DEFS@/r conftest.frag
19348 /@DEFS@/d
19349 CEOF
19350 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19351 rm -f "$tmp"/in
19352 mv "$tmp"/out "$tmp"/in
19353 rm -f conftest.edit conftest.frag
19354 ' >> "$CONFIG_STATUS"
19355
19356 cat >>"$CONFIG_STATUS" <<\EOF
19357   # Let's still pretend it is `configure' which instantiates (i.e., don't
19358   # use $as_me), people would be surprised to read:
19359   #    /* config.h.  Generated automatically by config.status.  */
19360   if test x"$ac_file" = x-; then
19361     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19362   else
19363     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19364   fi
19365   cat "$tmp"/in >>"$tmp"/config.h
19366   rm -f "$tmp"/in
19367   if test x"$ac_file" != x-; then
19368     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19369       { echo "$as_me:19369: $ac_file is unchanged" >&5
19370 echo "$as_me: $ac_file is unchanged" >&6;}
19371     else
19372       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19373          X"$ac_file" : 'X\(//\)[^/]' \| \
19374          X"$ac_file" : 'X\(//\)$' \| \
19375          X"$ac_file" : 'X\(/\)' \| \
19376          .     : '\(.\)' 2>/dev/null ||
19377 echo X"$ac_file" |
19378     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19379           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19380           /^X\(\/\/\)$/{ s//\1/; q; }
19381           /^X\(\/\).*/{ s//\1/; q; }
19382           s/.*/./; q'`
19383       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19384         { case "$ac_dir" in
19385   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19386   *)                      as_incr_dir=.;;
19387 esac
19388 as_dummy="$ac_dir"
19389 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19390   case $as_mkdir_dir in
19391     # Skip DOS drivespec
19392     ?:) as_incr_dir=$as_mkdir_dir ;;
19393     *)
19394       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19395       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19396     ;;
19397   esac
19398 done; }
19399
19400       fi
19401       rm -f "$ac_file"
19402       mv "$tmp/config.h" "$ac_file"
19403     fi
19404   else
19405     cat "$tmp"/config.h
19406     rm -f "$tmp"/config.h
19407   fi
19408 done
19409 EOF
19410 cat >>"$CONFIG_STATUS" <<\EOF
19411 #
19412 # CONFIG_COMMANDS section.
19413 #
19414 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19415   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19416   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19417
19418   case "$ac_dest" in
19419     default )
19420 $AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
19421 if test -z "$USE_OLD_MAKERULES" ; then
19422         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19423 fi
19424  ;;
19425   esac
19426 done
19427 EOF
19428
19429 cat >>"$CONFIG_STATUS" <<\EOF
19430
19431 { (exit 0); exit 0; }
19432 EOF
19433 chmod +x "$CONFIG_STATUS"
19434 ac_clean_files=$ac_clean_files_save
19435
19436 # configure is writing to config.log, and then calls config.status.
19437 # config.status does its own redirection, appending to config.log.
19438 # Unfortunately, on DOS this fails, as config.log is still kept open
19439 # by configure, so config.status won't be able to write to it; its
19440 # output is simply discarded.  So we exec the FD to /dev/null,
19441 # effectively closing config.log, so it can be properly (re)opened and
19442 # appended to by config.status.  When coming back to configure, we
19443 # need to make the FD available again.
19444 if test "$no_create" != yes; then
19445   ac_cs_success=:
19446   exec 5>/dev/null
19447   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19448   exec 5>>config.log
19449   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19450   # would make configure fail if this is the last instruction.
19451   "$ac_cs_success" || { (exit 1); exit 1; }
19452 fi
19453 ${MAKE:-make} preinstall