]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
c4cf4f3e54f1df175ffebd588779ba834e8fbc45
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.83 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20210509.
5 #
6 # Copyright 2003-2020,2021      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr=expr
38 else
39   as_expr=false
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s=ln
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2020,2021        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 top_builddir=`pwd`
1063
1064 ac_aux_dir=
1065 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1066   if test -f "$ac_dir/install-sh"; then
1067     ac_aux_dir=$ac_dir
1068     ac_install_sh="$ac_aux_dir/install-sh -c"
1069     break
1070   elif test -f "$ac_dir/install.sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install.sh -c"
1073     break
1074   elif test -f "$ac_dir/shtool"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/shtool install -c"
1077     break
1078   fi
1079 done
1080 if test -z "$ac_aux_dir"; then
1081   { { echo "$as_me:1081: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1082 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1086 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1087 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1088
1089 # Make sure we can run config.sub.
1090 $ac_config_sub sun4 >/dev/null 2>&1 ||
1091   { { echo "$as_me:1091: error: cannot run $ac_config_sub" >&5
1092 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1093    { (exit 1); exit 1; }; }
1094
1095 echo "$as_me:1095: checking build system type" >&5
1096 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1097 if test "${ac_cv_build+set}" = set; then
1098   echo $ECHO_N "(cached) $ECHO_C" >&6
1099 else
1100   ac_cv_build_alias=$build_alias
1101 test -z "$ac_cv_build_alias" &&
1102   ac_cv_build_alias=`$ac_config_guess`
1103 test -z "$ac_cv_build_alias" &&
1104   { { echo "$as_me:1104: error: cannot guess build type; you must specify one" >&5
1105 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1106    { (exit 1); exit 1; }; }
1107 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1108   { { echo "$as_me:1108: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1109 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1110    { (exit 1); exit 1; }; }
1111
1112 fi
1113 echo "$as_me:1113: result: $ac_cv_build" >&5
1114 echo "${ECHO_T}$ac_cv_build" >&6
1115 build=$ac_cv_build
1116 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1117 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1118 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1119
1120 echo "$as_me:1120: checking host system type" >&5
1121 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1122 if test "${ac_cv_host+set}" = set; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   ac_cv_host_alias=$host_alias
1126 test -z "$ac_cv_host_alias" &&
1127   ac_cv_host_alias=$ac_cv_build_alias
1128 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1129   { { echo "$as_me:1129: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1130 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1131    { (exit 1); exit 1; }; }
1132
1133 fi
1134 echo "$as_me:1134: result: $ac_cv_host" >&5
1135 echo "${ECHO_T}$ac_cv_host" >&6
1136 host=$ac_cv_host
1137 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1138 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1139 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1140
1141 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1142         echo "$as_me:1142: checking target system type" >&5
1143 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1144 if test "${ac_cv_target+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   ac_cv_target_alias=$target_alias
1148 test "x$ac_cv_target_alias" = "x" &&
1149   ac_cv_target_alias=$ac_cv_host_alias
1150 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1151   { { echo "$as_me:1151: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1152 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1153    { (exit 1); exit 1; }; }
1154
1155 fi
1156 echo "$as_me:1156: result: $ac_cv_target" >&5
1157 echo "${ECHO_T}$ac_cv_target" >&6
1158 target=$ac_cv_target
1159 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1160 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1161 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1162
1163 # The aliases save the names the user supplied, while $host etc.
1164 # will get canonicalized.
1165 test -n "$target_alias" &&
1166   test "$program_prefix$program_suffix$program_transform_name" = \
1167     NONENONEs,x,x, &&
1168   program_prefix=${target_alias}-
1169         system_name="$host_os"
1170 else
1171         system_name="`(uname -s -r) 2>/dev/null`"
1172         if test -z "$system_name" ; then
1173                 system_name="`(hostname) 2>/dev/null`"
1174         fi
1175 fi
1176 test -n "$system_name" &&
1177 cat >>confdefs.h <<EOF
1178 #define SYSTEM_NAME "$system_name"
1179 EOF
1180
1181 if test "${cf_cv_system_name+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   cf_cv_system_name="$system_name"
1185 fi
1186
1187 test -z "$system_name" && system_name="$cf_cv_system_name"
1188 test -n "$cf_cv_system_name" && echo "$as_me:1188: result: Configuring for $cf_cv_system_name" >&5
1189 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1190
1191 if test ".$system_name" != ".$cf_cv_system_name" ; then
1192         echo "$as_me:1192: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1193 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1194         { { echo "$as_me:1194: error: \"Please remove config.cache and try again.\"" >&5
1195 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1196    { (exit 1); exit 1; }; }
1197 fi
1198
1199 # Check whether --with-system-type or --without-system-type was given.
1200 if test "${with_system_type+set}" = set; then
1201   withval="$with_system_type"
1202   { echo "$as_me:1202: WARNING: overriding system type to $withval" >&5
1203 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1204         cf_cv_system_name=$withval
1205         host_os=$withval
1206
1207 fi;
1208
1209 ###     Save the given $CFLAGS to allow user-override.
1210 cf_user_CFLAGS="$CFLAGS"
1211
1212 ###     Default install-location
1213 for ac_prog in ggrep grep
1214 do
1215   # Extract the first word of "$ac_prog", so it can be a program name with args.
1216 set dummy $ac_prog; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_GREP+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$GREP"; then
1223   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_GREP="$ac_prog"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 GREP=$ac_cv_prog_GREP
1239 if test -n "$GREP"; then
1240   echo "$as_me:1240: result: $GREP" >&5
1241 echo "${ECHO_T}$GREP" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247   test -n "$GREP" && break
1248 done
1249 test -n "$GREP" || GREP=": "
1250
1251 echo "$as_me:1251: checking for fgrep" >&5
1252 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1253 if test "${ac_cv_path_FGREP+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1257    then ac_cv_path_FGREP="$GREP -F"
1258    else
1259      for ac_prog in gfgrep fgrep
1260 do
1261   # Extract the first word of "$ac_prog", so it can be a program name with args.
1262 set dummy $ac_prog; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_path_FGREP+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   case $FGREP in
1269   [\\/]* | ?:[\\/]*)
1270   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1271   ;;
1272   *)
1273   ac_save_IFS=$IFS; IFS=$ac_path_separator
1274 ac_dummy="$PATH"
1275 for ac_dir in $ac_dummy; do
1276   IFS=$ac_save_IFS
1277   test -z "$ac_dir" && ac_dir=.
1278   if $as_executable_p "$ac_dir/$ac_word"; then
1279    ac_cv_path_FGREP="$ac_dir/$ac_word"
1280    echo "$as_me:1280: found $ac_dir/$ac_word" >&5
1281    break
1282 fi
1283 done
1284
1285   ;;
1286 esac
1287 fi
1288 FGREP=$ac_cv_path_FGREP
1289
1290 if test -n "$FGREP"; then
1291   echo "$as_me:1291: result: $FGREP" >&5
1292 echo "${ECHO_T}$FGREP" >&6
1293 else
1294   echo "$as_me:1294: result: no" >&5
1295 echo "${ECHO_T}no" >&6
1296 fi
1297
1298   test -n "$FGREP" && break
1299 done
1300 test -n "$FGREP" || FGREP=": "
1301
1302      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1302: error: cannot find workable fgrep" >&5
1303 echo "$as_me: error: cannot find workable fgrep" >&2;}
1304    { (exit 1); exit 1; }; }
1305    fi
1306 fi
1307 echo "$as_me:1307: result: $ac_cv_path_FGREP" >&5
1308 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1309  FGREP="$ac_cv_path_FGREP"
1310
1311 echo "$as_me:1311: checking for prefix" >&5
1312 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1313 if test "x$prefix" = "xNONE" ; then
1314         case "$cf_cv_system_name" in
1315                 # non-vendor systems don't have a conflict
1316         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1317                 prefix=/usr
1318                 ;;
1319         (*)     prefix=$ac_default_prefix
1320                 ;;
1321         esac
1322 fi
1323 echo "$as_me:1323: result: $prefix" >&5
1324 echo "${ECHO_T}$prefix" >&6
1325
1326 if test "x$prefix" = "xNONE" ; then
1327 echo "$as_me:1327: checking for default include-directory" >&5
1328 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1329 test -n "$verbose" && echo 1>&6
1330 for cf_symbol in \
1331         "$includedir" \
1332         "$includedir/ncurses" \
1333         "$prefix/include" \
1334         "$prefix/include/ncurses" \
1335         /usr/local/include \
1336         /usr/local/include/ncurses \
1337         /usr/include \
1338         /usr/include/ncurses
1339 do
1340         cf_dir=`eval echo "$cf_symbol"`
1341         if test -f "$cf_dir/curses.h" ; then
1342         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1343                 includedir="$cf_symbol"
1344                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1345                 break
1346         fi
1347         fi
1348         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1349 done
1350 echo "$as_me:1350: result: $includedir" >&5
1351 echo "${ECHO_T}$includedir" >&6
1352 fi
1353
1354 ###     Checks for programs.
1355
1356 ac_ext=c
1357 ac_cpp='$CPP $CPPFLAGS'
1358 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1359 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1360 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1361 ac_main_return="return"
1362 if test -n "$ac_tool_prefix"; then
1363   for ac_prog in gnatgcc gcc cc
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in gnatgcc gcc cc
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo "$2"`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit "$ac_status"); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit "$ac_status"); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit "$ac_status"); }
1465
1466 cat >"conftest.$ac_ext" <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main (void)
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit "$ac_status"); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat "conftest.$ac_ext" >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit "$ac_status"); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe "conftest$ac_cv_exeext"
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit "$ac_status"); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f "conftest$ac_cv_exeext"
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f "conftest.$ac_ext"
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >"conftest.$ac_ext" <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main (void)
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit "$ac_status"); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat "conftest.$ac_ext" >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >"conftest.$ac_ext" <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main (void)
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f "conftest.$ac_objext"
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit "$ac_status"); } &&
1662          { ac_try='test -s "conftest.$ac_objext"'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit "$ac_status"); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat "conftest.$ac_ext" >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >"conftest.$ac_ext" <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main (void)
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f "conftest.$ac_objext"
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit "$ac_status"); } &&
1707          { ac_try='test -s "conftest.$ac_objext"'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit "$ac_status"); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat "conftest.$ac_ext" >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >"conftest.$ac_ext" <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f "conftest.$ac_objext"
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit "$ac_status"); } &&
1753          { ac_try='test -s "conftest.$ac_objext"'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit "$ac_status"); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >"conftest.$ac_ext" <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main (void)
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f "conftest.$ac_objext"
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit "$ac_status"); } &&
1787          { ac_try='test -s "conftest.$ac_objext"'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit "$ac_status"); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat "conftest.$ac_ext" >&5
1797 continue
1798 fi
1799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1800   cat >"conftest.$ac_ext" <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main (void)
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f "conftest.$ac_objext"
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit "$ac_status"); } &&
1818          { ac_try='test -s "conftest.$ac_objext"'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit "$ac_status"); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat "conftest.$ac_ext" >&5
1828 fi
1829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo "$ac_declaration"    >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1846 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return="return"
1849
1850 GCC_VERSION=none
1851 if test "$GCC" = yes ; then
1852         echo "$as_me:1852: checking version of $CC" >&5
1853 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1854         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1855         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1856         echo "$as_me:1856: result: $GCC_VERSION" >&5
1857 echo "${ECHO_T}$GCC_VERSION" >&6
1858 fi
1859
1860 INTEL_COMPILER=no
1861
1862 if test "$GCC" = yes ; then
1863         case "$host_os" in
1864         (linux*|gnu*)
1865                 echo "$as_me:1865: checking if this is really Intel C compiler" >&5
1866 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1867                 cf_save_CFLAGS="$CFLAGS"
1868                 CFLAGS="$CFLAGS -no-gcc"
1869                 cat >"conftest.$ac_ext" <<_ACEOF
1870 #line 1870 "configure"
1871 #include "confdefs.h"
1872
1873 int
1874 main (void)
1875 {
1876
1877 #ifdef __INTEL_COMPILER
1878 #else
1879 make an error
1880 #endif
1881
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 rm -f "conftest.$ac_objext"
1887 if { (eval echo "$as_me:1887: \"$ac_compile\"") >&5
1888   (eval $ac_compile) 2>&5
1889   ac_status=$?
1890   echo "$as_me:1890: \$? = $ac_status" >&5
1891   (exit "$ac_status"); } &&
1892          { ac_try='test -s "conftest.$ac_objext"'
1893   { (eval echo "$as_me:1893: \"$ac_try\"") >&5
1894   (eval $ac_try) 2>&5
1895   ac_status=$?
1896   echo "$as_me:1896: \$? = $ac_status" >&5
1897   (exit "$ac_status"); }; }; then
1898   INTEL_COMPILER=yes
1899 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1900
1901 else
1902   echo "$as_me: failed program was:" >&5
1903 cat "conftest.$ac_ext" >&5
1904 fi
1905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1906                 CFLAGS="$cf_save_CFLAGS"
1907                 echo "$as_me:1907: result: $INTEL_COMPILER" >&5
1908 echo "${ECHO_T}$INTEL_COMPILER" >&6
1909                 ;;
1910         esac
1911 fi
1912
1913 CLANG_COMPILER=no
1914
1915 if test "$GCC" = yes ; then
1916         echo "$as_me:1916: checking if this is really Clang C compiler" >&5
1917 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1918         cf_save_CFLAGS="$CFLAGS"
1919         cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   CLANG_COMPILER=yes
1949
1950 else
1951   echo "$as_me: failed program was:" >&5
1952 cat "conftest.$ac_ext" >&5
1953 fi
1954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1955         CFLAGS="$cf_save_CFLAGS"
1956         echo "$as_me:1956: result: $CLANG_COMPILER" >&5
1957 echo "${ECHO_T}$CLANG_COMPILER" >&6
1958 fi
1959
1960 CLANG_VERSION=none
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         case "$CC" in
1964         (c[1-9][0-9]|*/c[1-9][0-9])
1965                 { echo "$as_me:1965: WARNING: replacing broken compiler alias $CC" >&5
1966 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1967                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1968                 CC=clang
1969                 ;;
1970         esac
1971
1972         echo "$as_me:1972: checking version of $CC" >&5
1973 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1974         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1975         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1976         echo "$as_me:1976: result: $CLANG_VERSION" >&5
1977 echo "${ECHO_T}$CLANG_VERSION" >&6
1978
1979         for cf_clang_opt in \
1980                 -Qunused-arguments \
1981                 -Wno-error=implicit-function-declaration
1982         do
1983                 echo "$as_me:1983: checking if option $cf_clang_opt works" >&5
1984 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1985                 cf_save_CFLAGS="$CFLAGS"
1986                 CFLAGS="$CFLAGS $cf_clang_opt"
1987                 cat >"conftest.$ac_ext" <<_ACEOF
1988 #line 1988 "configure"
1989 #include "confdefs.h"
1990
1991                         #include <stdio.h>
1992 int
1993 main (void)
1994 {
1995
1996                         printf("hello!\\n");
1997   ;
1998   return 0;
1999 }
2000 _ACEOF
2001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2002 if { (eval echo "$as_me:2002: \"$ac_link\"") >&5
2003   (eval $ac_link) 2>&5
2004   ac_status=$?
2005   echo "$as_me:2005: \$? = $ac_status" >&5
2006   (exit "$ac_status"); } &&
2007          { ac_try='test -s "conftest$ac_exeext"'
2008   { (eval echo "$as_me:2008: \"$ac_try\"") >&5
2009   (eval $ac_try) 2>&5
2010   ac_status=$?
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit "$ac_status"); }; }; then
2013
2014                         cf_clang_optok=yes
2015 else
2016   echo "$as_me: failed program was:" >&5
2017 cat "conftest.$ac_ext" >&5
2018
2019                         cf_clang_optok=no
2020 fi
2021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2022                 echo "$as_me:2022: result: $cf_clang_optok" >&5
2023 echo "${ECHO_T}$cf_clang_optok" >&6
2024                 CFLAGS="$cf_save_CFLAGS"
2025                 if test "$cf_clang_optok" = yes; then
2026                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing adding option $cf_clang_opt ..." 1>&5
2029
2030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2031         CFLAGS="${CFLAGS}$cf_clang_opt"
2032
2033                 fi
2034         done
2035 fi
2036
2037 echo "$as_me:2037: checking for $CC option to accept ANSI C" >&5
2038 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2039 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2040   echo $ECHO_N "(cached) $ECHO_C" >&6
2041 else
2042   ac_cv_prog_cc_stdc=no
2043 ac_save_CC=$CC
2044 cat >"conftest.$ac_ext" <<_ACEOF
2045 #line 2045 "configure"
2046 #include "confdefs.h"
2047 #include <stdarg.h>
2048 #include <stdio.h>
2049 #include <sys/types.h>
2050 #include <sys/stat.h>
2051 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2052 struct buf { int x; };
2053 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2054 static char *e (p, i)
2055      char **p;
2056      int i;
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 PKG_CONFIG_LIBDIR=no
3283
3284 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3285 if test "${with_pkg_config_libdir+set}" = set; then
3286   withval="$with_pkg_config_libdir"
3287   PKG_CONFIG_LIBDIR=$withval
3288 else
3289   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3290 fi;
3291
3292 case x$PKG_CONFIG_LIBDIR in
3293 (x/*)
3294         ;;
3295 (xyes)
3296         # Look for the library directory using the same prefix as the executable
3297         if test "x$PKG_CONFIG" = xnone
3298         then
3299                 cf_path=$prefix
3300         else
3301                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3302         fi
3303
3304         # If you don't like using the default architecture, you have to specify the
3305         # intended library directory and corresponding compiler/linker options.
3306         #
3307         # This case allows for Debian's 2014-flavor of multiarch, along with the
3308         # most common variations before that point.  Some other variants spell the
3309         # directory differently, e.g., "pkg-config", and put it in unusual places.
3310         # pkg-config has always been poorly standardized, which is ironic...
3311         case x`(arch) 2>/dev/null` in
3312         (*64)
3313                 cf_search_path="\
3314                         $cf_path/lib/*64-linux-gnu \
3315                         $cf_path/share \
3316                         $cf_path/lib64 \
3317                         $cf_path/lib32 \
3318                         $cf_path/lib"
3319                 ;;
3320         (*)
3321                 cf_search_path="\
3322                         $cf_path/lib/*-linux-gnu \
3323                         $cf_path/share \
3324                         $cf_path/lib32 \
3325                         $cf_path/lib \
3326                         $cf_path/libdata"
3327                 ;;
3328         esac
3329
3330         test -n "$verbose" && echo "    list..." 1>&6
3331
3332 echo "${as_me:-configure}:3332: testing list... ..." 1>&5
3333
3334         for cf_config in $cf_search_path
3335         do
3336                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3337
3338 echo "${as_me:-configure}:3338: testing checking $cf_config/pkgconfig ..." 1>&5
3339
3340                 if test -d "$cf_config/pkgconfig"
3341                 then
3342                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3343                         echo "$as_me:3343: checking done" >&5
3344 echo $ECHO_N "checking done... $ECHO_C" >&6
3345                         break
3346                 fi
3347         done
3348         ;;
3349 (*)
3350         ;;
3351 esac
3352
3353 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3354         echo "$as_me:3354: result: $PKG_CONFIG_LIBDIR" >&5
3355 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3356 fi
3357
3358 echo "$as_me:3358: checking if you want to build test-programs" >&5
3359 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3360
3361 # Check whether --with-tests or --without-tests was given.
3362 if test "${with_tests+set}" = set; then
3363   withval="$with_tests"
3364   cf_with_tests=$withval
3365 else
3366   cf_with_tests=yes
3367 fi;
3368 echo "$as_me:3368: result: $cf_with_tests" >&5
3369 echo "${ECHO_T}$cf_with_tests" >&6
3370
3371 echo "$as_me:3371: checking if we should assume mixed-case filenames" >&5
3372 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3373
3374 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3375 if test "${enable_mixed_case+set}" = set; then
3376   enableval="$enable_mixed_case"
3377   enable_mixedcase=$enableval
3378 else
3379   enable_mixedcase=auto
3380 fi;
3381 echo "$as_me:3381: result: $enable_mixedcase" >&5
3382 echo "${ECHO_T}$enable_mixedcase" >&6
3383 if test "$enable_mixedcase" = "auto" ; then
3384
3385 echo "$as_me:3385: checking if filesystem supports mixed-case filenames" >&5
3386 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3387 if test "${cf_cv_mixedcase+set}" = set; then
3388   echo $ECHO_N "(cached) $ECHO_C" >&6
3389 else
3390
3391 if test "$cross_compiling" = yes ; then
3392         case "$target_alias" in
3393         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3394                 cf_cv_mixedcase=no
3395                 ;;
3396         (*)
3397                 cf_cv_mixedcase=yes
3398                 ;;
3399         esac
3400 else
3401         rm -f conftest CONFTEST
3402         echo test >conftest
3403         if test -f CONFTEST ; then
3404                 cf_cv_mixedcase=no
3405         else
3406                 cf_cv_mixedcase=yes
3407         fi
3408         rm -f conftest CONFTEST
3409 fi
3410
3411 fi
3412 echo "$as_me:3412: result: $cf_cv_mixedcase" >&5
3413 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3414 test "$cf_cv_mixedcase" = yes &&
3415 cat >>confdefs.h <<\EOF
3416 #define MIXEDCASE_FILENAMES 1
3417 EOF
3418
3419 else
3420         cf_cv_mixedcase=$enable_mixedcase
3421         if test "$enable_mixedcase" = "yes" ; then
3422                 cat >>confdefs.h <<\EOF
3423 #define MIXEDCASE_FILENAMES 1
3424 EOF
3425
3426         fi
3427 fi
3428
3429 # do this after mixed-case option (tags/TAGS is not as important as tic).
3430 echo "$as_me:3430: checking whether ${MAKE-make} sets \${MAKE}" >&5
3431 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3432 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3433 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3434   echo $ECHO_N "(cached) $ECHO_C" >&6
3435 else
3436   cat >conftest.make <<\EOF
3437 all:
3438         @echo 'ac_maketemp="${MAKE}"'
3439 EOF
3440 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3441 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3442 if test -n "$ac_maketemp"; then
3443   eval ac_cv_prog_make_${ac_make}_set=yes
3444 else
3445   eval ac_cv_prog_make_${ac_make}_set=no
3446 fi
3447 rm -f conftest.make
3448 fi
3449 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3450   echo "$as_me:3450: result: yes" >&5
3451 echo "${ECHO_T}yes" >&6
3452   SET_MAKE=
3453 else
3454   echo "$as_me:3454: result: no" >&5
3455 echo "${ECHO_T}no" >&6
3456   SET_MAKE="MAKE=${MAKE-make}"
3457 fi
3458
3459 echo "$as_me:3459: checking for \".PHONY\" make-support" >&5
3460 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3461 if test "${cf_cv_make_PHONY+set}" = set; then
3462   echo $ECHO_N "(cached) $ECHO_C" >&6
3463 else
3464
3465         rm -rf conftest*
3466         (
3467                 mkdir conftest || exit 1
3468                 cd conftest
3469                 cat >makefile <<'CF_EOF'
3470 .PHONY: always
3471 DATA=0
3472 always: always.out
3473         @echo "** making $@ $(DATA)"
3474 once: once.out
3475         @echo "** making $@ $(DATA)"
3476 always.out:
3477         @echo "** making $@ $(DATA)"
3478         echo $(DATA) > $@
3479 once.out:
3480         @echo "** making $@ $(DATA)"
3481         echo $(DATA) > $@
3482 CF_EOF
3483                 for cf_data in 1 2 3
3484                 do
3485                         ${MAKE:-make} always DATA=$cf_data
3486                         ${MAKE:-make} once   DATA=$cf_data
3487                         ${MAKE:-make} -t always once
3488                         if test -f always ; then
3489                                 echo "no (case 1)" > ../conftest.tmp
3490                         elif test ! -f always.out ; then
3491                                 echo "no (case 2)" > ../conftest.tmp
3492                         elif test ! -f once.out ; then
3493                                 echo "no (case 3)" > ../conftest.tmp
3494                         elif ! cmp -s always.out once.out ; then
3495                                 echo "no (case 4)" > ../conftest.tmp
3496                                 diff always.out once.out
3497                         else
3498                                 cf_check="`cat always.out`"
3499                                 if test "x$cf_check" != "x$cf_data" ; then
3500                                         echo "no (case 5)" > ../conftest.tmp
3501                                 else
3502                                         echo yes > ../conftest.tmp
3503                                         rm -f ./*.out
3504                                         continue
3505                                 fi
3506                         fi
3507                         break
3508                 done
3509         ) >&5 2>&1
3510         cf_cv_make_PHONY="`cat conftest.tmp`"
3511         rm -rf conftest*
3512
3513 fi
3514 echo "$as_me:3514: result: $cf_cv_make_PHONY" >&5
3515 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3516 MAKE_NO_PHONY="#"
3517 MAKE_PHONY="#"
3518 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3519 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3520
3521 for ac_prog in exctags ctags
3522 do
3523   # Extract the first word of "$ac_prog", so it can be a program name with args.
3524 set dummy $ac_prog; ac_word=$2
3525 echo "$as_me:3525: checking for $ac_word" >&5
3526 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3527 if test "${ac_cv_prog_CTAGS+set}" = set; then
3528   echo $ECHO_N "(cached) $ECHO_C" >&6
3529 else
3530   if test -n "$CTAGS"; then
3531   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3532 else
3533   ac_save_IFS=$IFS; IFS=$ac_path_separator
3534 ac_dummy="$PATH"
3535 for ac_dir in $ac_dummy; do
3536   IFS=$ac_save_IFS
3537   test -z "$ac_dir" && ac_dir=.
3538   $as_executable_p "$ac_dir/$ac_word" || continue
3539 ac_cv_prog_CTAGS="$ac_prog"
3540 echo "$as_me:3540: found $ac_dir/$ac_word" >&5
3541 break
3542 done
3543
3544 fi
3545 fi
3546 CTAGS=$ac_cv_prog_CTAGS
3547 if test -n "$CTAGS"; then
3548   echo "$as_me:3548: result: $CTAGS" >&5
3549 echo "${ECHO_T}$CTAGS" >&6
3550 else
3551   echo "$as_me:3551: result: no" >&5
3552 echo "${ECHO_T}no" >&6
3553 fi
3554
3555   test -n "$CTAGS" && break
3556 done
3557
3558 for ac_prog in exetags etags
3559 do
3560   # Extract the first word of "$ac_prog", so it can be a program name with args.
3561 set dummy $ac_prog; ac_word=$2
3562 echo "$as_me:3562: checking for $ac_word" >&5
3563 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3564 if test "${ac_cv_prog_ETAGS+set}" = set; then
3565   echo $ECHO_N "(cached) $ECHO_C" >&6
3566 else
3567   if test -n "$ETAGS"; then
3568   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3569 else
3570   ac_save_IFS=$IFS; IFS=$ac_path_separator
3571 ac_dummy="$PATH"
3572 for ac_dir in $ac_dummy; do
3573   IFS=$ac_save_IFS
3574   test -z "$ac_dir" && ac_dir=.
3575   $as_executable_p "$ac_dir/$ac_word" || continue
3576 ac_cv_prog_ETAGS="$ac_prog"
3577 echo "$as_me:3577: found $ac_dir/$ac_word" >&5
3578 break
3579 done
3580
3581 fi
3582 fi
3583 ETAGS=$ac_cv_prog_ETAGS
3584 if test -n "$ETAGS"; then
3585   echo "$as_me:3585: result: $ETAGS" >&5
3586 echo "${ECHO_T}$ETAGS" >&6
3587 else
3588   echo "$as_me:3588: result: no" >&5
3589 echo "${ECHO_T}no" >&6
3590 fi
3591
3592   test -n "$ETAGS" && break
3593 done
3594
3595 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3596 set dummy ${CTAGS:-ctags}; ac_word=$2
3597 echo "$as_me:3597: checking for $ac_word" >&5
3598 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3599 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3600   echo $ECHO_N "(cached) $ECHO_C" >&6
3601 else
3602   if test -n "$MAKE_LOWER_TAGS"; then
3603   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3604 else
3605   ac_save_IFS=$IFS; IFS=$ac_path_separator
3606 ac_dummy="$PATH"
3607 for ac_dir in $ac_dummy; do
3608   IFS=$ac_save_IFS
3609   test -z "$ac_dir" && ac_dir=.
3610   $as_executable_p "$ac_dir/$ac_word" || continue
3611 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3612 echo "$as_me:3612: found $ac_dir/$ac_word" >&5
3613 break
3614 done
3615
3616   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3617 fi
3618 fi
3619 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3620 if test -n "$MAKE_LOWER_TAGS"; then
3621   echo "$as_me:3621: result: $MAKE_LOWER_TAGS" >&5
3622 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3623 else
3624   echo "$as_me:3624: result: no" >&5
3625 echo "${ECHO_T}no" >&6
3626 fi
3627
3628 if test "$cf_cv_mixedcase" = yes ; then
3629         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3630 set dummy ${ETAGS:-etags}; ac_word=$2
3631 echo "$as_me:3631: checking for $ac_word" >&5
3632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3633 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3634   echo $ECHO_N "(cached) $ECHO_C" >&6
3635 else
3636   if test -n "$MAKE_UPPER_TAGS"; then
3637   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3638 else
3639   ac_save_IFS=$IFS; IFS=$ac_path_separator
3640 ac_dummy="$PATH"
3641 for ac_dir in $ac_dummy; do
3642   IFS=$ac_save_IFS
3643   test -z "$ac_dir" && ac_dir=.
3644   $as_executable_p "$ac_dir/$ac_word" || continue
3645 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3646 echo "$as_me:3646: found $ac_dir/$ac_word" >&5
3647 break
3648 done
3649
3650   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3651 fi
3652 fi
3653 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3654 if test -n "$MAKE_UPPER_TAGS"; then
3655   echo "$as_me:3655: result: $MAKE_UPPER_TAGS" >&5
3656 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3657 else
3658   echo "$as_me:3658: result: no" >&5
3659 echo "${ECHO_T}no" >&6
3660 fi
3661
3662 else
3663         MAKE_UPPER_TAGS=no
3664 fi
3665
3666 if test "$MAKE_UPPER_TAGS" = yes ; then
3667         MAKE_UPPER_TAGS=
3668 else
3669         MAKE_UPPER_TAGS="#"
3670 fi
3671
3672 if test "$MAKE_LOWER_TAGS" = yes ; then
3673         MAKE_LOWER_TAGS=
3674 else
3675         MAKE_LOWER_TAGS="#"
3676 fi
3677
3678 echo "$as_me:3678: checking for makeflags variable" >&5
3679 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3680 if test "${cf_cv_makeflags+set}" = set; then
3681   echo $ECHO_N "(cached) $ECHO_C" >&6
3682 else
3683
3684         cf_cv_makeflags=''
3685         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3686         do
3687                 cat >cf_makeflags.tmp <<CF_EOF
3688 SHELL = $SHELL
3689 all :
3690         @ echo '.$cf_option'
3691 CF_EOF
3692                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3693                 case "$cf_result" in
3694                 (.*k|.*kw)
3695                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3696                         case "$cf_result" in
3697                         (.*CC=*)        cf_cv_makeflags=
3698                                 ;;
3699                         (*)     cf_cv_makeflags=$cf_option
3700                                 ;;
3701                         esac
3702                         break
3703                         ;;
3704                 (.-)
3705                         ;;
3706                 (*)
3707
3708 echo "${as_me:-configure}:3708: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3709
3710                         ;;
3711                 esac
3712         done
3713         rm -f cf_makeflags.tmp
3714
3715 fi
3716 echo "$as_me:3716: result: $cf_cv_makeflags" >&5
3717 echo "${ECHO_T}$cf_cv_makeflags" >&6
3718
3719 if test -n "$ac_tool_prefix"; then
3720   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3721 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3722 echo "$as_me:3722: checking for $ac_word" >&5
3723 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3724 if test "${ac_cv_prog_RANLIB+set}" = set; then
3725   echo $ECHO_N "(cached) $ECHO_C" >&6
3726 else
3727   if test -n "$RANLIB"; then
3728   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3729 else
3730   ac_save_IFS=$IFS; IFS=$ac_path_separator
3731 ac_dummy="$PATH"
3732 for ac_dir in $ac_dummy; do
3733   IFS=$ac_save_IFS
3734   test -z "$ac_dir" && ac_dir=.
3735   $as_executable_p "$ac_dir/$ac_word" || continue
3736 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3737 echo "$as_me:3737: found $ac_dir/$ac_word" >&5
3738 break
3739 done
3740
3741 fi
3742 fi
3743 RANLIB=$ac_cv_prog_RANLIB
3744 if test -n "$RANLIB"; then
3745   echo "$as_me:3745: result: $RANLIB" >&5
3746 echo "${ECHO_T}$RANLIB" >&6
3747 else
3748   echo "$as_me:3748: result: no" >&5
3749 echo "${ECHO_T}no" >&6
3750 fi
3751
3752 fi
3753 if test -z "$ac_cv_prog_RANLIB"; then
3754   ac_ct_RANLIB=$RANLIB
3755   # Extract the first word of "ranlib", so it can be a program name with args.
3756 set dummy ranlib; ac_word=$2
3757 echo "$as_me:3757: checking for $ac_word" >&5
3758 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3759 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3760   echo $ECHO_N "(cached) $ECHO_C" >&6
3761 else
3762   if test -n "$ac_ct_RANLIB"; then
3763   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3764 else
3765   ac_save_IFS=$IFS; IFS=$ac_path_separator
3766 ac_dummy="$PATH"
3767 for ac_dir in $ac_dummy; do
3768   IFS=$ac_save_IFS
3769   test -z "$ac_dir" && ac_dir=.
3770   $as_executable_p "$ac_dir/$ac_word" || continue
3771 ac_cv_prog_ac_ct_RANLIB="ranlib"
3772 echo "$as_me:3772: found $ac_dir/$ac_word" >&5
3773 break
3774 done
3775
3776   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3777 fi
3778 fi
3779 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3780 if test -n "$ac_ct_RANLIB"; then
3781   echo "$as_me:3781: result: $ac_ct_RANLIB" >&5
3782 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3783 else
3784   echo "$as_me:3784: result: no" >&5
3785 echo "${ECHO_T}no" >&6
3786 fi
3787
3788   RANLIB=$ac_ct_RANLIB
3789 else
3790   RANLIB="$ac_cv_prog_RANLIB"
3791 fi
3792
3793 if test -n "$ac_tool_prefix"; then
3794   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3795 set dummy ${ac_tool_prefix}ld; ac_word=$2
3796 echo "$as_me:3796: checking for $ac_word" >&5
3797 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3798 if test "${ac_cv_prog_LD+set}" = set; then
3799   echo $ECHO_N "(cached) $ECHO_C" >&6
3800 else
3801   if test -n "$LD"; then
3802   ac_cv_prog_LD="$LD" # Let the user override the test.
3803 else
3804   ac_save_IFS=$IFS; IFS=$ac_path_separator
3805 ac_dummy="$PATH"
3806 for ac_dir in $ac_dummy; do
3807   IFS=$ac_save_IFS
3808   test -z "$ac_dir" && ac_dir=.
3809   $as_executable_p "$ac_dir/$ac_word" || continue
3810 ac_cv_prog_LD="${ac_tool_prefix}ld"
3811 echo "$as_me:3811: found $ac_dir/$ac_word" >&5
3812 break
3813 done
3814
3815 fi
3816 fi
3817 LD=$ac_cv_prog_LD
3818 if test -n "$LD"; then
3819   echo "$as_me:3819: result: $LD" >&5
3820 echo "${ECHO_T}$LD" >&6
3821 else
3822   echo "$as_me:3822: result: no" >&5
3823 echo "${ECHO_T}no" >&6
3824 fi
3825
3826 fi
3827 if test -z "$ac_cv_prog_LD"; then
3828   ac_ct_LD=$LD
3829   # Extract the first word of "ld", so it can be a program name with args.
3830 set dummy ld; ac_word=$2
3831 echo "$as_me:3831: checking for $ac_word" >&5
3832 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3833 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3834   echo $ECHO_N "(cached) $ECHO_C" >&6
3835 else
3836   if test -n "$ac_ct_LD"; then
3837   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3838 else
3839   ac_save_IFS=$IFS; IFS=$ac_path_separator
3840 ac_dummy="$PATH"
3841 for ac_dir in $ac_dummy; do
3842   IFS=$ac_save_IFS
3843   test -z "$ac_dir" && ac_dir=.
3844   $as_executable_p "$ac_dir/$ac_word" || continue
3845 ac_cv_prog_ac_ct_LD="ld"
3846 echo "$as_me:3846: found $ac_dir/$ac_word" >&5
3847 break
3848 done
3849
3850   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3851 fi
3852 fi
3853 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3854 if test -n "$ac_ct_LD"; then
3855   echo "$as_me:3855: result: $ac_ct_LD" >&5
3856 echo "${ECHO_T}$ac_ct_LD" >&6
3857 else
3858   echo "$as_me:3858: result: no" >&5
3859 echo "${ECHO_T}no" >&6
3860 fi
3861
3862   LD=$ac_ct_LD
3863 else
3864   LD="$ac_cv_prog_LD"
3865 fi
3866
3867 if test -n "$ac_tool_prefix"; then
3868   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3869 set dummy ${ac_tool_prefix}ar; ac_word=$2
3870 echo "$as_me:3870: checking for $ac_word" >&5
3871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3872 if test "${ac_cv_prog_AR+set}" = set; then
3873   echo $ECHO_N "(cached) $ECHO_C" >&6
3874 else
3875   if test -n "$AR"; then
3876   ac_cv_prog_AR="$AR" # Let the user override the test.
3877 else
3878   ac_save_IFS=$IFS; IFS=$ac_path_separator
3879 ac_dummy="$PATH"
3880 for ac_dir in $ac_dummy; do
3881   IFS=$ac_save_IFS
3882   test -z "$ac_dir" && ac_dir=.
3883   $as_executable_p "$ac_dir/$ac_word" || continue
3884 ac_cv_prog_AR="${ac_tool_prefix}ar"
3885 echo "$as_me:3885: found $ac_dir/$ac_word" >&5
3886 break
3887 done
3888
3889 fi
3890 fi
3891 AR=$ac_cv_prog_AR
3892 if test -n "$AR"; then
3893   echo "$as_me:3893: result: $AR" >&5
3894 echo "${ECHO_T}$AR" >&6
3895 else
3896   echo "$as_me:3896: result: no" >&5
3897 echo "${ECHO_T}no" >&6
3898 fi
3899
3900 fi
3901 if test -z "$ac_cv_prog_AR"; then
3902   ac_ct_AR=$AR
3903   # Extract the first word of "ar", so it can be a program name with args.
3904 set dummy ar; ac_word=$2
3905 echo "$as_me:3905: checking for $ac_word" >&5
3906 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3907 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3908   echo $ECHO_N "(cached) $ECHO_C" >&6
3909 else
3910   if test -n "$ac_ct_AR"; then
3911   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3912 else
3913   ac_save_IFS=$IFS; IFS=$ac_path_separator
3914 ac_dummy="$PATH"
3915 for ac_dir in $ac_dummy; do
3916   IFS=$ac_save_IFS
3917   test -z "$ac_dir" && ac_dir=.
3918   $as_executable_p "$ac_dir/$ac_word" || continue
3919 ac_cv_prog_ac_ct_AR="ar"
3920 echo "$as_me:3920: found $ac_dir/$ac_word" >&5
3921 break
3922 done
3923
3924   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3925 fi
3926 fi
3927 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3928 if test -n "$ac_ct_AR"; then
3929   echo "$as_me:3929: result: $ac_ct_AR" >&5
3930 echo "${ECHO_T}$ac_ct_AR" >&6
3931 else
3932   echo "$as_me:3932: result: no" >&5
3933 echo "${ECHO_T}no" >&6
3934 fi
3935
3936   AR=$ac_ct_AR
3937 else
3938   AR="$ac_cv_prog_AR"
3939 fi
3940
3941 if test -n "$ac_tool_prefix"; then
3942   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3943 set dummy ${ac_tool_prefix}ar; ac_word=$2
3944 echo "$as_me:3944: checking for $ac_word" >&5
3945 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3946 if test "${ac_cv_prog_AR+set}" = set; then
3947   echo $ECHO_N "(cached) $ECHO_C" >&6
3948 else
3949   if test -n "$AR"; then
3950   ac_cv_prog_AR="$AR" # Let the user override the test.
3951 else
3952   ac_save_IFS=$IFS; IFS=$ac_path_separator
3953 ac_dummy="$PATH"
3954 for ac_dir in $ac_dummy; do
3955   IFS=$ac_save_IFS
3956   test -z "$ac_dir" && ac_dir=.
3957   $as_executable_p "$ac_dir/$ac_word" || continue
3958 ac_cv_prog_AR="${ac_tool_prefix}ar"
3959 echo "$as_me:3959: found $ac_dir/$ac_word" >&5
3960 break
3961 done
3962
3963 fi
3964 fi
3965 AR=$ac_cv_prog_AR
3966 if test -n "$AR"; then
3967   echo "$as_me:3967: result: $AR" >&5
3968 echo "${ECHO_T}$AR" >&6
3969 else
3970   echo "$as_me:3970: result: no" >&5
3971 echo "${ECHO_T}no" >&6
3972 fi
3973
3974 fi
3975 if test -z "$ac_cv_prog_AR"; then
3976   ac_ct_AR=$AR
3977   # Extract the first word of "ar", so it can be a program name with args.
3978 set dummy ar; ac_word=$2
3979 echo "$as_me:3979: checking for $ac_word" >&5
3980 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3981 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3982   echo $ECHO_N "(cached) $ECHO_C" >&6
3983 else
3984   if test -n "$ac_ct_AR"; then
3985   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3986 else
3987   ac_save_IFS=$IFS; IFS=$ac_path_separator
3988 ac_dummy="$PATH"
3989 for ac_dir in $ac_dummy; do
3990   IFS=$ac_save_IFS
3991   test -z "$ac_dir" && ac_dir=.
3992   $as_executable_p "$ac_dir/$ac_word" || continue
3993 ac_cv_prog_ac_ct_AR="ar"
3994 echo "$as_me:3994: found $ac_dir/$ac_word" >&5
3995 break
3996 done
3997
3998   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3999 fi
4000 fi
4001 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4002 if test -n "$ac_ct_AR"; then
4003   echo "$as_me:4003: result: $ac_ct_AR" >&5
4004 echo "${ECHO_T}$ac_ct_AR" >&6
4005 else
4006   echo "$as_me:4006: result: no" >&5
4007 echo "${ECHO_T}no" >&6
4008 fi
4009
4010   AR=$ac_ct_AR
4011 else
4012   AR="$ac_cv_prog_AR"
4013 fi
4014
4015 echo "$as_me:4015: checking for options to update archives" >&5
4016 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4017 if test "${cf_cv_ar_flags+set}" = set; then
4018   echo $ECHO_N "(cached) $ECHO_C" >&6
4019 else
4020
4021         case "$cf_cv_system_name" in
4022         (*-msvc*)
4023                 cf_cv_ar_flags=''
4024                 cat >mk_static_lib.sh <<-EOF
4025                 #!$SHELL
4026                 MSVC_BIN="$AR"
4027                 out="\$1"
4028                 shift
4029                 exec \$MSVC_BIN -out:"\$out" \$@
4030                 EOF
4031                 chmod +x mk_static_lib.sh
4032                 AR=`pwd`/mk_static_lib.sh
4033                 ;;
4034         (*)
4035                 cf_cv_ar_flags=unknown
4036                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4037                 do
4038
4039                         # check if $ARFLAGS already contains this choice
4040                         if test "x$ARFLAGS" != "x" ; then
4041                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4042                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4043                                         cf_cv_ar_flags=
4044                                         break
4045                                 fi
4046                         fi
4047
4048                         rm -f "conftest.$ac_cv_objext"
4049                         rm -f conftest.a
4050
4051                         cat >"conftest.$ac_ext" <<EOF
4052 #line 4052 "configure"
4053 int     testdata[3] = { 123, 456, 789 };
4054 EOF
4055                         if { (eval echo "$as_me:4055: \"$ac_compile\"") >&5
4056   (eval $ac_compile) 2>&5
4057   ac_status=$?
4058   echo "$as_me:4058: \$? = $ac_status" >&5
4059   (exit "$ac_status"); } ; then
4060                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4061                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4062                                 if test -f conftest.a ; then
4063                                         cf_cv_ar_flags="$cf_ar_flags"
4064                                         break
4065                                 fi
4066                         else
4067                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4068
4069 echo "${as_me:-configure}:4069: testing cannot compile test-program ..." 1>&5
4070
4071                                 break
4072                         fi
4073                 done
4074                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4075                 ;;
4076         esac
4077
4078 fi
4079 echo "$as_me:4079: result: $cf_cv_ar_flags" >&5
4080 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4081
4082 if test -n "$ARFLAGS" ; then
4083         if test -n "$cf_cv_ar_flags" ; then
4084                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4085         fi
4086 else
4087         ARFLAGS=$cf_cv_ar_flags
4088 fi
4089
4090         echo "$as_me:4090: checking for PATH separator" >&5
4091 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4092         case "$cf_cv_system_name" in
4093         (os2*)  PATH_SEPARATOR=';'  ;;
4094         (*)     ${PATH_SEPARATOR:=':'}  ;;
4095         esac
4096
4097         echo "$as_me:4097: result: $PATH_SEPARATOR" >&5
4098 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4099
4100 echo "$as_me:4100: checking if you have specified an install-prefix" >&5
4101 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4102
4103 # Check whether --with-install-prefix or --without-install-prefix was given.
4104 if test "${with_install_prefix+set}" = set; then
4105   withval="$with_install_prefix"
4106   case "$withval" in
4107         (yes|no)
4108                 ;;
4109         (*)     DESTDIR="$withval"
4110                 ;;
4111         esac
4112 fi;
4113 echo "$as_me:4113: result: $DESTDIR" >&5
4114 echo "${ECHO_T}$DESTDIR" >&6
4115
4116 ###############################################################################
4117
4118 # If we're cross-compiling, allow the user to override the tools and their
4119 # options.  The configure script is oriented toward identifying the host
4120 # compiler, etc., but we need a build compiler to generate parts of the source.
4121
4122 if test "$cross_compiling" = yes ; then
4123
4124         # defaults that we might want to override
4125         : ${BUILD_CFLAGS:=''}
4126         : ${BUILD_CPPFLAGS:=''}
4127         : ${BUILD_LDFLAGS:=''}
4128         : ${BUILD_LIBS:=''}
4129         : ${BUILD_EXEEXT:='$x'}
4130         : ${BUILD_OBJEXT:='o'}
4131
4132 # Check whether --with-build-cc or --without-build-cc was given.
4133 if test "${with_build_cc+set}" = set; then
4134   withval="$with_build_cc"
4135   BUILD_CC="$withval"
4136 else
4137   for ac_prog in gcc clang c99 c89 cc cl
4138 do
4139   # Extract the first word of "$ac_prog", so it can be a program name with args.
4140 set dummy $ac_prog; ac_word=$2
4141 echo "$as_me:4141: checking for $ac_word" >&5
4142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4143 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4144   echo $ECHO_N "(cached) $ECHO_C" >&6
4145 else
4146   if test -n "$BUILD_CC"; then
4147   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4148 else
4149   ac_save_IFS=$IFS; IFS=$ac_path_separator
4150 ac_dummy="$PATH"
4151 for ac_dir in $ac_dummy; do
4152   IFS=$ac_save_IFS
4153   test -z "$ac_dir" && ac_dir=.
4154   $as_executable_p "$ac_dir/$ac_word" || continue
4155 ac_cv_prog_BUILD_CC="$ac_prog"
4156 echo "$as_me:4156: found $ac_dir/$ac_word" >&5
4157 break
4158 done
4159
4160 fi
4161 fi
4162 BUILD_CC=$ac_cv_prog_BUILD_CC
4163 if test -n "$BUILD_CC"; then
4164   echo "$as_me:4164: result: $BUILD_CC" >&5
4165 echo "${ECHO_T}$BUILD_CC" >&6
4166 else
4167   echo "$as_me:4167: result: no" >&5
4168 echo "${ECHO_T}no" >&6
4169 fi
4170
4171   test -n "$BUILD_CC" && break
4172 done
4173 test -n "$BUILD_CC" || BUILD_CC="none"
4174
4175 fi;
4176         echo "$as_me:4176: checking for native build C compiler" >&5
4177 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4178         echo "$as_me:4178: result: $BUILD_CC" >&5
4179 echo "${ECHO_T}$BUILD_CC" >&6
4180
4181         echo "$as_me:4181: checking for native build C preprocessor" >&5
4182 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4183
4184 # Check whether --with-build-cpp or --without-build-cpp was given.
4185 if test "${with_build_cpp+set}" = set; then
4186   withval="$with_build_cpp"
4187   BUILD_CPP="$withval"
4188 else
4189   BUILD_CPP='${BUILD_CC} -E'
4190 fi;
4191         echo "$as_me:4191: result: $BUILD_CPP" >&5
4192 echo "${ECHO_T}$BUILD_CPP" >&6
4193
4194         echo "$as_me:4194: checking for native build C flags" >&5
4195 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4196
4197 # Check whether --with-build-cflags or --without-build-cflags was given.
4198 if test "${with_build_cflags+set}" = set; then
4199   withval="$with_build_cflags"
4200   BUILD_CFLAGS="$withval"
4201 fi;
4202         echo "$as_me:4202: result: $BUILD_CFLAGS" >&5
4203 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4204
4205         echo "$as_me:4205: checking for native build C preprocessor-flags" >&5
4206 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4207
4208 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4209 if test "${with_build_cppflags+set}" = set; then
4210   withval="$with_build_cppflags"
4211   BUILD_CPPFLAGS="$withval"
4212 fi;
4213         echo "$as_me:4213: result: $BUILD_CPPFLAGS" >&5
4214 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4215
4216         echo "$as_me:4216: checking for native build linker-flags" >&5
4217 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4218
4219 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4220 if test "${with_build_ldflags+set}" = set; then
4221   withval="$with_build_ldflags"
4222   BUILD_LDFLAGS="$withval"
4223 fi;
4224         echo "$as_me:4224: result: $BUILD_LDFLAGS" >&5
4225 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4226
4227         echo "$as_me:4227: checking for native build linker-libraries" >&5
4228 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4229
4230 # Check whether --with-build-libs or --without-build-libs was given.
4231 if test "${with_build_libs+set}" = set; then
4232   withval="$with_build_libs"
4233   BUILD_LIBS="$withval"
4234 fi;
4235         echo "$as_me:4235: result: $BUILD_LIBS" >&5
4236 echo "${ECHO_T}$BUILD_LIBS" >&6
4237
4238         # this assumes we're on Unix.
4239         BUILD_EXEEXT=
4240         BUILD_OBJEXT=o
4241
4242         : ${BUILD_CC:='${CC}'}
4243
4244         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4245                 { { echo "$as_me:4245: error: Cross-build requires two compilers.
4246 Use --with-build-cc to specify the native compiler." >&5
4247 echo "$as_me: error: Cross-build requires two compilers.
4248 Use --with-build-cc to specify the native compiler." >&2;}
4249    { (exit 1); exit 1; }; }
4250         fi
4251
4252 else
4253         : ${BUILD_CC:='${CC}'}
4254         : ${BUILD_CPP:='${CPP}'}
4255         : ${BUILD_CFLAGS:='${CFLAGS}'}
4256         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4257         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4258         : ${BUILD_LIBS:='${LIBS}'}
4259         : ${BUILD_EXEEXT:='$x'}
4260         : ${BUILD_OBJEXT:='o'}
4261 fi
4262
4263 ###############################################################################
4264
4265 ### Options to allow the user to specify the set of libraries which are used.
4266 ### Use "--without-normal --with-shared" to allow the default model to be
4267 ### shared, for example.
4268 cf_list_models=""
4269
4270 echo "$as_me:4270: checking if you want to build shared C-objects" >&5
4271 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4272
4273 # Check whether --with-shared or --without-shared was given.
4274 if test "${with_shared+set}" = set; then
4275   withval="$with_shared"
4276   with_shared=$withval
4277 else
4278   with_shared=no
4279 fi;
4280 echo "$as_me:4280: result: $with_shared" >&5
4281 echo "${ECHO_T}$with_shared" >&6
4282 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4283
4284 echo "$as_me:4284: checking for specified models" >&5
4285 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4286 test -z "$cf_list_models" && cf_list_models=normal
4287 echo "$as_me:4287: result: $cf_list_models" >&5
4288 echo "${ECHO_T}$cf_list_models" >&6
4289
4290 ### Use the first model as the default, and save its suffix for use in building
4291 ### up test-applications.
4292 echo "$as_me:4292: checking for default model" >&5
4293 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4294 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4295 echo "$as_me:4295: result: $DFT_LWR_MODEL" >&5
4296 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4297
4298 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4299
4300 echo "$as_me:4300: checking for specific curses-directory" >&5
4301 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4302
4303 # Check whether --with-curses-dir or --without-curses-dir was given.
4304 if test "${with_curses_dir+set}" = set; then
4305   withval="$with_curses_dir"
4306   cf_cv_curses_dir=$withval
4307 else
4308   cf_cv_curses_dir=no
4309 fi;
4310 echo "$as_me:4310: result: $cf_cv_curses_dir" >&5
4311 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4312
4313 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4314 then
4315
4316 if test "x$prefix" != xNONE; then
4317         cf_path_syntax="$prefix"
4318 else
4319         cf_path_syntax="$ac_default_prefix"
4320 fi
4321
4322 case ".$withval" in
4323 (.\$\(*\)*|.\'*\'*)
4324         ;;
4325 (..|./*|.\\*)
4326         ;;
4327 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4328         ;;
4329 (.\$\{*prefix\}*|.\$\{*dir\}*)
4330         eval withval="$withval"
4331         case ".$withval" in
4332         (.NONE/*)
4333                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4334                 ;;
4335         esac
4336         ;;
4337 (.no|.NONE/*)
4338         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4339         ;;
4340 (*)
4341         { { echo "$as_me:4341: error: expected a pathname, not \"$withval\"" >&5
4342 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4343    { (exit 1); exit 1; }; }
4344         ;;
4345 esac
4346
4347         if test -d "$cf_cv_curses_dir"
4348         then
4349
4350 if test -n "$cf_cv_curses_dir/include" ; then
4351   for cf_add_incdir in $cf_cv_curses_dir/include
4352   do
4353         while test "$cf_add_incdir" != /usr/include
4354         do
4355           if test -d "$cf_add_incdir"
4356           then
4357                 cf_have_incdir=no
4358                 if test -n "$CFLAGS$CPPFLAGS" ; then
4359                   # a loop is needed to ensure we can add subdirs of existing dirs
4360                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4361                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4362                           cf_have_incdir=yes; break
4363                         fi
4364                   done
4365                 fi
4366
4367                 if test "$cf_have_incdir" = no ; then
4368                   if test "$cf_add_incdir" = /usr/local/include ; then
4369                         if test "$GCC" = yes
4370                         then
4371                           cf_save_CPPFLAGS=$CPPFLAGS
4372
4373         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4374         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4375
4376                           cat >"conftest.$ac_ext" <<_ACEOF
4377 #line 4377 "configure"
4378 #include "confdefs.h"
4379 #include <stdio.h>
4380 int
4381 main (void)
4382 {
4383 printf("Hello")
4384   ;
4385   return 0;
4386 }
4387 _ACEOF
4388 rm -f "conftest.$ac_objext"
4389 if { (eval echo "$as_me:4389: \"$ac_compile\"") >&5
4390   (eval $ac_compile) 2>&5
4391   ac_status=$?
4392   echo "$as_me:4392: \$? = $ac_status" >&5
4393   (exit "$ac_status"); } &&
4394          { ac_try='test -s "conftest.$ac_objext"'
4395   { (eval echo "$as_me:4395: \"$ac_try\"") >&5
4396   (eval $ac_try) 2>&5
4397   ac_status=$?
4398   echo "$as_me:4398: \$? = $ac_status" >&5
4399   (exit "$ac_status"); }; }; then
4400   :
4401 else
4402   echo "$as_me: failed program was:" >&5
4403 cat "conftest.$ac_ext" >&5
4404 cf_have_incdir=yes
4405 fi
4406 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4407                           CPPFLAGS=$cf_save_CPPFLAGS
4408                         fi
4409                   fi
4410                 fi
4411
4412                 if test "$cf_have_incdir" = no ; then
4413                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4414
4415 echo "${as_me:-configure}:4415: testing adding $cf_add_incdir to include-path ..." 1>&5
4416
4417                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4418
4419                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4420                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4421                   cf_add_incdir="$cf_top_incdir"
4422                 else
4423                   break
4424                 fi
4425           else
4426                 break
4427           fi
4428         done
4429   done
4430 fi
4431
4432 if test -n "$cf_cv_curses_dir/lib" ; then
4433         for cf_add_libdir in $cf_cv_curses_dir/lib
4434         do
4435                 if test "$cf_add_libdir" = /usr/lib ; then
4436                         :
4437                 elif test -d "$cf_add_libdir"
4438                 then
4439                         cf_have_libdir=no
4440                         if test -n "$LDFLAGS$LIBS" ; then
4441                                 # a loop is needed to ensure we can add subdirs of existing dirs
4442                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4443                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4444                                                 cf_have_libdir=yes; break
4445                                         fi
4446                                 done
4447                         fi
4448                         if test "$cf_have_libdir" = no ; then
4449                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4450
4451 echo "${as_me:-configure}:4451: testing adding $cf_add_libdir to library-path ..." 1>&5
4452
4453                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4454                         fi
4455                 fi
4456         done
4457 fi
4458
4459         fi
4460 fi
4461
4462 cf_ncuconfig_root=ncurses
4463 cf_have_ncuconfig=no
4464
4465 if test "x${PKG_CONFIG:=none}" != xnone; then
4466         echo "$as_me:4466: checking pkg-config for $cf_ncuconfig_root" >&5
4467 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4468         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4469                 echo "$as_me:4469: result: yes" >&5
4470 echo "${ECHO_T}yes" >&6
4471
4472                 echo "$as_me:4472: checking if the $cf_ncuconfig_root package files work" >&5
4473 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4474                 cf_have_ncuconfig=unknown
4475
4476                 cf_save_CFLAGS="$CFLAGS"
4477                 cf_save_CPPFLAGS="$CPPFLAGS"
4478                 cf_save_LIBS="$LIBS"
4479
4480                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4481                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4482
4483                 # while -W for passing linker flags is prevalent, it is not "standard".
4484                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4485                 # incompatible _and_ non-standard -W option which gives an error.  Work
4486                 # around that pitfall.
4487                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4488                 (x*c[89]9@@*-W*)
4489
4490 cf_fix_cppflags=no
4491 cf_new_cflags=
4492 cf_new_cppflags=
4493 cf_new_extra_cppflags=
4494
4495 for cf_add_cflags in $cf_pkg_cflags
4496 do
4497 case "$cf_fix_cppflags" in
4498 (no)
4499         case "$cf_add_cflags" in
4500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4501                 case "$cf_add_cflags" in
4502                 (-D*)
4503                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4504
4505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4506                                 && test -z "${cf_tst_cflags}" \
4507                                 && cf_fix_cppflags=yes
4508
4509                         if test "$cf_fix_cppflags" = yes ; then
4510
4511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4513
4514                                 continue
4515                         elif test "${cf_tst_cflags}" = "\"'" ; then
4516
4517         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4518         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4519
4520                                 continue
4521                         fi
4522                         ;;
4523                 esac
4524                 case "$CPPFLAGS" in
4525                 (*$cf_add_cflags)
4526                         ;;
4527                 (*)
4528                         case "$cf_add_cflags" in
4529                         (-D*)
4530                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4531
4532 CPPFLAGS=`echo "$CPPFLAGS" | \
4533         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4534                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4535
4536                                 ;;
4537                         esac
4538
4539         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4540         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4541
4542                         ;;
4543                 esac
4544                 ;;
4545         (*)
4546
4547         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4548         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4549
4550                 ;;
4551         esac
4552         ;;
4553 (yes)
4554
4555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4557
4558         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4559
4560         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4561                 && test -z "${cf_tst_cflags}" \
4562                 && cf_fix_cppflags=no
4563         ;;
4564 esac
4565 done
4566
4567 if test -n "$cf_new_cflags" ; then
4568
4569         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4570         CFLAGS="${CFLAGS}$cf_new_cflags"
4571
4572 fi
4573
4574 if test -n "$cf_new_cppflags" ; then
4575
4576         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4577         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4578
4579 fi
4580
4581 if test -n "$cf_new_extra_cppflags" ; then
4582
4583         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4584         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4585
4586 fi
4587
4588 cf_add_libs="$LIBS"
4589 # reverse order
4590 cf_add_0lib=
4591 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4592 # filter duplicates
4593 for cf_add_1lib in $cf_add_0lib; do
4594         for cf_add_2lib in $cf_add_libs; do
4595                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4596                         cf_add_1lib=
4597                         break
4598                 fi
4599         done
4600         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4601 done
4602 LIBS="$cf_add_libs"
4603
4604                         cat >"conftest.$ac_ext" <<_ACEOF
4605 #line 4605 "configure"
4606 #include "confdefs.h"
4607 #include <${cf_cv_ncurses_header:-curses.h}>
4608 int
4609 main (void)
4610 {
4611 initscr(); mousemask(0,0); tigetstr((char *)0);
4612   ;
4613   return 0;
4614 }
4615 _ACEOF
4616 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4617 if { (eval echo "$as_me:4617: \"$ac_link\"") >&5
4618   (eval $ac_link) 2>&5
4619   ac_status=$?
4620   echo "$as_me:4620: \$? = $ac_status" >&5
4621   (exit "$ac_status"); } &&
4622          { ac_try='test -s "conftest$ac_exeext"'
4623   { (eval echo "$as_me:4623: \"$ac_try\"") >&5
4624   (eval $ac_try) 2>&5
4625   ac_status=$?
4626   echo "$as_me:4626: \$? = $ac_status" >&5
4627   (exit "$ac_status"); }; }; then
4628   if test "$cross_compiling" = yes; then
4629   cf_test_ncuconfig=maybe
4630 else
4631   cat >"conftest.$ac_ext" <<_ACEOF
4632 #line 4632 "configure"
4633 #include "confdefs.h"
4634 #include <${cf_cv_ncurses_header:-curses.h}>
4635                                         int main(void)
4636                                         { const char *xx = curses_version(); return (xx == 0); }
4637 _ACEOF
4638 rm -f "conftest$ac_exeext"
4639 if { (eval echo "$as_me:4639: \"$ac_link\"") >&5
4640   (eval $ac_link) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4644   { (eval echo "$as_me:4644: \"$ac_try\"") >&5
4645   (eval $ac_try) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit "$ac_status"); }; }; then
4649   cf_test_ncuconfig=yes
4650 else
4651   echo "$as_me: program exited with status $ac_status" >&5
4652 echo "$as_me: failed program was:" >&5
4653 cat "conftest.$ac_ext" >&5
4654 cf_test_ncuconfig=no
4655 fi
4656 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4657 fi
4658 else
4659   echo "$as_me: failed program was:" >&5
4660 cat "conftest.$ac_ext" >&5
4661 cf_test_ncuconfig=no
4662 fi
4663 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4664
4665                         CFLAGS="$cf_save_CFLAGS"
4666                         CPPFLAGS="$cf_save_CPPFLAGS"
4667                         LIBS="$cf_save_LIBS"
4668
4669                         if test "x$cf_test_ncuconfig" != xyes; then
4670                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4671                                 cf_pkg_cflags="$cf_temp"
4672                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4673                                 cf_pkg_libs="$cf_temp"
4674                         fi
4675                         ;;
4676                 esac
4677
4678 cf_fix_cppflags=no
4679 cf_new_cflags=
4680 cf_new_cppflags=
4681 cf_new_extra_cppflags=
4682
4683 for cf_add_cflags in $cf_pkg_cflags
4684 do
4685 case "$cf_fix_cppflags" in
4686 (no)
4687         case "$cf_add_cflags" in
4688         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4689                 case "$cf_add_cflags" in
4690                 (-D*)
4691                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4692
4693                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4694                                 && test -z "${cf_tst_cflags}" \
4695                                 && cf_fix_cppflags=yes
4696
4697                         if test "$cf_fix_cppflags" = yes ; then
4698
4699         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4700         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4701
4702                                 continue
4703                         elif test "${cf_tst_cflags}" = "\"'" ; then
4704
4705         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4706         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4707
4708                                 continue
4709                         fi
4710                         ;;
4711                 esac
4712                 case "$CPPFLAGS" in
4713                 (*$cf_add_cflags)
4714                         ;;
4715                 (*)
4716                         case "$cf_add_cflags" in
4717                         (-D*)
4718                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4719
4720 CPPFLAGS=`echo "$CPPFLAGS" | \
4721         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4722                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4723
4724                                 ;;
4725                         esac
4726
4727         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4728         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4729
4730                         ;;
4731                 esac
4732                 ;;
4733         (*)
4734
4735         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4736         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4737
4738                 ;;
4739         esac
4740         ;;
4741 (yes)
4742
4743         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4744         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4745
4746         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4747
4748         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4749                 && test -z "${cf_tst_cflags}" \
4750                 && cf_fix_cppflags=no
4751         ;;
4752 esac
4753 done
4754
4755 if test -n "$cf_new_cflags" ; then
4756
4757         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4758         CFLAGS="${CFLAGS}$cf_new_cflags"
4759
4760 fi
4761
4762 if test -n "$cf_new_cppflags" ; then
4763
4764         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4765         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4766
4767 fi
4768
4769 if test -n "$cf_new_extra_cppflags" ; then
4770
4771         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4772         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4773
4774 fi
4775
4776 cf_add_libs="$LIBS"
4777 # reverse order
4778 cf_add_0lib=
4779 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4780 # filter duplicates
4781 for cf_add_1lib in $cf_add_0lib; do
4782         for cf_add_2lib in $cf_add_libs; do
4783                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4784                         cf_add_1lib=
4785                         break
4786                 fi
4787         done
4788         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4789 done
4790 LIBS="$cf_add_libs"
4791
4792                 cat >"conftest.$ac_ext" <<_ACEOF
4793 #line 4793 "configure"
4794 #include "confdefs.h"
4795 #include <${cf_cv_ncurses_header:-curses.h}>
4796 int
4797 main (void)
4798 {
4799 initscr(); mousemask(0,0); tigetstr((char *)0);
4800   ;
4801   return 0;
4802 }
4803 _ACEOF
4804 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4805 if { (eval echo "$as_me:4805: \"$ac_link\"") >&5
4806   (eval $ac_link) 2>&5
4807   ac_status=$?
4808   echo "$as_me:4808: \$? = $ac_status" >&5
4809   (exit "$ac_status"); } &&
4810          { ac_try='test -s "conftest$ac_exeext"'
4811   { (eval echo "$as_me:4811: \"$ac_try\"") >&5
4812   (eval $ac_try) 2>&5
4813   ac_status=$?
4814   echo "$as_me:4814: \$? = $ac_status" >&5
4815   (exit "$ac_status"); }; }; then
4816   if test "$cross_compiling" = yes; then
4817   cf_have_ncuconfig=maybe
4818 else
4819   cat >"conftest.$ac_ext" <<_ACEOF
4820 #line 4820 "configure"
4821 #include "confdefs.h"
4822 #include <${cf_cv_ncurses_header:-curses.h}>
4823                                 int main(void)
4824                                 { const char *xx = curses_version(); return (xx == 0); }
4825 _ACEOF
4826 rm -f "conftest$ac_exeext"
4827 if { (eval echo "$as_me:4827: \"$ac_link\"") >&5
4828   (eval $ac_link) 2>&5
4829   ac_status=$?
4830   echo "$as_me:4830: \$? = $ac_status" >&5
4831   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4832   { (eval echo "$as_me:4832: \"$ac_try\"") >&5
4833   (eval $ac_try) 2>&5
4834   ac_status=$?
4835   echo "$as_me:4835: \$? = $ac_status" >&5
4836   (exit "$ac_status"); }; }; then
4837   cf_have_ncuconfig=yes
4838 else
4839   echo "$as_me: program exited with status $ac_status" >&5
4840 echo "$as_me: failed program was:" >&5
4841 cat "conftest.$ac_ext" >&5
4842 cf_have_ncuconfig=no
4843 fi
4844 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4845 fi
4846 else
4847   echo "$as_me: failed program was:" >&5
4848 cat "conftest.$ac_ext" >&5
4849 cf_have_ncuconfig=no
4850 fi
4851 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4852                 echo "$as_me:4852: result: $cf_have_ncuconfig" >&5
4853 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4854                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4855                 if test "$cf_have_ncuconfig" != "yes"
4856                 then
4857                         CPPFLAGS="$cf_save_CPPFLAGS"
4858                         LIBS="$cf_save_LIBS"
4859                         NCURSES_CONFIG_PKG=none
4860                 else
4861
4862 cat >>confdefs.h <<\EOF
4863 #define NCURSES 1
4864 EOF
4865
4866                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4867
4868 echo "$as_me:4868: checking for terminfo header" >&5
4869 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4870 if test "${cf_cv_term_header+set}" = set; then
4871   echo $ECHO_N "(cached) $ECHO_C" >&6
4872 else
4873
4874 case "${cf_cv_ncurses_header}" in
4875 (*/ncurses.h|*/ncursesw.h)
4876         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4877         ;;
4878 (*)
4879         cf_term_header=term.h
4880         ;;
4881 esac
4882
4883 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4884 do
4885 cat >"conftest.$ac_ext" <<_ACEOF
4886 #line 4886 "configure"
4887 #include "confdefs.h"
4888 #include <stdio.h>
4889 #include <${cf_cv_ncurses_header:-curses.h}>
4890 #include <$cf_test>
4891
4892 int
4893 main (void)
4894 {
4895 int x = auto_left_margin; (void)x
4896   ;
4897   return 0;
4898 }
4899 _ACEOF
4900 rm -f "conftest.$ac_objext"
4901 if { (eval echo "$as_me:4901: \"$ac_compile\"") >&5
4902   (eval $ac_compile) 2>&5
4903   ac_status=$?
4904   echo "$as_me:4904: \$? = $ac_status" >&5
4905   (exit "$ac_status"); } &&
4906          { ac_try='test -s "conftest.$ac_objext"'
4907   { (eval echo "$as_me:4907: \"$ac_try\"") >&5
4908   (eval $ac_try) 2>&5
4909   ac_status=$?
4910   echo "$as_me:4910: \$? = $ac_status" >&5
4911   (exit "$ac_status"); }; }; then
4912
4913         cf_cv_term_header="$cf_test"
4914 else
4915   echo "$as_me: failed program was:" >&5
4916 cat "conftest.$ac_ext" >&5
4917
4918         cf_cv_term_header=unknown
4919
4920 fi
4921 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4922         test "$cf_cv_term_header" != unknown && break
4923 done
4924
4925 fi
4926 echo "$as_me:4926: result: $cf_cv_term_header" >&5
4927 echo "${ECHO_T}$cf_cv_term_header" >&6
4928
4929 # Set definitions to allow ifdef'ing to accommodate subdirectories
4930
4931 case "$cf_cv_term_header" in
4932 (*term.h)
4933
4934 cat >>confdefs.h <<\EOF
4935 #define HAVE_TERM_H 1
4936 EOF
4937
4938         ;;
4939 esac
4940
4941 case "$cf_cv_term_header" in
4942 (ncurses/term.h)
4943
4944 cat >>confdefs.h <<\EOF
4945 #define HAVE_NCURSES_TERM_H 1
4946 EOF
4947
4948         ;;
4949 (ncursesw/term.h)
4950
4951 cat >>confdefs.h <<\EOF
4952 #define HAVE_NCURSESW_TERM_H 1
4953 EOF
4954
4955         ;;
4956 esac
4957
4958                 fi
4959
4960         else
4961                 echo "$as_me:4961: result: no" >&5
4962 echo "${ECHO_T}no" >&6
4963                 NCURSES_CONFIG_PKG=none
4964         fi
4965 else
4966         NCURSES_CONFIG_PKG=none
4967 fi
4968
4969 if test "x$cf_have_ncuconfig" = "xno"; then
4970         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4971
4972 if test -n "$ac_tool_prefix"; then
4973   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4974   do
4975     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4976 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4977 echo "$as_me:4977: checking for $ac_word" >&5
4978 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4979 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4980   echo $ECHO_N "(cached) $ECHO_C" >&6
4981 else
4982   if test -n "$NCURSES_CONFIG"; then
4983   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4984 else
4985   ac_save_IFS=$IFS; IFS=$ac_path_separator
4986 ac_dummy="$PATH"
4987 for ac_dir in $ac_dummy; do
4988   IFS=$ac_save_IFS
4989   test -z "$ac_dir" && ac_dir=.
4990   $as_executable_p "$ac_dir/$ac_word" || continue
4991 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4992 echo "$as_me:4992: found $ac_dir/$ac_word" >&5
4993 break
4994 done
4995
4996 fi
4997 fi
4998 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4999 if test -n "$NCURSES_CONFIG"; then
5000   echo "$as_me:5000: result: $NCURSES_CONFIG" >&5
5001 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5002 else
5003   echo "$as_me:5003: result: no" >&5
5004 echo "${ECHO_T}no" >&6
5005 fi
5006
5007     test -n "$NCURSES_CONFIG" && break
5008   done
5009 fi
5010 if test -z "$NCURSES_CONFIG"; then
5011   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5012   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5013 do
5014   # Extract the first word of "$ac_prog", so it can be a program name with args.
5015 set dummy $ac_prog; ac_word=$2
5016 echo "$as_me:5016: checking for $ac_word" >&5
5017 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5018 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5019   echo $ECHO_N "(cached) $ECHO_C" >&6
5020 else
5021   if test -n "$ac_ct_NCURSES_CONFIG"; then
5022   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5023 else
5024   ac_save_IFS=$IFS; IFS=$ac_path_separator
5025 ac_dummy="$PATH"
5026 for ac_dir in $ac_dummy; do
5027   IFS=$ac_save_IFS
5028   test -z "$ac_dir" && ac_dir=.
5029   $as_executable_p "$ac_dir/$ac_word" || continue
5030 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5031 echo "$as_me:5031: found $ac_dir/$ac_word" >&5
5032 break
5033 done
5034
5035 fi
5036 fi
5037 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5038 if test -n "$ac_ct_NCURSES_CONFIG"; then
5039   echo "$as_me:5039: result: $ac_ct_NCURSES_CONFIG" >&5
5040 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5041 else
5042   echo "$as_me:5042: result: no" >&5
5043 echo "${ECHO_T}no" >&6
5044 fi
5045
5046   test -n "$ac_ct_NCURSES_CONFIG" && break
5047 done
5048 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5049
5050   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5051 fi
5052
5053         if test "$NCURSES_CONFIG" != none ; then
5054
5055 cf_fix_cppflags=no
5056 cf_new_cflags=
5057 cf_new_cppflags=
5058 cf_new_extra_cppflags=
5059
5060 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5061 do
5062 case "$cf_fix_cppflags" in
5063 (no)
5064         case "$cf_add_cflags" in
5065         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5066                 case "$cf_add_cflags" in
5067                 (-D*)
5068                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5069
5070                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5071                                 && test -z "${cf_tst_cflags}" \
5072                                 && cf_fix_cppflags=yes
5073
5074                         if test "$cf_fix_cppflags" = yes ; then
5075
5076         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5077         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5078
5079                                 continue
5080                         elif test "${cf_tst_cflags}" = "\"'" ; then
5081
5082         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5083         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5084
5085                                 continue
5086                         fi
5087                         ;;
5088                 esac
5089                 case "$CPPFLAGS" in
5090                 (*$cf_add_cflags)
5091                         ;;
5092                 (*)
5093                         case "$cf_add_cflags" in
5094                         (-D*)
5095                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5096
5097 CPPFLAGS=`echo "$CPPFLAGS" | \
5098         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5099                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5100
5101                                 ;;
5102                         esac
5103
5104         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5105         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5106
5107                         ;;
5108                 esac
5109                 ;;
5110         (*)
5111
5112         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5113         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5114
5115                 ;;
5116         esac
5117         ;;
5118 (yes)
5119
5120         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5121         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5122
5123         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5124
5125         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5126                 && test -z "${cf_tst_cflags}" \
5127                 && cf_fix_cppflags=no
5128         ;;
5129 esac
5130 done
5131
5132 if test -n "$cf_new_cflags" ; then
5133
5134         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5135         CFLAGS="${CFLAGS}$cf_new_cflags"
5136
5137 fi
5138
5139 if test -n "$cf_new_cppflags" ; then
5140
5141         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5142         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5143
5144 fi
5145
5146 if test -n "$cf_new_extra_cppflags" ; then
5147
5148         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5149         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5150
5151 fi
5152
5153 cf_add_libs="$LIBS"
5154 # reverse order
5155 cf_add_0lib=
5156 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5157 # filter duplicates
5158 for cf_add_1lib in $cf_add_0lib; do
5159         for cf_add_2lib in $cf_add_libs; do
5160                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5161                         cf_add_1lib=
5162                         break
5163                 fi
5164         done
5165         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5166 done
5167 LIBS="$cf_add_libs"
5168
5169                 # even with config script, some packages use no-override for curses.h
5170
5171 echo "$as_me:5171: checking if we have identified curses headers" >&5
5172 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5173 if test "${cf_cv_ncurses_header+set}" = set; then
5174   echo $ECHO_N "(cached) $ECHO_C" >&6
5175 else
5176
5177 cf_cv_ncurses_header=none
5178 for cf_header in \
5179         ncurses.h ncurses/ncurses.h \
5180         curses.h ncurses/curses.h
5181 do
5182 cat >"conftest.$ac_ext" <<_ACEOF
5183 #line 5183 "configure"
5184 #include "confdefs.h"
5185 #include <${cf_header}>
5186 int
5187 main (void)
5188 {
5189 initscr(); tgoto("?", 0,0)
5190   ;
5191   return 0;
5192 }
5193 _ACEOF
5194 rm -f "conftest.$ac_objext"
5195 if { (eval echo "$as_me:5195: \"$ac_compile\"") >&5
5196   (eval $ac_compile) 2>&5
5197   ac_status=$?
5198   echo "$as_me:5198: \$? = $ac_status" >&5
5199   (exit "$ac_status"); } &&
5200          { ac_try='test -s "conftest.$ac_objext"'
5201   { (eval echo "$as_me:5201: \"$ac_try\"") >&5
5202   (eval $ac_try) 2>&5
5203   ac_status=$?
5204   echo "$as_me:5204: \$? = $ac_status" >&5
5205   (exit "$ac_status"); }; }; then
5206   cf_cv_ncurses_header=$cf_header; break
5207 else
5208   echo "$as_me: failed program was:" >&5
5209 cat "conftest.$ac_ext" >&5
5210 fi
5211 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5212 done
5213
5214 fi
5215 echo "$as_me:5215: result: $cf_cv_ncurses_header" >&5
5216 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5217
5218 if test "$cf_cv_ncurses_header" = none ; then
5219         { { echo "$as_me:5219: error: No curses header-files found" >&5
5220 echo "$as_me: error: No curses header-files found" >&2;}
5221    { (exit 1); exit 1; }; }
5222 fi
5223
5224 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5225
5226 for ac_header in $cf_cv_ncurses_header
5227 do
5228 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5229 echo "$as_me:5229: checking for $ac_header" >&5
5230 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5231 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5232   echo $ECHO_N "(cached) $ECHO_C" >&6
5233 else
5234   cat >"conftest.$ac_ext" <<_ACEOF
5235 #line 5235 "configure"
5236 #include "confdefs.h"
5237 #include <$ac_header>
5238 _ACEOF
5239 if { (eval echo "$as_me:5239: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5240   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5241   ac_status=$?
5242   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5243   rm -f conftest.er1
5244   cat conftest.err >&5
5245   echo "$as_me:5245: \$? = $ac_status" >&5
5246   (exit "$ac_status"); } >/dev/null; then
5247   if test -s conftest.err; then
5248     ac_cpp_err=$ac_c_preproc_warn_flag
5249   else
5250     ac_cpp_err=
5251   fi
5252 else
5253   ac_cpp_err=yes
5254 fi
5255 if test -z "$ac_cpp_err"; then
5256   eval "$as_ac_Header=yes"
5257 else
5258   echo "$as_me: failed program was:" >&5
5259   cat "conftest.$ac_ext" >&5
5260   eval "$as_ac_Header=no"
5261 fi
5262 rm -f conftest.err "conftest.$ac_ext"
5263 fi
5264 echo "$as_me:5264: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5265 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5266 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5267   cat >>confdefs.h <<EOF
5268 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5269 EOF
5270
5271 fi
5272 done
5273
5274 cat >>confdefs.h <<\EOF
5275 #define NCURSES 1
5276 EOF
5277
5278 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5279
5280                 cat >>confdefs.h <<EOF
5281 #define $cf_nculib_ROOT 1
5282 EOF
5283
5284                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5285
5286         else
5287
5288 cf_ncuhdr_root=ncurses
5289
5290 test -n "$cf_cv_curses_dir" && \
5291 test "$cf_cv_curses_dir" != "no" && { \
5292
5293 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5294   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5295   do
5296         while test "$cf_add_incdir" != /usr/include
5297         do
5298           if test -d "$cf_add_incdir"
5299           then
5300                 cf_have_incdir=no
5301                 if test -n "$CFLAGS$CPPFLAGS" ; then
5302                   # a loop is needed to ensure we can add subdirs of existing dirs
5303                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5304                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5305                           cf_have_incdir=yes; break
5306                         fi
5307                   done
5308                 fi
5309
5310                 if test "$cf_have_incdir" = no ; then
5311                   if test "$cf_add_incdir" = /usr/local/include ; then
5312                         if test "$GCC" = yes
5313                         then
5314                           cf_save_CPPFLAGS=$CPPFLAGS
5315
5316         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5317         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5318
5319                           cat >"conftest.$ac_ext" <<_ACEOF
5320 #line 5320 "configure"
5321 #include "confdefs.h"
5322 #include <stdio.h>
5323 int
5324 main (void)
5325 {
5326 printf("Hello")
5327   ;
5328   return 0;
5329 }
5330 _ACEOF
5331 rm -f "conftest.$ac_objext"
5332 if { (eval echo "$as_me:5332: \"$ac_compile\"") >&5
5333   (eval $ac_compile) 2>&5
5334   ac_status=$?
5335   echo "$as_me:5335: \$? = $ac_status" >&5
5336   (exit "$ac_status"); } &&
5337          { ac_try='test -s "conftest.$ac_objext"'
5338   { (eval echo "$as_me:5338: \"$ac_try\"") >&5
5339   (eval $ac_try) 2>&5
5340   ac_status=$?
5341   echo "$as_me:5341: \$? = $ac_status" >&5
5342   (exit "$ac_status"); }; }; then
5343   :
5344 else
5345   echo "$as_me: failed program was:" >&5
5346 cat "conftest.$ac_ext" >&5
5347 cf_have_incdir=yes
5348 fi
5349 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5350                           CPPFLAGS=$cf_save_CPPFLAGS
5351                         fi
5352                   fi
5353                 fi
5354
5355                 if test "$cf_have_incdir" = no ; then
5356                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5357
5358 echo "${as_me:-configure}:5358: testing adding $cf_add_incdir to include-path ..." 1>&5
5359
5360                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5361
5362                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5363                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5364                   cf_add_incdir="$cf_top_incdir"
5365                 else
5366                   break
5367                 fi
5368           else
5369                 break
5370           fi
5371         done
5372   done
5373 fi
5374
5375 }
5376
5377 echo "$as_me:5377: checking for $cf_ncuhdr_root header in include-path" >&5
5378 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5379 if test "${cf_cv_ncurses_h+set}" = set; then
5380   echo $ECHO_N "(cached) $ECHO_C" >&6
5381 else
5382
5383         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5384         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5385         for cf_header in $cf_header_list
5386         do
5387
5388         cat >"conftest.$ac_ext" <<_ACEOF
5389 #line 5389 "configure"
5390 #include "confdefs.h"
5391
5392 #include <$cf_header>
5393 int
5394 main (void)
5395 {
5396
5397 #ifdef NCURSES_VERSION
5398
5399 printf("%s\\n", NCURSES_VERSION);
5400 #else
5401 #ifdef __NCURSES_H
5402 printf("old\\n");
5403 #else
5404         make an error
5405 #endif
5406 #endif
5407
5408   ;
5409   return 0;
5410 }
5411 _ACEOF
5412 rm -f "conftest.$ac_objext"
5413 if { (eval echo "$as_me:5413: \"$ac_compile\"") >&5
5414   (eval $ac_compile) 2>&5
5415   ac_status=$?
5416   echo "$as_me:5416: \$? = $ac_status" >&5
5417   (exit "$ac_status"); } &&
5418          { ac_try='test -s "conftest.$ac_objext"'
5419   { (eval echo "$as_me:5419: \"$ac_try\"") >&5
5420   (eval $ac_try) 2>&5
5421   ac_status=$?
5422   echo "$as_me:5422: \$? = $ac_status" >&5
5423   (exit "$ac_status"); }; }; then
5424   cf_cv_ncurses_h=$cf_header
5425
5426 else
5427   echo "$as_me: failed program was:" >&5
5428 cat "conftest.$ac_ext" >&5
5429 cf_cv_ncurses_h=no
5430 fi
5431 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5432
5433                 test "$cf_cv_ncurses_h" != no && break
5434         done
5435
5436 fi
5437 echo "$as_me:5437: result: $cf_cv_ncurses_h" >&5
5438 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5439
5440 if test "$cf_cv_ncurses_h" != no ; then
5441         cf_cv_ncurses_header=$cf_cv_ncurses_h
5442 else
5443
5444 echo "$as_me:5444: checking for $cf_ncuhdr_root include-path" >&5
5445 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5446 if test "${cf_cv_ncurses_h2+set}" = set; then
5447   echo $ECHO_N "(cached) $ECHO_C" >&6
5448 else
5449
5450         test -n "$verbose" && echo
5451
5452 cf_search=
5453
5454 # collect the current set of include-directories from compiler flags
5455 cf_header_path_list=""
5456 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5457         for cf_header_path in $CPPFLAGS $CFLAGS
5458         do
5459                 case "$cf_header_path" in
5460                 (-I*)
5461                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5462
5463 test "x$cf_header_path" != "xNONE" && \
5464 test -d "$cf_header_path" && \
5465  {
5466         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5467         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5468         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5469         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5470         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5471         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"
5472 }
5473
5474                         cf_header_path_list="$cf_header_path_list $cf_search"
5475                         ;;
5476                 esac
5477         done
5478 fi
5479
5480 # add the variations for the package we are looking for
5481
5482 cf_search=
5483
5484 test "x$prefix" != "xNONE" && \
5485 test -d "$prefix" && \
5486  {
5487         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5488         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5489         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5490         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5491         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5492         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5493 }
5494
5495 for cf_subdir_prefix in \
5496         /usr \
5497         /usr/local \
5498         /usr/pkg \
5499         /opt \
5500         /opt/local \
5501         $HOME
5502 do
5503
5504 test "x$cf_subdir_prefix" != "x$prefix" && \
5505 test -d "$cf_subdir_prefix" && \
5506 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5507         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5508         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5509         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5510         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5511         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5512         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"
5513 }
5514
5515 done
5516
5517 test "$includedir" != NONE && \
5518 test "$includedir" != "/usr/include" && \
5519 test -d "$includedir" && {
5520         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5521         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5522 }
5523
5524 test "$oldincludedir" != NONE && \
5525 test "$oldincludedir" != "/usr/include" && \
5526 test -d "$oldincludedir" && {
5527         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5528         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5529 }
5530
5531 cf_search="$cf_search $cf_header_path_list"
5532
5533         test -n "$verbose" && echo "search path $cf_search"
5534         cf_save2_CPPFLAGS="$CPPFLAGS"
5535         for cf_incdir in $cf_search
5536         do
5537
5538 if test -n "$cf_incdir" ; then
5539   for cf_add_incdir in $cf_incdir
5540   do
5541         while test "$cf_add_incdir" != /usr/include
5542         do
5543           if test -d "$cf_add_incdir"
5544           then
5545                 cf_have_incdir=no
5546                 if test -n "$CFLAGS$CPPFLAGS" ; then
5547                   # a loop is needed to ensure we can add subdirs of existing dirs
5548                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5549                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5550                           cf_have_incdir=yes; break
5551                         fi
5552                   done
5553                 fi
5554
5555                 if test "$cf_have_incdir" = no ; then
5556                   if test "$cf_add_incdir" = /usr/local/include ; then
5557                         if test "$GCC" = yes
5558                         then
5559                           cf_save_CPPFLAGS=$CPPFLAGS
5560
5561         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5562         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5563
5564                           cat >"conftest.$ac_ext" <<_ACEOF
5565 #line 5565 "configure"
5566 #include "confdefs.h"
5567 #include <stdio.h>
5568 int
5569 main (void)
5570 {
5571 printf("Hello")
5572   ;
5573   return 0;
5574 }
5575 _ACEOF
5576 rm -f "conftest.$ac_objext"
5577 if { (eval echo "$as_me:5577: \"$ac_compile\"") >&5
5578   (eval $ac_compile) 2>&5
5579   ac_status=$?
5580   echo "$as_me:5580: \$? = $ac_status" >&5
5581   (exit "$ac_status"); } &&
5582          { ac_try='test -s "conftest.$ac_objext"'
5583   { (eval echo "$as_me:5583: \"$ac_try\"") >&5
5584   (eval $ac_try) 2>&5
5585   ac_status=$?
5586   echo "$as_me:5586: \$? = $ac_status" >&5
5587   (exit "$ac_status"); }; }; then
5588   :
5589 else
5590   echo "$as_me: failed program was:" >&5
5591 cat "conftest.$ac_ext" >&5
5592 cf_have_incdir=yes
5593 fi
5594 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5595                           CPPFLAGS=$cf_save_CPPFLAGS
5596                         fi
5597                   fi
5598                 fi
5599
5600                 if test "$cf_have_incdir" = no ; then
5601                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5602
5603 echo "${as_me:-configure}:5603: testing adding $cf_add_incdir to include-path ..." 1>&5
5604
5605                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5606
5607                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5608                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5609                   cf_add_incdir="$cf_top_incdir"
5610                 else
5611                   break
5612                 fi
5613           else
5614                 break
5615           fi
5616         done
5617   done
5618 fi
5619
5620                 for cf_header in \
5621                         ncurses.h \
5622                         curses.h
5623                 do
5624
5625         cat >"conftest.$ac_ext" <<_ACEOF
5626 #line 5626 "configure"
5627 #include "confdefs.h"
5628
5629 #include <$cf_header>
5630 int
5631 main (void)
5632 {
5633
5634 #ifdef NCURSES_VERSION
5635
5636 printf("%s\\n", NCURSES_VERSION);
5637 #else
5638 #ifdef __NCURSES_H
5639 printf("old\\n");
5640 #else
5641         make an error
5642 #endif
5643 #endif
5644
5645   ;
5646   return 0;
5647 }
5648 _ACEOF
5649 rm -f "conftest.$ac_objext"
5650 if { (eval echo "$as_me:5650: \"$ac_compile\"") >&5
5651   (eval $ac_compile) 2>&5
5652   ac_status=$?
5653   echo "$as_me:5653: \$? = $ac_status" >&5
5654   (exit "$ac_status"); } &&
5655          { ac_try='test -s "conftest.$ac_objext"'
5656   { (eval echo "$as_me:5656: \"$ac_try\"") >&5
5657   (eval $ac_try) 2>&5
5658   ac_status=$?
5659   echo "$as_me:5659: \$? = $ac_status" >&5
5660   (exit "$ac_status"); }; }; then
5661   cf_cv_ncurses_h2=$cf_header
5662
5663 else
5664   echo "$as_me: failed program was:" >&5
5665 cat "conftest.$ac_ext" >&5
5666 cf_cv_ncurses_h2=no
5667 fi
5668 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5669
5670                         if test "$cf_cv_ncurses_h2" != no ; then
5671                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5672                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5673                                 break
5674                         fi
5675                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5676                 done
5677                 CPPFLAGS="$cf_save2_CPPFLAGS"
5678                 test "$cf_cv_ncurses_h2" != no && break
5679         done
5680         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5680: error: not found" >&5
5681 echo "$as_me: error: not found" >&2;}
5682    { (exit 1); exit 1; }; }
5683
5684 fi
5685 echo "$as_me:5685: result: $cf_cv_ncurses_h2" >&5
5686 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5687
5688         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5689         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5690         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5691                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5692         fi
5693
5694 if test -n "$cf_1st_incdir" ; then
5695   for cf_add_incdir in $cf_1st_incdir
5696   do
5697         while test "$cf_add_incdir" != /usr/include
5698         do
5699           if test -d "$cf_add_incdir"
5700           then
5701                 cf_have_incdir=no
5702                 if test -n "$CFLAGS$CPPFLAGS" ; then
5703                   # a loop is needed to ensure we can add subdirs of existing dirs
5704                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5705                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5706                           cf_have_incdir=yes; break
5707                         fi
5708                   done
5709                 fi
5710
5711                 if test "$cf_have_incdir" = no ; then
5712                   if test "$cf_add_incdir" = /usr/local/include ; then
5713                         if test "$GCC" = yes
5714                         then
5715                           cf_save_CPPFLAGS=$CPPFLAGS
5716
5717         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5718         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5719
5720                           cat >"conftest.$ac_ext" <<_ACEOF
5721 #line 5721 "configure"
5722 #include "confdefs.h"
5723 #include <stdio.h>
5724 int
5725 main (void)
5726 {
5727 printf("Hello")
5728   ;
5729   return 0;
5730 }
5731 _ACEOF
5732 rm -f "conftest.$ac_objext"
5733 if { (eval echo "$as_me:5733: \"$ac_compile\"") >&5
5734   (eval $ac_compile) 2>&5
5735   ac_status=$?
5736   echo "$as_me:5736: \$? = $ac_status" >&5
5737   (exit "$ac_status"); } &&
5738          { ac_try='test -s "conftest.$ac_objext"'
5739   { (eval echo "$as_me:5739: \"$ac_try\"") >&5
5740   (eval $ac_try) 2>&5
5741   ac_status=$?
5742   echo "$as_me:5742: \$? = $ac_status" >&5
5743   (exit "$ac_status"); }; }; then
5744   :
5745 else
5746   echo "$as_me: failed program was:" >&5
5747 cat "conftest.$ac_ext" >&5
5748 cf_have_incdir=yes
5749 fi
5750 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5751                           CPPFLAGS=$cf_save_CPPFLAGS
5752                         fi
5753                   fi
5754                 fi
5755
5756                 if test "$cf_have_incdir" = no ; then
5757                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5758
5759 echo "${as_me:-configure}:5759: testing adding $cf_add_incdir to include-path ..." 1>&5
5760
5761                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5762
5763                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5764                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5765                   cf_add_incdir="$cf_top_incdir"
5766                 else
5767                   break
5768                 fi
5769           else
5770                 break
5771           fi
5772         done
5773   done
5774 fi
5775
5776 fi
5777
5778 # Set definitions to allow ifdef'ing for ncurses.h
5779
5780 case "$cf_cv_ncurses_header" in
5781 (*ncurses.h)
5782
5783 cat >>confdefs.h <<\EOF
5784 #define HAVE_NCURSES_H 1
5785 EOF
5786
5787         ;;
5788 esac
5789
5790 case "$cf_cv_ncurses_header" in
5791 (ncurses/curses.h|ncurses/ncurses.h)
5792
5793 cat >>confdefs.h <<\EOF
5794 #define HAVE_NCURSES_NCURSES_H 1
5795 EOF
5796
5797         ;;
5798 (ncursesw/curses.h|ncursesw/ncurses.h)
5799
5800 cat >>confdefs.h <<\EOF
5801 #define HAVE_NCURSESW_NCURSES_H 1
5802 EOF
5803
5804         ;;
5805 esac
5806
5807 echo "$as_me:5807: checking for terminfo header" >&5
5808 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5809 if test "${cf_cv_term_header+set}" = set; then
5810   echo $ECHO_N "(cached) $ECHO_C" >&6
5811 else
5812
5813 case "${cf_cv_ncurses_header}" in
5814 (*/ncurses.h|*/ncursesw.h)
5815         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5816         ;;
5817 (*)
5818         cf_term_header=term.h
5819         ;;
5820 esac
5821
5822 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5823 do
5824 cat >"conftest.$ac_ext" <<_ACEOF
5825 #line 5825 "configure"
5826 #include "confdefs.h"
5827 #include <stdio.h>
5828 #include <${cf_cv_ncurses_header:-curses.h}>
5829 #include <$cf_test>
5830
5831 int
5832 main (void)
5833 {
5834 int x = auto_left_margin; (void)x
5835   ;
5836   return 0;
5837 }
5838 _ACEOF
5839 rm -f "conftest.$ac_objext"
5840 if { (eval echo "$as_me:5840: \"$ac_compile\"") >&5
5841   (eval $ac_compile) 2>&5
5842   ac_status=$?
5843   echo "$as_me:5843: \$? = $ac_status" >&5
5844   (exit "$ac_status"); } &&
5845          { ac_try='test -s "conftest.$ac_objext"'
5846   { (eval echo "$as_me:5846: \"$ac_try\"") >&5
5847   (eval $ac_try) 2>&5
5848   ac_status=$?
5849   echo "$as_me:5849: \$? = $ac_status" >&5
5850   (exit "$ac_status"); }; }; then
5851
5852         cf_cv_term_header="$cf_test"
5853 else
5854   echo "$as_me: failed program was:" >&5
5855 cat "conftest.$ac_ext" >&5
5856
5857         cf_cv_term_header=unknown
5858
5859 fi
5860 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5861         test "$cf_cv_term_header" != unknown && break
5862 done
5863
5864 fi
5865 echo "$as_me:5865: result: $cf_cv_term_header" >&5
5866 echo "${ECHO_T}$cf_cv_term_header" >&6
5867
5868 # Set definitions to allow ifdef'ing to accommodate subdirectories
5869
5870 case "$cf_cv_term_header" in
5871 (*term.h)
5872
5873 cat >>confdefs.h <<\EOF
5874 #define HAVE_TERM_H 1
5875 EOF
5876
5877         ;;
5878 esac
5879
5880 case "$cf_cv_term_header" in
5881 (ncurses/term.h)
5882
5883 cat >>confdefs.h <<\EOF
5884 #define HAVE_NCURSES_TERM_H 1
5885 EOF
5886
5887         ;;
5888 (ncursesw/term.h)
5889
5890 cat >>confdefs.h <<\EOF
5891 #define HAVE_NCURSESW_TERM_H 1
5892 EOF
5893
5894         ;;
5895 esac
5896
5897 # some applications need this, but should check for NCURSES_VERSION
5898
5899 cat >>confdefs.h <<\EOF
5900 #define NCURSES 1
5901 EOF
5902
5903 echo "$as_me:5903: checking for ncurses version" >&5
5904 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5905 if test "${cf_cv_ncurses_version+set}" = set; then
5906   echo $ECHO_N "(cached) $ECHO_C" >&6
5907 else
5908
5909         cf_cv_ncurses_version=no
5910         cf_tempfile=out$$
5911         rm -f "$cf_tempfile"
5912         if test "$cross_compiling" = yes; then
5913
5914         # This will not work if the preprocessor splits the line after the
5915         # Autoconf token.  The 'unproto' program does that.
5916         cat > "conftest.$ac_ext" <<EOF
5917 #include <${cf_cv_ncurses_header:-curses.h}>
5918 #undef Autoconf
5919 #ifdef NCURSES_VERSION
5920 Autoconf NCURSES_VERSION
5921 #else
5922 #ifdef __NCURSES_H
5923 Autoconf "old"
5924 #endif
5925 ;
5926 #endif
5927 EOF
5928         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5929         { (eval echo "$as_me:5929: \"$cf_try\"") >&5
5930   (eval $cf_try) 2>&5
5931   ac_status=$?
5932   echo "$as_me:5932: \$? = $ac_status" >&5
5933   (exit "$ac_status"); }
5934         if test -f conftest.out ; then
5935                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
5936                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5937                 rm -f conftest.out
5938         fi
5939
5940 else
5941   cat >"conftest.$ac_ext" <<_ACEOF
5942 #line 5942 "configure"
5943 #include "confdefs.h"
5944
5945 #include <${cf_cv_ncurses_header:-curses.h}>
5946 #include <stdio.h>
5947 int main(void)
5948 {
5949         FILE *fp = fopen("$cf_tempfile", "w");
5950 #ifdef NCURSES_VERSION
5951 # ifdef NCURSES_VERSION_PATCH
5952         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5953 # else
5954         fprintf(fp, "%s\\n", NCURSES_VERSION);
5955 # endif
5956 #else
5957 # ifdef __NCURSES_H
5958         fprintf(fp, "old\\n");
5959 # else
5960         make an error
5961 # endif
5962 #endif
5963         ${cf_cv_main_return:-return}(0);
5964 }
5965 _ACEOF
5966 rm -f "conftest$ac_exeext"
5967 if { (eval echo "$as_me:5967: \"$ac_link\"") >&5
5968   (eval $ac_link) 2>&5
5969   ac_status=$?
5970   echo "$as_me:5970: \$? = $ac_status" >&5
5971   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5972   { (eval echo "$as_me:5972: \"$ac_try\"") >&5
5973   (eval $ac_try) 2>&5
5974   ac_status=$?
5975   echo "$as_me:5975: \$? = $ac_status" >&5
5976   (exit "$ac_status"); }; }; then
5977
5978         cf_cv_ncurses_version=`cat $cf_tempfile`
5979 else
5980   echo "$as_me: program exited with status $ac_status" >&5
5981 echo "$as_me: failed program was:" >&5
5982 cat "conftest.$ac_ext" >&5
5983 fi
5984 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5985 fi
5986         rm -f "$cf_tempfile"
5987
5988 fi
5989 echo "$as_me:5989: result: $cf_cv_ncurses_version" >&5
5990 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5991 test "$cf_cv_ncurses_version" = no ||
5992 cat >>confdefs.h <<\EOF
5993 #define NCURSES 1
5994 EOF
5995
5996 cf_nculib_root=ncurses
5997         # This works, except for the special case where we find gpm, but
5998         # ncurses is in a nonstandard location via $LIBS, and we really want
5999         # to link gpm.
6000 cf_ncurses_LIBS=""
6001 cf_ncurses_SAVE="$LIBS"
6002 echo "$as_me:6002: checking for Gpm_Open in -lgpm" >&5
6003 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6004 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6005   echo $ECHO_N "(cached) $ECHO_C" >&6
6006 else
6007   ac_check_lib_save_LIBS=$LIBS
6008 LIBS="-lgpm  $LIBS"
6009 cat >"conftest.$ac_ext" <<_ACEOF
6010 #line 6010 "configure"
6011 #include "confdefs.h"
6012
6013 /* Override any gcc2 internal prototype to avoid an error.  */
6014 #ifdef __cplusplus
6015 extern "C"
6016 #endif
6017 /* We use char because int might match the return type of a gcc2
6018    builtin and then its argument prototype would still apply.  */
6019 char Gpm_Open ();
6020 int
6021 main (void)
6022 {
6023 Gpm_Open ();
6024   ;
6025   return 0;
6026 }
6027 _ACEOF
6028 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6029 if { (eval echo "$as_me:6029: \"$ac_link\"") >&5
6030   (eval $ac_link) 2>&5
6031   ac_status=$?
6032   echo "$as_me:6032: \$? = $ac_status" >&5
6033   (exit "$ac_status"); } &&
6034          { ac_try='test -s "conftest$ac_exeext"'
6035   { (eval echo "$as_me:6035: \"$ac_try\"") >&5
6036   (eval $ac_try) 2>&5
6037   ac_status=$?
6038   echo "$as_me:6038: \$? = $ac_status" >&5
6039   (exit "$ac_status"); }; }; then
6040   ac_cv_lib_gpm_Gpm_Open=yes
6041 else
6042   echo "$as_me: failed program was:" >&5
6043 cat "conftest.$ac_ext" >&5
6044 ac_cv_lib_gpm_Gpm_Open=no
6045 fi
6046 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6047 LIBS=$ac_check_lib_save_LIBS
6048 fi
6049 echo "$as_me:6049: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6050 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6051 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6052   echo "$as_me:6052: checking for initscr in -lgpm" >&5
6053 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6054 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6055   echo $ECHO_N "(cached) $ECHO_C" >&6
6056 else
6057   ac_check_lib_save_LIBS=$LIBS
6058 LIBS="-lgpm  $LIBS"
6059 cat >"conftest.$ac_ext" <<_ACEOF
6060 #line 6060 "configure"
6061 #include "confdefs.h"
6062
6063 /* Override any gcc2 internal prototype to avoid an error.  */
6064 #ifdef __cplusplus
6065 extern "C"
6066 #endif
6067 /* We use char because int might match the return type of a gcc2
6068    builtin and then its argument prototype would still apply.  */
6069 char initscr ();
6070 int
6071 main (void)
6072 {
6073 initscr ();
6074   ;
6075   return 0;
6076 }
6077 _ACEOF
6078 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6079 if { (eval echo "$as_me:6079: \"$ac_link\"") >&5
6080   (eval $ac_link) 2>&5
6081   ac_status=$?
6082   echo "$as_me:6082: \$? = $ac_status" >&5
6083   (exit "$ac_status"); } &&
6084          { ac_try='test -s "conftest$ac_exeext"'
6085   { (eval echo "$as_me:6085: \"$ac_try\"") >&5
6086   (eval $ac_try) 2>&5
6087   ac_status=$?
6088   echo "$as_me:6088: \$? = $ac_status" >&5
6089   (exit "$ac_status"); }; }; then
6090   ac_cv_lib_gpm_initscr=yes
6091 else
6092   echo "$as_me: failed program was:" >&5
6093 cat "conftest.$ac_ext" >&5
6094 ac_cv_lib_gpm_initscr=no
6095 fi
6096 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6097 LIBS=$ac_check_lib_save_LIBS
6098 fi
6099 echo "$as_me:6099: result: $ac_cv_lib_gpm_initscr" >&5
6100 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6101 if test "$ac_cv_lib_gpm_initscr" = yes; then
6102   LIBS="$cf_ncurses_SAVE"
6103 else
6104   cf_ncurses_LIBS="-lgpm"
6105 fi
6106
6107 fi
6108
6109 case "$host_os" in
6110 (freebsd*)
6111         # This is only necessary if you are linking against an obsolete
6112         # version of ncurses (but it should do no harm, since it's static).
6113         if test "$cf_nculib_root" = ncurses ; then
6114                 echo "$as_me:6114: checking for tgoto in -lmytinfo" >&5
6115 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6116 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6117   echo $ECHO_N "(cached) $ECHO_C" >&6
6118 else
6119   ac_check_lib_save_LIBS=$LIBS
6120 LIBS="-lmytinfo  $LIBS"
6121 cat >"conftest.$ac_ext" <<_ACEOF
6122 #line 6122 "configure"
6123 #include "confdefs.h"
6124
6125 /* Override any gcc2 internal prototype to avoid an error.  */
6126 #ifdef __cplusplus
6127 extern "C"
6128 #endif
6129 /* We use char because int might match the return type of a gcc2
6130    builtin and then its argument prototype would still apply.  */
6131 char tgoto ();
6132 int
6133 main (void)
6134 {
6135 tgoto ();
6136   ;
6137   return 0;
6138 }
6139 _ACEOF
6140 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6141 if { (eval echo "$as_me:6141: \"$ac_link\"") >&5
6142   (eval $ac_link) 2>&5
6143   ac_status=$?
6144   echo "$as_me:6144: \$? = $ac_status" >&5
6145   (exit "$ac_status"); } &&
6146          { ac_try='test -s "conftest$ac_exeext"'
6147   { (eval echo "$as_me:6147: \"$ac_try\"") >&5
6148   (eval $ac_try) 2>&5
6149   ac_status=$?
6150   echo "$as_me:6150: \$? = $ac_status" >&5
6151   (exit "$ac_status"); }; }; then
6152   ac_cv_lib_mytinfo_tgoto=yes
6153 else
6154   echo "$as_me: failed program was:" >&5
6155 cat "conftest.$ac_ext" >&5
6156 ac_cv_lib_mytinfo_tgoto=no
6157 fi
6158 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6159 LIBS=$ac_check_lib_save_LIBS
6160 fi
6161 echo "$as_me:6161: result: $ac_cv_lib_mytinfo_tgoto" >&5
6162 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6163 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6164   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6165 fi
6166
6167         fi
6168         ;;
6169 esac
6170
6171 cf_add_libs="$LIBS"
6172 # reverse order
6173 cf_add_0lib=
6174 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6175 # filter duplicates
6176 for cf_add_1lib in $cf_add_0lib; do
6177         for cf_add_2lib in $cf_add_libs; do
6178                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6179                         cf_add_1lib=
6180                         break
6181                 fi
6182         done
6183         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6184 done
6185 LIBS="$cf_add_libs"
6186
6187 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6188 then
6189
6190 cf_add_libs="$LIBS"
6191 # reverse order
6192 cf_add_0lib=
6193 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6194 # filter duplicates
6195 for cf_add_1lib in $cf_add_0lib; do
6196         for cf_add_2lib in $cf_add_libs; do
6197                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6198                         cf_add_1lib=
6199                         break
6200                 fi
6201         done
6202         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6203 done
6204 LIBS="$cf_add_libs"
6205
6206 else
6207
6208         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6209         cf_libdir=""
6210         echo "$as_me:6210: checking for initscr" >&5
6211 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6212 if test "${ac_cv_func_initscr+set}" = set; then
6213   echo $ECHO_N "(cached) $ECHO_C" >&6
6214 else
6215   cat >"conftest.$ac_ext" <<_ACEOF
6216 #line 6216 "configure"
6217 #include "confdefs.h"
6218 #define initscr autoconf_temporary
6219 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6220 #undef initscr
6221
6222 #ifdef __cplusplus
6223 extern "C"
6224 #endif
6225
6226 /* We use char because int might match the return type of a gcc2
6227    builtin and then its argument prototype would still apply.  */
6228 char initscr (void);
6229
6230 int
6231 main (void)
6232 {
6233
6234 /* The GNU C library defines stubs for functions which it implements
6235     to always fail with ENOSYS.  Some functions are actually named
6236     something starting with __ and the normal name is an alias.  */
6237 #if defined (__stub_initscr) || defined (__stub___initscr)
6238 #error found stub for initscr
6239 #endif
6240
6241         return initscr ();
6242   ;
6243   return 0;
6244 }
6245 _ACEOF
6246 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6247 if { (eval echo "$as_me:6247: \"$ac_link\"") >&5
6248   (eval $ac_link) 2>&5
6249   ac_status=$?
6250   echo "$as_me:6250: \$? = $ac_status" >&5
6251   (exit "$ac_status"); } &&
6252          { ac_try='test -s "conftest$ac_exeext"'
6253   { (eval echo "$as_me:6253: \"$ac_try\"") >&5
6254   (eval $ac_try) 2>&5
6255   ac_status=$?
6256   echo "$as_me:6256: \$? = $ac_status" >&5
6257   (exit "$ac_status"); }; }; then
6258   ac_cv_func_initscr=yes
6259 else
6260   echo "$as_me: failed program was:" >&5
6261 cat "conftest.$ac_ext" >&5
6262 ac_cv_func_initscr=no
6263 fi
6264 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6265 fi
6266 echo "$as_me:6266: result: $ac_cv_func_initscr" >&5
6267 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6268 if test "$ac_cv_func_initscr" = yes; then
6269   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6270 else
6271
6272                 cf_save_LIBS="$LIBS"
6273                 echo "$as_me:6273: checking for initscr in -l$cf_nculib_root" >&5
6274 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6275                 LIBS="-l$cf_nculib_root $LIBS"
6276                 cat >"conftest.$ac_ext" <<_ACEOF
6277 #line 6277 "configure"
6278 #include "confdefs.h"
6279 #include <${cf_cv_ncurses_header:-curses.h}>
6280 int
6281 main (void)
6282 {
6283 initscr()
6284   ;
6285   return 0;
6286 }
6287 _ACEOF
6288 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6289 if { (eval echo "$as_me:6289: \"$ac_link\"") >&5
6290   (eval $ac_link) 2>&5
6291   ac_status=$?
6292   echo "$as_me:6292: \$? = $ac_status" >&5
6293   (exit "$ac_status"); } &&
6294          { ac_try='test -s "conftest$ac_exeext"'
6295   { (eval echo "$as_me:6295: \"$ac_try\"") >&5
6296   (eval $ac_try) 2>&5
6297   ac_status=$?
6298   echo "$as_me:6298: \$? = $ac_status" >&5
6299   (exit "$ac_status"); }; }; then
6300   echo "$as_me:6300: result: yes" >&5
6301 echo "${ECHO_T}yes" >&6
6302                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6303
6304 else
6305   echo "$as_me: failed program was:" >&5
6306 cat "conftest.$ac_ext" >&5
6307 echo "$as_me:6307: result: no" >&5
6308 echo "${ECHO_T}no" >&6
6309
6310 cf_search=
6311 cf_library_path_list=""
6312 if test -n "${LDFLAGS}${LIBS}" ; then
6313         for cf_library_path in $LDFLAGS $LIBS
6314         do
6315                 case "$cf_library_path" in
6316                 (-L*)
6317                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6318
6319 test "x$cf_library_path" != "xNONE" && \
6320 test -d "$cf_library_path" && \
6321  {
6322         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6323         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6324         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6325         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6326         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6327         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"
6328 }
6329
6330                         cf_library_path_list="$cf_library_path_list $cf_search"
6331                         ;;
6332                 esac
6333         done
6334 fi
6335
6336 cf_search=
6337
6338 test "x$prefix" != "xNONE" && \
6339 test -d "$prefix" && \
6340  {
6341         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6342         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6343         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6344         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6345         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6346         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6347 }
6348
6349 for cf_subdir_prefix in \
6350         /usr \
6351         /usr/local \
6352         /usr/pkg \
6353         /opt \
6354         /opt/local \
6355         $HOME
6356 do
6357
6358 test "x$cf_subdir_prefix" != "x$prefix" && \
6359 test -d "$cf_subdir_prefix" && \
6360 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6361         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6362         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6363         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6364         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6365         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6366         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"
6367 }
6368
6369 done
6370
6371 cf_search="$cf_library_path_list $cf_search"
6372
6373                         for cf_libdir in $cf_search
6374                         do
6375                                 echo "$as_me:6375: checking for -l$cf_nculib_root in $cf_libdir" >&5
6376 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6377                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6378                                 cat >"conftest.$ac_ext" <<_ACEOF
6379 #line 6379 "configure"
6380 #include "confdefs.h"
6381 #include <${cf_cv_ncurses_header:-curses.h}>
6382 int
6383 main (void)
6384 {
6385 initscr()
6386   ;
6387   return 0;
6388 }
6389 _ACEOF
6390 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6391 if { (eval echo "$as_me:6391: \"$ac_link\"") >&5
6392   (eval $ac_link) 2>&5
6393   ac_status=$?
6394   echo "$as_me:6394: \$? = $ac_status" >&5
6395   (exit "$ac_status"); } &&
6396          { ac_try='test -s "conftest$ac_exeext"'
6397   { (eval echo "$as_me:6397: \"$ac_try\"") >&5
6398   (eval $ac_try) 2>&5
6399   ac_status=$?
6400   echo "$as_me:6400: \$? = $ac_status" >&5
6401   (exit "$ac_status"); }; }; then
6402   echo "$as_me:6402: result: yes" >&5
6403 echo "${ECHO_T}yes" >&6
6404                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6405                                          break
6406 else
6407   echo "$as_me: failed program was:" >&5
6408 cat "conftest.$ac_ext" >&5
6409 echo "$as_me:6409: result: no" >&5
6410 echo "${ECHO_T}no" >&6
6411                                          LIBS="$cf_save_LIBS"
6412 fi
6413 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6414                         done
6415
6416 fi
6417 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6418
6419 fi
6420
6421 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6422
6423 if test "$cf_found_library" = no ; then
6424         { { echo "$as_me:6424: error: Cannot link $cf_nculib_root library" >&5
6425 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6426    { (exit 1); exit 1; }; }
6427 fi
6428
6429 fi
6430
6431 if test -n "$cf_ncurses_LIBS" ; then
6432         echo "$as_me:6432: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6433 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6434         cf_ncurses_SAVE="$LIBS"
6435         for p in $cf_ncurses_LIBS ; do
6436                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6437                 if test "$q" != "$LIBS" ; then
6438                         LIBS="$q"
6439                 fi
6440         done
6441         cat >"conftest.$ac_ext" <<_ACEOF
6442 #line 6442 "configure"
6443 #include "confdefs.h"
6444 #include <${cf_cv_ncurses_header:-curses.h}>
6445 int
6446 main (void)
6447 {
6448 initscr(); mousemask(0,0); tigetstr((char *)0);
6449   ;
6450   return 0;
6451 }
6452 _ACEOF
6453 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6454 if { (eval echo "$as_me:6454: \"$ac_link\"") >&5
6455   (eval $ac_link) 2>&5
6456   ac_status=$?
6457   echo "$as_me:6457: \$? = $ac_status" >&5
6458   (exit "$ac_status"); } &&
6459          { ac_try='test -s "conftest$ac_exeext"'
6460   { (eval echo "$as_me:6460: \"$ac_try\"") >&5
6461   (eval $ac_try) 2>&5
6462   ac_status=$?
6463   echo "$as_me:6463: \$? = $ac_status" >&5
6464   (exit "$ac_status"); }; }; then
6465   echo "$as_me:6465: result: yes" >&5
6466 echo "${ECHO_T}yes" >&6
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                  LIBS="$cf_ncurses_SAVE"
6473 fi
6474 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6475 fi
6476
6477 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6478
6479 cat >>confdefs.h <<EOF
6480 #define $cf_nculib_ROOT 1
6481 EOF
6482
6483         fi
6484 else
6485         NCURSES_CONFIG=none
6486 fi
6487
6488 echo "$as_me:6488: checking if you want wide-character code" >&5
6489 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6490
6491 # Check whether --enable-widec or --disable-widec was given.
6492 if test "${enable_widec+set}" = set; then
6493   enableval="$enable_widec"
6494   with_widec=$enableval
6495 else
6496   with_widec=no
6497 fi;
6498 echo "$as_me:6498: result: $with_widec" >&5
6499 echo "${ECHO_T}$with_widec" >&6
6500 if test "$with_widec" = yes ; then
6501
6502 for ac_header in wchar.h
6503 do
6504 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6505 echo "$as_me:6505: checking for $ac_header" >&5
6506 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6507 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6508   echo $ECHO_N "(cached) $ECHO_C" >&6
6509 else
6510   cat >"conftest.$ac_ext" <<_ACEOF
6511 #line 6511 "configure"
6512 #include "confdefs.h"
6513 #include <$ac_header>
6514 _ACEOF
6515 if { (eval echo "$as_me:6515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6517   ac_status=$?
6518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6519   rm -f conftest.er1
6520   cat conftest.err >&5
6521   echo "$as_me:6521: \$? = $ac_status" >&5
6522   (exit "$ac_status"); } >/dev/null; then
6523   if test -s conftest.err; then
6524     ac_cpp_err=$ac_c_preproc_warn_flag
6525   else
6526     ac_cpp_err=
6527   fi
6528 else
6529   ac_cpp_err=yes
6530 fi
6531 if test -z "$ac_cpp_err"; then
6532   eval "$as_ac_Header=yes"
6533 else
6534   echo "$as_me: failed program was:" >&5
6535   cat "conftest.$ac_ext" >&5
6536   eval "$as_ac_Header=no"
6537 fi
6538 rm -f conftest.err "conftest.$ac_ext"
6539 fi
6540 echo "$as_me:6540: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6541 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6542 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6543   cat >>confdefs.h <<EOF
6544 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6545 EOF
6546
6547 fi
6548 done
6549
6550 echo "$as_me:6550: checking for multibyte character support" >&5
6551 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6552 if test "${cf_cv_utf8_lib+set}" = set; then
6553   echo $ECHO_N "(cached) $ECHO_C" >&6
6554 else
6555
6556         cf_save_LIBS="$LIBS"
6557         cat >"conftest.$ac_ext" <<_ACEOF
6558 #line 6558 "configure"
6559 #include "confdefs.h"
6560
6561 #include <stdlib.h>
6562 #include <stdio.h>
6563 #ifdef HAVE_WCHAR_H
6564 #include <wchar.h>
6565 #endif
6566
6567 int
6568 main (void)
6569 {
6570 putwc(0,0);
6571   ;
6572   return 0;
6573 }
6574 _ACEOF
6575 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6576 if { (eval echo "$as_me:6576: \"$ac_link\"") >&5
6577   (eval $ac_link) 2>&5
6578   ac_status=$?
6579   echo "$as_me:6579: \$? = $ac_status" >&5
6580   (exit "$ac_status"); } &&
6581          { ac_try='test -s "conftest$ac_exeext"'
6582   { (eval echo "$as_me:6582: \"$ac_try\"") >&5
6583   (eval $ac_try) 2>&5
6584   ac_status=$?
6585   echo "$as_me:6585: \$? = $ac_status" >&5
6586   (exit "$ac_status"); }; }; then
6587   cf_cv_utf8_lib=yes
6588 else
6589   echo "$as_me: failed program was:" >&5
6590 cat "conftest.$ac_ext" >&5
6591
6592 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6593 # will be set on completion of the AC_TRY_LINK below.
6594 cf_cv_header_path_utf8=
6595 cf_cv_library_path_utf8=
6596
6597 echo "${as_me:-configure}:6597: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6598
6599 cf_save_LIBS="$LIBS"
6600
6601 cat >"conftest.$ac_ext" <<_ACEOF
6602 #line 6602 "configure"
6603 #include "confdefs.h"
6604
6605 #include <libutf8.h>
6606 int
6607 main (void)
6608 {
6609 putwc(0,0);
6610   ;
6611   return 0;
6612 }
6613 _ACEOF
6614 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6615 if { (eval echo "$as_me:6615: \"$ac_link\"") >&5
6616   (eval $ac_link) 2>&5
6617   ac_status=$?
6618   echo "$as_me:6618: \$? = $ac_status" >&5
6619   (exit "$ac_status"); } &&
6620          { ac_try='test -s "conftest$ac_exeext"'
6621   { (eval echo "$as_me:6621: \"$ac_try\"") >&5
6622   (eval $ac_try) 2>&5
6623   ac_status=$?
6624   echo "$as_me:6624: \$? = $ac_status" >&5
6625   (exit "$ac_status"); }; }; then
6626
6627         cf_cv_find_linkage_utf8=yes
6628         cf_cv_header_path_utf8=/usr/include
6629         cf_cv_library_path_utf8=/usr/lib
6630
6631 else
6632   echo "$as_me: failed program was:" >&5
6633 cat "conftest.$ac_ext" >&5
6634
6635 LIBS="-lutf8  $cf_save_LIBS"
6636
6637 cat >"conftest.$ac_ext" <<_ACEOF
6638 #line 6638 "configure"
6639 #include "confdefs.h"
6640
6641 #include <libutf8.h>
6642 int
6643 main (void)
6644 {
6645 putwc(0,0);
6646   ;
6647   return 0;
6648 }
6649 _ACEOF
6650 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6651 if { (eval echo "$as_me:6651: \"$ac_link\"") >&5
6652   (eval $ac_link) 2>&5
6653   ac_status=$?
6654   echo "$as_me:6654: \$? = $ac_status" >&5
6655   (exit "$ac_status"); } &&
6656          { ac_try='test -s "conftest$ac_exeext"'
6657   { (eval echo "$as_me:6657: \"$ac_try\"") >&5
6658   (eval $ac_try) 2>&5
6659   ac_status=$?
6660   echo "$as_me:6660: \$? = $ac_status" >&5
6661   (exit "$ac_status"); }; }; then
6662
6663         cf_cv_find_linkage_utf8=yes
6664         cf_cv_header_path_utf8=/usr/include
6665         cf_cv_library_path_utf8=/usr/lib
6666         cf_cv_library_file_utf8="-lutf8"
6667
6668 else
6669   echo "$as_me: failed program was:" >&5
6670 cat "conftest.$ac_ext" >&5
6671
6672         cf_cv_find_linkage_utf8=no
6673         LIBS="$cf_save_LIBS"
6674
6675         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6676
6677 echo "${as_me:-configure}:6677: testing find linkage for utf8 library ..." 1>&5
6678
6679 echo "${as_me:-configure}:6679: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6680
6681         cf_save_CPPFLAGS="$CPPFLAGS"
6682         cf_test_CPPFLAGS="$CPPFLAGS"
6683
6684 cf_search=
6685
6686 # collect the current set of include-directories from compiler flags
6687 cf_header_path_list=""
6688 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6689         for cf_header_path in $CPPFLAGS $CFLAGS
6690         do
6691                 case "$cf_header_path" in
6692                 (-I*)
6693                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6694
6695 test "x$cf_header_path" != "xNONE" && \
6696 test -d "$cf_header_path" && \
6697  {
6698         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6699         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6700         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6701         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6702         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6703         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6704 }
6705
6706                         cf_header_path_list="$cf_header_path_list $cf_search"
6707                         ;;
6708                 esac
6709         done
6710 fi
6711
6712 # add the variations for the package we are looking for
6713
6714 cf_search=
6715
6716 test "x$prefix" != "xNONE" && \
6717 test -d "$prefix" && \
6718  {
6719         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6720         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6721         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6722         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6723         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6724         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6725 }
6726
6727 for cf_subdir_prefix in \
6728         /usr \
6729         /usr/local \
6730         /usr/pkg \
6731         /opt \
6732         /opt/local \
6733         $HOME
6734 do
6735
6736 test "x$cf_subdir_prefix" != "x$prefix" && \
6737 test -d "$cf_subdir_prefix" && \
6738 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6739         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6740         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6741         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6742         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6743         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6744         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6745 }
6746
6747 done
6748
6749 test "$includedir" != NONE && \
6750 test "$includedir" != "/usr/include" && \
6751 test -d "$includedir" && {
6752         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6753         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6754 }
6755
6756 test "$oldincludedir" != NONE && \
6757 test "$oldincludedir" != "/usr/include" && \
6758 test -d "$oldincludedir" && {
6759         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6760         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6761 }
6762
6763 cf_search="$cf_search $cf_header_path_list"
6764
6765         for cf_cv_header_path_utf8 in $cf_search
6766         do
6767                 if test -d "$cf_cv_header_path_utf8" ; then
6768                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6769
6770 echo "${as_me:-configure}:6770: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6771
6772                         CPPFLAGS="$cf_save_CPPFLAGS"
6773
6774         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6775         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6776
6777                         cat >"conftest.$ac_ext" <<_ACEOF
6778 #line 6778 "configure"
6779 #include "confdefs.h"
6780
6781 #include <libutf8.h>
6782 int
6783 main (void)
6784 {
6785 putwc(0,0);
6786   ;
6787   return 0;
6788 }
6789 _ACEOF
6790 rm -f "conftest.$ac_objext"
6791 if { (eval echo "$as_me:6791: \"$ac_compile\"") >&5
6792   (eval $ac_compile) 2>&5
6793   ac_status=$?
6794   echo "$as_me:6794: \$? = $ac_status" >&5
6795   (exit "$ac_status"); } &&
6796          { ac_try='test -s "conftest.$ac_objext"'
6797   { (eval echo "$as_me:6797: \"$ac_try\"") >&5
6798   (eval $ac_try) 2>&5
6799   ac_status=$?
6800   echo "$as_me:6800: \$? = $ac_status" >&5
6801   (exit "$ac_status"); }; }; then
6802
6803                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6804
6805 echo "${as_me:-configure}:6805: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6806
6807                                 cf_cv_find_linkage_utf8=maybe
6808                                 cf_test_CPPFLAGS="$CPPFLAGS"
6809                                 break
6810 else
6811   echo "$as_me: failed program was:" >&5
6812 cat "conftest.$ac_ext" >&5
6813
6814                                 CPPFLAGS="$cf_save_CPPFLAGS"
6815
6816 fi
6817 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6818                 fi
6819         done
6820
6821         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6822
6823 echo "${as_me:-configure}:6823: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6824
6825                 cf_save_LIBS="$LIBS"
6826                 cf_save_LDFLAGS="$LDFLAGS"
6827
6828                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6829
6830 cf_search=
6831 cf_library_path_list=""
6832 if test -n "${LDFLAGS}${LIBS}" ; then
6833         for cf_library_path in $LDFLAGS $LIBS
6834         do
6835                 case "$cf_library_path" in
6836                 (-L*)
6837                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6838
6839 test "x$cf_library_path" != "xNONE" && \
6840 test -d "$cf_library_path" && \
6841  {
6842         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6843         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6844         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6845         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6846         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6847         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6848 }
6849
6850                         cf_library_path_list="$cf_library_path_list $cf_search"
6851                         ;;
6852                 esac
6853         done
6854 fi
6855
6856 cf_search=
6857
6858 test "x$prefix" != "xNONE" && \
6859 test -d "$prefix" && \
6860  {
6861         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6862         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6863         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6864         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6865         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6866         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6867 }
6868
6869 for cf_subdir_prefix in \
6870         /usr \
6871         /usr/local \
6872         /usr/pkg \
6873         /opt \
6874         /opt/local \
6875         $HOME
6876 do
6877
6878 test "x$cf_subdir_prefix" != "x$prefix" && \
6879 test -d "$cf_subdir_prefix" && \
6880 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6881         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6882         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6883         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6884         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6885         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6886         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6887 }
6888
6889 done
6890
6891 cf_search="$cf_library_path_list $cf_search"
6892
6893                         for cf_cv_library_path_utf8 in $cf_search
6894                         do
6895                                 if test -d "$cf_cv_library_path_utf8" ; then
6896                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6897
6898 echo "${as_me:-configure}:6898: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6899
6900                                         CPPFLAGS="$cf_test_CPPFLAGS"
6901                                         LIBS="-lutf8  $cf_save_LIBS"
6902                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6903                                         cat >"conftest.$ac_ext" <<_ACEOF
6904 #line 6904 "configure"
6905 #include "confdefs.h"
6906
6907 #include <libutf8.h>
6908 int
6909 main (void)
6910 {
6911 putwc(0,0);
6912   ;
6913   return 0;
6914 }
6915 _ACEOF
6916 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6917 if { (eval echo "$as_me:6917: \"$ac_link\"") >&5
6918   (eval $ac_link) 2>&5
6919   ac_status=$?
6920   echo "$as_me:6920: \$? = $ac_status" >&5
6921   (exit "$ac_status"); } &&
6922          { ac_try='test -s "conftest$ac_exeext"'
6923   { (eval echo "$as_me:6923: \"$ac_try\"") >&5
6924   (eval $ac_try) 2>&5
6925   ac_status=$?
6926   echo "$as_me:6926: \$? = $ac_status" >&5
6927   (exit "$ac_status"); }; }; then
6928
6929                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6930
6931 echo "${as_me:-configure}:6931: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6932
6933                                         cf_cv_find_linkage_utf8=yes
6934                                         cf_cv_library_file_utf8="-lutf8"
6935                                         break
6936 else
6937   echo "$as_me: failed program was:" >&5
6938 cat "conftest.$ac_ext" >&5
6939
6940                                         CPPFLAGS="$cf_save_CPPFLAGS"
6941                                         LIBS="$cf_save_LIBS"
6942                                         LDFLAGS="$cf_save_LDFLAGS"
6943
6944 fi
6945 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6946                                 fi
6947                         done
6948                         CPPFLAGS="$cf_save_CPPFLAGS"
6949                         LDFLAGS="$cf_save_LDFLAGS"
6950                 fi
6951
6952         else
6953                 cf_cv_find_linkage_utf8=no
6954         fi
6955
6956 fi
6957 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6958
6959 fi
6960 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6961
6962 LIBS="$cf_save_LIBS"
6963
6964 if test "$cf_cv_find_linkage_utf8" = yes ; then
6965 cf_cv_utf8_lib=add-on
6966 else
6967 cf_cv_utf8_lib=no
6968 fi
6969
6970 fi
6971 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6972 fi
6973 echo "$as_me:6973: result: $cf_cv_utf8_lib" >&5
6974 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6975
6976 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6977 # ncurses/ncursesw:
6978 if test "$cf_cv_utf8_lib" = "add-on" ; then
6979
6980 cat >>confdefs.h <<\EOF
6981 #define HAVE_LIBUTF8_H 1
6982 EOF
6983
6984 if test -n "$cf_cv_header_path_utf8" ; then
6985   for cf_add_incdir in $cf_cv_header_path_utf8
6986   do
6987         while test "$cf_add_incdir" != /usr/include
6988         do
6989           if test -d "$cf_add_incdir"
6990           then
6991                 cf_have_incdir=no
6992                 if test -n "$CFLAGS$CPPFLAGS" ; then
6993                   # a loop is needed to ensure we can add subdirs of existing dirs
6994                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6995                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6996                           cf_have_incdir=yes; break
6997                         fi
6998                   done
6999                 fi
7000
7001                 if test "$cf_have_incdir" = no ; then
7002                   if test "$cf_add_incdir" = /usr/local/include ; then
7003                         if test "$GCC" = yes
7004                         then
7005                           cf_save_CPPFLAGS=$CPPFLAGS
7006
7007         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7008         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7009
7010                           cat >"conftest.$ac_ext" <<_ACEOF
7011 #line 7011 "configure"
7012 #include "confdefs.h"
7013 #include <stdio.h>
7014 int
7015 main (void)
7016 {
7017 printf("Hello")
7018   ;
7019   return 0;
7020 }
7021 _ACEOF
7022 rm -f "conftest.$ac_objext"
7023 if { (eval echo "$as_me:7023: \"$ac_compile\"") >&5
7024   (eval $ac_compile) 2>&5
7025   ac_status=$?
7026   echo "$as_me:7026: \$? = $ac_status" >&5
7027   (exit "$ac_status"); } &&
7028          { ac_try='test -s "conftest.$ac_objext"'
7029   { (eval echo "$as_me:7029: \"$ac_try\"") >&5
7030   (eval $ac_try) 2>&5
7031   ac_status=$?
7032   echo "$as_me:7032: \$? = $ac_status" >&5
7033   (exit "$ac_status"); }; }; then
7034   :
7035 else
7036   echo "$as_me: failed program was:" >&5
7037 cat "conftest.$ac_ext" >&5
7038 cf_have_incdir=yes
7039 fi
7040 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7041                           CPPFLAGS=$cf_save_CPPFLAGS
7042                         fi
7043                   fi
7044                 fi
7045
7046                 if test "$cf_have_incdir" = no ; then
7047                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7048
7049 echo "${as_me:-configure}:7049: testing adding $cf_add_incdir to include-path ..." 1>&5
7050
7051                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7052
7053                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7054                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7055                   cf_add_incdir="$cf_top_incdir"
7056                 else
7057                   break
7058                 fi
7059           else
7060                 break
7061           fi
7062         done
7063   done
7064 fi
7065
7066 if test -n "$cf_cv_library_path_utf8" ; then
7067         for cf_add_libdir in $cf_cv_library_path_utf8
7068         do
7069                 if test "$cf_add_libdir" = /usr/lib ; then
7070                         :
7071                 elif test -d "$cf_add_libdir"
7072                 then
7073                         cf_have_libdir=no
7074                         if test -n "$LDFLAGS$LIBS" ; then
7075                                 # a loop is needed to ensure we can add subdirs of existing dirs
7076                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7077                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7078                                                 cf_have_libdir=yes; break
7079                                         fi
7080                                 done
7081                         fi
7082                         if test "$cf_have_libdir" = no ; then
7083                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7084
7085 echo "${as_me:-configure}:7085: testing adding $cf_add_libdir to library-path ..." 1>&5
7086
7087                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7088                         fi
7089                 fi
7090         done
7091 fi
7092
7093 cf_add_libs="$LIBS"
7094 # reverse order
7095 cf_add_0lib=
7096 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7097 # filter duplicates
7098 for cf_add_1lib in $cf_add_0lib; do
7099         for cf_add_2lib in $cf_add_libs; do
7100                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7101                         cf_add_1lib=
7102                         break
7103                 fi
7104         done
7105         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7106 done
7107 LIBS="$cf_add_libs"
7108
7109 fi
7110
7111 cf_ncuconfig_root=ncursesw
7112 cf_have_ncuconfig=no
7113
7114 if test "x${PKG_CONFIG:=none}" != xnone; then
7115         echo "$as_me:7115: checking pkg-config for $cf_ncuconfig_root" >&5
7116 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7117         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7118                 echo "$as_me:7118: result: yes" >&5
7119 echo "${ECHO_T}yes" >&6
7120
7121                 echo "$as_me:7121: checking if the $cf_ncuconfig_root package files work" >&5
7122 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7123                 cf_have_ncuconfig=unknown
7124
7125                 cf_save_CFLAGS="$CFLAGS"
7126                 cf_save_CPPFLAGS="$CPPFLAGS"
7127                 cf_save_LIBS="$LIBS"
7128
7129                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7130                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7131
7132                 # while -W for passing linker flags is prevalent, it is not "standard".
7133                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7134                 # incompatible _and_ non-standard -W option which gives an error.  Work
7135                 # around that pitfall.
7136                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7137                 (x*c[89]9@@*-W*)
7138
7139 cf_fix_cppflags=no
7140 cf_new_cflags=
7141 cf_new_cppflags=
7142 cf_new_extra_cppflags=
7143
7144 for cf_add_cflags in $cf_pkg_cflags
7145 do
7146 case "$cf_fix_cppflags" in
7147 (no)
7148         case "$cf_add_cflags" in
7149         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7150                 case "$cf_add_cflags" in
7151                 (-D*)
7152                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7153
7154                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7155                                 && test -z "${cf_tst_cflags}" \
7156                                 && cf_fix_cppflags=yes
7157
7158                         if test "$cf_fix_cppflags" = yes ; then
7159
7160         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7161         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7162
7163                                 continue
7164                         elif test "${cf_tst_cflags}" = "\"'" ; then
7165
7166         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7167         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7168
7169                                 continue
7170                         fi
7171                         ;;
7172                 esac
7173                 case "$CPPFLAGS" in
7174                 (*$cf_add_cflags)
7175                         ;;
7176                 (*)
7177                         case "$cf_add_cflags" in
7178                         (-D*)
7179                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7180
7181 CPPFLAGS=`echo "$CPPFLAGS" | \
7182         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7183                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7184
7185                                 ;;
7186                         esac
7187
7188         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7189         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7190
7191                         ;;
7192                 esac
7193                 ;;
7194         (*)
7195
7196         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7197         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7198
7199                 ;;
7200         esac
7201         ;;
7202 (yes)
7203
7204         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7205         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7206
7207         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7208
7209         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7210                 && test -z "${cf_tst_cflags}" \
7211                 && cf_fix_cppflags=no
7212         ;;
7213 esac
7214 done
7215
7216 if test -n "$cf_new_cflags" ; then
7217
7218         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7219         CFLAGS="${CFLAGS}$cf_new_cflags"
7220
7221 fi
7222
7223 if test -n "$cf_new_cppflags" ; then
7224
7225         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7226         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7227
7228 fi
7229
7230 if test -n "$cf_new_extra_cppflags" ; then
7231
7232         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7233         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7234
7235 fi
7236
7237 cf_add_libs="$LIBS"
7238 # reverse order
7239 cf_add_0lib=
7240 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7241 # filter duplicates
7242 for cf_add_1lib in $cf_add_0lib; do
7243         for cf_add_2lib in $cf_add_libs; do
7244                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7245                         cf_add_1lib=
7246                         break
7247                 fi
7248         done
7249         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7250 done
7251 LIBS="$cf_add_libs"
7252
7253                         cat >"conftest.$ac_ext" <<_ACEOF
7254 #line 7254 "configure"
7255 #include "confdefs.h"
7256 #include <${cf_cv_ncurses_header:-curses.h}>
7257 int
7258 main (void)
7259 {
7260 initscr(); mousemask(0,0); tigetstr((char *)0);
7261   ;
7262   return 0;
7263 }
7264 _ACEOF
7265 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7266 if { (eval echo "$as_me:7266: \"$ac_link\"") >&5
7267   (eval $ac_link) 2>&5
7268   ac_status=$?
7269   echo "$as_me:7269: \$? = $ac_status" >&5
7270   (exit "$ac_status"); } &&
7271          { ac_try='test -s "conftest$ac_exeext"'
7272   { (eval echo "$as_me:7272: \"$ac_try\"") >&5
7273   (eval $ac_try) 2>&5
7274   ac_status=$?
7275   echo "$as_me:7275: \$? = $ac_status" >&5
7276   (exit "$ac_status"); }; }; then
7277   if test "$cross_compiling" = yes; then
7278   cf_test_ncuconfig=maybe
7279 else
7280   cat >"conftest.$ac_ext" <<_ACEOF
7281 #line 7281 "configure"
7282 #include "confdefs.h"
7283 #include <${cf_cv_ncurses_header:-curses.h}>
7284                                         int main(void)
7285                                         { const char *xx = curses_version(); return (xx == 0); }
7286 _ACEOF
7287 rm -f "conftest$ac_exeext"
7288 if { (eval echo "$as_me:7288: \"$ac_link\"") >&5
7289   (eval $ac_link) 2>&5
7290   ac_status=$?
7291   echo "$as_me:7291: \$? = $ac_status" >&5
7292   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7293   { (eval echo "$as_me:7293: \"$ac_try\"") >&5
7294   (eval $ac_try) 2>&5
7295   ac_status=$?
7296   echo "$as_me:7296: \$? = $ac_status" >&5
7297   (exit "$ac_status"); }; }; then
7298   cf_test_ncuconfig=yes
7299 else
7300   echo "$as_me: program exited with status $ac_status" >&5
7301 echo "$as_me: failed program was:" >&5
7302 cat "conftest.$ac_ext" >&5
7303 cf_test_ncuconfig=no
7304 fi
7305 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7306 fi
7307 else
7308   echo "$as_me: failed program was:" >&5
7309 cat "conftest.$ac_ext" >&5
7310 cf_test_ncuconfig=no
7311 fi
7312 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7313
7314                         CFLAGS="$cf_save_CFLAGS"
7315                         CPPFLAGS="$cf_save_CPPFLAGS"
7316                         LIBS="$cf_save_LIBS"
7317
7318                         if test "x$cf_test_ncuconfig" != xyes; then
7319                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7320                                 cf_pkg_cflags="$cf_temp"
7321                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7322                                 cf_pkg_libs="$cf_temp"
7323                         fi
7324                         ;;
7325                 esac
7326
7327 cf_fix_cppflags=no
7328 cf_new_cflags=
7329 cf_new_cppflags=
7330 cf_new_extra_cppflags=
7331
7332 for cf_add_cflags in $cf_pkg_cflags
7333 do
7334 case "$cf_fix_cppflags" in
7335 (no)
7336         case "$cf_add_cflags" in
7337         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7338                 case "$cf_add_cflags" in
7339                 (-D*)
7340                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7341
7342                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7343                                 && test -z "${cf_tst_cflags}" \
7344                                 && cf_fix_cppflags=yes
7345
7346                         if test "$cf_fix_cppflags" = yes ; then
7347
7348         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7349         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7350
7351                                 continue
7352                         elif test "${cf_tst_cflags}" = "\"'" ; then
7353
7354         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7355         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7356
7357                                 continue
7358                         fi
7359                         ;;
7360                 esac
7361                 case "$CPPFLAGS" in
7362                 (*$cf_add_cflags)
7363                         ;;
7364                 (*)
7365                         case "$cf_add_cflags" in
7366                         (-D*)
7367                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7368
7369 CPPFLAGS=`echo "$CPPFLAGS" | \
7370         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7371                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7372
7373                                 ;;
7374                         esac
7375
7376         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7377         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7378
7379                         ;;
7380                 esac
7381                 ;;
7382         (*)
7383
7384         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7385         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7386
7387                 ;;
7388         esac
7389         ;;
7390 (yes)
7391
7392         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7393         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7394
7395         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7396
7397         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7398                 && test -z "${cf_tst_cflags}" \
7399                 && cf_fix_cppflags=no
7400         ;;
7401 esac
7402 done
7403
7404 if test -n "$cf_new_cflags" ; then
7405
7406         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7407         CFLAGS="${CFLAGS}$cf_new_cflags"
7408
7409 fi
7410
7411 if test -n "$cf_new_cppflags" ; then
7412
7413         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7414         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7415
7416 fi
7417
7418 if test -n "$cf_new_extra_cppflags" ; then
7419
7420         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7421         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7422
7423 fi
7424
7425 cf_add_libs="$LIBS"
7426 # reverse order
7427 cf_add_0lib=
7428 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7429 # filter duplicates
7430 for cf_add_1lib in $cf_add_0lib; do
7431         for cf_add_2lib in $cf_add_libs; do
7432                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7433                         cf_add_1lib=
7434                         break
7435                 fi
7436         done
7437         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7438 done
7439 LIBS="$cf_add_libs"
7440
7441                 cat >"conftest.$ac_ext" <<_ACEOF
7442 #line 7442 "configure"
7443 #include "confdefs.h"
7444 #include <${cf_cv_ncurses_header:-curses.h}>
7445 int
7446 main (void)
7447 {
7448 initscr(); mousemask(0,0); tigetstr((char *)0);
7449   ;
7450   return 0;
7451 }
7452 _ACEOF
7453 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7454 if { (eval echo "$as_me:7454: \"$ac_link\"") >&5
7455   (eval $ac_link) 2>&5
7456   ac_status=$?
7457   echo "$as_me:7457: \$? = $ac_status" >&5
7458   (exit "$ac_status"); } &&
7459          { ac_try='test -s "conftest$ac_exeext"'
7460   { (eval echo "$as_me:7460: \"$ac_try\"") >&5
7461   (eval $ac_try) 2>&5
7462   ac_status=$?
7463   echo "$as_me:7463: \$? = $ac_status" >&5
7464   (exit "$ac_status"); }; }; then
7465   if test "$cross_compiling" = yes; then
7466   cf_have_ncuconfig=maybe
7467 else
7468   cat >"conftest.$ac_ext" <<_ACEOF
7469 #line 7469 "configure"
7470 #include "confdefs.h"
7471 #include <${cf_cv_ncurses_header:-curses.h}>
7472                                 int main(void)
7473                                 { const char *xx = curses_version(); return (xx == 0); }
7474 _ACEOF
7475 rm -f "conftest$ac_exeext"
7476 if { (eval echo "$as_me:7476: \"$ac_link\"") >&5
7477   (eval $ac_link) 2>&5
7478   ac_status=$?
7479   echo "$as_me:7479: \$? = $ac_status" >&5
7480   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7481   { (eval echo "$as_me:7481: \"$ac_try\"") >&5
7482   (eval $ac_try) 2>&5
7483   ac_status=$?
7484   echo "$as_me:7484: \$? = $ac_status" >&5
7485   (exit "$ac_status"); }; }; then
7486   cf_have_ncuconfig=yes
7487 else
7488   echo "$as_me: program exited with status $ac_status" >&5
7489 echo "$as_me: failed program was:" >&5
7490 cat "conftest.$ac_ext" >&5
7491 cf_have_ncuconfig=no
7492 fi
7493 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7494 fi
7495 else
7496   echo "$as_me: failed program was:" >&5
7497 cat "conftest.$ac_ext" >&5
7498 cf_have_ncuconfig=no
7499 fi
7500 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7501                 echo "$as_me:7501: result: $cf_have_ncuconfig" >&5
7502 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7503                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7504                 if test "$cf_have_ncuconfig" != "yes"
7505                 then
7506                         CPPFLAGS="$cf_save_CPPFLAGS"
7507                         LIBS="$cf_save_LIBS"
7508                         NCURSES_CONFIG_PKG=none
7509                 else
7510
7511 cat >>confdefs.h <<\EOF
7512 #define NCURSES 1
7513 EOF
7514
7515                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7516
7517 echo "$as_me:7517: checking for terminfo header" >&5
7518 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7519 if test "${cf_cv_term_header+set}" = set; then
7520   echo $ECHO_N "(cached) $ECHO_C" >&6
7521 else
7522
7523 case "${cf_cv_ncurses_header}" in
7524 (*/ncurses.h|*/ncursesw.h)
7525         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7526         ;;
7527 (*)
7528         cf_term_header=term.h
7529         ;;
7530 esac
7531
7532 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7533 do
7534 cat >"conftest.$ac_ext" <<_ACEOF
7535 #line 7535 "configure"
7536 #include "confdefs.h"
7537 #include <stdio.h>
7538 #include <${cf_cv_ncurses_header:-curses.h}>
7539 #include <$cf_test>
7540
7541 int
7542 main (void)
7543 {
7544 int x = auto_left_margin; (void)x
7545   ;
7546   return 0;
7547 }
7548 _ACEOF
7549 rm -f "conftest.$ac_objext"
7550 if { (eval echo "$as_me:7550: \"$ac_compile\"") >&5
7551   (eval $ac_compile) 2>&5
7552   ac_status=$?
7553   echo "$as_me:7553: \$? = $ac_status" >&5
7554   (exit "$ac_status"); } &&
7555          { ac_try='test -s "conftest.$ac_objext"'
7556   { (eval echo "$as_me:7556: \"$ac_try\"") >&5
7557   (eval $ac_try) 2>&5
7558   ac_status=$?
7559   echo "$as_me:7559: \$? = $ac_status" >&5
7560   (exit "$ac_status"); }; }; then
7561
7562         cf_cv_term_header="$cf_test"
7563 else
7564   echo "$as_me: failed program was:" >&5
7565 cat "conftest.$ac_ext" >&5
7566
7567         cf_cv_term_header=unknown
7568
7569 fi
7570 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7571         test "$cf_cv_term_header" != unknown && break
7572 done
7573
7574 fi
7575 echo "$as_me:7575: result: $cf_cv_term_header" >&5
7576 echo "${ECHO_T}$cf_cv_term_header" >&6
7577
7578 # Set definitions to allow ifdef'ing to accommodate subdirectories
7579
7580 case "$cf_cv_term_header" in
7581 (*term.h)
7582
7583 cat >>confdefs.h <<\EOF
7584 #define HAVE_TERM_H 1
7585 EOF
7586
7587         ;;
7588 esac
7589
7590 case "$cf_cv_term_header" in
7591 (ncurses/term.h)
7592
7593 cat >>confdefs.h <<\EOF
7594 #define HAVE_NCURSES_TERM_H 1
7595 EOF
7596
7597         ;;
7598 (ncursesw/term.h)
7599
7600 cat >>confdefs.h <<\EOF
7601 #define HAVE_NCURSESW_TERM_H 1
7602 EOF
7603
7604         ;;
7605 esac
7606
7607                 fi
7608
7609         else
7610                 echo "$as_me:7610: result: no" >&5
7611 echo "${ECHO_T}no" >&6
7612                 NCURSES_CONFIG_PKG=none
7613         fi
7614 else
7615         NCURSES_CONFIG_PKG=none
7616 fi
7617
7618 if test "x$cf_have_ncuconfig" = "xno"; then
7619         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7620
7621 if test -n "$ac_tool_prefix"; then
7622   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7623   do
7624     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7625 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7626 echo "$as_me:7626: checking for $ac_word" >&5
7627 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7628 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7629   echo $ECHO_N "(cached) $ECHO_C" >&6
7630 else
7631   if test -n "$NCURSES_CONFIG"; then
7632   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7633 else
7634   ac_save_IFS=$IFS; IFS=$ac_path_separator
7635 ac_dummy="$PATH"
7636 for ac_dir in $ac_dummy; do
7637   IFS=$ac_save_IFS
7638   test -z "$ac_dir" && ac_dir=.
7639   $as_executable_p "$ac_dir/$ac_word" || continue
7640 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7641 echo "$as_me:7641: found $ac_dir/$ac_word" >&5
7642 break
7643 done
7644
7645 fi
7646 fi
7647 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7648 if test -n "$NCURSES_CONFIG"; then
7649   echo "$as_me:7649: result: $NCURSES_CONFIG" >&5
7650 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7651 else
7652   echo "$as_me:7652: result: no" >&5
7653 echo "${ECHO_T}no" >&6
7654 fi
7655
7656     test -n "$NCURSES_CONFIG" && break
7657   done
7658 fi
7659 if test -z "$NCURSES_CONFIG"; then
7660   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7661   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7662 do
7663   # Extract the first word of "$ac_prog", so it can be a program name with args.
7664 set dummy $ac_prog; ac_word=$2
7665 echo "$as_me:7665: checking for $ac_word" >&5
7666 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7667 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7668   echo $ECHO_N "(cached) $ECHO_C" >&6
7669 else
7670   if test -n "$ac_ct_NCURSES_CONFIG"; then
7671   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7672 else
7673   ac_save_IFS=$IFS; IFS=$ac_path_separator
7674 ac_dummy="$PATH"
7675 for ac_dir in $ac_dummy; do
7676   IFS=$ac_save_IFS
7677   test -z "$ac_dir" && ac_dir=.
7678   $as_executable_p "$ac_dir/$ac_word" || continue
7679 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7680 echo "$as_me:7680: found $ac_dir/$ac_word" >&5
7681 break
7682 done
7683
7684 fi
7685 fi
7686 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7687 if test -n "$ac_ct_NCURSES_CONFIG"; then
7688   echo "$as_me:7688: result: $ac_ct_NCURSES_CONFIG" >&5
7689 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7690 else
7691   echo "$as_me:7691: result: no" >&5
7692 echo "${ECHO_T}no" >&6
7693 fi
7694
7695   test -n "$ac_ct_NCURSES_CONFIG" && break
7696 done
7697 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7698
7699   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7700 fi
7701
7702         if test "$NCURSES_CONFIG" != none ; then
7703
7704 cf_fix_cppflags=no
7705 cf_new_cflags=
7706 cf_new_cppflags=
7707 cf_new_extra_cppflags=
7708
7709 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7710 do
7711 case "$cf_fix_cppflags" in
7712 (no)
7713         case "$cf_add_cflags" in
7714         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7715                 case "$cf_add_cflags" in
7716                 (-D*)
7717                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7718
7719                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7720                                 && test -z "${cf_tst_cflags}" \
7721                                 && cf_fix_cppflags=yes
7722
7723                         if test "$cf_fix_cppflags" = yes ; then
7724
7725         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7726         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7727
7728                                 continue
7729                         elif test "${cf_tst_cflags}" = "\"'" ; then
7730
7731         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7732         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7733
7734                                 continue
7735                         fi
7736                         ;;
7737                 esac
7738                 case "$CPPFLAGS" in
7739                 (*$cf_add_cflags)
7740                         ;;
7741                 (*)
7742                         case "$cf_add_cflags" in
7743                         (-D*)
7744                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7745
7746 CPPFLAGS=`echo "$CPPFLAGS" | \
7747         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7748                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7749
7750                                 ;;
7751                         esac
7752
7753         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7754         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7755
7756                         ;;
7757                 esac
7758                 ;;
7759         (*)
7760
7761         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7762         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7763
7764                 ;;
7765         esac
7766         ;;
7767 (yes)
7768
7769         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7770         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7771
7772         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7773
7774         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7775                 && test -z "${cf_tst_cflags}" \
7776                 && cf_fix_cppflags=no
7777         ;;
7778 esac
7779 done
7780
7781 if test -n "$cf_new_cflags" ; then
7782
7783         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7784         CFLAGS="${CFLAGS}$cf_new_cflags"
7785
7786 fi
7787
7788 if test -n "$cf_new_cppflags" ; then
7789
7790         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7791         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7792
7793 fi
7794
7795 if test -n "$cf_new_extra_cppflags" ; then
7796
7797         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7798         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7799
7800 fi
7801
7802 cf_add_libs="$LIBS"
7803 # reverse order
7804 cf_add_0lib=
7805 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7806 # filter duplicates
7807 for cf_add_1lib in $cf_add_0lib; do
7808         for cf_add_2lib in $cf_add_libs; do
7809                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7810                         cf_add_1lib=
7811                         break
7812                 fi
7813         done
7814         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7815 done
7816 LIBS="$cf_add_libs"
7817
7818                 # even with config script, some packages use no-override for curses.h
7819
7820 echo "$as_me:7820: checking if we have identified curses headers" >&5
7821 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7822 if test "${cf_cv_ncurses_header+set}" = set; then
7823   echo $ECHO_N "(cached) $ECHO_C" >&6
7824 else
7825
7826 cf_cv_ncurses_header=none
7827 for cf_header in \
7828         ncurses.h ncursesw/ncurses.h \
7829         curses.h ncursesw/curses.h
7830 do
7831 cat >"conftest.$ac_ext" <<_ACEOF
7832 #line 7832 "configure"
7833 #include "confdefs.h"
7834 #include <${cf_header}>
7835 int
7836 main (void)
7837 {
7838 initscr(); tgoto("?", 0,0)
7839   ;
7840   return 0;
7841 }
7842 _ACEOF
7843 rm -f "conftest.$ac_objext"
7844 if { (eval echo "$as_me:7844: \"$ac_compile\"") >&5
7845   (eval $ac_compile) 2>&5
7846   ac_status=$?
7847   echo "$as_me:7847: \$? = $ac_status" >&5
7848   (exit "$ac_status"); } &&
7849          { ac_try='test -s "conftest.$ac_objext"'
7850   { (eval echo "$as_me:7850: \"$ac_try\"") >&5
7851   (eval $ac_try) 2>&5
7852   ac_status=$?
7853   echo "$as_me:7853: \$? = $ac_status" >&5
7854   (exit "$ac_status"); }; }; then
7855   cf_cv_ncurses_header=$cf_header; break
7856 else
7857   echo "$as_me: failed program was:" >&5
7858 cat "conftest.$ac_ext" >&5
7859 fi
7860 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7861 done
7862
7863 fi
7864 echo "$as_me:7864: result: $cf_cv_ncurses_header" >&5
7865 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7866
7867 if test "$cf_cv_ncurses_header" = none ; then
7868         { { echo "$as_me:7868: error: No curses header-files found" >&5
7869 echo "$as_me: error: No curses header-files found" >&2;}
7870    { (exit 1); exit 1; }; }
7871 fi
7872
7873 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7874
7875 for ac_header in $cf_cv_ncurses_header
7876 do
7877 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7878 echo "$as_me:7878: checking for $ac_header" >&5
7879 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7880 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7881   echo $ECHO_N "(cached) $ECHO_C" >&6
7882 else
7883   cat >"conftest.$ac_ext" <<_ACEOF
7884 #line 7884 "configure"
7885 #include "confdefs.h"
7886 #include <$ac_header>
7887 _ACEOF
7888 if { (eval echo "$as_me:7888: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7889   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7890   ac_status=$?
7891   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7892   rm -f conftest.er1
7893   cat conftest.err >&5
7894   echo "$as_me:7894: \$? = $ac_status" >&5
7895   (exit "$ac_status"); } >/dev/null; then
7896   if test -s conftest.err; then
7897     ac_cpp_err=$ac_c_preproc_warn_flag
7898   else
7899     ac_cpp_err=
7900   fi
7901 else
7902   ac_cpp_err=yes
7903 fi
7904 if test -z "$ac_cpp_err"; then
7905   eval "$as_ac_Header=yes"
7906 else
7907   echo "$as_me: failed program was:" >&5
7908   cat "conftest.$ac_ext" >&5
7909   eval "$as_ac_Header=no"
7910 fi
7911 rm -f conftest.err "conftest.$ac_ext"
7912 fi
7913 echo "$as_me:7913: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7914 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7915 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7916   cat >>confdefs.h <<EOF
7917 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7918 EOF
7919
7920 fi
7921 done
7922
7923 cat >>confdefs.h <<\EOF
7924 #define NCURSES 1
7925 EOF
7926
7927 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7928
7929                 cat >>confdefs.h <<EOF
7930 #define $cf_nculib_ROOT 1
7931 EOF
7932
7933                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
7934
7935         else
7936
7937 cf_ncuhdr_root=ncursesw
7938
7939 test -n "$cf_cv_curses_dir" && \
7940 test "$cf_cv_curses_dir" != "no" && { \
7941
7942 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7943   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7944   do
7945         while test "$cf_add_incdir" != /usr/include
7946         do
7947           if test -d "$cf_add_incdir"
7948           then
7949                 cf_have_incdir=no
7950                 if test -n "$CFLAGS$CPPFLAGS" ; then
7951                   # a loop is needed to ensure we can add subdirs of existing dirs
7952                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7953                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7954                           cf_have_incdir=yes; break
7955                         fi
7956                   done
7957                 fi
7958
7959                 if test "$cf_have_incdir" = no ; then
7960                   if test "$cf_add_incdir" = /usr/local/include ; then
7961                         if test "$GCC" = yes
7962                         then
7963                           cf_save_CPPFLAGS=$CPPFLAGS
7964
7965         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7966         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7967
7968                           cat >"conftest.$ac_ext" <<_ACEOF
7969 #line 7969 "configure"
7970 #include "confdefs.h"
7971 #include <stdio.h>
7972 int
7973 main (void)
7974 {
7975 printf("Hello")
7976   ;
7977   return 0;
7978 }
7979 _ACEOF
7980 rm -f "conftest.$ac_objext"
7981 if { (eval echo "$as_me:7981: \"$ac_compile\"") >&5
7982   (eval $ac_compile) 2>&5
7983   ac_status=$?
7984   echo "$as_me:7984: \$? = $ac_status" >&5
7985   (exit "$ac_status"); } &&
7986          { ac_try='test -s "conftest.$ac_objext"'
7987   { (eval echo "$as_me:7987: \"$ac_try\"") >&5
7988   (eval $ac_try) 2>&5
7989   ac_status=$?
7990   echo "$as_me:7990: \$? = $ac_status" >&5
7991   (exit "$ac_status"); }; }; then
7992   :
7993 else
7994   echo "$as_me: failed program was:" >&5
7995 cat "conftest.$ac_ext" >&5
7996 cf_have_incdir=yes
7997 fi
7998 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7999                           CPPFLAGS=$cf_save_CPPFLAGS
8000                         fi
8001                   fi
8002                 fi
8003
8004                 if test "$cf_have_incdir" = no ; then
8005                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8006
8007 echo "${as_me:-configure}:8007: testing adding $cf_add_incdir to include-path ..." 1>&5
8008
8009                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8010
8011                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8012                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8013                   cf_add_incdir="$cf_top_incdir"
8014                 else
8015                   break
8016                 fi
8017           else
8018                 break
8019           fi
8020         done
8021   done
8022 fi
8023
8024 }
8025
8026 echo "$as_me:8026: checking for $cf_ncuhdr_root header in include-path" >&5
8027 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8028 if test "${cf_cv_ncurses_h+set}" = set; then
8029   echo $ECHO_N "(cached) $ECHO_C" >&6
8030 else
8031
8032         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8033         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8034         for cf_header in $cf_header_list
8035         do
8036
8037         cat >"conftest.$ac_ext" <<_ACEOF
8038 #line 8038 "configure"
8039 #include "confdefs.h"
8040
8041 #define _XOPEN_SOURCE_EXTENDED
8042 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8043 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8044
8045 #include <$cf_header>
8046 int
8047 main (void)
8048 {
8049
8050 #ifdef NCURSES_VERSION
8051
8052 #ifndef WACS_BSSB
8053         make an error
8054 #endif
8055
8056 printf("%s\\n", NCURSES_VERSION);
8057 #else
8058 #ifdef __NCURSES_H
8059 printf("old\\n");
8060 #else
8061         make an error
8062 #endif
8063 #endif
8064
8065   ;
8066   return 0;
8067 }
8068 _ACEOF
8069 rm -f "conftest.$ac_objext"
8070 if { (eval echo "$as_me:8070: \"$ac_compile\"") >&5
8071   (eval $ac_compile) 2>&5
8072   ac_status=$?
8073   echo "$as_me:8073: \$? = $ac_status" >&5
8074   (exit "$ac_status"); } &&
8075          { ac_try='test -s "conftest.$ac_objext"'
8076   { (eval echo "$as_me:8076: \"$ac_try\"") >&5
8077   (eval $ac_try) 2>&5
8078   ac_status=$?
8079   echo "$as_me:8079: \$? = $ac_status" >&5
8080   (exit "$ac_status"); }; }; then
8081   cf_cv_ncurses_h=$cf_header
8082
8083 else
8084   echo "$as_me: failed program was:" >&5
8085 cat "conftest.$ac_ext" >&5
8086 cf_cv_ncurses_h=no
8087 fi
8088 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8089
8090                 test "$cf_cv_ncurses_h" != no && break
8091         done
8092
8093 fi
8094 echo "$as_me:8094: result: $cf_cv_ncurses_h" >&5
8095 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8096
8097 if test "$cf_cv_ncurses_h" != no ; then
8098         cf_cv_ncurses_header=$cf_cv_ncurses_h
8099 else
8100
8101 echo "$as_me:8101: checking for $cf_ncuhdr_root include-path" >&5
8102 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8103 if test "${cf_cv_ncurses_h2+set}" = set; then
8104   echo $ECHO_N "(cached) $ECHO_C" >&6
8105 else
8106
8107         test -n "$verbose" && echo
8108
8109 cf_search=
8110
8111 # collect the current set of include-directories from compiler flags
8112 cf_header_path_list=""
8113 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8114         for cf_header_path in $CPPFLAGS $CFLAGS
8115         do
8116                 case "$cf_header_path" in
8117                 (-I*)
8118                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8119
8120 test "x$cf_header_path" != "xNONE" && \
8121 test -d "$cf_header_path" && \
8122  {
8123         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8124         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8125         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8126         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8127         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8128         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"
8129 }
8130
8131                         cf_header_path_list="$cf_header_path_list $cf_search"
8132                         ;;
8133                 esac
8134         done
8135 fi
8136
8137 # add the variations for the package we are looking for
8138
8139 cf_search=
8140
8141 test "x$prefix" != "xNONE" && \
8142 test -d "$prefix" && \
8143  {
8144         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8145         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8146         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8147         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8148         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8149         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8150 }
8151
8152 for cf_subdir_prefix in \
8153         /usr \
8154         /usr/local \
8155         /usr/pkg \
8156         /opt \
8157         /opt/local \
8158         $HOME
8159 do
8160
8161 test "x$cf_subdir_prefix" != "x$prefix" && \
8162 test -d "$cf_subdir_prefix" && \
8163 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8164         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8165         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8166         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8167         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8168         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8169         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"
8170 }
8171
8172 done
8173
8174 test "$includedir" != NONE && \
8175 test "$includedir" != "/usr/include" && \
8176 test -d "$includedir" && {
8177         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8178         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8179 }
8180
8181 test "$oldincludedir" != NONE && \
8182 test "$oldincludedir" != "/usr/include" && \
8183 test -d "$oldincludedir" && {
8184         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8185         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8186 }
8187
8188 cf_search="$cf_search $cf_header_path_list"
8189
8190         test -n "$verbose" && echo "search path $cf_search"
8191         cf_save2_CPPFLAGS="$CPPFLAGS"
8192         for cf_incdir in $cf_search
8193         do
8194
8195 if test -n "$cf_incdir" ; then
8196   for cf_add_incdir in $cf_incdir
8197   do
8198         while test "$cf_add_incdir" != /usr/include
8199         do
8200           if test -d "$cf_add_incdir"
8201           then
8202                 cf_have_incdir=no
8203                 if test -n "$CFLAGS$CPPFLAGS" ; then
8204                   # a loop is needed to ensure we can add subdirs of existing dirs
8205                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8206                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8207                           cf_have_incdir=yes; break
8208                         fi
8209                   done
8210                 fi
8211
8212                 if test "$cf_have_incdir" = no ; then
8213                   if test "$cf_add_incdir" = /usr/local/include ; then
8214                         if test "$GCC" = yes
8215                         then
8216                           cf_save_CPPFLAGS=$CPPFLAGS
8217
8218         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8219         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8220
8221                           cat >"conftest.$ac_ext" <<_ACEOF
8222 #line 8222 "configure"
8223 #include "confdefs.h"
8224 #include <stdio.h>
8225 int
8226 main (void)
8227 {
8228 printf("Hello")
8229   ;
8230   return 0;
8231 }
8232 _ACEOF
8233 rm -f "conftest.$ac_objext"
8234 if { (eval echo "$as_me:8234: \"$ac_compile\"") >&5
8235   (eval $ac_compile) 2>&5
8236   ac_status=$?
8237   echo "$as_me:8237: \$? = $ac_status" >&5
8238   (exit "$ac_status"); } &&
8239          { ac_try='test -s "conftest.$ac_objext"'
8240   { (eval echo "$as_me:8240: \"$ac_try\"") >&5
8241   (eval $ac_try) 2>&5
8242   ac_status=$?
8243   echo "$as_me:8243: \$? = $ac_status" >&5
8244   (exit "$ac_status"); }; }; then
8245   :
8246 else
8247   echo "$as_me: failed program was:" >&5
8248 cat "conftest.$ac_ext" >&5
8249 cf_have_incdir=yes
8250 fi
8251 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8252                           CPPFLAGS=$cf_save_CPPFLAGS
8253                         fi
8254                   fi
8255                 fi
8256
8257                 if test "$cf_have_incdir" = no ; then
8258                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8259
8260 echo "${as_me:-configure}:8260: testing adding $cf_add_incdir to include-path ..." 1>&5
8261
8262                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8263
8264                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8265                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8266                   cf_add_incdir="$cf_top_incdir"
8267                 else
8268                   break
8269                 fi
8270           else
8271                 break
8272           fi
8273         done
8274   done
8275 fi
8276
8277                 for cf_header in \
8278                         ncurses.h \
8279                         curses.h
8280                 do
8281
8282         cat >"conftest.$ac_ext" <<_ACEOF
8283 #line 8283 "configure"
8284 #include "confdefs.h"
8285
8286 #include <$cf_header>
8287 int
8288 main (void)
8289 {
8290
8291 #ifdef NCURSES_VERSION
8292
8293 printf("%s\\n", NCURSES_VERSION);
8294 #else
8295 #ifdef __NCURSES_H
8296 printf("old\\n");
8297 #else
8298         make an error
8299 #endif
8300 #endif
8301
8302   ;
8303   return 0;
8304 }
8305 _ACEOF
8306 rm -f "conftest.$ac_objext"
8307 if { (eval echo "$as_me:8307: \"$ac_compile\"") >&5
8308   (eval $ac_compile) 2>&5
8309   ac_status=$?
8310   echo "$as_me:8310: \$? = $ac_status" >&5
8311   (exit "$ac_status"); } &&
8312          { ac_try='test -s "conftest.$ac_objext"'
8313   { (eval echo "$as_me:8313: \"$ac_try\"") >&5
8314   (eval $ac_try) 2>&5
8315   ac_status=$?
8316   echo "$as_me:8316: \$? = $ac_status" >&5
8317   (exit "$ac_status"); }; }; then
8318   cf_cv_ncurses_h2=$cf_header
8319
8320 else
8321   echo "$as_me: failed program was:" >&5
8322 cat "conftest.$ac_ext" >&5
8323 cf_cv_ncurses_h2=no
8324 fi
8325 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8326
8327                         if test "$cf_cv_ncurses_h2" != no ; then
8328                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8329                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8330                                 break
8331                         fi
8332                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8333                 done
8334                 CPPFLAGS="$cf_save2_CPPFLAGS"
8335                 test "$cf_cv_ncurses_h2" != no && break
8336         done
8337         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8337: error: not found" >&5
8338 echo "$as_me: error: not found" >&2;}
8339    { (exit 1); exit 1; }; }
8340
8341 fi
8342 echo "$as_me:8342: result: $cf_cv_ncurses_h2" >&5
8343 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8344
8345         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8346         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8347         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8348                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8349         fi
8350
8351 if test -n "$cf_1st_incdir" ; then
8352   for cf_add_incdir in $cf_1st_incdir
8353   do
8354         while test "$cf_add_incdir" != /usr/include
8355         do
8356           if test -d "$cf_add_incdir"
8357           then
8358                 cf_have_incdir=no
8359                 if test -n "$CFLAGS$CPPFLAGS" ; then
8360                   # a loop is needed to ensure we can add subdirs of existing dirs
8361                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8362                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8363                           cf_have_incdir=yes; break
8364                         fi
8365                   done
8366                 fi
8367
8368                 if test "$cf_have_incdir" = no ; then
8369                   if test "$cf_add_incdir" = /usr/local/include ; then
8370                         if test "$GCC" = yes
8371                         then
8372                           cf_save_CPPFLAGS=$CPPFLAGS
8373
8374         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8375         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8376
8377                           cat >"conftest.$ac_ext" <<_ACEOF
8378 #line 8378 "configure"
8379 #include "confdefs.h"
8380 #include <stdio.h>
8381 int
8382 main (void)
8383 {
8384 printf("Hello")
8385   ;
8386   return 0;
8387 }
8388 _ACEOF
8389 rm -f "conftest.$ac_objext"
8390 if { (eval echo "$as_me:8390: \"$ac_compile\"") >&5
8391   (eval $ac_compile) 2>&5
8392   ac_status=$?
8393   echo "$as_me:8393: \$? = $ac_status" >&5
8394   (exit "$ac_status"); } &&
8395          { ac_try='test -s "conftest.$ac_objext"'
8396   { (eval echo "$as_me:8396: \"$ac_try\"") >&5
8397   (eval $ac_try) 2>&5
8398   ac_status=$?
8399   echo "$as_me:8399: \$? = $ac_status" >&5
8400   (exit "$ac_status"); }; }; then
8401   :
8402 else
8403   echo "$as_me: failed program was:" >&5
8404 cat "conftest.$ac_ext" >&5
8405 cf_have_incdir=yes
8406 fi
8407 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8408                           CPPFLAGS=$cf_save_CPPFLAGS
8409                         fi
8410                   fi
8411                 fi
8412
8413                 if test "$cf_have_incdir" = no ; then
8414                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8415
8416 echo "${as_me:-configure}:8416: testing adding $cf_add_incdir to include-path ..." 1>&5
8417
8418                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8419
8420                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8421                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8422                   cf_add_incdir="$cf_top_incdir"
8423                 else
8424                   break
8425                 fi
8426           else
8427                 break
8428           fi
8429         done
8430   done
8431 fi
8432
8433 fi
8434
8435 # Set definitions to allow ifdef'ing for ncurses.h
8436
8437 case "$cf_cv_ncurses_header" in
8438 (*ncurses.h)
8439
8440 cat >>confdefs.h <<\EOF
8441 #define HAVE_NCURSES_H 1
8442 EOF
8443
8444         ;;
8445 esac
8446
8447 case "$cf_cv_ncurses_header" in
8448 (ncurses/curses.h|ncurses/ncurses.h)
8449
8450 cat >>confdefs.h <<\EOF
8451 #define HAVE_NCURSES_NCURSES_H 1
8452 EOF
8453
8454         ;;
8455 (ncursesw/curses.h|ncursesw/ncurses.h)
8456
8457 cat >>confdefs.h <<\EOF
8458 #define HAVE_NCURSESW_NCURSES_H 1
8459 EOF
8460
8461         ;;
8462 esac
8463
8464 echo "$as_me:8464: checking for terminfo header" >&5
8465 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8466 if test "${cf_cv_term_header+set}" = set; then
8467   echo $ECHO_N "(cached) $ECHO_C" >&6
8468 else
8469
8470 case "${cf_cv_ncurses_header}" in
8471 (*/ncurses.h|*/ncursesw.h)
8472         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8473         ;;
8474 (*)
8475         cf_term_header=term.h
8476         ;;
8477 esac
8478
8479 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8480 do
8481 cat >"conftest.$ac_ext" <<_ACEOF
8482 #line 8482 "configure"
8483 #include "confdefs.h"
8484 #include <stdio.h>
8485 #include <${cf_cv_ncurses_header:-curses.h}>
8486 #include <$cf_test>
8487
8488 int
8489 main (void)
8490 {
8491 int x = auto_left_margin; (void)x
8492   ;
8493   return 0;
8494 }
8495 _ACEOF
8496 rm -f "conftest.$ac_objext"
8497 if { (eval echo "$as_me:8497: \"$ac_compile\"") >&5
8498   (eval $ac_compile) 2>&5
8499   ac_status=$?
8500   echo "$as_me:8500: \$? = $ac_status" >&5
8501   (exit "$ac_status"); } &&
8502          { ac_try='test -s "conftest.$ac_objext"'
8503   { (eval echo "$as_me:8503: \"$ac_try\"") >&5
8504   (eval $ac_try) 2>&5
8505   ac_status=$?
8506   echo "$as_me:8506: \$? = $ac_status" >&5
8507   (exit "$ac_status"); }; }; then
8508
8509         cf_cv_term_header="$cf_test"
8510 else
8511   echo "$as_me: failed program was:" >&5
8512 cat "conftest.$ac_ext" >&5
8513
8514         cf_cv_term_header=unknown
8515
8516 fi
8517 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8518         test "$cf_cv_term_header" != unknown && break
8519 done
8520
8521 fi
8522 echo "$as_me:8522: result: $cf_cv_term_header" >&5
8523 echo "${ECHO_T}$cf_cv_term_header" >&6
8524
8525 # Set definitions to allow ifdef'ing to accommodate subdirectories
8526
8527 case "$cf_cv_term_header" in
8528 (*term.h)
8529
8530 cat >>confdefs.h <<\EOF
8531 #define HAVE_TERM_H 1
8532 EOF
8533
8534         ;;
8535 esac
8536
8537 case "$cf_cv_term_header" in
8538 (ncurses/term.h)
8539
8540 cat >>confdefs.h <<\EOF
8541 #define HAVE_NCURSES_TERM_H 1
8542 EOF
8543
8544         ;;
8545 (ncursesw/term.h)
8546
8547 cat >>confdefs.h <<\EOF
8548 #define HAVE_NCURSESW_TERM_H 1
8549 EOF
8550
8551         ;;
8552 esac
8553
8554 # some applications need this, but should check for NCURSES_VERSION
8555
8556 cat >>confdefs.h <<\EOF
8557 #define NCURSES 1
8558 EOF
8559
8560 echo "$as_me:8560: checking for ncurses version" >&5
8561 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8562 if test "${cf_cv_ncurses_version+set}" = set; then
8563   echo $ECHO_N "(cached) $ECHO_C" >&6
8564 else
8565
8566         cf_cv_ncurses_version=no
8567         cf_tempfile=out$$
8568         rm -f "$cf_tempfile"
8569         if test "$cross_compiling" = yes; then
8570
8571         # This will not work if the preprocessor splits the line after the
8572         # Autoconf token.  The 'unproto' program does that.
8573         cat > "conftest.$ac_ext" <<EOF
8574 #include <${cf_cv_ncurses_header:-curses.h}>
8575 #undef Autoconf
8576 #ifdef NCURSES_VERSION
8577 Autoconf NCURSES_VERSION
8578 #else
8579 #ifdef __NCURSES_H
8580 Autoconf "old"
8581 #endif
8582 ;
8583 #endif
8584 EOF
8585         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8586         { (eval echo "$as_me:8586: \"$cf_try\"") >&5
8587   (eval $cf_try) 2>&5
8588   ac_status=$?
8589   echo "$as_me:8589: \$? = $ac_status" >&5
8590   (exit "$ac_status"); }
8591         if test -f conftest.out ; then
8592                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8593                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8594                 rm -f conftest.out
8595         fi
8596
8597 else
8598   cat >"conftest.$ac_ext" <<_ACEOF
8599 #line 8599 "configure"
8600 #include "confdefs.h"
8601
8602 #include <${cf_cv_ncurses_header:-curses.h}>
8603 #include <stdio.h>
8604 int main(void)
8605 {
8606         FILE *fp = fopen("$cf_tempfile", "w");
8607 #ifdef NCURSES_VERSION
8608 # ifdef NCURSES_VERSION_PATCH
8609         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8610 # else
8611         fprintf(fp, "%s\\n", NCURSES_VERSION);
8612 # endif
8613 #else
8614 # ifdef __NCURSES_H
8615         fprintf(fp, "old\\n");
8616 # else
8617         make an error
8618 # endif
8619 #endif
8620         ${cf_cv_main_return:-return}(0);
8621 }
8622 _ACEOF
8623 rm -f "conftest$ac_exeext"
8624 if { (eval echo "$as_me:8624: \"$ac_link\"") >&5
8625   (eval $ac_link) 2>&5
8626   ac_status=$?
8627   echo "$as_me:8627: \$? = $ac_status" >&5
8628   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8629   { (eval echo "$as_me:8629: \"$ac_try\"") >&5
8630   (eval $ac_try) 2>&5
8631   ac_status=$?
8632   echo "$as_me:8632: \$? = $ac_status" >&5
8633   (exit "$ac_status"); }; }; then
8634
8635         cf_cv_ncurses_version=`cat $cf_tempfile`
8636 else
8637   echo "$as_me: program exited with status $ac_status" >&5
8638 echo "$as_me: failed program was:" >&5
8639 cat "conftest.$ac_ext" >&5
8640 fi
8641 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8642 fi
8643         rm -f "$cf_tempfile"
8644
8645 fi
8646 echo "$as_me:8646: result: $cf_cv_ncurses_version" >&5
8647 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8648 test "$cf_cv_ncurses_version" = no ||
8649 cat >>confdefs.h <<\EOF
8650 #define NCURSES 1
8651 EOF
8652
8653 cf_nculib_root=ncursesw
8654         # This works, except for the special case where we find gpm, but
8655         # ncurses is in a nonstandard location via $LIBS, and we really want
8656         # to link gpm.
8657 cf_ncurses_LIBS=""
8658 cf_ncurses_SAVE="$LIBS"
8659 echo "$as_me:8659: checking for Gpm_Open in -lgpm" >&5
8660 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8661 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8662   echo $ECHO_N "(cached) $ECHO_C" >&6
8663 else
8664   ac_check_lib_save_LIBS=$LIBS
8665 LIBS="-lgpm  $LIBS"
8666 cat >"conftest.$ac_ext" <<_ACEOF
8667 #line 8667 "configure"
8668 #include "confdefs.h"
8669
8670 /* Override any gcc2 internal prototype to avoid an error.  */
8671 #ifdef __cplusplus
8672 extern "C"
8673 #endif
8674 /* We use char because int might match the return type of a gcc2
8675    builtin and then its argument prototype would still apply.  */
8676 char Gpm_Open ();
8677 int
8678 main (void)
8679 {
8680 Gpm_Open ();
8681   ;
8682   return 0;
8683 }
8684 _ACEOF
8685 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8686 if { (eval echo "$as_me:8686: \"$ac_link\"") >&5
8687   (eval $ac_link) 2>&5
8688   ac_status=$?
8689   echo "$as_me:8689: \$? = $ac_status" >&5
8690   (exit "$ac_status"); } &&
8691          { ac_try='test -s "conftest$ac_exeext"'
8692   { (eval echo "$as_me:8692: \"$ac_try\"") >&5
8693   (eval $ac_try) 2>&5
8694   ac_status=$?
8695   echo "$as_me:8695: \$? = $ac_status" >&5
8696   (exit "$ac_status"); }; }; then
8697   ac_cv_lib_gpm_Gpm_Open=yes
8698 else
8699   echo "$as_me: failed program was:" >&5
8700 cat "conftest.$ac_ext" >&5
8701 ac_cv_lib_gpm_Gpm_Open=no
8702 fi
8703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8704 LIBS=$ac_check_lib_save_LIBS
8705 fi
8706 echo "$as_me:8706: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8707 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8708 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8709   echo "$as_me:8709: checking for initscr in -lgpm" >&5
8710 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8711 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8712   echo $ECHO_N "(cached) $ECHO_C" >&6
8713 else
8714   ac_check_lib_save_LIBS=$LIBS
8715 LIBS="-lgpm  $LIBS"
8716 cat >"conftest.$ac_ext" <<_ACEOF
8717 #line 8717 "configure"
8718 #include "confdefs.h"
8719
8720 /* Override any gcc2 internal prototype to avoid an error.  */
8721 #ifdef __cplusplus
8722 extern "C"
8723 #endif
8724 /* We use char because int might match the return type of a gcc2
8725    builtin and then its argument prototype would still apply.  */
8726 char initscr ();
8727 int
8728 main (void)
8729 {
8730 initscr ();
8731   ;
8732   return 0;
8733 }
8734 _ACEOF
8735 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8736 if { (eval echo "$as_me:8736: \"$ac_link\"") >&5
8737   (eval $ac_link) 2>&5
8738   ac_status=$?
8739   echo "$as_me:8739: \$? = $ac_status" >&5
8740   (exit "$ac_status"); } &&
8741          { ac_try='test -s "conftest$ac_exeext"'
8742   { (eval echo "$as_me:8742: \"$ac_try\"") >&5
8743   (eval $ac_try) 2>&5
8744   ac_status=$?
8745   echo "$as_me:8745: \$? = $ac_status" >&5
8746   (exit "$ac_status"); }; }; then
8747   ac_cv_lib_gpm_initscr=yes
8748 else
8749   echo "$as_me: failed program was:" >&5
8750 cat "conftest.$ac_ext" >&5
8751 ac_cv_lib_gpm_initscr=no
8752 fi
8753 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8754 LIBS=$ac_check_lib_save_LIBS
8755 fi
8756 echo "$as_me:8756: result: $ac_cv_lib_gpm_initscr" >&5
8757 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8758 if test "$ac_cv_lib_gpm_initscr" = yes; then
8759   LIBS="$cf_ncurses_SAVE"
8760 else
8761   cf_ncurses_LIBS="-lgpm"
8762 fi
8763
8764 fi
8765
8766 case "$host_os" in
8767 (freebsd*)
8768         # This is only necessary if you are linking against an obsolete
8769         # version of ncurses (but it should do no harm, since it's static).
8770         if test "$cf_nculib_root" = ncurses ; then
8771                 echo "$as_me:8771: checking for tgoto in -lmytinfo" >&5
8772 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8773 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8774   echo $ECHO_N "(cached) $ECHO_C" >&6
8775 else
8776   ac_check_lib_save_LIBS=$LIBS
8777 LIBS="-lmytinfo  $LIBS"
8778 cat >"conftest.$ac_ext" <<_ACEOF
8779 #line 8779 "configure"
8780 #include "confdefs.h"
8781
8782 /* Override any gcc2 internal prototype to avoid an error.  */
8783 #ifdef __cplusplus
8784 extern "C"
8785 #endif
8786 /* We use char because int might match the return type of a gcc2
8787    builtin and then its argument prototype would still apply.  */
8788 char tgoto ();
8789 int
8790 main (void)
8791 {
8792 tgoto ();
8793   ;
8794   return 0;
8795 }
8796 _ACEOF
8797 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8798 if { (eval echo "$as_me:8798: \"$ac_link\"") >&5
8799   (eval $ac_link) 2>&5
8800   ac_status=$?
8801   echo "$as_me:8801: \$? = $ac_status" >&5
8802   (exit "$ac_status"); } &&
8803          { ac_try='test -s "conftest$ac_exeext"'
8804   { (eval echo "$as_me:8804: \"$ac_try\"") >&5
8805   (eval $ac_try) 2>&5
8806   ac_status=$?
8807   echo "$as_me:8807: \$? = $ac_status" >&5
8808   (exit "$ac_status"); }; }; then
8809   ac_cv_lib_mytinfo_tgoto=yes
8810 else
8811   echo "$as_me: failed program was:" >&5
8812 cat "conftest.$ac_ext" >&5
8813 ac_cv_lib_mytinfo_tgoto=no
8814 fi
8815 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8816 LIBS=$ac_check_lib_save_LIBS
8817 fi
8818 echo "$as_me:8818: result: $ac_cv_lib_mytinfo_tgoto" >&5
8819 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8820 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8821   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8822 fi
8823
8824         fi
8825         ;;
8826 esac
8827
8828 cf_add_libs="$LIBS"
8829 # reverse order
8830 cf_add_0lib=
8831 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8832 # filter duplicates
8833 for cf_add_1lib in $cf_add_0lib; do
8834         for cf_add_2lib in $cf_add_libs; do
8835                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8836                         cf_add_1lib=
8837                         break
8838                 fi
8839         done
8840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8841 done
8842 LIBS="$cf_add_libs"
8843
8844 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8845 then
8846
8847 cf_add_libs="$LIBS"
8848 # reverse order
8849 cf_add_0lib=
8850 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8851 # filter duplicates
8852 for cf_add_1lib in $cf_add_0lib; do
8853         for cf_add_2lib in $cf_add_libs; do
8854                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8855                         cf_add_1lib=
8856                         break
8857                 fi
8858         done
8859         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8860 done
8861 LIBS="$cf_add_libs"
8862
8863 else
8864
8865         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
8866         cf_libdir=""
8867         echo "$as_me:8867: checking for initscr" >&5
8868 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8869 if test "${ac_cv_func_initscr+set}" = set; then
8870   echo $ECHO_N "(cached) $ECHO_C" >&6
8871 else
8872   cat >"conftest.$ac_ext" <<_ACEOF
8873 #line 8873 "configure"
8874 #include "confdefs.h"
8875 #define initscr autoconf_temporary
8876 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8877 #undef initscr
8878
8879 #ifdef __cplusplus
8880 extern "C"
8881 #endif
8882
8883 /* We use char because int might match the return type of a gcc2
8884    builtin and then its argument prototype would still apply.  */
8885 char initscr (void);
8886
8887 int
8888 main (void)
8889 {
8890
8891 /* The GNU C library defines stubs for functions which it implements
8892     to always fail with ENOSYS.  Some functions are actually named
8893     something starting with __ and the normal name is an alias.  */
8894 #if defined (__stub_initscr) || defined (__stub___initscr)
8895 #error found stub for initscr
8896 #endif
8897
8898         return initscr ();
8899   ;
8900   return 0;
8901 }
8902 _ACEOF
8903 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8904 if { (eval echo "$as_me:8904: \"$ac_link\"") >&5
8905   (eval $ac_link) 2>&5
8906   ac_status=$?
8907   echo "$as_me:8907: \$? = $ac_status" >&5
8908   (exit "$ac_status"); } &&
8909          { ac_try='test -s "conftest$ac_exeext"'
8910   { (eval echo "$as_me:8910: \"$ac_try\"") >&5
8911   (eval $ac_try) 2>&5
8912   ac_status=$?
8913   echo "$as_me:8913: \$? = $ac_status" >&5
8914   (exit "$ac_status"); }; }; then
8915   ac_cv_func_initscr=yes
8916 else
8917   echo "$as_me: failed program was:" >&5
8918 cat "conftest.$ac_ext" >&5
8919 ac_cv_func_initscr=no
8920 fi
8921 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8922 fi
8923 echo "$as_me:8923: result: $ac_cv_func_initscr" >&5
8924 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8925 if test "$ac_cv_func_initscr" = yes; then
8926   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8927 else
8928
8929                 cf_save_LIBS="$LIBS"
8930                 echo "$as_me:8930: checking for initscr in -l$cf_nculib_root" >&5
8931 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8932                 LIBS="-l$cf_nculib_root $LIBS"
8933                 cat >"conftest.$ac_ext" <<_ACEOF
8934 #line 8934 "configure"
8935 #include "confdefs.h"
8936 #include <${cf_cv_ncurses_header:-curses.h}>
8937 int
8938 main (void)
8939 {
8940 initscr()
8941   ;
8942   return 0;
8943 }
8944 _ACEOF
8945 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8946 if { (eval echo "$as_me:8946: \"$ac_link\"") >&5
8947   (eval $ac_link) 2>&5
8948   ac_status=$?
8949   echo "$as_me:8949: \$? = $ac_status" >&5
8950   (exit "$ac_status"); } &&
8951          { ac_try='test -s "conftest$ac_exeext"'
8952   { (eval echo "$as_me:8952: \"$ac_try\"") >&5
8953   (eval $ac_try) 2>&5
8954   ac_status=$?
8955   echo "$as_me:8955: \$? = $ac_status" >&5
8956   (exit "$ac_status"); }; }; then
8957   echo "$as_me:8957: result: yes" >&5
8958 echo "${ECHO_T}yes" >&6
8959                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8960
8961 else
8962   echo "$as_me: failed program was:" >&5
8963 cat "conftest.$ac_ext" >&5
8964 echo "$as_me:8964: result: no" >&5
8965 echo "${ECHO_T}no" >&6
8966
8967 cf_search=
8968 cf_library_path_list=""
8969 if test -n "${LDFLAGS}${LIBS}" ; then
8970         for cf_library_path in $LDFLAGS $LIBS
8971         do
8972                 case "$cf_library_path" in
8973                 (-L*)
8974                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8975
8976 test "x$cf_library_path" != "xNONE" && \
8977 test -d "$cf_library_path" && \
8978  {
8979         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8980         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
8981         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8982         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8983         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8984         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"
8985 }
8986
8987                         cf_library_path_list="$cf_library_path_list $cf_search"
8988                         ;;
8989                 esac
8990         done
8991 fi
8992
8993 cf_search=
8994
8995 test "x$prefix" != "xNONE" && \
8996 test -d "$prefix" && \
8997  {
8998         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8999         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9000         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9001         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9002         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9003         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9004 }
9005
9006 for cf_subdir_prefix in \
9007         /usr \
9008         /usr/local \
9009         /usr/pkg \
9010         /opt \
9011         /opt/local \
9012         $HOME
9013 do
9014
9015 test "x$cf_subdir_prefix" != "x$prefix" && \
9016 test -d "$cf_subdir_prefix" && \
9017 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9018         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9019         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9020         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9021         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9022         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9023         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"
9024 }
9025
9026 done
9027
9028 cf_search="$cf_library_path_list $cf_search"
9029
9030                         for cf_libdir in $cf_search
9031                         do
9032                                 echo "$as_me:9032: checking for -l$cf_nculib_root in $cf_libdir" >&5
9033 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9034                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9035                                 cat >"conftest.$ac_ext" <<_ACEOF
9036 #line 9036 "configure"
9037 #include "confdefs.h"
9038 #include <${cf_cv_ncurses_header:-curses.h}>
9039 int
9040 main (void)
9041 {
9042 initscr()
9043   ;
9044   return 0;
9045 }
9046 _ACEOF
9047 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9048 if { (eval echo "$as_me:9048: \"$ac_link\"") >&5
9049   (eval $ac_link) 2>&5
9050   ac_status=$?
9051   echo "$as_me:9051: \$? = $ac_status" >&5
9052   (exit "$ac_status"); } &&
9053          { ac_try='test -s "conftest$ac_exeext"'
9054   { (eval echo "$as_me:9054: \"$ac_try\"") >&5
9055   (eval $ac_try) 2>&5
9056   ac_status=$?
9057   echo "$as_me:9057: \$? = $ac_status" >&5
9058   (exit "$ac_status"); }; }; then
9059   echo "$as_me:9059: result: yes" >&5
9060 echo "${ECHO_T}yes" >&6
9061                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9062                                          break
9063 else
9064   echo "$as_me: failed program was:" >&5
9065 cat "conftest.$ac_ext" >&5
9066 echo "$as_me:9066: result: no" >&5
9067 echo "${ECHO_T}no" >&6
9068                                          LIBS="$cf_save_LIBS"
9069 fi
9070 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9071                         done
9072
9073 fi
9074 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9075
9076 fi
9077
9078 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9079
9080 if test "$cf_found_library" = no ; then
9081         { { echo "$as_me:9081: error: Cannot link $cf_nculib_root library" >&5
9082 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9083    { (exit 1); exit 1; }; }
9084 fi
9085
9086 fi
9087
9088 if test -n "$cf_ncurses_LIBS" ; then
9089         echo "$as_me:9089: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9090 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9091         cf_ncurses_SAVE="$LIBS"
9092         for p in $cf_ncurses_LIBS ; do
9093                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9094                 if test "$q" != "$LIBS" ; then
9095                         LIBS="$q"
9096                 fi
9097         done
9098         cat >"conftest.$ac_ext" <<_ACEOF
9099 #line 9099 "configure"
9100 #include "confdefs.h"
9101 #include <${cf_cv_ncurses_header:-curses.h}>
9102 int
9103 main (void)
9104 {
9105 initscr(); mousemask(0,0); tigetstr((char *)0);
9106   ;
9107   return 0;
9108 }
9109 _ACEOF
9110 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9111 if { (eval echo "$as_me:9111: \"$ac_link\"") >&5
9112   (eval $ac_link) 2>&5
9113   ac_status=$?
9114   echo "$as_me:9114: \$? = $ac_status" >&5
9115   (exit "$ac_status"); } &&
9116          { ac_try='test -s "conftest$ac_exeext"'
9117   { (eval echo "$as_me:9117: \"$ac_try\"") >&5
9118   (eval $ac_try) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit "$ac_status"); }; }; then
9122   echo "$as_me:9122: result: yes" >&5
9123 echo "${ECHO_T}yes" >&6
9124 else
9125   echo "$as_me: failed program was:" >&5
9126 cat "conftest.$ac_ext" >&5
9127 echo "$as_me:9127: result: no" >&5
9128 echo "${ECHO_T}no" >&6
9129                  LIBS="$cf_ncurses_SAVE"
9130 fi
9131 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9132 fi
9133
9134 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9135
9136 cat >>confdefs.h <<EOF
9137 #define $cf_nculib_ROOT 1
9138 EOF
9139
9140         fi
9141 else
9142         NCURSES_CONFIG=none
9143 fi
9144
9145 else
9146
9147 cf_ncuconfig_root=ncurses
9148 cf_have_ncuconfig=no
9149
9150 if test "x${PKG_CONFIG:=none}" != xnone; then
9151         echo "$as_me:9151: checking pkg-config for $cf_ncuconfig_root" >&5
9152 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9153         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9154                 echo "$as_me:9154: result: yes" >&5
9155 echo "${ECHO_T}yes" >&6
9156
9157                 echo "$as_me:9157: checking if the $cf_ncuconfig_root package files work" >&5
9158 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9159                 cf_have_ncuconfig=unknown
9160
9161                 cf_save_CFLAGS="$CFLAGS"
9162                 cf_save_CPPFLAGS="$CPPFLAGS"
9163                 cf_save_LIBS="$LIBS"
9164
9165                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9166                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9167
9168                 # while -W for passing linker flags is prevalent, it is not "standard".
9169                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9170                 # incompatible _and_ non-standard -W option which gives an error.  Work
9171                 # around that pitfall.
9172                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9173                 (x*c[89]9@@*-W*)
9174
9175 cf_fix_cppflags=no
9176 cf_new_cflags=
9177 cf_new_cppflags=
9178 cf_new_extra_cppflags=
9179
9180 for cf_add_cflags in $cf_pkg_cflags
9181 do
9182 case "$cf_fix_cppflags" in
9183 (no)
9184         case "$cf_add_cflags" in
9185         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9186                 case "$cf_add_cflags" in
9187                 (-D*)
9188                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9189
9190                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9191                                 && test -z "${cf_tst_cflags}" \
9192                                 && cf_fix_cppflags=yes
9193
9194                         if test "$cf_fix_cppflags" = yes ; then
9195
9196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9198
9199                                 continue
9200                         elif test "${cf_tst_cflags}" = "\"'" ; then
9201
9202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9204
9205                                 continue
9206                         fi
9207                         ;;
9208                 esac
9209                 case "$CPPFLAGS" in
9210                 (*$cf_add_cflags)
9211                         ;;
9212                 (*)
9213                         case "$cf_add_cflags" in
9214                         (-D*)
9215                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9216
9217 CPPFLAGS=`echo "$CPPFLAGS" | \
9218         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9219                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9220
9221                                 ;;
9222                         esac
9223
9224         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9225         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9226
9227                         ;;
9228                 esac
9229                 ;;
9230         (*)
9231
9232         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9233         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9234
9235                 ;;
9236         esac
9237         ;;
9238 (yes)
9239
9240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9242
9243         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9244
9245         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9246                 && test -z "${cf_tst_cflags}" \
9247                 && cf_fix_cppflags=no
9248         ;;
9249 esac
9250 done
9251
9252 if test -n "$cf_new_cflags" ; then
9253
9254         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9255         CFLAGS="${CFLAGS}$cf_new_cflags"
9256
9257 fi
9258
9259 if test -n "$cf_new_cppflags" ; then
9260
9261         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9262         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9263
9264 fi
9265
9266 if test -n "$cf_new_extra_cppflags" ; then
9267
9268         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9269         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9270
9271 fi
9272
9273 cf_add_libs="$LIBS"
9274 # reverse order
9275 cf_add_0lib=
9276 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9277 # filter duplicates
9278 for cf_add_1lib in $cf_add_0lib; do
9279         for cf_add_2lib in $cf_add_libs; do
9280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9281                         cf_add_1lib=
9282                         break
9283                 fi
9284         done
9285         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9286 done
9287 LIBS="$cf_add_libs"
9288
9289                         cat >"conftest.$ac_ext" <<_ACEOF
9290 #line 9290 "configure"
9291 #include "confdefs.h"
9292 #include <${cf_cv_ncurses_header:-curses.h}>
9293 int
9294 main (void)
9295 {
9296 initscr(); mousemask(0,0); tigetstr((char *)0);
9297   ;
9298   return 0;
9299 }
9300 _ACEOF
9301 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9302 if { (eval echo "$as_me:9302: \"$ac_link\"") >&5
9303   (eval $ac_link) 2>&5
9304   ac_status=$?
9305   echo "$as_me:9305: \$? = $ac_status" >&5
9306   (exit "$ac_status"); } &&
9307          { ac_try='test -s "conftest$ac_exeext"'
9308   { (eval echo "$as_me:9308: \"$ac_try\"") >&5
9309   (eval $ac_try) 2>&5
9310   ac_status=$?
9311   echo "$as_me:9311: \$? = $ac_status" >&5
9312   (exit "$ac_status"); }; }; then
9313   if test "$cross_compiling" = yes; then
9314   cf_test_ncuconfig=maybe
9315 else
9316   cat >"conftest.$ac_ext" <<_ACEOF
9317 #line 9317 "configure"
9318 #include "confdefs.h"
9319 #include <${cf_cv_ncurses_header:-curses.h}>
9320                                         int main(void)
9321                                         { const char *xx = curses_version(); return (xx == 0); }
9322 _ACEOF
9323 rm -f "conftest$ac_exeext"
9324 if { (eval echo "$as_me:9324: \"$ac_link\"") >&5
9325   (eval $ac_link) 2>&5
9326   ac_status=$?
9327   echo "$as_me:9327: \$? = $ac_status" >&5
9328   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9329   { (eval echo "$as_me:9329: \"$ac_try\"") >&5
9330   (eval $ac_try) 2>&5
9331   ac_status=$?
9332   echo "$as_me:9332: \$? = $ac_status" >&5
9333   (exit "$ac_status"); }; }; then
9334   cf_test_ncuconfig=yes
9335 else
9336   echo "$as_me: program exited with status $ac_status" >&5
9337 echo "$as_me: failed program was:" >&5
9338 cat "conftest.$ac_ext" >&5
9339 cf_test_ncuconfig=no
9340 fi
9341 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9342 fi
9343 else
9344   echo "$as_me: failed program was:" >&5
9345 cat "conftest.$ac_ext" >&5
9346 cf_test_ncuconfig=no
9347 fi
9348 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9349
9350                         CFLAGS="$cf_save_CFLAGS"
9351                         CPPFLAGS="$cf_save_CPPFLAGS"
9352                         LIBS="$cf_save_LIBS"
9353
9354                         if test "x$cf_test_ncuconfig" != xyes; then
9355                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9356                                 cf_pkg_cflags="$cf_temp"
9357                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9358                                 cf_pkg_libs="$cf_temp"
9359                         fi
9360                         ;;
9361                 esac
9362
9363 cf_fix_cppflags=no
9364 cf_new_cflags=
9365 cf_new_cppflags=
9366 cf_new_extra_cppflags=
9367
9368 for cf_add_cflags in $cf_pkg_cflags
9369 do
9370 case "$cf_fix_cppflags" in
9371 (no)
9372         case "$cf_add_cflags" in
9373         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9374                 case "$cf_add_cflags" in
9375                 (-D*)
9376                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9377
9378                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9379                                 && test -z "${cf_tst_cflags}" \
9380                                 && cf_fix_cppflags=yes
9381
9382                         if test "$cf_fix_cppflags" = yes ; then
9383
9384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9386
9387                                 continue
9388                         elif test "${cf_tst_cflags}" = "\"'" ; then
9389
9390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9392
9393                                 continue
9394                         fi
9395                         ;;
9396                 esac
9397                 case "$CPPFLAGS" in
9398                 (*$cf_add_cflags)
9399                         ;;
9400                 (*)
9401                         case "$cf_add_cflags" in
9402                         (-D*)
9403                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9404
9405 CPPFLAGS=`echo "$CPPFLAGS" | \
9406         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9407                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9408
9409                                 ;;
9410                         esac
9411
9412         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9413         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9414
9415                         ;;
9416                 esac
9417                 ;;
9418         (*)
9419
9420         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9421         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9422
9423                 ;;
9424         esac
9425         ;;
9426 (yes)
9427
9428         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9429         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9430
9431         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9432
9433         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9434                 && test -z "${cf_tst_cflags}" \
9435                 && cf_fix_cppflags=no
9436         ;;
9437 esac
9438 done
9439
9440 if test -n "$cf_new_cflags" ; then
9441
9442         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9443         CFLAGS="${CFLAGS}$cf_new_cflags"
9444
9445 fi
9446
9447 if test -n "$cf_new_cppflags" ; then
9448
9449         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9450         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9451
9452 fi
9453
9454 if test -n "$cf_new_extra_cppflags" ; then
9455
9456         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9457         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9458
9459 fi
9460
9461 cf_add_libs="$LIBS"
9462 # reverse order
9463 cf_add_0lib=
9464 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9465 # filter duplicates
9466 for cf_add_1lib in $cf_add_0lib; do
9467         for cf_add_2lib in $cf_add_libs; do
9468                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9469                         cf_add_1lib=
9470                         break
9471                 fi
9472         done
9473         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9474 done
9475 LIBS="$cf_add_libs"
9476
9477                 cat >"conftest.$ac_ext" <<_ACEOF
9478 #line 9478 "configure"
9479 #include "confdefs.h"
9480 #include <${cf_cv_ncurses_header:-curses.h}>
9481 int
9482 main (void)
9483 {
9484 initscr(); mousemask(0,0); tigetstr((char *)0);
9485   ;
9486   return 0;
9487 }
9488 _ACEOF
9489 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9490 if { (eval echo "$as_me:9490: \"$ac_link\"") >&5
9491   (eval $ac_link) 2>&5
9492   ac_status=$?
9493   echo "$as_me:9493: \$? = $ac_status" >&5
9494   (exit "$ac_status"); } &&
9495          { ac_try='test -s "conftest$ac_exeext"'
9496   { (eval echo "$as_me:9496: \"$ac_try\"") >&5
9497   (eval $ac_try) 2>&5
9498   ac_status=$?
9499   echo "$as_me:9499: \$? = $ac_status" >&5
9500   (exit "$ac_status"); }; }; then
9501   if test "$cross_compiling" = yes; then
9502   cf_have_ncuconfig=maybe
9503 else
9504   cat >"conftest.$ac_ext" <<_ACEOF
9505 #line 9505 "configure"
9506 #include "confdefs.h"
9507 #include <${cf_cv_ncurses_header:-curses.h}>
9508                                 int main(void)
9509                                 { const char *xx = curses_version(); return (xx == 0); }
9510 _ACEOF
9511 rm -f "conftest$ac_exeext"
9512 if { (eval echo "$as_me:9512: \"$ac_link\"") >&5
9513   (eval $ac_link) 2>&5
9514   ac_status=$?
9515   echo "$as_me:9515: \$? = $ac_status" >&5
9516   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9517   { (eval echo "$as_me:9517: \"$ac_try\"") >&5
9518   (eval $ac_try) 2>&5
9519   ac_status=$?
9520   echo "$as_me:9520: \$? = $ac_status" >&5
9521   (exit "$ac_status"); }; }; then
9522   cf_have_ncuconfig=yes
9523 else
9524   echo "$as_me: program exited with status $ac_status" >&5
9525 echo "$as_me: failed program was:" >&5
9526 cat "conftest.$ac_ext" >&5
9527 cf_have_ncuconfig=no
9528 fi
9529 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9530 fi
9531 else
9532   echo "$as_me: failed program was:" >&5
9533 cat "conftest.$ac_ext" >&5
9534 cf_have_ncuconfig=no
9535 fi
9536 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9537                 echo "$as_me:9537: result: $cf_have_ncuconfig" >&5
9538 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9539                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9540                 if test "$cf_have_ncuconfig" != "yes"
9541                 then
9542                         CPPFLAGS="$cf_save_CPPFLAGS"
9543                         LIBS="$cf_save_LIBS"
9544                         NCURSES_CONFIG_PKG=none
9545                 else
9546
9547 cat >>confdefs.h <<\EOF
9548 #define NCURSES 1
9549 EOF
9550
9551                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9552
9553 echo "$as_me:9553: checking for terminfo header" >&5
9554 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9555 if test "${cf_cv_term_header+set}" = set; then
9556   echo $ECHO_N "(cached) $ECHO_C" >&6
9557 else
9558
9559 case "${cf_cv_ncurses_header}" in
9560 (*/ncurses.h|*/ncursesw.h)
9561         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9562         ;;
9563 (*)
9564         cf_term_header=term.h
9565         ;;
9566 esac
9567
9568 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9569 do
9570 cat >"conftest.$ac_ext" <<_ACEOF
9571 #line 9571 "configure"
9572 #include "confdefs.h"
9573 #include <stdio.h>
9574 #include <${cf_cv_ncurses_header:-curses.h}>
9575 #include <$cf_test>
9576
9577 int
9578 main (void)
9579 {
9580 int x = auto_left_margin; (void)x
9581   ;
9582   return 0;
9583 }
9584 _ACEOF
9585 rm -f "conftest.$ac_objext"
9586 if { (eval echo "$as_me:9586: \"$ac_compile\"") >&5
9587   (eval $ac_compile) 2>&5
9588   ac_status=$?
9589   echo "$as_me:9589: \$? = $ac_status" >&5
9590   (exit "$ac_status"); } &&
9591          { ac_try='test -s "conftest.$ac_objext"'
9592   { (eval echo "$as_me:9592: \"$ac_try\"") >&5
9593   (eval $ac_try) 2>&5
9594   ac_status=$?
9595   echo "$as_me:9595: \$? = $ac_status" >&5
9596   (exit "$ac_status"); }; }; then
9597
9598         cf_cv_term_header="$cf_test"
9599 else
9600   echo "$as_me: failed program was:" >&5
9601 cat "conftest.$ac_ext" >&5
9602
9603         cf_cv_term_header=unknown
9604
9605 fi
9606 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9607         test "$cf_cv_term_header" != unknown && break
9608 done
9609
9610 fi
9611 echo "$as_me:9611: result: $cf_cv_term_header" >&5
9612 echo "${ECHO_T}$cf_cv_term_header" >&6
9613
9614 # Set definitions to allow ifdef'ing to accommodate subdirectories
9615
9616 case "$cf_cv_term_header" in
9617 (*term.h)
9618
9619 cat >>confdefs.h <<\EOF
9620 #define HAVE_TERM_H 1
9621 EOF
9622
9623         ;;
9624 esac
9625
9626 case "$cf_cv_term_header" in
9627 (ncurses/term.h)
9628
9629 cat >>confdefs.h <<\EOF
9630 #define HAVE_NCURSES_TERM_H 1
9631 EOF
9632
9633         ;;
9634 (ncursesw/term.h)
9635
9636 cat >>confdefs.h <<\EOF
9637 #define HAVE_NCURSESW_TERM_H 1
9638 EOF
9639
9640         ;;
9641 esac
9642
9643                 fi
9644
9645         else
9646                 echo "$as_me:9646: result: no" >&5
9647 echo "${ECHO_T}no" >&6
9648                 NCURSES_CONFIG_PKG=none
9649         fi
9650 else
9651         NCURSES_CONFIG_PKG=none
9652 fi
9653
9654 if test "x$cf_have_ncuconfig" = "xno"; then
9655         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9656
9657 if test -n "$ac_tool_prefix"; then
9658   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9659   do
9660     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9661 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9662 echo "$as_me:9662: checking for $ac_word" >&5
9663 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9664 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9665   echo $ECHO_N "(cached) $ECHO_C" >&6
9666 else
9667   if test -n "$NCURSES_CONFIG"; then
9668   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9669 else
9670   ac_save_IFS=$IFS; IFS=$ac_path_separator
9671 ac_dummy="$PATH"
9672 for ac_dir in $ac_dummy; do
9673   IFS=$ac_save_IFS
9674   test -z "$ac_dir" && ac_dir=.
9675   $as_executable_p "$ac_dir/$ac_word" || continue
9676 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9677 echo "$as_me:9677: found $ac_dir/$ac_word" >&5
9678 break
9679 done
9680
9681 fi
9682 fi
9683 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9684 if test -n "$NCURSES_CONFIG"; then
9685   echo "$as_me:9685: result: $NCURSES_CONFIG" >&5
9686 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9687 else
9688   echo "$as_me:9688: result: no" >&5
9689 echo "${ECHO_T}no" >&6
9690 fi
9691
9692     test -n "$NCURSES_CONFIG" && break
9693   done
9694 fi
9695 if test -z "$NCURSES_CONFIG"; then
9696   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9697   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9698 do
9699   # Extract the first word of "$ac_prog", so it can be a program name with args.
9700 set dummy $ac_prog; ac_word=$2
9701 echo "$as_me:9701: checking for $ac_word" >&5
9702 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9703 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9704   echo $ECHO_N "(cached) $ECHO_C" >&6
9705 else
9706   if test -n "$ac_ct_NCURSES_CONFIG"; then
9707   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9708 else
9709   ac_save_IFS=$IFS; IFS=$ac_path_separator
9710 ac_dummy="$PATH"
9711 for ac_dir in $ac_dummy; do
9712   IFS=$ac_save_IFS
9713   test -z "$ac_dir" && ac_dir=.
9714   $as_executable_p "$ac_dir/$ac_word" || continue
9715 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9716 echo "$as_me:9716: found $ac_dir/$ac_word" >&5
9717 break
9718 done
9719
9720 fi
9721 fi
9722 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9723 if test -n "$ac_ct_NCURSES_CONFIG"; then
9724   echo "$as_me:9724: result: $ac_ct_NCURSES_CONFIG" >&5
9725 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9726 else
9727   echo "$as_me:9727: result: no" >&5
9728 echo "${ECHO_T}no" >&6
9729 fi
9730
9731   test -n "$ac_ct_NCURSES_CONFIG" && break
9732 done
9733 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9734
9735   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9736 fi
9737
9738         if test "$NCURSES_CONFIG" != none ; then
9739
9740 cf_fix_cppflags=no
9741 cf_new_cflags=
9742 cf_new_cppflags=
9743 cf_new_extra_cppflags=
9744
9745 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9746 do
9747 case "$cf_fix_cppflags" in
9748 (no)
9749         case "$cf_add_cflags" in
9750         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9751                 case "$cf_add_cflags" in
9752                 (-D*)
9753                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9754
9755                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9756                                 && test -z "${cf_tst_cflags}" \
9757                                 && cf_fix_cppflags=yes
9758
9759                         if test "$cf_fix_cppflags" = yes ; then
9760
9761         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9762         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9763
9764                                 continue
9765                         elif test "${cf_tst_cflags}" = "\"'" ; then
9766
9767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9769
9770                                 continue
9771                         fi
9772                         ;;
9773                 esac
9774                 case "$CPPFLAGS" in
9775                 (*$cf_add_cflags)
9776                         ;;
9777                 (*)
9778                         case "$cf_add_cflags" in
9779                         (-D*)
9780                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9781
9782 CPPFLAGS=`echo "$CPPFLAGS" | \
9783         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9784                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9785
9786                                 ;;
9787                         esac
9788
9789         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9790         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9791
9792                         ;;
9793                 esac
9794                 ;;
9795         (*)
9796
9797         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9798         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9799
9800                 ;;
9801         esac
9802         ;;
9803 (yes)
9804
9805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9807
9808         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9809
9810         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9811                 && test -z "${cf_tst_cflags}" \
9812                 && cf_fix_cppflags=no
9813         ;;
9814 esac
9815 done
9816
9817 if test -n "$cf_new_cflags" ; then
9818
9819         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9820         CFLAGS="${CFLAGS}$cf_new_cflags"
9821
9822 fi
9823
9824 if test -n "$cf_new_cppflags" ; then
9825
9826         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9827         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9828
9829 fi
9830
9831 if test -n "$cf_new_extra_cppflags" ; then
9832
9833         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9834         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9835
9836 fi
9837
9838 cf_add_libs="$LIBS"
9839 # reverse order
9840 cf_add_0lib=
9841 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9842 # filter duplicates
9843 for cf_add_1lib in $cf_add_0lib; do
9844         for cf_add_2lib in $cf_add_libs; do
9845                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9846                         cf_add_1lib=
9847                         break
9848                 fi
9849         done
9850         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9851 done
9852 LIBS="$cf_add_libs"
9853
9854                 # even with config script, some packages use no-override for curses.h
9855
9856 echo "$as_me:9856: checking if we have identified curses headers" >&5
9857 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9858 if test "${cf_cv_ncurses_header+set}" = set; then
9859   echo $ECHO_N "(cached) $ECHO_C" >&6
9860 else
9861
9862 cf_cv_ncurses_header=none
9863 for cf_header in \
9864         ncurses.h ncurses/ncurses.h \
9865         curses.h ncurses/curses.h
9866 do
9867 cat >"conftest.$ac_ext" <<_ACEOF
9868 #line 9868 "configure"
9869 #include "confdefs.h"
9870 #include <${cf_header}>
9871 int
9872 main (void)
9873 {
9874 initscr(); tgoto("?", 0,0)
9875   ;
9876   return 0;
9877 }
9878 _ACEOF
9879 rm -f "conftest.$ac_objext"
9880 if { (eval echo "$as_me:9880: \"$ac_compile\"") >&5
9881   (eval $ac_compile) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit "$ac_status"); } &&
9885          { ac_try='test -s "conftest.$ac_objext"'
9886   { (eval echo "$as_me:9886: \"$ac_try\"") >&5
9887   (eval $ac_try) 2>&5
9888   ac_status=$?
9889   echo "$as_me:9889: \$? = $ac_status" >&5
9890   (exit "$ac_status"); }; }; then
9891   cf_cv_ncurses_header=$cf_header; break
9892 else
9893   echo "$as_me: failed program was:" >&5
9894 cat "conftest.$ac_ext" >&5
9895 fi
9896 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9897 done
9898
9899 fi
9900 echo "$as_me:9900: result: $cf_cv_ncurses_header" >&5
9901 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9902
9903 if test "$cf_cv_ncurses_header" = none ; then
9904         { { echo "$as_me:9904: error: No curses header-files found" >&5
9905 echo "$as_me: error: No curses header-files found" >&2;}
9906    { (exit 1); exit 1; }; }
9907 fi
9908
9909 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9910
9911 for ac_header in $cf_cv_ncurses_header
9912 do
9913 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9914 echo "$as_me:9914: checking for $ac_header" >&5
9915 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9916 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9917   echo $ECHO_N "(cached) $ECHO_C" >&6
9918 else
9919   cat >"conftest.$ac_ext" <<_ACEOF
9920 #line 9920 "configure"
9921 #include "confdefs.h"
9922 #include <$ac_header>
9923 _ACEOF
9924 if { (eval echo "$as_me:9924: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9925   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9926   ac_status=$?
9927   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9928   rm -f conftest.er1
9929   cat conftest.err >&5
9930   echo "$as_me:9930: \$? = $ac_status" >&5
9931   (exit "$ac_status"); } >/dev/null; then
9932   if test -s conftest.err; then
9933     ac_cpp_err=$ac_c_preproc_warn_flag
9934   else
9935     ac_cpp_err=
9936   fi
9937 else
9938   ac_cpp_err=yes
9939 fi
9940 if test -z "$ac_cpp_err"; then
9941   eval "$as_ac_Header=yes"
9942 else
9943   echo "$as_me: failed program was:" >&5
9944   cat "conftest.$ac_ext" >&5
9945   eval "$as_ac_Header=no"
9946 fi
9947 rm -f conftest.err "conftest.$ac_ext"
9948 fi
9949 echo "$as_me:9949: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9950 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9951 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9952   cat >>confdefs.h <<EOF
9953 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9954 EOF
9955
9956 fi
9957 done
9958
9959 cat >>confdefs.h <<\EOF
9960 #define NCURSES 1
9961 EOF
9962
9963 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9964
9965                 cat >>confdefs.h <<EOF
9966 #define $cf_nculib_ROOT 1
9967 EOF
9968
9969                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9970
9971         else
9972
9973 cf_ncuhdr_root=ncurses
9974
9975 test -n "$cf_cv_curses_dir" && \
9976 test "$cf_cv_curses_dir" != "no" && { \
9977
9978 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9979   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9980   do
9981         while test "$cf_add_incdir" != /usr/include
9982         do
9983           if test -d "$cf_add_incdir"
9984           then
9985                 cf_have_incdir=no
9986                 if test -n "$CFLAGS$CPPFLAGS" ; then
9987                   # a loop is needed to ensure we can add subdirs of existing dirs
9988                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9989                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9990                           cf_have_incdir=yes; break
9991                         fi
9992                   done
9993                 fi
9994
9995                 if test "$cf_have_incdir" = no ; then
9996                   if test "$cf_add_incdir" = /usr/local/include ; then
9997                         if test "$GCC" = yes
9998                         then
9999                           cf_save_CPPFLAGS=$CPPFLAGS
10000
10001         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10002         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10003
10004                           cat >"conftest.$ac_ext" <<_ACEOF
10005 #line 10005 "configure"
10006 #include "confdefs.h"
10007 #include <stdio.h>
10008 int
10009 main (void)
10010 {
10011 printf("Hello")
10012   ;
10013   return 0;
10014 }
10015 _ACEOF
10016 rm -f "conftest.$ac_objext"
10017 if { (eval echo "$as_me:10017: \"$ac_compile\"") >&5
10018   (eval $ac_compile) 2>&5
10019   ac_status=$?
10020   echo "$as_me:10020: \$? = $ac_status" >&5
10021   (exit "$ac_status"); } &&
10022          { ac_try='test -s "conftest.$ac_objext"'
10023   { (eval echo "$as_me:10023: \"$ac_try\"") >&5
10024   (eval $ac_try) 2>&5
10025   ac_status=$?
10026   echo "$as_me:10026: \$? = $ac_status" >&5
10027   (exit "$ac_status"); }; }; then
10028   :
10029 else
10030   echo "$as_me: failed program was:" >&5
10031 cat "conftest.$ac_ext" >&5
10032 cf_have_incdir=yes
10033 fi
10034 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10035                           CPPFLAGS=$cf_save_CPPFLAGS
10036                         fi
10037                   fi
10038                 fi
10039
10040                 if test "$cf_have_incdir" = no ; then
10041                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10042
10043 echo "${as_me:-configure}:10043: testing adding $cf_add_incdir to include-path ..." 1>&5
10044
10045                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10046
10047                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10048                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10049                   cf_add_incdir="$cf_top_incdir"
10050                 else
10051                   break
10052                 fi
10053           else
10054                 break
10055           fi
10056         done
10057   done
10058 fi
10059
10060 }
10061
10062 echo "$as_me:10062: checking for $cf_ncuhdr_root header in include-path" >&5
10063 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10064 if test "${cf_cv_ncurses_h+set}" = set; then
10065   echo $ECHO_N "(cached) $ECHO_C" >&6
10066 else
10067
10068         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10069         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10070         for cf_header in $cf_header_list
10071         do
10072
10073         cat >"conftest.$ac_ext" <<_ACEOF
10074 #line 10074 "configure"
10075 #include "confdefs.h"
10076
10077 #include <$cf_header>
10078 int
10079 main (void)
10080 {
10081
10082 #ifdef NCURSES_VERSION
10083
10084 printf("%s\\n", NCURSES_VERSION);
10085 #else
10086 #ifdef __NCURSES_H
10087 printf("old\\n");
10088 #else
10089         make an error
10090 #endif
10091 #endif
10092
10093   ;
10094   return 0;
10095 }
10096 _ACEOF
10097 rm -f "conftest.$ac_objext"
10098 if { (eval echo "$as_me:10098: \"$ac_compile\"") >&5
10099   (eval $ac_compile) 2>&5
10100   ac_status=$?
10101   echo "$as_me:10101: \$? = $ac_status" >&5
10102   (exit "$ac_status"); } &&
10103          { ac_try='test -s "conftest.$ac_objext"'
10104   { (eval echo "$as_me:10104: \"$ac_try\"") >&5
10105   (eval $ac_try) 2>&5
10106   ac_status=$?
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit "$ac_status"); }; }; then
10109   cf_cv_ncurses_h=$cf_header
10110
10111 else
10112   echo "$as_me: failed program was:" >&5
10113 cat "conftest.$ac_ext" >&5
10114 cf_cv_ncurses_h=no
10115 fi
10116 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10117
10118                 test "$cf_cv_ncurses_h" != no && break
10119         done
10120
10121 fi
10122 echo "$as_me:10122: result: $cf_cv_ncurses_h" >&5
10123 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10124
10125 if test "$cf_cv_ncurses_h" != no ; then
10126         cf_cv_ncurses_header=$cf_cv_ncurses_h
10127 else
10128
10129 echo "$as_me:10129: checking for $cf_ncuhdr_root include-path" >&5
10130 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10131 if test "${cf_cv_ncurses_h2+set}" = set; then
10132   echo $ECHO_N "(cached) $ECHO_C" >&6
10133 else
10134
10135         test -n "$verbose" && echo
10136
10137 cf_search=
10138
10139 # collect the current set of include-directories from compiler flags
10140 cf_header_path_list=""
10141 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10142         for cf_header_path in $CPPFLAGS $CFLAGS
10143         do
10144                 case "$cf_header_path" in
10145                 (-I*)
10146                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10147
10148 test "x$cf_header_path" != "xNONE" && \
10149 test -d "$cf_header_path" && \
10150  {
10151         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10152         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10153         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10154         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10155         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10156         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"
10157 }
10158
10159                         cf_header_path_list="$cf_header_path_list $cf_search"
10160                         ;;
10161                 esac
10162         done
10163 fi
10164
10165 # add the variations for the package we are looking for
10166
10167 cf_search=
10168
10169 test "x$prefix" != "xNONE" && \
10170 test -d "$prefix" && \
10171  {
10172         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10173         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10174         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10175         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10176         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10177         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10178 }
10179
10180 for cf_subdir_prefix in \
10181         /usr \
10182         /usr/local \
10183         /usr/pkg \
10184         /opt \
10185         /opt/local \
10186         $HOME
10187 do
10188
10189 test "x$cf_subdir_prefix" != "x$prefix" && \
10190 test -d "$cf_subdir_prefix" && \
10191 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10192         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10193         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10194         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10195         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10196         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10197         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"
10198 }
10199
10200 done
10201
10202 test "$includedir" != NONE && \
10203 test "$includedir" != "/usr/include" && \
10204 test -d "$includedir" && {
10205         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10206         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10207 }
10208
10209 test "$oldincludedir" != NONE && \
10210 test "$oldincludedir" != "/usr/include" && \
10211 test -d "$oldincludedir" && {
10212         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10213         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10214 }
10215
10216 cf_search="$cf_search $cf_header_path_list"
10217
10218         test -n "$verbose" && echo "search path $cf_search"
10219         cf_save2_CPPFLAGS="$CPPFLAGS"
10220         for cf_incdir in $cf_search
10221         do
10222
10223 if test -n "$cf_incdir" ; then
10224   for cf_add_incdir in $cf_incdir
10225   do
10226         while test "$cf_add_incdir" != /usr/include
10227         do
10228           if test -d "$cf_add_incdir"
10229           then
10230                 cf_have_incdir=no
10231                 if test -n "$CFLAGS$CPPFLAGS" ; then
10232                   # a loop is needed to ensure we can add subdirs of existing dirs
10233                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10234                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10235                           cf_have_incdir=yes; break
10236                         fi
10237                   done
10238                 fi
10239
10240                 if test "$cf_have_incdir" = no ; then
10241                   if test "$cf_add_incdir" = /usr/local/include ; then
10242                         if test "$GCC" = yes
10243                         then
10244                           cf_save_CPPFLAGS=$CPPFLAGS
10245
10246         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10247         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10248
10249                           cat >"conftest.$ac_ext" <<_ACEOF
10250 #line 10250 "configure"
10251 #include "confdefs.h"
10252 #include <stdio.h>
10253 int
10254 main (void)
10255 {
10256 printf("Hello")
10257   ;
10258   return 0;
10259 }
10260 _ACEOF
10261 rm -f "conftest.$ac_objext"
10262 if { (eval echo "$as_me:10262: \"$ac_compile\"") >&5
10263   (eval $ac_compile) 2>&5
10264   ac_status=$?
10265   echo "$as_me:10265: \$? = $ac_status" >&5
10266   (exit "$ac_status"); } &&
10267          { ac_try='test -s "conftest.$ac_objext"'
10268   { (eval echo "$as_me:10268: \"$ac_try\"") >&5
10269   (eval $ac_try) 2>&5
10270   ac_status=$?
10271   echo "$as_me:10271: \$? = $ac_status" >&5
10272   (exit "$ac_status"); }; }; then
10273   :
10274 else
10275   echo "$as_me: failed program was:" >&5
10276 cat "conftest.$ac_ext" >&5
10277 cf_have_incdir=yes
10278 fi
10279 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10280                           CPPFLAGS=$cf_save_CPPFLAGS
10281                         fi
10282                   fi
10283                 fi
10284
10285                 if test "$cf_have_incdir" = no ; then
10286                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10287
10288 echo "${as_me:-configure}:10288: testing adding $cf_add_incdir to include-path ..." 1>&5
10289
10290                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10291
10292                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10293                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10294                   cf_add_incdir="$cf_top_incdir"
10295                 else
10296                   break
10297                 fi
10298           else
10299                 break
10300           fi
10301         done
10302   done
10303 fi
10304
10305                 for cf_header in \
10306                         ncurses.h \
10307                         curses.h
10308                 do
10309
10310         cat >"conftest.$ac_ext" <<_ACEOF
10311 #line 10311 "configure"
10312 #include "confdefs.h"
10313
10314 #include <$cf_header>
10315 int
10316 main (void)
10317 {
10318
10319 #ifdef NCURSES_VERSION
10320
10321 printf("%s\\n", NCURSES_VERSION);
10322 #else
10323 #ifdef __NCURSES_H
10324 printf("old\\n");
10325 #else
10326         make an error
10327 #endif
10328 #endif
10329
10330   ;
10331   return 0;
10332 }
10333 _ACEOF
10334 rm -f "conftest.$ac_objext"
10335 if { (eval echo "$as_me:10335: \"$ac_compile\"") >&5
10336   (eval $ac_compile) 2>&5
10337   ac_status=$?
10338   echo "$as_me:10338: \$? = $ac_status" >&5
10339   (exit "$ac_status"); } &&
10340          { ac_try='test -s "conftest.$ac_objext"'
10341   { (eval echo "$as_me:10341: \"$ac_try\"") >&5
10342   (eval $ac_try) 2>&5
10343   ac_status=$?
10344   echo "$as_me:10344: \$? = $ac_status" >&5
10345   (exit "$ac_status"); }; }; then
10346   cf_cv_ncurses_h2=$cf_header
10347
10348 else
10349   echo "$as_me: failed program was:" >&5
10350 cat "conftest.$ac_ext" >&5
10351 cf_cv_ncurses_h2=no
10352 fi
10353 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10354
10355                         if test "$cf_cv_ncurses_h2" != no ; then
10356                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10357                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10358                                 break
10359                         fi
10360                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10361                 done
10362                 CPPFLAGS="$cf_save2_CPPFLAGS"
10363                 test "$cf_cv_ncurses_h2" != no && break
10364         done
10365         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10365: error: not found" >&5
10366 echo "$as_me: error: not found" >&2;}
10367    { (exit 1); exit 1; }; }
10368
10369 fi
10370 echo "$as_me:10370: result: $cf_cv_ncurses_h2" >&5
10371 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10372
10373         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10374         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10375         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10376                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10377         fi
10378
10379 if test -n "$cf_1st_incdir" ; then
10380   for cf_add_incdir in $cf_1st_incdir
10381   do
10382         while test "$cf_add_incdir" != /usr/include
10383         do
10384           if test -d "$cf_add_incdir"
10385           then
10386                 cf_have_incdir=no
10387                 if test -n "$CFLAGS$CPPFLAGS" ; then
10388                   # a loop is needed to ensure we can add subdirs of existing dirs
10389                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10390                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10391                           cf_have_incdir=yes; break
10392                         fi
10393                   done
10394                 fi
10395
10396                 if test "$cf_have_incdir" = no ; then
10397                   if test "$cf_add_incdir" = /usr/local/include ; then
10398                         if test "$GCC" = yes
10399                         then
10400                           cf_save_CPPFLAGS=$CPPFLAGS
10401
10402         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10403         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10404
10405                           cat >"conftest.$ac_ext" <<_ACEOF
10406 #line 10406 "configure"
10407 #include "confdefs.h"
10408 #include <stdio.h>
10409 int
10410 main (void)
10411 {
10412 printf("Hello")
10413   ;
10414   return 0;
10415 }
10416 _ACEOF
10417 rm -f "conftest.$ac_objext"
10418 if { (eval echo "$as_me:10418: \"$ac_compile\"") >&5
10419   (eval $ac_compile) 2>&5
10420   ac_status=$?
10421   echo "$as_me:10421: \$? = $ac_status" >&5
10422   (exit "$ac_status"); } &&
10423          { ac_try='test -s "conftest.$ac_objext"'
10424   { (eval echo "$as_me:10424: \"$ac_try\"") >&5
10425   (eval $ac_try) 2>&5
10426   ac_status=$?
10427   echo "$as_me:10427: \$? = $ac_status" >&5
10428   (exit "$ac_status"); }; }; then
10429   :
10430 else
10431   echo "$as_me: failed program was:" >&5
10432 cat "conftest.$ac_ext" >&5
10433 cf_have_incdir=yes
10434 fi
10435 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10436                           CPPFLAGS=$cf_save_CPPFLAGS
10437                         fi
10438                   fi
10439                 fi
10440
10441                 if test "$cf_have_incdir" = no ; then
10442                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10443
10444 echo "${as_me:-configure}:10444: testing adding $cf_add_incdir to include-path ..." 1>&5
10445
10446                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10447
10448                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10449                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10450                   cf_add_incdir="$cf_top_incdir"
10451                 else
10452                   break
10453                 fi
10454           else
10455                 break
10456           fi
10457         done
10458   done
10459 fi
10460
10461 fi
10462
10463 # Set definitions to allow ifdef'ing for ncurses.h
10464
10465 case "$cf_cv_ncurses_header" in
10466 (*ncurses.h)
10467
10468 cat >>confdefs.h <<\EOF
10469 #define HAVE_NCURSES_H 1
10470 EOF
10471
10472         ;;
10473 esac
10474
10475 case "$cf_cv_ncurses_header" in
10476 (ncurses/curses.h|ncurses/ncurses.h)
10477
10478 cat >>confdefs.h <<\EOF
10479 #define HAVE_NCURSES_NCURSES_H 1
10480 EOF
10481
10482         ;;
10483 (ncursesw/curses.h|ncursesw/ncurses.h)
10484
10485 cat >>confdefs.h <<\EOF
10486 #define HAVE_NCURSESW_NCURSES_H 1
10487 EOF
10488
10489         ;;
10490 esac
10491
10492 echo "$as_me:10492: checking for terminfo header" >&5
10493 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10494 if test "${cf_cv_term_header+set}" = set; then
10495   echo $ECHO_N "(cached) $ECHO_C" >&6
10496 else
10497
10498 case "${cf_cv_ncurses_header}" in
10499 (*/ncurses.h|*/ncursesw.h)
10500         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10501         ;;
10502 (*)
10503         cf_term_header=term.h
10504         ;;
10505 esac
10506
10507 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10508 do
10509 cat >"conftest.$ac_ext" <<_ACEOF
10510 #line 10510 "configure"
10511 #include "confdefs.h"
10512 #include <stdio.h>
10513 #include <${cf_cv_ncurses_header:-curses.h}>
10514 #include <$cf_test>
10515
10516 int
10517 main (void)
10518 {
10519 int x = auto_left_margin; (void)x
10520   ;
10521   return 0;
10522 }
10523 _ACEOF
10524 rm -f "conftest.$ac_objext"
10525 if { (eval echo "$as_me:10525: \"$ac_compile\"") >&5
10526   (eval $ac_compile) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit "$ac_status"); } &&
10530          { ac_try='test -s "conftest.$ac_objext"'
10531   { (eval echo "$as_me:10531: \"$ac_try\"") >&5
10532   (eval $ac_try) 2>&5
10533   ac_status=$?
10534   echo "$as_me:10534: \$? = $ac_status" >&5
10535   (exit "$ac_status"); }; }; then
10536
10537         cf_cv_term_header="$cf_test"
10538 else
10539   echo "$as_me: failed program was:" >&5
10540 cat "conftest.$ac_ext" >&5
10541
10542         cf_cv_term_header=unknown
10543
10544 fi
10545 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10546         test "$cf_cv_term_header" != unknown && break
10547 done
10548
10549 fi
10550 echo "$as_me:10550: result: $cf_cv_term_header" >&5
10551 echo "${ECHO_T}$cf_cv_term_header" >&6
10552
10553 # Set definitions to allow ifdef'ing to accommodate subdirectories
10554
10555 case "$cf_cv_term_header" in
10556 (*term.h)
10557
10558 cat >>confdefs.h <<\EOF
10559 #define HAVE_TERM_H 1
10560 EOF
10561
10562         ;;
10563 esac
10564
10565 case "$cf_cv_term_header" in
10566 (ncurses/term.h)
10567
10568 cat >>confdefs.h <<\EOF
10569 #define HAVE_NCURSES_TERM_H 1
10570 EOF
10571
10572         ;;
10573 (ncursesw/term.h)
10574
10575 cat >>confdefs.h <<\EOF
10576 #define HAVE_NCURSESW_TERM_H 1
10577 EOF
10578
10579         ;;
10580 esac
10581
10582 # some applications need this, but should check for NCURSES_VERSION
10583
10584 cat >>confdefs.h <<\EOF
10585 #define NCURSES 1
10586 EOF
10587
10588 echo "$as_me:10588: checking for ncurses version" >&5
10589 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10590 if test "${cf_cv_ncurses_version+set}" = set; then
10591   echo $ECHO_N "(cached) $ECHO_C" >&6
10592 else
10593
10594         cf_cv_ncurses_version=no
10595         cf_tempfile=out$$
10596         rm -f "$cf_tempfile"
10597         if test "$cross_compiling" = yes; then
10598
10599         # This will not work if the preprocessor splits the line after the
10600         # Autoconf token.  The 'unproto' program does that.
10601         cat > "conftest.$ac_ext" <<EOF
10602 #include <${cf_cv_ncurses_header:-curses.h}>
10603 #undef Autoconf
10604 #ifdef NCURSES_VERSION
10605 Autoconf NCURSES_VERSION
10606 #else
10607 #ifdef __NCURSES_H
10608 Autoconf "old"
10609 #endif
10610 ;
10611 #endif
10612 EOF
10613         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10614         { (eval echo "$as_me:10614: \"$cf_try\"") >&5
10615   (eval $cf_try) 2>&5
10616   ac_status=$?
10617   echo "$as_me:10617: \$? = $ac_status" >&5
10618   (exit "$ac_status"); }
10619         if test -f conftest.out ; then
10620                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10621                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10622                 rm -f conftest.out
10623         fi
10624
10625 else
10626   cat >"conftest.$ac_ext" <<_ACEOF
10627 #line 10627 "configure"
10628 #include "confdefs.h"
10629
10630 #include <${cf_cv_ncurses_header:-curses.h}>
10631 #include <stdio.h>
10632 int main(void)
10633 {
10634         FILE *fp = fopen("$cf_tempfile", "w");
10635 #ifdef NCURSES_VERSION
10636 # ifdef NCURSES_VERSION_PATCH
10637         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10638 # else
10639         fprintf(fp, "%s\\n", NCURSES_VERSION);
10640 # endif
10641 #else
10642 # ifdef __NCURSES_H
10643         fprintf(fp, "old\\n");
10644 # else
10645         make an error
10646 # endif
10647 #endif
10648         ${cf_cv_main_return:-return}(0);
10649 }
10650 _ACEOF
10651 rm -f "conftest$ac_exeext"
10652 if { (eval echo "$as_me:10652: \"$ac_link\"") >&5
10653   (eval $ac_link) 2>&5
10654   ac_status=$?
10655   echo "$as_me:10655: \$? = $ac_status" >&5
10656   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10657   { (eval echo "$as_me:10657: \"$ac_try\"") >&5
10658   (eval $ac_try) 2>&5
10659   ac_status=$?
10660   echo "$as_me:10660: \$? = $ac_status" >&5
10661   (exit "$ac_status"); }; }; then
10662
10663         cf_cv_ncurses_version=`cat $cf_tempfile`
10664 else
10665   echo "$as_me: program exited with status $ac_status" >&5
10666 echo "$as_me: failed program was:" >&5
10667 cat "conftest.$ac_ext" >&5
10668 fi
10669 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10670 fi
10671         rm -f "$cf_tempfile"
10672
10673 fi
10674 echo "$as_me:10674: result: $cf_cv_ncurses_version" >&5
10675 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10676 test "$cf_cv_ncurses_version" = no ||
10677 cat >>confdefs.h <<\EOF
10678 #define NCURSES 1
10679 EOF
10680
10681 cf_nculib_root=ncurses
10682         # This works, except for the special case where we find gpm, but
10683         # ncurses is in a nonstandard location via $LIBS, and we really want
10684         # to link gpm.
10685 cf_ncurses_LIBS=""
10686 cf_ncurses_SAVE="$LIBS"
10687 echo "$as_me:10687: checking for Gpm_Open in -lgpm" >&5
10688 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10689 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10690   echo $ECHO_N "(cached) $ECHO_C" >&6
10691 else
10692   ac_check_lib_save_LIBS=$LIBS
10693 LIBS="-lgpm  $LIBS"
10694 cat >"conftest.$ac_ext" <<_ACEOF
10695 #line 10695 "configure"
10696 #include "confdefs.h"
10697
10698 /* Override any gcc2 internal prototype to avoid an error.  */
10699 #ifdef __cplusplus
10700 extern "C"
10701 #endif
10702 /* We use char because int might match the return type of a gcc2
10703    builtin and then its argument prototype would still apply.  */
10704 char Gpm_Open ();
10705 int
10706 main (void)
10707 {
10708 Gpm_Open ();
10709   ;
10710   return 0;
10711 }
10712 _ACEOF
10713 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10714 if { (eval echo "$as_me:10714: \"$ac_link\"") >&5
10715   (eval $ac_link) 2>&5
10716   ac_status=$?
10717   echo "$as_me:10717: \$? = $ac_status" >&5
10718   (exit "$ac_status"); } &&
10719          { ac_try='test -s "conftest$ac_exeext"'
10720   { (eval echo "$as_me:10720: \"$ac_try\"") >&5
10721   (eval $ac_try) 2>&5
10722   ac_status=$?
10723   echo "$as_me:10723: \$? = $ac_status" >&5
10724   (exit "$ac_status"); }; }; then
10725   ac_cv_lib_gpm_Gpm_Open=yes
10726 else
10727   echo "$as_me: failed program was:" >&5
10728 cat "conftest.$ac_ext" >&5
10729 ac_cv_lib_gpm_Gpm_Open=no
10730 fi
10731 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10732 LIBS=$ac_check_lib_save_LIBS
10733 fi
10734 echo "$as_me:10734: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10735 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10736 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10737   echo "$as_me:10737: checking for initscr in -lgpm" >&5
10738 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10739 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10740   echo $ECHO_N "(cached) $ECHO_C" >&6
10741 else
10742   ac_check_lib_save_LIBS=$LIBS
10743 LIBS="-lgpm  $LIBS"
10744 cat >"conftest.$ac_ext" <<_ACEOF
10745 #line 10745 "configure"
10746 #include "confdefs.h"
10747
10748 /* Override any gcc2 internal prototype to avoid an error.  */
10749 #ifdef __cplusplus
10750 extern "C"
10751 #endif
10752 /* We use char because int might match the return type of a gcc2
10753    builtin and then its argument prototype would still apply.  */
10754 char initscr ();
10755 int
10756 main (void)
10757 {
10758 initscr ();
10759   ;
10760   return 0;
10761 }
10762 _ACEOF
10763 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10764 if { (eval echo "$as_me:10764: \"$ac_link\"") >&5
10765   (eval $ac_link) 2>&5
10766   ac_status=$?
10767   echo "$as_me:10767: \$? = $ac_status" >&5
10768   (exit "$ac_status"); } &&
10769          { ac_try='test -s "conftest$ac_exeext"'
10770   { (eval echo "$as_me:10770: \"$ac_try\"") >&5
10771   (eval $ac_try) 2>&5
10772   ac_status=$?
10773   echo "$as_me:10773: \$? = $ac_status" >&5
10774   (exit "$ac_status"); }; }; then
10775   ac_cv_lib_gpm_initscr=yes
10776 else
10777   echo "$as_me: failed program was:" >&5
10778 cat "conftest.$ac_ext" >&5
10779 ac_cv_lib_gpm_initscr=no
10780 fi
10781 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10782 LIBS=$ac_check_lib_save_LIBS
10783 fi
10784 echo "$as_me:10784: result: $ac_cv_lib_gpm_initscr" >&5
10785 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10786 if test "$ac_cv_lib_gpm_initscr" = yes; then
10787   LIBS="$cf_ncurses_SAVE"
10788 else
10789   cf_ncurses_LIBS="-lgpm"
10790 fi
10791
10792 fi
10793
10794 case "$host_os" in
10795 (freebsd*)
10796         # This is only necessary if you are linking against an obsolete
10797         # version of ncurses (but it should do no harm, since it's static).
10798         if test "$cf_nculib_root" = ncurses ; then
10799                 echo "$as_me:10799: checking for tgoto in -lmytinfo" >&5
10800 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10801 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10802   echo $ECHO_N "(cached) $ECHO_C" >&6
10803 else
10804   ac_check_lib_save_LIBS=$LIBS
10805 LIBS="-lmytinfo  $LIBS"
10806 cat >"conftest.$ac_ext" <<_ACEOF
10807 #line 10807 "configure"
10808 #include "confdefs.h"
10809
10810 /* Override any gcc2 internal prototype to avoid an error.  */
10811 #ifdef __cplusplus
10812 extern "C"
10813 #endif
10814 /* We use char because int might match the return type of a gcc2
10815    builtin and then its argument prototype would still apply.  */
10816 char tgoto ();
10817 int
10818 main (void)
10819 {
10820 tgoto ();
10821   ;
10822   return 0;
10823 }
10824 _ACEOF
10825 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10826 if { (eval echo "$as_me:10826: \"$ac_link\"") >&5
10827   (eval $ac_link) 2>&5
10828   ac_status=$?
10829   echo "$as_me:10829: \$? = $ac_status" >&5
10830   (exit "$ac_status"); } &&
10831          { ac_try='test -s "conftest$ac_exeext"'
10832   { (eval echo "$as_me:10832: \"$ac_try\"") >&5
10833   (eval $ac_try) 2>&5
10834   ac_status=$?
10835   echo "$as_me:10835: \$? = $ac_status" >&5
10836   (exit "$ac_status"); }; }; then
10837   ac_cv_lib_mytinfo_tgoto=yes
10838 else
10839   echo "$as_me: failed program was:" >&5
10840 cat "conftest.$ac_ext" >&5
10841 ac_cv_lib_mytinfo_tgoto=no
10842 fi
10843 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10844 LIBS=$ac_check_lib_save_LIBS
10845 fi
10846 echo "$as_me:10846: result: $ac_cv_lib_mytinfo_tgoto" >&5
10847 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10848 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
10849   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10850 fi
10851
10852         fi
10853         ;;
10854 esac
10855
10856 cf_add_libs="$LIBS"
10857 # reverse order
10858 cf_add_0lib=
10859 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10860 # filter duplicates
10861 for cf_add_1lib in $cf_add_0lib; do
10862         for cf_add_2lib in $cf_add_libs; do
10863                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10864                         cf_add_1lib=
10865                         break
10866                 fi
10867         done
10868         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10869 done
10870 LIBS="$cf_add_libs"
10871
10872 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
10873 then
10874
10875 cf_add_libs="$LIBS"
10876 # reverse order
10877 cf_add_0lib=
10878 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10879 # filter duplicates
10880 for cf_add_1lib in $cf_add_0lib; do
10881         for cf_add_2lib in $cf_add_libs; do
10882                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10883                         cf_add_1lib=
10884                         break
10885                 fi
10886         done
10887         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10888 done
10889 LIBS="$cf_add_libs"
10890
10891 else
10892
10893         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10894         cf_libdir=""
10895         echo "$as_me:10895: checking for initscr" >&5
10896 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10897 if test "${ac_cv_func_initscr+set}" = set; then
10898   echo $ECHO_N "(cached) $ECHO_C" >&6
10899 else
10900   cat >"conftest.$ac_ext" <<_ACEOF
10901 #line 10901 "configure"
10902 #include "confdefs.h"
10903 #define initscr autoconf_temporary
10904 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10905 #undef initscr
10906
10907 #ifdef __cplusplus
10908 extern "C"
10909 #endif
10910
10911 /* We use char because int might match the return type of a gcc2
10912    builtin and then its argument prototype would still apply.  */
10913 char initscr (void);
10914
10915 int
10916 main (void)
10917 {
10918
10919 /* The GNU C library defines stubs for functions which it implements
10920     to always fail with ENOSYS.  Some functions are actually named
10921     something starting with __ and the normal name is an alias.  */
10922 #if defined (__stub_initscr) || defined (__stub___initscr)
10923 #error found stub for initscr
10924 #endif
10925
10926         return initscr ();
10927   ;
10928   return 0;
10929 }
10930 _ACEOF
10931 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10932 if { (eval echo "$as_me:10932: \"$ac_link\"") >&5
10933   (eval $ac_link) 2>&5
10934   ac_status=$?
10935   echo "$as_me:10935: \$? = $ac_status" >&5
10936   (exit "$ac_status"); } &&
10937          { ac_try='test -s "conftest$ac_exeext"'
10938   { (eval echo "$as_me:10938: \"$ac_try\"") >&5
10939   (eval $ac_try) 2>&5
10940   ac_status=$?
10941   echo "$as_me:10941: \$? = $ac_status" >&5
10942   (exit "$ac_status"); }; }; then
10943   ac_cv_func_initscr=yes
10944 else
10945   echo "$as_me: failed program was:" >&5
10946 cat "conftest.$ac_ext" >&5
10947 ac_cv_func_initscr=no
10948 fi
10949 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10950 fi
10951 echo "$as_me:10951: result: $ac_cv_func_initscr" >&5
10952 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10953 if test "$ac_cv_func_initscr" = yes; then
10954   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10955 else
10956
10957                 cf_save_LIBS="$LIBS"
10958                 echo "$as_me:10958: checking for initscr in -l$cf_nculib_root" >&5
10959 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10960                 LIBS="-l$cf_nculib_root $LIBS"
10961                 cat >"conftest.$ac_ext" <<_ACEOF
10962 #line 10962 "configure"
10963 #include "confdefs.h"
10964 #include <${cf_cv_ncurses_header:-curses.h}>
10965 int
10966 main (void)
10967 {
10968 initscr()
10969   ;
10970   return 0;
10971 }
10972 _ACEOF
10973 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10974 if { (eval echo "$as_me:10974: \"$ac_link\"") >&5
10975   (eval $ac_link) 2>&5
10976   ac_status=$?
10977   echo "$as_me:10977: \$? = $ac_status" >&5
10978   (exit "$ac_status"); } &&
10979          { ac_try='test -s "conftest$ac_exeext"'
10980   { (eval echo "$as_me:10980: \"$ac_try\"") >&5
10981   (eval $ac_try) 2>&5
10982   ac_status=$?
10983   echo "$as_me:10983: \$? = $ac_status" >&5
10984   (exit "$ac_status"); }; }; then
10985   echo "$as_me:10985: result: yes" >&5
10986 echo "${ECHO_T}yes" >&6
10987                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10988
10989 else
10990   echo "$as_me: failed program was:" >&5
10991 cat "conftest.$ac_ext" >&5
10992 echo "$as_me:10992: result: no" >&5
10993 echo "${ECHO_T}no" >&6
10994
10995 cf_search=
10996 cf_library_path_list=""
10997 if test -n "${LDFLAGS}${LIBS}" ; then
10998         for cf_library_path in $LDFLAGS $LIBS
10999         do
11000                 case "$cf_library_path" in
11001                 (-L*)
11002                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11003
11004 test "x$cf_library_path" != "xNONE" && \
11005 test -d "$cf_library_path" && \
11006  {
11007         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11008         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11009         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11010         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11011         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11012         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"
11013 }
11014
11015                         cf_library_path_list="$cf_library_path_list $cf_search"
11016                         ;;
11017                 esac
11018         done
11019 fi
11020
11021 cf_search=
11022
11023 test "x$prefix" != "xNONE" && \
11024 test -d "$prefix" && \
11025  {
11026         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11027         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11028         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11029         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11030         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11031         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11032 }
11033
11034 for cf_subdir_prefix in \
11035         /usr \
11036         /usr/local \
11037         /usr/pkg \
11038         /opt \
11039         /opt/local \
11040         $HOME
11041 do
11042
11043 test "x$cf_subdir_prefix" != "x$prefix" && \
11044 test -d "$cf_subdir_prefix" && \
11045 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11046         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11047         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11048         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11049         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11050         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11051         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"
11052 }
11053
11054 done
11055
11056 cf_search="$cf_library_path_list $cf_search"
11057
11058                         for cf_libdir in $cf_search
11059                         do
11060                                 echo "$as_me:11060: checking for -l$cf_nculib_root in $cf_libdir" >&5
11061 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11062                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11063                                 cat >"conftest.$ac_ext" <<_ACEOF
11064 #line 11064 "configure"
11065 #include "confdefs.h"
11066 #include <${cf_cv_ncurses_header:-curses.h}>
11067 int
11068 main (void)
11069 {
11070 initscr()
11071   ;
11072   return 0;
11073 }
11074 _ACEOF
11075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11076 if { (eval echo "$as_me:11076: \"$ac_link\"") >&5
11077   (eval $ac_link) 2>&5
11078   ac_status=$?
11079   echo "$as_me:11079: \$? = $ac_status" >&5
11080   (exit "$ac_status"); } &&
11081          { ac_try='test -s "conftest$ac_exeext"'
11082   { (eval echo "$as_me:11082: \"$ac_try\"") >&5
11083   (eval $ac_try) 2>&5
11084   ac_status=$?
11085   echo "$as_me:11085: \$? = $ac_status" >&5
11086   (exit "$ac_status"); }; }; then
11087   echo "$as_me:11087: result: yes" >&5
11088 echo "${ECHO_T}yes" >&6
11089                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11090                                          break
11091 else
11092   echo "$as_me: failed program was:" >&5
11093 cat "conftest.$ac_ext" >&5
11094 echo "$as_me:11094: result: no" >&5
11095 echo "${ECHO_T}no" >&6
11096                                          LIBS="$cf_save_LIBS"
11097 fi
11098 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11099                         done
11100
11101 fi
11102 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11103
11104 fi
11105
11106 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11107
11108 if test "$cf_found_library" = no ; then
11109         { { echo "$as_me:11109: error: Cannot link $cf_nculib_root library" >&5
11110 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11111    { (exit 1); exit 1; }; }
11112 fi
11113
11114 fi
11115
11116 if test -n "$cf_ncurses_LIBS" ; then
11117         echo "$as_me:11117: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11118 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11119         cf_ncurses_SAVE="$LIBS"
11120         for p in $cf_ncurses_LIBS ; do
11121                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11122                 if test "$q" != "$LIBS" ; then
11123                         LIBS="$q"
11124                 fi
11125         done
11126         cat >"conftest.$ac_ext" <<_ACEOF
11127 #line 11127 "configure"
11128 #include "confdefs.h"
11129 #include <${cf_cv_ncurses_header:-curses.h}>
11130 int
11131 main (void)
11132 {
11133 initscr(); mousemask(0,0); tigetstr((char *)0);
11134   ;
11135   return 0;
11136 }
11137 _ACEOF
11138 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11139 if { (eval echo "$as_me:11139: \"$ac_link\"") >&5
11140   (eval $ac_link) 2>&5
11141   ac_status=$?
11142   echo "$as_me:11142: \$? = $ac_status" >&5
11143   (exit "$ac_status"); } &&
11144          { ac_try='test -s "conftest$ac_exeext"'
11145   { (eval echo "$as_me:11145: \"$ac_try\"") >&5
11146   (eval $ac_try) 2>&5
11147   ac_status=$?
11148   echo "$as_me:11148: \$? = $ac_status" >&5
11149   (exit "$ac_status"); }; }; then
11150   echo "$as_me:11150: result: yes" >&5
11151 echo "${ECHO_T}yes" >&6
11152 else
11153   echo "$as_me: failed program was:" >&5
11154 cat "conftest.$ac_ext" >&5
11155 echo "$as_me:11155: result: no" >&5
11156 echo "${ECHO_T}no" >&6
11157                  LIBS="$cf_ncurses_SAVE"
11158 fi
11159 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11160 fi
11161
11162 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11163
11164 cat >>confdefs.h <<EOF
11165 #define $cf_nculib_ROOT 1
11166 EOF
11167
11168         fi
11169 else
11170         NCURSES_CONFIG=none
11171 fi
11172
11173 fi
11174
11175 if test "$NCURSES_CONFIG_PKG" != none ; then
11176         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11177
11178         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11179         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11180         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11181
11182         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11183         if test -z "$cf_cv_abi_version"
11184         then
11185                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11186         fi
11187
11188 elif test "$NCURSES_CONFIG" != none ; then
11189
11190         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11191
11192         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11193         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11194         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11195
11196         # ABI version is not available from headers
11197         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11198
11199 else
11200
11201         for cf_name in MAJOR MINOR PATCH
11202         do
11203         cat >conftest.$ac_ext <<CF_EOF
11204         #include <${cf_cv_ncurses_header:-curses.h}>
11205         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11206 CF_EOF
11207                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11208                 { (eval echo "$as_me:11208: \"$cf_try\"") >&5
11209   (eval $cf_try) 2>&5
11210   ac_status=$?
11211   echo "$as_me:11211: \$? = $ac_status" >&5
11212   (exit "$ac_status"); }
11213                 if test -f conftest.out ; then
11214                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11215                         eval NCURSES_$cf_name=\"$cf_result\"
11216                         # cat conftest.$ac_ext
11217                         # cat conftest.out
11218                 fi
11219         done
11220
11221         cf_cv_abi_version=${NCURSES_MAJOR}
11222
11223 fi
11224
11225 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11226
11227 cf_cv_timestamp=`date`
11228
11229 echo "$as_me:11229: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11230 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11231
11232 echo "$as_me:11232: checking if you want to have a library-prefix" >&5
11233 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11234
11235 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11236 if test "${with_lib_prefix+set}" = set; then
11237   withval="$with_lib_prefix"
11238   with_lib_prefix=$withval
11239 else
11240   with_lib_prefix=auto
11241 fi;
11242 echo "$as_me:11242: result: $with_lib_prefix" >&5
11243 echo "${ECHO_T}$with_lib_prefix" >&6
11244
11245 if test "$with_lib_prefix" = auto
11246 then
11247
11248         case "$cf_cv_system_name" in
11249         (OS/2*|os2*)
11250                 if test "$DFT_LWR_MODEL" = libtool; then
11251                         LIB_PREFIX='lib'
11252                 else
11253                         LIB_PREFIX=''
11254                 fi
11255                 ;;
11256         (*-msvc*)
11257                 LIB_PREFIX=''
11258                 ;;
11259         (*)     LIB_PREFIX='lib'
11260                 ;;
11261         esac
11262 cf_prefix=$LIB_PREFIX
11263
11264 elif test "$with_lib_prefix" = no
11265 then
11266         LIB_PREFIX=
11267 else
11268         LIB_PREFIX=$with_lib_prefix
11269 fi
11270
11271 LIB_SUFFIX=
11272
11273 ###############################################################################
11274
11275 if test X"$CC_G_OPT" = X"" ; then
11276         CC_G_OPT='-g'
11277         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11278 fi
11279
11280 echo "$as_me:11280: checking for default loader flags" >&5
11281 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11282 case $DFT_LWR_MODEL in
11283 (normal)  LD_MODEL=''   ;;
11284 (debug)   LD_MODEL=$CC_G_OPT ;;
11285 (profile) LD_MODEL='-pg';;
11286 (shared)  LD_MODEL=''   ;;
11287 esac
11288 echo "$as_me:11288: result: $LD_MODEL" >&5
11289 echo "${ECHO_T}$LD_MODEL" >&6
11290
11291 LD_RPATH_OPT=
11292 if test "x$cf_cv_enable_rpath" != xno
11293 then
11294         echo "$as_me:11294: checking for an rpath option" >&5
11295 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11296         case "$cf_cv_system_name" in
11297         (irix*)
11298                 if test "$GCC" = yes; then
11299                         LD_RPATH_OPT="-Wl,-rpath,"
11300                 else
11301                         LD_RPATH_OPT="-rpath "
11302                 fi
11303                 ;;
11304         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11305                 LD_RPATH_OPT="-Wl,-rpath,"
11306                 ;;
11307         (openbsd[2-9].*|mirbsd*)
11308                 LD_RPATH_OPT="-Wl,-rpath,"
11309                 ;;
11310         (dragonfly*)
11311                 LD_RPATH_OPT="-rpath "
11312                 ;;
11313         (netbsd*)
11314                 LD_RPATH_OPT="-Wl,-rpath,"
11315                 ;;
11316         (osf*|mls+*)
11317                 LD_RPATH_OPT="-rpath "
11318                 ;;
11319         (solaris2*)
11320                 LD_RPATH_OPT="-R"
11321                 ;;
11322         (*)
11323                 ;;
11324         esac
11325         echo "$as_me:11325: result: $LD_RPATH_OPT" >&5
11326 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11327
11328         case "x$LD_RPATH_OPT" in
11329         (x-R*)
11330                 echo "$as_me:11330: checking if we need a space after rpath option" >&5
11331 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11332                 cf_save_LIBS="$LIBS"
11333
11334 cf_add_libs="$LIBS"
11335 # reverse order
11336 cf_add_0lib=
11337 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11338 # filter duplicates
11339 for cf_add_1lib in $cf_add_0lib; do
11340         for cf_add_2lib in $cf_add_libs; do
11341                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11342                         cf_add_1lib=
11343                         break
11344                 fi
11345         done
11346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11347 done
11348 LIBS="$cf_add_libs"
11349
11350                 cat >"conftest.$ac_ext" <<_ACEOF
11351 #line 11351 "configure"
11352 #include "confdefs.h"
11353
11354 int
11355 main (void)
11356 {
11357
11358   ;
11359   return 0;
11360 }
11361 _ACEOF
11362 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11363 if { (eval echo "$as_me:11363: \"$ac_link\"") >&5
11364   (eval $ac_link) 2>&5
11365   ac_status=$?
11366   echo "$as_me:11366: \$? = $ac_status" >&5
11367   (exit "$ac_status"); } &&
11368          { ac_try='test -s "conftest$ac_exeext"'
11369   { (eval echo "$as_me:11369: \"$ac_try\"") >&5
11370   (eval $ac_try) 2>&5
11371   ac_status=$?
11372   echo "$as_me:11372: \$? = $ac_status" >&5
11373   (exit "$ac_status"); }; }; then
11374   cf_rpath_space=no
11375 else
11376   echo "$as_me: failed program was:" >&5
11377 cat "conftest.$ac_ext" >&5
11378 cf_rpath_space=yes
11379 fi
11380 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11381                 LIBS="$cf_save_LIBS"
11382                 echo "$as_me:11382: result: $cf_rpath_space" >&5
11383 echo "${ECHO_T}$cf_rpath_space" >&6
11384                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11385                 ;;
11386         esac
11387 fi
11388
11389         RM_SHARED_OPTS=
11390         LOCAL_LDFLAGS=
11391         LOCAL_LDFLAGS2=
11392         LD_SHARED_OPTS=
11393         INSTALL_LIB="-m 644"
11394         : ${rel_builddir:=.}
11395
11396         shlibdir=$libdir
11397
11398         MAKE_DLLS="#"
11399
11400         cf_cv_do_symlinks=no
11401         cf_ld_rpath_opt=
11402         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11403
11404         echo "$as_me:11404: checking if release/abi version should be used for shared libs" >&5
11405 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11406
11407 # Check whether --with-shlib-version or --without-shlib-version was given.
11408 if test "${with_shlib_version+set}" = set; then
11409   withval="$with_shlib_version"
11410   test -z "$withval" && withval=auto
11411         case "$withval" in
11412         (yes)
11413                 cf_cv_shlib_version=auto
11414                 ;;
11415         (rel|abi|auto)
11416                 cf_cv_shlib_version=$withval
11417                 ;;
11418         (*)
11419                 echo "$as_me:11419: result: $withval" >&5
11420 echo "${ECHO_T}$withval" >&6
11421                 { { echo "$as_me:11421: error: option value must be one of: rel, abi, or auto" >&5
11422 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11423    { (exit 1); exit 1; }; }
11424                 ;;
11425         esac
11426
11427 else
11428   cf_cv_shlib_version=auto
11429 fi;
11430         echo "$as_me:11430: result: $cf_cv_shlib_version" >&5
11431 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11432
11433         cf_cv_rm_so_locs=no
11434         cf_try_cflags=
11435
11436         # Some less-capable ports of gcc support only -fpic
11437         CC_SHARED_OPTS=
11438
11439         cf_try_fPIC=no
11440         if test "$GCC" = yes
11441         then
11442                 cf_try_fPIC=yes
11443         else
11444                 case "$cf_cv_system_name" in
11445                 (*linux*)       # e.g., PGI compiler
11446                         cf_try_fPIC=yes
11447                         ;;
11448                 esac
11449         fi
11450
11451         if test "$cf_try_fPIC" = yes
11452         then
11453                 echo "$as_me:11453: checking which $CC option to use" >&5
11454 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11455                 cf_save_CFLAGS="$CFLAGS"
11456                 for CC_SHARED_OPTS in -fPIC -fpic ''
11457                 do
11458                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11459                         cat >"conftest.$ac_ext" <<_ACEOF
11460 #line 11460 "configure"
11461 #include "confdefs.h"
11462 #include <stdio.h>
11463 int
11464 main (void)
11465 {
11466 int x = 1
11467   ;
11468   return 0;
11469 }
11470 _ACEOF
11471 rm -f "conftest.$ac_objext"
11472 if { (eval echo "$as_me:11472: \"$ac_compile\"") >&5
11473   (eval $ac_compile) 2>&5
11474   ac_status=$?
11475   echo "$as_me:11475: \$? = $ac_status" >&5
11476   (exit "$ac_status"); } &&
11477          { ac_try='test -s "conftest.$ac_objext"'
11478   { (eval echo "$as_me:11478: \"$ac_try\"") >&5
11479   (eval $ac_try) 2>&5
11480   ac_status=$?
11481   echo "$as_me:11481: \$? = $ac_status" >&5
11482   (exit "$ac_status"); }; }; then
11483   break
11484 else
11485   echo "$as_me: failed program was:" >&5
11486 cat "conftest.$ac_ext" >&5
11487 fi
11488 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11489                 done
11490                 echo "$as_me:11490: result: $CC_SHARED_OPTS" >&5
11491 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11492                 CFLAGS="$cf_save_CFLAGS"
11493         fi
11494
11495         cf_cv_shlib_version_infix=no
11496
11497         case "$cf_cv_system_name" in
11498         (aix4.3-9*|aix[5-7]*)
11499                 if test "$GCC" = yes; then
11500                         CC_SHARED_OPTS='-Wl,-brtl'
11501                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11502                 else
11503                         CC_SHARED_OPTS='-brtl'
11504                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11505                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11506                 fi
11507                 ;;
11508         (beos*)
11509                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11510                 ;;
11511         (cygwin*)
11512                 CC_SHARED_OPTS=
11513                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11514                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11515                 cf_cv_shlib_version=cygdll
11516                 cf_cv_shlib_version_infix=cygdll
11517                 shlibdir=$bindir
11518                 MAKE_DLLS=
11519                 cat >mk_shared_lib.sh <<-CF_EOF
11520                 #!$SHELL
11521                 SHARED_LIB=\$1
11522                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11523                 shift
11524                 cat <<-EOF
11525                 Linking shared library
11526                 ** SHARED_LIB \$SHARED_LIB
11527                 ** IMPORT_LIB \$IMPORT_LIB
11528 EOF
11529                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11530 CF_EOF
11531                 chmod +x mk_shared_lib.sh
11532                 ;;
11533         (msys*)
11534                 CC_SHARED_OPTS=
11535                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11536                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11537                 cf_cv_shlib_version=msysdll
11538                 cf_cv_shlib_version_infix=msysdll
11539                 shlibdir=$bindir
11540                 MAKE_DLLS=
11541                 cat >mk_shared_lib.sh <<-CF_EOF
11542                 #!$SHELL
11543                 SHARED_LIB=\$1
11544                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11545                 shift
11546                 cat <<-EOF
11547                 Linking shared library
11548                 ** SHARED_LIB \$SHARED_LIB
11549                 ** IMPORT_LIB \$IMPORT_LIB
11550 EOF
11551                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11552 CF_EOF
11553                 chmod +x mk_shared_lib.sh
11554                 ;;
11555         (darwin*)
11556                 cf_try_cflags="no-cpp-precomp"
11557                 CC_SHARED_OPTS="-dynamic"
11558                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11559                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11560                 cf_cv_shlib_version_infix=yes
11561                 echo "$as_me:11561: checking if ld -search_paths_first works" >&5
11562 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11563 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11564   echo $ECHO_N "(cached) $ECHO_C" >&6
11565 else
11566
11567                         cf_save_LDFLAGS=$LDFLAGS
11568                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11569                         cat >"conftest.$ac_ext" <<_ACEOF
11570 #line 11570 "configure"
11571 #include "confdefs.h"
11572
11573 int
11574 main (void)
11575 {
11576 int i;
11577   ;
11578   return 0;
11579 }
11580 _ACEOF
11581 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11582 if { (eval echo "$as_me:11582: \"$ac_link\"") >&5
11583   (eval $ac_link) 2>&5
11584   ac_status=$?
11585   echo "$as_me:11585: \$? = $ac_status" >&5
11586   (exit "$ac_status"); } &&
11587          { ac_try='test -s "conftest$ac_exeext"'
11588   { (eval echo "$as_me:11588: \"$ac_try\"") >&5
11589   (eval $ac_try) 2>&5
11590   ac_status=$?
11591   echo "$as_me:11591: \$? = $ac_status" >&5
11592   (exit "$ac_status"); }; }; then
11593   cf_cv_ldflags_search_paths_first=yes
11594 else
11595   echo "$as_me: failed program was:" >&5
11596 cat "conftest.$ac_ext" >&5
11597 cf_cv_ldflags_search_paths_first=no
11598 fi
11599 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11600                                 LDFLAGS=$cf_save_LDFLAGS
11601 fi
11602 echo "$as_me:11602: result: $cf_cv_ldflags_search_paths_first" >&5
11603 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11604                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11605                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11606                 fi
11607                 ;;
11608         (haiku*)
11609
11610         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11611         if test "$cf_cv_shlib_version" = rel; then
11612                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11613         else
11614                 cf_cv_shared_soname='`basename $@`'
11615         fi
11616
11617                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11618                 ;;
11619         (hpux[7-8]*)
11620                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11621                 if test "$GCC" != yes; then
11622                         CC_SHARED_OPTS='+Z'
11623                 fi
11624                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11625                 INSTALL_LIB="-m 555"
11626                 ;;
11627         (hpux*)
11628                 # (tested with gcc 2.7.2 -- I don't have c89)
11629                 if test "$GCC" = yes; then
11630                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11631                 else
11632                         CC_SHARED_OPTS='+Z'
11633                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11634                 fi
11635                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11636                 # HP-UX shared libraries must be executable, and should be
11637                 # readonly to exploit a quirk in the memory manager.
11638                 INSTALL_LIB="-m 555"
11639                 ;;
11640         (interix*)
11641                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11642                 if test "$cf_cv_shlib_version" = rel; then
11643                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11644                 else
11645                         cf_shared_soname='`basename $@`'
11646                 fi
11647                 CC_SHARED_OPTS=
11648                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11649                 ;;
11650         (irix*)
11651                 if test "$cf_cv_enable_rpath" = yes ; then
11652                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11653                 fi
11654                 # tested with IRIX 5.2 and 'cc'.
11655                 if test "$GCC" != yes; then
11656                         CC_SHARED_OPTS='-KPIC'
11657                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11658                 else
11659                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11660                 fi
11661                 cf_cv_rm_so_locs=yes
11662                 ;;
11663         (linux*|gnu*|k*bsd*-gnu)
11664                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11665                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11666                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11667                 fi
11668                 if test "$cf_cv_enable_rpath" = yes ; then
11669                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11670                 fi
11671
11672         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11673         if test "$cf_cv_shlib_version" = rel; then
11674                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11675         else
11676                 cf_cv_shared_soname='`basename $@`'
11677         fi
11678
11679                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11680                 ;;
11681         (mingw*msvc*)
11682                 cf_cv_shlib_version=msvcdll
11683                 cf_cv_shlib_version_infix=msvcdll
11684                 shlibdir=$bindir
11685                 MAKE_DLLS=
11686                 if test "$DFT_LWR_MODEL" = "shared" ; then
11687                         LOCAL_LDFLAGS="-link -dll"
11688                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11689                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11690                 fi
11691                 CC_SHARED_OPTS=
11692                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11693                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11694                 cat >mk_shared_lib.sh <<-CF_EOF
11695                 #!$SHELL
11696                 SHARED_LIB=\$1
11697                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11698                 shift
11699                 my_ld=\$1
11700                 shift
11701                 cat <<-EOF
11702                 Linking shared library
11703                 ** SHARED LIB \$SHARED_LIB
11704                 ** IMPORT_LIB \$IMPORT_LIB
11705 EOF
11706                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11707                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11708                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11709 CF_EOF
11710                 chmod +x mk_shared_lib.sh
11711                 cat >mk_prog.sh <<-CF_EOF
11712                 #!$SHELL
11713                 shift
11714                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11715                 LD="$LD"
11716                 clopts=()
11717                 ldopts=("/subsystem:console")
11718                 libs=()
11719                 isdll=0
11720                 while test \$# -gt 0; do
11721                         case "\$1" in
11722                                 -link)
11723                                         # ignore -link argument
11724                                         ;;
11725                                 -M[TD] | -M[TD]d)
11726                                         # ignore runtime-library option
11727                                         ;;
11728                                 -dll)
11729                                         isdll=1
11730                                         ;;
11731                                 -W* | -w*)
11732                                         # ignore warnings
11733                                         ;;
11734                                 -D*)
11735                                         clopts+=("\$1")
11736                                         ;;
11737                                 -I*)
11738                                         clopts+=("\$1")
11739                                         ;;
11740                                 -l*)
11741                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11742                                         ;;
11743                                 -L*)
11744                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11745                                         ;;
11746                                 *.obj | *.o)
11747                                         ldopts+=("\$1")
11748                                         ;;
11749                                 -Wl,*)
11750                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11751                                                 ldopts+=("\${linkarg}")
11752                                         done
11753                                         ;;
11754                                 *.lib)
11755                                         ldopts+=("\$1")
11756                                         ;;
11757                                 -o)
11758                                         shift
11759                                         ldopts+=("-out:\$1")
11760                                         ;;
11761                                 *)
11762                                         clopts+=("\$1")
11763                                         ldopts+=("\$1")
11764                                         ;;
11765                         esac
11766                         shift
11767                 done
11768                 if [ "\$isdll" -ne 0 ]; then
11769                         for lib in \${libs[*]}; do
11770                                 ldopts+=("\$lib.dll.lib")
11771                         done
11772                 else
11773                         for lib in \${libs[*]}; do
11774                                 ldopts+=("\$lib.lib")
11775                         done
11776                 fi
11777                 cat <<-EOF
11778                 Creating program
11779                 ** ld options:   "\${ldopts[@]}"
11780 EOF
11781                 exec \$LD \${ldopts[@]}
11782 CF_EOF
11783                 chmod +x mk_prog.sh
11784                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11785                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11786                 ;;
11787         (mingw*)
11788                 cf_cv_shlib_version=mingw
11789                 cf_cv_shlib_version_infix=mingw
11790                 shlibdir=$bindir
11791                 MAKE_DLLS=
11792                 if test "$DFT_LWR_MODEL" = "shared" ; then
11793                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11794                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11795                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11796                 fi
11797                 CC_SHARED_OPTS=
11798                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11799                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11800                 cat >mk_shared_lib.sh <<-CF_EOF
11801                 #!$SHELL
11802                 SHARED_LIB=\$1
11803                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11804                 shift
11805                 cat <<-EOF
11806                 Linking shared library
11807                 ** SHARED_LIB \$SHARED_LIB
11808                 ** IMPORT_LIB \$IMPORT_LIB
11809 EOF
11810                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11811 CF_EOF
11812                 chmod +x mk_shared_lib.sh
11813                 ;;
11814         (openbsd[2-9].*|mirbsd*)
11815                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11816                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11817                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11818                 fi
11819                 if test "$cf_cv_enable_rpath" = yes ; then
11820                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11821                 fi
11822                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11823
11824         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11825         if test "$cf_cv_shlib_version" = rel; then
11826                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11827         else
11828                 cf_cv_shared_soname='`basename $@`'
11829         fi
11830
11831                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11832                 ;;
11833         (nskJ*)
11834                 CC_SHARED_OPTS=
11835                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11836                 ;;
11837         (nskL*)
11838                 CC_SHARED_OPTS=
11839                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11840                 ;;
11841         (nto-qnx*|openbsd*|freebsd[12].*)
11842                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11843                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11844                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11845                 ;;
11846         (dragonfly*|freebsd*)
11847                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11848                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11849                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11850                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11851                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11852                 fi
11853
11854         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11855         if test "$cf_cv_shlib_version" = rel; then
11856                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11857         else
11858                 cf_cv_shared_soname='`basename $@`'
11859         fi
11860
11861                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11862                 ;;
11863         (netbsd*)
11864                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11865                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11866                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11867                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11868                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11869                         if test "$cf_cv_shlib_version" = auto; then
11870                         if test -f /usr/libexec/ld.elf_so; then
11871                                 cf_cv_shlib_version=abi
11872                         else
11873                                 cf_cv_shlib_version=rel
11874                         fi
11875                         fi
11876
11877         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11878         if test "$cf_cv_shlib_version" = rel; then
11879                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11880         else
11881                 cf_cv_shared_soname='`basename $@`'
11882         fi
11883
11884                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11885                 else
11886                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11887                 fi
11888                 ;;
11889         (osf*|mls+*)
11890                 # tested with OSF/1 V3.2 and 'cc'
11891                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11892                 # link with shared libs).
11893                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11894                 case "$host_os" in
11895                 (osf4*)
11896                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11897                         ;;
11898                 esac
11899                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11900                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11901                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11902                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11903                 fi
11904                 cf_cv_rm_so_locs=yes
11905                 ;;
11906         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11907                 # tested with osr5.0.5
11908                 if test "$GCC" != yes; then
11909                         CC_SHARED_OPTS='-belf -KPIC'
11910                 fi
11911                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11912                 if test "$cf_cv_enable_rpath" = yes ; then
11913                         # only way is to set LD_RUN_PATH but no switch for it
11914                         RUN_PATH=$libdir
11915                 fi
11916                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11917                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11918                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11919                 ;;
11920         (sunos4*)
11921                 # tested with SunOS 4.1.1 and gcc 2.7.0
11922                 if test "$GCC" != yes; then
11923                         CC_SHARED_OPTS='-KPIC'
11924                 fi
11925                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11926                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11927                 ;;
11928         (solaris2*)
11929                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11930                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11931                 if test "$DFT_LWR_MODEL" = "shared" ; then
11932                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11933                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11934                 fi
11935                 if test "$cf_cv_enable_rpath" = yes ; then
11936                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11937                 fi
11938
11939         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11940         if test "$cf_cv_shlib_version" = rel; then
11941                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11942         else
11943                 cf_cv_shared_soname='`basename $@`'
11944         fi
11945
11946                 if test "$GCC" != yes; then
11947                         cf_save_CFLAGS="$CFLAGS"
11948                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11949                         do
11950                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11951                                 cat >"conftest.$ac_ext" <<_ACEOF
11952 #line 11952 "configure"
11953 #include "confdefs.h"
11954 #include <stdio.h>
11955 int
11956 main (void)
11957 {
11958 printf("Hello\\n");
11959   ;
11960   return 0;
11961 }
11962 _ACEOF
11963 rm -f "conftest.$ac_objext"
11964 if { (eval echo "$as_me:11964: \"$ac_compile\"") >&5
11965   (eval $ac_compile) 2>&5
11966   ac_status=$?
11967   echo "$as_me:11967: \$? = $ac_status" >&5
11968   (exit "$ac_status"); } &&
11969          { ac_try='test -s "conftest.$ac_objext"'
11970   { (eval echo "$as_me:11970: \"$ac_try\"") >&5
11971   (eval $ac_try) 2>&5
11972   ac_status=$?
11973   echo "$as_me:11973: \$? = $ac_status" >&5
11974   (exit "$ac_status"); }; }; then
11975   break
11976 else
11977   echo "$as_me: failed program was:" >&5
11978 cat "conftest.$ac_ext" >&5
11979 fi
11980 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11981                         done
11982                         CFLAGS="$cf_save_CFLAGS"
11983                         CC_SHARED_OPTS=$cf_shared_opts
11984                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11985                 else
11986                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11987                 fi
11988                 ;;
11989         (sysv5uw7*|unix_sv*)
11990                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11991                 if test "$GCC" != yes; then
11992                         CC_SHARED_OPTS='-KPIC'
11993                 fi
11994                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11995                 ;;
11996         (*)
11997                 CC_SHARED_OPTS='unknown'
11998                 MK_SHARED_LIB='echo unknown'
11999                 ;;
12000         esac
12001
12002         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12003         case "$cf_cv_shlib_version" in
12004         (rel|abi)
12005                 case "$MK_SHARED_LIB" in
12006                 (*'-o $@')
12007                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12008                         ;;
12009                 (*)
12010                         { echo "$as_me:12010: WARNING: ignored --with-shlib-version" >&5
12011 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12012                         ;;
12013                 esac
12014                 ;;
12015         esac
12016
12017         if test -n "$cf_try_cflags"
12018         then
12019 cat > conftest.$ac_ext <<EOF
12020 #line 12020 "${as_me:-configure}"
12021 #include <stdio.h>
12022 int main(int argc, char *argv[])
12023 {
12024         printf("hello\\n");
12025         return (argv[argc-1] == 0) ;
12026 }
12027 EOF
12028                 cf_save_CFLAGS="$CFLAGS"
12029                 for cf_opt in $cf_try_cflags
12030                 do
12031                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12032                         echo "$as_me:12032: checking if CFLAGS option -$cf_opt works" >&5
12033 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12034                         if { (eval echo "$as_me:12034: \"$ac_compile\"") >&5
12035   (eval $ac_compile) 2>&5
12036   ac_status=$?
12037   echo "$as_me:12037: \$? = $ac_status" >&5
12038   (exit "$ac_status"); }; then
12039                                 echo "$as_me:12039: result: yes" >&5
12040 echo "${ECHO_T}yes" >&6
12041                                 cf_save_CFLAGS="$CFLAGS"
12042                         else
12043                                 echo "$as_me:12043: result: no" >&5
12044 echo "${ECHO_T}no" >&6
12045                         fi
12046                 done
12047                 CFLAGS="$cf_save_CFLAGS"
12048         fi
12049
12050         # RPATH_LIST is a colon-separated list of directories
12051         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12052         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12053
12054         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12055
12056         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12057
12058 echo "${as_me:-configure}:12058: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12059
12060         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12061
12062 echo "${as_me:-configure}:12062: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12063
12064 # The test/sample programs in the original tree link using rpath option.
12065 # Make it optional for packagers.
12066 if test -n "$LOCAL_LDFLAGS"
12067 then
12068         echo "$as_me:12068: checking if you want to link sample programs with rpath option" >&5
12069 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12070
12071 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12072 if test "${enable_rpath_link+set}" = set; then
12073   enableval="$enable_rpath_link"
12074   with_rpath_link=$enableval
12075 else
12076   with_rpath_link=yes
12077 fi;
12078         echo "$as_me:12078: result: $with_rpath_link" >&5
12079 echo "${ECHO_T}$with_rpath_link" >&6
12080         if test "$with_rpath_link" = no
12081         then
12082                 LOCAL_LDFLAGS=
12083                 LOCAL_LDFLAGS2=
12084         fi
12085 fi
12086
12087 ###############################################################################
12088
12089 ###   use option --enable-broken-linker to force on use of broken-linker support
12090
12091 echo "$as_me:12091: checking if you want broken-linker support code" >&5
12092 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12093
12094 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12095 if test "${enable_broken_linker+set}" = set; then
12096   enableval="$enable_broken_linker"
12097   with_broken_linker=$enableval
12098 else
12099   with_broken_linker=no
12100 fi;
12101 echo "$as_me:12101: result: $with_broken_linker" >&5
12102 echo "${ECHO_T}$with_broken_linker" >&6
12103
12104 : "${BROKEN_LINKER:=0}"
12105 if test "x$with_broken_linker" = xyes ; then
12106
12107 cat >>confdefs.h <<\EOF
12108 #define BROKEN_LINKER 1
12109 EOF
12110
12111         BROKEN_LINKER=1
12112 fi
12113
12114 # Check to define _XOPEN_SOURCE "automatically"
12115
12116 echo "$as_me:12116: checking if the POSIX test-macros are already defined" >&5
12117 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12118 if test "${cf_cv_posix_visible+set}" = set; then
12119   echo $ECHO_N "(cached) $ECHO_C" >&6
12120 else
12121
12122 cat >"conftest.$ac_ext" <<_ACEOF
12123 #line 12123 "configure"
12124 #include "confdefs.h"
12125 #include <stdio.h>
12126 int
12127 main (void)
12128 {
12129
12130 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12131         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12132         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12133         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12134 #error conflicting symbols found
12135 #endif
12136
12137   ;
12138   return 0;
12139 }
12140 _ACEOF
12141 rm -f "conftest.$ac_objext"
12142 if { (eval echo "$as_me:12142: \"$ac_compile\"") >&5
12143   (eval $ac_compile) 2>&5
12144   ac_status=$?
12145   echo "$as_me:12145: \$? = $ac_status" >&5
12146   (exit "$ac_status"); } &&
12147          { ac_try='test -s "conftest.$ac_objext"'
12148   { (eval echo "$as_me:12148: \"$ac_try\"") >&5
12149   (eval $ac_try) 2>&5
12150   ac_status=$?
12151   echo "$as_me:12151: \$? = $ac_status" >&5
12152   (exit "$ac_status"); }; }; then
12153   cf_cv_posix_visible=no
12154 else
12155   echo "$as_me: failed program was:" >&5
12156 cat "conftest.$ac_ext" >&5
12157 cf_cv_posix_visible=yes
12158 fi
12159 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12160
12161 fi
12162 echo "$as_me:12162: result: $cf_cv_posix_visible" >&5
12163 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12164
12165 if test "$cf_cv_posix_visible" = no; then
12166
12167 cf_XOPEN_SOURCE=600
12168 cf_POSIX_C_SOURCE=199506L
12169 cf_xopen_source=
12170
12171 case "$host_os" in
12172 (aix[4-7]*)
12173         cf_xopen_source="-D_ALL_SOURCE"
12174         ;;
12175 (msys)
12176         cf_XOPEN_SOURCE=600
12177         ;;
12178 (darwin[0-8].*)
12179         cf_xopen_source="-D_APPLE_C_SOURCE"
12180         ;;
12181 (darwin*)
12182         cf_xopen_source="-D_DARWIN_C_SOURCE"
12183         cf_XOPEN_SOURCE=
12184         ;;
12185 (freebsd*|dragonfly*|midnightbsd*)
12186         # 5.x headers associate
12187         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12188         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12189         cf_POSIX_C_SOURCE=200112L
12190         cf_XOPEN_SOURCE=600
12191         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12192         ;;
12193 (hpux11*)
12194         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12195         ;;
12196 (hpux*)
12197         cf_xopen_source="-D_HPUX_SOURCE"
12198         ;;
12199 (irix[56].*)
12200         cf_xopen_source="-D_SGI_SOURCE"
12201         cf_XOPEN_SOURCE=
12202         ;;
12203 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12204
12205 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12206
12207 echo "$as_me:12207: checking if this is the GNU C library" >&5
12208 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12209 if test "${cf_cv_gnu_library+set}" = set; then
12210   echo $ECHO_N "(cached) $ECHO_C" >&6
12211 else
12212
12213 cat >"conftest.$ac_ext" <<_ACEOF
12214 #line 12214 "configure"
12215 #include "confdefs.h"
12216 #include <sys/types.h>
12217 int
12218 main (void)
12219 {
12220
12221         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12222                 return 0;
12223         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12224                 return 0;
12225         #else
12226         #       error not GNU C library
12227         #endif
12228   ;
12229   return 0;
12230 }
12231 _ACEOF
12232 rm -f "conftest.$ac_objext"
12233 if { (eval echo "$as_me:12233: \"$ac_compile\"") >&5
12234   (eval $ac_compile) 2>&5
12235   ac_status=$?
12236   echo "$as_me:12236: \$? = $ac_status" >&5
12237   (exit "$ac_status"); } &&
12238          { ac_try='test -s "conftest.$ac_objext"'
12239   { (eval echo "$as_me:12239: \"$ac_try\"") >&5
12240   (eval $ac_try) 2>&5
12241   ac_status=$?
12242   echo "$as_me:12242: \$? = $ac_status" >&5
12243   (exit "$ac_status"); }; }; then
12244   cf_cv_gnu_library=yes
12245 else
12246   echo "$as_me: failed program was:" >&5
12247 cat "conftest.$ac_ext" >&5
12248 cf_cv_gnu_library=no
12249 fi
12250 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12251
12252 fi
12253 echo "$as_me:12253: result: $cf_cv_gnu_library" >&5
12254 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12255
12256 if test x$cf_cv_gnu_library = xyes; then
12257
12258         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12259         # was changed to help a little.  newlib incorporated the change about 4
12260         # years later.
12261         echo "$as_me:12261: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12262 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12263 if test "${cf_cv_gnu_library_219+set}" = set; then
12264   echo $ECHO_N "(cached) $ECHO_C" >&6
12265 else
12266
12267                 cf_save="$CPPFLAGS"
12268
12269         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12270         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12271
12272                 cat >"conftest.$ac_ext" <<_ACEOF
12273 #line 12273 "configure"
12274 #include "confdefs.h"
12275 #include <sys/types.h>
12276 int
12277 main (void)
12278 {
12279
12280                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12281                                 return 0;
12282                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12283                                 return 0;
12284                         #else
12285                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12286                         #endif
12287   ;
12288   return 0;
12289 }
12290 _ACEOF
12291 rm -f "conftest.$ac_objext"
12292 if { (eval echo "$as_me:12292: \"$ac_compile\"") >&5
12293   (eval $ac_compile) 2>&5
12294   ac_status=$?
12295   echo "$as_me:12295: \$? = $ac_status" >&5
12296   (exit "$ac_status"); } &&
12297          { ac_try='test -s "conftest.$ac_objext"'
12298   { (eval echo "$as_me:12298: \"$ac_try\"") >&5
12299   (eval $ac_try) 2>&5
12300   ac_status=$?
12301   echo "$as_me:12301: \$? = $ac_status" >&5
12302   (exit "$ac_status"); }; }; then
12303   cf_cv_gnu_library_219=yes
12304 else
12305   echo "$as_me: failed program was:" >&5
12306 cat "conftest.$ac_ext" >&5
12307 cf_cv_gnu_library_219=no
12308 fi
12309 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12310                 CPPFLAGS="$cf_save"
12311
12312 fi
12313 echo "$as_me:12313: result: $cf_cv_gnu_library_219" >&5
12314 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12315
12316         if test "x$cf_cv_gnu_library_219" = xyes; then
12317                 cf_save="$CPPFLAGS"
12318                 echo "$as_me:12318: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12319 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12320 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12321   echo $ECHO_N "(cached) $ECHO_C" >&6
12322 else
12323
12324 cf_fix_cppflags=no
12325 cf_new_cflags=
12326 cf_new_cppflags=
12327 cf_new_extra_cppflags=
12328
12329 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12330 do
12331 case "$cf_fix_cppflags" in
12332 (no)
12333         case "$cf_add_cflags" in
12334         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12335                 case "$cf_add_cflags" in
12336                 (-D*)
12337                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12338
12339                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12340                                 && test -z "${cf_tst_cflags}" \
12341                                 && cf_fix_cppflags=yes
12342
12343                         if test "$cf_fix_cppflags" = yes ; then
12344
12345         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12346         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12347
12348                                 continue
12349                         elif test "${cf_tst_cflags}" = "\"'" ; then
12350
12351         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12352         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12353
12354                                 continue
12355                         fi
12356                         ;;
12357                 esac
12358                 case "$CPPFLAGS" in
12359                 (*$cf_add_cflags)
12360                         ;;
12361                 (*)
12362                         case "$cf_add_cflags" in
12363                         (-D*)
12364                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12365
12366 CPPFLAGS=`echo "$CPPFLAGS" | \
12367         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12368                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12369
12370                                 ;;
12371                         esac
12372
12373         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12374         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12375
12376                         ;;
12377                 esac
12378                 ;;
12379         (*)
12380
12381         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12382         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12383
12384                 ;;
12385         esac
12386         ;;
12387 (yes)
12388
12389         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12390         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12391
12392         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12393
12394         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12395                 && test -z "${cf_tst_cflags}" \
12396                 && cf_fix_cppflags=no
12397         ;;
12398 esac
12399 done
12400
12401 if test -n "$cf_new_cflags" ; then
12402
12403         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12404         CFLAGS="${CFLAGS}$cf_new_cflags"
12405
12406 fi
12407
12408 if test -n "$cf_new_cppflags" ; then
12409
12410         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12411         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12412
12413 fi
12414
12415 if test -n "$cf_new_extra_cppflags" ; then
12416
12417         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12418         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12419
12420 fi
12421
12422                         cat >"conftest.$ac_ext" <<_ACEOF
12423 #line 12423 "configure"
12424 #include "confdefs.h"
12425
12426                                 #include <limits.h>
12427                                 #include <sys/types.h>
12428
12429 int
12430 main (void)
12431 {
12432
12433                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12434                                         return 0;
12435                                 #else
12436                                 #       error GNU C library is too old
12437                                 #endif
12438   ;
12439   return 0;
12440 }
12441 _ACEOF
12442 rm -f "conftest.$ac_objext"
12443 if { (eval echo "$as_me:12443: \"$ac_compile\"") >&5
12444   (eval $ac_compile) 2>&5
12445   ac_status=$?
12446   echo "$as_me:12446: \$? = $ac_status" >&5
12447   (exit "$ac_status"); } &&
12448          { ac_try='test -s "conftest.$ac_objext"'
12449   { (eval echo "$as_me:12449: \"$ac_try\"") >&5
12450   (eval $ac_try) 2>&5
12451   ac_status=$?
12452   echo "$as_me:12452: \$? = $ac_status" >&5
12453   (exit "$ac_status"); }; }; then
12454   cf_cv_gnu_dftsrc_219=yes
12455 else
12456   echo "$as_me: failed program was:" >&5
12457 cat "conftest.$ac_ext" >&5
12458 cf_cv_gnu_dftsrc_219=no
12459 fi
12460 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12461
12462 fi
12463 echo "$as_me:12463: result: $cf_cv_gnu_dftsrc_219" >&5
12464 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12465                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12466         else
12467                 cf_cv_gnu_dftsrc_219=maybe
12468         fi
12469
12470         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12471
12472                 echo "$as_me:12472: checking if we must define _GNU_SOURCE" >&5
12473 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12474 if test "${cf_cv_gnu_source+set}" = set; then
12475   echo $ECHO_N "(cached) $ECHO_C" >&6
12476 else
12477
12478                 cat >"conftest.$ac_ext" <<_ACEOF
12479 #line 12479 "configure"
12480 #include "confdefs.h"
12481 #include <sys/types.h>
12482 int
12483 main (void)
12484 {
12485
12486                         #ifndef _XOPEN_SOURCE
12487                         #error  expected _XOPEN_SOURCE to be defined
12488                         #endif
12489   ;
12490   return 0;
12491 }
12492 _ACEOF
12493 rm -f "conftest.$ac_objext"
12494 if { (eval echo "$as_me:12494: \"$ac_compile\"") >&5
12495   (eval $ac_compile) 2>&5
12496   ac_status=$?
12497   echo "$as_me:12497: \$? = $ac_status" >&5
12498   (exit "$ac_status"); } &&
12499          { ac_try='test -s "conftest.$ac_objext"'
12500   { (eval echo "$as_me:12500: \"$ac_try\"") >&5
12501   (eval $ac_try) 2>&5
12502   ac_status=$?
12503   echo "$as_me:12503: \$? = $ac_status" >&5
12504   (exit "$ac_status"); }; }; then
12505   cf_cv_gnu_source=no
12506 else
12507   echo "$as_me: failed program was:" >&5
12508 cat "conftest.$ac_ext" >&5
12509 cf_save="$CPPFLAGS"
12510
12511 cf_fix_cppflags=no
12512 cf_new_cflags=
12513 cf_new_cppflags=
12514 cf_new_extra_cppflags=
12515
12516 for cf_add_cflags in -D_GNU_SOURCE
12517 do
12518 case "$cf_fix_cppflags" in
12519 (no)
12520         case "$cf_add_cflags" in
12521         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12522                 case "$cf_add_cflags" in
12523                 (-D*)
12524                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12525
12526                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12527                                 && test -z "${cf_tst_cflags}" \
12528                                 && cf_fix_cppflags=yes
12529
12530                         if test "$cf_fix_cppflags" = yes ; then
12531
12532         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12533         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12534
12535                                 continue
12536                         elif test "${cf_tst_cflags}" = "\"'" ; then
12537
12538         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12539         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12540
12541                                 continue
12542                         fi
12543                         ;;
12544                 esac
12545                 case "$CPPFLAGS" in
12546                 (*$cf_add_cflags)
12547                         ;;
12548                 (*)
12549                         case "$cf_add_cflags" in
12550                         (-D*)
12551                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12552
12553 CPPFLAGS=`echo "$CPPFLAGS" | \
12554         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12555                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12556
12557                                 ;;
12558                         esac
12559
12560         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12561         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12562
12563                         ;;
12564                 esac
12565                 ;;
12566         (*)
12567
12568         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12569         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12570
12571                 ;;
12572         esac
12573         ;;
12574 (yes)
12575
12576         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12577         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12578
12579         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12580
12581         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12582                 && test -z "${cf_tst_cflags}" \
12583                 && cf_fix_cppflags=no
12584         ;;
12585 esac
12586 done
12587
12588 if test -n "$cf_new_cflags" ; then
12589
12590         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12591         CFLAGS="${CFLAGS}$cf_new_cflags"
12592
12593 fi
12594
12595 if test -n "$cf_new_cppflags" ; then
12596
12597         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12598         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12599
12600 fi
12601
12602 if test -n "$cf_new_extra_cppflags" ; then
12603
12604         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12605         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12606
12607 fi
12608
12609                          cat >"conftest.$ac_ext" <<_ACEOF
12610 #line 12610 "configure"
12611 #include "confdefs.h"
12612 #include <sys/types.h>
12613 int
12614 main (void)
12615 {
12616
12617                                 #ifdef _XOPEN_SOURCE
12618                                 #error  expected _XOPEN_SOURCE to be undefined
12619                                 #endif
12620   ;
12621   return 0;
12622 }
12623 _ACEOF
12624 rm -f "conftest.$ac_objext"
12625 if { (eval echo "$as_me:12625: \"$ac_compile\"") >&5
12626   (eval $ac_compile) 2>&5
12627   ac_status=$?
12628   echo "$as_me:12628: \$? = $ac_status" >&5
12629   (exit "$ac_status"); } &&
12630          { ac_try='test -s "conftest.$ac_objext"'
12631   { (eval echo "$as_me:12631: \"$ac_try\"") >&5
12632   (eval $ac_try) 2>&5
12633   ac_status=$?
12634   echo "$as_me:12634: \$? = $ac_status" >&5
12635   (exit "$ac_status"); }; }; then
12636   cf_cv_gnu_source=no
12637 else
12638   echo "$as_me: failed program was:" >&5
12639 cat "conftest.$ac_ext" >&5
12640 cf_cv_gnu_source=yes
12641 fi
12642 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12643                         CPPFLAGS="$cf_save"
12644
12645 fi
12646 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12647
12648 fi
12649 echo "$as_me:12649: result: $cf_cv_gnu_source" >&5
12650 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12651
12652                 if test "$cf_cv_gnu_source" = yes
12653                 then
12654                 echo "$as_me:12654: checking if we should also define _DEFAULT_SOURCE" >&5
12655 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12656 if test "${cf_cv_default_source+set}" = set; then
12657   echo $ECHO_N "(cached) $ECHO_C" >&6
12658 else
12659
12660         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12661         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12662
12663                         cat >"conftest.$ac_ext" <<_ACEOF
12664 #line 12664 "configure"
12665 #include "confdefs.h"
12666 #include <sys/types.h>
12667 int
12668 main (void)
12669 {
12670
12671                                 #ifdef _DEFAULT_SOURCE
12672                                 #error  expected _DEFAULT_SOURCE to be undefined
12673                                 #endif
12674   ;
12675   return 0;
12676 }
12677 _ACEOF
12678 rm -f "conftest.$ac_objext"
12679 if { (eval echo "$as_me:12679: \"$ac_compile\"") >&5
12680   (eval $ac_compile) 2>&5
12681   ac_status=$?
12682   echo "$as_me:12682: \$? = $ac_status" >&5
12683   (exit "$ac_status"); } &&
12684          { ac_try='test -s "conftest.$ac_objext"'
12685   { (eval echo "$as_me:12685: \"$ac_try\"") >&5
12686   (eval $ac_try) 2>&5
12687   ac_status=$?
12688   echo "$as_me:12688: \$? = $ac_status" >&5
12689   (exit "$ac_status"); }; }; then
12690   cf_cv_default_source=no
12691 else
12692   echo "$as_me: failed program was:" >&5
12693 cat "conftest.$ac_ext" >&5
12694 cf_cv_default_source=yes
12695 fi
12696 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12697
12698 fi
12699 echo "$as_me:12699: result: $cf_cv_default_source" >&5
12700 echo "${ECHO_T}$cf_cv_default_source" >&6
12701                         if test "$cf_cv_default_source" = yes
12702                         then
12703
12704         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12705         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12706
12707                         fi
12708                 fi
12709         fi
12710
12711 fi
12712
12713         ;;
12714 (minix*)
12715         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12716         ;;
12717 (mirbsd*)
12718         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12719         cf_XOPEN_SOURCE=
12720
12721 if test "$cf_cv_posix_visible" = no; then
12722
12723 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12724
12725 cf_save_CFLAGS="$CFLAGS"
12726 cf_save_CPPFLAGS="$CPPFLAGS"
12727
12728 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12729         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12730                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12731
12732 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12733         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12734                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12735
12736 echo "$as_me:12736: checking if we should define _POSIX_C_SOURCE" >&5
12737 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12738 if test "${cf_cv_posix_c_source+set}" = set; then
12739   echo $ECHO_N "(cached) $ECHO_C" >&6
12740 else
12741
12742 echo "${as_me:-configure}:12742: testing if the symbol is already defined go no further ..." 1>&5
12743
12744         cat >"conftest.$ac_ext" <<_ACEOF
12745 #line 12745 "configure"
12746 #include "confdefs.h"
12747 #include <sys/types.h>
12748 int
12749 main (void)
12750 {
12751
12752 #ifndef _POSIX_C_SOURCE
12753 make an error
12754 #endif
12755   ;
12756   return 0;
12757 }
12758 _ACEOF
12759 rm -f "conftest.$ac_objext"
12760 if { (eval echo "$as_me:12760: \"$ac_compile\"") >&5
12761   (eval $ac_compile) 2>&5
12762   ac_status=$?
12763   echo "$as_me:12763: \$? = $ac_status" >&5
12764   (exit "$ac_status"); } &&
12765          { ac_try='test -s "conftest.$ac_objext"'
12766   { (eval echo "$as_me:12766: \"$ac_try\"") >&5
12767   (eval $ac_try) 2>&5
12768   ac_status=$?
12769   echo "$as_me:12769: \$? = $ac_status" >&5
12770   (exit "$ac_status"); }; }; then
12771   cf_cv_posix_c_source=no
12772 else
12773   echo "$as_me: failed program was:" >&5
12774 cat "conftest.$ac_ext" >&5
12775 cf_want_posix_source=no
12776          case .$cf_POSIX_C_SOURCE in
12777          (.[12]??*)
12778                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12779                 ;;
12780          (.2)
12781                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12782                 cf_want_posix_source=yes
12783                 ;;
12784          (.*)
12785                 cf_want_posix_source=yes
12786                 ;;
12787          esac
12788          if test "$cf_want_posix_source" = yes ; then
12789                 cat >"conftest.$ac_ext" <<_ACEOF
12790 #line 12790 "configure"
12791 #include "confdefs.h"
12792 #include <sys/types.h>
12793 int
12794 main (void)
12795 {
12796
12797 #ifdef _POSIX_SOURCE
12798 make an error
12799 #endif
12800   ;
12801   return 0;
12802 }
12803 _ACEOF
12804 rm -f "conftest.$ac_objext"
12805 if { (eval echo "$as_me:12805: \"$ac_compile\"") >&5
12806   (eval $ac_compile) 2>&5
12807   ac_status=$?
12808   echo "$as_me:12808: \$? = $ac_status" >&5
12809   (exit "$ac_status"); } &&
12810          { ac_try='test -s "conftest.$ac_objext"'
12811   { (eval echo "$as_me:12811: \"$ac_try\"") >&5
12812   (eval $ac_try) 2>&5
12813   ac_status=$?
12814   echo "$as_me:12814: \$? = $ac_status" >&5
12815   (exit "$ac_status"); }; }; then
12816   :
12817 else
12818   echo "$as_me: failed program was:" >&5
12819 cat "conftest.$ac_ext" >&5
12820 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12821 fi
12822 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12823          fi
12824
12825 echo "${as_me:-configure}:12825: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12826
12827          CFLAGS="$cf_trim_CFLAGS"
12828          CPPFLAGS="$cf_trim_CPPFLAGS"
12829
12830         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12831         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12832
12833 echo "${as_me:-configure}:12833: testing if the second compile does not leave our definition intact error ..." 1>&5
12834
12835          cat >"conftest.$ac_ext" <<_ACEOF
12836 #line 12836 "configure"
12837 #include "confdefs.h"
12838 #include <sys/types.h>
12839 int
12840 main (void)
12841 {
12842
12843 #ifndef _POSIX_C_SOURCE
12844 make an error
12845 #endif
12846   ;
12847   return 0;
12848 }
12849 _ACEOF
12850 rm -f "conftest.$ac_objext"
12851 if { (eval echo "$as_me:12851: \"$ac_compile\"") >&5
12852   (eval $ac_compile) 2>&5
12853   ac_status=$?
12854   echo "$as_me:12854: \$? = $ac_status" >&5
12855   (exit "$ac_status"); } &&
12856          { ac_try='test -s "conftest.$ac_objext"'
12857   { (eval echo "$as_me:12857: \"$ac_try\"") >&5
12858   (eval $ac_try) 2>&5
12859   ac_status=$?
12860   echo "$as_me:12860: \$? = $ac_status" >&5
12861   (exit "$ac_status"); }; }; then
12862   :
12863 else
12864   echo "$as_me: failed program was:" >&5
12865 cat "conftest.$ac_ext" >&5
12866 cf_cv_posix_c_source=no
12867 fi
12868 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12869          CFLAGS="$cf_save_CFLAGS"
12870          CPPFLAGS="$cf_save_CPPFLAGS"
12871
12872 fi
12873 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12874
12875 fi
12876 echo "$as_me:12876: result: $cf_cv_posix_c_source" >&5
12877 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12878
12879 if test "$cf_cv_posix_c_source" != no ; then
12880         CFLAGS="$cf_trim_CFLAGS"
12881         CPPFLAGS="$cf_trim_CPPFLAGS"
12882
12883 cf_fix_cppflags=no
12884 cf_new_cflags=
12885 cf_new_cppflags=
12886 cf_new_extra_cppflags=
12887
12888 for cf_add_cflags in $cf_cv_posix_c_source
12889 do
12890 case "$cf_fix_cppflags" in
12891 (no)
12892         case "$cf_add_cflags" in
12893         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12894                 case "$cf_add_cflags" in
12895                 (-D*)
12896                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12897
12898                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12899                                 && test -z "${cf_tst_cflags}" \
12900                                 && cf_fix_cppflags=yes
12901
12902                         if test "$cf_fix_cppflags" = yes ; then
12903
12904         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12905         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12906
12907                                 continue
12908                         elif test "${cf_tst_cflags}" = "\"'" ; then
12909
12910         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12911         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12912
12913                                 continue
12914                         fi
12915                         ;;
12916                 esac
12917                 case "$CPPFLAGS" in
12918                 (*$cf_add_cflags)
12919                         ;;
12920                 (*)
12921                         case "$cf_add_cflags" in
12922                         (-D*)
12923                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12924
12925 CPPFLAGS=`echo "$CPPFLAGS" | \
12926         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12927                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12928
12929                                 ;;
12930                         esac
12931
12932         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12933         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12934
12935                         ;;
12936                 esac
12937                 ;;
12938         (*)
12939
12940         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12941         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12942
12943                 ;;
12944         esac
12945         ;;
12946 (yes)
12947
12948         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12949         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12950
12951         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12952
12953         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12954                 && test -z "${cf_tst_cflags}" \
12955                 && cf_fix_cppflags=no
12956         ;;
12957 esac
12958 done
12959
12960 if test -n "$cf_new_cflags" ; then
12961
12962         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12963         CFLAGS="${CFLAGS}$cf_new_cflags"
12964
12965 fi
12966
12967 if test -n "$cf_new_cppflags" ; then
12968
12969         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12970         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12971
12972 fi
12973
12974 if test -n "$cf_new_extra_cppflags" ; then
12975
12976         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12977         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12978
12979 fi
12980
12981 fi
12982
12983 fi # cf_cv_posix_visible
12984
12985         ;;
12986 (netbsd*)
12987         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12988         ;;
12989 (openbsd[6-9]*)
12990         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
12991         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
12992         # Abusing the conformance level is a workaround.
12993         { echo "$as_me:12993: WARNING: this system does not provide usable locale support" >&5
12994 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
12995         cf_xopen_source="-D_BSD_SOURCE"
12996         cf_XOPEN_SOURCE=700
12997         ;;
12998 (openbsd[4-5]*)
12999         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13000         cf_xopen_source="-D_BSD_SOURCE"
13001         cf_XOPEN_SOURCE=600
13002         ;;
13003 (openbsd*)
13004         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13005         ;;
13006 (osf[45]*)
13007         cf_xopen_source="-D_OSF_SOURCE"
13008         ;;
13009 (nto-qnx*)
13010         cf_xopen_source="-D_QNX_SOURCE"
13011         ;;
13012 (sco*)
13013         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13014         ;;
13015 (solaris2.*)
13016         cf_xopen_source="-D__EXTENSIONS__"
13017         cf_cv_xopen_source=broken
13018         ;;
13019 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13020         cf_XOPEN_SOURCE=
13021         cf_POSIX_C_SOURCE=
13022         ;;
13023 (*)
13024
13025 echo "$as_me:13025: checking if we should define _XOPEN_SOURCE" >&5
13026 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13027 if test "${cf_cv_xopen_source+set}" = set; then
13028   echo $ECHO_N "(cached) $ECHO_C" >&6
13029 else
13030
13031         cat >"conftest.$ac_ext" <<_ACEOF
13032 #line 13032 "configure"
13033 #include "confdefs.h"
13034
13035 #include <stdlib.h>
13036 #include <string.h>
13037 #include <sys/types.h>
13038
13039 int
13040 main (void)
13041 {
13042
13043 #ifndef _XOPEN_SOURCE
13044 make an error
13045 #endif
13046   ;
13047   return 0;
13048 }
13049 _ACEOF
13050 rm -f "conftest.$ac_objext"
13051 if { (eval echo "$as_me:13051: \"$ac_compile\"") >&5
13052   (eval $ac_compile) 2>&5
13053   ac_status=$?
13054   echo "$as_me:13054: \$? = $ac_status" >&5
13055   (exit "$ac_status"); } &&
13056          { ac_try='test -s "conftest.$ac_objext"'
13057   { (eval echo "$as_me:13057: \"$ac_try\"") >&5
13058   (eval $ac_try) 2>&5
13059   ac_status=$?
13060   echo "$as_me:13060: \$? = $ac_status" >&5
13061   (exit "$ac_status"); }; }; then
13062   cf_cv_xopen_source=no
13063 else
13064   echo "$as_me: failed program was:" >&5
13065 cat "conftest.$ac_ext" >&5
13066 cf_save="$CPPFLAGS"
13067
13068         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13069         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13070
13071          cat >"conftest.$ac_ext" <<_ACEOF
13072 #line 13072 "configure"
13073 #include "confdefs.h"
13074
13075 #include <stdlib.h>
13076 #include <string.h>
13077 #include <sys/types.h>
13078
13079 int
13080 main (void)
13081 {
13082
13083 #ifdef _XOPEN_SOURCE
13084 make an error
13085 #endif
13086   ;
13087   return 0;
13088 }
13089 _ACEOF
13090 rm -f "conftest.$ac_objext"
13091 if { (eval echo "$as_me:13091: \"$ac_compile\"") >&5
13092   (eval $ac_compile) 2>&5
13093   ac_status=$?
13094   echo "$as_me:13094: \$? = $ac_status" >&5
13095   (exit "$ac_status"); } &&
13096          { ac_try='test -s "conftest.$ac_objext"'
13097   { (eval echo "$as_me:13097: \"$ac_try\"") >&5
13098   (eval $ac_try) 2>&5
13099   ac_status=$?
13100   echo "$as_me:13100: \$? = $ac_status" >&5
13101   (exit "$ac_status"); }; }; then
13102   cf_cv_xopen_source=no
13103 else
13104   echo "$as_me: failed program was:" >&5
13105 cat "conftest.$ac_ext" >&5
13106 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13107 fi
13108 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13109         CPPFLAGS="$cf_save"
13110
13111 fi
13112 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13113
13114 fi
13115 echo "$as_me:13115: result: $cf_cv_xopen_source" >&5
13116 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13117
13118 if test "$cf_cv_xopen_source" != no ; then
13119
13120 CFLAGS=`echo "$CFLAGS" | \
13121         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13122                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13123
13124 CPPFLAGS=`echo "$CPPFLAGS" | \
13125         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13126                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13127
13128         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13129
13130 cf_fix_cppflags=no
13131 cf_new_cflags=
13132 cf_new_cppflags=
13133 cf_new_extra_cppflags=
13134
13135 for cf_add_cflags in $cf_temp_xopen_source
13136 do
13137 case "$cf_fix_cppflags" in
13138 (no)
13139         case "$cf_add_cflags" in
13140         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13141                 case "$cf_add_cflags" in
13142                 (-D*)
13143                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13144
13145                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13146                                 && test -z "${cf_tst_cflags}" \
13147                                 && cf_fix_cppflags=yes
13148
13149                         if test "$cf_fix_cppflags" = yes ; then
13150
13151         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13152         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13153
13154                                 continue
13155                         elif test "${cf_tst_cflags}" = "\"'" ; then
13156
13157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13159
13160                                 continue
13161                         fi
13162                         ;;
13163                 esac
13164                 case "$CPPFLAGS" in
13165                 (*$cf_add_cflags)
13166                         ;;
13167                 (*)
13168                         case "$cf_add_cflags" in
13169                         (-D*)
13170                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13171
13172 CPPFLAGS=`echo "$CPPFLAGS" | \
13173         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13174                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13175
13176                                 ;;
13177                         esac
13178
13179         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13180         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13181
13182                         ;;
13183                 esac
13184                 ;;
13185         (*)
13186
13187         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13188         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13189
13190                 ;;
13191         esac
13192         ;;
13193 (yes)
13194
13195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13197
13198         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13199
13200         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13201                 && test -z "${cf_tst_cflags}" \
13202                 && cf_fix_cppflags=no
13203         ;;
13204 esac
13205 done
13206
13207 if test -n "$cf_new_cflags" ; then
13208
13209         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13210         CFLAGS="${CFLAGS}$cf_new_cflags"
13211
13212 fi
13213
13214 if test -n "$cf_new_cppflags" ; then
13215
13216         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13217         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13218
13219 fi
13220
13221 if test -n "$cf_new_extra_cppflags" ; then
13222
13223         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13224         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13225
13226 fi
13227
13228 fi
13229
13230 if test "$cf_cv_posix_visible" = no; then
13231
13232 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13233
13234 cf_save_CFLAGS="$CFLAGS"
13235 cf_save_CPPFLAGS="$CPPFLAGS"
13236
13237 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13238         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13239                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13240
13241 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13242         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13243                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13244
13245 echo "$as_me:13245: checking if we should define _POSIX_C_SOURCE" >&5
13246 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13247 if test "${cf_cv_posix_c_source+set}" = set; then
13248   echo $ECHO_N "(cached) $ECHO_C" >&6
13249 else
13250
13251 echo "${as_me:-configure}:13251: testing if the symbol is already defined go no further ..." 1>&5
13252
13253         cat >"conftest.$ac_ext" <<_ACEOF
13254 #line 13254 "configure"
13255 #include "confdefs.h"
13256 #include <sys/types.h>
13257 int
13258 main (void)
13259 {
13260
13261 #ifndef _POSIX_C_SOURCE
13262 make an error
13263 #endif
13264   ;
13265   return 0;
13266 }
13267 _ACEOF
13268 rm -f "conftest.$ac_objext"
13269 if { (eval echo "$as_me:13269: \"$ac_compile\"") >&5
13270   (eval $ac_compile) 2>&5
13271   ac_status=$?
13272   echo "$as_me:13272: \$? = $ac_status" >&5
13273   (exit "$ac_status"); } &&
13274          { ac_try='test -s "conftest.$ac_objext"'
13275   { (eval echo "$as_me:13275: \"$ac_try\"") >&5
13276   (eval $ac_try) 2>&5
13277   ac_status=$?
13278   echo "$as_me:13278: \$? = $ac_status" >&5
13279   (exit "$ac_status"); }; }; then
13280   cf_cv_posix_c_source=no
13281 else
13282   echo "$as_me: failed program was:" >&5
13283 cat "conftest.$ac_ext" >&5
13284 cf_want_posix_source=no
13285          case .$cf_POSIX_C_SOURCE in
13286          (.[12]??*)
13287                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13288                 ;;
13289          (.2)
13290                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13291                 cf_want_posix_source=yes
13292                 ;;
13293          (.*)
13294                 cf_want_posix_source=yes
13295                 ;;
13296          esac
13297          if test "$cf_want_posix_source" = yes ; then
13298                 cat >"conftest.$ac_ext" <<_ACEOF
13299 #line 13299 "configure"
13300 #include "confdefs.h"
13301 #include <sys/types.h>
13302 int
13303 main (void)
13304 {
13305
13306 #ifdef _POSIX_SOURCE
13307 make an error
13308 #endif
13309   ;
13310   return 0;
13311 }
13312 _ACEOF
13313 rm -f "conftest.$ac_objext"
13314 if { (eval echo "$as_me:13314: \"$ac_compile\"") >&5
13315   (eval $ac_compile) 2>&5
13316   ac_status=$?
13317   echo "$as_me:13317: \$? = $ac_status" >&5
13318   (exit "$ac_status"); } &&
13319          { ac_try='test -s "conftest.$ac_objext"'
13320   { (eval echo "$as_me:13320: \"$ac_try\"") >&5
13321   (eval $ac_try) 2>&5
13322   ac_status=$?
13323   echo "$as_me:13323: \$? = $ac_status" >&5
13324   (exit "$ac_status"); }; }; then
13325   :
13326 else
13327   echo "$as_me: failed program was:" >&5
13328 cat "conftest.$ac_ext" >&5
13329 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13330 fi
13331 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13332          fi
13333
13334 echo "${as_me:-configure}:13334: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13335
13336          CFLAGS="$cf_trim_CFLAGS"
13337          CPPFLAGS="$cf_trim_CPPFLAGS"
13338
13339         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13340         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13341
13342 echo "${as_me:-configure}:13342: testing if the second compile does not leave our definition intact error ..." 1>&5
13343
13344          cat >"conftest.$ac_ext" <<_ACEOF
13345 #line 13345 "configure"
13346 #include "confdefs.h"
13347 #include <sys/types.h>
13348 int
13349 main (void)
13350 {
13351
13352 #ifndef _POSIX_C_SOURCE
13353 make an error
13354 #endif
13355   ;
13356   return 0;
13357 }
13358 _ACEOF
13359 rm -f "conftest.$ac_objext"
13360 if { (eval echo "$as_me:13360: \"$ac_compile\"") >&5
13361   (eval $ac_compile) 2>&5
13362   ac_status=$?
13363   echo "$as_me:13363: \$? = $ac_status" >&5
13364   (exit "$ac_status"); } &&
13365          { ac_try='test -s "conftest.$ac_objext"'
13366   { (eval echo "$as_me:13366: \"$ac_try\"") >&5
13367   (eval $ac_try) 2>&5
13368   ac_status=$?
13369   echo "$as_me:13369: \$? = $ac_status" >&5
13370   (exit "$ac_status"); }; }; then
13371   :
13372 else
13373   echo "$as_me: failed program was:" >&5
13374 cat "conftest.$ac_ext" >&5
13375 cf_cv_posix_c_source=no
13376 fi
13377 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13378          CFLAGS="$cf_save_CFLAGS"
13379          CPPFLAGS="$cf_save_CPPFLAGS"
13380
13381 fi
13382 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13383
13384 fi
13385 echo "$as_me:13385: result: $cf_cv_posix_c_source" >&5
13386 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13387
13388 if test "$cf_cv_posix_c_source" != no ; then
13389         CFLAGS="$cf_trim_CFLAGS"
13390         CPPFLAGS="$cf_trim_CPPFLAGS"
13391
13392 cf_fix_cppflags=no
13393 cf_new_cflags=
13394 cf_new_cppflags=
13395 cf_new_extra_cppflags=
13396
13397 for cf_add_cflags in $cf_cv_posix_c_source
13398 do
13399 case "$cf_fix_cppflags" in
13400 (no)
13401         case "$cf_add_cflags" in
13402         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13403                 case "$cf_add_cflags" in
13404                 (-D*)
13405                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13406
13407                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13408                                 && test -z "${cf_tst_cflags}" \
13409                                 && cf_fix_cppflags=yes
13410
13411                         if test "$cf_fix_cppflags" = yes ; then
13412
13413         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13414         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13415
13416                                 continue
13417                         elif test "${cf_tst_cflags}" = "\"'" ; then
13418
13419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13421
13422                                 continue
13423                         fi
13424                         ;;
13425                 esac
13426                 case "$CPPFLAGS" in
13427                 (*$cf_add_cflags)
13428                         ;;
13429                 (*)
13430                         case "$cf_add_cflags" in
13431                         (-D*)
13432                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13433
13434 CPPFLAGS=`echo "$CPPFLAGS" | \
13435         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13436                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13437
13438                                 ;;
13439                         esac
13440
13441         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13442         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13443
13444                         ;;
13445                 esac
13446                 ;;
13447         (*)
13448
13449         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13450         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13451
13452                 ;;
13453         esac
13454         ;;
13455 (yes)
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         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13461
13462         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13463                 && test -z "${cf_tst_cflags}" \
13464                 && cf_fix_cppflags=no
13465         ;;
13466 esac
13467 done
13468
13469 if test -n "$cf_new_cflags" ; then
13470
13471         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13472         CFLAGS="${CFLAGS}$cf_new_cflags"
13473
13474 fi
13475
13476 if test -n "$cf_new_cppflags" ; then
13477
13478         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13479         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13480
13481 fi
13482
13483 if test -n "$cf_new_extra_cppflags" ; then
13484
13485         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13486         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13487
13488 fi
13489
13490 fi
13491
13492 fi # cf_cv_posix_visible
13493
13494         ;;
13495 esac
13496
13497 if test -n "$cf_xopen_source" ; then
13498
13499 cf_fix_cppflags=no
13500 cf_new_cflags=
13501 cf_new_cppflags=
13502 cf_new_extra_cppflags=
13503
13504 for cf_add_cflags in $cf_xopen_source
13505 do
13506 case "$cf_fix_cppflags" in
13507 (no)
13508         case "$cf_add_cflags" in
13509         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13510                 case "$cf_add_cflags" in
13511                 (-D*)
13512                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13513
13514                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13515                                 && test -z "${cf_tst_cflags}" \
13516                                 && cf_fix_cppflags=yes
13517
13518                         if test "$cf_fix_cppflags" = yes ; then
13519
13520         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13521         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13522
13523                                 continue
13524                         elif test "${cf_tst_cflags}" = "\"'" ; then
13525
13526         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13527         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13528
13529                                 continue
13530                         fi
13531                         ;;
13532                 esac
13533                 case "$CPPFLAGS" in
13534                 (*$cf_add_cflags)
13535                         ;;
13536                 (*)
13537                         case "$cf_add_cflags" in
13538                         (-D*)
13539                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13540
13541 CPPFLAGS=`echo "$CPPFLAGS" | \
13542         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13543                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13544
13545                                 ;;
13546                         esac
13547
13548         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13549         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13550
13551                         ;;
13552                 esac
13553                 ;;
13554         (*)
13555
13556         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13557         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13558
13559                 ;;
13560         esac
13561         ;;
13562 (yes)
13563
13564         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13565         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13566
13567         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13568
13569         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13570                 && test -z "${cf_tst_cflags}" \
13571                 && cf_fix_cppflags=no
13572         ;;
13573 esac
13574 done
13575
13576 if test -n "$cf_new_cflags" ; then
13577         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13578
13579 echo "${as_me:-configure}:13579: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13580
13581         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13582         CFLAGS="${CFLAGS}$cf_new_cflags"
13583
13584 fi
13585
13586 if test -n "$cf_new_cppflags" ; then
13587         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13588
13589 echo "${as_me:-configure}:13589: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13590
13591         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13592         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13593
13594 fi
13595
13596 if test -n "$cf_new_extra_cppflags" ; then
13597         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13598
13599 echo "${as_me:-configure}:13599: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13600
13601         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13602         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13603
13604 fi
13605
13606 fi
13607
13608 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13609         echo "$as_me:13609: checking if _XOPEN_SOURCE really is set" >&5
13610 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13611         cat >"conftest.$ac_ext" <<_ACEOF
13612 #line 13612 "configure"
13613 #include "confdefs.h"
13614 #include <stdlib.h>
13615 int
13616 main (void)
13617 {
13618
13619 #ifndef _XOPEN_SOURCE
13620 make an error
13621 #endif
13622   ;
13623   return 0;
13624 }
13625 _ACEOF
13626 rm -f "conftest.$ac_objext"
13627 if { (eval echo "$as_me:13627: \"$ac_compile\"") >&5
13628   (eval $ac_compile) 2>&5
13629   ac_status=$?
13630   echo "$as_me:13630: \$? = $ac_status" >&5
13631   (exit "$ac_status"); } &&
13632          { ac_try='test -s "conftest.$ac_objext"'
13633   { (eval echo "$as_me:13633: \"$ac_try\"") >&5
13634   (eval $ac_try) 2>&5
13635   ac_status=$?
13636   echo "$as_me:13636: \$? = $ac_status" >&5
13637   (exit "$ac_status"); }; }; then
13638   cf_XOPEN_SOURCE_set=yes
13639 else
13640   echo "$as_me: failed program was:" >&5
13641 cat "conftest.$ac_ext" >&5
13642 cf_XOPEN_SOURCE_set=no
13643 fi
13644 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13645         echo "$as_me:13645: result: $cf_XOPEN_SOURCE_set" >&5
13646 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13647         if test "$cf_XOPEN_SOURCE_set" = yes
13648         then
13649                 cat >"conftest.$ac_ext" <<_ACEOF
13650 #line 13650 "configure"
13651 #include "confdefs.h"
13652 #include <stdlib.h>
13653 int
13654 main (void)
13655 {
13656
13657 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13658 make an error
13659 #endif
13660   ;
13661   return 0;
13662 }
13663 _ACEOF
13664 rm -f "conftest.$ac_objext"
13665 if { (eval echo "$as_me:13665: \"$ac_compile\"") >&5
13666   (eval $ac_compile) 2>&5
13667   ac_status=$?
13668   echo "$as_me:13668: \$? = $ac_status" >&5
13669   (exit "$ac_status"); } &&
13670          { ac_try='test -s "conftest.$ac_objext"'
13671   { (eval echo "$as_me:13671: \"$ac_try\"") >&5
13672   (eval $ac_try) 2>&5
13673   ac_status=$?
13674   echo "$as_me:13674: \$? = $ac_status" >&5
13675   (exit "$ac_status"); }; }; then
13676   cf_XOPEN_SOURCE_set_ok=yes
13677 else
13678   echo "$as_me: failed program was:" >&5
13679 cat "conftest.$ac_ext" >&5
13680 cf_XOPEN_SOURCE_set_ok=no
13681 fi
13682 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13683                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13684                 then
13685                         { echo "$as_me:13685: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13686 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13687                 fi
13688         else
13689
13690 echo "$as_me:13690: checking if we should define _XOPEN_SOURCE" >&5
13691 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13692 if test "${cf_cv_xopen_source+set}" = set; then
13693   echo $ECHO_N "(cached) $ECHO_C" >&6
13694 else
13695
13696         cat >"conftest.$ac_ext" <<_ACEOF
13697 #line 13697 "configure"
13698 #include "confdefs.h"
13699
13700 #include <stdlib.h>
13701 #include <string.h>
13702 #include <sys/types.h>
13703
13704 int
13705 main (void)
13706 {
13707
13708 #ifndef _XOPEN_SOURCE
13709 make an error
13710 #endif
13711   ;
13712   return 0;
13713 }
13714 _ACEOF
13715 rm -f "conftest.$ac_objext"
13716 if { (eval echo "$as_me:13716: \"$ac_compile\"") >&5
13717   (eval $ac_compile) 2>&5
13718   ac_status=$?
13719   echo "$as_me:13719: \$? = $ac_status" >&5
13720   (exit "$ac_status"); } &&
13721          { ac_try='test -s "conftest.$ac_objext"'
13722   { (eval echo "$as_me:13722: \"$ac_try\"") >&5
13723   (eval $ac_try) 2>&5
13724   ac_status=$?
13725   echo "$as_me:13725: \$? = $ac_status" >&5
13726   (exit "$ac_status"); }; }; then
13727   cf_cv_xopen_source=no
13728 else
13729   echo "$as_me: failed program was:" >&5
13730 cat "conftest.$ac_ext" >&5
13731 cf_save="$CPPFLAGS"
13732
13733         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13734         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13735
13736          cat >"conftest.$ac_ext" <<_ACEOF
13737 #line 13737 "configure"
13738 #include "confdefs.h"
13739
13740 #include <stdlib.h>
13741 #include <string.h>
13742 #include <sys/types.h>
13743
13744 int
13745 main (void)
13746 {
13747
13748 #ifdef _XOPEN_SOURCE
13749 make an error
13750 #endif
13751   ;
13752   return 0;
13753 }
13754 _ACEOF
13755 rm -f "conftest.$ac_objext"
13756 if { (eval echo "$as_me:13756: \"$ac_compile\"") >&5
13757   (eval $ac_compile) 2>&5
13758   ac_status=$?
13759   echo "$as_me:13759: \$? = $ac_status" >&5
13760   (exit "$ac_status"); } &&
13761          { ac_try='test -s "conftest.$ac_objext"'
13762   { (eval echo "$as_me:13762: \"$ac_try\"") >&5
13763   (eval $ac_try) 2>&5
13764   ac_status=$?
13765   echo "$as_me:13765: \$? = $ac_status" >&5
13766   (exit "$ac_status"); }; }; then
13767   cf_cv_xopen_source=no
13768 else
13769   echo "$as_me: failed program was:" >&5
13770 cat "conftest.$ac_ext" >&5
13771 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13772 fi
13773 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13774         CPPFLAGS="$cf_save"
13775
13776 fi
13777 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13778
13779 fi
13780 echo "$as_me:13780: result: $cf_cv_xopen_source" >&5
13781 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13782
13783 if test "$cf_cv_xopen_source" != no ; then
13784
13785 CFLAGS=`echo "$CFLAGS" | \
13786         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13787                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13788
13789 CPPFLAGS=`echo "$CPPFLAGS" | \
13790         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13791                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13792
13793         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13794
13795 cf_fix_cppflags=no
13796 cf_new_cflags=
13797 cf_new_cppflags=
13798 cf_new_extra_cppflags=
13799
13800 for cf_add_cflags in $cf_temp_xopen_source
13801 do
13802 case "$cf_fix_cppflags" in
13803 (no)
13804         case "$cf_add_cflags" in
13805         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13806                 case "$cf_add_cflags" in
13807                 (-D*)
13808                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13809
13810                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13811                                 && test -z "${cf_tst_cflags}" \
13812                                 && cf_fix_cppflags=yes
13813
13814                         if test "$cf_fix_cppflags" = yes ; then
13815
13816         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13817         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13818
13819                                 continue
13820                         elif test "${cf_tst_cflags}" = "\"'" ; then
13821
13822         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13823         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13824
13825                                 continue
13826                         fi
13827                         ;;
13828                 esac
13829                 case "$CPPFLAGS" in
13830                 (*$cf_add_cflags)
13831                         ;;
13832                 (*)
13833                         case "$cf_add_cflags" in
13834                         (-D*)
13835                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13836
13837 CPPFLAGS=`echo "$CPPFLAGS" | \
13838         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13839                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13840
13841                                 ;;
13842                         esac
13843
13844         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13845         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13846
13847                         ;;
13848                 esac
13849                 ;;
13850         (*)
13851
13852         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13853         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13854
13855                 ;;
13856         esac
13857         ;;
13858 (yes)
13859
13860         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13861         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13862
13863         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13864
13865         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13866                 && test -z "${cf_tst_cflags}" \
13867                 && cf_fix_cppflags=no
13868         ;;
13869 esac
13870 done
13871
13872 if test -n "$cf_new_cflags" ; then
13873
13874         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13875         CFLAGS="${CFLAGS}$cf_new_cflags"
13876
13877 fi
13878
13879 if test -n "$cf_new_cppflags" ; then
13880
13881         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13882         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13883
13884 fi
13885
13886 if test -n "$cf_new_extra_cppflags" ; then
13887
13888         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13889         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13890
13891 fi
13892
13893 fi
13894
13895         fi
13896 fi
13897 fi # cf_cv_posix_visible
13898
13899 # Check whether --enable-largefile or --disable-largefile was given.
13900 if test "${enable_largefile+set}" = set; then
13901   enableval="$enable_largefile"
13902
13903 fi;
13904 if test "$enable_largefile" != no; then
13905
13906   echo "$as_me:13906: checking for special C compiler options needed for large files" >&5
13907 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13908 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13909   echo $ECHO_N "(cached) $ECHO_C" >&6
13910 else
13911   ac_cv_sys_largefile_CC=no
13912      if test "$GCC" != yes; then
13913        ac_save_CC=$CC
13914        while :; do
13915          # IRIX 6.2 and later do not support large files by default,
13916          # so use the C compiler's -n32 option if that helps.
13917          cat >"conftest.$ac_ext" <<_ACEOF
13918 #line 13918 "configure"
13919 #include "confdefs.h"
13920 #include <sys/types.h>
13921  /* Check that off_t can represent 2**63 - 1 correctly.
13922     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13923     since some C++ compilers masquerading as C compilers
13924     incorrectly reject 9223372036854775807.  */
13925 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13926   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13927                        && LARGE_OFF_T % 2147483647 == 1)
13928                       ? 1 : -1];
13929 int
13930 main (void)
13931 {
13932
13933   ;
13934   return 0;
13935 }
13936 _ACEOF
13937          rm -f "conftest.$ac_objext"
13938 if { (eval echo "$as_me:13938: \"$ac_compile\"") >&5
13939   (eval $ac_compile) 2>&5
13940   ac_status=$?
13941   echo "$as_me:13941: \$? = $ac_status" >&5
13942   (exit "$ac_status"); } &&
13943          { ac_try='test -s "conftest.$ac_objext"'
13944   { (eval echo "$as_me:13944: \"$ac_try\"") >&5
13945   (eval $ac_try) 2>&5
13946   ac_status=$?
13947   echo "$as_me:13947: \$? = $ac_status" >&5
13948   (exit "$ac_status"); }; }; then
13949   break
13950 else
13951   echo "$as_me: failed program was:" >&5
13952 cat "conftest.$ac_ext" >&5
13953 fi
13954 rm -f "conftest.$ac_objext"
13955          CC="$CC -n32"
13956          rm -f "conftest.$ac_objext"
13957 if { (eval echo "$as_me:13957: \"$ac_compile\"") >&5
13958   (eval $ac_compile) 2>&5
13959   ac_status=$?
13960   echo "$as_me:13960: \$? = $ac_status" >&5
13961   (exit "$ac_status"); } &&
13962          { ac_try='test -s "conftest.$ac_objext"'
13963   { (eval echo "$as_me:13963: \"$ac_try\"") >&5
13964   (eval $ac_try) 2>&5
13965   ac_status=$?
13966   echo "$as_me:13966: \$? = $ac_status" >&5
13967   (exit "$ac_status"); }; }; then
13968   ac_cv_sys_largefile_CC=' -n32'; break
13969 else
13970   echo "$as_me: failed program was:" >&5
13971 cat "conftest.$ac_ext" >&5
13972 fi
13973 rm -f "conftest.$ac_objext"
13974          break
13975        done
13976        CC=$ac_save_CC
13977        rm -f "conftest.$ac_ext"
13978     fi
13979 fi
13980 echo "$as_me:13980: result: $ac_cv_sys_largefile_CC" >&5
13981 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13982   if test "$ac_cv_sys_largefile_CC" != no; then
13983     CC=$CC$ac_cv_sys_largefile_CC
13984   fi
13985
13986   echo "$as_me:13986: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13987 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13988 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13989   echo $ECHO_N "(cached) $ECHO_C" >&6
13990 else
13991   while :; do
13992   ac_cv_sys_file_offset_bits=no
13993   cat >"conftest.$ac_ext" <<_ACEOF
13994 #line 13994 "configure"
13995 #include "confdefs.h"
13996 #include <sys/types.h>
13997  /* Check that off_t can represent 2**63 - 1 correctly.
13998     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13999     since some C++ compilers masquerading as C compilers
14000     incorrectly reject 9223372036854775807.  */
14001 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14002   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14003                        && LARGE_OFF_T % 2147483647 == 1)
14004                       ? 1 : -1];
14005 int
14006 main (void)
14007 {
14008
14009   ;
14010   return 0;
14011 }
14012 _ACEOF
14013 rm -f "conftest.$ac_objext"
14014 if { (eval echo "$as_me:14014: \"$ac_compile\"") >&5
14015   (eval $ac_compile) 2>&5
14016   ac_status=$?
14017   echo "$as_me:14017: \$? = $ac_status" >&5
14018   (exit "$ac_status"); } &&
14019          { ac_try='test -s "conftest.$ac_objext"'
14020   { (eval echo "$as_me:14020: \"$ac_try\"") >&5
14021   (eval $ac_try) 2>&5
14022   ac_status=$?
14023   echo "$as_me:14023: \$? = $ac_status" >&5
14024   (exit "$ac_status"); }; }; then
14025   break
14026 else
14027   echo "$as_me: failed program was:" >&5
14028 cat "conftest.$ac_ext" >&5
14029 fi
14030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14031   cat >"conftest.$ac_ext" <<_ACEOF
14032 #line 14032 "configure"
14033 #include "confdefs.h"
14034 #define _FILE_OFFSET_BITS 64
14035 #include <sys/types.h>
14036  /* Check that off_t can represent 2**63 - 1 correctly.
14037     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14038     since some C++ compilers masquerading as C compilers
14039     incorrectly reject 9223372036854775807.  */
14040 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14041   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14042                        && LARGE_OFF_T % 2147483647 == 1)
14043                       ? 1 : -1];
14044 int
14045 main (void)
14046 {
14047
14048   ;
14049   return 0;
14050 }
14051 _ACEOF
14052 rm -f "conftest.$ac_objext"
14053 if { (eval echo "$as_me:14053: \"$ac_compile\"") >&5
14054   (eval $ac_compile) 2>&5
14055   ac_status=$?
14056   echo "$as_me:14056: \$? = $ac_status" >&5
14057   (exit "$ac_status"); } &&
14058          { ac_try='test -s "conftest.$ac_objext"'
14059   { (eval echo "$as_me:14059: \"$ac_try\"") >&5
14060   (eval $ac_try) 2>&5
14061   ac_status=$?
14062   echo "$as_me:14062: \$? = $ac_status" >&5
14063   (exit "$ac_status"); }; }; then
14064   ac_cv_sys_file_offset_bits=64; break
14065 else
14066   echo "$as_me: failed program was:" >&5
14067 cat "conftest.$ac_ext" >&5
14068 fi
14069 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14070   break
14071 done
14072 fi
14073 echo "$as_me:14073: result: $ac_cv_sys_file_offset_bits" >&5
14074 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14075 if test "$ac_cv_sys_file_offset_bits" != no; then
14076
14077 cat >>confdefs.h <<EOF
14078 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14079 EOF
14080
14081 fi
14082 rm -rf conftest*
14083   echo "$as_me:14083: checking for _LARGE_FILES value needed for large files" >&5
14084 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14085 if test "${ac_cv_sys_large_files+set}" = set; then
14086   echo $ECHO_N "(cached) $ECHO_C" >&6
14087 else
14088   while :; do
14089   ac_cv_sys_large_files=no
14090   cat >"conftest.$ac_ext" <<_ACEOF
14091 #line 14091 "configure"
14092 #include "confdefs.h"
14093 #include <sys/types.h>
14094  /* Check that off_t can represent 2**63 - 1 correctly.
14095     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14096     since some C++ compilers masquerading as C compilers
14097     incorrectly reject 9223372036854775807.  */
14098 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14099   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14100                        && LARGE_OFF_T % 2147483647 == 1)
14101                       ? 1 : -1];
14102 int
14103 main (void)
14104 {
14105
14106   ;
14107   return 0;
14108 }
14109 _ACEOF
14110 rm -f "conftest.$ac_objext"
14111 if { (eval echo "$as_me:14111: \"$ac_compile\"") >&5
14112   (eval $ac_compile) 2>&5
14113   ac_status=$?
14114   echo "$as_me:14114: \$? = $ac_status" >&5
14115   (exit "$ac_status"); } &&
14116          { ac_try='test -s "conftest.$ac_objext"'
14117   { (eval echo "$as_me:14117: \"$ac_try\"") >&5
14118   (eval $ac_try) 2>&5
14119   ac_status=$?
14120   echo "$as_me:14120: \$? = $ac_status" >&5
14121   (exit "$ac_status"); }; }; then
14122   break
14123 else
14124   echo "$as_me: failed program was:" >&5
14125 cat "conftest.$ac_ext" >&5
14126 fi
14127 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14128   cat >"conftest.$ac_ext" <<_ACEOF
14129 #line 14129 "configure"
14130 #include "confdefs.h"
14131 #define _LARGE_FILES 1
14132 #include <sys/types.h>
14133  /* Check that off_t can represent 2**63 - 1 correctly.
14134     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14135     since some C++ compilers masquerading as C compilers
14136     incorrectly reject 9223372036854775807.  */
14137 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14138   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14139                        && LARGE_OFF_T % 2147483647 == 1)
14140                       ? 1 : -1];
14141 int
14142 main (void)
14143 {
14144
14145   ;
14146   return 0;
14147 }
14148 _ACEOF
14149 rm -f "conftest.$ac_objext"
14150 if { (eval echo "$as_me:14150: \"$ac_compile\"") >&5
14151   (eval $ac_compile) 2>&5
14152   ac_status=$?
14153   echo "$as_me:14153: \$? = $ac_status" >&5
14154   (exit "$ac_status"); } &&
14155          { ac_try='test -s "conftest.$ac_objext"'
14156   { (eval echo "$as_me:14156: \"$ac_try\"") >&5
14157   (eval $ac_try) 2>&5
14158   ac_status=$?
14159   echo "$as_me:14159: \$? = $ac_status" >&5
14160   (exit "$ac_status"); }; }; then
14161   ac_cv_sys_large_files=1; break
14162 else
14163   echo "$as_me: failed program was:" >&5
14164 cat "conftest.$ac_ext" >&5
14165 fi
14166 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14167   break
14168 done
14169 fi
14170 echo "$as_me:14170: result: $ac_cv_sys_large_files" >&5
14171 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14172 if test "$ac_cv_sys_large_files" != no; then
14173
14174 cat >>confdefs.h <<EOF
14175 #define _LARGE_FILES $ac_cv_sys_large_files
14176 EOF
14177
14178 fi
14179 rm -rf conftest*
14180 fi
14181
14182         if test "$enable_largefile" != no ; then
14183         echo "$as_me:14183: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14184 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14185 if test "${ac_cv_sys_largefile_source+set}" = set; then
14186   echo $ECHO_N "(cached) $ECHO_C" >&6
14187 else
14188   while :; do
14189   ac_cv_sys_largefile_source=no
14190   cat >"conftest.$ac_ext" <<_ACEOF
14191 #line 14191 "configure"
14192 #include "confdefs.h"
14193 #include <stdio.h>
14194 int
14195 main (void)
14196 {
14197 return !fseeko;
14198   ;
14199   return 0;
14200 }
14201 _ACEOF
14202 rm -f "conftest.$ac_objext"
14203 if { (eval echo "$as_me:14203: \"$ac_compile\"") >&5
14204   (eval $ac_compile) 2>&5
14205   ac_status=$?
14206   echo "$as_me:14206: \$? = $ac_status" >&5
14207   (exit "$ac_status"); } &&
14208          { ac_try='test -s "conftest.$ac_objext"'
14209   { (eval echo "$as_me:14209: \"$ac_try\"") >&5
14210   (eval $ac_try) 2>&5
14211   ac_status=$?
14212   echo "$as_me:14212: \$? = $ac_status" >&5
14213   (exit "$ac_status"); }; }; then
14214   break
14215 else
14216   echo "$as_me: failed program was:" >&5
14217 cat "conftest.$ac_ext" >&5
14218 fi
14219 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14220   cat >"conftest.$ac_ext" <<_ACEOF
14221 #line 14221 "configure"
14222 #include "confdefs.h"
14223 #define _LARGEFILE_SOURCE 1
14224 #include <stdio.h>
14225 int
14226 main (void)
14227 {
14228 return !fseeko;
14229   ;
14230   return 0;
14231 }
14232 _ACEOF
14233 rm -f "conftest.$ac_objext"
14234 if { (eval echo "$as_me:14234: \"$ac_compile\"") >&5
14235   (eval $ac_compile) 2>&5
14236   ac_status=$?
14237   echo "$as_me:14237: \$? = $ac_status" >&5
14238   (exit "$ac_status"); } &&
14239          { ac_try='test -s "conftest.$ac_objext"'
14240   { (eval echo "$as_me:14240: \"$ac_try\"") >&5
14241   (eval $ac_try) 2>&5
14242   ac_status=$?
14243   echo "$as_me:14243: \$? = $ac_status" >&5
14244   (exit "$ac_status"); }; }; then
14245   ac_cv_sys_largefile_source=1; break
14246 else
14247   echo "$as_me: failed program was:" >&5
14248 cat "conftest.$ac_ext" >&5
14249 fi
14250 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14251   break
14252 done
14253 fi
14254 echo "$as_me:14254: result: $ac_cv_sys_largefile_source" >&5
14255 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14256 if test "$ac_cv_sys_largefile_source" != no; then
14257
14258 cat >>confdefs.h <<EOF
14259 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14260 EOF
14261
14262 fi
14263 rm -rf conftest*
14264
14265 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14266 # in glibc 2.1.3, but that breaks too many other things.
14267 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14268 echo "$as_me:14268: checking for fseeko" >&5
14269 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14270 if test "${ac_cv_func_fseeko+set}" = set; then
14271   echo $ECHO_N "(cached) $ECHO_C" >&6
14272 else
14273   cat >"conftest.$ac_ext" <<_ACEOF
14274 #line 14274 "configure"
14275 #include "confdefs.h"
14276 #include <stdio.h>
14277 int
14278 main (void)
14279 {
14280 return fseeko && fseeko (stdin, 0, 0);
14281   ;
14282   return 0;
14283 }
14284 _ACEOF
14285 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14286 if { (eval echo "$as_me:14286: \"$ac_link\"") >&5
14287   (eval $ac_link) 2>&5
14288   ac_status=$?
14289   echo "$as_me:14289: \$? = $ac_status" >&5
14290   (exit "$ac_status"); } &&
14291          { ac_try='test -s "conftest$ac_exeext"'
14292   { (eval echo "$as_me:14292: \"$ac_try\"") >&5
14293   (eval $ac_try) 2>&5
14294   ac_status=$?
14295   echo "$as_me:14295: \$? = $ac_status" >&5
14296   (exit "$ac_status"); }; }; then
14297   ac_cv_func_fseeko=yes
14298 else
14299   echo "$as_me: failed program was:" >&5
14300 cat "conftest.$ac_ext" >&5
14301 ac_cv_func_fseeko=no
14302 fi
14303 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14304 fi
14305 echo "$as_me:14305: result: $ac_cv_func_fseeko" >&5
14306 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14307 if test $ac_cv_func_fseeko = yes; then
14308
14309 cat >>confdefs.h <<\EOF
14310 #define HAVE_FSEEKO 1
14311 EOF
14312
14313 fi
14314
14315         # Normally we would collect these definitions in the config.h,
14316         # but (like _XOPEN_SOURCE), some environments rely on having these
14317         # defined before any of the system headers are included.  Another
14318         # case comes up with C++, e.g., on AIX the compiler compiles the
14319         # header files by themselves before looking at the body files it is
14320         # told to compile.  For ncurses, those header files do not include
14321         # the config.h
14322         if test "$ac_cv_sys_large_files" != no
14323         then
14324
14325         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14326         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14327
14328         fi
14329         if test "$ac_cv_sys_largefile_source" != no
14330         then
14331
14332         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14333         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14334
14335         fi
14336         if test "$ac_cv_sys_file_offset_bits" != no
14337         then
14338
14339         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14340         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14341
14342         fi
14343
14344         echo "$as_me:14344: checking whether to use struct dirent64" >&5
14345 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14346 if test "${cf_cv_struct_dirent64+set}" = set; then
14347   echo $ECHO_N "(cached) $ECHO_C" >&6
14348 else
14349
14350                 cat >"conftest.$ac_ext" <<_ACEOF
14351 #line 14351 "configure"
14352 #include "confdefs.h"
14353
14354 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14355 #include <sys/types.h>
14356 #include <dirent.h>
14357
14358 int
14359 main (void)
14360 {
14361
14362                 /* if transitional largefile support is setup, this is true */
14363                 extern struct dirent64 * readdir(DIR *);
14364                 struct dirent64 *x = readdir((DIR *)0);
14365                 struct dirent *y = readdir((DIR *)0);
14366                 int z = x - y;
14367                 (void)z;
14368
14369   ;
14370   return 0;
14371 }
14372 _ACEOF
14373 rm -f "conftest.$ac_objext"
14374 if { (eval echo "$as_me:14374: \"$ac_compile\"") >&5
14375   (eval $ac_compile) 2>&5
14376   ac_status=$?
14377   echo "$as_me:14377: \$? = $ac_status" >&5
14378   (exit "$ac_status"); } &&
14379          { ac_try='test -s "conftest.$ac_objext"'
14380   { (eval echo "$as_me:14380: \"$ac_try\"") >&5
14381   (eval $ac_try) 2>&5
14382   ac_status=$?
14383   echo "$as_me:14383: \$? = $ac_status" >&5
14384   (exit "$ac_status"); }; }; then
14385   cf_cv_struct_dirent64=yes
14386 else
14387   echo "$as_me: failed program was:" >&5
14388 cat "conftest.$ac_ext" >&5
14389 cf_cv_struct_dirent64=no
14390 fi
14391 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14392
14393 fi
14394 echo "$as_me:14394: result: $cf_cv_struct_dirent64" >&5
14395 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14396         test "$cf_cv_struct_dirent64" = yes &&
14397 cat >>confdefs.h <<\EOF
14398 #define HAVE_STRUCT_DIRENT64 1
14399 EOF
14400
14401         fi
14402
14403 ### Enable compiling-in rcs id's
14404 echo "$as_me:14404: checking if RCS identifiers should be compiled-in" >&5
14405 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14406
14407 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14408 if test "${with_rcs_ids+set}" = set; then
14409   withval="$with_rcs_ids"
14410   with_rcs_ids=$withval
14411 else
14412   with_rcs_ids=no
14413 fi;
14414 echo "$as_me:14414: result: $with_rcs_ids" >&5
14415 echo "${ECHO_T}$with_rcs_ids" >&6
14416 test "$with_rcs_ids" = yes &&
14417 cat >>confdefs.h <<\EOF
14418 #define USE_RCS_IDS 1
14419 EOF
14420
14421 ###############################################################################
14422
14423 ### Note that some functions (such as const) are normally disabled anyway.
14424 echo "$as_me:14424: checking if you want to build with function extensions" >&5
14425 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14426
14427 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14428 if test "${enable_ext_funcs+set}" = set; then
14429   enableval="$enable_ext_funcs"
14430   with_ext_funcs=$enableval
14431 else
14432   with_ext_funcs=yes
14433 fi;
14434 echo "$as_me:14434: result: $with_ext_funcs" >&5
14435 echo "${ECHO_T}$with_ext_funcs" >&6
14436 if test "$with_ext_funcs" = yes ; then
14437         NCURSES_EXT_FUNCS=1
14438
14439 cat >>confdefs.h <<\EOF
14440 #define HAVE_USE_DEFAULT_COLORS 1
14441 EOF
14442
14443 cat >>confdefs.h <<\EOF
14444 #define NCURSES_EXT_FUNCS 1
14445 EOF
14446
14447 else
14448         NCURSES_EXT_FUNCS=0
14449 fi
14450
14451 ###   use option --enable-const to turn on use of const beyond that in XSI.
14452 echo "$as_me:14452: checking for extended use of const keyword" >&5
14453 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14454
14455 # Check whether --enable-const or --disable-const was given.
14456 if test "${enable_const+set}" = set; then
14457   enableval="$enable_const"
14458   with_ext_const=$enableval
14459 else
14460   with_ext_const=no
14461 fi;
14462 echo "$as_me:14462: result: $with_ext_const" >&5
14463 echo "${ECHO_T}$with_ext_const" >&6
14464 NCURSES_CONST='/*nothing*/'
14465 if test "$with_ext_const" = yes ; then
14466         NCURSES_CONST=const
14467 fi
14468
14469 ###############################################################################
14470 # These options are relatively safe to experiment with.
14471
14472 echo "$as_me:14472: checking if you want all development code" >&5
14473 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14474
14475 # Check whether --with-develop or --without-develop was given.
14476 if test "${with_develop+set}" = set; then
14477   withval="$with_develop"
14478   with_develop=$withval
14479 else
14480   with_develop=no
14481 fi;
14482 echo "$as_me:14482: result: $with_develop" >&5
14483 echo "${ECHO_T}$with_develop" >&6
14484
14485 ###############################################################################
14486 # These are just experimental, probably should not be in a package:
14487
14488 # This is still experimental (20080329), but should ultimately be moved to
14489 # the script-block --with-normal, etc.
14490
14491 echo "$as_me:14491: checking if you want to link with the pthread library" >&5
14492 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14493
14494 # Check whether --with-pthread or --without-pthread was given.
14495 if test "${with_pthread+set}" = set; then
14496   withval="$with_pthread"
14497   with_pthread=$withval
14498 else
14499   with_pthread=no
14500 fi;
14501 echo "$as_me:14501: result: $with_pthread" >&5
14502 echo "${ECHO_T}$with_pthread" >&6
14503
14504 if test "$with_pthread" != no ; then
14505         echo "$as_me:14505: checking for pthread.h" >&5
14506 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14507 if test "${ac_cv_header_pthread_h+set}" = set; then
14508   echo $ECHO_N "(cached) $ECHO_C" >&6
14509 else
14510   cat >"conftest.$ac_ext" <<_ACEOF
14511 #line 14511 "configure"
14512 #include "confdefs.h"
14513 #include <pthread.h>
14514 _ACEOF
14515 if { (eval echo "$as_me:14515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14517   ac_status=$?
14518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14519   rm -f conftest.er1
14520   cat conftest.err >&5
14521   echo "$as_me:14521: \$? = $ac_status" >&5
14522   (exit "$ac_status"); } >/dev/null; then
14523   if test -s conftest.err; then
14524     ac_cpp_err=$ac_c_preproc_warn_flag
14525   else
14526     ac_cpp_err=
14527   fi
14528 else
14529   ac_cpp_err=yes
14530 fi
14531 if test -z "$ac_cpp_err"; then
14532   ac_cv_header_pthread_h=yes
14533 else
14534   echo "$as_me: failed program was:" >&5
14535   cat "conftest.$ac_ext" >&5
14536   ac_cv_header_pthread_h=no
14537 fi
14538 rm -f conftest.err "conftest.$ac_ext"
14539 fi
14540 echo "$as_me:14540: result: $ac_cv_header_pthread_h" >&5
14541 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14542 if test "$ac_cv_header_pthread_h" = yes; then
14543
14544 cat >>confdefs.h <<\EOF
14545 #define HAVE_PTHREADS_H 1
14546 EOF
14547
14548         for cf_lib_pthread in pthread c_r
14549         do
14550             echo "$as_me:14550: checking if we can link with the $cf_lib_pthread library" >&5
14551 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14552             cf_save_LIBS="$LIBS"
14553
14554 cf_add_libs="$LIBS"
14555 # reverse order
14556 cf_add_0lib=
14557 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14558 # filter duplicates
14559 for cf_add_1lib in $cf_add_0lib; do
14560         for cf_add_2lib in $cf_add_libs; do
14561                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14562                         cf_add_1lib=
14563                         break
14564                 fi
14565         done
14566         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14567 done
14568 LIBS="$cf_add_libs"
14569
14570             cat >"conftest.$ac_ext" <<_ACEOF
14571 #line 14571 "configure"
14572 #include "confdefs.h"
14573
14574 #include <pthread.h>
14575
14576 int
14577 main (void)
14578 {
14579
14580                 int rc = pthread_create(0,0,0,0);
14581                 int r2 = pthread_mutexattr_settype(0, 0);
14582
14583   ;
14584   return 0;
14585 }
14586 _ACEOF
14587 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14588 if { (eval echo "$as_me:14588: \"$ac_link\"") >&5
14589   (eval $ac_link) 2>&5
14590   ac_status=$?
14591   echo "$as_me:14591: \$? = $ac_status" >&5
14592   (exit "$ac_status"); } &&
14593          { ac_try='test -s "conftest$ac_exeext"'
14594   { (eval echo "$as_me:14594: \"$ac_try\"") >&5
14595   (eval $ac_try) 2>&5
14596   ac_status=$?
14597   echo "$as_me:14597: \$? = $ac_status" >&5
14598   (exit "$ac_status"); }; }; then
14599   with_pthread=yes
14600 else
14601   echo "$as_me: failed program was:" >&5
14602 cat "conftest.$ac_ext" >&5
14603 with_pthread=no
14604 fi
14605 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14606             LIBS="$cf_save_LIBS"
14607             echo "$as_me:14607: result: $with_pthread" >&5
14608 echo "${ECHO_T}$with_pthread" >&6
14609             test "$with_pthread" = yes && break
14610         done
14611
14612         if test "$with_pthread" = yes ; then
14613
14614 cf_add_libs="$LIBS"
14615 # reverse order
14616 cf_add_0lib=
14617 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14618 # filter duplicates
14619 for cf_add_1lib in $cf_add_0lib; do
14620         for cf_add_2lib in $cf_add_libs; do
14621                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14622                         cf_add_1lib=
14623                         break
14624                 fi
14625         done
14626         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14627 done
14628 LIBS="$cf_add_libs"
14629
14630 cat >>confdefs.h <<\EOF
14631 #define HAVE_LIBPTHREADS 1
14632 EOF
14633
14634         else
14635             { { echo "$as_me:14635: error: Cannot link with pthread library" >&5
14636 echo "$as_me: error: Cannot link with pthread library" >&2;}
14637    { (exit 1); exit 1; }; }
14638         fi
14639
14640 fi
14641
14642 fi
14643
14644 echo "$as_me:14644: checking if you want to use weak-symbols for pthreads" >&5
14645 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14646
14647 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14648 if test "${enable_weak_symbols+set}" = set; then
14649   enableval="$enable_weak_symbols"
14650   use_weak_symbols=$withval
14651 else
14652   use_weak_symbols=no
14653 fi;
14654 echo "$as_me:14654: result: $use_weak_symbols" >&5
14655 echo "${ECHO_T}$use_weak_symbols" >&6
14656 if test "$use_weak_symbols" = yes ; then
14657
14658 echo "$as_me:14658: checking if $CC supports weak symbols" >&5
14659 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14660 if test "${cf_cv_weak_symbols+set}" = set; then
14661   echo $ECHO_N "(cached) $ECHO_C" >&6
14662 else
14663
14664 cat >"conftest.$ac_ext" <<_ACEOF
14665 #line 14665 "configure"
14666 #include "confdefs.h"
14667
14668 #include <stdio.h>
14669 int
14670 main (void)
14671 {
14672
14673 #if defined(__GNUC__)
14674 #  if defined __USE_ISOC99
14675 #    define _cat_pragma(exp)    _Pragma(#exp)
14676 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14677 #  else
14678 #    define _weak_pragma(exp)
14679 #  endif
14680 #  define _declare(name)        __extension__ extern __typeof__(name) name
14681 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14682 #endif
14683
14684 weak_symbol(fopen);
14685
14686   ;
14687   return 0;
14688 }
14689 _ACEOF
14690 rm -f "conftest.$ac_objext"
14691 if { (eval echo "$as_me:14691: \"$ac_compile\"") >&5
14692   (eval $ac_compile) 2>&5
14693   ac_status=$?
14694   echo "$as_me:14694: \$? = $ac_status" >&5
14695   (exit "$ac_status"); } &&
14696          { ac_try='test -s "conftest.$ac_objext"'
14697   { (eval echo "$as_me:14697: \"$ac_try\"") >&5
14698   (eval $ac_try) 2>&5
14699   ac_status=$?
14700   echo "$as_me:14700: \$? = $ac_status" >&5
14701   (exit "$ac_status"); }; }; then
14702   cf_cv_weak_symbols=yes
14703 else
14704   echo "$as_me: failed program was:" >&5
14705 cat "conftest.$ac_ext" >&5
14706 cf_cv_weak_symbols=no
14707 fi
14708 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14709
14710 fi
14711 echo "$as_me:14711: result: $cf_cv_weak_symbols" >&5
14712 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14713
14714 else
14715         cf_cv_weak_symbols=no
14716 fi
14717
14718 if test $cf_cv_weak_symbols = yes ; then
14719
14720 cat >>confdefs.h <<\EOF
14721 #define USE_WEAK_SYMBOLS 1
14722 EOF
14723
14724 fi
14725
14726 PTHREAD=
14727 if test "$with_pthread" = "yes" ; then
14728
14729 cat >>confdefs.h <<\EOF
14730 #define USE_PTHREADS 1
14731 EOF
14732
14733         enable_reentrant=yes
14734         if test $cf_cv_weak_symbols = yes ; then
14735                 PTHREAD=-lpthread
14736         fi
14737 fi
14738
14739 # OpenSUSE is installing ncurses6, using reentrant option.
14740 echo "$as_me:14740: checking for _nc_TABSIZE" >&5
14741 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14742 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14743   echo $ECHO_N "(cached) $ECHO_C" >&6
14744 else
14745   cat >"conftest.$ac_ext" <<_ACEOF
14746 #line 14746 "configure"
14747 #include "confdefs.h"
14748 #define _nc_TABSIZE autoconf_temporary
14749 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14750 #undef _nc_TABSIZE
14751
14752 #ifdef __cplusplus
14753 extern "C"
14754 #endif
14755
14756 /* We use char because int might match the return type of a gcc2
14757    builtin and then its argument prototype would still apply.  */
14758 char _nc_TABSIZE (void);
14759
14760 int
14761 main (void)
14762 {
14763
14764 /* The GNU C library defines stubs for functions which it implements
14765     to always fail with ENOSYS.  Some functions are actually named
14766     something starting with __ and the normal name is an alias.  */
14767 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14768 #error found stub for _nc_TABSIZE
14769 #endif
14770
14771         return _nc_TABSIZE ();
14772   ;
14773   return 0;
14774 }
14775 _ACEOF
14776 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14777 if { (eval echo "$as_me:14777: \"$ac_link\"") >&5
14778   (eval $ac_link) 2>&5
14779   ac_status=$?
14780   echo "$as_me:14780: \$? = $ac_status" >&5
14781   (exit "$ac_status"); } &&
14782          { ac_try='test -s "conftest$ac_exeext"'
14783   { (eval echo "$as_me:14783: \"$ac_try\"") >&5
14784   (eval $ac_try) 2>&5
14785   ac_status=$?
14786   echo "$as_me:14786: \$? = $ac_status" >&5
14787   (exit "$ac_status"); }; }; then
14788   ac_cv_func__nc_TABSIZE=yes
14789 else
14790   echo "$as_me: failed program was:" >&5
14791 cat "conftest.$ac_ext" >&5
14792 ac_cv_func__nc_TABSIZE=no
14793 fi
14794 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14795 fi
14796 echo "$as_me:14796: result: $ac_cv_func__nc_TABSIZE" >&5
14797 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14798 if test "$ac_cv_func__nc_TABSIZE" = yes; then
14799   assume_reentrant=yes
14800 else
14801   assume_reentrant=no
14802 fi
14803
14804 # Reentrant code has to be opaque; there's little advantage to making ncurses
14805 # opaque outside of that, so there is no --enable-opaque option.  We can use
14806 # this option without --with-pthreads, but this will be always set for
14807 # pthreads.
14808 echo "$as_me:14808: checking if you want experimental reentrant code" >&5
14809 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14810
14811 # Check whether --enable-reentrant or --disable-reentrant was given.
14812 if test "${enable_reentrant+set}" = set; then
14813   enableval="$enable_reentrant"
14814   with_reentrant=$enableval
14815 else
14816   with_reentrant=$assume_reentrant
14817 fi;
14818 echo "$as_me:14818: result: $with_reentrant" >&5
14819 echo "${ECHO_T}$with_reentrant" >&6
14820 if test "$with_reentrant" = yes ; then
14821         cf_cv_enable_reentrant=1
14822         if test $cf_cv_weak_symbols = yes ; then
14823
14824 # remove pthread library from $LIBS
14825 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14826
14827         elif test "$assume_reentrant" = no ; then
14828                 LIB_SUFFIX="t${LIB_SUFFIX}"
14829         fi
14830
14831 cat >>confdefs.h <<\EOF
14832 #define USE_REENTRANT 1
14833 EOF
14834
14835 else
14836         cf_cv_enable_reentrant=0
14837 fi
14838
14839 ### Allow using a different wrap-prefix
14840 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14841         echo "$as_me:14841: checking for prefix used to wrap public variables" >&5
14842 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14843
14844 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14845 if test "${with_wrap_prefix+set}" = set; then
14846   withval="$with_wrap_prefix"
14847   NCURSES_WRAP_PREFIX=$withval
14848 else
14849   NCURSES_WRAP_PREFIX=_nc_
14850 fi;
14851         echo "$as_me:14851: result: $NCURSES_WRAP_PREFIX" >&5
14852 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14853 else
14854         NCURSES_WRAP_PREFIX=_nc_
14855 fi
14856
14857 cat >>confdefs.h <<EOF
14858 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14859 EOF
14860
14861 ###############################################################################
14862
14863 ###     use option --disable-echo to suppress full display compiling commands
14864
14865 echo "$as_me:14865: checking if you want to see long compiling messages" >&5
14866 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14867
14868 # Check whether --enable-echo or --disable-echo was given.
14869 if test "${enable_echo+set}" = set; then
14870   enableval="$enable_echo"
14871   test "$enableval" != no && enableval=yes
14872         if test "$enableval" != "yes" ; then
14873
14874         ECHO_LT='--silent'
14875         ECHO_LD='@echo linking $@;'
14876         RULE_CC='@echo compiling $<'
14877         SHOW_CC='@echo compiling $@'
14878         ECHO_CC='@'
14879
14880         else
14881
14882         ECHO_LT=''
14883         ECHO_LD=''
14884         RULE_CC=''
14885         SHOW_CC=''
14886         ECHO_CC=''
14887
14888         fi
14889 else
14890   enableval=yes
14891
14892         ECHO_LT=''
14893         ECHO_LD=''
14894         RULE_CC=''
14895         SHOW_CC=''
14896         ECHO_CC=''
14897
14898 fi;
14899 echo "$as_me:14899: result: $enableval" >&5
14900 echo "${ECHO_T}$enableval" >&6
14901
14902 echo "$as_me:14902: checking if you want to use C11 _Noreturn feature" >&5
14903 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
14904
14905 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
14906 if test "${enable_stdnoreturn+set}" = set; then
14907   enableval="$enable_stdnoreturn"
14908   test "$enableval" != yes && enableval=no
14909         if test "$enableval" != "no" ; then
14910     enable_stdnoreturn=yes
14911         else
14912                 enable_stdnoreturn=no
14913         fi
14914 else
14915   enableval=no
14916         enable_stdnoreturn=no
14917
14918 fi;
14919 echo "$as_me:14919: result: $enable_stdnoreturn" >&5
14920 echo "${ECHO_T}$enable_stdnoreturn" >&6
14921
14922 if test $enable_stdnoreturn = yes; then
14923 echo "$as_me:14923: checking for C11 _Noreturn feature" >&5
14924 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
14925 if test "${cf_cv_c11_noreturn+set}" = set; then
14926   echo $ECHO_N "(cached) $ECHO_C" >&6
14927 else
14928   cat >"conftest.$ac_ext" <<_ACEOF
14929 #line 14929 "configure"
14930 #include "confdefs.h"
14931
14932 #include <stdio.h>
14933 #include <stdlib.h>
14934 #include <stdnoreturn.h>
14935 static _Noreturn void giveup(void) { exit(0); }
14936
14937 int
14938 main (void)
14939 {
14940 if (feof(stdin)) giveup()
14941   ;
14942   return 0;
14943 }
14944 _ACEOF
14945 rm -f "conftest.$ac_objext"
14946 if { (eval echo "$as_me:14946: \"$ac_compile\"") >&5
14947   (eval $ac_compile) 2>&5
14948   ac_status=$?
14949   echo "$as_me:14949: \$? = $ac_status" >&5
14950   (exit "$ac_status"); } &&
14951          { ac_try='test -s "conftest.$ac_objext"'
14952   { (eval echo "$as_me:14952: \"$ac_try\"") >&5
14953   (eval $ac_try) 2>&5
14954   ac_status=$?
14955   echo "$as_me:14955: \$? = $ac_status" >&5
14956   (exit "$ac_status"); }; }; then
14957   cf_cv_c11_noreturn=yes
14958 else
14959   echo "$as_me: failed program was:" >&5
14960 cat "conftest.$ac_ext" >&5
14961 cf_cv_c11_noreturn=no
14962 fi
14963 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14964
14965 fi
14966 echo "$as_me:14966: result: $cf_cv_c11_noreturn" >&5
14967 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
14968 else
14969         cf_cv_c11_noreturn=no,
14970 fi
14971
14972 if test "$cf_cv_c11_noreturn" = yes; then
14973
14974 cat >>confdefs.h <<\EOF
14975 #define HAVE_STDNORETURN_H 1
14976 EOF
14977
14978 cat >>confdefs.h <<EOF
14979 #define STDC_NORETURN _Noreturn
14980 EOF
14981
14982         HAVE_STDNORETURN_H=1
14983 else
14984         HAVE_STDNORETURN_H=0
14985 fi
14986
14987 if test "$GCC" = yes || test "$GXX" = yes
14988 then
14989
14990 if test "$GCC" = yes || test "$GXX" = yes
14991 then
14992         case $CFLAGS in
14993         (*-Werror=*)
14994                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14995
14996 echo "${as_me:-configure}:14996: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14997
14998                 cf_temp_flags=
14999                 for cf_temp_scan in $CFLAGS
15000                 do
15001                         case "x$cf_temp_scan" in
15002                         (x-Werror=*)
15003
15004         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15005         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15006
15007                                 ;;
15008                         (*)
15009
15010         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15011         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15012
15013                                 ;;
15014                         esac
15015                 done
15016                 CFLAGS="$cf_temp_flags"
15017                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15018
15019 echo "${as_me:-configure}:15019: testing ... fixed $CFLAGS ..." 1>&5
15020
15021                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15022
15023 echo "${as_me:-configure}:15023: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15024
15025                 ;;
15026         esac
15027 fi
15028
15029 if test "$GCC" = yes || test "$GXX" = yes
15030 then
15031         case $CPPFLAGS in
15032         (*-Werror=*)
15033                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15034
15035 echo "${as_me:-configure}:15035: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15036
15037                 cf_temp_flags=
15038                 for cf_temp_scan in $CPPFLAGS
15039                 do
15040                         case "x$cf_temp_scan" in
15041                         (x-Werror=*)
15042
15043         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15044         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15045
15046                                 ;;
15047                         (*)
15048
15049         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15050         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15051
15052                                 ;;
15053                         esac
15054                 done
15055                 CPPFLAGS="$cf_temp_flags"
15056                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15057
15058 echo "${as_me:-configure}:15058: testing ... fixed $CPPFLAGS ..." 1>&5
15059
15060                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15061
15062 echo "${as_me:-configure}:15062: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15063
15064                 ;;
15065         esac
15066 fi
15067
15068 if test "$GCC" = yes || test "$GXX" = yes
15069 then
15070         case $LDFLAGS in
15071         (*-Werror=*)
15072                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15073
15074 echo "${as_me:-configure}:15074: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15075
15076                 cf_temp_flags=
15077                 for cf_temp_scan in $LDFLAGS
15078                 do
15079                         case "x$cf_temp_scan" in
15080                         (x-Werror=*)
15081
15082         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15083         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15084
15085                                 ;;
15086                         (*)
15087
15088         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15089         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15090
15091                                 ;;
15092                         esac
15093                 done
15094                 LDFLAGS="$cf_temp_flags"
15095                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15096
15097 echo "${as_me:-configure}:15097: testing ... fixed $LDFLAGS ..." 1>&5
15098
15099                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15100
15101 echo "${as_me:-configure}:15101: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15102
15103                 ;;
15104         esac
15105 fi
15106
15107 echo "$as_me:15107: checking if you want to turn on gcc warnings" >&5
15108 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15109
15110 # Check whether --enable-warnings or --disable-warnings was given.
15111 if test "${enable_warnings+set}" = set; then
15112   enableval="$enable_warnings"
15113   test "$enableval" != yes && enableval=no
15114         if test "$enableval" != "no" ; then
15115     enable_warnings=yes
15116         else
15117                 enable_warnings=no
15118         fi
15119 else
15120   enableval=no
15121         enable_warnings=no
15122
15123 fi;
15124 echo "$as_me:15124: result: $enable_warnings" >&5
15125 echo "${ECHO_T}$enable_warnings" >&6
15126 if test "$enable_warnings" = "yes"
15127 then
15128
15129 if test "x$have_x" = xyes; then
15130
15131 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15132 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15133 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15134 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15135 for cf_X_CFLAGS in $X_CFLAGS
15136 do
15137         case "x$cf_X_CFLAGS" in
15138         x-[IUD]*)
15139                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15140                 ;;
15141         *)
15142                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15143                 ;;
15144         esac
15145 done
15146
15147 cat >"conftest.$ac_ext" <<_ACEOF
15148 #line 15148 "configure"
15149 #include "confdefs.h"
15150
15151 #include <stdlib.h>
15152 #include <X11/Intrinsic.h>
15153
15154 int
15155 main (void)
15156 {
15157 String foo = malloc(1); free((void*)foo)
15158   ;
15159   return 0;
15160 }
15161 _ACEOF
15162 rm -f "conftest.$ac_objext"
15163 if { (eval echo "$as_me:15163: \"$ac_compile\"") >&5
15164   (eval $ac_compile) 2>&5
15165   ac_status=$?
15166   echo "$as_me:15166: \$? = $ac_status" >&5
15167   (exit "$ac_status"); } &&
15168          { ac_try='test -s "conftest.$ac_objext"'
15169   { (eval echo "$as_me:15169: \"$ac_try\"") >&5
15170   (eval $ac_try) 2>&5
15171   ac_status=$?
15172   echo "$as_me:15172: \$? = $ac_status" >&5
15173   (exit "$ac_status"); }; }; then
15174
15175 echo "$as_me:15175: checking for X11/Xt const-feature" >&5
15176 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15177 if test "${cf_cv_const_x_string+set}" = set; then
15178   echo $ECHO_N "(cached) $ECHO_C" >&6
15179 else
15180
15181         cat >"conftest.$ac_ext" <<_ACEOF
15182 #line 15182 "configure"
15183 #include "confdefs.h"
15184
15185 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15186 #undef  XTSTRINGDEFINES /* X11R5 and later */
15187 #include <stdlib.h>
15188 #include <X11/Intrinsic.h>
15189
15190 int
15191 main (void)
15192 {
15193 String foo = malloc(1); *foo = 0
15194   ;
15195   return 0;
15196 }
15197 _ACEOF
15198 rm -f "conftest.$ac_objext"
15199 if { (eval echo "$as_me:15199: \"$ac_compile\"") >&5
15200   (eval $ac_compile) 2>&5
15201   ac_status=$?
15202   echo "$as_me:15202: \$? = $ac_status" >&5
15203   (exit "$ac_status"); } &&
15204          { ac_try='test -s "conftest.$ac_objext"'
15205   { (eval echo "$as_me:15205: \"$ac_try\"") >&5
15206   (eval $ac_try) 2>&5
15207   ac_status=$?
15208   echo "$as_me:15208: \$? = $ac_status" >&5
15209   (exit "$ac_status"); }; }; then
15210
15211                         cf_cv_const_x_string=no
15212
15213 else
15214   echo "$as_me: failed program was:" >&5
15215 cat "conftest.$ac_ext" >&5
15216
15217                         cf_cv_const_x_string=yes
15218
15219 fi
15220 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15221
15222 fi
15223 echo "$as_me:15223: result: $cf_cv_const_x_string" >&5
15224 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15225
15226 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15227 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15228 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15229
15230 case "$cf_cv_const_x_string" in
15231 (no)
15232
15233         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15234         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15235
15236         ;;
15237 (*)
15238
15239         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15240         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15241
15242         ;;
15243 esac
15244
15245 else
15246   echo "$as_me: failed program was:" >&5
15247 cat "conftest.$ac_ext" >&5
15248 fi
15249 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15250  fi
15251 cat > "conftest.$ac_ext" <<EOF
15252 #line 15252 "${as_me:-configure}"
15253 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15254 EOF
15255 if test "$INTEL_COMPILER" = yes
15256 then
15257 # The "-wdXXX" options suppress warnings:
15258 # remark #1419: external declaration in primary source file
15259 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15260 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15261 # remark #193: zero used for undefined preprocessing identifier
15262 # remark #593: variable "curs_sb_left_arrow" was set but never used
15263 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15264 # remark #869: parameter "tw" was never referenced
15265 # remark #981: operands are evaluated in unspecified order
15266 # warning #279: controlling expression is constant
15267
15268         { echo "$as_me:15268: checking for $CC warning options..." >&5
15269 echo "$as_me: checking for $CC warning options..." >&6;}
15270         cf_save_CFLAGS="$CFLAGS"
15271         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15272         for cf_opt in \
15273                 wd1419 \
15274                 wd1683 \
15275                 wd1684 \
15276                 wd193 \
15277                 wd593 \
15278                 wd279 \
15279                 wd810 \
15280                 wd869 \
15281                 wd981
15282         do
15283                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15284                 if { (eval echo "$as_me:15284: \"$ac_compile\"") >&5
15285   (eval $ac_compile) 2>&5
15286   ac_status=$?
15287   echo "$as_me:15287: \$? = $ac_status" >&5
15288   (exit "$ac_status"); }; then
15289                         test -n "$verbose" && echo "$as_me:15289: result: ... -$cf_opt" >&5
15290 echo "${ECHO_T}... -$cf_opt" >&6
15291                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15292                 fi
15293         done
15294         CFLAGS="$cf_save_CFLAGS"
15295 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15296 then
15297         { echo "$as_me:15297: checking for $CC warning options..." >&5
15298 echo "$as_me: checking for $CC warning options..." >&6;}
15299         cf_save_CFLAGS="$CFLAGS"
15300         cf_warn_CONST=""
15301         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15302         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15303         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15304         for cf_opt in W Wall \
15305                 Wbad-function-cast \
15306                 Wcast-align \
15307                 Wcast-qual \
15308                 Wdeclaration-after-statement \
15309                 Wextra \
15310                 Winline \
15311                 Wmissing-declarations \
15312                 Wmissing-prototypes \
15313                 Wnested-externs \
15314                 Wpointer-arith \
15315                 Wshadow \
15316                 Wstrict-prototypes \
15317                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15318         do
15319                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15320                 if { (eval echo "$as_me:15320: \"$ac_compile\"") >&5
15321   (eval $ac_compile) 2>&5
15322   ac_status=$?
15323   echo "$as_me:15323: \$? = $ac_status" >&5
15324   (exit "$ac_status"); }; then
15325                         test -n "$verbose" && echo "$as_me:15325: result: ... -$cf_opt" >&5
15326 echo "${ECHO_T}... -$cf_opt" >&6
15327                         case "$cf_opt" in
15328                         (Winline)
15329                                 case "$GCC_VERSION" in
15330                                 ([34].*)
15331                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15332
15333 echo "${as_me:-configure}:15333: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15334
15335                                         continue;;
15336                                 esac
15337                                 ;;
15338                         (Wpointer-arith)
15339                                 case "$GCC_VERSION" in
15340                                 ([12].*)
15341                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15342
15343 echo "${as_me:-configure}:15343: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15344
15345                                         continue;;
15346                                 esac
15347                                 ;;
15348                         esac
15349                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15350                 fi
15351         done
15352         CFLAGS="$cf_save_CFLAGS"
15353 fi
15354 rm -rf ./conftest*
15355
15356 fi
15357
15358 if test "$GCC" = yes || test "$GXX" = yes
15359 then
15360 cat > conftest.i <<EOF
15361 #ifndef GCC_PRINTF
15362 #define GCC_PRINTF 0
15363 #endif
15364 #ifndef GCC_SCANF
15365 #define GCC_SCANF 0
15366 #endif
15367 #ifndef GCC_NORETURN
15368 #define GCC_NORETURN /* nothing */
15369 #endif
15370 #ifndef GCC_UNUSED
15371 #define GCC_UNUSED /* nothing */
15372 #endif
15373 EOF
15374 if test "$GCC" = yes
15375 then
15376         { echo "$as_me:15376: checking for $CC __attribute__ directives..." >&5
15377 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15378 cat > "conftest.$ac_ext" <<EOF
15379 #line 15379 "${as_me:-configure}"
15380 #include "confdefs.h"
15381 #include "conftest.h"
15382 #include "conftest.i"
15383 #if     GCC_PRINTF
15384 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15385 #else
15386 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15387 #endif
15388 #if     GCC_SCANF
15389 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15390 #else
15391 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15392 #endif
15393 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15394 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15395 extern GCC_NORETURN void foo(void);
15396 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15397 EOF
15398         cf_printf_attribute=no
15399         cf_scanf_attribute=no
15400         for cf_attribute in scanf printf unused noreturn
15401         do
15402
15403 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15404
15405                 cf_directive="__attribute__(($cf_attribute))"
15406                 echo "checking for $CC $cf_directive" 1>&5
15407
15408                 case "$cf_attribute" in
15409                 (printf)
15410                         cf_printf_attribute=yes
15411                         cat >conftest.h <<EOF
15412 #define GCC_$cf_ATTRIBUTE 1
15413 EOF
15414                         ;;
15415                 (scanf)
15416                         cf_scanf_attribute=yes
15417                         cat >conftest.h <<EOF
15418 #define GCC_$cf_ATTRIBUTE 1
15419 EOF
15420                         ;;
15421                 (*)
15422                         cat >conftest.h <<EOF
15423 #define GCC_$cf_ATTRIBUTE $cf_directive
15424 EOF
15425                         ;;
15426                 esac
15427
15428                 if { (eval echo "$as_me:15428: \"$ac_compile\"") >&5
15429   (eval $ac_compile) 2>&5
15430   ac_status=$?
15431   echo "$as_me:15431: \$? = $ac_status" >&5
15432   (exit "$ac_status"); }; then
15433                         test -n "$verbose" && echo "$as_me:15433: result: ... $cf_attribute" >&5
15434 echo "${ECHO_T}... $cf_attribute" >&6
15435                         cat conftest.h >>confdefs.h
15436                         case "$cf_attribute" in
15437                         (noreturn)
15438
15439 cat >>confdefs.h <<EOF
15440 #define GCC_NORETURN $cf_directive
15441 EOF
15442
15443                                 ;;
15444                         (printf)
15445                                 cf_value='/* nothing */'
15446                                 if test "$cf_printf_attribute" != no ; then
15447                                         cf_value='__attribute__((format(printf,fmt,var)))'
15448
15449 cat >>confdefs.h <<\EOF
15450 #define GCC_PRINTF 1
15451 EOF
15452
15453                                 fi
15454
15455 cat >>confdefs.h <<EOF
15456 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15457 EOF
15458
15459                                 ;;
15460                         (scanf)
15461                                 cf_value='/* nothing */'
15462                                 if test "$cf_scanf_attribute" != no ; then
15463                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15464
15465 cat >>confdefs.h <<\EOF
15466 #define GCC_SCANF 1
15467 EOF
15468
15469                                 fi
15470
15471 cat >>confdefs.h <<EOF
15472 #define GCC_SCANFLIKE(fmt,var) $cf_value
15473 EOF
15474
15475                                 ;;
15476                         (unused)
15477
15478 cat >>confdefs.h <<EOF
15479 #define GCC_UNUSED $cf_directive
15480 EOF
15481
15482                                 ;;
15483                         esac
15484                 fi
15485         done
15486 else
15487         ${FGREP-fgrep} define conftest.i >>confdefs.h
15488 fi
15489 rm -rf ./conftest*
15490 fi
15491
15492 fi
15493
15494 if test "x$enable_warnings" = "xyes"; then
15495
15496         ADAFLAGS="$ADAFLAGS -gnatg"
15497
15498 fi
15499
15500 ###     use option --enable-assertions to turn on generation of assertion code
15501 echo "$as_me:15501: checking if you want to enable runtime assertions" >&5
15502 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15503
15504 # Check whether --enable-assertions or --disable-assertions was given.
15505 if test "${enable_assertions+set}" = set; then
15506   enableval="$enable_assertions"
15507   with_assertions=$enableval
15508 else
15509   with_assertions=no
15510 fi;
15511 echo "$as_me:15511: result: $with_assertions" >&5
15512 echo "${ECHO_T}$with_assertions" >&6
15513 if test -n "$GCC"
15514 then
15515         if test "$with_assertions" = no
15516         then
15517                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15518         else
15519
15520         ADAFLAGS="$ADAFLAGS -gnata"
15521
15522         fi
15523 fi
15524
15525 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15526
15527 cat >>confdefs.h <<\EOF
15528 #define HAVE_NC_ALLOC_H 1
15529 EOF
15530
15531 ###     use option --enable-expanded to generate certain macros as functions
15532
15533 # Check whether --enable-expanded or --disable-expanded was given.
15534 if test "${enable_expanded+set}" = set; then
15535   enableval="$enable_expanded"
15536   test "$enableval" = yes &&
15537 cat >>confdefs.h <<\EOF
15538 #define NCURSES_EXPANDED 1
15539 EOF
15540
15541 fi;
15542
15543 ###     use option --disable-macros to suppress macros in favor of functions
15544
15545 # Check whether --enable-macros or --disable-macros was given.
15546 if test "${enable_macros+set}" = set; then
15547   enableval="$enable_macros"
15548   test "$enableval" = no &&
15549 cat >>confdefs.h <<\EOF
15550 #define NCURSES_NOMACROS 1
15551 EOF
15552
15553 fi;
15554
15555 # Normally we only add trace() to the debug-library.  Allow this to be
15556 # extended to all models of the ncurses library:
15557 cf_all_traces=no
15558 case "$CFLAGS $CPPFLAGS" in
15559 (*-DTRACE*)
15560         cf_all_traces=yes
15561         ;;
15562 esac
15563
15564 echo "$as_me:15564: checking whether to add trace feature to all models" >&5
15565 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15566
15567 # Check whether --with-trace or --without-trace was given.
15568 if test "${with_trace+set}" = set; then
15569   withval="$with_trace"
15570   cf_with_trace=$withval
15571 else
15572   cf_with_trace=$cf_all_traces
15573 fi;
15574 echo "$as_me:15574: result: $cf_with_trace" >&5
15575 echo "${ECHO_T}$cf_with_trace" >&6
15576
15577 if test "$cf_with_trace" = yes ; then
15578         ADA_TRACE=TRUE
15579
15580 cf_fix_cppflags=no
15581 cf_new_cflags=
15582 cf_new_cppflags=
15583 cf_new_extra_cppflags=
15584
15585 for cf_add_cflags in -DTRACE
15586 do
15587 case "$cf_fix_cppflags" in
15588 (no)
15589         case "$cf_add_cflags" in
15590         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15591                 case "$cf_add_cflags" in
15592                 (-D*)
15593                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15594
15595                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15596                                 && test -z "${cf_tst_cflags}" \
15597                                 && cf_fix_cppflags=yes
15598
15599                         if test "$cf_fix_cppflags" = yes ; then
15600
15601         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15602         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15603
15604                                 continue
15605                         elif test "${cf_tst_cflags}" = "\"'" ; then
15606
15607         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15608         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15609
15610                                 continue
15611                         fi
15612                         ;;
15613                 esac
15614                 case "$CPPFLAGS" in
15615                 (*$cf_add_cflags)
15616                         ;;
15617                 (*)
15618                         case "$cf_add_cflags" in
15619                         (-D*)
15620                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15621
15622 CPPFLAGS=`echo "$CPPFLAGS" | \
15623         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15624                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15625
15626                                 ;;
15627                         esac
15628
15629         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15630         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15631
15632                         ;;
15633                 esac
15634                 ;;
15635         (*)
15636
15637         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15638         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15639
15640                 ;;
15641         esac
15642         ;;
15643 (yes)
15644
15645         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15646         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15647
15648         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15649
15650         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15651                 && test -z "${cf_tst_cflags}" \
15652                 && cf_fix_cppflags=no
15653         ;;
15654 esac
15655 done
15656
15657 if test -n "$cf_new_cflags" ; then
15658
15659         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15660         CFLAGS="${CFLAGS}$cf_new_cflags"
15661
15662 fi
15663
15664 if test -n "$cf_new_cppflags" ; then
15665
15666         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15667         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15668
15669 fi
15670
15671 if test -n "$cf_new_extra_cppflags" ; then
15672
15673         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15674         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15675
15676 fi
15677
15678 else
15679         ADA_TRACE=FALSE
15680 fi
15681
15682 echo "$as_me:15682: checking if we want to use GNAT projects" >&5
15683 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15684
15685 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15686 if test "${enable_gnat_projects+set}" = set; then
15687   enableval="$enable_gnat_projects"
15688   test "$enableval" != no && enableval=yes
15689         if test "$enableval" != "yes" ; then
15690     enable_gnat_projects=no
15691         else
15692                 enable_gnat_projects=yes
15693         fi
15694 else
15695   enableval=yes
15696         enable_gnat_projects=yes
15697
15698 fi;
15699 echo "$as_me:15699: result: $enable_gnat_projects" >&5
15700 echo "${ECHO_T}$enable_gnat_projects" >&6
15701
15702 ###     Checks for libraries.
15703 case $cf_cv_system_name in
15704 (*mingw32*)
15705         ;;
15706 (*)
15707 echo "$as_me:15707: checking for gettimeofday" >&5
15708 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15709 if test "${ac_cv_func_gettimeofday+set}" = set; then
15710   echo $ECHO_N "(cached) $ECHO_C" >&6
15711 else
15712   cat >"conftest.$ac_ext" <<_ACEOF
15713 #line 15713 "configure"
15714 #include "confdefs.h"
15715 #define gettimeofday autoconf_temporary
15716 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15717 #undef gettimeofday
15718
15719 #ifdef __cplusplus
15720 extern "C"
15721 #endif
15722
15723 /* We use char because int might match the return type of a gcc2
15724    builtin and then its argument prototype would still apply.  */
15725 char gettimeofday (void);
15726
15727 int
15728 main (void)
15729 {
15730
15731 /* The GNU C library defines stubs for functions which it implements
15732     to always fail with ENOSYS.  Some functions are actually named
15733     something starting with __ and the normal name is an alias.  */
15734 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15735 #error found stub for gettimeofday
15736 #endif
15737
15738         return gettimeofday ();
15739   ;
15740   return 0;
15741 }
15742 _ACEOF
15743 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15744 if { (eval echo "$as_me:15744: \"$ac_link\"") >&5
15745   (eval $ac_link) 2>&5
15746   ac_status=$?
15747   echo "$as_me:15747: \$? = $ac_status" >&5
15748   (exit "$ac_status"); } &&
15749          { ac_try='test -s "conftest$ac_exeext"'
15750   { (eval echo "$as_me:15750: \"$ac_try\"") >&5
15751   (eval $ac_try) 2>&5
15752   ac_status=$?
15753   echo "$as_me:15753: \$? = $ac_status" >&5
15754   (exit "$ac_status"); }; }; then
15755   ac_cv_func_gettimeofday=yes
15756 else
15757   echo "$as_me: failed program was:" >&5
15758 cat "conftest.$ac_ext" >&5
15759 ac_cv_func_gettimeofday=no
15760 fi
15761 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15762 fi
15763 echo "$as_me:15763: result: $ac_cv_func_gettimeofday" >&5
15764 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15765 if test "$ac_cv_func_gettimeofday" = yes; then
15766   cat >>confdefs.h <<\EOF
15767 #define HAVE_GETTIMEOFDAY 1
15768 EOF
15769
15770 else
15771
15772 echo "$as_me:15772: checking for gettimeofday in -lbsd" >&5
15773 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15774 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15775   echo $ECHO_N "(cached) $ECHO_C" >&6
15776 else
15777   ac_check_lib_save_LIBS=$LIBS
15778 LIBS="-lbsd  $LIBS"
15779 cat >"conftest.$ac_ext" <<_ACEOF
15780 #line 15780 "configure"
15781 #include "confdefs.h"
15782
15783 /* Override any gcc2 internal prototype to avoid an error.  */
15784 #ifdef __cplusplus
15785 extern "C"
15786 #endif
15787 /* We use char because int might match the return type of a gcc2
15788    builtin and then its argument prototype would still apply.  */
15789 char gettimeofday ();
15790 int
15791 main (void)
15792 {
15793 gettimeofday ();
15794   ;
15795   return 0;
15796 }
15797 _ACEOF
15798 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15799 if { (eval echo "$as_me:15799: \"$ac_link\"") >&5
15800   (eval $ac_link) 2>&5
15801   ac_status=$?
15802   echo "$as_me:15802: \$? = $ac_status" >&5
15803   (exit "$ac_status"); } &&
15804          { ac_try='test -s "conftest$ac_exeext"'
15805   { (eval echo "$as_me:15805: \"$ac_try\"") >&5
15806   (eval $ac_try) 2>&5
15807   ac_status=$?
15808   echo "$as_me:15808: \$? = $ac_status" >&5
15809   (exit "$ac_status"); }; }; then
15810   ac_cv_lib_bsd_gettimeofday=yes
15811 else
15812   echo "$as_me: failed program was:" >&5
15813 cat "conftest.$ac_ext" >&5
15814 ac_cv_lib_bsd_gettimeofday=no
15815 fi
15816 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15817 LIBS=$ac_check_lib_save_LIBS
15818 fi
15819 echo "$as_me:15819: result: $ac_cv_lib_bsd_gettimeofday" >&5
15820 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15821 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
15822
15823 cat >>confdefs.h <<\EOF
15824 #define HAVE_GETTIMEOFDAY 1
15825 EOF
15826
15827         LIBS="$LIBS -lbsd"
15828 fi
15829
15830 fi
15831         ;;
15832 esac
15833
15834 ###     Checks for header files.
15835 echo "$as_me:15835: checking for ANSI C header files" >&5
15836 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15837 if test "${ac_cv_header_stdc+set}" = set; then
15838   echo $ECHO_N "(cached) $ECHO_C" >&6
15839 else
15840   cat >"conftest.$ac_ext" <<_ACEOF
15841 #line 15841 "configure"
15842 #include "confdefs.h"
15843 #include <stdlib.h>
15844 #include <stdarg.h>
15845 #include <string.h>
15846 #include <float.h>
15847
15848 _ACEOF
15849 if { (eval echo "$as_me:15849: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15850   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15851   ac_status=$?
15852   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15853   rm -f conftest.er1
15854   cat conftest.err >&5
15855   echo "$as_me:15855: \$? = $ac_status" >&5
15856   (exit "$ac_status"); } >/dev/null; then
15857   if test -s conftest.err; then
15858     ac_cpp_err=$ac_c_preproc_warn_flag
15859   else
15860     ac_cpp_err=
15861   fi
15862 else
15863   ac_cpp_err=yes
15864 fi
15865 if test -z "$ac_cpp_err"; then
15866   ac_cv_header_stdc=yes
15867 else
15868   echo "$as_me: failed program was:" >&5
15869   cat "conftest.$ac_ext" >&5
15870   ac_cv_header_stdc=no
15871 fi
15872 rm -f conftest.err "conftest.$ac_ext"
15873
15874 if test $ac_cv_header_stdc = yes; then
15875   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15876   cat >"conftest.$ac_ext" <<_ACEOF
15877 #line 15877 "configure"
15878 #include "confdefs.h"
15879 #include <string.h>
15880
15881 _ACEOF
15882 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15883   $EGREP "memchr" >/dev/null 2>&1; then
15884   :
15885 else
15886   ac_cv_header_stdc=no
15887 fi
15888 rm -rf conftest*
15889
15890 fi
15891
15892 if test $ac_cv_header_stdc = yes; then
15893   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15894   cat >"conftest.$ac_ext" <<_ACEOF
15895 #line 15895 "configure"
15896 #include "confdefs.h"
15897 #include <stdlib.h>
15898
15899 _ACEOF
15900 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15901   $EGREP "free" >/dev/null 2>&1; then
15902   :
15903 else
15904   ac_cv_header_stdc=no
15905 fi
15906 rm -rf conftest*
15907
15908 fi
15909
15910 if test $ac_cv_header_stdc = yes; then
15911   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15912   if test "$cross_compiling" = yes; then
15913   :
15914 else
15915   cat >"conftest.$ac_ext" <<_ACEOF
15916 #line 15916 "configure"
15917 #include "confdefs.h"
15918 #include <ctype.h>
15919 #if ((' ' & 0x0FF) == 0x020)
15920 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15921 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15922 #else
15923 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15924                      || ('j' <= (c) && (c) <= 'r') \
15925                      || ('s' <= (c) && (c) <= 'z'))
15926 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15927 #endif
15928
15929 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15930 int
15931 main (void)
15932 {
15933   int i;
15934   for (i = 0; i < 256; i++)
15935     if (XOR (islower (i), ISLOWER (i))
15936         || toupper (i) != TOUPPER (i))
15937       $ac_main_return(2);
15938   $ac_main_return (0);
15939 }
15940 _ACEOF
15941 rm -f "conftest$ac_exeext"
15942 if { (eval echo "$as_me:15942: \"$ac_link\"") >&5
15943   (eval $ac_link) 2>&5
15944   ac_status=$?
15945   echo "$as_me:15945: \$? = $ac_status" >&5
15946   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
15947   { (eval echo "$as_me:15947: \"$ac_try\"") >&5
15948   (eval $ac_try) 2>&5
15949   ac_status=$?
15950   echo "$as_me:15950: \$? = $ac_status" >&5
15951   (exit "$ac_status"); }; }; then
15952   :
15953 else
15954   echo "$as_me: program exited with status $ac_status" >&5
15955 echo "$as_me: failed program was:" >&5
15956 cat "conftest.$ac_ext" >&5
15957 ac_cv_header_stdc=no
15958 fi
15959 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
15960 fi
15961 fi
15962 fi
15963 echo "$as_me:15963: result: $ac_cv_header_stdc" >&5
15964 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15965 if test $ac_cv_header_stdc = yes; then
15966
15967 cat >>confdefs.h <<\EOF
15968 #define STDC_HEADERS 1
15969 EOF
15970
15971 fi
15972
15973 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15974
15975 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15976                   inttypes.h stdint.h unistd.h
15977 do
15978 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15979 echo "$as_me:15979: checking for $ac_header" >&5
15980 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15981 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15982   echo $ECHO_N "(cached) $ECHO_C" >&6
15983 else
15984   cat >"conftest.$ac_ext" <<_ACEOF
15985 #line 15985 "configure"
15986 #include "confdefs.h"
15987 $ac_includes_default
15988 #include <$ac_header>
15989 _ACEOF
15990 rm -f "conftest.$ac_objext"
15991 if { (eval echo "$as_me:15991: \"$ac_compile\"") >&5
15992   (eval $ac_compile) 2>&5
15993   ac_status=$?
15994   echo "$as_me:15994: \$? = $ac_status" >&5
15995   (exit "$ac_status"); } &&
15996          { ac_try='test -s "conftest.$ac_objext"'
15997   { (eval echo "$as_me:15997: \"$ac_try\"") >&5
15998   (eval $ac_try) 2>&5
15999   ac_status=$?
16000   echo "$as_me:16000: \$? = $ac_status" >&5
16001   (exit "$ac_status"); }; }; then
16002   eval "$as_ac_Header=yes"
16003 else
16004   echo "$as_me: failed program was:" >&5
16005 cat "conftest.$ac_ext" >&5
16006 eval "$as_ac_Header=no"
16007 fi
16008 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16009 fi
16010 echo "$as_me:16010: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16011 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16012 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16013   cat >>confdefs.h <<EOF
16014 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16015 EOF
16016
16017 fi
16018 done
16019
16020 echo "$as_me:16020: checking for signed char" >&5
16021 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16022 if test "${ac_cv_type_signed_char+set}" = set; then
16023   echo $ECHO_N "(cached) $ECHO_C" >&6
16024 else
16025   cat >"conftest.$ac_ext" <<_ACEOF
16026 #line 16026 "configure"
16027 #include "confdefs.h"
16028 $ac_includes_default
16029 int
16030 main (void)
16031 {
16032 if ((signed char *) 0)
16033   return 0;
16034 if (sizeof (signed char))
16035   return 0;
16036   ;
16037   return 0;
16038 }
16039 _ACEOF
16040 rm -f "conftest.$ac_objext"
16041 if { (eval echo "$as_me:16041: \"$ac_compile\"") >&5
16042   (eval $ac_compile) 2>&5
16043   ac_status=$?
16044   echo "$as_me:16044: \$? = $ac_status" >&5
16045   (exit "$ac_status"); } &&
16046          { ac_try='test -s "conftest.$ac_objext"'
16047   { (eval echo "$as_me:16047: \"$ac_try\"") >&5
16048   (eval $ac_try) 2>&5
16049   ac_status=$?
16050   echo "$as_me:16050: \$? = $ac_status" >&5
16051   (exit "$ac_status"); }; }; then
16052   ac_cv_type_signed_char=yes
16053 else
16054   echo "$as_me: failed program was:" >&5
16055 cat "conftest.$ac_ext" >&5
16056 ac_cv_type_signed_char=no
16057 fi
16058 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16059 fi
16060 echo "$as_me:16060: result: $ac_cv_type_signed_char" >&5
16061 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16062
16063 echo "$as_me:16063: checking size of signed char" >&5
16064 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16065 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16066   echo $ECHO_N "(cached) $ECHO_C" >&6
16067 else
16068   if test "$ac_cv_type_signed_char" = yes; then
16069   if test "$cross_compiling" = yes; then
16070   # Depending upon the size, compute the lo and hi bounds.
16071 cat >"conftest.$ac_ext" <<_ACEOF
16072 #line 16072 "configure"
16073 #include "confdefs.h"
16074 $ac_includes_default
16075 int
16076 main (void)
16077 {
16078 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16079   ;
16080   return 0;
16081 }
16082 _ACEOF
16083 rm -f "conftest.$ac_objext"
16084 if { (eval echo "$as_me:16084: \"$ac_compile\"") >&5
16085   (eval $ac_compile) 2>&5
16086   ac_status=$?
16087   echo "$as_me:16087: \$? = $ac_status" >&5
16088   (exit "$ac_status"); } &&
16089          { ac_try='test -s "conftest.$ac_objext"'
16090   { (eval echo "$as_me:16090: \"$ac_try\"") >&5
16091   (eval $ac_try) 2>&5
16092   ac_status=$?
16093   echo "$as_me:16093: \$? = $ac_status" >&5
16094   (exit "$ac_status"); }; }; then
16095   ac_lo=0 ac_mid=0
16096   while :; do
16097     cat >"conftest.$ac_ext" <<_ACEOF
16098 #line 16098 "configure"
16099 #include "confdefs.h"
16100 $ac_includes_default
16101 int
16102 main (void)
16103 {
16104 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16105   ;
16106   return 0;
16107 }
16108 _ACEOF
16109 rm -f "conftest.$ac_objext"
16110 if { (eval echo "$as_me:16110: \"$ac_compile\"") >&5
16111   (eval $ac_compile) 2>&5
16112   ac_status=$?
16113   echo "$as_me:16113: \$? = $ac_status" >&5
16114   (exit "$ac_status"); } &&
16115          { ac_try='test -s "conftest.$ac_objext"'
16116   { (eval echo "$as_me:16116: \"$ac_try\"") >&5
16117   (eval $ac_try) 2>&5
16118   ac_status=$?
16119   echo "$as_me:16119: \$? = $ac_status" >&5
16120   (exit "$ac_status"); }; }; then
16121   ac_hi=$ac_mid; break
16122 else
16123   echo "$as_me: failed program was:" >&5
16124 cat "conftest.$ac_ext" >&5
16125 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16126 fi
16127 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16128   done
16129 else
16130   echo "$as_me: failed program was:" >&5
16131 cat "conftest.$ac_ext" >&5
16132 ac_hi=-1 ac_mid=-1
16133   while :; do
16134     cat >"conftest.$ac_ext" <<_ACEOF
16135 #line 16135 "configure"
16136 #include "confdefs.h"
16137 $ac_includes_default
16138 int
16139 main (void)
16140 {
16141 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16142   ;
16143   return 0;
16144 }
16145 _ACEOF
16146 rm -f "conftest.$ac_objext"
16147 if { (eval echo "$as_me:16147: \"$ac_compile\"") >&5
16148   (eval $ac_compile) 2>&5
16149   ac_status=$?
16150   echo "$as_me:16150: \$? = $ac_status" >&5
16151   (exit "$ac_status"); } &&
16152          { ac_try='test -s "conftest.$ac_objext"'
16153   { (eval echo "$as_me:16153: \"$ac_try\"") >&5
16154   (eval $ac_try) 2>&5
16155   ac_status=$?
16156   echo "$as_me:16156: \$? = $ac_status" >&5
16157   (exit "$ac_status"); }; }; then
16158   ac_lo=$ac_mid; break
16159 else
16160   echo "$as_me: failed program was:" >&5
16161 cat "conftest.$ac_ext" >&5
16162 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16163 fi
16164 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16165   done
16166 fi
16167 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16168 # Binary search between lo and hi bounds.
16169 while test "x$ac_lo" != "x$ac_hi"; do
16170   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16171   cat >"conftest.$ac_ext" <<_ACEOF
16172 #line 16172 "configure"
16173 #include "confdefs.h"
16174 $ac_includes_default
16175 int
16176 main (void)
16177 {
16178 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16179   ;
16180   return 0;
16181 }
16182 _ACEOF
16183 rm -f "conftest.$ac_objext"
16184 if { (eval echo "$as_me:16184: \"$ac_compile\"") >&5
16185   (eval $ac_compile) 2>&5
16186   ac_status=$?
16187   echo "$as_me:16187: \$? = $ac_status" >&5
16188   (exit "$ac_status"); } &&
16189          { ac_try='test -s "conftest.$ac_objext"'
16190   { (eval echo "$as_me:16190: \"$ac_try\"") >&5
16191   (eval $ac_try) 2>&5
16192   ac_status=$?
16193   echo "$as_me:16193: \$? = $ac_status" >&5
16194   (exit "$ac_status"); }; }; then
16195   ac_hi=$ac_mid
16196 else
16197   echo "$as_me: failed program was:" >&5
16198 cat "conftest.$ac_ext" >&5
16199 ac_lo=`expr "$ac_mid" + 1`
16200 fi
16201 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16202 done
16203 ac_cv_sizeof_signed_char=$ac_lo
16204 else
16205   if test "$cross_compiling" = yes; then
16206   { { echo "$as_me:16206: error: cannot run test program while cross compiling" >&5
16207 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16208    { (exit 1); exit 1; }; }
16209 else
16210   cat >"conftest.$ac_ext" <<_ACEOF
16211 #line 16211 "configure"
16212 #include "confdefs.h"
16213 $ac_includes_default
16214 int
16215 main (void)
16216 {
16217 FILE *f = fopen ("conftest.val", "w");
16218 if (!f)
16219   $ac_main_return (1);
16220 fprintf (f, "%ld", (long)(sizeof (signed char)));
16221 fclose (f);
16222   ;
16223   return 0;
16224 }
16225 _ACEOF
16226 rm -f "conftest$ac_exeext"
16227 if { (eval echo "$as_me:16227: \"$ac_link\"") >&5
16228   (eval $ac_link) 2>&5
16229   ac_status=$?
16230   echo "$as_me:16230: \$? = $ac_status" >&5
16231   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16232   { (eval echo "$as_me:16232: \"$ac_try\"") >&5
16233   (eval $ac_try) 2>&5
16234   ac_status=$?
16235   echo "$as_me:16235: \$? = $ac_status" >&5
16236   (exit "$ac_status"); }; }; then
16237   ac_cv_sizeof_signed_char=`cat conftest.val`
16238 else
16239   echo "$as_me: program exited with status $ac_status" >&5
16240 echo "$as_me: failed program was:" >&5
16241 cat "conftest.$ac_ext" >&5
16242 fi
16243 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16244 fi
16245 fi
16246 rm -f conftest.val
16247 else
16248   ac_cv_sizeof_signed_char=0
16249 fi
16250 fi
16251 echo "$as_me:16251: result: $ac_cv_sizeof_signed_char" >&5
16252 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16253 cat >>confdefs.h <<EOF
16254 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16255 EOF
16256
16257 echo "$as_me:16257: checking for ANSI C header files" >&5
16258 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16259 if test "${ac_cv_header_stdc+set}" = set; then
16260   echo $ECHO_N "(cached) $ECHO_C" >&6
16261 else
16262   cat >"conftest.$ac_ext" <<_ACEOF
16263 #line 16263 "configure"
16264 #include "confdefs.h"
16265 #include <stdlib.h>
16266 #include <stdarg.h>
16267 #include <string.h>
16268 #include <float.h>
16269
16270 _ACEOF
16271 if { (eval echo "$as_me:16271: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16272   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16273   ac_status=$?
16274   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16275   rm -f conftest.er1
16276   cat conftest.err >&5
16277   echo "$as_me:16277: \$? = $ac_status" >&5
16278   (exit "$ac_status"); } >/dev/null; then
16279   if test -s conftest.err; then
16280     ac_cpp_err=$ac_c_preproc_warn_flag
16281   else
16282     ac_cpp_err=
16283   fi
16284 else
16285   ac_cpp_err=yes
16286 fi
16287 if test -z "$ac_cpp_err"; then
16288   ac_cv_header_stdc=yes
16289 else
16290   echo "$as_me: failed program was:" >&5
16291   cat "conftest.$ac_ext" >&5
16292   ac_cv_header_stdc=no
16293 fi
16294 rm -f conftest.err "conftest.$ac_ext"
16295
16296 if test $ac_cv_header_stdc = yes; then
16297   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16298   cat >"conftest.$ac_ext" <<_ACEOF
16299 #line 16299 "configure"
16300 #include "confdefs.h"
16301 #include <string.h>
16302
16303 _ACEOF
16304 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16305   $EGREP "memchr" >/dev/null 2>&1; then
16306   :
16307 else
16308   ac_cv_header_stdc=no
16309 fi
16310 rm -rf conftest*
16311
16312 fi
16313
16314 if test $ac_cv_header_stdc = yes; then
16315   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16316   cat >"conftest.$ac_ext" <<_ACEOF
16317 #line 16317 "configure"
16318 #include "confdefs.h"
16319 #include <stdlib.h>
16320
16321 _ACEOF
16322 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16323   $EGREP "free" >/dev/null 2>&1; then
16324   :
16325 else
16326   ac_cv_header_stdc=no
16327 fi
16328 rm -rf conftest*
16329
16330 fi
16331
16332 if test $ac_cv_header_stdc = yes; then
16333   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16334   if test "$cross_compiling" = yes; then
16335   :
16336 else
16337   cat >"conftest.$ac_ext" <<_ACEOF
16338 #line 16338 "configure"
16339 #include "confdefs.h"
16340 #include <ctype.h>
16341 #if ((' ' & 0x0FF) == 0x020)
16342 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16343 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16344 #else
16345 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16346                      || ('j' <= (c) && (c) <= 'r') \
16347                      || ('s' <= (c) && (c) <= 'z'))
16348 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16349 #endif
16350
16351 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16352 int
16353 main (void)
16354 {
16355   int i;
16356   for (i = 0; i < 256; i++)
16357     if (XOR (islower (i), ISLOWER (i))
16358         || toupper (i) != TOUPPER (i))
16359       $ac_main_return(2);
16360   $ac_main_return (0);
16361 }
16362 _ACEOF
16363 rm -f "conftest$ac_exeext"
16364 if { (eval echo "$as_me:16364: \"$ac_link\"") >&5
16365   (eval $ac_link) 2>&5
16366   ac_status=$?
16367   echo "$as_me:16367: \$? = $ac_status" >&5
16368   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16369   { (eval echo "$as_me:16369: \"$ac_try\"") >&5
16370   (eval $ac_try) 2>&5
16371   ac_status=$?
16372   echo "$as_me:16372: \$? = $ac_status" >&5
16373   (exit "$ac_status"); }; }; then
16374   :
16375 else
16376   echo "$as_me: program exited with status $ac_status" >&5
16377 echo "$as_me: failed program was:" >&5
16378 cat "conftest.$ac_ext" >&5
16379 ac_cv_header_stdc=no
16380 fi
16381 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16382 fi
16383 fi
16384 fi
16385 echo "$as_me:16385: result: $ac_cv_header_stdc" >&5
16386 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16387 if test $ac_cv_header_stdc = yes; then
16388
16389 cat >>confdefs.h <<\EOF
16390 #define STDC_HEADERS 1
16391 EOF
16392
16393 fi
16394
16395 ac_header_dirent=no
16396 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16397   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16398 echo "$as_me:16398: checking for $ac_hdr that defines DIR" >&5
16399 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16400 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16401   echo $ECHO_N "(cached) $ECHO_C" >&6
16402 else
16403   cat >"conftest.$ac_ext" <<_ACEOF
16404 #line 16404 "configure"
16405 #include "confdefs.h"
16406 #include <sys/types.h>
16407 #include <$ac_hdr>
16408
16409 int
16410 main (void)
16411 {
16412 if ((DIR *) 0)
16413 return 0;
16414   ;
16415   return 0;
16416 }
16417 _ACEOF
16418 rm -f "conftest.$ac_objext"
16419 if { (eval echo "$as_me:16419: \"$ac_compile\"") >&5
16420   (eval $ac_compile) 2>&5
16421   ac_status=$?
16422   echo "$as_me:16422: \$? = $ac_status" >&5
16423   (exit "$ac_status"); } &&
16424          { ac_try='test -s "conftest.$ac_objext"'
16425   { (eval echo "$as_me:16425: \"$ac_try\"") >&5
16426   (eval $ac_try) 2>&5
16427   ac_status=$?
16428   echo "$as_me:16428: \$? = $ac_status" >&5
16429   (exit "$ac_status"); }; }; then
16430   eval "$as_ac_Header=yes"
16431 else
16432   echo "$as_me: failed program was:" >&5
16433 cat "conftest.$ac_ext" >&5
16434 eval "$as_ac_Header=no"
16435 fi
16436 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16437 fi
16438 echo "$as_me:16438: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16439 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16440 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16441   cat >>confdefs.h <<EOF
16442 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16443 EOF
16444
16445 ac_header_dirent=$ac_hdr; break
16446 fi
16447
16448 done
16449 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16450 if test $ac_header_dirent = dirent.h; then
16451   echo "$as_me:16451: checking for opendir in -ldir" >&5
16452 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16453 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16454   echo $ECHO_N "(cached) $ECHO_C" >&6
16455 else
16456   ac_check_lib_save_LIBS=$LIBS
16457 LIBS="-ldir  $LIBS"
16458 cat >"conftest.$ac_ext" <<_ACEOF
16459 #line 16459 "configure"
16460 #include "confdefs.h"
16461
16462 /* Override any gcc2 internal prototype to avoid an error.  */
16463 #ifdef __cplusplus
16464 extern "C"
16465 #endif
16466 /* We use char because int might match the return type of a gcc2
16467    builtin and then its argument prototype would still apply.  */
16468 char opendir ();
16469 int
16470 main (void)
16471 {
16472 opendir ();
16473   ;
16474   return 0;
16475 }
16476 _ACEOF
16477 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16478 if { (eval echo "$as_me:16478: \"$ac_link\"") >&5
16479   (eval $ac_link) 2>&5
16480   ac_status=$?
16481   echo "$as_me:16481: \$? = $ac_status" >&5
16482   (exit "$ac_status"); } &&
16483          { ac_try='test -s "conftest$ac_exeext"'
16484   { (eval echo "$as_me:16484: \"$ac_try\"") >&5
16485   (eval $ac_try) 2>&5
16486   ac_status=$?
16487   echo "$as_me:16487: \$? = $ac_status" >&5
16488   (exit "$ac_status"); }; }; then
16489   ac_cv_lib_dir_opendir=yes
16490 else
16491   echo "$as_me: failed program was:" >&5
16492 cat "conftest.$ac_ext" >&5
16493 ac_cv_lib_dir_opendir=no
16494 fi
16495 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16496 LIBS=$ac_check_lib_save_LIBS
16497 fi
16498 echo "$as_me:16498: result: $ac_cv_lib_dir_opendir" >&5
16499 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16500 if test "$ac_cv_lib_dir_opendir" = yes; then
16501   LIBS="$LIBS -ldir"
16502 fi
16503
16504 else
16505   echo "$as_me:16505: checking for opendir in -lx" >&5
16506 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16507 if test "${ac_cv_lib_x_opendir+set}" = set; then
16508   echo $ECHO_N "(cached) $ECHO_C" >&6
16509 else
16510   ac_check_lib_save_LIBS=$LIBS
16511 LIBS="-lx  $LIBS"
16512 cat >"conftest.$ac_ext" <<_ACEOF
16513 #line 16513 "configure"
16514 #include "confdefs.h"
16515
16516 /* Override any gcc2 internal prototype to avoid an error.  */
16517 #ifdef __cplusplus
16518 extern "C"
16519 #endif
16520 /* We use char because int might match the return type of a gcc2
16521    builtin and then its argument prototype would still apply.  */
16522 char opendir ();
16523 int
16524 main (void)
16525 {
16526 opendir ();
16527   ;
16528   return 0;
16529 }
16530 _ACEOF
16531 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16532 if { (eval echo "$as_me:16532: \"$ac_link\"") >&5
16533   (eval $ac_link) 2>&5
16534   ac_status=$?
16535   echo "$as_me:16535: \$? = $ac_status" >&5
16536   (exit "$ac_status"); } &&
16537          { ac_try='test -s "conftest$ac_exeext"'
16538   { (eval echo "$as_me:16538: \"$ac_try\"") >&5
16539   (eval $ac_try) 2>&5
16540   ac_status=$?
16541   echo "$as_me:16541: \$? = $ac_status" >&5
16542   (exit "$ac_status"); }; }; then
16543   ac_cv_lib_x_opendir=yes
16544 else
16545   echo "$as_me: failed program was:" >&5
16546 cat "conftest.$ac_ext" >&5
16547 ac_cv_lib_x_opendir=no
16548 fi
16549 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16550 LIBS=$ac_check_lib_save_LIBS
16551 fi
16552 echo "$as_me:16552: result: $ac_cv_lib_x_opendir" >&5
16553 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16554 if test "$ac_cv_lib_x_opendir" = yes; then
16555   LIBS="$LIBS -lx"
16556 fi
16557
16558 fi
16559
16560 echo "$as_me:16560: checking whether time.h and sys/time.h may both be included" >&5
16561 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16562 if test "${ac_cv_header_time+set}" = set; then
16563   echo $ECHO_N "(cached) $ECHO_C" >&6
16564 else
16565   cat >"conftest.$ac_ext" <<_ACEOF
16566 #line 16566 "configure"
16567 #include "confdefs.h"
16568 #include <sys/types.h>
16569 #include <sys/time.h>
16570 #include <time.h>
16571
16572 int
16573 main (void)
16574 {
16575 if ((struct tm *) 0)
16576 return 0;
16577   ;
16578   return 0;
16579 }
16580 _ACEOF
16581 rm -f "conftest.$ac_objext"
16582 if { (eval echo "$as_me:16582: \"$ac_compile\"") >&5
16583   (eval $ac_compile) 2>&5
16584   ac_status=$?
16585   echo "$as_me:16585: \$? = $ac_status" >&5
16586   (exit "$ac_status"); } &&
16587          { ac_try='test -s "conftest.$ac_objext"'
16588   { (eval echo "$as_me:16588: \"$ac_try\"") >&5
16589   (eval $ac_try) 2>&5
16590   ac_status=$?
16591   echo "$as_me:16591: \$? = $ac_status" >&5
16592   (exit "$ac_status"); }; }; then
16593   ac_cv_header_time=yes
16594 else
16595   echo "$as_me: failed program was:" >&5
16596 cat "conftest.$ac_ext" >&5
16597 ac_cv_header_time=no
16598 fi
16599 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16600 fi
16601 echo "$as_me:16601: result: $ac_cv_header_time" >&5
16602 echo "${ECHO_T}$ac_cv_header_time" >&6
16603 if test $ac_cv_header_time = yes; then
16604
16605 cat >>confdefs.h <<\EOF
16606 #define TIME_WITH_SYS_TIME 1
16607 EOF
16608
16609 fi
16610
16611 ###     checks for compiler characteristics
16612 ac_ext=c
16613 ac_cpp='$CPP $CPPFLAGS'
16614 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16615 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16616 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16617 ac_main_return="return"
16618
16619 echo "$as_me:16619: checking for an ANSI C-conforming const" >&5
16620 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16621 if test "${ac_cv_c_const+set}" = set; then
16622   echo $ECHO_N "(cached) $ECHO_C" >&6
16623 else
16624   cat >"conftest.$ac_ext" <<_ACEOF
16625 #line 16625 "configure"
16626 #include "confdefs.h"
16627
16628 int
16629 main (void)
16630 {
16631 /* FIXME: Include the comments suggested by Paul. */
16632 #ifndef __cplusplus
16633   /* Ultrix mips cc rejects this.  */
16634   typedef int charset[2];
16635   const charset x;
16636   /* SunOS 4.1.1 cc rejects this.  */
16637   char const *const *ccp;
16638   char **p;
16639   /* NEC SVR4.0.2 mips cc rejects this.  */
16640   struct point {int x, y;};
16641   static struct point const zero = {0,0};
16642   /* AIX XL C 1.02.0.0 rejects this.
16643      It does not let you subtract one const X* pointer from another in
16644      an arm of an if-expression whose if-part is not a constant
16645      expression */
16646   const char *g = "string";
16647   ccp = &g + (g ? g-g : 0);
16648   /* HPUX 7.0 cc rejects these. */
16649   ++ccp;
16650   p = (char**) ccp;
16651   ccp = (char const *const *) p;
16652   { /* SCO 3.2v4 cc rejects this.  */
16653     char *t;
16654     char const *s = 0 ? (char *) 0 : (char const *) 0;
16655
16656     *t++ = 0;
16657   }
16658   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16659     int x[] = {25, 17};
16660     const int *foo = &x[0];
16661     ++foo;
16662   }
16663   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16664     typedef const int *iptr;
16665     iptr p = 0;
16666     ++p;
16667   }
16668   { /* AIX XL C 1.02.0.0 rejects this saying
16669        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16670     struct s { int j; const int *ap[3]; };
16671     struct s *b; b->j = 5;
16672   }
16673   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16674     const int foo = 10;
16675   }
16676 #endif
16677
16678   ;
16679   return 0;
16680 }
16681 _ACEOF
16682 rm -f "conftest.$ac_objext"
16683 if { (eval echo "$as_me:16683: \"$ac_compile\"") >&5
16684   (eval $ac_compile) 2>&5
16685   ac_status=$?
16686   echo "$as_me:16686: \$? = $ac_status" >&5
16687   (exit "$ac_status"); } &&
16688          { ac_try='test -s "conftest.$ac_objext"'
16689   { (eval echo "$as_me:16689: \"$ac_try\"") >&5
16690   (eval $ac_try) 2>&5
16691   ac_status=$?
16692   echo "$as_me:16692: \$? = $ac_status" >&5
16693   (exit "$ac_status"); }; }; then
16694   ac_cv_c_const=yes
16695 else
16696   echo "$as_me: failed program was:" >&5
16697 cat "conftest.$ac_ext" >&5
16698 ac_cv_c_const=no
16699 fi
16700 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16701 fi
16702 echo "$as_me:16702: result: $ac_cv_c_const" >&5
16703 echo "${ECHO_T}$ac_cv_c_const" >&6
16704 if test $ac_cv_c_const = no; then
16705
16706 cat >>confdefs.h <<\EOF
16707 #define const
16708 EOF
16709
16710 fi
16711
16712 ###     Checks for external-data
16713
16714 echo "$as_me:16714: checking if data-only library module links" >&5
16715 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16716 if test "${cf_cv_link_dataonly+set}" = set; then
16717   echo $ECHO_N "(cached) $ECHO_C" >&6
16718 else
16719
16720         rm -f conftest.a
16721         cat >conftest.$ac_ext <<EOF
16722 #line 16722 "configure"
16723 int     testdata[3] = { 123, 456, 789 };
16724 EOF
16725         if { (eval echo "$as_me:16725: \"$ac_compile\"") >&5
16726   (eval $ac_compile) 2>&5
16727   ac_status=$?
16728   echo "$as_me:16728: \$? = $ac_status" >&5
16729   (exit "$ac_status"); } ; then
16730                 mv conftest.o data.o && \
16731                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16732         fi
16733         rm -f conftest.$ac_ext data.o
16734         cat >conftest.$ac_ext <<EOF
16735 #line 16735 "configure"
16736 int     testfunc(void)
16737 {
16738 #if defined(NeXT)
16739         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16740 #else
16741         extern int testdata[3];
16742         return testdata[0] == 123
16743            &&  testdata[1] == 456
16744            &&  testdata[2] == 789;
16745 #endif
16746 }
16747 EOF
16748         if { (eval echo "$as_me:16748: \"$ac_compile\"") >&5
16749   (eval $ac_compile) 2>&5
16750   ac_status=$?
16751   echo "$as_me:16751: \$? = $ac_status" >&5
16752   (exit "$ac_status"); }; then
16753                 mv conftest.o func.o && \
16754                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16755         fi
16756         rm -f conftest.$ac_ext func.o
16757         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16758         cf_saveLIBS="$LIBS"
16759         LIBS="conftest.a $LIBS"
16760         if test "$cross_compiling" = yes; then
16761   cf_cv_link_dataonly=unknown
16762 else
16763   cat >"conftest.$ac_ext" <<_ACEOF
16764 #line 16764 "configure"
16765 #include "confdefs.h"
16766
16767         int main(void)
16768         {
16769                 extern int testfunc();
16770                 ${cf_cv_main_return:-return} (!testfunc());
16771         }
16772
16773 _ACEOF
16774 rm -f "conftest$ac_exeext"
16775 if { (eval echo "$as_me:16775: \"$ac_link\"") >&5
16776   (eval $ac_link) 2>&5
16777   ac_status=$?
16778   echo "$as_me:16778: \$? = $ac_status" >&5
16779   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16780   { (eval echo "$as_me:16780: \"$ac_try\"") >&5
16781   (eval $ac_try) 2>&5
16782   ac_status=$?
16783   echo "$as_me:16783: \$? = $ac_status" >&5
16784   (exit "$ac_status"); }; }; then
16785   cf_cv_link_dataonly=yes
16786 else
16787   echo "$as_me: program exited with status $ac_status" >&5
16788 echo "$as_me: failed program was:" >&5
16789 cat "conftest.$ac_ext" >&5
16790 cf_cv_link_dataonly=no
16791 fi
16792 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16793 fi
16794         LIBS="$cf_saveLIBS"
16795
16796 fi
16797
16798 echo "$as_me:16798: result: $cf_cv_link_dataonly" >&5
16799 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16800
16801 if test "$cf_cv_link_dataonly" = no ; then
16802
16803 cat >>confdefs.h <<\EOF
16804 #define BROKEN_LINKER 1
16805 EOF
16806
16807         BROKEN_LINKER=1
16808 fi
16809
16810 ###     Checks for library functions.
16811
16812 for ac_header in \
16813 unistd.h \
16814
16815 do
16816 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16817 echo "$as_me:16817: checking for $ac_header" >&5
16818 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16819 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16820   echo $ECHO_N "(cached) $ECHO_C" >&6
16821 else
16822   cat >"conftest.$ac_ext" <<_ACEOF
16823 #line 16823 "configure"
16824 #include "confdefs.h"
16825 #include <$ac_header>
16826 _ACEOF
16827 if { (eval echo "$as_me:16827: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16828   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16829   ac_status=$?
16830   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16831   rm -f conftest.er1
16832   cat conftest.err >&5
16833   echo "$as_me:16833: \$? = $ac_status" >&5
16834   (exit "$ac_status"); } >/dev/null; then
16835   if test -s conftest.err; then
16836     ac_cpp_err=$ac_c_preproc_warn_flag
16837   else
16838     ac_cpp_err=
16839   fi
16840 else
16841   ac_cpp_err=yes
16842 fi
16843 if test -z "$ac_cpp_err"; then
16844   eval "$as_ac_Header=yes"
16845 else
16846   echo "$as_me: failed program was:" >&5
16847   cat "conftest.$ac_ext" >&5
16848   eval "$as_ac_Header=no"
16849 fi
16850 rm -f conftest.err "conftest.$ac_ext"
16851 fi
16852 echo "$as_me:16852: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16853 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16854 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16855   cat >>confdefs.h <<EOF
16856 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16857 EOF
16858
16859 fi
16860 done
16861
16862 echo "$as_me:16862: checking for working mkstemp" >&5
16863 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16864 if test "${cf_cv_func_mkstemp+set}" = set; then
16865   echo $ECHO_N "(cached) $ECHO_C" >&6
16866 else
16867
16868 rm -rf ./conftest*
16869 if test "$cross_compiling" = yes; then
16870   cf_cv_func_mkstemp=maybe
16871 else
16872   cat >"conftest.$ac_ext" <<_ACEOF
16873 #line 16873 "configure"
16874 #include "confdefs.h"
16875
16876 #include <sys/types.h>
16877 #ifdef HAVE_UNISTD_H
16878 #include <unistd.h>
16879 #endif
16880 #include <stdlib.h>
16881 #include <stdio.h>
16882 #include <string.h>
16883 #include <sys/stat.h>
16884 int main(void)
16885 {
16886         char *tmpl = "conftestXXXXXX";
16887         char name[2][80];
16888         int n;
16889         int result = 0;
16890         int fd;
16891         struct stat sb;
16892
16893         umask(077);
16894         for (n = 0; n < 2; ++n) {
16895                 strcpy(name[n], tmpl);
16896                 if ((fd = mkstemp(name[n])) >= 0) {
16897                         if (!strcmp(name[n], tmpl)
16898                          || stat(name[n], &sb) != 0
16899                          || (sb.st_mode & S_IFMT) != S_IFREG
16900                          || (sb.st_mode & 077) != 0) {
16901                                 result = 1;
16902                         }
16903                         close(fd);
16904                 }
16905         }
16906         if (result == 0
16907          && !strcmp(name[0], name[1]))
16908                 result = 1;
16909         ${cf_cv_main_return:-return}(result);
16910 }
16911
16912 _ACEOF
16913 rm -f "conftest$ac_exeext"
16914 if { (eval echo "$as_me:16914: \"$ac_link\"") >&5
16915   (eval $ac_link) 2>&5
16916   ac_status=$?
16917   echo "$as_me:16917: \$? = $ac_status" >&5
16918   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16919   { (eval echo "$as_me:16919: \"$ac_try\"") >&5
16920   (eval $ac_try) 2>&5
16921   ac_status=$?
16922   echo "$as_me:16922: \$? = $ac_status" >&5
16923   (exit "$ac_status"); }; }; then
16924   cf_cv_func_mkstemp=yes
16925
16926 else
16927   echo "$as_me: program exited with status $ac_status" >&5
16928 echo "$as_me: failed program was:" >&5
16929 cat "conftest.$ac_ext" >&5
16930 cf_cv_func_mkstemp=no
16931
16932 fi
16933 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16934 fi
16935
16936 fi
16937 echo "$as_me:16937: result: $cf_cv_func_mkstemp" >&5
16938 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16939 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16940         echo "$as_me:16940: checking for mkstemp" >&5
16941 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16942 if test "${ac_cv_func_mkstemp+set}" = set; then
16943   echo $ECHO_N "(cached) $ECHO_C" >&6
16944 else
16945   cat >"conftest.$ac_ext" <<_ACEOF
16946 #line 16946 "configure"
16947 #include "confdefs.h"
16948 #define mkstemp autoconf_temporary
16949 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16950 #undef mkstemp
16951
16952 #ifdef __cplusplus
16953 extern "C"
16954 #endif
16955
16956 /* We use char because int might match the return type of a gcc2
16957    builtin and then its argument prototype would still apply.  */
16958 char mkstemp (void);
16959
16960 int
16961 main (void)
16962 {
16963
16964 /* The GNU C library defines stubs for functions which it implements
16965     to always fail with ENOSYS.  Some functions are actually named
16966     something starting with __ and the normal name is an alias.  */
16967 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16968 #error found stub for mkstemp
16969 #endif
16970
16971         return mkstemp ();
16972   ;
16973   return 0;
16974 }
16975 _ACEOF
16976 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16977 if { (eval echo "$as_me:16977: \"$ac_link\"") >&5
16978   (eval $ac_link) 2>&5
16979   ac_status=$?
16980   echo "$as_me:16980: \$? = $ac_status" >&5
16981   (exit "$ac_status"); } &&
16982          { ac_try='test -s "conftest$ac_exeext"'
16983   { (eval echo "$as_me:16983: \"$ac_try\"") >&5
16984   (eval $ac_try) 2>&5
16985   ac_status=$?
16986   echo "$as_me:16986: \$? = $ac_status" >&5
16987   (exit "$ac_status"); }; }; then
16988   ac_cv_func_mkstemp=yes
16989 else
16990   echo "$as_me: failed program was:" >&5
16991 cat "conftest.$ac_ext" >&5
16992 ac_cv_func_mkstemp=no
16993 fi
16994 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16995 fi
16996 echo "$as_me:16996: result: $ac_cv_func_mkstemp" >&5
16997 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16998
16999 fi
17000 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17001
17002 cat >>confdefs.h <<\EOF
17003 #define HAVE_MKSTEMP 1
17004 EOF
17005
17006 fi
17007
17008 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17009         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17010         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17011 fi
17012
17013 cf_with_ada=yes
17014 if test "$cf_with_ada" != "no" ; then
17015
17016 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17017 do
17018
17019 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17020
17021         unset ac_cv_path_cf_TEMP_gnat
17022         unset cf_TEMP_gnat
17023         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17024 set dummy $cf_prog_gnat; ac_word=$2
17025 echo "$as_me:17025: checking for $ac_word" >&5
17026 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17027 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17028   echo $ECHO_N "(cached) $ECHO_C" >&6
17029 else
17030   case $cf_TEMP_gnat in
17031   [\\/]* | ?:[\\/]*)
17032   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17033   ;;
17034   *)
17035   ac_save_IFS=$IFS; IFS=$ac_path_separator
17036 ac_dummy="$PATH"
17037 for ac_dir in $ac_dummy; do
17038   IFS=$ac_save_IFS
17039   test -z "$ac_dir" && ac_dir=.
17040   if $as_executable_p "$ac_dir/$ac_word"; then
17041    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17042    echo "$as_me:17042: found $ac_dir/$ac_word" >&5
17043    break
17044 fi
17045 done
17046
17047   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17048   ;;
17049 esac
17050 fi
17051 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17052
17053 if test -n "$cf_TEMP_gnat"; then
17054   echo "$as_me:17054: result: $cf_TEMP_gnat" >&5
17055 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17056 else
17057   echo "$as_me:17057: result: no" >&5
17058 echo "${ECHO_T}no" >&6
17059 fi
17060
17061         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17062
17063         if test "x$cf_TEMP_gnat" != xno; then
17064                 unset cf_cv_gnat_version
17065                 unset cf_TEMP_gnat
17066
17067 echo "$as_me:17067: checking for $cf_prog_gnat version" >&5
17068 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17069 if test "${cf_cv_gnat_version+set}" = set; then
17070   echo $ECHO_N "(cached) $ECHO_C" >&6
17071 else
17072
17073 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17074         grep '[0-9].[0-9][0-9]*' |\
17075         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17076
17077 fi
17078 echo "$as_me:17078: result: $cf_cv_gnat_version" >&5
17079 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17080 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17081 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17082
17083         fi
17084         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17085
17086         unset cf_TEMP_gnat
17087         unset cf_cv_gnat_version
17088         unset ac_cv_path_cf_TEMP_gnat
17089 done
17090
17091 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17092         cf_ada_make=
17093         cf_cv_prog_gnat_correct=no
17094 else
17095         cf_ada_make=gnatmake
17096         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17097                 # gprconfig is newer than gnatmake; we can continue...
17098                 cf_ada_config="##"
17099         else
17100                 rm -rf ./conftest* ./*~conftest*
17101                 if mkdir conftest.src
17102                 then
17103                         cf_ada_config=""
17104                         cd conftest.src
17105                         for cf_gprconfig in Ada C
17106                         do
17107                                 echo "$as_me:17107: checking for gprconfig name for $cf_gprconfig" >&5
17108 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17109                                 if test "$cf_gprconfig" = C
17110                                 then
17111                                         for cf_gprconfig_param in \
17112                                                 "$cf_gprconfig,,,,GNATGCC" \
17113                                                 "$cf_gprconfig,,,,GCC" \
17114                                                 "$cf_gprconfig"
17115                                         do
17116                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17117                                                 test -n "$cf_gprconfig_value" && break
17118                                         done
17119                                 else
17120                                         cf_gprconfig_param=$cf_gprconfig
17121                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17122                                 fi
17123                                 if test -n "$cf_gprconfig_value"
17124                                 then
17125                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17126                                         echo "$as_me:17126: result: $cf_gprconfig_value" >&5
17127 echo "${ECHO_T}$cf_gprconfig_value" >&6
17128                                 else
17129                                         echo "$as_me:17129: result: missing" >&5
17130 echo "${ECHO_T}missing" >&6
17131                                         cf_ada_config="#"
17132                                         break
17133                                 fi
17134                         done
17135                         cd ..
17136                         rm -rf ./conftest* ./*~conftest*
17137                 fi
17138         fi
17139         if test "x$cf_ada_config" != "x#"
17140         then
17141
17142 echo "$as_me:17142: checking for gnat version" >&5
17143 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17144 if test "${cf_cv_gnat_version+set}" = set; then
17145   echo $ECHO_N "(cached) $ECHO_C" >&6
17146 else
17147
17148 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17149         grep '[0-9].[0-9][0-9]*' |\
17150         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17151
17152 fi
17153 echo "$as_me:17153: result: $cf_cv_gnat_version" >&5
17154 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17155 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17156
17157 case "$cf_cv_gnat_version" in
17158 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17159         cf_cv_prog_gnat_correct=yes
17160         ;;
17161 (*)
17162         { echo "$as_me:17162: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17163 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17164         cf_cv_prog_gnat_correct=no
17165         ;;
17166 esac
17167
17168                 # Extract the first word of "m4", so it can be a program name with args.
17169 set dummy m4; ac_word=$2
17170 echo "$as_me:17170: checking for $ac_word" >&5
17171 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17172 if test "${ac_cv_prog_M4_exists+set}" = set; then
17173   echo $ECHO_N "(cached) $ECHO_C" >&6
17174 else
17175   if test -n "$M4_exists"; then
17176   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17177 else
17178   ac_save_IFS=$IFS; IFS=$ac_path_separator
17179 ac_dummy="$PATH"
17180 for ac_dir in $ac_dummy; do
17181   IFS=$ac_save_IFS
17182   test -z "$ac_dir" && ac_dir=.
17183   $as_executable_p "$ac_dir/$ac_word" || continue
17184 ac_cv_prog_M4_exists="yes"
17185 echo "$as_me:17185: found $ac_dir/$ac_word" >&5
17186 break
17187 done
17188
17189   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17190 fi
17191 fi
17192 M4_exists=$ac_cv_prog_M4_exists
17193 if test -n "$M4_exists"; then
17194   echo "$as_me:17194: result: $M4_exists" >&5
17195 echo "${ECHO_T}$M4_exists" >&6
17196 else
17197   echo "$as_me:17197: result: no" >&5
17198 echo "${ECHO_T}no" >&6
17199 fi
17200
17201                 if test "$ac_cv_prog_M4_exists" = no; then
17202                         cf_cv_prog_gnat_correct=no
17203                         { echo "$as_me:17203: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17204 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17205                 fi
17206                 if test "$cf_cv_prog_gnat_correct" = yes; then
17207                         echo "$as_me:17207: checking if GNAT works" >&5
17208 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17209
17210 rm -rf ./conftest* ./*~conftest*
17211 cat >>conftest.ads <<CF_EOF
17212 procedure conftest;
17213 CF_EOF
17214 cat >>conftest.adb <<CF_EOF
17215 with Text_IO;
17216 with GNAT.OS_Lib;
17217 procedure conftest is
17218 begin
17219    Text_IO.Put ("Hello World");
17220    Text_IO.New_Line;
17221    GNAT.OS_Lib.OS_Exit (0);
17222 end conftest;
17223 CF_EOF
17224 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17225    if ( ./conftest 1>&5 2>&1 ) ; then
17226       cf_cv_prog_gnat_correct=yes
17227    else
17228       cf_cv_prog_gnat_correct=no
17229    fi
17230 else
17231    cf_cv_prog_gnat_correct=no
17232 fi
17233 rm -rf ./conftest* ./*~conftest*
17234
17235                         echo "$as_me:17235: result: $cf_cv_prog_gnat_correct" >&5
17236 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17237                 fi
17238         else
17239                 cf_cv_prog_gnat_correct=no
17240         fi
17241 fi
17242
17243         if test "$cf_cv_prog_gnat_correct" = yes; then
17244
17245         echo "$as_me:17245: checking optimization options for ADAFLAGS" >&5
17246 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17247         case "$CFLAGS" in
17248         (*-g*)
17249
17250         ADAFLAGS="$ADAFLAGS -g"
17251
17252                 ;;
17253         esac
17254         case "$CFLAGS" in
17255         (*-O*)
17256                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17257
17258         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17259
17260                 ;;
17261         esac
17262         echo "$as_me:17262: result: $ADAFLAGS" >&5
17263 echo "${ECHO_T}$ADAFLAGS" >&6
17264
17265 echo "$as_me:17265: checking if GNATPREP supports -T option" >&5
17266 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17267 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17268   echo $ECHO_N "(cached) $ECHO_C" >&6
17269 else
17270
17271 cf_cv_gnatprep_opt_t=no
17272 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17273
17274 fi
17275 echo "$as_me:17275: result: $cf_cv_gnatprep_opt_t" >&5
17276 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17277 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17278
17279 echo "$as_me:17279: checking if GNAT supports generics" >&5
17280 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17281 case "$cf_cv_gnat_version" in
17282 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17283         cf_gnat_generics=yes
17284         ;;
17285 (*)
17286         cf_gnat_generics=no
17287         ;;
17288 esac
17289 echo "$as_me:17289: result: $cf_gnat_generics" >&5
17290 echo "${ECHO_T}$cf_gnat_generics" >&6
17291
17292 if test "$cf_gnat_generics" = yes
17293 then
17294         cf_compile_generics=generics
17295         cf_generic_objects="\${GENOBJS}"
17296 else
17297         cf_compile_generics=
17298         cf_generic_objects=
17299 fi
17300
17301 echo "$as_me:17301: checking if GNAT supports SIGINT" >&5
17302 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17303 if test "${cf_cv_gnat_sigint+set}" = set; then
17304   echo $ECHO_N "(cached) $ECHO_C" >&6
17305 else
17306
17307 rm -rf ./conftest* ./*~conftest*
17308 cat >>conftest.ads <<CF_EOF
17309 with Ada.Interrupts.Names;
17310
17311 package ConfTest is
17312
17313    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17314    pragma Unreserve_All_Interrupts;
17315    pragma Warnings (On);
17316
17317    protected Process is
17318       procedure Stop;
17319       function Continue return Boolean;
17320       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17321    private
17322       Done : Boolean := False;
17323    end Process;
17324
17325 end ConfTest;
17326 CF_EOF
17327 cat >>conftest.adb <<CF_EOF
17328 package body ConfTest is
17329    protected body Process is
17330       procedure Stop is
17331       begin
17332          Done := True;
17333       end Stop;
17334       function Continue return Boolean is
17335       begin
17336          return not Done;
17337       end Continue;
17338    end Process;
17339 end ConfTest;
17340 CF_EOF
17341 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17342       cf_cv_gnat_sigint=yes
17343 else
17344    cf_cv_gnat_sigint=no
17345 fi
17346 rm -rf ./conftest* ./*~conftest*
17347
17348 fi
17349 echo "$as_me:17349: result: $cf_cv_gnat_sigint" >&5
17350 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17351
17352 if test "$cf_cv_gnat_sigint" = yes ; then
17353         USE_GNAT_SIGINT=""
17354 else
17355         USE_GNAT_SIGINT="#"
17356 fi
17357
17358 cf_gnat_libraries=no
17359 cf_gnat_projects=no
17360
17361 if test "$enable_gnat_projects" != no ; then
17362 echo "$as_me:17362: checking if GNAT supports project files" >&5
17363 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17364 case "$cf_cv_gnat_version" in
17365 (3.[0-9]*)
17366         ;;
17367 (*)
17368         case "$cf_cv_system_name" in
17369         (cygwin*|msys*)
17370                 ;;
17371         (*)
17372                 rm -rf ./conftest* ./*~conftest*
17373                 if mkdir conftest.src conftest.bin conftest.lib
17374                 then
17375                         cd conftest.src
17376                         rm -rf ./conftest* ./*~conftest*
17377                         cat >>library.gpr <<CF_EOF
17378 project Library is
17379   Kind := External ("LIB_KIND");
17380   for Library_Name use "ConfTest";
17381   for Object_Dir use ".";
17382   for Library_ALI_Dir use External("LIBRARY_DIR");
17383   for Library_Version use External ("SONAME");
17384   for Library_Kind use Kind;
17385   for Library_Dir use External("BUILD_DIR");
17386   Source_Dir := External ("SOURCE_DIR");
17387   for Source_Dirs use (Source_Dir);
17388 end Library;
17389 CF_EOF
17390                         cat >>confpackage.ads <<CF_EOF
17391 package ConfPackage is
17392    procedure conftest;
17393 end ConfPackage;
17394 CF_EOF
17395                         cat >>confpackage.adb <<CF_EOF
17396 with Text_IO;
17397 package body ConfPackage is
17398    procedure conftest is
17399    begin
17400       Text_IO.Put ("Hello World");
17401       Text_IO.New_Line;
17402    end conftest;
17403 end ConfPackage;
17404 CF_EOF
17405                         if ( "$cf_ada_make" $ADAFLAGS \
17406                                         -Plibrary.gpr \
17407                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17408                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17409                                         -XSOURCE_DIR="`pwd`" \
17410                                         -XSONAME=libConfTest.so.1 \
17411                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17412                                 cf_gnat_projects=yes
17413                         fi
17414                         cd ..
17415                 fi
17416                 if test -f conftest.lib/confpackage.ali
17417                 then
17418                         cf_gnat_libraries=yes
17419                 fi
17420                 rm -rf ./conftest* ./*~conftest*
17421                 ;;
17422         esac
17423         ;;
17424 esac
17425 echo "$as_me:17425: result: $cf_gnat_projects" >&5
17426 echo "${ECHO_T}$cf_gnat_projects" >&6
17427 fi # enable_gnat_projects
17428
17429 if test "$cf_gnat_projects" = yes
17430 then
17431         echo "$as_me:17431: checking if GNAT supports libraries" >&5
17432 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17433         echo "$as_me:17433: result: $cf_gnat_libraries" >&5
17434 echo "${ECHO_T}$cf_gnat_libraries" >&6
17435 fi
17436
17437 USE_OLD_MAKERULES=""
17438 USE_GNAT_PROJECTS="#"
17439 USE_GNAT_MAKE_GPR="#"
17440 USE_GNAT_GPRBUILD="#"
17441
17442 if test "$cf_gnat_projects" = yes
17443 then
17444         USE_OLD_MAKERULES="#"
17445         USE_GNAT_PROJECTS=""
17446         if test "$cf_cv_VERSION_GPRBUILD" != no
17447         then
17448                 USE_GNAT_GPRBUILD=""
17449         elif test "$cf_cv_VERSION_GNATMAKE" != no
17450         then
17451                 USE_GNAT_MAKE_GPR=""
17452         else
17453                 { echo "$as_me:17453: WARNING: use old makefile rules since tools are missing" >&5
17454 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17455         fi
17456 fi
17457
17458 if test "$cf_gnat_libraries" = yes
17459 then
17460         USE_GNAT_LIBRARIES=""
17461 else
17462         USE_GNAT_LIBRARIES="#"
17463 fi
17464
17465 echo "$as_me:17465: checking for ada-compiler" >&5
17466 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17467
17468 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17469 if test "${with_ada_compiler+set}" = set; then
17470   withval="$with_ada_compiler"
17471   cf_ada_compiler=$withval
17472 else
17473   cf_ada_compiler=gnatmake
17474 fi;
17475
17476 echo "$as_me:17476: result: $cf_ada_compiler" >&5
17477 echo "${ECHO_T}$cf_ada_compiler" >&6
17478
17479                 cf_ada_package=terminal_interface
17480
17481 echo "$as_me:17481: checking for ada-include" >&5
17482 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17483
17484 # Check whether --with-ada-include or --without-ada-include was given.
17485 if test "${with_ada_include+set}" = set; then
17486   withval="$with_ada_include"
17487
17488 else
17489   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17490 fi; if test -n "$prefix/share/ada/adainclude" ; then
17491
17492 if test "x$prefix" != xNONE; then
17493         cf_path_syntax="$prefix"
17494 else
17495         cf_path_syntax="$ac_default_prefix"
17496 fi
17497
17498 case ".$withval" in
17499 (.\$\(*\)*|.\'*\'*)
17500         ;;
17501 (..|./*|.\\*)
17502         ;;
17503 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17504         ;;
17505 (.\$\{*prefix\}*|.\$\{*dir\}*)
17506         eval withval="$withval"
17507         case ".$withval" in
17508         (.NONE/*)
17509                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17510                 ;;
17511         esac
17512         ;;
17513 (.no|.NONE/*)
17514         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17515         ;;
17516 (*)
17517         { { echo "$as_me:17517: error: expected a pathname, not \"$withval\"" >&5
17518 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17519    { (exit 1); exit 1; }; }
17520         ;;
17521 esac
17522
17523 fi
17524 eval ADA_INCLUDE="$withval"
17525
17526 echo "$as_me:17526: result: $ADA_INCLUDE" >&5
17527 echo "${ECHO_T}$ADA_INCLUDE" >&6
17528
17529 echo "$as_me:17529: checking for ada-objects" >&5
17530 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17531
17532 # Check whether --with-ada-objects or --without-ada-objects was given.
17533 if test "${with_ada_objects+set}" = set; then
17534   withval="$with_ada_objects"
17535
17536 else
17537   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17538 fi; if test -n "$prefix/lib/ada/adalib" ; then
17539
17540 if test "x$prefix" != xNONE; then
17541         cf_path_syntax="$prefix"
17542 else
17543         cf_path_syntax="$ac_default_prefix"
17544 fi
17545
17546 case ".$withval" in
17547 (.\$\(*\)*|.\'*\'*)
17548         ;;
17549 (..|./*|.\\*)
17550         ;;
17551 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17552         ;;
17553 (.\$\{*prefix\}*|.\$\{*dir\}*)
17554         eval withval="$withval"
17555         case ".$withval" in
17556         (.NONE/*)
17557                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17558                 ;;
17559         esac
17560         ;;
17561 (.no|.NONE/*)
17562         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17563         ;;
17564 (*)
17565         { { echo "$as_me:17565: error: expected a pathname, not \"$withval\"" >&5
17566 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17567    { (exit 1); exit 1; }; }
17568         ;;
17569 esac
17570
17571 fi
17572 eval ADA_OBJECTS="$withval"
17573
17574 echo "$as_me:17574: result: $ADA_OBJECTS" >&5
17575 echo "${ECHO_T}$ADA_OBJECTS" >&6
17576
17577 echo "$as_me:17577: checking if an Ada95 shared-library should be built" >&5
17578 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17579
17580 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17581 if test "${with_ada_sharedlib+set}" = set; then
17582   withval="$with_ada_sharedlib"
17583   with_ada_sharedlib=$withval
17584 else
17585   with_ada_sharedlib=no
17586 fi;
17587 echo "$as_me:17587: result: $with_ada_sharedlib" >&5
17588 echo "${ECHO_T}$with_ada_sharedlib" >&6
17589
17590 if test "x$with_ada_sharedlib" != xno
17591 then
17592         if test "x$cf_gnat_projects" != xyes
17593         then
17594                 { echo "$as_me:17594: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17595 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17596                 with_ada_sharedlib=no
17597         fi
17598 fi
17599
17600 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17601 MAKE_ADA_SHAREDLIB="#"
17602
17603 if test "x$with_ada_sharedlib" != xno
17604 then
17605         MAKE_ADA_SHAREDLIB=
17606         if test "x$with_ada_sharedlib" != xyes
17607         then
17608                 ADA_SHAREDLIB="$with_ada_sharedlib"
17609         fi
17610 fi
17611
17612                 # allow the Ada binding to be renamed
17613
17614 echo "$as_me:17614: checking for ada-libname" >&5
17615 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17616
17617 # Check whether --with-ada-libname or --without-ada-libname was given.
17618 if test "${with_ada_libname+set}" = set; then
17619   withval="$with_ada_libname"
17620   ADA_LIBNAME=$withval
17621 else
17622   ADA_LIBNAME=AdaCurses
17623 fi;
17624 case "x$ADA_LIBNAME" in
17625 (x|xyes|xno)
17626         ADA_LIBNAME=AdaCurses
17627         ;;
17628 esac
17629
17630 echo "$as_me:17630: result: $ADA_LIBNAME" >&5
17631 echo "${ECHO_T}$ADA_LIBNAME" >&6
17632
17633         else
17634                 { { echo "$as_me:17634: error: No usable Ada compiler found" >&5
17635 echo "$as_me: error: No usable Ada compiler found" >&2;}
17636    { (exit 1); exit 1; }; }
17637         fi
17638 else
17639         { { echo "$as_me:17639: error: The Ada compiler is needed for this package" >&5
17640 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17641    { (exit 1); exit 1; }; }
17642 fi
17643
17644 ################################################################################
17645
17646 # not needed
17647 TINFO_LDFLAGS2=
17648
17649 TINFO_LIBS=
17650
17651 ### Construct the list of include-directories to be generated
17652
17653 if test "$srcdir" != "."; then
17654         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17655 fi
17656 CPPFLAGS="-I../include $CPPFLAGS"
17657 if test "$srcdir" != "."; then
17658         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17659 fi
17660 CPPFLAGS="-I. $CPPFLAGS"
17661
17662 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17663 if test "$srcdir" != "."; then
17664         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17665 fi
17666 if test "$GCC" != yes; then
17667         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17668 elif test "$includedir" != "/usr/include"; then
17669         if test "$includedir" = '${prefix}/include' ; then
17670                 if test x$prefix != x/usr ; then
17671                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17672                 fi
17673         else
17674                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17675         fi
17676 fi
17677
17678 ### Build up pieces for makefile rules
17679 echo "$as_me:17679: checking default library suffix" >&5
17680 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17681
17682         case $DFT_LWR_MODEL in
17683         (libtool) DFT_ARG_SUFFIX=''   ;;
17684         (normal)  DFT_ARG_SUFFIX=''   ;;
17685         (debug)   DFT_ARG_SUFFIX='_g' ;;
17686         (profile) DFT_ARG_SUFFIX='_p' ;;
17687         (shared)  DFT_ARG_SUFFIX=''   ;;
17688         esac
17689         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17690 echo "$as_me:17690: result: $DFT_ARG_SUFFIX" >&5
17691 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17692
17693 echo "$as_me:17693: checking default library-dependency suffix" >&5
17694 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17695
17696         case X$DFT_LWR_MODEL in
17697         (Xlibtool)
17698                 DFT_LIB_SUFFIX='.la'
17699                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17700                 ;;
17701         (Xdebug)
17702                 case "$cf_cv_system_name" in
17703                 (*-msvc*)
17704                         DFT_LIB_SUFFIX='_g.lib'
17705                         ;;
17706                 (*)
17707                         DFT_LIB_SUFFIX='_g.a'
17708                         ;;
17709                 esac
17710                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17711                 ;;
17712         (Xprofile)
17713                 case "$cf_cv_system_name" in
17714                 (*-msvc*)
17715                         DFT_LIB_SUFFIX='_p.lib'
17716                         ;;
17717                 (*)
17718                         DFT_LIB_SUFFIX='_p.a'
17719                         ;;
17720                 esac
17721                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17722                 ;;
17723         (Xshared)
17724                 case "$cf_cv_system_name" in
17725                 (aix[5-7]*)
17726                         DFT_LIB_SUFFIX='.so'
17727                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17728                         ;;
17729                 (*-msvc*)
17730                         DFT_LIB_SUFFIX='.dll'
17731                         DFT_DEP_SUFFIX='.dll.lib'
17732                         ;;
17733                 (cygwin*|msys*|mingw*)
17734                         DFT_LIB_SUFFIX='.dll'
17735                         DFT_DEP_SUFFIX='.dll.a'
17736                         ;;
17737                 (darwin*)
17738                         DFT_LIB_SUFFIX='.dylib'
17739                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17740                         ;;
17741                 (hpux*)
17742                         case "$target" in
17743                         (ia64*)
17744                                 DFT_LIB_SUFFIX='.so'
17745                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17746                                 ;;
17747                         (*)
17748                                 DFT_LIB_SUFFIX='.sl'
17749                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17750                                 ;;
17751                         esac
17752                         ;;
17753                 (*)
17754                         DFT_LIB_SUFFIX='.so'
17755                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17756                         ;;
17757                 esac
17758                 ;;
17759         (*)
17760                 case "$target" in
17761                 (*-msvc*)
17762                         DFT_LIB_SUFFIX='.lib'
17763                         ;;
17764                 (*)
17765                         DFT_LIB_SUFFIX='.a'
17766                         ;;
17767                 esac
17768                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17769                 ;;
17770         esac
17771         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17772         then
17773                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17774                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17775         fi
17776 echo "$as_me:17776: result: $DFT_DEP_SUFFIX" >&5
17777 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17778
17779 echo "$as_me:17779: checking default object directory" >&5
17780 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17781
17782         case $DFT_LWR_MODEL in
17783         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17784         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17785         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17786         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17787         (shared)
17788                 case "$cf_cv_system_name" in
17789                 (cygwin|msys)
17790                         DFT_OBJ_SUBDIR='objects' ;;
17791                 (*)
17792                         DFT_OBJ_SUBDIR='obj_s' ;;
17793                 esac
17794         esac
17795 echo "$as_me:17795: result: $DFT_OBJ_SUBDIR" >&5
17796 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17797
17798 ### Set up low-level terminfo dependencies for makefiles.
17799
17800 if test "$DFT_LWR_MODEL" = shared ; then
17801         case $cf_cv_system_name in
17802         (cygwin*)
17803                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17804                 ;;
17805         (msys*)
17806                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17807                 ;;
17808         esac
17809 fi
17810
17811 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17812
17813 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17814
17815 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17816
17817 ### Construct the list of subdirectories for which we'll customize makefiles
17818 ### with the appropriate compile-rules.
17819
17820 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17821
17822 cat >>confdefs.h <<EOF
17823 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17824 EOF
17825
17826 ################################################################################
17827
17828 TEST_ARG2=
17829
17830 TEST_LIBS2=
17831
17832 NCURSES_SHLIB2="sh -c"
17833
17834 ADA_SUBDIRS="include gen src doc"
17835 if test "x$cf_with_tests" != "xno" ; then
17836         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17837 fi
17838 for cf_dir in $ADA_SUBDIRS
17839 do
17840         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17841 done
17842
17843 NCURSES_TREE="#"
17844
17845 EXTERNAL_TREE=
17846
17847 # match layout used by make-tar.sh
17848 ADAHTML_DIR=../doc/ada
17849
17850 if test "x$cross_compiling" = xyes ; then
17851         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17852 else
17853         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17854 fi
17855
17856 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"
17857 ac_config_commands="$ac_config_commands default"
17858 cat >confcache <<\_ACEOF
17859 # This file is a shell script that caches the results of configure
17860 # tests run on this system so they can be shared between configure
17861 # scripts and configure runs, see configure's option --config-cache.
17862 # It is not useful on other systems.  If it contains results you don't
17863 # want to keep, you may remove or edit it.
17864 #
17865 # config.status only pays attention to the cache file if you give it
17866 # the --recheck option to rerun configure.
17867 #
17868 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17869 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17870 # following values.
17871
17872 _ACEOF
17873
17874 # The following way of writing the cache mishandles newlines in values,
17875 # but we know of no workaround that is simple, portable, and efficient.
17876 # So, don't put newlines in cache variables' values.
17877 # Ultrix sh set writes to stderr and can't be redirected directly,
17878 # and sets the high bit in the cache file unless we assign to the vars.
17879 {
17880   (set) 2>&1 |
17881     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17882     *ac_space=\ *)
17883       # `set' does not quote correctly, so add quotes (double-quote
17884       # substitution turns \\\\ into \\, and sed turns \\ into \).
17885       sed -n \
17886         "s/'/'\\\\''/g;
17887           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17888       ;;
17889     *)
17890       # `set' quotes correctly as required by POSIX, so do not add quotes.
17891       sed -n \
17892         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17893       ;;
17894     esac;
17895 } |
17896   sed '
17897      t clear
17898      : clear
17899      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17900      t end
17901      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17902      : end' >>confcache
17903 if cmp -s $cache_file confcache; then :; else
17904   if test -w $cache_file; then
17905     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17906     cat confcache >$cache_file
17907   else
17908     echo "not updating unwritable cache $cache_file"
17909   fi
17910 fi
17911 rm -f confcache
17912
17913 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17914 # Let make expand exec_prefix.
17915 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17916
17917 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17918 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17919 # trailing colons and then remove the whole line if VPATH becomes empty
17920 # (actually we leave an empty line to preserve line numbers).
17921 if test "x$srcdir" = x.; then
17922   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17923 s/:*\$(srcdir):*/:/;
17924 s/:*\${srcdir}:*/:/;
17925 s/:*@srcdir@:*/:/;
17926 s/^\([^=]*=[    ]*\):*/\1/;
17927 s/:*$//;
17928 s/^[^=]*=[      ]*$//;
17929 }'
17930 fi
17931
17932 DEFS=-DHAVE_CONFIG_H
17933
17934 : "${CONFIG_STATUS=./config.status}"
17935 ac_clean_files_save=$ac_clean_files
17936 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17937 { echo "$as_me:17937: creating $CONFIG_STATUS" >&5
17938 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17939 cat >"$CONFIG_STATUS" <<_ACEOF
17940 #! $SHELL
17941 # Generated automatically by configure.
17942 # Run this file to recreate the current configuration.
17943 # Compiler output produced by configure, useful for debugging
17944 # configure, is in config.log if it exists.
17945
17946 debug=false
17947 SHELL=\${CONFIG_SHELL-$SHELL}
17948 ac_cs_invocation="\$0 \$@"
17949
17950 CLICOLOR_FORCE= GREP_OPTIONS=
17951 unset CLICOLOR_FORCE GREP_OPTIONS
17952 _ACEOF
17953
17954 cat >>"$CONFIG_STATUS" <<\_ACEOF
17955 # Be Bourne compatible
17956 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17957   emulate sh
17958   NULLCMD=:
17959 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17960   set -o posix
17961 fi
17962
17963 # Name of the executable.
17964 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17965
17966 if expr a : '\(a\)' >/dev/null 2>&1; then
17967   as_expr=expr
17968 else
17969   as_expr=false
17970 fi
17971
17972 rm -f conf$$ conf$$.exe conf$$.file
17973 echo >conf$$.file
17974 if ln -s conf$$.file conf$$ 2>/dev/null; then
17975   # We could just check for DJGPP; but this test a) works b) is more generic
17976   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17977   if test -f conf$$.exe; then
17978     # Don't use ln at all; we don't have any links
17979     as_ln_s='cp -p'
17980   else
17981     as_ln_s='ln -s'
17982   fi
17983 elif ln conf$$.file conf$$ 2>/dev/null; then
17984   as_ln_s=ln
17985 else
17986   as_ln_s='cp -p'
17987 fi
17988 rm -f conf$$ conf$$.exe conf$$.file
17989
17990 as_executable_p="test -f"
17991
17992 # Support unset when possible.
17993 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17994   as_unset="unset"
17995 else
17996   as_unset="false"
17997 fi
17998
17999 # NLS nuisances.
18000 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18001 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18002 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18003 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18004 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18005 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18006 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18007 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18008
18009 # IFS
18010 # We need space, tab and new line, in precisely that order.
18011 as_nl='
18012 '
18013 IFS="   $as_nl"
18014
18015 # CDPATH.
18016 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18017
18018 exec 6>&1
18019
18020 _ACEOF
18021
18022 # Files that config.status was made for.
18023 if test -n "$ac_config_files"; then
18024   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18025 fi
18026
18027 if test -n "$ac_config_headers"; then
18028   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18029 fi
18030
18031 if test -n "$ac_config_links"; then
18032   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18033 fi
18034
18035 if test -n "$ac_config_commands"; then
18036   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18037 fi
18038
18039 cat >>"$CONFIG_STATUS" <<\EOF
18040
18041 ac_cs_usage="\
18042 \`$as_me' instantiates files from templates according to the
18043 current configuration.
18044
18045 Usage: $0 [OPTIONS] [FILE]...
18046
18047   -h, --help       print this help, then exit
18048   -V, --version    print version number, then exit
18049   -d, --debug      don't remove temporary files
18050       --recheck    update $as_me by reconfiguring in the same conditions
18051   --file=FILE[:TEMPLATE]
18052                    instantiate the configuration file FILE
18053   --header=FILE[:TEMPLATE]
18054                    instantiate the configuration header FILE
18055
18056 Configuration files:
18057 $config_files
18058
18059 Configuration headers:
18060 $config_headers
18061
18062 Configuration commands:
18063 $config_commands
18064
18065 Report bugs to <dickey@invisible-island.net>."
18066 EOF
18067
18068 cat >>"$CONFIG_STATUS" <<EOF
18069 ac_cs_version="\\
18070 config.status
18071 configured by $0, generated by GNU Autoconf 2.52.20210509,
18072   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18073
18074 Copyright 2003-2020,2021        Thomas E. Dickey
18075 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18076 Free Software Foundation, Inc.
18077 This config.status script is free software; the Free Software Foundation
18078 gives unlimited permission to copy, distribute and modify it."
18079 srcdir="$srcdir"
18080 INSTALL="$INSTALL"
18081 EOF
18082
18083 cat >>"$CONFIG_STATUS" <<\EOF
18084 # If no file are specified by the user, then we need to provide default
18085 # value.  By we need to know if files were specified by the user.
18086 ac_need_defaults=:
18087 while test $# != 0
18088 do
18089   case $1 in
18090   --*=*)
18091     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18092     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18093     shift
18094     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18095     shift
18096     ;;
18097   -*);;
18098   *) # This is not an option, so the user has probably given explicit
18099      # arguments.
18100      ac_need_defaults=false;;
18101   esac
18102
18103   case $1 in
18104   # Handling of the options.
18105 EOF
18106 cat >>"$CONFIG_STATUS" <<EOF
18107   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18108     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18109     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18110 EOF
18111 cat >>"$CONFIG_STATUS" <<\EOF
18112   --version | --vers* | -V )
18113     echo "$ac_cs_version"; exit 0 ;;
18114   --he | --h)
18115     # Conflict between --help and --header
18116     { { echo "$as_me:18116: error: ambiguous option: $1
18117 Try \`$0 --help' for more information." >&5
18118 echo "$as_me: error: ambiguous option: $1
18119 Try \`$0 --help' for more information." >&2;}
18120    { (exit 1); exit 1; }; };;
18121   --help | --hel | -h )
18122     echo "$ac_cs_usage"; exit 0 ;;
18123   --debug | --d* | -d )
18124     debug=: ;;
18125   --file | --fil | --fi | --f )
18126     shift
18127     CONFIG_FILES="$CONFIG_FILES $1"
18128     ac_need_defaults=false;;
18129   --header | --heade | --head | --hea )
18130     shift
18131     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18132     ac_need_defaults=false;;
18133
18134   # This is an error.
18135   -*) { { echo "$as_me:18135: error: unrecognized option: $1
18136 Try \`$0 --help' for more information." >&5
18137 echo "$as_me: error: unrecognized option: $1
18138 Try \`$0 --help' for more information." >&2;}
18139    { (exit 1); exit 1; }; } ;;
18140
18141   *) ac_config_targets="$ac_config_targets $1" ;;
18142
18143   esac
18144   shift
18145 done
18146
18147 exec 5>>config.log
18148 cat >&5 << _ACEOF
18149
18150 ## ----------------------- ##
18151 ## Running config.status.  ##
18152 ## ----------------------- ##
18153
18154 This file was extended by $as_me 2.52.20210509, executed with
18155   CONFIG_FILES    = $CONFIG_FILES
18156   CONFIG_HEADERS  = $CONFIG_HEADERS
18157   CONFIG_LINKS    = $CONFIG_LINKS
18158   CONFIG_COMMANDS = $CONFIG_COMMANDS
18159   > "$ac_cs_invocation"
18160 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18161
18162 _ACEOF
18163 EOF
18164
18165 cat >>"$CONFIG_STATUS" <<EOF
18166 #
18167 # INIT-COMMANDS section.
18168 #
18169
18170 ### Special initialization commands, used to pass information from the
18171 ### configuration-run into config.status
18172
18173 AWK="$AWK"
18174 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18175 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18176 LIB_NAME="$LIB_NAME"
18177 LIB_PREFIX="$LIB_PREFIX"
18178 LIB_SUFFIX="$LIB_SUFFIX"
18179 LN_S="$LN_S"
18180 NCURSES_MAJOR="$NCURSES_MAJOR"
18181 NCURSES_MINOR="$NCURSES_MINOR"
18182 NCURSES_PATCH="$NCURSES_PATCH"
18183 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18184 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18185 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18186 cf_cv_abi_version="$cf_cv_abi_version"
18187 cf_cv_rel_version="$cf_cv_rel_version"
18188 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18189 cf_cv_shared_soname='$cf_cv_shared_soname'
18190 cf_cv_shlib_version="$cf_cv_shlib_version"
18191 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18192 cf_cv_system_name="$cf_cv_system_name"
18193 host="$host"
18194 target="$target"
18195
18196 EOF
18197
18198 cat >>"$CONFIG_STATUS" <<\EOF
18199 for ac_config_target in $ac_config_targets
18200 do
18201   case "$ac_config_target" in
18202   # Handling of arguments.
18203   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18204   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18205   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18206   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18207   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18208   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18209   *) { { echo "$as_me:18209: error: invalid argument: $ac_config_target" >&5
18210 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18211    { (exit 1); exit 1; }; };;
18212   esac
18213 done
18214
18215 # If the user did not use the arguments to specify the items to instantiate,
18216 # then the envvar interface is used.  Set only those that are not.
18217 # We use the long form for the default assignment because of an extremely
18218 # bizarre bug on SunOS 4.1.3.
18219 if "$ac_need_defaults"; then
18220   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18221   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18222   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18223 fi
18224
18225 # Create a temporary directory, and hook for its removal unless debugging.
18226 $debug ||
18227 {
18228   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18229   trap '{ (exit 1); exit 1; }' 1 2 13 15
18230 }
18231
18232 # Create a (secure) tmp directory for tmp files.
18233 : ${TMPDIR=/tmp}
18234 {
18235   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18236   test -n "$tmp" && test -d "$tmp"
18237 }  ||
18238 {
18239   tmp=$TMPDIR/cs$$-$RANDOM
18240   (umask 077 && mkdir $tmp)
18241 } ||
18242 {
18243    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18244    { (exit 1); exit 1; }
18245 }
18246
18247 EOF
18248
18249 cat >>"$CONFIG_STATUS" <<EOF
18250
18251 #
18252 # CONFIG_FILES section.
18253 #
18254
18255 # No need to generate the scripts if there are no CONFIG_FILES.
18256 # This happens for instance when ./config.status config.h
18257 if test -n "\$CONFIG_FILES"; then
18258   # Protect against being on the right side of a sed subst in config.status.
18259   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18260    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18261 s,@SHELL@,$SHELL,;t t
18262 s,@exec_prefix@,$exec_prefix,;t t
18263 s,@prefix@,$prefix,;t t
18264 s,@program_transform_name@,$program_transform_name,;t t
18265 s,@bindir@,$bindir,;t t
18266 s,@sbindir@,$sbindir,;t t
18267 s,@libexecdir@,$libexecdir,;t t
18268 s,@datarootdir@,$datarootdir,;t t
18269 s,@datadir@,$datadir,;t t
18270 s,@sysconfdir@,$sysconfdir,;t t
18271 s,@sharedstatedir@,$sharedstatedir,;t t
18272 s,@localstatedir@,$localstatedir,;t t
18273 s,@runstatedir@,$runstatedir,;t t
18274 s,@libdir@,$libdir,;t t
18275 s,@includedir@,$includedir,;t t
18276 s,@oldincludedir@,$oldincludedir,;t t
18277 s,@infodir@,$infodir,;t t
18278 s,@mandir@,$mandir,;t t
18279 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18280 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18281 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18282 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18283 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18284 s,@build_alias@,$build_alias,;t t
18285 s,@host_alias@,$host_alias,;t t
18286 s,@target_alias@,$target_alias,;t t
18287 s,@ECHO_C@,$ECHO_C,;t t
18288 s,@ECHO_N@,$ECHO_N,;t t
18289 s,@ECHO_T@,$ECHO_T,;t t
18290 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18291 s,@DEFS@,$DEFS,;t t
18292 s,@LIBS@,$LIBS,;t t
18293 s,@top_builddir@,$top_builddir,;t t
18294 s,@build@,$build,;t t
18295 s,@build_cpu@,$build_cpu,;t t
18296 s,@build_vendor@,$build_vendor,;t t
18297 s,@build_os@,$build_os,;t t
18298 s,@host@,$host,;t t
18299 s,@host_cpu@,$host_cpu,;t t
18300 s,@host_vendor@,$host_vendor,;t t
18301 s,@host_os@,$host_os,;t t
18302 s,@target@,$target,;t t
18303 s,@target_cpu@,$target_cpu,;t t
18304 s,@target_vendor@,$target_vendor,;t t
18305 s,@target_os@,$target_os,;t t
18306 s,@GREP@,$GREP,;t t
18307 s,@FGREP@,$FGREP,;t t
18308 s,@CC@,$CC,;t t
18309 s,@CFLAGS@,$CFLAGS,;t t
18310 s,@LDFLAGS@,$LDFLAGS,;t t
18311 s,@CPPFLAGS@,$CPPFLAGS,;t t
18312 s,@ac_ct_CC@,$ac_ct_CC,;t t
18313 s,@EXEEXT@,$EXEEXT,;t t
18314 s,@OBJEXT@,$OBJEXT,;t t
18315 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18316 s,@CPP@,$CPP,;t t
18317 s,@EGREP@,$EGREP,;t t
18318 s,@AWK@,$AWK,;t t
18319 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18320 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18321 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18322 s,@LN_S@,$LN_S,;t t
18323 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18324 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18325 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18326 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18327 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18328 s,@SET_MAKE@,$SET_MAKE,;t t
18329 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18330 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18331 s,@CTAGS@,$CTAGS,;t t
18332 s,@ETAGS@,$ETAGS,;t t
18333 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18334 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18335 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18336 s,@RANLIB@,$RANLIB,;t t
18337 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18338 s,@LD@,$LD,;t t
18339 s,@ac_ct_LD@,$ac_ct_LD,;t t
18340 s,@AR@,$AR,;t t
18341 s,@ac_ct_AR@,$ac_ct_AR,;t t
18342 s,@ARFLAGS@,$ARFLAGS,;t t
18343 s,@DESTDIR@,$DESTDIR,;t t
18344 s,@BUILD_CC@,$BUILD_CC,;t t
18345 s,@BUILD_CPP@,$BUILD_CPP,;t t
18346 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18347 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18348 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18349 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18350 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18351 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18352 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18353 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18354 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18355 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18356 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18357 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18358 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18359 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18360 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18361 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18362 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18363 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18364 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18365 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18366 s,@CC_G_OPT@,$CC_G_OPT,;t t
18367 s,@LD_MODEL@,$LD_MODEL,;t t
18368 s,@shlibdir@,$shlibdir,;t t
18369 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18370 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18371 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18372 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18373 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18374 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18375 s,@LINK_PROGS@,$LINK_PROGS,;t t
18376 s,@LINK_TESTS@,$LINK_TESTS,;t t
18377 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18378 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18379 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18380 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18381 s,@RPATH_LIST@,$RPATH_LIST,;t t
18382 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18383 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18384 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18385 s,@PTHREAD@,$PTHREAD,;t t
18386 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18387 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18388 s,@ECHO_LT@,$ECHO_LT,;t t
18389 s,@ECHO_LD@,$ECHO_LD,;t t
18390 s,@RULE_CC@,$RULE_CC,;t t
18391 s,@SHOW_CC@,$SHOW_CC,;t t
18392 s,@ECHO_CC@,$ECHO_CC,;t t
18393 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18394 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18395 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18396 s,@ADAFLAGS@,$ADAFLAGS,;t t
18397 s,@ADA_TRACE@,$ADA_TRACE,;t t
18398 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18399 s,@M4_exists@,$M4_exists,;t t
18400 s,@cf_ada_make@,$cf_ada_make,;t t
18401 s,@cf_ada_config@,$cf_ada_config,;t t
18402 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18403 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18404 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18405 s,@cf_compile_generics@,$cf_compile_generics,;t t
18406 s,@cf_generic_objects@,$cf_generic_objects,;t t
18407 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18408 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18409 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18410 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18411 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18412 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18413 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18414 s,@cf_ada_package@,$cf_ada_package,;t t
18415 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18416 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18417 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18418 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18419 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18420 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18421 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18422 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18423 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18424 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18425 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18426 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18427 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18428 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18429 s,@TEST_ARG2@,$TEST_ARG2,;t t
18430 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18431 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18432 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18433 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18434 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18435 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18436 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18437 CEOF
18438
18439 EOF
18440
18441   cat >>"$CONFIG_STATUS" <<\EOF
18442   # Split the substitutions into bite-sized pieces for seds with
18443   # small command number limits, like on Digital OSF/1 and HP-UX.
18444   ac_max_sed_lines=48
18445   ac_sed_frag=1 # Number of current file.
18446   ac_beg=1 # First line for current file.
18447   ac_end=$ac_max_sed_lines # Line after last line for current file.
18448   ac_more_lines=:
18449   ac_sed_cmds=
18450   while "$ac_more_lines"; do
18451     if test "$ac_beg" -gt 1; then
18452       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18453     else
18454       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18455     fi
18456     if test ! -s $tmp/subs.frag; then
18457       ac_more_lines=false
18458     else
18459       # The purpose of the label and of the branching condition is to
18460       # speed up the sed processing (if there are no `@' at all, there
18461       # is no need to browse any of the substitutions).
18462       # These are the two extra sed commands mentioned above.
18463       (echo ':t
18464   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18465       # It is possible to make a multiline substitution using escaped newlines.
18466       # Ensure that we do not split the substitution between script fragments.
18467       ac_BEG=$ac_end
18468       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18469       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18470       if test -s $tmp/subs.next; then
18471         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18472         if test ! -s $tmp/subs.edit; then
18473           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18474           if test ! -s $tmp/subs.edit; then
18475             if test "$ac_beg" -gt 1; then
18476               ac_end=`expr "$ac_end" - 1`
18477               continue
18478             fi
18479           fi
18480         fi
18481       fi
18482
18483       if test -z "$ac_sed_cmds"; then
18484         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18485       else
18486         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18487       fi
18488       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18489       ac_beg=$ac_end
18490       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18491     fi
18492   done
18493   if test -z "$ac_sed_cmds"; then
18494     ac_sed_cmds=cat
18495   fi
18496 fi # test -n "$CONFIG_FILES"
18497
18498 EOF
18499 cat >>"$CONFIG_STATUS" <<\EOF
18500 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18501   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18502   case "$ac_file" in
18503   - | *:- | *:-:* ) # input from stdin
18504         cat >$tmp/stdin
18505         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18506         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18507   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18508         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18509   * )   ac_file_in=$ac_file.in ;;
18510   esac
18511
18512   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18513   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18514          X"$ac_file" : 'X\(//\)[^/]' \| \
18515          X"$ac_file" : 'X\(//\)$' \| \
18516          X"$ac_file" : 'X\(/\)' \| \
18517          .     : '\(.\)' 2>/dev/null ||
18518 echo X"$ac_file" |
18519     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18520           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18521           /^X\(\/\/\)$/{ s//\1/; q; }
18522           /^X\(\/\).*/{ s//\1/; q; }
18523           s/.*/./; q'`
18524   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18525     { case "$ac_dir" in
18526   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18527   *)                      as_incr_dir=.;;
18528 esac
18529 as_dummy="$ac_dir"
18530 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18531   case $as_mkdir_dir in
18532     # Skip DOS drivespec
18533     ?:) as_incr_dir=$as_mkdir_dir ;;
18534     *)
18535       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18536       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18537     ;;
18538   esac
18539 done; }
18540
18541     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18542     # A "../" for each directory in $ac_dir_suffix.
18543     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18544   else
18545     ac_dir_suffix= ac_dots=
18546   fi
18547
18548   case "$srcdir" in
18549   .)  ac_srcdir=.
18550       if test -z "$ac_dots"; then
18551          ac_top_srcdir=.
18552       else
18553          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18554       fi ;;
18555   [\\/]* | ?:[\\/]* )
18556       ac_srcdir="$srcdir$ac_dir_suffix";
18557       ac_top_srcdir="$srcdir" ;;
18558   *) # Relative path.
18559     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18560     ac_top_srcdir="$ac_dots$srcdir" ;;
18561   esac
18562
18563   case $INSTALL in
18564   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18565   *) ac_INSTALL=$ac_dots$INSTALL ;;
18566   esac
18567
18568   if test x"$ac_file" != x-; then
18569     { echo "$as_me:18569: creating $ac_file" >&5
18570 echo "$as_me: creating $ac_file" >&6;}
18571     rm -f "$ac_file"
18572   fi
18573   # Let's still pretend it is `configure' which instantiates (i.e., don't
18574   # use $as_me), people would be surprised to read:
18575   #    /* config.h.  Generated automatically by config.status.  */
18576   configure_input="Generated automatically from `echo $ac_file_in |
18577                                                  sed 's,.*/,,'` by configure."
18578
18579   # First look for the input files in the build tree, otherwise in the
18580   # src tree.
18581   ac_file_inputs=`IFS=:
18582     for f in $ac_file_in; do
18583       case $f in
18584       -) echo $tmp/stdin ;;
18585       [\\/$]*)
18586          # Absolute (can't be DOS-style, as IFS=:)
18587          test -f "$f" || { { echo "$as_me:18587: error: cannot find input file: $f" >&5
18588 echo "$as_me: error: cannot find input file: $f" >&2;}
18589    { (exit 1); exit 1; }; }
18590          echo $f;;
18591       *) # Relative
18592          if test -f "$f"; then
18593            # Build tree
18594            echo $f
18595          elif test -f "$srcdir/$f"; then
18596            # Source tree
18597            echo "$srcdir/$f"
18598          else
18599            # /dev/null tree
18600            { { echo "$as_me:18600: error: cannot find input file: $f" >&5
18601 echo "$as_me: error: cannot find input file: $f" >&2;}
18602    { (exit 1); exit 1; }; }
18603          fi;;
18604       esac
18605     done` || { (exit 1); exit 1; }
18606 EOF
18607 cat >>"$CONFIG_STATUS" <<\EOF
18608   ac_warn_datarootdir=no
18609   if test x"$ac_file" != x-; then
18610     for ac_item in $ac_file_inputs
18611     do
18612       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18613       if test -n "$ac_seen"; then
18614         ac_used=`grep '@datarootdir@' "$ac_item"`
18615         if test -z "$ac_used"; then
18616           { echo "$as_me:18616: WARNING: datarootdir was used implicitly but not set:
18617 $ac_seen" >&5
18618 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18619 $ac_seen" >&2;}
18620           ac_warn_datarootdir=yes
18621         fi
18622       fi
18623       ac_seen=`grep '${datarootdir}' "$ac_item"`
18624       if test -n "$ac_seen"; then
18625         { echo "$as_me:18625: WARNING: datarootdir was used explicitly but not set:
18626 $ac_seen" >&5
18627 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18628 $ac_seen" >&2;}
18629         ac_warn_datarootdir=yes
18630       fi
18631     done
18632   fi
18633
18634 if test "x$ac_warn_datarootdir" = xyes; then
18635   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18636 fi
18637
18638 EOF
18639 cat >>"$CONFIG_STATUS" <<EOF
18640   sed "$ac_vpsub
18641 $extrasub
18642 EOF
18643 cat >>"$CONFIG_STATUS" <<\EOF
18644 :t
18645 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18646 s,@configure_input@,$configure_input,;t t
18647 s,@srcdir@,$ac_srcdir,;t t
18648 s,@top_srcdir@,$ac_top_srcdir,;t t
18649 s,@INSTALL@,$ac_INSTALL,;t t
18650 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18651   rm -f $tmp/stdin
18652   if test x"$ac_file" != x-; then
18653     cp "$tmp/out" "$ac_file"
18654
18655     for ac_name in prefix exec_prefix datarootdir
18656     do
18657         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18658         if test -n "$ac_seen"; then
18659             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18660             if test -z "$ac_init"; then
18661               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18662               { echo "$as_me:18662: WARNING: Variable $ac_name is used but was not set:
18663 $ac_seen" >&5
18664 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18665 $ac_seen" >&2;}
18666             fi
18667         fi
18668     done
18669     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18670     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18671     if test -s $tmp/out; then
18672       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18673       { echo "$as_me:18673: WARNING: Some variables may not be substituted:
18674 $ac_seen" >&5
18675 echo "$as_me: WARNING: Some variables may not be substituted:
18676 $ac_seen" >&2;}
18677     fi
18678   else
18679     cat $tmp/out
18680   fi
18681   rm -f $tmp/out
18682
18683 done
18684 EOF
18685 cat >>"$CONFIG_STATUS" <<\EOF
18686
18687 #
18688 # CONFIG_HEADER section.
18689 #
18690
18691 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18692 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18693 #
18694 # ac_d sets the value in "#define NAME VALUE" lines.
18695 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18696 ac_dB='[        ].*$,\1#\2'
18697 ac_dC=' '
18698 ac_dD=',;t'
18699 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18700 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18701 ac_iB='\([      ]\),\1#\2define\3'
18702 ac_iC=' '
18703 ac_iD='\4,;t'
18704 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18705 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18706 ac_uB='$,\1#\2define\3'
18707 ac_uC=' '
18708 ac_uD=',;t'
18709
18710 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18711   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18712   case "$ac_file" in
18713   - | *:- | *:-:* ) # input from stdin
18714         cat >$tmp/stdin
18715         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18716         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18717   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18718         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18719   * )   ac_file_in=$ac_file.in ;;
18720   esac
18721
18722   test x"$ac_file" != x- && { echo "$as_me:18722: creating $ac_file" >&5
18723 echo "$as_me: creating $ac_file" >&6;}
18724
18725   # First look for the input files in the build tree, otherwise in the
18726   # src tree.
18727   ac_file_inputs=`IFS=:
18728     for f in $ac_file_in; do
18729       case $f in
18730       -) echo $tmp/stdin ;;
18731       [\\/$]*)
18732          # Absolute (can't be DOS-style, as IFS=:)
18733          test -f "$f" || { { echo "$as_me:18733: error: cannot find input file: $f" >&5
18734 echo "$as_me: error: cannot find input file: $f" >&2;}
18735    { (exit 1); exit 1; }; }
18736          echo $f;;
18737       *) # Relative
18738          if test -f "$f"; then
18739            # Build tree
18740            echo $f
18741          elif test -f "$srcdir/$f"; then
18742            # Source tree
18743            echo "$srcdir/$f"
18744          else
18745            # /dev/null tree
18746            { { echo "$as_me:18746: error: cannot find input file: $f" >&5
18747 echo "$as_me: error: cannot find input file: $f" >&2;}
18748    { (exit 1); exit 1; }; }
18749          fi;;
18750       esac
18751     done` || { (exit 1); exit 1; }
18752   # Remove the trailing spaces.
18753   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18754
18755 EOF
18756
18757 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18758 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18759 # be either 'cat' or 'sort'.
18760 cat confdefs.h | uniq >conftest.vals
18761
18762 # Break up conftest.vals because some shells have a limit on
18763 # the size of here documents, and old seds have small limits too.
18764
18765 rm -f conftest.tail
18766 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
18767 while grep . conftest.vals >/dev/null
18768 do
18769   # Write chunks of a limited-size here document to conftest.frag.
18770   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
18771   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
18772   echo 'CEOF' >> "$CONFIG_STATUS"
18773   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
18774   rm -f conftest.vals
18775   mv conftest.tail conftest.vals
18776 done
18777 rm -f conftest.vals
18778
18779 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18780 # marker @DEFS@.
18781 echo '  cat >> conftest.edit <<CEOF
18782 /@DEFS@/r conftest.frag
18783 /@DEFS@/d
18784 CEOF
18785 sed -f conftest.edit $tmp/in > $tmp/out
18786 rm -f $tmp/in
18787 mv $tmp/out $tmp/in
18788 rm -f conftest.edit conftest.frag
18789 ' >> "$CONFIG_STATUS"
18790
18791 cat >>"$CONFIG_STATUS" <<\EOF
18792   # Let's still pretend it is `configure' which instantiates (i.e., don't
18793   # use $as_me), people would be surprised to read:
18794   #    /* config.h.  Generated automatically by config.status.  */
18795   if test x"$ac_file" = x-; then
18796     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18797   else
18798     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18799   fi
18800   cat $tmp/in >>$tmp/config.h
18801   rm -f $tmp/in
18802   if test x"$ac_file" != x-; then
18803     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
18804       { echo "$as_me:18804: $ac_file is unchanged" >&5
18805 echo "$as_me: $ac_file is unchanged" >&6;}
18806     else
18807       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18808          X"$ac_file" : 'X\(//\)[^/]' \| \
18809          X"$ac_file" : 'X\(//\)$' \| \
18810          X"$ac_file" : 'X\(/\)' \| \
18811          .     : '\(.\)' 2>/dev/null ||
18812 echo X"$ac_file" |
18813     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18814           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18815           /^X\(\/\/\)$/{ s//\1/; q; }
18816           /^X\(\/\).*/{ s//\1/; q; }
18817           s/.*/./; q'`
18818       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18819         { case "$ac_dir" in
18820   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18821   *)                      as_incr_dir=.;;
18822 esac
18823 as_dummy="$ac_dir"
18824 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18825   case $as_mkdir_dir in
18826     # Skip DOS drivespec
18827     ?:) as_incr_dir=$as_mkdir_dir ;;
18828     *)
18829       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18830       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18831     ;;
18832   esac
18833 done; }
18834
18835       fi
18836       rm -f "$ac_file"
18837       mv "$tmp/config.h" "$ac_file"
18838     fi
18839   else
18840     cat $tmp/config.h
18841     rm -f $tmp/config.h
18842   fi
18843 done
18844 EOF
18845 cat >>"$CONFIG_STATUS" <<\EOF
18846 #
18847 # CONFIG_COMMANDS section.
18848 #
18849 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18850   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18851   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18852
18853   case "$ac_dest" in
18854     default )
18855 if test -z "$USE_OLD_MAKERULES" ; then
18856         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18857 fi
18858  ;;
18859   esac
18860 done
18861 EOF
18862
18863 cat >>"$CONFIG_STATUS" <<\EOF
18864
18865 { (exit 0); exit 0; }
18866 EOF
18867 chmod +x "$CONFIG_STATUS"
18868 ac_clean_files=$ac_clean_files_save
18869
18870 # configure is writing to config.log, and then calls config.status.
18871 # config.status does its own redirection, appending to config.log.
18872 # Unfortunately, on DOS this fails, as config.log is still kept open
18873 # by configure, so config.status won't be able to write to it; its
18874 # output is simply discarded.  So we exec the FD to /dev/null,
18875 # effectively closing config.log, so it can be properly (re)opened and
18876 # appended to by config.status.  When coming back to configure, we
18877 # need to make the FD available again.
18878 if test "$no_create" != yes; then
18879   ac_cs_success=:
18880   exec 5>/dev/null
18881   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
18882   exec 5>>config.log
18883   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18884   # would make configure fail if this is the last instruction.
18885   "$ac_cs_success" || { (exit 1); exit 1; }
18886 fi
18887 ${MAKE:-make} preinstall