]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.4 - patch 20230107
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.88 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20221202.
5 #
6 # Copyright 2003-2021,2022      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr="expr"
38 else
39   as_expr="false"
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s='ln'
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2021,2022        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20221202.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 PACKAGE="AdaCurses"
1063
1064 top_builddir=`pwd`
1065
1066 ac_aux_dir=
1067 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1068   if test -f "$ac_dir/install-sh"; then
1069     ac_aux_dir=$ac_dir
1070     ac_install_sh="$ac_aux_dir/install-sh -c"
1071     break
1072   elif test -f "$ac_dir/install.sh"; then
1073     ac_aux_dir=$ac_dir
1074     ac_install_sh="$ac_aux_dir/install.sh -c"
1075     break
1076   elif test -f "$ac_dir/shtool"; then
1077     ac_aux_dir=$ac_dir
1078     ac_install_sh="$ac_aux_dir/shtool install -c"
1079     break
1080   fi
1081 done
1082 if test -z "$ac_aux_dir"; then
1083   { { echo "$as_me:1083: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1084 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1085    { (exit 1); exit 1; }; }
1086 fi
1087 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1088 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1089 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1090
1091 # Make sure we can run config.sub.
1092 $ac_config_sub sun4 >/dev/null 2>&1 ||
1093   { { echo "$as_me:1093: error: cannot run $ac_config_sub" >&5
1094 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1095    { (exit 1); exit 1; }; }
1096
1097 echo "$as_me:1097: checking build system type" >&5
1098 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1099 if test "${ac_cv_build+set}" = set; then
1100   echo $ECHO_N "(cached) $ECHO_C" >&6
1101 else
1102   ac_cv_build_alias=$build_alias
1103 test -z "$ac_cv_build_alias" &&
1104   ac_cv_build_alias=`$ac_config_guess`
1105 test -z "$ac_cv_build_alias" &&
1106   { { echo "$as_me:1106: error: cannot guess build type; you must specify one" >&5
1107 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1108    { (exit 1); exit 1; }; }
1109 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1110   { { echo "$as_me:1110: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1111 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1112    { (exit 1); exit 1; }; }
1113
1114 fi
1115 echo "$as_me:1115: result: $ac_cv_build" >&5
1116 echo "${ECHO_T}$ac_cv_build" >&6
1117 build=$ac_cv_build
1118 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1119 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1120 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1121
1122 echo "$as_me:1122: checking host system type" >&5
1123 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1124 if test "${ac_cv_host+set}" = set; then
1125   echo $ECHO_N "(cached) $ECHO_C" >&6
1126 else
1127   ac_cv_host_alias=$host_alias
1128 test -z "$ac_cv_host_alias" &&
1129   ac_cv_host_alias=$ac_cv_build_alias
1130 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1131   { { echo "$as_me:1131: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1132 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1133    { (exit 1); exit 1; }; }
1134
1135 fi
1136 echo "$as_me:1136: result: $ac_cv_host" >&5
1137 echo "${ECHO_T}$ac_cv_host" >&6
1138 host=$ac_cv_host
1139 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1140 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1141 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1142
1143 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1144         echo "$as_me:1144: checking target system type" >&5
1145 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1146 if test "${ac_cv_target+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   ac_cv_target_alias=$target_alias
1150 test "x$ac_cv_target_alias" = "x" &&
1151   ac_cv_target_alias=$ac_cv_host_alias
1152 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1153   { { echo "$as_me:1153: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1154 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1155    { (exit 1); exit 1; }; }
1156
1157 fi
1158 echo "$as_me:1158: result: $ac_cv_target" >&5
1159 echo "${ECHO_T}$ac_cv_target" >&6
1160 target=$ac_cv_target
1161 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1162 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1163 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1164
1165 # The aliases save the names the user supplied, while $host etc.
1166 # will get canonicalized.
1167 test -n "$target_alias" &&
1168   test "$program_prefix$program_suffix$program_transform_name" = \
1169     NONENONEs,x,x, &&
1170   program_prefix=${target_alias}-
1171         system_name="$host_os"
1172 else
1173         system_name="`(uname -s -r) 2>/dev/null`"
1174         if test -z "$system_name" ; then
1175                 system_name="`(hostname) 2>/dev/null`"
1176         fi
1177 fi
1178 test -n "$system_name" &&
1179 cat >>confdefs.h <<EOF
1180 #define SYSTEM_NAME "$system_name"
1181 EOF
1182
1183 if test "${cf_cv_system_name+set}" = set; then
1184   echo $ECHO_N "(cached) $ECHO_C" >&6
1185 else
1186   cf_cv_system_name="$system_name"
1187 fi
1188
1189 test -z "$system_name" && system_name="$cf_cv_system_name"
1190 test -n "$cf_cv_system_name" && echo "$as_me:1190: result: Configuring for $cf_cv_system_name" >&5
1191 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1192
1193 if test ".$system_name" != ".$cf_cv_system_name" ; then
1194         echo "$as_me:1194: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1195 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1196         { { echo "$as_me:1196: error: \"Please remove config.cache and try again.\"" >&5
1197 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1198    { (exit 1); exit 1; }; }
1199 fi
1200
1201 # Check whether --with-system-type or --without-system-type was given.
1202 if test "${with_system_type+set}" = set; then
1203   withval="$with_system_type"
1204   { echo "$as_me:1204: WARNING: overriding system type to $withval" >&5
1205 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1206         cf_cv_system_name=$withval
1207         host_os=$withval
1208
1209 fi;
1210
1211 ###     Save the given $CFLAGS to allow user-override.
1212 cf_user_CFLAGS="$CFLAGS"
1213
1214 ###     Default install-location
1215 for ac_prog in ggrep grep
1216 do
1217   # Extract the first word of "$ac_prog", so it can be a program name with args.
1218 set dummy $ac_prog; ac_word=$2
1219 echo "$as_me:1219: checking for $ac_word" >&5
1220 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1221 if test "${ac_cv_prog_GREP+set}" = set; then
1222   echo $ECHO_N "(cached) $ECHO_C" >&6
1223 else
1224   if test -n "$GREP"; then
1225   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1226 else
1227   ac_save_IFS=$IFS; IFS=$ac_path_separator
1228 ac_dummy="$PATH"
1229 for ac_dir in $ac_dummy; do
1230   IFS=$ac_save_IFS
1231   test -z "$ac_dir" && ac_dir=.
1232   $as_executable_p "$ac_dir/$ac_word" || continue
1233 ac_cv_prog_GREP="$ac_prog"
1234 echo "$as_me:1234: found $ac_dir/$ac_word" >&5
1235 break
1236 done
1237
1238 fi
1239 fi
1240 GREP=$ac_cv_prog_GREP
1241 if test -n "$GREP"; then
1242   echo "$as_me:1242: result: $GREP" >&5
1243 echo "${ECHO_T}$GREP" >&6
1244 else
1245   echo "$as_me:1245: result: no" >&5
1246 echo "${ECHO_T}no" >&6
1247 fi
1248
1249   test -n "$GREP" && break
1250 done
1251 test -n "$GREP" || GREP=": "
1252
1253 echo "$as_me:1253: checking for fgrep" >&5
1254 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1255 if test "${ac_cv_path_FGREP+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1259    then ac_cv_path_FGREP="$GREP -F"
1260    else
1261      for ac_prog in gfgrep fgrep
1262 do
1263   # Extract the first word of "$ac_prog", so it can be a program name with args.
1264 set dummy $ac_prog; ac_word=$2
1265 echo "$as_me:1265: checking for $ac_word" >&5
1266 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1267 if test "${ac_cv_path_FGREP+set}" = set; then
1268   echo $ECHO_N "(cached) $ECHO_C" >&6
1269 else
1270   case $FGREP in
1271   [\\/]* | ?:[\\/]*)
1272   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1273   ;;
1274   *)
1275   ac_save_IFS=$IFS; IFS=$ac_path_separator
1276 ac_dummy="$PATH"
1277 for ac_dir in $ac_dummy; do
1278   IFS=$ac_save_IFS
1279   test -z "$ac_dir" && ac_dir=.
1280   if $as_executable_p "$ac_dir/$ac_word"; then
1281    ac_cv_path_FGREP="$ac_dir/$ac_word"
1282    echo "$as_me:1282: found $ac_dir/$ac_word" >&5
1283    break
1284 fi
1285 done
1286
1287   ;;
1288 esac
1289 fi
1290 FGREP=$ac_cv_path_FGREP
1291
1292 if test -n "$FGREP"; then
1293   echo "$as_me:1293: result: $FGREP" >&5
1294 echo "${ECHO_T}$FGREP" >&6
1295 else
1296   echo "$as_me:1296: result: no" >&5
1297 echo "${ECHO_T}no" >&6
1298 fi
1299
1300   test -n "$FGREP" && break
1301 done
1302 test -n "$FGREP" || FGREP=": "
1303
1304      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1304: error: cannot find workable fgrep" >&5
1305 echo "$as_me: error: cannot find workable fgrep" >&2;}
1306    { (exit 1); exit 1; }; }
1307    fi
1308 fi
1309 echo "$as_me:1309: result: $ac_cv_path_FGREP" >&5
1310 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1311  FGREP="$ac_cv_path_FGREP"
1312
1313 echo "$as_me:1313: checking for prefix" >&5
1314 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1315 if test "x$prefix" = "xNONE" ; then
1316         case "$cf_cv_system_name" in
1317                 # non-vendor systems don't have a conflict
1318         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1319                 prefix=/usr
1320                 ;;
1321         (*)     prefix=$ac_default_prefix
1322                 ;;
1323         esac
1324 fi
1325 echo "$as_me:1325: result: $prefix" >&5
1326 echo "${ECHO_T}$prefix" >&6
1327
1328 if test "x$prefix" = "xNONE" ; then
1329 echo "$as_me:1329: checking for default include-directory" >&5
1330 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1331 test -n "$verbose" && echo 1>&6
1332 for cf_symbol in \
1333         "$includedir" \
1334         "$includedir/ncurses" \
1335         "$prefix/include" \
1336         "$prefix/include/ncurses" \
1337         /usr/local/include \
1338         /usr/local/include/ncurses \
1339         /usr/include \
1340         /usr/include/ncurses
1341 do
1342         cf_dir=`eval echo "$cf_symbol"`
1343         if test -f "$cf_dir/curses.h" ; then
1344         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1345                 includedir="$cf_symbol"
1346                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1347                 break
1348         fi
1349         fi
1350         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1351 done
1352 echo "$as_me:1352: result: $includedir" >&5
1353 echo "${ECHO_T}$includedir" >&6
1354 fi
1355
1356 ###     Checks for programs.
1357
1358 ac_ext=c
1359 ac_cpp='$CPP $CPPFLAGS'
1360 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1361 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1362 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1363 ac_main_return="return"
1364 if test -n "$ac_tool_prefix"; then
1365   for ac_prog in gnatgcc gcc cc
1366   do
1367     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1368 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1369 echo "$as_me:1369: checking for $ac_word" >&5
1370 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1371 if test "${ac_cv_prog_CC+set}" = set; then
1372   echo $ECHO_N "(cached) $ECHO_C" >&6
1373 else
1374   if test -n "$CC"; then
1375   ac_cv_prog_CC="$CC" # Let the user override the test.
1376 else
1377   ac_save_IFS=$IFS; IFS=$ac_path_separator
1378 ac_dummy="$PATH"
1379 for ac_dir in $ac_dummy; do
1380   IFS=$ac_save_IFS
1381   test -z "$ac_dir" && ac_dir=.
1382   $as_executable_p "$ac_dir/$ac_word" || continue
1383 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1384 echo "$as_me:1384: found $ac_dir/$ac_word" >&5
1385 break
1386 done
1387
1388 fi
1389 fi
1390 CC=$ac_cv_prog_CC
1391 if test -n "$CC"; then
1392   echo "$as_me:1392: result: $CC" >&5
1393 echo "${ECHO_T}$CC" >&6
1394 else
1395   echo "$as_me:1395: result: no" >&5
1396 echo "${ECHO_T}no" >&6
1397 fi
1398
1399     test -n "$CC" && break
1400   done
1401 fi
1402 if test -z "$CC"; then
1403   ac_ct_CC=$CC
1404   for ac_prog in gnatgcc gcc cc
1405 do
1406   # Extract the first word of "$ac_prog", so it can be a program name with args.
1407 set dummy $ac_prog; ac_word=$2
1408 echo "$as_me:1408: checking for $ac_word" >&5
1409 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1410 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1411   echo $ECHO_N "(cached) $ECHO_C" >&6
1412 else
1413   if test -n "$ac_ct_CC"; then
1414   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1415 else
1416   ac_save_IFS=$IFS; IFS=$ac_path_separator
1417 ac_dummy="$PATH"
1418 for ac_dir in $ac_dummy; do
1419   IFS=$ac_save_IFS
1420   test -z "$ac_dir" && ac_dir=.
1421   $as_executable_p "$ac_dir/$ac_word" || continue
1422 ac_cv_prog_ac_ct_CC="$ac_prog"
1423 echo "$as_me:1423: found $ac_dir/$ac_word" >&5
1424 break
1425 done
1426
1427 fi
1428 fi
1429 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1430 if test -n "$ac_ct_CC"; then
1431   echo "$as_me:1431: result: $ac_ct_CC" >&5
1432 echo "${ECHO_T}$ac_ct_CC" >&6
1433 else
1434   echo "$as_me:1434: result: no" >&5
1435 echo "${ECHO_T}no" >&6
1436 fi
1437
1438   test -n "$ac_ct_CC" && break
1439 done
1440
1441   CC=$ac_ct_CC
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo "$2"`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit "$ac_status"); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit "$ac_status"); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit "$ac_status"); }
1467
1468 cat >"conftest.$ac_ext" <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit "$ac_status"); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat "conftest.$ac_ext" >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit "$ac_status"); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe "conftest$ac_cv_exeext"
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit "$ac_status"); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f "conftest$ac_cv_exeext"
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f "conftest.$ac_ext"
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >"conftest.$ac_ext" <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit "$ac_status"); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat "conftest.$ac_ext" >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >"conftest.$ac_ext" <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f "conftest.$ac_objext"
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit "$ac_status"); } &&
1664          { ac_try='test -s "conftest.$ac_objext"'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit "$ac_status"); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat "conftest.$ac_ext" >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >"conftest.$ac_ext" <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f "conftest.$ac_objext"
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit "$ac_status"); } &&
1709          { ac_try='test -s "conftest.$ac_objext"'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit "$ac_status"); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat "conftest.$ac_ext" >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >"conftest.$ac_ext" <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f "conftest.$ac_objext"
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit "$ac_status"); } &&
1755          { ac_try='test -s "conftest.$ac_objext"'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit "$ac_status"); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >"conftest.$ac_ext" <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f "conftest.$ac_objext"
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit "$ac_status"); } &&
1789          { ac_try='test -s "conftest.$ac_objext"'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit "$ac_status"); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat "conftest.$ac_ext" >&5
1799 continue
1800 fi
1801 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1802   cat >"conftest.$ac_ext" <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f "conftest.$ac_objext"
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit "$ac_status"); } &&
1820          { ac_try='test -s "conftest.$ac_objext"'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit "$ac_status"); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat "conftest.$ac_ext" >&5
1830 fi
1831 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo "$ac_declaration"    >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat "conftest.$ac_ext" >&5
1843 fi
1844 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1848 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return="return"
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case "$host_os" in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >"conftest.$ac_ext" <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f "conftest.$ac_objext"
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit "$ac_status"); } &&
1894          { ac_try='test -s "conftest.$ac_objext"'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit "$ac_status"); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat "conftest.$ac_ext" >&5
1906 fi
1907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         cat >"conftest.$ac_ext" <<_ACEOF
1922 #line 1922 "configure"
1923 #include "confdefs.h"
1924
1925 int
1926 main (void)
1927 {
1928
1929 #ifdef __clang__
1930 #else
1931 make an error
1932 #endif
1933
1934   ;
1935   return 0;
1936 }
1937 _ACEOF
1938 rm -f "conftest.$ac_objext"
1939 if { (eval echo "$as_me:1939: \"$ac_compile\"") >&5
1940   (eval $ac_compile) 2>&5
1941   ac_status=$?
1942   echo "$as_me:1942: \$? = $ac_status" >&5
1943   (exit "$ac_status"); } &&
1944          { ac_try='test -s "conftest.$ac_objext"'
1945   { (eval echo "$as_me:1945: \"$ac_try\"") >&5
1946   (eval $ac_try) 2>&5
1947   ac_status=$?
1948   echo "$as_me:1948: \$? = $ac_status" >&5
1949   (exit "$ac_status"); }; }; then
1950   CLANG_COMPILER=yes
1951
1952 else
1953   echo "$as_me: failed program was:" >&5
1954 cat "conftest.$ac_ext" >&5
1955 fi
1956 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1957         CFLAGS="$cf_save_CFLAGS"
1958         echo "$as_me:1958: result: $CLANG_COMPILER" >&5
1959 echo "${ECHO_T}$CLANG_COMPILER" >&6
1960 fi
1961
1962 CLANG_VERSION=none
1963
1964 if test "x$CLANG_COMPILER" = "xyes" ; then
1965         case "$CC" in
1966         (c[1-9][0-9]|*/c[1-9][0-9])
1967                 { echo "$as_me:1967: WARNING: replacing broken compiler alias $CC" >&5
1968 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1969                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1970                 CC=clang
1971                 ;;
1972         esac
1973
1974         echo "$as_me:1974: checking version of $CC" >&5
1975 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1976         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1977         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1978         echo "$as_me:1978: result: $CLANG_VERSION" >&5
1979 echo "${ECHO_T}$CLANG_VERSION" >&6
1980
1981         for cf_clang_opt in \
1982                 -Qunused-arguments \
1983                 -Wno-error=implicit-function-declaration
1984         do
1985                 echo "$as_me:1985: checking if option $cf_clang_opt works" >&5
1986 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1987                 cf_save_CFLAGS="$CFLAGS"
1988                 CFLAGS="$CFLAGS $cf_clang_opt"
1989                 cat >"conftest.$ac_ext" <<_ACEOF
1990 #line 1990 "configure"
1991 #include "confdefs.h"
1992
1993                         #include <stdio.h>
1994 int
1995 main (void)
1996 {
1997
1998                         printf("hello!\\n");
1999   ;
2000   return 0;
2001 }
2002 _ACEOF
2003 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2004 if { (eval echo "$as_me:2004: \"$ac_link\"") >&5
2005   (eval $ac_link) 2>&5
2006   ac_status=$?
2007   echo "$as_me:2007: \$? = $ac_status" >&5
2008   (exit "$ac_status"); } &&
2009          { ac_try='test -s "conftest$ac_exeext"'
2010   { (eval echo "$as_me:2010: \"$ac_try\"") >&5
2011   (eval $ac_try) 2>&5
2012   ac_status=$?
2013   echo "$as_me:2013: \$? = $ac_status" >&5
2014   (exit "$ac_status"); }; }; then
2015
2016                         cf_clang_optok=yes
2017 else
2018   echo "$as_me: failed program was:" >&5
2019 cat "conftest.$ac_ext" >&5
2020
2021                         cf_clang_optok=no
2022 fi
2023 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2024                 echo "$as_me:2024: result: $cf_clang_optok" >&5
2025 echo "${ECHO_T}$cf_clang_optok" >&6
2026                 CFLAGS="$cf_save_CFLAGS"
2027                 if test "$cf_clang_optok" = yes; then
2028                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2029
2030 echo "${as_me:-configure}:2030: testing adding option $cf_clang_opt ..." 1>&5
2031
2032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2033         CFLAGS="${CFLAGS}$cf_clang_opt"
2034
2035                 fi
2036         done
2037 fi
2038
2039 echo "$as_me:2039: checking for $CC option to accept ANSI C" >&5
2040 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2041 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2042   echo $ECHO_N "(cached) $ECHO_C" >&6
2043 else
2044   ac_cv_prog_cc_stdc=no
2045 ac_save_CC=$CC
2046 cat >"conftest.$ac_ext" <<_ACEOF
2047 #line 2047 "configure"
2048 #include "confdefs.h"
2049 #include <stdarg.h>
2050 #include <stdio.h>
2051 #include <sys/types.h>
2052 #include <sys/stat.h>
2053 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2054 struct buf { int x; };
2055 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2056 static char *e (p, i)
2057      char **p;
2058      int i;
2059 {
2060   return p[i];
2061 }
2062 static char *f (char * (*g) (char **, int), char **p, ...)
2063 {
2064   char *s;
2065   va_list v;
2066   va_start (v,p);
2067   s = g (p, va_arg (v,int));
2068   va_end (v);
2069   return s;
2070 }
2071 int test (int i, double x);
2072 struct s1 {int (*f) (int a);};
2073 struct s2 {int (*f) (double a);};
2074 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2075 int argc;
2076 char **argv;
2077 int
2078 main (void)
2079 {
2080 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2081   ;
2082   return 0;
2083 }
2084 _ACEOF
2085 # Don't try gcc -ansi; that turns off useful extensions and
2086 # breaks some systems' header files.
2087 # AIX                   -qlanglvl=ansi
2088 # Ultrix and OSF/1      -std1
2089 # HP-UX 10.20 and later -Ae
2090 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2091 # SVR4                  -Xc -D__EXTENSIONS__
2092 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2093 do
2094   CC="$ac_save_CC $ac_arg"
2095   rm -f "conftest.$ac_objext"
2096 if { (eval echo "$as_me:2096: \"$ac_compile\"") >&5
2097   (eval $ac_compile) 2>&5
2098   ac_status=$?
2099   echo "$as_me:2099: \$? = $ac_status" >&5
2100   (exit "$ac_status"); } &&
2101          { ac_try='test -s "conftest.$ac_objext"'
2102   { (eval echo "$as_me:2102: \"$ac_try\"") >&5
2103   (eval $ac_try) 2>&5
2104   ac_status=$?
2105   echo "$as_me:2105: \$? = $ac_status" >&5
2106   (exit "$ac_status"); }; }; then
2107   ac_cv_prog_cc_stdc=$ac_arg
2108 break
2109 else
2110   echo "$as_me: failed program was:" >&5
2111 cat "conftest.$ac_ext" >&5
2112 fi
2113 rm -f "conftest.$ac_objext"
2114 done
2115 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2116 CC=$ac_save_CC
2117
2118 fi
2119
2120 case "x$ac_cv_prog_cc_stdc" in
2121   x|xno)
2122     echo "$as_me:2122: result: none needed" >&5
2123 echo "${ECHO_T}none needed" >&6 ;;
2124   *)
2125     echo "$as_me:2125: result: $ac_cv_prog_cc_stdc" >&5
2126 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2127     CC="$CC $ac_cv_prog_cc_stdc" ;;
2128 esac
2129
2130 # This should have been defined by AC_PROG_CC
2131 : "${CC:=cc}"
2132
2133 echo "$as_me:2133: checking \$CFLAGS variable" >&5
2134 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2135 case "x$CFLAGS" in
2136 (*-[IUD]*)
2137         echo "$as_me:2137: result: broken" >&5
2138 echo "${ECHO_T}broken" >&6
2139         { echo "$as_me:2139: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2140 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2141         cf_flags="$CFLAGS"
2142         CFLAGS=
2143         for cf_arg in $cf_flags
2144         do
2145
2146 cf_fix_cppflags=no
2147 cf_new_cflags=
2148 cf_new_cppflags=
2149 cf_new_extra_cppflags=
2150
2151 for cf_add_cflags in $cf_arg
2152 do
2153 case "$cf_fix_cppflags" in
2154 (no)
2155         case "$cf_add_cflags" in
2156         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2157                 case "$cf_add_cflags" in
2158                 (-D*)
2159                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2160
2161                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2162                                 && test -z "${cf_tst_cflags}" \
2163                                 && cf_fix_cppflags=yes
2164
2165                         if test "$cf_fix_cppflags" = yes ; then
2166
2167         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2168         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2169
2170                                 continue
2171                         elif test "${cf_tst_cflags}" = "\"'" ; then
2172
2173         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2174         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2175
2176                                 continue
2177                         fi
2178                         ;;
2179                 esac
2180                 case "$CPPFLAGS" in
2181                 (*$cf_add_cflags)
2182                         ;;
2183                 (*)
2184                         case "$cf_add_cflags" in
2185                         (-D*)
2186                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2187
2188 CPPFLAGS=`echo "$CPPFLAGS" | \
2189         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2190                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2191
2192                                 ;;
2193                         esac
2194
2195         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2196         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2197
2198                         ;;
2199                 esac
2200                 ;;
2201         (*)
2202
2203         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2204         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2205
2206                 ;;
2207         esac
2208         ;;
2209 (yes)
2210
2211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2213
2214         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2215
2216         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2217                 && test -z "${cf_tst_cflags}" \
2218                 && cf_fix_cppflags=no
2219         ;;
2220 esac
2221 done
2222
2223 if test -n "$cf_new_cflags" ; then
2224
2225         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2226         CFLAGS="${CFLAGS}$cf_new_cflags"
2227
2228 fi
2229
2230 if test -n "$cf_new_cppflags" ; then
2231
2232         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2233         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2234
2235 fi
2236
2237 if test -n "$cf_new_extra_cppflags" ; then
2238
2239         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2240         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2241
2242 fi
2243
2244         done
2245         ;;
2246 (*)
2247         echo "$as_me:2247: result: ok" >&5
2248 echo "${ECHO_T}ok" >&6
2249         ;;
2250 esac
2251
2252 echo "$as_me:2252: checking \$CC variable" >&5
2253 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2254 case "$CC" in
2255 (*[\ \  ]-*)
2256         echo "$as_me:2256: result: broken" >&5
2257 echo "${ECHO_T}broken" >&6
2258         { echo "$as_me:2258: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2259 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2260         # humor him...
2261         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2262         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2263         CC="$cf_prog"
2264         for cf_arg in $cf_flags
2265         do
2266                 case "x$cf_arg" in
2267                 (x-[IUDfgOW]*)
2268
2269 cf_fix_cppflags=no
2270 cf_new_cflags=
2271 cf_new_cppflags=
2272 cf_new_extra_cppflags=
2273
2274 for cf_add_cflags in $cf_arg
2275 do
2276 case "$cf_fix_cppflags" in
2277 (no)
2278         case "$cf_add_cflags" in
2279         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2280                 case "$cf_add_cflags" in
2281                 (-D*)
2282                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2283
2284                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2285                                 && test -z "${cf_tst_cflags}" \
2286                                 && cf_fix_cppflags=yes
2287
2288                         if test "$cf_fix_cppflags" = yes ; then
2289
2290         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2291         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2292
2293                                 continue
2294                         elif test "${cf_tst_cflags}" = "\"'" ; then
2295
2296         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2297         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2298
2299                                 continue
2300                         fi
2301                         ;;
2302                 esac
2303                 case "$CPPFLAGS" in
2304                 (*$cf_add_cflags)
2305                         ;;
2306                 (*)
2307                         case "$cf_add_cflags" in
2308                         (-D*)
2309                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2310
2311 CPPFLAGS=`echo "$CPPFLAGS" | \
2312         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2313                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2314
2315                                 ;;
2316                         esac
2317
2318         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2319         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2320
2321                         ;;
2322                 esac
2323                 ;;
2324         (*)
2325
2326         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2327         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2328
2329                 ;;
2330         esac
2331         ;;
2332 (yes)
2333
2334         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2335         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2336
2337         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2338
2339         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2340                 && test -z "${cf_tst_cflags}" \
2341                 && cf_fix_cppflags=no
2342         ;;
2343 esac
2344 done
2345
2346 if test -n "$cf_new_cflags" ; then
2347
2348         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2349         CFLAGS="${CFLAGS}$cf_new_cflags"
2350
2351 fi
2352
2353 if test -n "$cf_new_cppflags" ; then
2354
2355         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2356         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2357
2358 fi
2359
2360 if test -n "$cf_new_extra_cppflags" ; then
2361
2362         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2363         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2364
2365 fi
2366
2367                         ;;
2368                 (*)
2369                         CC="$CC $cf_arg"
2370                         ;;
2371                 esac
2372         done
2373         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2374
2375 echo "${as_me:-configure}:2375: testing resulting CC: '$CC' ..." 1>&5
2376
2377         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2378
2379 echo "${as_me:-configure}:2379: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2380
2381         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2382
2383 echo "${as_me:-configure}:2383: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2384
2385         ;;
2386 (*)
2387         echo "$as_me:2387: result: ok" >&5
2388 echo "${ECHO_T}ok" >&6
2389         ;;
2390 esac
2391
2392 echo "$as_me:2392: checking for egrep" >&5
2393 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2394 if test "${ac_cv_path_EGREP+set}" = set; then
2395   echo $ECHO_N "(cached) $ECHO_C" >&6
2396 else
2397   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2398    then ac_cv_path_EGREP="$GREP -E"
2399    else
2400      for ac_prog in gegrep egrep
2401 do
2402   # Extract the first word of "$ac_prog", so it can be a program name with args.
2403 set dummy $ac_prog; ac_word=$2
2404 echo "$as_me:2404: checking for $ac_word" >&5
2405 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2406 if test "${ac_cv_path_EGREP+set}" = set; then
2407   echo $ECHO_N "(cached) $ECHO_C" >&6
2408 else
2409   case $EGREP in
2410   [\\/]* | ?:[\\/]*)
2411   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2412   ;;
2413   *)
2414   ac_save_IFS=$IFS; IFS=$ac_path_separator
2415 ac_dummy="$PATH"
2416 for ac_dir in $ac_dummy; do
2417   IFS=$ac_save_IFS
2418   test -z "$ac_dir" && ac_dir=.
2419   if $as_executable_p "$ac_dir/$ac_word"; then
2420    ac_cv_path_EGREP="$ac_dir/$ac_word"
2421    echo "$as_me:2421: found $ac_dir/$ac_word" >&5
2422    break
2423 fi
2424 done
2425
2426   ;;
2427 esac
2428 fi
2429 EGREP=$ac_cv_path_EGREP
2430
2431 if test -n "$EGREP"; then
2432   echo "$as_me:2432: result: $EGREP" >&5
2433 echo "${ECHO_T}$EGREP" >&6
2434 else
2435   echo "$as_me:2435: result: no" >&5
2436 echo "${ECHO_T}no" >&6
2437 fi
2438
2439   test -n "$EGREP" && break
2440 done
2441 test -n "$EGREP" || EGREP=": "
2442
2443      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2443: error: cannot find workable egrep" >&5
2444 echo "$as_me: error: cannot find workable egrep" >&2;}
2445    { (exit 1); exit 1; }; }
2446    fi
2447 fi
2448 echo "$as_me:2448: result: $ac_cv_path_EGREP" >&5
2449 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2450  EGREP="$ac_cv_path_EGREP"
2451
2452 ac_ext=c
2453 ac_cpp='$CPP $CPPFLAGS'
2454 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2455 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2456 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2457 ac_main_return="return"
2458 echo "$as_me:2458: checking how to run the C preprocessor" >&5
2459 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2460 # On Suns, sometimes $CPP names a directory.
2461 if test -n "$CPP" && test -d "$CPP"; then
2462   CPP=
2463 fi
2464 if test -z "$CPP"; then
2465   if test "${ac_cv_prog_CPP+set}" = set; then
2466   echo $ECHO_N "(cached) $ECHO_C" >&6
2467 else
2468       # Double quotes because CPP needs to be expanded
2469     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2470     do
2471       ac_preproc_ok=false
2472 for ac_c_preproc_warn_flag in '' yes
2473 do
2474   # Use a header file that comes with gcc, so configuring glibc
2475   # with a fresh cross-compiler works.
2476   # On the NeXT, cc -E runs the code through the compiler's parser,
2477   # not just through cpp. "Syntax error" is here to catch this case.
2478   cat >"conftest.$ac_ext" <<_ACEOF
2479 #line 2479 "configure"
2480 #include "confdefs.h"
2481 #include <assert.h>
2482                      Syntax error
2483 _ACEOF
2484 if { (eval echo "$as_me:2484: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2485   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2486   ac_status=$?
2487   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2488   rm -f conftest.er1
2489   cat conftest.err >&5
2490   echo "$as_me:2490: \$? = $ac_status" >&5
2491   (exit "$ac_status"); } >/dev/null; then
2492   if test -s conftest.err; then
2493     ac_cpp_err=$ac_c_preproc_warn_flag
2494   else
2495     ac_cpp_err=
2496   fi
2497 else
2498   ac_cpp_err=yes
2499 fi
2500 if test -z "$ac_cpp_err"; then
2501   :
2502 else
2503   echo "$as_me: failed program was:" >&5
2504   cat "conftest.$ac_ext" >&5
2505   # Broken: fails on valid input.
2506 continue
2507 fi
2508 rm -f conftest.err "conftest.$ac_ext"
2509
2510   # OK, works on sane cases.  Now check whether non-existent headers
2511   # can be detected and how.
2512   cat >"conftest.$ac_ext" <<_ACEOF
2513 #line 2513 "configure"
2514 #include "confdefs.h"
2515 #include <ac_nonexistent.h>
2516 _ACEOF
2517 if { (eval echo "$as_me:2517: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2518   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2519   ac_status=$?
2520   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2521   rm -f conftest.er1
2522   cat conftest.err >&5
2523   echo "$as_me:2523: \$? = $ac_status" >&5
2524   (exit "$ac_status"); } >/dev/null; then
2525   if test -s conftest.err; then
2526     ac_cpp_err=$ac_c_preproc_warn_flag
2527   else
2528     ac_cpp_err=
2529   fi
2530 else
2531   ac_cpp_err=yes
2532 fi
2533 if test -z "$ac_cpp_err"; then
2534   # Broken: success on invalid input.
2535 continue
2536 else
2537   echo "$as_me: failed program was:" >&5
2538   cat "conftest.$ac_ext" >&5
2539   # Passes both tests.
2540 ac_preproc_ok=:
2541 break
2542 fi
2543 rm -f conftest.err "conftest.$ac_ext"
2544
2545 done
2546 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2547 rm -f conftest.err "conftest.$ac_ext"
2548 if $ac_preproc_ok; then
2549   break
2550 fi
2551
2552     done
2553     ac_cv_prog_CPP=$CPP
2554
2555 fi
2556   CPP=$ac_cv_prog_CPP
2557 else
2558   ac_cv_prog_CPP=$CPP
2559 fi
2560 echo "$as_me:2560: result: $CPP" >&5
2561 echo "${ECHO_T}$CPP" >&6
2562 ac_preproc_ok=false
2563 for ac_c_preproc_warn_flag in '' yes
2564 do
2565   # Use a header file that comes with gcc, so configuring glibc
2566   # with a fresh cross-compiler works.
2567   # On the NeXT, cc -E runs the code through the compiler's parser,
2568   # not just through cpp. "Syntax error" is here to catch this case.
2569   cat >"conftest.$ac_ext" <<_ACEOF
2570 #line 2570 "configure"
2571 #include "confdefs.h"
2572 #include <assert.h>
2573                      Syntax error
2574 _ACEOF
2575 if { (eval echo "$as_me:2575: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2576   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2577   ac_status=$?
2578   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2579   rm -f conftest.er1
2580   cat conftest.err >&5
2581   echo "$as_me:2581: \$? = $ac_status" >&5
2582   (exit "$ac_status"); } >/dev/null; then
2583   if test -s conftest.err; then
2584     ac_cpp_err=$ac_c_preproc_warn_flag
2585   else
2586     ac_cpp_err=
2587   fi
2588 else
2589   ac_cpp_err=yes
2590 fi
2591 if test -z "$ac_cpp_err"; then
2592   :
2593 else
2594   echo "$as_me: failed program was:" >&5
2595   cat "conftest.$ac_ext" >&5
2596   # Broken: fails on valid input.
2597 continue
2598 fi
2599 rm -f conftest.err "conftest.$ac_ext"
2600
2601   # OK, works on sane cases.  Now check whether non-existent headers
2602   # can be detected and how.
2603   cat >"conftest.$ac_ext" <<_ACEOF
2604 #line 2604 "configure"
2605 #include "confdefs.h"
2606 #include <ac_nonexistent.h>
2607 _ACEOF
2608 if { (eval echo "$as_me:2608: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2609   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2610   ac_status=$?
2611   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2612   rm -f conftest.er1
2613   cat conftest.err >&5
2614   echo "$as_me:2614: \$? = $ac_status" >&5
2615   (exit "$ac_status"); } >/dev/null; then
2616   if test -s conftest.err; then
2617     ac_cpp_err=$ac_c_preproc_warn_flag
2618   else
2619     ac_cpp_err=
2620   fi
2621 else
2622   ac_cpp_err=yes
2623 fi
2624 if test -z "$ac_cpp_err"; then
2625   # Broken: success on invalid input.
2626 continue
2627 else
2628   echo "$as_me: failed program was:" >&5
2629   cat "conftest.$ac_ext" >&5
2630   # Passes both tests.
2631 ac_preproc_ok=:
2632 break
2633 fi
2634 rm -f conftest.err "conftest.$ac_ext"
2635
2636 done
2637 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2638 rm -f conftest.err "conftest.$ac_ext"
2639 if $ac_preproc_ok; then
2640   :
2641 else
2642   { { echo "$as_me:2642: error: C preprocessor \"$CPP\" fails sanity check" >&5
2643 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2644    { (exit 1); exit 1; }; }
2645 fi
2646
2647 ac_ext=c
2648 ac_cpp='$CPP $CPPFLAGS'
2649 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2650 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2651 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2652 ac_main_return="return"
2653
2654 if test $ac_cv_c_compiler_gnu = yes; then
2655     echo "$as_me:2655: checking whether $CC needs -traditional" >&5
2656 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2657 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2658   echo $ECHO_N "(cached) $ECHO_C" >&6
2659 else
2660     ac_pattern="Autoconf.*'x'"
2661   cat >"conftest.$ac_ext" <<_ACEOF
2662 #line 2662 "configure"
2663 #include "confdefs.h"
2664 #include <sgtty.h>
2665 int Autoconf = TIOCGETP;
2666 _ACEOF
2667 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2668   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2669   ac_cv_prog_gcc_traditional=yes
2670 else
2671   ac_cv_prog_gcc_traditional=no
2672 fi
2673 rm -rf conftest*
2674
2675   if test $ac_cv_prog_gcc_traditional = no; then
2676     cat >"conftest.$ac_ext" <<_ACEOF
2677 #line 2677 "configure"
2678 #include "confdefs.h"
2679 #include <termio.h>
2680 int Autoconf = TCGETA;
2681 _ACEOF
2682 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2683   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2684   ac_cv_prog_gcc_traditional=yes
2685 fi
2686 rm -rf conftest*
2687
2688   fi
2689 fi
2690 echo "$as_me:2690: result: $ac_cv_prog_gcc_traditional" >&5
2691 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2692   if test $ac_cv_prog_gcc_traditional = yes; then
2693     CC="$CC -traditional"
2694   fi
2695 fi
2696
2697 echo "$as_me:2697: checking whether $CC understands -c and -o together" >&5
2698 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2699 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2700   echo $ECHO_N "(cached) $ECHO_C" >&6
2701 else
2702
2703 cat > conftest.$ac_ext <<CF_EOF
2704 int main(void)
2705 {
2706         ${cf_cv_main_return:-return}(0);
2707 }
2708 CF_EOF
2709 # We do the test twice because some compilers refuse to overwrite an
2710 # existing .o file with -o, though they will create one.
2711 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2712 if { (eval echo "$as_me:2712: \"$ac_try\"") >&5
2713   (eval $ac_try) 2>&5
2714   ac_status=$?
2715   echo "$as_me:2715: \$? = $ac_status" >&5
2716   (exit "$ac_status"); } &&
2717   test -f conftest2.$ac_objext && { (eval echo "$as_me:2717: \"$ac_try\"") >&5
2718   (eval $ac_try) 2>&5
2719   ac_status=$?
2720   echo "$as_me:2720: \$? = $ac_status" >&5
2721   (exit "$ac_status"); };
2722 then
2723   eval cf_cv_prog_CC_c_o=yes
2724 else
2725   eval cf_cv_prog_CC_c_o=no
2726 fi
2727 rm -rf ./conftest*
2728
2729 fi
2730 if test "$cf_cv_prog_CC_c_o" = yes; then
2731   echo "$as_me:2731: result: yes" >&5
2732 echo "${ECHO_T}yes" >&6
2733 else
2734   echo "$as_me:2734: result: no" >&5
2735 echo "${ECHO_T}no" >&6
2736 fi
2737
2738 test "$program_prefix" != NONE &&
2739   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2740 # Use a double $ so make ignores it.
2741 test "$program_suffix" != NONE &&
2742   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2743 # Double any \ or $.  echo might interpret backslashes.
2744 # By default was `s,x,x', remove it if useless.
2745 cat <<\_ACEOF >conftest.sed
2746 s/[\\$]/&&/g;s/;s,x,x,$//
2747 _ACEOF
2748 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2749 rm conftest.sed
2750
2751 for ac_prog in mawk gawk nawk awk
2752 do
2753   # Extract the first word of "$ac_prog", so it can be a program name with args.
2754 set dummy $ac_prog; ac_word=$2
2755 echo "$as_me:2755: checking for $ac_word" >&5
2756 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2757 if test "${ac_cv_prog_AWK+set}" = set; then
2758   echo $ECHO_N "(cached) $ECHO_C" >&6
2759 else
2760   if test -n "$AWK"; then
2761   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2762 else
2763   ac_save_IFS=$IFS; IFS=$ac_path_separator
2764 ac_dummy="$PATH"
2765 for ac_dir in $ac_dummy; do
2766   IFS=$ac_save_IFS
2767   test -z "$ac_dir" && ac_dir=.
2768   $as_executable_p "$ac_dir/$ac_word" || continue
2769 ac_cv_prog_AWK="$ac_prog"
2770 echo "$as_me:2770: found $ac_dir/$ac_word" >&5
2771 break
2772 done
2773
2774 fi
2775 fi
2776 AWK=$ac_cv_prog_AWK
2777 if test -n "$AWK"; then
2778   echo "$as_me:2778: result: $AWK" >&5
2779 echo "${ECHO_T}$AWK" >&6
2780 else
2781   echo "$as_me:2781: result: no" >&5
2782 echo "${ECHO_T}no" >&6
2783 fi
2784
2785   test -n "$AWK" && break
2786 done
2787
2788 test -z "$AWK" && { { echo "$as_me:2788: error: No awk program found" >&5
2789 echo "$as_me: error: No awk program found" >&2;}
2790    { (exit 1); exit 1; }; }
2791
2792 echo "$as_me:2792: checking for egrep" >&5
2793 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2794 if test "${ac_cv_prog_egrep+set}" = set; then
2795   echo $ECHO_N "(cached) $ECHO_C" >&6
2796 else
2797   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2798                 then ac_cv_prog_egrep='grep -E'
2799                 else ac_cv_prog_egrep='egrep'
2800         fi
2801 fi
2802 echo "$as_me:2802: result: $ac_cv_prog_egrep" >&5
2803 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2804         EGREP=$ac_cv_prog_egrep
2805
2806         test -z "$EGREP" && { { echo "$as_me:2806: error: No egrep program found" >&5
2807 echo "$as_me: error: No egrep program found" >&2;}
2808    { (exit 1); exit 1; }; }
2809
2810 # Find a good install program.  We prefer a C program (faster),
2811 # so one script is as good as another.  But avoid the broken or
2812 # incompatible versions:
2813 # SysV /etc/install, /usr/sbin/install
2814 # SunOS /usr/etc/install
2815 # IRIX /sbin/install
2816 # AIX /bin/install
2817 # AmigaOS /C/install, which installs bootblocks on floppy discs
2818 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2819 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2820 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2821 # ./install, which can be erroneously created by make from ./install.sh.
2822 echo "$as_me:2822: checking for a BSD compatible install" >&5
2823 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2824 if test -z "$INSTALL"; then
2825 if test "${ac_cv_path_install+set}" = set; then
2826   echo $ECHO_N "(cached) $ECHO_C" >&6
2827 else
2828     ac_save_IFS=$IFS; IFS=$ac_path_separator
2829   for ac_dir in $PATH; do
2830     IFS=$ac_save_IFS
2831     # Account for people who put trailing slashes in PATH elements.
2832     case $ac_dir/ in
2833     / | ./ | .// | /cC/* \
2834     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2835     | /usr/ucb/* ) ;;
2836     *)
2837       # OSF1 and SCO ODT 3.0 have their own names for install.
2838       # Don't use installbsd from OSF since it installs stuff as root
2839       # by default.
2840       for ac_prog in ginstall scoinst install; do
2841         if $as_executable_p "$ac_dir/$ac_prog"; then
2842           if test $ac_prog = install &&
2843             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2844             # AIX install.  It has an incompatible calling convention.
2845             :
2846           elif test $ac_prog = install &&
2847             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2848             # program-specific install script used by HP pwplus--don't use.
2849             :
2850           else
2851             ac_cv_path_install="$ac_dir/$ac_prog -c"
2852             break 2
2853           fi
2854         fi
2855       done
2856       ;;
2857     esac
2858   done
2859
2860 fi
2861   if test "${ac_cv_path_install+set}" = set; then
2862     INSTALL=$ac_cv_path_install
2863   else
2864     # As a last resort, use the slow shell script.  We don't cache a
2865     # path for INSTALL within a source directory, because that will
2866     # break other packages using the cache if that directory is
2867     # removed, or if the path is relative.
2868     INSTALL=$ac_install_sh
2869   fi
2870 fi
2871 echo "$as_me:2871: result: $INSTALL" >&5
2872 echo "${ECHO_T}$INSTALL" >&6
2873
2874 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2875 # It thinks the first close brace ends the variable substitution.
2876 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2877
2878 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2879
2880 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2881
2882 echo "$as_me:2882: checking whether ln -s works" >&5
2883 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2884 LN_S=$as_ln_s
2885 if test "$LN_S" = "ln -s"; then
2886   echo "$as_me:2886: result: yes" >&5
2887 echo "${ECHO_T}yes" >&6
2888 else
2889   echo "$as_me:2889: result: no, using $LN_S" >&5
2890 echo "${ECHO_T}no, using $LN_S" >&6
2891 fi
2892
2893 echo "$as_me:2893: checking if $LN_S -f options work" >&5
2894 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2895
2896 rm -f conf$$.src conf$$dst
2897 echo >conf$$.dst
2898 echo first >conf$$.src
2899 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2900         cf_prog_ln_sf=yes
2901 else
2902         cf_prog_ln_sf=no
2903 fi
2904 rm -f conf$$.dst conf$$src
2905 echo "$as_me:2905: result: $cf_prog_ln_sf" >&5
2906 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2907
2908 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2909
2910 # Find a good install program.  We prefer a C program (faster),
2911 # so one script is as good as another.  But avoid the broken or
2912 # incompatible versions:
2913 # SysV /etc/install, /usr/sbin/install
2914 # SunOS /usr/etc/install
2915 # IRIX /sbin/install
2916 # AIX /bin/install
2917 # AmigaOS /C/install, which installs bootblocks on floppy discs
2918 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2919 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2920 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2921 # ./install, which can be erroneously created by make from ./install.sh.
2922 echo "$as_me:2922: checking for a BSD compatible install" >&5
2923 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2924 if test -z "$INSTALL"; then
2925 if test "${ac_cv_path_install+set}" = set; then
2926   echo $ECHO_N "(cached) $ECHO_C" >&6
2927 else
2928     ac_save_IFS=$IFS; IFS=$ac_path_separator
2929   for ac_dir in $PATH; do
2930     IFS=$ac_save_IFS
2931     # Account for people who put trailing slashes in PATH elements.
2932     case $ac_dir/ in
2933     / | ./ | .// | /cC/* \
2934     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2935     | /usr/ucb/* ) ;;
2936     *)
2937       # OSF1 and SCO ODT 3.0 have their own names for install.
2938       # Don't use installbsd from OSF since it installs stuff as root
2939       # by default.
2940       for ac_prog in ginstall scoinst install; do
2941         if $as_executable_p "$ac_dir/$ac_prog"; then
2942           if test $ac_prog = install &&
2943             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2944             # AIX install.  It has an incompatible calling convention.
2945             :
2946           elif test $ac_prog = install &&
2947             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2948             # program-specific install script used by HP pwplus--don't use.
2949             :
2950           else
2951             ac_cv_path_install="$ac_dir/$ac_prog -c"
2952             break 2
2953           fi
2954         fi
2955       done
2956       ;;
2957     esac
2958   done
2959
2960 fi
2961   if test "${ac_cv_path_install+set}" = set; then
2962     INSTALL=$ac_cv_path_install
2963   else
2964     # As a last resort, use the slow shell script.  We don't cache a
2965     # path for INSTALL within a source directory, because that will
2966     # break other packages using the cache if that directory is
2967     # removed, or if the path is relative.
2968     INSTALL=$ac_install_sh
2969   fi
2970 fi
2971 echo "$as_me:2971: result: $INSTALL" >&5
2972 echo "${ECHO_T}$INSTALL" >&6
2973
2974 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2975 # It thinks the first close brace ends the variable substitution.
2976 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2977
2978 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2979
2980 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2981
2982 case $INSTALL in
2983 (/*)
2984         ;;
2985 (*)
2986         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2987         test -z "$cf_dir" && cf_dir=.
2988         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2989         ;;
2990 esac
2991
2992 echo "$as_me:2992: checking if you want to install stripped executables" >&5
2993 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2994
2995 # Check whether --enable-stripping or --disable-stripping was given.
2996 if test "${enable_stripping+set}" = set; then
2997   enableval="$enable_stripping"
2998   test "$enableval" != no && enableval=yes
2999         if test "$enableval" != "yes" ; then
3000     enable_stripping=no
3001         else
3002                 enable_stripping=yes
3003         fi
3004 else
3005   enableval=yes
3006         enable_stripping=yes
3007
3008 fi;
3009 echo "$as_me:3009: result: $enable_stripping" >&5
3010 echo "${ECHO_T}$enable_stripping" >&6
3011
3012 if test "$enable_stripping" = yes
3013 then
3014         INSTALL_OPT_S="-s"
3015 else
3016         INSTALL_OPT_S=
3017 fi
3018
3019 : "${INSTALL:=install}"
3020 echo "$as_me:3020: checking if install accepts -p option" >&5
3021 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3022 if test "${cf_cv_install_p+set}" = set; then
3023   echo $ECHO_N "(cached) $ECHO_C" >&6
3024 else
3025
3026         rm -rf ./conftest*
3027         date >conftest.in
3028         mkdir conftest.out
3029         sleep 3
3030         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3031         then
3032                 if test -f conftest.out/conftest.in
3033                 then
3034                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3035                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3036                         if test -s conftest.err
3037                         then
3038                                 cf_cv_install_p=no
3039                         else
3040                                 cf_cv_install_p=yes
3041                         fi
3042                 else
3043                         cf_cv_install_p=no
3044                 fi
3045         else
3046                 cf_cv_install_p=no
3047         fi
3048         rm -rf ./conftest*
3049
3050 fi
3051 echo "$as_me:3051: result: $cf_cv_install_p" >&5
3052 echo "${ECHO_T}$cf_cv_install_p" >&6
3053
3054 echo "$as_me:3054: checking if install needs to be told about ownership" >&5
3055 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3056 case `$ac_config_guess` in
3057 (*minix)
3058         with_install_o=yes
3059         ;;
3060 (*)
3061         with_install_o=no
3062         ;;
3063 esac
3064
3065 echo "$as_me:3065: result: $with_install_o" >&5
3066 echo "${ECHO_T}$with_install_o" >&6
3067 if test "x$with_install_o" = xyes
3068 then
3069         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3070 else
3071         INSTALL_OPT_O=
3072 fi
3073
3074 echo "$as_me:3074: checking for long file names" >&5
3075 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3076 if test "${ac_cv_sys_long_file_names+set}" = set; then
3077   echo $ECHO_N "(cached) $ECHO_C" >&6
3078 else
3079   ac_cv_sys_long_file_names=yes
3080 # Test for long file names in all the places we know might matter:
3081 #      .                the current directory, where building will happen
3082 #      $prefix/lib      where we will be installing things
3083 #      $exec_prefix/lib likewise
3084 # eval it to expand exec_prefix.
3085 #      $TMPDIR          if set, where it might want to write temporary files
3086 # if $TMPDIR is not set:
3087 #      /tmp             where it might want to write temporary files
3088 #      /var/tmp         likewise
3089 #      /usr/tmp         likewise
3090 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3091   ac_tmpdirs=$TMPDIR
3092 else
3093   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3094 fi
3095 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3096   test -d "$ac_dir" || continue
3097   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3098   ac_xdir=$ac_dir/cf$$
3099   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3100   ac_tf1=$ac_xdir/conftest9012345
3101   ac_tf2=$ac_xdir/conftest9012346
3102   (echo 1 >"$ac_tf1") 2>/dev/null
3103   (echo 2 >"$ac_tf2") 2>/dev/null
3104   ac_val=`cat "$ac_tf1" 2>/dev/null`
3105   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3106     ac_cv_sys_long_file_names=no
3107     rm -rf "$ac_xdir" 2>/dev/null
3108     break
3109   fi
3110   rm -rf "$ac_xdir" 2>/dev/null
3111 done
3112 fi
3113 echo "$as_me:3113: result: $ac_cv_sys_long_file_names" >&5
3114 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3115 if test "$ac_cv_sys_long_file_names" = yes; then
3116
3117 cat >>confdefs.h <<\EOF
3118 #define HAVE_LONG_FILE_NAMES 1
3119 EOF
3120
3121 fi
3122
3123 # if we find pkg-config, check if we should install the ".pc" files.
3124
3125 echo "$as_me:3125: checking if you want to use pkg-config" >&5
3126 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3127
3128 # Check whether --with-pkg-config or --without-pkg-config was given.
3129 if test "${with_pkg_config+set}" = set; then
3130   withval="$with_pkg_config"
3131   cf_pkg_config=$withval
3132 else
3133   cf_pkg_config=yes
3134 fi;
3135 echo "$as_me:3135: result: $cf_pkg_config" >&5
3136 echo "${ECHO_T}$cf_pkg_config" >&6
3137
3138 case "$cf_pkg_config" in
3139 (no)
3140         PKG_CONFIG=none
3141         ;;
3142 (yes)
3143
3144 if test -n "$ac_tool_prefix"; then
3145   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3146 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3147 echo "$as_me:3147: checking for $ac_word" >&5
3148 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3149 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3150   echo $ECHO_N "(cached) $ECHO_C" >&6
3151 else
3152   case $PKG_CONFIG in
3153   [\\/]* | ?:[\\/]*)
3154   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3155   ;;
3156   *)
3157   ac_save_IFS=$IFS; IFS=$ac_path_separator
3158 ac_dummy="$PATH"
3159 for ac_dir in $ac_dummy; do
3160   IFS=$ac_save_IFS
3161   test -z "$ac_dir" && ac_dir=.
3162   if $as_executable_p "$ac_dir/$ac_word"; then
3163    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3164    echo "$as_me:3164: found $ac_dir/$ac_word" >&5
3165    break
3166 fi
3167 done
3168
3169   ;;
3170 esac
3171 fi
3172 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3173
3174 if test -n "$PKG_CONFIG"; then
3175   echo "$as_me:3175: result: $PKG_CONFIG" >&5
3176 echo "${ECHO_T}$PKG_CONFIG" >&6
3177 else
3178   echo "$as_me:3178: result: no" >&5
3179 echo "${ECHO_T}no" >&6
3180 fi
3181
3182 fi
3183 if test -z "$ac_cv_path_PKG_CONFIG"; then
3184   ac_pt_PKG_CONFIG=$PKG_CONFIG
3185   # Extract the first word of "pkg-config", so it can be a program name with args.
3186 set dummy pkg-config; ac_word=$2
3187 echo "$as_me:3187: checking for $ac_word" >&5
3188 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3189 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3190   echo $ECHO_N "(cached) $ECHO_C" >&6
3191 else
3192   case $ac_pt_PKG_CONFIG in
3193   [\\/]* | ?:[\\/]*)
3194   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3195   ;;
3196   *)
3197   ac_save_IFS=$IFS; IFS=$ac_path_separator
3198 ac_dummy="$PATH"
3199 for ac_dir in $ac_dummy; do
3200   IFS=$ac_save_IFS
3201   test -z "$ac_dir" && ac_dir=.
3202   if $as_executable_p "$ac_dir/$ac_word"; then
3203    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3204    echo "$as_me:3204: found $ac_dir/$ac_word" >&5
3205    break
3206 fi
3207 done
3208
3209   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3210   ;;
3211 esac
3212 fi
3213 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3214
3215 if test -n "$ac_pt_PKG_CONFIG"; then
3216   echo "$as_me:3216: result: $ac_pt_PKG_CONFIG" >&5
3217 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3218 else
3219   echo "$as_me:3219: result: no" >&5
3220 echo "${ECHO_T}no" >&6
3221 fi
3222
3223   PKG_CONFIG=$ac_pt_PKG_CONFIG
3224 else
3225   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3226 fi
3227
3228         ;;
3229 (*)
3230         PKG_CONFIG=$withval
3231         ;;
3232 esac
3233
3234 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3235 if test "$PKG_CONFIG" != none ; then
3236
3237 if test "x$prefix" != xNONE; then
3238         cf_path_syntax="$prefix"
3239 else
3240         cf_path_syntax="$ac_default_prefix"
3241 fi
3242
3243 case ".$PKG_CONFIG" in
3244 (.\$\(*\)*|.\'*\'*)
3245         ;;
3246 (..|./*|.\\*)
3247         ;;
3248 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3249         ;;
3250 (.\$\{*prefix\}*|.\$\{*dir\}*)
3251         eval PKG_CONFIG="$PKG_CONFIG"
3252         case ".$PKG_CONFIG" in
3253         (.NONE/*)
3254                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3255                 ;;
3256         esac
3257         ;;
3258 (.no|.NONE/*)
3259         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3260         ;;
3261 (*)
3262         { { echo "$as_me:3262: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3263 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3264    { (exit 1); exit 1; }; }
3265         ;;
3266 esac
3267
3268 elif test "x$cf_pkg_config" != xno ; then
3269         { echo "$as_me:3269: WARNING: pkg-config is not installed" >&5
3270 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3271 fi
3272
3273 case "$PKG_CONFIG" in
3274 (no|none|yes)
3275         echo "$as_me:3275: checking for pkg-config library directory" >&5
3276 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3277         ;;
3278 (*)
3279         echo "$as_me:3279: checking for $PKG_CONFIG library directory" >&5
3280 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3281         ;;
3282 esac
3283
3284 # if $PKG_CONFIG_LIBDIR is set, try to use that
3285 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,'`
3286
3287 # if the option is used, let that override.  otherwise default to "libdir"
3288
3289 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3290 if test "${with_pkg_config_libdir+set}" = set; then
3291   withval="$with_pkg_config_libdir"
3292   cf_search_path=$withval
3293 else
3294   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3295 fi;
3296
3297 case "x$cf_search_path" in
3298 (xlibdir)
3299         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3300         echo "$as_me:3300: result: $PKG_CONFIG_LIBDIR" >&5
3301 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3302         cf_search_path=
3303         ;;
3304 (x)
3305         ;;
3306 (x/*\ *)
3307         PKG_CONFIG_LIBDIR=
3308         ;;
3309 (x/*)
3310         PKG_CONFIG_LIBDIR="$cf_search_path"
3311         echo "$as_me:3311: result: $PKG_CONFIG_LIBDIR" >&5
3312 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3313         cf_search_path=
3314         ;;
3315 (xyes|xauto)
3316         echo "$as_me:3316: result: auto" >&5
3317 echo "${ECHO_T}auto" >&6
3318         cf_search_path=
3319         # Look for the library directory using the same prefix as the executable
3320         echo "$as_me:3320: checking for search-list" >&5
3321 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3322         if test "x$PKG_CONFIG" != xnone
3323         then
3324                 # works for pkg-config since version 0.24 (2009)
3325                 # works for pkgconf since version 0.8.3 (2012)
3326                 for cf_pkg_program in \
3327                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3328                         pkg-config \
3329                         pkgconf
3330                 do
3331                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3332                         test -n "$cf_search_path" && break
3333                 done
3334
3335                 # works for pkg-config since import in 2005 of original 2001 HP code.
3336                 test -z "$cf_search_path" && \
3337                 cf_search_path=`
3338                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3339 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3340         sub(\"^[^']*'\",\"\"); \
3341         sub(\"'.*\",\"\"); \
3342         printf \" %s\", \\$0; } \
3343 { next; } \
3344 "`
3345         fi
3346
3347         echo "$as_me:3347: result: $cf_search_path" >&5
3348 echo "${ECHO_T}$cf_search_path" >&6
3349         ;;
3350 (*)
3351         { { echo "$as_me:3351: error: Unexpected option value: $cf_search_path" >&5
3352 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3353    { (exit 1); exit 1; }; }
3354         ;;
3355 esac
3356
3357 if test -n "$cf_search_path"
3358 then
3359         echo "$as_me:3359: checking for first directory" >&5
3360 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3361         cf_pkg_config_path=none
3362         for cf_config in $cf_search_path
3363         do
3364                 if test -d "$cf_config"
3365                 then
3366                         cf_pkg_config_path=$cf_config
3367                         break
3368                 fi
3369         done
3370         echo "$as_me:3370: result: $cf_pkg_config_path" >&5
3371 echo "${ECHO_T}$cf_pkg_config_path" >&6
3372
3373         if test "x$cf_pkg_config_path" != xnone ; then
3374                 # limit this to the first directory found
3375                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3376         fi
3377
3378         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3379         then
3380                 echo "$as_me:3380: checking for workaround" >&5
3381 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3382                 if test "$prefix" = "NONE" ; then
3383                         cf_prefix="$ac_default_prefix"
3384                 else
3385                         cf_prefix="$prefix"
3386                 fi
3387                 eval cf_libdir=$libdir
3388                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3389                 cf_backup=
3390                 for cf_config in $cf_search_path
3391                 do
3392                         case $cf_config in
3393                         $cf_libdir/pkgconfig)
3394                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3395                                 break
3396                                 ;;
3397                         *)
3398                                 test -z "$cf_backup" && cf_backup=$cf_config
3399                                 ;;
3400                         esac
3401                 done
3402                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3403                 echo "$as_me:3403: result: $PKG_CONFIG_LIBDIR" >&5
3404 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3405         fi
3406 fi
3407
3408 echo "$as_me:3408: checking if you want to build test-programs" >&5
3409 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3410
3411 # Check whether --with-tests or --without-tests was given.
3412 if test "${with_tests+set}" = set; then
3413   withval="$with_tests"
3414   cf_with_tests=$withval
3415 else
3416   cf_with_tests=yes
3417 fi;
3418 echo "$as_me:3418: result: $cf_with_tests" >&5
3419 echo "${ECHO_T}$cf_with_tests" >&6
3420
3421 echo "$as_me:3421: checking if we should assume mixed-case filenames" >&5
3422 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3423
3424 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3425 if test "${enable_mixed_case+set}" = set; then
3426   enableval="$enable_mixed_case"
3427   enable_mixedcase=$enableval
3428 else
3429   enable_mixedcase=auto
3430 fi;
3431 echo "$as_me:3431: result: $enable_mixedcase" >&5
3432 echo "${ECHO_T}$enable_mixedcase" >&6
3433 if test "$enable_mixedcase" = "auto" ; then
3434
3435 echo "$as_me:3435: checking if filesystem supports mixed-case filenames" >&5
3436 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3437 if test "${cf_cv_mixedcase+set}" = set; then
3438   echo $ECHO_N "(cached) $ECHO_C" >&6
3439 else
3440
3441 if test "$cross_compiling" = yes ; then
3442         case "$target_alias" in
3443         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3444                 cf_cv_mixedcase=no
3445                 ;;
3446         (*)
3447                 cf_cv_mixedcase=yes
3448                 ;;
3449         esac
3450 else
3451         rm -f conftest CONFTEST
3452         echo test >conftest
3453         if test -f CONFTEST ; then
3454                 cf_cv_mixedcase=no
3455         else
3456                 cf_cv_mixedcase=yes
3457         fi
3458         rm -f conftest CONFTEST
3459 fi
3460
3461 fi
3462 echo "$as_me:3462: result: $cf_cv_mixedcase" >&5
3463 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3464 test "$cf_cv_mixedcase" = yes &&
3465 cat >>confdefs.h <<\EOF
3466 #define MIXEDCASE_FILENAMES 1
3467 EOF
3468
3469 else
3470         cf_cv_mixedcase=$enable_mixedcase
3471         if test "$enable_mixedcase" = "yes" ; then
3472                 cat >>confdefs.h <<\EOF
3473 #define MIXEDCASE_FILENAMES 1
3474 EOF
3475
3476         fi
3477 fi
3478
3479 # do this after mixed-case option (tags/TAGS is not as important as tic).
3480 echo "$as_me:3480: checking whether ${MAKE-make} sets \${MAKE}" >&5
3481 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3482 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3483 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3484   echo $ECHO_N "(cached) $ECHO_C" >&6
3485 else
3486   cat >conftest.make <<\EOF
3487 all:
3488         @echo 'ac_maketemp="${MAKE}"'
3489 EOF
3490 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3491 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3492 if test -n "$ac_maketemp"; then
3493   eval ac_cv_prog_make_${ac_make}_set=yes
3494 else
3495   eval ac_cv_prog_make_${ac_make}_set=no
3496 fi
3497 rm -f conftest.make
3498 fi
3499 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3500   echo "$as_me:3500: result: yes" >&5
3501 echo "${ECHO_T}yes" >&6
3502   SET_MAKE=
3503 else
3504   echo "$as_me:3504: result: no" >&5
3505 echo "${ECHO_T}no" >&6
3506   SET_MAKE="MAKE=${MAKE-make}"
3507 fi
3508
3509 echo "$as_me:3509: checking for \".PHONY\" make-support" >&5
3510 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3511 if test "${cf_cv_make_PHONY+set}" = set; then
3512   echo $ECHO_N "(cached) $ECHO_C" >&6
3513 else
3514
3515         rm -rf conftest*
3516         (
3517                 mkdir conftest || exit 1
3518                 cd conftest
3519                 cat >makefile <<'CF_EOF'
3520 .PHONY: always
3521 DATA=0
3522 always: always.out
3523         @echo "** making $@ $(DATA)"
3524 once: once.out
3525         @echo "** making $@ $(DATA)"
3526 always.out:
3527         @echo "** making $@ $(DATA)"
3528         echo $(DATA) > $@
3529 once.out:
3530         @echo "** making $@ $(DATA)"
3531         echo $(DATA) > $@
3532 CF_EOF
3533                 for cf_data in 1 2 3
3534                 do
3535                         ${MAKE:-make} always DATA=$cf_data
3536                         ${MAKE:-make} once   DATA=$cf_data
3537                         ${MAKE:-make} -t always once
3538                         if test -f always ; then
3539                                 echo "no (case 1)" > ../conftest.tmp
3540                         elif test ! -f always.out ; then
3541                                 echo "no (case 2)" > ../conftest.tmp
3542                         elif test ! -f once.out ; then
3543                                 echo "no (case 3)" > ../conftest.tmp
3544                         elif ! cmp -s always.out once.out ; then
3545                                 echo "no (case 4)" > ../conftest.tmp
3546                                 diff always.out once.out
3547                         else
3548                                 cf_check="`cat always.out`"
3549                                 if test "x$cf_check" != "x$cf_data" ; then
3550                                         echo "no (case 5)" > ../conftest.tmp
3551                                 else
3552                                         echo yes > ../conftest.tmp
3553                                         rm -f ./*.out
3554                                         continue
3555                                 fi
3556                         fi
3557                         break
3558                 done
3559         ) >&5 2>&1
3560         cf_cv_make_PHONY="`cat conftest.tmp`"
3561         rm -rf conftest*
3562
3563 fi
3564 echo "$as_me:3564: result: $cf_cv_make_PHONY" >&5
3565 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3566 MAKE_NO_PHONY="#"
3567 MAKE_PHONY="#"
3568 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3569 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3570
3571 for ac_prog in exctags ctags
3572 do
3573   # Extract the first word of "$ac_prog", so it can be a program name with args.
3574 set dummy $ac_prog; ac_word=$2
3575 echo "$as_me:3575: checking for $ac_word" >&5
3576 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3577 if test "${ac_cv_prog_CTAGS+set}" = set; then
3578   echo $ECHO_N "(cached) $ECHO_C" >&6
3579 else
3580   if test -n "$CTAGS"; then
3581   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3582 else
3583   ac_save_IFS=$IFS; IFS=$ac_path_separator
3584 ac_dummy="$PATH"
3585 for ac_dir in $ac_dummy; do
3586   IFS=$ac_save_IFS
3587   test -z "$ac_dir" && ac_dir=.
3588   $as_executable_p "$ac_dir/$ac_word" || continue
3589 ac_cv_prog_CTAGS="$ac_prog"
3590 echo "$as_me:3590: found $ac_dir/$ac_word" >&5
3591 break
3592 done
3593
3594 fi
3595 fi
3596 CTAGS=$ac_cv_prog_CTAGS
3597 if test -n "$CTAGS"; then
3598   echo "$as_me:3598: result: $CTAGS" >&5
3599 echo "${ECHO_T}$CTAGS" >&6
3600 else
3601   echo "$as_me:3601: result: no" >&5
3602 echo "${ECHO_T}no" >&6
3603 fi
3604
3605   test -n "$CTAGS" && break
3606 done
3607
3608 for ac_prog in exetags etags
3609 do
3610   # Extract the first word of "$ac_prog", so it can be a program name with args.
3611 set dummy $ac_prog; ac_word=$2
3612 echo "$as_me:3612: checking for $ac_word" >&5
3613 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3614 if test "${ac_cv_prog_ETAGS+set}" = set; then
3615   echo $ECHO_N "(cached) $ECHO_C" >&6
3616 else
3617   if test -n "$ETAGS"; then
3618   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3619 else
3620   ac_save_IFS=$IFS; IFS=$ac_path_separator
3621 ac_dummy="$PATH"
3622 for ac_dir in $ac_dummy; do
3623   IFS=$ac_save_IFS
3624   test -z "$ac_dir" && ac_dir=.
3625   $as_executable_p "$ac_dir/$ac_word" || continue
3626 ac_cv_prog_ETAGS="$ac_prog"
3627 echo "$as_me:3627: found $ac_dir/$ac_word" >&5
3628 break
3629 done
3630
3631 fi
3632 fi
3633 ETAGS=$ac_cv_prog_ETAGS
3634 if test -n "$ETAGS"; then
3635   echo "$as_me:3635: result: $ETAGS" >&5
3636 echo "${ECHO_T}$ETAGS" >&6
3637 else
3638   echo "$as_me:3638: result: no" >&5
3639 echo "${ECHO_T}no" >&6
3640 fi
3641
3642   test -n "$ETAGS" && break
3643 done
3644
3645 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3646 set dummy ${CTAGS:-ctags}; ac_word=$2
3647 echo "$as_me:3647: checking for $ac_word" >&5
3648 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3649 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3650   echo $ECHO_N "(cached) $ECHO_C" >&6
3651 else
3652   if test -n "$MAKE_LOWER_TAGS"; then
3653   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3654 else
3655   ac_save_IFS=$IFS; IFS=$ac_path_separator
3656 ac_dummy="$PATH"
3657 for ac_dir in $ac_dummy; do
3658   IFS=$ac_save_IFS
3659   test -z "$ac_dir" && ac_dir=.
3660   $as_executable_p "$ac_dir/$ac_word" || continue
3661 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3662 echo "$as_me:3662: found $ac_dir/$ac_word" >&5
3663 break
3664 done
3665
3666   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3667 fi
3668 fi
3669 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3670 if test -n "$MAKE_LOWER_TAGS"; then
3671   echo "$as_me:3671: result: $MAKE_LOWER_TAGS" >&5
3672 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3673 else
3674   echo "$as_me:3674: result: no" >&5
3675 echo "${ECHO_T}no" >&6
3676 fi
3677
3678 if test "$cf_cv_mixedcase" = yes ; then
3679         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3680 set dummy ${ETAGS:-etags}; ac_word=$2
3681 echo "$as_me:3681: checking for $ac_word" >&5
3682 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3683 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3684   echo $ECHO_N "(cached) $ECHO_C" >&6
3685 else
3686   if test -n "$MAKE_UPPER_TAGS"; then
3687   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3688 else
3689   ac_save_IFS=$IFS; IFS=$ac_path_separator
3690 ac_dummy="$PATH"
3691 for ac_dir in $ac_dummy; do
3692   IFS=$ac_save_IFS
3693   test -z "$ac_dir" && ac_dir=.
3694   $as_executable_p "$ac_dir/$ac_word" || continue
3695 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3696 echo "$as_me:3696: found $ac_dir/$ac_word" >&5
3697 break
3698 done
3699
3700   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3701 fi
3702 fi
3703 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3704 if test -n "$MAKE_UPPER_TAGS"; then
3705   echo "$as_me:3705: result: $MAKE_UPPER_TAGS" >&5
3706 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3707 else
3708   echo "$as_me:3708: result: no" >&5
3709 echo "${ECHO_T}no" >&6
3710 fi
3711
3712 else
3713         MAKE_UPPER_TAGS=no
3714 fi
3715
3716 if test "$MAKE_UPPER_TAGS" = yes ; then
3717         MAKE_UPPER_TAGS=
3718 else
3719         MAKE_UPPER_TAGS="#"
3720 fi
3721
3722 if test "$MAKE_LOWER_TAGS" = yes ; then
3723         MAKE_LOWER_TAGS=
3724 else
3725         MAKE_LOWER_TAGS="#"
3726 fi
3727
3728 echo "$as_me:3728: checking for makeflags variable" >&5
3729 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3730 if test "${cf_cv_makeflags+set}" = set; then
3731   echo $ECHO_N "(cached) $ECHO_C" >&6
3732 else
3733
3734         cf_cv_makeflags=''
3735         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3736         do
3737                 cat >cf_makeflags.tmp <<CF_EOF
3738 SHELL = $SHELL
3739 all :
3740         @ echo '.$cf_option'
3741 CF_EOF
3742                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3743                 case "$cf_result" in
3744                 (.*k|.*kw)
3745                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3746                         case "$cf_result" in
3747                         (.*CC=*)        cf_cv_makeflags=
3748                                 ;;
3749                         (*)     cf_cv_makeflags=$cf_option
3750                                 ;;
3751                         esac
3752                         break
3753                         ;;
3754                 (.-)
3755                         ;;
3756                 (*)
3757
3758 echo "${as_me:-configure}:3758: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3759
3760                         ;;
3761                 esac
3762         done
3763         rm -f cf_makeflags.tmp
3764
3765 fi
3766 echo "$as_me:3766: result: $cf_cv_makeflags" >&5
3767 echo "${ECHO_T}$cf_cv_makeflags" >&6
3768
3769 if test -n "$ac_tool_prefix"; then
3770   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3771 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3772 echo "$as_me:3772: checking for $ac_word" >&5
3773 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3774 if test "${ac_cv_prog_RANLIB+set}" = set; then
3775   echo $ECHO_N "(cached) $ECHO_C" >&6
3776 else
3777   if test -n "$RANLIB"; then
3778   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3779 else
3780   ac_save_IFS=$IFS; IFS=$ac_path_separator
3781 ac_dummy="$PATH"
3782 for ac_dir in $ac_dummy; do
3783   IFS=$ac_save_IFS
3784   test -z "$ac_dir" && ac_dir=.
3785   $as_executable_p "$ac_dir/$ac_word" || continue
3786 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3787 echo "$as_me:3787: found $ac_dir/$ac_word" >&5
3788 break
3789 done
3790
3791 fi
3792 fi
3793 RANLIB=$ac_cv_prog_RANLIB
3794 if test -n "$RANLIB"; then
3795   echo "$as_me:3795: result: $RANLIB" >&5
3796 echo "${ECHO_T}$RANLIB" >&6
3797 else
3798   echo "$as_me:3798: result: no" >&5
3799 echo "${ECHO_T}no" >&6
3800 fi
3801
3802 fi
3803 if test -z "$ac_cv_prog_RANLIB"; then
3804   ac_ct_RANLIB=$RANLIB
3805   # Extract the first word of "ranlib", so it can be a program name with args.
3806 set dummy ranlib; ac_word=$2
3807 echo "$as_me:3807: checking for $ac_word" >&5
3808 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3809 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3810   echo $ECHO_N "(cached) $ECHO_C" >&6
3811 else
3812   if test -n "$ac_ct_RANLIB"; then
3813   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3814 else
3815   ac_save_IFS=$IFS; IFS=$ac_path_separator
3816 ac_dummy="$PATH"
3817 for ac_dir in $ac_dummy; do
3818   IFS=$ac_save_IFS
3819   test -z "$ac_dir" && ac_dir=.
3820   $as_executable_p "$ac_dir/$ac_word" || continue
3821 ac_cv_prog_ac_ct_RANLIB="ranlib"
3822 echo "$as_me:3822: found $ac_dir/$ac_word" >&5
3823 break
3824 done
3825
3826   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3827 fi
3828 fi
3829 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3830 if test -n "$ac_ct_RANLIB"; then
3831   echo "$as_me:3831: result: $ac_ct_RANLIB" >&5
3832 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3833 else
3834   echo "$as_me:3834: result: no" >&5
3835 echo "${ECHO_T}no" >&6
3836 fi
3837
3838   RANLIB=$ac_ct_RANLIB
3839 else
3840   RANLIB="$ac_cv_prog_RANLIB"
3841 fi
3842
3843 if test -n "$ac_tool_prefix"; then
3844   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3845 set dummy ${ac_tool_prefix}ld; ac_word=$2
3846 echo "$as_me:3846: checking for $ac_word" >&5
3847 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3848 if test "${ac_cv_prog_LD+set}" = set; then
3849   echo $ECHO_N "(cached) $ECHO_C" >&6
3850 else
3851   if test -n "$LD"; then
3852   ac_cv_prog_LD="$LD" # Let the user override the test.
3853 else
3854   ac_save_IFS=$IFS; IFS=$ac_path_separator
3855 ac_dummy="$PATH"
3856 for ac_dir in $ac_dummy; do
3857   IFS=$ac_save_IFS
3858   test -z "$ac_dir" && ac_dir=.
3859   $as_executable_p "$ac_dir/$ac_word" || continue
3860 ac_cv_prog_LD="${ac_tool_prefix}ld"
3861 echo "$as_me:3861: found $ac_dir/$ac_word" >&5
3862 break
3863 done
3864
3865 fi
3866 fi
3867 LD=$ac_cv_prog_LD
3868 if test -n "$LD"; then
3869   echo "$as_me:3869: result: $LD" >&5
3870 echo "${ECHO_T}$LD" >&6
3871 else
3872   echo "$as_me:3872: result: no" >&5
3873 echo "${ECHO_T}no" >&6
3874 fi
3875
3876 fi
3877 if test -z "$ac_cv_prog_LD"; then
3878   ac_ct_LD=$LD
3879   # Extract the first word of "ld", so it can be a program name with args.
3880 set dummy ld; ac_word=$2
3881 echo "$as_me:3881: checking for $ac_word" >&5
3882 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3883 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3884   echo $ECHO_N "(cached) $ECHO_C" >&6
3885 else
3886   if test -n "$ac_ct_LD"; then
3887   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3888 else
3889   ac_save_IFS=$IFS; IFS=$ac_path_separator
3890 ac_dummy="$PATH"
3891 for ac_dir in $ac_dummy; do
3892   IFS=$ac_save_IFS
3893   test -z "$ac_dir" && ac_dir=.
3894   $as_executable_p "$ac_dir/$ac_word" || continue
3895 ac_cv_prog_ac_ct_LD="ld"
3896 echo "$as_me:3896: found $ac_dir/$ac_word" >&5
3897 break
3898 done
3899
3900   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3901 fi
3902 fi
3903 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3904 if test -n "$ac_ct_LD"; then
3905   echo "$as_me:3905: result: $ac_ct_LD" >&5
3906 echo "${ECHO_T}$ac_ct_LD" >&6
3907 else
3908   echo "$as_me:3908: result: no" >&5
3909 echo "${ECHO_T}no" >&6
3910 fi
3911
3912   LD=$ac_ct_LD
3913 else
3914   LD="$ac_cv_prog_LD"
3915 fi
3916
3917 if test -n "$ac_tool_prefix"; then
3918   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3919 set dummy ${ac_tool_prefix}ar; ac_word=$2
3920 echo "$as_me:3920: checking for $ac_word" >&5
3921 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3922 if test "${ac_cv_prog_AR+set}" = set; then
3923   echo $ECHO_N "(cached) $ECHO_C" >&6
3924 else
3925   if test -n "$AR"; then
3926   ac_cv_prog_AR="$AR" # Let the user override the test.
3927 else
3928   ac_save_IFS=$IFS; IFS=$ac_path_separator
3929 ac_dummy="$PATH"
3930 for ac_dir in $ac_dummy; do
3931   IFS=$ac_save_IFS
3932   test -z "$ac_dir" && ac_dir=.
3933   $as_executable_p "$ac_dir/$ac_word" || continue
3934 ac_cv_prog_AR="${ac_tool_prefix}ar"
3935 echo "$as_me:3935: found $ac_dir/$ac_word" >&5
3936 break
3937 done
3938
3939 fi
3940 fi
3941 AR=$ac_cv_prog_AR
3942 if test -n "$AR"; then
3943   echo "$as_me:3943: result: $AR" >&5
3944 echo "${ECHO_T}$AR" >&6
3945 else
3946   echo "$as_me:3946: result: no" >&5
3947 echo "${ECHO_T}no" >&6
3948 fi
3949
3950 fi
3951 if test -z "$ac_cv_prog_AR"; then
3952   ac_ct_AR=$AR
3953   # Extract the first word of "ar", so it can be a program name with args.
3954 set dummy ar; ac_word=$2
3955 echo "$as_me:3955: checking for $ac_word" >&5
3956 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3957 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3958   echo $ECHO_N "(cached) $ECHO_C" >&6
3959 else
3960   if test -n "$ac_ct_AR"; then
3961   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3962 else
3963   ac_save_IFS=$IFS; IFS=$ac_path_separator
3964 ac_dummy="$PATH"
3965 for ac_dir in $ac_dummy; do
3966   IFS=$ac_save_IFS
3967   test -z "$ac_dir" && ac_dir=.
3968   $as_executable_p "$ac_dir/$ac_word" || continue
3969 ac_cv_prog_ac_ct_AR="ar"
3970 echo "$as_me:3970: found $ac_dir/$ac_word" >&5
3971 break
3972 done
3973
3974   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3975 fi
3976 fi
3977 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3978 if test -n "$ac_ct_AR"; then
3979   echo "$as_me:3979: result: $ac_ct_AR" >&5
3980 echo "${ECHO_T}$ac_ct_AR" >&6
3981 else
3982   echo "$as_me:3982: result: no" >&5
3983 echo "${ECHO_T}no" >&6
3984 fi
3985
3986   AR=$ac_ct_AR
3987 else
3988   AR="$ac_cv_prog_AR"
3989 fi
3990
3991 if test -n "$ac_tool_prefix"; then
3992   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3993 set dummy ${ac_tool_prefix}ar; ac_word=$2
3994 echo "$as_me:3994: checking for $ac_word" >&5
3995 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3996 if test "${ac_cv_prog_AR+set}" = set; then
3997   echo $ECHO_N "(cached) $ECHO_C" >&6
3998 else
3999   if test -n "$AR"; then
4000   ac_cv_prog_AR="$AR" # Let the user override the test.
4001 else
4002   ac_save_IFS=$IFS; IFS=$ac_path_separator
4003 ac_dummy="$PATH"
4004 for ac_dir in $ac_dummy; do
4005   IFS=$ac_save_IFS
4006   test -z "$ac_dir" && ac_dir=.
4007   $as_executable_p "$ac_dir/$ac_word" || continue
4008 ac_cv_prog_AR="${ac_tool_prefix}ar"
4009 echo "$as_me:4009: found $ac_dir/$ac_word" >&5
4010 break
4011 done
4012
4013 fi
4014 fi
4015 AR=$ac_cv_prog_AR
4016 if test -n "$AR"; then
4017   echo "$as_me:4017: result: $AR" >&5
4018 echo "${ECHO_T}$AR" >&6
4019 else
4020   echo "$as_me:4020: result: no" >&5
4021 echo "${ECHO_T}no" >&6
4022 fi
4023
4024 fi
4025 if test -z "$ac_cv_prog_AR"; then
4026   ac_ct_AR=$AR
4027   # Extract the first word of "ar", so it can be a program name with args.
4028 set dummy ar; ac_word=$2
4029 echo "$as_me:4029: checking for $ac_word" >&5
4030 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4031 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4032   echo $ECHO_N "(cached) $ECHO_C" >&6
4033 else
4034   if test -n "$ac_ct_AR"; then
4035   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4036 else
4037   ac_save_IFS=$IFS; IFS=$ac_path_separator
4038 ac_dummy="$PATH"
4039 for ac_dir in $ac_dummy; do
4040   IFS=$ac_save_IFS
4041   test -z "$ac_dir" && ac_dir=.
4042   $as_executable_p "$ac_dir/$ac_word" || continue
4043 ac_cv_prog_ac_ct_AR="ar"
4044 echo "$as_me:4044: found $ac_dir/$ac_word" >&5
4045 break
4046 done
4047
4048   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4049 fi
4050 fi
4051 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4052 if test -n "$ac_ct_AR"; then
4053   echo "$as_me:4053: result: $ac_ct_AR" >&5
4054 echo "${ECHO_T}$ac_ct_AR" >&6
4055 else
4056   echo "$as_me:4056: result: no" >&5
4057 echo "${ECHO_T}no" >&6
4058 fi
4059
4060   AR=$ac_ct_AR
4061 else
4062   AR="$ac_cv_prog_AR"
4063 fi
4064
4065 echo "$as_me:4065: checking for options to update archives" >&5
4066 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4067 if test "${cf_cv_ar_flags+set}" = set; then
4068   echo $ECHO_N "(cached) $ECHO_C" >&6
4069 else
4070
4071         case "$cf_cv_system_name" in
4072         (*-msvc*)
4073                 cf_cv_ar_flags=''
4074                 cat >mk_static_lib.sh <<-EOF
4075                 #!$SHELL
4076                 MSVC_BIN="$AR"
4077                 out="\$1"
4078                 shift
4079                 exec \$MSVC_BIN -out:"\$out" \$@
4080                 EOF
4081                 chmod +x mk_static_lib.sh
4082                 AR=`pwd`/mk_static_lib.sh
4083                 ;;
4084         (*)
4085                 cf_cv_ar_flags=unknown
4086                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4087                 do
4088
4089                         # check if $ARFLAGS already contains this choice
4090                         if test "x$ARFLAGS" != "x" ; then
4091                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4092                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4093                                         cf_cv_ar_flags=
4094                                         break
4095                                 fi
4096                         fi
4097
4098                         rm -f "conftest.$ac_cv_objext"
4099                         rm -f conftest.a
4100
4101                         cat >"conftest.$ac_ext" <<EOF
4102 #line 4102 "configure"
4103 int     testdata[3] = { 123, 456, 789 };
4104 EOF
4105                         if { (eval echo "$as_me:4105: \"$ac_compile\"") >&5
4106   (eval $ac_compile) 2>&5
4107   ac_status=$?
4108   echo "$as_me:4108: \$? = $ac_status" >&5
4109   (exit "$ac_status"); } ; then
4110                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4111                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4112                                 if test -f conftest.a ; then
4113                                         cf_cv_ar_flags="$cf_ar_flags"
4114                                         break
4115                                 fi
4116                         else
4117                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4118
4119 echo "${as_me:-configure}:4119: testing cannot compile test-program ..." 1>&5
4120
4121                                 break
4122                         fi
4123                 done
4124                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4125                 ;;
4126         esac
4127
4128 fi
4129 echo "$as_me:4129: result: $cf_cv_ar_flags" >&5
4130 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4131
4132 if test -n "$ARFLAGS" ; then
4133         if test -n "$cf_cv_ar_flags" ; then
4134                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4135         fi
4136 else
4137         ARFLAGS=$cf_cv_ar_flags
4138 fi
4139
4140         echo "$as_me:4140: checking for PATH separator" >&5
4141 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4142         case "$cf_cv_system_name" in
4143         (os2*)  PATH_SEPARATOR=';'  ;;
4144         (*)     ${PATH_SEPARATOR:=':'}  ;;
4145         esac
4146
4147         echo "$as_me:4147: result: $PATH_SEPARATOR" >&5
4148 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4149
4150 echo "$as_me:4150: checking if you have specified an install-prefix" >&5
4151 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4152
4153 # Check whether --with-install-prefix or --without-install-prefix was given.
4154 if test "${with_install_prefix+set}" = set; then
4155   withval="$with_install_prefix"
4156   case "$withval" in
4157         (yes|no)
4158                 ;;
4159         (*)     DESTDIR="$withval"
4160                 ;;
4161         esac
4162 fi;
4163 echo "$as_me:4163: result: $DESTDIR" >&5
4164 echo "${ECHO_T}$DESTDIR" >&6
4165
4166 ###############################################################################
4167
4168 # If we're cross-compiling, allow the user to override the tools and their
4169 # options.  The configure script is oriented toward identifying the host
4170 # compiler, etc., but we need a build compiler to generate parts of the source.
4171
4172 if test "$cross_compiling" = yes ; then
4173
4174         # defaults that we might want to override
4175         : ${BUILD_CFLAGS:=''}
4176         : ${BUILD_CPPFLAGS:=''}
4177         : ${BUILD_LDFLAGS:=''}
4178         : ${BUILD_LIBS:=''}
4179         : ${BUILD_EXEEXT:='$x'}
4180         : ${BUILD_OBJEXT:='o'}
4181
4182 # Check whether --with-build-cc or --without-build-cc was given.
4183 if test "${with_build_cc+set}" = set; then
4184   withval="$with_build_cc"
4185   BUILD_CC="$withval"
4186 else
4187   for ac_prog in gcc clang c99 c89 cc cl
4188 do
4189   # Extract the first word of "$ac_prog", so it can be a program name with args.
4190 set dummy $ac_prog; ac_word=$2
4191 echo "$as_me:4191: checking for $ac_word" >&5
4192 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4193 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4194   echo $ECHO_N "(cached) $ECHO_C" >&6
4195 else
4196   if test -n "$BUILD_CC"; then
4197   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4198 else
4199   ac_save_IFS=$IFS; IFS=$ac_path_separator
4200 ac_dummy="$PATH"
4201 for ac_dir in $ac_dummy; do
4202   IFS=$ac_save_IFS
4203   test -z "$ac_dir" && ac_dir=.
4204   $as_executable_p "$ac_dir/$ac_word" || continue
4205 ac_cv_prog_BUILD_CC="$ac_prog"
4206 echo "$as_me:4206: found $ac_dir/$ac_word" >&5
4207 break
4208 done
4209
4210 fi
4211 fi
4212 BUILD_CC=$ac_cv_prog_BUILD_CC
4213 if test -n "$BUILD_CC"; then
4214   echo "$as_me:4214: result: $BUILD_CC" >&5
4215 echo "${ECHO_T}$BUILD_CC" >&6
4216 else
4217   echo "$as_me:4217: result: no" >&5
4218 echo "${ECHO_T}no" >&6
4219 fi
4220
4221   test -n "$BUILD_CC" && break
4222 done
4223 test -n "$BUILD_CC" || BUILD_CC="none"
4224
4225 fi;
4226         echo "$as_me:4226: checking for native build C compiler" >&5
4227 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4228         echo "$as_me:4228: result: $BUILD_CC" >&5
4229 echo "${ECHO_T}$BUILD_CC" >&6
4230
4231         echo "$as_me:4231: checking for native build C preprocessor" >&5
4232 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4233
4234 # Check whether --with-build-cpp or --without-build-cpp was given.
4235 if test "${with_build_cpp+set}" = set; then
4236   withval="$with_build_cpp"
4237   BUILD_CPP="$withval"
4238 else
4239   BUILD_CPP='${BUILD_CC} -E'
4240 fi;
4241         echo "$as_me:4241: result: $BUILD_CPP" >&5
4242 echo "${ECHO_T}$BUILD_CPP" >&6
4243
4244         echo "$as_me:4244: checking for native build C flags" >&5
4245 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4246
4247 # Check whether --with-build-cflags or --without-build-cflags was given.
4248 if test "${with_build_cflags+set}" = set; then
4249   withval="$with_build_cflags"
4250   BUILD_CFLAGS="$withval"
4251 fi;
4252         echo "$as_me:4252: result: $BUILD_CFLAGS" >&5
4253 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4254
4255         echo "$as_me:4255: checking for native build C preprocessor-flags" >&5
4256 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4257
4258 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4259 if test "${with_build_cppflags+set}" = set; then
4260   withval="$with_build_cppflags"
4261   BUILD_CPPFLAGS="$withval"
4262 fi;
4263         echo "$as_me:4263: result: $BUILD_CPPFLAGS" >&5
4264 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4265
4266         echo "$as_me:4266: checking for native build linker-flags" >&5
4267 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4268
4269 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4270 if test "${with_build_ldflags+set}" = set; then
4271   withval="$with_build_ldflags"
4272   BUILD_LDFLAGS="$withval"
4273 fi;
4274         echo "$as_me:4274: result: $BUILD_LDFLAGS" >&5
4275 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4276
4277         echo "$as_me:4277: checking for native build linker-libraries" >&5
4278 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4279
4280 # Check whether --with-build-libs or --without-build-libs was given.
4281 if test "${with_build_libs+set}" = set; then
4282   withval="$with_build_libs"
4283   BUILD_LIBS="$withval"
4284 fi;
4285         echo "$as_me:4285: result: $BUILD_LIBS" >&5
4286 echo "${ECHO_T}$BUILD_LIBS" >&6
4287
4288         # this assumes we're on Unix.
4289         BUILD_EXEEXT=
4290         BUILD_OBJEXT=o
4291
4292         : ${BUILD_CC:='${CC}'}
4293
4294         echo "$as_me:4294: checking if the build-compiler \"$BUILD_CC\" works" >&5
4295 echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4296
4297         cf_save_crossed=$cross_compiling
4298         cf_save_ac_link=$ac_link
4299         cross_compiling=no
4300         cf_build_cppflags=$BUILD_CPPFLAGS
4301         test "$cf_build_cppflags" = "#" && cf_build_cppflags=
4302         ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $cf_build_cppflags $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4303
4304         if test "$cross_compiling" = yes; then
4305   cf_ok_build_cc=unknown
4306 else
4307   cat >"conftest.$ac_ext" <<_ACEOF
4308 #line 4308 "configure"
4309 #include "confdefs.h"
4310 #include <stdio.h>
4311                 int main(int argc, char *argv[])
4312                 {
4313                         ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4314                 }
4315
4316 _ACEOF
4317 rm -f "conftest$ac_exeext"
4318 if { (eval echo "$as_me:4318: \"$ac_link\"") >&5
4319   (eval $ac_link) 2>&5
4320   ac_status=$?
4321   echo "$as_me:4321: \$? = $ac_status" >&5
4322   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4323   { (eval echo "$as_me:4323: \"$ac_try\"") >&5
4324   (eval $ac_try) 2>&5
4325   ac_status=$?
4326   echo "$as_me:4326: \$? = $ac_status" >&5
4327   (exit "$ac_status"); }; }; then
4328   cf_ok_build_cc=yes
4329 else
4330   echo "$as_me: program exited with status $ac_status" >&5
4331 echo "$as_me: failed program was:" >&5
4332 cat "conftest.$ac_ext" >&5
4333 cf_ok_build_cc=no
4334 fi
4335 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4336 fi
4337
4338         cross_compiling=$cf_save_crossed
4339         ac_link=$cf_save_ac_link
4340
4341         echo "$as_me:4341: result: $cf_ok_build_cc" >&5
4342 echo "${ECHO_T}$cf_ok_build_cc" >&6
4343
4344         if test "$cf_ok_build_cc" != yes
4345         then
4346                 { { echo "$as_me:4346: error: Cross-build requires two compilers.
4347 Use --with-build-cc to specify the native compiler." >&5
4348 echo "$as_me: error: Cross-build requires two compilers.
4349 Use --with-build-cc to specify the native compiler." >&2;}
4350    { (exit 1); exit 1; }; }
4351         fi
4352
4353 else
4354         : ${BUILD_CC:='${CC}'}
4355         : ${BUILD_CPP:='${CPP}'}
4356         : ${BUILD_CFLAGS:='${CFLAGS}'}
4357         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4358         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4359         : ${BUILD_LIBS:='${LIBS}'}
4360         : ${BUILD_EXEEXT:='$x'}
4361         : ${BUILD_OBJEXT:='o'}
4362 fi
4363
4364 ###############################################################################
4365
4366 ### Options to allow the user to specify the set of libraries which are used.
4367 ### Use "--without-normal --with-shared" to allow the default model to be
4368 ### shared, for example.
4369 cf_list_models=""
4370
4371 echo "$as_me:4371: checking if you want to build shared C-objects" >&5
4372 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4373
4374 # Check whether --with-shared or --without-shared was given.
4375 if test "${with_shared+set}" = set; then
4376   withval="$with_shared"
4377   with_shared=$withval
4378 else
4379   with_shared=no
4380 fi;
4381 echo "$as_me:4381: result: $with_shared" >&5
4382 echo "${ECHO_T}$with_shared" >&6
4383 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4384
4385 echo "$as_me:4385: checking for specified models" >&5
4386 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4387 test -z "$cf_list_models" && cf_list_models=normal
4388 echo "$as_me:4388: result: $cf_list_models" >&5
4389 echo "${ECHO_T}$cf_list_models" >&6
4390
4391 ### Use the first model as the default, and save its suffix for use in building
4392 ### up test-applications.
4393 echo "$as_me:4393: checking for default model" >&5
4394 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4395 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4396 echo "$as_me:4396: result: $DFT_LWR_MODEL" >&5
4397 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4398
4399 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4400
4401 echo "$as_me:4401: checking for specific curses-directory" >&5
4402 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4403
4404 # Check whether --with-curses-dir or --without-curses-dir was given.
4405 if test "${with_curses_dir+set}" = set; then
4406   withval="$with_curses_dir"
4407   cf_cv_curses_dir=$withval
4408 else
4409   cf_cv_curses_dir=no
4410 fi;
4411 echo "$as_me:4411: result: $cf_cv_curses_dir" >&5
4412 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4413
4414 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4415 then
4416
4417 if test "x$prefix" != xNONE; then
4418         cf_path_syntax="$prefix"
4419 else
4420         cf_path_syntax="$ac_default_prefix"
4421 fi
4422
4423 case ".$withval" in
4424 (.\$\(*\)*|.\'*\'*)
4425         ;;
4426 (..|./*|.\\*)
4427         ;;
4428 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4429         ;;
4430 (.\$\{*prefix\}*|.\$\{*dir\}*)
4431         eval withval="$withval"
4432         case ".$withval" in
4433         (.NONE/*)
4434                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4435                 ;;
4436         esac
4437         ;;
4438 (.no|.NONE/*)
4439         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4440         ;;
4441 (*)
4442         { { echo "$as_me:4442: error: expected a pathname, not \"$withval\"" >&5
4443 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4444    { (exit 1); exit 1; }; }
4445         ;;
4446 esac
4447
4448         if test -d "$cf_cv_curses_dir"
4449         then
4450
4451 if test -n "$cf_cv_curses_dir/include" ; then
4452   for cf_add_incdir in $cf_cv_curses_dir/include
4453   do
4454         while test "$cf_add_incdir" != /usr/include
4455         do
4456           if test -d "$cf_add_incdir"
4457           then
4458                 cf_have_incdir=no
4459                 if test -n "$CFLAGS$CPPFLAGS" ; then
4460                   # a loop is needed to ensure we can add subdirs of existing dirs
4461                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4462                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4463                           cf_have_incdir=yes; break
4464                         fi
4465                   done
4466                 fi
4467
4468                 if test "$cf_have_incdir" = no ; then
4469                   if test "$cf_add_incdir" = /usr/local/include ; then
4470                         if test "$GCC" = yes
4471                         then
4472                           cf_save_CPPFLAGS=$CPPFLAGS
4473
4474         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4475         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4476
4477                           cat >"conftest.$ac_ext" <<_ACEOF
4478 #line 4478 "configure"
4479 #include "confdefs.h"
4480 #include <stdio.h>
4481 int
4482 main (void)
4483 {
4484 printf("Hello")
4485   ;
4486   return 0;
4487 }
4488 _ACEOF
4489 rm -f "conftest.$ac_objext"
4490 if { (eval echo "$as_me:4490: \"$ac_compile\"") >&5
4491   (eval $ac_compile) 2>&5
4492   ac_status=$?
4493   echo "$as_me:4493: \$? = $ac_status" >&5
4494   (exit "$ac_status"); } &&
4495          { ac_try='test -s "conftest.$ac_objext"'
4496   { (eval echo "$as_me:4496: \"$ac_try\"") >&5
4497   (eval $ac_try) 2>&5
4498   ac_status=$?
4499   echo "$as_me:4499: \$? = $ac_status" >&5
4500   (exit "$ac_status"); }; }; then
4501   :
4502 else
4503   echo "$as_me: failed program was:" >&5
4504 cat "conftest.$ac_ext" >&5
4505 cf_have_incdir=yes
4506 fi
4507 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4508                           CPPFLAGS=$cf_save_CPPFLAGS
4509                         fi
4510                   fi
4511                 fi
4512
4513                 if test "$cf_have_incdir" = no ; then
4514                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4515
4516 echo "${as_me:-configure}:4516: testing adding $cf_add_incdir to include-path ..." 1>&5
4517
4518                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4519
4520                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4521                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4522                   cf_add_incdir="$cf_top_incdir"
4523                 else
4524                   break
4525                 fi
4526           else
4527                 break
4528           fi
4529         done
4530   done
4531 fi
4532
4533 if test -n "$cf_cv_curses_dir/lib" ; then
4534         for cf_add_libdir in $cf_cv_curses_dir/lib
4535         do
4536                 if test "$cf_add_libdir" = /usr/lib ; then
4537                         :
4538                 elif test -d "$cf_add_libdir"
4539                 then
4540                         cf_have_libdir=no
4541                         if test -n "$LDFLAGS$LIBS" ; then
4542                                 # a loop is needed to ensure we can add subdirs of existing dirs
4543                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4544                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4545                                                 cf_have_libdir=yes; break
4546                                         fi
4547                                 done
4548                         fi
4549                         if test "$cf_have_libdir" = no ; then
4550                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4551
4552 echo "${as_me:-configure}:4552: testing adding $cf_add_libdir to library-path ..." 1>&5
4553
4554                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4555                         fi
4556                 fi
4557         done
4558 fi
4559
4560         fi
4561 fi
4562
4563 cf_ncuconfig_root=ncurses
4564 cf_have_ncuconfig=no
4565
4566 if test "x${PKG_CONFIG:=none}" != xnone; then
4567         echo "$as_me:4567: checking pkg-config for $cf_ncuconfig_root" >&5
4568 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4569         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4570                 echo "$as_me:4570: result: yes" >&5
4571 echo "${ECHO_T}yes" >&6
4572
4573                 echo "$as_me:4573: checking if the $cf_ncuconfig_root package files work" >&5
4574 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4575                 cf_have_ncuconfig=unknown
4576
4577                 cf_save_CFLAGS="$CFLAGS"
4578                 cf_save_CPPFLAGS="$CPPFLAGS"
4579                 cf_save_LIBS="$LIBS"
4580
4581                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4582                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4583
4584                 # while -W for passing linker flags is prevalent, it is not "standard".
4585                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4586                 # incompatible _and_ non-standard -W option which gives an error.  Work
4587                 # around that pitfall.
4588                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4589                 (x*c[89]9@@*-W*)
4590
4591 cf_fix_cppflags=no
4592 cf_new_cflags=
4593 cf_new_cppflags=
4594 cf_new_extra_cppflags=
4595
4596 for cf_add_cflags in $cf_pkg_cflags
4597 do
4598 case "$cf_fix_cppflags" in
4599 (no)
4600         case "$cf_add_cflags" in
4601         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4602                 case "$cf_add_cflags" in
4603                 (-D*)
4604                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4605
4606                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4607                                 && test -z "${cf_tst_cflags}" \
4608                                 && cf_fix_cppflags=yes
4609
4610                         if test "$cf_fix_cppflags" = yes ; then
4611
4612         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4613         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4614
4615                                 continue
4616                         elif test "${cf_tst_cflags}" = "\"'" ; then
4617
4618         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4619         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4620
4621                                 continue
4622                         fi
4623                         ;;
4624                 esac
4625                 case "$CPPFLAGS" in
4626                 (*$cf_add_cflags)
4627                         ;;
4628                 (*)
4629                         case "$cf_add_cflags" in
4630                         (-D*)
4631                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4632
4633 CPPFLAGS=`echo "$CPPFLAGS" | \
4634         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4635                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4636
4637                                 ;;
4638                         esac
4639
4640         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4641         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4642
4643                         ;;
4644                 esac
4645                 ;;
4646         (*)
4647
4648         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4649         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4650
4651                 ;;
4652         esac
4653         ;;
4654 (yes)
4655
4656         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4657         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4658
4659         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4660
4661         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4662                 && test -z "${cf_tst_cflags}" \
4663                 && cf_fix_cppflags=no
4664         ;;
4665 esac
4666 done
4667
4668 if test -n "$cf_new_cflags" ; then
4669
4670         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4671         CFLAGS="${CFLAGS}$cf_new_cflags"
4672
4673 fi
4674
4675 if test -n "$cf_new_cppflags" ; then
4676
4677         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4678         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4679
4680 fi
4681
4682 if test -n "$cf_new_extra_cppflags" ; then
4683
4684         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4685         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4686
4687 fi
4688
4689 cf_add_libs="$LIBS"
4690 # reverse order
4691 cf_add_0lib=
4692 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4693 # filter duplicates
4694 for cf_add_1lib in $cf_add_0lib; do
4695         for cf_add_2lib in $cf_add_libs; do
4696                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4697                         cf_add_1lib=
4698                         break
4699                 fi
4700         done
4701         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4702 done
4703 LIBS="$cf_add_libs"
4704
4705                         cat >"conftest.$ac_ext" <<_ACEOF
4706 #line 4706 "configure"
4707 #include "confdefs.h"
4708 #include <${cf_cv_ncurses_header:-curses.h}>
4709 int
4710 main (void)
4711 {
4712 initscr(); mousemask(0,0); tigetstr((char *)0);
4713   ;
4714   return 0;
4715 }
4716 _ACEOF
4717 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4718 if { (eval echo "$as_me:4718: \"$ac_link\"") >&5
4719   (eval $ac_link) 2>&5
4720   ac_status=$?
4721   echo "$as_me:4721: \$? = $ac_status" >&5
4722   (exit "$ac_status"); } &&
4723          { ac_try='test -s "conftest$ac_exeext"'
4724   { (eval echo "$as_me:4724: \"$ac_try\"") >&5
4725   (eval $ac_try) 2>&5
4726   ac_status=$?
4727   echo "$as_me:4727: \$? = $ac_status" >&5
4728   (exit "$ac_status"); }; }; then
4729   if test "$cross_compiling" = yes; then
4730   cf_test_ncuconfig=maybe
4731 else
4732   cat >"conftest.$ac_ext" <<_ACEOF
4733 #line 4733 "configure"
4734 #include "confdefs.h"
4735 #include <${cf_cv_ncurses_header:-curses.h}>
4736                                         int main(void)
4737                                         { const char *xx = curses_version(); return (xx == 0); }
4738 _ACEOF
4739 rm -f "conftest$ac_exeext"
4740 if { (eval echo "$as_me:4740: \"$ac_link\"") >&5
4741   (eval $ac_link) 2>&5
4742   ac_status=$?
4743   echo "$as_me:4743: \$? = $ac_status" >&5
4744   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4745   { (eval echo "$as_me:4745: \"$ac_try\"") >&5
4746   (eval $ac_try) 2>&5
4747   ac_status=$?
4748   echo "$as_me:4748: \$? = $ac_status" >&5
4749   (exit "$ac_status"); }; }; then
4750   cf_test_ncuconfig=yes
4751 else
4752   echo "$as_me: program exited with status $ac_status" >&5
4753 echo "$as_me: failed program was:" >&5
4754 cat "conftest.$ac_ext" >&5
4755 cf_test_ncuconfig=no
4756 fi
4757 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4758 fi
4759 else
4760   echo "$as_me: failed program was:" >&5
4761 cat "conftest.$ac_ext" >&5
4762 cf_test_ncuconfig=no
4763 fi
4764 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4765
4766                         CFLAGS="$cf_save_CFLAGS"
4767                         CPPFLAGS="$cf_save_CPPFLAGS"
4768                         LIBS="$cf_save_LIBS"
4769
4770                         if test "x$cf_test_ncuconfig" != xyes; then
4771                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4772                                 cf_pkg_cflags="$cf_temp"
4773                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4774                                 cf_pkg_libs="$cf_temp"
4775                         fi
4776                         ;;
4777                 esac
4778
4779 for cf_add_cflags in $cf_pkg_cflags
4780 do
4781         case "x$cf_add_cflags" in
4782         (x-[DU]*)
4783
4784 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4785 while true
4786 do
4787         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4788         test "$CFLAGS" != "$cf_old_cflag" || break
4789
4790         CFLAGS="$cf_old_cflag"
4791 done
4792
4793 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4794 while true
4795 do
4796         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4797         test "$CPPFLAGS" != "$cf_old_cflag" || break
4798
4799         CPPFLAGS="$cf_old_cflag"
4800 done
4801
4802                 ;;
4803         esac
4804
4805 cf_fix_cppflags=no
4806 cf_new_cflags=
4807 cf_new_cppflags=
4808 cf_new_extra_cppflags=
4809
4810 for cf_add_cflags in $cf_add_cflags
4811 do
4812 case "$cf_fix_cppflags" in
4813 (no)
4814         case "$cf_add_cflags" in
4815         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4816                 case "$cf_add_cflags" in
4817                 (-D*)
4818                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4819
4820                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4821                                 && test -z "${cf_tst_cflags}" \
4822                                 && cf_fix_cppflags=yes
4823
4824                         if test "$cf_fix_cppflags" = yes ; then
4825
4826         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4827         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4828
4829                                 continue
4830                         elif test "${cf_tst_cflags}" = "\"'" ; then
4831
4832         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4833         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4834
4835                                 continue
4836                         fi
4837                         ;;
4838                 esac
4839                 case "$CPPFLAGS" in
4840                 (*$cf_add_cflags)
4841                         ;;
4842                 (*)
4843                         case "$cf_add_cflags" in
4844                         (-D*)
4845                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4846
4847 CPPFLAGS=`echo "$CPPFLAGS" | \
4848         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4849                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4850
4851                                 ;;
4852                         esac
4853
4854         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4855         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4856
4857                         ;;
4858                 esac
4859                 ;;
4860         (*)
4861
4862         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4863         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4864
4865                 ;;
4866         esac
4867         ;;
4868 (yes)
4869
4870         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4871         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4872
4873         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4874
4875         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4876                 && test -z "${cf_tst_cflags}" \
4877                 && cf_fix_cppflags=no
4878         ;;
4879 esac
4880 done
4881
4882 if test -n "$cf_new_cflags" ; then
4883
4884         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4885         CFLAGS="${CFLAGS}$cf_new_cflags"
4886
4887 fi
4888
4889 if test -n "$cf_new_cppflags" ; then
4890
4891         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4892         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4893
4894 fi
4895
4896 if test -n "$cf_new_extra_cppflags" ; then
4897
4898         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4899         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4900
4901 fi
4902
4903 done
4904
4905 cf_add_libs="$LIBS"
4906 # reverse order
4907 cf_add_0lib=
4908 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4909 # filter duplicates
4910 for cf_add_1lib in $cf_add_0lib; do
4911         for cf_add_2lib in $cf_add_libs; do
4912                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4913                         cf_add_1lib=
4914                         break
4915                 fi
4916         done
4917         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4918 done
4919 LIBS="$cf_add_libs"
4920
4921                 cat >"conftest.$ac_ext" <<_ACEOF
4922 #line 4922 "configure"
4923 #include "confdefs.h"
4924 #include <${cf_cv_ncurses_header:-curses.h}>
4925 int
4926 main (void)
4927 {
4928 initscr(); mousemask(0,0); tigetstr((char *)0);
4929   ;
4930   return 0;
4931 }
4932 _ACEOF
4933 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4934 if { (eval echo "$as_me:4934: \"$ac_link\"") >&5
4935   (eval $ac_link) 2>&5
4936   ac_status=$?
4937   echo "$as_me:4937: \$? = $ac_status" >&5
4938   (exit "$ac_status"); } &&
4939          { ac_try='test -s "conftest$ac_exeext"'
4940   { (eval echo "$as_me:4940: \"$ac_try\"") >&5
4941   (eval $ac_try) 2>&5
4942   ac_status=$?
4943   echo "$as_me:4943: \$? = $ac_status" >&5
4944   (exit "$ac_status"); }; }; then
4945   if test "$cross_compiling" = yes; then
4946   cf_have_ncuconfig=maybe
4947 else
4948   cat >"conftest.$ac_ext" <<_ACEOF
4949 #line 4949 "configure"
4950 #include "confdefs.h"
4951 #include <${cf_cv_ncurses_header:-curses.h}>
4952                                 int main(void)
4953                                 { const char *xx = curses_version(); return (xx == 0); }
4954 _ACEOF
4955 rm -f "conftest$ac_exeext"
4956 if { (eval echo "$as_me:4956: \"$ac_link\"") >&5
4957   (eval $ac_link) 2>&5
4958   ac_status=$?
4959   echo "$as_me:4959: \$? = $ac_status" >&5
4960   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4961   { (eval echo "$as_me:4961: \"$ac_try\"") >&5
4962   (eval $ac_try) 2>&5
4963   ac_status=$?
4964   echo "$as_me:4964: \$? = $ac_status" >&5
4965   (exit "$ac_status"); }; }; then
4966   cf_have_ncuconfig=yes
4967 else
4968   echo "$as_me: program exited with status $ac_status" >&5
4969 echo "$as_me: failed program was:" >&5
4970 cat "conftest.$ac_ext" >&5
4971 cf_have_ncuconfig=no
4972 fi
4973 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4974 fi
4975 else
4976   echo "$as_me: failed program was:" >&5
4977 cat "conftest.$ac_ext" >&5
4978 cf_have_ncuconfig=no
4979 fi
4980 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4981                 echo "$as_me:4981: result: $cf_have_ncuconfig" >&5
4982 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4983                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4984                 if test "$cf_have_ncuconfig" != "yes"
4985                 then
4986                         CPPFLAGS="$cf_save_CPPFLAGS"
4987                         LIBS="$cf_save_LIBS"
4988                         NCURSES_CONFIG_PKG=none
4989                 else
4990
4991 cat >>confdefs.h <<\EOF
4992 #define NCURSES 1
4993 EOF
4994
4995                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4996
4997 echo "$as_me:4997: checking for terminfo header" >&5
4998 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4999 if test "${cf_cv_term_header+set}" = set; then
5000   echo $ECHO_N "(cached) $ECHO_C" >&6
5001 else
5002
5003 case "${cf_cv_ncurses_header}" in
5004 (*/ncurses.h|*/ncursesw.h)
5005         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5006         ;;
5007 (*)
5008         cf_term_header=term.h
5009         ;;
5010 esac
5011
5012 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5013 do
5014 cat >"conftest.$ac_ext" <<_ACEOF
5015 #line 5015 "configure"
5016 #include "confdefs.h"
5017 #include <stdio.h>
5018 #include <${cf_cv_ncurses_header:-curses.h}>
5019 #include <$cf_test>
5020
5021 int
5022 main (void)
5023 {
5024 int x = auto_left_margin; (void)x
5025   ;
5026   return 0;
5027 }
5028 _ACEOF
5029 rm -f "conftest.$ac_objext"
5030 if { (eval echo "$as_me:5030: \"$ac_compile\"") >&5
5031   (eval $ac_compile) 2>&5
5032   ac_status=$?
5033   echo "$as_me:5033: \$? = $ac_status" >&5
5034   (exit "$ac_status"); } &&
5035          { ac_try='test -s "conftest.$ac_objext"'
5036   { (eval echo "$as_me:5036: \"$ac_try\"") >&5
5037   (eval $ac_try) 2>&5
5038   ac_status=$?
5039   echo "$as_me:5039: \$? = $ac_status" >&5
5040   (exit "$ac_status"); }; }; then
5041
5042         cf_cv_term_header="$cf_test"
5043 else
5044   echo "$as_me: failed program was:" >&5
5045 cat "conftest.$ac_ext" >&5
5046
5047         cf_cv_term_header=unknown
5048
5049 fi
5050 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5051         test "$cf_cv_term_header" != unknown && break
5052 done
5053
5054 fi
5055 echo "$as_me:5055: result: $cf_cv_term_header" >&5
5056 echo "${ECHO_T}$cf_cv_term_header" >&6
5057
5058 # Set definitions to allow ifdef'ing to accommodate subdirectories
5059
5060 case "$cf_cv_term_header" in
5061 (*term.h)
5062
5063 cat >>confdefs.h <<\EOF
5064 #define HAVE_TERM_H 1
5065 EOF
5066
5067         ;;
5068 esac
5069
5070 case "$cf_cv_term_header" in
5071 (ncurses/term.h)
5072
5073 cat >>confdefs.h <<\EOF
5074 #define HAVE_NCURSES_TERM_H 1
5075 EOF
5076
5077         ;;
5078 (ncursesw/term.h)
5079
5080 cat >>confdefs.h <<\EOF
5081 #define HAVE_NCURSESW_TERM_H 1
5082 EOF
5083
5084         ;;
5085 esac
5086
5087                 fi
5088
5089         else
5090                 echo "$as_me:5090: result: no" >&5
5091 echo "${ECHO_T}no" >&6
5092                 NCURSES_CONFIG_PKG=none
5093         fi
5094 else
5095         NCURSES_CONFIG_PKG=none
5096 fi
5097
5098 if test "x$cf_have_ncuconfig" = "xno"; then
5099         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5100
5101 if test -n "$ac_tool_prefix"; then
5102   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5103   do
5104     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5105 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5106 echo "$as_me:5106: checking for $ac_word" >&5
5107 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5108 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5109   echo $ECHO_N "(cached) $ECHO_C" >&6
5110 else
5111   if test -n "$NCURSES_CONFIG"; then
5112   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5113 else
5114   ac_save_IFS=$IFS; IFS=$ac_path_separator
5115 ac_dummy="$PATH"
5116 for ac_dir in $ac_dummy; do
5117   IFS=$ac_save_IFS
5118   test -z "$ac_dir" && ac_dir=.
5119   $as_executable_p "$ac_dir/$ac_word" || continue
5120 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5121 echo "$as_me:5121: found $ac_dir/$ac_word" >&5
5122 break
5123 done
5124
5125 fi
5126 fi
5127 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5128 if test -n "$NCURSES_CONFIG"; then
5129   echo "$as_me:5129: result: $NCURSES_CONFIG" >&5
5130 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5131 else
5132   echo "$as_me:5132: result: no" >&5
5133 echo "${ECHO_T}no" >&6
5134 fi
5135
5136     test -n "$NCURSES_CONFIG" && break
5137   done
5138 fi
5139 if test -z "$NCURSES_CONFIG"; then
5140   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5141   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5142 do
5143   # Extract the first word of "$ac_prog", so it can be a program name with args.
5144 set dummy $ac_prog; ac_word=$2
5145 echo "$as_me:5145: checking for $ac_word" >&5
5146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5147 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5148   echo $ECHO_N "(cached) $ECHO_C" >&6
5149 else
5150   if test -n "$ac_ct_NCURSES_CONFIG"; then
5151   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5152 else
5153   ac_save_IFS=$IFS; IFS=$ac_path_separator
5154 ac_dummy="$PATH"
5155 for ac_dir in $ac_dummy; do
5156   IFS=$ac_save_IFS
5157   test -z "$ac_dir" && ac_dir=.
5158   $as_executable_p "$ac_dir/$ac_word" || continue
5159 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5160 echo "$as_me:5160: found $ac_dir/$ac_word" >&5
5161 break
5162 done
5163
5164 fi
5165 fi
5166 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5167 if test -n "$ac_ct_NCURSES_CONFIG"; then
5168   echo "$as_me:5168: result: $ac_ct_NCURSES_CONFIG" >&5
5169 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5170 else
5171   echo "$as_me:5171: result: no" >&5
5172 echo "${ECHO_T}no" >&6
5173 fi
5174
5175   test -n "$ac_ct_NCURSES_CONFIG" && break
5176 done
5177 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5178
5179   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5180 fi
5181
5182         if test "$NCURSES_CONFIG" != none ; then
5183
5184 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5185 do
5186         case "x$cf_add_cflags" in
5187         (x-[DU]*)
5188
5189 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5190 while true
5191 do
5192         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5193         test "$CFLAGS" != "$cf_old_cflag" || break
5194
5195         CFLAGS="$cf_old_cflag"
5196 done
5197
5198 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5199 while true
5200 do
5201         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5202         test "$CPPFLAGS" != "$cf_old_cflag" || break
5203
5204         CPPFLAGS="$cf_old_cflag"
5205 done
5206
5207                 ;;
5208         esac
5209
5210 cf_fix_cppflags=no
5211 cf_new_cflags=
5212 cf_new_cppflags=
5213 cf_new_extra_cppflags=
5214
5215 for cf_add_cflags in $cf_add_cflags
5216 do
5217 case "$cf_fix_cppflags" in
5218 (no)
5219         case "$cf_add_cflags" in
5220         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5221                 case "$cf_add_cflags" in
5222                 (-D*)
5223                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5224
5225                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5226                                 && test -z "${cf_tst_cflags}" \
5227                                 && cf_fix_cppflags=yes
5228
5229                         if test "$cf_fix_cppflags" = yes ; then
5230
5231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5233
5234                                 continue
5235                         elif test "${cf_tst_cflags}" = "\"'" ; then
5236
5237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5239
5240                                 continue
5241                         fi
5242                         ;;
5243                 esac
5244                 case "$CPPFLAGS" in
5245                 (*$cf_add_cflags)
5246                         ;;
5247                 (*)
5248                         case "$cf_add_cflags" in
5249                         (-D*)
5250                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5251
5252 CPPFLAGS=`echo "$CPPFLAGS" | \
5253         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5254                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5255
5256                                 ;;
5257                         esac
5258
5259         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5260         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5261
5262                         ;;
5263                 esac
5264                 ;;
5265         (*)
5266
5267         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5268         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5269
5270                 ;;
5271         esac
5272         ;;
5273 (yes)
5274
5275         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5276         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5277
5278         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5279
5280         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5281                 && test -z "${cf_tst_cflags}" \
5282                 && cf_fix_cppflags=no
5283         ;;
5284 esac
5285 done
5286
5287 if test -n "$cf_new_cflags" ; then
5288
5289         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5290         CFLAGS="${CFLAGS}$cf_new_cflags"
5291
5292 fi
5293
5294 if test -n "$cf_new_cppflags" ; then
5295
5296         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5297         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5298
5299 fi
5300
5301 if test -n "$cf_new_extra_cppflags" ; then
5302
5303         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5304         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5305
5306 fi
5307
5308 done
5309
5310 cf_add_libs="$LIBS"
5311 # reverse order
5312 cf_add_0lib=
5313 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5314 # filter duplicates
5315 for cf_add_1lib in $cf_add_0lib; do
5316         for cf_add_2lib in $cf_add_libs; do
5317                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5318                         cf_add_1lib=
5319                         break
5320                 fi
5321         done
5322         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5323 done
5324 LIBS="$cf_add_libs"
5325
5326                 # even with config script, some packages use no-override for curses.h
5327
5328 echo "$as_me:5328: checking if we have identified curses headers" >&5
5329 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5330 if test "${cf_cv_ncurses_header+set}" = set; then
5331   echo $ECHO_N "(cached) $ECHO_C" >&6
5332 else
5333
5334 cf_cv_ncurses_header=none
5335 for cf_header in \
5336         ncurses.h ncurses/ncurses.h \
5337         curses.h ncurses/curses.h
5338 do
5339 cat >"conftest.$ac_ext" <<_ACEOF
5340 #line 5340 "configure"
5341 #include "confdefs.h"
5342 #include <${cf_header}>
5343 int
5344 main (void)
5345 {
5346 initscr(); endwin()
5347   ;
5348   return 0;
5349 }
5350 _ACEOF
5351 rm -f "conftest.$ac_objext"
5352 if { (eval echo "$as_me:5352: \"$ac_compile\"") >&5
5353   (eval $ac_compile) 2>&5
5354   ac_status=$?
5355   echo "$as_me:5355: \$? = $ac_status" >&5
5356   (exit "$ac_status"); } &&
5357          { ac_try='test -s "conftest.$ac_objext"'
5358   { (eval echo "$as_me:5358: \"$ac_try\"") >&5
5359   (eval $ac_try) 2>&5
5360   ac_status=$?
5361   echo "$as_me:5361: \$? = $ac_status" >&5
5362   (exit "$ac_status"); }; }; then
5363   cf_cv_ncurses_header=$cf_header; break
5364 else
5365   echo "$as_me: failed program was:" >&5
5366 cat "conftest.$ac_ext" >&5
5367 fi
5368 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5369 done
5370
5371 fi
5372 echo "$as_me:5372: result: $cf_cv_ncurses_header" >&5
5373 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5374
5375 if test "$cf_cv_ncurses_header" = none ; then
5376         { { echo "$as_me:5376: error: No curses header-files found" >&5
5377 echo "$as_me: error: No curses header-files found" >&2;}
5378    { (exit 1); exit 1; }; }
5379 fi
5380
5381 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5382
5383 for ac_header in $cf_cv_ncurses_header
5384 do
5385 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5386 echo "$as_me:5386: checking for $ac_header" >&5
5387 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5388 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5389   echo $ECHO_N "(cached) $ECHO_C" >&6
5390 else
5391   cat >"conftest.$ac_ext" <<_ACEOF
5392 #line 5392 "configure"
5393 #include "confdefs.h"
5394 #include <$ac_header>
5395 _ACEOF
5396 if { (eval echo "$as_me:5396: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5397   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5398   ac_status=$?
5399   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5400   rm -f conftest.er1
5401   cat conftest.err >&5
5402   echo "$as_me:5402: \$? = $ac_status" >&5
5403   (exit "$ac_status"); } >/dev/null; then
5404   if test -s conftest.err; then
5405     ac_cpp_err=$ac_c_preproc_warn_flag
5406   else
5407     ac_cpp_err=
5408   fi
5409 else
5410   ac_cpp_err=yes
5411 fi
5412 if test -z "$ac_cpp_err"; then
5413   eval "$as_ac_Header=yes"
5414 else
5415   echo "$as_me: failed program was:" >&5
5416   cat "conftest.$ac_ext" >&5
5417   eval "$as_ac_Header=no"
5418 fi
5419 rm -f conftest.err "conftest.$ac_ext"
5420 fi
5421 echo "$as_me:5421: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5422 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5423 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5424   cat >>confdefs.h <<EOF
5425 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5426 EOF
5427
5428 fi
5429 done
5430
5431 cat >>confdefs.h <<\EOF
5432 #define NCURSES 1
5433 EOF
5434
5435 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5436
5437                 cat >>confdefs.h <<EOF
5438 #define $cf_nculib_ROOT 1
5439 EOF
5440
5441                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5442
5443         else
5444
5445 cf_ncuhdr_root=ncurses
5446
5447 test -n "$cf_cv_curses_dir" && \
5448 test "$cf_cv_curses_dir" != "no" && { \
5449
5450 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5451   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5452   do
5453         while test "$cf_add_incdir" != /usr/include
5454         do
5455           if test -d "$cf_add_incdir"
5456           then
5457                 cf_have_incdir=no
5458                 if test -n "$CFLAGS$CPPFLAGS" ; then
5459                   # a loop is needed to ensure we can add subdirs of existing dirs
5460                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5461                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5462                           cf_have_incdir=yes; break
5463                         fi
5464                   done
5465                 fi
5466
5467                 if test "$cf_have_incdir" = no ; then
5468                   if test "$cf_add_incdir" = /usr/local/include ; then
5469                         if test "$GCC" = yes
5470                         then
5471                           cf_save_CPPFLAGS=$CPPFLAGS
5472
5473         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5474         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5475
5476                           cat >"conftest.$ac_ext" <<_ACEOF
5477 #line 5477 "configure"
5478 #include "confdefs.h"
5479 #include <stdio.h>
5480 int
5481 main (void)
5482 {
5483 printf("Hello")
5484   ;
5485   return 0;
5486 }
5487 _ACEOF
5488 rm -f "conftest.$ac_objext"
5489 if { (eval echo "$as_me:5489: \"$ac_compile\"") >&5
5490   (eval $ac_compile) 2>&5
5491   ac_status=$?
5492   echo "$as_me:5492: \$? = $ac_status" >&5
5493   (exit "$ac_status"); } &&
5494          { ac_try='test -s "conftest.$ac_objext"'
5495   { (eval echo "$as_me:5495: \"$ac_try\"") >&5
5496   (eval $ac_try) 2>&5
5497   ac_status=$?
5498   echo "$as_me:5498: \$? = $ac_status" >&5
5499   (exit "$ac_status"); }; }; then
5500   :
5501 else
5502   echo "$as_me: failed program was:" >&5
5503 cat "conftest.$ac_ext" >&5
5504 cf_have_incdir=yes
5505 fi
5506 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5507                           CPPFLAGS=$cf_save_CPPFLAGS
5508                         fi
5509                   fi
5510                 fi
5511
5512                 if test "$cf_have_incdir" = no ; then
5513                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5514
5515 echo "${as_me:-configure}:5515: testing adding $cf_add_incdir to include-path ..." 1>&5
5516
5517                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5518
5519                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5520                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5521                   cf_add_incdir="$cf_top_incdir"
5522                 else
5523                   break
5524                 fi
5525           else
5526                 break
5527           fi
5528         done
5529   done
5530 fi
5531
5532 }
5533
5534 echo "$as_me:5534: checking for $cf_ncuhdr_root header in include-path" >&5
5535 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5536 if test "${cf_cv_ncurses_h+set}" = set; then
5537   echo $ECHO_N "(cached) $ECHO_C" >&6
5538 else
5539
5540         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5541         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5542         for cf_header in $cf_header_list
5543         do
5544
5545         cat >"conftest.$ac_ext" <<_ACEOF
5546 #line 5546 "configure"
5547 #include "confdefs.h"
5548
5549 #include <$cf_header>
5550 int
5551 main (void)
5552 {
5553
5554 #ifdef NCURSES_VERSION
5555
5556 printf("%s\\n", NCURSES_VERSION);
5557 #else
5558 #ifdef __NCURSES_H
5559 printf("old\\n");
5560 #else
5561         make an error
5562 #endif
5563 #endif
5564
5565   ;
5566   return 0;
5567 }
5568 _ACEOF
5569 rm -f "conftest.$ac_objext"
5570 if { (eval echo "$as_me:5570: \"$ac_compile\"") >&5
5571   (eval $ac_compile) 2>&5
5572   ac_status=$?
5573   echo "$as_me:5573: \$? = $ac_status" >&5
5574   (exit "$ac_status"); } &&
5575          { ac_try='test -s "conftest.$ac_objext"'
5576   { (eval echo "$as_me:5576: \"$ac_try\"") >&5
5577   (eval $ac_try) 2>&5
5578   ac_status=$?
5579   echo "$as_me:5579: \$? = $ac_status" >&5
5580   (exit "$ac_status"); }; }; then
5581   cf_cv_ncurses_h=$cf_header
5582
5583 else
5584   echo "$as_me: failed program was:" >&5
5585 cat "conftest.$ac_ext" >&5
5586 cf_cv_ncurses_h=no
5587 fi
5588 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5589
5590                 test "$cf_cv_ncurses_h" != no && break
5591         done
5592
5593 fi
5594 echo "$as_me:5594: result: $cf_cv_ncurses_h" >&5
5595 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5596
5597 if test "$cf_cv_ncurses_h" != no ; then
5598         cf_cv_ncurses_header=$cf_cv_ncurses_h
5599 else
5600
5601 echo "$as_me:5601: checking for $cf_ncuhdr_root include-path" >&5
5602 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5603 if test "${cf_cv_ncurses_h2+set}" = set; then
5604   echo $ECHO_N "(cached) $ECHO_C" >&6
5605 else
5606
5607         test -n "$verbose" && echo
5608
5609 cf_search=
5610
5611 # collect the current set of include-directories from compiler flags
5612 cf_header_path_list=""
5613 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5614         for cf_header_path in $CPPFLAGS $CFLAGS
5615         do
5616                 case "$cf_header_path" in
5617                 (-I*)
5618                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5619
5620 test "x$cf_header_path" != "xNONE" && \
5621 test -d "$cf_header_path" && \
5622  {
5623         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5624         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5625         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5626         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5627         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5628         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"
5629 }
5630
5631                         cf_header_path_list="$cf_header_path_list $cf_search"
5632                         ;;
5633                 esac
5634         done
5635 fi
5636
5637 # add the variations for the package we are looking for
5638
5639 cf_search=
5640
5641 test "x$prefix" != "xNONE" && \
5642 test -d "$prefix" && \
5643  {
5644         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5645         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5646         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5647         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5648         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5649         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5650 }
5651
5652 for cf_subdir_prefix in \
5653         /usr \
5654         /usr/local \
5655         /usr/pkg \
5656         /opt \
5657         /opt/local \
5658         $HOME
5659 do
5660
5661 test "x$cf_subdir_prefix" != "x$prefix" && \
5662 test -d "$cf_subdir_prefix" && \
5663 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5664         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5665         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5666         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5667         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5668         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5669         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"
5670 }
5671
5672 done
5673
5674 test "$includedir" != NONE && \
5675 test "$includedir" != "/usr/include" && \
5676 test -d "$includedir" && {
5677         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5678         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5679 }
5680
5681 test "$oldincludedir" != NONE && \
5682 test "$oldincludedir" != "/usr/include" && \
5683 test -d "$oldincludedir" && {
5684         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5685         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5686 }
5687
5688 cf_search="$cf_search $cf_header_path_list"
5689
5690         test -n "$verbose" && echo "search path $cf_search"
5691         cf_save2_CPPFLAGS="$CPPFLAGS"
5692         for cf_incdir in $cf_search
5693         do
5694
5695 if test -n "$cf_incdir" ; then
5696   for cf_add_incdir in $cf_incdir
5697   do
5698         while test "$cf_add_incdir" != /usr/include
5699         do
5700           if test -d "$cf_add_incdir"
5701           then
5702                 cf_have_incdir=no
5703                 if test -n "$CFLAGS$CPPFLAGS" ; then
5704                   # a loop is needed to ensure we can add subdirs of existing dirs
5705                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5706                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5707                           cf_have_incdir=yes; break
5708                         fi
5709                   done
5710                 fi
5711
5712                 if test "$cf_have_incdir" = no ; then
5713                   if test "$cf_add_incdir" = /usr/local/include ; then
5714                         if test "$GCC" = yes
5715                         then
5716                           cf_save_CPPFLAGS=$CPPFLAGS
5717
5718         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5719         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5720
5721                           cat >"conftest.$ac_ext" <<_ACEOF
5722 #line 5722 "configure"
5723 #include "confdefs.h"
5724 #include <stdio.h>
5725 int
5726 main (void)
5727 {
5728 printf("Hello")
5729   ;
5730   return 0;
5731 }
5732 _ACEOF
5733 rm -f "conftest.$ac_objext"
5734 if { (eval echo "$as_me:5734: \"$ac_compile\"") >&5
5735   (eval $ac_compile) 2>&5
5736   ac_status=$?
5737   echo "$as_me:5737: \$? = $ac_status" >&5
5738   (exit "$ac_status"); } &&
5739          { ac_try='test -s "conftest.$ac_objext"'
5740   { (eval echo "$as_me:5740: \"$ac_try\"") >&5
5741   (eval $ac_try) 2>&5
5742   ac_status=$?
5743   echo "$as_me:5743: \$? = $ac_status" >&5
5744   (exit "$ac_status"); }; }; then
5745   :
5746 else
5747   echo "$as_me: failed program was:" >&5
5748 cat "conftest.$ac_ext" >&5
5749 cf_have_incdir=yes
5750 fi
5751 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5752                           CPPFLAGS=$cf_save_CPPFLAGS
5753                         fi
5754                   fi
5755                 fi
5756
5757                 if test "$cf_have_incdir" = no ; then
5758                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5759
5760 echo "${as_me:-configure}:5760: testing adding $cf_add_incdir to include-path ..." 1>&5
5761
5762                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5763
5764                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5765                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5766                   cf_add_incdir="$cf_top_incdir"
5767                 else
5768                   break
5769                 fi
5770           else
5771                 break
5772           fi
5773         done
5774   done
5775 fi
5776
5777                 for cf_header in \
5778                         ncurses.h \
5779                         curses.h
5780                 do
5781
5782         cat >"conftest.$ac_ext" <<_ACEOF
5783 #line 5783 "configure"
5784 #include "confdefs.h"
5785
5786 #include <$cf_header>
5787 int
5788 main (void)
5789 {
5790
5791 #ifdef NCURSES_VERSION
5792
5793 printf("%s\\n", NCURSES_VERSION);
5794 #else
5795 #ifdef __NCURSES_H
5796 printf("old\\n");
5797 #else
5798         make an error
5799 #endif
5800 #endif
5801
5802   ;
5803   return 0;
5804 }
5805 _ACEOF
5806 rm -f "conftest.$ac_objext"
5807 if { (eval echo "$as_me:5807: \"$ac_compile\"") >&5
5808   (eval $ac_compile) 2>&5
5809   ac_status=$?
5810   echo "$as_me:5810: \$? = $ac_status" >&5
5811   (exit "$ac_status"); } &&
5812          { ac_try='test -s "conftest.$ac_objext"'
5813   { (eval echo "$as_me:5813: \"$ac_try\"") >&5
5814   (eval $ac_try) 2>&5
5815   ac_status=$?
5816   echo "$as_me:5816: \$? = $ac_status" >&5
5817   (exit "$ac_status"); }; }; then
5818   cf_cv_ncurses_h2=$cf_header
5819
5820 else
5821   echo "$as_me: failed program was:" >&5
5822 cat "conftest.$ac_ext" >&5
5823 cf_cv_ncurses_h2=no
5824 fi
5825 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5826
5827                         if test "$cf_cv_ncurses_h2" != no ; then
5828                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5829                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5830                                 break
5831                         fi
5832                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5833                 done
5834                 CPPFLAGS="$cf_save2_CPPFLAGS"
5835                 test "$cf_cv_ncurses_h2" != no && break
5836         done
5837         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5837: error: not found" >&5
5838 echo "$as_me: error: not found" >&2;}
5839    { (exit 1); exit 1; }; }
5840
5841 fi
5842 echo "$as_me:5842: result: $cf_cv_ncurses_h2" >&5
5843 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5844
5845         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5846         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5847         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5848                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5849         fi
5850
5851 if test -n "$cf_1st_incdir" ; then
5852   for cf_add_incdir in $cf_1st_incdir
5853   do
5854         while test "$cf_add_incdir" != /usr/include
5855         do
5856           if test -d "$cf_add_incdir"
5857           then
5858                 cf_have_incdir=no
5859                 if test -n "$CFLAGS$CPPFLAGS" ; then
5860                   # a loop is needed to ensure we can add subdirs of existing dirs
5861                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5862                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5863                           cf_have_incdir=yes; break
5864                         fi
5865                   done
5866                 fi
5867
5868                 if test "$cf_have_incdir" = no ; then
5869                   if test "$cf_add_incdir" = /usr/local/include ; then
5870                         if test "$GCC" = yes
5871                         then
5872                           cf_save_CPPFLAGS=$CPPFLAGS
5873
5874         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5875         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5876
5877                           cat >"conftest.$ac_ext" <<_ACEOF
5878 #line 5878 "configure"
5879 #include "confdefs.h"
5880 #include <stdio.h>
5881 int
5882 main (void)
5883 {
5884 printf("Hello")
5885   ;
5886   return 0;
5887 }
5888 _ACEOF
5889 rm -f "conftest.$ac_objext"
5890 if { (eval echo "$as_me:5890: \"$ac_compile\"") >&5
5891   (eval $ac_compile) 2>&5
5892   ac_status=$?
5893   echo "$as_me:5893: \$? = $ac_status" >&5
5894   (exit "$ac_status"); } &&
5895          { ac_try='test -s "conftest.$ac_objext"'
5896   { (eval echo "$as_me:5896: \"$ac_try\"") >&5
5897   (eval $ac_try) 2>&5
5898   ac_status=$?
5899   echo "$as_me:5899: \$? = $ac_status" >&5
5900   (exit "$ac_status"); }; }; then
5901   :
5902 else
5903   echo "$as_me: failed program was:" >&5
5904 cat "conftest.$ac_ext" >&5
5905 cf_have_incdir=yes
5906 fi
5907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5908                           CPPFLAGS=$cf_save_CPPFLAGS
5909                         fi
5910                   fi
5911                 fi
5912
5913                 if test "$cf_have_incdir" = no ; then
5914                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5915
5916 echo "${as_me:-configure}:5916: testing adding $cf_add_incdir to include-path ..." 1>&5
5917
5918                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5919
5920                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5921                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5922                   cf_add_incdir="$cf_top_incdir"
5923                 else
5924                   break
5925                 fi
5926           else
5927                 break
5928           fi
5929         done
5930   done
5931 fi
5932
5933 fi
5934
5935 # Set definitions to allow ifdef'ing for ncurses.h
5936
5937 case "$cf_cv_ncurses_header" in
5938 (*ncurses.h)
5939
5940 cat >>confdefs.h <<\EOF
5941 #define HAVE_NCURSES_H 1
5942 EOF
5943
5944         ;;
5945 esac
5946
5947 case "$cf_cv_ncurses_header" in
5948 (ncurses/curses.h|ncurses/ncurses.h)
5949
5950 cat >>confdefs.h <<\EOF
5951 #define HAVE_NCURSES_NCURSES_H 1
5952 EOF
5953
5954         ;;
5955 (ncursesw/curses.h|ncursesw/ncurses.h)
5956
5957 cat >>confdefs.h <<\EOF
5958 #define HAVE_NCURSESW_NCURSES_H 1
5959 EOF
5960
5961         ;;
5962 esac
5963
5964 echo "$as_me:5964: checking for terminfo header" >&5
5965 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5966 if test "${cf_cv_term_header+set}" = set; then
5967   echo $ECHO_N "(cached) $ECHO_C" >&6
5968 else
5969
5970 case "${cf_cv_ncurses_header}" in
5971 (*/ncurses.h|*/ncursesw.h)
5972         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5973         ;;
5974 (*)
5975         cf_term_header=term.h
5976         ;;
5977 esac
5978
5979 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5980 do
5981 cat >"conftest.$ac_ext" <<_ACEOF
5982 #line 5982 "configure"
5983 #include "confdefs.h"
5984 #include <stdio.h>
5985 #include <${cf_cv_ncurses_header:-curses.h}>
5986 #include <$cf_test>
5987
5988 int
5989 main (void)
5990 {
5991 int x = auto_left_margin; (void)x
5992   ;
5993   return 0;
5994 }
5995 _ACEOF
5996 rm -f "conftest.$ac_objext"
5997 if { (eval echo "$as_me:5997: \"$ac_compile\"") >&5
5998   (eval $ac_compile) 2>&5
5999   ac_status=$?
6000   echo "$as_me:6000: \$? = $ac_status" >&5
6001   (exit "$ac_status"); } &&
6002          { ac_try='test -s "conftest.$ac_objext"'
6003   { (eval echo "$as_me:6003: \"$ac_try\"") >&5
6004   (eval $ac_try) 2>&5
6005   ac_status=$?
6006   echo "$as_me:6006: \$? = $ac_status" >&5
6007   (exit "$ac_status"); }; }; then
6008
6009         cf_cv_term_header="$cf_test"
6010 else
6011   echo "$as_me: failed program was:" >&5
6012 cat "conftest.$ac_ext" >&5
6013
6014         cf_cv_term_header=unknown
6015
6016 fi
6017 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6018         test "$cf_cv_term_header" != unknown && break
6019 done
6020
6021 fi
6022 echo "$as_me:6022: result: $cf_cv_term_header" >&5
6023 echo "${ECHO_T}$cf_cv_term_header" >&6
6024
6025 # Set definitions to allow ifdef'ing to accommodate subdirectories
6026
6027 case "$cf_cv_term_header" in
6028 (*term.h)
6029
6030 cat >>confdefs.h <<\EOF
6031 #define HAVE_TERM_H 1
6032 EOF
6033
6034         ;;
6035 esac
6036
6037 case "$cf_cv_term_header" in
6038 (ncurses/term.h)
6039
6040 cat >>confdefs.h <<\EOF
6041 #define HAVE_NCURSES_TERM_H 1
6042 EOF
6043
6044         ;;
6045 (ncursesw/term.h)
6046
6047 cat >>confdefs.h <<\EOF
6048 #define HAVE_NCURSESW_TERM_H 1
6049 EOF
6050
6051         ;;
6052 esac
6053
6054 # some applications need this, but should check for NCURSES_VERSION
6055
6056 cat >>confdefs.h <<\EOF
6057 #define NCURSES 1
6058 EOF
6059
6060 echo "$as_me:6060: checking for ncurses version" >&5
6061 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6062 if test "${cf_cv_ncurses_version+set}" = set; then
6063   echo $ECHO_N "(cached) $ECHO_C" >&6
6064 else
6065
6066         cf_cv_ncurses_version=no
6067         cf_tempfile=out$$
6068         rm -f "$cf_tempfile"
6069         if test "$cross_compiling" = yes; then
6070
6071         # This will not work if the preprocessor splits the line after the
6072         # Autoconf token.  The 'unproto' program does that.
6073         cat > "conftest.$ac_ext" <<EOF
6074 #include <${cf_cv_ncurses_header:-curses.h}>
6075 #undef Autoconf
6076 #ifdef NCURSES_VERSION
6077 Autoconf NCURSES_VERSION
6078 #else
6079 #ifdef __NCURSES_H
6080 Autoconf "old"
6081 #endif
6082 ;
6083 #endif
6084 EOF
6085         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6086         { (eval echo "$as_me:6086: \"$cf_try\"") >&5
6087   (eval $cf_try) 2>&5
6088   ac_status=$?
6089   echo "$as_me:6089: \$? = $ac_status" >&5
6090   (exit "$ac_status"); }
6091         if test -f conftest.out ; then
6092                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6093                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6094                 rm -f conftest.out
6095         fi
6096
6097 else
6098   cat >"conftest.$ac_ext" <<_ACEOF
6099 #line 6099 "configure"
6100 #include "confdefs.h"
6101
6102 $ac_includes_default
6103
6104 #include <${cf_cv_ncurses_header:-curses.h}>
6105
6106 int main(void)
6107 {
6108         FILE *fp = fopen("$cf_tempfile", "w");
6109 #ifdef NCURSES_VERSION
6110 # ifdef NCURSES_VERSION_PATCH
6111         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6112 # else
6113         fprintf(fp, "%s\\n", NCURSES_VERSION);
6114 # endif
6115 #else
6116 # ifdef __NCURSES_H
6117         fprintf(fp, "old\\n");
6118 # else
6119         make an error
6120 # endif
6121 #endif
6122         ${cf_cv_main_return:-return}(0);
6123 }
6124 _ACEOF
6125 rm -f "conftest$ac_exeext"
6126 if { (eval echo "$as_me:6126: \"$ac_link\"") >&5
6127   (eval $ac_link) 2>&5
6128   ac_status=$?
6129   echo "$as_me:6129: \$? = $ac_status" >&5
6130   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6131   { (eval echo "$as_me:6131: \"$ac_try\"") >&5
6132   (eval $ac_try) 2>&5
6133   ac_status=$?
6134   echo "$as_me:6134: \$? = $ac_status" >&5
6135   (exit "$ac_status"); }; }; then
6136
6137         cf_cv_ncurses_version=`cat $cf_tempfile`
6138 else
6139   echo "$as_me: program exited with status $ac_status" >&5
6140 echo "$as_me: failed program was:" >&5
6141 cat "conftest.$ac_ext" >&5
6142 fi
6143 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6144 fi
6145         rm -f "$cf_tempfile"
6146
6147 fi
6148 echo "$as_me:6148: result: $cf_cv_ncurses_version" >&5
6149 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6150 test "$cf_cv_ncurses_version" = no ||
6151 cat >>confdefs.h <<\EOF
6152 #define NCURSES 1
6153 EOF
6154
6155 cf_nculib_root=ncurses
6156         # This works, except for the special case where we find gpm, but
6157         # ncurses is in a nonstandard location via $LIBS, and we really want
6158         # to link gpm.
6159 cf_ncurses_LIBS=""
6160 cf_ncurses_SAVE="$LIBS"
6161 echo "$as_me:6161: checking for Gpm_Open in -lgpm" >&5
6162 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6163 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6164   echo $ECHO_N "(cached) $ECHO_C" >&6
6165 else
6166   ac_check_lib_save_LIBS=$LIBS
6167 LIBS="-lgpm  $LIBS"
6168 cat >"conftest.$ac_ext" <<_ACEOF
6169 #line 6169 "configure"
6170 #include "confdefs.h"
6171
6172 /* Override any gcc2 internal prototype to avoid an error.  */
6173 #ifdef __cplusplus
6174 extern "C"
6175 #endif
6176 /* We use char because int might match the return type of a gcc2
6177    builtin and then its argument prototype would still apply.  */
6178 char Gpm_Open ();
6179 int
6180 main (void)
6181 {
6182 Gpm_Open ();
6183   ;
6184   return 0;
6185 }
6186 _ACEOF
6187 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6188 if { (eval echo "$as_me:6188: \"$ac_link\"") >&5
6189   (eval $ac_link) 2>&5
6190   ac_status=$?
6191   echo "$as_me:6191: \$? = $ac_status" >&5
6192   (exit "$ac_status"); } &&
6193          { ac_try='test -s "conftest$ac_exeext"'
6194   { (eval echo "$as_me:6194: \"$ac_try\"") >&5
6195   (eval $ac_try) 2>&5
6196   ac_status=$?
6197   echo "$as_me:6197: \$? = $ac_status" >&5
6198   (exit "$ac_status"); }; }; then
6199   ac_cv_lib_gpm_Gpm_Open=yes
6200 else
6201   echo "$as_me: failed program was:" >&5
6202 cat "conftest.$ac_ext" >&5
6203 ac_cv_lib_gpm_Gpm_Open=no
6204 fi
6205 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6206 LIBS=$ac_check_lib_save_LIBS
6207 fi
6208 echo "$as_me:6208: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6209 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6210 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6211   echo "$as_me:6211: checking for initscr in -lgpm" >&5
6212 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6213 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6214   echo $ECHO_N "(cached) $ECHO_C" >&6
6215 else
6216   ac_check_lib_save_LIBS=$LIBS
6217 LIBS="-lgpm  $LIBS"
6218 cat >"conftest.$ac_ext" <<_ACEOF
6219 #line 6219 "configure"
6220 #include "confdefs.h"
6221
6222 /* Override any gcc2 internal prototype to avoid an error.  */
6223 #ifdef __cplusplus
6224 extern "C"
6225 #endif
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 ();
6229 int
6230 main (void)
6231 {
6232 initscr ();
6233   ;
6234   return 0;
6235 }
6236 _ACEOF
6237 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6238 if { (eval echo "$as_me:6238: \"$ac_link\"") >&5
6239   (eval $ac_link) 2>&5
6240   ac_status=$?
6241   echo "$as_me:6241: \$? = $ac_status" >&5
6242   (exit "$ac_status"); } &&
6243          { ac_try='test -s "conftest$ac_exeext"'
6244   { (eval echo "$as_me:6244: \"$ac_try\"") >&5
6245   (eval $ac_try) 2>&5
6246   ac_status=$?
6247   echo "$as_me:6247: \$? = $ac_status" >&5
6248   (exit "$ac_status"); }; }; then
6249   ac_cv_lib_gpm_initscr=yes
6250 else
6251   echo "$as_me: failed program was:" >&5
6252 cat "conftest.$ac_ext" >&5
6253 ac_cv_lib_gpm_initscr=no
6254 fi
6255 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6256 LIBS=$ac_check_lib_save_LIBS
6257 fi
6258 echo "$as_me:6258: result: $ac_cv_lib_gpm_initscr" >&5
6259 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6260 if test "$ac_cv_lib_gpm_initscr" = yes; then
6261   LIBS="$cf_ncurses_SAVE"
6262 else
6263   cf_ncurses_LIBS="-lgpm"
6264 fi
6265
6266 fi
6267
6268 case "$host_os" in
6269 (freebsd*)
6270         # This is only necessary if you are linking against an obsolete
6271         # version of ncurses (but it should do no harm, since it is static).
6272         if test "$cf_nculib_root" = ncurses ; then
6273                 echo "$as_me:6273: checking for tgoto in -lmytinfo" >&5
6274 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6275 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6276   echo $ECHO_N "(cached) $ECHO_C" >&6
6277 else
6278   ac_check_lib_save_LIBS=$LIBS
6279 LIBS="-lmytinfo  $LIBS"
6280 cat >"conftest.$ac_ext" <<_ACEOF
6281 #line 6281 "configure"
6282 #include "confdefs.h"
6283
6284 /* Override any gcc2 internal prototype to avoid an error.  */
6285 #ifdef __cplusplus
6286 extern "C"
6287 #endif
6288 /* We use char because int might match the return type of a gcc2
6289    builtin and then its argument prototype would still apply.  */
6290 char tgoto ();
6291 int
6292 main (void)
6293 {
6294 tgoto ();
6295   ;
6296   return 0;
6297 }
6298 _ACEOF
6299 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6300 if { (eval echo "$as_me:6300: \"$ac_link\"") >&5
6301   (eval $ac_link) 2>&5
6302   ac_status=$?
6303   echo "$as_me:6303: \$? = $ac_status" >&5
6304   (exit "$ac_status"); } &&
6305          { ac_try='test -s "conftest$ac_exeext"'
6306   { (eval echo "$as_me:6306: \"$ac_try\"") >&5
6307   (eval $ac_try) 2>&5
6308   ac_status=$?
6309   echo "$as_me:6309: \$? = $ac_status" >&5
6310   (exit "$ac_status"); }; }; then
6311   ac_cv_lib_mytinfo_tgoto=yes
6312 else
6313   echo "$as_me: failed program was:" >&5
6314 cat "conftest.$ac_ext" >&5
6315 ac_cv_lib_mytinfo_tgoto=no
6316 fi
6317 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6318 LIBS=$ac_check_lib_save_LIBS
6319 fi
6320 echo "$as_me:6320: result: $ac_cv_lib_mytinfo_tgoto" >&5
6321 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6322 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6323   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6324 fi
6325
6326         fi
6327         ;;
6328 esac
6329
6330 cf_add_libs="$LIBS"
6331 # reverse order
6332 cf_add_0lib=
6333 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6334 # filter duplicates
6335 for cf_add_1lib in $cf_add_0lib; do
6336         for cf_add_2lib in $cf_add_libs; do
6337                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6338                         cf_add_1lib=
6339                         break
6340                 fi
6341         done
6342         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6343 done
6344 LIBS="$cf_add_libs"
6345
6346 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6347 then
6348
6349 cf_add_libs="$LIBS"
6350 # reverse order
6351 cf_add_0lib=
6352 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6353 # filter duplicates
6354 for cf_add_1lib in $cf_add_0lib; do
6355         for cf_add_2lib in $cf_add_libs; do
6356                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6357                         cf_add_1lib=
6358                         break
6359                 fi
6360         done
6361         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6362 done
6363 LIBS="$cf_add_libs"
6364
6365 else
6366
6367         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6368         cf_libdir=""
6369         echo "$as_me:6369: checking for initscr" >&5
6370 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6371 if test "${ac_cv_func_initscr+set}" = set; then
6372   echo $ECHO_N "(cached) $ECHO_C" >&6
6373 else
6374   cat >"conftest.$ac_ext" <<_ACEOF
6375 #line 6375 "configure"
6376 #include "confdefs.h"
6377 #define initscr autoconf_temporary
6378 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6379 #undef initscr
6380
6381 #ifdef __cplusplus
6382 extern "C"
6383 #endif
6384
6385 /* We use char because int might match the return type of a gcc2
6386    builtin and then its argument prototype would still apply.  */
6387 char initscr (void);
6388
6389 int
6390 main (void)
6391 {
6392
6393 /* The GNU C library defines stubs for functions which it implements
6394     to always fail with ENOSYS.  Some functions are actually named
6395     something starting with __ and the normal name is an alias.  */
6396 #if defined (__stub_initscr) || defined (__stub___initscr)
6397 #error found stub for initscr
6398 #endif
6399
6400         return initscr ();
6401   ;
6402   return 0;
6403 }
6404 _ACEOF
6405 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6406 if { (eval echo "$as_me:6406: \"$ac_link\"") >&5
6407   (eval $ac_link) 2>&5
6408   ac_status=$?
6409   echo "$as_me:6409: \$? = $ac_status" >&5
6410   (exit "$ac_status"); } &&
6411          { ac_try='test -s "conftest$ac_exeext"'
6412   { (eval echo "$as_me:6412: \"$ac_try\"") >&5
6413   (eval $ac_try) 2>&5
6414   ac_status=$?
6415   echo "$as_me:6415: \$? = $ac_status" >&5
6416   (exit "$ac_status"); }; }; then
6417   ac_cv_func_initscr=yes
6418 else
6419   echo "$as_me: failed program was:" >&5
6420 cat "conftest.$ac_ext" >&5
6421 ac_cv_func_initscr=no
6422 fi
6423 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6424 fi
6425 echo "$as_me:6425: result: $ac_cv_func_initscr" >&5
6426 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6427 if test "$ac_cv_func_initscr" = yes; then
6428   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6429 else
6430
6431                 cf_save_LIBS="$LIBS"
6432                 echo "$as_me:6432: checking for initscr in -l$cf_nculib_root" >&5
6433 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6434                 LIBS="-l$cf_nculib_root $LIBS"
6435                 cat >"conftest.$ac_ext" <<_ACEOF
6436 #line 6436 "configure"
6437 #include "confdefs.h"
6438 #include <${cf_cv_ncurses_header:-curses.h}>
6439 int
6440 main (void)
6441 {
6442 initscr()
6443   ;
6444   return 0;
6445 }
6446 _ACEOF
6447 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6448 if { (eval echo "$as_me:6448: \"$ac_link\"") >&5
6449   (eval $ac_link) 2>&5
6450   ac_status=$?
6451   echo "$as_me:6451: \$? = $ac_status" >&5
6452   (exit "$ac_status"); } &&
6453          { ac_try='test -s "conftest$ac_exeext"'
6454   { (eval echo "$as_me:6454: \"$ac_try\"") >&5
6455   (eval $ac_try) 2>&5
6456   ac_status=$?
6457   echo "$as_me:6457: \$? = $ac_status" >&5
6458   (exit "$ac_status"); }; }; then
6459   echo "$as_me:6459: result: yes" >&5
6460 echo "${ECHO_T}yes" >&6
6461                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6462
6463 else
6464   echo "$as_me: failed program was:" >&5
6465 cat "conftest.$ac_ext" >&5
6466 echo "$as_me:6466: result: no" >&5
6467 echo "${ECHO_T}no" >&6
6468
6469 cf_search=
6470 cf_library_path_list=""
6471 if test -n "${LDFLAGS}${LIBS}" ; then
6472         for cf_library_path in $LDFLAGS $LIBS
6473         do
6474                 case "$cf_library_path" in
6475                 (-L*)
6476                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6477
6478 test "x$cf_library_path" != "xNONE" && \
6479 test -d "$cf_library_path" && \
6480  {
6481         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6482         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6483         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6484         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6485         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6486         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"
6487 }
6488
6489                         cf_library_path_list="$cf_library_path_list $cf_search"
6490                         ;;
6491                 esac
6492         done
6493 fi
6494
6495 cf_search=
6496
6497 test "x$prefix" != "xNONE" && \
6498 test -d "$prefix" && \
6499  {
6500         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6501         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6502         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6503         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6504         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6505         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6506 }
6507
6508 for cf_subdir_prefix in \
6509         /usr \
6510         /usr/local \
6511         /usr/pkg \
6512         /opt \
6513         /opt/local \
6514         $HOME
6515 do
6516
6517 test "x$cf_subdir_prefix" != "x$prefix" && \
6518 test -d "$cf_subdir_prefix" && \
6519 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6520         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6521         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6522         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6523         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6524         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6525         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"
6526 }
6527
6528 done
6529
6530 cf_search="$cf_library_path_list $cf_search"
6531
6532                         for cf_libdir in $cf_search
6533                         do
6534                                 echo "$as_me:6534: checking for -l$cf_nculib_root in $cf_libdir" >&5
6535 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6536                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6537                                 cat >"conftest.$ac_ext" <<_ACEOF
6538 #line 6538 "configure"
6539 #include "confdefs.h"
6540 #include <${cf_cv_ncurses_header:-curses.h}>
6541 int
6542 main (void)
6543 {
6544 initscr()
6545   ;
6546   return 0;
6547 }
6548 _ACEOF
6549 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6550 if { (eval echo "$as_me:6550: \"$ac_link\"") >&5
6551   (eval $ac_link) 2>&5
6552   ac_status=$?
6553   echo "$as_me:6553: \$? = $ac_status" >&5
6554   (exit "$ac_status"); } &&
6555          { ac_try='test -s "conftest$ac_exeext"'
6556   { (eval echo "$as_me:6556: \"$ac_try\"") >&5
6557   (eval $ac_try) 2>&5
6558   ac_status=$?
6559   echo "$as_me:6559: \$? = $ac_status" >&5
6560   (exit "$ac_status"); }; }; then
6561   echo "$as_me:6561: result: yes" >&5
6562 echo "${ECHO_T}yes" >&6
6563                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6564                                          break
6565 else
6566   echo "$as_me: failed program was:" >&5
6567 cat "conftest.$ac_ext" >&5
6568 echo "$as_me:6568: result: no" >&5
6569 echo "${ECHO_T}no" >&6
6570                                          LIBS="$cf_save_LIBS"
6571 fi
6572 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6573                         done
6574
6575 fi
6576 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6577
6578 fi
6579
6580 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6581
6582 if test "$cf_found_library" = no ; then
6583         { { echo "$as_me:6583: error: Cannot link $cf_nculib_root library" >&5
6584 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6585    { (exit 1); exit 1; }; }
6586 fi
6587
6588 fi
6589
6590 if test -n "$cf_ncurses_LIBS" ; then
6591         echo "$as_me:6591: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6592 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6593         cf_ncurses_SAVE="$LIBS"
6594         for p in $cf_ncurses_LIBS ; do
6595                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6596                 if test "$q" != "$LIBS" ; then
6597                         LIBS="$q"
6598                 fi
6599         done
6600         cat >"conftest.$ac_ext" <<_ACEOF
6601 #line 6601 "configure"
6602 #include "confdefs.h"
6603 #include <${cf_cv_ncurses_header:-curses.h}>
6604 int
6605 main (void)
6606 {
6607 initscr(); mousemask(0,0); tigetstr((char *)0);
6608   ;
6609   return 0;
6610 }
6611 _ACEOF
6612 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6613 if { (eval echo "$as_me:6613: \"$ac_link\"") >&5
6614   (eval $ac_link) 2>&5
6615   ac_status=$?
6616   echo "$as_me:6616: \$? = $ac_status" >&5
6617   (exit "$ac_status"); } &&
6618          { ac_try='test -s "conftest$ac_exeext"'
6619   { (eval echo "$as_me:6619: \"$ac_try\"") >&5
6620   (eval $ac_try) 2>&5
6621   ac_status=$?
6622   echo "$as_me:6622: \$? = $ac_status" >&5
6623   (exit "$ac_status"); }; }; then
6624   echo "$as_me:6624: result: yes" >&5
6625 echo "${ECHO_T}yes" >&6
6626 else
6627   echo "$as_me: failed program was:" >&5
6628 cat "conftest.$ac_ext" >&5
6629 echo "$as_me:6629: result: no" >&5
6630 echo "${ECHO_T}no" >&6
6631                  LIBS="$cf_ncurses_SAVE"
6632 fi
6633 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6634 fi
6635
6636 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6637
6638 cat >>confdefs.h <<EOF
6639 #define $cf_nculib_ROOT 1
6640 EOF
6641
6642         fi
6643 else
6644         NCURSES_CONFIG=none
6645 fi
6646
6647 echo "$as_me:6647: checking if you want wide-character code" >&5
6648 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6649
6650 # Check whether --enable-widec or --disable-widec was given.
6651 if test "${enable_widec+set}" = set; then
6652   enableval="$enable_widec"
6653   with_widec=$enableval
6654 else
6655   with_widec=no
6656 fi;
6657 echo "$as_me:6657: result: $with_widec" >&5
6658 echo "${ECHO_T}$with_widec" >&6
6659 if test "$with_widec" = yes ; then
6660
6661 for ac_header in wchar.h
6662 do
6663 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6664 echo "$as_me:6664: checking for $ac_header" >&5
6665 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6666 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6667   echo $ECHO_N "(cached) $ECHO_C" >&6
6668 else
6669   cat >"conftest.$ac_ext" <<_ACEOF
6670 #line 6670 "configure"
6671 #include "confdefs.h"
6672 #include <$ac_header>
6673 _ACEOF
6674 if { (eval echo "$as_me:6674: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6675   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6676   ac_status=$?
6677   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6678   rm -f conftest.er1
6679   cat conftest.err >&5
6680   echo "$as_me:6680: \$? = $ac_status" >&5
6681   (exit "$ac_status"); } >/dev/null; then
6682   if test -s conftest.err; then
6683     ac_cpp_err=$ac_c_preproc_warn_flag
6684   else
6685     ac_cpp_err=
6686   fi
6687 else
6688   ac_cpp_err=yes
6689 fi
6690 if test -z "$ac_cpp_err"; then
6691   eval "$as_ac_Header=yes"
6692 else
6693   echo "$as_me: failed program was:" >&5
6694   cat "conftest.$ac_ext" >&5
6695   eval "$as_ac_Header=no"
6696 fi
6697 rm -f conftest.err "conftest.$ac_ext"
6698 fi
6699 echo "$as_me:6699: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6700 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6701 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6702   cat >>confdefs.h <<EOF
6703 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6704 EOF
6705
6706 fi
6707 done
6708
6709 echo "$as_me:6709: checking for multibyte character support" >&5
6710 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6711 if test "${cf_cv_utf8_lib+set}" = set; then
6712   echo $ECHO_N "(cached) $ECHO_C" >&6
6713 else
6714
6715         cf_save_LIBS="$LIBS"
6716         cat >"conftest.$ac_ext" <<_ACEOF
6717 #line 6717 "configure"
6718 #include "confdefs.h"
6719
6720 #include <stdlib.h>
6721 #include <stdio.h>
6722 #ifdef HAVE_WCHAR_H
6723 #include <wchar.h>
6724 #endif
6725
6726 int
6727 main (void)
6728 {
6729 putwc(0,0);
6730   ;
6731   return 0;
6732 }
6733 _ACEOF
6734 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6735 if { (eval echo "$as_me:6735: \"$ac_link\"") >&5
6736   (eval $ac_link) 2>&5
6737   ac_status=$?
6738   echo "$as_me:6738: \$? = $ac_status" >&5
6739   (exit "$ac_status"); } &&
6740          { ac_try='test -s "conftest$ac_exeext"'
6741   { (eval echo "$as_me:6741: \"$ac_try\"") >&5
6742   (eval $ac_try) 2>&5
6743   ac_status=$?
6744   echo "$as_me:6744: \$? = $ac_status" >&5
6745   (exit "$ac_status"); }; }; then
6746   cf_cv_utf8_lib=yes
6747 else
6748   echo "$as_me: failed program was:" >&5
6749 cat "conftest.$ac_ext" >&5
6750
6751 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6752 # will be set on completion of the AC_TRY_LINK below.
6753 cf_cv_header_path_utf8=
6754 cf_cv_library_path_utf8=
6755
6756 echo "${as_me:-configure}:6756: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6757
6758 cf_save_LIBS="$LIBS"
6759
6760 cat >"conftest.$ac_ext" <<_ACEOF
6761 #line 6761 "configure"
6762 #include "confdefs.h"
6763
6764 #include <libutf8.h>
6765 int
6766 main (void)
6767 {
6768 putwc(0,0);
6769   ;
6770   return 0;
6771 }
6772 _ACEOF
6773 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6774 if { (eval echo "$as_me:6774: \"$ac_link\"") >&5
6775   (eval $ac_link) 2>&5
6776   ac_status=$?
6777   echo "$as_me:6777: \$? = $ac_status" >&5
6778   (exit "$ac_status"); } &&
6779          { ac_try='test -s "conftest$ac_exeext"'
6780   { (eval echo "$as_me:6780: \"$ac_try\"") >&5
6781   (eval $ac_try) 2>&5
6782   ac_status=$?
6783   echo "$as_me:6783: \$? = $ac_status" >&5
6784   (exit "$ac_status"); }; }; then
6785
6786         cf_cv_find_linkage_utf8=yes
6787         cf_cv_header_path_utf8=/usr/include
6788         cf_cv_library_path_utf8=/usr/lib
6789
6790 else
6791   echo "$as_me: failed program was:" >&5
6792 cat "conftest.$ac_ext" >&5
6793
6794 LIBS="-lutf8  $cf_save_LIBS"
6795
6796 cat >"conftest.$ac_ext" <<_ACEOF
6797 #line 6797 "configure"
6798 #include "confdefs.h"
6799
6800 #include <libutf8.h>
6801 int
6802 main (void)
6803 {
6804 putwc(0,0);
6805   ;
6806   return 0;
6807 }
6808 _ACEOF
6809 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6810 if { (eval echo "$as_me:6810: \"$ac_link\"") >&5
6811   (eval $ac_link) 2>&5
6812   ac_status=$?
6813   echo "$as_me:6813: \$? = $ac_status" >&5
6814   (exit "$ac_status"); } &&
6815          { ac_try='test -s "conftest$ac_exeext"'
6816   { (eval echo "$as_me:6816: \"$ac_try\"") >&5
6817   (eval $ac_try) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit "$ac_status"); }; }; then
6821
6822         cf_cv_find_linkage_utf8=yes
6823         cf_cv_header_path_utf8=/usr/include
6824         cf_cv_library_path_utf8=/usr/lib
6825         cf_cv_library_file_utf8="-lutf8"
6826
6827 else
6828   echo "$as_me: failed program was:" >&5
6829 cat "conftest.$ac_ext" >&5
6830
6831         cf_cv_find_linkage_utf8=no
6832         LIBS="$cf_save_LIBS"
6833
6834         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6835
6836 echo "${as_me:-configure}:6836: testing find linkage for utf8 library ..." 1>&5
6837
6838 echo "${as_me:-configure}:6838: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6839
6840         cf_save_CPPFLAGS="$CPPFLAGS"
6841         cf_test_CPPFLAGS="$CPPFLAGS"
6842
6843 cf_search=
6844
6845 # collect the current set of include-directories from compiler flags
6846 cf_header_path_list=""
6847 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6848         for cf_header_path in $CPPFLAGS $CFLAGS
6849         do
6850                 case "$cf_header_path" in
6851                 (-I*)
6852                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6853
6854 test "x$cf_header_path" != "xNONE" && \
6855 test -d "$cf_header_path" && \
6856  {
6857         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6858         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6859         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6860         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6861         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6862         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6863 }
6864
6865                         cf_header_path_list="$cf_header_path_list $cf_search"
6866                         ;;
6867                 esac
6868         done
6869 fi
6870
6871 # add the variations for the package we are looking for
6872
6873 cf_search=
6874
6875 test "x$prefix" != "xNONE" && \
6876 test -d "$prefix" && \
6877  {
6878         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6879         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6880         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6881         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6882         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6883         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6884 }
6885
6886 for cf_subdir_prefix in \
6887         /usr \
6888         /usr/local \
6889         /usr/pkg \
6890         /opt \
6891         /opt/local \
6892         $HOME
6893 do
6894
6895 test "x$cf_subdir_prefix" != "x$prefix" && \
6896 test -d "$cf_subdir_prefix" && \
6897 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6898         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6899         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6900         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6901         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6902         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6903         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6904 }
6905
6906 done
6907
6908 test "$includedir" != NONE && \
6909 test "$includedir" != "/usr/include" && \
6910 test -d "$includedir" && {
6911         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6912         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6913 }
6914
6915 test "$oldincludedir" != NONE && \
6916 test "$oldincludedir" != "/usr/include" && \
6917 test -d "$oldincludedir" && {
6918         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6919         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6920 }
6921
6922 cf_search="$cf_search $cf_header_path_list"
6923
6924         for cf_cv_header_path_utf8 in $cf_search
6925         do
6926                 if test -d "$cf_cv_header_path_utf8" ; then
6927                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6928
6929 echo "${as_me:-configure}:6929: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6930
6931                         CPPFLAGS="$cf_save_CPPFLAGS"
6932
6933         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6934         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6935
6936                         cat >"conftest.$ac_ext" <<_ACEOF
6937 #line 6937 "configure"
6938 #include "confdefs.h"
6939
6940 #include <libutf8.h>
6941 int
6942 main (void)
6943 {
6944 putwc(0,0);
6945   ;
6946   return 0;
6947 }
6948 _ACEOF
6949 rm -f "conftest.$ac_objext"
6950 if { (eval echo "$as_me:6950: \"$ac_compile\"") >&5
6951   (eval $ac_compile) 2>&5
6952   ac_status=$?
6953   echo "$as_me:6953: \$? = $ac_status" >&5
6954   (exit "$ac_status"); } &&
6955          { ac_try='test -s "conftest.$ac_objext"'
6956   { (eval echo "$as_me:6956: \"$ac_try\"") >&5
6957   (eval $ac_try) 2>&5
6958   ac_status=$?
6959   echo "$as_me:6959: \$? = $ac_status" >&5
6960   (exit "$ac_status"); }; }; then
6961
6962                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6963
6964 echo "${as_me:-configure}:6964: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6965
6966                                 cf_cv_find_linkage_utf8=maybe
6967                                 cf_test_CPPFLAGS="$CPPFLAGS"
6968                                 break
6969 else
6970   echo "$as_me: failed program was:" >&5
6971 cat "conftest.$ac_ext" >&5
6972
6973                                 CPPFLAGS="$cf_save_CPPFLAGS"
6974
6975 fi
6976 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6977                 fi
6978         done
6979
6980         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6981
6982 echo "${as_me:-configure}:6982: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6983
6984                 cf_save_LIBS="$LIBS"
6985                 cf_save_LDFLAGS="$LDFLAGS"
6986
6987                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6988
6989 cf_search=
6990 cf_library_path_list=""
6991 if test -n "${LDFLAGS}${LIBS}" ; then
6992         for cf_library_path in $LDFLAGS $LIBS
6993         do
6994                 case "$cf_library_path" in
6995                 (-L*)
6996                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6997
6998 test "x$cf_library_path" != "xNONE" && \
6999 test -d "$cf_library_path" && \
7000  {
7001         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7002         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7003         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7004         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7005         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7006         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7007 }
7008
7009                         cf_library_path_list="$cf_library_path_list $cf_search"
7010                         ;;
7011                 esac
7012         done
7013 fi
7014
7015 cf_search=
7016
7017 test "x$prefix" != "xNONE" && \
7018 test -d "$prefix" && \
7019  {
7020         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7021         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7022         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7023         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7024         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7025         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7026 }
7027
7028 for cf_subdir_prefix in \
7029         /usr \
7030         /usr/local \
7031         /usr/pkg \
7032         /opt \
7033         /opt/local \
7034         $HOME
7035 do
7036
7037 test "x$cf_subdir_prefix" != "x$prefix" && \
7038 test -d "$cf_subdir_prefix" && \
7039 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7040         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7041         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7042         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7043         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7044         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7045         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7046 }
7047
7048 done
7049
7050 cf_search="$cf_library_path_list $cf_search"
7051
7052                         for cf_cv_library_path_utf8 in $cf_search
7053                         do
7054                                 if test -d "$cf_cv_library_path_utf8" ; then
7055                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7056
7057 echo "${as_me:-configure}:7057: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7058
7059                                         CPPFLAGS="$cf_test_CPPFLAGS"
7060                                         LIBS="-lutf8  $cf_save_LIBS"
7061                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7062                                         cat >"conftest.$ac_ext" <<_ACEOF
7063 #line 7063 "configure"
7064 #include "confdefs.h"
7065
7066 #include <libutf8.h>
7067 int
7068 main (void)
7069 {
7070 putwc(0,0);
7071   ;
7072   return 0;
7073 }
7074 _ACEOF
7075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7076 if { (eval echo "$as_me:7076: \"$ac_link\"") >&5
7077   (eval $ac_link) 2>&5
7078   ac_status=$?
7079   echo "$as_me:7079: \$? = $ac_status" >&5
7080   (exit "$ac_status"); } &&
7081          { ac_try='test -s "conftest$ac_exeext"'
7082   { (eval echo "$as_me:7082: \"$ac_try\"") >&5
7083   (eval $ac_try) 2>&5
7084   ac_status=$?
7085   echo "$as_me:7085: \$? = $ac_status" >&5
7086   (exit "$ac_status"); }; }; then
7087
7088                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7089
7090 echo "${as_me:-configure}:7090: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7091
7092                                         cf_cv_find_linkage_utf8=yes
7093                                         cf_cv_library_file_utf8="-lutf8"
7094                                         break
7095 else
7096   echo "$as_me: failed program was:" >&5
7097 cat "conftest.$ac_ext" >&5
7098
7099                                         CPPFLAGS="$cf_save_CPPFLAGS"
7100                                         LIBS="$cf_save_LIBS"
7101                                         LDFLAGS="$cf_save_LDFLAGS"
7102
7103 fi
7104 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7105                                 fi
7106                         done
7107                         CPPFLAGS="$cf_save_CPPFLAGS"
7108                         LDFLAGS="$cf_save_LDFLAGS"
7109                 fi
7110
7111         else
7112                 cf_cv_find_linkage_utf8=no
7113         fi
7114
7115 fi
7116 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7117
7118 fi
7119 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7120
7121 LIBS="$cf_save_LIBS"
7122
7123 if test "$cf_cv_find_linkage_utf8" = yes ; then
7124 cf_cv_utf8_lib=add-on
7125 else
7126 cf_cv_utf8_lib=no
7127 fi
7128
7129 fi
7130 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7131 fi
7132 echo "$as_me:7132: result: $cf_cv_utf8_lib" >&5
7133 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7134
7135 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7136 # ncurses/ncursesw:
7137 if test "$cf_cv_utf8_lib" = "add-on" ; then
7138
7139 cat >>confdefs.h <<\EOF
7140 #define HAVE_LIBUTF8_H 1
7141 EOF
7142
7143 if test -n "$cf_cv_header_path_utf8" ; then
7144   for cf_add_incdir in $cf_cv_header_path_utf8
7145   do
7146         while test "$cf_add_incdir" != /usr/include
7147         do
7148           if test -d "$cf_add_incdir"
7149           then
7150                 cf_have_incdir=no
7151                 if test -n "$CFLAGS$CPPFLAGS" ; then
7152                   # a loop is needed to ensure we can add subdirs of existing dirs
7153                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7154                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7155                           cf_have_incdir=yes; break
7156                         fi
7157                   done
7158                 fi
7159
7160                 if test "$cf_have_incdir" = no ; then
7161                   if test "$cf_add_incdir" = /usr/local/include ; then
7162                         if test "$GCC" = yes
7163                         then
7164                           cf_save_CPPFLAGS=$CPPFLAGS
7165
7166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7167         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7168
7169                           cat >"conftest.$ac_ext" <<_ACEOF
7170 #line 7170 "configure"
7171 #include "confdefs.h"
7172 #include <stdio.h>
7173 int
7174 main (void)
7175 {
7176 printf("Hello")
7177   ;
7178   return 0;
7179 }
7180 _ACEOF
7181 rm -f "conftest.$ac_objext"
7182 if { (eval echo "$as_me:7182: \"$ac_compile\"") >&5
7183   (eval $ac_compile) 2>&5
7184   ac_status=$?
7185   echo "$as_me:7185: \$? = $ac_status" >&5
7186   (exit "$ac_status"); } &&
7187          { ac_try='test -s "conftest.$ac_objext"'
7188   { (eval echo "$as_me:7188: \"$ac_try\"") >&5
7189   (eval $ac_try) 2>&5
7190   ac_status=$?
7191   echo "$as_me:7191: \$? = $ac_status" >&5
7192   (exit "$ac_status"); }; }; then
7193   :
7194 else
7195   echo "$as_me: failed program was:" >&5
7196 cat "conftest.$ac_ext" >&5
7197 cf_have_incdir=yes
7198 fi
7199 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7200                           CPPFLAGS=$cf_save_CPPFLAGS
7201                         fi
7202                   fi
7203                 fi
7204
7205                 if test "$cf_have_incdir" = no ; then
7206                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7207
7208 echo "${as_me:-configure}:7208: testing adding $cf_add_incdir to include-path ..." 1>&5
7209
7210                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7211
7212                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7213                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7214                   cf_add_incdir="$cf_top_incdir"
7215                 else
7216                   break
7217                 fi
7218           else
7219                 break
7220           fi
7221         done
7222   done
7223 fi
7224
7225 if test -n "$cf_cv_library_path_utf8" ; then
7226         for cf_add_libdir in $cf_cv_library_path_utf8
7227         do
7228                 if test "$cf_add_libdir" = /usr/lib ; then
7229                         :
7230                 elif test -d "$cf_add_libdir"
7231                 then
7232                         cf_have_libdir=no
7233                         if test -n "$LDFLAGS$LIBS" ; then
7234                                 # a loop is needed to ensure we can add subdirs of existing dirs
7235                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7236                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7237                                                 cf_have_libdir=yes; break
7238                                         fi
7239                                 done
7240                         fi
7241                         if test "$cf_have_libdir" = no ; then
7242                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7243
7244 echo "${as_me:-configure}:7244: testing adding $cf_add_libdir to library-path ..." 1>&5
7245
7246                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7247                         fi
7248                 fi
7249         done
7250 fi
7251
7252 cf_add_libs="$LIBS"
7253 # reverse order
7254 cf_add_0lib=
7255 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7256 # filter duplicates
7257 for cf_add_1lib in $cf_add_0lib; do
7258         for cf_add_2lib in $cf_add_libs; do
7259                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7260                         cf_add_1lib=
7261                         break
7262                 fi
7263         done
7264         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7265 done
7266 LIBS="$cf_add_libs"
7267
7268 fi
7269
7270 cf_ncuconfig_root=ncursesw
7271 cf_have_ncuconfig=no
7272
7273 if test "x${PKG_CONFIG:=none}" != xnone; then
7274         echo "$as_me:7274: checking pkg-config for $cf_ncuconfig_root" >&5
7275 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7276         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7277                 echo "$as_me:7277: result: yes" >&5
7278 echo "${ECHO_T}yes" >&6
7279
7280                 echo "$as_me:7280: checking if the $cf_ncuconfig_root package files work" >&5
7281 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7282                 cf_have_ncuconfig=unknown
7283
7284                 cf_save_CFLAGS="$CFLAGS"
7285                 cf_save_CPPFLAGS="$CPPFLAGS"
7286                 cf_save_LIBS="$LIBS"
7287
7288                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7289                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7290
7291                 # while -W for passing linker flags is prevalent, it is not "standard".
7292                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7293                 # incompatible _and_ non-standard -W option which gives an error.  Work
7294                 # around that pitfall.
7295                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7296                 (x*c[89]9@@*-W*)
7297
7298 cf_fix_cppflags=no
7299 cf_new_cflags=
7300 cf_new_cppflags=
7301 cf_new_extra_cppflags=
7302
7303 for cf_add_cflags in $cf_pkg_cflags
7304 do
7305 case "$cf_fix_cppflags" in
7306 (no)
7307         case "$cf_add_cflags" in
7308         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7309                 case "$cf_add_cflags" in
7310                 (-D*)
7311                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7312
7313                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7314                                 && test -z "${cf_tst_cflags}" \
7315                                 && cf_fix_cppflags=yes
7316
7317                         if test "$cf_fix_cppflags" = yes ; then
7318
7319         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7320         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7321
7322                                 continue
7323                         elif test "${cf_tst_cflags}" = "\"'" ; then
7324
7325         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7326         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7327
7328                                 continue
7329                         fi
7330                         ;;
7331                 esac
7332                 case "$CPPFLAGS" in
7333                 (*$cf_add_cflags)
7334                         ;;
7335                 (*)
7336                         case "$cf_add_cflags" in
7337                         (-D*)
7338                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7339
7340 CPPFLAGS=`echo "$CPPFLAGS" | \
7341         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7342                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7343
7344                                 ;;
7345                         esac
7346
7347         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7348         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7349
7350                         ;;
7351                 esac
7352                 ;;
7353         (*)
7354
7355         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7356         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7357
7358                 ;;
7359         esac
7360         ;;
7361 (yes)
7362
7363         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7364         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7365
7366         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7367
7368         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7369                 && test -z "${cf_tst_cflags}" \
7370                 && cf_fix_cppflags=no
7371         ;;
7372 esac
7373 done
7374
7375 if test -n "$cf_new_cflags" ; then
7376
7377         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7378         CFLAGS="${CFLAGS}$cf_new_cflags"
7379
7380 fi
7381
7382 if test -n "$cf_new_cppflags" ; then
7383
7384         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7385         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7386
7387 fi
7388
7389 if test -n "$cf_new_extra_cppflags" ; then
7390
7391         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7392         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7393
7394 fi
7395
7396 cf_add_libs="$LIBS"
7397 # reverse order
7398 cf_add_0lib=
7399 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7400 # filter duplicates
7401 for cf_add_1lib in $cf_add_0lib; do
7402         for cf_add_2lib in $cf_add_libs; do
7403                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7404                         cf_add_1lib=
7405                         break
7406                 fi
7407         done
7408         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7409 done
7410 LIBS="$cf_add_libs"
7411
7412                         cat >"conftest.$ac_ext" <<_ACEOF
7413 #line 7413 "configure"
7414 #include "confdefs.h"
7415 #include <${cf_cv_ncurses_header:-curses.h}>
7416 int
7417 main (void)
7418 {
7419 initscr(); mousemask(0,0); tigetstr((char *)0);
7420   ;
7421   return 0;
7422 }
7423 _ACEOF
7424 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7425 if { (eval echo "$as_me:7425: \"$ac_link\"") >&5
7426   (eval $ac_link) 2>&5
7427   ac_status=$?
7428   echo "$as_me:7428: \$? = $ac_status" >&5
7429   (exit "$ac_status"); } &&
7430          { ac_try='test -s "conftest$ac_exeext"'
7431   { (eval echo "$as_me:7431: \"$ac_try\"") >&5
7432   (eval $ac_try) 2>&5
7433   ac_status=$?
7434   echo "$as_me:7434: \$? = $ac_status" >&5
7435   (exit "$ac_status"); }; }; then
7436   if test "$cross_compiling" = yes; then
7437   cf_test_ncuconfig=maybe
7438 else
7439   cat >"conftest.$ac_ext" <<_ACEOF
7440 #line 7440 "configure"
7441 #include "confdefs.h"
7442 #include <${cf_cv_ncurses_header:-curses.h}>
7443                                         int main(void)
7444                                         { const char *xx = curses_version(); return (xx == 0); }
7445 _ACEOF
7446 rm -f "conftest$ac_exeext"
7447 if { (eval echo "$as_me:7447: \"$ac_link\"") >&5
7448   (eval $ac_link) 2>&5
7449   ac_status=$?
7450   echo "$as_me:7450: \$? = $ac_status" >&5
7451   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7452   { (eval echo "$as_me:7452: \"$ac_try\"") >&5
7453   (eval $ac_try) 2>&5
7454   ac_status=$?
7455   echo "$as_me:7455: \$? = $ac_status" >&5
7456   (exit "$ac_status"); }; }; then
7457   cf_test_ncuconfig=yes
7458 else
7459   echo "$as_me: program exited with status $ac_status" >&5
7460 echo "$as_me: failed program was:" >&5
7461 cat "conftest.$ac_ext" >&5
7462 cf_test_ncuconfig=no
7463 fi
7464 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7465 fi
7466 else
7467   echo "$as_me: failed program was:" >&5
7468 cat "conftest.$ac_ext" >&5
7469 cf_test_ncuconfig=no
7470 fi
7471 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7472
7473                         CFLAGS="$cf_save_CFLAGS"
7474                         CPPFLAGS="$cf_save_CPPFLAGS"
7475                         LIBS="$cf_save_LIBS"
7476
7477                         if test "x$cf_test_ncuconfig" != xyes; then
7478                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7479                                 cf_pkg_cflags="$cf_temp"
7480                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7481                                 cf_pkg_libs="$cf_temp"
7482                         fi
7483                         ;;
7484                 esac
7485
7486 for cf_add_cflags in $cf_pkg_cflags
7487 do
7488         case "x$cf_add_cflags" in
7489         (x-[DU]*)
7490
7491 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7492 while true
7493 do
7494         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7495         test "$CFLAGS" != "$cf_old_cflag" || break
7496
7497         CFLAGS="$cf_old_cflag"
7498 done
7499
7500 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7501 while true
7502 do
7503         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7504         test "$CPPFLAGS" != "$cf_old_cflag" || break
7505
7506         CPPFLAGS="$cf_old_cflag"
7507 done
7508
7509                 ;;
7510         esac
7511
7512 cf_fix_cppflags=no
7513 cf_new_cflags=
7514 cf_new_cppflags=
7515 cf_new_extra_cppflags=
7516
7517 for cf_add_cflags in $cf_add_cflags
7518 do
7519 case "$cf_fix_cppflags" in
7520 (no)
7521         case "$cf_add_cflags" in
7522         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7523                 case "$cf_add_cflags" in
7524                 (-D*)
7525                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7526
7527                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7528                                 && test -z "${cf_tst_cflags}" \
7529                                 && cf_fix_cppflags=yes
7530
7531                         if test "$cf_fix_cppflags" = yes ; then
7532
7533         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7534         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7535
7536                                 continue
7537                         elif test "${cf_tst_cflags}" = "\"'" ; then
7538
7539         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7540         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7541
7542                                 continue
7543                         fi
7544                         ;;
7545                 esac
7546                 case "$CPPFLAGS" in
7547                 (*$cf_add_cflags)
7548                         ;;
7549                 (*)
7550                         case "$cf_add_cflags" in
7551                         (-D*)
7552                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7553
7554 CPPFLAGS=`echo "$CPPFLAGS" | \
7555         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7556                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7557
7558                                 ;;
7559                         esac
7560
7561         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7562         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7563
7564                         ;;
7565                 esac
7566                 ;;
7567         (*)
7568
7569         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7570         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7571
7572                 ;;
7573         esac
7574         ;;
7575 (yes)
7576
7577         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7578         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7579
7580         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7581
7582         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7583                 && test -z "${cf_tst_cflags}" \
7584                 && cf_fix_cppflags=no
7585         ;;
7586 esac
7587 done
7588
7589 if test -n "$cf_new_cflags" ; then
7590
7591         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7592         CFLAGS="${CFLAGS}$cf_new_cflags"
7593
7594 fi
7595
7596 if test -n "$cf_new_cppflags" ; then
7597
7598         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7599         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7600
7601 fi
7602
7603 if test -n "$cf_new_extra_cppflags" ; then
7604
7605         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7606         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7607
7608 fi
7609
7610 done
7611
7612 cf_add_libs="$LIBS"
7613 # reverse order
7614 cf_add_0lib=
7615 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7616 # filter duplicates
7617 for cf_add_1lib in $cf_add_0lib; do
7618         for cf_add_2lib in $cf_add_libs; do
7619                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7620                         cf_add_1lib=
7621                         break
7622                 fi
7623         done
7624         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7625 done
7626 LIBS="$cf_add_libs"
7627
7628                 cat >"conftest.$ac_ext" <<_ACEOF
7629 #line 7629 "configure"
7630 #include "confdefs.h"
7631 #include <${cf_cv_ncurses_header:-curses.h}>
7632 int
7633 main (void)
7634 {
7635 initscr(); mousemask(0,0); tigetstr((char *)0);
7636   ;
7637   return 0;
7638 }
7639 _ACEOF
7640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7641 if { (eval echo "$as_me:7641: \"$ac_link\"") >&5
7642   (eval $ac_link) 2>&5
7643   ac_status=$?
7644   echo "$as_me:7644: \$? = $ac_status" >&5
7645   (exit "$ac_status"); } &&
7646          { ac_try='test -s "conftest$ac_exeext"'
7647   { (eval echo "$as_me:7647: \"$ac_try\"") >&5
7648   (eval $ac_try) 2>&5
7649   ac_status=$?
7650   echo "$as_me:7650: \$? = $ac_status" >&5
7651   (exit "$ac_status"); }; }; then
7652   if test "$cross_compiling" = yes; then
7653   cf_have_ncuconfig=maybe
7654 else
7655   cat >"conftest.$ac_ext" <<_ACEOF
7656 #line 7656 "configure"
7657 #include "confdefs.h"
7658 #include <${cf_cv_ncurses_header:-curses.h}>
7659                                 int main(void)
7660                                 { const char *xx = curses_version(); return (xx == 0); }
7661 _ACEOF
7662 rm -f "conftest$ac_exeext"
7663 if { (eval echo "$as_me:7663: \"$ac_link\"") >&5
7664   (eval $ac_link) 2>&5
7665   ac_status=$?
7666   echo "$as_me:7666: \$? = $ac_status" >&5
7667   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7668   { (eval echo "$as_me:7668: \"$ac_try\"") >&5
7669   (eval $ac_try) 2>&5
7670   ac_status=$?
7671   echo "$as_me:7671: \$? = $ac_status" >&5
7672   (exit "$ac_status"); }; }; then
7673   cf_have_ncuconfig=yes
7674 else
7675   echo "$as_me: program exited with status $ac_status" >&5
7676 echo "$as_me: failed program was:" >&5
7677 cat "conftest.$ac_ext" >&5
7678 cf_have_ncuconfig=no
7679 fi
7680 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7681 fi
7682 else
7683   echo "$as_me: failed program was:" >&5
7684 cat "conftest.$ac_ext" >&5
7685 cf_have_ncuconfig=no
7686 fi
7687 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7688                 echo "$as_me:7688: result: $cf_have_ncuconfig" >&5
7689 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7690                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7691                 if test "$cf_have_ncuconfig" != "yes"
7692                 then
7693                         CPPFLAGS="$cf_save_CPPFLAGS"
7694                         LIBS="$cf_save_LIBS"
7695                         NCURSES_CONFIG_PKG=none
7696                 else
7697
7698 cat >>confdefs.h <<\EOF
7699 #define NCURSES 1
7700 EOF
7701
7702                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7703
7704 echo "$as_me:7704: checking for terminfo header" >&5
7705 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7706 if test "${cf_cv_term_header+set}" = set; then
7707   echo $ECHO_N "(cached) $ECHO_C" >&6
7708 else
7709
7710 case "${cf_cv_ncurses_header}" in
7711 (*/ncurses.h|*/ncursesw.h)
7712         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7713         ;;
7714 (*)
7715         cf_term_header=term.h
7716         ;;
7717 esac
7718
7719 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7720 do
7721 cat >"conftest.$ac_ext" <<_ACEOF
7722 #line 7722 "configure"
7723 #include "confdefs.h"
7724 #include <stdio.h>
7725 #include <${cf_cv_ncurses_header:-curses.h}>
7726 #include <$cf_test>
7727
7728 int
7729 main (void)
7730 {
7731 int x = auto_left_margin; (void)x
7732   ;
7733   return 0;
7734 }
7735 _ACEOF
7736 rm -f "conftest.$ac_objext"
7737 if { (eval echo "$as_me:7737: \"$ac_compile\"") >&5
7738   (eval $ac_compile) 2>&5
7739   ac_status=$?
7740   echo "$as_me:7740: \$? = $ac_status" >&5
7741   (exit "$ac_status"); } &&
7742          { ac_try='test -s "conftest.$ac_objext"'
7743   { (eval echo "$as_me:7743: \"$ac_try\"") >&5
7744   (eval $ac_try) 2>&5
7745   ac_status=$?
7746   echo "$as_me:7746: \$? = $ac_status" >&5
7747   (exit "$ac_status"); }; }; then
7748
7749         cf_cv_term_header="$cf_test"
7750 else
7751   echo "$as_me: failed program was:" >&5
7752 cat "conftest.$ac_ext" >&5
7753
7754         cf_cv_term_header=unknown
7755
7756 fi
7757 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7758         test "$cf_cv_term_header" != unknown && break
7759 done
7760
7761 fi
7762 echo "$as_me:7762: result: $cf_cv_term_header" >&5
7763 echo "${ECHO_T}$cf_cv_term_header" >&6
7764
7765 # Set definitions to allow ifdef'ing to accommodate subdirectories
7766
7767 case "$cf_cv_term_header" in
7768 (*term.h)
7769
7770 cat >>confdefs.h <<\EOF
7771 #define HAVE_TERM_H 1
7772 EOF
7773
7774         ;;
7775 esac
7776
7777 case "$cf_cv_term_header" in
7778 (ncurses/term.h)
7779
7780 cat >>confdefs.h <<\EOF
7781 #define HAVE_NCURSES_TERM_H 1
7782 EOF
7783
7784         ;;
7785 (ncursesw/term.h)
7786
7787 cat >>confdefs.h <<\EOF
7788 #define HAVE_NCURSESW_TERM_H 1
7789 EOF
7790
7791         ;;
7792 esac
7793
7794                 fi
7795
7796         else
7797                 echo "$as_me:7797: result: no" >&5
7798 echo "${ECHO_T}no" >&6
7799                 NCURSES_CONFIG_PKG=none
7800         fi
7801 else
7802         NCURSES_CONFIG_PKG=none
7803 fi
7804
7805 if test "x$cf_have_ncuconfig" = "xno"; then
7806         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7807
7808 if test -n "$ac_tool_prefix"; then
7809   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7810   do
7811     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7812 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7813 echo "$as_me:7813: checking for $ac_word" >&5
7814 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7815 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7816   echo $ECHO_N "(cached) $ECHO_C" >&6
7817 else
7818   if test -n "$NCURSES_CONFIG"; then
7819   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7820 else
7821   ac_save_IFS=$IFS; IFS=$ac_path_separator
7822 ac_dummy="$PATH"
7823 for ac_dir in $ac_dummy; do
7824   IFS=$ac_save_IFS
7825   test -z "$ac_dir" && ac_dir=.
7826   $as_executable_p "$ac_dir/$ac_word" || continue
7827 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7828 echo "$as_me:7828: found $ac_dir/$ac_word" >&5
7829 break
7830 done
7831
7832 fi
7833 fi
7834 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7835 if test -n "$NCURSES_CONFIG"; then
7836   echo "$as_me:7836: result: $NCURSES_CONFIG" >&5
7837 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7838 else
7839   echo "$as_me:7839: result: no" >&5
7840 echo "${ECHO_T}no" >&6
7841 fi
7842
7843     test -n "$NCURSES_CONFIG" && break
7844   done
7845 fi
7846 if test -z "$NCURSES_CONFIG"; then
7847   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7848   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7849 do
7850   # Extract the first word of "$ac_prog", so it can be a program name with args.
7851 set dummy $ac_prog; ac_word=$2
7852 echo "$as_me:7852: checking for $ac_word" >&5
7853 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7854 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7855   echo $ECHO_N "(cached) $ECHO_C" >&6
7856 else
7857   if test -n "$ac_ct_NCURSES_CONFIG"; then
7858   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7859 else
7860   ac_save_IFS=$IFS; IFS=$ac_path_separator
7861 ac_dummy="$PATH"
7862 for ac_dir in $ac_dummy; do
7863   IFS=$ac_save_IFS
7864   test -z "$ac_dir" && ac_dir=.
7865   $as_executable_p "$ac_dir/$ac_word" || continue
7866 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7867 echo "$as_me:7867: found $ac_dir/$ac_word" >&5
7868 break
7869 done
7870
7871 fi
7872 fi
7873 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7874 if test -n "$ac_ct_NCURSES_CONFIG"; then
7875   echo "$as_me:7875: result: $ac_ct_NCURSES_CONFIG" >&5
7876 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7877 else
7878   echo "$as_me:7878: result: no" >&5
7879 echo "${ECHO_T}no" >&6
7880 fi
7881
7882   test -n "$ac_ct_NCURSES_CONFIG" && break
7883 done
7884 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7885
7886   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7887 fi
7888
7889         if test "$NCURSES_CONFIG" != none ; then
7890
7891 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7892 do
7893         case "x$cf_add_cflags" in
7894         (x-[DU]*)
7895
7896 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7897 while true
7898 do
7899         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7900         test "$CFLAGS" != "$cf_old_cflag" || break
7901
7902         CFLAGS="$cf_old_cflag"
7903 done
7904
7905 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7906 while true
7907 do
7908         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7909         test "$CPPFLAGS" != "$cf_old_cflag" || break
7910
7911         CPPFLAGS="$cf_old_cflag"
7912 done
7913
7914                 ;;
7915         esac
7916
7917 cf_fix_cppflags=no
7918 cf_new_cflags=
7919 cf_new_cppflags=
7920 cf_new_extra_cppflags=
7921
7922 for cf_add_cflags in $cf_add_cflags
7923 do
7924 case "$cf_fix_cppflags" in
7925 (no)
7926         case "$cf_add_cflags" in
7927         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7928                 case "$cf_add_cflags" in
7929                 (-D*)
7930                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7931
7932                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7933                                 && test -z "${cf_tst_cflags}" \
7934                                 && cf_fix_cppflags=yes
7935
7936                         if test "$cf_fix_cppflags" = yes ; then
7937
7938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7940
7941                                 continue
7942                         elif test "${cf_tst_cflags}" = "\"'" ; then
7943
7944         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7945         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7946
7947                                 continue
7948                         fi
7949                         ;;
7950                 esac
7951                 case "$CPPFLAGS" in
7952                 (*$cf_add_cflags)
7953                         ;;
7954                 (*)
7955                         case "$cf_add_cflags" in
7956                         (-D*)
7957                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7958
7959 CPPFLAGS=`echo "$CPPFLAGS" | \
7960         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7961                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7962
7963                                 ;;
7964                         esac
7965
7966         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7967         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7968
7969                         ;;
7970                 esac
7971                 ;;
7972         (*)
7973
7974         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7975         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7976
7977                 ;;
7978         esac
7979         ;;
7980 (yes)
7981
7982         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7983         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7984
7985         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7986
7987         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7988                 && test -z "${cf_tst_cflags}" \
7989                 && cf_fix_cppflags=no
7990         ;;
7991 esac
7992 done
7993
7994 if test -n "$cf_new_cflags" ; then
7995
7996         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7997         CFLAGS="${CFLAGS}$cf_new_cflags"
7998
7999 fi
8000
8001 if test -n "$cf_new_cppflags" ; then
8002
8003         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8004         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8005
8006 fi
8007
8008 if test -n "$cf_new_extra_cppflags" ; then
8009
8010         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8011         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8012
8013 fi
8014
8015 done
8016
8017 cf_add_libs="$LIBS"
8018 # reverse order
8019 cf_add_0lib=
8020 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8021 # filter duplicates
8022 for cf_add_1lib in $cf_add_0lib; do
8023         for cf_add_2lib in $cf_add_libs; do
8024                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8025                         cf_add_1lib=
8026                         break
8027                 fi
8028         done
8029         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8030 done
8031 LIBS="$cf_add_libs"
8032
8033                 # even with config script, some packages use no-override for curses.h
8034
8035 echo "$as_me:8035: checking if we have identified curses headers" >&5
8036 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8037 if test "${cf_cv_ncurses_header+set}" = set; then
8038   echo $ECHO_N "(cached) $ECHO_C" >&6
8039 else
8040
8041 cf_cv_ncurses_header=none
8042 for cf_header in \
8043         ncurses.h ncursesw/ncurses.h \
8044         curses.h ncursesw/curses.h
8045 do
8046 cat >"conftest.$ac_ext" <<_ACEOF
8047 #line 8047 "configure"
8048 #include "confdefs.h"
8049 #include <${cf_header}>
8050 int
8051 main (void)
8052 {
8053 initscr(); endwin()
8054   ;
8055   return 0;
8056 }
8057 _ACEOF
8058 rm -f "conftest.$ac_objext"
8059 if { (eval echo "$as_me:8059: \"$ac_compile\"") >&5
8060   (eval $ac_compile) 2>&5
8061   ac_status=$?
8062   echo "$as_me:8062: \$? = $ac_status" >&5
8063   (exit "$ac_status"); } &&
8064          { ac_try='test -s "conftest.$ac_objext"'
8065   { (eval echo "$as_me:8065: \"$ac_try\"") >&5
8066   (eval $ac_try) 2>&5
8067   ac_status=$?
8068   echo "$as_me:8068: \$? = $ac_status" >&5
8069   (exit "$ac_status"); }; }; then
8070   cf_cv_ncurses_header=$cf_header; break
8071 else
8072   echo "$as_me: failed program was:" >&5
8073 cat "conftest.$ac_ext" >&5
8074 fi
8075 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8076 done
8077
8078 fi
8079 echo "$as_me:8079: result: $cf_cv_ncurses_header" >&5
8080 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8081
8082 if test "$cf_cv_ncurses_header" = none ; then
8083         { { echo "$as_me:8083: error: No curses header-files found" >&5
8084 echo "$as_me: error: No curses header-files found" >&2;}
8085    { (exit 1); exit 1; }; }
8086 fi
8087
8088 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8089
8090 for ac_header in $cf_cv_ncurses_header
8091 do
8092 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8093 echo "$as_me:8093: checking for $ac_header" >&5
8094 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8095 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8096   echo $ECHO_N "(cached) $ECHO_C" >&6
8097 else
8098   cat >"conftest.$ac_ext" <<_ACEOF
8099 #line 8099 "configure"
8100 #include "confdefs.h"
8101 #include <$ac_header>
8102 _ACEOF
8103 if { (eval echo "$as_me:8103: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8104   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8105   ac_status=$?
8106   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8107   rm -f conftest.er1
8108   cat conftest.err >&5
8109   echo "$as_me:8109: \$? = $ac_status" >&5
8110   (exit "$ac_status"); } >/dev/null; then
8111   if test -s conftest.err; then
8112     ac_cpp_err=$ac_c_preproc_warn_flag
8113   else
8114     ac_cpp_err=
8115   fi
8116 else
8117   ac_cpp_err=yes
8118 fi
8119 if test -z "$ac_cpp_err"; then
8120   eval "$as_ac_Header=yes"
8121 else
8122   echo "$as_me: failed program was:" >&5
8123   cat "conftest.$ac_ext" >&5
8124   eval "$as_ac_Header=no"
8125 fi
8126 rm -f conftest.err "conftest.$ac_ext"
8127 fi
8128 echo "$as_me:8128: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8129 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8130 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8131   cat >>confdefs.h <<EOF
8132 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8133 EOF
8134
8135 fi
8136 done
8137
8138 cat >>confdefs.h <<\EOF
8139 #define NCURSES 1
8140 EOF
8141
8142 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8143
8144                 cat >>confdefs.h <<EOF
8145 #define $cf_nculib_ROOT 1
8146 EOF
8147
8148                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8149
8150         else
8151
8152 cf_ncuhdr_root=ncursesw
8153
8154 test -n "$cf_cv_curses_dir" && \
8155 test "$cf_cv_curses_dir" != "no" && { \
8156
8157 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8158   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8159   do
8160         while test "$cf_add_incdir" != /usr/include
8161         do
8162           if test -d "$cf_add_incdir"
8163           then
8164                 cf_have_incdir=no
8165                 if test -n "$CFLAGS$CPPFLAGS" ; then
8166                   # a loop is needed to ensure we can add subdirs of existing dirs
8167                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8168                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8169                           cf_have_incdir=yes; break
8170                         fi
8171                   done
8172                 fi
8173
8174                 if test "$cf_have_incdir" = no ; then
8175                   if test "$cf_add_incdir" = /usr/local/include ; then
8176                         if test "$GCC" = yes
8177                         then
8178                           cf_save_CPPFLAGS=$CPPFLAGS
8179
8180         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8181         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8182
8183                           cat >"conftest.$ac_ext" <<_ACEOF
8184 #line 8184 "configure"
8185 #include "confdefs.h"
8186 #include <stdio.h>
8187 int
8188 main (void)
8189 {
8190 printf("Hello")
8191   ;
8192   return 0;
8193 }
8194 _ACEOF
8195 rm -f "conftest.$ac_objext"
8196 if { (eval echo "$as_me:8196: \"$ac_compile\"") >&5
8197   (eval $ac_compile) 2>&5
8198   ac_status=$?
8199   echo "$as_me:8199: \$? = $ac_status" >&5
8200   (exit "$ac_status"); } &&
8201          { ac_try='test -s "conftest.$ac_objext"'
8202   { (eval echo "$as_me:8202: \"$ac_try\"") >&5
8203   (eval $ac_try) 2>&5
8204   ac_status=$?
8205   echo "$as_me:8205: \$? = $ac_status" >&5
8206   (exit "$ac_status"); }; }; then
8207   :
8208 else
8209   echo "$as_me: failed program was:" >&5
8210 cat "conftest.$ac_ext" >&5
8211 cf_have_incdir=yes
8212 fi
8213 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8214                           CPPFLAGS=$cf_save_CPPFLAGS
8215                         fi
8216                   fi
8217                 fi
8218
8219                 if test "$cf_have_incdir" = no ; then
8220                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8221
8222 echo "${as_me:-configure}:8222: testing adding $cf_add_incdir to include-path ..." 1>&5
8223
8224                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8225
8226                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8227                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8228                   cf_add_incdir="$cf_top_incdir"
8229                 else
8230                   break
8231                 fi
8232           else
8233                 break
8234           fi
8235         done
8236   done
8237 fi
8238
8239 }
8240
8241 echo "$as_me:8241: checking for $cf_ncuhdr_root header in include-path" >&5
8242 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8243 if test "${cf_cv_ncurses_h+set}" = set; then
8244   echo $ECHO_N "(cached) $ECHO_C" >&6
8245 else
8246
8247         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8248         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8249         for cf_header in $cf_header_list
8250         do
8251
8252         cat >"conftest.$ac_ext" <<_ACEOF
8253 #line 8253 "configure"
8254 #include "confdefs.h"
8255
8256 #define _XOPEN_SOURCE_EXTENDED
8257 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8258 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8259
8260 #include <$cf_header>
8261 int
8262 main (void)
8263 {
8264
8265 #ifdef NCURSES_VERSION
8266
8267 #ifndef WACS_BSSB
8268         make an error
8269 #endif
8270
8271 printf("%s\\n", NCURSES_VERSION);
8272 #else
8273 #ifdef __NCURSES_H
8274 printf("old\\n");
8275 #else
8276         make an error
8277 #endif
8278 #endif
8279
8280   ;
8281   return 0;
8282 }
8283 _ACEOF
8284 rm -f "conftest.$ac_objext"
8285 if { (eval echo "$as_me:8285: \"$ac_compile\"") >&5
8286   (eval $ac_compile) 2>&5
8287   ac_status=$?
8288   echo "$as_me:8288: \$? = $ac_status" >&5
8289   (exit "$ac_status"); } &&
8290          { ac_try='test -s "conftest.$ac_objext"'
8291   { (eval echo "$as_me:8291: \"$ac_try\"") >&5
8292   (eval $ac_try) 2>&5
8293   ac_status=$?
8294   echo "$as_me:8294: \$? = $ac_status" >&5
8295   (exit "$ac_status"); }; }; then
8296   cf_cv_ncurses_h=$cf_header
8297
8298 else
8299   echo "$as_me: failed program was:" >&5
8300 cat "conftest.$ac_ext" >&5
8301 cf_cv_ncurses_h=no
8302 fi
8303 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8304
8305                 test "$cf_cv_ncurses_h" != no && break
8306         done
8307
8308 fi
8309 echo "$as_me:8309: result: $cf_cv_ncurses_h" >&5
8310 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8311
8312 if test "$cf_cv_ncurses_h" != no ; then
8313         cf_cv_ncurses_header=$cf_cv_ncurses_h
8314 else
8315
8316 echo "$as_me:8316: checking for $cf_ncuhdr_root include-path" >&5
8317 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8318 if test "${cf_cv_ncurses_h2+set}" = set; then
8319   echo $ECHO_N "(cached) $ECHO_C" >&6
8320 else
8321
8322         test -n "$verbose" && echo
8323
8324 cf_search=
8325
8326 # collect the current set of include-directories from compiler flags
8327 cf_header_path_list=""
8328 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8329         for cf_header_path in $CPPFLAGS $CFLAGS
8330         do
8331                 case "$cf_header_path" in
8332                 (-I*)
8333                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8334
8335 test "x$cf_header_path" != "xNONE" && \
8336 test -d "$cf_header_path" && \
8337  {
8338         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8339         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8340         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8341         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8342         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8343         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"
8344 }
8345
8346                         cf_header_path_list="$cf_header_path_list $cf_search"
8347                         ;;
8348                 esac
8349         done
8350 fi
8351
8352 # add the variations for the package we are looking for
8353
8354 cf_search=
8355
8356 test "x$prefix" != "xNONE" && \
8357 test -d "$prefix" && \
8358  {
8359         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8360         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8361         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8362         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8363         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8364         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8365 }
8366
8367 for cf_subdir_prefix in \
8368         /usr \
8369         /usr/local \
8370         /usr/pkg \
8371         /opt \
8372         /opt/local \
8373         $HOME
8374 do
8375
8376 test "x$cf_subdir_prefix" != "x$prefix" && \
8377 test -d "$cf_subdir_prefix" && \
8378 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8379         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8380         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8381         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8382         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8383         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8384         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"
8385 }
8386
8387 done
8388
8389 test "$includedir" != NONE && \
8390 test "$includedir" != "/usr/include" && \
8391 test -d "$includedir" && {
8392         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8393         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8394 }
8395
8396 test "$oldincludedir" != NONE && \
8397 test "$oldincludedir" != "/usr/include" && \
8398 test -d "$oldincludedir" && {
8399         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8400         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8401 }
8402
8403 cf_search="$cf_search $cf_header_path_list"
8404
8405         test -n "$verbose" && echo "search path $cf_search"
8406         cf_save2_CPPFLAGS="$CPPFLAGS"
8407         for cf_incdir in $cf_search
8408         do
8409
8410 if test -n "$cf_incdir" ; then
8411   for cf_add_incdir in $cf_incdir
8412   do
8413         while test "$cf_add_incdir" != /usr/include
8414         do
8415           if test -d "$cf_add_incdir"
8416           then
8417                 cf_have_incdir=no
8418                 if test -n "$CFLAGS$CPPFLAGS" ; then
8419                   # a loop is needed to ensure we can add subdirs of existing dirs
8420                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8421                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8422                           cf_have_incdir=yes; break
8423                         fi
8424                   done
8425                 fi
8426
8427                 if test "$cf_have_incdir" = no ; then
8428                   if test "$cf_add_incdir" = /usr/local/include ; then
8429                         if test "$GCC" = yes
8430                         then
8431                           cf_save_CPPFLAGS=$CPPFLAGS
8432
8433         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8434         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8435
8436                           cat >"conftest.$ac_ext" <<_ACEOF
8437 #line 8437 "configure"
8438 #include "confdefs.h"
8439 #include <stdio.h>
8440 int
8441 main (void)
8442 {
8443 printf("Hello")
8444   ;
8445   return 0;
8446 }
8447 _ACEOF
8448 rm -f "conftest.$ac_objext"
8449 if { (eval echo "$as_me:8449: \"$ac_compile\"") >&5
8450   (eval $ac_compile) 2>&5
8451   ac_status=$?
8452   echo "$as_me:8452: \$? = $ac_status" >&5
8453   (exit "$ac_status"); } &&
8454          { ac_try='test -s "conftest.$ac_objext"'
8455   { (eval echo "$as_me:8455: \"$ac_try\"") >&5
8456   (eval $ac_try) 2>&5
8457   ac_status=$?
8458   echo "$as_me:8458: \$? = $ac_status" >&5
8459   (exit "$ac_status"); }; }; then
8460   :
8461 else
8462   echo "$as_me: failed program was:" >&5
8463 cat "conftest.$ac_ext" >&5
8464 cf_have_incdir=yes
8465 fi
8466 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8467                           CPPFLAGS=$cf_save_CPPFLAGS
8468                         fi
8469                   fi
8470                 fi
8471
8472                 if test "$cf_have_incdir" = no ; then
8473                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8474
8475 echo "${as_me:-configure}:8475: testing adding $cf_add_incdir to include-path ..." 1>&5
8476
8477                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8478
8479                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8480                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8481                   cf_add_incdir="$cf_top_incdir"
8482                 else
8483                   break
8484                 fi
8485           else
8486                 break
8487           fi
8488         done
8489   done
8490 fi
8491
8492                 for cf_header in \
8493                         ncurses.h \
8494                         curses.h
8495                 do
8496
8497         cat >"conftest.$ac_ext" <<_ACEOF
8498 #line 8498 "configure"
8499 #include "confdefs.h"
8500
8501 #include <$cf_header>
8502 int
8503 main (void)
8504 {
8505
8506 #ifdef NCURSES_VERSION
8507
8508 printf("%s\\n", NCURSES_VERSION);
8509 #else
8510 #ifdef __NCURSES_H
8511 printf("old\\n");
8512 #else
8513         make an error
8514 #endif
8515 #endif
8516
8517   ;
8518   return 0;
8519 }
8520 _ACEOF
8521 rm -f "conftest.$ac_objext"
8522 if { (eval echo "$as_me:8522: \"$ac_compile\"") >&5
8523   (eval $ac_compile) 2>&5
8524   ac_status=$?
8525   echo "$as_me:8525: \$? = $ac_status" >&5
8526   (exit "$ac_status"); } &&
8527          { ac_try='test -s "conftest.$ac_objext"'
8528   { (eval echo "$as_me:8528: \"$ac_try\"") >&5
8529   (eval $ac_try) 2>&5
8530   ac_status=$?
8531   echo "$as_me:8531: \$? = $ac_status" >&5
8532   (exit "$ac_status"); }; }; then
8533   cf_cv_ncurses_h2=$cf_header
8534
8535 else
8536   echo "$as_me: failed program was:" >&5
8537 cat "conftest.$ac_ext" >&5
8538 cf_cv_ncurses_h2=no
8539 fi
8540 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8541
8542                         if test "$cf_cv_ncurses_h2" != no ; then
8543                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8544                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8545                                 break
8546                         fi
8547                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8548                 done
8549                 CPPFLAGS="$cf_save2_CPPFLAGS"
8550                 test "$cf_cv_ncurses_h2" != no && break
8551         done
8552         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8552: error: not found" >&5
8553 echo "$as_me: error: not found" >&2;}
8554    { (exit 1); exit 1; }; }
8555
8556 fi
8557 echo "$as_me:8557: result: $cf_cv_ncurses_h2" >&5
8558 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8559
8560         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8561         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8562         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8563                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8564         fi
8565
8566 if test -n "$cf_1st_incdir" ; then
8567   for cf_add_incdir in $cf_1st_incdir
8568   do
8569         while test "$cf_add_incdir" != /usr/include
8570         do
8571           if test -d "$cf_add_incdir"
8572           then
8573                 cf_have_incdir=no
8574                 if test -n "$CFLAGS$CPPFLAGS" ; then
8575                   # a loop is needed to ensure we can add subdirs of existing dirs
8576                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8577                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8578                           cf_have_incdir=yes; break
8579                         fi
8580                   done
8581                 fi
8582
8583                 if test "$cf_have_incdir" = no ; then
8584                   if test "$cf_add_incdir" = /usr/local/include ; then
8585                         if test "$GCC" = yes
8586                         then
8587                           cf_save_CPPFLAGS=$CPPFLAGS
8588
8589         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8590         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8591
8592                           cat >"conftest.$ac_ext" <<_ACEOF
8593 #line 8593 "configure"
8594 #include "confdefs.h"
8595 #include <stdio.h>
8596 int
8597 main (void)
8598 {
8599 printf("Hello")
8600   ;
8601   return 0;
8602 }
8603 _ACEOF
8604 rm -f "conftest.$ac_objext"
8605 if { (eval echo "$as_me:8605: \"$ac_compile\"") >&5
8606   (eval $ac_compile) 2>&5
8607   ac_status=$?
8608   echo "$as_me:8608: \$? = $ac_status" >&5
8609   (exit "$ac_status"); } &&
8610          { ac_try='test -s "conftest.$ac_objext"'
8611   { (eval echo "$as_me:8611: \"$ac_try\"") >&5
8612   (eval $ac_try) 2>&5
8613   ac_status=$?
8614   echo "$as_me:8614: \$? = $ac_status" >&5
8615   (exit "$ac_status"); }; }; then
8616   :
8617 else
8618   echo "$as_me: failed program was:" >&5
8619 cat "conftest.$ac_ext" >&5
8620 cf_have_incdir=yes
8621 fi
8622 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8623                           CPPFLAGS=$cf_save_CPPFLAGS
8624                         fi
8625                   fi
8626                 fi
8627
8628                 if test "$cf_have_incdir" = no ; then
8629                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8630
8631 echo "${as_me:-configure}:8631: testing adding $cf_add_incdir to include-path ..." 1>&5
8632
8633                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8634
8635                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8636                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8637                   cf_add_incdir="$cf_top_incdir"
8638                 else
8639                   break
8640                 fi
8641           else
8642                 break
8643           fi
8644         done
8645   done
8646 fi
8647
8648 fi
8649
8650 # Set definitions to allow ifdef'ing for ncurses.h
8651
8652 case "$cf_cv_ncurses_header" in
8653 (*ncurses.h)
8654
8655 cat >>confdefs.h <<\EOF
8656 #define HAVE_NCURSES_H 1
8657 EOF
8658
8659         ;;
8660 esac
8661
8662 case "$cf_cv_ncurses_header" in
8663 (ncurses/curses.h|ncurses/ncurses.h)
8664
8665 cat >>confdefs.h <<\EOF
8666 #define HAVE_NCURSES_NCURSES_H 1
8667 EOF
8668
8669         ;;
8670 (ncursesw/curses.h|ncursesw/ncurses.h)
8671
8672 cat >>confdefs.h <<\EOF
8673 #define HAVE_NCURSESW_NCURSES_H 1
8674 EOF
8675
8676         ;;
8677 esac
8678
8679 echo "$as_me:8679: checking for terminfo header" >&5
8680 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8681 if test "${cf_cv_term_header+set}" = set; then
8682   echo $ECHO_N "(cached) $ECHO_C" >&6
8683 else
8684
8685 case "${cf_cv_ncurses_header}" in
8686 (*/ncurses.h|*/ncursesw.h)
8687         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8688         ;;
8689 (*)
8690         cf_term_header=term.h
8691         ;;
8692 esac
8693
8694 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8695 do
8696 cat >"conftest.$ac_ext" <<_ACEOF
8697 #line 8697 "configure"
8698 #include "confdefs.h"
8699 #include <stdio.h>
8700 #include <${cf_cv_ncurses_header:-curses.h}>
8701 #include <$cf_test>
8702
8703 int
8704 main (void)
8705 {
8706 int x = auto_left_margin; (void)x
8707   ;
8708   return 0;
8709 }
8710 _ACEOF
8711 rm -f "conftest.$ac_objext"
8712 if { (eval echo "$as_me:8712: \"$ac_compile\"") >&5
8713   (eval $ac_compile) 2>&5
8714   ac_status=$?
8715   echo "$as_me:8715: \$? = $ac_status" >&5
8716   (exit "$ac_status"); } &&
8717          { ac_try='test -s "conftest.$ac_objext"'
8718   { (eval echo "$as_me:8718: \"$ac_try\"") >&5
8719   (eval $ac_try) 2>&5
8720   ac_status=$?
8721   echo "$as_me:8721: \$? = $ac_status" >&5
8722   (exit "$ac_status"); }; }; then
8723
8724         cf_cv_term_header="$cf_test"
8725 else
8726   echo "$as_me: failed program was:" >&5
8727 cat "conftest.$ac_ext" >&5
8728
8729         cf_cv_term_header=unknown
8730
8731 fi
8732 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8733         test "$cf_cv_term_header" != unknown && break
8734 done
8735
8736 fi
8737 echo "$as_me:8737: result: $cf_cv_term_header" >&5
8738 echo "${ECHO_T}$cf_cv_term_header" >&6
8739
8740 # Set definitions to allow ifdef'ing to accommodate subdirectories
8741
8742 case "$cf_cv_term_header" in
8743 (*term.h)
8744
8745 cat >>confdefs.h <<\EOF
8746 #define HAVE_TERM_H 1
8747 EOF
8748
8749         ;;
8750 esac
8751
8752 case "$cf_cv_term_header" in
8753 (ncurses/term.h)
8754
8755 cat >>confdefs.h <<\EOF
8756 #define HAVE_NCURSES_TERM_H 1
8757 EOF
8758
8759         ;;
8760 (ncursesw/term.h)
8761
8762 cat >>confdefs.h <<\EOF
8763 #define HAVE_NCURSESW_TERM_H 1
8764 EOF
8765
8766         ;;
8767 esac
8768
8769 # some applications need this, but should check for NCURSES_VERSION
8770
8771 cat >>confdefs.h <<\EOF
8772 #define NCURSES 1
8773 EOF
8774
8775 echo "$as_me:8775: checking for ncurses version" >&5
8776 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8777 if test "${cf_cv_ncurses_version+set}" = set; then
8778   echo $ECHO_N "(cached) $ECHO_C" >&6
8779 else
8780
8781         cf_cv_ncurses_version=no
8782         cf_tempfile=out$$
8783         rm -f "$cf_tempfile"
8784         if test "$cross_compiling" = yes; then
8785
8786         # This will not work if the preprocessor splits the line after the
8787         # Autoconf token.  The 'unproto' program does that.
8788         cat > "conftest.$ac_ext" <<EOF
8789 #include <${cf_cv_ncurses_header:-curses.h}>
8790 #undef Autoconf
8791 #ifdef NCURSES_VERSION
8792 Autoconf NCURSES_VERSION
8793 #else
8794 #ifdef __NCURSES_H
8795 Autoconf "old"
8796 #endif
8797 ;
8798 #endif
8799 EOF
8800         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8801         { (eval echo "$as_me:8801: \"$cf_try\"") >&5
8802   (eval $cf_try) 2>&5
8803   ac_status=$?
8804   echo "$as_me:8804: \$? = $ac_status" >&5
8805   (exit "$ac_status"); }
8806         if test -f conftest.out ; then
8807                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8808                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8809                 rm -f conftest.out
8810         fi
8811
8812 else
8813   cat >"conftest.$ac_ext" <<_ACEOF
8814 #line 8814 "configure"
8815 #include "confdefs.h"
8816
8817 $ac_includes_default
8818
8819 #include <${cf_cv_ncurses_header:-curses.h}>
8820
8821 int main(void)
8822 {
8823         FILE *fp = fopen("$cf_tempfile", "w");
8824 #ifdef NCURSES_VERSION
8825 # ifdef NCURSES_VERSION_PATCH
8826         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8827 # else
8828         fprintf(fp, "%s\\n", NCURSES_VERSION);
8829 # endif
8830 #else
8831 # ifdef __NCURSES_H
8832         fprintf(fp, "old\\n");
8833 # else
8834         make an error
8835 # endif
8836 #endif
8837         ${cf_cv_main_return:-return}(0);
8838 }
8839 _ACEOF
8840 rm -f "conftest$ac_exeext"
8841 if { (eval echo "$as_me:8841: \"$ac_link\"") >&5
8842   (eval $ac_link) 2>&5
8843   ac_status=$?
8844   echo "$as_me:8844: \$? = $ac_status" >&5
8845   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8846   { (eval echo "$as_me:8846: \"$ac_try\"") >&5
8847   (eval $ac_try) 2>&5
8848   ac_status=$?
8849   echo "$as_me:8849: \$? = $ac_status" >&5
8850   (exit "$ac_status"); }; }; then
8851
8852         cf_cv_ncurses_version=`cat $cf_tempfile`
8853 else
8854   echo "$as_me: program exited with status $ac_status" >&5
8855 echo "$as_me: failed program was:" >&5
8856 cat "conftest.$ac_ext" >&5
8857 fi
8858 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8859 fi
8860         rm -f "$cf_tempfile"
8861
8862 fi
8863 echo "$as_me:8863: result: $cf_cv_ncurses_version" >&5
8864 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8865 test "$cf_cv_ncurses_version" = no ||
8866 cat >>confdefs.h <<\EOF
8867 #define NCURSES 1
8868 EOF
8869
8870 cf_nculib_root=ncursesw
8871         # This works, except for the special case where we find gpm, but
8872         # ncurses is in a nonstandard location via $LIBS, and we really want
8873         # to link gpm.
8874 cf_ncurses_LIBS=""
8875 cf_ncurses_SAVE="$LIBS"
8876 echo "$as_me:8876: checking for Gpm_Open in -lgpm" >&5
8877 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8878 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8879   echo $ECHO_N "(cached) $ECHO_C" >&6
8880 else
8881   ac_check_lib_save_LIBS=$LIBS
8882 LIBS="-lgpm  $LIBS"
8883 cat >"conftest.$ac_ext" <<_ACEOF
8884 #line 8884 "configure"
8885 #include "confdefs.h"
8886
8887 /* Override any gcc2 internal prototype to avoid an error.  */
8888 #ifdef __cplusplus
8889 extern "C"
8890 #endif
8891 /* We use char because int might match the return type of a gcc2
8892    builtin and then its argument prototype would still apply.  */
8893 char Gpm_Open ();
8894 int
8895 main (void)
8896 {
8897 Gpm_Open ();
8898   ;
8899   return 0;
8900 }
8901 _ACEOF
8902 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8903 if { (eval echo "$as_me:8903: \"$ac_link\"") >&5
8904   (eval $ac_link) 2>&5
8905   ac_status=$?
8906   echo "$as_me:8906: \$? = $ac_status" >&5
8907   (exit "$ac_status"); } &&
8908          { ac_try='test -s "conftest$ac_exeext"'
8909   { (eval echo "$as_me:8909: \"$ac_try\"") >&5
8910   (eval $ac_try) 2>&5
8911   ac_status=$?
8912   echo "$as_me:8912: \$? = $ac_status" >&5
8913   (exit "$ac_status"); }; }; then
8914   ac_cv_lib_gpm_Gpm_Open=yes
8915 else
8916   echo "$as_me: failed program was:" >&5
8917 cat "conftest.$ac_ext" >&5
8918 ac_cv_lib_gpm_Gpm_Open=no
8919 fi
8920 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8921 LIBS=$ac_check_lib_save_LIBS
8922 fi
8923 echo "$as_me:8923: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8924 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8925 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8926   echo "$as_me:8926: checking for initscr in -lgpm" >&5
8927 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8928 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8929   echo $ECHO_N "(cached) $ECHO_C" >&6
8930 else
8931   ac_check_lib_save_LIBS=$LIBS
8932 LIBS="-lgpm  $LIBS"
8933 cat >"conftest.$ac_ext" <<_ACEOF
8934 #line 8934 "configure"
8935 #include "confdefs.h"
8936
8937 /* Override any gcc2 internal prototype to avoid an error.  */
8938 #ifdef __cplusplus
8939 extern "C"
8940 #endif
8941 /* We use char because int might match the return type of a gcc2
8942    builtin and then its argument prototype would still apply.  */
8943 char initscr ();
8944 int
8945 main (void)
8946 {
8947 initscr ();
8948   ;
8949   return 0;
8950 }
8951 _ACEOF
8952 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8953 if { (eval echo "$as_me:8953: \"$ac_link\"") >&5
8954   (eval $ac_link) 2>&5
8955   ac_status=$?
8956   echo "$as_me:8956: \$? = $ac_status" >&5
8957   (exit "$ac_status"); } &&
8958          { ac_try='test -s "conftest$ac_exeext"'
8959   { (eval echo "$as_me:8959: \"$ac_try\"") >&5
8960   (eval $ac_try) 2>&5
8961   ac_status=$?
8962   echo "$as_me:8962: \$? = $ac_status" >&5
8963   (exit "$ac_status"); }; }; then
8964   ac_cv_lib_gpm_initscr=yes
8965 else
8966   echo "$as_me: failed program was:" >&5
8967 cat "conftest.$ac_ext" >&5
8968 ac_cv_lib_gpm_initscr=no
8969 fi
8970 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8971 LIBS=$ac_check_lib_save_LIBS
8972 fi
8973 echo "$as_me:8973: result: $ac_cv_lib_gpm_initscr" >&5
8974 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8975 if test "$ac_cv_lib_gpm_initscr" = yes; then
8976   LIBS="$cf_ncurses_SAVE"
8977 else
8978   cf_ncurses_LIBS="-lgpm"
8979 fi
8980
8981 fi
8982
8983 case "$host_os" in
8984 (freebsd*)
8985         # This is only necessary if you are linking against an obsolete
8986         # version of ncurses (but it should do no harm, since it is static).
8987         if test "$cf_nculib_root" = ncurses ; then
8988                 echo "$as_me:8988: checking for tgoto in -lmytinfo" >&5
8989 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8990 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8991   echo $ECHO_N "(cached) $ECHO_C" >&6
8992 else
8993   ac_check_lib_save_LIBS=$LIBS
8994 LIBS="-lmytinfo  $LIBS"
8995 cat >"conftest.$ac_ext" <<_ACEOF
8996 #line 8996 "configure"
8997 #include "confdefs.h"
8998
8999 /* Override any gcc2 internal prototype to avoid an error.  */
9000 #ifdef __cplusplus
9001 extern "C"
9002 #endif
9003 /* We use char because int might match the return type of a gcc2
9004    builtin and then its argument prototype would still apply.  */
9005 char tgoto ();
9006 int
9007 main (void)
9008 {
9009 tgoto ();
9010   ;
9011   return 0;
9012 }
9013 _ACEOF
9014 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9015 if { (eval echo "$as_me:9015: \"$ac_link\"") >&5
9016   (eval $ac_link) 2>&5
9017   ac_status=$?
9018   echo "$as_me:9018: \$? = $ac_status" >&5
9019   (exit "$ac_status"); } &&
9020          { ac_try='test -s "conftest$ac_exeext"'
9021   { (eval echo "$as_me:9021: \"$ac_try\"") >&5
9022   (eval $ac_try) 2>&5
9023   ac_status=$?
9024   echo "$as_me:9024: \$? = $ac_status" >&5
9025   (exit "$ac_status"); }; }; then
9026   ac_cv_lib_mytinfo_tgoto=yes
9027 else
9028   echo "$as_me: failed program was:" >&5
9029 cat "conftest.$ac_ext" >&5
9030 ac_cv_lib_mytinfo_tgoto=no
9031 fi
9032 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9033 LIBS=$ac_check_lib_save_LIBS
9034 fi
9035 echo "$as_me:9035: result: $ac_cv_lib_mytinfo_tgoto" >&5
9036 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9037 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9038   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9039 fi
9040
9041         fi
9042         ;;
9043 esac
9044
9045 cf_add_libs="$LIBS"
9046 # reverse order
9047 cf_add_0lib=
9048 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9049 # filter duplicates
9050 for cf_add_1lib in $cf_add_0lib; do
9051         for cf_add_2lib in $cf_add_libs; do
9052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9053                         cf_add_1lib=
9054                         break
9055                 fi
9056         done
9057         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9058 done
9059 LIBS="$cf_add_libs"
9060
9061 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9062 then
9063
9064 cf_add_libs="$LIBS"
9065 # reverse order
9066 cf_add_0lib=
9067 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9068 # filter duplicates
9069 for cf_add_1lib in $cf_add_0lib; do
9070         for cf_add_2lib in $cf_add_libs; do
9071                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9072                         cf_add_1lib=
9073                         break
9074                 fi
9075         done
9076         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9077 done
9078 LIBS="$cf_add_libs"
9079
9080 else
9081
9082         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9083         cf_libdir=""
9084         echo "$as_me:9084: checking for initscr" >&5
9085 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9086 if test "${ac_cv_func_initscr+set}" = set; then
9087   echo $ECHO_N "(cached) $ECHO_C" >&6
9088 else
9089   cat >"conftest.$ac_ext" <<_ACEOF
9090 #line 9090 "configure"
9091 #include "confdefs.h"
9092 #define initscr autoconf_temporary
9093 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9094 #undef initscr
9095
9096 #ifdef __cplusplus
9097 extern "C"
9098 #endif
9099
9100 /* We use char because int might match the return type of a gcc2
9101    builtin and then its argument prototype would still apply.  */
9102 char initscr (void);
9103
9104 int
9105 main (void)
9106 {
9107
9108 /* The GNU C library defines stubs for functions which it implements
9109     to always fail with ENOSYS.  Some functions are actually named
9110     something starting with __ and the normal name is an alias.  */
9111 #if defined (__stub_initscr) || defined (__stub___initscr)
9112 #error found stub for initscr
9113 #endif
9114
9115         return initscr ();
9116   ;
9117   return 0;
9118 }
9119 _ACEOF
9120 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9121 if { (eval echo "$as_me:9121: \"$ac_link\"") >&5
9122   (eval $ac_link) 2>&5
9123   ac_status=$?
9124   echo "$as_me:9124: \$? = $ac_status" >&5
9125   (exit "$ac_status"); } &&
9126          { ac_try='test -s "conftest$ac_exeext"'
9127   { (eval echo "$as_me:9127: \"$ac_try\"") >&5
9128   (eval $ac_try) 2>&5
9129   ac_status=$?
9130   echo "$as_me:9130: \$? = $ac_status" >&5
9131   (exit "$ac_status"); }; }; then
9132   ac_cv_func_initscr=yes
9133 else
9134   echo "$as_me: failed program was:" >&5
9135 cat "conftest.$ac_ext" >&5
9136 ac_cv_func_initscr=no
9137 fi
9138 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9139 fi
9140 echo "$as_me:9140: result: $ac_cv_func_initscr" >&5
9141 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9142 if test "$ac_cv_func_initscr" = yes; then
9143   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9144 else
9145
9146                 cf_save_LIBS="$LIBS"
9147                 echo "$as_me:9147: checking for initscr in -l$cf_nculib_root" >&5
9148 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9149                 LIBS="-l$cf_nculib_root $LIBS"
9150                 cat >"conftest.$ac_ext" <<_ACEOF
9151 #line 9151 "configure"
9152 #include "confdefs.h"
9153 #include <${cf_cv_ncurses_header:-curses.h}>
9154 int
9155 main (void)
9156 {
9157 initscr()
9158   ;
9159   return 0;
9160 }
9161 _ACEOF
9162 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9163 if { (eval echo "$as_me:9163: \"$ac_link\"") >&5
9164   (eval $ac_link) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit "$ac_status"); } &&
9168          { ac_try='test -s "conftest$ac_exeext"'
9169   { (eval echo "$as_me:9169: \"$ac_try\"") >&5
9170   (eval $ac_try) 2>&5
9171   ac_status=$?
9172   echo "$as_me:9172: \$? = $ac_status" >&5
9173   (exit "$ac_status"); }; }; then
9174   echo "$as_me:9174: result: yes" >&5
9175 echo "${ECHO_T}yes" >&6
9176                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9177
9178 else
9179   echo "$as_me: failed program was:" >&5
9180 cat "conftest.$ac_ext" >&5
9181 echo "$as_me:9181: result: no" >&5
9182 echo "${ECHO_T}no" >&6
9183
9184 cf_search=
9185 cf_library_path_list=""
9186 if test -n "${LDFLAGS}${LIBS}" ; then
9187         for cf_library_path in $LDFLAGS $LIBS
9188         do
9189                 case "$cf_library_path" in
9190                 (-L*)
9191                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9192
9193 test "x$cf_library_path" != "xNONE" && \
9194 test -d "$cf_library_path" && \
9195  {
9196         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9197         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9198         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9199         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9200         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9201         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"
9202 }
9203
9204                         cf_library_path_list="$cf_library_path_list $cf_search"
9205                         ;;
9206                 esac
9207         done
9208 fi
9209
9210 cf_search=
9211
9212 test "x$prefix" != "xNONE" && \
9213 test -d "$prefix" && \
9214  {
9215         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9216         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9217         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9218         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9219         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9220         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9221 }
9222
9223 for cf_subdir_prefix in \
9224         /usr \
9225         /usr/local \
9226         /usr/pkg \
9227         /opt \
9228         /opt/local \
9229         $HOME
9230 do
9231
9232 test "x$cf_subdir_prefix" != "x$prefix" && \
9233 test -d "$cf_subdir_prefix" && \
9234 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9235         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9236         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9237         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9238         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9239         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9240         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"
9241 }
9242
9243 done
9244
9245 cf_search="$cf_library_path_list $cf_search"
9246
9247                         for cf_libdir in $cf_search
9248                         do
9249                                 echo "$as_me:9249: checking for -l$cf_nculib_root in $cf_libdir" >&5
9250 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9251                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9252                                 cat >"conftest.$ac_ext" <<_ACEOF
9253 #line 9253 "configure"
9254 #include "confdefs.h"
9255 #include <${cf_cv_ncurses_header:-curses.h}>
9256 int
9257 main (void)
9258 {
9259 initscr()
9260   ;
9261   return 0;
9262 }
9263 _ACEOF
9264 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9265 if { (eval echo "$as_me:9265: \"$ac_link\"") >&5
9266   (eval $ac_link) 2>&5
9267   ac_status=$?
9268   echo "$as_me:9268: \$? = $ac_status" >&5
9269   (exit "$ac_status"); } &&
9270          { ac_try='test -s "conftest$ac_exeext"'
9271   { (eval echo "$as_me:9271: \"$ac_try\"") >&5
9272   (eval $ac_try) 2>&5
9273   ac_status=$?
9274   echo "$as_me:9274: \$? = $ac_status" >&5
9275   (exit "$ac_status"); }; }; then
9276   echo "$as_me:9276: result: yes" >&5
9277 echo "${ECHO_T}yes" >&6
9278                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9279                                          break
9280 else
9281   echo "$as_me: failed program was:" >&5
9282 cat "conftest.$ac_ext" >&5
9283 echo "$as_me:9283: result: no" >&5
9284 echo "${ECHO_T}no" >&6
9285                                          LIBS="$cf_save_LIBS"
9286 fi
9287 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9288                         done
9289
9290 fi
9291 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9292
9293 fi
9294
9295 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9296
9297 if test "$cf_found_library" = no ; then
9298         { { echo "$as_me:9298: error: Cannot link $cf_nculib_root library" >&5
9299 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9300    { (exit 1); exit 1; }; }
9301 fi
9302
9303 fi
9304
9305 if test -n "$cf_ncurses_LIBS" ; then
9306         echo "$as_me:9306: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9307 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9308         cf_ncurses_SAVE="$LIBS"
9309         for p in $cf_ncurses_LIBS ; do
9310                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9311                 if test "$q" != "$LIBS" ; then
9312                         LIBS="$q"
9313                 fi
9314         done
9315         cat >"conftest.$ac_ext" <<_ACEOF
9316 #line 9316 "configure"
9317 #include "confdefs.h"
9318 #include <${cf_cv_ncurses_header:-curses.h}>
9319 int
9320 main (void)
9321 {
9322 initscr(); mousemask(0,0); tigetstr((char *)0);
9323   ;
9324   return 0;
9325 }
9326 _ACEOF
9327 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9328 if { (eval echo "$as_me:9328: \"$ac_link\"") >&5
9329   (eval $ac_link) 2>&5
9330   ac_status=$?
9331   echo "$as_me:9331: \$? = $ac_status" >&5
9332   (exit "$ac_status"); } &&
9333          { ac_try='test -s "conftest$ac_exeext"'
9334   { (eval echo "$as_me:9334: \"$ac_try\"") >&5
9335   (eval $ac_try) 2>&5
9336   ac_status=$?
9337   echo "$as_me:9337: \$? = $ac_status" >&5
9338   (exit "$ac_status"); }; }; then
9339   echo "$as_me:9339: result: yes" >&5
9340 echo "${ECHO_T}yes" >&6
9341 else
9342   echo "$as_me: failed program was:" >&5
9343 cat "conftest.$ac_ext" >&5
9344 echo "$as_me:9344: result: no" >&5
9345 echo "${ECHO_T}no" >&6
9346                  LIBS="$cf_ncurses_SAVE"
9347 fi
9348 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9349 fi
9350
9351 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9352
9353 cat >>confdefs.h <<EOF
9354 #define $cf_nculib_ROOT 1
9355 EOF
9356
9357         fi
9358 else
9359         NCURSES_CONFIG=none
9360 fi
9361
9362 else
9363
9364 cf_ncuconfig_root=ncurses
9365 cf_have_ncuconfig=no
9366
9367 if test "x${PKG_CONFIG:=none}" != xnone; then
9368         echo "$as_me:9368: checking pkg-config for $cf_ncuconfig_root" >&5
9369 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9370         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9371                 echo "$as_me:9371: result: yes" >&5
9372 echo "${ECHO_T}yes" >&6
9373
9374                 echo "$as_me:9374: checking if the $cf_ncuconfig_root package files work" >&5
9375 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9376                 cf_have_ncuconfig=unknown
9377
9378                 cf_save_CFLAGS="$CFLAGS"
9379                 cf_save_CPPFLAGS="$CPPFLAGS"
9380                 cf_save_LIBS="$LIBS"
9381
9382                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9383                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9384
9385                 # while -W for passing linker flags is prevalent, it is not "standard".
9386                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9387                 # incompatible _and_ non-standard -W option which gives an error.  Work
9388                 # around that pitfall.
9389                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9390                 (x*c[89]9@@*-W*)
9391
9392 cf_fix_cppflags=no
9393 cf_new_cflags=
9394 cf_new_cppflags=
9395 cf_new_extra_cppflags=
9396
9397 for cf_add_cflags in $cf_pkg_cflags
9398 do
9399 case "$cf_fix_cppflags" in
9400 (no)
9401         case "$cf_add_cflags" in
9402         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9403                 case "$cf_add_cflags" in
9404                 (-D*)
9405                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9406
9407                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9408                                 && test -z "${cf_tst_cflags}" \
9409                                 && cf_fix_cppflags=yes
9410
9411                         if test "$cf_fix_cppflags" = yes ; then
9412
9413         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9414         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9415
9416                                 continue
9417                         elif test "${cf_tst_cflags}" = "\"'" ; then
9418
9419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9421
9422                                 continue
9423                         fi
9424                         ;;
9425                 esac
9426                 case "$CPPFLAGS" in
9427                 (*$cf_add_cflags)
9428                         ;;
9429                 (*)
9430                         case "$cf_add_cflags" in
9431                         (-D*)
9432                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9433
9434 CPPFLAGS=`echo "$CPPFLAGS" | \
9435         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9436                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9437
9438                                 ;;
9439                         esac
9440
9441         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9442         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9443
9444                         ;;
9445                 esac
9446                 ;;
9447         (*)
9448
9449         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9450         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9451
9452                 ;;
9453         esac
9454         ;;
9455 (yes)
9456
9457         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9458         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9459
9460         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9461
9462         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9463                 && test -z "${cf_tst_cflags}" \
9464                 && cf_fix_cppflags=no
9465         ;;
9466 esac
9467 done
9468
9469 if test -n "$cf_new_cflags" ; then
9470
9471         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9472         CFLAGS="${CFLAGS}$cf_new_cflags"
9473
9474 fi
9475
9476 if test -n "$cf_new_cppflags" ; then
9477
9478         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9479         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9480
9481 fi
9482
9483 if test -n "$cf_new_extra_cppflags" ; then
9484
9485         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9486         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9487
9488 fi
9489
9490 cf_add_libs="$LIBS"
9491 # reverse order
9492 cf_add_0lib=
9493 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9494 # filter duplicates
9495 for cf_add_1lib in $cf_add_0lib; do
9496         for cf_add_2lib in $cf_add_libs; do
9497                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9498                         cf_add_1lib=
9499                         break
9500                 fi
9501         done
9502         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9503 done
9504 LIBS="$cf_add_libs"
9505
9506                         cat >"conftest.$ac_ext" <<_ACEOF
9507 #line 9507 "configure"
9508 #include "confdefs.h"
9509 #include <${cf_cv_ncurses_header:-curses.h}>
9510 int
9511 main (void)
9512 {
9513 initscr(); mousemask(0,0); tigetstr((char *)0);
9514   ;
9515   return 0;
9516 }
9517 _ACEOF
9518 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9519 if { (eval echo "$as_me:9519: \"$ac_link\"") >&5
9520   (eval $ac_link) 2>&5
9521   ac_status=$?
9522   echo "$as_me:9522: \$? = $ac_status" >&5
9523   (exit "$ac_status"); } &&
9524          { ac_try='test -s "conftest$ac_exeext"'
9525   { (eval echo "$as_me:9525: \"$ac_try\"") >&5
9526   (eval $ac_try) 2>&5
9527   ac_status=$?
9528   echo "$as_me:9528: \$? = $ac_status" >&5
9529   (exit "$ac_status"); }; }; then
9530   if test "$cross_compiling" = yes; then
9531   cf_test_ncuconfig=maybe
9532 else
9533   cat >"conftest.$ac_ext" <<_ACEOF
9534 #line 9534 "configure"
9535 #include "confdefs.h"
9536 #include <${cf_cv_ncurses_header:-curses.h}>
9537                                         int main(void)
9538                                         { const char *xx = curses_version(); return (xx == 0); }
9539 _ACEOF
9540 rm -f "conftest$ac_exeext"
9541 if { (eval echo "$as_me:9541: \"$ac_link\"") >&5
9542   (eval $ac_link) 2>&5
9543   ac_status=$?
9544   echo "$as_me:9544: \$? = $ac_status" >&5
9545   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9546   { (eval echo "$as_me:9546: \"$ac_try\"") >&5
9547   (eval $ac_try) 2>&5
9548   ac_status=$?
9549   echo "$as_me:9549: \$? = $ac_status" >&5
9550   (exit "$ac_status"); }; }; then
9551   cf_test_ncuconfig=yes
9552 else
9553   echo "$as_me: program exited with status $ac_status" >&5
9554 echo "$as_me: failed program was:" >&5
9555 cat "conftest.$ac_ext" >&5
9556 cf_test_ncuconfig=no
9557 fi
9558 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9559 fi
9560 else
9561   echo "$as_me: failed program was:" >&5
9562 cat "conftest.$ac_ext" >&5
9563 cf_test_ncuconfig=no
9564 fi
9565 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9566
9567                         CFLAGS="$cf_save_CFLAGS"
9568                         CPPFLAGS="$cf_save_CPPFLAGS"
9569                         LIBS="$cf_save_LIBS"
9570
9571                         if test "x$cf_test_ncuconfig" != xyes; then
9572                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9573                                 cf_pkg_cflags="$cf_temp"
9574                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9575                                 cf_pkg_libs="$cf_temp"
9576                         fi
9577                         ;;
9578                 esac
9579
9580 for cf_add_cflags in $cf_pkg_cflags
9581 do
9582         case "x$cf_add_cflags" in
9583         (x-[DU]*)
9584
9585 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9586 while true
9587 do
9588         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9589         test "$CFLAGS" != "$cf_old_cflag" || break
9590
9591         CFLAGS="$cf_old_cflag"
9592 done
9593
9594 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9595 while true
9596 do
9597         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9598         test "$CPPFLAGS" != "$cf_old_cflag" || break
9599
9600         CPPFLAGS="$cf_old_cflag"
9601 done
9602
9603                 ;;
9604         esac
9605
9606 cf_fix_cppflags=no
9607 cf_new_cflags=
9608 cf_new_cppflags=
9609 cf_new_extra_cppflags=
9610
9611 for cf_add_cflags in $cf_add_cflags
9612 do
9613 case "$cf_fix_cppflags" in
9614 (no)
9615         case "$cf_add_cflags" in
9616         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9617                 case "$cf_add_cflags" in
9618                 (-D*)
9619                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9620
9621                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9622                                 && test -z "${cf_tst_cflags}" \
9623                                 && cf_fix_cppflags=yes
9624
9625                         if test "$cf_fix_cppflags" = yes ; then
9626
9627         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9628         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9629
9630                                 continue
9631                         elif test "${cf_tst_cflags}" = "\"'" ; then
9632
9633         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9634         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9635
9636                                 continue
9637                         fi
9638                         ;;
9639                 esac
9640                 case "$CPPFLAGS" in
9641                 (*$cf_add_cflags)
9642                         ;;
9643                 (*)
9644                         case "$cf_add_cflags" in
9645                         (-D*)
9646                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9647
9648 CPPFLAGS=`echo "$CPPFLAGS" | \
9649         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9650                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9651
9652                                 ;;
9653                         esac
9654
9655         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9656         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9657
9658                         ;;
9659                 esac
9660                 ;;
9661         (*)
9662
9663         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9664         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9665
9666                 ;;
9667         esac
9668         ;;
9669 (yes)
9670
9671         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9672         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9673
9674         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9675
9676         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9677                 && test -z "${cf_tst_cflags}" \
9678                 && cf_fix_cppflags=no
9679         ;;
9680 esac
9681 done
9682
9683 if test -n "$cf_new_cflags" ; then
9684
9685         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9686         CFLAGS="${CFLAGS}$cf_new_cflags"
9687
9688 fi
9689
9690 if test -n "$cf_new_cppflags" ; then
9691
9692         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9693         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9694
9695 fi
9696
9697 if test -n "$cf_new_extra_cppflags" ; then
9698
9699         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9700         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9701
9702 fi
9703
9704 done
9705
9706 cf_add_libs="$LIBS"
9707 # reverse order
9708 cf_add_0lib=
9709 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9710 # filter duplicates
9711 for cf_add_1lib in $cf_add_0lib; do
9712         for cf_add_2lib in $cf_add_libs; do
9713                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9714                         cf_add_1lib=
9715                         break
9716                 fi
9717         done
9718         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9719 done
9720 LIBS="$cf_add_libs"
9721
9722                 cat >"conftest.$ac_ext" <<_ACEOF
9723 #line 9723 "configure"
9724 #include "confdefs.h"
9725 #include <${cf_cv_ncurses_header:-curses.h}>
9726 int
9727 main (void)
9728 {
9729 initscr(); mousemask(0,0); tigetstr((char *)0);
9730   ;
9731   return 0;
9732 }
9733 _ACEOF
9734 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9735 if { (eval echo "$as_me:9735: \"$ac_link\"") >&5
9736   (eval $ac_link) 2>&5
9737   ac_status=$?
9738   echo "$as_me:9738: \$? = $ac_status" >&5
9739   (exit "$ac_status"); } &&
9740          { ac_try='test -s "conftest$ac_exeext"'
9741   { (eval echo "$as_me:9741: \"$ac_try\"") >&5
9742   (eval $ac_try) 2>&5
9743   ac_status=$?
9744   echo "$as_me:9744: \$? = $ac_status" >&5
9745   (exit "$ac_status"); }; }; then
9746   if test "$cross_compiling" = yes; then
9747   cf_have_ncuconfig=maybe
9748 else
9749   cat >"conftest.$ac_ext" <<_ACEOF
9750 #line 9750 "configure"
9751 #include "confdefs.h"
9752 #include <${cf_cv_ncurses_header:-curses.h}>
9753                                 int main(void)
9754                                 { const char *xx = curses_version(); return (xx == 0); }
9755 _ACEOF
9756 rm -f "conftest$ac_exeext"
9757 if { (eval echo "$as_me:9757: \"$ac_link\"") >&5
9758   (eval $ac_link) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9762   { (eval echo "$as_me:9762: \"$ac_try\"") >&5
9763   (eval $ac_try) 2>&5
9764   ac_status=$?
9765   echo "$as_me:9765: \$? = $ac_status" >&5
9766   (exit "$ac_status"); }; }; then
9767   cf_have_ncuconfig=yes
9768 else
9769   echo "$as_me: program exited with status $ac_status" >&5
9770 echo "$as_me: failed program was:" >&5
9771 cat "conftest.$ac_ext" >&5
9772 cf_have_ncuconfig=no
9773 fi
9774 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9775 fi
9776 else
9777   echo "$as_me: failed program was:" >&5
9778 cat "conftest.$ac_ext" >&5
9779 cf_have_ncuconfig=no
9780 fi
9781 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9782                 echo "$as_me:9782: result: $cf_have_ncuconfig" >&5
9783 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9784                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9785                 if test "$cf_have_ncuconfig" != "yes"
9786                 then
9787                         CPPFLAGS="$cf_save_CPPFLAGS"
9788                         LIBS="$cf_save_LIBS"
9789                         NCURSES_CONFIG_PKG=none
9790                 else
9791
9792 cat >>confdefs.h <<\EOF
9793 #define NCURSES 1
9794 EOF
9795
9796                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9797
9798 echo "$as_me:9798: checking for terminfo header" >&5
9799 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9800 if test "${cf_cv_term_header+set}" = set; then
9801   echo $ECHO_N "(cached) $ECHO_C" >&6
9802 else
9803
9804 case "${cf_cv_ncurses_header}" in
9805 (*/ncurses.h|*/ncursesw.h)
9806         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9807         ;;
9808 (*)
9809         cf_term_header=term.h
9810         ;;
9811 esac
9812
9813 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9814 do
9815 cat >"conftest.$ac_ext" <<_ACEOF
9816 #line 9816 "configure"
9817 #include "confdefs.h"
9818 #include <stdio.h>
9819 #include <${cf_cv_ncurses_header:-curses.h}>
9820 #include <$cf_test>
9821
9822 int
9823 main (void)
9824 {
9825 int x = auto_left_margin; (void)x
9826   ;
9827   return 0;
9828 }
9829 _ACEOF
9830 rm -f "conftest.$ac_objext"
9831 if { (eval echo "$as_me:9831: \"$ac_compile\"") >&5
9832   (eval $ac_compile) 2>&5
9833   ac_status=$?
9834   echo "$as_me:9834: \$? = $ac_status" >&5
9835   (exit "$ac_status"); } &&
9836          { ac_try='test -s "conftest.$ac_objext"'
9837   { (eval echo "$as_me:9837: \"$ac_try\"") >&5
9838   (eval $ac_try) 2>&5
9839   ac_status=$?
9840   echo "$as_me:9840: \$? = $ac_status" >&5
9841   (exit "$ac_status"); }; }; then
9842
9843         cf_cv_term_header="$cf_test"
9844 else
9845   echo "$as_me: failed program was:" >&5
9846 cat "conftest.$ac_ext" >&5
9847
9848         cf_cv_term_header=unknown
9849
9850 fi
9851 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9852         test "$cf_cv_term_header" != unknown && break
9853 done
9854
9855 fi
9856 echo "$as_me:9856: result: $cf_cv_term_header" >&5
9857 echo "${ECHO_T}$cf_cv_term_header" >&6
9858
9859 # Set definitions to allow ifdef'ing to accommodate subdirectories
9860
9861 case "$cf_cv_term_header" in
9862 (*term.h)
9863
9864 cat >>confdefs.h <<\EOF
9865 #define HAVE_TERM_H 1
9866 EOF
9867
9868         ;;
9869 esac
9870
9871 case "$cf_cv_term_header" in
9872 (ncurses/term.h)
9873
9874 cat >>confdefs.h <<\EOF
9875 #define HAVE_NCURSES_TERM_H 1
9876 EOF
9877
9878         ;;
9879 (ncursesw/term.h)
9880
9881 cat >>confdefs.h <<\EOF
9882 #define HAVE_NCURSESW_TERM_H 1
9883 EOF
9884
9885         ;;
9886 esac
9887
9888                 fi
9889
9890         else
9891                 echo "$as_me:9891: result: no" >&5
9892 echo "${ECHO_T}no" >&6
9893                 NCURSES_CONFIG_PKG=none
9894         fi
9895 else
9896         NCURSES_CONFIG_PKG=none
9897 fi
9898
9899 if test "x$cf_have_ncuconfig" = "xno"; then
9900         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9901
9902 if test -n "$ac_tool_prefix"; then
9903   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9904   do
9905     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9906 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9907 echo "$as_me:9907: checking for $ac_word" >&5
9908 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9909 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9910   echo $ECHO_N "(cached) $ECHO_C" >&6
9911 else
9912   if test -n "$NCURSES_CONFIG"; then
9913   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9914 else
9915   ac_save_IFS=$IFS; IFS=$ac_path_separator
9916 ac_dummy="$PATH"
9917 for ac_dir in $ac_dummy; do
9918   IFS=$ac_save_IFS
9919   test -z "$ac_dir" && ac_dir=.
9920   $as_executable_p "$ac_dir/$ac_word" || continue
9921 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9922 echo "$as_me:9922: found $ac_dir/$ac_word" >&5
9923 break
9924 done
9925
9926 fi
9927 fi
9928 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9929 if test -n "$NCURSES_CONFIG"; then
9930   echo "$as_me:9930: result: $NCURSES_CONFIG" >&5
9931 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9932 else
9933   echo "$as_me:9933: result: no" >&5
9934 echo "${ECHO_T}no" >&6
9935 fi
9936
9937     test -n "$NCURSES_CONFIG" && break
9938   done
9939 fi
9940 if test -z "$NCURSES_CONFIG"; then
9941   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9942   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9943 do
9944   # Extract the first word of "$ac_prog", so it can be a program name with args.
9945 set dummy $ac_prog; ac_word=$2
9946 echo "$as_me:9946: checking for $ac_word" >&5
9947 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9948 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9949   echo $ECHO_N "(cached) $ECHO_C" >&6
9950 else
9951   if test -n "$ac_ct_NCURSES_CONFIG"; then
9952   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9953 else
9954   ac_save_IFS=$IFS; IFS=$ac_path_separator
9955 ac_dummy="$PATH"
9956 for ac_dir in $ac_dummy; do
9957   IFS=$ac_save_IFS
9958   test -z "$ac_dir" && ac_dir=.
9959   $as_executable_p "$ac_dir/$ac_word" || continue
9960 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9961 echo "$as_me:9961: found $ac_dir/$ac_word" >&5
9962 break
9963 done
9964
9965 fi
9966 fi
9967 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9968 if test -n "$ac_ct_NCURSES_CONFIG"; then
9969   echo "$as_me:9969: result: $ac_ct_NCURSES_CONFIG" >&5
9970 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9971 else
9972   echo "$as_me:9972: result: no" >&5
9973 echo "${ECHO_T}no" >&6
9974 fi
9975
9976   test -n "$ac_ct_NCURSES_CONFIG" && break
9977 done
9978 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9979
9980   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9981 fi
9982
9983         if test "$NCURSES_CONFIG" != none ; then
9984
9985 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9986 do
9987         case "x$cf_add_cflags" in
9988         (x-[DU]*)
9989
9990 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9991 while true
9992 do
9993         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9994         test "$CFLAGS" != "$cf_old_cflag" || break
9995
9996         CFLAGS="$cf_old_cflag"
9997 done
9998
9999 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10000 while true
10001 do
10002         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10003         test "$CPPFLAGS" != "$cf_old_cflag" || break
10004
10005         CPPFLAGS="$cf_old_cflag"
10006 done
10007
10008                 ;;
10009         esac
10010
10011 cf_fix_cppflags=no
10012 cf_new_cflags=
10013 cf_new_cppflags=
10014 cf_new_extra_cppflags=
10015
10016 for cf_add_cflags in $cf_add_cflags
10017 do
10018 case "$cf_fix_cppflags" in
10019 (no)
10020         case "$cf_add_cflags" in
10021         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10022                 case "$cf_add_cflags" in
10023                 (-D*)
10024                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10025
10026                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10027                                 && test -z "${cf_tst_cflags}" \
10028                                 && cf_fix_cppflags=yes
10029
10030                         if test "$cf_fix_cppflags" = yes ; then
10031
10032         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10033         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10034
10035                                 continue
10036                         elif test "${cf_tst_cflags}" = "\"'" ; then
10037
10038         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10039         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10040
10041                                 continue
10042                         fi
10043                         ;;
10044                 esac
10045                 case "$CPPFLAGS" in
10046                 (*$cf_add_cflags)
10047                         ;;
10048                 (*)
10049                         case "$cf_add_cflags" in
10050                         (-D*)
10051                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10052
10053 CPPFLAGS=`echo "$CPPFLAGS" | \
10054         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10055                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10056
10057                                 ;;
10058                         esac
10059
10060         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10061         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10062
10063                         ;;
10064                 esac
10065                 ;;
10066         (*)
10067
10068         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10069         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10070
10071                 ;;
10072         esac
10073         ;;
10074 (yes)
10075
10076         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10077         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10078
10079         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10080
10081         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10082                 && test -z "${cf_tst_cflags}" \
10083                 && cf_fix_cppflags=no
10084         ;;
10085 esac
10086 done
10087
10088 if test -n "$cf_new_cflags" ; then
10089
10090         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10091         CFLAGS="${CFLAGS}$cf_new_cflags"
10092
10093 fi
10094
10095 if test -n "$cf_new_cppflags" ; then
10096
10097         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10098         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10099
10100 fi
10101
10102 if test -n "$cf_new_extra_cppflags" ; then
10103
10104         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10105         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10106
10107 fi
10108
10109 done
10110
10111 cf_add_libs="$LIBS"
10112 # reverse order
10113 cf_add_0lib=
10114 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10115 # filter duplicates
10116 for cf_add_1lib in $cf_add_0lib; do
10117         for cf_add_2lib in $cf_add_libs; do
10118                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10119                         cf_add_1lib=
10120                         break
10121                 fi
10122         done
10123         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10124 done
10125 LIBS="$cf_add_libs"
10126
10127                 # even with config script, some packages use no-override for curses.h
10128
10129 echo "$as_me:10129: checking if we have identified curses headers" >&5
10130 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10131 if test "${cf_cv_ncurses_header+set}" = set; then
10132   echo $ECHO_N "(cached) $ECHO_C" >&6
10133 else
10134
10135 cf_cv_ncurses_header=none
10136 for cf_header in \
10137         ncurses.h ncurses/ncurses.h \
10138         curses.h ncurses/curses.h
10139 do
10140 cat >"conftest.$ac_ext" <<_ACEOF
10141 #line 10141 "configure"
10142 #include "confdefs.h"
10143 #include <${cf_header}>
10144 int
10145 main (void)
10146 {
10147 initscr(); endwin()
10148   ;
10149   return 0;
10150 }
10151 _ACEOF
10152 rm -f "conftest.$ac_objext"
10153 if { (eval echo "$as_me:10153: \"$ac_compile\"") >&5
10154   (eval $ac_compile) 2>&5
10155   ac_status=$?
10156   echo "$as_me:10156: \$? = $ac_status" >&5
10157   (exit "$ac_status"); } &&
10158          { ac_try='test -s "conftest.$ac_objext"'
10159   { (eval echo "$as_me:10159: \"$ac_try\"") >&5
10160   (eval $ac_try) 2>&5
10161   ac_status=$?
10162   echo "$as_me:10162: \$? = $ac_status" >&5
10163   (exit "$ac_status"); }; }; then
10164   cf_cv_ncurses_header=$cf_header; break
10165 else
10166   echo "$as_me: failed program was:" >&5
10167 cat "conftest.$ac_ext" >&5
10168 fi
10169 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10170 done
10171
10172 fi
10173 echo "$as_me:10173: result: $cf_cv_ncurses_header" >&5
10174 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10175
10176 if test "$cf_cv_ncurses_header" = none ; then
10177         { { echo "$as_me:10177: error: No curses header-files found" >&5
10178 echo "$as_me: error: No curses header-files found" >&2;}
10179    { (exit 1); exit 1; }; }
10180 fi
10181
10182 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10183
10184 for ac_header in $cf_cv_ncurses_header
10185 do
10186 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10187 echo "$as_me:10187: checking for $ac_header" >&5
10188 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10189 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10190   echo $ECHO_N "(cached) $ECHO_C" >&6
10191 else
10192   cat >"conftest.$ac_ext" <<_ACEOF
10193 #line 10193 "configure"
10194 #include "confdefs.h"
10195 #include <$ac_header>
10196 _ACEOF
10197 if { (eval echo "$as_me:10197: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10198   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10199   ac_status=$?
10200   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10201   rm -f conftest.er1
10202   cat conftest.err >&5
10203   echo "$as_me:10203: \$? = $ac_status" >&5
10204   (exit "$ac_status"); } >/dev/null; then
10205   if test -s conftest.err; then
10206     ac_cpp_err=$ac_c_preproc_warn_flag
10207   else
10208     ac_cpp_err=
10209   fi
10210 else
10211   ac_cpp_err=yes
10212 fi
10213 if test -z "$ac_cpp_err"; then
10214   eval "$as_ac_Header=yes"
10215 else
10216   echo "$as_me: failed program was:" >&5
10217   cat "conftest.$ac_ext" >&5
10218   eval "$as_ac_Header=no"
10219 fi
10220 rm -f conftest.err "conftest.$ac_ext"
10221 fi
10222 echo "$as_me:10222: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10223 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10224 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10225   cat >>confdefs.h <<EOF
10226 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10227 EOF
10228
10229 fi
10230 done
10231
10232 cat >>confdefs.h <<\EOF
10233 #define NCURSES 1
10234 EOF
10235
10236 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10237
10238                 cat >>confdefs.h <<EOF
10239 #define $cf_nculib_ROOT 1
10240 EOF
10241
10242                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10243
10244         else
10245
10246 cf_ncuhdr_root=ncurses
10247
10248 test -n "$cf_cv_curses_dir" && \
10249 test "$cf_cv_curses_dir" != "no" && { \
10250
10251 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10252   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10253   do
10254         while test "$cf_add_incdir" != /usr/include
10255         do
10256           if test -d "$cf_add_incdir"
10257           then
10258                 cf_have_incdir=no
10259                 if test -n "$CFLAGS$CPPFLAGS" ; then
10260                   # a loop is needed to ensure we can add subdirs of existing dirs
10261                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10262                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10263                           cf_have_incdir=yes; break
10264                         fi
10265                   done
10266                 fi
10267
10268                 if test "$cf_have_incdir" = no ; then
10269                   if test "$cf_add_incdir" = /usr/local/include ; then
10270                         if test "$GCC" = yes
10271                         then
10272                           cf_save_CPPFLAGS=$CPPFLAGS
10273
10274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10275         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10276
10277                           cat >"conftest.$ac_ext" <<_ACEOF
10278 #line 10278 "configure"
10279 #include "confdefs.h"
10280 #include <stdio.h>
10281 int
10282 main (void)
10283 {
10284 printf("Hello")
10285   ;
10286   return 0;
10287 }
10288 _ACEOF
10289 rm -f "conftest.$ac_objext"
10290 if { (eval echo "$as_me:10290: \"$ac_compile\"") >&5
10291   (eval $ac_compile) 2>&5
10292   ac_status=$?
10293   echo "$as_me:10293: \$? = $ac_status" >&5
10294   (exit "$ac_status"); } &&
10295          { ac_try='test -s "conftest.$ac_objext"'
10296   { (eval echo "$as_me:10296: \"$ac_try\"") >&5
10297   (eval $ac_try) 2>&5
10298   ac_status=$?
10299   echo "$as_me:10299: \$? = $ac_status" >&5
10300   (exit "$ac_status"); }; }; then
10301   :
10302 else
10303   echo "$as_me: failed program was:" >&5
10304 cat "conftest.$ac_ext" >&5
10305 cf_have_incdir=yes
10306 fi
10307 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10308                           CPPFLAGS=$cf_save_CPPFLAGS
10309                         fi
10310                   fi
10311                 fi
10312
10313                 if test "$cf_have_incdir" = no ; then
10314                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10315
10316 echo "${as_me:-configure}:10316: testing adding $cf_add_incdir to include-path ..." 1>&5
10317
10318                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10319
10320                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10321                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10322                   cf_add_incdir="$cf_top_incdir"
10323                 else
10324                   break
10325                 fi
10326           else
10327                 break
10328           fi
10329         done
10330   done
10331 fi
10332
10333 }
10334
10335 echo "$as_me:10335: checking for $cf_ncuhdr_root header in include-path" >&5
10336 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10337 if test "${cf_cv_ncurses_h+set}" = set; then
10338   echo $ECHO_N "(cached) $ECHO_C" >&6
10339 else
10340
10341         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10342         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10343         for cf_header in $cf_header_list
10344         do
10345
10346         cat >"conftest.$ac_ext" <<_ACEOF
10347 #line 10347 "configure"
10348 #include "confdefs.h"
10349
10350 #include <$cf_header>
10351 int
10352 main (void)
10353 {
10354
10355 #ifdef NCURSES_VERSION
10356
10357 printf("%s\\n", NCURSES_VERSION);
10358 #else
10359 #ifdef __NCURSES_H
10360 printf("old\\n");
10361 #else
10362         make an error
10363 #endif
10364 #endif
10365
10366   ;
10367   return 0;
10368 }
10369 _ACEOF
10370 rm -f "conftest.$ac_objext"
10371 if { (eval echo "$as_me:10371: \"$ac_compile\"") >&5
10372   (eval $ac_compile) 2>&5
10373   ac_status=$?
10374   echo "$as_me:10374: \$? = $ac_status" >&5
10375   (exit "$ac_status"); } &&
10376          { ac_try='test -s "conftest.$ac_objext"'
10377   { (eval echo "$as_me:10377: \"$ac_try\"") >&5
10378   (eval $ac_try) 2>&5
10379   ac_status=$?
10380   echo "$as_me:10380: \$? = $ac_status" >&5
10381   (exit "$ac_status"); }; }; then
10382   cf_cv_ncurses_h=$cf_header
10383
10384 else
10385   echo "$as_me: failed program was:" >&5
10386 cat "conftest.$ac_ext" >&5
10387 cf_cv_ncurses_h=no
10388 fi
10389 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10390
10391                 test "$cf_cv_ncurses_h" != no && break
10392         done
10393
10394 fi
10395 echo "$as_me:10395: result: $cf_cv_ncurses_h" >&5
10396 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10397
10398 if test "$cf_cv_ncurses_h" != no ; then
10399         cf_cv_ncurses_header=$cf_cv_ncurses_h
10400 else
10401
10402 echo "$as_me:10402: checking for $cf_ncuhdr_root include-path" >&5
10403 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10404 if test "${cf_cv_ncurses_h2+set}" = set; then
10405   echo $ECHO_N "(cached) $ECHO_C" >&6
10406 else
10407
10408         test -n "$verbose" && echo
10409
10410 cf_search=
10411
10412 # collect the current set of include-directories from compiler flags
10413 cf_header_path_list=""
10414 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10415         for cf_header_path in $CPPFLAGS $CFLAGS
10416         do
10417                 case "$cf_header_path" in
10418                 (-I*)
10419                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10420
10421 test "x$cf_header_path" != "xNONE" && \
10422 test -d "$cf_header_path" && \
10423  {
10424         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10425         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10426         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10427         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10428         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10429         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"
10430 }
10431
10432                         cf_header_path_list="$cf_header_path_list $cf_search"
10433                         ;;
10434                 esac
10435         done
10436 fi
10437
10438 # add the variations for the package we are looking for
10439
10440 cf_search=
10441
10442 test "x$prefix" != "xNONE" && \
10443 test -d "$prefix" && \
10444  {
10445         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10446         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10447         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10448         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10449         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10450         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10451 }
10452
10453 for cf_subdir_prefix in \
10454         /usr \
10455         /usr/local \
10456         /usr/pkg \
10457         /opt \
10458         /opt/local \
10459         $HOME
10460 do
10461
10462 test "x$cf_subdir_prefix" != "x$prefix" && \
10463 test -d "$cf_subdir_prefix" && \
10464 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10465         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10466         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10467         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10468         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10469         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10470         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"
10471 }
10472
10473 done
10474
10475 test "$includedir" != NONE && \
10476 test "$includedir" != "/usr/include" && \
10477 test -d "$includedir" && {
10478         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10479         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10480 }
10481
10482 test "$oldincludedir" != NONE && \
10483 test "$oldincludedir" != "/usr/include" && \
10484 test -d "$oldincludedir" && {
10485         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10486         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10487 }
10488
10489 cf_search="$cf_search $cf_header_path_list"
10490
10491         test -n "$verbose" && echo "search path $cf_search"
10492         cf_save2_CPPFLAGS="$CPPFLAGS"
10493         for cf_incdir in $cf_search
10494         do
10495
10496 if test -n "$cf_incdir" ; then
10497   for cf_add_incdir in $cf_incdir
10498   do
10499         while test "$cf_add_incdir" != /usr/include
10500         do
10501           if test -d "$cf_add_incdir"
10502           then
10503                 cf_have_incdir=no
10504                 if test -n "$CFLAGS$CPPFLAGS" ; then
10505                   # a loop is needed to ensure we can add subdirs of existing dirs
10506                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10507                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10508                           cf_have_incdir=yes; break
10509                         fi
10510                   done
10511                 fi
10512
10513                 if test "$cf_have_incdir" = no ; then
10514                   if test "$cf_add_incdir" = /usr/local/include ; then
10515                         if test "$GCC" = yes
10516                         then
10517                           cf_save_CPPFLAGS=$CPPFLAGS
10518
10519         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10520         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10521
10522                           cat >"conftest.$ac_ext" <<_ACEOF
10523 #line 10523 "configure"
10524 #include "confdefs.h"
10525 #include <stdio.h>
10526 int
10527 main (void)
10528 {
10529 printf("Hello")
10530   ;
10531   return 0;
10532 }
10533 _ACEOF
10534 rm -f "conftest.$ac_objext"
10535 if { (eval echo "$as_me:10535: \"$ac_compile\"") >&5
10536   (eval $ac_compile) 2>&5
10537   ac_status=$?
10538   echo "$as_me:10538: \$? = $ac_status" >&5
10539   (exit "$ac_status"); } &&
10540          { ac_try='test -s "conftest.$ac_objext"'
10541   { (eval echo "$as_me:10541: \"$ac_try\"") >&5
10542   (eval $ac_try) 2>&5
10543   ac_status=$?
10544   echo "$as_me:10544: \$? = $ac_status" >&5
10545   (exit "$ac_status"); }; }; then
10546   :
10547 else
10548   echo "$as_me: failed program was:" >&5
10549 cat "conftest.$ac_ext" >&5
10550 cf_have_incdir=yes
10551 fi
10552 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10553                           CPPFLAGS=$cf_save_CPPFLAGS
10554                         fi
10555                   fi
10556                 fi
10557
10558                 if test "$cf_have_incdir" = no ; then
10559                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10560
10561 echo "${as_me:-configure}:10561: testing adding $cf_add_incdir to include-path ..." 1>&5
10562
10563                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10564
10565                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10566                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10567                   cf_add_incdir="$cf_top_incdir"
10568                 else
10569                   break
10570                 fi
10571           else
10572                 break
10573           fi
10574         done
10575   done
10576 fi
10577
10578                 for cf_header in \
10579                         ncurses.h \
10580                         curses.h
10581                 do
10582
10583         cat >"conftest.$ac_ext" <<_ACEOF
10584 #line 10584 "configure"
10585 #include "confdefs.h"
10586
10587 #include <$cf_header>
10588 int
10589 main (void)
10590 {
10591
10592 #ifdef NCURSES_VERSION
10593
10594 printf("%s\\n", NCURSES_VERSION);
10595 #else
10596 #ifdef __NCURSES_H
10597 printf("old\\n");
10598 #else
10599         make an error
10600 #endif
10601 #endif
10602
10603   ;
10604   return 0;
10605 }
10606 _ACEOF
10607 rm -f "conftest.$ac_objext"
10608 if { (eval echo "$as_me:10608: \"$ac_compile\"") >&5
10609   (eval $ac_compile) 2>&5
10610   ac_status=$?
10611   echo "$as_me:10611: \$? = $ac_status" >&5
10612   (exit "$ac_status"); } &&
10613          { ac_try='test -s "conftest.$ac_objext"'
10614   { (eval echo "$as_me:10614: \"$ac_try\"") >&5
10615   (eval $ac_try) 2>&5
10616   ac_status=$?
10617   echo "$as_me:10617: \$? = $ac_status" >&5
10618   (exit "$ac_status"); }; }; then
10619   cf_cv_ncurses_h2=$cf_header
10620
10621 else
10622   echo "$as_me: failed program was:" >&5
10623 cat "conftest.$ac_ext" >&5
10624 cf_cv_ncurses_h2=no
10625 fi
10626 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10627
10628                         if test "$cf_cv_ncurses_h2" != no ; then
10629                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10630                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10631                                 break
10632                         fi
10633                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10634                 done
10635                 CPPFLAGS="$cf_save2_CPPFLAGS"
10636                 test "$cf_cv_ncurses_h2" != no && break
10637         done
10638         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10638: error: not found" >&5
10639 echo "$as_me: error: not found" >&2;}
10640    { (exit 1); exit 1; }; }
10641
10642 fi
10643 echo "$as_me:10643: result: $cf_cv_ncurses_h2" >&5
10644 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10645
10646         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10647         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10648         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10649                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10650         fi
10651
10652 if test -n "$cf_1st_incdir" ; then
10653   for cf_add_incdir in $cf_1st_incdir
10654   do
10655         while test "$cf_add_incdir" != /usr/include
10656         do
10657           if test -d "$cf_add_incdir"
10658           then
10659                 cf_have_incdir=no
10660                 if test -n "$CFLAGS$CPPFLAGS" ; then
10661                   # a loop is needed to ensure we can add subdirs of existing dirs
10662                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10663                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10664                           cf_have_incdir=yes; break
10665                         fi
10666                   done
10667                 fi
10668
10669                 if test "$cf_have_incdir" = no ; then
10670                   if test "$cf_add_incdir" = /usr/local/include ; then
10671                         if test "$GCC" = yes
10672                         then
10673                           cf_save_CPPFLAGS=$CPPFLAGS
10674
10675         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10676         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10677
10678                           cat >"conftest.$ac_ext" <<_ACEOF
10679 #line 10679 "configure"
10680 #include "confdefs.h"
10681 #include <stdio.h>
10682 int
10683 main (void)
10684 {
10685 printf("Hello")
10686   ;
10687   return 0;
10688 }
10689 _ACEOF
10690 rm -f "conftest.$ac_objext"
10691 if { (eval echo "$as_me:10691: \"$ac_compile\"") >&5
10692   (eval $ac_compile) 2>&5
10693   ac_status=$?
10694   echo "$as_me:10694: \$? = $ac_status" >&5
10695   (exit "$ac_status"); } &&
10696          { ac_try='test -s "conftest.$ac_objext"'
10697   { (eval echo "$as_me:10697: \"$ac_try\"") >&5
10698   (eval $ac_try) 2>&5
10699   ac_status=$?
10700   echo "$as_me:10700: \$? = $ac_status" >&5
10701   (exit "$ac_status"); }; }; then
10702   :
10703 else
10704   echo "$as_me: failed program was:" >&5
10705 cat "conftest.$ac_ext" >&5
10706 cf_have_incdir=yes
10707 fi
10708 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10709                           CPPFLAGS=$cf_save_CPPFLAGS
10710                         fi
10711                   fi
10712                 fi
10713
10714                 if test "$cf_have_incdir" = no ; then
10715                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10716
10717 echo "${as_me:-configure}:10717: testing adding $cf_add_incdir to include-path ..." 1>&5
10718
10719                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10720
10721                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10722                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10723                   cf_add_incdir="$cf_top_incdir"
10724                 else
10725                   break
10726                 fi
10727           else
10728                 break
10729           fi
10730         done
10731   done
10732 fi
10733
10734 fi
10735
10736 # Set definitions to allow ifdef'ing for ncurses.h
10737
10738 case "$cf_cv_ncurses_header" in
10739 (*ncurses.h)
10740
10741 cat >>confdefs.h <<\EOF
10742 #define HAVE_NCURSES_H 1
10743 EOF
10744
10745         ;;
10746 esac
10747
10748 case "$cf_cv_ncurses_header" in
10749 (ncurses/curses.h|ncurses/ncurses.h)
10750
10751 cat >>confdefs.h <<\EOF
10752 #define HAVE_NCURSES_NCURSES_H 1
10753 EOF
10754
10755         ;;
10756 (ncursesw/curses.h|ncursesw/ncurses.h)
10757
10758 cat >>confdefs.h <<\EOF
10759 #define HAVE_NCURSESW_NCURSES_H 1
10760 EOF
10761
10762         ;;
10763 esac
10764
10765 echo "$as_me:10765: checking for terminfo header" >&5
10766 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10767 if test "${cf_cv_term_header+set}" = set; then
10768   echo $ECHO_N "(cached) $ECHO_C" >&6
10769 else
10770
10771 case "${cf_cv_ncurses_header}" in
10772 (*/ncurses.h|*/ncursesw.h)
10773         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10774         ;;
10775 (*)
10776         cf_term_header=term.h
10777         ;;
10778 esac
10779
10780 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10781 do
10782 cat >"conftest.$ac_ext" <<_ACEOF
10783 #line 10783 "configure"
10784 #include "confdefs.h"
10785 #include <stdio.h>
10786 #include <${cf_cv_ncurses_header:-curses.h}>
10787 #include <$cf_test>
10788
10789 int
10790 main (void)
10791 {
10792 int x = auto_left_margin; (void)x
10793   ;
10794   return 0;
10795 }
10796 _ACEOF
10797 rm -f "conftest.$ac_objext"
10798 if { (eval echo "$as_me:10798: \"$ac_compile\"") >&5
10799   (eval $ac_compile) 2>&5
10800   ac_status=$?
10801   echo "$as_me:10801: \$? = $ac_status" >&5
10802   (exit "$ac_status"); } &&
10803          { ac_try='test -s "conftest.$ac_objext"'
10804   { (eval echo "$as_me:10804: \"$ac_try\"") >&5
10805   (eval $ac_try) 2>&5
10806   ac_status=$?
10807   echo "$as_me:10807: \$? = $ac_status" >&5
10808   (exit "$ac_status"); }; }; then
10809
10810         cf_cv_term_header="$cf_test"
10811 else
10812   echo "$as_me: failed program was:" >&5
10813 cat "conftest.$ac_ext" >&5
10814
10815         cf_cv_term_header=unknown
10816
10817 fi
10818 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10819         test "$cf_cv_term_header" != unknown && break
10820 done
10821
10822 fi
10823 echo "$as_me:10823: result: $cf_cv_term_header" >&5
10824 echo "${ECHO_T}$cf_cv_term_header" >&6
10825
10826 # Set definitions to allow ifdef'ing to accommodate subdirectories
10827
10828 case "$cf_cv_term_header" in
10829 (*term.h)
10830
10831 cat >>confdefs.h <<\EOF
10832 #define HAVE_TERM_H 1
10833 EOF
10834
10835         ;;
10836 esac
10837
10838 case "$cf_cv_term_header" in
10839 (ncurses/term.h)
10840
10841 cat >>confdefs.h <<\EOF
10842 #define HAVE_NCURSES_TERM_H 1
10843 EOF
10844
10845         ;;
10846 (ncursesw/term.h)
10847
10848 cat >>confdefs.h <<\EOF
10849 #define HAVE_NCURSESW_TERM_H 1
10850 EOF
10851
10852         ;;
10853 esac
10854
10855 # some applications need this, but should check for NCURSES_VERSION
10856
10857 cat >>confdefs.h <<\EOF
10858 #define NCURSES 1
10859 EOF
10860
10861 echo "$as_me:10861: checking for ncurses version" >&5
10862 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10863 if test "${cf_cv_ncurses_version+set}" = set; then
10864   echo $ECHO_N "(cached) $ECHO_C" >&6
10865 else
10866
10867         cf_cv_ncurses_version=no
10868         cf_tempfile=out$$
10869         rm -f "$cf_tempfile"
10870         if test "$cross_compiling" = yes; then
10871
10872         # This will not work if the preprocessor splits the line after the
10873         # Autoconf token.  The 'unproto' program does that.
10874         cat > "conftest.$ac_ext" <<EOF
10875 #include <${cf_cv_ncurses_header:-curses.h}>
10876 #undef Autoconf
10877 #ifdef NCURSES_VERSION
10878 Autoconf NCURSES_VERSION
10879 #else
10880 #ifdef __NCURSES_H
10881 Autoconf "old"
10882 #endif
10883 ;
10884 #endif
10885 EOF
10886         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10887         { (eval echo "$as_me:10887: \"$cf_try\"") >&5
10888   (eval $cf_try) 2>&5
10889   ac_status=$?
10890   echo "$as_me:10890: \$? = $ac_status" >&5
10891   (exit "$ac_status"); }
10892         if test -f conftest.out ; then
10893                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10894                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10895                 rm -f conftest.out
10896         fi
10897
10898 else
10899   cat >"conftest.$ac_ext" <<_ACEOF
10900 #line 10900 "configure"
10901 #include "confdefs.h"
10902
10903 $ac_includes_default
10904
10905 #include <${cf_cv_ncurses_header:-curses.h}>
10906
10907 int main(void)
10908 {
10909         FILE *fp = fopen("$cf_tempfile", "w");
10910 #ifdef NCURSES_VERSION
10911 # ifdef NCURSES_VERSION_PATCH
10912         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10913 # else
10914         fprintf(fp, "%s\\n", NCURSES_VERSION);
10915 # endif
10916 #else
10917 # ifdef __NCURSES_H
10918         fprintf(fp, "old\\n");
10919 # else
10920         make an error
10921 # endif
10922 #endif
10923         ${cf_cv_main_return:-return}(0);
10924 }
10925 _ACEOF
10926 rm -f "conftest$ac_exeext"
10927 if { (eval echo "$as_me:10927: \"$ac_link\"") >&5
10928   (eval $ac_link) 2>&5
10929   ac_status=$?
10930   echo "$as_me:10930: \$? = $ac_status" >&5
10931   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10932   { (eval echo "$as_me:10932: \"$ac_try\"") >&5
10933   (eval $ac_try) 2>&5
10934   ac_status=$?
10935   echo "$as_me:10935: \$? = $ac_status" >&5
10936   (exit "$ac_status"); }; }; then
10937
10938         cf_cv_ncurses_version=`cat $cf_tempfile`
10939 else
10940   echo "$as_me: program exited with status $ac_status" >&5
10941 echo "$as_me: failed program was:" >&5
10942 cat "conftest.$ac_ext" >&5
10943 fi
10944 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10945 fi
10946         rm -f "$cf_tempfile"
10947
10948 fi
10949 echo "$as_me:10949: result: $cf_cv_ncurses_version" >&5
10950 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10951 test "$cf_cv_ncurses_version" = no ||
10952 cat >>confdefs.h <<\EOF
10953 #define NCURSES 1
10954 EOF
10955
10956 cf_nculib_root=ncurses
10957         # This works, except for the special case where we find gpm, but
10958         # ncurses is in a nonstandard location via $LIBS, and we really want
10959         # to link gpm.
10960 cf_ncurses_LIBS=""
10961 cf_ncurses_SAVE="$LIBS"
10962 echo "$as_me:10962: checking for Gpm_Open in -lgpm" >&5
10963 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10964 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10965   echo $ECHO_N "(cached) $ECHO_C" >&6
10966 else
10967   ac_check_lib_save_LIBS=$LIBS
10968 LIBS="-lgpm  $LIBS"
10969 cat >"conftest.$ac_ext" <<_ACEOF
10970 #line 10970 "configure"
10971 #include "confdefs.h"
10972
10973 /* Override any gcc2 internal prototype to avoid an error.  */
10974 #ifdef __cplusplus
10975 extern "C"
10976 #endif
10977 /* We use char because int might match the return type of a gcc2
10978    builtin and then its argument prototype would still apply.  */
10979 char Gpm_Open ();
10980 int
10981 main (void)
10982 {
10983 Gpm_Open ();
10984   ;
10985   return 0;
10986 }
10987 _ACEOF
10988 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10989 if { (eval echo "$as_me:10989: \"$ac_link\"") >&5
10990   (eval $ac_link) 2>&5
10991   ac_status=$?
10992   echo "$as_me:10992: \$? = $ac_status" >&5
10993   (exit "$ac_status"); } &&
10994          { ac_try='test -s "conftest$ac_exeext"'
10995   { (eval echo "$as_me:10995: \"$ac_try\"") >&5
10996   (eval $ac_try) 2>&5
10997   ac_status=$?
10998   echo "$as_me:10998: \$? = $ac_status" >&5
10999   (exit "$ac_status"); }; }; then
11000   ac_cv_lib_gpm_Gpm_Open=yes
11001 else
11002   echo "$as_me: failed program was:" >&5
11003 cat "conftest.$ac_ext" >&5
11004 ac_cv_lib_gpm_Gpm_Open=no
11005 fi
11006 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11007 LIBS=$ac_check_lib_save_LIBS
11008 fi
11009 echo "$as_me:11009: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11010 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11011 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11012   echo "$as_me:11012: checking for initscr in -lgpm" >&5
11013 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11014 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11015   echo $ECHO_N "(cached) $ECHO_C" >&6
11016 else
11017   ac_check_lib_save_LIBS=$LIBS
11018 LIBS="-lgpm  $LIBS"
11019 cat >"conftest.$ac_ext" <<_ACEOF
11020 #line 11020 "configure"
11021 #include "confdefs.h"
11022
11023 /* Override any gcc2 internal prototype to avoid an error.  */
11024 #ifdef __cplusplus
11025 extern "C"
11026 #endif
11027 /* We use char because int might match the return type of a gcc2
11028    builtin and then its argument prototype would still apply.  */
11029 char initscr ();
11030 int
11031 main (void)
11032 {
11033 initscr ();
11034   ;
11035   return 0;
11036 }
11037 _ACEOF
11038 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11039 if { (eval echo "$as_me:11039: \"$ac_link\"") >&5
11040   (eval $ac_link) 2>&5
11041   ac_status=$?
11042   echo "$as_me:11042: \$? = $ac_status" >&5
11043   (exit "$ac_status"); } &&
11044          { ac_try='test -s "conftest$ac_exeext"'
11045   { (eval echo "$as_me:11045: \"$ac_try\"") >&5
11046   (eval $ac_try) 2>&5
11047   ac_status=$?
11048   echo "$as_me:11048: \$? = $ac_status" >&5
11049   (exit "$ac_status"); }; }; then
11050   ac_cv_lib_gpm_initscr=yes
11051 else
11052   echo "$as_me: failed program was:" >&5
11053 cat "conftest.$ac_ext" >&5
11054 ac_cv_lib_gpm_initscr=no
11055 fi
11056 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11057 LIBS=$ac_check_lib_save_LIBS
11058 fi
11059 echo "$as_me:11059: result: $ac_cv_lib_gpm_initscr" >&5
11060 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11061 if test "$ac_cv_lib_gpm_initscr" = yes; then
11062   LIBS="$cf_ncurses_SAVE"
11063 else
11064   cf_ncurses_LIBS="-lgpm"
11065 fi
11066
11067 fi
11068
11069 case "$host_os" in
11070 (freebsd*)
11071         # This is only necessary if you are linking against an obsolete
11072         # version of ncurses (but it should do no harm, since it is static).
11073         if test "$cf_nculib_root" = ncurses ; then
11074                 echo "$as_me:11074: checking for tgoto in -lmytinfo" >&5
11075 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11076 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11077   echo $ECHO_N "(cached) $ECHO_C" >&6
11078 else
11079   ac_check_lib_save_LIBS=$LIBS
11080 LIBS="-lmytinfo  $LIBS"
11081 cat >"conftest.$ac_ext" <<_ACEOF
11082 #line 11082 "configure"
11083 #include "confdefs.h"
11084
11085 /* Override any gcc2 internal prototype to avoid an error.  */
11086 #ifdef __cplusplus
11087 extern "C"
11088 #endif
11089 /* We use char because int might match the return type of a gcc2
11090    builtin and then its argument prototype would still apply.  */
11091 char tgoto ();
11092 int
11093 main (void)
11094 {
11095 tgoto ();
11096   ;
11097   return 0;
11098 }
11099 _ACEOF
11100 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11101 if { (eval echo "$as_me:11101: \"$ac_link\"") >&5
11102   (eval $ac_link) 2>&5
11103   ac_status=$?
11104   echo "$as_me:11104: \$? = $ac_status" >&5
11105   (exit "$ac_status"); } &&
11106          { ac_try='test -s "conftest$ac_exeext"'
11107   { (eval echo "$as_me:11107: \"$ac_try\"") >&5
11108   (eval $ac_try) 2>&5
11109   ac_status=$?
11110   echo "$as_me:11110: \$? = $ac_status" >&5
11111   (exit "$ac_status"); }; }; then
11112   ac_cv_lib_mytinfo_tgoto=yes
11113 else
11114   echo "$as_me: failed program was:" >&5
11115 cat "conftest.$ac_ext" >&5
11116 ac_cv_lib_mytinfo_tgoto=no
11117 fi
11118 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11119 LIBS=$ac_check_lib_save_LIBS
11120 fi
11121 echo "$as_me:11121: result: $ac_cv_lib_mytinfo_tgoto" >&5
11122 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11123 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11124   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11125 fi
11126
11127         fi
11128         ;;
11129 esac
11130
11131 cf_add_libs="$LIBS"
11132 # reverse order
11133 cf_add_0lib=
11134 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11135 # filter duplicates
11136 for cf_add_1lib in $cf_add_0lib; do
11137         for cf_add_2lib in $cf_add_libs; do
11138                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11139                         cf_add_1lib=
11140                         break
11141                 fi
11142         done
11143         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11144 done
11145 LIBS="$cf_add_libs"
11146
11147 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11148 then
11149
11150 cf_add_libs="$LIBS"
11151 # reverse order
11152 cf_add_0lib=
11153 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11154 # filter duplicates
11155 for cf_add_1lib in $cf_add_0lib; do
11156         for cf_add_2lib in $cf_add_libs; do
11157                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11158                         cf_add_1lib=
11159                         break
11160                 fi
11161         done
11162         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11163 done
11164 LIBS="$cf_add_libs"
11165
11166 else
11167
11168         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11169         cf_libdir=""
11170         echo "$as_me:11170: checking for initscr" >&5
11171 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11172 if test "${ac_cv_func_initscr+set}" = set; then
11173   echo $ECHO_N "(cached) $ECHO_C" >&6
11174 else
11175   cat >"conftest.$ac_ext" <<_ACEOF
11176 #line 11176 "configure"
11177 #include "confdefs.h"
11178 #define initscr autoconf_temporary
11179 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11180 #undef initscr
11181
11182 #ifdef __cplusplus
11183 extern "C"
11184 #endif
11185
11186 /* We use char because int might match the return type of a gcc2
11187    builtin and then its argument prototype would still apply.  */
11188 char initscr (void);
11189
11190 int
11191 main (void)
11192 {
11193
11194 /* The GNU C library defines stubs for functions which it implements
11195     to always fail with ENOSYS.  Some functions are actually named
11196     something starting with __ and the normal name is an alias.  */
11197 #if defined (__stub_initscr) || defined (__stub___initscr)
11198 #error found stub for initscr
11199 #endif
11200
11201         return initscr ();
11202   ;
11203   return 0;
11204 }
11205 _ACEOF
11206 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11207 if { (eval echo "$as_me:11207: \"$ac_link\"") >&5
11208   (eval $ac_link) 2>&5
11209   ac_status=$?
11210   echo "$as_me:11210: \$? = $ac_status" >&5
11211   (exit "$ac_status"); } &&
11212          { ac_try='test -s "conftest$ac_exeext"'
11213   { (eval echo "$as_me:11213: \"$ac_try\"") >&5
11214   (eval $ac_try) 2>&5
11215   ac_status=$?
11216   echo "$as_me:11216: \$? = $ac_status" >&5
11217   (exit "$ac_status"); }; }; then
11218   ac_cv_func_initscr=yes
11219 else
11220   echo "$as_me: failed program was:" >&5
11221 cat "conftest.$ac_ext" >&5
11222 ac_cv_func_initscr=no
11223 fi
11224 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11225 fi
11226 echo "$as_me:11226: result: $ac_cv_func_initscr" >&5
11227 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11228 if test "$ac_cv_func_initscr" = yes; then
11229   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11230 else
11231
11232                 cf_save_LIBS="$LIBS"
11233                 echo "$as_me:11233: checking for initscr in -l$cf_nculib_root" >&5
11234 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11235                 LIBS="-l$cf_nculib_root $LIBS"
11236                 cat >"conftest.$ac_ext" <<_ACEOF
11237 #line 11237 "configure"
11238 #include "confdefs.h"
11239 #include <${cf_cv_ncurses_header:-curses.h}>
11240 int
11241 main (void)
11242 {
11243 initscr()
11244   ;
11245   return 0;
11246 }
11247 _ACEOF
11248 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11249 if { (eval echo "$as_me:11249: \"$ac_link\"") >&5
11250   (eval $ac_link) 2>&5
11251   ac_status=$?
11252   echo "$as_me:11252: \$? = $ac_status" >&5
11253   (exit "$ac_status"); } &&
11254          { ac_try='test -s "conftest$ac_exeext"'
11255   { (eval echo "$as_me:11255: \"$ac_try\"") >&5
11256   (eval $ac_try) 2>&5
11257   ac_status=$?
11258   echo "$as_me:11258: \$? = $ac_status" >&5
11259   (exit "$ac_status"); }; }; then
11260   echo "$as_me:11260: result: yes" >&5
11261 echo "${ECHO_T}yes" >&6
11262                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11263
11264 else
11265   echo "$as_me: failed program was:" >&5
11266 cat "conftest.$ac_ext" >&5
11267 echo "$as_me:11267: result: no" >&5
11268 echo "${ECHO_T}no" >&6
11269
11270 cf_search=
11271 cf_library_path_list=""
11272 if test -n "${LDFLAGS}${LIBS}" ; then
11273         for cf_library_path in $LDFLAGS $LIBS
11274         do
11275                 case "$cf_library_path" in
11276                 (-L*)
11277                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11278
11279 test "x$cf_library_path" != "xNONE" && \
11280 test -d "$cf_library_path" && \
11281  {
11282         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11283         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11284         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11285         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11286         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11287         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"
11288 }
11289
11290                         cf_library_path_list="$cf_library_path_list $cf_search"
11291                         ;;
11292                 esac
11293         done
11294 fi
11295
11296 cf_search=
11297
11298 test "x$prefix" != "xNONE" && \
11299 test -d "$prefix" && \
11300  {
11301         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11302         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11303         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11304         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11305         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11306         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11307 }
11308
11309 for cf_subdir_prefix in \
11310         /usr \
11311         /usr/local \
11312         /usr/pkg \
11313         /opt \
11314         /opt/local \
11315         $HOME
11316 do
11317
11318 test "x$cf_subdir_prefix" != "x$prefix" && \
11319 test -d "$cf_subdir_prefix" && \
11320 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11321         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11322         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11323         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11324         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11325         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11326         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"
11327 }
11328
11329 done
11330
11331 cf_search="$cf_library_path_list $cf_search"
11332
11333                         for cf_libdir in $cf_search
11334                         do
11335                                 echo "$as_me:11335: checking for -l$cf_nculib_root in $cf_libdir" >&5
11336 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11337                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11338                                 cat >"conftest.$ac_ext" <<_ACEOF
11339 #line 11339 "configure"
11340 #include "confdefs.h"
11341 #include <${cf_cv_ncurses_header:-curses.h}>
11342 int
11343 main (void)
11344 {
11345 initscr()
11346   ;
11347   return 0;
11348 }
11349 _ACEOF
11350 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11351 if { (eval echo "$as_me:11351: \"$ac_link\"") >&5
11352   (eval $ac_link) 2>&5
11353   ac_status=$?
11354   echo "$as_me:11354: \$? = $ac_status" >&5
11355   (exit "$ac_status"); } &&
11356          { ac_try='test -s "conftest$ac_exeext"'
11357   { (eval echo "$as_me:11357: \"$ac_try\"") >&5
11358   (eval $ac_try) 2>&5
11359   ac_status=$?
11360   echo "$as_me:11360: \$? = $ac_status" >&5
11361   (exit "$ac_status"); }; }; then
11362   echo "$as_me:11362: result: yes" >&5
11363 echo "${ECHO_T}yes" >&6
11364                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11365                                          break
11366 else
11367   echo "$as_me: failed program was:" >&5
11368 cat "conftest.$ac_ext" >&5
11369 echo "$as_me:11369: result: no" >&5
11370 echo "${ECHO_T}no" >&6
11371                                          LIBS="$cf_save_LIBS"
11372 fi
11373 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11374                         done
11375
11376 fi
11377 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11378
11379 fi
11380
11381 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11382
11383 if test "$cf_found_library" = no ; then
11384         { { echo "$as_me:11384: error: Cannot link $cf_nculib_root library" >&5
11385 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11386    { (exit 1); exit 1; }; }
11387 fi
11388
11389 fi
11390
11391 if test -n "$cf_ncurses_LIBS" ; then
11392         echo "$as_me:11392: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11393 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11394         cf_ncurses_SAVE="$LIBS"
11395         for p in $cf_ncurses_LIBS ; do
11396                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11397                 if test "$q" != "$LIBS" ; then
11398                         LIBS="$q"
11399                 fi
11400         done
11401         cat >"conftest.$ac_ext" <<_ACEOF
11402 #line 11402 "configure"
11403 #include "confdefs.h"
11404 #include <${cf_cv_ncurses_header:-curses.h}>
11405 int
11406 main (void)
11407 {
11408 initscr(); mousemask(0,0); tigetstr((char *)0);
11409   ;
11410   return 0;
11411 }
11412 _ACEOF
11413 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11414 if { (eval echo "$as_me:11414: \"$ac_link\"") >&5
11415   (eval $ac_link) 2>&5
11416   ac_status=$?
11417   echo "$as_me:11417: \$? = $ac_status" >&5
11418   (exit "$ac_status"); } &&
11419          { ac_try='test -s "conftest$ac_exeext"'
11420   { (eval echo "$as_me:11420: \"$ac_try\"") >&5
11421   (eval $ac_try) 2>&5
11422   ac_status=$?
11423   echo "$as_me:11423: \$? = $ac_status" >&5
11424   (exit "$ac_status"); }; }; then
11425   echo "$as_me:11425: result: yes" >&5
11426 echo "${ECHO_T}yes" >&6
11427 else
11428   echo "$as_me: failed program was:" >&5
11429 cat "conftest.$ac_ext" >&5
11430 echo "$as_me:11430: result: no" >&5
11431 echo "${ECHO_T}no" >&6
11432                  LIBS="$cf_ncurses_SAVE"
11433 fi
11434 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11435 fi
11436
11437 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11438
11439 cat >>confdefs.h <<EOF
11440 #define $cf_nculib_ROOT 1
11441 EOF
11442
11443         fi
11444 else
11445         NCURSES_CONFIG=none
11446 fi
11447
11448 fi
11449
11450 if test "$NCURSES_CONFIG_PKG" != none ; then
11451         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11452
11453         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11454         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11455         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11456
11457         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11458         if test -z "$cf_cv_abi_version"
11459         then
11460                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11461         fi
11462
11463 elif test "$NCURSES_CONFIG" != none ; then
11464
11465         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11466
11467         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11468         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11469         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11470
11471         # ABI version is not available from headers
11472         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11473
11474 else
11475
11476         for cf_name in MAJOR MINOR PATCH
11477         do
11478         cat >conftest.$ac_ext <<CF_EOF
11479         #include <${cf_cv_ncurses_header:-curses.h}>
11480         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11481 CF_EOF
11482                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11483                 { (eval echo "$as_me:11483: \"$cf_try\"") >&5
11484   (eval $cf_try) 2>&5
11485   ac_status=$?
11486   echo "$as_me:11486: \$? = $ac_status" >&5
11487   (exit "$ac_status"); }
11488                 if test -f conftest.out ; then
11489                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11490                         eval NCURSES_$cf_name=\"$cf_result\"
11491                         # cat conftest.$ac_ext
11492                         # cat conftest.out
11493                 fi
11494         done
11495
11496         cf_cv_abi_version=${NCURSES_MAJOR}
11497
11498 fi
11499
11500 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11501
11502 cf_cv_timestamp=`date`
11503
11504 echo "$as_me:11504: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11505 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11506
11507 echo "$as_me:11507: checking if you want to have a library-prefix" >&5
11508 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11509
11510 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11511 if test "${with_lib_prefix+set}" = set; then
11512   withval="$with_lib_prefix"
11513   with_lib_prefix=$withval
11514 else
11515   with_lib_prefix=auto
11516 fi;
11517 echo "$as_me:11517: result: $with_lib_prefix" >&5
11518 echo "${ECHO_T}$with_lib_prefix" >&6
11519
11520 if test "$with_lib_prefix" = auto
11521 then
11522
11523         case "$cf_cv_system_name" in
11524         (OS/2*|os2*)
11525                 if test "$DFT_LWR_MODEL" = libtool; then
11526                         LIB_PREFIX='lib'
11527                 else
11528                         LIB_PREFIX=''
11529                 fi
11530                 ;;
11531         (*-msvc*)
11532                 LIB_PREFIX=''
11533                 ;;
11534         (*)     LIB_PREFIX='lib'
11535                 ;;
11536         esac
11537 cf_prefix=$LIB_PREFIX
11538
11539 elif test "$with_lib_prefix" = no
11540 then
11541         LIB_PREFIX=
11542 else
11543         LIB_PREFIX=$with_lib_prefix
11544 fi
11545
11546 LIB_SUFFIX=
11547
11548 ###############################################################################
11549
11550 if test X"$CC_G_OPT" = X"" ; then
11551         CC_G_OPT='-g'
11552         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11553 fi
11554
11555 echo "$as_me:11555: checking for default loader flags" >&5
11556 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11557 case $DFT_LWR_MODEL in
11558 (normal)  LD_MODEL=''   ;;
11559 (debug)   LD_MODEL=$CC_G_OPT ;;
11560 (profile) LD_MODEL='-pg';;
11561 (shared)  LD_MODEL=''   ;;
11562 esac
11563 echo "$as_me:11563: result: $LD_MODEL" >&5
11564 echo "${ECHO_T}$LD_MODEL" >&6
11565
11566 LD_RPATH_OPT=
11567 if test "x$cf_cv_enable_rpath" != xno
11568 then
11569         echo "$as_me:11569: checking for an rpath option" >&5
11570 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11571         case "$cf_cv_system_name" in
11572         (irix*)
11573                 if test "$GCC" = yes; then
11574                         LD_RPATH_OPT="-Wl,-rpath,"
11575                 else
11576                         LD_RPATH_OPT="-rpath "
11577                 fi
11578                 ;;
11579         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11580                 LD_RPATH_OPT="-Wl,-rpath,"
11581                 ;;
11582         (openbsd[2-9].*|mirbsd*)
11583                 LD_RPATH_OPT="-Wl,-rpath,"
11584                 ;;
11585         (dragonfly*)
11586                 LD_RPATH_OPT="-rpath "
11587                 ;;
11588         (netbsd*)
11589                 LD_RPATH_OPT="-Wl,-rpath,"
11590                 ;;
11591         (osf*|mls+*)
11592                 LD_RPATH_OPT="-rpath "
11593                 ;;
11594         (solaris2*)
11595                 LD_RPATH_OPT="-R"
11596                 ;;
11597         (*)
11598                 ;;
11599         esac
11600         echo "$as_me:11600: result: $LD_RPATH_OPT" >&5
11601 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11602
11603         case "x$LD_RPATH_OPT" in
11604         (x-R*)
11605                 echo "$as_me:11605: checking if we need a space after rpath option" >&5
11606 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11607                 cf_save_LIBS="$LIBS"
11608
11609 cf_add_libs="$LIBS"
11610 # reverse order
11611 cf_add_0lib=
11612 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11613 # filter duplicates
11614 for cf_add_1lib in $cf_add_0lib; do
11615         for cf_add_2lib in $cf_add_libs; do
11616                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11617                         cf_add_1lib=
11618                         break
11619                 fi
11620         done
11621         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11622 done
11623 LIBS="$cf_add_libs"
11624
11625                 cat >"conftest.$ac_ext" <<_ACEOF
11626 #line 11626 "configure"
11627 #include "confdefs.h"
11628
11629 int
11630 main (void)
11631 {
11632
11633   ;
11634   return 0;
11635 }
11636 _ACEOF
11637 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11638 if { (eval echo "$as_me:11638: \"$ac_link\"") >&5
11639   (eval $ac_link) 2>&5
11640   ac_status=$?
11641   echo "$as_me:11641: \$? = $ac_status" >&5
11642   (exit "$ac_status"); } &&
11643          { ac_try='test -s "conftest$ac_exeext"'
11644   { (eval echo "$as_me:11644: \"$ac_try\"") >&5
11645   (eval $ac_try) 2>&5
11646   ac_status=$?
11647   echo "$as_me:11647: \$? = $ac_status" >&5
11648   (exit "$ac_status"); }; }; then
11649   cf_rpath_space=no
11650 else
11651   echo "$as_me: failed program was:" >&5
11652 cat "conftest.$ac_ext" >&5
11653 cf_rpath_space=yes
11654 fi
11655 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11656                 LIBS="$cf_save_LIBS"
11657                 echo "$as_me:11657: result: $cf_rpath_space" >&5
11658 echo "${ECHO_T}$cf_rpath_space" >&6
11659                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11660                 ;;
11661         esac
11662 fi
11663
11664         RM_SHARED_OPTS=
11665         LOCAL_LDFLAGS=
11666         LOCAL_LDFLAGS2=
11667         LD_SHARED_OPTS=
11668         INSTALL_LIB="-m 644"
11669         : ${rel_builddir:=.}
11670
11671         shlibdir=$libdir
11672
11673         MAKE_DLLS="#"
11674
11675         cf_cv_do_symlinks=no
11676         cf_ld_rpath_opt=
11677         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11678
11679         echo "$as_me:11679: checking if release/abi version should be used for shared libs" >&5
11680 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11681
11682 # Check whether --with-shlib-version or --without-shlib-version was given.
11683 if test "${with_shlib_version+set}" = set; then
11684   withval="$with_shlib_version"
11685   test -z "$withval" && withval=auto
11686         case "$withval" in
11687         (yes)
11688                 cf_cv_shlib_version=auto
11689                 ;;
11690         (rel|abi|auto)
11691                 cf_cv_shlib_version=$withval
11692                 ;;
11693         (*)
11694                 echo "$as_me:11694: result: $withval" >&5
11695 echo "${ECHO_T}$withval" >&6
11696                 { { echo "$as_me:11696: error: option value must be one of: rel, abi, or auto" >&5
11697 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11698    { (exit 1); exit 1; }; }
11699                 ;;
11700         esac
11701
11702 else
11703   cf_cv_shlib_version=auto
11704 fi;
11705         echo "$as_me:11705: result: $cf_cv_shlib_version" >&5
11706 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11707
11708         cf_cv_rm_so_locs=no
11709         cf_try_cflags=
11710
11711         # Some less-capable ports of gcc support only -fpic
11712         CC_SHARED_OPTS=
11713
11714         cf_try_fPIC=no
11715         if test "$GCC" = yes
11716         then
11717                 cf_try_fPIC=yes
11718         else
11719                 case "$cf_cv_system_name" in
11720                 (*linux*)       # e.g., PGI compiler
11721                         cf_try_fPIC=yes
11722                         ;;
11723                 esac
11724         fi
11725
11726         if test "$cf_try_fPIC" = yes
11727         then
11728                 echo "$as_me:11728: checking which $CC option to use" >&5
11729 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11730                 cf_save_CFLAGS="$CFLAGS"
11731                 for CC_SHARED_OPTS in -fPIC -fpic ''
11732                 do
11733                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11734                         cat >"conftest.$ac_ext" <<_ACEOF
11735 #line 11735 "configure"
11736 #include "confdefs.h"
11737 #include <stdio.h>
11738 int
11739 main (void)
11740 {
11741 int x = 1
11742   ;
11743   return 0;
11744 }
11745 _ACEOF
11746 rm -f "conftest.$ac_objext"
11747 if { (eval echo "$as_me:11747: \"$ac_compile\"") >&5
11748   (eval $ac_compile) 2>&5
11749   ac_status=$?
11750   echo "$as_me:11750: \$? = $ac_status" >&5
11751   (exit "$ac_status"); } &&
11752          { ac_try='test -s "conftest.$ac_objext"'
11753   { (eval echo "$as_me:11753: \"$ac_try\"") >&5
11754   (eval $ac_try) 2>&5
11755   ac_status=$?
11756   echo "$as_me:11756: \$? = $ac_status" >&5
11757   (exit "$ac_status"); }; }; then
11758   break
11759 else
11760   echo "$as_me: failed program was:" >&5
11761 cat "conftest.$ac_ext" >&5
11762 fi
11763 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11764                 done
11765                 echo "$as_me:11765: result: $CC_SHARED_OPTS" >&5
11766 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11767                 CFLAGS="$cf_save_CFLAGS"
11768         fi
11769
11770         cf_cv_shlib_version_infix=no
11771
11772         case "$cf_cv_system_name" in
11773         (aix4.3-9*|aix[5-7]*)
11774                 if test "$GCC" = yes; then
11775                         CC_SHARED_OPTS='-Wl,-brtl'
11776                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11777                 else
11778                         CC_SHARED_OPTS='-brtl'
11779                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11780                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11781                 fi
11782                 ;;
11783         (beos*)
11784                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11785                 ;;
11786         (cygwin*)
11787                 CC_SHARED_OPTS=
11788                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11789                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11790                 cf_cv_shlib_version=cygdll
11791                 cf_cv_shlib_version_infix=cygdll
11792                 shlibdir=$bindir
11793                 MAKE_DLLS=
11794                 cat >mk_shared_lib.sh <<-CF_EOF
11795                 #!$SHELL
11796                 SHARED_LIB=\$1
11797                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11798                 shift
11799                 cat <<-EOF
11800                 Linking shared library
11801                 ** SHARED_LIB \$SHARED_LIB
11802                 ** IMPORT_LIB \$IMPORT_LIB
11803 EOF
11804                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11805 CF_EOF
11806                 chmod +x mk_shared_lib.sh
11807                 ;;
11808         (msys*)
11809                 CC_SHARED_OPTS=
11810                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11811                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11812                 cf_cv_shlib_version=msysdll
11813                 cf_cv_shlib_version_infix=msysdll
11814                 shlibdir=$bindir
11815                 MAKE_DLLS=
11816                 cat >mk_shared_lib.sh <<-CF_EOF
11817                 #!$SHELL
11818                 SHARED_LIB=\$1
11819                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11820                 shift
11821                 cat <<-EOF
11822                 Linking shared library
11823                 ** SHARED_LIB \$SHARED_LIB
11824                 ** IMPORT_LIB \$IMPORT_LIB
11825 EOF
11826                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11827 CF_EOF
11828                 chmod +x mk_shared_lib.sh
11829                 ;;
11830         (darwin*)
11831                 cf_try_cflags="no-cpp-precomp"
11832                 CC_SHARED_OPTS="-dynamic"
11833                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11834                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11835                 cf_cv_shlib_version_infix=yes
11836                 echo "$as_me:11836: checking if ld -search_paths_first works" >&5
11837 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11838 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11839   echo $ECHO_N "(cached) $ECHO_C" >&6
11840 else
11841
11842                         cf_save_LDFLAGS=$LDFLAGS
11843                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11844                         cat >"conftest.$ac_ext" <<_ACEOF
11845 #line 11845 "configure"
11846 #include "confdefs.h"
11847
11848 int
11849 main (void)
11850 {
11851 int i;
11852   ;
11853   return 0;
11854 }
11855 _ACEOF
11856 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11857 if { (eval echo "$as_me:11857: \"$ac_link\"") >&5
11858   (eval $ac_link) 2>&5
11859   ac_status=$?
11860   echo "$as_me:11860: \$? = $ac_status" >&5
11861   (exit "$ac_status"); } &&
11862          { ac_try='test -s "conftest$ac_exeext"'
11863   { (eval echo "$as_me:11863: \"$ac_try\"") >&5
11864   (eval $ac_try) 2>&5
11865   ac_status=$?
11866   echo "$as_me:11866: \$? = $ac_status" >&5
11867   (exit "$ac_status"); }; }; then
11868   cf_cv_ldflags_search_paths_first=yes
11869 else
11870   echo "$as_me: failed program was:" >&5
11871 cat "conftest.$ac_ext" >&5
11872 cf_cv_ldflags_search_paths_first=no
11873 fi
11874 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11875                                 LDFLAGS=$cf_save_LDFLAGS
11876 fi
11877 echo "$as_me:11877: result: $cf_cv_ldflags_search_paths_first" >&5
11878 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11879                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11880                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11881                 fi
11882                 ;;
11883         (haiku*)
11884
11885         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11886         if test "$cf_cv_shlib_version" = rel; then
11887                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11888         else
11889                 cf_cv_shared_soname='`basename $@`'
11890         fi
11891
11892                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11893                 ;;
11894         (hpux[7-8]*)
11895                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11896                 if test "$GCC" != yes; then
11897                         CC_SHARED_OPTS='+Z'
11898                 fi
11899                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11900                 INSTALL_LIB="-m 555"
11901                 ;;
11902         (hpux*)
11903                 # (tested with gcc 2.7.2 -- I don't have c89)
11904                 if test "$GCC" = yes; then
11905                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11906                 else
11907                         CC_SHARED_OPTS='+Z'
11908                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11909                 fi
11910                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11911                 # HP-UX shared libraries must be executable, and should be
11912                 # readonly to exploit a quirk in the memory manager.
11913                 INSTALL_LIB="-m 555"
11914                 ;;
11915         (interix*)
11916                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11917                 if test "$cf_cv_shlib_version" = rel; then
11918                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11919                 else
11920                         cf_shared_soname='`basename $@`'
11921                 fi
11922                 CC_SHARED_OPTS=
11923                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11924                 ;;
11925         (irix*)
11926                 if test "$cf_cv_enable_rpath" = yes ; then
11927                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11928                 fi
11929                 # tested with IRIX 5.2 and 'cc'.
11930                 if test "$GCC" != yes; then
11931                         CC_SHARED_OPTS='-KPIC'
11932                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11933                 else
11934                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11935                 fi
11936                 cf_cv_rm_so_locs=yes
11937                 ;;
11938         (linux*|gnu*|k*bsd*-gnu)
11939                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11940                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11941                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11942                 fi
11943                 if test "$cf_cv_enable_rpath" = yes ; then
11944                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11945                 fi
11946
11947         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11948         if test "$cf_cv_shlib_version" = rel; then
11949                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11950         else
11951                 cf_cv_shared_soname='`basename $@`'
11952         fi
11953
11954                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11955                 ;;
11956         (mingw*msvc*)
11957                 cf_cv_shlib_version=msvcdll
11958                 cf_cv_shlib_version_infix=msvcdll
11959                 shlibdir=$bindir
11960                 MAKE_DLLS=
11961                 if test "$DFT_LWR_MODEL" = "shared" ; then
11962                         LOCAL_LDFLAGS="-link -dll"
11963                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11964                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11965                 fi
11966                 CC_SHARED_OPTS=
11967                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11968                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11969                 cat >mk_shared_lib.sh <<-CF_EOF
11970                 #!$SHELL
11971                 SHARED_LIB=\$1
11972                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11973                 shift
11974                 my_ld=\$1
11975                 shift
11976                 cat <<-EOF
11977                 Linking shared library
11978                 ** SHARED LIB \$SHARED_LIB
11979                 ** IMPORT_LIB \$IMPORT_LIB
11980 EOF
11981                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11982                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11983                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11984 CF_EOF
11985                 chmod +x mk_shared_lib.sh
11986                 cat >mk_prog.sh <<-CF_EOF
11987                 #!$SHELL
11988                 shift
11989                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11990                 LD="$LD"
11991                 clopts=()
11992                 ldopts=("/subsystem:console")
11993                 libs=()
11994                 isdll=0
11995                 while test \$# -gt 0; do
11996                         case "\$1" in
11997                                 -link)
11998                                         # ignore -link argument
11999                                         ;;
12000                                 -M[TD] | -M[TD]d)
12001                                         # ignore runtime-library option
12002                                         ;;
12003                                 -dll)
12004                                         isdll=1
12005                                         ;;
12006                                 -W* | -w*)
12007                                         # ignore warnings
12008                                         ;;
12009                                 -D*)
12010                                         clopts+=("\$1")
12011                                         ;;
12012                                 -I*)
12013                                         clopts+=("\$1")
12014                                         ;;
12015                                 -l*)
12016                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12017                                         ;;
12018                                 -L*)
12019                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12020                                         ;;
12021                                 *.obj | *.o)
12022                                         ldopts+=("\$1")
12023                                         ;;
12024                                 -Wl,*)
12025                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12026                                                 ldopts+=("\${linkarg}")
12027                                         done
12028                                         ;;
12029                                 *.lib)
12030                                         ldopts+=("\$1")
12031                                         ;;
12032                                 -o)
12033                                         shift
12034                                         ldopts+=("-out:\$1")
12035                                         ;;
12036                                 *)
12037                                         clopts+=("\$1")
12038                                         ldopts+=("\$1")
12039                                         ;;
12040                         esac
12041                         shift
12042                 done
12043                 if [ "\$isdll" -ne 0 ]; then
12044                         for lib in \${libs[*]}; do
12045                                 ldopts+=("\$lib.dll.lib")
12046                         done
12047                 else
12048                         for lib in \${libs[*]}; do
12049                                 ldopts+=("\$lib.lib")
12050                         done
12051                 fi
12052                 cat <<-EOF
12053                 Creating program
12054                 ** ld options:   "\${ldopts[@]}"
12055 EOF
12056                 exec \$LD \${ldopts[@]}
12057 CF_EOF
12058                 chmod +x mk_prog.sh
12059                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12060                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12061                 ;;
12062         (mingw*)
12063                 cf_cv_shlib_version=mingw
12064                 cf_cv_shlib_version_infix=mingw
12065                 shlibdir=$bindir
12066                 MAKE_DLLS=
12067                 if test "$DFT_LWR_MODEL" = "shared" ; then
12068                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12069                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12070                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12071                 fi
12072                 CC_SHARED_OPTS=
12073                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12074                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12075                 cat >mk_shared_lib.sh <<-CF_EOF
12076                 #!$SHELL
12077                 SHARED_LIB=\$1
12078                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12079                 shift
12080                 cat <<-EOF
12081                 Linking shared library
12082                 ** SHARED_LIB \$SHARED_LIB
12083                 ** IMPORT_LIB \$IMPORT_LIB
12084 EOF
12085                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12086 CF_EOF
12087                 chmod +x mk_shared_lib.sh
12088                 ;;
12089         (openbsd[2-9].*|mirbsd*)
12090                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12091                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12092                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12093                 fi
12094                 if test "$cf_cv_enable_rpath" = yes ; then
12095                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12096                 fi
12097                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12098
12099         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12100         if test "$cf_cv_shlib_version" = rel; then
12101                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12102         else
12103                 cf_cv_shared_soname='`basename $@`'
12104         fi
12105
12106                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12107                 ;;
12108         (nskJ*)
12109                 CC_SHARED_OPTS=
12110                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12111                 ;;
12112         (nskL*)
12113                 CC_SHARED_OPTS=
12114                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12115                 ;;
12116         (nto-qnx*|openbsd*|freebsd[12].*)
12117                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12118                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12119                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12120                 ;;
12121         (dragonfly*|freebsd*)
12122                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12123                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12124                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12125                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12126                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12127                 fi
12128
12129         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12130         if test "$cf_cv_shlib_version" = rel; then
12131                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12132         else
12133                 cf_cv_shared_soname='`basename $@`'
12134         fi
12135
12136                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12137                 ;;
12138         (netbsd*)
12139                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12140                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12141                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12142                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12143                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12144                         if test "$cf_cv_shlib_version" = auto; then
12145                         if test -f /usr/libexec/ld.elf_so; then
12146                                 cf_cv_shlib_version=abi
12147                         else
12148                                 cf_cv_shlib_version=rel
12149                         fi
12150                         fi
12151
12152         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12153         if test "$cf_cv_shlib_version" = rel; then
12154                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12155         else
12156                 cf_cv_shared_soname='`basename $@`'
12157         fi
12158
12159                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12160                 else
12161                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12162                 fi
12163                 ;;
12164         (osf*|mls+*)
12165                 # tested with OSF/1 V3.2 and 'cc'
12166                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12167                 # link with shared libs).
12168                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12169                 case "$host_os" in
12170                 (osf4*)
12171                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12172                         ;;
12173                 esac
12174                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12175                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12176                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12177                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12178                 fi
12179                 cf_cv_rm_so_locs=yes
12180                 ;;
12181         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12182                 # tested with osr5.0.5
12183                 if test "$GCC" != yes; then
12184                         CC_SHARED_OPTS='-belf -KPIC'
12185                 fi
12186                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12187                 if test "$cf_cv_enable_rpath" = yes ; then
12188                         # only way is to set LD_RUN_PATH but no switch for it
12189                         RUN_PATH=$libdir
12190                 fi
12191                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12192                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12193                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12194                 ;;
12195         (sunos4*)
12196                 # tested with SunOS 4.1.1 and gcc 2.7.0
12197                 if test "$GCC" != yes; then
12198                         CC_SHARED_OPTS='-KPIC'
12199                 fi
12200                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12201                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12202                 ;;
12203         (solaris2*)
12204                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12205                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12206                 if test "$DFT_LWR_MODEL" = "shared" ; then
12207                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12208                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12209                 fi
12210                 if test "$cf_cv_enable_rpath" = yes ; then
12211                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12212                 fi
12213
12214         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12215         if test "$cf_cv_shlib_version" = rel; then
12216                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12217         else
12218                 cf_cv_shared_soname='`basename $@`'
12219         fi
12220
12221                 if test "$GCC" != yes; then
12222                         cf_save_CFLAGS="$CFLAGS"
12223                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12224                         do
12225                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12226                                 cat >"conftest.$ac_ext" <<_ACEOF
12227 #line 12227 "configure"
12228 #include "confdefs.h"
12229 #include <stdio.h>
12230 int
12231 main (void)
12232 {
12233 printf("Hello\\n");
12234   ;
12235   return 0;
12236 }
12237 _ACEOF
12238 rm -f "conftest.$ac_objext"
12239 if { (eval echo "$as_me:12239: \"$ac_compile\"") >&5
12240   (eval $ac_compile) 2>&5
12241   ac_status=$?
12242   echo "$as_me:12242: \$? = $ac_status" >&5
12243   (exit "$ac_status"); } &&
12244          { ac_try='test -s "conftest.$ac_objext"'
12245   { (eval echo "$as_me:12245: \"$ac_try\"") >&5
12246   (eval $ac_try) 2>&5
12247   ac_status=$?
12248   echo "$as_me:12248: \$? = $ac_status" >&5
12249   (exit "$ac_status"); }; }; then
12250   break
12251 else
12252   echo "$as_me: failed program was:" >&5
12253 cat "conftest.$ac_ext" >&5
12254 fi
12255 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12256                         done
12257                         CFLAGS="$cf_save_CFLAGS"
12258                         CC_SHARED_OPTS=$cf_shared_opts
12259                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12260                 else
12261                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12262                 fi
12263                 ;;
12264         (sysv5uw7*|unix_sv*)
12265                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12266                 if test "$GCC" != yes; then
12267                         CC_SHARED_OPTS='-KPIC'
12268                 fi
12269                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12270                 ;;
12271         (*)
12272                 CC_SHARED_OPTS='unknown'
12273                 MK_SHARED_LIB='echo unknown'
12274                 ;;
12275         esac
12276
12277         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12278         case "$cf_cv_shlib_version" in
12279         (rel|abi)
12280                 case "$MK_SHARED_LIB" in
12281                 (*'-o $@')
12282                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12283                         ;;
12284                 (*)
12285                         { echo "$as_me:12285: WARNING: ignored --with-shlib-version" >&5
12286 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12287                         ;;
12288                 esac
12289                 ;;
12290         esac
12291
12292         if test -n "$cf_try_cflags"
12293         then
12294 cat > conftest.$ac_ext <<EOF
12295 #line 12295 "${as_me:-configure}"
12296 #include <stdio.h>
12297 int main(int argc, char *argv[])
12298 {
12299         printf("hello\\n");
12300         return (argv[argc-1] == 0) ;
12301 }
12302 EOF
12303                 cf_save_CFLAGS="$CFLAGS"
12304                 for cf_opt in $cf_try_cflags
12305                 do
12306                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12307                         echo "$as_me:12307: checking if CFLAGS option -$cf_opt works" >&5
12308 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12309                         if { (eval echo "$as_me:12309: \"$ac_compile\"") >&5
12310   (eval $ac_compile) 2>&5
12311   ac_status=$?
12312   echo "$as_me:12312: \$? = $ac_status" >&5
12313   (exit "$ac_status"); }; then
12314                                 echo "$as_me:12314: result: yes" >&5
12315 echo "${ECHO_T}yes" >&6
12316                                 cf_save_CFLAGS="$CFLAGS"
12317                         else
12318                                 echo "$as_me:12318: result: no" >&5
12319 echo "${ECHO_T}no" >&6
12320                         fi
12321                 done
12322                 CFLAGS="$cf_save_CFLAGS"
12323         fi
12324
12325         # RPATH_LIST is a colon-separated list of directories
12326         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12327         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12328
12329         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12330
12331         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12332
12333 echo "${as_me:-configure}:12333: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12334
12335         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12336
12337 echo "${as_me:-configure}:12337: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12338
12339 # The test/sample programs in the original tree link using rpath option.
12340 # Make it optional for packagers.
12341 if test -n "$LOCAL_LDFLAGS"
12342 then
12343         echo "$as_me:12343: checking if you want to link sample programs with rpath option" >&5
12344 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12345
12346 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12347 if test "${enable_rpath_link+set}" = set; then
12348   enableval="$enable_rpath_link"
12349   with_rpath_link=$enableval
12350 else
12351   with_rpath_link=yes
12352 fi;
12353         echo "$as_me:12353: result: $with_rpath_link" >&5
12354 echo "${ECHO_T}$with_rpath_link" >&6
12355         if test "$with_rpath_link" = no
12356         then
12357                 LOCAL_LDFLAGS=
12358                 LOCAL_LDFLAGS2=
12359         fi
12360 fi
12361
12362 ###############################################################################
12363
12364 ###   use option --enable-broken-linker to force on use of broken-linker support
12365
12366 echo "$as_me:12366: checking if you want broken-linker support code" >&5
12367 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12368
12369 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12370 if test "${enable_broken_linker+set}" = set; then
12371   enableval="$enable_broken_linker"
12372   with_broken_linker=$enableval
12373 else
12374   with_broken_linker=no
12375 fi;
12376 echo "$as_me:12376: result: $with_broken_linker" >&5
12377 echo "${ECHO_T}$with_broken_linker" >&6
12378
12379 : "${BROKEN_LINKER:=0}"
12380 if test "x$with_broken_linker" = xyes ; then
12381
12382 cat >>confdefs.h <<\EOF
12383 #define BROKEN_LINKER 1
12384 EOF
12385
12386         BROKEN_LINKER=1
12387 fi
12388
12389 # Check to define _XOPEN_SOURCE "automatically"
12390
12391 echo "$as_me:12391: checking if the POSIX test-macros are already defined" >&5
12392 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12393 if test "${cf_cv_posix_visible+set}" = set; then
12394   echo $ECHO_N "(cached) $ECHO_C" >&6
12395 else
12396
12397 cat >"conftest.$ac_ext" <<_ACEOF
12398 #line 12398 "configure"
12399 #include "confdefs.h"
12400 #include <stdio.h>
12401 int
12402 main (void)
12403 {
12404
12405 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12406         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12407         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12408         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12409 #error conflicting symbols found
12410 #endif
12411
12412   ;
12413   return 0;
12414 }
12415 _ACEOF
12416 rm -f "conftest.$ac_objext"
12417 if { (eval echo "$as_me:12417: \"$ac_compile\"") >&5
12418   (eval $ac_compile) 2>&5
12419   ac_status=$?
12420   echo "$as_me:12420: \$? = $ac_status" >&5
12421   (exit "$ac_status"); } &&
12422          { ac_try='test -s "conftest.$ac_objext"'
12423   { (eval echo "$as_me:12423: \"$ac_try\"") >&5
12424   (eval $ac_try) 2>&5
12425   ac_status=$?
12426   echo "$as_me:12426: \$? = $ac_status" >&5
12427   (exit "$ac_status"); }; }; then
12428   cf_cv_posix_visible=no
12429 else
12430   echo "$as_me: failed program was:" >&5
12431 cat "conftest.$ac_ext" >&5
12432 cf_cv_posix_visible=yes
12433 fi
12434 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12435
12436 fi
12437 echo "$as_me:12437: result: $cf_cv_posix_visible" >&5
12438 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12439
12440 if test "$cf_cv_posix_visible" = no; then
12441
12442 cf_XOPEN_SOURCE=600
12443 cf_POSIX_C_SOURCE=199506L
12444 cf_xopen_source=
12445
12446 case "$host_os" in
12447 (aix[4-7]*)
12448         cf_xopen_source="-D_ALL_SOURCE"
12449         ;;
12450 (msys)
12451         cf_XOPEN_SOURCE=600
12452         ;;
12453 (darwin[0-8].*)
12454         cf_xopen_source="-D_APPLE_C_SOURCE"
12455         ;;
12456 (darwin*)
12457         cf_xopen_source="-D_DARWIN_C_SOURCE"
12458         cf_XOPEN_SOURCE=
12459         ;;
12460 (freebsd*|dragonfly*|midnightbsd*)
12461         # 5.x headers associate
12462         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12463         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12464         cf_POSIX_C_SOURCE=200112L
12465         cf_XOPEN_SOURCE=600
12466         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12467         ;;
12468 (hpux11*)
12469         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12470         ;;
12471 (hpux*)
12472         cf_xopen_source="-D_HPUX_SOURCE"
12473         ;;
12474 (irix[56].*)
12475         cf_xopen_source="-D_SGI_SOURCE"
12476         cf_XOPEN_SOURCE=
12477         ;;
12478 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12479
12480 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12481
12482 echo "$as_me:12482: checking if this is the GNU C library" >&5
12483 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12484 if test "${cf_cv_gnu_library+set}" = set; then
12485   echo $ECHO_N "(cached) $ECHO_C" >&6
12486 else
12487
12488 cat >"conftest.$ac_ext" <<_ACEOF
12489 #line 12489 "configure"
12490 #include "confdefs.h"
12491 #include <sys/types.h>
12492 int
12493 main (void)
12494 {
12495
12496         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12497                 return 0;
12498         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12499                 return 0;
12500         #else
12501         #       error not GNU C library
12502         #endif
12503   ;
12504   return 0;
12505 }
12506 _ACEOF
12507 rm -f "conftest.$ac_objext"
12508 if { (eval echo "$as_me:12508: \"$ac_compile\"") >&5
12509   (eval $ac_compile) 2>&5
12510   ac_status=$?
12511   echo "$as_me:12511: \$? = $ac_status" >&5
12512   (exit "$ac_status"); } &&
12513          { ac_try='test -s "conftest.$ac_objext"'
12514   { (eval echo "$as_me:12514: \"$ac_try\"") >&5
12515   (eval $ac_try) 2>&5
12516   ac_status=$?
12517   echo "$as_me:12517: \$? = $ac_status" >&5
12518   (exit "$ac_status"); }; }; then
12519   cf_cv_gnu_library=yes
12520 else
12521   echo "$as_me: failed program was:" >&5
12522 cat "conftest.$ac_ext" >&5
12523 cf_cv_gnu_library=no
12524 fi
12525 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12526
12527 fi
12528 echo "$as_me:12528: result: $cf_cv_gnu_library" >&5
12529 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12530
12531 if test x$cf_cv_gnu_library = xyes; then
12532
12533         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12534         # was changed to help a little.  newlib incorporated the change about 4
12535         # years later.
12536         echo "$as_me:12536: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12537 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12538 if test "${cf_cv_gnu_library_219+set}" = set; then
12539   echo $ECHO_N "(cached) $ECHO_C" >&6
12540 else
12541
12542                 cf_save="$CPPFLAGS"
12543
12544         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12545         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12546
12547                 cat >"conftest.$ac_ext" <<_ACEOF
12548 #line 12548 "configure"
12549 #include "confdefs.h"
12550 #include <sys/types.h>
12551 int
12552 main (void)
12553 {
12554
12555                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12556                                 return 0;
12557                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12558                                 return 0;
12559                         #else
12560                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12561                         #endif
12562   ;
12563   return 0;
12564 }
12565 _ACEOF
12566 rm -f "conftest.$ac_objext"
12567 if { (eval echo "$as_me:12567: \"$ac_compile\"") >&5
12568   (eval $ac_compile) 2>&5
12569   ac_status=$?
12570   echo "$as_me:12570: \$? = $ac_status" >&5
12571   (exit "$ac_status"); } &&
12572          { ac_try='test -s "conftest.$ac_objext"'
12573   { (eval echo "$as_me:12573: \"$ac_try\"") >&5
12574   (eval $ac_try) 2>&5
12575   ac_status=$?
12576   echo "$as_me:12576: \$? = $ac_status" >&5
12577   (exit "$ac_status"); }; }; then
12578   cf_cv_gnu_library_219=yes
12579 else
12580   echo "$as_me: failed program was:" >&5
12581 cat "conftest.$ac_ext" >&5
12582 cf_cv_gnu_library_219=no
12583 fi
12584 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12585                 CPPFLAGS="$cf_save"
12586
12587 fi
12588 echo "$as_me:12588: result: $cf_cv_gnu_library_219" >&5
12589 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12590
12591         if test "x$cf_cv_gnu_library_219" = xyes; then
12592                 cf_save="$CPPFLAGS"
12593                 echo "$as_me:12593: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12594 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12595 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12596   echo $ECHO_N "(cached) $ECHO_C" >&6
12597 else
12598
12599 cf_fix_cppflags=no
12600 cf_new_cflags=
12601 cf_new_cppflags=
12602 cf_new_extra_cppflags=
12603
12604 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12605 do
12606 case "$cf_fix_cppflags" in
12607 (no)
12608         case "$cf_add_cflags" in
12609         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12610                 case "$cf_add_cflags" in
12611                 (-D*)
12612                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12613
12614                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12615                                 && test -z "${cf_tst_cflags}" \
12616                                 && cf_fix_cppflags=yes
12617
12618                         if test "$cf_fix_cppflags" = yes ; then
12619
12620         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12621         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12622
12623                                 continue
12624                         elif test "${cf_tst_cflags}" = "\"'" ; then
12625
12626         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12627         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12628
12629                                 continue
12630                         fi
12631                         ;;
12632                 esac
12633                 case "$CPPFLAGS" in
12634                 (*$cf_add_cflags)
12635                         ;;
12636                 (*)
12637                         case "$cf_add_cflags" in
12638                         (-D*)
12639                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12640
12641 CPPFLAGS=`echo "$CPPFLAGS" | \
12642         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12643                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12644
12645                                 ;;
12646                         esac
12647
12648         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12649         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12650
12651                         ;;
12652                 esac
12653                 ;;
12654         (*)
12655
12656         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12657         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12658
12659                 ;;
12660         esac
12661         ;;
12662 (yes)
12663
12664         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12665         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12666
12667         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12668
12669         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12670                 && test -z "${cf_tst_cflags}" \
12671                 && cf_fix_cppflags=no
12672         ;;
12673 esac
12674 done
12675
12676 if test -n "$cf_new_cflags" ; then
12677
12678         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12679         CFLAGS="${CFLAGS}$cf_new_cflags"
12680
12681 fi
12682
12683 if test -n "$cf_new_cppflags" ; then
12684
12685         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12686         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12687
12688 fi
12689
12690 if test -n "$cf_new_extra_cppflags" ; then
12691
12692         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12693         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12694
12695 fi
12696
12697                         cat >"conftest.$ac_ext" <<_ACEOF
12698 #line 12698 "configure"
12699 #include "confdefs.h"
12700
12701                                 #include <limits.h>
12702                                 #include <sys/types.h>
12703
12704 int
12705 main (void)
12706 {
12707
12708                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12709                                         return 0;
12710                                 #else
12711                                 #       error GNU C library is too old
12712                                 #endif
12713   ;
12714   return 0;
12715 }
12716 _ACEOF
12717 rm -f "conftest.$ac_objext"
12718 if { (eval echo "$as_me:12718: \"$ac_compile\"") >&5
12719   (eval $ac_compile) 2>&5
12720   ac_status=$?
12721   echo "$as_me:12721: \$? = $ac_status" >&5
12722   (exit "$ac_status"); } &&
12723          { ac_try='test -s "conftest.$ac_objext"'
12724   { (eval echo "$as_me:12724: \"$ac_try\"") >&5
12725   (eval $ac_try) 2>&5
12726   ac_status=$?
12727   echo "$as_me:12727: \$? = $ac_status" >&5
12728   (exit "$ac_status"); }; }; then
12729   cf_cv_gnu_dftsrc_219=yes
12730 else
12731   echo "$as_me: failed program was:" >&5
12732 cat "conftest.$ac_ext" >&5
12733 cf_cv_gnu_dftsrc_219=no
12734 fi
12735 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12736
12737 fi
12738 echo "$as_me:12738: result: $cf_cv_gnu_dftsrc_219" >&5
12739 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12740                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12741         else
12742                 cf_cv_gnu_dftsrc_219=maybe
12743         fi
12744
12745         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12746
12747                 echo "$as_me:12747: checking if we must define _GNU_SOURCE" >&5
12748 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12749 if test "${cf_cv_gnu_source+set}" = set; then
12750   echo $ECHO_N "(cached) $ECHO_C" >&6
12751 else
12752
12753                 cat >"conftest.$ac_ext" <<_ACEOF
12754 #line 12754 "configure"
12755 #include "confdefs.h"
12756 #include <sys/types.h>
12757 int
12758 main (void)
12759 {
12760
12761                         #ifndef _XOPEN_SOURCE
12762                         #error  expected _XOPEN_SOURCE to be defined
12763                         #endif
12764   ;
12765   return 0;
12766 }
12767 _ACEOF
12768 rm -f "conftest.$ac_objext"
12769 if { (eval echo "$as_me:12769: \"$ac_compile\"") >&5
12770   (eval $ac_compile) 2>&5
12771   ac_status=$?
12772   echo "$as_me:12772: \$? = $ac_status" >&5
12773   (exit "$ac_status"); } &&
12774          { ac_try='test -s "conftest.$ac_objext"'
12775   { (eval echo "$as_me:12775: \"$ac_try\"") >&5
12776   (eval $ac_try) 2>&5
12777   ac_status=$?
12778   echo "$as_me:12778: \$? = $ac_status" >&5
12779   (exit "$ac_status"); }; }; then
12780   cf_cv_gnu_source=no
12781 else
12782   echo "$as_me: failed program was:" >&5
12783 cat "conftest.$ac_ext" >&5
12784 cf_save="$CPPFLAGS"
12785
12786 cf_fix_cppflags=no
12787 cf_new_cflags=
12788 cf_new_cppflags=
12789 cf_new_extra_cppflags=
12790
12791 for cf_add_cflags in -D_GNU_SOURCE
12792 do
12793 case "$cf_fix_cppflags" in
12794 (no)
12795         case "$cf_add_cflags" in
12796         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12797                 case "$cf_add_cflags" in
12798                 (-D*)
12799                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12800
12801                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12802                                 && test -z "${cf_tst_cflags}" \
12803                                 && cf_fix_cppflags=yes
12804
12805                         if test "$cf_fix_cppflags" = yes ; then
12806
12807         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12808         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12809
12810                                 continue
12811                         elif test "${cf_tst_cflags}" = "\"'" ; then
12812
12813         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12814         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12815
12816                                 continue
12817                         fi
12818                         ;;
12819                 esac
12820                 case "$CPPFLAGS" in
12821                 (*$cf_add_cflags)
12822                         ;;
12823                 (*)
12824                         case "$cf_add_cflags" in
12825                         (-D*)
12826                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12827
12828 CPPFLAGS=`echo "$CPPFLAGS" | \
12829         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12830                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12831
12832                                 ;;
12833                         esac
12834
12835         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12836         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12837
12838                         ;;
12839                 esac
12840                 ;;
12841         (*)
12842
12843         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12844         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12845
12846                 ;;
12847         esac
12848         ;;
12849 (yes)
12850
12851         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12852         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12853
12854         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12855
12856         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12857                 && test -z "${cf_tst_cflags}" \
12858                 && cf_fix_cppflags=no
12859         ;;
12860 esac
12861 done
12862
12863 if test -n "$cf_new_cflags" ; then
12864
12865         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12866         CFLAGS="${CFLAGS}$cf_new_cflags"
12867
12868 fi
12869
12870 if test -n "$cf_new_cppflags" ; then
12871
12872         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12873         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12874
12875 fi
12876
12877 if test -n "$cf_new_extra_cppflags" ; then
12878
12879         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12880         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12881
12882 fi
12883
12884                          cat >"conftest.$ac_ext" <<_ACEOF
12885 #line 12885 "configure"
12886 #include "confdefs.h"
12887 #include <sys/types.h>
12888 int
12889 main (void)
12890 {
12891
12892                                 #ifdef _XOPEN_SOURCE
12893                                 #error  expected _XOPEN_SOURCE to be undefined
12894                                 #endif
12895   ;
12896   return 0;
12897 }
12898 _ACEOF
12899 rm -f "conftest.$ac_objext"
12900 if { (eval echo "$as_me:12900: \"$ac_compile\"") >&5
12901   (eval $ac_compile) 2>&5
12902   ac_status=$?
12903   echo "$as_me:12903: \$? = $ac_status" >&5
12904   (exit "$ac_status"); } &&
12905          { ac_try='test -s "conftest.$ac_objext"'
12906   { (eval echo "$as_me:12906: \"$ac_try\"") >&5
12907   (eval $ac_try) 2>&5
12908   ac_status=$?
12909   echo "$as_me:12909: \$? = $ac_status" >&5
12910   (exit "$ac_status"); }; }; then
12911   cf_cv_gnu_source=no
12912 else
12913   echo "$as_me: failed program was:" >&5
12914 cat "conftest.$ac_ext" >&5
12915 cf_cv_gnu_source=yes
12916 fi
12917 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12918                         CPPFLAGS="$cf_save"
12919
12920 fi
12921 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12922
12923 fi
12924 echo "$as_me:12924: result: $cf_cv_gnu_source" >&5
12925 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12926
12927                 if test "$cf_cv_gnu_source" = yes
12928                 then
12929                 echo "$as_me:12929: checking if we should also define _DEFAULT_SOURCE" >&5
12930 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12931 if test "${cf_cv_default_source+set}" = set; then
12932   echo $ECHO_N "(cached) $ECHO_C" >&6
12933 else
12934
12935         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12936         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12937
12938                         cat >"conftest.$ac_ext" <<_ACEOF
12939 #line 12939 "configure"
12940 #include "confdefs.h"
12941 #include <sys/types.h>
12942 int
12943 main (void)
12944 {
12945
12946                                 #ifdef _DEFAULT_SOURCE
12947                                 #error  expected _DEFAULT_SOURCE to be undefined
12948                                 #endif
12949   ;
12950   return 0;
12951 }
12952 _ACEOF
12953 rm -f "conftest.$ac_objext"
12954 if { (eval echo "$as_me:12954: \"$ac_compile\"") >&5
12955   (eval $ac_compile) 2>&5
12956   ac_status=$?
12957   echo "$as_me:12957: \$? = $ac_status" >&5
12958   (exit "$ac_status"); } &&
12959          { ac_try='test -s "conftest.$ac_objext"'
12960   { (eval echo "$as_me:12960: \"$ac_try\"") >&5
12961   (eval $ac_try) 2>&5
12962   ac_status=$?
12963   echo "$as_me:12963: \$? = $ac_status" >&5
12964   (exit "$ac_status"); }; }; then
12965   cf_cv_default_source=no
12966 else
12967   echo "$as_me: failed program was:" >&5
12968 cat "conftest.$ac_ext" >&5
12969 cf_cv_default_source=yes
12970 fi
12971 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12972
12973 fi
12974 echo "$as_me:12974: result: $cf_cv_default_source" >&5
12975 echo "${ECHO_T}$cf_cv_default_source" >&6
12976                         if test "$cf_cv_default_source" = yes
12977                         then
12978
12979         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12980         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12981
12982                         fi
12983                 fi
12984         fi
12985
12986 fi
12987
12988         ;;
12989 (minix*)
12990         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12991         ;;
12992 (mirbsd*)
12993         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12994         cf_XOPEN_SOURCE=
12995
12996 if test "$cf_cv_posix_visible" = no; then
12997
12998 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12999
13000 cf_save_CFLAGS="$CFLAGS"
13001 cf_save_CPPFLAGS="$CPPFLAGS"
13002
13003 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13004         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13005                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13006
13007 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13008         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13009                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13010
13011 echo "$as_me:13011: checking if we should define _POSIX_C_SOURCE" >&5
13012 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13013 if test "${cf_cv_posix_c_source+set}" = set; then
13014   echo $ECHO_N "(cached) $ECHO_C" >&6
13015 else
13016
13017 echo "${as_me:-configure}:13017: testing if the symbol is already defined go no further ..." 1>&5
13018
13019         cat >"conftest.$ac_ext" <<_ACEOF
13020 #line 13020 "configure"
13021 #include "confdefs.h"
13022 #include <sys/types.h>
13023 int
13024 main (void)
13025 {
13026
13027 #ifndef _POSIX_C_SOURCE
13028 make an error
13029 #endif
13030   ;
13031   return 0;
13032 }
13033 _ACEOF
13034 rm -f "conftest.$ac_objext"
13035 if { (eval echo "$as_me:13035: \"$ac_compile\"") >&5
13036   (eval $ac_compile) 2>&5
13037   ac_status=$?
13038   echo "$as_me:13038: \$? = $ac_status" >&5
13039   (exit "$ac_status"); } &&
13040          { ac_try='test -s "conftest.$ac_objext"'
13041   { (eval echo "$as_me:13041: \"$ac_try\"") >&5
13042   (eval $ac_try) 2>&5
13043   ac_status=$?
13044   echo "$as_me:13044: \$? = $ac_status" >&5
13045   (exit "$ac_status"); }; }; then
13046   cf_cv_posix_c_source=no
13047 else
13048   echo "$as_me: failed program was:" >&5
13049 cat "conftest.$ac_ext" >&5
13050 cf_want_posix_source=no
13051          case .$cf_POSIX_C_SOURCE in
13052          (.[12]??*)
13053                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13054                 ;;
13055          (.2)
13056                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13057                 cf_want_posix_source=yes
13058                 ;;
13059          (.*)
13060                 cf_want_posix_source=yes
13061                 ;;
13062          esac
13063          if test "$cf_want_posix_source" = yes ; then
13064                 cat >"conftest.$ac_ext" <<_ACEOF
13065 #line 13065 "configure"
13066 #include "confdefs.h"
13067 #include <sys/types.h>
13068 int
13069 main (void)
13070 {
13071
13072 #ifdef _POSIX_SOURCE
13073 make an error
13074 #endif
13075   ;
13076   return 0;
13077 }
13078 _ACEOF
13079 rm -f "conftest.$ac_objext"
13080 if { (eval echo "$as_me:13080: \"$ac_compile\"") >&5
13081   (eval $ac_compile) 2>&5
13082   ac_status=$?
13083   echo "$as_me:13083: \$? = $ac_status" >&5
13084   (exit "$ac_status"); } &&
13085          { ac_try='test -s "conftest.$ac_objext"'
13086   { (eval echo "$as_me:13086: \"$ac_try\"") >&5
13087   (eval $ac_try) 2>&5
13088   ac_status=$?
13089   echo "$as_me:13089: \$? = $ac_status" >&5
13090   (exit "$ac_status"); }; }; then
13091   :
13092 else
13093   echo "$as_me: failed program was:" >&5
13094 cat "conftest.$ac_ext" >&5
13095 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13096 fi
13097 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13098          fi
13099
13100 echo "${as_me:-configure}:13100: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13101
13102          CFLAGS="$cf_trim_CFLAGS"
13103          CPPFLAGS="$cf_trim_CPPFLAGS"
13104
13105         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13106         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13107
13108 echo "${as_me:-configure}:13108: testing if the second compile does not leave our definition intact error ..." 1>&5
13109
13110          cat >"conftest.$ac_ext" <<_ACEOF
13111 #line 13111 "configure"
13112 #include "confdefs.h"
13113 #include <sys/types.h>
13114 int
13115 main (void)
13116 {
13117
13118 #ifndef _POSIX_C_SOURCE
13119 make an error
13120 #endif
13121   ;
13122   return 0;
13123 }
13124 _ACEOF
13125 rm -f "conftest.$ac_objext"
13126 if { (eval echo "$as_me:13126: \"$ac_compile\"") >&5
13127   (eval $ac_compile) 2>&5
13128   ac_status=$?
13129   echo "$as_me:13129: \$? = $ac_status" >&5
13130   (exit "$ac_status"); } &&
13131          { ac_try='test -s "conftest.$ac_objext"'
13132   { (eval echo "$as_me:13132: \"$ac_try\"") >&5
13133   (eval $ac_try) 2>&5
13134   ac_status=$?
13135   echo "$as_me:13135: \$? = $ac_status" >&5
13136   (exit "$ac_status"); }; }; then
13137   :
13138 else
13139   echo "$as_me: failed program was:" >&5
13140 cat "conftest.$ac_ext" >&5
13141 cf_cv_posix_c_source=no
13142 fi
13143 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13144          CFLAGS="$cf_save_CFLAGS"
13145          CPPFLAGS="$cf_save_CPPFLAGS"
13146
13147 fi
13148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13149
13150 fi
13151 echo "$as_me:13151: result: $cf_cv_posix_c_source" >&5
13152 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13153
13154 if test "$cf_cv_posix_c_source" != no ; then
13155         CFLAGS="$cf_trim_CFLAGS"
13156         CPPFLAGS="$cf_trim_CPPFLAGS"
13157
13158 cf_fix_cppflags=no
13159 cf_new_cflags=
13160 cf_new_cppflags=
13161 cf_new_extra_cppflags=
13162
13163 for cf_add_cflags in $cf_cv_posix_c_source
13164 do
13165 case "$cf_fix_cppflags" in
13166 (no)
13167         case "$cf_add_cflags" in
13168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13169                 case "$cf_add_cflags" in
13170                 (-D*)
13171                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13172
13173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13174                                 && test -z "${cf_tst_cflags}" \
13175                                 && cf_fix_cppflags=yes
13176
13177                         if test "$cf_fix_cppflags" = yes ; then
13178
13179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13181
13182                                 continue
13183                         elif test "${cf_tst_cflags}" = "\"'" ; then
13184
13185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13187
13188                                 continue
13189                         fi
13190                         ;;
13191                 esac
13192                 case "$CPPFLAGS" in
13193                 (*$cf_add_cflags)
13194                         ;;
13195                 (*)
13196                         case "$cf_add_cflags" in
13197                         (-D*)
13198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13199
13200 CPPFLAGS=`echo "$CPPFLAGS" | \
13201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13203
13204                                 ;;
13205                         esac
13206
13207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13209
13210                         ;;
13211                 esac
13212                 ;;
13213         (*)
13214
13215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13217
13218                 ;;
13219         esac
13220         ;;
13221 (yes)
13222
13223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13225
13226         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13227
13228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13229                 && test -z "${cf_tst_cflags}" \
13230                 && cf_fix_cppflags=no
13231         ;;
13232 esac
13233 done
13234
13235 if test -n "$cf_new_cflags" ; then
13236
13237         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13238         CFLAGS="${CFLAGS}$cf_new_cflags"
13239
13240 fi
13241
13242 if test -n "$cf_new_cppflags" ; then
13243
13244         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13245         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13246
13247 fi
13248
13249 if test -n "$cf_new_extra_cppflags" ; then
13250
13251         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13252         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13253
13254 fi
13255
13256 fi
13257
13258 fi # cf_cv_posix_visible
13259
13260         ;;
13261 (netbsd*)
13262         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13263         ;;
13264 (openbsd[6-9]*)
13265         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13266         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13267         # Abusing the conformance level is a workaround.
13268         { echo "$as_me:13268: WARNING: this system does not provide usable locale support" >&5
13269 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13270         cf_xopen_source="-D_BSD_SOURCE"
13271         cf_XOPEN_SOURCE=700
13272         ;;
13273 (openbsd[4-5]*)
13274         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13275         cf_xopen_source="-D_BSD_SOURCE"
13276         cf_XOPEN_SOURCE=600
13277         ;;
13278 (openbsd*)
13279         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13280         ;;
13281 (osf[45]*)
13282         cf_xopen_source="-D_OSF_SOURCE"
13283         ;;
13284 (nto-qnx*)
13285         cf_xopen_source="-D_QNX_SOURCE"
13286         ;;
13287 (sco*)
13288         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13289         ;;
13290 (solaris2.*)
13291         cf_xopen_source="-D__EXTENSIONS__"
13292         cf_cv_xopen_source=broken
13293         ;;
13294 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13295         cf_XOPEN_SOURCE=
13296         cf_POSIX_C_SOURCE=
13297         ;;
13298 (*)
13299
13300 echo "$as_me:13300: checking if we should define _XOPEN_SOURCE" >&5
13301 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13302 if test "${cf_cv_xopen_source+set}" = set; then
13303   echo $ECHO_N "(cached) $ECHO_C" >&6
13304 else
13305
13306         cat >"conftest.$ac_ext" <<_ACEOF
13307 #line 13307 "configure"
13308 #include "confdefs.h"
13309
13310 #include <stdlib.h>
13311 #include <string.h>
13312 #include <sys/types.h>
13313
13314 int
13315 main (void)
13316 {
13317
13318 #ifndef _XOPEN_SOURCE
13319 make an error
13320 #endif
13321
13322   ;
13323   return 0;
13324 }
13325 _ACEOF
13326 rm -f "conftest.$ac_objext"
13327 if { (eval echo "$as_me:13327: \"$ac_compile\"") >&5
13328   (eval $ac_compile) 2>&5
13329   ac_status=$?
13330   echo "$as_me:13330: \$? = $ac_status" >&5
13331   (exit "$ac_status"); } &&
13332          { ac_try='test -s "conftest.$ac_objext"'
13333   { (eval echo "$as_me:13333: \"$ac_try\"") >&5
13334   (eval $ac_try) 2>&5
13335   ac_status=$?
13336   echo "$as_me:13336: \$? = $ac_status" >&5
13337   (exit "$ac_status"); }; }; then
13338   cf_cv_xopen_source=no
13339 else
13340   echo "$as_me: failed program was:" >&5
13341 cat "conftest.$ac_ext" >&5
13342 cf_save="$CPPFLAGS"
13343
13344         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13345         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13346
13347          cat >"conftest.$ac_ext" <<_ACEOF
13348 #line 13348 "configure"
13349 #include "confdefs.h"
13350
13351 #include <stdlib.h>
13352 #include <string.h>
13353 #include <sys/types.h>
13354
13355 int
13356 main (void)
13357 {
13358
13359 #ifndef _XOPEN_SOURCE
13360 make an error
13361 #endif
13362
13363   ;
13364   return 0;
13365 }
13366 _ACEOF
13367 rm -f "conftest.$ac_objext"
13368 if { (eval echo "$as_me:13368: \"$ac_compile\"") >&5
13369   (eval $ac_compile) 2>&5
13370   ac_status=$?
13371   echo "$as_me:13371: \$? = $ac_status" >&5
13372   (exit "$ac_status"); } &&
13373          { ac_try='test -s "conftest.$ac_objext"'
13374   { (eval echo "$as_me:13374: \"$ac_try\"") >&5
13375   (eval $ac_try) 2>&5
13376   ac_status=$?
13377   echo "$as_me:13377: \$? = $ac_status" >&5
13378   (exit "$ac_status"); }; }; then
13379   cf_cv_xopen_source=no
13380 else
13381   echo "$as_me: failed program was:" >&5
13382 cat "conftest.$ac_ext" >&5
13383 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13384 fi
13385 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13386                 CPPFLAGS="$cf_save"
13387
13388 fi
13389 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13390
13391 fi
13392 echo "$as_me:13392: result: $cf_cv_xopen_source" >&5
13393 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13394
13395 if test "$cf_cv_xopen_source" != no ; then
13396
13397 CFLAGS=`echo "$CFLAGS" | \
13398         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13399                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13400
13401 CPPFLAGS=`echo "$CPPFLAGS" | \
13402         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13403                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13404
13405         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13406
13407 for cf_add_cflags in $cf_temp_xopen_source
13408 do
13409         case "x$cf_add_cflags" in
13410         (x-[DU]*)
13411
13412 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13413 while true
13414 do
13415         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13416         test "$CFLAGS" != "$cf_old_cflag" || break
13417
13418         CFLAGS="$cf_old_cflag"
13419 done
13420
13421 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13422 while true
13423 do
13424         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13425         test "$CPPFLAGS" != "$cf_old_cflag" || break
13426
13427         CPPFLAGS="$cf_old_cflag"
13428 done
13429
13430                 ;;
13431         esac
13432
13433 cf_fix_cppflags=no
13434 cf_new_cflags=
13435 cf_new_cppflags=
13436 cf_new_extra_cppflags=
13437
13438 for cf_add_cflags in $cf_add_cflags
13439 do
13440 case "$cf_fix_cppflags" in
13441 (no)
13442         case "$cf_add_cflags" in
13443         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13444                 case "$cf_add_cflags" in
13445                 (-D*)
13446                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13447
13448                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13449                                 && test -z "${cf_tst_cflags}" \
13450                                 && cf_fix_cppflags=yes
13451
13452                         if test "$cf_fix_cppflags" = yes ; then
13453
13454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13456
13457                                 continue
13458                         elif test "${cf_tst_cflags}" = "\"'" ; then
13459
13460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13462
13463                                 continue
13464                         fi
13465                         ;;
13466                 esac
13467                 case "$CPPFLAGS" in
13468                 (*$cf_add_cflags)
13469                         ;;
13470                 (*)
13471                         case "$cf_add_cflags" in
13472                         (-D*)
13473                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13474
13475 CPPFLAGS=`echo "$CPPFLAGS" | \
13476         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13477                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13478
13479                                 ;;
13480                         esac
13481
13482         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13483         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13484
13485                         ;;
13486                 esac
13487                 ;;
13488         (*)
13489
13490         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13491         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13492
13493                 ;;
13494         esac
13495         ;;
13496 (yes)
13497
13498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13500
13501         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13502
13503         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13504                 && test -z "${cf_tst_cflags}" \
13505                 && cf_fix_cppflags=no
13506         ;;
13507 esac
13508 done
13509
13510 if test -n "$cf_new_cflags" ; then
13511
13512         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13513         CFLAGS="${CFLAGS}$cf_new_cflags"
13514
13515 fi
13516
13517 if test -n "$cf_new_cppflags" ; then
13518
13519         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13520         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13521
13522 fi
13523
13524 if test -n "$cf_new_extra_cppflags" ; then
13525
13526         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13527         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13528
13529 fi
13530
13531 done
13532
13533 fi
13534
13535         cf_save_xopen_cppflags="$CPPFLAGS"
13536
13537 if test "$cf_cv_posix_visible" = no; then
13538
13539 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13540
13541 cf_save_CFLAGS="$CFLAGS"
13542 cf_save_CPPFLAGS="$CPPFLAGS"
13543
13544 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13545         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13546                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13547
13548 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13549         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13550                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13551
13552 echo "$as_me:13552: checking if we should define _POSIX_C_SOURCE" >&5
13553 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13554 if test "${cf_cv_posix_c_source+set}" = set; then
13555   echo $ECHO_N "(cached) $ECHO_C" >&6
13556 else
13557
13558 echo "${as_me:-configure}:13558: testing if the symbol is already defined go no further ..." 1>&5
13559
13560         cat >"conftest.$ac_ext" <<_ACEOF
13561 #line 13561 "configure"
13562 #include "confdefs.h"
13563 #include <sys/types.h>
13564 int
13565 main (void)
13566 {
13567
13568 #ifndef _POSIX_C_SOURCE
13569 make an error
13570 #endif
13571   ;
13572   return 0;
13573 }
13574 _ACEOF
13575 rm -f "conftest.$ac_objext"
13576 if { (eval echo "$as_me:13576: \"$ac_compile\"") >&5
13577   (eval $ac_compile) 2>&5
13578   ac_status=$?
13579   echo "$as_me:13579: \$? = $ac_status" >&5
13580   (exit "$ac_status"); } &&
13581          { ac_try='test -s "conftest.$ac_objext"'
13582   { (eval echo "$as_me:13582: \"$ac_try\"") >&5
13583   (eval $ac_try) 2>&5
13584   ac_status=$?
13585   echo "$as_me:13585: \$? = $ac_status" >&5
13586   (exit "$ac_status"); }; }; then
13587   cf_cv_posix_c_source=no
13588 else
13589   echo "$as_me: failed program was:" >&5
13590 cat "conftest.$ac_ext" >&5
13591 cf_want_posix_source=no
13592          case .$cf_POSIX_C_SOURCE in
13593          (.[12]??*)
13594                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13595                 ;;
13596          (.2)
13597                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13598                 cf_want_posix_source=yes
13599                 ;;
13600          (.*)
13601                 cf_want_posix_source=yes
13602                 ;;
13603          esac
13604          if test "$cf_want_posix_source" = yes ; then
13605                 cat >"conftest.$ac_ext" <<_ACEOF
13606 #line 13606 "configure"
13607 #include "confdefs.h"
13608 #include <sys/types.h>
13609 int
13610 main (void)
13611 {
13612
13613 #ifdef _POSIX_SOURCE
13614 make an error
13615 #endif
13616   ;
13617   return 0;
13618 }
13619 _ACEOF
13620 rm -f "conftest.$ac_objext"
13621 if { (eval echo "$as_me:13621: \"$ac_compile\"") >&5
13622   (eval $ac_compile) 2>&5
13623   ac_status=$?
13624   echo "$as_me:13624: \$? = $ac_status" >&5
13625   (exit "$ac_status"); } &&
13626          { ac_try='test -s "conftest.$ac_objext"'
13627   { (eval echo "$as_me:13627: \"$ac_try\"") >&5
13628   (eval $ac_try) 2>&5
13629   ac_status=$?
13630   echo "$as_me:13630: \$? = $ac_status" >&5
13631   (exit "$ac_status"); }; }; then
13632   :
13633 else
13634   echo "$as_me: failed program was:" >&5
13635 cat "conftest.$ac_ext" >&5
13636 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13637 fi
13638 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13639          fi
13640
13641 echo "${as_me:-configure}:13641: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13642
13643          CFLAGS="$cf_trim_CFLAGS"
13644          CPPFLAGS="$cf_trim_CPPFLAGS"
13645
13646         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13647         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13648
13649 echo "${as_me:-configure}:13649: testing if the second compile does not leave our definition intact error ..." 1>&5
13650
13651          cat >"conftest.$ac_ext" <<_ACEOF
13652 #line 13652 "configure"
13653 #include "confdefs.h"
13654 #include <sys/types.h>
13655 int
13656 main (void)
13657 {
13658
13659 #ifndef _POSIX_C_SOURCE
13660 make an error
13661 #endif
13662   ;
13663   return 0;
13664 }
13665 _ACEOF
13666 rm -f "conftest.$ac_objext"
13667 if { (eval echo "$as_me:13667: \"$ac_compile\"") >&5
13668   (eval $ac_compile) 2>&5
13669   ac_status=$?
13670   echo "$as_me:13670: \$? = $ac_status" >&5
13671   (exit "$ac_status"); } &&
13672          { ac_try='test -s "conftest.$ac_objext"'
13673   { (eval echo "$as_me:13673: \"$ac_try\"") >&5
13674   (eval $ac_try) 2>&5
13675   ac_status=$?
13676   echo "$as_me:13676: \$? = $ac_status" >&5
13677   (exit "$ac_status"); }; }; then
13678   :
13679 else
13680   echo "$as_me: failed program was:" >&5
13681 cat "conftest.$ac_ext" >&5
13682 cf_cv_posix_c_source=no
13683 fi
13684 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13685          CFLAGS="$cf_save_CFLAGS"
13686          CPPFLAGS="$cf_save_CPPFLAGS"
13687
13688 fi
13689 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13690
13691 fi
13692 echo "$as_me:13692: result: $cf_cv_posix_c_source" >&5
13693 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13694
13695 if test "$cf_cv_posix_c_source" != no ; then
13696         CFLAGS="$cf_trim_CFLAGS"
13697         CPPFLAGS="$cf_trim_CPPFLAGS"
13698
13699 cf_fix_cppflags=no
13700 cf_new_cflags=
13701 cf_new_cppflags=
13702 cf_new_extra_cppflags=
13703
13704 for cf_add_cflags in $cf_cv_posix_c_source
13705 do
13706 case "$cf_fix_cppflags" in
13707 (no)
13708         case "$cf_add_cflags" in
13709         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13710                 case "$cf_add_cflags" in
13711                 (-D*)
13712                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13713
13714                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13715                                 && test -z "${cf_tst_cflags}" \
13716                                 && cf_fix_cppflags=yes
13717
13718                         if test "$cf_fix_cppflags" = yes ; then
13719
13720         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13721         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13722
13723                                 continue
13724                         elif test "${cf_tst_cflags}" = "\"'" ; then
13725
13726         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13727         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13728
13729                                 continue
13730                         fi
13731                         ;;
13732                 esac
13733                 case "$CPPFLAGS" in
13734                 (*$cf_add_cflags)
13735                         ;;
13736                 (*)
13737                         case "$cf_add_cflags" in
13738                         (-D*)
13739                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13740
13741 CPPFLAGS=`echo "$CPPFLAGS" | \
13742         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13743                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13744
13745                                 ;;
13746                         esac
13747
13748         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13749         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13750
13751                         ;;
13752                 esac
13753                 ;;
13754         (*)
13755
13756         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13757         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13758
13759                 ;;
13760         esac
13761         ;;
13762 (yes)
13763
13764         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13765         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13766
13767         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13768
13769         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13770                 && test -z "${cf_tst_cflags}" \
13771                 && cf_fix_cppflags=no
13772         ;;
13773 esac
13774 done
13775
13776 if test -n "$cf_new_cflags" ; then
13777
13778         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13779         CFLAGS="${CFLAGS}$cf_new_cflags"
13780
13781 fi
13782
13783 if test -n "$cf_new_cppflags" ; then
13784
13785         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13786         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13787
13788 fi
13789
13790 if test -n "$cf_new_extra_cppflags" ; then
13791
13792         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13793         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13794
13795 fi
13796
13797 fi
13798
13799 fi # cf_cv_posix_visible
13800
13801         # Some of these niche implementations use copy/paste, double-check...
13802         if test "$cf_cv_xopen_source" != no ; then
13803                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
13804
13805 echo "${as_me:-configure}:13805: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
13806
13807                 cat >"conftest.$ac_ext" <<_ACEOF
13808 #line 13808 "configure"
13809 #include "confdefs.h"
13810
13811 #include <stdlib.h>
13812 #include <string.h>
13813 #include <sys/types.h>
13814
13815 int
13816 main (void)
13817 {
13818
13819 #ifndef _XOPEN_SOURCE
13820 make an error
13821 #endif
13822
13823   ;
13824   return 0;
13825 }
13826 _ACEOF
13827 rm -f "conftest.$ac_objext"
13828 if { (eval echo "$as_me:13828: \"$ac_compile\"") >&5
13829   (eval $ac_compile) 2>&5
13830   ac_status=$?
13831   echo "$as_me:13831: \$? = $ac_status" >&5
13832   (exit "$ac_status"); } &&
13833          { ac_try='test -s "conftest.$ac_objext"'
13834   { (eval echo "$as_me:13834: \"$ac_try\"") >&5
13835   (eval $ac_try) 2>&5
13836   ac_status=$?
13837   echo "$as_me:13837: \$? = $ac_status" >&5
13838   (exit "$ac_status"); }; }; then
13839   :
13840 else
13841   echo "$as_me: failed program was:" >&5
13842 cat "conftest.$ac_ext" >&5
13843
13844                         { echo "$as_me:13844: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
13845 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
13846                         CPPFLAGS="$cf_save_xopen_cppflags"
13847 fi
13848 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13849         fi
13850         ;;
13851 esac
13852
13853 if test -n "$cf_xopen_source" ; then
13854
13855 for cf_add_cflags in $cf_xopen_source
13856 do
13857         case "x$cf_add_cflags" in
13858         (x-[DU]*)
13859
13860 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13861 while true
13862 do
13863         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13864         test "$CFLAGS" != "$cf_old_cflag" || break
13865         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13866
13867 echo "${as_me:-configure}:13867: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13868
13869         CFLAGS="$cf_old_cflag"
13870 done
13871
13872 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13873 while true
13874 do
13875         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13876         test "$CPPFLAGS" != "$cf_old_cflag" || break
13877         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13878
13879 echo "${as_me:-configure}:13879: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13880
13881         CPPFLAGS="$cf_old_cflag"
13882 done
13883
13884                 ;;
13885         esac
13886
13887 cf_fix_cppflags=no
13888 cf_new_cflags=
13889 cf_new_cppflags=
13890 cf_new_extra_cppflags=
13891
13892 for cf_add_cflags in $cf_add_cflags
13893 do
13894 case "$cf_fix_cppflags" in
13895 (no)
13896         case "$cf_add_cflags" in
13897         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13898                 case "$cf_add_cflags" in
13899                 (-D*)
13900                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13901
13902                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13903                                 && test -z "${cf_tst_cflags}" \
13904                                 && cf_fix_cppflags=yes
13905
13906                         if test "$cf_fix_cppflags" = yes ; then
13907
13908         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13909         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13910
13911                                 continue
13912                         elif test "${cf_tst_cflags}" = "\"'" ; then
13913
13914         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13915         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13916
13917                                 continue
13918                         fi
13919                         ;;
13920                 esac
13921                 case "$CPPFLAGS" in
13922                 (*$cf_add_cflags)
13923                         ;;
13924                 (*)
13925                         case "$cf_add_cflags" in
13926                         (-D*)
13927                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13928
13929 CPPFLAGS=`echo "$CPPFLAGS" | \
13930         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13931                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13932
13933                                 ;;
13934                         esac
13935
13936         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13937         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13938
13939                         ;;
13940                 esac
13941                 ;;
13942         (*)
13943
13944         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13945         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13946
13947                 ;;
13948         esac
13949         ;;
13950 (yes)
13951
13952         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13953         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13954
13955         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13956
13957         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13958                 && test -z "${cf_tst_cflags}" \
13959                 && cf_fix_cppflags=no
13960         ;;
13961 esac
13962 done
13963
13964 if test -n "$cf_new_cflags" ; then
13965         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13966
13967 echo "${as_me:-configure}:13967: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13968
13969         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13970         CFLAGS="${CFLAGS}$cf_new_cflags"
13971
13972 fi
13973
13974 if test -n "$cf_new_cppflags" ; then
13975         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13976
13977 echo "${as_me:-configure}:13977: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13978
13979         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13980         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13981
13982 fi
13983
13984 if test -n "$cf_new_extra_cppflags" ; then
13985         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13986
13987 echo "${as_me:-configure}:13987: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13988
13989         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13990         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13991
13992 fi
13993
13994 done
13995
13996 fi
13997
13998 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13999         echo "$as_me:13999: checking if _XOPEN_SOURCE really is set" >&5
14000 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
14001         cat >"conftest.$ac_ext" <<_ACEOF
14002 #line 14002 "configure"
14003 #include "confdefs.h"
14004 #include <stdlib.h>
14005 int
14006 main (void)
14007 {
14008
14009 #ifndef _XOPEN_SOURCE
14010 make an error
14011 #endif
14012   ;
14013   return 0;
14014 }
14015 _ACEOF
14016 rm -f "conftest.$ac_objext"
14017 if { (eval echo "$as_me:14017: \"$ac_compile\"") >&5
14018   (eval $ac_compile) 2>&5
14019   ac_status=$?
14020   echo "$as_me:14020: \$? = $ac_status" >&5
14021   (exit "$ac_status"); } &&
14022          { ac_try='test -s "conftest.$ac_objext"'
14023   { (eval echo "$as_me:14023: \"$ac_try\"") >&5
14024   (eval $ac_try) 2>&5
14025   ac_status=$?
14026   echo "$as_me:14026: \$? = $ac_status" >&5
14027   (exit "$ac_status"); }; }; then
14028   cf_XOPEN_SOURCE_set=yes
14029 else
14030   echo "$as_me: failed program was:" >&5
14031 cat "conftest.$ac_ext" >&5
14032 cf_XOPEN_SOURCE_set=no
14033 fi
14034 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14035         echo "$as_me:14035: result: $cf_XOPEN_SOURCE_set" >&5
14036 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14037         if test "$cf_XOPEN_SOURCE_set" = yes
14038         then
14039                 cat >"conftest.$ac_ext" <<_ACEOF
14040 #line 14040 "configure"
14041 #include "confdefs.h"
14042 #include <stdlib.h>
14043 int
14044 main (void)
14045 {
14046
14047 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14048 make an error
14049 #endif
14050   ;
14051   return 0;
14052 }
14053 _ACEOF
14054 rm -f "conftest.$ac_objext"
14055 if { (eval echo "$as_me:14055: \"$ac_compile\"") >&5
14056   (eval $ac_compile) 2>&5
14057   ac_status=$?
14058   echo "$as_me:14058: \$? = $ac_status" >&5
14059   (exit "$ac_status"); } &&
14060          { ac_try='test -s "conftest.$ac_objext"'
14061   { (eval echo "$as_me:14061: \"$ac_try\"") >&5
14062   (eval $ac_try) 2>&5
14063   ac_status=$?
14064   echo "$as_me:14064: \$? = $ac_status" >&5
14065   (exit "$ac_status"); }; }; then
14066   cf_XOPEN_SOURCE_set_ok=yes
14067 else
14068   echo "$as_me: failed program was:" >&5
14069 cat "conftest.$ac_ext" >&5
14070 cf_XOPEN_SOURCE_set_ok=no
14071 fi
14072 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14073                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14074                 then
14075                         { echo "$as_me:14075: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14076 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14077                 fi
14078         else
14079
14080 echo "$as_me:14080: checking if we should define _XOPEN_SOURCE" >&5
14081 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14082 if test "${cf_cv_xopen_source+set}" = set; then
14083   echo $ECHO_N "(cached) $ECHO_C" >&6
14084 else
14085
14086         cat >"conftest.$ac_ext" <<_ACEOF
14087 #line 14087 "configure"
14088 #include "confdefs.h"
14089
14090 #include <stdlib.h>
14091 #include <string.h>
14092 #include <sys/types.h>
14093
14094 int
14095 main (void)
14096 {
14097
14098 #ifndef _XOPEN_SOURCE
14099 make an error
14100 #endif
14101
14102   ;
14103   return 0;
14104 }
14105 _ACEOF
14106 rm -f "conftest.$ac_objext"
14107 if { (eval echo "$as_me:14107: \"$ac_compile\"") >&5
14108   (eval $ac_compile) 2>&5
14109   ac_status=$?
14110   echo "$as_me:14110: \$? = $ac_status" >&5
14111   (exit "$ac_status"); } &&
14112          { ac_try='test -s "conftest.$ac_objext"'
14113   { (eval echo "$as_me:14113: \"$ac_try\"") >&5
14114   (eval $ac_try) 2>&5
14115   ac_status=$?
14116   echo "$as_me:14116: \$? = $ac_status" >&5
14117   (exit "$ac_status"); }; }; then
14118   cf_cv_xopen_source=no
14119 else
14120   echo "$as_me: failed program was:" >&5
14121 cat "conftest.$ac_ext" >&5
14122 cf_save="$CPPFLAGS"
14123
14124         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14125         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14126
14127          cat >"conftest.$ac_ext" <<_ACEOF
14128 #line 14128 "configure"
14129 #include "confdefs.h"
14130
14131 #include <stdlib.h>
14132 #include <string.h>
14133 #include <sys/types.h>
14134
14135 int
14136 main (void)
14137 {
14138
14139 #ifndef _XOPEN_SOURCE
14140 make an error
14141 #endif
14142
14143   ;
14144   return 0;
14145 }
14146 _ACEOF
14147 rm -f "conftest.$ac_objext"
14148 if { (eval echo "$as_me:14148: \"$ac_compile\"") >&5
14149   (eval $ac_compile) 2>&5
14150   ac_status=$?
14151   echo "$as_me:14151: \$? = $ac_status" >&5
14152   (exit "$ac_status"); } &&
14153          { ac_try='test -s "conftest.$ac_objext"'
14154   { (eval echo "$as_me:14154: \"$ac_try\"") >&5
14155   (eval $ac_try) 2>&5
14156   ac_status=$?
14157   echo "$as_me:14157: \$? = $ac_status" >&5
14158   (exit "$ac_status"); }; }; then
14159   cf_cv_xopen_source=no
14160 else
14161   echo "$as_me: failed program was:" >&5
14162 cat "conftest.$ac_ext" >&5
14163 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14164 fi
14165 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14166                 CPPFLAGS="$cf_save"
14167
14168 fi
14169 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14170
14171 fi
14172 echo "$as_me:14172: result: $cf_cv_xopen_source" >&5
14173 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14174
14175 if test "$cf_cv_xopen_source" != no ; then
14176
14177 CFLAGS=`echo "$CFLAGS" | \
14178         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14179                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14180
14181 CPPFLAGS=`echo "$CPPFLAGS" | \
14182         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14183                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14184
14185         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14186
14187 for cf_add_cflags in $cf_temp_xopen_source
14188 do
14189         case "x$cf_add_cflags" in
14190         (x-[DU]*)
14191
14192 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14193 while true
14194 do
14195         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14196         test "$CFLAGS" != "$cf_old_cflag" || break
14197
14198         CFLAGS="$cf_old_cflag"
14199 done
14200
14201 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14202 while true
14203 do
14204         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14205         test "$CPPFLAGS" != "$cf_old_cflag" || break
14206
14207         CPPFLAGS="$cf_old_cflag"
14208 done
14209
14210                 ;;
14211         esac
14212
14213 cf_fix_cppflags=no
14214 cf_new_cflags=
14215 cf_new_cppflags=
14216 cf_new_extra_cppflags=
14217
14218 for cf_add_cflags in $cf_add_cflags
14219 do
14220 case "$cf_fix_cppflags" in
14221 (no)
14222         case "$cf_add_cflags" in
14223         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14224                 case "$cf_add_cflags" in
14225                 (-D*)
14226                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14227
14228                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14229                                 && test -z "${cf_tst_cflags}" \
14230                                 && cf_fix_cppflags=yes
14231
14232                         if test "$cf_fix_cppflags" = yes ; then
14233
14234         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14235         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14236
14237                                 continue
14238                         elif test "${cf_tst_cflags}" = "\"'" ; then
14239
14240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14242
14243                                 continue
14244                         fi
14245                         ;;
14246                 esac
14247                 case "$CPPFLAGS" in
14248                 (*$cf_add_cflags)
14249                         ;;
14250                 (*)
14251                         case "$cf_add_cflags" in
14252                         (-D*)
14253                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14254
14255 CPPFLAGS=`echo "$CPPFLAGS" | \
14256         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14257                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14258
14259                                 ;;
14260                         esac
14261
14262         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14263         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14264
14265                         ;;
14266                 esac
14267                 ;;
14268         (*)
14269
14270         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14271         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14272
14273                 ;;
14274         esac
14275         ;;
14276 (yes)
14277
14278         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14279         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14280
14281         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14282
14283         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14284                 && test -z "${cf_tst_cflags}" \
14285                 && cf_fix_cppflags=no
14286         ;;
14287 esac
14288 done
14289
14290 if test -n "$cf_new_cflags" ; then
14291
14292         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14293         CFLAGS="${CFLAGS}$cf_new_cflags"
14294
14295 fi
14296
14297 if test -n "$cf_new_cppflags" ; then
14298
14299         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14300         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14301
14302 fi
14303
14304 if test -n "$cf_new_extra_cppflags" ; then
14305
14306         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14307         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14308
14309 fi
14310
14311 done
14312
14313 fi
14314
14315         fi
14316 fi
14317 fi # cf_cv_posix_visible
14318
14319 # Check whether --enable-largefile or --disable-largefile was given.
14320 if test "${enable_largefile+set}" = set; then
14321   enableval="$enable_largefile"
14322
14323 fi;
14324 if test "$enable_largefile" != no; then
14325
14326   echo "$as_me:14326: checking for special C compiler options needed for large files" >&5
14327 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14328 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14329   echo $ECHO_N "(cached) $ECHO_C" >&6
14330 else
14331   ac_cv_sys_largefile_CC=no
14332      if test "$GCC" != yes; then
14333        ac_save_CC=$CC
14334        while :; do
14335          # IRIX 6.2 and later do not support large files by default,
14336          # so use the C compiler's -n32 option if that helps.
14337          cat >"conftest.$ac_ext" <<_ACEOF
14338 #line 14338 "configure"
14339 #include "confdefs.h"
14340 #include <sys/types.h>
14341  /* Check that off_t can represent 2**63 - 1 correctly.
14342     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14343     since some C++ compilers masquerading as C compilers
14344     incorrectly reject 9223372036854775807.  */
14345 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14346   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14347                        && LARGE_OFF_T % 2147483647 == 1)
14348                       ? 1 : -1];
14349 int
14350 main (void)
14351 {
14352
14353   ;
14354   return 0;
14355 }
14356 _ACEOF
14357          rm -f "conftest.$ac_objext"
14358 if { (eval echo "$as_me:14358: \"$ac_compile\"") >&5
14359   (eval $ac_compile) 2>&5
14360   ac_status=$?
14361   echo "$as_me:14361: \$? = $ac_status" >&5
14362   (exit "$ac_status"); } &&
14363          { ac_try='test -s "conftest.$ac_objext"'
14364   { (eval echo "$as_me:14364: \"$ac_try\"") >&5
14365   (eval $ac_try) 2>&5
14366   ac_status=$?
14367   echo "$as_me:14367: \$? = $ac_status" >&5
14368   (exit "$ac_status"); }; }; then
14369   break
14370 else
14371   echo "$as_me: failed program was:" >&5
14372 cat "conftest.$ac_ext" >&5
14373 fi
14374 rm -f "conftest.$ac_objext"
14375          CC="$CC -n32"
14376          rm -f "conftest.$ac_objext"
14377 if { (eval echo "$as_me:14377: \"$ac_compile\"") >&5
14378   (eval $ac_compile) 2>&5
14379   ac_status=$?
14380   echo "$as_me:14380: \$? = $ac_status" >&5
14381   (exit "$ac_status"); } &&
14382          { ac_try='test -s "conftest.$ac_objext"'
14383   { (eval echo "$as_me:14383: \"$ac_try\"") >&5
14384   (eval $ac_try) 2>&5
14385   ac_status=$?
14386   echo "$as_me:14386: \$? = $ac_status" >&5
14387   (exit "$ac_status"); }; }; then
14388   ac_cv_sys_largefile_CC=' -n32'; break
14389 else
14390   echo "$as_me: failed program was:" >&5
14391 cat "conftest.$ac_ext" >&5
14392 fi
14393 rm -f "conftest.$ac_objext"
14394          break
14395        done
14396        CC=$ac_save_CC
14397        rm -f "conftest.$ac_ext"
14398     fi
14399 fi
14400 echo "$as_me:14400: result: $ac_cv_sys_largefile_CC" >&5
14401 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14402   if test "$ac_cv_sys_largefile_CC" != no; then
14403     CC=$CC$ac_cv_sys_largefile_CC
14404   fi
14405
14406   echo "$as_me:14406: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14407 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14408 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14409   echo $ECHO_N "(cached) $ECHO_C" >&6
14410 else
14411   while :; do
14412   ac_cv_sys_file_offset_bits=no
14413   cat >"conftest.$ac_ext" <<_ACEOF
14414 #line 14414 "configure"
14415 #include "confdefs.h"
14416 #include <sys/types.h>
14417  /* Check that off_t can represent 2**63 - 1 correctly.
14418     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14419     since some C++ compilers masquerading as C compilers
14420     incorrectly reject 9223372036854775807.  */
14421 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14422   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14423                        && LARGE_OFF_T % 2147483647 == 1)
14424                       ? 1 : -1];
14425 int
14426 main (void)
14427 {
14428
14429   ;
14430   return 0;
14431 }
14432 _ACEOF
14433 rm -f "conftest.$ac_objext"
14434 if { (eval echo "$as_me:14434: \"$ac_compile\"") >&5
14435   (eval $ac_compile) 2>&5
14436   ac_status=$?
14437   echo "$as_me:14437: \$? = $ac_status" >&5
14438   (exit "$ac_status"); } &&
14439          { ac_try='test -s "conftest.$ac_objext"'
14440   { (eval echo "$as_me:14440: \"$ac_try\"") >&5
14441   (eval $ac_try) 2>&5
14442   ac_status=$?
14443   echo "$as_me:14443: \$? = $ac_status" >&5
14444   (exit "$ac_status"); }; }; then
14445   break
14446 else
14447   echo "$as_me: failed program was:" >&5
14448 cat "conftest.$ac_ext" >&5
14449 fi
14450 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14451   cat >"conftest.$ac_ext" <<_ACEOF
14452 #line 14452 "configure"
14453 #include "confdefs.h"
14454 #define _FILE_OFFSET_BITS 64
14455 #include <sys/types.h>
14456  /* Check that off_t can represent 2**63 - 1 correctly.
14457     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14458     since some C++ compilers masquerading as C compilers
14459     incorrectly reject 9223372036854775807.  */
14460 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14461   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14462                        && LARGE_OFF_T % 2147483647 == 1)
14463                       ? 1 : -1];
14464 int
14465 main (void)
14466 {
14467
14468   ;
14469   return 0;
14470 }
14471 _ACEOF
14472 rm -f "conftest.$ac_objext"
14473 if { (eval echo "$as_me:14473: \"$ac_compile\"") >&5
14474   (eval $ac_compile) 2>&5
14475   ac_status=$?
14476   echo "$as_me:14476: \$? = $ac_status" >&5
14477   (exit "$ac_status"); } &&
14478          { ac_try='test -s "conftest.$ac_objext"'
14479   { (eval echo "$as_me:14479: \"$ac_try\"") >&5
14480   (eval $ac_try) 2>&5
14481   ac_status=$?
14482   echo "$as_me:14482: \$? = $ac_status" >&5
14483   (exit "$ac_status"); }; }; then
14484   ac_cv_sys_file_offset_bits=64; break
14485 else
14486   echo "$as_me: failed program was:" >&5
14487 cat "conftest.$ac_ext" >&5
14488 fi
14489 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14490   break
14491 done
14492 fi
14493 echo "$as_me:14493: result: $ac_cv_sys_file_offset_bits" >&5
14494 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14495 if test "$ac_cv_sys_file_offset_bits" != no; then
14496
14497 cat >>confdefs.h <<EOF
14498 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14499 EOF
14500
14501 fi
14502 rm -rf conftest*
14503   echo "$as_me:14503: checking for _LARGE_FILES value needed for large files" >&5
14504 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14505 if test "${ac_cv_sys_large_files+set}" = set; then
14506   echo $ECHO_N "(cached) $ECHO_C" >&6
14507 else
14508   while :; do
14509   ac_cv_sys_large_files=no
14510   cat >"conftest.$ac_ext" <<_ACEOF
14511 #line 14511 "configure"
14512 #include "confdefs.h"
14513 #include <sys/types.h>
14514  /* Check that off_t can represent 2**63 - 1 correctly.
14515     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14516     since some C++ compilers masquerading as C compilers
14517     incorrectly reject 9223372036854775807.  */
14518 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14519   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14520                        && LARGE_OFF_T % 2147483647 == 1)
14521                       ? 1 : -1];
14522 int
14523 main (void)
14524 {
14525
14526   ;
14527   return 0;
14528 }
14529 _ACEOF
14530 rm -f "conftest.$ac_objext"
14531 if { (eval echo "$as_me:14531: \"$ac_compile\"") >&5
14532   (eval $ac_compile) 2>&5
14533   ac_status=$?
14534   echo "$as_me:14534: \$? = $ac_status" >&5
14535   (exit "$ac_status"); } &&
14536          { ac_try='test -s "conftest.$ac_objext"'
14537   { (eval echo "$as_me:14537: \"$ac_try\"") >&5
14538   (eval $ac_try) 2>&5
14539   ac_status=$?
14540   echo "$as_me:14540: \$? = $ac_status" >&5
14541   (exit "$ac_status"); }; }; then
14542   break
14543 else
14544   echo "$as_me: failed program was:" >&5
14545 cat "conftest.$ac_ext" >&5
14546 fi
14547 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14548   cat >"conftest.$ac_ext" <<_ACEOF
14549 #line 14549 "configure"
14550 #include "confdefs.h"
14551 #define _LARGE_FILES 1
14552 #include <sys/types.h>
14553  /* Check that off_t can represent 2**63 - 1 correctly.
14554     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14555     since some C++ compilers masquerading as C compilers
14556     incorrectly reject 9223372036854775807.  */
14557 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14558   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14559                        && LARGE_OFF_T % 2147483647 == 1)
14560                       ? 1 : -1];
14561 int
14562 main (void)
14563 {
14564
14565   ;
14566   return 0;
14567 }
14568 _ACEOF
14569 rm -f "conftest.$ac_objext"
14570 if { (eval echo "$as_me:14570: \"$ac_compile\"") >&5
14571   (eval $ac_compile) 2>&5
14572   ac_status=$?
14573   echo "$as_me:14573: \$? = $ac_status" >&5
14574   (exit "$ac_status"); } &&
14575          { ac_try='test -s "conftest.$ac_objext"'
14576   { (eval echo "$as_me:14576: \"$ac_try\"") >&5
14577   (eval $ac_try) 2>&5
14578   ac_status=$?
14579   echo "$as_me:14579: \$? = $ac_status" >&5
14580   (exit "$ac_status"); }; }; then
14581   ac_cv_sys_large_files=1; break
14582 else
14583   echo "$as_me: failed program was:" >&5
14584 cat "conftest.$ac_ext" >&5
14585 fi
14586 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14587   break
14588 done
14589 fi
14590 echo "$as_me:14590: result: $ac_cv_sys_large_files" >&5
14591 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14592 if test "$ac_cv_sys_large_files" != no; then
14593
14594 cat >>confdefs.h <<EOF
14595 #define _LARGE_FILES $ac_cv_sys_large_files
14596 EOF
14597
14598 fi
14599 rm -rf conftest*
14600 fi
14601
14602         if test "$enable_largefile" != no ; then
14603         echo "$as_me:14603: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14604 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14605 if test "${ac_cv_sys_largefile_source+set}" = set; then
14606   echo $ECHO_N "(cached) $ECHO_C" >&6
14607 else
14608   while :; do
14609   ac_cv_sys_largefile_source=no
14610   cat >"conftest.$ac_ext" <<_ACEOF
14611 #line 14611 "configure"
14612 #include "confdefs.h"
14613 #include <stdio.h>
14614 int
14615 main (void)
14616 {
14617 return !fseeko;
14618   ;
14619   return 0;
14620 }
14621 _ACEOF
14622 rm -f "conftest.$ac_objext"
14623 if { (eval echo "$as_me:14623: \"$ac_compile\"") >&5
14624   (eval $ac_compile) 2>&5
14625   ac_status=$?
14626   echo "$as_me:14626: \$? = $ac_status" >&5
14627   (exit "$ac_status"); } &&
14628          { ac_try='test -s "conftest.$ac_objext"'
14629   { (eval echo "$as_me:14629: \"$ac_try\"") >&5
14630   (eval $ac_try) 2>&5
14631   ac_status=$?
14632   echo "$as_me:14632: \$? = $ac_status" >&5
14633   (exit "$ac_status"); }; }; then
14634   break
14635 else
14636   echo "$as_me: failed program was:" >&5
14637 cat "conftest.$ac_ext" >&5
14638 fi
14639 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14640   cat >"conftest.$ac_ext" <<_ACEOF
14641 #line 14641 "configure"
14642 #include "confdefs.h"
14643 #define _LARGEFILE_SOURCE 1
14644 #include <stdio.h>
14645 int
14646 main (void)
14647 {
14648 return !fseeko;
14649   ;
14650   return 0;
14651 }
14652 _ACEOF
14653 rm -f "conftest.$ac_objext"
14654 if { (eval echo "$as_me:14654: \"$ac_compile\"") >&5
14655   (eval $ac_compile) 2>&5
14656   ac_status=$?
14657   echo "$as_me:14657: \$? = $ac_status" >&5
14658   (exit "$ac_status"); } &&
14659          { ac_try='test -s "conftest.$ac_objext"'
14660   { (eval echo "$as_me:14660: \"$ac_try\"") >&5
14661   (eval $ac_try) 2>&5
14662   ac_status=$?
14663   echo "$as_me:14663: \$? = $ac_status" >&5
14664   (exit "$ac_status"); }; }; then
14665   ac_cv_sys_largefile_source=1; break
14666 else
14667   echo "$as_me: failed program was:" >&5
14668 cat "conftest.$ac_ext" >&5
14669 fi
14670 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14671   break
14672 done
14673 fi
14674 echo "$as_me:14674: result: $ac_cv_sys_largefile_source" >&5
14675 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14676 if test "$ac_cv_sys_largefile_source" != no; then
14677
14678 cat >>confdefs.h <<EOF
14679 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14680 EOF
14681
14682 fi
14683 rm -rf conftest*
14684
14685 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14686 # in glibc 2.1.3, but that breaks too many other things.
14687 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14688 echo "$as_me:14688: checking for fseeko" >&5
14689 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14690 if test "${ac_cv_func_fseeko+set}" = set; then
14691   echo $ECHO_N "(cached) $ECHO_C" >&6
14692 else
14693   cat >"conftest.$ac_ext" <<_ACEOF
14694 #line 14694 "configure"
14695 #include "confdefs.h"
14696 #include <stdio.h>
14697 int
14698 main (void)
14699 {
14700 return fseeko && fseeko (stdin, 0, 0);
14701   ;
14702   return 0;
14703 }
14704 _ACEOF
14705 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14706 if { (eval echo "$as_me:14706: \"$ac_link\"") >&5
14707   (eval $ac_link) 2>&5
14708   ac_status=$?
14709   echo "$as_me:14709: \$? = $ac_status" >&5
14710   (exit "$ac_status"); } &&
14711          { ac_try='test -s "conftest$ac_exeext"'
14712   { (eval echo "$as_me:14712: \"$ac_try\"") >&5
14713   (eval $ac_try) 2>&5
14714   ac_status=$?
14715   echo "$as_me:14715: \$? = $ac_status" >&5
14716   (exit "$ac_status"); }; }; then
14717   ac_cv_func_fseeko=yes
14718 else
14719   echo "$as_me: failed program was:" >&5
14720 cat "conftest.$ac_ext" >&5
14721 ac_cv_func_fseeko=no
14722 fi
14723 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14724 fi
14725 echo "$as_me:14725: result: $ac_cv_func_fseeko" >&5
14726 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14727 if test $ac_cv_func_fseeko = yes; then
14728
14729 cat >>confdefs.h <<\EOF
14730 #define HAVE_FSEEKO 1
14731 EOF
14732
14733 fi
14734
14735         # Normally we would collect these definitions in the config.h,
14736         # but (like _XOPEN_SOURCE), some environments rely on having these
14737         # defined before any of the system headers are included.  Another
14738         # case comes up with C++, e.g., on AIX the compiler compiles the
14739         # header files by themselves before looking at the body files it is
14740         # told to compile.  For ncurses, those header files do not include
14741         # the config.h
14742         if test "$ac_cv_sys_large_files" != no
14743         then
14744
14745         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14746         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14747
14748         fi
14749         if test "$ac_cv_sys_largefile_source" != no
14750         then
14751
14752         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14753         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14754
14755         fi
14756         if test "$ac_cv_sys_file_offset_bits" != no
14757         then
14758
14759         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14760         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14761
14762         fi
14763
14764         echo "$as_me:14764: checking whether to use struct dirent64" >&5
14765 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14766 if test "${cf_cv_struct_dirent64+set}" = set; then
14767   echo $ECHO_N "(cached) $ECHO_C" >&6
14768 else
14769
14770                 cat >"conftest.$ac_ext" <<_ACEOF
14771 #line 14771 "configure"
14772 #include "confdefs.h"
14773
14774 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14775 #include <sys/types.h>
14776 #include <dirent.h>
14777
14778 int
14779 main (void)
14780 {
14781
14782                 /* if transitional largefile support is setup, this is true */
14783                 extern struct dirent64 * readdir(DIR *);
14784                 struct dirent64 *x = readdir((DIR *)0);
14785                 struct dirent *y = readdir((DIR *)0);
14786                 int z = x - y;
14787                 (void)z;
14788
14789   ;
14790   return 0;
14791 }
14792 _ACEOF
14793 rm -f "conftest.$ac_objext"
14794 if { (eval echo "$as_me:14794: \"$ac_compile\"") >&5
14795   (eval $ac_compile) 2>&5
14796   ac_status=$?
14797   echo "$as_me:14797: \$? = $ac_status" >&5
14798   (exit "$ac_status"); } &&
14799          { ac_try='test -s "conftest.$ac_objext"'
14800   { (eval echo "$as_me:14800: \"$ac_try\"") >&5
14801   (eval $ac_try) 2>&5
14802   ac_status=$?
14803   echo "$as_me:14803: \$? = $ac_status" >&5
14804   (exit "$ac_status"); }; }; then
14805   cf_cv_struct_dirent64=yes
14806 else
14807   echo "$as_me: failed program was:" >&5
14808 cat "conftest.$ac_ext" >&5
14809 cf_cv_struct_dirent64=no
14810 fi
14811 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14812
14813 fi
14814 echo "$as_me:14814: result: $cf_cv_struct_dirent64" >&5
14815 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14816         test "$cf_cv_struct_dirent64" = yes &&
14817 cat >>confdefs.h <<\EOF
14818 #define HAVE_STRUCT_DIRENT64 1
14819 EOF
14820
14821         fi
14822
14823 ### Enable compiling-in rcs id's
14824 echo "$as_me:14824: checking if RCS identifiers should be compiled-in" >&5
14825 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14826
14827 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14828 if test "${with_rcs_ids+set}" = set; then
14829   withval="$with_rcs_ids"
14830   with_rcs_ids=$withval
14831 else
14832   with_rcs_ids=no
14833 fi;
14834 echo "$as_me:14834: result: $with_rcs_ids" >&5
14835 echo "${ECHO_T}$with_rcs_ids" >&6
14836 test "$with_rcs_ids" = yes &&
14837 cat >>confdefs.h <<\EOF
14838 #define USE_RCS_IDS 1
14839 EOF
14840
14841 ###############################################################################
14842
14843 ### Note that some functions (such as const) are normally disabled anyway.
14844 echo "$as_me:14844: checking if you want to build with function extensions" >&5
14845 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14846
14847 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14848 if test "${enable_ext_funcs+set}" = set; then
14849   enableval="$enable_ext_funcs"
14850   with_ext_funcs=$enableval
14851 else
14852   with_ext_funcs=yes
14853 fi;
14854 echo "$as_me:14854: result: $with_ext_funcs" >&5
14855 echo "${ECHO_T}$with_ext_funcs" >&6
14856 if test "$with_ext_funcs" = yes ; then
14857         NCURSES_EXT_FUNCS=1
14858
14859 cat >>confdefs.h <<\EOF
14860 #define HAVE_USE_DEFAULT_COLORS 1
14861 EOF
14862
14863 cat >>confdefs.h <<\EOF
14864 #define NCURSES_EXT_FUNCS 1
14865 EOF
14866
14867 else
14868         NCURSES_EXT_FUNCS=0
14869 fi
14870
14871 ###   use option --enable-const to turn on use of const beyond that in XSI.
14872 echo "$as_me:14872: checking for extended use of const keyword" >&5
14873 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14874
14875 # Check whether --enable-const or --disable-const was given.
14876 if test "${enable_const+set}" = set; then
14877   enableval="$enable_const"
14878   with_ext_const=$enableval
14879 else
14880   with_ext_const=no
14881 fi;
14882 echo "$as_me:14882: result: $with_ext_const" >&5
14883 echo "${ECHO_T}$with_ext_const" >&6
14884 NCURSES_CONST='/*nothing*/'
14885 if test "$with_ext_const" = yes ; then
14886         NCURSES_CONST=const
14887 fi
14888
14889 ###############################################################################
14890 # These options are relatively safe to experiment with.
14891
14892 echo "$as_me:14892: checking if you want all development code" >&5
14893 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14894
14895 # Check whether --with-develop or --without-develop was given.
14896 if test "${with_develop+set}" = set; then
14897   withval="$with_develop"
14898   with_develop=$withval
14899 else
14900   with_develop=no
14901 fi;
14902 echo "$as_me:14902: result: $with_develop" >&5
14903 echo "${ECHO_T}$with_develop" >&6
14904
14905 ###############################################################################
14906 # These are just experimental, probably should not be in a package:
14907
14908 # This is still experimental (20080329), but should ultimately be moved to
14909 # the script-block --with-normal, etc.
14910
14911 echo "$as_me:14911: checking if you want to link with the pthread library" >&5
14912 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14913
14914 # Check whether --with-pthread or --without-pthread was given.
14915 if test "${with_pthread+set}" = set; then
14916   withval="$with_pthread"
14917   with_pthread=$withval
14918 else
14919   with_pthread=no
14920 fi;
14921 echo "$as_me:14921: result: $with_pthread" >&5
14922 echo "${ECHO_T}$with_pthread" >&6
14923
14924 if test "$with_pthread" != no ; then
14925         echo "$as_me:14925: checking for pthread.h" >&5
14926 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14927 if test "${ac_cv_header_pthread_h+set}" = set; then
14928   echo $ECHO_N "(cached) $ECHO_C" >&6
14929 else
14930   cat >"conftest.$ac_ext" <<_ACEOF
14931 #line 14931 "configure"
14932 #include "confdefs.h"
14933 #include <pthread.h>
14934 _ACEOF
14935 if { (eval echo "$as_me:14935: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14936   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14937   ac_status=$?
14938   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14939   rm -f conftest.er1
14940   cat conftest.err >&5
14941   echo "$as_me:14941: \$? = $ac_status" >&5
14942   (exit "$ac_status"); } >/dev/null; then
14943   if test -s conftest.err; then
14944     ac_cpp_err=$ac_c_preproc_warn_flag
14945   else
14946     ac_cpp_err=
14947   fi
14948 else
14949   ac_cpp_err=yes
14950 fi
14951 if test -z "$ac_cpp_err"; then
14952   ac_cv_header_pthread_h=yes
14953 else
14954   echo "$as_me: failed program was:" >&5
14955   cat "conftest.$ac_ext" >&5
14956   ac_cv_header_pthread_h=no
14957 fi
14958 rm -f conftest.err "conftest.$ac_ext"
14959 fi
14960 echo "$as_me:14960: result: $ac_cv_header_pthread_h" >&5
14961 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14962 if test "$ac_cv_header_pthread_h" = yes; then
14963
14964 cat >>confdefs.h <<\EOF
14965 #define HAVE_PTHREADS_H 1
14966 EOF
14967
14968         for cf_lib_pthread in pthread c_r
14969         do
14970             echo "$as_me:14970: checking if we can link with the $cf_lib_pthread library" >&5
14971 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14972             cf_save_LIBS="$LIBS"
14973
14974 cf_add_libs="$LIBS"
14975 # reverse order
14976 cf_add_0lib=
14977 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14978 # filter duplicates
14979 for cf_add_1lib in $cf_add_0lib; do
14980         for cf_add_2lib in $cf_add_libs; do
14981                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14982                         cf_add_1lib=
14983                         break
14984                 fi
14985         done
14986         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14987 done
14988 LIBS="$cf_add_libs"
14989
14990             cat >"conftest.$ac_ext" <<_ACEOF
14991 #line 14991 "configure"
14992 #include "confdefs.h"
14993
14994 #include <pthread.h>
14995
14996 int
14997 main (void)
14998 {
14999
15000                 int rc = pthread_create(0,0,0,0);
15001                 int r2 = pthread_mutexattr_settype(0, 0);
15002
15003   ;
15004   return 0;
15005 }
15006 _ACEOF
15007 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15008 if { (eval echo "$as_me:15008: \"$ac_link\"") >&5
15009   (eval $ac_link) 2>&5
15010   ac_status=$?
15011   echo "$as_me:15011: \$? = $ac_status" >&5
15012   (exit "$ac_status"); } &&
15013          { ac_try='test -s "conftest$ac_exeext"'
15014   { (eval echo "$as_me:15014: \"$ac_try\"") >&5
15015   (eval $ac_try) 2>&5
15016   ac_status=$?
15017   echo "$as_me:15017: \$? = $ac_status" >&5
15018   (exit "$ac_status"); }; }; then
15019   with_pthread=yes
15020 else
15021   echo "$as_me: failed program was:" >&5
15022 cat "conftest.$ac_ext" >&5
15023 with_pthread=no
15024 fi
15025 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15026             LIBS="$cf_save_LIBS"
15027             echo "$as_me:15027: result: $with_pthread" >&5
15028 echo "${ECHO_T}$with_pthread" >&6
15029             test "$with_pthread" = yes && break
15030         done
15031
15032         if test "$with_pthread" = yes ; then
15033
15034 cf_add_libs="$LIBS"
15035 # reverse order
15036 cf_add_0lib=
15037 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15038 # filter duplicates
15039 for cf_add_1lib in $cf_add_0lib; do
15040         for cf_add_2lib in $cf_add_libs; do
15041                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15042                         cf_add_1lib=
15043                         break
15044                 fi
15045         done
15046         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15047 done
15048 LIBS="$cf_add_libs"
15049
15050 cat >>confdefs.h <<\EOF
15051 #define HAVE_LIBPTHREADS 1
15052 EOF
15053
15054         else
15055             { { echo "$as_me:15055: error: Cannot link with pthread library" >&5
15056 echo "$as_me: error: Cannot link with pthread library" >&2;}
15057    { (exit 1); exit 1; }; }
15058         fi
15059
15060 fi
15061
15062 fi
15063
15064 echo "$as_me:15064: checking if you want to use weak-symbols for pthreads" >&5
15065 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15066
15067 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15068 if test "${enable_weak_symbols+set}" = set; then
15069   enableval="$enable_weak_symbols"
15070   use_weak_symbols=$withval
15071 else
15072   use_weak_symbols=no
15073 fi;
15074 echo "$as_me:15074: result: $use_weak_symbols" >&5
15075 echo "${ECHO_T}$use_weak_symbols" >&6
15076 if test "$use_weak_symbols" = yes ; then
15077
15078 echo "$as_me:15078: checking if $CC supports weak symbols" >&5
15079 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15080 if test "${cf_cv_weak_symbols+set}" = set; then
15081   echo $ECHO_N "(cached) $ECHO_C" >&6
15082 else
15083
15084 cat >"conftest.$ac_ext" <<_ACEOF
15085 #line 15085 "configure"
15086 #include "confdefs.h"
15087
15088 #include <stdio.h>
15089 int
15090 main (void)
15091 {
15092
15093 #if defined(__GNUC__)
15094 #  if defined __USE_ISOC99
15095 #    define _cat_pragma(exp)    _Pragma(#exp)
15096 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15097 #  else
15098 #    define _weak_pragma(exp)
15099 #  endif
15100 #  define _declare(name)        __extension__ extern __typeof__(name) name
15101 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15102 #endif
15103
15104 weak_symbol(fopen);
15105
15106   ;
15107   return 0;
15108 }
15109 _ACEOF
15110 rm -f "conftest.$ac_objext"
15111 if { (eval echo "$as_me:15111: \"$ac_compile\"") >&5
15112   (eval $ac_compile) 2>&5
15113   ac_status=$?
15114   echo "$as_me:15114: \$? = $ac_status" >&5
15115   (exit "$ac_status"); } &&
15116          { ac_try='test -s "conftest.$ac_objext"'
15117   { (eval echo "$as_me:15117: \"$ac_try\"") >&5
15118   (eval $ac_try) 2>&5
15119   ac_status=$?
15120   echo "$as_me:15120: \$? = $ac_status" >&5
15121   (exit "$ac_status"); }; }; then
15122   cf_cv_weak_symbols=yes
15123 else
15124   echo "$as_me: failed program was:" >&5
15125 cat "conftest.$ac_ext" >&5
15126 cf_cv_weak_symbols=no
15127 fi
15128 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15129
15130 fi
15131 echo "$as_me:15131: result: $cf_cv_weak_symbols" >&5
15132 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15133
15134 else
15135         cf_cv_weak_symbols=no
15136 fi
15137
15138 if test $cf_cv_weak_symbols = yes ; then
15139
15140 cat >>confdefs.h <<\EOF
15141 #define USE_WEAK_SYMBOLS 1
15142 EOF
15143
15144 fi
15145
15146 PTHREAD=
15147 if test "$with_pthread" = "yes" ; then
15148
15149 cat >>confdefs.h <<\EOF
15150 #define USE_PTHREADS 1
15151 EOF
15152
15153         enable_reentrant=yes
15154         if test $cf_cv_weak_symbols = yes ; then
15155                 PTHREAD=-lpthread
15156         fi
15157 fi
15158
15159 # OpenSUSE is installing ncurses6, using reentrant option.
15160 echo "$as_me:15160: checking for _nc_TABSIZE" >&5
15161 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15162 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15163   echo $ECHO_N "(cached) $ECHO_C" >&6
15164 else
15165   cat >"conftest.$ac_ext" <<_ACEOF
15166 #line 15166 "configure"
15167 #include "confdefs.h"
15168 #define _nc_TABSIZE autoconf_temporary
15169 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15170 #undef _nc_TABSIZE
15171
15172 #ifdef __cplusplus
15173 extern "C"
15174 #endif
15175
15176 /* We use char because int might match the return type of a gcc2
15177    builtin and then its argument prototype would still apply.  */
15178 char _nc_TABSIZE (void);
15179
15180 int
15181 main (void)
15182 {
15183
15184 /* The GNU C library defines stubs for functions which it implements
15185     to always fail with ENOSYS.  Some functions are actually named
15186     something starting with __ and the normal name is an alias.  */
15187 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15188 #error found stub for _nc_TABSIZE
15189 #endif
15190
15191         return _nc_TABSIZE ();
15192   ;
15193   return 0;
15194 }
15195 _ACEOF
15196 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15197 if { (eval echo "$as_me:15197: \"$ac_link\"") >&5
15198   (eval $ac_link) 2>&5
15199   ac_status=$?
15200   echo "$as_me:15200: \$? = $ac_status" >&5
15201   (exit "$ac_status"); } &&
15202          { ac_try='test -s "conftest$ac_exeext"'
15203   { (eval echo "$as_me:15203: \"$ac_try\"") >&5
15204   (eval $ac_try) 2>&5
15205   ac_status=$?
15206   echo "$as_me:15206: \$? = $ac_status" >&5
15207   (exit "$ac_status"); }; }; then
15208   ac_cv_func__nc_TABSIZE=yes
15209 else
15210   echo "$as_me: failed program was:" >&5
15211 cat "conftest.$ac_ext" >&5
15212 ac_cv_func__nc_TABSIZE=no
15213 fi
15214 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15215 fi
15216 echo "$as_me:15216: result: $ac_cv_func__nc_TABSIZE" >&5
15217 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15218 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15219   assume_reentrant=yes
15220 else
15221   assume_reentrant=no
15222 fi
15223
15224 # Reentrant code has to be opaque; there's little advantage to making ncurses
15225 # opaque outside of that, so there is no --enable-opaque option.  We can use
15226 # this option without --with-pthreads, but this will be always set for
15227 # pthreads.
15228 echo "$as_me:15228: checking if you want experimental reentrant code" >&5
15229 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15230
15231 # Check whether --enable-reentrant or --disable-reentrant was given.
15232 if test "${enable_reentrant+set}" = set; then
15233   enableval="$enable_reentrant"
15234   with_reentrant=$enableval
15235 else
15236   with_reentrant=$assume_reentrant
15237 fi;
15238 echo "$as_me:15238: result: $with_reentrant" >&5
15239 echo "${ECHO_T}$with_reentrant" >&6
15240 if test "$with_reentrant" = yes ; then
15241         cf_cv_enable_reentrant=1
15242         if test $cf_cv_weak_symbols = yes ; then
15243
15244 # remove pthread library from $LIBS
15245 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15246
15247         elif test "$assume_reentrant" = no ; then
15248                 LIB_SUFFIX="t${LIB_SUFFIX}"
15249         fi
15250
15251 cat >>confdefs.h <<\EOF
15252 #define USE_REENTRANT 1
15253 EOF
15254
15255 else
15256         cf_cv_enable_reentrant=0
15257 fi
15258
15259 ### Allow using a different wrap-prefix
15260 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15261         echo "$as_me:15261: checking for prefix used to wrap public variables" >&5
15262 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15263
15264 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15265 if test "${with_wrap_prefix+set}" = set; then
15266   withval="$with_wrap_prefix"
15267   NCURSES_WRAP_PREFIX=$withval
15268 else
15269   NCURSES_WRAP_PREFIX=_nc_
15270 fi;
15271         echo "$as_me:15271: result: $NCURSES_WRAP_PREFIX" >&5
15272 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15273 else
15274         NCURSES_WRAP_PREFIX=_nc_
15275 fi
15276
15277 cat >>confdefs.h <<EOF
15278 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15279 EOF
15280
15281 ###############################################################################
15282
15283 ###     use option --disable-echo to suppress full display compiling commands
15284
15285 echo "$as_me:15285: checking if you want to see long compiling messages" >&5
15286 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15287
15288 # Check whether --enable-echo or --disable-echo was given.
15289 if test "${enable_echo+set}" = set; then
15290   enableval="$enable_echo"
15291   test "$enableval" != no && enableval=yes
15292         if test "$enableval" != "yes" ; then
15293
15294         ECHO_LT='--silent'
15295         ECHO_LD='@echo linking $@;'
15296         RULE_CC='@echo compiling $<'
15297         SHOW_CC='@echo compiling $@'
15298         ECHO_CC='@'
15299
15300         else
15301
15302         ECHO_LT=''
15303         ECHO_LD=''
15304         RULE_CC=''
15305         SHOW_CC=''
15306         ECHO_CC=''
15307
15308         fi
15309 else
15310   enableval=yes
15311
15312         ECHO_LT=''
15313         ECHO_LD=''
15314         RULE_CC=''
15315         SHOW_CC=''
15316         ECHO_CC=''
15317
15318 fi;
15319 echo "$as_me:15319: result: $enableval" >&5
15320 echo "${ECHO_T}$enableval" >&6
15321
15322 echo "$as_me:15322: checking if you want to use C11 _Noreturn feature" >&5
15323 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15324
15325 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15326 if test "${enable_stdnoreturn+set}" = set; then
15327   enableval="$enable_stdnoreturn"
15328   test "$enableval" != yes && enableval=no
15329         if test "$enableval" != "no" ; then
15330     enable_stdnoreturn=yes
15331         else
15332                 enable_stdnoreturn=no
15333         fi
15334 else
15335   enableval=no
15336         enable_stdnoreturn=no
15337
15338 fi;
15339 echo "$as_me:15339: result: $enable_stdnoreturn" >&5
15340 echo "${ECHO_T}$enable_stdnoreturn" >&6
15341
15342 if test $enable_stdnoreturn = yes; then
15343 echo "$as_me:15343: checking for C11 _Noreturn feature" >&5
15344 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15345 if test "${cf_cv_c11_noreturn+set}" = set; then
15346   echo $ECHO_N "(cached) $ECHO_C" >&6
15347 else
15348   cat >"conftest.$ac_ext" <<_ACEOF
15349 #line 15349 "configure"
15350 #include "confdefs.h"
15351
15352 #include <stdio.h>
15353 #include <stdlib.h>
15354 #include <stdnoreturn.h>
15355 static _Noreturn void giveup(void) { exit(0); }
15356
15357 int
15358 main (void)
15359 {
15360 if (feof(stdin)) giveup()
15361   ;
15362   return 0;
15363 }
15364 _ACEOF
15365 rm -f "conftest.$ac_objext"
15366 if { (eval echo "$as_me:15366: \"$ac_compile\"") >&5
15367   (eval $ac_compile) 2>&5
15368   ac_status=$?
15369   echo "$as_me:15369: \$? = $ac_status" >&5
15370   (exit "$ac_status"); } &&
15371          { ac_try='test -s "conftest.$ac_objext"'
15372   { (eval echo "$as_me:15372: \"$ac_try\"") >&5
15373   (eval $ac_try) 2>&5
15374   ac_status=$?
15375   echo "$as_me:15375: \$? = $ac_status" >&5
15376   (exit "$ac_status"); }; }; then
15377   cf_cv_c11_noreturn=yes
15378 else
15379   echo "$as_me: failed program was:" >&5
15380 cat "conftest.$ac_ext" >&5
15381 cf_cv_c11_noreturn=no
15382 fi
15383 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15384
15385 fi
15386 echo "$as_me:15386: result: $cf_cv_c11_noreturn" >&5
15387 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15388 else
15389         cf_cv_c11_noreturn=no,
15390 fi
15391
15392 if test "$cf_cv_c11_noreturn" = yes; then
15393
15394 cat >>confdefs.h <<\EOF
15395 #define HAVE_STDNORETURN_H 1
15396 EOF
15397
15398 cat >>confdefs.h <<EOF
15399 #define STDC_NORETURN _Noreturn
15400 EOF
15401
15402         HAVE_STDNORETURN_H=1
15403 else
15404         HAVE_STDNORETURN_H=0
15405 fi
15406
15407 if test "$GCC" = yes || test "$GXX" = yes
15408 then
15409
15410 if test "$GCC" = yes || test "$GXX" = yes
15411 then
15412         case $CFLAGS in
15413         (*-Werror=*)
15414                 cf_temp_flags=
15415                 for cf_temp_scan in $CFLAGS
15416                 do
15417                         case "x$cf_temp_scan" in
15418                         (x-Werror=format*)
15419
15420         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15421         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15422
15423                                 ;;
15424                         (x-Werror=*)
15425
15426         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15427         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15428
15429                                 ;;
15430                         (*)
15431
15432         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15433         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15434
15435                                 ;;
15436                         esac
15437                 done
15438                 if test "x$CFLAGS" != "x$cf_temp_flags"
15439                 then
15440                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15441
15442 echo "${as_me:-configure}:15442: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15443
15444                         CFLAGS="$cf_temp_flags"
15445                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15446
15447 echo "${as_me:-configure}:15447: testing ... fixed $CFLAGS ..." 1>&5
15448
15449                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15450
15451 echo "${as_me:-configure}:15451: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15452
15453                 fi
15454                 ;;
15455         esac
15456 fi
15457
15458 if test "$GCC" = yes || test "$GXX" = yes
15459 then
15460         case $CPPFLAGS in
15461         (*-Werror=*)
15462                 cf_temp_flags=
15463                 for cf_temp_scan in $CPPFLAGS
15464                 do
15465                         case "x$cf_temp_scan" in
15466                         (x-Werror=format*)
15467
15468         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15469         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15470
15471                                 ;;
15472                         (x-Werror=*)
15473
15474         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15475         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15476
15477                                 ;;
15478                         (*)
15479
15480         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15481         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15482
15483                                 ;;
15484                         esac
15485                 done
15486                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
15487                 then
15488                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15489
15490 echo "${as_me:-configure}:15490: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15491
15492                         CPPFLAGS="$cf_temp_flags"
15493                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15494
15495 echo "${as_me:-configure}:15495: testing ... fixed $CPPFLAGS ..." 1>&5
15496
15497                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15498
15499 echo "${as_me:-configure}:15499: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15500
15501                 fi
15502                 ;;
15503         esac
15504 fi
15505
15506 if test "$GCC" = yes || test "$GXX" = yes
15507 then
15508         case $LDFLAGS in
15509         (*-Werror=*)
15510                 cf_temp_flags=
15511                 for cf_temp_scan in $LDFLAGS
15512                 do
15513                         case "x$cf_temp_scan" in
15514                         (x-Werror=format*)
15515
15516         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15517         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15518
15519                                 ;;
15520                         (x-Werror=*)
15521
15522         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15523         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15524
15525                                 ;;
15526                         (*)
15527
15528         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15529         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15530
15531                                 ;;
15532                         esac
15533                 done
15534                 if test "x$LDFLAGS" != "x$cf_temp_flags"
15535                 then
15536                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15537
15538 echo "${as_me:-configure}:15538: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15539
15540                         LDFLAGS="$cf_temp_flags"
15541                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15542
15543 echo "${as_me:-configure}:15543: testing ... fixed $LDFLAGS ..." 1>&5
15544
15545                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15546
15547 echo "${as_me:-configure}:15547: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15548
15549                 fi
15550                 ;;
15551         esac
15552 fi
15553
15554 echo "$as_me:15554: checking if you want to turn on gcc warnings" >&5
15555 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15556
15557 # Check whether --enable-warnings or --disable-warnings was given.
15558 if test "${enable_warnings+set}" = set; then
15559   enableval="$enable_warnings"
15560   test "$enableval" != yes && enableval=no
15561         if test "$enableval" != "no" ; then
15562     enable_warnings=yes
15563         else
15564                 enable_warnings=no
15565         fi
15566 else
15567   enableval=no
15568         enable_warnings=no
15569
15570 fi;
15571 echo "$as_me:15571: result: $enable_warnings" >&5
15572 echo "${ECHO_T}$enable_warnings" >&6
15573 if test "$enable_warnings" = "yes"
15574 then
15575
15576 if test "x$have_x" = xyes; then
15577
15578 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15579 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15580 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15581 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15582 for cf_X_CFLAGS in $X_CFLAGS
15583 do
15584         case "x$cf_X_CFLAGS" in
15585         x-[IUD]*)
15586                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15587                 ;;
15588         *)
15589                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15590                 ;;
15591         esac
15592 done
15593
15594 cat >"conftest.$ac_ext" <<_ACEOF
15595 #line 15595 "configure"
15596 #include "confdefs.h"
15597
15598 #include <stdlib.h>
15599 #include <X11/Intrinsic.h>
15600
15601 int
15602 main (void)
15603 {
15604 String foo = malloc(1); free((void*)foo)
15605   ;
15606   return 0;
15607 }
15608 _ACEOF
15609 rm -f "conftest.$ac_objext"
15610 if { (eval echo "$as_me:15610: \"$ac_compile\"") >&5
15611   (eval $ac_compile) 2>&5
15612   ac_status=$?
15613   echo "$as_me:15613: \$? = $ac_status" >&5
15614   (exit "$ac_status"); } &&
15615          { ac_try='test -s "conftest.$ac_objext"'
15616   { (eval echo "$as_me:15616: \"$ac_try\"") >&5
15617   (eval $ac_try) 2>&5
15618   ac_status=$?
15619   echo "$as_me:15619: \$? = $ac_status" >&5
15620   (exit "$ac_status"); }; }; then
15621
15622 echo "$as_me:15622: checking for X11/Xt const-feature" >&5
15623 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15624 if test "${cf_cv_const_x_string+set}" = set; then
15625   echo $ECHO_N "(cached) $ECHO_C" >&6
15626 else
15627
15628         cat >"conftest.$ac_ext" <<_ACEOF
15629 #line 15629 "configure"
15630 #include "confdefs.h"
15631
15632 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15633 #undef  XTSTRINGDEFINES /* X11R5 and later */
15634 #include <stdlib.h>
15635 #include <X11/Intrinsic.h>
15636
15637 int
15638 main (void)
15639 {
15640 String foo = malloc(1); *foo = 0
15641   ;
15642   return 0;
15643 }
15644 _ACEOF
15645 rm -f "conftest.$ac_objext"
15646 if { (eval echo "$as_me:15646: \"$ac_compile\"") >&5
15647   (eval $ac_compile) 2>&5
15648   ac_status=$?
15649   echo "$as_me:15649: \$? = $ac_status" >&5
15650   (exit "$ac_status"); } &&
15651          { ac_try='test -s "conftest.$ac_objext"'
15652   { (eval echo "$as_me:15652: \"$ac_try\"") >&5
15653   (eval $ac_try) 2>&5
15654   ac_status=$?
15655   echo "$as_me:15655: \$? = $ac_status" >&5
15656   (exit "$ac_status"); }; }; then
15657
15658                         cf_cv_const_x_string=no
15659
15660 else
15661   echo "$as_me: failed program was:" >&5
15662 cat "conftest.$ac_ext" >&5
15663
15664                         cf_cv_const_x_string=yes
15665
15666 fi
15667 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15668
15669 fi
15670 echo "$as_me:15670: result: $cf_cv_const_x_string" >&5
15671 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15672
15673 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15674 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15675 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15676
15677 case "$cf_cv_const_x_string" in
15678 (no)
15679
15680         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15681         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15682
15683         ;;
15684 (*)
15685
15686         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15687         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15688
15689         ;;
15690 esac
15691
15692 else
15693   echo "$as_me: failed program was:" >&5
15694 cat "conftest.$ac_ext" >&5
15695 fi
15696 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15697  fi
15698 cat > "conftest.$ac_ext" <<EOF
15699 #line 15699 "${as_me:-configure}"
15700 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15701 EOF
15702 if test "$INTEL_COMPILER" = yes
15703 then
15704 # The "-wdXXX" options suppress warnings:
15705 # remark #1419: external declaration in primary source file
15706 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15707 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15708 # remark #193: zero used for undefined preprocessing identifier
15709 # remark #593: variable "curs_sb_left_arrow" was set but never used
15710 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15711 # remark #869: parameter "tw" was never referenced
15712 # remark #981: operands are evaluated in unspecified order
15713 # warning #279: controlling expression is constant
15714
15715         { echo "$as_me:15715: checking for $CC warning options..." >&5
15716 echo "$as_me: checking for $CC warning options..." >&6;}
15717         cf_save_CFLAGS="$CFLAGS"
15718         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15719         for cf_opt in \
15720                 wd1419 \
15721                 wd1683 \
15722                 wd1684 \
15723                 wd193 \
15724                 wd593 \
15725                 wd279 \
15726                 wd810 \
15727                 wd869 \
15728                 wd981
15729         do
15730                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15731                 if { (eval echo "$as_me:15731: \"$ac_compile\"") >&5
15732   (eval $ac_compile) 2>&5
15733   ac_status=$?
15734   echo "$as_me:15734: \$? = $ac_status" >&5
15735   (exit "$ac_status"); }; then
15736                         test -n "$verbose" && echo "$as_me:15736: result: ... -$cf_opt" >&5
15737 echo "${ECHO_T}... -$cf_opt" >&6
15738                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15739                 fi
15740         done
15741         CFLAGS="$cf_save_CFLAGS"
15742 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15743 then
15744         { echo "$as_me:15744: checking for $CC warning options..." >&5
15745 echo "$as_me: checking for $CC warning options..." >&6;}
15746         cf_save_CFLAGS="$CFLAGS"
15747         cf_warn_CONST=""
15748         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15749         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15750         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15751         for cf_opt in W Wall \
15752                 Wbad-function-cast \
15753                 Wcast-align \
15754                 Wcast-qual \
15755                 Wdeclaration-after-statement \
15756                 Wextra \
15757                 Winline \
15758                 Wmissing-declarations \
15759                 Wmissing-prototypes \
15760                 Wnested-externs \
15761                 Wpointer-arith \
15762                 Wshadow \
15763                 Wstrict-prototypes \
15764                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15765         do
15766                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15767                 if { (eval echo "$as_me:15767: \"$ac_compile\"") >&5
15768   (eval $ac_compile) 2>&5
15769   ac_status=$?
15770   echo "$as_me:15770: \$? = $ac_status" >&5
15771   (exit "$ac_status"); }; then
15772                         test -n "$verbose" && echo "$as_me:15772: result: ... -$cf_opt" >&5
15773 echo "${ECHO_T}... -$cf_opt" >&6
15774                         case "$cf_opt" in
15775                         (Winline)
15776                                 case "$GCC_VERSION" in
15777                                 ([34].*)
15778                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15779
15780 echo "${as_me:-configure}:15780: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15781
15782                                         continue;;
15783                                 esac
15784                                 ;;
15785                         (Wpointer-arith)
15786                                 case "$GCC_VERSION" in
15787                                 ([12].*)
15788                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15789
15790 echo "${as_me:-configure}:15790: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15791
15792                                         continue;;
15793                                 esac
15794                                 ;;
15795                         esac
15796                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15797                 fi
15798         done
15799         CFLAGS="$cf_save_CFLAGS"
15800 fi
15801 rm -rf ./conftest*
15802
15803 fi
15804
15805 if test "$GCC" = yes || test "$GXX" = yes
15806 then
15807 cat > conftest.i <<EOF
15808 #ifndef GCC_PRINTF
15809 #define GCC_PRINTF 0
15810 #endif
15811 #ifndef GCC_SCANF
15812 #define GCC_SCANF 0
15813 #endif
15814 #ifndef GCC_NORETURN
15815 #define GCC_NORETURN /* nothing */
15816 #endif
15817 #ifndef GCC_UNUSED
15818 #define GCC_UNUSED /* nothing */
15819 #endif
15820 EOF
15821 if test "$GCC" = yes
15822 then
15823         { echo "$as_me:15823: checking for $CC __attribute__ directives..." >&5
15824 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15825 cat > "conftest.$ac_ext" <<EOF
15826 #line 15826 "${as_me:-configure}"
15827 #include <stdio.h>
15828 #include "confdefs.h"
15829 #include "conftest.h"
15830 #include "conftest.i"
15831 #if     GCC_PRINTF
15832 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15833 #else
15834 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15835 #endif
15836 #if     GCC_SCANF
15837 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15838 #else
15839 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15840 #endif
15841 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15842 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15843 extern GCC_NORETURN void foo(void);
15844 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15845 EOF
15846         cf_printf_attribute=no
15847         cf_scanf_attribute=no
15848         for cf_attribute in scanf printf unused noreturn
15849         do
15850
15851 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15852
15853                 cf_directive="__attribute__(($cf_attribute))"
15854                 echo "checking for $CC $cf_directive" 1>&5
15855
15856                 case "$cf_attribute" in
15857                 (printf)
15858                         cf_printf_attribute=yes
15859                         cat >conftest.h <<EOF
15860 #define GCC_$cf_ATTRIBUTE 1
15861 EOF
15862                         ;;
15863                 (scanf)
15864                         cf_scanf_attribute=yes
15865                         cat >conftest.h <<EOF
15866 #define GCC_$cf_ATTRIBUTE 1
15867 EOF
15868                         ;;
15869                 (*)
15870                         cat >conftest.h <<EOF
15871 #define GCC_$cf_ATTRIBUTE $cf_directive
15872 EOF
15873                         ;;
15874                 esac
15875
15876                 if { (eval echo "$as_me:15876: \"$ac_compile\"") >&5
15877   (eval $ac_compile) 2>&5
15878   ac_status=$?
15879   echo "$as_me:15879: \$? = $ac_status" >&5
15880   (exit "$ac_status"); }; then
15881                         test -n "$verbose" && echo "$as_me:15881: result: ... $cf_attribute" >&5
15882 echo "${ECHO_T}... $cf_attribute" >&6
15883                         cat conftest.h >>confdefs.h
15884                         case "$cf_attribute" in
15885                         (noreturn)
15886
15887 cat >>confdefs.h <<EOF
15888 #define GCC_NORETURN $cf_directive
15889 EOF
15890
15891                                 ;;
15892                         (printf)
15893                                 cf_value='/* nothing */'
15894                                 if test "$cf_printf_attribute" != no ; then
15895                                         cf_value='__attribute__((format(printf,fmt,var)))'
15896
15897 cat >>confdefs.h <<\EOF
15898 #define GCC_PRINTF 1
15899 EOF
15900
15901                                 fi
15902
15903 cat >>confdefs.h <<EOF
15904 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15905 EOF
15906
15907                                 ;;
15908                         (scanf)
15909                                 cf_value='/* nothing */'
15910                                 if test "$cf_scanf_attribute" != no ; then
15911                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15912
15913 cat >>confdefs.h <<\EOF
15914 #define GCC_SCANF 1
15915 EOF
15916
15917                                 fi
15918
15919 cat >>confdefs.h <<EOF
15920 #define GCC_SCANFLIKE(fmt,var) $cf_value
15921 EOF
15922
15923                                 ;;
15924                         (unused)
15925
15926 cat >>confdefs.h <<EOF
15927 #define GCC_UNUSED $cf_directive
15928 EOF
15929
15930                                 ;;
15931                         esac
15932                 fi
15933         done
15934 else
15935         ${FGREP-fgrep} define conftest.i >>confdefs.h
15936 fi
15937 rm -rf ./conftest*
15938 fi
15939
15940 fi
15941
15942 if test "x$enable_warnings" = "xyes"; then
15943
15944         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
15945
15946 fi
15947
15948 ###     use option --enable-assertions to turn on generation of assertion code
15949 echo "$as_me:15949: checking if you want to enable runtime assertions" >&5
15950 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15951
15952 # Check whether --enable-assertions or --disable-assertions was given.
15953 if test "${enable_assertions+set}" = set; then
15954   enableval="$enable_assertions"
15955   with_assertions=$enableval
15956 else
15957   with_assertions=no
15958 fi;
15959 echo "$as_me:15959: result: $with_assertions" >&5
15960 echo "${ECHO_T}$with_assertions" >&6
15961 if test -n "$GCC"
15962 then
15963         if test "$with_assertions" = no
15964         then
15965                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15966         else
15967
15968         ADAFLAGS="$ADAFLAGS -gnata"
15969
15970         fi
15971 fi
15972
15973 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15974
15975 cat >>confdefs.h <<\EOF
15976 #define HAVE_NC_ALLOC_H 1
15977 EOF
15978
15979 ###     use option --enable-expanded to generate certain macros as functions
15980
15981 # Check whether --enable-expanded or --disable-expanded was given.
15982 if test "${enable_expanded+set}" = set; then
15983   enableval="$enable_expanded"
15984   test "$enableval" = yes &&
15985 cat >>confdefs.h <<\EOF
15986 #define NCURSES_EXPANDED 1
15987 EOF
15988
15989 fi;
15990
15991 ###     use option --disable-macros to suppress macros in favor of functions
15992
15993 # Check whether --enable-macros or --disable-macros was given.
15994 if test "${enable_macros+set}" = set; then
15995   enableval="$enable_macros"
15996   test "$enableval" = no &&
15997 cat >>confdefs.h <<\EOF
15998 #define NCURSES_NOMACROS 1
15999 EOF
16000
16001 fi;
16002
16003 # Normally we only add trace() to the debug-library.  Allow this to be
16004 # extended to all models of the ncurses library:
16005 cf_all_traces=no
16006 case "$CFLAGS $CPPFLAGS" in
16007 (*-DTRACE*)
16008         cf_all_traces=yes
16009         ;;
16010 esac
16011
16012 echo "$as_me:16012: checking whether to add trace feature to all models" >&5
16013 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16014
16015 # Check whether --with-trace or --without-trace was given.
16016 if test "${with_trace+set}" = set; then
16017   withval="$with_trace"
16018   cf_with_trace=$withval
16019 else
16020   cf_with_trace=$cf_all_traces
16021 fi;
16022 echo "$as_me:16022: result: $cf_with_trace" >&5
16023 echo "${ECHO_T}$cf_with_trace" >&6
16024
16025 if test "$cf_with_trace" = yes ; then
16026         ADA_TRACE=TRUE
16027
16028 cf_fix_cppflags=no
16029 cf_new_cflags=
16030 cf_new_cppflags=
16031 cf_new_extra_cppflags=
16032
16033 for cf_add_cflags in -DTRACE
16034 do
16035 case "$cf_fix_cppflags" in
16036 (no)
16037         case "$cf_add_cflags" in
16038         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16039                 case "$cf_add_cflags" in
16040                 (-D*)
16041                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16042
16043                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16044                                 && test -z "${cf_tst_cflags}" \
16045                                 && cf_fix_cppflags=yes
16046
16047                         if test "$cf_fix_cppflags" = yes ; then
16048
16049         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16050         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16051
16052                                 continue
16053                         elif test "${cf_tst_cflags}" = "\"'" ; then
16054
16055         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16056         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16057
16058                                 continue
16059                         fi
16060                         ;;
16061                 esac
16062                 case "$CPPFLAGS" in
16063                 (*$cf_add_cflags)
16064                         ;;
16065                 (*)
16066                         case "$cf_add_cflags" in
16067                         (-D*)
16068                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16069
16070 CPPFLAGS=`echo "$CPPFLAGS" | \
16071         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16072                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16073
16074                                 ;;
16075                         esac
16076
16077         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16078         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16079
16080                         ;;
16081                 esac
16082                 ;;
16083         (*)
16084
16085         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16086         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16087
16088                 ;;
16089         esac
16090         ;;
16091 (yes)
16092
16093         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16094         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16095
16096         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16097
16098         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16099                 && test -z "${cf_tst_cflags}" \
16100                 && cf_fix_cppflags=no
16101         ;;
16102 esac
16103 done
16104
16105 if test -n "$cf_new_cflags" ; then
16106
16107         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16108         CFLAGS="${CFLAGS}$cf_new_cflags"
16109
16110 fi
16111
16112 if test -n "$cf_new_cppflags" ; then
16113
16114         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16115         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16116
16117 fi
16118
16119 if test -n "$cf_new_extra_cppflags" ; then
16120
16121         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16122         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16123
16124 fi
16125
16126 else
16127         ADA_TRACE=FALSE
16128 fi
16129
16130 echo "$as_me:16130: checking if we want to use GNAT projects" >&5
16131 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16132
16133 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16134 if test "${enable_gnat_projects+set}" = set; then
16135   enableval="$enable_gnat_projects"
16136   test "$enableval" != no && enableval=yes
16137         if test "$enableval" != "yes" ; then
16138     enable_gnat_projects=no
16139         else
16140                 enable_gnat_projects=yes
16141         fi
16142 else
16143   enableval=yes
16144         enable_gnat_projects=yes
16145
16146 fi;
16147 echo "$as_me:16147: result: $enable_gnat_projects" >&5
16148 echo "${ECHO_T}$enable_gnat_projects" >&6
16149
16150 ###     Checks for libraries.
16151 case $cf_cv_system_name in
16152 (*mingw32*)
16153
16154 echo "$as_me:16154: checking if ssp library is needed" >&5
16155 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16156 if test "${cf_cv_need_libssp+set}" = set; then
16157   echo $ECHO_N "(cached) $ECHO_C" >&6
16158 else
16159
16160 cat >"conftest.$ac_ext" <<_ACEOF
16161 #line 16161 "configure"
16162 #include "confdefs.h"
16163
16164 #include <sys/types.h>
16165 #include <dirent.h>
16166
16167 int
16168 main (void)
16169 {
16170
16171        DIR *dp = opendir(".");
16172
16173   ;
16174   return 0;
16175 }
16176 _ACEOF
16177 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16178 if { (eval echo "$as_me:16178: \"$ac_link\"") >&5
16179   (eval $ac_link) 2>&5
16180   ac_status=$?
16181   echo "$as_me:16181: \$? = $ac_status" >&5
16182   (exit "$ac_status"); } &&
16183          { ac_try='test -s "conftest$ac_exeext"'
16184   { (eval echo "$as_me:16184: \"$ac_try\"") >&5
16185   (eval $ac_try) 2>&5
16186   ac_status=$?
16187   echo "$as_me:16187: \$? = $ac_status" >&5
16188   (exit "$ac_status"); }; }; then
16189   cf_cv_need_libssp=no
16190 else
16191   echo "$as_me: failed program was:" >&5
16192 cat "conftest.$ac_ext" >&5
16193
16194         cf_save_LIBS="$LIBS"
16195         LIBS="$LIBS -lssp"
16196         cat >"conftest.$ac_ext" <<_ACEOF
16197 #line 16197 "configure"
16198 #include "confdefs.h"
16199
16200 #include <sys/types.h>
16201 #include <dirent.h>
16202
16203 int
16204 main (void)
16205 {
16206
16207                    DIR *dp = opendir(".");
16208
16209   ;
16210   return 0;
16211 }
16212 _ACEOF
16213 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16214 if { (eval echo "$as_me:16214: \"$ac_link\"") >&5
16215   (eval $ac_link) 2>&5
16216   ac_status=$?
16217   echo "$as_me:16217: \$? = $ac_status" >&5
16218   (exit "$ac_status"); } &&
16219          { ac_try='test -s "conftest$ac_exeext"'
16220   { (eval echo "$as_me:16220: \"$ac_try\"") >&5
16221   (eval $ac_try) 2>&5
16222   ac_status=$?
16223   echo "$as_me:16223: \$? = $ac_status" >&5
16224   (exit "$ac_status"); }; }; then
16225   cf_cv_need_libssp=yes
16226 else
16227   echo "$as_me: failed program was:" >&5
16228 cat "conftest.$ac_ext" >&5
16229 cf_cv_need_libssp=maybe
16230 fi
16231 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16232         LIBS="$cf_save_LIBS"
16233
16234 fi
16235 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16236 fi
16237 echo "$as_me:16237: result: $cf_cv_need_libssp" >&5
16238 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16239
16240 if test "x$cf_cv_need_libssp" = xyes
16241 then
16242
16243 cf_add_libs="$LIBS"
16244 # reverse order
16245 cf_add_0lib=
16246 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16247 # filter duplicates
16248 for cf_add_1lib in $cf_add_0lib; do
16249         for cf_add_2lib in $cf_add_libs; do
16250                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16251                         cf_add_1lib=
16252                         break
16253                 fi
16254         done
16255         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16256 done
16257 LIBS="$cf_add_libs"
16258
16259 fi
16260
16261         ;;
16262 (*)
16263 echo "$as_me:16263: checking for gettimeofday" >&5
16264 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16265 if test "${ac_cv_func_gettimeofday+set}" = set; then
16266   echo $ECHO_N "(cached) $ECHO_C" >&6
16267 else
16268   cat >"conftest.$ac_ext" <<_ACEOF
16269 #line 16269 "configure"
16270 #include "confdefs.h"
16271 #define gettimeofday autoconf_temporary
16272 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16273 #undef gettimeofday
16274
16275 #ifdef __cplusplus
16276 extern "C"
16277 #endif
16278
16279 /* We use char because int might match the return type of a gcc2
16280    builtin and then its argument prototype would still apply.  */
16281 char gettimeofday (void);
16282
16283 int
16284 main (void)
16285 {
16286
16287 /* The GNU C library defines stubs for functions which it implements
16288     to always fail with ENOSYS.  Some functions are actually named
16289     something starting with __ and the normal name is an alias.  */
16290 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16291 #error found stub for gettimeofday
16292 #endif
16293
16294         return gettimeofday ();
16295   ;
16296   return 0;
16297 }
16298 _ACEOF
16299 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16300 if { (eval echo "$as_me:16300: \"$ac_link\"") >&5
16301   (eval $ac_link) 2>&5
16302   ac_status=$?
16303   echo "$as_me:16303: \$? = $ac_status" >&5
16304   (exit "$ac_status"); } &&
16305          { ac_try='test -s "conftest$ac_exeext"'
16306   { (eval echo "$as_me:16306: \"$ac_try\"") >&5
16307   (eval $ac_try) 2>&5
16308   ac_status=$?
16309   echo "$as_me:16309: \$? = $ac_status" >&5
16310   (exit "$ac_status"); }; }; then
16311   ac_cv_func_gettimeofday=yes
16312 else
16313   echo "$as_me: failed program was:" >&5
16314 cat "conftest.$ac_ext" >&5
16315 ac_cv_func_gettimeofday=no
16316 fi
16317 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16318 fi
16319 echo "$as_me:16319: result: $ac_cv_func_gettimeofday" >&5
16320 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16321 if test "$ac_cv_func_gettimeofday" = yes; then
16322   cat >>confdefs.h <<\EOF
16323 #define HAVE_GETTIMEOFDAY 1
16324 EOF
16325
16326 else
16327
16328 echo "$as_me:16328: checking for gettimeofday in -lbsd" >&5
16329 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16330 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16331   echo $ECHO_N "(cached) $ECHO_C" >&6
16332 else
16333   ac_check_lib_save_LIBS=$LIBS
16334 LIBS="-lbsd  $LIBS"
16335 cat >"conftest.$ac_ext" <<_ACEOF
16336 #line 16336 "configure"
16337 #include "confdefs.h"
16338
16339 /* Override any gcc2 internal prototype to avoid an error.  */
16340 #ifdef __cplusplus
16341 extern "C"
16342 #endif
16343 /* We use char because int might match the return type of a gcc2
16344    builtin and then its argument prototype would still apply.  */
16345 char gettimeofday ();
16346 int
16347 main (void)
16348 {
16349 gettimeofday ();
16350   ;
16351   return 0;
16352 }
16353 _ACEOF
16354 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16355 if { (eval echo "$as_me:16355: \"$ac_link\"") >&5
16356   (eval $ac_link) 2>&5
16357   ac_status=$?
16358   echo "$as_me:16358: \$? = $ac_status" >&5
16359   (exit "$ac_status"); } &&
16360          { ac_try='test -s "conftest$ac_exeext"'
16361   { (eval echo "$as_me:16361: \"$ac_try\"") >&5
16362   (eval $ac_try) 2>&5
16363   ac_status=$?
16364   echo "$as_me:16364: \$? = $ac_status" >&5
16365   (exit "$ac_status"); }; }; then
16366   ac_cv_lib_bsd_gettimeofday=yes
16367 else
16368   echo "$as_me: failed program was:" >&5
16369 cat "conftest.$ac_ext" >&5
16370 ac_cv_lib_bsd_gettimeofday=no
16371 fi
16372 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16373 LIBS=$ac_check_lib_save_LIBS
16374 fi
16375 echo "$as_me:16375: result: $ac_cv_lib_bsd_gettimeofday" >&5
16376 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16377 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16378
16379 cat >>confdefs.h <<\EOF
16380 #define HAVE_GETTIMEOFDAY 1
16381 EOF
16382
16383         LIBS="$LIBS -lbsd"
16384 fi
16385
16386 fi
16387         ;;
16388 esac
16389
16390 ###     Checks for header files.
16391 echo "$as_me:16391: checking for ANSI C header files" >&5
16392 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16393 if test "${ac_cv_header_stdc+set}" = set; then
16394   echo $ECHO_N "(cached) $ECHO_C" >&6
16395 else
16396   cat >"conftest.$ac_ext" <<_ACEOF
16397 #line 16397 "configure"
16398 #include "confdefs.h"
16399 #include <stdlib.h>
16400 #include <stdarg.h>
16401 #include <string.h>
16402 #include <float.h>
16403
16404 _ACEOF
16405 if { (eval echo "$as_me:16405: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16406   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16407   ac_status=$?
16408   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16409   rm -f conftest.er1
16410   cat conftest.err >&5
16411   echo "$as_me:16411: \$? = $ac_status" >&5
16412   (exit "$ac_status"); } >/dev/null; then
16413   if test -s conftest.err; then
16414     ac_cpp_err=$ac_c_preproc_warn_flag
16415   else
16416     ac_cpp_err=
16417   fi
16418 else
16419   ac_cpp_err=yes
16420 fi
16421 if test -z "$ac_cpp_err"; then
16422   ac_cv_header_stdc=yes
16423 else
16424   echo "$as_me: failed program was:" >&5
16425   cat "conftest.$ac_ext" >&5
16426   ac_cv_header_stdc=no
16427 fi
16428 rm -f conftest.err "conftest.$ac_ext"
16429
16430 if test $ac_cv_header_stdc = yes; then
16431   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16432   cat >"conftest.$ac_ext" <<_ACEOF
16433 #line 16433 "configure"
16434 #include "confdefs.h"
16435 #include <string.h>
16436
16437 _ACEOF
16438 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16439   $EGREP "memchr" >/dev/null 2>&1; then
16440   :
16441 else
16442   ac_cv_header_stdc=no
16443 fi
16444 rm -rf conftest*
16445
16446 fi
16447
16448 if test $ac_cv_header_stdc = yes; then
16449   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16450   cat >"conftest.$ac_ext" <<_ACEOF
16451 #line 16451 "configure"
16452 #include "confdefs.h"
16453 #include <stdlib.h>
16454
16455 _ACEOF
16456 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16457   $EGREP "free" >/dev/null 2>&1; then
16458   :
16459 else
16460   ac_cv_header_stdc=no
16461 fi
16462 rm -rf conftest*
16463
16464 fi
16465
16466 if test $ac_cv_header_stdc = yes; then
16467   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16468   if test "$cross_compiling" = yes; then
16469   :
16470 else
16471   cat >"conftest.$ac_ext" <<_ACEOF
16472 #line 16472 "configure"
16473 #include "confdefs.h"
16474 #include <ctype.h>
16475 #if ((' ' & 0x0FF) == 0x020)
16476 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16477 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16478 #else
16479 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16480                      || ('j' <= (c) && (c) <= 'r') \
16481                      || ('s' <= (c) && (c) <= 'z'))
16482 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16483 #endif
16484
16485 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16486 int
16487 main (void)
16488 {
16489   int i;
16490   for (i = 0; i < 256; i++)
16491     if (XOR (islower (i), ISLOWER (i))
16492         || toupper (i) != TOUPPER (i))
16493       $ac_main_return(2);
16494   $ac_main_return (0);
16495 }
16496 _ACEOF
16497 rm -f "conftest$ac_exeext"
16498 if { (eval echo "$as_me:16498: \"$ac_link\"") >&5
16499   (eval $ac_link) 2>&5
16500   ac_status=$?
16501   echo "$as_me:16501: \$? = $ac_status" >&5
16502   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16503   { (eval echo "$as_me:16503: \"$ac_try\"") >&5
16504   (eval $ac_try) 2>&5
16505   ac_status=$?
16506   echo "$as_me:16506: \$? = $ac_status" >&5
16507   (exit "$ac_status"); }; }; then
16508   :
16509 else
16510   echo "$as_me: program exited with status $ac_status" >&5
16511 echo "$as_me: failed program was:" >&5
16512 cat "conftest.$ac_ext" >&5
16513 ac_cv_header_stdc=no
16514 fi
16515 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16516 fi
16517 fi
16518 fi
16519 echo "$as_me:16519: result: $ac_cv_header_stdc" >&5
16520 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16521 if test $ac_cv_header_stdc = yes; then
16522
16523 cat >>confdefs.h <<\EOF
16524 #define STDC_HEADERS 1
16525 EOF
16526
16527 fi
16528
16529 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16530
16531 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16532                   inttypes.h stdint.h unistd.h
16533 do
16534 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16535 echo "$as_me:16535: checking for $ac_header" >&5
16536 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16537 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16538   echo $ECHO_N "(cached) $ECHO_C" >&6
16539 else
16540   cat >"conftest.$ac_ext" <<_ACEOF
16541 #line 16541 "configure"
16542 #include "confdefs.h"
16543 $ac_includes_default
16544 #include <$ac_header>
16545 _ACEOF
16546 rm -f "conftest.$ac_objext"
16547 if { (eval echo "$as_me:16547: \"$ac_compile\"") >&5
16548   (eval $ac_compile) 2>&5
16549   ac_status=$?
16550   echo "$as_me:16550: \$? = $ac_status" >&5
16551   (exit "$ac_status"); } &&
16552          { ac_try='test -s "conftest.$ac_objext"'
16553   { (eval echo "$as_me:16553: \"$ac_try\"") >&5
16554   (eval $ac_try) 2>&5
16555   ac_status=$?
16556   echo "$as_me:16556: \$? = $ac_status" >&5
16557   (exit "$ac_status"); }; }; then
16558   eval "$as_ac_Header=yes"
16559 else
16560   echo "$as_me: failed program was:" >&5
16561 cat "conftest.$ac_ext" >&5
16562 eval "$as_ac_Header=no"
16563 fi
16564 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16565 fi
16566 echo "$as_me:16566: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16567 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16568 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16569   cat >>confdefs.h <<EOF
16570 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16571 EOF
16572
16573 fi
16574 done
16575
16576 echo "$as_me:16576: checking for signed char" >&5
16577 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16578 if test "${ac_cv_type_signed_char+set}" = set; then
16579   echo $ECHO_N "(cached) $ECHO_C" >&6
16580 else
16581   cat >"conftest.$ac_ext" <<_ACEOF
16582 #line 16582 "configure"
16583 #include "confdefs.h"
16584 $ac_includes_default
16585 int
16586 main (void)
16587 {
16588 if ((signed char *) 0)
16589   return 0;
16590 if (sizeof (signed char))
16591   return 0;
16592   ;
16593   return 0;
16594 }
16595 _ACEOF
16596 rm -f "conftest.$ac_objext"
16597 if { (eval echo "$as_me:16597: \"$ac_compile\"") >&5
16598   (eval $ac_compile) 2>&5
16599   ac_status=$?
16600   echo "$as_me:16600: \$? = $ac_status" >&5
16601   (exit "$ac_status"); } &&
16602          { ac_try='test -s "conftest.$ac_objext"'
16603   { (eval echo "$as_me:16603: \"$ac_try\"") >&5
16604   (eval $ac_try) 2>&5
16605   ac_status=$?
16606   echo "$as_me:16606: \$? = $ac_status" >&5
16607   (exit "$ac_status"); }; }; then
16608   ac_cv_type_signed_char=yes
16609 else
16610   echo "$as_me: failed program was:" >&5
16611 cat "conftest.$ac_ext" >&5
16612 ac_cv_type_signed_char=no
16613 fi
16614 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16615 fi
16616 echo "$as_me:16616: result: $ac_cv_type_signed_char" >&5
16617 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16618
16619 echo "$as_me:16619: checking size of signed char" >&5
16620 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16621 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16622   echo $ECHO_N "(cached) $ECHO_C" >&6
16623 else
16624   if test "$ac_cv_type_signed_char" = yes; then
16625   if test "$cross_compiling" = yes; then
16626   # Depending upon the size, compute the lo and hi bounds.
16627 cat >"conftest.$ac_ext" <<_ACEOF
16628 #line 16628 "configure"
16629 #include "confdefs.h"
16630 $ac_includes_default
16631 int
16632 main (void)
16633 {
16634 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16635   ;
16636   return 0;
16637 }
16638 _ACEOF
16639 rm -f "conftest.$ac_objext"
16640 if { (eval echo "$as_me:16640: \"$ac_compile\"") >&5
16641   (eval $ac_compile) 2>&5
16642   ac_status=$?
16643   echo "$as_me:16643: \$? = $ac_status" >&5
16644   (exit "$ac_status"); } &&
16645          { ac_try='test -s "conftest.$ac_objext"'
16646   { (eval echo "$as_me:16646: \"$ac_try\"") >&5
16647   (eval $ac_try) 2>&5
16648   ac_status=$?
16649   echo "$as_me:16649: \$? = $ac_status" >&5
16650   (exit "$ac_status"); }; }; then
16651   ac_lo=0 ac_mid=0
16652   while :; do
16653     cat >"conftest.$ac_ext" <<_ACEOF
16654 #line 16654 "configure"
16655 #include "confdefs.h"
16656 $ac_includes_default
16657 int
16658 main (void)
16659 {
16660 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16661   ;
16662   return 0;
16663 }
16664 _ACEOF
16665 rm -f "conftest.$ac_objext"
16666 if { (eval echo "$as_me:16666: \"$ac_compile\"") >&5
16667   (eval $ac_compile) 2>&5
16668   ac_status=$?
16669   echo "$as_me:16669: \$? = $ac_status" >&5
16670   (exit "$ac_status"); } &&
16671          { ac_try='test -s "conftest.$ac_objext"'
16672   { (eval echo "$as_me:16672: \"$ac_try\"") >&5
16673   (eval $ac_try) 2>&5
16674   ac_status=$?
16675   echo "$as_me:16675: \$? = $ac_status" >&5
16676   (exit "$ac_status"); }; }; then
16677   ac_hi=$ac_mid; break
16678 else
16679   echo "$as_me: failed program was:" >&5
16680 cat "conftest.$ac_ext" >&5
16681 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16682 fi
16683 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16684   done
16685 else
16686   echo "$as_me: failed program was:" >&5
16687 cat "conftest.$ac_ext" >&5
16688 ac_hi=-1 ac_mid=-1
16689   while :; do
16690     cat >"conftest.$ac_ext" <<_ACEOF
16691 #line 16691 "configure"
16692 #include "confdefs.h"
16693 $ac_includes_default
16694 int
16695 main (void)
16696 {
16697 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16698   ;
16699   return 0;
16700 }
16701 _ACEOF
16702 rm -f "conftest.$ac_objext"
16703 if { (eval echo "$as_me:16703: \"$ac_compile\"") >&5
16704   (eval $ac_compile) 2>&5
16705   ac_status=$?
16706   echo "$as_me:16706: \$? = $ac_status" >&5
16707   (exit "$ac_status"); } &&
16708          { ac_try='test -s "conftest.$ac_objext"'
16709   { (eval echo "$as_me:16709: \"$ac_try\"") >&5
16710   (eval $ac_try) 2>&5
16711   ac_status=$?
16712   echo "$as_me:16712: \$? = $ac_status" >&5
16713   (exit "$ac_status"); }; }; then
16714   ac_lo=$ac_mid; break
16715 else
16716   echo "$as_me: failed program was:" >&5
16717 cat "conftest.$ac_ext" >&5
16718 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16719 fi
16720 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16721   done
16722 fi
16723 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16724 # Binary search between lo and hi bounds.
16725 while test "x$ac_lo" != "x$ac_hi"; do
16726   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16727   cat >"conftest.$ac_ext" <<_ACEOF
16728 #line 16728 "configure"
16729 #include "confdefs.h"
16730 $ac_includes_default
16731 int
16732 main (void)
16733 {
16734 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16735   ;
16736   return 0;
16737 }
16738 _ACEOF
16739 rm -f "conftest.$ac_objext"
16740 if { (eval echo "$as_me:16740: \"$ac_compile\"") >&5
16741   (eval $ac_compile) 2>&5
16742   ac_status=$?
16743   echo "$as_me:16743: \$? = $ac_status" >&5
16744   (exit "$ac_status"); } &&
16745          { ac_try='test -s "conftest.$ac_objext"'
16746   { (eval echo "$as_me:16746: \"$ac_try\"") >&5
16747   (eval $ac_try) 2>&5
16748   ac_status=$?
16749   echo "$as_me:16749: \$? = $ac_status" >&5
16750   (exit "$ac_status"); }; }; then
16751   ac_hi=$ac_mid
16752 else
16753   echo "$as_me: failed program was:" >&5
16754 cat "conftest.$ac_ext" >&5
16755 ac_lo=`expr "$ac_mid" + 1`
16756 fi
16757 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16758 done
16759 ac_cv_sizeof_signed_char=$ac_lo
16760 else
16761   if test "$cross_compiling" = yes; then
16762   { { echo "$as_me:16762: error: cannot run test program while cross compiling" >&5
16763 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16764    { (exit 1); exit 1; }; }
16765 else
16766   cat >"conftest.$ac_ext" <<_ACEOF
16767 #line 16767 "configure"
16768 #include "confdefs.h"
16769 $ac_includes_default
16770 int
16771 main (void)
16772 {
16773 FILE *f = fopen ("conftest.val", "w");
16774 if (!f)
16775   $ac_main_return (1);
16776 fprintf (f, "%ld", (long)(sizeof (signed char)));
16777 fclose (f);
16778   ;
16779   return 0;
16780 }
16781 _ACEOF
16782 rm -f "conftest$ac_exeext"
16783 if { (eval echo "$as_me:16783: \"$ac_link\"") >&5
16784   (eval $ac_link) 2>&5
16785   ac_status=$?
16786   echo "$as_me:16786: \$? = $ac_status" >&5
16787   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16788   { (eval echo "$as_me:16788: \"$ac_try\"") >&5
16789   (eval $ac_try) 2>&5
16790   ac_status=$?
16791   echo "$as_me:16791: \$? = $ac_status" >&5
16792   (exit "$ac_status"); }; }; then
16793   ac_cv_sizeof_signed_char=`cat conftest.val`
16794 else
16795   echo "$as_me: program exited with status $ac_status" >&5
16796 echo "$as_me: failed program was:" >&5
16797 cat "conftest.$ac_ext" >&5
16798 fi
16799 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16800 fi
16801 fi
16802 rm -f conftest.val
16803 else
16804   ac_cv_sizeof_signed_char=0
16805 fi
16806 fi
16807 echo "$as_me:16807: result: $ac_cv_sizeof_signed_char" >&5
16808 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16809 cat >>confdefs.h <<EOF
16810 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16811 EOF
16812
16813 echo "$as_me:16813: checking for ANSI C header files" >&5
16814 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16815 if test "${ac_cv_header_stdc+set}" = set; then
16816   echo $ECHO_N "(cached) $ECHO_C" >&6
16817 else
16818   cat >"conftest.$ac_ext" <<_ACEOF
16819 #line 16819 "configure"
16820 #include "confdefs.h"
16821 #include <stdlib.h>
16822 #include <stdarg.h>
16823 #include <string.h>
16824 #include <float.h>
16825
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   ac_cv_header_stdc=yes
16845 else
16846   echo "$as_me: failed program was:" >&5
16847   cat "conftest.$ac_ext" >&5
16848   ac_cv_header_stdc=no
16849 fi
16850 rm -f conftest.err "conftest.$ac_ext"
16851
16852 if test $ac_cv_header_stdc = yes; then
16853   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16854   cat >"conftest.$ac_ext" <<_ACEOF
16855 #line 16855 "configure"
16856 #include "confdefs.h"
16857 #include <string.h>
16858
16859 _ACEOF
16860 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16861   $EGREP "memchr" >/dev/null 2>&1; then
16862   :
16863 else
16864   ac_cv_header_stdc=no
16865 fi
16866 rm -rf conftest*
16867
16868 fi
16869
16870 if test $ac_cv_header_stdc = yes; then
16871   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16872   cat >"conftest.$ac_ext" <<_ACEOF
16873 #line 16873 "configure"
16874 #include "confdefs.h"
16875 #include <stdlib.h>
16876
16877 _ACEOF
16878 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16879   $EGREP "free" >/dev/null 2>&1; then
16880   :
16881 else
16882   ac_cv_header_stdc=no
16883 fi
16884 rm -rf conftest*
16885
16886 fi
16887
16888 if test $ac_cv_header_stdc = yes; then
16889   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16890   if test "$cross_compiling" = yes; then
16891   :
16892 else
16893   cat >"conftest.$ac_ext" <<_ACEOF
16894 #line 16894 "configure"
16895 #include "confdefs.h"
16896 #include <ctype.h>
16897 #if ((' ' & 0x0FF) == 0x020)
16898 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16899 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16900 #else
16901 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16902                      || ('j' <= (c) && (c) <= 'r') \
16903                      || ('s' <= (c) && (c) <= 'z'))
16904 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16905 #endif
16906
16907 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16908 int
16909 main (void)
16910 {
16911   int i;
16912   for (i = 0; i < 256; i++)
16913     if (XOR (islower (i), ISLOWER (i))
16914         || toupper (i) != TOUPPER (i))
16915       $ac_main_return(2);
16916   $ac_main_return (0);
16917 }
16918 _ACEOF
16919 rm -f "conftest$ac_exeext"
16920 if { (eval echo "$as_me:16920: \"$ac_link\"") >&5
16921   (eval $ac_link) 2>&5
16922   ac_status=$?
16923   echo "$as_me:16923: \$? = $ac_status" >&5
16924   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16925   { (eval echo "$as_me:16925: \"$ac_try\"") >&5
16926   (eval $ac_try) 2>&5
16927   ac_status=$?
16928   echo "$as_me:16928: \$? = $ac_status" >&5
16929   (exit "$ac_status"); }; }; then
16930   :
16931 else
16932   echo "$as_me: program exited with status $ac_status" >&5
16933 echo "$as_me: failed program was:" >&5
16934 cat "conftest.$ac_ext" >&5
16935 ac_cv_header_stdc=no
16936 fi
16937 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16938 fi
16939 fi
16940 fi
16941 echo "$as_me:16941: result: $ac_cv_header_stdc" >&5
16942 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16943 if test $ac_cv_header_stdc = yes; then
16944
16945 cat >>confdefs.h <<\EOF
16946 #define STDC_HEADERS 1
16947 EOF
16948
16949 fi
16950
16951 ac_header_dirent=no
16952 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16953   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16954 echo "$as_me:16954: checking for $ac_hdr that defines DIR" >&5
16955 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16956 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16957   echo $ECHO_N "(cached) $ECHO_C" >&6
16958 else
16959   cat >"conftest.$ac_ext" <<_ACEOF
16960 #line 16960 "configure"
16961 #include "confdefs.h"
16962 #include <sys/types.h>
16963 #include <$ac_hdr>
16964
16965 int
16966 main (void)
16967 {
16968 if ((DIR *) 0)
16969 return 0;
16970   ;
16971   return 0;
16972 }
16973 _ACEOF
16974 rm -f "conftest.$ac_objext"
16975 if { (eval echo "$as_me:16975: \"$ac_compile\"") >&5
16976   (eval $ac_compile) 2>&5
16977   ac_status=$?
16978   echo "$as_me:16978: \$? = $ac_status" >&5
16979   (exit "$ac_status"); } &&
16980          { ac_try='test -s "conftest.$ac_objext"'
16981   { (eval echo "$as_me:16981: \"$ac_try\"") >&5
16982   (eval $ac_try) 2>&5
16983   ac_status=$?
16984   echo "$as_me:16984: \$? = $ac_status" >&5
16985   (exit "$ac_status"); }; }; then
16986   eval "$as_ac_Header=yes"
16987 else
16988   echo "$as_me: failed program was:" >&5
16989 cat "conftest.$ac_ext" >&5
16990 eval "$as_ac_Header=no"
16991 fi
16992 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16993 fi
16994 echo "$as_me:16994: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16995 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16996 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16997   cat >>confdefs.h <<EOF
16998 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16999 EOF
17000
17001 ac_header_dirent=$ac_hdr; break
17002 fi
17003
17004 done
17005 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
17006 if test $ac_header_dirent = dirent.h; then
17007   echo "$as_me:17007: checking for opendir in -ldir" >&5
17008 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
17009 if test "${ac_cv_lib_dir_opendir+set}" = set; then
17010   echo $ECHO_N "(cached) $ECHO_C" >&6
17011 else
17012   ac_check_lib_save_LIBS=$LIBS
17013 LIBS="-ldir  $LIBS"
17014 cat >"conftest.$ac_ext" <<_ACEOF
17015 #line 17015 "configure"
17016 #include "confdefs.h"
17017
17018 /* Override any gcc2 internal prototype to avoid an error.  */
17019 #ifdef __cplusplus
17020 extern "C"
17021 #endif
17022 /* We use char because int might match the return type of a gcc2
17023    builtin and then its argument prototype would still apply.  */
17024 char opendir ();
17025 int
17026 main (void)
17027 {
17028 opendir ();
17029   ;
17030   return 0;
17031 }
17032 _ACEOF
17033 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17034 if { (eval echo "$as_me:17034: \"$ac_link\"") >&5
17035   (eval $ac_link) 2>&5
17036   ac_status=$?
17037   echo "$as_me:17037: \$? = $ac_status" >&5
17038   (exit "$ac_status"); } &&
17039          { ac_try='test -s "conftest$ac_exeext"'
17040   { (eval echo "$as_me:17040: \"$ac_try\"") >&5
17041   (eval $ac_try) 2>&5
17042   ac_status=$?
17043   echo "$as_me:17043: \$? = $ac_status" >&5
17044   (exit "$ac_status"); }; }; then
17045   ac_cv_lib_dir_opendir=yes
17046 else
17047   echo "$as_me: failed program was:" >&5
17048 cat "conftest.$ac_ext" >&5
17049 ac_cv_lib_dir_opendir=no
17050 fi
17051 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17052 LIBS=$ac_check_lib_save_LIBS
17053 fi
17054 echo "$as_me:17054: result: $ac_cv_lib_dir_opendir" >&5
17055 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17056 if test "$ac_cv_lib_dir_opendir" = yes; then
17057   LIBS="$LIBS -ldir"
17058 fi
17059
17060 else
17061   echo "$as_me:17061: checking for opendir in -lx" >&5
17062 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17063 if test "${ac_cv_lib_x_opendir+set}" = set; then
17064   echo $ECHO_N "(cached) $ECHO_C" >&6
17065 else
17066   ac_check_lib_save_LIBS=$LIBS
17067 LIBS="-lx  $LIBS"
17068 cat >"conftest.$ac_ext" <<_ACEOF
17069 #line 17069 "configure"
17070 #include "confdefs.h"
17071
17072 /* Override any gcc2 internal prototype to avoid an error.  */
17073 #ifdef __cplusplus
17074 extern "C"
17075 #endif
17076 /* We use char because int might match the return type of a gcc2
17077    builtin and then its argument prototype would still apply.  */
17078 char opendir ();
17079 int
17080 main (void)
17081 {
17082 opendir ();
17083   ;
17084   return 0;
17085 }
17086 _ACEOF
17087 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17088 if { (eval echo "$as_me:17088: \"$ac_link\"") >&5
17089   (eval $ac_link) 2>&5
17090   ac_status=$?
17091   echo "$as_me:17091: \$? = $ac_status" >&5
17092   (exit "$ac_status"); } &&
17093          { ac_try='test -s "conftest$ac_exeext"'
17094   { (eval echo "$as_me:17094: \"$ac_try\"") >&5
17095   (eval $ac_try) 2>&5
17096   ac_status=$?
17097   echo "$as_me:17097: \$? = $ac_status" >&5
17098   (exit "$ac_status"); }; }; then
17099   ac_cv_lib_x_opendir=yes
17100 else
17101   echo "$as_me: failed program was:" >&5
17102 cat "conftest.$ac_ext" >&5
17103 ac_cv_lib_x_opendir=no
17104 fi
17105 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17106 LIBS=$ac_check_lib_save_LIBS
17107 fi
17108 echo "$as_me:17108: result: $ac_cv_lib_x_opendir" >&5
17109 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17110 if test "$ac_cv_lib_x_opendir" = yes; then
17111   LIBS="$LIBS -lx"
17112 fi
17113
17114 fi
17115
17116 echo "$as_me:17116: checking whether time.h and sys/time.h may both be included" >&5
17117 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17118 if test "${ac_cv_header_time+set}" = set; then
17119   echo $ECHO_N "(cached) $ECHO_C" >&6
17120 else
17121   cat >"conftest.$ac_ext" <<_ACEOF
17122 #line 17122 "configure"
17123 #include "confdefs.h"
17124 #include <sys/types.h>
17125 #include <sys/time.h>
17126 #include <time.h>
17127
17128 int
17129 main (void)
17130 {
17131 if ((struct tm *) 0)
17132 return 0;
17133   ;
17134   return 0;
17135 }
17136 _ACEOF
17137 rm -f "conftest.$ac_objext"
17138 if { (eval echo "$as_me:17138: \"$ac_compile\"") >&5
17139   (eval $ac_compile) 2>&5
17140   ac_status=$?
17141   echo "$as_me:17141: \$? = $ac_status" >&5
17142   (exit "$ac_status"); } &&
17143          { ac_try='test -s "conftest.$ac_objext"'
17144   { (eval echo "$as_me:17144: \"$ac_try\"") >&5
17145   (eval $ac_try) 2>&5
17146   ac_status=$?
17147   echo "$as_me:17147: \$? = $ac_status" >&5
17148   (exit "$ac_status"); }; }; then
17149   ac_cv_header_time=yes
17150 else
17151   echo "$as_me: failed program was:" >&5
17152 cat "conftest.$ac_ext" >&5
17153 ac_cv_header_time=no
17154 fi
17155 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17156 fi
17157 echo "$as_me:17157: result: $ac_cv_header_time" >&5
17158 echo "${ECHO_T}$ac_cv_header_time" >&6
17159 if test $ac_cv_header_time = yes; then
17160
17161 cat >>confdefs.h <<\EOF
17162 #define TIME_WITH_SYS_TIME 1
17163 EOF
17164
17165 fi
17166
17167 ###     checks for compiler characteristics
17168 ac_ext=c
17169 ac_cpp='$CPP $CPPFLAGS'
17170 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17171 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17172 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17173 ac_main_return="return"
17174
17175 echo "$as_me:17175: checking for an ANSI C-conforming const" >&5
17176 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17177 if test "${ac_cv_c_const+set}" = set; then
17178   echo $ECHO_N "(cached) $ECHO_C" >&6
17179 else
17180   cat >"conftest.$ac_ext" <<_ACEOF
17181 #line 17181 "configure"
17182 #include "confdefs.h"
17183
17184 int
17185 main (void)
17186 {
17187 /* FIXME: Include the comments suggested by Paul. */
17188 #ifndef __cplusplus
17189   /* Ultrix mips cc rejects this.  */
17190   typedef int charset[2];
17191   const charset x;
17192   /* SunOS 4.1.1 cc rejects this.  */
17193   char const *const *ccp;
17194   char **p;
17195   /* NEC SVR4.0.2 mips cc rejects this.  */
17196   struct point {int x, y;};
17197   static struct point const zero = {0,0};
17198   /* AIX XL C 1.02.0.0 rejects this.
17199      It does not let you subtract one const X* pointer from another in
17200      an arm of an if-expression whose if-part is not a constant
17201      expression */
17202   const char *g = "string";
17203   ccp = &g + (g ? g-g : 0);
17204   /* HPUX 7.0 cc rejects these. */
17205   ++ccp;
17206   p = (char**) ccp;
17207   ccp = (char const *const *) p;
17208   { /* SCO 3.2v4 cc rejects this.  */
17209     char *t;
17210     char const *s = 0 ? (char *) 0 : (char const *) 0;
17211
17212     *t++ = 0;
17213   }
17214   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17215     int x[] = {25, 17};
17216     const int *foo = &x[0];
17217     ++foo;
17218   }
17219   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17220     typedef const int *iptr;
17221     iptr p = 0;
17222     ++p;
17223   }
17224   { /* AIX XL C 1.02.0.0 rejects this saying
17225        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17226     struct s { int j; const int *ap[3]; };
17227     struct s *b; b->j = 5;
17228   }
17229   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17230     const int foo = 10;
17231   }
17232 #endif
17233
17234   ;
17235   return 0;
17236 }
17237 _ACEOF
17238 rm -f "conftest.$ac_objext"
17239 if { (eval echo "$as_me:17239: \"$ac_compile\"") >&5
17240   (eval $ac_compile) 2>&5
17241   ac_status=$?
17242   echo "$as_me:17242: \$? = $ac_status" >&5
17243   (exit "$ac_status"); } &&
17244          { ac_try='test -s "conftest.$ac_objext"'
17245   { (eval echo "$as_me:17245: \"$ac_try\"") >&5
17246   (eval $ac_try) 2>&5
17247   ac_status=$?
17248   echo "$as_me:17248: \$? = $ac_status" >&5
17249   (exit "$ac_status"); }; }; then
17250   ac_cv_c_const=yes
17251 else
17252   echo "$as_me: failed program was:" >&5
17253 cat "conftest.$ac_ext" >&5
17254 ac_cv_c_const=no
17255 fi
17256 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17257 fi
17258 echo "$as_me:17258: result: $ac_cv_c_const" >&5
17259 echo "${ECHO_T}$ac_cv_c_const" >&6
17260 if test $ac_cv_c_const = no; then
17261
17262 cat >>confdefs.h <<\EOF
17263 #define const
17264 EOF
17265
17266 fi
17267
17268 ###     Checks for external-data
17269
17270 echo "$as_me:17270: checking if data-only library module links" >&5
17271 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17272 if test "${cf_cv_link_dataonly+set}" = set; then
17273   echo $ECHO_N "(cached) $ECHO_C" >&6
17274 else
17275
17276         rm -f conftest.a
17277         cat >conftest.$ac_ext <<EOF
17278 #line 17278 "configure"
17279 int     testdata[3] = { 123, 456, 789 };
17280 EOF
17281         if { (eval echo "$as_me:17281: \"$ac_compile\"") >&5
17282   (eval $ac_compile) 2>&5
17283   ac_status=$?
17284   echo "$as_me:17284: \$? = $ac_status" >&5
17285   (exit "$ac_status"); } ; then
17286                 mv conftest.o data.o && \
17287                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17288         fi
17289         rm -f conftest.$ac_ext data.o
17290         cat >conftest.$ac_ext <<EOF
17291 #line 17291 "configure"
17292 int     testfunc(void)
17293 {
17294 #if defined(NeXT)
17295         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17296 #else
17297         extern int testdata[3];
17298         return testdata[0] == 123
17299            &&  testdata[1] == 456
17300            &&  testdata[2] == 789;
17301 #endif
17302 }
17303 EOF
17304         if { (eval echo "$as_me:17304: \"$ac_compile\"") >&5
17305   (eval $ac_compile) 2>&5
17306   ac_status=$?
17307   echo "$as_me:17307: \$? = $ac_status" >&5
17308   (exit "$ac_status"); }; then
17309                 mv conftest.o func.o && \
17310                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17311         fi
17312         rm -f conftest.$ac_ext func.o
17313         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17314         cf_saveLIBS="$LIBS"
17315         LIBS="conftest.a $LIBS"
17316         if test "$cross_compiling" = yes; then
17317   cf_cv_link_dataonly=unknown
17318 else
17319   cat >"conftest.$ac_ext" <<_ACEOF
17320 #line 17320 "configure"
17321 #include "confdefs.h"
17322
17323         int main(void)
17324         {
17325                 extern int testfunc();
17326                 ${cf_cv_main_return:-return} (!testfunc());
17327         }
17328
17329 _ACEOF
17330 rm -f "conftest$ac_exeext"
17331 if { (eval echo "$as_me:17331: \"$ac_link\"") >&5
17332   (eval $ac_link) 2>&5
17333   ac_status=$?
17334   echo "$as_me:17334: \$? = $ac_status" >&5
17335   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17336   { (eval echo "$as_me:17336: \"$ac_try\"") >&5
17337   (eval $ac_try) 2>&5
17338   ac_status=$?
17339   echo "$as_me:17339: \$? = $ac_status" >&5
17340   (exit "$ac_status"); }; }; then
17341   cf_cv_link_dataonly=yes
17342 else
17343   echo "$as_me: program exited with status $ac_status" >&5
17344 echo "$as_me: failed program was:" >&5
17345 cat "conftest.$ac_ext" >&5
17346 cf_cv_link_dataonly=no
17347 fi
17348 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17349 fi
17350         LIBS="$cf_saveLIBS"
17351
17352 fi
17353
17354 echo "$as_me:17354: result: $cf_cv_link_dataonly" >&5
17355 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17356
17357 if test "$cf_cv_link_dataonly" = no ; then
17358
17359 cat >>confdefs.h <<\EOF
17360 #define BROKEN_LINKER 1
17361 EOF
17362
17363         BROKEN_LINKER=1
17364 fi
17365
17366 ###     Checks for library functions.
17367
17368 for ac_header in \
17369 unistd.h \
17370
17371 do
17372 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17373 echo "$as_me:17373: checking for $ac_header" >&5
17374 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17375 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17376   echo $ECHO_N "(cached) $ECHO_C" >&6
17377 else
17378   cat >"conftest.$ac_ext" <<_ACEOF
17379 #line 17379 "configure"
17380 #include "confdefs.h"
17381 #include <$ac_header>
17382 _ACEOF
17383 if { (eval echo "$as_me:17383: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17384   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17385   ac_status=$?
17386   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17387   rm -f conftest.er1
17388   cat conftest.err >&5
17389   echo "$as_me:17389: \$? = $ac_status" >&5
17390   (exit "$ac_status"); } >/dev/null; then
17391   if test -s conftest.err; then
17392     ac_cpp_err=$ac_c_preproc_warn_flag
17393   else
17394     ac_cpp_err=
17395   fi
17396 else
17397   ac_cpp_err=yes
17398 fi
17399 if test -z "$ac_cpp_err"; then
17400   eval "$as_ac_Header=yes"
17401 else
17402   echo "$as_me: failed program was:" >&5
17403   cat "conftest.$ac_ext" >&5
17404   eval "$as_ac_Header=no"
17405 fi
17406 rm -f conftest.err "conftest.$ac_ext"
17407 fi
17408 echo "$as_me:17408: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17409 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17410 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17411   cat >>confdefs.h <<EOF
17412 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17413 EOF
17414
17415 fi
17416 done
17417
17418 echo "$as_me:17418: checking for working mkstemp" >&5
17419 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17420 if test "${cf_cv_func_mkstemp+set}" = set; then
17421   echo $ECHO_N "(cached) $ECHO_C" >&6
17422 else
17423
17424 rm -rf ./conftest*
17425 if test "$cross_compiling" = yes; then
17426   cf_cv_func_mkstemp=maybe
17427 else
17428   cat >"conftest.$ac_ext" <<_ACEOF
17429 #line 17429 "configure"
17430 #include "confdefs.h"
17431
17432 $ac_includes_default
17433
17434 int main(void)
17435 {
17436         char *tmpl = "conftestXXXXXX";
17437         char name[2][80];
17438         int n;
17439         int result = 0;
17440         int fd;
17441         struct stat sb;
17442
17443         umask(077);
17444         for (n = 0; n < 2; ++n) {
17445                 strcpy(name[n], tmpl);
17446                 if ((fd = mkstemp(name[n])) >= 0) {
17447                         if (!strcmp(name[n], tmpl)
17448                          || stat(name[n], &sb) != 0
17449                          || (sb.st_mode & S_IFMT) != S_IFREG
17450                          || (sb.st_mode & 077) != 0) {
17451                                 result = 1;
17452                         }
17453                         close(fd);
17454                 }
17455         }
17456         if (result == 0
17457          && !strcmp(name[0], name[1]))
17458                 result = 1;
17459         ${cf_cv_main_return:-return}(result);
17460 }
17461
17462 _ACEOF
17463 rm -f "conftest$ac_exeext"
17464 if { (eval echo "$as_me:17464: \"$ac_link\"") >&5
17465   (eval $ac_link) 2>&5
17466   ac_status=$?
17467   echo "$as_me:17467: \$? = $ac_status" >&5
17468   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17469   { (eval echo "$as_me:17469: \"$ac_try\"") >&5
17470   (eval $ac_try) 2>&5
17471   ac_status=$?
17472   echo "$as_me:17472: \$? = $ac_status" >&5
17473   (exit "$ac_status"); }; }; then
17474   cf_cv_func_mkstemp=yes
17475
17476 else
17477   echo "$as_me: program exited with status $ac_status" >&5
17478 echo "$as_me: failed program was:" >&5
17479 cat "conftest.$ac_ext" >&5
17480 cf_cv_func_mkstemp=no
17481
17482 fi
17483 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17484 fi
17485
17486 fi
17487 echo "$as_me:17487: result: $cf_cv_func_mkstemp" >&5
17488 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17489 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17490         echo "$as_me:17490: checking for mkstemp" >&5
17491 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17492 if test "${ac_cv_func_mkstemp+set}" = set; then
17493   echo $ECHO_N "(cached) $ECHO_C" >&6
17494 else
17495   cat >"conftest.$ac_ext" <<_ACEOF
17496 #line 17496 "configure"
17497 #include "confdefs.h"
17498 #define mkstemp autoconf_temporary
17499 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17500 #undef mkstemp
17501
17502 #ifdef __cplusplus
17503 extern "C"
17504 #endif
17505
17506 /* We use char because int might match the return type of a gcc2
17507    builtin and then its argument prototype would still apply.  */
17508 char mkstemp (void);
17509
17510 int
17511 main (void)
17512 {
17513
17514 /* The GNU C library defines stubs for functions which it implements
17515     to always fail with ENOSYS.  Some functions are actually named
17516     something starting with __ and the normal name is an alias.  */
17517 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17518 #error found stub for mkstemp
17519 #endif
17520
17521         return mkstemp ();
17522   ;
17523   return 0;
17524 }
17525 _ACEOF
17526 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17527 if { (eval echo "$as_me:17527: \"$ac_link\"") >&5
17528   (eval $ac_link) 2>&5
17529   ac_status=$?
17530   echo "$as_me:17530: \$? = $ac_status" >&5
17531   (exit "$ac_status"); } &&
17532          { ac_try='test -s "conftest$ac_exeext"'
17533   { (eval echo "$as_me:17533: \"$ac_try\"") >&5
17534   (eval $ac_try) 2>&5
17535   ac_status=$?
17536   echo "$as_me:17536: \$? = $ac_status" >&5
17537   (exit "$ac_status"); }; }; then
17538   ac_cv_func_mkstemp=yes
17539 else
17540   echo "$as_me: failed program was:" >&5
17541 cat "conftest.$ac_ext" >&5
17542 ac_cv_func_mkstemp=no
17543 fi
17544 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17545 fi
17546 echo "$as_me:17546: result: $ac_cv_func_mkstemp" >&5
17547 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17548
17549 fi
17550 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17551
17552 cat >>confdefs.h <<\EOF
17553 #define HAVE_MKSTEMP 1
17554 EOF
17555
17556 fi
17557
17558 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17559         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17560         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17561 fi
17562
17563 cf_with_ada=yes
17564 if test "$cf_with_ada" != "no" ; then
17565
17566 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17567 do
17568
17569 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17570
17571         unset ac_cv_path_cf_TEMP_gnat
17572         unset cf_TEMP_gnat
17573         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17574 set dummy $cf_prog_gnat; ac_word=$2
17575 echo "$as_me:17575: checking for $ac_word" >&5
17576 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17577 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17578   echo $ECHO_N "(cached) $ECHO_C" >&6
17579 else
17580   case $cf_TEMP_gnat in
17581   [\\/]* | ?:[\\/]*)
17582   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17583   ;;
17584   *)
17585   ac_save_IFS=$IFS; IFS=$ac_path_separator
17586 ac_dummy="$PATH"
17587 for ac_dir in $ac_dummy; do
17588   IFS=$ac_save_IFS
17589   test -z "$ac_dir" && ac_dir=.
17590   if $as_executable_p "$ac_dir/$ac_word"; then
17591    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17592    echo "$as_me:17592: found $ac_dir/$ac_word" >&5
17593    break
17594 fi
17595 done
17596
17597   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17598   ;;
17599 esac
17600 fi
17601 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17602
17603 if test -n "$cf_TEMP_gnat"; then
17604   echo "$as_me:17604: result: $cf_TEMP_gnat" >&5
17605 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17606 else
17607   echo "$as_me:17607: result: no" >&5
17608 echo "${ECHO_T}no" >&6
17609 fi
17610
17611         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17612
17613         if test "x$cf_TEMP_gnat" != xno; then
17614                 unset cf_cv_gnat_version
17615                 unset cf_TEMP_gnat
17616
17617 echo "$as_me:17617: checking for $cf_prog_gnat version" >&5
17618 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17619 if test "${cf_cv_gnat_version+set}" = set; then
17620   echo $ECHO_N "(cached) $ECHO_C" >&6
17621 else
17622
17623 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17624         grep '[0-9].[0-9][0-9]*' |\
17625         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17626
17627 fi
17628 echo "$as_me:17628: result: $cf_cv_gnat_version" >&5
17629 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17630 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17631 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17632
17633         fi
17634         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17635
17636         unset cf_TEMP_gnat
17637         unset cf_cv_gnat_version
17638         unset ac_cv_path_cf_TEMP_gnat
17639 done
17640
17641 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17642         cf_ada_make=
17643         cf_cv_prog_gnat_correct=no
17644 else
17645         cf_ada_make=gnatmake
17646         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17647                 # gprconfig is newer than gnatmake; we can continue...
17648                 cf_ada_config="##"
17649         else
17650                 rm -rf ./conftest* ./*~conftest*
17651                 if mkdir conftest.src
17652                 then
17653                         cf_ada_config=""
17654                         cd conftest.src
17655                         for cf_gprconfig in Ada C
17656                         do
17657                                 echo "$as_me:17657: checking for gprconfig name for $cf_gprconfig" >&5
17658 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17659                                 if test "$cf_gprconfig" = C
17660                                 then
17661                                         for cf_gprconfig_param in \
17662                                                 "$cf_gprconfig,,,,GNATGCC" \
17663                                                 "$cf_gprconfig,,,,GCC" \
17664                                                 "$cf_gprconfig"
17665                                         do
17666                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17667                                                 test -n "$cf_gprconfig_value" && break
17668                                         done
17669                                 else
17670                                         cf_gprconfig_param=$cf_gprconfig
17671                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17672                                 fi
17673                                 if test -n "$cf_gprconfig_value"
17674                                 then
17675                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17676                                         echo "$as_me:17676: result: $cf_gprconfig_value" >&5
17677 echo "${ECHO_T}$cf_gprconfig_value" >&6
17678                                 else
17679                                         echo "$as_me:17679: result: missing" >&5
17680 echo "${ECHO_T}missing" >&6
17681                                         cf_ada_config="#"
17682                                         break
17683                                 fi
17684                         done
17685                         cd ..
17686                         rm -rf ./conftest* ./*~conftest*
17687                 fi
17688         fi
17689         if test "x$cf_ada_config" != "x#"
17690         then
17691
17692 echo "$as_me:17692: checking for gnat version" >&5
17693 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17694 if test "${cf_cv_gnat_version+set}" = set; then
17695   echo $ECHO_N "(cached) $ECHO_C" >&6
17696 else
17697
17698 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17699         grep '[0-9].[0-9][0-9]*' |\
17700         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17701
17702 fi
17703 echo "$as_me:17703: result: $cf_cv_gnat_version" >&5
17704 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17705 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17706
17707 case "$cf_cv_gnat_version" in
17708 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17709         cf_cv_prog_gnat_correct=yes
17710         ;;
17711 (*)
17712         { echo "$as_me:17712: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17713 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17714         cf_cv_prog_gnat_correct=no
17715         ;;
17716 esac
17717
17718                 # Extract the first word of "m4", so it can be a program name with args.
17719 set dummy m4; ac_word=$2
17720 echo "$as_me:17720: checking for $ac_word" >&5
17721 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17722 if test "${ac_cv_prog_M4_exists+set}" = set; then
17723   echo $ECHO_N "(cached) $ECHO_C" >&6
17724 else
17725   if test -n "$M4_exists"; then
17726   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17727 else
17728   ac_save_IFS=$IFS; IFS=$ac_path_separator
17729 ac_dummy="$PATH"
17730 for ac_dir in $ac_dummy; do
17731   IFS=$ac_save_IFS
17732   test -z "$ac_dir" && ac_dir=.
17733   $as_executable_p "$ac_dir/$ac_word" || continue
17734 ac_cv_prog_M4_exists="yes"
17735 echo "$as_me:17735: found $ac_dir/$ac_word" >&5
17736 break
17737 done
17738
17739   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17740 fi
17741 fi
17742 M4_exists=$ac_cv_prog_M4_exists
17743 if test -n "$M4_exists"; then
17744   echo "$as_me:17744: result: $M4_exists" >&5
17745 echo "${ECHO_T}$M4_exists" >&6
17746 else
17747   echo "$as_me:17747: result: no" >&5
17748 echo "${ECHO_T}no" >&6
17749 fi
17750
17751                 if test "$ac_cv_prog_M4_exists" = no; then
17752                         cf_cv_prog_gnat_correct=no
17753                         { echo "$as_me:17753: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17754 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17755                 fi
17756                 if test "$cf_cv_prog_gnat_correct" = yes; then
17757                         echo "$as_me:17757: checking if GNAT works" >&5
17758 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17759
17760 rm -rf ./conftest* ./*~conftest*
17761 cat >>conftest.ads <<CF_EOF
17762 procedure conftest;
17763 CF_EOF
17764 cat >>conftest.adb <<CF_EOF
17765 with Text_IO;
17766 with GNAT.OS_Lib;
17767 procedure conftest is
17768 begin
17769    Text_IO.Put ("Hello World");
17770    Text_IO.New_Line;
17771    GNAT.OS_Lib.OS_Exit (0);
17772 end conftest;
17773 CF_EOF
17774 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17775    if ( ./conftest 1>&5 2>&1 ) ; then
17776       cf_cv_prog_gnat_correct=yes
17777    else
17778       cf_cv_prog_gnat_correct=no
17779    fi
17780 else
17781    cf_cv_prog_gnat_correct=no
17782 fi
17783 rm -rf ./conftest* ./*~conftest*
17784
17785                         echo "$as_me:17785: result: $cf_cv_prog_gnat_correct" >&5
17786 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17787                 fi
17788         else
17789                 cf_cv_prog_gnat_correct=no
17790         fi
17791 fi
17792
17793         if test "$cf_cv_prog_gnat_correct" = yes; then
17794
17795         echo "$as_me:17795: checking optimization options for ADAFLAGS" >&5
17796 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17797         case "$CFLAGS" in
17798         (*-g*)
17799
17800         ADAFLAGS="$ADAFLAGS -g"
17801
17802                 ;;
17803         esac
17804         case "$CFLAGS" in
17805         (*-O*)
17806                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17807
17808         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17809
17810                 ;;
17811         esac
17812         echo "$as_me:17812: result: $ADAFLAGS" >&5
17813 echo "${ECHO_T}$ADAFLAGS" >&6
17814
17815 echo "$as_me:17815: checking if GNATPREP supports -T option" >&5
17816 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17817 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17818   echo $ECHO_N "(cached) $ECHO_C" >&6
17819 else
17820
17821 cf_cv_gnatprep_opt_t=no
17822 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17823
17824 fi
17825 echo "$as_me:17825: result: $cf_cv_gnatprep_opt_t" >&5
17826 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17827 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17828
17829 echo "$as_me:17829: checking if GNAT supports generics" >&5
17830 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17831 case "$cf_cv_gnat_version" in
17832 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17833         cf_gnat_generics=yes
17834         ;;
17835 (*)
17836         cf_gnat_generics=no
17837         ;;
17838 esac
17839 echo "$as_me:17839: result: $cf_gnat_generics" >&5
17840 echo "${ECHO_T}$cf_gnat_generics" >&6
17841
17842 if test "$cf_gnat_generics" = yes
17843 then
17844         cf_compile_generics=generics
17845         cf_generic_objects="\${GENOBJS}"
17846 else
17847         cf_compile_generics=
17848         cf_generic_objects=
17849 fi
17850
17851 echo "$as_me:17851: checking if GNAT supports SIGINT" >&5
17852 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17853 if test "${cf_cv_gnat_sigint+set}" = set; then
17854   echo $ECHO_N "(cached) $ECHO_C" >&6
17855 else
17856
17857 rm -rf ./conftest* ./*~conftest*
17858 cat >>conftest.ads <<CF_EOF
17859 with Ada.Interrupts.Names;
17860
17861 package ConfTest is
17862
17863    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17864    pragma Unreserve_All_Interrupts;
17865    pragma Warnings (On);
17866
17867    protected Process is
17868       procedure Stop;
17869       function Continue return Boolean;
17870       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17871    private
17872       Done : Boolean := False;
17873    end Process;
17874
17875 end ConfTest;
17876 CF_EOF
17877 cat >>conftest.adb <<CF_EOF
17878 package body ConfTest is
17879    protected body Process is
17880       procedure Stop is
17881       begin
17882          Done := True;
17883       end Stop;
17884       function Continue return Boolean is
17885       begin
17886          return not Done;
17887       end Continue;
17888    end Process;
17889 end ConfTest;
17890 CF_EOF
17891 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17892       cf_cv_gnat_sigint=yes
17893 else
17894    cf_cv_gnat_sigint=no
17895 fi
17896 rm -rf ./conftest* ./*~conftest*
17897
17898 fi
17899 echo "$as_me:17899: result: $cf_cv_gnat_sigint" >&5
17900 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17901
17902 if test "$cf_cv_gnat_sigint" = yes ; then
17903         USE_GNAT_SIGINT=""
17904 else
17905         USE_GNAT_SIGINT="#"
17906 fi
17907
17908 cf_gnat_libraries=no
17909 cf_gnat_projects=no
17910
17911 if test "$enable_gnat_projects" != no ; then
17912 echo "$as_me:17912: checking if GNAT supports project files" >&5
17913 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17914 case "$cf_cv_gnat_version" in
17915 (3.[0-9]*)
17916         ;;
17917 (*)
17918         case "$cf_cv_system_name" in
17919         (cygwin*|msys*)
17920                 ;;
17921         (*)
17922                 rm -rf ./conftest* ./*~conftest*
17923                 if mkdir conftest.src conftest.bin conftest.lib
17924                 then
17925                         cd conftest.src
17926                         rm -rf ./conftest* ./*~conftest*
17927                         cat >>library.gpr <<CF_EOF
17928 project Library is
17929   Kind := External ("LIB_KIND");
17930   for Library_Name use "ConfTest";
17931   for Object_Dir use ".";
17932   for Library_ALI_Dir use External("LIBRARY_DIR");
17933   for Library_Version use External ("SONAME");
17934   for Library_Kind use Kind;
17935   for Library_Dir use External("BUILD_DIR");
17936   Source_Dir := External ("SOURCE_DIR");
17937   for Source_Dirs use (Source_Dir);
17938 end Library;
17939 CF_EOF
17940                         cat >>confpackage.ads <<CF_EOF
17941 package ConfPackage is
17942    procedure conftest;
17943 end ConfPackage;
17944 CF_EOF
17945                         cat >>confpackage.adb <<CF_EOF
17946 with Text_IO;
17947 package body ConfPackage is
17948    procedure conftest is
17949    begin
17950       Text_IO.Put ("Hello World");
17951       Text_IO.New_Line;
17952    end conftest;
17953 end ConfPackage;
17954 CF_EOF
17955                         if ( "$cf_ada_make" $ADAFLAGS \
17956                                         -Plibrary.gpr \
17957                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17958                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17959                                         -XSOURCE_DIR="`pwd`" \
17960                                         -XSONAME=libConfTest.so.1 \
17961                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17962                                 cf_gnat_projects=yes
17963                         fi
17964                         cd ..
17965                 fi
17966                 if test -f conftest.lib/confpackage.ali
17967                 then
17968                         cf_gnat_libraries=yes
17969                 fi
17970                 rm -rf ./conftest* ./*~conftest*
17971                 ;;
17972         esac
17973         ;;
17974 esac
17975 echo "$as_me:17975: result: $cf_gnat_projects" >&5
17976 echo "${ECHO_T}$cf_gnat_projects" >&6
17977 fi # enable_gnat_projects
17978
17979 if test "$cf_gnat_projects" = yes
17980 then
17981         echo "$as_me:17981: checking if GNAT supports libraries" >&5
17982 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17983         echo "$as_me:17983: result: $cf_gnat_libraries" >&5
17984 echo "${ECHO_T}$cf_gnat_libraries" >&6
17985 fi
17986
17987 USE_OLD_MAKERULES=""
17988 USE_GNAT_PROJECTS="#"
17989 USE_GNAT_MAKE_GPR="#"
17990 USE_GNAT_GPRBUILD="#"
17991
17992 if test "$cf_gnat_projects" = yes
17993 then
17994         USE_OLD_MAKERULES="#"
17995         USE_GNAT_PROJECTS=""
17996         if test "$cf_cv_VERSION_GPRBUILD" != no
17997         then
17998                 USE_GNAT_GPRBUILD=""
17999         elif test "$cf_cv_VERSION_GNATMAKE" != no
18000         then
18001                 USE_GNAT_MAKE_GPR=""
18002         else
18003                 { echo "$as_me:18003: WARNING: use old makefile rules since tools are missing" >&5
18004 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
18005         fi
18006 fi
18007
18008 if test "$cf_gnat_libraries" = yes
18009 then
18010         USE_GNAT_LIBRARIES=""
18011 else
18012         USE_GNAT_LIBRARIES="#"
18013 fi
18014
18015 echo "$as_me:18015: checking for ada-compiler" >&5
18016 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
18017
18018 # Check whether --with-ada-compiler or --without-ada-compiler was given.
18019 if test "${with_ada_compiler+set}" = set; then
18020   withval="$with_ada_compiler"
18021   cf_ada_compiler=$withval
18022 else
18023   cf_ada_compiler=gnatmake
18024 fi;
18025
18026 echo "$as_me:18026: result: $cf_ada_compiler" >&5
18027 echo "${ECHO_T}$cf_ada_compiler" >&6
18028
18029                 cf_ada_package=terminal_interface
18030
18031 echo "$as_me:18031: checking for ada-include" >&5
18032 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
18033
18034 # Check whether --with-ada-include or --without-ada-include was given.
18035 if test "${with_ada_include+set}" = set; then
18036   withval="$with_ada_include"
18037
18038 else
18039   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18040 fi; if test -n "$prefix/share/ada/adainclude" ; then
18041
18042 if test "x$prefix" != xNONE; then
18043         cf_path_syntax="$prefix"
18044 else
18045         cf_path_syntax="$ac_default_prefix"
18046 fi
18047
18048 case ".$withval" in
18049 (.\$\(*\)*|.\'*\'*)
18050         ;;
18051 (..|./*|.\\*)
18052         ;;
18053 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18054         ;;
18055 (.\$\{*prefix\}*|.\$\{*dir\}*)
18056         eval withval="$withval"
18057         case ".$withval" in
18058         (.NONE/*)
18059                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18060                 ;;
18061         esac
18062         ;;
18063 (.no|.NONE/*)
18064         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18065         ;;
18066 (*)
18067         { { echo "$as_me:18067: error: expected a pathname, not \"$withval\"" >&5
18068 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18069    { (exit 1); exit 1; }; }
18070         ;;
18071 esac
18072
18073 fi
18074 eval ADA_INCLUDE="$withval"
18075
18076 echo "$as_me:18076: result: $ADA_INCLUDE" >&5
18077 echo "${ECHO_T}$ADA_INCLUDE" >&6
18078
18079 echo "$as_me:18079: checking for ada-objects" >&5
18080 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
18081
18082 # Check whether --with-ada-objects or --without-ada-objects was given.
18083 if test "${with_ada_objects+set}" = set; then
18084   withval="$with_ada_objects"
18085
18086 else
18087   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18088 fi; if test -n "$prefix/lib/ada/adalib" ; then
18089
18090 if test "x$prefix" != xNONE; then
18091         cf_path_syntax="$prefix"
18092 else
18093         cf_path_syntax="$ac_default_prefix"
18094 fi
18095
18096 case ".$withval" in
18097 (.\$\(*\)*|.\'*\'*)
18098         ;;
18099 (..|./*|.\\*)
18100         ;;
18101 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18102         ;;
18103 (.\$\{*prefix\}*|.\$\{*dir\}*)
18104         eval withval="$withval"
18105         case ".$withval" in
18106         (.NONE/*)
18107                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18108                 ;;
18109         esac
18110         ;;
18111 (.no|.NONE/*)
18112         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18113         ;;
18114 (*)
18115         { { echo "$as_me:18115: error: expected a pathname, not \"$withval\"" >&5
18116 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18117    { (exit 1); exit 1; }; }
18118         ;;
18119 esac
18120
18121 fi
18122 eval ADA_OBJECTS="$withval"
18123
18124 echo "$as_me:18124: result: $ADA_OBJECTS" >&5
18125 echo "${ECHO_T}$ADA_OBJECTS" >&6
18126
18127 echo "$as_me:18127: checking if an Ada95 shared-library should be built" >&5
18128 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
18129
18130 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18131 if test "${with_ada_sharedlib+set}" = set; then
18132   withval="$with_ada_sharedlib"
18133   with_ada_sharedlib=$withval
18134 else
18135   with_ada_sharedlib=no
18136 fi;
18137 echo "$as_me:18137: result: $with_ada_sharedlib" >&5
18138 echo "${ECHO_T}$with_ada_sharedlib" >&6
18139
18140 if test "x$with_ada_sharedlib" != xno
18141 then
18142         if test "x$cf_gnat_projects" != xyes
18143         then
18144                 { echo "$as_me:18144: WARNING: disabling shared-library since GNAT projects are not supported" >&5
18145 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
18146                 with_ada_sharedlib=no
18147         fi
18148 fi
18149
18150 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18151 MAKE_ADA_SHAREDLIB="#"
18152
18153 if test "x$with_ada_sharedlib" != xno
18154 then
18155         MAKE_ADA_SHAREDLIB=
18156         if test "x$with_ada_sharedlib" != xyes
18157         then
18158                 ADA_SHAREDLIB="$with_ada_sharedlib"
18159         fi
18160 fi
18161
18162                 # allow the Ada binding to be renamed
18163
18164 echo "$as_me:18164: checking for ada-libname" >&5
18165 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18166
18167 # Check whether --with-ada-libname or --without-ada-libname was given.
18168 if test "${with_ada_libname+set}" = set; then
18169   withval="$with_ada_libname"
18170   ADA_LIBNAME=$withval
18171 else
18172   ADA_LIBNAME=AdaCurses
18173 fi;
18174 case "x$ADA_LIBNAME" in
18175 (x|xyes|xno)
18176         ADA_LIBNAME=AdaCurses
18177         ;;
18178 esac
18179
18180 echo "$as_me:18180: result: $ADA_LIBNAME" >&5
18181 echo "${ECHO_T}$ADA_LIBNAME" >&6
18182
18183         else
18184                 { { echo "$as_me:18184: error: No usable Ada compiler found" >&5
18185 echo "$as_me: error: No usable Ada compiler found" >&2;}
18186    { (exit 1); exit 1; }; }
18187         fi
18188 else
18189         { { echo "$as_me:18189: error: The Ada compiler is needed for this package" >&5
18190 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18191    { (exit 1); exit 1; }; }
18192 fi
18193
18194 ################################################################################
18195
18196 # not needed
18197 TINFO_LDFLAGS2=
18198
18199 TINFO_LIBS=
18200
18201 ### Construct the list of include-directories to be generated
18202
18203 if test "$srcdir" != "."; then
18204         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18205 fi
18206 CPPFLAGS="-I../include $CPPFLAGS"
18207 if test "$srcdir" != "."; then
18208         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18209 fi
18210 CPPFLAGS="-I. $CPPFLAGS"
18211
18212 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18213 if test "$srcdir" != "."; then
18214         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18215 fi
18216 if test "$GCC" != yes; then
18217         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18218 elif test "$includedir" != "/usr/include"; then
18219         if test "$includedir" = '${prefix}/include' ; then
18220                 if test x$prefix != x/usr ; then
18221                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18222                 fi
18223         else
18224                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18225         fi
18226 fi
18227
18228 ### Build up pieces for makefile rules
18229 echo "$as_me:18229: checking default library suffix" >&5
18230 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18231
18232         case $DFT_LWR_MODEL in
18233         (libtool) DFT_ARG_SUFFIX=''   ;;
18234         (normal)  DFT_ARG_SUFFIX=''   ;;
18235         (debug)   DFT_ARG_SUFFIX='_g' ;;
18236         (profile) DFT_ARG_SUFFIX='_p' ;;
18237         (shared)  DFT_ARG_SUFFIX=''   ;;
18238         esac
18239         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18240 echo "$as_me:18240: result: $DFT_ARG_SUFFIX" >&5
18241 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18242
18243 echo "$as_me:18243: checking default library-dependency suffix" >&5
18244 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18245
18246         case X$DFT_LWR_MODEL in
18247         (Xlibtool)
18248                 DFT_LIB_SUFFIX='.la'
18249                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18250                 ;;
18251         (Xdebug)
18252                 case "$cf_cv_system_name" in
18253                 (*-msvc*)
18254                         DFT_LIB_SUFFIX='_g.lib'
18255                         ;;
18256                 (*)
18257                         DFT_LIB_SUFFIX='_g.a'
18258                         ;;
18259                 esac
18260                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18261                 ;;
18262         (Xprofile)
18263                 case "$cf_cv_system_name" in
18264                 (*-msvc*)
18265                         DFT_LIB_SUFFIX='_p.lib'
18266                         ;;
18267                 (*)
18268                         DFT_LIB_SUFFIX='_p.a'
18269                         ;;
18270                 esac
18271                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18272                 ;;
18273         (Xshared)
18274                 case "$cf_cv_system_name" in
18275                 (aix[5-7]*)
18276                         DFT_LIB_SUFFIX='.so'
18277                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18278                         ;;
18279                 (*-msvc*)
18280                         DFT_LIB_SUFFIX='.dll'
18281                         DFT_DEP_SUFFIX='.dll.lib'
18282                         ;;
18283                 (cygwin*|msys*|mingw*)
18284                         DFT_LIB_SUFFIX='.dll'
18285                         DFT_DEP_SUFFIX='.dll.a'
18286                         ;;
18287                 (darwin*)
18288                         DFT_LIB_SUFFIX='.dylib'
18289                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18290                         ;;
18291                 (hpux*)
18292                         case "$target" in
18293                         (ia64*)
18294                                 DFT_LIB_SUFFIX='.so'
18295                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18296                                 ;;
18297                         (*)
18298                                 DFT_LIB_SUFFIX='.sl'
18299                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18300                                 ;;
18301                         esac
18302                         ;;
18303                 (*)
18304                         DFT_LIB_SUFFIX='.so'
18305                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18306                         ;;
18307                 esac
18308                 ;;
18309         (*)
18310                 case "$target" in
18311                 (*-msvc*)
18312                         DFT_LIB_SUFFIX='.lib'
18313                         ;;
18314                 (*)
18315                         DFT_LIB_SUFFIX='.a'
18316                         ;;
18317                 esac
18318                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18319                 ;;
18320         esac
18321         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18322         then
18323                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18324                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18325         fi
18326 echo "$as_me:18326: result: $DFT_DEP_SUFFIX" >&5
18327 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18328
18329 echo "$as_me:18329: checking default object directory" >&5
18330 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18331
18332         case $DFT_LWR_MODEL in
18333         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18334         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18335         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18336         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18337         (shared)
18338                 case "$cf_cv_system_name" in
18339                 (cygwin|msys)
18340                         DFT_OBJ_SUBDIR='objects' ;;
18341                 (*)
18342                         DFT_OBJ_SUBDIR='obj_s' ;;
18343                 esac
18344         esac
18345 echo "$as_me:18345: result: $DFT_OBJ_SUBDIR" >&5
18346 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18347
18348 ### Set up low-level terminfo dependencies for makefiles.
18349
18350 if test "$DFT_LWR_MODEL" = shared ; then
18351         case $cf_cv_system_name in
18352         (cygwin*)
18353                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18354                 ;;
18355         (msys*)
18356                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18357                 ;;
18358         esac
18359 fi
18360
18361 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18362
18363 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18364
18365 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18366
18367 ### Construct the list of subdirectories for which we'll customize makefiles
18368 ### with the appropriate compile-rules.
18369
18370 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18371
18372 cat >>confdefs.h <<EOF
18373 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18374 EOF
18375
18376 ################################################################################
18377
18378 TEST_ARG2=
18379
18380 TEST_LIBS2=
18381
18382 NCURSES_SHLIB2="sh -c"
18383
18384 ADA_SUBDIRS="include gen src doc"
18385 if test "x$cf_with_tests" != "xno" ; then
18386         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18387 fi
18388 for cf_dir in $ADA_SUBDIRS
18389 do
18390         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18391 done
18392
18393 NCURSES_TREE="#"
18394
18395 EXTERNAL_TREE=
18396
18397 # match layout used by make-tar.sh
18398 ADAHTML_DIR=../doc/ada
18399
18400 if test "x$cross_compiling" = xyes ; then
18401         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18402 else
18403         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18404 fi
18405
18406 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"
18407 ac_config_commands="$ac_config_commands default"
18408 cat >confcache <<\_ACEOF
18409 # This file is a shell script that caches the results of configure
18410 # tests run on this system so they can be shared between configure
18411 # scripts and configure runs, see configure's option --config-cache.
18412 # It is not useful on other systems.  If it contains results you don't
18413 # want to keep, you may remove or edit it.
18414 #
18415 # config.status only pays attention to the cache file if you give it
18416 # the --recheck option to rerun configure.
18417 #
18418 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18419 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18420 # following values.
18421
18422 _ACEOF
18423
18424 # The following way of writing the cache mishandles newlines in values,
18425 # but we know of no workaround that is simple, portable, and efficient.
18426 # So, don't put newlines in cache variables' values.
18427 # Ultrix sh set writes to stderr and can't be redirected directly,
18428 # and sets the high bit in the cache file unless we assign to the vars.
18429 {
18430   (set) 2>&1 |
18431     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18432     *ac_space=\ *)
18433       # `set' does not quote correctly, so add quotes (double-quote
18434       # substitution turns \\\\ into \\, and sed turns \\ into \).
18435       sed -n \
18436         "s/'/'\\\\''/g;
18437           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18438       ;;
18439     *)
18440       # `set' quotes correctly as required by POSIX, so do not add quotes.
18441       sed -n \
18442         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18443       ;;
18444     esac;
18445 } |
18446   sed '
18447      t clear
18448      : clear
18449      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18450      t end
18451      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18452      : end' >>confcache
18453 if cmp -s $cache_file confcache; then :; else
18454   if test -w $cache_file; then
18455     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18456     cat confcache >$cache_file
18457   else
18458     echo "not updating unwritable cache $cache_file"
18459   fi
18460 fi
18461 rm -f confcache
18462
18463 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18464 # Let make expand exec_prefix.
18465 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18466
18467 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18468 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18469 # trailing colons and then remove the whole line if VPATH becomes empty
18470 # (actually we leave an empty line to preserve line numbers).
18471 if test "x$srcdir" = x.; then
18472   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18473 s/:*\$(srcdir):*/:/;
18474 s/:*\${srcdir}:*/:/;
18475 s/:*@srcdir@:*/:/;
18476 s/^\([^=]*=[    ]*\):*/\1/;
18477 s/:*$//;
18478 s/^[^=]*=[      ]*$//;
18479 }'
18480 fi
18481
18482 DEFS=-DHAVE_CONFIG_H
18483
18484 : "${CONFIG_STATUS=./config.status}"
18485 ac_clean_files_save=$ac_clean_files
18486 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18487 { echo "$as_me:18487: creating $CONFIG_STATUS" >&5
18488 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18489 cat >"$CONFIG_STATUS" <<_ACEOF
18490 #! $SHELL
18491 # Generated automatically by configure.
18492 # Run this file to recreate the current configuration.
18493 # Compiler output produced by configure, useful for debugging
18494 # configure, is in config.log if it exists.
18495
18496 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18497
18498 debug=false
18499 SHELL=\${CONFIG_SHELL-$SHELL}
18500 ac_cs_invocation="\$0 \$@"
18501
18502 CLICOLOR_FORCE= GREP_OPTIONS=
18503 unset CLICOLOR_FORCE GREP_OPTIONS
18504 _ACEOF
18505
18506 cat >>"$CONFIG_STATUS" <<\_ACEOF
18507 # Be Bourne compatible
18508 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18509   emulate sh
18510   NULLCMD=:
18511 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18512   set -o posix
18513 fi
18514
18515 # Name of the executable.
18516 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18517
18518 if expr a : '\(a\)' >/dev/null 2>&1; then
18519   as_expr="expr"
18520 else
18521   as_expr="false"
18522 fi
18523
18524 rm -f conf$$ conf$$.exe conf$$.file
18525 echo >conf$$.file
18526 if ln -s conf$$.file conf$$ 2>/dev/null; then
18527   # We could just check for DJGPP; but this test a) works b) is more generic
18528   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18529   if test -f conf$$.exe; then
18530     # Don't use ln at all; we don't have any links
18531     as_ln_s='cp -p'
18532   else
18533     as_ln_s='ln -s'
18534   fi
18535 elif ln conf$$.file conf$$ 2>/dev/null; then
18536   as_ln_s='ln'
18537 else
18538   as_ln_s='cp -p'
18539 fi
18540 rm -f conf$$ conf$$.exe conf$$.file
18541
18542 as_executable_p="test -f"
18543
18544 # Support unset when possible.
18545 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18546   as_unset="unset"
18547 else
18548   as_unset="false"
18549 fi
18550
18551 # NLS nuisances.
18552 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18553 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18554 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18555 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18556 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18557 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18558 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18559 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18560
18561 # IFS
18562 # We need space, tab and new line, in precisely that order.
18563 as_nl='
18564 '
18565 IFS="   $as_nl"
18566
18567 # CDPATH.
18568 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18569
18570 exec 6>&1
18571
18572 _ACEOF
18573
18574 # Files that config.status was made for.
18575 if test -n "$ac_config_files"; then
18576   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18577 fi
18578
18579 if test -n "$ac_config_headers"; then
18580   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18581 fi
18582
18583 if test -n "$ac_config_links"; then
18584   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18585 fi
18586
18587 if test -n "$ac_config_commands"; then
18588   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18589 fi
18590
18591 cat >>"$CONFIG_STATUS" <<\EOF
18592
18593 ac_cs_usage="\
18594 \`$as_me' instantiates files from templates according to the
18595 current configuration.
18596
18597 Usage: $0 [OPTIONS] [FILE]...
18598
18599   -h, --help       print this help, then exit
18600   -V, --version    print version number, then exit
18601   -d, --debug      don't remove temporary files
18602       --recheck    update $as_me by reconfiguring in the same conditions
18603   --file=FILE[:TEMPLATE]
18604                    instantiate the configuration file FILE
18605   --header=FILE[:TEMPLATE]
18606                    instantiate the configuration header FILE
18607
18608 Configuration files:
18609 $config_files
18610
18611 Configuration headers:
18612 $config_headers
18613
18614 Configuration commands:
18615 $config_commands
18616
18617 Report bugs to <dickey@invisible-island.net>."
18618 EOF
18619
18620 cat >>"$CONFIG_STATUS" <<EOF
18621 ac_cs_version="\\
18622 config.status
18623 configured by $0, generated by GNU Autoconf 2.52.20221202,
18624   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18625
18626 Copyright 2003-2021,2022        Thomas E. Dickey
18627 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18628 Free Software Foundation, Inc.
18629 This config.status script is free software; the Free Software Foundation
18630 gives unlimited permission to copy, distribute and modify it."
18631 srcdir="$srcdir"
18632 INSTALL="$INSTALL"
18633 EOF
18634
18635 cat >>"$CONFIG_STATUS" <<\EOF
18636 # If no file are specified by the user, then we need to provide default
18637 # value.  By we need to know if files were specified by the user.
18638 ac_need_defaults=:
18639 while test $# != 0
18640 do
18641   case $1 in
18642   --*=*)
18643     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18644     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18645     shift
18646     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18647     shift
18648     ;;
18649   -*);;
18650   *) # This is not an option, so the user has probably given explicit
18651      # arguments.
18652      ac_need_defaults=false;;
18653   esac
18654
18655   case $1 in
18656   # Handling of the options.
18657 EOF
18658 cat >>"$CONFIG_STATUS" <<EOF
18659   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18660     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18661     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18662 EOF
18663 cat >>"$CONFIG_STATUS" <<\EOF
18664   --version | --vers* | -V )
18665     echo "$ac_cs_version"; exit 0 ;;
18666   --he | --h)
18667     # Conflict between --help and --header
18668     { { echo "$as_me:18668: error: ambiguous option: $1
18669 Try \`$0 --help' for more information." >&5
18670 echo "$as_me: error: ambiguous option: $1
18671 Try \`$0 --help' for more information." >&2;}
18672    { (exit 1); exit 1; }; };;
18673   --help | --hel | -h )
18674     echo "$ac_cs_usage"; exit 0 ;;
18675   --debug | --d* | -d )
18676     debug=: ;;
18677   --file | --fil | --fi | --f )
18678     shift
18679     CONFIG_FILES="$CONFIG_FILES $1"
18680     ac_need_defaults=false;;
18681   --header | --heade | --head | --hea )
18682     shift
18683     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18684     ac_need_defaults=false;;
18685
18686   # This is an error.
18687   -*) { { echo "$as_me:18687: error: unrecognized option: $1
18688 Try \`$0 --help' for more information." >&5
18689 echo "$as_me: error: unrecognized option: $1
18690 Try \`$0 --help' for more information." >&2;}
18691    { (exit 1); exit 1; }; } ;;
18692
18693   *) ac_config_targets="$ac_config_targets $1" ;;
18694
18695   esac
18696   shift
18697 done
18698
18699 exec 5>>config.log
18700 cat >&5 << _ACEOF
18701
18702 ## ----------------------- ##
18703 ## Running config.status.  ##
18704 ## ----------------------- ##
18705
18706 This file was extended by $as_me 2.52.20221202, executed with
18707   CONFIG_FILES    = $CONFIG_FILES
18708   CONFIG_HEADERS  = $CONFIG_HEADERS
18709   CONFIG_LINKS    = $CONFIG_LINKS
18710   CONFIG_COMMANDS = $CONFIG_COMMANDS
18711   > "$ac_cs_invocation"
18712 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18713
18714 _ACEOF
18715 EOF
18716
18717 cat >>"$CONFIG_STATUS" <<EOF
18718 #
18719 # INIT-COMMANDS section.
18720 #
18721
18722 ### Special initialization commands, used to pass information from the
18723 ### configuration-run into config.status
18724
18725 AWK="$AWK"
18726 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18727 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18728 LIB_NAME="$LIB_NAME"
18729 LIB_PREFIX="$LIB_PREFIX"
18730 LIB_SUFFIX="$LIB_SUFFIX"
18731 LN_S="$LN_S"
18732 NCURSES_MAJOR="$NCURSES_MAJOR"
18733 NCURSES_MINOR="$NCURSES_MINOR"
18734 NCURSES_PATCH="$NCURSES_PATCH"
18735 PACKAGE="$PACKAGE"
18736 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18737 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18738 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18739 cf_cv_abi_version="$cf_cv_abi_version"
18740 cf_cv_rel_version="$cf_cv_rel_version"
18741 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18742 cf_cv_shared_soname='$cf_cv_shared_soname'
18743 cf_cv_shlib_version="$cf_cv_shlib_version"
18744 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18745 cf_cv_system_name="$cf_cv_system_name"
18746 host="$host"
18747 target="$target"
18748
18749 EOF
18750
18751 cat >>"$CONFIG_STATUS" <<\EOF
18752 for ac_config_target in $ac_config_targets
18753 do
18754   case "$ac_config_target" in
18755   # Handling of arguments.
18756   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18757   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18758   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18759   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18760   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18761   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18762   *) { { echo "$as_me:18762: error: invalid argument: $ac_config_target" >&5
18763 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18764    { (exit 1); exit 1; }; };;
18765   esac
18766 done
18767
18768 # If the user did not use the arguments to specify the items to instantiate,
18769 # then the envvar interface is used.  Set only those that are not.
18770 # We use the long form for the default assignment because of an extremely
18771 # bizarre bug on SunOS 4.1.3.
18772 if "$ac_need_defaults"; then
18773   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18774   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18775   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18776 fi
18777
18778 # Create a temporary directory, and hook for its removal unless debugging.
18779 $debug ||
18780 {
18781   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18782   trap '{ (exit 1); exit 1; }' 1 2 13 15
18783 }
18784
18785 # Create a (secure) tmp directory for tmp files.
18786 : "${TMPDIR=/tmp}"
18787 {
18788   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18789   test -n "$tmp" && test -d "$tmp"
18790 }  ||
18791 {
18792   tmp=$TMPDIR/cs$$-$RANDOM
18793   (umask 077 && mkdir "$tmp")
18794 } ||
18795 {
18796    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18797    { (exit 1); exit 1; }
18798 }
18799
18800 EOF
18801
18802 cat >>"$CONFIG_STATUS" <<EOF
18803
18804 #
18805 # CONFIG_FILES section.
18806 #
18807
18808 # No need to generate the scripts if there are no CONFIG_FILES.
18809 # This happens for instance when ./config.status config.h
18810 if test -n "\$CONFIG_FILES"; then
18811   # Protect against being on the right side of a sed subst in config.status.
18812   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18813    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
18814 s,@SHELL@,$SHELL,;t t
18815 s,@exec_prefix@,$exec_prefix,;t t
18816 s,@prefix@,$prefix,;t t
18817 s,@program_transform_name@,$program_transform_name,;t t
18818 s,@bindir@,$bindir,;t t
18819 s,@sbindir@,$sbindir,;t t
18820 s,@libexecdir@,$libexecdir,;t t
18821 s,@datarootdir@,$datarootdir,;t t
18822 s,@datadir@,$datadir,;t t
18823 s,@sysconfdir@,$sysconfdir,;t t
18824 s,@sharedstatedir@,$sharedstatedir,;t t
18825 s,@localstatedir@,$localstatedir,;t t
18826 s,@runstatedir@,$runstatedir,;t t
18827 s,@libdir@,$libdir,;t t
18828 s,@includedir@,$includedir,;t t
18829 s,@oldincludedir@,$oldincludedir,;t t
18830 s,@infodir@,$infodir,;t t
18831 s,@mandir@,$mandir,;t t
18832 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18833 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18834 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18835 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18836 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18837 s,@build_alias@,$build_alias,;t t
18838 s,@host_alias@,$host_alias,;t t
18839 s,@target_alias@,$target_alias,;t t
18840 s,@ECHO_C@,$ECHO_C,;t t
18841 s,@ECHO_N@,$ECHO_N,;t t
18842 s,@ECHO_T@,$ECHO_T,;t t
18843 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18844 s,@DEFS@,$DEFS,;t t
18845 s,@LIBS@,$LIBS,;t t
18846 s,@PACKAGE@,$PACKAGE,;t t
18847 s,@top_builddir@,$top_builddir,;t t
18848 s,@build@,$build,;t t
18849 s,@build_cpu@,$build_cpu,;t t
18850 s,@build_vendor@,$build_vendor,;t t
18851 s,@build_os@,$build_os,;t t
18852 s,@host@,$host,;t t
18853 s,@host_cpu@,$host_cpu,;t t
18854 s,@host_vendor@,$host_vendor,;t t
18855 s,@host_os@,$host_os,;t t
18856 s,@target@,$target,;t t
18857 s,@target_cpu@,$target_cpu,;t t
18858 s,@target_vendor@,$target_vendor,;t t
18859 s,@target_os@,$target_os,;t t
18860 s,@GREP@,$GREP,;t t
18861 s,@FGREP@,$FGREP,;t t
18862 s,@CC@,$CC,;t t
18863 s,@CFLAGS@,$CFLAGS,;t t
18864 s,@LDFLAGS@,$LDFLAGS,;t t
18865 s,@CPPFLAGS@,$CPPFLAGS,;t t
18866 s,@ac_ct_CC@,$ac_ct_CC,;t t
18867 s,@EXEEXT@,$EXEEXT,;t t
18868 s,@OBJEXT@,$OBJEXT,;t t
18869 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18870 s,@CPP@,$CPP,;t t
18871 s,@EGREP@,$EGREP,;t t
18872 s,@AWK@,$AWK,;t t
18873 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18874 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18875 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18876 s,@LN_S@,$LN_S,;t t
18877 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18878 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18879 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18880 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18881 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18882 s,@SET_MAKE@,$SET_MAKE,;t t
18883 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18884 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18885 s,@CTAGS@,$CTAGS,;t t
18886 s,@ETAGS@,$ETAGS,;t t
18887 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18888 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18889 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18890 s,@RANLIB@,$RANLIB,;t t
18891 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18892 s,@LD@,$LD,;t t
18893 s,@ac_ct_LD@,$ac_ct_LD,;t t
18894 s,@AR@,$AR,;t t
18895 s,@ac_ct_AR@,$ac_ct_AR,;t t
18896 s,@ARFLAGS@,$ARFLAGS,;t t
18897 s,@DESTDIR@,$DESTDIR,;t t
18898 s,@BUILD_CC@,$BUILD_CC,;t t
18899 s,@BUILD_CPP@,$BUILD_CPP,;t t
18900 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18901 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18902 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18903 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18904 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18905 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18906 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18907 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18908 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18909 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18910 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18911 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18912 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18913 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18914 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18915 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18916 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18917 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18918 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18919 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18920 s,@CC_G_OPT@,$CC_G_OPT,;t t
18921 s,@LD_MODEL@,$LD_MODEL,;t t
18922 s,@shlibdir@,$shlibdir,;t t
18923 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18924 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18925 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18926 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18927 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18928 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18929 s,@LINK_PROGS@,$LINK_PROGS,;t t
18930 s,@LINK_TESTS@,$LINK_TESTS,;t t
18931 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18932 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18933 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18934 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18935 s,@RPATH_LIST@,$RPATH_LIST,;t t
18936 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18937 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18938 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18939 s,@PTHREAD@,$PTHREAD,;t t
18940 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18941 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18942 s,@ECHO_LT@,$ECHO_LT,;t t
18943 s,@ECHO_LD@,$ECHO_LD,;t t
18944 s,@RULE_CC@,$RULE_CC,;t t
18945 s,@SHOW_CC@,$SHOW_CC,;t t
18946 s,@ECHO_CC@,$ECHO_CC,;t t
18947 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18948 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18949 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18950 s,@ADAFLAGS@,$ADAFLAGS,;t t
18951 s,@ADA_TRACE@,$ADA_TRACE,;t t
18952 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18953 s,@M4_exists@,$M4_exists,;t t
18954 s,@cf_ada_make@,$cf_ada_make,;t t
18955 s,@cf_ada_config@,$cf_ada_config,;t t
18956 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18957 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18958 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18959 s,@cf_compile_generics@,$cf_compile_generics,;t t
18960 s,@cf_generic_objects@,$cf_generic_objects,;t t
18961 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18962 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18963 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18964 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18965 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18966 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18967 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18968 s,@cf_ada_package@,$cf_ada_package,;t t
18969 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18970 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18971 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18972 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18973 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18974 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18975 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18976 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18977 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18978 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18979 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18980 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18981 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18982 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18983 s,@TEST_ARG2@,$TEST_ARG2,;t t
18984 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18985 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18986 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18987 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18988 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18989 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18990 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18991 CEOF
18992
18993 EOF
18994
18995   cat >>"$CONFIG_STATUS" <<\EOF
18996   # Split the substitutions into bite-sized pieces for seds with
18997   # small command number limits, like on Digital OSF/1 and HP-UX.
18998   ac_max_sed_lines=48
18999   ac_sed_frag=1 # Number of current file.
19000   ac_beg=1 # First line for current file.
19001   ac_end=$ac_max_sed_lines # Line after last line for current file.
19002   ac_more_lines=:
19003   ac_sed_cmds=
19004   while "$ac_more_lines"; do
19005     if test "$ac_beg" -gt 1; then
19006       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19007     else
19008       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19009     fi
19010     if test ! -s "$tmp"/subs.frag; then
19011       ac_more_lines=false
19012     else
19013       # The purpose of the label and of the branching condition is to
19014       # speed up the sed processing (if there are no `@' at all, there
19015       # is no need to browse any of the substitutions).
19016       # These are the two extra sed commands mentioned above.
19017       (echo ':t
19018   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19019       # It is possible to make a multiline substitution using escaped newlines.
19020       # Ensure that we do not split the substitution between script fragments.
19021       ac_BEG=$ac_end
19022       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19023       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19024       if test -s "$tmp"/subs.next; then
19025         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19026         if test ! -s "$tmp"/subs.edit; then
19027           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19028           if test ! -s "$tmp"/subs.edit; then
19029             if test "$ac_beg" -gt 1; then
19030               ac_end=`expr "$ac_end" - 1`
19031               continue
19032             fi
19033           fi
19034         fi
19035       fi
19036
19037       if test -z "$ac_sed_cmds"; then
19038         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19039       else
19040         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19041       fi
19042       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19043       ac_beg=$ac_end
19044       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19045     fi
19046   done
19047   if test -z "$ac_sed_cmds"; then
19048     ac_sed_cmds="cat"
19049   fi
19050 fi # test -n "$CONFIG_FILES"
19051
19052 EOF
19053 cat >>"$CONFIG_STATUS" <<\EOF
19054 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19055   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19056   case "$ac_file" in
19057   - | *:- | *:-:* ) # input from stdin
19058         cat >"$tmp"/stdin
19059         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19060         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19061   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19062         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19063   * )   ac_file_in=$ac_file.in ;;
19064   esac
19065
19066   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19067   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19068          X"$ac_file" : 'X\(//\)[^/]' \| \
19069          X"$ac_file" : 'X\(//\)$' \| \
19070          X"$ac_file" : 'X\(/\)' \| \
19071          .     : '\(.\)' 2>/dev/null ||
19072 echo X"$ac_file" |
19073     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19074           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19075           /^X\(\/\/\)$/{ s//\1/; q; }
19076           /^X\(\/\).*/{ s//\1/; q; }
19077           s/.*/./; q'`
19078   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19079     { case "$ac_dir" in
19080   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19081   *)                      as_incr_dir=.;;
19082 esac
19083 as_dummy="$ac_dir"
19084 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19085   case $as_mkdir_dir in
19086     # Skip DOS drivespec
19087     ?:) as_incr_dir=$as_mkdir_dir ;;
19088     *)
19089       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19090       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19091     ;;
19092   esac
19093 done; }
19094
19095     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19096     # A "../" for each directory in $ac_dir_suffix.
19097     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19098   else
19099     ac_dir_suffix= ac_dots=
19100   fi
19101
19102   case "$srcdir" in
19103   .)  ac_srcdir=.
19104       if test -z "$ac_dots"; then
19105          ac_top_srcdir=.
19106       else
19107          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19108       fi ;;
19109   [\\/]* | ?:[\\/]* )
19110       ac_srcdir="$srcdir$ac_dir_suffix";
19111       ac_top_srcdir="$srcdir" ;;
19112   *) # Relative path.
19113     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19114     ac_top_srcdir="$ac_dots$srcdir" ;;
19115   esac
19116
19117   case $INSTALL in
19118   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19119   *) ac_INSTALL=$ac_dots$INSTALL ;;
19120   esac
19121
19122   if test x"$ac_file" != x-; then
19123     { echo "$as_me:19123: creating $ac_file" >&5
19124 echo "$as_me: creating $ac_file" >&6;}
19125     rm -f "$ac_file"
19126   fi
19127   # Let's still pretend it is `configure' which instantiates (i.e., don't
19128   # use $as_me), people would be surprised to read:
19129   #    /* config.h.  Generated automatically by config.status.  */
19130   configure_input="Generated automatically from `echo $ac_file_in |
19131                                                  sed 's,.*/,,'` by configure."
19132
19133   # First look for the input files in the build tree, otherwise in the
19134   # src tree.
19135   ac_file_inputs=`IFS=:
19136     for f in $ac_file_in; do
19137       case $f in
19138       -) echo "$tmp"/stdin ;;
19139       [\\/$]*)
19140          # Absolute (can't be DOS-style, as IFS=:)
19141          test -f "$f" || { { echo "$as_me:19141: error: cannot find input file: $f" >&5
19142 echo "$as_me: error: cannot find input file: $f" >&2;}
19143    { (exit 1); exit 1; }; }
19144          echo "$f";;
19145       *) # Relative
19146          if test -f "$f"; then
19147            # Build tree
19148            echo "$f"
19149          elif test -f "$srcdir/$f"; then
19150            # Source tree
19151            echo "$srcdir/$f"
19152          else
19153            # /dev/null tree
19154            { { echo "$as_me:19154: error: cannot find input file: $f" >&5
19155 echo "$as_me: error: cannot find input file: $f" >&2;}
19156    { (exit 1); exit 1; }; }
19157          fi;;
19158       esac
19159     done` || { (exit 1); exit 1; }
19160 EOF
19161 cat >>"$CONFIG_STATUS" <<\EOF
19162   ac_warn_datarootdir=no
19163   if test x"$ac_file" != x-; then
19164     for ac_item in $ac_file_inputs
19165     do
19166       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19167       if test -n "$ac_seen"; then
19168         ac_used=`grep '@datarootdir@' "$ac_item"`
19169         if test -z "$ac_used"; then
19170           { echo "$as_me:19170: WARNING: datarootdir was used implicitly but not set:
19171 $ac_seen" >&5
19172 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19173 $ac_seen" >&2;}
19174           ac_warn_datarootdir=yes
19175         fi
19176       fi
19177       ac_seen=`grep '${datarootdir}' "$ac_item"`
19178       if test -n "$ac_seen"; then
19179         { echo "$as_me:19179: WARNING: datarootdir was used explicitly but not set:
19180 $ac_seen" >&5
19181 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19182 $ac_seen" >&2;}
19183         ac_warn_datarootdir=yes
19184       fi
19185     done
19186   fi
19187
19188 if test "x$ac_warn_datarootdir" = xyes; then
19189   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19190 fi
19191
19192 EOF
19193 cat >>"$CONFIG_STATUS" <<EOF
19194   sed "$ac_vpsub
19195 $extrasub
19196 EOF
19197 cat >>"$CONFIG_STATUS" <<\EOF
19198 :t
19199 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19200 s,@configure_input@,$configure_input,;t t
19201 s,@srcdir@,$ac_srcdir,;t t
19202 s,@top_srcdir@,$ac_top_srcdir,;t t
19203 s,@INSTALL@,$ac_INSTALL,;t t
19204 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19205   rm -f "$tmp"/stdin
19206 EOF
19207 : "${FGREP:=grep -F}"
19208 : "${EGREP:=grep -E}"
19209 cat >>"$CONFIG_STATUS" <<EOF
19210   : "\${FGREP:=$FGREP}"
19211   : "\${EGREP:=$EGREP}"
19212 EOF
19213 cat >>"$CONFIG_STATUS" <<\EOF
19214   if test x"$ac_file" != x-; then
19215     cp "$tmp/out" "$ac_file"
19216
19217     for ac_name in prefix exec_prefix datarootdir
19218     do
19219         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19220         if test -n "$ac_seen"; then
19221             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19222             if test -z "$ac_init"; then
19223               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19224               { echo "$as_me:19224: WARNING: Variable $ac_name is used but was not set:
19225 $ac_seen" >&5
19226 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19227 $ac_seen" >&2;}
19228             fi
19229         fi
19230     done
19231     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19232     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19233     if test -s "$tmp"/out; then
19234       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19235       { echo "$as_me:19235: WARNING: Some variables may not be substituted:
19236 $ac_seen" >&5
19237 echo "$as_me: WARNING: Some variables may not be substituted:
19238 $ac_seen" >&2;}
19239     fi
19240   else
19241     cat "$tmp"/out
19242   fi
19243   rm -f "$tmp"/out
19244
19245 done
19246 EOF
19247 cat >>"$CONFIG_STATUS" <<\EOF
19248
19249 #
19250 # CONFIG_HEADER section.
19251 #
19252
19253 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19254 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19255 #
19256 # ac_d sets the value in "#define NAME VALUE" lines.
19257 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19258 ac_dB='[        ].*$,\1#\2'
19259 ac_dC=' '
19260 ac_dD=',;t'
19261 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19262 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19263 ac_iB='\([      ]\),\1#\2define\3'
19264 ac_iC=' '
19265 ac_iD='\4,;t'
19266 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19267 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19268 ac_uB='$,\1#\2define\3'
19269 ac_uC=' '
19270 ac_uD=',;t'
19271
19272 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19273   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19274   case "$ac_file" in
19275   - | *:- | *:-:* ) # input from stdin
19276         cat >"$tmp"/stdin
19277         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19278         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19279   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19280         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19281   * )   ac_file_in=$ac_file.in ;;
19282   esac
19283
19284   test x"$ac_file" != x- && { echo "$as_me:19284: creating $ac_file" >&5
19285 echo "$as_me: creating $ac_file" >&6;}
19286
19287   # First look for the input files in the build tree, otherwise in the
19288   # src tree.
19289   ac_file_inputs=`IFS=:
19290     for f in $ac_file_in; do
19291       case $f in
19292       -) echo "$tmp"/stdin ;;
19293       [\\/$]*)
19294          # Absolute (can't be DOS-style, as IFS=:)
19295          test -f "$f" || { { echo "$as_me:19295: error: cannot find input file: $f" >&5
19296 echo "$as_me: error: cannot find input file: $f" >&2;}
19297    { (exit 1); exit 1; }; }
19298          echo $f;;
19299       *) # Relative
19300          if test -f "$f"; then
19301            # Build tree
19302            echo $f
19303          elif test -f "$srcdir/$f"; then
19304            # Source tree
19305            echo "$srcdir/$f"
19306          else
19307            # /dev/null tree
19308            { { echo "$as_me:19308: error: cannot find input file: $f" >&5
19309 echo "$as_me: error: cannot find input file: $f" >&2;}
19310    { (exit 1); exit 1; }; }
19311          fi;;
19312       esac
19313     done` || { (exit 1); exit 1; }
19314   # Remove the trailing spaces.
19315   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19316
19317 EOF
19318
19319 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19320 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19321 # be either 'cat' or 'sort'.
19322 cat confdefs.h | uniq >conftest.vals
19323
19324 # Break up conftest.vals because some shells have a limit on
19325 # the size of here documents, and old seds have small limits too.
19326
19327 rm -f conftest.tail
19328 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19329 while grep . conftest.vals >/dev/null
19330 do
19331   # Write chunks of a limited-size here document to conftest.frag.
19332   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19333   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19334   echo 'CEOF' >> "$CONFIG_STATUS"
19335   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19336   rm -f conftest.vals
19337   mv conftest.tail conftest.vals
19338 done
19339 rm -f conftest.vals
19340
19341 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19342 # marker @DEFS@.
19343 echo '  cat >> conftest.edit <<CEOF
19344 /@DEFS@/r conftest.frag
19345 /@DEFS@/d
19346 CEOF
19347 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19348 rm -f "$tmp"/in
19349 mv "$tmp"/out "$tmp"/in
19350 rm -f conftest.edit conftest.frag
19351 ' >> "$CONFIG_STATUS"
19352
19353 cat >>"$CONFIG_STATUS" <<\EOF
19354   # Let's still pretend it is `configure' which instantiates (i.e., don't
19355   # use $as_me), people would be surprised to read:
19356   #    /* config.h.  Generated automatically by config.status.  */
19357   if test x"$ac_file" = x-; then
19358     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19359   else
19360     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19361   fi
19362   cat "$tmp"/in >>"$tmp"/config.h
19363   rm -f "$tmp"/in
19364   if test x"$ac_file" != x-; then
19365     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19366       { echo "$as_me:19366: $ac_file is unchanged" >&5
19367 echo "$as_me: $ac_file is unchanged" >&6;}
19368     else
19369       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19370          X"$ac_file" : 'X\(//\)[^/]' \| \
19371          X"$ac_file" : 'X\(//\)$' \| \
19372          X"$ac_file" : 'X\(/\)' \| \
19373          .     : '\(.\)' 2>/dev/null ||
19374 echo X"$ac_file" |
19375     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19376           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19377           /^X\(\/\/\)$/{ s//\1/; q; }
19378           /^X\(\/\).*/{ s//\1/; q; }
19379           s/.*/./; q'`
19380       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19381         { case "$ac_dir" in
19382   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19383   *)                      as_incr_dir=.;;
19384 esac
19385 as_dummy="$ac_dir"
19386 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19387   case $as_mkdir_dir in
19388     # Skip DOS drivespec
19389     ?:) as_incr_dir=$as_mkdir_dir ;;
19390     *)
19391       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19392       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19393     ;;
19394   esac
19395 done; }
19396
19397       fi
19398       rm -f "$ac_file"
19399       mv "$tmp/config.h" "$ac_file"
19400     fi
19401   else
19402     cat "$tmp"/config.h
19403     rm -f "$tmp"/config.h
19404   fi
19405 done
19406 EOF
19407 cat >>"$CONFIG_STATUS" <<\EOF
19408 #
19409 # CONFIG_COMMANDS section.
19410 #
19411 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19412   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19413   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19414
19415   case "$ac_dest" in
19416     default )
19417 $AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
19418 if test -z "$USE_OLD_MAKERULES" ; then
19419         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19420 fi
19421  ;;
19422   esac
19423 done
19424 EOF
19425
19426 cat >>"$CONFIG_STATUS" <<\EOF
19427
19428 { (exit 0); exit 0; }
19429 EOF
19430 chmod +x "$CONFIG_STATUS"
19431 ac_clean_files=$ac_clean_files_save
19432
19433 # configure is writing to config.log, and then calls config.status.
19434 # config.status does its own redirection, appending to config.log.
19435 # Unfortunately, on DOS this fails, as config.log is still kept open
19436 # by configure, so config.status won't be able to write to it; its
19437 # output is simply discarded.  So we exec the FD to /dev/null,
19438 # effectively closing config.log, so it can be properly (re)opened and
19439 # appended to by config.status.  When coming back to configure, we
19440 # need to make the FD available again.
19441 if test "$no_create" != yes; then
19442   ac_cs_success=:
19443   exec 5>/dev/null
19444   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19445   exec 5>>config.log
19446   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19447   # would make configure fail if this is the last instruction.
19448   "$ac_cs_success" || { (exit 1); exit 1; }
19449 fi
19450 ${MAKE:-make} preinstall