]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
fa45b3c493039653522f354169ea5afdac82467e
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.93 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20231210.
5 #
6 # Copyright 2003-2022,2023      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr="expr"
38 else
39   as_expr="false"
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s='ln'
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --without-ada           suppress check for Ada compiler
707   --disable-stripping     do not strip (debug info) installed executables
708   --with-strip-program=XX specify program to use when stripping in install
709   --with-pkg-config[=CMD] enable/disable use of pkg-config and its name CMD
710   --with-pkg-config-libdir[=XXX] use given directory for installing pc-files
711   --without-tests         suppress build with test-programs
712   --enable-mixed-case     tic should assume mixed-case filenames
713   --with-install-prefix   prefixes actual install-location ($DESTDIR)
714 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
715   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
716   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
717   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
718   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
719   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
720   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
721 Options to Specify the Libraries Built/Used:
722   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
723   --with-curses-dir=DIR   directory in which (n)curses is installed
724   --enable-widec          compile with wide-char/UTF-8 code
725   --with-lib-prefix       override library-prefix
726   --with-shlib-version[={rel|abi}] use release or ABI version in shared library file names
727   --enable-rpath-link     link sample programs with rpath option
728 Fine-Tuning Your Configuration:
729   --enable-broken_linker  compile with broken-linker support code
730   --disable-largefile     omit support for large files
731   --with-rcs-ids          compile-in RCS identifiers
732 Extensions:
733   --disable-ext-funcs     disable function-extensions
734   --enable-const          compile with extra/non-standard const
735 Development Code:
736   --without-develop       disable development options
737 Experimental Code:
738   --with-pthread          use POSIX thread library
739   --enable-weak-symbols   enable weak-symbols for pthreads
740   --enable-reentrant      compile with experimental reentrant code
741   --with-wrap-prefix=XXX  override prefix used for public variables
742 Testing/development Options:
743   --disable-echo          do not display "compiling" commands
744   --enable-warnings       test: turn on gcc compiler warnings
745   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
746   --enable-assertions     test: turn on generation of assertion code
747   --enable-expanded       test: generate functions for certain macros
748   --disable-macros        test: use functions rather than macros
749   --with-trace            test: add trace() function to all models of ncurses
750   --disable-gnat-projects test: disable GNAT projects even if usable
751 Ada95 Binding Options:
752   --with-ada-compiler[=CMD] use CMD as Ada95 compiler (default: gnatmake)
753   --with-ada-include=DIR  find Ada95 includes in DIR (default: PREFIX/share/ada/adainclude)
754   --with-ada-objects=DIR  find Ada95 objects in DIR (default: PREFIX/lib/ada/adalib)
755   --with-ada-sharedlib    build Ada95 shared library; requires GNAT project support
756   --with-ada-libname[=XXX]  use XXX as Ada95 library name
757
758 Some influential environment variables:
759   CC          C compiler command
760   CFLAGS      C compiler flags
761   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
762               nonstandard directory <lib dir>
763   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
764               headers in a nonstandard directory <include dir>
765   CPP         C preprocessor
766
767 Use these variables to override the choices made by `configure' or to help
768 it to find libraries and programs with nonstandard names/locations.
769
770 EOF
771 fi
772
773 if test "$ac_init_help" = "recursive"; then
774   # If there are subdirs, report their specific --help.
775   ac_popdir=`pwd`
776   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
777     cd "$ac_subdir"
778     # A "../" for each directory in /$ac_subdir.
779     ac_dots=`echo "$ac_subdir" |
780              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
781
782     case "$srcdir" in
783     .) # No --srcdir option.  We are building in place.
784       ac_sub_srcdir="$srcdir" ;;
785     [\\/]* | ?:[\\/]* ) # Absolute path.
786       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
787     *) # Relative path.
788       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
789     esac
790
791     # Check for guested configure; otherwise get Cygnus style configure.
792     if test -f "$ac_sub_srcdir/configure.gnu"; then
793       echo
794       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
795     elif test -f "$ac_sub_srcdir/configure"; then
796       echo
797       $SHELL "$ac_sub_srcdir/configure" --help=recursive
798     elif test -f "$ac_sub_srcdir/configure.ac" ||
799            test -f "$ac_sub_srcdir/configure.in"; then
800       echo
801       "$ac_configure" --help
802     else
803       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
804     fi
805     cd "$ac_popdir"
806   done
807 fi
808
809 test -n "$ac_init_help" && exit 0
810 if "$ac_init_version"; then
811   cat <<\EOF
812
813 Copyright 2003-2022,2023        Thomas E. Dickey
814 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
815 Free Software Foundation, Inc.
816 This configure script is free software; the Free Software Foundation
817 gives unlimited permission to copy, distribute and modify it.
818 EOF
819   exit 0
820 fi
821 exec 5>config.log
822 cat >&5 <<EOF
823 This file contains any messages produced by compilers while
824 running configure, to aid debugging if configure makes a mistake.
825
826 It was created by $as_me, which was
827 generated by GNU Autoconf 2.52.20231210.  Invocation command line was
828
829   $ $0 $@
830
831 EOF
832 {
833 cat <<_ASUNAME
834 ## ---------- ##
835 ## Platform.  ##
836 ## ---------- ##
837
838 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
839 uname -m = `(uname -m) 2>/dev/null || echo unknown`
840 uname -r = `(uname -r) 2>/dev/null || echo unknown`
841 uname -s = `(uname -s) 2>/dev/null || echo unknown`
842 uname -v = `(uname -v) 2>/dev/null || echo unknown`
843
844 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
845 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
846
847 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
848 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
849 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
850 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
851 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
852 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
853 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
854
855 PATH = $PATH
856
857 _ASUNAME
858 } >&5
859
860 cat >&5 <<EOF
861 ## ------------ ##
862 ## Core tests.  ##
863 ## ------------ ##
864
865 EOF
866
867 # Keep a trace of the command line.
868 # Strip out --no-create and --no-recursion so they do not pile up.
869 # Also quote any args containing shell meta-characters.
870 ac_configure_args=
871 ac_sep=
872 for ac_arg
873 do
874   case "$ac_arg" in
875   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
876   | --no-cr | --no-c) ;;
877   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
878   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
879   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
880     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
881     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
882     ac_sep=" " ;;
883   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
884      ac_sep=" " ;;
885   esac
886   # Get rid of the leading space.
887 done
888
889 # When interrupted or exit'd, cleanup temporary files, and complete
890 # config.log.  We remove comments because anyway the quotes in there
891 # would cause problems or look ugly.
892 trap 'exit_status=$?
893   # Save into config.log some information that might help in debugging.
894   echo >&5
895   echo "## ----------------- ##" >&5
896   echo "## Cache variables.  ##" >&5
897   echo "## ----------------- ##" >&5
898   echo >&5
899   # The following way of writing the cache mishandles newlines in values,
900 {
901   (set) 2>&1 |
902     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
903     *ac_space=\ *)
904       sed -n \
905         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
906           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
907       ;;
908     *)
909       sed -n \
910         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
911       ;;
912     esac;
913 } >&5
914   sed "/^$/d" confdefs.h >conftest.log
915   if test -s conftest.log; then
916     echo >&5
917     echo "## ------------ ##" >&5
918     echo "## confdefs.h.  ##" >&5
919     echo "## ------------ ##" >&5
920     echo >&5
921     cat conftest.log >&5
922   fi
923   (echo; echo) >&5
924   test "$ac_signal" != 0 &&
925     echo "$as_me: caught signal $ac_signal" >&5
926   echo "$as_me: exit $exit_status" >&5
927   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
928     exit $exit_status
929      ' 0
930 for ac_signal in 1 2 13 15; do
931   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
932 done
933 ac_signal=0
934
935 # confdefs.h avoids OS command line length limits that DEFS can exceed.
936 rm -rf conftest* confdefs.h
937 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
938 echo >confdefs.h
939
940 # Let the site file select an alternate cache file if it wants to.
941 # Prefer explicitly selected file to automatically selected ones.
942 if test -z "$CONFIG_SITE"; then
943   if test "x$prefix" != xNONE; then
944     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
945   else
946     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
947   fi
948 fi
949 for ac_site_file in $CONFIG_SITE; do
950   if test -r "$ac_site_file"; then
951     { echo "$as_me:951: loading site script $ac_site_file" >&5
952 echo "$as_me: loading site script $ac_site_file" >&6;}
953     cat "$ac_site_file" >&5
954     . "$ac_site_file"
955   fi
956 done
957
958 if test -r "$cache_file"; then
959   # Some versions of bash will fail to source /dev/null (special
960   # files actually), so we avoid doing that.
961   if test -f "$cache_file"; then
962     { echo "$as_me:962: loading cache $cache_file" >&5
963 echo "$as_me: loading cache $cache_file" >&6;}
964     case $cache_file in
965       [\\/]* | ?:[\\/]* ) . $cache_file;;
966       *)                      . ./$cache_file;;
967     esac
968   fi
969 else
970   { echo "$as_me:970: creating cache $cache_file" >&5
971 echo "$as_me: creating cache $cache_file" >&6;}
972   >$cache_file
973 fi
974
975 # Check that the precious variables saved in the cache have kept the same
976 # value.
977 ac_cache_corrupted=false
978 for ac_var in `(set) 2>&1 |
979                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
980   eval ac_old_set=\$ac_cv_env_${ac_var}_set
981   eval ac_new_set=\$ac_env_${ac_var}_set
982   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
983   eval ac_new_val="\$ac_env_${ac_var}_value"
984   case "$ac_old_set,$ac_new_set" in
985     set,)
986       { echo "$as_me:986: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
987 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
988       ac_cache_corrupted=: ;;
989     ,set)
990       { echo "$as_me:990: error: \`$ac_var' was not set in the previous run" >&5
991 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
992       ac_cache_corrupted=: ;;
993     ,);;
994     *)
995       if test "x$ac_old_val" != "x$ac_new_val"; then
996         { echo "$as_me:996: error: \`$ac_var' has changed since the previous run:" >&5
997 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
998         { echo "$as_me:998:   former value:  $ac_old_val" >&5
999 echo "$as_me:   former value:  $ac_old_val" >&2;}
1000         { echo "$as_me:1000:   current value: $ac_new_val" >&5
1001 echo "$as_me:   current value: $ac_new_val" >&2;}
1002         ac_cache_corrupted=:
1003       fi;;
1004   esac
1005   # Pass precious variables to config.status.  It doesn't matter if
1006   # we pass some twice (in addition to the command line arguments).
1007   if test "$ac_new_set" = set; then
1008     case "$ac_new_val" in
1009     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1010       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1011       ac_configure_args="$ac_configure_args '$ac_arg'"
1012       ;;
1013     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1014        ;;
1015     esac
1016   fi
1017 done
1018 if "$ac_cache_corrupted"; then
1019   { echo "$as_me:1019: error: changes in the environment can compromise the build" >&5
1020 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1021   { { echo "$as_me:1021: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1022 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1023    { (exit 1); exit 1; }; }
1024 fi
1025
1026 ac_ext=c
1027 ac_cpp='$CPP $CPPFLAGS'
1028 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1029 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1030 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1031 ac_main_return="return"
1032
1033 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1034   *c*,-n*) ECHO_N=
1035            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1036            ECHO_T='     '
1037            ;;
1038   *c*,*  ) ECHO_N=-n
1039            ECHO_C=
1040            ECHO_T=
1041            ;;
1042   *)       ECHO_N=
1043            ECHO_C='\c'
1044            ECHO_T=
1045            ;;
1046 esac
1047 echo "#! $SHELL" >conftest.sh
1048 echo  "exit 0"   >>conftest.sh
1049 chmod +x conftest.sh
1050 if { (echo "$as_me:1050: PATH=\".;.\"; conftest.sh") >&5
1051   (PATH=".;."; conftest.sh) 2>&5
1052   ac_status=$?
1053   echo "$as_me:1053: \$? = $ac_status" >&5
1054   (exit "$ac_status"); }; then
1055   ac_path_separator=';'
1056 else
1057   ac_path_separator=:
1058 fi
1059 PATH_SEPARATOR="$ac_path_separator"
1060 rm -f conftest.sh
1061
1062 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1063
1064 PACKAGE="AdaCurses"
1065
1066 top_builddir=`pwd`
1067
1068 ac_aux_dir=
1069 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1070   if test -f "$ac_dir/install-sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install-sh -c"
1073     break
1074   elif test -f "$ac_dir/install.sh"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/install.sh -c"
1077     break
1078   elif test -f "$ac_dir/shtool"; then
1079     ac_aux_dir=$ac_dir
1080     ac_install_sh="$ac_aux_dir/shtool install -c"
1081     break
1082   fi
1083 done
1084 if test -z "$ac_aux_dir"; then
1085   { { echo "$as_me:1085: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1086 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1087    { (exit 1); exit 1; }; }
1088 fi
1089 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1090 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1091 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1092
1093 # Make sure we can run config.sub.
1094 $ac_config_sub sun4 >/dev/null 2>&1 ||
1095   { { echo "$as_me:1095: error: cannot run $ac_config_sub" >&5
1096 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1097    { (exit 1); exit 1; }; }
1098
1099 echo "$as_me:1099: checking build system type" >&5
1100 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1101 if test "${ac_cv_build+set}" = set; then
1102   echo $ECHO_N "(cached) $ECHO_C" >&6
1103 else
1104   ac_cv_build_alias=$build_alias
1105 test -z "$ac_cv_build_alias" &&
1106   ac_cv_build_alias=`$ac_config_guess`
1107 test -z "$ac_cv_build_alias" &&
1108   { { echo "$as_me:1108: error: cannot guess build type; you must specify one" >&5
1109 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1110    { (exit 1); exit 1; }; }
1111 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1112   { { echo "$as_me:1112: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1113 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1114    { (exit 1); exit 1; }; }
1115
1116 fi
1117 echo "$as_me:1117: result: $ac_cv_build" >&5
1118 echo "${ECHO_T}$ac_cv_build" >&6
1119 build=$ac_cv_build
1120 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1121 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1122 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1123
1124 echo "$as_me:1124: checking host system type" >&5
1125 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1126 if test "${ac_cv_host+set}" = set; then
1127   echo $ECHO_N "(cached) $ECHO_C" >&6
1128 else
1129   ac_cv_host_alias=$host_alias
1130 test -z "$ac_cv_host_alias" &&
1131   ac_cv_host_alias=$ac_cv_build_alias
1132 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1133   { { echo "$as_me:1133: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1134 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1135    { (exit 1); exit 1; }; }
1136
1137 fi
1138 echo "$as_me:1138: result: $ac_cv_host" >&5
1139 echo "${ECHO_T}$ac_cv_host" >&6
1140 host=$ac_cv_host
1141 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1142 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1143 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1144
1145 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1146         echo "$as_me:1146: checking target system type" >&5
1147 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1148 if test "${ac_cv_target+set}" = set; then
1149   echo $ECHO_N "(cached) $ECHO_C" >&6
1150 else
1151   ac_cv_target_alias=$target_alias
1152 test "x$ac_cv_target_alias" = "x" &&
1153   ac_cv_target_alias=$ac_cv_host_alias
1154 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1155   { { echo "$as_me:1155: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1156 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1157    { (exit 1); exit 1; }; }
1158
1159 fi
1160 echo "$as_me:1160: result: $ac_cv_target" >&5
1161 echo "${ECHO_T}$ac_cv_target" >&6
1162 target=$ac_cv_target
1163 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1164 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1165 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1166
1167 # The aliases save the names the user supplied, while $host etc.
1168 # will get canonicalized.
1169 test -n "$target_alias" &&
1170   test "$program_prefix$program_suffix$program_transform_name" = \
1171     NONENONEs,x,x, &&
1172   program_prefix=${target_alias}-
1173         system_name="$host_os"
1174 else
1175         system_name="`(uname -s -r) 2>/dev/null`"
1176         if test -z "$system_name" ; then
1177                 system_name="`(hostname) 2>/dev/null`"
1178         fi
1179 fi
1180 test -n "$system_name" &&
1181 cat >>confdefs.h <<EOF
1182 #define SYSTEM_NAME "$system_name"
1183 EOF
1184
1185 if test "${cf_cv_system_name+set}" = set; then
1186   echo $ECHO_N "(cached) $ECHO_C" >&6
1187 else
1188   cf_cv_system_name="$system_name"
1189 fi
1190
1191 test -z "$system_name" && system_name="$cf_cv_system_name"
1192 test -n "$cf_cv_system_name" && echo "$as_me:1192: result: Configuring for $cf_cv_system_name" >&5
1193 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1194
1195 if test ".$system_name" != ".$cf_cv_system_name" ; then
1196         echo "$as_me:1196: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1197 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1198         { { echo "$as_me:1198: error: \"Please remove config.cache and try again.\"" >&5
1199 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1200    { (exit 1); exit 1; }; }
1201 fi
1202
1203 # Check whether --with-system-type or --without-system-type was given.
1204 if test "${with_system_type+set}" = set; then
1205   withval="$with_system_type"
1206   { echo "$as_me:1206: WARNING: overriding system type to $withval" >&5
1207 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1208         cf_cv_system_name=$withval
1209         host_os=$withval
1210
1211 fi;
1212
1213 ###     Save the given $CFLAGS to allow user-override.
1214 cf_user_CFLAGS="$CFLAGS"
1215
1216 ###     Default install-location
1217 for ac_prog in ggrep grep
1218 do
1219   # Extract the first word of "$ac_prog", so it can be a program name with args.
1220 set dummy $ac_prog; ac_word=$2
1221 echo "$as_me:1221: checking for $ac_word" >&5
1222 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1223 if test "${ac_cv_prog_GREP+set}" = set; then
1224   echo $ECHO_N "(cached) $ECHO_C" >&6
1225 else
1226   if test -n "$GREP"; then
1227   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1228 else
1229   ac_save_IFS=$IFS; IFS=$ac_path_separator
1230 ac_dummy="$PATH"
1231 for ac_dir in $ac_dummy; do
1232   IFS=$ac_save_IFS
1233   test -z "$ac_dir" && ac_dir=.
1234   $as_executable_p "$ac_dir/$ac_word" || continue
1235 ac_cv_prog_GREP="$ac_prog"
1236 echo "$as_me:1236: found $ac_dir/$ac_word" >&5
1237 break
1238 done
1239
1240 fi
1241 fi
1242 GREP=$ac_cv_prog_GREP
1243 if test -n "$GREP"; then
1244   echo "$as_me:1244: result: $GREP" >&5
1245 echo "${ECHO_T}$GREP" >&6
1246 else
1247   echo "$as_me:1247: result: no" >&5
1248 echo "${ECHO_T}no" >&6
1249 fi
1250
1251   test -n "$GREP" && break
1252 done
1253 test -n "$GREP" || GREP=": "
1254
1255 echo "$as_me:1255: checking for fgrep" >&5
1256 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1257 if test "${ac_cv_path_FGREP+set}" = set; then
1258   echo $ECHO_N "(cached) $ECHO_C" >&6
1259 else
1260   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1261    then ac_cv_path_FGREP="$GREP -F"
1262    else
1263      for ac_prog in gfgrep fgrep
1264 do
1265   # Extract the first word of "$ac_prog", so it can be a program name with args.
1266 set dummy $ac_prog; ac_word=$2
1267 echo "$as_me:1267: checking for $ac_word" >&5
1268 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1269 if test "${ac_cv_path_FGREP+set}" = set; then
1270   echo $ECHO_N "(cached) $ECHO_C" >&6
1271 else
1272   case $FGREP in
1273   [\\/]* | ?:[\\/]*)
1274   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1275   ;;
1276   *)
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   if $as_executable_p "$ac_dir/$ac_word"; then
1283    ac_cv_path_FGREP="$ac_dir/$ac_word"
1284    echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285    break
1286 fi
1287 done
1288
1289   ;;
1290 esac
1291 fi
1292 FGREP=$ac_cv_path_FGREP
1293
1294 if test -n "$FGREP"; then
1295   echo "$as_me:1295: result: $FGREP" >&5
1296 echo "${ECHO_T}$FGREP" >&6
1297 else
1298   echo "$as_me:1298: result: no" >&5
1299 echo "${ECHO_T}no" >&6
1300 fi
1301
1302   test -n "$FGREP" && break
1303 done
1304 test -n "$FGREP" || FGREP=": "
1305
1306      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1306: error: cannot find workable fgrep" >&5
1307 echo "$as_me: error: cannot find workable fgrep" >&2;}
1308    { (exit 1); exit 1; }; }
1309    fi
1310 fi
1311 echo "$as_me:1311: result: $ac_cv_path_FGREP" >&5
1312 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1313  FGREP="$ac_cv_path_FGREP"
1314
1315 echo "$as_me:1315: checking for prefix" >&5
1316 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1317 if test "x$prefix" = "xNONE" ; then
1318         case "$cf_cv_system_name" in
1319                 # non-vendor systems don't have a conflict
1320         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1321                 prefix=/usr
1322                 ;;
1323         (*)     prefix=$ac_default_prefix
1324                 ;;
1325         esac
1326 fi
1327 echo "$as_me:1327: result: $prefix" >&5
1328 echo "${ECHO_T}$prefix" >&6
1329
1330 if test "x$prefix" = "xNONE" ; then
1331 echo "$as_me:1331: checking for default include-directory" >&5
1332 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1333 test -n "$verbose" && echo 1>&6
1334 for cf_symbol in \
1335         "$includedir" \
1336         "$includedir/ncurses" \
1337         "$prefix/include" \
1338         "$prefix/include/ncurses" \
1339         /usr/local/include \
1340         /usr/local/include/ncurses \
1341         /usr/include \
1342         /usr/include/ncurses
1343 do
1344         cf_dir=`eval echo "$cf_symbol"`
1345         if test -f "$cf_dir/curses.h" ; then
1346         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1347                 includedir="$cf_symbol"
1348                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1349                 break
1350         fi
1351         fi
1352         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1353 done
1354 echo "$as_me:1354: result: $includedir" >&5
1355 echo "${ECHO_T}$includedir" >&6
1356 fi
1357
1358 ###     Checks for programs.
1359
1360 # Check whether --with-ada or --without-ada was given.
1361 if test "${with_ada+set}" = set; then
1362   withval="$with_ada"
1363   cf_with_ada=$withval
1364 else
1365   cf_with_ada=yes
1366 fi;
1367
1368 cf_prog_cc="gcc cc"
1369 if test "x$cf_with_ada" = xyes
1370 then
1371
1372 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
1373 do
1374
1375 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1376
1377         unset ac_cv_path_cf_TEMP_gnat
1378         unset cf_TEMP_gnat
1379         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
1380 set dummy $cf_prog_gnat; ac_word=$2
1381 echo "$as_me:1381: checking for $ac_word" >&5
1382 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1383 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
1384   echo $ECHO_N "(cached) $ECHO_C" >&6
1385 else
1386   case $cf_TEMP_gnat in
1387   [\\/]* | ?:[\\/]*)
1388   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
1389   ;;
1390   *)
1391   ac_save_IFS=$IFS; IFS=$ac_path_separator
1392 ac_dummy="$PATH"
1393 for ac_dir in $ac_dummy; do
1394   IFS=$ac_save_IFS
1395   test -z "$ac_dir" && ac_dir=.
1396   if $as_executable_p "$ac_dir/$ac_word"; then
1397    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
1398    echo "$as_me:1398: found $ac_dir/$ac_word" >&5
1399    break
1400 fi
1401 done
1402
1403   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
1404   ;;
1405 esac
1406 fi
1407 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
1408
1409 if test -n "$cf_TEMP_gnat"; then
1410   echo "$as_me:1410: result: $cf_TEMP_gnat" >&5
1411 echo "${ECHO_T}$cf_TEMP_gnat" >&6
1412 else
1413   echo "$as_me:1413: result: no" >&5
1414 echo "${ECHO_T}no" >&6
1415 fi
1416
1417         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
1418
1419         if test "x$cf_TEMP_gnat" != xno; then
1420                 unset cf_cv_gnat_version
1421                 unset cf_TEMP_gnat
1422
1423 echo "$as_me:1423: checking for $cf_prog_gnat version" >&5
1424 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
1425 if test "${cf_cv_gnat_version+set}" = set; then
1426   echo $ECHO_N "(cached) $ECHO_C" >&6
1427 else
1428
1429 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
1430         grep '[0-9].[0-9][0-9]*' |\
1431         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
1432
1433 fi
1434 echo "$as_me:1434: result: $cf_cv_gnat_version" >&5
1435 echo "${ECHO_T}$cf_cv_gnat_version" >&6
1436 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
1437 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
1438
1439         fi
1440         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
1441
1442         unset cf_TEMP_gnat
1443         unset cf_cv_gnat_version
1444         unset ac_cv_path_cf_TEMP_gnat
1445 done
1446
1447 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
1448         cf_ada_make=
1449         cf_cv_prog_gnat_correct=no
1450 else
1451         cf_ada_make=gnatmake
1452         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
1453                 # gprconfig is newer than gnatmake; we can continue...
1454                 cf_ada_config="##"
1455         else
1456                 rm -rf ./conftest* ./*~conftest*
1457                 if mkdir conftest.src
1458                 then
1459                         cf_ada_config=""
1460                         cd conftest.src
1461                         for cf_gprconfig in Ada C
1462                         do
1463                                 echo "$as_me:1463: checking for gprconfig name for $cf_gprconfig" >&5
1464 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
1465                                 if test "$cf_gprconfig" = C
1466                                 then
1467                                         for cf_gprconfig_param in \
1468                                                 "$cf_gprconfig,,,,GNATGCC" \
1469                                                 "$cf_gprconfig,,,,GCC" \
1470                                                 "$cf_gprconfig"
1471                                         do
1472                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
1473                                                 test -n "$cf_gprconfig_value" && break
1474                                         done
1475                                 else
1476                                         cf_gprconfig_param=$cf_gprconfig
1477                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
1478                                 fi
1479                                 if test -n "$cf_gprconfig_value"
1480                                 then
1481                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
1482                                         echo "$as_me:1482: result: $cf_gprconfig_value" >&5
1483 echo "${ECHO_T}$cf_gprconfig_value" >&6
1484                                 else
1485                                         echo "$as_me:1485: result: missing" >&5
1486 echo "${ECHO_T}missing" >&6
1487                                         cf_ada_config="#"
1488                                         break
1489                                 fi
1490                         done
1491                         cd ..
1492                         rm -rf ./conftest* ./*~conftest*
1493                 fi
1494         fi
1495         if test "x$cf_ada_config" != "x#"
1496         then
1497
1498 echo "$as_me:1498: checking for gnat version" >&5
1499 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
1500 if test "${cf_cv_gnat_version+set}" = set; then
1501   echo $ECHO_N "(cached) $ECHO_C" >&6
1502 else
1503
1504 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
1505         grep '[0-9].[0-9][0-9]*' |\
1506         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
1507
1508 fi
1509 echo "$as_me:1509: result: $cf_cv_gnat_version" >&5
1510 echo "${ECHO_T}$cf_cv_gnat_version" >&6
1511 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
1512
1513 case "$cf_cv_gnat_version" in
1514 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
1515         cf_cv_prog_gnat_correct=yes
1516         ;;
1517 (*)
1518         { echo "$as_me:1518: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
1519 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
1520         cf_cv_prog_gnat_correct=no
1521         ;;
1522 esac
1523
1524                 # Extract the first word of "m4", so it can be a program name with args.
1525 set dummy m4; ac_word=$2
1526 echo "$as_me:1526: checking for $ac_word" >&5
1527 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1528 if test "${ac_cv_prog_M4_exists+set}" = set; then
1529   echo $ECHO_N "(cached) $ECHO_C" >&6
1530 else
1531   if test -n "$M4_exists"; then
1532   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
1533 else
1534   ac_save_IFS=$IFS; IFS=$ac_path_separator
1535 ac_dummy="$PATH"
1536 for ac_dir in $ac_dummy; do
1537   IFS=$ac_save_IFS
1538   test -z "$ac_dir" && ac_dir=.
1539   $as_executable_p "$ac_dir/$ac_word" || continue
1540 ac_cv_prog_M4_exists="yes"
1541 echo "$as_me:1541: found $ac_dir/$ac_word" >&5
1542 break
1543 done
1544
1545   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
1546 fi
1547 fi
1548 M4_exists=$ac_cv_prog_M4_exists
1549 if test -n "$M4_exists"; then
1550   echo "$as_me:1550: result: $M4_exists" >&5
1551 echo "${ECHO_T}$M4_exists" >&6
1552 else
1553   echo "$as_me:1553: result: no" >&5
1554 echo "${ECHO_T}no" >&6
1555 fi
1556
1557                 if test "$ac_cv_prog_M4_exists" = no; then
1558                         cf_cv_prog_gnat_correct=no
1559                         { echo "$as_me:1559: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
1560 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
1561                 fi
1562                 if test "$cf_cv_prog_gnat_correct" = yes; then
1563                         echo "$as_me:1563: checking if GNAT works" >&5
1564 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
1565
1566 rm -rf ./conftest* ./*~conftest*
1567 cat >>conftest.ads <<CF_EOF
1568 procedure conftest;
1569 CF_EOF
1570 cat >>conftest.adb <<CF_EOF
1571 with Text_IO;
1572 with GNAT.OS_Lib;
1573 procedure conftest is
1574 begin
1575    Text_IO.Put ("Hello World");
1576    Text_IO.New_Line;
1577    GNAT.OS_Lib.OS_Exit (0);
1578 end conftest;
1579 CF_EOF
1580 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
1581    if ( ./conftest 1>&5 2>&1 ) ; then
1582       cf_cv_prog_gnat_correct=yes
1583    else
1584       cf_cv_prog_gnat_correct=no
1585    fi
1586 else
1587    cf_cv_prog_gnat_correct=no
1588 fi
1589 rm -rf ./conftest* ./*~conftest*
1590
1591                         echo "$as_me:1591: result: $cf_cv_prog_gnat_correct" >&5
1592 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
1593                 fi
1594         else
1595                 cf_cv_prog_gnat_correct=no
1596         fi
1597 fi
1598
1599         if test "x$cf_cv_prog_gnat_correct" = xyes; then
1600                 # gcc's developers chose to deprecate gnatgcc before making gprconfig
1601                 # work.  They replaced gnatgcc in gcc 13 with a script which spits out
1602                 # a warning offering advice which could never work.
1603                 #
1604                 # Here is a workaround.
1605                 # Extract the first word of "gnatgcc", so it can be a program name with args.
1606 set dummy gnatgcc; ac_word=$2
1607 echo "$as_me:1607: checking for $ac_word" >&5
1608 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1609 if test "${ac_cv_path_cf_cv_path_gnatgcc+set}" = set; then
1610   echo $ECHO_N "(cached) $ECHO_C" >&6
1611 else
1612   case $cf_cv_path_gnatgcc in
1613   [\\/]* | ?:[\\/]*)
1614   ac_cv_path_cf_cv_path_gnatgcc="$cf_cv_path_gnatgcc" # Let the user override the test with a path.
1615   ;;
1616   *)
1617   ac_save_IFS=$IFS; IFS=$ac_path_separator
1618 ac_dummy="$PATH"
1619 for ac_dir in $ac_dummy; do
1620   IFS=$ac_save_IFS
1621   test -z "$ac_dir" && ac_dir=.
1622   if $as_executable_p "$ac_dir/$ac_word"; then
1623    ac_cv_path_cf_cv_path_gnatgcc="$ac_dir/$ac_word"
1624    echo "$as_me:1624: found $ac_dir/$ac_word" >&5
1625    break
1626 fi
1627 done
1628
1629   test -z "$ac_cv_path_cf_cv_path_gnatgcc" && ac_cv_path_cf_cv_path_gnatgcc="no"
1630   ;;
1631 esac
1632 fi
1633 cf_cv_path_gnatgcc=$ac_cv_path_cf_cv_path_gnatgcc
1634
1635 if test -n "$cf_cv_path_gnatgcc"; then
1636   echo "$as_me:1636: result: $cf_cv_path_gnatgcc" >&5
1637 echo "${ECHO_T}$cf_cv_path_gnatgcc" >&6
1638 else
1639   echo "$as_me:1639: result: no" >&5
1640 echo "${ECHO_T}no" >&6
1641 fi
1642
1643                 if test "$cf_cv_path_gnatgcc" != no
1644                 then
1645                         echo "$as_me:1645: checking for improvement" >&5
1646 echo $ECHO_N "checking for improvement... $ECHO_C" >&6
1647                         cf_file_gnatgcc=`file -L "$cf_cv_path_gnatgcc" 2>/dev/null`
1648                         case "x$cf_file_gnatgcc" in
1649                         (*script*)
1650                                 cf_cv_path_gnatgcc=`sh -x "$cf_cv_path_gnatgcc" --version 2>&1 | grep -w exec | sed -e 's/^[    ]*+[    ]*//' -e 's/exec[       ]//' -e 's/ .*//'`
1651                                 ;;
1652                         (*)
1653                                 cf_cv_path_gnatgcc=no
1654                                 ;;
1655                         esac
1656                         echo "$as_me:1656: result: $cf_cv_path_gnatgcc" >&5
1657 echo "${ECHO_T}$cf_cv_path_gnatgcc" >&6
1658                         test "$cf_cv_path_gnatgcc" = no && cf_cv_path_gnatgcc=gnatgcc
1659                         cf_prog_cc="$cf_cv_path_gnatgcc $cf_prog_cc"
1660                 fi
1661         fi
1662 fi
1663 case "$cf_prog_cc" in
1664 (*/*)
1665         CC="$cf_prog_cc"
1666
1667         ;;
1668 (*)
1669
1670 ac_ext=c
1671 ac_cpp='$CPP $CPPFLAGS'
1672 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1673 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1674 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1675 ac_main_return="return"
1676 if test -n "$ac_tool_prefix"; then
1677   for ac_prog in $cf_prog_cc
1678   do
1679     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1680 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1681 echo "$as_me:1681: checking for $ac_word" >&5
1682 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1683 if test "${ac_cv_prog_CC+set}" = set; then
1684   echo $ECHO_N "(cached) $ECHO_C" >&6
1685 else
1686   if test -n "$CC"; then
1687   ac_cv_prog_CC="$CC" # Let the user override the test.
1688 else
1689   ac_save_IFS=$IFS; IFS=$ac_path_separator
1690 ac_dummy="$PATH"
1691 for ac_dir in $ac_dummy; do
1692   IFS=$ac_save_IFS
1693   test -z "$ac_dir" && ac_dir=.
1694   $as_executable_p "$ac_dir/$ac_word" || continue
1695 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1696 echo "$as_me:1696: found $ac_dir/$ac_word" >&5
1697 break
1698 done
1699
1700 fi
1701 fi
1702 CC=$ac_cv_prog_CC
1703 if test -n "$CC"; then
1704   echo "$as_me:1704: result: $CC" >&5
1705 echo "${ECHO_T}$CC" >&6
1706 else
1707   echo "$as_me:1707: result: no" >&5
1708 echo "${ECHO_T}no" >&6
1709 fi
1710
1711     test -n "$CC" && break
1712   done
1713 fi
1714 if test -z "$CC"; then
1715   ac_ct_CC=$CC
1716   for ac_prog in $cf_prog_cc
1717 do
1718   # Extract the first word of "$ac_prog", so it can be a program name with args.
1719 set dummy $ac_prog; ac_word=$2
1720 echo "$as_me:1720: checking for $ac_word" >&5
1721 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1722 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1723   echo $ECHO_N "(cached) $ECHO_C" >&6
1724 else
1725   if test -n "$ac_ct_CC"; then
1726   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1727 else
1728   ac_save_IFS=$IFS; IFS=$ac_path_separator
1729 ac_dummy="$PATH"
1730 for ac_dir in $ac_dummy; do
1731   IFS=$ac_save_IFS
1732   test -z "$ac_dir" && ac_dir=.
1733   $as_executable_p "$ac_dir/$ac_word" || continue
1734 ac_cv_prog_ac_ct_CC="$ac_prog"
1735 echo "$as_me:1735: found $ac_dir/$ac_word" >&5
1736 break
1737 done
1738
1739 fi
1740 fi
1741 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1742 if test -n "$ac_ct_CC"; then
1743   echo "$as_me:1743: result: $ac_ct_CC" >&5
1744 echo "${ECHO_T}$ac_ct_CC" >&6
1745 else
1746   echo "$as_me:1746: result: no" >&5
1747 echo "${ECHO_T}no" >&6
1748 fi
1749
1750   test -n "$ac_ct_CC" && break
1751 done
1752
1753   CC=$ac_ct_CC
1754 fi
1755
1756 test -z "$CC" && { { echo "$as_me:1756: error: no acceptable cc found in \$PATH" >&5
1757 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1758    { (exit 1); exit 1; }; }
1759
1760 # Provide some information about the compiler.
1761 echo "$as_me:1761:" \
1762      "checking for C compiler version" >&5
1763 ac_compiler=`set X $ac_compile; echo "$2"`
1764 { (eval echo "$as_me:1764: \"$ac_compiler --version </dev/null >&5\"") >&5
1765   (eval $ac_compiler --version </dev/null >&5) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit "$ac_status"); }
1769 { (eval echo "$as_me:1769: \"$ac_compiler -v </dev/null >&5\"") >&5
1770   (eval $ac_compiler -v </dev/null >&5) 2>&5
1771   ac_status=$?
1772   echo "$as_me:1772: \$? = $ac_status" >&5
1773   (exit "$ac_status"); }
1774 { (eval echo "$as_me:1774: \"$ac_compiler -V </dev/null >&5\"") >&5
1775   (eval $ac_compiler -V </dev/null >&5) 2>&5
1776   ac_status=$?
1777   echo "$as_me:1777: \$? = $ac_status" >&5
1778   (exit "$ac_status"); }
1779
1780 cat >"conftest.$ac_ext" <<_ACEOF
1781 #line 1781 "configure"
1782 #include "confdefs.h"
1783
1784 int
1785 main (void)
1786 {
1787
1788   ;
1789   return 0;
1790 }
1791 _ACEOF
1792 ac_clean_files_save=$ac_clean_files
1793 ac_clean_files="$ac_clean_files a.out a.exe"
1794 # Try to create an executable without -o first, disregard a.out.
1795 # It will help us diagnose broken compilers, and finding out an intuition
1796 # of exeext.
1797 echo "$as_me:1797: checking for C compiler default output" >&5
1798 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1799 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1800 if { (eval echo "$as_me:1800: \"$ac_link_default\"") >&5
1801   (eval $ac_link_default) 2>&5
1802   ac_status=$?
1803   echo "$as_me:1803: \$? = $ac_status" >&5
1804   (exit "$ac_status"); }; then
1805   # Find the output, starting from the most likely.  This scheme is
1806 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1807 # resort.
1808 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1809                 ls a.out conftest 2>/dev/null;
1810                 ls a.* conftest.* 2>/dev/null`; do
1811   case $ac_file in
1812     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1813     a.out ) # We found the default executable, but exeext='' is most
1814             # certainly right.
1815             break;;
1816     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1817           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1818           export ac_cv_exeext
1819           break;;
1820     * ) break;;
1821   esac
1822 done
1823 else
1824   echo "$as_me: failed program was:" >&5
1825 cat "conftest.$ac_ext" >&5
1826 { { echo "$as_me:1826: error: C compiler cannot create executables" >&5
1827 echo "$as_me: error: C compiler cannot create executables" >&2;}
1828    { (exit 77); exit 77; }; }
1829 fi
1830
1831 ac_exeext=$ac_cv_exeext
1832 echo "$as_me:1832: result: $ac_file" >&5
1833 echo "${ECHO_T}$ac_file" >&6
1834
1835 # Check the compiler produces executables we can run.  If not, either
1836 # the compiler is broken, or we cross compile.
1837 echo "$as_me:1837: checking whether the C compiler works" >&5
1838 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1839 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1840 # If not cross compiling, check that we can run a simple program.
1841 if test "$cross_compiling" != yes; then
1842   if { ac_try='./$ac_file'
1843   { (eval echo "$as_me:1843: \"$ac_try\"") >&5
1844   (eval $ac_try) 2>&5
1845   ac_status=$?
1846   echo "$as_me:1846: \$? = $ac_status" >&5
1847   (exit "$ac_status"); }; }; then
1848     cross_compiling=no
1849   else
1850     if test "$cross_compiling" = maybe; then
1851         cross_compiling=yes
1852     else
1853         { { echo "$as_me:1853: error: cannot run C compiled programs.
1854 If you meant to cross compile, use \`--host'." >&5
1855 echo "$as_me: error: cannot run C compiled programs.
1856 If you meant to cross compile, use \`--host'." >&2;}
1857    { (exit 1); exit 1; }; }
1858     fi
1859   fi
1860 fi
1861 echo "$as_me:1861: result: yes" >&5
1862 echo "${ECHO_T}yes" >&6
1863
1864 rm -f a.out a.exe "conftest$ac_cv_exeext"
1865 ac_clean_files=$ac_clean_files_save
1866 # Check the compiler produces executables we can run.  If not, either
1867 # the compiler is broken, or we cross compile.
1868 echo "$as_me:1868: checking whether we are cross compiling" >&5
1869 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1870 echo "$as_me:1870: result: $cross_compiling" >&5
1871 echo "${ECHO_T}$cross_compiling" >&6
1872
1873 echo "$as_me:1873: checking for executable suffix" >&5
1874 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1875 if { (eval echo "$as_me:1875: \"$ac_link\"") >&5
1876   (eval $ac_link) 2>&5
1877   ac_status=$?
1878   echo "$as_me:1878: \$? = $ac_status" >&5
1879   (exit "$ac_status"); }; then
1880   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1881 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1882 # work properly (i.e., refer to `conftest.exe'), while it won't with
1883 # `rm'.
1884 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1885   case $ac_file in
1886     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1887     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1888           export ac_cv_exeext
1889           break;;
1890     * ) break;;
1891   esac
1892 done
1893 else
1894   { { echo "$as_me:1894: error: cannot compute EXEEXT: cannot compile and link" >&5
1895 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1896    { (exit 1); exit 1; }; }
1897 fi
1898
1899 rm -f "conftest$ac_cv_exeext"
1900 echo "$as_me:1900: result: $ac_cv_exeext" >&5
1901 echo "${ECHO_T}$ac_cv_exeext" >&6
1902
1903 rm -f "conftest.$ac_ext"
1904 EXEEXT=$ac_cv_exeext
1905 ac_exeext=$EXEEXT
1906 echo "$as_me:1906: checking for object suffix" >&5
1907 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1908 if test "${ac_cv_objext+set}" = set; then
1909   echo $ECHO_N "(cached) $ECHO_C" >&6
1910 else
1911   cat >"conftest.$ac_ext" <<_ACEOF
1912 #line 1912 "configure"
1913 #include "confdefs.h"
1914
1915 int
1916 main (void)
1917 {
1918
1919   ;
1920   return 0;
1921 }
1922 _ACEOF
1923 rm -f conftest.o conftest.obj
1924 if { (eval echo "$as_me:1924: \"$ac_compile\"") >&5
1925   (eval $ac_compile) 2>&5
1926   ac_status=$?
1927   echo "$as_me:1927: \$? = $ac_status" >&5
1928   (exit "$ac_status"); }; then
1929   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1930   case $ac_file in
1931     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1932     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1933        break;;
1934   esac
1935 done
1936 else
1937   echo "$as_me: failed program was:" >&5
1938 cat "conftest.$ac_ext" >&5
1939 { { echo "$as_me:1939: error: cannot compute OBJEXT: cannot compile" >&5
1940 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1941    { (exit 1); exit 1; }; }
1942 fi
1943
1944 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1945 fi
1946 echo "$as_me:1946: result: $ac_cv_objext" >&5
1947 echo "${ECHO_T}$ac_cv_objext" >&6
1948 OBJEXT=$ac_cv_objext
1949 ac_objext=$OBJEXT
1950 echo "$as_me:1950: checking whether we are using the GNU C compiler" >&5
1951 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1952 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1953   echo $ECHO_N "(cached) $ECHO_C" >&6
1954 else
1955   cat >"conftest.$ac_ext" <<_ACEOF
1956 #line 1956 "configure"
1957 #include "confdefs.h"
1958
1959 int
1960 main (void)
1961 {
1962 #ifndef __GNUC__
1963        choke me
1964 #endif
1965
1966   ;
1967   return 0;
1968 }
1969 _ACEOF
1970 rm -f "conftest.$ac_objext"
1971 if { (eval echo "$as_me:1971: \"$ac_compile\"") >&5
1972   (eval $ac_compile) 2>&5
1973   ac_status=$?
1974   echo "$as_me:1974: \$? = $ac_status" >&5
1975   (exit "$ac_status"); } &&
1976          { ac_try='test -s "conftest.$ac_objext"'
1977   { (eval echo "$as_me:1977: \"$ac_try\"") >&5
1978   (eval $ac_try) 2>&5
1979   ac_status=$?
1980   echo "$as_me:1980: \$? = $ac_status" >&5
1981   (exit "$ac_status"); }; }; then
1982   ac_compiler_gnu=yes
1983 else
1984   echo "$as_me: failed program was:" >&5
1985 cat "conftest.$ac_ext" >&5
1986 ac_compiler_gnu=no
1987 fi
1988 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1989 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1990
1991 fi
1992 echo "$as_me:1992: result: $ac_cv_c_compiler_gnu" >&5
1993 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1994 GCC=`test $ac_compiler_gnu = yes && echo yes`
1995 ac_test_CFLAGS=${CFLAGS+set}
1996 ac_save_CFLAGS=$CFLAGS
1997 CFLAGS="-g"
1998 echo "$as_me:1998: checking whether $CC accepts -g" >&5
1999 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
2000 if test "${ac_cv_prog_cc_g+set}" = set; then
2001   echo $ECHO_N "(cached) $ECHO_C" >&6
2002 else
2003   cat >"conftest.$ac_ext" <<_ACEOF
2004 #line 2004 "configure"
2005 #include "confdefs.h"
2006
2007 int
2008 main (void)
2009 {
2010
2011   ;
2012   return 0;
2013 }
2014 _ACEOF
2015 rm -f "conftest.$ac_objext"
2016 if { (eval echo "$as_me:2016: \"$ac_compile\"") >&5
2017   (eval $ac_compile) 2>&5
2018   ac_status=$?
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit "$ac_status"); } &&
2021          { ac_try='test -s "conftest.$ac_objext"'
2022   { (eval echo "$as_me:2022: \"$ac_try\"") >&5
2023   (eval $ac_try) 2>&5
2024   ac_status=$?
2025   echo "$as_me:2025: \$? = $ac_status" >&5
2026   (exit "$ac_status"); }; }; then
2027   ac_cv_prog_cc_g=yes
2028 else
2029   echo "$as_me: failed program was:" >&5
2030 cat "conftest.$ac_ext" >&5
2031 ac_cv_prog_cc_g=no
2032 fi
2033 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2034 fi
2035 echo "$as_me:2035: result: $ac_cv_prog_cc_g" >&5
2036 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
2037 if test "$ac_test_CFLAGS" = set; then
2038   CFLAGS=$ac_save_CFLAGS
2039 elif test $ac_cv_prog_cc_g = yes; then
2040   if test "$GCC" = yes; then
2041     CFLAGS="-g -O2"
2042   else
2043     CFLAGS="-g"
2044   fi
2045 else
2046   if test "$GCC" = yes; then
2047     CFLAGS="-O2"
2048   else
2049     CFLAGS=
2050   fi
2051 fi
2052 # Some people use a C++ compiler to compile C.  Since we use `exit',
2053 # in C++ we need to declare it.  In case someone uses the same compiler
2054 # for both compiling C and C++ we need to have the C++ compiler decide
2055 # the declaration of exit, since it's the most demanding environment.
2056 cat >"conftest.$ac_ext" <<_ACEOF
2057 #ifndef __cplusplus
2058   choke me
2059 #endif
2060 _ACEOF
2061 rm -f "conftest.$ac_objext"
2062 if { (eval echo "$as_me:2062: \"$ac_compile\"") >&5
2063   (eval $ac_compile) 2>&5
2064   ac_status=$?
2065   echo "$as_me:2065: \$? = $ac_status" >&5
2066   (exit "$ac_status"); } &&
2067          { ac_try='test -s "conftest.$ac_objext"'
2068   { (eval echo "$as_me:2068: \"$ac_try\"") >&5
2069   (eval $ac_try) 2>&5
2070   ac_status=$?
2071   echo "$as_me:2071: \$? = $ac_status" >&5
2072   (exit "$ac_status"); }; }; then
2073   for ac_declaration in \
2074    ''\
2075    '#include <stdlib.h>' \
2076    'extern "C" void std::exit (int) throw (); using std::exit;' \
2077    'extern "C" void std::exit (int); using std::exit;' \
2078    'extern "C" void exit (int) throw ();' \
2079    'extern "C" void exit (int);' \
2080    'void exit (int);'
2081 do
2082   cat >"conftest.$ac_ext" <<_ACEOF
2083 #line 2083 "configure"
2084 #include "confdefs.h"
2085 #include <stdlib.h>
2086 $ac_declaration
2087 int
2088 main (void)
2089 {
2090 exit (42);
2091   ;
2092   return 0;
2093 }
2094 _ACEOF
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   :
2108 else
2109   echo "$as_me: failed program was:" >&5
2110 cat "conftest.$ac_ext" >&5
2111 continue
2112 fi
2113 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2114   cat >"conftest.$ac_ext" <<_ACEOF
2115 #line 2115 "configure"
2116 #include "confdefs.h"
2117 $ac_declaration
2118 int
2119 main (void)
2120 {
2121 exit (42);
2122   ;
2123   return 0;
2124 }
2125 _ACEOF
2126 rm -f "conftest.$ac_objext"
2127 if { (eval echo "$as_me:2127: \"$ac_compile\"") >&5
2128   (eval $ac_compile) 2>&5
2129   ac_status=$?
2130   echo "$as_me:2130: \$? = $ac_status" >&5
2131   (exit "$ac_status"); } &&
2132          { ac_try='test -s "conftest.$ac_objext"'
2133   { (eval echo "$as_me:2133: \"$ac_try\"") >&5
2134   (eval $ac_try) 2>&5
2135   ac_status=$?
2136   echo "$as_me:2136: \$? = $ac_status" >&5
2137   (exit "$ac_status"); }; }; then
2138   break
2139 else
2140   echo "$as_me: failed program was:" >&5
2141 cat "conftest.$ac_ext" >&5
2142 fi
2143 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2144 done
2145 rm -rf conftest*
2146 if test -n "$ac_declaration"; then
2147   echo '#ifdef __cplusplus' >>confdefs.h
2148   echo "$ac_declaration"    >>confdefs.h
2149   echo '#endif'             >>confdefs.h
2150 fi
2151
2152 else
2153   echo "$as_me: failed program was:" >&5
2154 cat "conftest.$ac_ext" >&5
2155 fi
2156 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2157 ac_ext=c
2158 ac_cpp='$CPP $CPPFLAGS'
2159 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2160 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2161 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2162 ac_main_return="return"
2163
2164 GCC_VERSION=none
2165 if test "$GCC" = yes ; then
2166         echo "$as_me:2166: checking version of $CC" >&5
2167 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
2168         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^[^(]*([^)][^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
2169         test -z "$GCC_VERSION" && GCC_VERSION=unknown
2170         echo "$as_me:2170: result: $GCC_VERSION" >&5
2171 echo "${ECHO_T}$GCC_VERSION" >&6
2172 fi
2173
2174 INTEL_COMPILER=no
2175
2176 if test "$GCC" = yes ; then
2177         case "$host_os" in
2178         (linux*|gnu*)
2179                 echo "$as_me:2179: checking if this is really Intel C compiler" >&5
2180 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
2181                 cf_save_CFLAGS="$CFLAGS"
2182                 CFLAGS="$CFLAGS -no-gcc"
2183                 cat >"conftest.$ac_ext" <<_ACEOF
2184 #line 2184 "configure"
2185 #include "confdefs.h"
2186
2187 int
2188 main (void)
2189 {
2190
2191 #ifdef __INTEL_COMPILER
2192 #else
2193 #error __INTEL_COMPILER is not defined
2194 #endif
2195
2196   ;
2197   return 0;
2198 }
2199 _ACEOF
2200 rm -f "conftest.$ac_objext"
2201 if { (eval echo "$as_me:2201: \"$ac_compile\"") >&5
2202   (eval $ac_compile) 2>&5
2203   ac_status=$?
2204   echo "$as_me:2204: \$? = $ac_status" >&5
2205   (exit "$ac_status"); } &&
2206          { ac_try='test -s "conftest.$ac_objext"'
2207   { (eval echo "$as_me:2207: \"$ac_try\"") >&5
2208   (eval $ac_try) 2>&5
2209   ac_status=$?
2210   echo "$as_me:2210: \$? = $ac_status" >&5
2211   (exit "$ac_status"); }; }; then
2212   INTEL_COMPILER=yes
2213 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
2214
2215 else
2216   echo "$as_me: failed program was:" >&5
2217 cat "conftest.$ac_ext" >&5
2218 fi
2219 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2220                 CFLAGS="$cf_save_CFLAGS"
2221                 echo "$as_me:2221: result: $INTEL_COMPILER" >&5
2222 echo "${ECHO_T}$INTEL_COMPILER" >&6
2223                 ;;
2224         esac
2225 fi
2226
2227 CLANG_COMPILER=no
2228
2229 if test "$GCC" = yes ; then
2230         echo "$as_me:2230: checking if this is really Clang C compiler" >&5
2231 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
2232         cf_save_CFLAGS="$CFLAGS"
2233         cat >"conftest.$ac_ext" <<_ACEOF
2234 #line 2234 "configure"
2235 #include "confdefs.h"
2236
2237 int
2238 main (void)
2239 {
2240
2241 #ifdef __clang__
2242 #else
2243 #error __clang__ is not defined
2244 #endif
2245
2246   ;
2247   return 0;
2248 }
2249 _ACEOF
2250 rm -f "conftest.$ac_objext"
2251 if { (eval echo "$as_me:2251: \"$ac_compile\"") >&5
2252   (eval $ac_compile) 2>&5
2253   ac_status=$?
2254   echo "$as_me:2254: \$? = $ac_status" >&5
2255   (exit "$ac_status"); } &&
2256          { ac_try='test -s "conftest.$ac_objext"'
2257   { (eval echo "$as_me:2257: \"$ac_try\"") >&5
2258   (eval $ac_try) 2>&5
2259   ac_status=$?
2260   echo "$as_me:2260: \$? = $ac_status" >&5
2261   (exit "$ac_status"); }; }; then
2262   CLANG_COMPILER=yes
2263
2264 else
2265   echo "$as_me: failed program was:" >&5
2266 cat "conftest.$ac_ext" >&5
2267 fi
2268 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2269         CFLAGS="$cf_save_CFLAGS"
2270         echo "$as_me:2270: result: $CLANG_COMPILER" >&5
2271 echo "${ECHO_T}$CLANG_COMPILER" >&6
2272 fi
2273
2274 CLANG_VERSION=none
2275
2276 if test "x$CLANG_COMPILER" = "xyes" ; then
2277         case "$CC" in
2278         (c[1-9][0-9]|*/c[1-9][0-9])
2279                 { echo "$as_me:2279: WARNING: replacing broken compiler alias $CC" >&5
2280 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
2281                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
2282                 CC=clang
2283                 ;;
2284         esac
2285
2286         echo "$as_me:2286: checking version of $CC" >&5
2287 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
2288         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.].*//'`"
2289         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
2290         echo "$as_me:2290: result: $CLANG_VERSION" >&5
2291 echo "${ECHO_T}$CLANG_VERSION" >&6
2292
2293         for cf_clang_opt in \
2294                 -Qunused-arguments \
2295                 -Wno-error=implicit-function-declaration
2296         do
2297                 echo "$as_me:2297: checking if option $cf_clang_opt works" >&5
2298 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
2299                 cf_save_CFLAGS="$CFLAGS"
2300                 CFLAGS="$CFLAGS $cf_clang_opt"
2301                 cat >"conftest.$ac_ext" <<_ACEOF
2302 #line 2302 "configure"
2303 #include "confdefs.h"
2304
2305                         #include <stdio.h>
2306 int
2307 main (void)
2308 {
2309
2310                         printf("hello!\\n");
2311   ;
2312   return 0;
2313 }
2314 _ACEOF
2315 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2316 if { (eval echo "$as_me:2316: \"$ac_link\"") >&5
2317   (eval $ac_link) 2>&5
2318   ac_status=$?
2319   echo "$as_me:2319: \$? = $ac_status" >&5
2320   (exit "$ac_status"); } &&
2321          { ac_try='test -s "conftest$ac_exeext"'
2322   { (eval echo "$as_me:2322: \"$ac_try\"") >&5
2323   (eval $ac_try) 2>&5
2324   ac_status=$?
2325   echo "$as_me:2325: \$? = $ac_status" >&5
2326   (exit "$ac_status"); }; }; then
2327
2328                         cf_clang_optok=yes
2329 else
2330   echo "$as_me: failed program was:" >&5
2331 cat "conftest.$ac_ext" >&5
2332
2333                         cf_clang_optok=no
2334 fi
2335 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2336                 echo "$as_me:2336: result: $cf_clang_optok" >&5
2337 echo "${ECHO_T}$cf_clang_optok" >&6
2338                 CFLAGS="$cf_save_CFLAGS"
2339                 if test "$cf_clang_optok" = yes; then
2340                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2341
2342 echo "${as_me:-configure}:2342: testing adding option $cf_clang_opt ..." 1>&5
2343
2344         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2345         CFLAGS="${CFLAGS}$cf_clang_opt"
2346
2347                 fi
2348         done
2349 fi
2350
2351 echo "$as_me:2351: checking for $CC option to accept ANSI C" >&5
2352 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2353 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2354   echo $ECHO_N "(cached) $ECHO_C" >&6
2355 else
2356   ac_cv_prog_cc_stdc=no
2357 ac_save_CC=$CC
2358 cat >"conftest.$ac_ext" <<_ACEOF
2359 #line 2359 "configure"
2360 #include "confdefs.h"
2361 #include <stdarg.h>
2362 #include <stdio.h>
2363 #include <sys/types.h>
2364 #include <sys/stat.h>
2365 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2366 struct buf { int x; };
2367 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2368 static char *e (char **p, int i)
2369 {
2370   return p[i];
2371 }
2372 static char *f (char * (*g) (char **, int), char **p, ...)
2373 {
2374   char *s;
2375   va_list v;
2376   va_start (v,p);
2377   s = g (p, va_arg (v,int));
2378   va_end (v);
2379   return s;
2380 }
2381 int test (int i, double x);
2382 struct s1 {int (*f) (int a);};
2383 struct s2 {int (*f) (double a);};
2384 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2385 int argc;
2386 char **argv;
2387 int
2388 main (void)
2389 {
2390 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2391   ;
2392   return 0;
2393 }
2394 _ACEOF
2395 # Don't try gcc -ansi; that turns off useful extensions and
2396 # breaks some systems' header files.
2397 # AIX                   -qlanglvl=ansi
2398 # Ultrix and OSF/1      -std1
2399 # HP-UX 10.20 and later -Ae
2400 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2401 # SVR4                  -Xc -D__EXTENSIONS__
2402 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2403 do
2404   CC="$ac_save_CC $ac_arg"
2405   rm -f "conftest.$ac_objext"
2406 if { (eval echo "$as_me:2406: \"$ac_compile\"") >&5
2407   (eval $ac_compile) 2>&5
2408   ac_status=$?
2409   echo "$as_me:2409: \$? = $ac_status" >&5
2410   (exit "$ac_status"); } &&
2411          { ac_try='test -s "conftest.$ac_objext"'
2412   { (eval echo "$as_me:2412: \"$ac_try\"") >&5
2413   (eval $ac_try) 2>&5
2414   ac_status=$?
2415   echo "$as_me:2415: \$? = $ac_status" >&5
2416   (exit "$ac_status"); }; }; then
2417   ac_cv_prog_cc_stdc=$ac_arg
2418 break
2419 else
2420   echo "$as_me: failed program was:" >&5
2421 cat "conftest.$ac_ext" >&5
2422 fi
2423 rm -f "conftest.$ac_objext"
2424 done
2425 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2426 CC=$ac_save_CC
2427
2428 fi
2429
2430 case "x$ac_cv_prog_cc_stdc" in
2431   x|xno)
2432     echo "$as_me:2432: result: none needed" >&5
2433 echo "${ECHO_T}none needed" >&6 ;;
2434   *)
2435     echo "$as_me:2435: result: $ac_cv_prog_cc_stdc" >&5
2436 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2437     CC="$CC $ac_cv_prog_cc_stdc" ;;
2438 esac
2439
2440 # This should have been defined by AC_PROG_CC
2441 : "${CC:=cc}"
2442
2443 echo "$as_me:2443: checking \$CFLAGS variable" >&5
2444 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2445 case "x$CFLAGS" in
2446 (*-[IUD]*)
2447         echo "$as_me:2447: result: broken" >&5
2448 echo "${ECHO_T}broken" >&6
2449         { echo "$as_me:2449: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2450 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2451         cf_flags="$CFLAGS"
2452         CFLAGS=
2453         for cf_arg in $cf_flags
2454         do
2455
2456 cf_fix_cppflags=no
2457 cf_new_cflags=
2458 cf_new_cppflags=
2459 cf_new_extra_cppflags=
2460
2461 for cf_add_cflags in $cf_arg
2462 do
2463 case "$cf_fix_cppflags" in
2464 (no)
2465         case "$cf_add_cflags" in
2466         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2467                 case "$cf_add_cflags" in
2468                 (-D*)
2469                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2470
2471                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2472                                 && test -z "${cf_tst_cflags}" \
2473                                 && cf_fix_cppflags=yes
2474
2475                         if test "$cf_fix_cppflags" = yes ; then
2476
2477         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2478         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2479
2480                                 continue
2481                         elif test "${cf_tst_cflags}" = "\"'" ; then
2482
2483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2485
2486                                 continue
2487                         fi
2488                         ;;
2489                 esac
2490                 case "$CPPFLAGS" in
2491                 (*$cf_add_cflags)
2492                         ;;
2493                 (*)
2494                         case "$cf_add_cflags" in
2495                         (-D*)
2496                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2497
2498 CPPFLAGS=`echo "$CPPFLAGS" | \
2499         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2500                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2501
2502                                 ;;
2503                         esac
2504
2505         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2506         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2507
2508                         ;;
2509                 esac
2510                 ;;
2511         (*)
2512
2513         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2514         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2515
2516                 ;;
2517         esac
2518         ;;
2519 (yes)
2520
2521         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2522         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2523
2524         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2525
2526         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2527                 && test -z "${cf_tst_cflags}" \
2528                 && cf_fix_cppflags=no
2529         ;;
2530 esac
2531 done
2532
2533 if test -n "$cf_new_cflags" ; then
2534
2535         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2536         CFLAGS="${CFLAGS}$cf_new_cflags"
2537
2538 fi
2539
2540 if test -n "$cf_new_cppflags" ; then
2541
2542         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2543         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2544
2545 fi
2546
2547 if test -n "$cf_new_extra_cppflags" ; then
2548
2549         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2550         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2551
2552 fi
2553
2554         done
2555         ;;
2556 (*)
2557         echo "$as_me:2557: result: ok" >&5
2558 echo "${ECHO_T}ok" >&6
2559         ;;
2560 esac
2561
2562 echo "$as_me:2562: checking \$CC variable" >&5
2563 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2564 case "$CC" in
2565 (*[\ \  ]-*)
2566         echo "$as_me:2566: result: broken" >&5
2567 echo "${ECHO_T}broken" >&6
2568         { echo "$as_me:2568: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2569 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2570         # humor him...
2571         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2572         cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"`
2573         CC="$cf_prog"
2574         for cf_arg in $cf_flags
2575         do
2576                 case "x$cf_arg" in
2577                 (x-[IUDfgOW]*)
2578
2579 cf_fix_cppflags=no
2580 cf_new_cflags=
2581 cf_new_cppflags=
2582 cf_new_extra_cppflags=
2583
2584 for cf_add_cflags in $cf_arg
2585 do
2586 case "$cf_fix_cppflags" in
2587 (no)
2588         case "$cf_add_cflags" in
2589         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2590                 case "$cf_add_cflags" in
2591                 (-D*)
2592                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2593
2594                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2595                                 && test -z "${cf_tst_cflags}" \
2596                                 && cf_fix_cppflags=yes
2597
2598                         if test "$cf_fix_cppflags" = yes ; then
2599
2600         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2601         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2602
2603                                 continue
2604                         elif test "${cf_tst_cflags}" = "\"'" ; then
2605
2606         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2607         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2608
2609                                 continue
2610                         fi
2611                         ;;
2612                 esac
2613                 case "$CPPFLAGS" in
2614                 (*$cf_add_cflags)
2615                         ;;
2616                 (*)
2617                         case "$cf_add_cflags" in
2618                         (-D*)
2619                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2620
2621 CPPFLAGS=`echo "$CPPFLAGS" | \
2622         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2623                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2624
2625                                 ;;
2626                         esac
2627
2628         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2629         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2630
2631                         ;;
2632                 esac
2633                 ;;
2634         (*)
2635
2636         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2637         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2638
2639                 ;;
2640         esac
2641         ;;
2642 (yes)
2643
2644         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2645         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2646
2647         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2648
2649         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2650                 && test -z "${cf_tst_cflags}" \
2651                 && cf_fix_cppflags=no
2652         ;;
2653 esac
2654 done
2655
2656 if test -n "$cf_new_cflags" ; then
2657
2658         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2659         CFLAGS="${CFLAGS}$cf_new_cflags"
2660
2661 fi
2662
2663 if test -n "$cf_new_cppflags" ; then
2664
2665         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2666         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2667
2668 fi
2669
2670 if test -n "$cf_new_extra_cppflags" ; then
2671
2672         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2673         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2674
2675 fi
2676
2677                         ;;
2678                 (*)
2679                         CC="$CC $cf_arg"
2680                         ;;
2681                 esac
2682         done
2683         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2684
2685 echo "${as_me:-configure}:2685: testing resulting CC: '$CC' ..." 1>&5
2686
2687         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2688
2689 echo "${as_me:-configure}:2689: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2690
2691         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2692
2693 echo "${as_me:-configure}:2693: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2694
2695         ;;
2696 (*)
2697         echo "$as_me:2697: result: ok" >&5
2698 echo "${ECHO_T}ok" >&6
2699         ;;
2700 esac
2701
2702         ;;
2703 esac
2704
2705 echo "$as_me:2705: checking for egrep" >&5
2706 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2707 if test "${ac_cv_path_EGREP+set}" = set; then
2708   echo $ECHO_N "(cached) $ECHO_C" >&6
2709 else
2710   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2711    then ac_cv_path_EGREP="$GREP -E"
2712    else
2713      for ac_prog in gegrep egrep
2714 do
2715   # Extract the first word of "$ac_prog", so it can be a program name with args.
2716 set dummy $ac_prog; ac_word=$2
2717 echo "$as_me:2717: checking for $ac_word" >&5
2718 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2719 if test "${ac_cv_path_EGREP+set}" = set; then
2720   echo $ECHO_N "(cached) $ECHO_C" >&6
2721 else
2722   case $EGREP in
2723   [\\/]* | ?:[\\/]*)
2724   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2725   ;;
2726   *)
2727   ac_save_IFS=$IFS; IFS=$ac_path_separator
2728 ac_dummy="$PATH"
2729 for ac_dir in $ac_dummy; do
2730   IFS=$ac_save_IFS
2731   test -z "$ac_dir" && ac_dir=.
2732   if $as_executable_p "$ac_dir/$ac_word"; then
2733    ac_cv_path_EGREP="$ac_dir/$ac_word"
2734    echo "$as_me:2734: found $ac_dir/$ac_word" >&5
2735    break
2736 fi
2737 done
2738
2739   ;;
2740 esac
2741 fi
2742 EGREP=$ac_cv_path_EGREP
2743
2744 if test -n "$EGREP"; then
2745   echo "$as_me:2745: result: $EGREP" >&5
2746 echo "${ECHO_T}$EGREP" >&6
2747 else
2748   echo "$as_me:2748: result: no" >&5
2749 echo "${ECHO_T}no" >&6
2750 fi
2751
2752   test -n "$EGREP" && break
2753 done
2754 test -n "$EGREP" || EGREP=": "
2755
2756      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2756: error: cannot find workable egrep" >&5
2757 echo "$as_me: error: cannot find workable egrep" >&2;}
2758    { (exit 1); exit 1; }; }
2759    fi
2760 fi
2761 echo "$as_me:2761: result: $ac_cv_path_EGREP" >&5
2762 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2763  EGREP="$ac_cv_path_EGREP"
2764
2765 ac_ext=c
2766 ac_cpp='$CPP $CPPFLAGS'
2767 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2768 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2769 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2770 ac_main_return="return"
2771 echo "$as_me:2771: checking how to run the C preprocessor" >&5
2772 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2773 # On Suns, sometimes $CPP names a directory.
2774 if test -n "$CPP" && test -d "$CPP"; then
2775   CPP=
2776 fi
2777 if test -z "$CPP"; then
2778   if test "${ac_cv_prog_CPP+set}" = set; then
2779   echo $ECHO_N "(cached) $ECHO_C" >&6
2780 else
2781       # Double quotes because CPP needs to be expanded
2782     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2783     do
2784       ac_preproc_ok=false
2785 for ac_c_preproc_warn_flag in '' yes
2786 do
2787   # Use a header file that comes with gcc, so configuring glibc
2788   # with a fresh cross-compiler works.
2789   # On the NeXT, cc -E runs the code through the compiler's parser,
2790   # not just through cpp. "Syntax error" is here to catch this case.
2791   cat >"conftest.$ac_ext" <<_ACEOF
2792 #line 2792 "configure"
2793 #include "confdefs.h"
2794 #include <assert.h>
2795                      Syntax error
2796 _ACEOF
2797 if { (eval echo "$as_me:2797: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2798   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2799   ac_status=$?
2800   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2801   rm -f conftest.er1
2802   cat conftest.err >&5
2803   echo "$as_me:2803: \$? = $ac_status" >&5
2804   (exit "$ac_status"); } >/dev/null; then
2805   if test -s conftest.err; then
2806     ac_cpp_err=$ac_c_preproc_warn_flag
2807   else
2808     ac_cpp_err=
2809   fi
2810 else
2811   ac_cpp_err=yes
2812 fi
2813 if test -z "$ac_cpp_err"; then
2814   :
2815 else
2816   echo "$as_me: failed program was:" >&5
2817   cat "conftest.$ac_ext" >&5
2818   # Broken: fails on valid input.
2819 continue
2820 fi
2821 rm -f conftest.err "conftest.$ac_ext"
2822
2823   # OK, works on sane cases.  Now check whether non-existent headers
2824   # can be detected and how.
2825   cat >"conftest.$ac_ext" <<_ACEOF
2826 #line 2826 "configure"
2827 #include "confdefs.h"
2828 #include <ac_nonexistent.h>
2829 _ACEOF
2830 if { (eval echo "$as_me:2830: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2831   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2832   ac_status=$?
2833   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2834   rm -f conftest.er1
2835   cat conftest.err >&5
2836   echo "$as_me:2836: \$? = $ac_status" >&5
2837   (exit "$ac_status"); } >/dev/null; then
2838   if test -s conftest.err; then
2839     ac_cpp_err=$ac_c_preproc_warn_flag
2840   else
2841     ac_cpp_err=
2842   fi
2843 else
2844   ac_cpp_err=yes
2845 fi
2846 if test -z "$ac_cpp_err"; then
2847   # Broken: success on invalid input.
2848 continue
2849 else
2850   echo "$as_me: failed program was:" >&5
2851   cat "conftest.$ac_ext" >&5
2852   # Passes both tests.
2853 ac_preproc_ok=:
2854 break
2855 fi
2856 rm -f conftest.err "conftest.$ac_ext"
2857
2858 done
2859 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2860 rm -f conftest.err "conftest.$ac_ext"
2861 if $ac_preproc_ok; then
2862   break
2863 fi
2864
2865     done
2866     ac_cv_prog_CPP=$CPP
2867
2868 fi
2869   CPP=$ac_cv_prog_CPP
2870 else
2871   ac_cv_prog_CPP=$CPP
2872 fi
2873 echo "$as_me:2873: result: $CPP" >&5
2874 echo "${ECHO_T}$CPP" >&6
2875 ac_preproc_ok=false
2876 for ac_c_preproc_warn_flag in '' yes
2877 do
2878   # Use a header file that comes with gcc, so configuring glibc
2879   # with a fresh cross-compiler works.
2880   # On the NeXT, cc -E runs the code through the compiler's parser,
2881   # not just through cpp. "Syntax error" is here to catch this case.
2882   cat >"conftest.$ac_ext" <<_ACEOF
2883 #line 2883 "configure"
2884 #include "confdefs.h"
2885 #include <assert.h>
2886                      Syntax error
2887 _ACEOF
2888 if { (eval echo "$as_me:2888: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2889   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2890   ac_status=$?
2891   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2892   rm -f conftest.er1
2893   cat conftest.err >&5
2894   echo "$as_me:2894: \$? = $ac_status" >&5
2895   (exit "$ac_status"); } >/dev/null; then
2896   if test -s conftest.err; then
2897     ac_cpp_err=$ac_c_preproc_warn_flag
2898   else
2899     ac_cpp_err=
2900   fi
2901 else
2902   ac_cpp_err=yes
2903 fi
2904 if test -z "$ac_cpp_err"; then
2905   :
2906 else
2907   echo "$as_me: failed program was:" >&5
2908   cat "conftest.$ac_ext" >&5
2909   # Broken: fails on valid input.
2910 continue
2911 fi
2912 rm -f conftest.err "conftest.$ac_ext"
2913
2914   # OK, works on sane cases.  Now check whether non-existent headers
2915   # can be detected and how.
2916   cat >"conftest.$ac_ext" <<_ACEOF
2917 #line 2917 "configure"
2918 #include "confdefs.h"
2919 #include <ac_nonexistent.h>
2920 _ACEOF
2921 if { (eval echo "$as_me:2921: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2922   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2923   ac_status=$?
2924   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2925   rm -f conftest.er1
2926   cat conftest.err >&5
2927   echo "$as_me:2927: \$? = $ac_status" >&5
2928   (exit "$ac_status"); } >/dev/null; then
2929   if test -s conftest.err; then
2930     ac_cpp_err=$ac_c_preproc_warn_flag
2931   else
2932     ac_cpp_err=
2933   fi
2934 else
2935   ac_cpp_err=yes
2936 fi
2937 if test -z "$ac_cpp_err"; then
2938   # Broken: success on invalid input.
2939 continue
2940 else
2941   echo "$as_me: failed program was:" >&5
2942   cat "conftest.$ac_ext" >&5
2943   # Passes both tests.
2944 ac_preproc_ok=:
2945 break
2946 fi
2947 rm -f conftest.err "conftest.$ac_ext"
2948
2949 done
2950 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2951 rm -f conftest.err "conftest.$ac_ext"
2952 if $ac_preproc_ok; then
2953   :
2954 else
2955   { { echo "$as_me:2955: error: C preprocessor \"$CPP\" fails sanity check" >&5
2956 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2957    { (exit 1); exit 1; }; }
2958 fi
2959
2960 ac_ext=c
2961 ac_cpp='$CPP $CPPFLAGS'
2962 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2963 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2964 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2965 ac_main_return="return"
2966
2967 if test $ac_cv_c_compiler_gnu = yes; then
2968     echo "$as_me:2968: checking whether $CC needs -traditional" >&5
2969 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2970 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2971   echo $ECHO_N "(cached) $ECHO_C" >&6
2972 else
2973     ac_pattern="Autoconf.*'x'"
2974   cat >"conftest.$ac_ext" <<_ACEOF
2975 #line 2975 "configure"
2976 #include "confdefs.h"
2977 #include <sgtty.h>
2978 int Autoconf = TIOCGETP;
2979 _ACEOF
2980 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2981   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2982   ac_cv_prog_gcc_traditional=yes
2983 else
2984   ac_cv_prog_gcc_traditional=no
2985 fi
2986 rm -rf conftest*
2987
2988   if test $ac_cv_prog_gcc_traditional = no; then
2989     cat >"conftest.$ac_ext" <<_ACEOF
2990 #line 2990 "configure"
2991 #include "confdefs.h"
2992 #include <termio.h>
2993 int Autoconf = TCGETA;
2994 _ACEOF
2995 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2996   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2997   ac_cv_prog_gcc_traditional=yes
2998 fi
2999 rm -rf conftest*
3000
3001   fi
3002 fi
3003 echo "$as_me:3003: result: $ac_cv_prog_gcc_traditional" >&5
3004 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
3005   if test $ac_cv_prog_gcc_traditional = yes; then
3006     CC="$CC -traditional"
3007   fi
3008 fi
3009
3010 echo "$as_me:3010: checking whether $CC understands -c and -o together" >&5
3011 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
3012 if test "${cf_cv_prog_CC_c_o+set}" = set; then
3013   echo $ECHO_N "(cached) $ECHO_C" >&6
3014 else
3015
3016 cat > conftest.$ac_ext <<CF_EOF
3017 int main(void)
3018 {
3019         ${cf_cv_main_return:-return}(0);
3020 }
3021 CF_EOF
3022 # We do the test twice because some compilers refuse to overwrite an
3023 # existing .o file with -o, though they will create one.
3024 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3025 if { (eval echo "$as_me:3025: \"$ac_try\"") >&5
3026   (eval $ac_try) 2>&5
3027   ac_status=$?
3028   echo "$as_me:3028: \$? = $ac_status" >&5
3029   (exit "$ac_status"); } &&
3030   test -f conftest2.$ac_objext && { (eval echo "$as_me:3030: \"$ac_try\"") >&5
3031   (eval $ac_try) 2>&5
3032   ac_status=$?
3033   echo "$as_me:3033: \$? = $ac_status" >&5
3034   (exit "$ac_status"); };
3035 then
3036   eval cf_cv_prog_CC_c_o=yes
3037 else
3038   eval cf_cv_prog_CC_c_o=no
3039 fi
3040 rm -rf ./conftest*
3041
3042 fi
3043 if test "$cf_cv_prog_CC_c_o" = yes; then
3044   echo "$as_me:3044: result: yes" >&5
3045 echo "${ECHO_T}yes" >&6
3046 else
3047   echo "$as_me:3047: result: no" >&5
3048 echo "${ECHO_T}no" >&6
3049 fi
3050
3051 test "$program_prefix" != NONE &&
3052   program_transform_name="s,^,$program_prefix,;$program_transform_name"
3053 # Use a double $ so make ignores it.
3054 test "$program_suffix" != NONE &&
3055   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
3056 # Double any \ or $.  echo might interpret backslashes.
3057 # By default was `s,x,x', remove it if useless.
3058 cat <<\_ACEOF >conftest.sed
3059 s/[\\$]/&&/g;s/;s,x,x,$//
3060 _ACEOF
3061 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
3062 rm conftest.sed
3063
3064 for ac_prog in mawk gawk nawk awk
3065 do
3066   # Extract the first word of "$ac_prog", so it can be a program name with args.
3067 set dummy $ac_prog; ac_word=$2
3068 echo "$as_me:3068: checking for $ac_word" >&5
3069 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3070 if test "${ac_cv_prog_AWK+set}" = set; then
3071   echo $ECHO_N "(cached) $ECHO_C" >&6
3072 else
3073   if test -n "$AWK"; then
3074   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3075 else
3076   ac_save_IFS=$IFS; IFS=$ac_path_separator
3077 ac_dummy="$PATH"
3078 for ac_dir in $ac_dummy; do
3079   IFS=$ac_save_IFS
3080   test -z "$ac_dir" && ac_dir=.
3081   $as_executable_p "$ac_dir/$ac_word" || continue
3082 ac_cv_prog_AWK="$ac_prog"
3083 echo "$as_me:3083: found $ac_dir/$ac_word" >&5
3084 break
3085 done
3086
3087 fi
3088 fi
3089 AWK=$ac_cv_prog_AWK
3090 if test -n "$AWK"; then
3091   echo "$as_me:3091: result: $AWK" >&5
3092 echo "${ECHO_T}$AWK" >&6
3093 else
3094   echo "$as_me:3094: result: no" >&5
3095 echo "${ECHO_T}no" >&6
3096 fi
3097
3098   test -n "$AWK" && break
3099 done
3100
3101 test -z "$AWK" && { { echo "$as_me:3101: error: No awk program found" >&5
3102 echo "$as_me: error: No awk program found" >&2;}
3103    { (exit 1); exit 1; }; }
3104
3105 echo "$as_me:3105: checking for egrep" >&5
3106 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
3107 if test "${ac_cv_prog_egrep+set}" = set; then
3108   echo $ECHO_N "(cached) $ECHO_C" >&6
3109 else
3110   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
3111                 then ac_cv_prog_egrep='grep -E'
3112                 else ac_cv_prog_egrep='egrep'
3113         fi
3114 fi
3115 echo "$as_me:3115: result: $ac_cv_prog_egrep" >&5
3116 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
3117         EGREP=$ac_cv_prog_egrep
3118
3119         test -z "$EGREP" && { { echo "$as_me:3119: error: No egrep program found" >&5
3120 echo "$as_me: error: No egrep program found" >&2;}
3121    { (exit 1); exit 1; }; }
3122
3123 # Find a good install program.  We prefer a C program (faster),
3124 # so one script is as good as another.  But avoid the broken or
3125 # incompatible versions:
3126 # SysV /etc/install, /usr/sbin/install
3127 # SunOS /usr/etc/install
3128 # IRIX /sbin/install
3129 # AIX /bin/install
3130 # AmigaOS /C/install, which installs bootblocks on floppy discs
3131 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3132 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3133 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3134 # ./install, which can be erroneously created by make from ./install.sh.
3135 echo "$as_me:3135: checking for a BSD compatible install" >&5
3136 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
3137 if test -z "$INSTALL"; then
3138 if test "${ac_cv_path_install+set}" = set; then
3139   echo $ECHO_N "(cached) $ECHO_C" >&6
3140 else
3141     ac_save_IFS=$IFS; IFS=$ac_path_separator
3142   for ac_dir in $PATH; do
3143     IFS=$ac_save_IFS
3144     # Account for people who put trailing slashes in PATH elements.
3145     case $ac_dir/ in
3146     / | ./ | .// | /cC/* \
3147     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
3148     | /usr/ucb/* ) ;;
3149     *)
3150       # OSF1 and SCO ODT 3.0 have their own names for install.
3151       # Don't use installbsd from OSF since it installs stuff as root
3152       # by default.
3153       for ac_prog in ginstall scoinst install; do
3154         if $as_executable_p "$ac_dir/$ac_prog"; then
3155           if test $ac_prog = install &&
3156             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3157             # AIX install.  It has an incompatible calling convention.
3158             :
3159           elif test $ac_prog = install &&
3160             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3161             # program-specific install script used by HP pwplus--don't use.
3162             :
3163           else
3164             ac_cv_path_install="$ac_dir/$ac_prog -c"
3165             break 2
3166           fi
3167         fi
3168       done
3169       ;;
3170     esac
3171   done
3172
3173 fi
3174   if test "${ac_cv_path_install+set}" = set; then
3175     INSTALL=$ac_cv_path_install
3176   else
3177     # As a last resort, use the slow shell script.  We don't cache a
3178     # path for INSTALL within a source directory, because that will
3179     # break other packages using the cache if that directory is
3180     # removed, or if the path is relative.
3181     INSTALL=$ac_install_sh
3182   fi
3183 fi
3184 echo "$as_me:3184: result: $INSTALL" >&5
3185 echo "${ECHO_T}$INSTALL" >&6
3186
3187 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3188 # It thinks the first close brace ends the variable substitution.
3189 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3190
3191 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
3192
3193 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3194
3195 echo "$as_me:3195: checking whether ln -s works" >&5
3196 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
3197 LN_S=$as_ln_s
3198 if test "$LN_S" = "ln -s"; then
3199   echo "$as_me:3199: result: yes" >&5
3200 echo "${ECHO_T}yes" >&6
3201 else
3202   echo "$as_me:3202: result: no, using $LN_S" >&5
3203 echo "${ECHO_T}no, using $LN_S" >&6
3204 fi
3205
3206 echo "$as_me:3206: checking if $LN_S -f options work" >&5
3207 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
3208
3209 rm -f conf$$.src conf$$dst
3210 echo >conf$$.dst
3211 echo first >conf$$.src
3212 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
3213         cf_prog_ln_sf=yes
3214 else
3215         cf_prog_ln_sf=no
3216 fi
3217 rm -f conf$$.dst conf$$src
3218 echo "$as_me:3218: result: $cf_prog_ln_sf" >&5
3219 echo "${ECHO_T}$cf_prog_ln_sf" >&6
3220
3221 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
3222
3223 # Find a good install program.  We prefer a C program (faster),
3224 # so one script is as good as another.  But avoid the broken or
3225 # incompatible versions:
3226 # SysV /etc/install, /usr/sbin/install
3227 # SunOS /usr/etc/install
3228 # IRIX /sbin/install
3229 # AIX /bin/install
3230 # AmigaOS /C/install, which installs bootblocks on floppy discs
3231 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3232 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3233 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3234 # ./install, which can be erroneously created by make from ./install.sh.
3235 echo "$as_me:3235: checking for a BSD compatible install" >&5
3236 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
3237 if test -z "$INSTALL"; then
3238 if test "${ac_cv_path_install+set}" = set; then
3239   echo $ECHO_N "(cached) $ECHO_C" >&6
3240 else
3241     ac_save_IFS=$IFS; IFS=$ac_path_separator
3242   for ac_dir in $PATH; do
3243     IFS=$ac_save_IFS
3244     # Account for people who put trailing slashes in PATH elements.
3245     case $ac_dir/ in
3246     / | ./ | .// | /cC/* \
3247     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
3248     | /usr/ucb/* ) ;;
3249     *)
3250       # OSF1 and SCO ODT 3.0 have their own names for install.
3251       # Don't use installbsd from OSF since it installs stuff as root
3252       # by default.
3253       for ac_prog in ginstall scoinst install; do
3254         if $as_executable_p "$ac_dir/$ac_prog"; then
3255           if test $ac_prog = install &&
3256             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3257             # AIX install.  It has an incompatible calling convention.
3258             :
3259           elif test $ac_prog = install &&
3260             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3261             # program-specific install script used by HP pwplus--don't use.
3262             :
3263           else
3264             ac_cv_path_install="$ac_dir/$ac_prog -c"
3265             break 2
3266           fi
3267         fi
3268       done
3269       ;;
3270     esac
3271   done
3272
3273 fi
3274   if test "${ac_cv_path_install+set}" = set; then
3275     INSTALL=$ac_cv_path_install
3276   else
3277     # As a last resort, use the slow shell script.  We don't cache a
3278     # path for INSTALL within a source directory, because that will
3279     # break other packages using the cache if that directory is
3280     # removed, or if the path is relative.
3281     INSTALL=$ac_install_sh
3282   fi
3283 fi
3284 echo "$as_me:3284: result: $INSTALL" >&5
3285 echo "${ECHO_T}$INSTALL" >&6
3286
3287 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3288 # It thinks the first close brace ends the variable substitution.
3289 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3290
3291 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
3292
3293 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3294
3295 case $INSTALL in
3296 (/*)
3297         ;;
3298 (*)
3299         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
3300         test -z "$cf_dir" && cf_dir=.
3301         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
3302         ;;
3303 esac
3304
3305 echo "$as_me:3305: checking if you want to install stripped executables" >&5
3306 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
3307
3308 # Check whether --enable-stripping or --disable-stripping was given.
3309 if test "${enable_stripping+set}" = set; then
3310   enableval="$enable_stripping"
3311   test "$enableval" != no && enableval=yes
3312         if test "$enableval" != "yes" ; then
3313     enable_stripping=no
3314         else
3315                 enable_stripping=yes
3316         fi
3317 else
3318   enableval=yes
3319         enable_stripping=yes
3320
3321 fi;
3322 echo "$as_me:3322: result: $enable_stripping" >&5
3323 echo "${ECHO_T}$enable_stripping" >&6
3324
3325 if test "$enable_stripping" = yes
3326 then
3327         INSTALL_OPT_S="-s"
3328 else
3329         INSTALL_OPT_S=
3330 fi
3331
3332 : "${INSTALL:=install}"
3333 echo "$as_me:3333: checking if install accepts -p option" >&5
3334 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3335 if test "${cf_cv_install_p+set}" = set; then
3336   echo $ECHO_N "(cached) $ECHO_C" >&6
3337 else
3338
3339         rm -rf ./conftest*
3340         date >conftest.in
3341         mkdir conftest.out
3342         sleep 3
3343         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3344         then
3345                 if test -f conftest.out/conftest.in
3346                 then
3347                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3348                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3349                         if test -s conftest.err
3350                         then
3351                                 cf_cv_install_p=no
3352                         else
3353                                 cf_cv_install_p=yes
3354                         fi
3355                 else
3356                         cf_cv_install_p=no
3357                 fi
3358         else
3359                 cf_cv_install_p=no
3360         fi
3361         rm -rf ./conftest*
3362
3363 fi
3364 echo "$as_me:3364: result: $cf_cv_install_p" >&5
3365 echo "${ECHO_T}$cf_cv_install_p" >&6
3366
3367 echo "$as_me:3367: checking if install needs to be told about ownership" >&5
3368 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3369 case `$ac_config_guess` in
3370 (*minix)
3371         with_install_o=yes
3372         ;;
3373 (*)
3374         with_install_o=no
3375         ;;
3376 esac
3377
3378 echo "$as_me:3378: result: $with_install_o" >&5
3379 echo "${ECHO_T}$with_install_o" >&6
3380 if test "x$with_install_o" = xyes
3381 then
3382         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'`"
3383 else
3384         INSTALL_OPT_O=
3385 fi
3386
3387 if test -n "$INSTALL_OPT_S"
3388 then
3389         echo "$as_me:3389: checking if you want to specify strip-program" >&5
3390 echo $ECHO_N "checking if you want to specify strip-program... $ECHO_C" >&6
3391
3392 # Check whether --with-strip-program or --without-strip-program was given.
3393 if test "${with_strip_program+set}" = set; then
3394   withval="$with_strip_program"
3395   with_strip_program=$withval
3396 else
3397   with_strip_program=no
3398 fi;
3399         echo "$as_me:3399: result: $with_strip_program" >&5
3400 echo "${ECHO_T}$with_strip_program" >&6
3401         if test "$with_strip_program" != no
3402         then
3403                 echo "$as_me:3403: checking if strip-program is supported with this installer" >&5
3404 echo $ECHO_N "checking if strip-program is supported with this installer... $ECHO_C" >&6
3405                 cf_install_program=`echo "$INSTALL" | sed -e 's%[ ]*[ ]-.%%'`
3406                 check_install_strip=no
3407                 if test -f "$cf_install_program"
3408                 then
3409                         check_install_version=`"$cf_install_program" --version 2>/dev/null | head -n 1 | grep coreutils`
3410                         if test -n "$check_install_version"
3411                         then
3412                                 check_install_strip="option"
3413                         else
3414                                 for check_strip_variable in STRIPBIN STRIP
3415                                 do
3416                                         if strings "$cf_install_program" | grep "^$check_strip_variable$" >/dev/null
3417                                         then
3418                                                 check_install_strip="environ"
3419                                                 break
3420                                         fi
3421                                 done
3422                         fi
3423                 fi
3424                 echo "$as_me:3424: result: $check_install_strip" >&5
3425 echo "${ECHO_T}$check_install_strip" >&6
3426                 case "$check_install_strip" in
3427                 (no)
3428                         { echo "$as_me:3428: WARNING: $cf_install_program does not support strip program option" >&5
3429 echo "$as_me: WARNING: $cf_install_program does not support strip program option" >&2;}
3430                         with_strip_program=no
3431                         ;;
3432                 (environ)
3433                         cat >install.tmp <<-CF_EOF
3434                         #! $SHELL
3435                         STRIPBIN="$with_strip_program" \\
3436                         STRIP="$with_strip_program" \\
3437                         $INSTALL "$@"
3438                         CF_EOF
3439                         INSTALL="`pwd`/install.tmp"
3440                         chmod +x "$INSTALL"
3441                         test -n "$verbose" && echo "    created $INSTALL" 1>&6
3442
3443 echo "${as_me:-configure}:3443: testing created $INSTALL ..." 1>&5
3444
3445                         ;;
3446                 (option)
3447                         INSTALL_OPT_S="$INSTALL_OPT_S --strip-program=\"$with_strip_program\""
3448                         ;;
3449                 esac
3450         fi
3451 fi
3452
3453 echo "$as_me:3453: checking for long file names" >&5
3454 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3455 if test "${ac_cv_sys_long_file_names+set}" = set; then
3456   echo $ECHO_N "(cached) $ECHO_C" >&6
3457 else
3458   ac_cv_sys_long_file_names=yes
3459 # Test for long file names in all the places we know might matter:
3460 #      .                the current directory, where building will happen
3461 #      $prefix/lib      where we will be installing things
3462 #      $exec_prefix/lib likewise
3463 # eval it to expand exec_prefix.
3464 #      $TMPDIR          if set, where it might want to write temporary files
3465 # if $TMPDIR is not set:
3466 #      /tmp             where it might want to write temporary files
3467 #      /var/tmp         likewise
3468 #      /usr/tmp         likewise
3469 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3470   ac_tmpdirs=$TMPDIR
3471 else
3472   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3473 fi
3474 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3475   test -d "$ac_dir" || continue
3476   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3477   ac_xdir=$ac_dir/cf$$
3478   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3479   ac_tf1=$ac_xdir/conftest9012345
3480   ac_tf2=$ac_xdir/conftest9012346
3481   (echo 1 >"$ac_tf1") 2>/dev/null
3482   (echo 2 >"$ac_tf2") 2>/dev/null
3483   ac_val=`cat "$ac_tf1" 2>/dev/null`
3484   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3485     ac_cv_sys_long_file_names=no
3486     rm -rf "$ac_xdir" 2>/dev/null
3487     break
3488   fi
3489   rm -rf "$ac_xdir" 2>/dev/null
3490 done
3491 fi
3492 echo "$as_me:3492: result: $ac_cv_sys_long_file_names" >&5
3493 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3494 if test "$ac_cv_sys_long_file_names" = yes; then
3495
3496 cat >>confdefs.h <<\EOF
3497 #define HAVE_LONG_FILE_NAMES 1
3498 EOF
3499
3500 fi
3501
3502 # if we find pkg-config, check if we should install the ".pc" files.
3503
3504 echo "$as_me:3504: checking if you want to use pkg-config" >&5
3505 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3506
3507 # Check whether --with-pkg-config or --without-pkg-config was given.
3508 if test "${with_pkg_config+set}" = set; then
3509   withval="$with_pkg_config"
3510   cf_pkg_config=$withval
3511 else
3512   cf_pkg_config=yes
3513 fi;
3514 echo "$as_me:3514: result: $cf_pkg_config" >&5
3515 echo "${ECHO_T}$cf_pkg_config" >&6
3516
3517 case "$cf_pkg_config" in
3518 (no)
3519         PKG_CONFIG=none
3520         ;;
3521 (yes)
3522
3523 if test -n "$ac_tool_prefix"; then
3524   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3525 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3526 echo "$as_me:3526: checking for $ac_word" >&5
3527 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3528 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3529   echo $ECHO_N "(cached) $ECHO_C" >&6
3530 else
3531   case $PKG_CONFIG in
3532   [\\/]* | ?:[\\/]*)
3533   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3534   ;;
3535   *)
3536   ac_save_IFS=$IFS; IFS=$ac_path_separator
3537 ac_dummy="$PATH"
3538 for ac_dir in $ac_dummy; do
3539   IFS=$ac_save_IFS
3540   test -z "$ac_dir" && ac_dir=.
3541   if $as_executable_p "$ac_dir/$ac_word"; then
3542    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3543    echo "$as_me:3543: found $ac_dir/$ac_word" >&5
3544    break
3545 fi
3546 done
3547
3548   ;;
3549 esac
3550 fi
3551 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3552
3553 if test -n "$PKG_CONFIG"; then
3554   echo "$as_me:3554: result: $PKG_CONFIG" >&5
3555 echo "${ECHO_T}$PKG_CONFIG" >&6
3556 else
3557   echo "$as_me:3557: result: no" >&5
3558 echo "${ECHO_T}no" >&6
3559 fi
3560
3561 fi
3562 if test -z "$ac_cv_path_PKG_CONFIG"; then
3563   ac_pt_PKG_CONFIG=$PKG_CONFIG
3564   # Extract the first word of "pkg-config", so it can be a program name with args.
3565 set dummy pkg-config; ac_word=$2
3566 echo "$as_me:3566: checking for $ac_word" >&5
3567 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3568 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3569   echo $ECHO_N "(cached) $ECHO_C" >&6
3570 else
3571   case $ac_pt_PKG_CONFIG in
3572   [\\/]* | ?:[\\/]*)
3573   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3574   ;;
3575   *)
3576   ac_save_IFS=$IFS; IFS=$ac_path_separator
3577 ac_dummy="$PATH"
3578 for ac_dir in $ac_dummy; do
3579   IFS=$ac_save_IFS
3580   test -z "$ac_dir" && ac_dir=.
3581   if $as_executable_p "$ac_dir/$ac_word"; then
3582    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3583    echo "$as_me:3583: found $ac_dir/$ac_word" >&5
3584    break
3585 fi
3586 done
3587
3588   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3589   ;;
3590 esac
3591 fi
3592 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3593
3594 if test -n "$ac_pt_PKG_CONFIG"; then
3595   echo "$as_me:3595: result: $ac_pt_PKG_CONFIG" >&5
3596 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3597 else
3598   echo "$as_me:3598: result: no" >&5
3599 echo "${ECHO_T}no" >&6
3600 fi
3601
3602   PKG_CONFIG=$ac_pt_PKG_CONFIG
3603 else
3604   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3605 fi
3606
3607         ;;
3608 (*)
3609         PKG_CONFIG=$withval
3610         ;;
3611 esac
3612
3613 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3614 if test "$PKG_CONFIG" != none ; then
3615
3616 if test "x$prefix" != xNONE; then
3617         cf_path_syntax="$prefix"
3618 else
3619         cf_path_syntax="$ac_default_prefix"
3620 fi
3621
3622 case ".$PKG_CONFIG" in
3623 (.\$\(*\)*|.\'*\'*)
3624         ;;
3625 (..|./*|.\\*)
3626         ;;
3627 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3628         ;;
3629 (.\$\{*prefix\}*|.\$\{*dir\}*)
3630         eval PKG_CONFIG="$PKG_CONFIG"
3631         case ".$PKG_CONFIG" in
3632         (.NONE/*)
3633                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3634                 ;;
3635         esac
3636         ;;
3637 (.no|.NONE/*)
3638         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3639         ;;
3640 (*)
3641         { { echo "$as_me:3641: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3642 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3643    { (exit 1); exit 1; }; }
3644         ;;
3645 esac
3646
3647 elif test "x$cf_pkg_config" != xno ; then
3648         { echo "$as_me:3648: WARNING: pkg-config is not installed" >&5
3649 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3650 fi
3651
3652 case "$PKG_CONFIG" in
3653 (no|none|yes)
3654         echo "$as_me:3654: checking for pkg-config library directory" >&5
3655 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3656         ;;
3657 (*)
3658         echo "$as_me:3658: checking for $PKG_CONFIG library directory" >&5
3659 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3660         ;;
3661 esac
3662
3663 # if $PKG_CONFIG_LIBDIR is set, try to use that
3664 if test -n "$PKG_CONFIG_PATH"; then
3665         cf_search_path=`echo "$PKG_CONFIG_PATH" | sed -e 's/:/ /g' -e 's,^[     ]*,,' -e 's,[   ]*$,,'`
3666 elif test -n "$PKG_CONFIG_LIBDIR"; then
3667         cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,' -e 's,[   ]*$,,'`
3668 else
3669         cf_search_path=auto
3670 fi
3671
3672 # if the option is used, let that override.  otherwise default to "libdir"
3673
3674 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3675 if test "${with_pkg_config_libdir+set}" = set; then
3676   withval="$with_pkg_config_libdir"
3677   cf_search_path=$withval
3678 else
3679   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3680 fi;
3681
3682 case "x$cf_search_path" in
3683 (xlibdir)
3684         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3685         echo "$as_me:3685: result: $PKG_CONFIG_LIBDIR" >&5
3686 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3687         cf_search_path=
3688         ;;
3689 (x)
3690         ;;
3691 (x/*\ *)
3692         PKG_CONFIG_LIBDIR=
3693         ;;
3694 (x/*)
3695         PKG_CONFIG_LIBDIR="$cf_search_path"
3696         echo "$as_me:3696: result: $PKG_CONFIG_LIBDIR" >&5
3697 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3698         cf_search_path=
3699         ;;
3700 (xyes|xauto)
3701         echo "$as_me:3701: result: auto" >&5
3702 echo "${ECHO_T}auto" >&6
3703         cf_search_path=
3704         # Look for the library directory using the same prefix as the executable
3705         echo "$as_me:3705: checking for search-list" >&5
3706 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3707         if test "x$PKG_CONFIG" != xnone
3708         then
3709                 # works for pkg-config since version 0.24 (2009)
3710                 # works for pkgconf since version 0.8.3 (2012)
3711                 for cf_pkg_program in \
3712                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3713                         pkg-config \
3714                         pkgconf
3715                 do
3716                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3717                         test -n "$cf_search_path" && break
3718                 done
3719
3720                 # works for pkg-config since import in 2005 of original 2001 HP code.
3721                 test -z "$cf_search_path" && \
3722                 cf_search_path=`
3723                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3724 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3725         sub(\"^[^']*'\",\"\"); \
3726         sub(\"'.*\",\"\"); \
3727         printf \" %s\", \\$0; } \
3728 { next; } \
3729 "`
3730         fi
3731
3732         echo "$as_me:3732: result: $cf_search_path" >&5
3733 echo "${ECHO_T}$cf_search_path" >&6
3734         ;;
3735 (*)
3736         { { echo "$as_me:3736: error: Unexpected option value: $cf_search_path" >&5
3737 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3738    { (exit 1); exit 1; }; }
3739         ;;
3740 esac
3741
3742 if test -n "$cf_search_path"
3743 then
3744         echo "$as_me:3744: checking for first directory" >&5
3745 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3746         cf_pkg_config_path=none
3747         for cf_config in $cf_search_path
3748         do
3749                 if test -d "$cf_config"
3750                 then
3751                         cf_pkg_config_path=$cf_config
3752                         break
3753                 fi
3754         done
3755         echo "$as_me:3755: result: $cf_pkg_config_path" >&5
3756 echo "${ECHO_T}$cf_pkg_config_path" >&6
3757
3758         if test "x$cf_pkg_config_path" != xnone ; then
3759                 # limit this to the first directory found
3760                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3761         fi
3762
3763         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3764         then
3765                 echo "$as_me:3765: checking for workaround" >&5
3766 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3767                 if test "$prefix" = "NONE" ; then
3768                         cf_prefix="$ac_default_prefix"
3769                 else
3770                         cf_prefix="$prefix"
3771                 fi
3772                 eval cf_libdir=$libdir
3773                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3774                 cf_backup=
3775                 for cf_config in $cf_search_path
3776                 do
3777                         case $cf_config in
3778                         $cf_libdir/pkgconfig)
3779                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3780                                 break
3781                                 ;;
3782                         *)
3783                                 test -z "$cf_backup" && cf_backup=$cf_config
3784                                 ;;
3785                         esac
3786                 done
3787                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3788                 echo "$as_me:3788: result: $PKG_CONFIG_LIBDIR" >&5
3789 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3790         fi
3791 fi
3792
3793 echo "$as_me:3793: checking if you want to build test-programs" >&5
3794 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3795
3796 # Check whether --with-tests or --without-tests was given.
3797 if test "${with_tests+set}" = set; then
3798   withval="$with_tests"
3799   cf_with_tests=$withval
3800 else
3801   cf_with_tests=yes
3802 fi;
3803 echo "$as_me:3803: result: $cf_with_tests" >&5
3804 echo "${ECHO_T}$cf_with_tests" >&6
3805
3806 echo "$as_me:3806: checking if we should assume mixed-case filenames" >&5
3807 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3808
3809 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3810 if test "${enable_mixed_case+set}" = set; then
3811   enableval="$enable_mixed_case"
3812   enable_mixedcase=$enableval
3813 else
3814   enable_mixedcase=auto
3815 fi;
3816 echo "$as_me:3816: result: $enable_mixedcase" >&5
3817 echo "${ECHO_T}$enable_mixedcase" >&6
3818 if test "$enable_mixedcase" = "auto" ; then
3819
3820 echo "$as_me:3820: checking if filesystem supports mixed-case filenames" >&5
3821 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3822 if test "${cf_cv_mixedcase+set}" = set; then
3823   echo $ECHO_N "(cached) $ECHO_C" >&6
3824 else
3825
3826 if test "$cross_compiling" = yes ; then
3827         case "$target_alias" in
3828         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3829                 cf_cv_mixedcase=no
3830                 ;;
3831         (*)
3832                 cf_cv_mixedcase=yes
3833                 ;;
3834         esac
3835 else
3836         rm -f conftest CONFTEST
3837         echo test >conftest
3838         if test -f CONFTEST ; then
3839                 cf_cv_mixedcase=no
3840         else
3841                 cf_cv_mixedcase=yes
3842         fi
3843         rm -f conftest CONFTEST
3844 fi
3845
3846 fi
3847 echo "$as_me:3847: result: $cf_cv_mixedcase" >&5
3848 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3849 test "$cf_cv_mixedcase" = yes &&
3850 cat >>confdefs.h <<\EOF
3851 #define MIXEDCASE_FILENAMES 1
3852 EOF
3853
3854 else
3855         cf_cv_mixedcase=$enable_mixedcase
3856         if test "$enable_mixedcase" = "yes" ; then
3857                 cat >>confdefs.h <<\EOF
3858 #define MIXEDCASE_FILENAMES 1
3859 EOF
3860
3861         fi
3862 fi
3863
3864 # do this after mixed-case option (tags/TAGS is not as important as tic).
3865 echo "$as_me:3865: checking whether ${MAKE-make} sets \${MAKE}" >&5
3866 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3867 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3868 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3869   echo $ECHO_N "(cached) $ECHO_C" >&6
3870 else
3871   cat >conftest.make <<\EOF
3872 all:
3873         @echo 'ac_maketemp="${MAKE}"'
3874 EOF
3875 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3876 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3877 if test -n "$ac_maketemp"; then
3878   eval ac_cv_prog_make_${ac_make}_set=yes
3879 else
3880   eval ac_cv_prog_make_${ac_make}_set=no
3881 fi
3882 rm -f conftest.make
3883 fi
3884 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3885   echo "$as_me:3885: result: yes" >&5
3886 echo "${ECHO_T}yes" >&6
3887   SET_MAKE=
3888 else
3889   echo "$as_me:3889: result: no" >&5
3890 echo "${ECHO_T}no" >&6
3891   SET_MAKE="MAKE=${MAKE-make}"
3892 fi
3893
3894 echo "$as_me:3894: checking for \".PHONY\" make-support" >&5
3895 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3896 if test "${cf_cv_make_PHONY+set}" = set; then
3897   echo $ECHO_N "(cached) $ECHO_C" >&6
3898 else
3899
3900         rm -rf conftest*
3901         (
3902                 mkdir conftest || exit 1
3903                 cd conftest
3904                 cat >makefile <<'CF_EOF'
3905 .PHONY: always
3906 DATA=0
3907 always: always.out
3908         @echo "** making $@ $(DATA)"
3909 once: once.out
3910         @echo "** making $@ $(DATA)"
3911 always.out:
3912         @echo "** making $@ $(DATA)"
3913         echo $(DATA) > $@
3914 once.out:
3915         @echo "** making $@ $(DATA)"
3916         echo $(DATA) > $@
3917 CF_EOF
3918                 for cf_data in 1 2 3
3919                 do
3920                         ${MAKE:-make} always DATA=$cf_data
3921                         ${MAKE:-make} once   DATA=$cf_data
3922                         ${MAKE:-make} -t always once
3923                         if test -f always ; then
3924                                 echo "no (case 1)" > ../conftest.tmp
3925                         elif test ! -f always.out ; then
3926                                 echo "no (case 2)" > ../conftest.tmp
3927                         elif test ! -f once.out ; then
3928                                 echo "no (case 3)" > ../conftest.tmp
3929                         elif ! cmp -s always.out once.out ; then
3930                                 echo "no (case 4)" > ../conftest.tmp
3931                                 diff always.out once.out
3932                         else
3933                                 cf_check="`cat always.out`"
3934                                 if test "x$cf_check" != "x$cf_data" ; then
3935                                         echo "no (case 5)" > ../conftest.tmp
3936                                 else
3937                                         echo yes > ../conftest.tmp
3938                                         rm -f ./*.out
3939                                         continue
3940                                 fi
3941                         fi
3942                         break
3943                 done
3944         ) >&5 2>&1
3945         cf_cv_make_PHONY="`cat conftest.tmp`"
3946         rm -rf conftest*
3947
3948 fi
3949 echo "$as_me:3949: result: $cf_cv_make_PHONY" >&5
3950 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3951 MAKE_NO_PHONY="#"
3952 MAKE_PHONY="#"
3953 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3954 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3955
3956 for ac_prog in exctags ctags
3957 do
3958   # Extract the first word of "$ac_prog", so it can be a program name with args.
3959 set dummy $ac_prog; ac_word=$2
3960 echo "$as_me:3960: checking for $ac_word" >&5
3961 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3962 if test "${ac_cv_prog_CTAGS+set}" = set; then
3963   echo $ECHO_N "(cached) $ECHO_C" >&6
3964 else
3965   if test -n "$CTAGS"; then
3966   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3967 else
3968   ac_save_IFS=$IFS; IFS=$ac_path_separator
3969 ac_dummy="$PATH"
3970 for ac_dir in $ac_dummy; do
3971   IFS=$ac_save_IFS
3972   test -z "$ac_dir" && ac_dir=.
3973   $as_executable_p "$ac_dir/$ac_word" || continue
3974 ac_cv_prog_CTAGS="$ac_prog"
3975 echo "$as_me:3975: found $ac_dir/$ac_word" >&5
3976 break
3977 done
3978
3979 fi
3980 fi
3981 CTAGS=$ac_cv_prog_CTAGS
3982 if test -n "$CTAGS"; then
3983   echo "$as_me:3983: result: $CTAGS" >&5
3984 echo "${ECHO_T}$CTAGS" >&6
3985 else
3986   echo "$as_me:3986: result: no" >&5
3987 echo "${ECHO_T}no" >&6
3988 fi
3989
3990   test -n "$CTAGS" && break
3991 done
3992
3993 for ac_prog in exetags etags
3994 do
3995   # Extract the first word of "$ac_prog", so it can be a program name with args.
3996 set dummy $ac_prog; ac_word=$2
3997 echo "$as_me:3997: checking for $ac_word" >&5
3998 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3999 if test "${ac_cv_prog_ETAGS+set}" = set; then
4000   echo $ECHO_N "(cached) $ECHO_C" >&6
4001 else
4002   if test -n "$ETAGS"; then
4003   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
4004 else
4005   ac_save_IFS=$IFS; IFS=$ac_path_separator
4006 ac_dummy="$PATH"
4007 for ac_dir in $ac_dummy; do
4008   IFS=$ac_save_IFS
4009   test -z "$ac_dir" && ac_dir=.
4010   $as_executable_p "$ac_dir/$ac_word" || continue
4011 ac_cv_prog_ETAGS="$ac_prog"
4012 echo "$as_me:4012: found $ac_dir/$ac_word" >&5
4013 break
4014 done
4015
4016 fi
4017 fi
4018 ETAGS=$ac_cv_prog_ETAGS
4019 if test -n "$ETAGS"; then
4020   echo "$as_me:4020: result: $ETAGS" >&5
4021 echo "${ECHO_T}$ETAGS" >&6
4022 else
4023   echo "$as_me:4023: result: no" >&5
4024 echo "${ECHO_T}no" >&6
4025 fi
4026
4027   test -n "$ETAGS" && break
4028 done
4029
4030 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
4031 set dummy ${CTAGS:-ctags}; ac_word=$2
4032 echo "$as_me:4032: checking for $ac_word" >&5
4033 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4034 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
4035   echo $ECHO_N "(cached) $ECHO_C" >&6
4036 else
4037   if test -n "$MAKE_LOWER_TAGS"; then
4038   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
4039 else
4040   ac_save_IFS=$IFS; IFS=$ac_path_separator
4041 ac_dummy="$PATH"
4042 for ac_dir in $ac_dummy; do
4043   IFS=$ac_save_IFS
4044   test -z "$ac_dir" && ac_dir=.
4045   $as_executable_p "$ac_dir/$ac_word" || continue
4046 ac_cv_prog_MAKE_LOWER_TAGS="yes"
4047 echo "$as_me:4047: found $ac_dir/$ac_word" >&5
4048 break
4049 done
4050
4051   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
4052 fi
4053 fi
4054 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
4055 if test -n "$MAKE_LOWER_TAGS"; then
4056   echo "$as_me:4056: result: $MAKE_LOWER_TAGS" >&5
4057 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
4058 else
4059   echo "$as_me:4059: result: no" >&5
4060 echo "${ECHO_T}no" >&6
4061 fi
4062
4063 if test "$cf_cv_mixedcase" = yes ; then
4064         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
4065 set dummy ${ETAGS:-etags}; ac_word=$2
4066 echo "$as_me:4066: checking for $ac_word" >&5
4067 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4068 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
4069   echo $ECHO_N "(cached) $ECHO_C" >&6
4070 else
4071   if test -n "$MAKE_UPPER_TAGS"; then
4072   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
4073 else
4074   ac_save_IFS=$IFS; IFS=$ac_path_separator
4075 ac_dummy="$PATH"
4076 for ac_dir in $ac_dummy; do
4077   IFS=$ac_save_IFS
4078   test -z "$ac_dir" && ac_dir=.
4079   $as_executable_p "$ac_dir/$ac_word" || continue
4080 ac_cv_prog_MAKE_UPPER_TAGS="yes"
4081 echo "$as_me:4081: found $ac_dir/$ac_word" >&5
4082 break
4083 done
4084
4085   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
4086 fi
4087 fi
4088 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
4089 if test -n "$MAKE_UPPER_TAGS"; then
4090   echo "$as_me:4090: result: $MAKE_UPPER_TAGS" >&5
4091 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
4092 else
4093   echo "$as_me:4093: result: no" >&5
4094 echo "${ECHO_T}no" >&6
4095 fi
4096
4097 else
4098         MAKE_UPPER_TAGS=no
4099 fi
4100
4101 if test "$MAKE_UPPER_TAGS" = yes ; then
4102         MAKE_UPPER_TAGS=
4103 else
4104         MAKE_UPPER_TAGS="#"
4105 fi
4106
4107 if test "$MAKE_LOWER_TAGS" = yes ; then
4108         MAKE_LOWER_TAGS=
4109 else
4110         MAKE_LOWER_TAGS="#"
4111 fi
4112
4113 echo "$as_me:4113: checking for makeflags variable" >&5
4114 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
4115 if test "${cf_cv_makeflags+set}" = set; then
4116   echo $ECHO_N "(cached) $ECHO_C" >&6
4117 else
4118
4119         cf_cv_makeflags=''
4120         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
4121         do
4122                 cat >cf_makeflags.tmp <<CF_EOF
4123 SHELL = $SHELL
4124 all :
4125         @ echo '.$cf_option'
4126 CF_EOF
4127                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
4128                 case "$cf_result" in
4129                 (.*k|.*kw)
4130                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
4131                         case "$cf_result" in
4132                         (.*CC=*)        cf_cv_makeflags=
4133                                 ;;
4134                         (*)     cf_cv_makeflags=$cf_option
4135                                 ;;
4136                         esac
4137                         break
4138                         ;;
4139                 (.-)
4140                         ;;
4141                 (*)
4142
4143 echo "${as_me:-configure}:4143: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
4144
4145                         ;;
4146                 esac
4147         done
4148         rm -f cf_makeflags.tmp
4149
4150 fi
4151 echo "$as_me:4151: result: $cf_cv_makeflags" >&5
4152 echo "${ECHO_T}$cf_cv_makeflags" >&6
4153
4154 if test -n "$ac_tool_prefix"; then
4155   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4156 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4157 echo "$as_me:4157: checking for $ac_word" >&5
4158 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4159 if test "${ac_cv_prog_RANLIB+set}" = set; then
4160   echo $ECHO_N "(cached) $ECHO_C" >&6
4161 else
4162   if test -n "$RANLIB"; then
4163   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4164 else
4165   ac_save_IFS=$IFS; IFS=$ac_path_separator
4166 ac_dummy="$PATH"
4167 for ac_dir in $ac_dummy; do
4168   IFS=$ac_save_IFS
4169   test -z "$ac_dir" && ac_dir=.
4170   $as_executable_p "$ac_dir/$ac_word" || continue
4171 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4172 echo "$as_me:4172: found $ac_dir/$ac_word" >&5
4173 break
4174 done
4175
4176 fi
4177 fi
4178 RANLIB=$ac_cv_prog_RANLIB
4179 if test -n "$RANLIB"; then
4180   echo "$as_me:4180: result: $RANLIB" >&5
4181 echo "${ECHO_T}$RANLIB" >&6
4182 else
4183   echo "$as_me:4183: result: no" >&5
4184 echo "${ECHO_T}no" >&6
4185 fi
4186
4187 fi
4188 if test -z "$ac_cv_prog_RANLIB"; then
4189   ac_ct_RANLIB=$RANLIB
4190   # Extract the first word of "ranlib", so it can be a program name with args.
4191 set dummy ranlib; ac_word=$2
4192 echo "$as_me:4192: checking for $ac_word" >&5
4193 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4194 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
4195   echo $ECHO_N "(cached) $ECHO_C" >&6
4196 else
4197   if test -n "$ac_ct_RANLIB"; then
4198   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
4199 else
4200   ac_save_IFS=$IFS; IFS=$ac_path_separator
4201 ac_dummy="$PATH"
4202 for ac_dir in $ac_dummy; do
4203   IFS=$ac_save_IFS
4204   test -z "$ac_dir" && ac_dir=.
4205   $as_executable_p "$ac_dir/$ac_word" || continue
4206 ac_cv_prog_ac_ct_RANLIB="ranlib"
4207 echo "$as_me:4207: found $ac_dir/$ac_word" >&5
4208 break
4209 done
4210
4211   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
4212 fi
4213 fi
4214 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
4215 if test -n "$ac_ct_RANLIB"; then
4216   echo "$as_me:4216: result: $ac_ct_RANLIB" >&5
4217 echo "${ECHO_T}$ac_ct_RANLIB" >&6
4218 else
4219   echo "$as_me:4219: result: no" >&5
4220 echo "${ECHO_T}no" >&6
4221 fi
4222
4223   RANLIB=$ac_ct_RANLIB
4224 else
4225   RANLIB="$ac_cv_prog_RANLIB"
4226 fi
4227
4228 if test -n "$ac_tool_prefix"; then
4229   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
4230 set dummy ${ac_tool_prefix}ld; ac_word=$2
4231 echo "$as_me:4231: checking for $ac_word" >&5
4232 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4233 if test "${ac_cv_prog_LD+set}" = set; then
4234   echo $ECHO_N "(cached) $ECHO_C" >&6
4235 else
4236   if test -n "$LD"; then
4237   ac_cv_prog_LD="$LD" # Let the user override the test.
4238 else
4239   ac_save_IFS=$IFS; IFS=$ac_path_separator
4240 ac_dummy="$PATH"
4241 for ac_dir in $ac_dummy; do
4242   IFS=$ac_save_IFS
4243   test -z "$ac_dir" && ac_dir=.
4244   $as_executable_p "$ac_dir/$ac_word" || continue
4245 ac_cv_prog_LD="${ac_tool_prefix}ld"
4246 echo "$as_me:4246: found $ac_dir/$ac_word" >&5
4247 break
4248 done
4249
4250 fi
4251 fi
4252 LD=$ac_cv_prog_LD
4253 if test -n "$LD"; then
4254   echo "$as_me:4254: result: $LD" >&5
4255 echo "${ECHO_T}$LD" >&6
4256 else
4257   echo "$as_me:4257: result: no" >&5
4258 echo "${ECHO_T}no" >&6
4259 fi
4260
4261 fi
4262 if test -z "$ac_cv_prog_LD"; then
4263   ac_ct_LD=$LD
4264   # Extract the first word of "ld", so it can be a program name with args.
4265 set dummy ld; ac_word=$2
4266 echo "$as_me:4266: checking for $ac_word" >&5
4267 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4268 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
4269   echo $ECHO_N "(cached) $ECHO_C" >&6
4270 else
4271   if test -n "$ac_ct_LD"; then
4272   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
4273 else
4274   ac_save_IFS=$IFS; IFS=$ac_path_separator
4275 ac_dummy="$PATH"
4276 for ac_dir in $ac_dummy; do
4277   IFS=$ac_save_IFS
4278   test -z "$ac_dir" && ac_dir=.
4279   $as_executable_p "$ac_dir/$ac_word" || continue
4280 ac_cv_prog_ac_ct_LD="ld"
4281 echo "$as_me:4281: found $ac_dir/$ac_word" >&5
4282 break
4283 done
4284
4285   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
4286 fi
4287 fi
4288 ac_ct_LD=$ac_cv_prog_ac_ct_LD
4289 if test -n "$ac_ct_LD"; then
4290   echo "$as_me:4290: result: $ac_ct_LD" >&5
4291 echo "${ECHO_T}$ac_ct_LD" >&6
4292 else
4293   echo "$as_me:4293: result: no" >&5
4294 echo "${ECHO_T}no" >&6
4295 fi
4296
4297   LD=$ac_ct_LD
4298 else
4299   LD="$ac_cv_prog_LD"
4300 fi
4301
4302 if test -n "$ac_tool_prefix"; then
4303   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
4304 set dummy ${ac_tool_prefix}ar; ac_word=$2
4305 echo "$as_me:4305: checking for $ac_word" >&5
4306 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4307 if test "${ac_cv_prog_AR+set}" = set; then
4308   echo $ECHO_N "(cached) $ECHO_C" >&6
4309 else
4310   if test -n "$AR"; then
4311   ac_cv_prog_AR="$AR" # Let the user override the test.
4312 else
4313   ac_save_IFS=$IFS; IFS=$ac_path_separator
4314 ac_dummy="$PATH"
4315 for ac_dir in $ac_dummy; do
4316   IFS=$ac_save_IFS
4317   test -z "$ac_dir" && ac_dir=.
4318   $as_executable_p "$ac_dir/$ac_word" || continue
4319 ac_cv_prog_AR="${ac_tool_prefix}ar"
4320 echo "$as_me:4320: found $ac_dir/$ac_word" >&5
4321 break
4322 done
4323
4324 fi
4325 fi
4326 AR=$ac_cv_prog_AR
4327 if test -n "$AR"; then
4328   echo "$as_me:4328: result: $AR" >&5
4329 echo "${ECHO_T}$AR" >&6
4330 else
4331   echo "$as_me:4331: result: no" >&5
4332 echo "${ECHO_T}no" >&6
4333 fi
4334
4335 fi
4336 if test -z "$ac_cv_prog_AR"; then
4337   ac_ct_AR=$AR
4338   # Extract the first word of "ar", so it can be a program name with args.
4339 set dummy ar; ac_word=$2
4340 echo "$as_me:4340: checking for $ac_word" >&5
4341 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4342 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4343   echo $ECHO_N "(cached) $ECHO_C" >&6
4344 else
4345   if test -n "$ac_ct_AR"; then
4346   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4347 else
4348   ac_save_IFS=$IFS; IFS=$ac_path_separator
4349 ac_dummy="$PATH"
4350 for ac_dir in $ac_dummy; do
4351   IFS=$ac_save_IFS
4352   test -z "$ac_dir" && ac_dir=.
4353   $as_executable_p "$ac_dir/$ac_word" || continue
4354 ac_cv_prog_ac_ct_AR="ar"
4355 echo "$as_me:4355: found $ac_dir/$ac_word" >&5
4356 break
4357 done
4358
4359   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4360 fi
4361 fi
4362 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4363 if test -n "$ac_ct_AR"; then
4364   echo "$as_me:4364: result: $ac_ct_AR" >&5
4365 echo "${ECHO_T}$ac_ct_AR" >&6
4366 else
4367   echo "$as_me:4367: result: no" >&5
4368 echo "${ECHO_T}no" >&6
4369 fi
4370
4371   AR=$ac_ct_AR
4372 else
4373   AR="$ac_cv_prog_AR"
4374 fi
4375
4376 if test -n "$ac_tool_prefix"; then
4377   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
4378 set dummy ${ac_tool_prefix}ar; ac_word=$2
4379 echo "$as_me:4379: checking for $ac_word" >&5
4380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4381 if test "${ac_cv_prog_AR+set}" = set; then
4382   echo $ECHO_N "(cached) $ECHO_C" >&6
4383 else
4384   if test -n "$AR"; then
4385   ac_cv_prog_AR="$AR" # Let the user override the test.
4386 else
4387   ac_save_IFS=$IFS; IFS=$ac_path_separator
4388 ac_dummy="$PATH"
4389 for ac_dir in $ac_dummy; do
4390   IFS=$ac_save_IFS
4391   test -z "$ac_dir" && ac_dir=.
4392   $as_executable_p "$ac_dir/$ac_word" || continue
4393 ac_cv_prog_AR="${ac_tool_prefix}ar"
4394 echo "$as_me:4394: found $ac_dir/$ac_word" >&5
4395 break
4396 done
4397
4398 fi
4399 fi
4400 AR=$ac_cv_prog_AR
4401 if test -n "$AR"; then
4402   echo "$as_me:4402: result: $AR" >&5
4403 echo "${ECHO_T}$AR" >&6
4404 else
4405   echo "$as_me:4405: result: no" >&5
4406 echo "${ECHO_T}no" >&6
4407 fi
4408
4409 fi
4410 if test -z "$ac_cv_prog_AR"; then
4411   ac_ct_AR=$AR
4412   # Extract the first word of "ar", so it can be a program name with args.
4413 set dummy ar; ac_word=$2
4414 echo "$as_me:4414: checking for $ac_word" >&5
4415 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4416 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4417   echo $ECHO_N "(cached) $ECHO_C" >&6
4418 else
4419   if test -n "$ac_ct_AR"; then
4420   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4421 else
4422   ac_save_IFS=$IFS; IFS=$ac_path_separator
4423 ac_dummy="$PATH"
4424 for ac_dir in $ac_dummy; do
4425   IFS=$ac_save_IFS
4426   test -z "$ac_dir" && ac_dir=.
4427   $as_executable_p "$ac_dir/$ac_word" || continue
4428 ac_cv_prog_ac_ct_AR="ar"
4429 echo "$as_me:4429: found $ac_dir/$ac_word" >&5
4430 break
4431 done
4432
4433   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4434 fi
4435 fi
4436 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4437 if test -n "$ac_ct_AR"; then
4438   echo "$as_me:4438: result: $ac_ct_AR" >&5
4439 echo "${ECHO_T}$ac_ct_AR" >&6
4440 else
4441   echo "$as_me:4441: result: no" >&5
4442 echo "${ECHO_T}no" >&6
4443 fi
4444
4445   AR=$ac_ct_AR
4446 else
4447   AR="$ac_cv_prog_AR"
4448 fi
4449
4450 echo "$as_me:4450: checking for options to update archives" >&5
4451 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4452 if test "${cf_cv_ar_flags+set}" = set; then
4453   echo $ECHO_N "(cached) $ECHO_C" >&6
4454 else
4455
4456         case "$cf_cv_system_name" in
4457         (*-msvc*)
4458                 cf_cv_ar_flags=''
4459                 cat >mk_static_lib.sh <<-EOF
4460                 #!$SHELL
4461                 MSVC_BIN="$AR"
4462                 out="\$1"
4463                 shift
4464                 exec \$MSVC_BIN -out:"\$out" \$@
4465                 EOF
4466                 chmod +x mk_static_lib.sh
4467                 AR=`pwd`/mk_static_lib.sh
4468                 ;;
4469         (*)
4470                 cf_cv_ar_flags=unknown
4471                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4472                 do
4473
4474                         # check if $ARFLAGS already contains this choice
4475                         if test "x$ARFLAGS" != "x" ; then
4476                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4477                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4478                                         cf_cv_ar_flags=
4479                                         break
4480                                 fi
4481                         fi
4482
4483                         rm -f "conftest.$ac_cv_objext"
4484                         rm -f conftest.a
4485
4486                         cat >"conftest.$ac_ext" <<EOF
4487 #line 4487 "configure"
4488 int     testdata[3] = { 123, 456, 789 };
4489 EOF
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"); } ; then
4495                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4496                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4497                                 if test -f conftest.a ; then
4498                                         cf_cv_ar_flags="$cf_ar_flags"
4499                                         break
4500                                 fi
4501                         else
4502                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4503
4504 echo "${as_me:-configure}:4504: testing cannot compile test-program ..." 1>&5
4505
4506                                 break
4507                         fi
4508                 done
4509                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4510                 ;;
4511         esac
4512
4513 fi
4514 echo "$as_me:4514: result: $cf_cv_ar_flags" >&5
4515 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4516
4517 if test -n "$ARFLAGS" ; then
4518         if test -n "$cf_cv_ar_flags" ; then
4519                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4520         fi
4521 else
4522         ARFLAGS=$cf_cv_ar_flags
4523 fi
4524
4525         echo "$as_me:4525: checking for PATH separator" >&5
4526 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4527         case "$cf_cv_system_name" in
4528         (os2*)  PATH_SEPARATOR=';'  ;;
4529         (*)     ${PATH_SEPARATOR:=':'}  ;;
4530         esac
4531
4532         echo "$as_me:4532: result: $PATH_SEPARATOR" >&5
4533 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4534
4535 echo "$as_me:4535: checking if you have specified an install-prefix" >&5
4536 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4537
4538 # Check whether --with-install-prefix or --without-install-prefix was given.
4539 if test "${with_install_prefix+set}" = set; then
4540   withval="$with_install_prefix"
4541   case "$withval" in
4542         (yes|no)
4543                 ;;
4544         (*)     DESTDIR="$withval"
4545                 ;;
4546         esac
4547 fi;
4548 echo "$as_me:4548: result: $DESTDIR" >&5
4549 echo "${ECHO_T}$DESTDIR" >&6
4550
4551 ###############################################################################
4552
4553 # If we're cross-compiling, allow the user to override the tools and their
4554 # options.  The configure script is oriented toward identifying the host
4555 # compiler, etc., but we need a build compiler to generate parts of the source.
4556
4557 if test "$cross_compiling" = yes ; then
4558
4559         # defaults that we might want to override
4560         : ${BUILD_CFLAGS:=''}
4561         : ${BUILD_CPPFLAGS:=''}
4562         : ${BUILD_LDFLAGS:=''}
4563         : ${BUILD_LIBS:=''}
4564         : ${BUILD_EXEEXT:='$x'}
4565         : ${BUILD_OBJEXT:='o'}
4566
4567 # Check whether --with-build-cc or --without-build-cc was given.
4568 if test "${with_build_cc+set}" = set; then
4569   withval="$with_build_cc"
4570   BUILD_CC="$withval"
4571 else
4572   for ac_prog in gcc clang c99 c89 cc cl
4573 do
4574   # Extract the first word of "$ac_prog", so it can be a program name with args.
4575 set dummy $ac_prog; ac_word=$2
4576 echo "$as_me:4576: checking for $ac_word" >&5
4577 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4578 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4579   echo $ECHO_N "(cached) $ECHO_C" >&6
4580 else
4581   if test -n "$BUILD_CC"; then
4582   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4583 else
4584   ac_save_IFS=$IFS; IFS=$ac_path_separator
4585 ac_dummy="$PATH"
4586 for ac_dir in $ac_dummy; do
4587   IFS=$ac_save_IFS
4588   test -z "$ac_dir" && ac_dir=.
4589   $as_executable_p "$ac_dir/$ac_word" || continue
4590 ac_cv_prog_BUILD_CC="$ac_prog"
4591 echo "$as_me:4591: found $ac_dir/$ac_word" >&5
4592 break
4593 done
4594
4595 fi
4596 fi
4597 BUILD_CC=$ac_cv_prog_BUILD_CC
4598 if test -n "$BUILD_CC"; then
4599   echo "$as_me:4599: result: $BUILD_CC" >&5
4600 echo "${ECHO_T}$BUILD_CC" >&6
4601 else
4602   echo "$as_me:4602: result: no" >&5
4603 echo "${ECHO_T}no" >&6
4604 fi
4605
4606   test -n "$BUILD_CC" && break
4607 done
4608 test -n "$BUILD_CC" || BUILD_CC="none"
4609
4610 fi;
4611         echo "$as_me:4611: checking for native build C compiler" >&5
4612 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4613         echo "$as_me:4613: result: $BUILD_CC" >&5
4614 echo "${ECHO_T}$BUILD_CC" >&6
4615
4616         echo "$as_me:4616: checking for native build C preprocessor" >&5
4617 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4618
4619 # Check whether --with-build-cpp or --without-build-cpp was given.
4620 if test "${with_build_cpp+set}" = set; then
4621   withval="$with_build_cpp"
4622   BUILD_CPP="$withval"
4623 else
4624   BUILD_CPP='${BUILD_CC} -E'
4625 fi;
4626         echo "$as_me:4626: result: $BUILD_CPP" >&5
4627 echo "${ECHO_T}$BUILD_CPP" >&6
4628
4629         echo "$as_me:4629: checking for native build C flags" >&5
4630 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4631
4632 # Check whether --with-build-cflags or --without-build-cflags was given.
4633 if test "${with_build_cflags+set}" = set; then
4634   withval="$with_build_cflags"
4635   BUILD_CFLAGS="$withval"
4636 fi;
4637         echo "$as_me:4637: result: $BUILD_CFLAGS" >&5
4638 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4639
4640         echo "$as_me:4640: checking for native build C preprocessor-flags" >&5
4641 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4642
4643 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4644 if test "${with_build_cppflags+set}" = set; then
4645   withval="$with_build_cppflags"
4646   BUILD_CPPFLAGS="$withval"
4647 fi;
4648         echo "$as_me:4648: result: $BUILD_CPPFLAGS" >&5
4649 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4650
4651         echo "$as_me:4651: checking for native build linker-flags" >&5
4652 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4653
4654 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4655 if test "${with_build_ldflags+set}" = set; then
4656   withval="$with_build_ldflags"
4657   BUILD_LDFLAGS="$withval"
4658 fi;
4659         echo "$as_me:4659: result: $BUILD_LDFLAGS" >&5
4660 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4661
4662         echo "$as_me:4662: checking for native build linker-libraries" >&5
4663 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4664
4665 # Check whether --with-build-libs or --without-build-libs was given.
4666 if test "${with_build_libs+set}" = set; then
4667   withval="$with_build_libs"
4668   BUILD_LIBS="$withval"
4669 fi;
4670         echo "$as_me:4670: result: $BUILD_LIBS" >&5
4671 echo "${ECHO_T}$BUILD_LIBS" >&6
4672
4673         # this assumes we're on Unix.
4674         BUILD_EXEEXT=
4675         BUILD_OBJEXT=o
4676
4677         : ${BUILD_CC:='${CC}'}
4678
4679         echo "$as_me:4679: checking if the build-compiler \"$BUILD_CC\" works" >&5
4680 echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4681
4682         cf_save_crossed=$cross_compiling
4683         cf_save_ac_link=$ac_link
4684         cross_compiling=no
4685         cf_build_cppflags=$BUILD_CPPFLAGS
4686         test "$cf_build_cppflags" = "#" && cf_build_cppflags=
4687         ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $cf_build_cppflags $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4688
4689         if test "$cross_compiling" = yes; then
4690   cf_ok_build_cc=unknown
4691 else
4692   cat >"conftest.$ac_ext" <<_ACEOF
4693 #line 4693 "configure"
4694 #include "confdefs.h"
4695 #include <stdio.h>
4696                 int main(int argc, char *argv[])
4697                 {
4698                         ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4699                 }
4700
4701 _ACEOF
4702 rm -f "conftest$ac_exeext"
4703 if { (eval echo "$as_me:4703: \"$ac_link\"") >&5
4704   (eval $ac_link) 2>&5
4705   ac_status=$?
4706   echo "$as_me:4706: \$? = $ac_status" >&5
4707   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4708   { (eval echo "$as_me:4708: \"$ac_try\"") >&5
4709   (eval $ac_try) 2>&5
4710   ac_status=$?
4711   echo "$as_me:4711: \$? = $ac_status" >&5
4712   (exit "$ac_status"); }; }; then
4713   cf_ok_build_cc=yes
4714 else
4715   echo "$as_me: program exited with status $ac_status" >&5
4716 echo "$as_me: failed program was:" >&5
4717 cat "conftest.$ac_ext" >&5
4718 cf_ok_build_cc=no
4719 fi
4720 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4721 fi
4722
4723         cross_compiling=$cf_save_crossed
4724         ac_link=$cf_save_ac_link
4725
4726         echo "$as_me:4726: result: $cf_ok_build_cc" >&5
4727 echo "${ECHO_T}$cf_ok_build_cc" >&6
4728
4729         if test "$cf_ok_build_cc" != yes
4730         then
4731                 { { echo "$as_me:4731: error: Cross-build requires two compilers.
4732 Use --with-build-cc to specify the native compiler." >&5
4733 echo "$as_me: error: Cross-build requires two compilers.
4734 Use --with-build-cc to specify the native compiler." >&2;}
4735    { (exit 1); exit 1; }; }
4736         fi
4737
4738 else
4739         : ${BUILD_CC:='${CC}'}
4740         : ${BUILD_CPP:='${CPP}'}
4741         : ${BUILD_CFLAGS:='${CFLAGS}'}
4742         : ${BUILD_CPPFLAGS:=''${CPPFLAGS}''}
4743         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4744         : ${BUILD_LIBS:=''${LIBS}''}
4745         : ${BUILD_EXEEXT:='$x'}
4746         : ${BUILD_OBJEXT:='o'}
4747 fi
4748
4749 ###############################################################################
4750
4751 ### Options to allow the user to specify the set of libraries which are used.
4752 ### Use "--without-normal --with-shared" to allow the default model to be
4753 ### shared, for example.
4754 cf_list_models=""
4755
4756 echo "$as_me:4756: checking if you want to build shared C-objects" >&5
4757 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4758
4759 # Check whether --with-shared or --without-shared was given.
4760 if test "${with_shared+set}" = set; then
4761   withval="$with_shared"
4762   with_shared=$withval
4763 else
4764   with_shared=no
4765 fi;
4766 echo "$as_me:4766: result: $with_shared" >&5
4767 echo "${ECHO_T}$with_shared" >&6
4768 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4769
4770 echo "$as_me:4770: checking for specified models" >&5
4771 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4772 test -z "$cf_list_models" && cf_list_models=normal
4773 echo "$as_me:4773: result: $cf_list_models" >&5
4774 echo "${ECHO_T}$cf_list_models" >&6
4775
4776 ### Use the first model as the default, and save its suffix for use in building
4777 ### up test-applications.
4778 echo "$as_me:4778: checking for default model" >&5
4779 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4780 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4781 echo "$as_me:4781: result: $DFT_LWR_MODEL" >&5
4782 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4783
4784 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4785
4786 echo "$as_me:4786: checking for specific curses-directory" >&5
4787 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4788
4789 # Check whether --with-curses-dir or --without-curses-dir was given.
4790 if test "${with_curses_dir+set}" = set; then
4791   withval="$with_curses_dir"
4792   cf_cv_curses_dir=$withval
4793 else
4794   cf_cv_curses_dir=no
4795 fi;
4796 echo "$as_me:4796: result: $cf_cv_curses_dir" >&5
4797 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4798
4799 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4800 then
4801
4802 if test "x$prefix" != xNONE; then
4803         cf_path_syntax="$prefix"
4804 else
4805         cf_path_syntax="$ac_default_prefix"
4806 fi
4807
4808 case ".$withval" in
4809 (.\$\(*\)*|.\'*\'*)
4810         ;;
4811 (..|./*|.\\*)
4812         ;;
4813 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4814         ;;
4815 (.\$\{*prefix\}*|.\$\{*dir\}*)
4816         eval withval="$withval"
4817         case ".$withval" in
4818         (.NONE/*)
4819                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4820                 ;;
4821         esac
4822         ;;
4823 (.no|.NONE/*)
4824         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4825         ;;
4826 (*)
4827         { { echo "$as_me:4827: error: expected a pathname, not \"$withval\"" >&5
4828 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4829    { (exit 1); exit 1; }; }
4830         ;;
4831 esac
4832
4833         if test -d "$cf_cv_curses_dir"
4834         then
4835
4836 if test -n "$cf_cv_curses_dir/include" ; then
4837   for cf_add_incdir in $cf_cv_curses_dir/include
4838   do
4839         while test "$cf_add_incdir" != /usr/include
4840         do
4841           if test -d "$cf_add_incdir"
4842           then
4843                 cf_have_incdir=no
4844                 if test -n "$CFLAGS$CPPFLAGS" ; then
4845                   # a loop is needed to ensure we can add subdirs of existing dirs
4846                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4847                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4848                           cf_have_incdir=yes; break
4849                         fi
4850                   done
4851                 fi
4852
4853                 if test "$cf_have_incdir" = no ; then
4854                   if test "$cf_add_incdir" = /usr/local/include ; then
4855                         if test "$GCC" = yes
4856                         then
4857                           cf_save_CPPFLAGS=$CPPFLAGS
4858
4859         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4860         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4861
4862                           cat >"conftest.$ac_ext" <<_ACEOF
4863 #line 4863 "configure"
4864 #include "confdefs.h"
4865 #include <stdio.h>
4866 int
4867 main (void)
4868 {
4869 printf("Hello")
4870   ;
4871   return 0;
4872 }
4873 _ACEOF
4874 rm -f "conftest.$ac_objext"
4875 if { (eval echo "$as_me:4875: \"$ac_compile\"") >&5
4876   (eval $ac_compile) 2>&5
4877   ac_status=$?
4878   echo "$as_me:4878: \$? = $ac_status" >&5
4879   (exit "$ac_status"); } &&
4880          { ac_try='test -s "conftest.$ac_objext"'
4881   { (eval echo "$as_me:4881: \"$ac_try\"") >&5
4882   (eval $ac_try) 2>&5
4883   ac_status=$?
4884   echo "$as_me:4884: \$? = $ac_status" >&5
4885   (exit "$ac_status"); }; }; then
4886   :
4887 else
4888   echo "$as_me: failed program was:" >&5
4889 cat "conftest.$ac_ext" >&5
4890 cf_have_incdir=yes
4891 fi
4892 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4893                           CPPFLAGS=$cf_save_CPPFLAGS
4894                         fi
4895                   fi
4896                 fi
4897
4898                 if test "$cf_have_incdir" = no ; then
4899                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4900
4901 echo "${as_me:-configure}:4901: testing adding $cf_add_incdir to include-path ..." 1>&5
4902
4903                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4904
4905                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4906                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4907                   cf_add_incdir="$cf_top_incdir"
4908                 else
4909                   break
4910                 fi
4911           else
4912                 break
4913           fi
4914         done
4915   done
4916 fi
4917
4918 if test -n "$cf_cv_curses_dir/lib" ; then
4919         for cf_add_libdir in $cf_cv_curses_dir/lib
4920         do
4921                 if test "$cf_add_libdir" = /usr/lib ; then
4922                         :
4923                 elif test -d "$cf_add_libdir"
4924                 then
4925                         cf_have_libdir=no
4926                         if test -n "$LDFLAGS$LIBS" ; then
4927                                 # a loop is needed to ensure we can add subdirs of existing dirs
4928                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4929                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4930                                                 cf_have_libdir=yes; break
4931                                         fi
4932                                 done
4933                         fi
4934                         if test "$cf_have_libdir" = no ; then
4935                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4936
4937 echo "${as_me:-configure}:4937: testing adding $cf_add_libdir to library-path ..." 1>&5
4938
4939                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4940                         fi
4941                 fi
4942         done
4943 fi
4944
4945         fi
4946 fi
4947
4948 cf_ncuconfig_root=ncurses
4949 cf_have_ncuconfig=no
4950
4951 if test "x${PKG_CONFIG:=none}" != xnone; then
4952         echo "$as_me:4952: checking pkg-config for $cf_ncuconfig_root" >&5
4953 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4954         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4955                 echo "$as_me:4955: result: yes" >&5
4956 echo "${ECHO_T}yes" >&6
4957
4958                 echo "$as_me:4958: checking if the $cf_ncuconfig_root package files work" >&5
4959 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4960                 cf_have_ncuconfig=unknown
4961
4962                 cf_save_CFLAGS="$CFLAGS"
4963                 cf_save_CPPFLAGS="$CPPFLAGS"
4964                 cf_save_LIBS="$LIBS"
4965
4966                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4967                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4968
4969                 # while -W for passing linker flags is prevalent, it is not "standard".
4970                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4971                 # incompatible _and_ non-standard -W option which gives an error.  Work
4972                 # around that pitfall.
4973                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4974                 (x*c[89]9@@*-W*)
4975
4976 cf_fix_cppflags=no
4977 cf_new_cflags=
4978 cf_new_cppflags=
4979 cf_new_extra_cppflags=
4980
4981 for cf_add_cflags in $cf_pkg_cflags
4982 do
4983 case "$cf_fix_cppflags" in
4984 (no)
4985         case "$cf_add_cflags" in
4986         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4987                 case "$cf_add_cflags" in
4988                 (-D*)
4989                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4990
4991                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4992                                 && test -z "${cf_tst_cflags}" \
4993                                 && cf_fix_cppflags=yes
4994
4995                         if test "$cf_fix_cppflags" = yes ; then
4996
4997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4999
5000                                 continue
5001                         elif test "${cf_tst_cflags}" = "\"'" ; then
5002
5003         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5004         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5005
5006                                 continue
5007                         fi
5008                         ;;
5009                 esac
5010                 case "$CPPFLAGS" in
5011                 (*$cf_add_cflags)
5012                         ;;
5013                 (*)
5014                         case "$cf_add_cflags" in
5015                         (-D*)
5016                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5017
5018 CPPFLAGS=`echo "$CPPFLAGS" | \
5019         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5020                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5021
5022                                 ;;
5023                         esac
5024
5025         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5026         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5027
5028                         ;;
5029                 esac
5030                 ;;
5031         (*)
5032
5033         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5034         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5035
5036                 ;;
5037         esac
5038         ;;
5039 (yes)
5040
5041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5043
5044         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5045
5046         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5047                 && test -z "${cf_tst_cflags}" \
5048                 && cf_fix_cppflags=no
5049         ;;
5050 esac
5051 done
5052
5053 if test -n "$cf_new_cflags" ; then
5054
5055         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5056         CFLAGS="${CFLAGS}$cf_new_cflags"
5057
5058 fi
5059
5060 if test -n "$cf_new_cppflags" ; then
5061
5062         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5063         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5064
5065 fi
5066
5067 if test -n "$cf_new_extra_cppflags" ; then
5068
5069         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5070         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5071
5072 fi
5073
5074 cf_add_libs="$LIBS"
5075 # reverse order
5076 cf_add_0lib=
5077 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5078 # filter duplicates
5079 for cf_add_1lib in $cf_add_0lib; do
5080         for cf_add_2lib in $cf_add_libs; do
5081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5082                         cf_add_1lib=
5083                         break
5084                 fi
5085         done
5086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5087 done
5088 LIBS="$cf_add_libs"
5089
5090                         cat >"conftest.$ac_ext" <<_ACEOF
5091 #line 5091 "configure"
5092 #include "confdefs.h"
5093 #include <${cf_cv_ncurses_header:-curses.h}>
5094 int
5095 main (void)
5096 {
5097 initscr(); mousemask(0,0); tigetstr((char *)0);
5098   ;
5099   return 0;
5100 }
5101 _ACEOF
5102 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5103 if { (eval echo "$as_me:5103: \"$ac_link\"") >&5
5104   (eval $ac_link) 2>&5
5105   ac_status=$?
5106   echo "$as_me:5106: \$? = $ac_status" >&5
5107   (exit "$ac_status"); } &&
5108          { ac_try='test -s "conftest$ac_exeext"'
5109   { (eval echo "$as_me:5109: \"$ac_try\"") >&5
5110   (eval $ac_try) 2>&5
5111   ac_status=$?
5112   echo "$as_me:5112: \$? = $ac_status" >&5
5113   (exit "$ac_status"); }; }; then
5114   if test "$cross_compiling" = yes; then
5115   cf_test_ncuconfig=maybe
5116 else
5117   cat >"conftest.$ac_ext" <<_ACEOF
5118 #line 5118 "configure"
5119 #include "confdefs.h"
5120 #include <${cf_cv_ncurses_header:-curses.h}>
5121                                         int main(void)
5122                                         { const char *xx = curses_version(); return (xx == 0); }
5123 _ACEOF
5124 rm -f "conftest$ac_exeext"
5125 if { (eval echo "$as_me:5125: \"$ac_link\"") >&5
5126   (eval $ac_link) 2>&5
5127   ac_status=$?
5128   echo "$as_me:5128: \$? = $ac_status" >&5
5129   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5130   { (eval echo "$as_me:5130: \"$ac_try\"") >&5
5131   (eval $ac_try) 2>&5
5132   ac_status=$?
5133   echo "$as_me:5133: \$? = $ac_status" >&5
5134   (exit "$ac_status"); }; }; then
5135   cf_test_ncuconfig=yes
5136 else
5137   echo "$as_me: program exited with status $ac_status" >&5
5138 echo "$as_me: failed program was:" >&5
5139 cat "conftest.$ac_ext" >&5
5140 cf_test_ncuconfig=no
5141 fi
5142 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5143 fi
5144 else
5145   echo "$as_me: failed program was:" >&5
5146 cat "conftest.$ac_ext" >&5
5147 cf_test_ncuconfig=no
5148 fi
5149 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5150
5151                         CFLAGS="$cf_save_CFLAGS"
5152                         CPPFLAGS="$cf_save_CPPFLAGS"
5153                         LIBS="$cf_save_LIBS"
5154
5155                         if test "x$cf_test_ncuconfig" != xyes; then
5156                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
5157                                 cf_pkg_cflags="$cf_temp"
5158                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
5159                                 cf_pkg_libs="$cf_temp"
5160                         fi
5161                         ;;
5162                 esac
5163
5164 for cf_add_cflags in $cf_pkg_cflags
5165 do
5166         case "x$cf_add_cflags" in
5167         (x-[DU]*)
5168
5169 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5170 while true
5171 do
5172         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'`
5173         test "$CFLAGS" != "$cf_old_cflag" || break
5174
5175         CFLAGS="$cf_old_cflag"
5176 done
5177
5178 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5179 while true
5180 do
5181         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'`
5182         test "$CPPFLAGS" != "$cf_old_cflag" || break
5183
5184         CPPFLAGS="$cf_old_cflag"
5185 done
5186
5187                 ;;
5188         esac
5189
5190 cf_fix_cppflags=no
5191 cf_new_cflags=
5192 cf_new_cppflags=
5193 cf_new_extra_cppflags=
5194
5195 for cf_add_cflags in $cf_add_cflags
5196 do
5197 case "$cf_fix_cppflags" in
5198 (no)
5199         case "$cf_add_cflags" in
5200         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5201                 case "$cf_add_cflags" in
5202                 (-D*)
5203                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5204
5205                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5206                                 && test -z "${cf_tst_cflags}" \
5207                                 && cf_fix_cppflags=yes
5208
5209                         if test "$cf_fix_cppflags" = yes ; then
5210
5211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5213
5214                                 continue
5215                         elif test "${cf_tst_cflags}" = "\"'" ; then
5216
5217         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5218         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5219
5220                                 continue
5221                         fi
5222                         ;;
5223                 esac
5224                 case "$CPPFLAGS" in
5225                 (*$cf_add_cflags)
5226                         ;;
5227                 (*)
5228                         case "$cf_add_cflags" in
5229                         (-D*)
5230                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5231
5232 CPPFLAGS=`echo "$CPPFLAGS" | \
5233         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5234                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5235
5236                                 ;;
5237                         esac
5238
5239         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5240         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5241
5242                         ;;
5243                 esac
5244                 ;;
5245         (*)
5246
5247         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5248         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5249
5250                 ;;
5251         esac
5252         ;;
5253 (yes)
5254
5255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5257
5258         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5259
5260         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5261                 && test -z "${cf_tst_cflags}" \
5262                 && cf_fix_cppflags=no
5263         ;;
5264 esac
5265 done
5266
5267 if test -n "$cf_new_cflags" ; then
5268
5269         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5270         CFLAGS="${CFLAGS}$cf_new_cflags"
5271
5272 fi
5273
5274 if test -n "$cf_new_cppflags" ; then
5275
5276         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5277         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5278
5279 fi
5280
5281 if test -n "$cf_new_extra_cppflags" ; then
5282
5283         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5284         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5285
5286 fi
5287
5288 done
5289
5290 cf_add_libs="$LIBS"
5291 # reverse order
5292 cf_add_0lib=
5293 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5294 # filter duplicates
5295 for cf_add_1lib in $cf_add_0lib; do
5296         for cf_add_2lib in $cf_add_libs; do
5297                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5298                         cf_add_1lib=
5299                         break
5300                 fi
5301         done
5302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5303 done
5304 LIBS="$cf_add_libs"
5305
5306                 cat >"conftest.$ac_ext" <<_ACEOF
5307 #line 5307 "configure"
5308 #include "confdefs.h"
5309 #include <${cf_cv_ncurses_header:-curses.h}>
5310 int
5311 main (void)
5312 {
5313 initscr(); mousemask(0,0); tigetstr((char *)0);
5314   ;
5315   return 0;
5316 }
5317 _ACEOF
5318 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5319 if { (eval echo "$as_me:5319: \"$ac_link\"") >&5
5320   (eval $ac_link) 2>&5
5321   ac_status=$?
5322   echo "$as_me:5322: \$? = $ac_status" >&5
5323   (exit "$ac_status"); } &&
5324          { ac_try='test -s "conftest$ac_exeext"'
5325   { (eval echo "$as_me:5325: \"$ac_try\"") >&5
5326   (eval $ac_try) 2>&5
5327   ac_status=$?
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit "$ac_status"); }; }; then
5330   if test "$cross_compiling" = yes; then
5331   cf_have_ncuconfig=maybe
5332 else
5333   cat >"conftest.$ac_ext" <<_ACEOF
5334 #line 5334 "configure"
5335 #include "confdefs.h"
5336 #include <${cf_cv_ncurses_header:-curses.h}>
5337                                 int main(void)
5338                                 { const char *xx = curses_version(); return (xx == 0); }
5339 _ACEOF
5340 rm -f "conftest$ac_exeext"
5341 if { (eval echo "$as_me:5341: \"$ac_link\"") >&5
5342   (eval $ac_link) 2>&5
5343   ac_status=$?
5344   echo "$as_me:5344: \$? = $ac_status" >&5
5345   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5346   { (eval echo "$as_me:5346: \"$ac_try\"") >&5
5347   (eval $ac_try) 2>&5
5348   ac_status=$?
5349   echo "$as_me:5349: \$? = $ac_status" >&5
5350   (exit "$ac_status"); }; }; then
5351   cf_have_ncuconfig=yes
5352 else
5353   echo "$as_me: program exited with status $ac_status" >&5
5354 echo "$as_me: failed program was:" >&5
5355 cat "conftest.$ac_ext" >&5
5356 cf_have_ncuconfig=no
5357 fi
5358 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5359 fi
5360 else
5361   echo "$as_me: failed program was:" >&5
5362 cat "conftest.$ac_ext" >&5
5363 cf_have_ncuconfig=no
5364 fi
5365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5366                 echo "$as_me:5366: result: $cf_have_ncuconfig" >&5
5367 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5368                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5369                 if test "$cf_have_ncuconfig" != "yes"
5370                 then
5371                         CPPFLAGS="$cf_save_CPPFLAGS"
5372                         LIBS="$cf_save_LIBS"
5373                         NCURSES_CONFIG_PKG=none
5374                 else
5375
5376 cat >>confdefs.h <<\EOF
5377 #define NCURSES 1
5378 EOF
5379
5380                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5381
5382 echo "$as_me:5382: checking for terminfo header" >&5
5383 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5384 if test "${cf_cv_term_header+set}" = set; then
5385   echo $ECHO_N "(cached) $ECHO_C" >&6
5386 else
5387
5388 case "${cf_cv_ncurses_header}" in
5389 (*/ncurses.h|*/ncursesw.h)
5390         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5391         ;;
5392 (*)
5393         cf_term_header=term.h
5394         ;;
5395 esac
5396
5397 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5398 do
5399 cat >"conftest.$ac_ext" <<_ACEOF
5400 #line 5400 "configure"
5401 #include "confdefs.h"
5402 #include <stdio.h>
5403 #include <${cf_cv_ncurses_header:-curses.h}>
5404 #include <$cf_test>
5405
5406 int
5407 main (void)
5408 {
5409 int x = auto_left_margin; (void)x
5410   ;
5411   return 0;
5412 }
5413 _ACEOF
5414 rm -f "conftest.$ac_objext"
5415 if { (eval echo "$as_me:5415: \"$ac_compile\"") >&5
5416   (eval $ac_compile) 2>&5
5417   ac_status=$?
5418   echo "$as_me:5418: \$? = $ac_status" >&5
5419   (exit "$ac_status"); } &&
5420          { ac_try='test -s "conftest.$ac_objext"'
5421   { (eval echo "$as_me:5421: \"$ac_try\"") >&5
5422   (eval $ac_try) 2>&5
5423   ac_status=$?
5424   echo "$as_me:5424: \$? = $ac_status" >&5
5425   (exit "$ac_status"); }; }; then
5426
5427         cf_cv_term_header="$cf_test"
5428 else
5429   echo "$as_me: failed program was:" >&5
5430 cat "conftest.$ac_ext" >&5
5431
5432         cf_cv_term_header=unknown
5433
5434 fi
5435 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5436         test "$cf_cv_term_header" != unknown && break
5437 done
5438
5439 fi
5440 echo "$as_me:5440: result: $cf_cv_term_header" >&5
5441 echo "${ECHO_T}$cf_cv_term_header" >&6
5442
5443 # Set definitions to allow ifdef'ing to accommodate subdirectories
5444
5445 case "$cf_cv_term_header" in
5446 (*term.h)
5447
5448 cat >>confdefs.h <<\EOF
5449 #define HAVE_TERM_H 1
5450 EOF
5451
5452         ;;
5453 esac
5454
5455 case "$cf_cv_term_header" in
5456 (ncurses/term.h)
5457
5458 cat >>confdefs.h <<\EOF
5459 #define HAVE_NCURSES_TERM_H 1
5460 EOF
5461
5462         ;;
5463 (ncursesw/term.h)
5464
5465 cat >>confdefs.h <<\EOF
5466 #define HAVE_NCURSESW_TERM_H 1
5467 EOF
5468
5469         ;;
5470 esac
5471
5472                 fi
5473
5474         else
5475                 echo "$as_me:5475: result: no" >&5
5476 echo "${ECHO_T}no" >&6
5477                 NCURSES_CONFIG_PKG=none
5478         fi
5479 else
5480         NCURSES_CONFIG_PKG=none
5481 fi
5482
5483 if test "x$cf_have_ncuconfig" = "xno"; then
5484         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5485
5486 if test -n "$ac_tool_prefix"; then
5487   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5488   do
5489     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5490 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5491 echo "$as_me:5491: checking for $ac_word" >&5
5492 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5493 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5494   echo $ECHO_N "(cached) $ECHO_C" >&6
5495 else
5496   if test -n "$NCURSES_CONFIG"; then
5497   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5498 else
5499   ac_save_IFS=$IFS; IFS=$ac_path_separator
5500 ac_dummy="$PATH"
5501 for ac_dir in $ac_dummy; do
5502   IFS=$ac_save_IFS
5503   test -z "$ac_dir" && ac_dir=.
5504   $as_executable_p "$ac_dir/$ac_word" || continue
5505 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5506 echo "$as_me:5506: found $ac_dir/$ac_word" >&5
5507 break
5508 done
5509
5510 fi
5511 fi
5512 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5513 if test -n "$NCURSES_CONFIG"; then
5514   echo "$as_me:5514: result: $NCURSES_CONFIG" >&5
5515 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5516 else
5517   echo "$as_me:5517: result: no" >&5
5518 echo "${ECHO_T}no" >&6
5519 fi
5520
5521     test -n "$NCURSES_CONFIG" && break
5522   done
5523 fi
5524 if test -z "$NCURSES_CONFIG"; then
5525   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5526   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5527 do
5528   # Extract the first word of "$ac_prog", so it can be a program name with args.
5529 set dummy $ac_prog; ac_word=$2
5530 echo "$as_me:5530: checking for $ac_word" >&5
5531 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5532 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5533   echo $ECHO_N "(cached) $ECHO_C" >&6
5534 else
5535   if test -n "$ac_ct_NCURSES_CONFIG"; then
5536   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5537 else
5538   ac_save_IFS=$IFS; IFS=$ac_path_separator
5539 ac_dummy="$PATH"
5540 for ac_dir in $ac_dummy; do
5541   IFS=$ac_save_IFS
5542   test -z "$ac_dir" && ac_dir=.
5543   $as_executable_p "$ac_dir/$ac_word" || continue
5544 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5545 echo "$as_me:5545: found $ac_dir/$ac_word" >&5
5546 break
5547 done
5548
5549 fi
5550 fi
5551 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5552 if test -n "$ac_ct_NCURSES_CONFIG"; then
5553   echo "$as_me:5553: result: $ac_ct_NCURSES_CONFIG" >&5
5554 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5555 else
5556   echo "$as_me:5556: result: no" >&5
5557 echo "${ECHO_T}no" >&6
5558 fi
5559
5560   test -n "$ac_ct_NCURSES_CONFIG" && break
5561 done
5562 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5563
5564   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5565 fi
5566
5567         if test "$NCURSES_CONFIG" != none ; then
5568
5569 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5570 do
5571         case "x$cf_add_cflags" in
5572         (x-[DU]*)
5573
5574 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5575 while true
5576 do
5577         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'`
5578         test "$CFLAGS" != "$cf_old_cflag" || break
5579
5580         CFLAGS="$cf_old_cflag"
5581 done
5582
5583 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5584 while true
5585 do
5586         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'`
5587         test "$CPPFLAGS" != "$cf_old_cflag" || break
5588
5589         CPPFLAGS="$cf_old_cflag"
5590 done
5591
5592                 ;;
5593         esac
5594
5595 cf_fix_cppflags=no
5596 cf_new_cflags=
5597 cf_new_cppflags=
5598 cf_new_extra_cppflags=
5599
5600 for cf_add_cflags in $cf_add_cflags
5601 do
5602 case "$cf_fix_cppflags" in
5603 (no)
5604         case "$cf_add_cflags" in
5605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5606                 case "$cf_add_cflags" in
5607                 (-D*)
5608                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5609
5610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5611                                 && test -z "${cf_tst_cflags}" \
5612                                 && cf_fix_cppflags=yes
5613
5614                         if test "$cf_fix_cppflags" = yes ; then
5615
5616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5618
5619                                 continue
5620                         elif test "${cf_tst_cflags}" = "\"'" ; then
5621
5622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5624
5625                                 continue
5626                         fi
5627                         ;;
5628                 esac
5629                 case "$CPPFLAGS" in
5630                 (*$cf_add_cflags)
5631                         ;;
5632                 (*)
5633                         case "$cf_add_cflags" in
5634                         (-D*)
5635                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5636
5637 CPPFLAGS=`echo "$CPPFLAGS" | \
5638         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5639                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5640
5641                                 ;;
5642                         esac
5643
5644         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5645         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5646
5647                         ;;
5648                 esac
5649                 ;;
5650         (*)
5651
5652         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5653         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5654
5655                 ;;
5656         esac
5657         ;;
5658 (yes)
5659
5660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5662
5663         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5664
5665         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5666                 && test -z "${cf_tst_cflags}" \
5667                 && cf_fix_cppflags=no
5668         ;;
5669 esac
5670 done
5671
5672 if test -n "$cf_new_cflags" ; then
5673
5674         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5675         CFLAGS="${CFLAGS}$cf_new_cflags"
5676
5677 fi
5678
5679 if test -n "$cf_new_cppflags" ; then
5680
5681         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5682         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5683
5684 fi
5685
5686 if test -n "$cf_new_extra_cppflags" ; then
5687
5688         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5689         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5690
5691 fi
5692
5693 done
5694
5695 cf_add_libs="$LIBS"
5696 # reverse order
5697 cf_add_0lib=
5698 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5699 # filter duplicates
5700 for cf_add_1lib in $cf_add_0lib; do
5701         for cf_add_2lib in $cf_add_libs; do
5702                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5703                         cf_add_1lib=
5704                         break
5705                 fi
5706         done
5707         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5708 done
5709 LIBS="$cf_add_libs"
5710
5711                 # even with config script, some packages use no-override for curses.h
5712
5713 echo "$as_me:5713: checking if we have identified curses headers" >&5
5714 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5715 if test "${cf_cv_ncurses_header+set}" = set; then
5716   echo $ECHO_N "(cached) $ECHO_C" >&6
5717 else
5718
5719 cf_cv_ncurses_header=none
5720 for cf_header in \
5721         ncurses.h ncurses/ncurses.h \
5722         curses.h ncurses/curses.h
5723 do
5724 cat >"conftest.$ac_ext" <<_ACEOF
5725 #line 5725 "configure"
5726 #include "confdefs.h"
5727 #include <${cf_header}>
5728 int
5729 main (void)
5730 {
5731 initscr(); endwin()
5732   ;
5733   return 0;
5734 }
5735 _ACEOF
5736 rm -f "conftest.$ac_objext"
5737 if { (eval echo "$as_me:5737: \"$ac_compile\"") >&5
5738   (eval $ac_compile) 2>&5
5739   ac_status=$?
5740   echo "$as_me:5740: \$? = $ac_status" >&5
5741   (exit "$ac_status"); } &&
5742          { ac_try='test -s "conftest.$ac_objext"'
5743   { (eval echo "$as_me:5743: \"$ac_try\"") >&5
5744   (eval $ac_try) 2>&5
5745   ac_status=$?
5746   echo "$as_me:5746: \$? = $ac_status" >&5
5747   (exit "$ac_status"); }; }; then
5748   cf_cv_ncurses_header=$cf_header; break
5749 else
5750   echo "$as_me: failed program was:" >&5
5751 cat "conftest.$ac_ext" >&5
5752 fi
5753 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5754 done
5755
5756 fi
5757 echo "$as_me:5757: result: $cf_cv_ncurses_header" >&5
5758 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5759
5760 if test "$cf_cv_ncurses_header" = none ; then
5761         { { echo "$as_me:5761: error: No curses header-files found" >&5
5762 echo "$as_me: error: No curses header-files found" >&2;}
5763    { (exit 1); exit 1; }; }
5764 fi
5765
5766 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5767
5768 for ac_header in $cf_cv_ncurses_header
5769 do
5770 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5771 echo "$as_me:5771: checking for $ac_header" >&5
5772 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5773 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5774   echo $ECHO_N "(cached) $ECHO_C" >&6
5775 else
5776   cat >"conftest.$ac_ext" <<_ACEOF
5777 #line 5777 "configure"
5778 #include "confdefs.h"
5779 #include <$ac_header>
5780 _ACEOF
5781 if { (eval echo "$as_me:5781: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5782   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5783   ac_status=$?
5784   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5785   rm -f conftest.er1
5786   cat conftest.err >&5
5787   echo "$as_me:5787: \$? = $ac_status" >&5
5788   (exit "$ac_status"); } >/dev/null; then
5789   if test -s conftest.err; then
5790     ac_cpp_err=$ac_c_preproc_warn_flag
5791   else
5792     ac_cpp_err=
5793   fi
5794 else
5795   ac_cpp_err=yes
5796 fi
5797 if test -z "$ac_cpp_err"; then
5798   eval "$as_ac_Header=yes"
5799 else
5800   echo "$as_me: failed program was:" >&5
5801   cat "conftest.$ac_ext" >&5
5802   eval "$as_ac_Header=no"
5803 fi
5804 rm -f conftest.err "conftest.$ac_ext"
5805 fi
5806 echo "$as_me:5806: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5807 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5808 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5809   cat >>confdefs.h <<EOF
5810 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5811 EOF
5812
5813 fi
5814 done
5815
5816 cat >>confdefs.h <<\EOF
5817 #define NCURSES 1
5818 EOF
5819
5820 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5821
5822                 cat >>confdefs.h <<EOF
5823 #define $cf_nculib_ROOT 1
5824 EOF
5825
5826                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5827
5828         else
5829
5830 cf_ncuhdr_root=ncurses
5831
5832 test -n "$cf_cv_curses_dir" && \
5833 test "$cf_cv_curses_dir" != "no" && { \
5834
5835 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5836   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5837   do
5838         while test "$cf_add_incdir" != /usr/include
5839         do
5840           if test -d "$cf_add_incdir"
5841           then
5842                 cf_have_incdir=no
5843                 if test -n "$CFLAGS$CPPFLAGS" ; then
5844                   # a loop is needed to ensure we can add subdirs of existing dirs
5845                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5846                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5847                           cf_have_incdir=yes; break
5848                         fi
5849                   done
5850                 fi
5851
5852                 if test "$cf_have_incdir" = no ; then
5853                   if test "$cf_add_incdir" = /usr/local/include ; then
5854                         if test "$GCC" = yes
5855                         then
5856                           cf_save_CPPFLAGS=$CPPFLAGS
5857
5858         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5859         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5860
5861                           cat >"conftest.$ac_ext" <<_ACEOF
5862 #line 5862 "configure"
5863 #include "confdefs.h"
5864 #include <stdio.h>
5865 int
5866 main (void)
5867 {
5868 printf("Hello")
5869   ;
5870   return 0;
5871 }
5872 _ACEOF
5873 rm -f "conftest.$ac_objext"
5874 if { (eval echo "$as_me:5874: \"$ac_compile\"") >&5
5875   (eval $ac_compile) 2>&5
5876   ac_status=$?
5877   echo "$as_me:5877: \$? = $ac_status" >&5
5878   (exit "$ac_status"); } &&
5879          { ac_try='test -s "conftest.$ac_objext"'
5880   { (eval echo "$as_me:5880: \"$ac_try\"") >&5
5881   (eval $ac_try) 2>&5
5882   ac_status=$?
5883   echo "$as_me:5883: \$? = $ac_status" >&5
5884   (exit "$ac_status"); }; }; then
5885   :
5886 else
5887   echo "$as_me: failed program was:" >&5
5888 cat "conftest.$ac_ext" >&5
5889 cf_have_incdir=yes
5890 fi
5891 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5892                           CPPFLAGS=$cf_save_CPPFLAGS
5893                         fi
5894                   fi
5895                 fi
5896
5897                 if test "$cf_have_incdir" = no ; then
5898                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5899
5900 echo "${as_me:-configure}:5900: testing adding $cf_add_incdir to include-path ..." 1>&5
5901
5902                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5903
5904                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5905                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5906                   cf_add_incdir="$cf_top_incdir"
5907                 else
5908                   break
5909                 fi
5910           else
5911                 break
5912           fi
5913         done
5914   done
5915 fi
5916
5917 }
5918
5919 echo "$as_me:5919: checking for $cf_ncuhdr_root header in include-path" >&5
5920 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5921 if test "${cf_cv_ncurses_h+set}" = set; then
5922   echo $ECHO_N "(cached) $ECHO_C" >&6
5923 else
5924
5925         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5926         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5927         for cf_header in $cf_header_list
5928         do
5929
5930         cat >"conftest.$ac_ext" <<_ACEOF
5931 #line 5931 "configure"
5932 #include "confdefs.h"
5933
5934 #include <$cf_header>
5935 int
5936 main (void)
5937 {
5938
5939 #ifdef NCURSES_VERSION
5940
5941 printf("%s\\n", NCURSES_VERSION);
5942 #else
5943 #ifdef __NCURSES_H
5944 printf("old\\n");
5945 #else
5946         #error __NCURSES_H is not defined
5947 #endif
5948 #endif
5949
5950   ;
5951   return 0;
5952 }
5953 _ACEOF
5954 rm -f "conftest.$ac_objext"
5955 if { (eval echo "$as_me:5955: \"$ac_compile\"") >&5
5956   (eval $ac_compile) 2>&5
5957   ac_status=$?
5958   echo "$as_me:5958: \$? = $ac_status" >&5
5959   (exit "$ac_status"); } &&
5960          { ac_try='test -s "conftest.$ac_objext"'
5961   { (eval echo "$as_me:5961: \"$ac_try\"") >&5
5962   (eval $ac_try) 2>&5
5963   ac_status=$?
5964   echo "$as_me:5964: \$? = $ac_status" >&5
5965   (exit "$ac_status"); }; }; then
5966   cf_cv_ncurses_h=$cf_header
5967
5968 else
5969   echo "$as_me: failed program was:" >&5
5970 cat "conftest.$ac_ext" >&5
5971 cf_cv_ncurses_h=no
5972 fi
5973 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5974
5975                 test "$cf_cv_ncurses_h" != no && break
5976         done
5977
5978 fi
5979 echo "$as_me:5979: result: $cf_cv_ncurses_h" >&5
5980 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5981
5982 if test "$cf_cv_ncurses_h" != no ; then
5983         cf_cv_ncurses_header=$cf_cv_ncurses_h
5984 else
5985
5986 echo "$as_me:5986: checking for $cf_ncuhdr_root include-path" >&5
5987 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5988 if test "${cf_cv_ncurses_h2+set}" = set; then
5989   echo $ECHO_N "(cached) $ECHO_C" >&6
5990 else
5991
5992         test -n "$verbose" && echo
5993
5994 cf_search=
5995
5996 # collect the current set of include-directories from compiler flags
5997 cf_header_path_list=""
5998 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5999         for cf_header_path in $CPPFLAGS $CFLAGS
6000         do
6001                 case "$cf_header_path" in
6002                 (-I*)
6003                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6004
6005 test "x$cf_header_path" != "xNONE" && \
6006 test -d "$cf_header_path" && \
6007  {
6008         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6009         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6010         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6011         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6012         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6013         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"
6014 }
6015
6016                         cf_header_path_list="$cf_header_path_list $cf_search"
6017                         ;;
6018                 esac
6019         done
6020 fi
6021
6022 # add the variations for the package we are looking for
6023
6024 cf_search=
6025
6026 test "x$prefix" != "xNONE" && \
6027 test -d "$prefix" && \
6028  {
6029         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6030         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6031         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6032         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6033         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6034         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6035 }
6036
6037 for cf_subdir_prefix in \
6038         /usr \
6039         /usr/local \
6040         /usr/pkg \
6041         /opt \
6042         /opt/local \
6043         $HOME
6044 do
6045
6046 test "x$cf_subdir_prefix" != "x$prefix" && \
6047 test -d "$cf_subdir_prefix" && \
6048 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6049         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6050         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6051         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6052         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6053         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6054         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"
6055 }
6056
6057 done
6058
6059 test "$includedir" != NONE && \
6060 test "$includedir" != "/usr/include" && \
6061 test -d "$includedir" && {
6062         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6063         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6064 }
6065
6066 test "$oldincludedir" != NONE && \
6067 test "$oldincludedir" != "/usr/include" && \
6068 test -d "$oldincludedir" && {
6069         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6070         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6071 }
6072
6073 cf_search="$cf_search $cf_header_path_list"
6074
6075         test -n "$verbose" && echo "search path $cf_search"
6076         cf_save2_CPPFLAGS="$CPPFLAGS"
6077         for cf_incdir in $cf_search
6078         do
6079
6080 if test -n "$cf_incdir" ; then
6081   for cf_add_incdir in $cf_incdir
6082   do
6083         while test "$cf_add_incdir" != /usr/include
6084         do
6085           if test -d "$cf_add_incdir"
6086           then
6087                 cf_have_incdir=no
6088                 if test -n "$CFLAGS$CPPFLAGS" ; then
6089                   # a loop is needed to ensure we can add subdirs of existing dirs
6090                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6091                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6092                           cf_have_incdir=yes; break
6093                         fi
6094                   done
6095                 fi
6096
6097                 if test "$cf_have_incdir" = no ; then
6098                   if test "$cf_add_incdir" = /usr/local/include ; then
6099                         if test "$GCC" = yes
6100                         then
6101                           cf_save_CPPFLAGS=$CPPFLAGS
6102
6103         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6104         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6105
6106                           cat >"conftest.$ac_ext" <<_ACEOF
6107 #line 6107 "configure"
6108 #include "confdefs.h"
6109 #include <stdio.h>
6110 int
6111 main (void)
6112 {
6113 printf("Hello")
6114   ;
6115   return 0;
6116 }
6117 _ACEOF
6118 rm -f "conftest.$ac_objext"
6119 if { (eval echo "$as_me:6119: \"$ac_compile\"") >&5
6120   (eval $ac_compile) 2>&5
6121   ac_status=$?
6122   echo "$as_me:6122: \$? = $ac_status" >&5
6123   (exit "$ac_status"); } &&
6124          { ac_try='test -s "conftest.$ac_objext"'
6125   { (eval echo "$as_me:6125: \"$ac_try\"") >&5
6126   (eval $ac_try) 2>&5
6127   ac_status=$?
6128   echo "$as_me:6128: \$? = $ac_status" >&5
6129   (exit "$ac_status"); }; }; then
6130   :
6131 else
6132   echo "$as_me: failed program was:" >&5
6133 cat "conftest.$ac_ext" >&5
6134 cf_have_incdir=yes
6135 fi
6136 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6137                           CPPFLAGS=$cf_save_CPPFLAGS
6138                         fi
6139                   fi
6140                 fi
6141
6142                 if test "$cf_have_incdir" = no ; then
6143                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6144
6145 echo "${as_me:-configure}:6145: testing adding $cf_add_incdir to include-path ..." 1>&5
6146
6147                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6148
6149                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6150                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6151                   cf_add_incdir="$cf_top_incdir"
6152                 else
6153                   break
6154                 fi
6155           else
6156                 break
6157           fi
6158         done
6159   done
6160 fi
6161
6162                 for cf_header in \
6163                         ncurses.h \
6164                         curses.h
6165                 do
6166
6167         cat >"conftest.$ac_ext" <<_ACEOF
6168 #line 6168 "configure"
6169 #include "confdefs.h"
6170
6171 #include <$cf_header>
6172 int
6173 main (void)
6174 {
6175
6176 #ifdef NCURSES_VERSION
6177
6178 printf("%s\\n", NCURSES_VERSION);
6179 #else
6180 #ifdef __NCURSES_H
6181 printf("old\\n");
6182 #else
6183         #error __NCURSES_H is not defined
6184 #endif
6185 #endif
6186
6187   ;
6188   return 0;
6189 }
6190 _ACEOF
6191 rm -f "conftest.$ac_objext"
6192 if { (eval echo "$as_me:6192: \"$ac_compile\"") >&5
6193   (eval $ac_compile) 2>&5
6194   ac_status=$?
6195   echo "$as_me:6195: \$? = $ac_status" >&5
6196   (exit "$ac_status"); } &&
6197          { ac_try='test -s "conftest.$ac_objext"'
6198   { (eval echo "$as_me:6198: \"$ac_try\"") >&5
6199   (eval $ac_try) 2>&5
6200   ac_status=$?
6201   echo "$as_me:6201: \$? = $ac_status" >&5
6202   (exit "$ac_status"); }; }; then
6203   cf_cv_ncurses_h2=$cf_header
6204
6205 else
6206   echo "$as_me: failed program was:" >&5
6207 cat "conftest.$ac_ext" >&5
6208 cf_cv_ncurses_h2=no
6209 fi
6210 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6211
6212                         if test "$cf_cv_ncurses_h2" != no ; then
6213                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6214                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
6215                                 break
6216                         fi
6217                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6218                 done
6219                 CPPFLAGS="$cf_save2_CPPFLAGS"
6220                 test "$cf_cv_ncurses_h2" != no && break
6221         done
6222         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6222: error: not found" >&5
6223 echo "$as_me: error: not found" >&2;}
6224    { (exit 1); exit 1; }; }
6225
6226 fi
6227 echo "$as_me:6227: result: $cf_cv_ncurses_h2" >&5
6228 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6229
6230         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
6231         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
6232         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
6233                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
6234         fi
6235
6236 if test -n "$cf_1st_incdir" ; then
6237   for cf_add_incdir in $cf_1st_incdir
6238   do
6239         while test "$cf_add_incdir" != /usr/include
6240         do
6241           if test -d "$cf_add_incdir"
6242           then
6243                 cf_have_incdir=no
6244                 if test -n "$CFLAGS$CPPFLAGS" ; then
6245                   # a loop is needed to ensure we can add subdirs of existing dirs
6246                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6247                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6248                           cf_have_incdir=yes; break
6249                         fi
6250                   done
6251                 fi
6252
6253                 if test "$cf_have_incdir" = no ; then
6254                   if test "$cf_add_incdir" = /usr/local/include ; then
6255                         if test "$GCC" = yes
6256                         then
6257                           cf_save_CPPFLAGS=$CPPFLAGS
6258
6259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6260         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6261
6262                           cat >"conftest.$ac_ext" <<_ACEOF
6263 #line 6263 "configure"
6264 #include "confdefs.h"
6265 #include <stdio.h>
6266 int
6267 main (void)
6268 {
6269 printf("Hello")
6270   ;
6271   return 0;
6272 }
6273 _ACEOF
6274 rm -f "conftest.$ac_objext"
6275 if { (eval echo "$as_me:6275: \"$ac_compile\"") >&5
6276   (eval $ac_compile) 2>&5
6277   ac_status=$?
6278   echo "$as_me:6278: \$? = $ac_status" >&5
6279   (exit "$ac_status"); } &&
6280          { ac_try='test -s "conftest.$ac_objext"'
6281   { (eval echo "$as_me:6281: \"$ac_try\"") >&5
6282   (eval $ac_try) 2>&5
6283   ac_status=$?
6284   echo "$as_me:6284: \$? = $ac_status" >&5
6285   (exit "$ac_status"); }; }; then
6286   :
6287 else
6288   echo "$as_me: failed program was:" >&5
6289 cat "conftest.$ac_ext" >&5
6290 cf_have_incdir=yes
6291 fi
6292 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6293                           CPPFLAGS=$cf_save_CPPFLAGS
6294                         fi
6295                   fi
6296                 fi
6297
6298                 if test "$cf_have_incdir" = no ; then
6299                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6300
6301 echo "${as_me:-configure}:6301: testing adding $cf_add_incdir to include-path ..." 1>&5
6302
6303                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6304
6305                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6306                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6307                   cf_add_incdir="$cf_top_incdir"
6308                 else
6309                   break
6310                 fi
6311           else
6312                 break
6313           fi
6314         done
6315   done
6316 fi
6317
6318 fi
6319
6320 # Set definitions to allow ifdef'ing for ncurses.h
6321
6322 case "$cf_cv_ncurses_header" in
6323 (*ncurses.h)
6324
6325 cat >>confdefs.h <<\EOF
6326 #define HAVE_NCURSES_H 1
6327 EOF
6328
6329         ;;
6330 esac
6331
6332 case "$cf_cv_ncurses_header" in
6333 (ncurses/curses.h|ncurses/ncurses.h)
6334
6335 cat >>confdefs.h <<\EOF
6336 #define HAVE_NCURSES_NCURSES_H 1
6337 EOF
6338
6339         ;;
6340 (ncursesw/curses.h|ncursesw/ncurses.h)
6341
6342 cat >>confdefs.h <<\EOF
6343 #define HAVE_NCURSESW_NCURSES_H 1
6344 EOF
6345
6346         ;;
6347 esac
6348
6349 echo "$as_me:6349: checking for terminfo header" >&5
6350 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6351 if test "${cf_cv_term_header+set}" = set; then
6352   echo $ECHO_N "(cached) $ECHO_C" >&6
6353 else
6354
6355 case "${cf_cv_ncurses_header}" in
6356 (*/ncurses.h|*/ncursesw.h)
6357         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6358         ;;
6359 (*)
6360         cf_term_header=term.h
6361         ;;
6362 esac
6363
6364 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6365 do
6366 cat >"conftest.$ac_ext" <<_ACEOF
6367 #line 6367 "configure"
6368 #include "confdefs.h"
6369 #include <stdio.h>
6370 #include <${cf_cv_ncurses_header:-curses.h}>
6371 #include <$cf_test>
6372
6373 int
6374 main (void)
6375 {
6376 int x = auto_left_margin; (void)x
6377   ;
6378   return 0;
6379 }
6380 _ACEOF
6381 rm -f "conftest.$ac_objext"
6382 if { (eval echo "$as_me:6382: \"$ac_compile\"") >&5
6383   (eval $ac_compile) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit "$ac_status"); } &&
6387          { ac_try='test -s "conftest.$ac_objext"'
6388   { (eval echo "$as_me:6388: \"$ac_try\"") >&5
6389   (eval $ac_try) 2>&5
6390   ac_status=$?
6391   echo "$as_me:6391: \$? = $ac_status" >&5
6392   (exit "$ac_status"); }; }; then
6393
6394         cf_cv_term_header="$cf_test"
6395 else
6396   echo "$as_me: failed program was:" >&5
6397 cat "conftest.$ac_ext" >&5
6398
6399         cf_cv_term_header=unknown
6400
6401 fi
6402 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6403         test "$cf_cv_term_header" != unknown && break
6404 done
6405
6406 fi
6407 echo "$as_me:6407: result: $cf_cv_term_header" >&5
6408 echo "${ECHO_T}$cf_cv_term_header" >&6
6409
6410 # Set definitions to allow ifdef'ing to accommodate subdirectories
6411
6412 case "$cf_cv_term_header" in
6413 (*term.h)
6414
6415 cat >>confdefs.h <<\EOF
6416 #define HAVE_TERM_H 1
6417 EOF
6418
6419         ;;
6420 esac
6421
6422 case "$cf_cv_term_header" in
6423 (ncurses/term.h)
6424
6425 cat >>confdefs.h <<\EOF
6426 #define HAVE_NCURSES_TERM_H 1
6427 EOF
6428
6429         ;;
6430 (ncursesw/term.h)
6431
6432 cat >>confdefs.h <<\EOF
6433 #define HAVE_NCURSESW_TERM_H 1
6434 EOF
6435
6436         ;;
6437 esac
6438
6439 # some applications need this, but should check for NCURSES_VERSION
6440
6441 cat >>confdefs.h <<\EOF
6442 #define NCURSES 1
6443 EOF
6444
6445 echo "$as_me:6445: checking for ncurses version" >&5
6446 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6447 if test "${cf_cv_ncurses_version+set}" = set; then
6448   echo $ECHO_N "(cached) $ECHO_C" >&6
6449 else
6450
6451         cf_cv_ncurses_version=no
6452         cf_tempfile=out$$
6453         rm -f "$cf_tempfile"
6454         if test "$cross_compiling" = yes; then
6455
6456         # This will not work if the preprocessor splits the line after the
6457         # Autoconf token.  The 'unproto' program does that.
6458         cat > "conftest.$ac_ext" <<EOF
6459 #include <${cf_cv_ncurses_header:-curses.h}>
6460 #undef Autoconf
6461 #ifdef NCURSES_VERSION
6462 Autoconf NCURSES_VERSION
6463 #else
6464 #ifdef __NCURSES_H
6465 Autoconf "old"
6466 #endif
6467 ;
6468 #endif
6469 EOF
6470         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6471         { (eval echo "$as_me:6471: \"$cf_try\"") >&5
6472   (eval $cf_try) 2>&5
6473   ac_status=$?
6474   echo "$as_me:6474: \$? = $ac_status" >&5
6475   (exit "$ac_status"); }
6476         if test -f conftest.out ; then
6477                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6478                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6479                 rm -f conftest.out
6480         fi
6481
6482 else
6483   cat >"conftest.$ac_ext" <<_ACEOF
6484 #line 6484 "configure"
6485 #include "confdefs.h"
6486
6487 $ac_includes_default
6488
6489 #include <${cf_cv_ncurses_header:-curses.h}>
6490
6491 int main(void)
6492 {
6493         FILE *fp = fopen("$cf_tempfile", "w");
6494 #ifdef NCURSES_VERSION
6495 # ifdef NCURSES_VERSION_PATCH
6496         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6497 # else
6498         fprintf(fp, "%s\\n", NCURSES_VERSION);
6499 # endif
6500 #else
6501 # ifdef __NCURSES_H
6502         fprintf(fp, "old\\n");
6503 # else
6504         #error expected ncurses header to define __NCURSES_H
6505 # endif
6506 #endif
6507         ${cf_cv_main_return:-return}(0);
6508 }
6509 _ACEOF
6510 rm -f "conftest$ac_exeext"
6511 if { (eval echo "$as_me:6511: \"$ac_link\"") >&5
6512   (eval $ac_link) 2>&5
6513   ac_status=$?
6514   echo "$as_me:6514: \$? = $ac_status" >&5
6515   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6516   { (eval echo "$as_me:6516: \"$ac_try\"") >&5
6517   (eval $ac_try) 2>&5
6518   ac_status=$?
6519   echo "$as_me:6519: \$? = $ac_status" >&5
6520   (exit "$ac_status"); }; }; then
6521
6522         cf_cv_ncurses_version=`cat $cf_tempfile`
6523 else
6524   echo "$as_me: program exited with status $ac_status" >&5
6525 echo "$as_me: failed program was:" >&5
6526 cat "conftest.$ac_ext" >&5
6527 fi
6528 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6529 fi
6530         rm -f "$cf_tempfile"
6531
6532 fi
6533 echo "$as_me:6533: result: $cf_cv_ncurses_version" >&5
6534 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6535 test "$cf_cv_ncurses_version" = no ||
6536 cat >>confdefs.h <<\EOF
6537 #define NCURSES 1
6538 EOF
6539
6540 cf_nculib_root=ncurses
6541         # This works, except for the special case where we find gpm, but
6542         # ncurses is in a nonstandard location via $LIBS, and we really want
6543         # to link gpm.
6544 cf_ncurses_LIBS=""
6545 cf_ncurses_SAVE="$LIBS"
6546 echo "$as_me:6546: checking for Gpm_Open in -lgpm" >&5
6547 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6548 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6549   echo $ECHO_N "(cached) $ECHO_C" >&6
6550 else
6551   ac_check_lib_save_LIBS=$LIBS
6552 LIBS="-lgpm  $LIBS"
6553 cat >"conftest.$ac_ext" <<_ACEOF
6554 #line 6554 "configure"
6555 #include "confdefs.h"
6556
6557 /* Override any gcc2 internal prototype to avoid an error.  */
6558 #ifdef __cplusplus
6559 extern "C"
6560 #endif
6561 /* We use char because int might match the return type of a gcc2
6562    builtin and then its argument prototype would still apply.  */
6563 char Gpm_Open (void);
6564 int
6565 main (void)
6566 {
6567 Gpm_Open ();
6568   ;
6569   return 0;
6570 }
6571 _ACEOF
6572 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6573 if { (eval echo "$as_me:6573: \"$ac_link\"") >&5
6574   (eval $ac_link) 2>&5
6575   ac_status=$?
6576   echo "$as_me:6576: \$? = $ac_status" >&5
6577   (exit "$ac_status"); } &&
6578          { ac_try='test -s "conftest$ac_exeext"'
6579   { (eval echo "$as_me:6579: \"$ac_try\"") >&5
6580   (eval $ac_try) 2>&5
6581   ac_status=$?
6582   echo "$as_me:6582: \$? = $ac_status" >&5
6583   (exit "$ac_status"); }; }; then
6584   ac_cv_lib_gpm_Gpm_Open=yes
6585 else
6586   echo "$as_me: failed program was:" >&5
6587 cat "conftest.$ac_ext" >&5
6588 ac_cv_lib_gpm_Gpm_Open=no
6589 fi
6590 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6591 LIBS=$ac_check_lib_save_LIBS
6592 fi
6593 echo "$as_me:6593: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6594 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6595 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6596   echo "$as_me:6596: checking for initscr in -lgpm" >&5
6597 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6598 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6599   echo $ECHO_N "(cached) $ECHO_C" >&6
6600 else
6601   ac_check_lib_save_LIBS=$LIBS
6602 LIBS="-lgpm  $LIBS"
6603 cat >"conftest.$ac_ext" <<_ACEOF
6604 #line 6604 "configure"
6605 #include "confdefs.h"
6606
6607 /* Override any gcc2 internal prototype to avoid an error.  */
6608 #ifdef __cplusplus
6609 extern "C"
6610 #endif
6611 /* We use char because int might match the return type of a gcc2
6612    builtin and then its argument prototype would still apply.  */
6613 char initscr (void);
6614 int
6615 main (void)
6616 {
6617 initscr ();
6618   ;
6619   return 0;
6620 }
6621 _ACEOF
6622 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6623 if { (eval echo "$as_me:6623: \"$ac_link\"") >&5
6624   (eval $ac_link) 2>&5
6625   ac_status=$?
6626   echo "$as_me:6626: \$? = $ac_status" >&5
6627   (exit "$ac_status"); } &&
6628          { ac_try='test -s "conftest$ac_exeext"'
6629   { (eval echo "$as_me:6629: \"$ac_try\"") >&5
6630   (eval $ac_try) 2>&5
6631   ac_status=$?
6632   echo "$as_me:6632: \$? = $ac_status" >&5
6633   (exit "$ac_status"); }; }; then
6634   ac_cv_lib_gpm_initscr=yes
6635 else
6636   echo "$as_me: failed program was:" >&5
6637 cat "conftest.$ac_ext" >&5
6638 ac_cv_lib_gpm_initscr=no
6639 fi
6640 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6641 LIBS=$ac_check_lib_save_LIBS
6642 fi
6643 echo "$as_me:6643: result: $ac_cv_lib_gpm_initscr" >&5
6644 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6645 if test "$ac_cv_lib_gpm_initscr" = yes; then
6646   LIBS="$cf_ncurses_SAVE"
6647 else
6648   cf_ncurses_LIBS="-lgpm"
6649 fi
6650
6651 fi
6652
6653 case "$host_os" in
6654 (freebsd*)
6655         # This is only necessary if you are linking against an obsolete
6656         # version of ncurses (but it should do no harm, since it is static).
6657         if test "$cf_nculib_root" = ncurses ; then
6658                 echo "$as_me:6658: checking for tgoto in -lmytinfo" >&5
6659 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6660 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6661   echo $ECHO_N "(cached) $ECHO_C" >&6
6662 else
6663   ac_check_lib_save_LIBS=$LIBS
6664 LIBS="-lmytinfo  $LIBS"
6665 cat >"conftest.$ac_ext" <<_ACEOF
6666 #line 6666 "configure"
6667 #include "confdefs.h"
6668
6669 /* Override any gcc2 internal prototype to avoid an error.  */
6670 #ifdef __cplusplus
6671 extern "C"
6672 #endif
6673 /* We use char because int might match the return type of a gcc2
6674    builtin and then its argument prototype would still apply.  */
6675 char tgoto (void);
6676 int
6677 main (void)
6678 {
6679 tgoto ();
6680   ;
6681   return 0;
6682 }
6683 _ACEOF
6684 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6685 if { (eval echo "$as_me:6685: \"$ac_link\"") >&5
6686   (eval $ac_link) 2>&5
6687   ac_status=$?
6688   echo "$as_me:6688: \$? = $ac_status" >&5
6689   (exit "$ac_status"); } &&
6690          { ac_try='test -s "conftest$ac_exeext"'
6691   { (eval echo "$as_me:6691: \"$ac_try\"") >&5
6692   (eval $ac_try) 2>&5
6693   ac_status=$?
6694   echo "$as_me:6694: \$? = $ac_status" >&5
6695   (exit "$ac_status"); }; }; then
6696   ac_cv_lib_mytinfo_tgoto=yes
6697 else
6698   echo "$as_me: failed program was:" >&5
6699 cat "conftest.$ac_ext" >&5
6700 ac_cv_lib_mytinfo_tgoto=no
6701 fi
6702 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6703 LIBS=$ac_check_lib_save_LIBS
6704 fi
6705 echo "$as_me:6705: result: $ac_cv_lib_mytinfo_tgoto" >&5
6706 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6707 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6708   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6709 fi
6710
6711         fi
6712         ;;
6713 esac
6714
6715 cf_add_libs="$LIBS"
6716 # reverse order
6717 cf_add_0lib=
6718 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6719 # filter duplicates
6720 for cf_add_1lib in $cf_add_0lib; do
6721         for cf_add_2lib in $cf_add_libs; do
6722                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6723                         cf_add_1lib=
6724                         break
6725                 fi
6726         done
6727         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6728 done
6729 LIBS="$cf_add_libs"
6730
6731 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6732 then
6733
6734 cf_add_libs="$LIBS"
6735 # reverse order
6736 cf_add_0lib=
6737 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6738 # filter duplicates
6739 for cf_add_1lib in $cf_add_0lib; do
6740         for cf_add_2lib in $cf_add_libs; do
6741                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6742                         cf_add_1lib=
6743                         break
6744                 fi
6745         done
6746         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6747 done
6748 LIBS="$cf_add_libs"
6749
6750 else
6751
6752         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6753         cf_libdir=""
6754         echo "$as_me:6754: checking for initscr" >&5
6755 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6756 if test "${ac_cv_func_initscr+set}" = set; then
6757   echo $ECHO_N "(cached) $ECHO_C" >&6
6758 else
6759   cat >"conftest.$ac_ext" <<_ACEOF
6760 #line 6760 "configure"
6761 #include "confdefs.h"
6762 #define initscr autoconf_temporary
6763 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6764 #undef initscr
6765
6766 #ifdef __cplusplus
6767 extern "C"
6768 #endif
6769
6770 /* We use char because int might match the return type of a gcc2
6771    builtin and then its argument prototype would still apply.  */
6772 char initscr (void);
6773
6774 int
6775 main (void)
6776 {
6777
6778 /* The GNU C library defines stubs for functions which it implements
6779     to always fail with ENOSYS.  Some functions are actually named
6780     something starting with __ and the normal name is an alias.  */
6781 #if defined (__stub_initscr) || defined (__stub___initscr)
6782 #error found stub for initscr
6783 #endif
6784
6785         return initscr ();
6786   ;
6787   return 0;
6788 }
6789 _ACEOF
6790 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6791 if { (eval echo "$as_me:6791: \"$ac_link\"") >&5
6792   (eval $ac_link) 2>&5
6793   ac_status=$?
6794   echo "$as_me:6794: \$? = $ac_status" >&5
6795   (exit "$ac_status"); } &&
6796          { ac_try='test -s "conftest$ac_exeext"'
6797   { (eval echo "$as_me:6797: \"$ac_try\"") >&5
6798   (eval $ac_try) 2>&5
6799   ac_status=$?
6800   echo "$as_me:6800: \$? = $ac_status" >&5
6801   (exit "$ac_status"); }; }; then
6802   ac_cv_func_initscr=yes
6803 else
6804   echo "$as_me: failed program was:" >&5
6805 cat "conftest.$ac_ext" >&5
6806 ac_cv_func_initscr=no
6807 fi
6808 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6809 fi
6810 echo "$as_me:6810: result: $ac_cv_func_initscr" >&5
6811 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6812 if test "$ac_cv_func_initscr" = yes; then
6813   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6814 else
6815
6816                 cf_save_LIBS="$LIBS"
6817                 echo "$as_me:6817: checking for initscr in -l$cf_nculib_root" >&5
6818 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6819                 LIBS="-l$cf_nculib_root $LIBS"
6820                 cat >"conftest.$ac_ext" <<_ACEOF
6821 #line 6821 "configure"
6822 #include "confdefs.h"
6823 #include <${cf_cv_ncurses_header:-curses.h}>
6824 int
6825 main (void)
6826 {
6827 initscr()
6828   ;
6829   return 0;
6830 }
6831 _ACEOF
6832 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6833 if { (eval echo "$as_me:6833: \"$ac_link\"") >&5
6834   (eval $ac_link) 2>&5
6835   ac_status=$?
6836   echo "$as_me:6836: \$? = $ac_status" >&5
6837   (exit "$ac_status"); } &&
6838          { ac_try='test -s "conftest$ac_exeext"'
6839   { (eval echo "$as_me:6839: \"$ac_try\"") >&5
6840   (eval $ac_try) 2>&5
6841   ac_status=$?
6842   echo "$as_me:6842: \$? = $ac_status" >&5
6843   (exit "$ac_status"); }; }; then
6844   echo "$as_me:6844: result: yes" >&5
6845 echo "${ECHO_T}yes" >&6
6846                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6847
6848 else
6849   echo "$as_me: failed program was:" >&5
6850 cat "conftest.$ac_ext" >&5
6851 echo "$as_me:6851: result: no" >&5
6852 echo "${ECHO_T}no" >&6
6853
6854 cf_search=
6855 cf_library_path_list=""
6856 if test -n "${LDFLAGS}${LIBS}" ; then
6857         for cf_library_path in $LDFLAGS $LIBS
6858         do
6859                 case "$cf_library_path" in
6860                 (-L*)
6861                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6862
6863 test "x$cf_library_path" != "xNONE" && \
6864 test -d "$cf_library_path" && \
6865  {
6866         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6867         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6868         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6869         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6870         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6871         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"
6872 }
6873
6874                         cf_library_path_list="$cf_library_path_list $cf_search"
6875                         ;;
6876                 esac
6877         done
6878 fi
6879
6880 cf_search=
6881
6882 test "x$prefix" != "xNONE" && \
6883 test -d "$prefix" && \
6884  {
6885         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6886         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6887         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6888         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6889         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6890         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6891 }
6892
6893 for cf_subdir_prefix in \
6894         /usr \
6895         /usr/local \
6896         /usr/pkg \
6897         /opt \
6898         /opt/local \
6899         $HOME
6900 do
6901
6902 test "x$cf_subdir_prefix" != "x$prefix" && \
6903 test -d "$cf_subdir_prefix" && \
6904 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6905         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6906         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6907         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6908         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6909         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6910         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"
6911 }
6912
6913 done
6914
6915 cf_search="$cf_library_path_list $cf_search"
6916
6917                         for cf_libdir in $cf_search
6918                         do
6919                                 echo "$as_me:6919: checking for -l$cf_nculib_root in $cf_libdir" >&5
6920 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6921                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6922                                 cat >"conftest.$ac_ext" <<_ACEOF
6923 #line 6923 "configure"
6924 #include "confdefs.h"
6925 #include <${cf_cv_ncurses_header:-curses.h}>
6926 int
6927 main (void)
6928 {
6929 initscr()
6930   ;
6931   return 0;
6932 }
6933 _ACEOF
6934 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6935 if { (eval echo "$as_me:6935: \"$ac_link\"") >&5
6936   (eval $ac_link) 2>&5
6937   ac_status=$?
6938   echo "$as_me:6938: \$? = $ac_status" >&5
6939   (exit "$ac_status"); } &&
6940          { ac_try='test -s "conftest$ac_exeext"'
6941   { (eval echo "$as_me:6941: \"$ac_try\"") >&5
6942   (eval $ac_try) 2>&5
6943   ac_status=$?
6944   echo "$as_me:6944: \$? = $ac_status" >&5
6945   (exit "$ac_status"); }; }; then
6946   echo "$as_me:6946: result: yes" >&5
6947 echo "${ECHO_T}yes" >&6
6948                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6949                                          break
6950 else
6951   echo "$as_me: failed program was:" >&5
6952 cat "conftest.$ac_ext" >&5
6953 echo "$as_me:6953: result: no" >&5
6954 echo "${ECHO_T}no" >&6
6955                                          LIBS="$cf_save_LIBS"
6956 fi
6957 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6958                         done
6959
6960 fi
6961 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6962
6963 fi
6964
6965 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6966
6967 if test "$cf_found_library" = no ; then
6968         { { echo "$as_me:6968: error: Cannot link $cf_nculib_root library" >&5
6969 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6970    { (exit 1); exit 1; }; }
6971 fi
6972
6973 fi
6974
6975 if test -n "$cf_ncurses_LIBS" ; then
6976         echo "$as_me:6976: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6977 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6978         cf_ncurses_SAVE="$LIBS"
6979         for p in $cf_ncurses_LIBS ; do
6980                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6981                 if test "$q" != "$LIBS" ; then
6982                         LIBS="$q"
6983                 fi
6984         done
6985         cat >"conftest.$ac_ext" <<_ACEOF
6986 #line 6986 "configure"
6987 #include "confdefs.h"
6988 #include <${cf_cv_ncurses_header:-curses.h}>
6989 int
6990 main (void)
6991 {
6992 initscr(); mousemask(0,0); tigetstr((char *)0);
6993   ;
6994   return 0;
6995 }
6996 _ACEOF
6997 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6998 if { (eval echo "$as_me:6998: \"$ac_link\"") >&5
6999   (eval $ac_link) 2>&5
7000   ac_status=$?
7001   echo "$as_me:7001: \$? = $ac_status" >&5
7002   (exit "$ac_status"); } &&
7003          { ac_try='test -s "conftest$ac_exeext"'
7004   { (eval echo "$as_me:7004: \"$ac_try\"") >&5
7005   (eval $ac_try) 2>&5
7006   ac_status=$?
7007   echo "$as_me:7007: \$? = $ac_status" >&5
7008   (exit "$ac_status"); }; }; then
7009   echo "$as_me:7009: result: yes" >&5
7010 echo "${ECHO_T}yes" >&6
7011 else
7012   echo "$as_me: failed program was:" >&5
7013 cat "conftest.$ac_ext" >&5
7014 echo "$as_me:7014: result: no" >&5
7015 echo "${ECHO_T}no" >&6
7016                  LIBS="$cf_ncurses_SAVE"
7017 fi
7018 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7019 fi
7020
7021 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7022
7023 cat >>confdefs.h <<EOF
7024 #define $cf_nculib_ROOT 1
7025 EOF
7026
7027         fi
7028 else
7029         NCURSES_CONFIG=none
7030 fi
7031
7032 echo "$as_me:7032: checking if you want wide-character code" >&5
7033 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
7034
7035 # Check whether --enable-widec or --disable-widec was given.
7036 if test "${enable_widec+set}" = set; then
7037   enableval="$enable_widec"
7038   with_widec=$enableval
7039 else
7040   with_widec=no
7041 fi;
7042 echo "$as_me:7042: result: $with_widec" >&5
7043 echo "${ECHO_T}$with_widec" >&6
7044 if test "$with_widec" = yes ; then
7045
7046 for ac_header in wchar.h
7047 do
7048 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7049 echo "$as_me:7049: checking for $ac_header" >&5
7050 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7051 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7052   echo $ECHO_N "(cached) $ECHO_C" >&6
7053 else
7054   cat >"conftest.$ac_ext" <<_ACEOF
7055 #line 7055 "configure"
7056 #include "confdefs.h"
7057 #include <$ac_header>
7058 _ACEOF
7059 if { (eval echo "$as_me:7059: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7060   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7061   ac_status=$?
7062   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7063   rm -f conftest.er1
7064   cat conftest.err >&5
7065   echo "$as_me:7065: \$? = $ac_status" >&5
7066   (exit "$ac_status"); } >/dev/null; then
7067   if test -s conftest.err; then
7068     ac_cpp_err=$ac_c_preproc_warn_flag
7069   else
7070     ac_cpp_err=
7071   fi
7072 else
7073   ac_cpp_err=yes
7074 fi
7075 if test -z "$ac_cpp_err"; then
7076   eval "$as_ac_Header=yes"
7077 else
7078   echo "$as_me: failed program was:" >&5
7079   cat "conftest.$ac_ext" >&5
7080   eval "$as_ac_Header=no"
7081 fi
7082 rm -f conftest.err "conftest.$ac_ext"
7083 fi
7084 echo "$as_me:7084: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7085 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7086 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7087   cat >>confdefs.h <<EOF
7088 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7089 EOF
7090
7091 fi
7092 done
7093
7094 echo "$as_me:7094: checking for multibyte character support" >&5
7095 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7096 if test "${cf_cv_utf8_lib+set}" = set; then
7097   echo $ECHO_N "(cached) $ECHO_C" >&6
7098 else
7099
7100         cf_save_LIBS="$LIBS"
7101         cat >"conftest.$ac_ext" <<_ACEOF
7102 #line 7102 "configure"
7103 #include "confdefs.h"
7104
7105 $ac_includes_default
7106 #ifdef HAVE_WCHAR_H
7107 #include <wchar.h>
7108 #endif
7109
7110 int
7111 main (void)
7112 {
7113 putwc(0,0);
7114   ;
7115   return 0;
7116 }
7117 _ACEOF
7118 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7119 if { (eval echo "$as_me:7119: \"$ac_link\"") >&5
7120   (eval $ac_link) 2>&5
7121   ac_status=$?
7122   echo "$as_me:7122: \$? = $ac_status" >&5
7123   (exit "$ac_status"); } &&
7124          { ac_try='test -s "conftest$ac_exeext"'
7125   { (eval echo "$as_me:7125: \"$ac_try\"") >&5
7126   (eval $ac_try) 2>&5
7127   ac_status=$?
7128   echo "$as_me:7128: \$? = $ac_status" >&5
7129   (exit "$ac_status"); }; }; then
7130   cf_cv_utf8_lib=yes
7131 else
7132   echo "$as_me: failed program was:" >&5
7133 cat "conftest.$ac_ext" >&5
7134
7135 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7136 # will be set on completion of the AC_TRY_LINK below.
7137 cf_cv_header_path_utf8=
7138 cf_cv_library_path_utf8=
7139
7140 echo "${as_me:-configure}:7140: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7141
7142 cf_save_LIBS="$LIBS"
7143
7144 cat >"conftest.$ac_ext" <<_ACEOF
7145 #line 7145 "configure"
7146 #include "confdefs.h"
7147
7148 #include <libutf8.h>
7149 int
7150 main (void)
7151 {
7152 putwc(0,0);
7153   ;
7154   return 0;
7155 }
7156 _ACEOF
7157 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7158 if { (eval echo "$as_me:7158: \"$ac_link\"") >&5
7159   (eval $ac_link) 2>&5
7160   ac_status=$?
7161   echo "$as_me:7161: \$? = $ac_status" >&5
7162   (exit "$ac_status"); } &&
7163          { ac_try='test -s "conftest$ac_exeext"'
7164   { (eval echo "$as_me:7164: \"$ac_try\"") >&5
7165   (eval $ac_try) 2>&5
7166   ac_status=$?
7167   echo "$as_me:7167: \$? = $ac_status" >&5
7168   (exit "$ac_status"); }; }; then
7169
7170         cf_cv_find_linkage_utf8=yes
7171         cf_cv_header_path_utf8=/usr/include
7172         cf_cv_library_path_utf8=/usr/lib
7173
7174 else
7175   echo "$as_me: failed program was:" >&5
7176 cat "conftest.$ac_ext" >&5
7177
7178 LIBS="-lutf8  $cf_save_LIBS"
7179
7180 cat >"conftest.$ac_ext" <<_ACEOF
7181 #line 7181 "configure"
7182 #include "confdefs.h"
7183
7184 #include <libutf8.h>
7185 int
7186 main (void)
7187 {
7188 putwc(0,0);
7189   ;
7190   return 0;
7191 }
7192 _ACEOF
7193 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7194 if { (eval echo "$as_me:7194: \"$ac_link\"") >&5
7195   (eval $ac_link) 2>&5
7196   ac_status=$?
7197   echo "$as_me:7197: \$? = $ac_status" >&5
7198   (exit "$ac_status"); } &&
7199          { ac_try='test -s "conftest$ac_exeext"'
7200   { (eval echo "$as_me:7200: \"$ac_try\"") >&5
7201   (eval $ac_try) 2>&5
7202   ac_status=$?
7203   echo "$as_me:7203: \$? = $ac_status" >&5
7204   (exit "$ac_status"); }; }; then
7205
7206         cf_cv_find_linkage_utf8=yes
7207         cf_cv_header_path_utf8=/usr/include
7208         cf_cv_library_path_utf8=/usr/lib
7209         cf_cv_library_file_utf8="-lutf8"
7210
7211 else
7212   echo "$as_me: failed program was:" >&5
7213 cat "conftest.$ac_ext" >&5
7214
7215         cf_cv_find_linkage_utf8=no
7216         LIBS="$cf_save_LIBS"
7217
7218         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7219
7220 echo "${as_me:-configure}:7220: testing find linkage for utf8 library ..." 1>&5
7221
7222 echo "${as_me:-configure}:7222: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7223
7224         cf_save_CPPFLAGS="$CPPFLAGS"
7225         cf_test_CPPFLAGS="$CPPFLAGS"
7226
7227 cf_search=
7228
7229 # collect the current set of include-directories from compiler flags
7230 cf_header_path_list=""
7231 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7232         for cf_header_path in $CPPFLAGS $CFLAGS
7233         do
7234                 case "$cf_header_path" in
7235                 (-I*)
7236                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7237
7238 test "x$cf_header_path" != "xNONE" && \
7239 test -d "$cf_header_path" && \
7240  {
7241         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7242         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7243         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7244         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7245         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7246         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7247 }
7248
7249                         cf_header_path_list="$cf_header_path_list $cf_search"
7250                         ;;
7251                 esac
7252         done
7253 fi
7254
7255 # add the variations for the package we are looking for
7256
7257 cf_search=
7258
7259 test "x$prefix" != "xNONE" && \
7260 test -d "$prefix" && \
7261  {
7262         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7263         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7264         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7265         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7266         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7267         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7268 }
7269
7270 for cf_subdir_prefix in \
7271         /usr \
7272         /usr/local \
7273         /usr/pkg \
7274         /opt \
7275         /opt/local \
7276         $HOME
7277 do
7278
7279 test "x$cf_subdir_prefix" != "x$prefix" && \
7280 test -d "$cf_subdir_prefix" && \
7281 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7282         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7283         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7284         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7285         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7286         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7287         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7288 }
7289
7290 done
7291
7292 test "$includedir" != NONE && \
7293 test "$includedir" != "/usr/include" && \
7294 test -d "$includedir" && {
7295         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7296         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7297 }
7298
7299 test "$oldincludedir" != NONE && \
7300 test "$oldincludedir" != "/usr/include" && \
7301 test -d "$oldincludedir" && {
7302         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7303         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7304 }
7305
7306 cf_search="$cf_search $cf_header_path_list"
7307
7308         for cf_cv_header_path_utf8 in $cf_search
7309         do
7310                 if test -d "$cf_cv_header_path_utf8" ; then
7311                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7312
7313 echo "${as_me:-configure}:7313: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7314
7315                         CPPFLAGS="$cf_save_CPPFLAGS"
7316
7317         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7318         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7319
7320                         cat >"conftest.$ac_ext" <<_ACEOF
7321 #line 7321 "configure"
7322 #include "confdefs.h"
7323
7324 #include <libutf8.h>
7325 int
7326 main (void)
7327 {
7328 putwc(0,0);
7329   ;
7330   return 0;
7331 }
7332 _ACEOF
7333 rm -f "conftest.$ac_objext"
7334 if { (eval echo "$as_me:7334: \"$ac_compile\"") >&5
7335   (eval $ac_compile) 2>&5
7336   ac_status=$?
7337   echo "$as_me:7337: \$? = $ac_status" >&5
7338   (exit "$ac_status"); } &&
7339          { ac_try='test -s "conftest.$ac_objext"'
7340   { (eval echo "$as_me:7340: \"$ac_try\"") >&5
7341   (eval $ac_try) 2>&5
7342   ac_status=$?
7343   echo "$as_me:7343: \$? = $ac_status" >&5
7344   (exit "$ac_status"); }; }; then
7345
7346                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7347
7348 echo "${as_me:-configure}:7348: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7349
7350                                 cf_cv_find_linkage_utf8=maybe
7351                                 cf_test_CPPFLAGS="$CPPFLAGS"
7352                                 break
7353 else
7354   echo "$as_me: failed program was:" >&5
7355 cat "conftest.$ac_ext" >&5
7356
7357                                 CPPFLAGS="$cf_save_CPPFLAGS"
7358
7359 fi
7360 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7361                 fi
7362         done
7363
7364         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7365
7366 echo "${as_me:-configure}:7366: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7367
7368                 cf_save_LIBS="$LIBS"
7369                 cf_save_LDFLAGS="$LDFLAGS"
7370
7371                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7372
7373 cf_search=
7374 cf_library_path_list=""
7375 if test -n "${LDFLAGS}${LIBS}" ; then
7376         for cf_library_path in $LDFLAGS $LIBS
7377         do
7378                 case "$cf_library_path" in
7379                 (-L*)
7380                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7381
7382 test "x$cf_library_path" != "xNONE" && \
7383 test -d "$cf_library_path" && \
7384  {
7385         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7386         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7387         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7388         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7389         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7390         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7391 }
7392
7393                         cf_library_path_list="$cf_library_path_list $cf_search"
7394                         ;;
7395                 esac
7396         done
7397 fi
7398
7399 cf_search=
7400
7401 test "x$prefix" != "xNONE" && \
7402 test -d "$prefix" && \
7403  {
7404         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7405         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7406         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7407         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7408         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7409         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7410 }
7411
7412 for cf_subdir_prefix in \
7413         /usr \
7414         /usr/local \
7415         /usr/pkg \
7416         /opt \
7417         /opt/local \
7418         $HOME
7419 do
7420
7421 test "x$cf_subdir_prefix" != "x$prefix" && \
7422 test -d "$cf_subdir_prefix" && \
7423 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7424         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7425         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7426         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7427         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7428         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7429         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7430 }
7431
7432 done
7433
7434 cf_search="$cf_library_path_list $cf_search"
7435
7436                         for cf_cv_library_path_utf8 in $cf_search
7437                         do
7438                                 if test -d "$cf_cv_library_path_utf8" ; then
7439                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7440
7441 echo "${as_me:-configure}:7441: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7442
7443                                         CPPFLAGS="$cf_test_CPPFLAGS"
7444                                         LIBS="-lutf8  $cf_save_LIBS"
7445                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7446                                         cat >"conftest.$ac_ext" <<_ACEOF
7447 #line 7447 "configure"
7448 #include "confdefs.h"
7449
7450 #include <libutf8.h>
7451 int
7452 main (void)
7453 {
7454 putwc(0,0);
7455   ;
7456   return 0;
7457 }
7458 _ACEOF
7459 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7460 if { (eval echo "$as_me:7460: \"$ac_link\"") >&5
7461   (eval $ac_link) 2>&5
7462   ac_status=$?
7463   echo "$as_me:7463: \$? = $ac_status" >&5
7464   (exit "$ac_status"); } &&
7465          { ac_try='test -s "conftest$ac_exeext"'
7466   { (eval echo "$as_me:7466: \"$ac_try\"") >&5
7467   (eval $ac_try) 2>&5
7468   ac_status=$?
7469   echo "$as_me:7469: \$? = $ac_status" >&5
7470   (exit "$ac_status"); }; }; then
7471
7472                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7473
7474 echo "${as_me:-configure}:7474: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7475
7476                                         cf_cv_find_linkage_utf8=yes
7477                                         cf_cv_library_file_utf8="-lutf8"
7478                                         break
7479 else
7480   echo "$as_me: failed program was:" >&5
7481 cat "conftest.$ac_ext" >&5
7482
7483                                         CPPFLAGS="$cf_save_CPPFLAGS"
7484                                         LIBS="$cf_save_LIBS"
7485                                         LDFLAGS="$cf_save_LDFLAGS"
7486
7487 fi
7488 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7489                                 fi
7490                         done
7491                         CPPFLAGS="$cf_save_CPPFLAGS"
7492                         LDFLAGS="$cf_save_LDFLAGS"
7493                 fi
7494
7495         else
7496                 cf_cv_find_linkage_utf8=no
7497         fi
7498
7499 fi
7500 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7501
7502 fi
7503 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7504
7505 LIBS="$cf_save_LIBS"
7506
7507 if test "$cf_cv_find_linkage_utf8" = yes ; then
7508 cf_cv_utf8_lib=add-on
7509 else
7510 cf_cv_utf8_lib=no
7511 fi
7512
7513 fi
7514 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7515 fi
7516 echo "$as_me:7516: result: $cf_cv_utf8_lib" >&5
7517 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7518
7519 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7520 # ncurses/ncursesw:
7521 if test "$cf_cv_utf8_lib" = "add-on" ; then
7522
7523 cat >>confdefs.h <<\EOF
7524 #define HAVE_LIBUTF8_H 1
7525 EOF
7526
7527 if test -n "$cf_cv_header_path_utf8" ; then
7528   for cf_add_incdir in $cf_cv_header_path_utf8
7529   do
7530         while test "$cf_add_incdir" != /usr/include
7531         do
7532           if test -d "$cf_add_incdir"
7533           then
7534                 cf_have_incdir=no
7535                 if test -n "$CFLAGS$CPPFLAGS" ; then
7536                   # a loop is needed to ensure we can add subdirs of existing dirs
7537                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7538                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7539                           cf_have_incdir=yes; break
7540                         fi
7541                   done
7542                 fi
7543
7544                 if test "$cf_have_incdir" = no ; then
7545                   if test "$cf_add_incdir" = /usr/local/include ; then
7546                         if test "$GCC" = yes
7547                         then
7548                           cf_save_CPPFLAGS=$CPPFLAGS
7549
7550         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7551         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7552
7553                           cat >"conftest.$ac_ext" <<_ACEOF
7554 #line 7554 "configure"
7555 #include "confdefs.h"
7556 #include <stdio.h>
7557 int
7558 main (void)
7559 {
7560 printf("Hello")
7561   ;
7562   return 0;
7563 }
7564 _ACEOF
7565 rm -f "conftest.$ac_objext"
7566 if { (eval echo "$as_me:7566: \"$ac_compile\"") >&5
7567   (eval $ac_compile) 2>&5
7568   ac_status=$?
7569   echo "$as_me:7569: \$? = $ac_status" >&5
7570   (exit "$ac_status"); } &&
7571          { ac_try='test -s "conftest.$ac_objext"'
7572   { (eval echo "$as_me:7572: \"$ac_try\"") >&5
7573   (eval $ac_try) 2>&5
7574   ac_status=$?
7575   echo "$as_me:7575: \$? = $ac_status" >&5
7576   (exit "$ac_status"); }; }; then
7577   :
7578 else
7579   echo "$as_me: failed program was:" >&5
7580 cat "conftest.$ac_ext" >&5
7581 cf_have_incdir=yes
7582 fi
7583 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7584                           CPPFLAGS=$cf_save_CPPFLAGS
7585                         fi
7586                   fi
7587                 fi
7588
7589                 if test "$cf_have_incdir" = no ; then
7590                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7591
7592 echo "${as_me:-configure}:7592: testing adding $cf_add_incdir to include-path ..." 1>&5
7593
7594                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7595
7596                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7597                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7598                   cf_add_incdir="$cf_top_incdir"
7599                 else
7600                   break
7601                 fi
7602           else
7603                 break
7604           fi
7605         done
7606   done
7607 fi
7608
7609 if test -n "$cf_cv_library_path_utf8" ; then
7610         for cf_add_libdir in $cf_cv_library_path_utf8
7611         do
7612                 if test "$cf_add_libdir" = /usr/lib ; then
7613                         :
7614                 elif test -d "$cf_add_libdir"
7615                 then
7616                         cf_have_libdir=no
7617                         if test -n "$LDFLAGS$LIBS" ; then
7618                                 # a loop is needed to ensure we can add subdirs of existing dirs
7619                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7620                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7621                                                 cf_have_libdir=yes; break
7622                                         fi
7623                                 done
7624                         fi
7625                         if test "$cf_have_libdir" = no ; then
7626                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7627
7628 echo "${as_me:-configure}:7628: testing adding $cf_add_libdir to library-path ..." 1>&5
7629
7630                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7631                         fi
7632                 fi
7633         done
7634 fi
7635
7636 cf_add_libs="$LIBS"
7637 # reverse order
7638 cf_add_0lib=
7639 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7640 # filter duplicates
7641 for cf_add_1lib in $cf_add_0lib; do
7642         for cf_add_2lib in $cf_add_libs; do
7643                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7644                         cf_add_1lib=
7645                         break
7646                 fi
7647         done
7648         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7649 done
7650 LIBS="$cf_add_libs"
7651
7652 fi
7653
7654 cf_ncuconfig_root=ncursesw
7655 cf_have_ncuconfig=no
7656
7657 if test "x${PKG_CONFIG:=none}" != xnone; then
7658         echo "$as_me:7658: checking pkg-config for $cf_ncuconfig_root" >&5
7659 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7660         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7661                 echo "$as_me:7661: result: yes" >&5
7662 echo "${ECHO_T}yes" >&6
7663
7664                 echo "$as_me:7664: checking if the $cf_ncuconfig_root package files work" >&5
7665 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7666                 cf_have_ncuconfig=unknown
7667
7668                 cf_save_CFLAGS="$CFLAGS"
7669                 cf_save_CPPFLAGS="$CPPFLAGS"
7670                 cf_save_LIBS="$LIBS"
7671
7672                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7673                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7674
7675                 # while -W for passing linker flags is prevalent, it is not "standard".
7676                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7677                 # incompatible _and_ non-standard -W option which gives an error.  Work
7678                 # around that pitfall.
7679                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7680                 (x*c[89]9@@*-W*)
7681
7682 cf_fix_cppflags=no
7683 cf_new_cflags=
7684 cf_new_cppflags=
7685 cf_new_extra_cppflags=
7686
7687 for cf_add_cflags in $cf_pkg_cflags
7688 do
7689 case "$cf_fix_cppflags" in
7690 (no)
7691         case "$cf_add_cflags" in
7692         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7693                 case "$cf_add_cflags" in
7694                 (-D*)
7695                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7696
7697                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7698                                 && test -z "${cf_tst_cflags}" \
7699                                 && cf_fix_cppflags=yes
7700
7701                         if test "$cf_fix_cppflags" = yes ; then
7702
7703         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7704         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7705
7706                                 continue
7707                         elif test "${cf_tst_cflags}" = "\"'" ; then
7708
7709         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7710         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7711
7712                                 continue
7713                         fi
7714                         ;;
7715                 esac
7716                 case "$CPPFLAGS" in
7717                 (*$cf_add_cflags)
7718                         ;;
7719                 (*)
7720                         case "$cf_add_cflags" in
7721                         (-D*)
7722                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7723
7724 CPPFLAGS=`echo "$CPPFLAGS" | \
7725         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7726                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7727
7728                                 ;;
7729                         esac
7730
7731         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7732         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7733
7734                         ;;
7735                 esac
7736                 ;;
7737         (*)
7738
7739         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7740         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7741
7742                 ;;
7743         esac
7744         ;;
7745 (yes)
7746
7747         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7748         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7749
7750         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7751
7752         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7753                 && test -z "${cf_tst_cflags}" \
7754                 && cf_fix_cppflags=no
7755         ;;
7756 esac
7757 done
7758
7759 if test -n "$cf_new_cflags" ; then
7760
7761         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7762         CFLAGS="${CFLAGS}$cf_new_cflags"
7763
7764 fi
7765
7766 if test -n "$cf_new_cppflags" ; then
7767
7768         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7769         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7770
7771 fi
7772
7773 if test -n "$cf_new_extra_cppflags" ; then
7774
7775         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7776         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7777
7778 fi
7779
7780 cf_add_libs="$LIBS"
7781 # reverse order
7782 cf_add_0lib=
7783 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7784 # filter duplicates
7785 for cf_add_1lib in $cf_add_0lib; do
7786         for cf_add_2lib in $cf_add_libs; do
7787                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7788                         cf_add_1lib=
7789                         break
7790                 fi
7791         done
7792         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7793 done
7794 LIBS="$cf_add_libs"
7795
7796                         cat >"conftest.$ac_ext" <<_ACEOF
7797 #line 7797 "configure"
7798 #include "confdefs.h"
7799 #include <${cf_cv_ncurses_header:-curses.h}>
7800 int
7801 main (void)
7802 {
7803 initscr(); mousemask(0,0); tigetstr((char *)0);
7804   ;
7805   return 0;
7806 }
7807 _ACEOF
7808 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7809 if { (eval echo "$as_me:7809: \"$ac_link\"") >&5
7810   (eval $ac_link) 2>&5
7811   ac_status=$?
7812   echo "$as_me:7812: \$? = $ac_status" >&5
7813   (exit "$ac_status"); } &&
7814          { ac_try='test -s "conftest$ac_exeext"'
7815   { (eval echo "$as_me:7815: \"$ac_try\"") >&5
7816   (eval $ac_try) 2>&5
7817   ac_status=$?
7818   echo "$as_me:7818: \$? = $ac_status" >&5
7819   (exit "$ac_status"); }; }; then
7820   if test "$cross_compiling" = yes; then
7821   cf_test_ncuconfig=maybe
7822 else
7823   cat >"conftest.$ac_ext" <<_ACEOF
7824 #line 7824 "configure"
7825 #include "confdefs.h"
7826 #include <${cf_cv_ncurses_header:-curses.h}>
7827                                         int main(void)
7828                                         { const char *xx = curses_version(); return (xx == 0); }
7829 _ACEOF
7830 rm -f "conftest$ac_exeext"
7831 if { (eval echo "$as_me:7831: \"$ac_link\"") >&5
7832   (eval $ac_link) 2>&5
7833   ac_status=$?
7834   echo "$as_me:7834: \$? = $ac_status" >&5
7835   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7836   { (eval echo "$as_me:7836: \"$ac_try\"") >&5
7837   (eval $ac_try) 2>&5
7838   ac_status=$?
7839   echo "$as_me:7839: \$? = $ac_status" >&5
7840   (exit "$ac_status"); }; }; then
7841   cf_test_ncuconfig=yes
7842 else
7843   echo "$as_me: program exited with status $ac_status" >&5
7844 echo "$as_me: failed program was:" >&5
7845 cat "conftest.$ac_ext" >&5
7846 cf_test_ncuconfig=no
7847 fi
7848 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7849 fi
7850 else
7851   echo "$as_me: failed program was:" >&5
7852 cat "conftest.$ac_ext" >&5
7853 cf_test_ncuconfig=no
7854 fi
7855 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7856
7857                         CFLAGS="$cf_save_CFLAGS"
7858                         CPPFLAGS="$cf_save_CPPFLAGS"
7859                         LIBS="$cf_save_LIBS"
7860
7861                         if test "x$cf_test_ncuconfig" != xyes; then
7862                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7863                                 cf_pkg_cflags="$cf_temp"
7864                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7865                                 cf_pkg_libs="$cf_temp"
7866                         fi
7867                         ;;
7868                 esac
7869
7870 for cf_add_cflags in $cf_pkg_cflags
7871 do
7872         case "x$cf_add_cflags" in
7873         (x-[DU]*)
7874
7875 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7876 while true
7877 do
7878         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'`
7879         test "$CFLAGS" != "$cf_old_cflag" || break
7880
7881         CFLAGS="$cf_old_cflag"
7882 done
7883
7884 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7885 while true
7886 do
7887         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'`
7888         test "$CPPFLAGS" != "$cf_old_cflag" || break
7889
7890         CPPFLAGS="$cf_old_cflag"
7891 done
7892
7893                 ;;
7894         esac
7895
7896 cf_fix_cppflags=no
7897 cf_new_cflags=
7898 cf_new_cppflags=
7899 cf_new_extra_cppflags=
7900
7901 for cf_add_cflags in $cf_add_cflags
7902 do
7903 case "$cf_fix_cppflags" in
7904 (no)
7905         case "$cf_add_cflags" in
7906         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7907                 case "$cf_add_cflags" in
7908                 (-D*)
7909                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7910
7911                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7912                                 && test -z "${cf_tst_cflags}" \
7913                                 && cf_fix_cppflags=yes
7914
7915                         if test "$cf_fix_cppflags" = yes ; then
7916
7917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7919
7920                                 continue
7921                         elif test "${cf_tst_cflags}" = "\"'" ; then
7922
7923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7925
7926                                 continue
7927                         fi
7928                         ;;
7929                 esac
7930                 case "$CPPFLAGS" in
7931                 (*$cf_add_cflags)
7932                         ;;
7933                 (*)
7934                         case "$cf_add_cflags" in
7935                         (-D*)
7936                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7937
7938 CPPFLAGS=`echo "$CPPFLAGS" | \
7939         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7940                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7941
7942                                 ;;
7943                         esac
7944
7945         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7946         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7947
7948                         ;;
7949                 esac
7950                 ;;
7951         (*)
7952
7953         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7954         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7955
7956                 ;;
7957         esac
7958         ;;
7959 (yes)
7960
7961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7963
7964         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7965
7966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7967                 && test -z "${cf_tst_cflags}" \
7968                 && cf_fix_cppflags=no
7969         ;;
7970 esac
7971 done
7972
7973 if test -n "$cf_new_cflags" ; then
7974
7975         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7976         CFLAGS="${CFLAGS}$cf_new_cflags"
7977
7978 fi
7979
7980 if test -n "$cf_new_cppflags" ; then
7981
7982         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7983         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7984
7985 fi
7986
7987 if test -n "$cf_new_extra_cppflags" ; then
7988
7989         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7990         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7991
7992 fi
7993
7994 done
7995
7996 cf_add_libs="$LIBS"
7997 # reverse order
7998 cf_add_0lib=
7999 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8000 # filter duplicates
8001 for cf_add_1lib in $cf_add_0lib; do
8002         for cf_add_2lib in $cf_add_libs; do
8003                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8004                         cf_add_1lib=
8005                         break
8006                 fi
8007         done
8008         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8009 done
8010 LIBS="$cf_add_libs"
8011
8012                 cat >"conftest.$ac_ext" <<_ACEOF
8013 #line 8013 "configure"
8014 #include "confdefs.h"
8015 #include <${cf_cv_ncurses_header:-curses.h}>
8016 int
8017 main (void)
8018 {
8019 initscr(); mousemask(0,0); tigetstr((char *)0);
8020   ;
8021   return 0;
8022 }
8023 _ACEOF
8024 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8025 if { (eval echo "$as_me:8025: \"$ac_link\"") >&5
8026   (eval $ac_link) 2>&5
8027   ac_status=$?
8028   echo "$as_me:8028: \$? = $ac_status" >&5
8029   (exit "$ac_status"); } &&
8030          { ac_try='test -s "conftest$ac_exeext"'
8031   { (eval echo "$as_me:8031: \"$ac_try\"") >&5
8032   (eval $ac_try) 2>&5
8033   ac_status=$?
8034   echo "$as_me:8034: \$? = $ac_status" >&5
8035   (exit "$ac_status"); }; }; then
8036   if test "$cross_compiling" = yes; then
8037   cf_have_ncuconfig=maybe
8038 else
8039   cat >"conftest.$ac_ext" <<_ACEOF
8040 #line 8040 "configure"
8041 #include "confdefs.h"
8042 #include <${cf_cv_ncurses_header:-curses.h}>
8043                                 int main(void)
8044                                 { const char *xx = curses_version(); return (xx == 0); }
8045 _ACEOF
8046 rm -f "conftest$ac_exeext"
8047 if { (eval echo "$as_me:8047: \"$ac_link\"") >&5
8048   (eval $ac_link) 2>&5
8049   ac_status=$?
8050   echo "$as_me:8050: \$? = $ac_status" >&5
8051   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8052   { (eval echo "$as_me:8052: \"$ac_try\"") >&5
8053   (eval $ac_try) 2>&5
8054   ac_status=$?
8055   echo "$as_me:8055: \$? = $ac_status" >&5
8056   (exit "$ac_status"); }; }; then
8057   cf_have_ncuconfig=yes
8058 else
8059   echo "$as_me: program exited with status $ac_status" >&5
8060 echo "$as_me: failed program was:" >&5
8061 cat "conftest.$ac_ext" >&5
8062 cf_have_ncuconfig=no
8063 fi
8064 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8065 fi
8066 else
8067   echo "$as_me: failed program was:" >&5
8068 cat "conftest.$ac_ext" >&5
8069 cf_have_ncuconfig=no
8070 fi
8071 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8072                 echo "$as_me:8072: result: $cf_have_ncuconfig" >&5
8073 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8074                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8075                 if test "$cf_have_ncuconfig" != "yes"
8076                 then
8077                         CPPFLAGS="$cf_save_CPPFLAGS"
8078                         LIBS="$cf_save_LIBS"
8079                         NCURSES_CONFIG_PKG=none
8080                 else
8081
8082 cat >>confdefs.h <<\EOF
8083 #define NCURSES 1
8084 EOF
8085
8086                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8087
8088 echo "$as_me:8088: checking for terminfo header" >&5
8089 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8090 if test "${cf_cv_term_header+set}" = set; then
8091   echo $ECHO_N "(cached) $ECHO_C" >&6
8092 else
8093
8094 case "${cf_cv_ncurses_header}" in
8095 (*/ncurses.h|*/ncursesw.h)
8096         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8097         ;;
8098 (*)
8099         cf_term_header=term.h
8100         ;;
8101 esac
8102
8103 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8104 do
8105 cat >"conftest.$ac_ext" <<_ACEOF
8106 #line 8106 "configure"
8107 #include "confdefs.h"
8108 #include <stdio.h>
8109 #include <${cf_cv_ncurses_header:-curses.h}>
8110 #include <$cf_test>
8111
8112 int
8113 main (void)
8114 {
8115 int x = auto_left_margin; (void)x
8116   ;
8117   return 0;
8118 }
8119 _ACEOF
8120 rm -f "conftest.$ac_objext"
8121 if { (eval echo "$as_me:8121: \"$ac_compile\"") >&5
8122   (eval $ac_compile) 2>&5
8123   ac_status=$?
8124   echo "$as_me:8124: \$? = $ac_status" >&5
8125   (exit "$ac_status"); } &&
8126          { ac_try='test -s "conftest.$ac_objext"'
8127   { (eval echo "$as_me:8127: \"$ac_try\"") >&5
8128   (eval $ac_try) 2>&5
8129   ac_status=$?
8130   echo "$as_me:8130: \$? = $ac_status" >&5
8131   (exit "$ac_status"); }; }; then
8132
8133         cf_cv_term_header="$cf_test"
8134 else
8135   echo "$as_me: failed program was:" >&5
8136 cat "conftest.$ac_ext" >&5
8137
8138         cf_cv_term_header=unknown
8139
8140 fi
8141 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8142         test "$cf_cv_term_header" != unknown && break
8143 done
8144
8145 fi
8146 echo "$as_me:8146: result: $cf_cv_term_header" >&5
8147 echo "${ECHO_T}$cf_cv_term_header" >&6
8148
8149 # Set definitions to allow ifdef'ing to accommodate subdirectories
8150
8151 case "$cf_cv_term_header" in
8152 (*term.h)
8153
8154 cat >>confdefs.h <<\EOF
8155 #define HAVE_TERM_H 1
8156 EOF
8157
8158         ;;
8159 esac
8160
8161 case "$cf_cv_term_header" in
8162 (ncurses/term.h)
8163
8164 cat >>confdefs.h <<\EOF
8165 #define HAVE_NCURSES_TERM_H 1
8166 EOF
8167
8168         ;;
8169 (ncursesw/term.h)
8170
8171 cat >>confdefs.h <<\EOF
8172 #define HAVE_NCURSESW_TERM_H 1
8173 EOF
8174
8175         ;;
8176 esac
8177
8178                 fi
8179
8180         else
8181                 echo "$as_me:8181: result: no" >&5
8182 echo "${ECHO_T}no" >&6
8183                 NCURSES_CONFIG_PKG=none
8184         fi
8185 else
8186         NCURSES_CONFIG_PKG=none
8187 fi
8188
8189 if test "x$cf_have_ncuconfig" = "xno"; then
8190         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8191
8192 if test -n "$ac_tool_prefix"; then
8193   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8194   do
8195     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8196 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8197 echo "$as_me:8197: checking for $ac_word" >&5
8198 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8199 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8200   echo $ECHO_N "(cached) $ECHO_C" >&6
8201 else
8202   if test -n "$NCURSES_CONFIG"; then
8203   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8204 else
8205   ac_save_IFS=$IFS; IFS=$ac_path_separator
8206 ac_dummy="$PATH"
8207 for ac_dir in $ac_dummy; do
8208   IFS=$ac_save_IFS
8209   test -z "$ac_dir" && ac_dir=.
8210   $as_executable_p "$ac_dir/$ac_word" || continue
8211 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8212 echo "$as_me:8212: found $ac_dir/$ac_word" >&5
8213 break
8214 done
8215
8216 fi
8217 fi
8218 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8219 if test -n "$NCURSES_CONFIG"; then
8220   echo "$as_me:8220: result: $NCURSES_CONFIG" >&5
8221 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8222 else
8223   echo "$as_me:8223: result: no" >&5
8224 echo "${ECHO_T}no" >&6
8225 fi
8226
8227     test -n "$NCURSES_CONFIG" && break
8228   done
8229 fi
8230 if test -z "$NCURSES_CONFIG"; then
8231   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8232   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8233 do
8234   # Extract the first word of "$ac_prog", so it can be a program name with args.
8235 set dummy $ac_prog; ac_word=$2
8236 echo "$as_me:8236: checking for $ac_word" >&5
8237 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8238 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8239   echo $ECHO_N "(cached) $ECHO_C" >&6
8240 else
8241   if test -n "$ac_ct_NCURSES_CONFIG"; then
8242   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8243 else
8244   ac_save_IFS=$IFS; IFS=$ac_path_separator
8245 ac_dummy="$PATH"
8246 for ac_dir in $ac_dummy; do
8247   IFS=$ac_save_IFS
8248   test -z "$ac_dir" && ac_dir=.
8249   $as_executable_p "$ac_dir/$ac_word" || continue
8250 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8251 echo "$as_me:8251: found $ac_dir/$ac_word" >&5
8252 break
8253 done
8254
8255 fi
8256 fi
8257 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8258 if test -n "$ac_ct_NCURSES_CONFIG"; then
8259   echo "$as_me:8259: result: $ac_ct_NCURSES_CONFIG" >&5
8260 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8261 else
8262   echo "$as_me:8262: result: no" >&5
8263 echo "${ECHO_T}no" >&6
8264 fi
8265
8266   test -n "$ac_ct_NCURSES_CONFIG" && break
8267 done
8268 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8269
8270   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8271 fi
8272
8273         if test "$NCURSES_CONFIG" != none ; then
8274
8275 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8276 do
8277         case "x$cf_add_cflags" in
8278         (x-[DU]*)
8279
8280 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8281 while true
8282 do
8283         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'`
8284         test "$CFLAGS" != "$cf_old_cflag" || break
8285
8286         CFLAGS="$cf_old_cflag"
8287 done
8288
8289 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8290 while true
8291 do
8292         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'`
8293         test "$CPPFLAGS" != "$cf_old_cflag" || break
8294
8295         CPPFLAGS="$cf_old_cflag"
8296 done
8297
8298                 ;;
8299         esac
8300
8301 cf_fix_cppflags=no
8302 cf_new_cflags=
8303 cf_new_cppflags=
8304 cf_new_extra_cppflags=
8305
8306 for cf_add_cflags in $cf_add_cflags
8307 do
8308 case "$cf_fix_cppflags" in
8309 (no)
8310         case "$cf_add_cflags" in
8311         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8312                 case "$cf_add_cflags" in
8313                 (-D*)
8314                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8315
8316                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8317                                 && test -z "${cf_tst_cflags}" \
8318                                 && cf_fix_cppflags=yes
8319
8320                         if test "$cf_fix_cppflags" = yes ; then
8321
8322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8324
8325                                 continue
8326                         elif test "${cf_tst_cflags}" = "\"'" ; then
8327
8328         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8329         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8330
8331                                 continue
8332                         fi
8333                         ;;
8334                 esac
8335                 case "$CPPFLAGS" in
8336                 (*$cf_add_cflags)
8337                         ;;
8338                 (*)
8339                         case "$cf_add_cflags" in
8340                         (-D*)
8341                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8342
8343 CPPFLAGS=`echo "$CPPFLAGS" | \
8344         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8345                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8346
8347                                 ;;
8348                         esac
8349
8350         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8351         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8352
8353                         ;;
8354                 esac
8355                 ;;
8356         (*)
8357
8358         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8359         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8360
8361                 ;;
8362         esac
8363         ;;
8364 (yes)
8365
8366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8368
8369         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8370
8371         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8372                 && test -z "${cf_tst_cflags}" \
8373                 && cf_fix_cppflags=no
8374         ;;
8375 esac
8376 done
8377
8378 if test -n "$cf_new_cflags" ; then
8379
8380         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8381         CFLAGS="${CFLAGS}$cf_new_cflags"
8382
8383 fi
8384
8385 if test -n "$cf_new_cppflags" ; then
8386
8387         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8388         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8389
8390 fi
8391
8392 if test -n "$cf_new_extra_cppflags" ; then
8393
8394         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8395         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8396
8397 fi
8398
8399 done
8400
8401 cf_add_libs="$LIBS"
8402 # reverse order
8403 cf_add_0lib=
8404 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8405 # filter duplicates
8406 for cf_add_1lib in $cf_add_0lib; do
8407         for cf_add_2lib in $cf_add_libs; do
8408                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8409                         cf_add_1lib=
8410                         break
8411                 fi
8412         done
8413         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8414 done
8415 LIBS="$cf_add_libs"
8416
8417                 # even with config script, some packages use no-override for curses.h
8418
8419 echo "$as_me:8419: checking if we have identified curses headers" >&5
8420 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8421 if test "${cf_cv_ncurses_header+set}" = set; then
8422   echo $ECHO_N "(cached) $ECHO_C" >&6
8423 else
8424
8425 cf_cv_ncurses_header=none
8426 for cf_header in \
8427         ncurses.h ncursesw/ncurses.h \
8428         curses.h ncursesw/curses.h
8429 do
8430 cat >"conftest.$ac_ext" <<_ACEOF
8431 #line 8431 "configure"
8432 #include "confdefs.h"
8433 #include <${cf_header}>
8434 int
8435 main (void)
8436 {
8437 initscr(); endwin()
8438   ;
8439   return 0;
8440 }
8441 _ACEOF
8442 rm -f "conftest.$ac_objext"
8443 if { (eval echo "$as_me:8443: \"$ac_compile\"") >&5
8444   (eval $ac_compile) 2>&5
8445   ac_status=$?
8446   echo "$as_me:8446: \$? = $ac_status" >&5
8447   (exit "$ac_status"); } &&
8448          { ac_try='test -s "conftest.$ac_objext"'
8449   { (eval echo "$as_me:8449: \"$ac_try\"") >&5
8450   (eval $ac_try) 2>&5
8451   ac_status=$?
8452   echo "$as_me:8452: \$? = $ac_status" >&5
8453   (exit "$ac_status"); }; }; then
8454   cf_cv_ncurses_header=$cf_header; break
8455 else
8456   echo "$as_me: failed program was:" >&5
8457 cat "conftest.$ac_ext" >&5
8458 fi
8459 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8460 done
8461
8462 fi
8463 echo "$as_me:8463: result: $cf_cv_ncurses_header" >&5
8464 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8465
8466 if test "$cf_cv_ncurses_header" = none ; then
8467         { { echo "$as_me:8467: error: No curses header-files found" >&5
8468 echo "$as_me: error: No curses header-files found" >&2;}
8469    { (exit 1); exit 1; }; }
8470 fi
8471
8472 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8473
8474 for ac_header in $cf_cv_ncurses_header
8475 do
8476 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8477 echo "$as_me:8477: checking for $ac_header" >&5
8478 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8479 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8480   echo $ECHO_N "(cached) $ECHO_C" >&6
8481 else
8482   cat >"conftest.$ac_ext" <<_ACEOF
8483 #line 8483 "configure"
8484 #include "confdefs.h"
8485 #include <$ac_header>
8486 _ACEOF
8487 if { (eval echo "$as_me:8487: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8488   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8489   ac_status=$?
8490   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8491   rm -f conftest.er1
8492   cat conftest.err >&5
8493   echo "$as_me:8493: \$? = $ac_status" >&5
8494   (exit "$ac_status"); } >/dev/null; then
8495   if test -s conftest.err; then
8496     ac_cpp_err=$ac_c_preproc_warn_flag
8497   else
8498     ac_cpp_err=
8499   fi
8500 else
8501   ac_cpp_err=yes
8502 fi
8503 if test -z "$ac_cpp_err"; then
8504   eval "$as_ac_Header=yes"
8505 else
8506   echo "$as_me: failed program was:" >&5
8507   cat "conftest.$ac_ext" >&5
8508   eval "$as_ac_Header=no"
8509 fi
8510 rm -f conftest.err "conftest.$ac_ext"
8511 fi
8512 echo "$as_me:8512: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8513 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8514 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8515   cat >>confdefs.h <<EOF
8516 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8517 EOF
8518
8519 fi
8520 done
8521
8522 cat >>confdefs.h <<\EOF
8523 #define NCURSES 1
8524 EOF
8525
8526 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8527
8528                 cat >>confdefs.h <<EOF
8529 #define $cf_nculib_ROOT 1
8530 EOF
8531
8532                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8533
8534         else
8535
8536 cf_ncuhdr_root=ncursesw
8537
8538 test -n "$cf_cv_curses_dir" && \
8539 test "$cf_cv_curses_dir" != "no" && { \
8540
8541 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8542   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8543   do
8544         while test "$cf_add_incdir" != /usr/include
8545         do
8546           if test -d "$cf_add_incdir"
8547           then
8548                 cf_have_incdir=no
8549                 if test -n "$CFLAGS$CPPFLAGS" ; then
8550                   # a loop is needed to ensure we can add subdirs of existing dirs
8551                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8552                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8553                           cf_have_incdir=yes; break
8554                         fi
8555                   done
8556                 fi
8557
8558                 if test "$cf_have_incdir" = no ; then
8559                   if test "$cf_add_incdir" = /usr/local/include ; then
8560                         if test "$GCC" = yes
8561                         then
8562                           cf_save_CPPFLAGS=$CPPFLAGS
8563
8564         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8565         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8566
8567                           cat >"conftest.$ac_ext" <<_ACEOF
8568 #line 8568 "configure"
8569 #include "confdefs.h"
8570 #include <stdio.h>
8571 int
8572 main (void)
8573 {
8574 printf("Hello")
8575   ;
8576   return 0;
8577 }
8578 _ACEOF
8579 rm -f "conftest.$ac_objext"
8580 if { (eval echo "$as_me:8580: \"$ac_compile\"") >&5
8581   (eval $ac_compile) 2>&5
8582   ac_status=$?
8583   echo "$as_me:8583: \$? = $ac_status" >&5
8584   (exit "$ac_status"); } &&
8585          { ac_try='test -s "conftest.$ac_objext"'
8586   { (eval echo "$as_me:8586: \"$ac_try\"") >&5
8587   (eval $ac_try) 2>&5
8588   ac_status=$?
8589   echo "$as_me:8589: \$? = $ac_status" >&5
8590   (exit "$ac_status"); }; }; then
8591   :
8592 else
8593   echo "$as_me: failed program was:" >&5
8594 cat "conftest.$ac_ext" >&5
8595 cf_have_incdir=yes
8596 fi
8597 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8598                           CPPFLAGS=$cf_save_CPPFLAGS
8599                         fi
8600                   fi
8601                 fi
8602
8603                 if test "$cf_have_incdir" = no ; then
8604                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8605
8606 echo "${as_me:-configure}:8606: testing adding $cf_add_incdir to include-path ..." 1>&5
8607
8608                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8609
8610                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8611                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8612                   cf_add_incdir="$cf_top_incdir"
8613                 else
8614                   break
8615                 fi
8616           else
8617                 break
8618           fi
8619         done
8620   done
8621 fi
8622
8623 }
8624
8625 echo "$as_me:8625: checking for $cf_ncuhdr_root header in include-path" >&5
8626 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8627 if test "${cf_cv_ncurses_h+set}" = set; then
8628   echo $ECHO_N "(cached) $ECHO_C" >&6
8629 else
8630
8631         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8632         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8633         for cf_header in $cf_header_list
8634         do
8635
8636         cat >"conftest.$ac_ext" <<_ACEOF
8637 #line 8637 "configure"
8638 #include "confdefs.h"
8639
8640 #define _XOPEN_SOURCE_EXTENDED
8641 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8642 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8643
8644 #include <$cf_header>
8645 int
8646 main (void)
8647 {
8648
8649 #ifdef NCURSES_VERSION
8650
8651 #ifndef WACS_BSSB
8652         #error WACS_BSSB is not defined
8653 #endif
8654
8655 printf("%s\\n", NCURSES_VERSION);
8656 #else
8657 #ifdef __NCURSES_H
8658 printf("old\\n");
8659 #else
8660         #error __NCURSES_H is not defined
8661 #endif
8662 #endif
8663
8664   ;
8665   return 0;
8666 }
8667 _ACEOF
8668 rm -f "conftest.$ac_objext"
8669 if { (eval echo "$as_me:8669: \"$ac_compile\"") >&5
8670   (eval $ac_compile) 2>&5
8671   ac_status=$?
8672   echo "$as_me:8672: \$? = $ac_status" >&5
8673   (exit "$ac_status"); } &&
8674          { ac_try='test -s "conftest.$ac_objext"'
8675   { (eval echo "$as_me:8675: \"$ac_try\"") >&5
8676   (eval $ac_try) 2>&5
8677   ac_status=$?
8678   echo "$as_me:8678: \$? = $ac_status" >&5
8679   (exit "$ac_status"); }; }; then
8680   cf_cv_ncurses_h=$cf_header
8681
8682 else
8683   echo "$as_me: failed program was:" >&5
8684 cat "conftest.$ac_ext" >&5
8685 cf_cv_ncurses_h=no
8686 fi
8687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8688
8689                 test "$cf_cv_ncurses_h" != no && break
8690         done
8691
8692 fi
8693 echo "$as_me:8693: result: $cf_cv_ncurses_h" >&5
8694 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8695
8696 if test "$cf_cv_ncurses_h" != no ; then
8697         cf_cv_ncurses_header=$cf_cv_ncurses_h
8698 else
8699
8700 echo "$as_me:8700: checking for $cf_ncuhdr_root include-path" >&5
8701 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8702 if test "${cf_cv_ncurses_h2+set}" = set; then
8703   echo $ECHO_N "(cached) $ECHO_C" >&6
8704 else
8705
8706         test -n "$verbose" && echo
8707
8708 cf_search=
8709
8710 # collect the current set of include-directories from compiler flags
8711 cf_header_path_list=""
8712 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8713         for cf_header_path in $CPPFLAGS $CFLAGS
8714         do
8715                 case "$cf_header_path" in
8716                 (-I*)
8717                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8718
8719 test "x$cf_header_path" != "xNONE" && \
8720 test -d "$cf_header_path" && \
8721  {
8722         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8723         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8724         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8725         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8726         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8727         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"
8728 }
8729
8730                         cf_header_path_list="$cf_header_path_list $cf_search"
8731                         ;;
8732                 esac
8733         done
8734 fi
8735
8736 # add the variations for the package we are looking for
8737
8738 cf_search=
8739
8740 test "x$prefix" != "xNONE" && \
8741 test -d "$prefix" && \
8742  {
8743         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8744         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8745         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8746         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8747         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8748         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8749 }
8750
8751 for cf_subdir_prefix in \
8752         /usr \
8753         /usr/local \
8754         /usr/pkg \
8755         /opt \
8756         /opt/local \
8757         $HOME
8758 do
8759
8760 test "x$cf_subdir_prefix" != "x$prefix" && \
8761 test -d "$cf_subdir_prefix" && \
8762 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8763         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8764         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8765         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8766         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8767         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8768         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"
8769 }
8770
8771 done
8772
8773 test "$includedir" != NONE && \
8774 test "$includedir" != "/usr/include" && \
8775 test -d "$includedir" && {
8776         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8777         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8778 }
8779
8780 test "$oldincludedir" != NONE && \
8781 test "$oldincludedir" != "/usr/include" && \
8782 test -d "$oldincludedir" && {
8783         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8784         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8785 }
8786
8787 cf_search="$cf_search $cf_header_path_list"
8788
8789         test -n "$verbose" && echo "search path $cf_search"
8790         cf_save2_CPPFLAGS="$CPPFLAGS"
8791         for cf_incdir in $cf_search
8792         do
8793
8794 if test -n "$cf_incdir" ; then
8795   for cf_add_incdir in $cf_incdir
8796   do
8797         while test "$cf_add_incdir" != /usr/include
8798         do
8799           if test -d "$cf_add_incdir"
8800           then
8801                 cf_have_incdir=no
8802                 if test -n "$CFLAGS$CPPFLAGS" ; then
8803                   # a loop is needed to ensure we can add subdirs of existing dirs
8804                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8805                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8806                           cf_have_incdir=yes; break
8807                         fi
8808                   done
8809                 fi
8810
8811                 if test "$cf_have_incdir" = no ; then
8812                   if test "$cf_add_incdir" = /usr/local/include ; then
8813                         if test "$GCC" = yes
8814                         then
8815                           cf_save_CPPFLAGS=$CPPFLAGS
8816
8817         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8818         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8819
8820                           cat >"conftest.$ac_ext" <<_ACEOF
8821 #line 8821 "configure"
8822 #include "confdefs.h"
8823 #include <stdio.h>
8824 int
8825 main (void)
8826 {
8827 printf("Hello")
8828   ;
8829   return 0;
8830 }
8831 _ACEOF
8832 rm -f "conftest.$ac_objext"
8833 if { (eval echo "$as_me:8833: \"$ac_compile\"") >&5
8834   (eval $ac_compile) 2>&5
8835   ac_status=$?
8836   echo "$as_me:8836: \$? = $ac_status" >&5
8837   (exit "$ac_status"); } &&
8838          { ac_try='test -s "conftest.$ac_objext"'
8839   { (eval echo "$as_me:8839: \"$ac_try\"") >&5
8840   (eval $ac_try) 2>&5
8841   ac_status=$?
8842   echo "$as_me:8842: \$? = $ac_status" >&5
8843   (exit "$ac_status"); }; }; then
8844   :
8845 else
8846   echo "$as_me: failed program was:" >&5
8847 cat "conftest.$ac_ext" >&5
8848 cf_have_incdir=yes
8849 fi
8850 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8851                           CPPFLAGS=$cf_save_CPPFLAGS
8852                         fi
8853                   fi
8854                 fi
8855
8856                 if test "$cf_have_incdir" = no ; then
8857                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8858
8859 echo "${as_me:-configure}:8859: testing adding $cf_add_incdir to include-path ..." 1>&5
8860
8861                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8862
8863                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8864                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8865                   cf_add_incdir="$cf_top_incdir"
8866                 else
8867                   break
8868                 fi
8869           else
8870                 break
8871           fi
8872         done
8873   done
8874 fi
8875
8876                 for cf_header in \
8877                         ncurses.h \
8878                         curses.h
8879                 do
8880
8881         cat >"conftest.$ac_ext" <<_ACEOF
8882 #line 8882 "configure"
8883 #include "confdefs.h"
8884
8885 #include <$cf_header>
8886 int
8887 main (void)
8888 {
8889
8890 #ifdef NCURSES_VERSION
8891
8892 printf("%s\\n", NCURSES_VERSION);
8893 #else
8894 #ifdef __NCURSES_H
8895 printf("old\\n");
8896 #else
8897         #error __NCURSES_H is not defined
8898 #endif
8899 #endif
8900
8901   ;
8902   return 0;
8903 }
8904 _ACEOF
8905 rm -f "conftest.$ac_objext"
8906 if { (eval echo "$as_me:8906: \"$ac_compile\"") >&5
8907   (eval $ac_compile) 2>&5
8908   ac_status=$?
8909   echo "$as_me:8909: \$? = $ac_status" >&5
8910   (exit "$ac_status"); } &&
8911          { ac_try='test -s "conftest.$ac_objext"'
8912   { (eval echo "$as_me:8912: \"$ac_try\"") >&5
8913   (eval $ac_try) 2>&5
8914   ac_status=$?
8915   echo "$as_me:8915: \$? = $ac_status" >&5
8916   (exit "$ac_status"); }; }; then
8917   cf_cv_ncurses_h2=$cf_header
8918
8919 else
8920   echo "$as_me: failed program was:" >&5
8921 cat "conftest.$ac_ext" >&5
8922 cf_cv_ncurses_h2=no
8923 fi
8924 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8925
8926                         if test "$cf_cv_ncurses_h2" != no ; then
8927                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8928                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8929                                 break
8930                         fi
8931                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8932                 done
8933                 CPPFLAGS="$cf_save2_CPPFLAGS"
8934                 test "$cf_cv_ncurses_h2" != no && break
8935         done
8936         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8936: error: not found" >&5
8937 echo "$as_me: error: not found" >&2;}
8938    { (exit 1); exit 1; }; }
8939
8940 fi
8941 echo "$as_me:8941: result: $cf_cv_ncurses_h2" >&5
8942 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8943
8944         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8945         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8946         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8947                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8948         fi
8949
8950 if test -n "$cf_1st_incdir" ; then
8951   for cf_add_incdir in $cf_1st_incdir
8952   do
8953         while test "$cf_add_incdir" != /usr/include
8954         do
8955           if test -d "$cf_add_incdir"
8956           then
8957                 cf_have_incdir=no
8958                 if test -n "$CFLAGS$CPPFLAGS" ; then
8959                   # a loop is needed to ensure we can add subdirs of existing dirs
8960                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8961                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8962                           cf_have_incdir=yes; break
8963                         fi
8964                   done
8965                 fi
8966
8967                 if test "$cf_have_incdir" = no ; then
8968                   if test "$cf_add_incdir" = /usr/local/include ; then
8969                         if test "$GCC" = yes
8970                         then
8971                           cf_save_CPPFLAGS=$CPPFLAGS
8972
8973         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8974         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8975
8976                           cat >"conftest.$ac_ext" <<_ACEOF
8977 #line 8977 "configure"
8978 #include "confdefs.h"
8979 #include <stdio.h>
8980 int
8981 main (void)
8982 {
8983 printf("Hello")
8984   ;
8985   return 0;
8986 }
8987 _ACEOF
8988 rm -f "conftest.$ac_objext"
8989 if { (eval echo "$as_me:8989: \"$ac_compile\"") >&5
8990   (eval $ac_compile) 2>&5
8991   ac_status=$?
8992   echo "$as_me:8992: \$? = $ac_status" >&5
8993   (exit "$ac_status"); } &&
8994          { ac_try='test -s "conftest.$ac_objext"'
8995   { (eval echo "$as_me:8995: \"$ac_try\"") >&5
8996   (eval $ac_try) 2>&5
8997   ac_status=$?
8998   echo "$as_me:8998: \$? = $ac_status" >&5
8999   (exit "$ac_status"); }; }; then
9000   :
9001 else
9002   echo "$as_me: failed program was:" >&5
9003 cat "conftest.$ac_ext" >&5
9004 cf_have_incdir=yes
9005 fi
9006 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9007                           CPPFLAGS=$cf_save_CPPFLAGS
9008                         fi
9009                   fi
9010                 fi
9011
9012                 if test "$cf_have_incdir" = no ; then
9013                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9014
9015 echo "${as_me:-configure}:9015: testing adding $cf_add_incdir to include-path ..." 1>&5
9016
9017                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9018
9019                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9020                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9021                   cf_add_incdir="$cf_top_incdir"
9022                 else
9023                   break
9024                 fi
9025           else
9026                 break
9027           fi
9028         done
9029   done
9030 fi
9031
9032 fi
9033
9034 # Set definitions to allow ifdef'ing for ncurses.h
9035
9036 case "$cf_cv_ncurses_header" in
9037 (*ncurses.h)
9038
9039 cat >>confdefs.h <<\EOF
9040 #define HAVE_NCURSES_H 1
9041 EOF
9042
9043         ;;
9044 esac
9045
9046 case "$cf_cv_ncurses_header" in
9047 (ncurses/curses.h|ncurses/ncurses.h)
9048
9049 cat >>confdefs.h <<\EOF
9050 #define HAVE_NCURSES_NCURSES_H 1
9051 EOF
9052
9053         ;;
9054 (ncursesw/curses.h|ncursesw/ncurses.h)
9055
9056 cat >>confdefs.h <<\EOF
9057 #define HAVE_NCURSESW_NCURSES_H 1
9058 EOF
9059
9060         ;;
9061 esac
9062
9063 echo "$as_me:9063: checking for terminfo header" >&5
9064 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9065 if test "${cf_cv_term_header+set}" = set; then
9066   echo $ECHO_N "(cached) $ECHO_C" >&6
9067 else
9068
9069 case "${cf_cv_ncurses_header}" in
9070 (*/ncurses.h|*/ncursesw.h)
9071         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9072         ;;
9073 (*)
9074         cf_term_header=term.h
9075         ;;
9076 esac
9077
9078 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9079 do
9080 cat >"conftest.$ac_ext" <<_ACEOF
9081 #line 9081 "configure"
9082 #include "confdefs.h"
9083 #include <stdio.h>
9084 #include <${cf_cv_ncurses_header:-curses.h}>
9085 #include <$cf_test>
9086
9087 int
9088 main (void)
9089 {
9090 int x = auto_left_margin; (void)x
9091   ;
9092   return 0;
9093 }
9094 _ACEOF
9095 rm -f "conftest.$ac_objext"
9096 if { (eval echo "$as_me:9096: \"$ac_compile\"") >&5
9097   (eval $ac_compile) 2>&5
9098   ac_status=$?
9099   echo "$as_me:9099: \$? = $ac_status" >&5
9100   (exit "$ac_status"); } &&
9101          { ac_try='test -s "conftest.$ac_objext"'
9102   { (eval echo "$as_me:9102: \"$ac_try\"") >&5
9103   (eval $ac_try) 2>&5
9104   ac_status=$?
9105   echo "$as_me:9105: \$? = $ac_status" >&5
9106   (exit "$ac_status"); }; }; then
9107
9108         cf_cv_term_header="$cf_test"
9109 else
9110   echo "$as_me: failed program was:" >&5
9111 cat "conftest.$ac_ext" >&5
9112
9113         cf_cv_term_header=unknown
9114
9115 fi
9116 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9117         test "$cf_cv_term_header" != unknown && break
9118 done
9119
9120 fi
9121 echo "$as_me:9121: result: $cf_cv_term_header" >&5
9122 echo "${ECHO_T}$cf_cv_term_header" >&6
9123
9124 # Set definitions to allow ifdef'ing to accommodate subdirectories
9125
9126 case "$cf_cv_term_header" in
9127 (*term.h)
9128
9129 cat >>confdefs.h <<\EOF
9130 #define HAVE_TERM_H 1
9131 EOF
9132
9133         ;;
9134 esac
9135
9136 case "$cf_cv_term_header" in
9137 (ncurses/term.h)
9138
9139 cat >>confdefs.h <<\EOF
9140 #define HAVE_NCURSES_TERM_H 1
9141 EOF
9142
9143         ;;
9144 (ncursesw/term.h)
9145
9146 cat >>confdefs.h <<\EOF
9147 #define HAVE_NCURSESW_TERM_H 1
9148 EOF
9149
9150         ;;
9151 esac
9152
9153 # some applications need this, but should check for NCURSES_VERSION
9154
9155 cat >>confdefs.h <<\EOF
9156 #define NCURSES 1
9157 EOF
9158
9159 echo "$as_me:9159: checking for ncurses version" >&5
9160 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9161 if test "${cf_cv_ncurses_version+set}" = set; then
9162   echo $ECHO_N "(cached) $ECHO_C" >&6
9163 else
9164
9165         cf_cv_ncurses_version=no
9166         cf_tempfile=out$$
9167         rm -f "$cf_tempfile"
9168         if test "$cross_compiling" = yes; then
9169
9170         # This will not work if the preprocessor splits the line after the
9171         # Autoconf token.  The 'unproto' program does that.
9172         cat > "conftest.$ac_ext" <<EOF
9173 #include <${cf_cv_ncurses_header:-curses.h}>
9174 #undef Autoconf
9175 #ifdef NCURSES_VERSION
9176 Autoconf NCURSES_VERSION
9177 #else
9178 #ifdef __NCURSES_H
9179 Autoconf "old"
9180 #endif
9181 ;
9182 #endif
9183 EOF
9184         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9185         { (eval echo "$as_me:9185: \"$cf_try\"") >&5
9186   (eval $cf_try) 2>&5
9187   ac_status=$?
9188   echo "$as_me:9188: \$? = $ac_status" >&5
9189   (exit "$ac_status"); }
9190         if test -f conftest.out ; then
9191                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9192                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9193                 rm -f conftest.out
9194         fi
9195
9196 else
9197   cat >"conftest.$ac_ext" <<_ACEOF
9198 #line 9198 "configure"
9199 #include "confdefs.h"
9200
9201 $ac_includes_default
9202
9203 #include <${cf_cv_ncurses_header:-curses.h}>
9204
9205 int main(void)
9206 {
9207         FILE *fp = fopen("$cf_tempfile", "w");
9208 #ifdef NCURSES_VERSION
9209 # ifdef NCURSES_VERSION_PATCH
9210         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9211 # else
9212         fprintf(fp, "%s\\n", NCURSES_VERSION);
9213 # endif
9214 #else
9215 # ifdef __NCURSES_H
9216         fprintf(fp, "old\\n");
9217 # else
9218         #error expected ncurses header to define __NCURSES_H
9219 # endif
9220 #endif
9221         ${cf_cv_main_return:-return}(0);
9222 }
9223 _ACEOF
9224 rm -f "conftest$ac_exeext"
9225 if { (eval echo "$as_me:9225: \"$ac_link\"") >&5
9226   (eval $ac_link) 2>&5
9227   ac_status=$?
9228   echo "$as_me:9228: \$? = $ac_status" >&5
9229   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9230   { (eval echo "$as_me:9230: \"$ac_try\"") >&5
9231   (eval $ac_try) 2>&5
9232   ac_status=$?
9233   echo "$as_me:9233: \$? = $ac_status" >&5
9234   (exit "$ac_status"); }; }; then
9235
9236         cf_cv_ncurses_version=`cat $cf_tempfile`
9237 else
9238   echo "$as_me: program exited with status $ac_status" >&5
9239 echo "$as_me: failed program was:" >&5
9240 cat "conftest.$ac_ext" >&5
9241 fi
9242 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9243 fi
9244         rm -f "$cf_tempfile"
9245
9246 fi
9247 echo "$as_me:9247: result: $cf_cv_ncurses_version" >&5
9248 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9249 test "$cf_cv_ncurses_version" = no ||
9250 cat >>confdefs.h <<\EOF
9251 #define NCURSES 1
9252 EOF
9253
9254 cf_nculib_root=ncursesw
9255         # This works, except for the special case where we find gpm, but
9256         # ncurses is in a nonstandard location via $LIBS, and we really want
9257         # to link gpm.
9258 cf_ncurses_LIBS=""
9259 cf_ncurses_SAVE="$LIBS"
9260 echo "$as_me:9260: checking for Gpm_Open in -lgpm" >&5
9261 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9262 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9263   echo $ECHO_N "(cached) $ECHO_C" >&6
9264 else
9265   ac_check_lib_save_LIBS=$LIBS
9266 LIBS="-lgpm  $LIBS"
9267 cat >"conftest.$ac_ext" <<_ACEOF
9268 #line 9268 "configure"
9269 #include "confdefs.h"
9270
9271 /* Override any gcc2 internal prototype to avoid an error.  */
9272 #ifdef __cplusplus
9273 extern "C"
9274 #endif
9275 /* We use char because int might match the return type of a gcc2
9276    builtin and then its argument prototype would still apply.  */
9277 char Gpm_Open (void);
9278 int
9279 main (void)
9280 {
9281 Gpm_Open ();
9282   ;
9283   return 0;
9284 }
9285 _ACEOF
9286 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9287 if { (eval echo "$as_me:9287: \"$ac_link\"") >&5
9288   (eval $ac_link) 2>&5
9289   ac_status=$?
9290   echo "$as_me:9290: \$? = $ac_status" >&5
9291   (exit "$ac_status"); } &&
9292          { ac_try='test -s "conftest$ac_exeext"'
9293   { (eval echo "$as_me:9293: \"$ac_try\"") >&5
9294   (eval $ac_try) 2>&5
9295   ac_status=$?
9296   echo "$as_me:9296: \$? = $ac_status" >&5
9297   (exit "$ac_status"); }; }; then
9298   ac_cv_lib_gpm_Gpm_Open=yes
9299 else
9300   echo "$as_me: failed program was:" >&5
9301 cat "conftest.$ac_ext" >&5
9302 ac_cv_lib_gpm_Gpm_Open=no
9303 fi
9304 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9305 LIBS=$ac_check_lib_save_LIBS
9306 fi
9307 echo "$as_me:9307: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9308 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9309 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9310   echo "$as_me:9310: checking for initscr in -lgpm" >&5
9311 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9312 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9313   echo $ECHO_N "(cached) $ECHO_C" >&6
9314 else
9315   ac_check_lib_save_LIBS=$LIBS
9316 LIBS="-lgpm  $LIBS"
9317 cat >"conftest.$ac_ext" <<_ACEOF
9318 #line 9318 "configure"
9319 #include "confdefs.h"
9320
9321 /* Override any gcc2 internal prototype to avoid an error.  */
9322 #ifdef __cplusplus
9323 extern "C"
9324 #endif
9325 /* We use char because int might match the return type of a gcc2
9326    builtin and then its argument prototype would still apply.  */
9327 char initscr (void);
9328 int
9329 main (void)
9330 {
9331 initscr ();
9332   ;
9333   return 0;
9334 }
9335 _ACEOF
9336 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9337 if { (eval echo "$as_me:9337: \"$ac_link\"") >&5
9338   (eval $ac_link) 2>&5
9339   ac_status=$?
9340   echo "$as_me:9340: \$? = $ac_status" >&5
9341   (exit "$ac_status"); } &&
9342          { ac_try='test -s "conftest$ac_exeext"'
9343   { (eval echo "$as_me:9343: \"$ac_try\"") >&5
9344   (eval $ac_try) 2>&5
9345   ac_status=$?
9346   echo "$as_me:9346: \$? = $ac_status" >&5
9347   (exit "$ac_status"); }; }; then
9348   ac_cv_lib_gpm_initscr=yes
9349 else
9350   echo "$as_me: failed program was:" >&5
9351 cat "conftest.$ac_ext" >&5
9352 ac_cv_lib_gpm_initscr=no
9353 fi
9354 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9355 LIBS=$ac_check_lib_save_LIBS
9356 fi
9357 echo "$as_me:9357: result: $ac_cv_lib_gpm_initscr" >&5
9358 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9359 if test "$ac_cv_lib_gpm_initscr" = yes; then
9360   LIBS="$cf_ncurses_SAVE"
9361 else
9362   cf_ncurses_LIBS="-lgpm"
9363 fi
9364
9365 fi
9366
9367 case "$host_os" in
9368 (freebsd*)
9369         # This is only necessary if you are linking against an obsolete
9370         # version of ncurses (but it should do no harm, since it is static).
9371         if test "$cf_nculib_root" = ncurses ; then
9372                 echo "$as_me:9372: checking for tgoto in -lmytinfo" >&5
9373 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9374 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9375   echo $ECHO_N "(cached) $ECHO_C" >&6
9376 else
9377   ac_check_lib_save_LIBS=$LIBS
9378 LIBS="-lmytinfo  $LIBS"
9379 cat >"conftest.$ac_ext" <<_ACEOF
9380 #line 9380 "configure"
9381 #include "confdefs.h"
9382
9383 /* Override any gcc2 internal prototype to avoid an error.  */
9384 #ifdef __cplusplus
9385 extern "C"
9386 #endif
9387 /* We use char because int might match the return type of a gcc2
9388    builtin and then its argument prototype would still apply.  */
9389 char tgoto (void);
9390 int
9391 main (void)
9392 {
9393 tgoto ();
9394   ;
9395   return 0;
9396 }
9397 _ACEOF
9398 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9399 if { (eval echo "$as_me:9399: \"$ac_link\"") >&5
9400   (eval $ac_link) 2>&5
9401   ac_status=$?
9402   echo "$as_me:9402: \$? = $ac_status" >&5
9403   (exit "$ac_status"); } &&
9404          { ac_try='test -s "conftest$ac_exeext"'
9405   { (eval echo "$as_me:9405: \"$ac_try\"") >&5
9406   (eval $ac_try) 2>&5
9407   ac_status=$?
9408   echo "$as_me:9408: \$? = $ac_status" >&5
9409   (exit "$ac_status"); }; }; then
9410   ac_cv_lib_mytinfo_tgoto=yes
9411 else
9412   echo "$as_me: failed program was:" >&5
9413 cat "conftest.$ac_ext" >&5
9414 ac_cv_lib_mytinfo_tgoto=no
9415 fi
9416 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9417 LIBS=$ac_check_lib_save_LIBS
9418 fi
9419 echo "$as_me:9419: result: $ac_cv_lib_mytinfo_tgoto" >&5
9420 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9421 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9422   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9423 fi
9424
9425         fi
9426         ;;
9427 esac
9428
9429 cf_add_libs="$LIBS"
9430 # reverse order
9431 cf_add_0lib=
9432 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9433 # filter duplicates
9434 for cf_add_1lib in $cf_add_0lib; do
9435         for cf_add_2lib in $cf_add_libs; do
9436                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9437                         cf_add_1lib=
9438                         break
9439                 fi
9440         done
9441         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9442 done
9443 LIBS="$cf_add_libs"
9444
9445 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9446 then
9447
9448 cf_add_libs="$LIBS"
9449 # reverse order
9450 cf_add_0lib=
9451 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9452 # filter duplicates
9453 for cf_add_1lib in $cf_add_0lib; do
9454         for cf_add_2lib in $cf_add_libs; do
9455                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9456                         cf_add_1lib=
9457                         break
9458                 fi
9459         done
9460         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9461 done
9462 LIBS="$cf_add_libs"
9463
9464 else
9465
9466         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9467         cf_libdir=""
9468         echo "$as_me:9468: checking for initscr" >&5
9469 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9470 if test "${ac_cv_func_initscr+set}" = set; then
9471   echo $ECHO_N "(cached) $ECHO_C" >&6
9472 else
9473   cat >"conftest.$ac_ext" <<_ACEOF
9474 #line 9474 "configure"
9475 #include "confdefs.h"
9476 #define initscr autoconf_temporary
9477 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9478 #undef initscr
9479
9480 #ifdef __cplusplus
9481 extern "C"
9482 #endif
9483
9484 /* We use char because int might match the return type of a gcc2
9485    builtin and then its argument prototype would still apply.  */
9486 char initscr (void);
9487
9488 int
9489 main (void)
9490 {
9491
9492 /* The GNU C library defines stubs for functions which it implements
9493     to always fail with ENOSYS.  Some functions are actually named
9494     something starting with __ and the normal name is an alias.  */
9495 #if defined (__stub_initscr) || defined (__stub___initscr)
9496 #error found stub for initscr
9497 #endif
9498
9499         return initscr ();
9500   ;
9501   return 0;
9502 }
9503 _ACEOF
9504 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9505 if { (eval echo "$as_me:9505: \"$ac_link\"") >&5
9506   (eval $ac_link) 2>&5
9507   ac_status=$?
9508   echo "$as_me:9508: \$? = $ac_status" >&5
9509   (exit "$ac_status"); } &&
9510          { ac_try='test -s "conftest$ac_exeext"'
9511   { (eval echo "$as_me:9511: \"$ac_try\"") >&5
9512   (eval $ac_try) 2>&5
9513   ac_status=$?
9514   echo "$as_me:9514: \$? = $ac_status" >&5
9515   (exit "$ac_status"); }; }; then
9516   ac_cv_func_initscr=yes
9517 else
9518   echo "$as_me: failed program was:" >&5
9519 cat "conftest.$ac_ext" >&5
9520 ac_cv_func_initscr=no
9521 fi
9522 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9523 fi
9524 echo "$as_me:9524: result: $ac_cv_func_initscr" >&5
9525 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9526 if test "$ac_cv_func_initscr" = yes; then
9527   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9528 else
9529
9530                 cf_save_LIBS="$LIBS"
9531                 echo "$as_me:9531: checking for initscr in -l$cf_nculib_root" >&5
9532 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9533                 LIBS="-l$cf_nculib_root $LIBS"
9534                 cat >"conftest.$ac_ext" <<_ACEOF
9535 #line 9535 "configure"
9536 #include "confdefs.h"
9537 #include <${cf_cv_ncurses_header:-curses.h}>
9538 int
9539 main (void)
9540 {
9541 initscr()
9542   ;
9543   return 0;
9544 }
9545 _ACEOF
9546 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9547 if { (eval echo "$as_me:9547: \"$ac_link\"") >&5
9548   (eval $ac_link) 2>&5
9549   ac_status=$?
9550   echo "$as_me:9550: \$? = $ac_status" >&5
9551   (exit "$ac_status"); } &&
9552          { ac_try='test -s "conftest$ac_exeext"'
9553   { (eval echo "$as_me:9553: \"$ac_try\"") >&5
9554   (eval $ac_try) 2>&5
9555   ac_status=$?
9556   echo "$as_me:9556: \$? = $ac_status" >&5
9557   (exit "$ac_status"); }; }; then
9558   echo "$as_me:9558: result: yes" >&5
9559 echo "${ECHO_T}yes" >&6
9560                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9561
9562 else
9563   echo "$as_me: failed program was:" >&5
9564 cat "conftest.$ac_ext" >&5
9565 echo "$as_me:9565: result: no" >&5
9566 echo "${ECHO_T}no" >&6
9567
9568 cf_search=
9569 cf_library_path_list=""
9570 if test -n "${LDFLAGS}${LIBS}" ; then
9571         for cf_library_path in $LDFLAGS $LIBS
9572         do
9573                 case "$cf_library_path" in
9574                 (-L*)
9575                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9576
9577 test "x$cf_library_path" != "xNONE" && \
9578 test -d "$cf_library_path" && \
9579  {
9580         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9581         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9582         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9583         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9584         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9585         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"
9586 }
9587
9588                         cf_library_path_list="$cf_library_path_list $cf_search"
9589                         ;;
9590                 esac
9591         done
9592 fi
9593
9594 cf_search=
9595
9596 test "x$prefix" != "xNONE" && \
9597 test -d "$prefix" && \
9598  {
9599         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9600         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9601         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9602         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9603         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9604         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9605 }
9606
9607 for cf_subdir_prefix in \
9608         /usr \
9609         /usr/local \
9610         /usr/pkg \
9611         /opt \
9612         /opt/local \
9613         $HOME
9614 do
9615
9616 test "x$cf_subdir_prefix" != "x$prefix" && \
9617 test -d "$cf_subdir_prefix" && \
9618 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9619         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9620         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9621         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9622         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9623         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9624         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"
9625 }
9626
9627 done
9628
9629 cf_search="$cf_library_path_list $cf_search"
9630
9631                         for cf_libdir in $cf_search
9632                         do
9633                                 echo "$as_me:9633: checking for -l$cf_nculib_root in $cf_libdir" >&5
9634 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9635                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9636                                 cat >"conftest.$ac_ext" <<_ACEOF
9637 #line 9637 "configure"
9638 #include "confdefs.h"
9639 #include <${cf_cv_ncurses_header:-curses.h}>
9640 int
9641 main (void)
9642 {
9643 initscr()
9644   ;
9645   return 0;
9646 }
9647 _ACEOF
9648 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9649 if { (eval echo "$as_me:9649: \"$ac_link\"") >&5
9650   (eval $ac_link) 2>&5
9651   ac_status=$?
9652   echo "$as_me:9652: \$? = $ac_status" >&5
9653   (exit "$ac_status"); } &&
9654          { ac_try='test -s "conftest$ac_exeext"'
9655   { (eval echo "$as_me:9655: \"$ac_try\"") >&5
9656   (eval $ac_try) 2>&5
9657   ac_status=$?
9658   echo "$as_me:9658: \$? = $ac_status" >&5
9659   (exit "$ac_status"); }; }; then
9660   echo "$as_me:9660: result: yes" >&5
9661 echo "${ECHO_T}yes" >&6
9662                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9663                                          break
9664 else
9665   echo "$as_me: failed program was:" >&5
9666 cat "conftest.$ac_ext" >&5
9667 echo "$as_me:9667: result: no" >&5
9668 echo "${ECHO_T}no" >&6
9669                                          LIBS="$cf_save_LIBS"
9670 fi
9671 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9672                         done
9673
9674 fi
9675 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9676
9677 fi
9678
9679 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9680
9681 if test "$cf_found_library" = no ; then
9682         { { echo "$as_me:9682: error: Cannot link $cf_nculib_root library" >&5
9683 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9684    { (exit 1); exit 1; }; }
9685 fi
9686
9687 fi
9688
9689 if test -n "$cf_ncurses_LIBS" ; then
9690         echo "$as_me:9690: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9691 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9692         cf_ncurses_SAVE="$LIBS"
9693         for p in $cf_ncurses_LIBS ; do
9694                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9695                 if test "$q" != "$LIBS" ; then
9696                         LIBS="$q"
9697                 fi
9698         done
9699         cat >"conftest.$ac_ext" <<_ACEOF
9700 #line 9700 "configure"
9701 #include "confdefs.h"
9702 #include <${cf_cv_ncurses_header:-curses.h}>
9703 int
9704 main (void)
9705 {
9706 initscr(); mousemask(0,0); tigetstr((char *)0);
9707   ;
9708   return 0;
9709 }
9710 _ACEOF
9711 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9712 if { (eval echo "$as_me:9712: \"$ac_link\"") >&5
9713   (eval $ac_link) 2>&5
9714   ac_status=$?
9715   echo "$as_me:9715: \$? = $ac_status" >&5
9716   (exit "$ac_status"); } &&
9717          { ac_try='test -s "conftest$ac_exeext"'
9718   { (eval echo "$as_me:9718: \"$ac_try\"") >&5
9719   (eval $ac_try) 2>&5
9720   ac_status=$?
9721   echo "$as_me:9721: \$? = $ac_status" >&5
9722   (exit "$ac_status"); }; }; then
9723   echo "$as_me:9723: result: yes" >&5
9724 echo "${ECHO_T}yes" >&6
9725 else
9726   echo "$as_me: failed program was:" >&5
9727 cat "conftest.$ac_ext" >&5
9728 echo "$as_me:9728: result: no" >&5
9729 echo "${ECHO_T}no" >&6
9730                  LIBS="$cf_ncurses_SAVE"
9731 fi
9732 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9733 fi
9734
9735 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9736
9737 cat >>confdefs.h <<EOF
9738 #define $cf_nculib_ROOT 1
9739 EOF
9740
9741         fi
9742 else
9743         NCURSES_CONFIG=none
9744 fi
9745
9746 else
9747
9748 cf_ncuconfig_root=ncurses
9749 cf_have_ncuconfig=no
9750
9751 if test "x${PKG_CONFIG:=none}" != xnone; then
9752         echo "$as_me:9752: checking pkg-config for $cf_ncuconfig_root" >&5
9753 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9754         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9755                 echo "$as_me:9755: result: yes" >&5
9756 echo "${ECHO_T}yes" >&6
9757
9758                 echo "$as_me:9758: checking if the $cf_ncuconfig_root package files work" >&5
9759 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9760                 cf_have_ncuconfig=unknown
9761
9762                 cf_save_CFLAGS="$CFLAGS"
9763                 cf_save_CPPFLAGS="$CPPFLAGS"
9764                 cf_save_LIBS="$LIBS"
9765
9766                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9767                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9768
9769                 # while -W for passing linker flags is prevalent, it is not "standard".
9770                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9771                 # incompatible _and_ non-standard -W option which gives an error.  Work
9772                 # around that pitfall.
9773                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9774                 (x*c[89]9@@*-W*)
9775
9776 cf_fix_cppflags=no
9777 cf_new_cflags=
9778 cf_new_cppflags=
9779 cf_new_extra_cppflags=
9780
9781 for cf_add_cflags in $cf_pkg_cflags
9782 do
9783 case "$cf_fix_cppflags" in
9784 (no)
9785         case "$cf_add_cflags" in
9786         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9787                 case "$cf_add_cflags" in
9788                 (-D*)
9789                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9790
9791                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9792                                 && test -z "${cf_tst_cflags}" \
9793                                 && cf_fix_cppflags=yes
9794
9795                         if test "$cf_fix_cppflags" = yes ; then
9796
9797         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9798         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9799
9800                                 continue
9801                         elif test "${cf_tst_cflags}" = "\"'" ; then
9802
9803         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9804         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9805
9806                                 continue
9807                         fi
9808                         ;;
9809                 esac
9810                 case "$CPPFLAGS" in
9811                 (*$cf_add_cflags)
9812                         ;;
9813                 (*)
9814                         case "$cf_add_cflags" in
9815                         (-D*)
9816                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9817
9818 CPPFLAGS=`echo "$CPPFLAGS" | \
9819         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9820                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9821
9822                                 ;;
9823                         esac
9824
9825         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9826         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9827
9828                         ;;
9829                 esac
9830                 ;;
9831         (*)
9832
9833         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9834         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9835
9836                 ;;
9837         esac
9838         ;;
9839 (yes)
9840
9841         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9842         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9843
9844         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9845
9846         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9847                 && test -z "${cf_tst_cflags}" \
9848                 && cf_fix_cppflags=no
9849         ;;
9850 esac
9851 done
9852
9853 if test -n "$cf_new_cflags" ; then
9854
9855         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9856         CFLAGS="${CFLAGS}$cf_new_cflags"
9857
9858 fi
9859
9860 if test -n "$cf_new_cppflags" ; then
9861
9862         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9863         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9864
9865 fi
9866
9867 if test -n "$cf_new_extra_cppflags" ; then
9868
9869         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9870         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9871
9872 fi
9873
9874 cf_add_libs="$LIBS"
9875 # reverse order
9876 cf_add_0lib=
9877 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9878 # filter duplicates
9879 for cf_add_1lib in $cf_add_0lib; do
9880         for cf_add_2lib in $cf_add_libs; do
9881                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9882                         cf_add_1lib=
9883                         break
9884                 fi
9885         done
9886         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9887 done
9888 LIBS="$cf_add_libs"
9889
9890                         cat >"conftest.$ac_ext" <<_ACEOF
9891 #line 9891 "configure"
9892 #include "confdefs.h"
9893 #include <${cf_cv_ncurses_header:-curses.h}>
9894 int
9895 main (void)
9896 {
9897 initscr(); mousemask(0,0); tigetstr((char *)0);
9898   ;
9899   return 0;
9900 }
9901 _ACEOF
9902 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9903 if { (eval echo "$as_me:9903: \"$ac_link\"") >&5
9904   (eval $ac_link) 2>&5
9905   ac_status=$?
9906   echo "$as_me:9906: \$? = $ac_status" >&5
9907   (exit "$ac_status"); } &&
9908          { ac_try='test -s "conftest$ac_exeext"'
9909   { (eval echo "$as_me:9909: \"$ac_try\"") >&5
9910   (eval $ac_try) 2>&5
9911   ac_status=$?
9912   echo "$as_me:9912: \$? = $ac_status" >&5
9913   (exit "$ac_status"); }; }; then
9914   if test "$cross_compiling" = yes; then
9915   cf_test_ncuconfig=maybe
9916 else
9917   cat >"conftest.$ac_ext" <<_ACEOF
9918 #line 9918 "configure"
9919 #include "confdefs.h"
9920 #include <${cf_cv_ncurses_header:-curses.h}>
9921                                         int main(void)
9922                                         { const char *xx = curses_version(); return (xx == 0); }
9923 _ACEOF
9924 rm -f "conftest$ac_exeext"
9925 if { (eval echo "$as_me:9925: \"$ac_link\"") >&5
9926   (eval $ac_link) 2>&5
9927   ac_status=$?
9928   echo "$as_me:9928: \$? = $ac_status" >&5
9929   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9930   { (eval echo "$as_me:9930: \"$ac_try\"") >&5
9931   (eval $ac_try) 2>&5
9932   ac_status=$?
9933   echo "$as_me:9933: \$? = $ac_status" >&5
9934   (exit "$ac_status"); }; }; then
9935   cf_test_ncuconfig=yes
9936 else
9937   echo "$as_me: program exited with status $ac_status" >&5
9938 echo "$as_me: failed program was:" >&5
9939 cat "conftest.$ac_ext" >&5
9940 cf_test_ncuconfig=no
9941 fi
9942 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9943 fi
9944 else
9945   echo "$as_me: failed program was:" >&5
9946 cat "conftest.$ac_ext" >&5
9947 cf_test_ncuconfig=no
9948 fi
9949 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9950
9951                         CFLAGS="$cf_save_CFLAGS"
9952                         CPPFLAGS="$cf_save_CPPFLAGS"
9953                         LIBS="$cf_save_LIBS"
9954
9955                         if test "x$cf_test_ncuconfig" != xyes; then
9956                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9957                                 cf_pkg_cflags="$cf_temp"
9958                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9959                                 cf_pkg_libs="$cf_temp"
9960                         fi
9961                         ;;
9962                 esac
9963
9964 for cf_add_cflags in $cf_pkg_cflags
9965 do
9966         case "x$cf_add_cflags" in
9967         (x-[DU]*)
9968
9969 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9970 while true
9971 do
9972         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'`
9973         test "$CFLAGS" != "$cf_old_cflag" || break
9974
9975         CFLAGS="$cf_old_cflag"
9976 done
9977
9978 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9979 while true
9980 do
9981         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'`
9982         test "$CPPFLAGS" != "$cf_old_cflag" || break
9983
9984         CPPFLAGS="$cf_old_cflag"
9985 done
9986
9987                 ;;
9988         esac
9989
9990 cf_fix_cppflags=no
9991 cf_new_cflags=
9992 cf_new_cppflags=
9993 cf_new_extra_cppflags=
9994
9995 for cf_add_cflags in $cf_add_cflags
9996 do
9997 case "$cf_fix_cppflags" in
9998 (no)
9999         case "$cf_add_cflags" in
10000         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10001                 case "$cf_add_cflags" in
10002                 (-D*)
10003                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10004
10005                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10006                                 && test -z "${cf_tst_cflags}" \
10007                                 && cf_fix_cppflags=yes
10008
10009                         if test "$cf_fix_cppflags" = yes ; then
10010
10011         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10012         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10013
10014                                 continue
10015                         elif test "${cf_tst_cflags}" = "\"'" ; then
10016
10017         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10018         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10019
10020                                 continue
10021                         fi
10022                         ;;
10023                 esac
10024                 case "$CPPFLAGS" in
10025                 (*$cf_add_cflags)
10026                         ;;
10027                 (*)
10028                         case "$cf_add_cflags" in
10029                         (-D*)
10030                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10031
10032 CPPFLAGS=`echo "$CPPFLAGS" | \
10033         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10034                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10035
10036                                 ;;
10037                         esac
10038
10039         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10040         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10041
10042                         ;;
10043                 esac
10044                 ;;
10045         (*)
10046
10047         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10048         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10049
10050                 ;;
10051         esac
10052         ;;
10053 (yes)
10054
10055         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10056         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10057
10058         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10059
10060         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10061                 && test -z "${cf_tst_cflags}" \
10062                 && cf_fix_cppflags=no
10063         ;;
10064 esac
10065 done
10066
10067 if test -n "$cf_new_cflags" ; then
10068
10069         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10070         CFLAGS="${CFLAGS}$cf_new_cflags"
10071
10072 fi
10073
10074 if test -n "$cf_new_cppflags" ; then
10075
10076         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10077         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10078
10079 fi
10080
10081 if test -n "$cf_new_extra_cppflags" ; then
10082
10083         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10084         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10085
10086 fi
10087
10088 done
10089
10090 cf_add_libs="$LIBS"
10091 # reverse order
10092 cf_add_0lib=
10093 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10094 # filter duplicates
10095 for cf_add_1lib in $cf_add_0lib; do
10096         for cf_add_2lib in $cf_add_libs; do
10097                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10098                         cf_add_1lib=
10099                         break
10100                 fi
10101         done
10102         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10103 done
10104 LIBS="$cf_add_libs"
10105
10106                 cat >"conftest.$ac_ext" <<_ACEOF
10107 #line 10107 "configure"
10108 #include "confdefs.h"
10109 #include <${cf_cv_ncurses_header:-curses.h}>
10110 int
10111 main (void)
10112 {
10113 initscr(); mousemask(0,0); tigetstr((char *)0);
10114   ;
10115   return 0;
10116 }
10117 _ACEOF
10118 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10119 if { (eval echo "$as_me:10119: \"$ac_link\"") >&5
10120   (eval $ac_link) 2>&5
10121   ac_status=$?
10122   echo "$as_me:10122: \$? = $ac_status" >&5
10123   (exit "$ac_status"); } &&
10124          { ac_try='test -s "conftest$ac_exeext"'
10125   { (eval echo "$as_me:10125: \"$ac_try\"") >&5
10126   (eval $ac_try) 2>&5
10127   ac_status=$?
10128   echo "$as_me:10128: \$? = $ac_status" >&5
10129   (exit "$ac_status"); }; }; then
10130   if test "$cross_compiling" = yes; then
10131   cf_have_ncuconfig=maybe
10132 else
10133   cat >"conftest.$ac_ext" <<_ACEOF
10134 #line 10134 "configure"
10135 #include "confdefs.h"
10136 #include <${cf_cv_ncurses_header:-curses.h}>
10137                                 int main(void)
10138                                 { const char *xx = curses_version(); return (xx == 0); }
10139 _ACEOF
10140 rm -f "conftest$ac_exeext"
10141 if { (eval echo "$as_me:10141: \"$ac_link\"") >&5
10142   (eval $ac_link) 2>&5
10143   ac_status=$?
10144   echo "$as_me:10144: \$? = $ac_status" >&5
10145   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10146   { (eval echo "$as_me:10146: \"$ac_try\"") >&5
10147   (eval $ac_try) 2>&5
10148   ac_status=$?
10149   echo "$as_me:10149: \$? = $ac_status" >&5
10150   (exit "$ac_status"); }; }; then
10151   cf_have_ncuconfig=yes
10152 else
10153   echo "$as_me: program exited with status $ac_status" >&5
10154 echo "$as_me: failed program was:" >&5
10155 cat "conftest.$ac_ext" >&5
10156 cf_have_ncuconfig=no
10157 fi
10158 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10159 fi
10160 else
10161   echo "$as_me: failed program was:" >&5
10162 cat "conftest.$ac_ext" >&5
10163 cf_have_ncuconfig=no
10164 fi
10165 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10166                 echo "$as_me:10166: result: $cf_have_ncuconfig" >&5
10167 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10168                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10169                 if test "$cf_have_ncuconfig" != "yes"
10170                 then
10171                         CPPFLAGS="$cf_save_CPPFLAGS"
10172                         LIBS="$cf_save_LIBS"
10173                         NCURSES_CONFIG_PKG=none
10174                 else
10175
10176 cat >>confdefs.h <<\EOF
10177 #define NCURSES 1
10178 EOF
10179
10180                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10181
10182 echo "$as_me:10182: checking for terminfo header" >&5
10183 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10184 if test "${cf_cv_term_header+set}" = set; then
10185   echo $ECHO_N "(cached) $ECHO_C" >&6
10186 else
10187
10188 case "${cf_cv_ncurses_header}" in
10189 (*/ncurses.h|*/ncursesw.h)
10190         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10191         ;;
10192 (*)
10193         cf_term_header=term.h
10194         ;;
10195 esac
10196
10197 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10198 do
10199 cat >"conftest.$ac_ext" <<_ACEOF
10200 #line 10200 "configure"
10201 #include "confdefs.h"
10202 #include <stdio.h>
10203 #include <${cf_cv_ncurses_header:-curses.h}>
10204 #include <$cf_test>
10205
10206 int
10207 main (void)
10208 {
10209 int x = auto_left_margin; (void)x
10210   ;
10211   return 0;
10212 }
10213 _ACEOF
10214 rm -f "conftest.$ac_objext"
10215 if { (eval echo "$as_me:10215: \"$ac_compile\"") >&5
10216   (eval $ac_compile) 2>&5
10217   ac_status=$?
10218   echo "$as_me:10218: \$? = $ac_status" >&5
10219   (exit "$ac_status"); } &&
10220          { ac_try='test -s "conftest.$ac_objext"'
10221   { (eval echo "$as_me:10221: \"$ac_try\"") >&5
10222   (eval $ac_try) 2>&5
10223   ac_status=$?
10224   echo "$as_me:10224: \$? = $ac_status" >&5
10225   (exit "$ac_status"); }; }; then
10226
10227         cf_cv_term_header="$cf_test"
10228 else
10229   echo "$as_me: failed program was:" >&5
10230 cat "conftest.$ac_ext" >&5
10231
10232         cf_cv_term_header=unknown
10233
10234 fi
10235 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10236         test "$cf_cv_term_header" != unknown && break
10237 done
10238
10239 fi
10240 echo "$as_me:10240: result: $cf_cv_term_header" >&5
10241 echo "${ECHO_T}$cf_cv_term_header" >&6
10242
10243 # Set definitions to allow ifdef'ing to accommodate subdirectories
10244
10245 case "$cf_cv_term_header" in
10246 (*term.h)
10247
10248 cat >>confdefs.h <<\EOF
10249 #define HAVE_TERM_H 1
10250 EOF
10251
10252         ;;
10253 esac
10254
10255 case "$cf_cv_term_header" in
10256 (ncurses/term.h)
10257
10258 cat >>confdefs.h <<\EOF
10259 #define HAVE_NCURSES_TERM_H 1
10260 EOF
10261
10262         ;;
10263 (ncursesw/term.h)
10264
10265 cat >>confdefs.h <<\EOF
10266 #define HAVE_NCURSESW_TERM_H 1
10267 EOF
10268
10269         ;;
10270 esac
10271
10272                 fi
10273
10274         else
10275                 echo "$as_me:10275: result: no" >&5
10276 echo "${ECHO_T}no" >&6
10277                 NCURSES_CONFIG_PKG=none
10278         fi
10279 else
10280         NCURSES_CONFIG_PKG=none
10281 fi
10282
10283 if test "x$cf_have_ncuconfig" = "xno"; then
10284         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10285
10286 if test -n "$ac_tool_prefix"; then
10287   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10288   do
10289     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10290 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10291 echo "$as_me:10291: checking for $ac_word" >&5
10292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10293 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10294   echo $ECHO_N "(cached) $ECHO_C" >&6
10295 else
10296   if test -n "$NCURSES_CONFIG"; then
10297   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10298 else
10299   ac_save_IFS=$IFS; IFS=$ac_path_separator
10300 ac_dummy="$PATH"
10301 for ac_dir in $ac_dummy; do
10302   IFS=$ac_save_IFS
10303   test -z "$ac_dir" && ac_dir=.
10304   $as_executable_p "$ac_dir/$ac_word" || continue
10305 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10306 echo "$as_me:10306: found $ac_dir/$ac_word" >&5
10307 break
10308 done
10309
10310 fi
10311 fi
10312 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10313 if test -n "$NCURSES_CONFIG"; then
10314   echo "$as_me:10314: result: $NCURSES_CONFIG" >&5
10315 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10316 else
10317   echo "$as_me:10317: result: no" >&5
10318 echo "${ECHO_T}no" >&6
10319 fi
10320
10321     test -n "$NCURSES_CONFIG" && break
10322   done
10323 fi
10324 if test -z "$NCURSES_CONFIG"; then
10325   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10326   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10327 do
10328   # Extract the first word of "$ac_prog", so it can be a program name with args.
10329 set dummy $ac_prog; ac_word=$2
10330 echo "$as_me:10330: checking for $ac_word" >&5
10331 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10332 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10333   echo $ECHO_N "(cached) $ECHO_C" >&6
10334 else
10335   if test -n "$ac_ct_NCURSES_CONFIG"; then
10336   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10337 else
10338   ac_save_IFS=$IFS; IFS=$ac_path_separator
10339 ac_dummy="$PATH"
10340 for ac_dir in $ac_dummy; do
10341   IFS=$ac_save_IFS
10342   test -z "$ac_dir" && ac_dir=.
10343   $as_executable_p "$ac_dir/$ac_word" || continue
10344 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10345 echo "$as_me:10345: found $ac_dir/$ac_word" >&5
10346 break
10347 done
10348
10349 fi
10350 fi
10351 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10352 if test -n "$ac_ct_NCURSES_CONFIG"; then
10353   echo "$as_me:10353: result: $ac_ct_NCURSES_CONFIG" >&5
10354 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10355 else
10356   echo "$as_me:10356: result: no" >&5
10357 echo "${ECHO_T}no" >&6
10358 fi
10359
10360   test -n "$ac_ct_NCURSES_CONFIG" && break
10361 done
10362 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10363
10364   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10365 fi
10366
10367         if test "$NCURSES_CONFIG" != none ; then
10368
10369 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10370 do
10371         case "x$cf_add_cflags" in
10372         (x-[DU]*)
10373
10374 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10375 while true
10376 do
10377         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'`
10378         test "$CFLAGS" != "$cf_old_cflag" || break
10379
10380         CFLAGS="$cf_old_cflag"
10381 done
10382
10383 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10384 while true
10385 do
10386         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'`
10387         test "$CPPFLAGS" != "$cf_old_cflag" || break
10388
10389         CPPFLAGS="$cf_old_cflag"
10390 done
10391
10392                 ;;
10393         esac
10394
10395 cf_fix_cppflags=no
10396 cf_new_cflags=
10397 cf_new_cppflags=
10398 cf_new_extra_cppflags=
10399
10400 for cf_add_cflags in $cf_add_cflags
10401 do
10402 case "$cf_fix_cppflags" in
10403 (no)
10404         case "$cf_add_cflags" in
10405         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10406                 case "$cf_add_cflags" in
10407                 (-D*)
10408                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10409
10410                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10411                                 && test -z "${cf_tst_cflags}" \
10412                                 && cf_fix_cppflags=yes
10413
10414                         if test "$cf_fix_cppflags" = yes ; then
10415
10416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10418
10419                                 continue
10420                         elif test "${cf_tst_cflags}" = "\"'" ; then
10421
10422         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10423         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10424
10425                                 continue
10426                         fi
10427                         ;;
10428                 esac
10429                 case "$CPPFLAGS" in
10430                 (*$cf_add_cflags)
10431                         ;;
10432                 (*)
10433                         case "$cf_add_cflags" in
10434                         (-D*)
10435                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10436
10437 CPPFLAGS=`echo "$CPPFLAGS" | \
10438         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10439                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10440
10441                                 ;;
10442                         esac
10443
10444         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10445         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10446
10447                         ;;
10448                 esac
10449                 ;;
10450         (*)
10451
10452         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10453         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10454
10455                 ;;
10456         esac
10457         ;;
10458 (yes)
10459
10460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10462
10463         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10464
10465         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10466                 && test -z "${cf_tst_cflags}" \
10467                 && cf_fix_cppflags=no
10468         ;;
10469 esac
10470 done
10471
10472 if test -n "$cf_new_cflags" ; then
10473
10474         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10475         CFLAGS="${CFLAGS}$cf_new_cflags"
10476
10477 fi
10478
10479 if test -n "$cf_new_cppflags" ; then
10480
10481         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10482         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10483
10484 fi
10485
10486 if test -n "$cf_new_extra_cppflags" ; then
10487
10488         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10489         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10490
10491 fi
10492
10493 done
10494
10495 cf_add_libs="$LIBS"
10496 # reverse order
10497 cf_add_0lib=
10498 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10499 # filter duplicates
10500 for cf_add_1lib in $cf_add_0lib; do
10501         for cf_add_2lib in $cf_add_libs; do
10502                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10503                         cf_add_1lib=
10504                         break
10505                 fi
10506         done
10507         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10508 done
10509 LIBS="$cf_add_libs"
10510
10511                 # even with config script, some packages use no-override for curses.h
10512
10513 echo "$as_me:10513: checking if we have identified curses headers" >&5
10514 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10515 if test "${cf_cv_ncurses_header+set}" = set; then
10516   echo $ECHO_N "(cached) $ECHO_C" >&6
10517 else
10518
10519 cf_cv_ncurses_header=none
10520 for cf_header in \
10521         ncurses.h ncurses/ncurses.h \
10522         curses.h ncurses/curses.h
10523 do
10524 cat >"conftest.$ac_ext" <<_ACEOF
10525 #line 10525 "configure"
10526 #include "confdefs.h"
10527 #include <${cf_header}>
10528 int
10529 main (void)
10530 {
10531 initscr(); endwin()
10532   ;
10533   return 0;
10534 }
10535 _ACEOF
10536 rm -f "conftest.$ac_objext"
10537 if { (eval echo "$as_me:10537: \"$ac_compile\"") >&5
10538   (eval $ac_compile) 2>&5
10539   ac_status=$?
10540   echo "$as_me:10540: \$? = $ac_status" >&5
10541   (exit "$ac_status"); } &&
10542          { ac_try='test -s "conftest.$ac_objext"'
10543   { (eval echo "$as_me:10543: \"$ac_try\"") >&5
10544   (eval $ac_try) 2>&5
10545   ac_status=$?
10546   echo "$as_me:10546: \$? = $ac_status" >&5
10547   (exit "$ac_status"); }; }; then
10548   cf_cv_ncurses_header=$cf_header; break
10549 else
10550   echo "$as_me: failed program was:" >&5
10551 cat "conftest.$ac_ext" >&5
10552 fi
10553 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10554 done
10555
10556 fi
10557 echo "$as_me:10557: result: $cf_cv_ncurses_header" >&5
10558 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10559
10560 if test "$cf_cv_ncurses_header" = none ; then
10561         { { echo "$as_me:10561: error: No curses header-files found" >&5
10562 echo "$as_me: error: No curses header-files found" >&2;}
10563    { (exit 1); exit 1; }; }
10564 fi
10565
10566 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10567
10568 for ac_header in $cf_cv_ncurses_header
10569 do
10570 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10571 echo "$as_me:10571: checking for $ac_header" >&5
10572 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10573 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10574   echo $ECHO_N "(cached) $ECHO_C" >&6
10575 else
10576   cat >"conftest.$ac_ext" <<_ACEOF
10577 #line 10577 "configure"
10578 #include "confdefs.h"
10579 #include <$ac_header>
10580 _ACEOF
10581 if { (eval echo "$as_me:10581: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10582   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10583   ac_status=$?
10584   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10585   rm -f conftest.er1
10586   cat conftest.err >&5
10587   echo "$as_me:10587: \$? = $ac_status" >&5
10588   (exit "$ac_status"); } >/dev/null; then
10589   if test -s conftest.err; then
10590     ac_cpp_err=$ac_c_preproc_warn_flag
10591   else
10592     ac_cpp_err=
10593   fi
10594 else
10595   ac_cpp_err=yes
10596 fi
10597 if test -z "$ac_cpp_err"; then
10598   eval "$as_ac_Header=yes"
10599 else
10600   echo "$as_me: failed program was:" >&5
10601   cat "conftest.$ac_ext" >&5
10602   eval "$as_ac_Header=no"
10603 fi
10604 rm -f conftest.err "conftest.$ac_ext"
10605 fi
10606 echo "$as_me:10606: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10607 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10608 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10609   cat >>confdefs.h <<EOF
10610 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10611 EOF
10612
10613 fi
10614 done
10615
10616 cat >>confdefs.h <<\EOF
10617 #define NCURSES 1
10618 EOF
10619
10620 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10621
10622                 cat >>confdefs.h <<EOF
10623 #define $cf_nculib_ROOT 1
10624 EOF
10625
10626                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10627
10628         else
10629
10630 cf_ncuhdr_root=ncurses
10631
10632 test -n "$cf_cv_curses_dir" && \
10633 test "$cf_cv_curses_dir" != "no" && { \
10634
10635 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10636   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10637   do
10638         while test "$cf_add_incdir" != /usr/include
10639         do
10640           if test -d "$cf_add_incdir"
10641           then
10642                 cf_have_incdir=no
10643                 if test -n "$CFLAGS$CPPFLAGS" ; then
10644                   # a loop is needed to ensure we can add subdirs of existing dirs
10645                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10646                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10647                           cf_have_incdir=yes; break
10648                         fi
10649                   done
10650                 fi
10651
10652                 if test "$cf_have_incdir" = no ; then
10653                   if test "$cf_add_incdir" = /usr/local/include ; then
10654                         if test "$GCC" = yes
10655                         then
10656                           cf_save_CPPFLAGS=$CPPFLAGS
10657
10658         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10659         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10660
10661                           cat >"conftest.$ac_ext" <<_ACEOF
10662 #line 10662 "configure"
10663 #include "confdefs.h"
10664 #include <stdio.h>
10665 int
10666 main (void)
10667 {
10668 printf("Hello")
10669   ;
10670   return 0;
10671 }
10672 _ACEOF
10673 rm -f "conftest.$ac_objext"
10674 if { (eval echo "$as_me:10674: \"$ac_compile\"") >&5
10675   (eval $ac_compile) 2>&5
10676   ac_status=$?
10677   echo "$as_me:10677: \$? = $ac_status" >&5
10678   (exit "$ac_status"); } &&
10679          { ac_try='test -s "conftest.$ac_objext"'
10680   { (eval echo "$as_me:10680: \"$ac_try\"") >&5
10681   (eval $ac_try) 2>&5
10682   ac_status=$?
10683   echo "$as_me:10683: \$? = $ac_status" >&5
10684   (exit "$ac_status"); }; }; then
10685   :
10686 else
10687   echo "$as_me: failed program was:" >&5
10688 cat "conftest.$ac_ext" >&5
10689 cf_have_incdir=yes
10690 fi
10691 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10692                           CPPFLAGS=$cf_save_CPPFLAGS
10693                         fi
10694                   fi
10695                 fi
10696
10697                 if test "$cf_have_incdir" = no ; then
10698                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10699
10700 echo "${as_me:-configure}:10700: testing adding $cf_add_incdir to include-path ..." 1>&5
10701
10702                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10703
10704                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10705                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10706                   cf_add_incdir="$cf_top_incdir"
10707                 else
10708                   break
10709                 fi
10710           else
10711                 break
10712           fi
10713         done
10714   done
10715 fi
10716
10717 }
10718
10719 echo "$as_me:10719: checking for $cf_ncuhdr_root header in include-path" >&5
10720 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10721 if test "${cf_cv_ncurses_h+set}" = set; then
10722   echo $ECHO_N "(cached) $ECHO_C" >&6
10723 else
10724
10725         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10726         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10727         for cf_header in $cf_header_list
10728         do
10729
10730         cat >"conftest.$ac_ext" <<_ACEOF
10731 #line 10731 "configure"
10732 #include "confdefs.h"
10733
10734 #include <$cf_header>
10735 int
10736 main (void)
10737 {
10738
10739 #ifdef NCURSES_VERSION
10740
10741 printf("%s\\n", NCURSES_VERSION);
10742 #else
10743 #ifdef __NCURSES_H
10744 printf("old\\n");
10745 #else
10746         #error __NCURSES_H is not defined
10747 #endif
10748 #endif
10749
10750   ;
10751   return 0;
10752 }
10753 _ACEOF
10754 rm -f "conftest.$ac_objext"
10755 if { (eval echo "$as_me:10755: \"$ac_compile\"") >&5
10756   (eval $ac_compile) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit "$ac_status"); } &&
10760          { ac_try='test -s "conftest.$ac_objext"'
10761   { (eval echo "$as_me:10761: \"$ac_try\"") >&5
10762   (eval $ac_try) 2>&5
10763   ac_status=$?
10764   echo "$as_me:10764: \$? = $ac_status" >&5
10765   (exit "$ac_status"); }; }; then
10766   cf_cv_ncurses_h=$cf_header
10767
10768 else
10769   echo "$as_me: failed program was:" >&5
10770 cat "conftest.$ac_ext" >&5
10771 cf_cv_ncurses_h=no
10772 fi
10773 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10774
10775                 test "$cf_cv_ncurses_h" != no && break
10776         done
10777
10778 fi
10779 echo "$as_me:10779: result: $cf_cv_ncurses_h" >&5
10780 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10781
10782 if test "$cf_cv_ncurses_h" != no ; then
10783         cf_cv_ncurses_header=$cf_cv_ncurses_h
10784 else
10785
10786 echo "$as_me:10786: checking for $cf_ncuhdr_root include-path" >&5
10787 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10788 if test "${cf_cv_ncurses_h2+set}" = set; then
10789   echo $ECHO_N "(cached) $ECHO_C" >&6
10790 else
10791
10792         test -n "$verbose" && echo
10793
10794 cf_search=
10795
10796 # collect the current set of include-directories from compiler flags
10797 cf_header_path_list=""
10798 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10799         for cf_header_path in $CPPFLAGS $CFLAGS
10800         do
10801                 case "$cf_header_path" in
10802                 (-I*)
10803                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10804
10805 test "x$cf_header_path" != "xNONE" && \
10806 test -d "$cf_header_path" && \
10807  {
10808         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10809         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10810         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10811         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10812         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10813         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"
10814 }
10815
10816                         cf_header_path_list="$cf_header_path_list $cf_search"
10817                         ;;
10818                 esac
10819         done
10820 fi
10821
10822 # add the variations for the package we are looking for
10823
10824 cf_search=
10825
10826 test "x$prefix" != "xNONE" && \
10827 test -d "$prefix" && \
10828  {
10829         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10830         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10831         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10832         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10833         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10834         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10835 }
10836
10837 for cf_subdir_prefix in \
10838         /usr \
10839         /usr/local \
10840         /usr/pkg \
10841         /opt \
10842         /opt/local \
10843         $HOME
10844 do
10845
10846 test "x$cf_subdir_prefix" != "x$prefix" && \
10847 test -d "$cf_subdir_prefix" && \
10848 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10849         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10850         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10851         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10852         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10853         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10854         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"
10855 }
10856
10857 done
10858
10859 test "$includedir" != NONE && \
10860 test "$includedir" != "/usr/include" && \
10861 test -d "$includedir" && {
10862         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10863         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10864 }
10865
10866 test "$oldincludedir" != NONE && \
10867 test "$oldincludedir" != "/usr/include" && \
10868 test -d "$oldincludedir" && {
10869         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10870         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10871 }
10872
10873 cf_search="$cf_search $cf_header_path_list"
10874
10875         test -n "$verbose" && echo "search path $cf_search"
10876         cf_save2_CPPFLAGS="$CPPFLAGS"
10877         for cf_incdir in $cf_search
10878         do
10879
10880 if test -n "$cf_incdir" ; then
10881   for cf_add_incdir in $cf_incdir
10882   do
10883         while test "$cf_add_incdir" != /usr/include
10884         do
10885           if test -d "$cf_add_incdir"
10886           then
10887                 cf_have_incdir=no
10888                 if test -n "$CFLAGS$CPPFLAGS" ; then
10889                   # a loop is needed to ensure we can add subdirs of existing dirs
10890                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10891                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10892                           cf_have_incdir=yes; break
10893                         fi
10894                   done
10895                 fi
10896
10897                 if test "$cf_have_incdir" = no ; then
10898                   if test "$cf_add_incdir" = /usr/local/include ; then
10899                         if test "$GCC" = yes
10900                         then
10901                           cf_save_CPPFLAGS=$CPPFLAGS
10902
10903         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10904         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10905
10906                           cat >"conftest.$ac_ext" <<_ACEOF
10907 #line 10907 "configure"
10908 #include "confdefs.h"
10909 #include <stdio.h>
10910 int
10911 main (void)
10912 {
10913 printf("Hello")
10914   ;
10915   return 0;
10916 }
10917 _ACEOF
10918 rm -f "conftest.$ac_objext"
10919 if { (eval echo "$as_me:10919: \"$ac_compile\"") >&5
10920   (eval $ac_compile) 2>&5
10921   ac_status=$?
10922   echo "$as_me:10922: \$? = $ac_status" >&5
10923   (exit "$ac_status"); } &&
10924          { ac_try='test -s "conftest.$ac_objext"'
10925   { (eval echo "$as_me:10925: \"$ac_try\"") >&5
10926   (eval $ac_try) 2>&5
10927   ac_status=$?
10928   echo "$as_me:10928: \$? = $ac_status" >&5
10929   (exit "$ac_status"); }; }; then
10930   :
10931 else
10932   echo "$as_me: failed program was:" >&5
10933 cat "conftest.$ac_ext" >&5
10934 cf_have_incdir=yes
10935 fi
10936 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10937                           CPPFLAGS=$cf_save_CPPFLAGS
10938                         fi
10939                   fi
10940                 fi
10941
10942                 if test "$cf_have_incdir" = no ; then
10943                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10944
10945 echo "${as_me:-configure}:10945: testing adding $cf_add_incdir to include-path ..." 1>&5
10946
10947                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10948
10949                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10950                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10951                   cf_add_incdir="$cf_top_incdir"
10952                 else
10953                   break
10954                 fi
10955           else
10956                 break
10957           fi
10958         done
10959   done
10960 fi
10961
10962                 for cf_header in \
10963                         ncurses.h \
10964                         curses.h
10965                 do
10966
10967         cat >"conftest.$ac_ext" <<_ACEOF
10968 #line 10968 "configure"
10969 #include "confdefs.h"
10970
10971 #include <$cf_header>
10972 int
10973 main (void)
10974 {
10975
10976 #ifdef NCURSES_VERSION
10977
10978 printf("%s\\n", NCURSES_VERSION);
10979 #else
10980 #ifdef __NCURSES_H
10981 printf("old\\n");
10982 #else
10983         #error __NCURSES_H is not defined
10984 #endif
10985 #endif
10986
10987   ;
10988   return 0;
10989 }
10990 _ACEOF
10991 rm -f "conftest.$ac_objext"
10992 if { (eval echo "$as_me:10992: \"$ac_compile\"") >&5
10993   (eval $ac_compile) 2>&5
10994   ac_status=$?
10995   echo "$as_me:10995: \$? = $ac_status" >&5
10996   (exit "$ac_status"); } &&
10997          { ac_try='test -s "conftest.$ac_objext"'
10998   { (eval echo "$as_me:10998: \"$ac_try\"") >&5
10999   (eval $ac_try) 2>&5
11000   ac_status=$?
11001   echo "$as_me:11001: \$? = $ac_status" >&5
11002   (exit "$ac_status"); }; }; then
11003   cf_cv_ncurses_h2=$cf_header
11004
11005 else
11006   echo "$as_me: failed program was:" >&5
11007 cat "conftest.$ac_ext" >&5
11008 cf_cv_ncurses_h2=no
11009 fi
11010 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11011
11012                         if test "$cf_cv_ncurses_h2" != no ; then
11013                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11014                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11015                                 break
11016                         fi
11017                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11018                 done
11019                 CPPFLAGS="$cf_save2_CPPFLAGS"
11020                 test "$cf_cv_ncurses_h2" != no && break
11021         done
11022         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11022: error: not found" >&5
11023 echo "$as_me: error: not found" >&2;}
11024    { (exit 1); exit 1; }; }
11025
11026 fi
11027 echo "$as_me:11027: result: $cf_cv_ncurses_h2" >&5
11028 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11029
11030         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11031         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11032         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11033                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11034         fi
11035
11036 if test -n "$cf_1st_incdir" ; then
11037   for cf_add_incdir in $cf_1st_incdir
11038   do
11039         while test "$cf_add_incdir" != /usr/include
11040         do
11041           if test -d "$cf_add_incdir"
11042           then
11043                 cf_have_incdir=no
11044                 if test -n "$CFLAGS$CPPFLAGS" ; then
11045                   # a loop is needed to ensure we can add subdirs of existing dirs
11046                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11047                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11048                           cf_have_incdir=yes; break
11049                         fi
11050                   done
11051                 fi
11052
11053                 if test "$cf_have_incdir" = no ; then
11054                   if test "$cf_add_incdir" = /usr/local/include ; then
11055                         if test "$GCC" = yes
11056                         then
11057                           cf_save_CPPFLAGS=$CPPFLAGS
11058
11059         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11060         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11061
11062                           cat >"conftest.$ac_ext" <<_ACEOF
11063 #line 11063 "configure"
11064 #include "confdefs.h"
11065 #include <stdio.h>
11066 int
11067 main (void)
11068 {
11069 printf("Hello")
11070   ;
11071   return 0;
11072 }
11073 _ACEOF
11074 rm -f "conftest.$ac_objext"
11075 if { (eval echo "$as_me:11075: \"$ac_compile\"") >&5
11076   (eval $ac_compile) 2>&5
11077   ac_status=$?
11078   echo "$as_me:11078: \$? = $ac_status" >&5
11079   (exit "$ac_status"); } &&
11080          { ac_try='test -s "conftest.$ac_objext"'
11081   { (eval echo "$as_me:11081: \"$ac_try\"") >&5
11082   (eval $ac_try) 2>&5
11083   ac_status=$?
11084   echo "$as_me:11084: \$? = $ac_status" >&5
11085   (exit "$ac_status"); }; }; then
11086   :
11087 else
11088   echo "$as_me: failed program was:" >&5
11089 cat "conftest.$ac_ext" >&5
11090 cf_have_incdir=yes
11091 fi
11092 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11093                           CPPFLAGS=$cf_save_CPPFLAGS
11094                         fi
11095                   fi
11096                 fi
11097
11098                 if test "$cf_have_incdir" = no ; then
11099                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11100
11101 echo "${as_me:-configure}:11101: testing adding $cf_add_incdir to include-path ..." 1>&5
11102
11103                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11104
11105                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11106                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11107                   cf_add_incdir="$cf_top_incdir"
11108                 else
11109                   break
11110                 fi
11111           else
11112                 break
11113           fi
11114         done
11115   done
11116 fi
11117
11118 fi
11119
11120 # Set definitions to allow ifdef'ing for ncurses.h
11121
11122 case "$cf_cv_ncurses_header" in
11123 (*ncurses.h)
11124
11125 cat >>confdefs.h <<\EOF
11126 #define HAVE_NCURSES_H 1
11127 EOF
11128
11129         ;;
11130 esac
11131
11132 case "$cf_cv_ncurses_header" in
11133 (ncurses/curses.h|ncurses/ncurses.h)
11134
11135 cat >>confdefs.h <<\EOF
11136 #define HAVE_NCURSES_NCURSES_H 1
11137 EOF
11138
11139         ;;
11140 (ncursesw/curses.h|ncursesw/ncurses.h)
11141
11142 cat >>confdefs.h <<\EOF
11143 #define HAVE_NCURSESW_NCURSES_H 1
11144 EOF
11145
11146         ;;
11147 esac
11148
11149 echo "$as_me:11149: checking for terminfo header" >&5
11150 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11151 if test "${cf_cv_term_header+set}" = set; then
11152   echo $ECHO_N "(cached) $ECHO_C" >&6
11153 else
11154
11155 case "${cf_cv_ncurses_header}" in
11156 (*/ncurses.h|*/ncursesw.h)
11157         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11158         ;;
11159 (*)
11160         cf_term_header=term.h
11161         ;;
11162 esac
11163
11164 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11165 do
11166 cat >"conftest.$ac_ext" <<_ACEOF
11167 #line 11167 "configure"
11168 #include "confdefs.h"
11169 #include <stdio.h>
11170 #include <${cf_cv_ncurses_header:-curses.h}>
11171 #include <$cf_test>
11172
11173 int
11174 main (void)
11175 {
11176 int x = auto_left_margin; (void)x
11177   ;
11178   return 0;
11179 }
11180 _ACEOF
11181 rm -f "conftest.$ac_objext"
11182 if { (eval echo "$as_me:11182: \"$ac_compile\"") >&5
11183   (eval $ac_compile) 2>&5
11184   ac_status=$?
11185   echo "$as_me:11185: \$? = $ac_status" >&5
11186   (exit "$ac_status"); } &&
11187          { ac_try='test -s "conftest.$ac_objext"'
11188   { (eval echo "$as_me:11188: \"$ac_try\"") >&5
11189   (eval $ac_try) 2>&5
11190   ac_status=$?
11191   echo "$as_me:11191: \$? = $ac_status" >&5
11192   (exit "$ac_status"); }; }; then
11193
11194         cf_cv_term_header="$cf_test"
11195 else
11196   echo "$as_me: failed program was:" >&5
11197 cat "conftest.$ac_ext" >&5
11198
11199         cf_cv_term_header=unknown
11200
11201 fi
11202 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11203         test "$cf_cv_term_header" != unknown && break
11204 done
11205
11206 fi
11207 echo "$as_me:11207: result: $cf_cv_term_header" >&5
11208 echo "${ECHO_T}$cf_cv_term_header" >&6
11209
11210 # Set definitions to allow ifdef'ing to accommodate subdirectories
11211
11212 case "$cf_cv_term_header" in
11213 (*term.h)
11214
11215 cat >>confdefs.h <<\EOF
11216 #define HAVE_TERM_H 1
11217 EOF
11218
11219         ;;
11220 esac
11221
11222 case "$cf_cv_term_header" in
11223 (ncurses/term.h)
11224
11225 cat >>confdefs.h <<\EOF
11226 #define HAVE_NCURSES_TERM_H 1
11227 EOF
11228
11229         ;;
11230 (ncursesw/term.h)
11231
11232 cat >>confdefs.h <<\EOF
11233 #define HAVE_NCURSESW_TERM_H 1
11234 EOF
11235
11236         ;;
11237 esac
11238
11239 # some applications need this, but should check for NCURSES_VERSION
11240
11241 cat >>confdefs.h <<\EOF
11242 #define NCURSES 1
11243 EOF
11244
11245 echo "$as_me:11245: checking for ncurses version" >&5
11246 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11247 if test "${cf_cv_ncurses_version+set}" = set; then
11248   echo $ECHO_N "(cached) $ECHO_C" >&6
11249 else
11250
11251         cf_cv_ncurses_version=no
11252         cf_tempfile=out$$
11253         rm -f "$cf_tempfile"
11254         if test "$cross_compiling" = yes; then
11255
11256         # This will not work if the preprocessor splits the line after the
11257         # Autoconf token.  The 'unproto' program does that.
11258         cat > "conftest.$ac_ext" <<EOF
11259 #include <${cf_cv_ncurses_header:-curses.h}>
11260 #undef Autoconf
11261 #ifdef NCURSES_VERSION
11262 Autoconf NCURSES_VERSION
11263 #else
11264 #ifdef __NCURSES_H
11265 Autoconf "old"
11266 #endif
11267 ;
11268 #endif
11269 EOF
11270         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11271         { (eval echo "$as_me:11271: \"$cf_try\"") >&5
11272   (eval $cf_try) 2>&5
11273   ac_status=$?
11274   echo "$as_me:11274: \$? = $ac_status" >&5
11275   (exit "$ac_status"); }
11276         if test -f conftest.out ; then
11277                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11278                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11279                 rm -f conftest.out
11280         fi
11281
11282 else
11283   cat >"conftest.$ac_ext" <<_ACEOF
11284 #line 11284 "configure"
11285 #include "confdefs.h"
11286
11287 $ac_includes_default
11288
11289 #include <${cf_cv_ncurses_header:-curses.h}>
11290
11291 int main(void)
11292 {
11293         FILE *fp = fopen("$cf_tempfile", "w");
11294 #ifdef NCURSES_VERSION
11295 # ifdef NCURSES_VERSION_PATCH
11296         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11297 # else
11298         fprintf(fp, "%s\\n", NCURSES_VERSION);
11299 # endif
11300 #else
11301 # ifdef __NCURSES_H
11302         fprintf(fp, "old\\n");
11303 # else
11304         #error expected ncurses header to define __NCURSES_H
11305 # endif
11306 #endif
11307         ${cf_cv_main_return:-return}(0);
11308 }
11309 _ACEOF
11310 rm -f "conftest$ac_exeext"
11311 if { (eval echo "$as_me:11311: \"$ac_link\"") >&5
11312   (eval $ac_link) 2>&5
11313   ac_status=$?
11314   echo "$as_me:11314: \$? = $ac_status" >&5
11315   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11316   { (eval echo "$as_me:11316: \"$ac_try\"") >&5
11317   (eval $ac_try) 2>&5
11318   ac_status=$?
11319   echo "$as_me:11319: \$? = $ac_status" >&5
11320   (exit "$ac_status"); }; }; then
11321
11322         cf_cv_ncurses_version=`cat $cf_tempfile`
11323 else
11324   echo "$as_me: program exited with status $ac_status" >&5
11325 echo "$as_me: failed program was:" >&5
11326 cat "conftest.$ac_ext" >&5
11327 fi
11328 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11329 fi
11330         rm -f "$cf_tempfile"
11331
11332 fi
11333 echo "$as_me:11333: result: $cf_cv_ncurses_version" >&5
11334 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11335 test "$cf_cv_ncurses_version" = no ||
11336 cat >>confdefs.h <<\EOF
11337 #define NCURSES 1
11338 EOF
11339
11340 cf_nculib_root=ncurses
11341         # This works, except for the special case where we find gpm, but
11342         # ncurses is in a nonstandard location via $LIBS, and we really want
11343         # to link gpm.
11344 cf_ncurses_LIBS=""
11345 cf_ncurses_SAVE="$LIBS"
11346 echo "$as_me:11346: checking for Gpm_Open in -lgpm" >&5
11347 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11348 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11349   echo $ECHO_N "(cached) $ECHO_C" >&6
11350 else
11351   ac_check_lib_save_LIBS=$LIBS
11352 LIBS="-lgpm  $LIBS"
11353 cat >"conftest.$ac_ext" <<_ACEOF
11354 #line 11354 "configure"
11355 #include "confdefs.h"
11356
11357 /* Override any gcc2 internal prototype to avoid an error.  */
11358 #ifdef __cplusplus
11359 extern "C"
11360 #endif
11361 /* We use char because int might match the return type of a gcc2
11362    builtin and then its argument prototype would still apply.  */
11363 char Gpm_Open (void);
11364 int
11365 main (void)
11366 {
11367 Gpm_Open ();
11368   ;
11369   return 0;
11370 }
11371 _ACEOF
11372 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11373 if { (eval echo "$as_me:11373: \"$ac_link\"") >&5
11374   (eval $ac_link) 2>&5
11375   ac_status=$?
11376   echo "$as_me:11376: \$? = $ac_status" >&5
11377   (exit "$ac_status"); } &&
11378          { ac_try='test -s "conftest$ac_exeext"'
11379   { (eval echo "$as_me:11379: \"$ac_try\"") >&5
11380   (eval $ac_try) 2>&5
11381   ac_status=$?
11382   echo "$as_me:11382: \$? = $ac_status" >&5
11383   (exit "$ac_status"); }; }; then
11384   ac_cv_lib_gpm_Gpm_Open=yes
11385 else
11386   echo "$as_me: failed program was:" >&5
11387 cat "conftest.$ac_ext" >&5
11388 ac_cv_lib_gpm_Gpm_Open=no
11389 fi
11390 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11391 LIBS=$ac_check_lib_save_LIBS
11392 fi
11393 echo "$as_me:11393: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11394 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11395 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11396   echo "$as_me:11396: checking for initscr in -lgpm" >&5
11397 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11398 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11399   echo $ECHO_N "(cached) $ECHO_C" >&6
11400 else
11401   ac_check_lib_save_LIBS=$LIBS
11402 LIBS="-lgpm  $LIBS"
11403 cat >"conftest.$ac_ext" <<_ACEOF
11404 #line 11404 "configure"
11405 #include "confdefs.h"
11406
11407 /* Override any gcc2 internal prototype to avoid an error.  */
11408 #ifdef __cplusplus
11409 extern "C"
11410 #endif
11411 /* We use char because int might match the return type of a gcc2
11412    builtin and then its argument prototype would still apply.  */
11413 char initscr (void);
11414 int
11415 main (void)
11416 {
11417 initscr ();
11418   ;
11419   return 0;
11420 }
11421 _ACEOF
11422 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11423 if { (eval echo "$as_me:11423: \"$ac_link\"") >&5
11424   (eval $ac_link) 2>&5
11425   ac_status=$?
11426   echo "$as_me:11426: \$? = $ac_status" >&5
11427   (exit "$ac_status"); } &&
11428          { ac_try='test -s "conftest$ac_exeext"'
11429   { (eval echo "$as_me:11429: \"$ac_try\"") >&5
11430   (eval $ac_try) 2>&5
11431   ac_status=$?
11432   echo "$as_me:11432: \$? = $ac_status" >&5
11433   (exit "$ac_status"); }; }; then
11434   ac_cv_lib_gpm_initscr=yes
11435 else
11436   echo "$as_me: failed program was:" >&5
11437 cat "conftest.$ac_ext" >&5
11438 ac_cv_lib_gpm_initscr=no
11439 fi
11440 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11441 LIBS=$ac_check_lib_save_LIBS
11442 fi
11443 echo "$as_me:11443: result: $ac_cv_lib_gpm_initscr" >&5
11444 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11445 if test "$ac_cv_lib_gpm_initscr" = yes; then
11446   LIBS="$cf_ncurses_SAVE"
11447 else
11448   cf_ncurses_LIBS="-lgpm"
11449 fi
11450
11451 fi
11452
11453 case "$host_os" in
11454 (freebsd*)
11455         # This is only necessary if you are linking against an obsolete
11456         # version of ncurses (but it should do no harm, since it is static).
11457         if test "$cf_nculib_root" = ncurses ; then
11458                 echo "$as_me:11458: checking for tgoto in -lmytinfo" >&5
11459 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11460 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11461   echo $ECHO_N "(cached) $ECHO_C" >&6
11462 else
11463   ac_check_lib_save_LIBS=$LIBS
11464 LIBS="-lmytinfo  $LIBS"
11465 cat >"conftest.$ac_ext" <<_ACEOF
11466 #line 11466 "configure"
11467 #include "confdefs.h"
11468
11469 /* Override any gcc2 internal prototype to avoid an error.  */
11470 #ifdef __cplusplus
11471 extern "C"
11472 #endif
11473 /* We use char because int might match the return type of a gcc2
11474    builtin and then its argument prototype would still apply.  */
11475 char tgoto (void);
11476 int
11477 main (void)
11478 {
11479 tgoto ();
11480   ;
11481   return 0;
11482 }
11483 _ACEOF
11484 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11485 if { (eval echo "$as_me:11485: \"$ac_link\"") >&5
11486   (eval $ac_link) 2>&5
11487   ac_status=$?
11488   echo "$as_me:11488: \$? = $ac_status" >&5
11489   (exit "$ac_status"); } &&
11490          { ac_try='test -s "conftest$ac_exeext"'
11491   { (eval echo "$as_me:11491: \"$ac_try\"") >&5
11492   (eval $ac_try) 2>&5
11493   ac_status=$?
11494   echo "$as_me:11494: \$? = $ac_status" >&5
11495   (exit "$ac_status"); }; }; then
11496   ac_cv_lib_mytinfo_tgoto=yes
11497 else
11498   echo "$as_me: failed program was:" >&5
11499 cat "conftest.$ac_ext" >&5
11500 ac_cv_lib_mytinfo_tgoto=no
11501 fi
11502 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11503 LIBS=$ac_check_lib_save_LIBS
11504 fi
11505 echo "$as_me:11505: result: $ac_cv_lib_mytinfo_tgoto" >&5
11506 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11507 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11508   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11509 fi
11510
11511         fi
11512         ;;
11513 esac
11514
11515 cf_add_libs="$LIBS"
11516 # reverse order
11517 cf_add_0lib=
11518 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11519 # filter duplicates
11520 for cf_add_1lib in $cf_add_0lib; do
11521         for cf_add_2lib in $cf_add_libs; do
11522                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11523                         cf_add_1lib=
11524                         break
11525                 fi
11526         done
11527         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11528 done
11529 LIBS="$cf_add_libs"
11530
11531 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11532 then
11533
11534 cf_add_libs="$LIBS"
11535 # reverse order
11536 cf_add_0lib=
11537 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11538 # filter duplicates
11539 for cf_add_1lib in $cf_add_0lib; do
11540         for cf_add_2lib in $cf_add_libs; do
11541                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11542                         cf_add_1lib=
11543                         break
11544                 fi
11545         done
11546         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11547 done
11548 LIBS="$cf_add_libs"
11549
11550 else
11551
11552         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11553         cf_libdir=""
11554         echo "$as_me:11554: checking for initscr" >&5
11555 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11556 if test "${ac_cv_func_initscr+set}" = set; then
11557   echo $ECHO_N "(cached) $ECHO_C" >&6
11558 else
11559   cat >"conftest.$ac_ext" <<_ACEOF
11560 #line 11560 "configure"
11561 #include "confdefs.h"
11562 #define initscr autoconf_temporary
11563 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11564 #undef initscr
11565
11566 #ifdef __cplusplus
11567 extern "C"
11568 #endif
11569
11570 /* We use char because int might match the return type of a gcc2
11571    builtin and then its argument prototype would still apply.  */
11572 char initscr (void);
11573
11574 int
11575 main (void)
11576 {
11577
11578 /* The GNU C library defines stubs for functions which it implements
11579     to always fail with ENOSYS.  Some functions are actually named
11580     something starting with __ and the normal name is an alias.  */
11581 #if defined (__stub_initscr) || defined (__stub___initscr)
11582 #error found stub for initscr
11583 #endif
11584
11585         return initscr ();
11586   ;
11587   return 0;
11588 }
11589 _ACEOF
11590 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11591 if { (eval echo "$as_me:11591: \"$ac_link\"") >&5
11592   (eval $ac_link) 2>&5
11593   ac_status=$?
11594   echo "$as_me:11594: \$? = $ac_status" >&5
11595   (exit "$ac_status"); } &&
11596          { ac_try='test -s "conftest$ac_exeext"'
11597   { (eval echo "$as_me:11597: \"$ac_try\"") >&5
11598   (eval $ac_try) 2>&5
11599   ac_status=$?
11600   echo "$as_me:11600: \$? = $ac_status" >&5
11601   (exit "$ac_status"); }; }; then
11602   ac_cv_func_initscr=yes
11603 else
11604   echo "$as_me: failed program was:" >&5
11605 cat "conftest.$ac_ext" >&5
11606 ac_cv_func_initscr=no
11607 fi
11608 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11609 fi
11610 echo "$as_me:11610: result: $ac_cv_func_initscr" >&5
11611 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11612 if test "$ac_cv_func_initscr" = yes; then
11613   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11614 else
11615
11616                 cf_save_LIBS="$LIBS"
11617                 echo "$as_me:11617: checking for initscr in -l$cf_nculib_root" >&5
11618 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11619                 LIBS="-l$cf_nculib_root $LIBS"
11620                 cat >"conftest.$ac_ext" <<_ACEOF
11621 #line 11621 "configure"
11622 #include "confdefs.h"
11623 #include <${cf_cv_ncurses_header:-curses.h}>
11624 int
11625 main (void)
11626 {
11627 initscr()
11628   ;
11629   return 0;
11630 }
11631 _ACEOF
11632 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11633 if { (eval echo "$as_me:11633: \"$ac_link\"") >&5
11634   (eval $ac_link) 2>&5
11635   ac_status=$?
11636   echo "$as_me:11636: \$? = $ac_status" >&5
11637   (exit "$ac_status"); } &&
11638          { ac_try='test -s "conftest$ac_exeext"'
11639   { (eval echo "$as_me:11639: \"$ac_try\"") >&5
11640   (eval $ac_try) 2>&5
11641   ac_status=$?
11642   echo "$as_me:11642: \$? = $ac_status" >&5
11643   (exit "$ac_status"); }; }; then
11644   echo "$as_me:11644: result: yes" >&5
11645 echo "${ECHO_T}yes" >&6
11646                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11647
11648 else
11649   echo "$as_me: failed program was:" >&5
11650 cat "conftest.$ac_ext" >&5
11651 echo "$as_me:11651: result: no" >&5
11652 echo "${ECHO_T}no" >&6
11653
11654 cf_search=
11655 cf_library_path_list=""
11656 if test -n "${LDFLAGS}${LIBS}" ; then
11657         for cf_library_path in $LDFLAGS $LIBS
11658         do
11659                 case "$cf_library_path" in
11660                 (-L*)
11661                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11662
11663 test "x$cf_library_path" != "xNONE" && \
11664 test -d "$cf_library_path" && \
11665  {
11666         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11667         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11668         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11669         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11670         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11671         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"
11672 }
11673
11674                         cf_library_path_list="$cf_library_path_list $cf_search"
11675                         ;;
11676                 esac
11677         done
11678 fi
11679
11680 cf_search=
11681
11682 test "x$prefix" != "xNONE" && \
11683 test -d "$prefix" && \
11684  {
11685         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11686         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11687         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11688         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11689         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11690         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11691 }
11692
11693 for cf_subdir_prefix in \
11694         /usr \
11695         /usr/local \
11696         /usr/pkg \
11697         /opt \
11698         /opt/local \
11699         $HOME
11700 do
11701
11702 test "x$cf_subdir_prefix" != "x$prefix" && \
11703 test -d "$cf_subdir_prefix" && \
11704 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11705         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11706         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11707         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11708         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11709         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11710         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"
11711 }
11712
11713 done
11714
11715 cf_search="$cf_library_path_list $cf_search"
11716
11717                         for cf_libdir in $cf_search
11718                         do
11719                                 echo "$as_me:11719: checking for -l$cf_nculib_root in $cf_libdir" >&5
11720 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11721                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11722                                 cat >"conftest.$ac_ext" <<_ACEOF
11723 #line 11723 "configure"
11724 #include "confdefs.h"
11725 #include <${cf_cv_ncurses_header:-curses.h}>
11726 int
11727 main (void)
11728 {
11729 initscr()
11730   ;
11731   return 0;
11732 }
11733 _ACEOF
11734 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11735 if { (eval echo "$as_me:11735: \"$ac_link\"") >&5
11736   (eval $ac_link) 2>&5
11737   ac_status=$?
11738   echo "$as_me:11738: \$? = $ac_status" >&5
11739   (exit "$ac_status"); } &&
11740          { ac_try='test -s "conftest$ac_exeext"'
11741   { (eval echo "$as_me:11741: \"$ac_try\"") >&5
11742   (eval $ac_try) 2>&5
11743   ac_status=$?
11744   echo "$as_me:11744: \$? = $ac_status" >&5
11745   (exit "$ac_status"); }; }; then
11746   echo "$as_me:11746: result: yes" >&5
11747 echo "${ECHO_T}yes" >&6
11748                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11749                                          break
11750 else
11751   echo "$as_me: failed program was:" >&5
11752 cat "conftest.$ac_ext" >&5
11753 echo "$as_me:11753: result: no" >&5
11754 echo "${ECHO_T}no" >&6
11755                                          LIBS="$cf_save_LIBS"
11756 fi
11757 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11758                         done
11759
11760 fi
11761 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11762
11763 fi
11764
11765 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11766
11767 if test "$cf_found_library" = no ; then
11768         { { echo "$as_me:11768: error: Cannot link $cf_nculib_root library" >&5
11769 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11770    { (exit 1); exit 1; }; }
11771 fi
11772
11773 fi
11774
11775 if test -n "$cf_ncurses_LIBS" ; then
11776         echo "$as_me:11776: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11777 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11778         cf_ncurses_SAVE="$LIBS"
11779         for p in $cf_ncurses_LIBS ; do
11780                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11781                 if test "$q" != "$LIBS" ; then
11782                         LIBS="$q"
11783                 fi
11784         done
11785         cat >"conftest.$ac_ext" <<_ACEOF
11786 #line 11786 "configure"
11787 #include "confdefs.h"
11788 #include <${cf_cv_ncurses_header:-curses.h}>
11789 int
11790 main (void)
11791 {
11792 initscr(); mousemask(0,0); tigetstr((char *)0);
11793   ;
11794   return 0;
11795 }
11796 _ACEOF
11797 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11798 if { (eval echo "$as_me:11798: \"$ac_link\"") >&5
11799   (eval $ac_link) 2>&5
11800   ac_status=$?
11801   echo "$as_me:11801: \$? = $ac_status" >&5
11802   (exit "$ac_status"); } &&
11803          { ac_try='test -s "conftest$ac_exeext"'
11804   { (eval echo "$as_me:11804: \"$ac_try\"") >&5
11805   (eval $ac_try) 2>&5
11806   ac_status=$?
11807   echo "$as_me:11807: \$? = $ac_status" >&5
11808   (exit "$ac_status"); }; }; then
11809   echo "$as_me:11809: result: yes" >&5
11810 echo "${ECHO_T}yes" >&6
11811 else
11812   echo "$as_me: failed program was:" >&5
11813 cat "conftest.$ac_ext" >&5
11814 echo "$as_me:11814: result: no" >&5
11815 echo "${ECHO_T}no" >&6
11816                  LIBS="$cf_ncurses_SAVE"
11817 fi
11818 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11819 fi
11820
11821 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11822
11823 cat >>confdefs.h <<EOF
11824 #define $cf_nculib_ROOT 1
11825 EOF
11826
11827         fi
11828 else
11829         NCURSES_CONFIG=none
11830 fi
11831
11832 fi
11833
11834 if test "$NCURSES_CONFIG_PKG" != none ; then
11835         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11836
11837         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11838         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11839         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11840
11841         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11842         if test -z "$cf_cv_abi_version"
11843         then
11844                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11845         fi
11846
11847 elif test "$NCURSES_CONFIG" != none ; then
11848
11849         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11850
11851         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11852         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11853         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11854
11855         # ABI version is not available from headers
11856         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11857
11858 else
11859
11860         for cf_name in MAJOR MINOR PATCH
11861         do
11862         cat >conftest.$ac_ext <<CF_EOF
11863         #include <${cf_cv_ncurses_header:-curses.h}>
11864         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11865 CF_EOF
11866                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11867                 { (eval echo "$as_me:11867: \"$cf_try\"") >&5
11868   (eval $cf_try) 2>&5
11869   ac_status=$?
11870   echo "$as_me:11870: \$? = $ac_status" >&5
11871   (exit "$ac_status"); }
11872                 if test -f conftest.out ; then
11873                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11874                         eval NCURSES_$cf_name=\"$cf_result\"
11875                         # cat conftest.$ac_ext
11876                         # cat conftest.out
11877                 fi
11878         done
11879
11880         cf_cv_abi_version=${NCURSES_MAJOR}
11881
11882 fi
11883
11884 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11885
11886 cf_cv_timestamp=`date`
11887
11888 echo "$as_me:11888: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11889 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11890
11891 echo "$as_me:11891: checking if you want to have a library-prefix" >&5
11892 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11893
11894 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11895 if test "${with_lib_prefix+set}" = set; then
11896   withval="$with_lib_prefix"
11897   with_lib_prefix=$withval
11898 else
11899   with_lib_prefix=auto
11900 fi;
11901 echo "$as_me:11901: result: $with_lib_prefix" >&5
11902 echo "${ECHO_T}$with_lib_prefix" >&6
11903
11904 if test "$with_lib_prefix" = auto
11905 then
11906
11907         case "$cf_cv_system_name" in
11908         (OS/2*|os2*)
11909                 if test "$DFT_LWR_MODEL" = libtool; then
11910                         LIB_PREFIX='lib'
11911                 else
11912                         LIB_PREFIX=''
11913                 fi
11914                 ;;
11915         (*-msvc*)
11916                 LIB_PREFIX=''
11917                 ;;
11918         (*)     LIB_PREFIX='lib'
11919                 ;;
11920         esac
11921 cf_prefix=$LIB_PREFIX
11922
11923 elif test "$with_lib_prefix" = no
11924 then
11925         LIB_PREFIX=
11926 else
11927         LIB_PREFIX=$with_lib_prefix
11928 fi
11929
11930 LIB_SUFFIX=
11931
11932 ###############################################################################
11933
11934 if test X"$CC_G_OPT" = X"" ; then
11935         CC_G_OPT='-g'
11936         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11937 fi
11938
11939 echo "$as_me:11939: checking for default loader flags" >&5
11940 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11941 case $DFT_LWR_MODEL in
11942 (normal)  LD_MODEL=''   ;;
11943 (debug)   LD_MODEL=$CC_G_OPT ;;
11944 (profile) LD_MODEL='-pg';;
11945 (shared)  LD_MODEL=''   ;;
11946 esac
11947 echo "$as_me:11947: result: $LD_MODEL" >&5
11948 echo "${ECHO_T}$LD_MODEL" >&6
11949
11950 LD_RPATH_OPT=
11951 if test "x$cf_cv_enable_rpath" != xno
11952 then
11953         echo "$as_me:11953: checking for an rpath option" >&5
11954 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11955         case "$cf_cv_system_name" in
11956         (irix*)
11957                 if test "$GCC" = yes; then
11958                         LD_RPATH_OPT="-Wl,-rpath,"
11959                 else
11960                         LD_RPATH_OPT="-rpath "
11961                 fi
11962                 ;;
11963         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11964                 LD_RPATH_OPT="-Wl,-rpath,"
11965                 ;;
11966         (openbsd[2-9].*|mirbsd*)
11967                 LD_RPATH_OPT="-Wl,-rpath,"
11968                 ;;
11969         (dragonfly*)
11970                 LD_RPATH_OPT="-rpath "
11971                 ;;
11972         (netbsd*)
11973                 LD_RPATH_OPT="-Wl,-rpath,"
11974                 ;;
11975         (osf*|mls+*)
11976                 LD_RPATH_OPT="-rpath "
11977                 ;;
11978         (solaris2*)
11979                 LD_RPATH_OPT="-R"
11980                 ;;
11981         (*)
11982                 ;;
11983         esac
11984         echo "$as_me:11984: result: $LD_RPATH_OPT" >&5
11985 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11986
11987         case "x$LD_RPATH_OPT" in
11988         (x-R*)
11989                 echo "$as_me:11989: checking if we need a space after rpath option" >&5
11990 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11991                 cf_save_LIBS="$LIBS"
11992
11993 cf_add_libs="$LIBS"
11994 # reverse order
11995 cf_add_0lib=
11996 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11997 # filter duplicates
11998 for cf_add_1lib in $cf_add_0lib; do
11999         for cf_add_2lib in $cf_add_libs; do
12000                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12001                         cf_add_1lib=
12002                         break
12003                 fi
12004         done
12005         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12006 done
12007 LIBS="$cf_add_libs"
12008
12009                 cat >"conftest.$ac_ext" <<_ACEOF
12010 #line 12010 "configure"
12011 #include "confdefs.h"
12012
12013 int
12014 main (void)
12015 {
12016
12017   ;
12018   return 0;
12019 }
12020 _ACEOF
12021 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12022 if { (eval echo "$as_me:12022: \"$ac_link\"") >&5
12023   (eval $ac_link) 2>&5
12024   ac_status=$?
12025   echo "$as_me:12025: \$? = $ac_status" >&5
12026   (exit "$ac_status"); } &&
12027          { ac_try='test -s "conftest$ac_exeext"'
12028   { (eval echo "$as_me:12028: \"$ac_try\"") >&5
12029   (eval $ac_try) 2>&5
12030   ac_status=$?
12031   echo "$as_me:12031: \$? = $ac_status" >&5
12032   (exit "$ac_status"); }; }; then
12033   cf_rpath_space=no
12034 else
12035   echo "$as_me: failed program was:" >&5
12036 cat "conftest.$ac_ext" >&5
12037 cf_rpath_space=yes
12038 fi
12039 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12040                 LIBS="$cf_save_LIBS"
12041                 echo "$as_me:12041: result: $cf_rpath_space" >&5
12042 echo "${ECHO_T}$cf_rpath_space" >&6
12043                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
12044                 ;;
12045         esac
12046 fi
12047
12048         RM_SHARED_OPTS=
12049         LOCAL_LDFLAGS=
12050         LOCAL_LDFLAGS2=
12051         LD_SHARED_OPTS=
12052         INSTALL_LIB="-m 644"
12053         : ${rel_builddir:=.}
12054
12055         shlibdir=$libdir
12056
12057         MAKE_DLLS="#"
12058
12059         cf_cv_do_symlinks=no
12060         cf_ld_rpath_opt=
12061         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
12062
12063         echo "$as_me:12063: checking whether to use release or ABI version in shared library file names" >&5
12064 echo $ECHO_N "checking whether to use release or ABI version in shared library file names... $ECHO_C" >&6
12065
12066 # Check whether --with-shlib-version or --without-shlib-version was given.
12067 if test "${with_shlib_version+set}" = set; then
12068   withval="$with_shlib_version"
12069   test -z "$withval" && withval=auto
12070         case "$withval" in
12071         (yes)
12072                 cf_cv_shlib_version=auto
12073                 ;;
12074         (rel|abi|auto)
12075                 cf_cv_shlib_version=$withval
12076                 ;;
12077         (*)
12078                 echo "$as_me:12078: result: $withval" >&5
12079 echo "${ECHO_T}$withval" >&6
12080                 { { echo "$as_me:12080: error: option value must be one of: rel, abi, or auto" >&5
12081 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
12082    { (exit 1); exit 1; }; }
12083                 ;;
12084         esac
12085
12086 else
12087   cf_cv_shlib_version=auto
12088 fi;
12089         echo "$as_me:12089: result: $cf_cv_shlib_version" >&5
12090 echo "${ECHO_T}$cf_cv_shlib_version" >&6
12091
12092         cf_cv_rm_so_locs=no
12093         cf_try_cflags=
12094
12095         # Some less-capable ports of gcc support only -fpic
12096         CC_SHARED_OPTS=
12097
12098         cf_try_fPIC=no
12099         if test "$GCC" = yes
12100         then
12101                 cf_try_fPIC=yes
12102         else
12103                 case "$cf_cv_system_name" in
12104                 (*linux*)       # e.g., PGI compiler
12105                         cf_try_fPIC=yes
12106                         ;;
12107                 esac
12108         fi
12109
12110         if test "$cf_try_fPIC" = yes
12111         then
12112                 echo "$as_me:12112: checking which $CC option to use" >&5
12113 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
12114                 cf_save_CFLAGS="$CFLAGS"
12115                 for CC_SHARED_OPTS in -fPIC -fpic ''
12116                 do
12117                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
12118                         cat >"conftest.$ac_ext" <<_ACEOF
12119 #line 12119 "configure"
12120 #include "confdefs.h"
12121 #include <stdio.h>
12122 int
12123 main (void)
12124 {
12125 int x = 1; (void)x
12126   ;
12127   return 0;
12128 }
12129 _ACEOF
12130 rm -f "conftest.$ac_objext"
12131 if { (eval echo "$as_me:12131: \"$ac_compile\"") >&5
12132   (eval $ac_compile) 2>&5
12133   ac_status=$?
12134   echo "$as_me:12134: \$? = $ac_status" >&5
12135   (exit "$ac_status"); } &&
12136          { ac_try='test -s "conftest.$ac_objext"'
12137   { (eval echo "$as_me:12137: \"$ac_try\"") >&5
12138   (eval $ac_try) 2>&5
12139   ac_status=$?
12140   echo "$as_me:12140: \$? = $ac_status" >&5
12141   (exit "$ac_status"); }; }; then
12142   break
12143 else
12144   echo "$as_me: failed program was:" >&5
12145 cat "conftest.$ac_ext" >&5
12146 fi
12147 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12148                 done
12149                 echo "$as_me:12149: result: $CC_SHARED_OPTS" >&5
12150 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
12151                 CFLAGS="$cf_save_CFLAGS"
12152         fi
12153
12154         cf_cv_shlib_version_infix=no
12155
12156         case "$cf_cv_system_name" in
12157         (aix4.3-9*|aix[5-7]*)
12158                 if test "$GCC" = yes; then
12159                         CC_SHARED_OPTS='-Wl,-brtl'
12160                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
12161                 else
12162                         CC_SHARED_OPTS='-brtl'
12163                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
12164                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
12165                 fi
12166                 ;;
12167         (beos*)
12168                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
12169                 ;;
12170         (cygwin*)
12171                 CC_SHARED_OPTS=
12172                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12173                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12174                 cf_cv_shlib_version=cygdll
12175                 cf_cv_shlib_version_infix=cygdll
12176                 shlibdir=$bindir
12177                 MAKE_DLLS=
12178                 cat >mk_shared_lib.sh <<-CF_EOF
12179                 #!$SHELL
12180                 SHARED_LIB=\$1
12181                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
12182                 shift
12183                 cat <<-EOF
12184                 Linking shared library
12185                 ** SHARED_LIB \$SHARED_LIB
12186                 ** IMPORT_LIB \$IMPORT_LIB
12187 EOF
12188                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12189 CF_EOF
12190                 chmod +x mk_shared_lib.sh
12191                 ;;
12192         (msys*)
12193                 CC_SHARED_OPTS=
12194                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12195                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12196                 cf_cv_shlib_version=msysdll
12197                 cf_cv_shlib_version_infix=msysdll
12198                 shlibdir=$bindir
12199                 MAKE_DLLS=
12200                 cat >mk_shared_lib.sh <<-CF_EOF
12201                 #!$SHELL
12202                 SHARED_LIB=\$1
12203                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
12204                 shift
12205                 cat <<-EOF
12206                 Linking shared library
12207                 ** SHARED_LIB \$SHARED_LIB
12208                 ** IMPORT_LIB \$IMPORT_LIB
12209 EOF
12210                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12211 CF_EOF
12212                 chmod +x mk_shared_lib.sh
12213                 ;;
12214         (darwin*)
12215                 cf_try_cflags="no-cpp-precomp"
12216                 CC_SHARED_OPTS="-dynamic"
12217                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
12218                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
12219                 cf_cv_shlib_version_infix=yes
12220                 echo "$as_me:12220: checking if ld -search_paths_first works" >&5
12221 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
12222 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
12223   echo $ECHO_N "(cached) $ECHO_C" >&6
12224 else
12225
12226                         cf_save_LDFLAGS=$LDFLAGS
12227                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
12228                         cat >"conftest.$ac_ext" <<_ACEOF
12229 #line 12229 "configure"
12230 #include "confdefs.h"
12231
12232 int
12233 main (void)
12234 {
12235 int i;
12236   ;
12237   return 0;
12238 }
12239 _ACEOF
12240 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12241 if { (eval echo "$as_me:12241: \"$ac_link\"") >&5
12242   (eval $ac_link) 2>&5
12243   ac_status=$?
12244   echo "$as_me:12244: \$? = $ac_status" >&5
12245   (exit "$ac_status"); } &&
12246          { ac_try='test -s "conftest$ac_exeext"'
12247   { (eval echo "$as_me:12247: \"$ac_try\"") >&5
12248   (eval $ac_try) 2>&5
12249   ac_status=$?
12250   echo "$as_me:12250: \$? = $ac_status" >&5
12251   (exit "$ac_status"); }; }; then
12252   cf_cv_ldflags_search_paths_first=yes
12253 else
12254   echo "$as_me: failed program was:" >&5
12255 cat "conftest.$ac_ext" >&5
12256 cf_cv_ldflags_search_paths_first=no
12257 fi
12258 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12259                                 LDFLAGS=$cf_save_LDFLAGS
12260 fi
12261 echo "$as_me:12261: result: $cf_cv_ldflags_search_paths_first" >&5
12262 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
12263                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
12264                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
12265                 fi
12266                 ;;
12267         (haiku*)
12268
12269         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12270         if test "$cf_cv_shlib_version" = rel; then
12271                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12272         else
12273                 cf_cv_shared_soname='`basename $@`'
12274         fi
12275
12276                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12277                 ;;
12278         (hpux[7-8]*)
12279                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
12280                 if test "$GCC" != yes; then
12281                         CC_SHARED_OPTS='+Z'
12282                 fi
12283                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
12284                 INSTALL_LIB="-m 555"
12285                 ;;
12286         (hpux*)
12287                 # (tested with gcc 2.7.2 -- I don't have c89)
12288                 if test "$GCC" = yes; then
12289                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
12290                 else
12291                         CC_SHARED_OPTS='+Z'
12292                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
12293                 fi
12294                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
12295                 # HP-UX shared libraries must be executable, and should be
12296                 # readonly to exploit a quirk in the memory manager.
12297                 INSTALL_LIB="-m 555"
12298                 ;;
12299         (interix*)
12300                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12301                 if test "$cf_cv_shlib_version" = rel; then
12302                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12303                 else
12304                         cf_shared_soname='`basename $@`'
12305                 fi
12306                 CC_SHARED_OPTS=
12307                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
12308                 ;;
12309         (irix*)
12310                 if test "$cf_cv_enable_rpath" = yes ; then
12311                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12312                 fi
12313                 # tested with IRIX 5.2 and 'cc'.
12314                 if test "$GCC" != yes; then
12315                         CC_SHARED_OPTS='-KPIC'
12316                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
12317                 else
12318                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
12319                 fi
12320                 cf_cv_rm_so_locs=yes
12321                 ;;
12322         (linux*|gnu*|k*bsd*-gnu)
12323                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12324                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12325                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12326                 fi
12327                 if test "$cf_cv_enable_rpath" = yes ; then
12328                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12329                 fi
12330
12331         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12332         if test "$cf_cv_shlib_version" = rel; then
12333                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12334         else
12335                 cf_cv_shared_soname='`basename $@`'
12336         fi
12337
12338                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12339                 ;;
12340         (mingw*msvc*)
12341                 cf_cv_shlib_version=msvcdll
12342                 cf_cv_shlib_version_infix=msvcdll
12343                 shlibdir=$bindir
12344                 MAKE_DLLS=
12345                 if test "$DFT_LWR_MODEL" = "shared" ; then
12346                         LOCAL_LDFLAGS="-link -dll"
12347                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12348                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
12349                 fi
12350                 CC_SHARED_OPTS=
12351                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
12352                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
12353                 cat >mk_shared_lib.sh <<-CF_EOF
12354                 #!$SHELL
12355                 SHARED_LIB=\$1
12356                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
12357                 shift
12358                 my_ld=\$1
12359                 shift
12360                 cat <<-EOF
12361                 Linking shared library
12362                 ** SHARED LIB \$SHARED_LIB
12363                 ** IMPORT_LIB \$IMPORT_LIB
12364 EOF
12365                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
12366                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
12367                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
12368 CF_EOF
12369                 chmod +x mk_shared_lib.sh
12370                 cat >mk_prog.sh <<-CF_EOF
12371                 #!$SHELL
12372                 shift
12373                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
12374                 LD="$LD"
12375                 clopts=()
12376                 ldopts=("/subsystem:console")
12377                 libs=()
12378                 isdll=0
12379                 while test \$# -gt 0; do
12380                         case "\$1" in
12381                                 -link)
12382                                         # ignore -link argument
12383                                         ;;
12384                                 -M[TD] | -M[TD]d)
12385                                         # ignore runtime-library option
12386                                         ;;
12387                                 -dll)
12388                                         isdll=1
12389                                         ;;
12390                                 -W* | -w*)
12391                                         # ignore warnings
12392                                         ;;
12393                                 -D*)
12394                                         clopts+=("\$1")
12395                                         ;;
12396                                 -I*)
12397                                         clopts+=("\$1")
12398                                         ;;
12399                                 -l*)
12400                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12401                                         ;;
12402                                 -L*)
12403                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12404                                         ;;
12405                                 *.obj | *.o)
12406                                         ldopts+=("\$1")
12407                                         ;;
12408                                 -Wl,*)
12409                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12410                                                 ldopts+=("\${linkarg}")
12411                                         done
12412                                         ;;
12413                                 *.lib)
12414                                         ldopts+=("\$1")
12415                                         ;;
12416                                 -o)
12417                                         shift
12418                                         ldopts+=("-out:\$1")
12419                                         ;;
12420                                 *)
12421                                         clopts+=("\$1")
12422                                         ldopts+=("\$1")
12423                                         ;;
12424                         esac
12425                         shift
12426                 done
12427                 if [ "\$isdll" -ne 0 ]; then
12428                         for lib in \${libs[*]}; do
12429                                 ldopts+=("\$lib.dll.lib")
12430                         done
12431                 else
12432                         for lib in \${libs[*]}; do
12433                                 ldopts+=("\$lib.lib")
12434                         done
12435                 fi
12436                 cat <<-EOF
12437                 Creating program
12438                 ** ld options:   "\${ldopts[@]}"
12439 EOF
12440                 exec \$LD \${ldopts[@]}
12441 CF_EOF
12442                 chmod +x mk_prog.sh
12443                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12444                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12445                 ;;
12446         (mingw*)
12447                 cf_cv_shlib_version=mingw
12448                 cf_cv_shlib_version_infix=mingw
12449                 shlibdir=$bindir
12450                 MAKE_DLLS=
12451                 if test "$DFT_LWR_MODEL" = "shared" ; then
12452                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12453                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12454                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12455                 fi
12456                 CC_SHARED_OPTS=
12457                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12458                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12459                 cat >mk_shared_lib.sh <<-CF_EOF
12460                 #!$SHELL
12461                 SHARED_LIB=\$1
12462                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12463                 shift
12464                 cat <<-EOF
12465                 Linking shared library
12466                 ** SHARED_LIB \$SHARED_LIB
12467                 ** IMPORT_LIB \$IMPORT_LIB
12468 EOF
12469                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12470 CF_EOF
12471                 chmod +x mk_shared_lib.sh
12472                 ;;
12473         (openbsd[2-9].*|mirbsd*)
12474                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12475                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12476                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12477                 fi
12478                 if test "$cf_cv_enable_rpath" = yes ; then
12479                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12480                 fi
12481                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12482
12483         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12484         if test "$cf_cv_shlib_version" = rel; then
12485                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12486         else
12487                 cf_cv_shared_soname='`basename $@`'
12488         fi
12489
12490                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12491                 ;;
12492         (nskJ*)
12493                 CC_SHARED_OPTS=
12494                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12495                 ;;
12496         (nskL*)
12497                 CC_SHARED_OPTS=
12498                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12499                 ;;
12500         (nto-qnx*|openbsd*|freebsd[12].*)
12501                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12502                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12503                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12504                 ;;
12505         (dragonfly*|freebsd*)
12506                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12507                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12508                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12509                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12510                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12511                 fi
12512
12513         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12514         if test "$cf_cv_shlib_version" = rel; then
12515                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12516         else
12517                 cf_cv_shared_soname='`basename $@`'
12518         fi
12519
12520                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12521                 ;;
12522         (netbsd*)
12523                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12524                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12525                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12526                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12527                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12528                         if test "$cf_cv_shlib_version" = auto; then
12529                         if test -f /usr/libexec/ld.elf_so; then
12530                                 cf_cv_shlib_version=abi
12531                         else
12532                                 cf_cv_shlib_version=rel
12533                         fi
12534                         fi
12535
12536         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12537         if test "$cf_cv_shlib_version" = rel; then
12538                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12539         else
12540                 cf_cv_shared_soname='`basename $@`'
12541         fi
12542
12543                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12544                 else
12545                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12546                 fi
12547                 ;;
12548         (osf*|mls+*)
12549                 # tested with OSF/1 V3.2 and 'cc'
12550                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12551                 # link with shared libs).
12552                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12553                 case "$host_os" in
12554                 (osf4*)
12555                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12556                         ;;
12557                 esac
12558                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12559                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12560                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12561                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12562                 fi
12563                 cf_cv_rm_so_locs=yes
12564                 ;;
12565         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12566                 # tested with osr5.0.5
12567                 if test "$GCC" != yes; then
12568                         CC_SHARED_OPTS='-belf -KPIC'
12569                 fi
12570                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12571                 if test "$cf_cv_enable_rpath" = yes ; then
12572                         # only way is to set LD_RUN_PATH but no switch for it
12573                         RUN_PATH=$libdir
12574                 fi
12575                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12576                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12577                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12578                 ;;
12579         (sunos4*)
12580                 # tested with SunOS 4.1.1 and gcc 2.7.0
12581                 if test "$GCC" != yes; then
12582                         CC_SHARED_OPTS='-KPIC'
12583                 fi
12584                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12585                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12586                 ;;
12587         (solaris2*)
12588                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12589                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12590                 if test "$DFT_LWR_MODEL" = "shared" ; then
12591                         LOCAL_LDFLAGS="-R\$(LOCAL_LIBDIR):\${libdir}"
12592                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12593                 fi
12594                 if test "$cf_cv_enable_rpath" = yes ; then
12595                         EXTRA_LDFLAGS="-R\${libdir} $EXTRA_LDFLAGS"
12596                 fi
12597
12598         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12599         if test "$cf_cv_shlib_version" = rel; then
12600                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12601         else
12602                 cf_cv_shared_soname='`basename $@`'
12603         fi
12604
12605                 if test "$GCC" != yes; then
12606                         cf_save_CFLAGS="$CFLAGS"
12607                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12608                         do
12609                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12610                                 cat >"conftest.$ac_ext" <<_ACEOF
12611 #line 12611 "configure"
12612 #include "confdefs.h"
12613 #include <stdio.h>
12614 int
12615 main (void)
12616 {
12617 printf("Hello\\n");
12618   ;
12619   return 0;
12620 }
12621 _ACEOF
12622 rm -f "conftest.$ac_objext"
12623 if { (eval echo "$as_me:12623: \"$ac_compile\"") >&5
12624   (eval $ac_compile) 2>&5
12625   ac_status=$?
12626   echo "$as_me:12626: \$? = $ac_status" >&5
12627   (exit "$ac_status"); } &&
12628          { ac_try='test -s "conftest.$ac_objext"'
12629   { (eval echo "$as_me:12629: \"$ac_try\"") >&5
12630   (eval $ac_try) 2>&5
12631   ac_status=$?
12632   echo "$as_me:12632: \$? = $ac_status" >&5
12633   (exit "$ac_status"); }; }; then
12634   break
12635 else
12636   echo "$as_me: failed program was:" >&5
12637 cat "conftest.$ac_ext" >&5
12638 fi
12639 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12640                         done
12641                         CFLAGS="$cf_save_CFLAGS"
12642                         CC_SHARED_OPTS=$cf_shared_opts
12643                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $@'
12644                 else
12645                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $@'
12646                 fi
12647                 ;;
12648         (sysv5uw7*|unix_sv*)
12649                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12650                 if test "$GCC" != yes; then
12651                         CC_SHARED_OPTS='-KPIC'
12652                 fi
12653                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12654                 ;;
12655         (*)
12656                 CC_SHARED_OPTS='unknown'
12657                 MK_SHARED_LIB='echo unknown'
12658                 ;;
12659         esac
12660
12661         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12662         case "$cf_cv_shlib_version" in
12663         (rel|abi)
12664                 case "$MK_SHARED_LIB" in
12665                 (*'-o $@')
12666                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12667                         ;;
12668                 (*)
12669                         { echo "$as_me:12669: WARNING: ignored --with-shlib-version" >&5
12670 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12671                         ;;
12672                 esac
12673                 ;;
12674         esac
12675
12676         if test -n "$cf_try_cflags"
12677         then
12678 cat > conftest.$ac_ext <<EOF
12679 #line 12679 "${as_me:-configure}"
12680 #include <stdio.h>
12681 int main(int argc, char *argv[])
12682 {
12683         printf("hello\\n");
12684         return (argv[argc-1] == 0) ;
12685 }
12686 EOF
12687                 cf_save_CFLAGS="$CFLAGS"
12688                 for cf_opt in $cf_try_cflags
12689                 do
12690                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12691                         echo "$as_me:12691: checking if CFLAGS option -$cf_opt works" >&5
12692 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12693                         if { (eval echo "$as_me:12693: \"$ac_compile\"") >&5
12694   (eval $ac_compile) 2>&5
12695   ac_status=$?
12696   echo "$as_me:12696: \$? = $ac_status" >&5
12697   (exit "$ac_status"); }; then
12698                                 echo "$as_me:12698: result: yes" >&5
12699 echo "${ECHO_T}yes" >&6
12700                                 cf_save_CFLAGS="$CFLAGS"
12701                         else
12702                                 echo "$as_me:12702: result: no" >&5
12703 echo "${ECHO_T}no" >&6
12704                         fi
12705                 done
12706                 CFLAGS="$cf_save_CFLAGS"
12707         fi
12708
12709         # RPATH_LIST is a colon-separated list of directories
12710         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12711         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12712
12713         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12714
12715         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12716
12717 echo "${as_me:-configure}:12717: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12718
12719         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12720
12721 echo "${as_me:-configure}:12721: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12722
12723 # The test/sample programs in the original tree link using rpath option.
12724 # Make it optional for packagers.
12725 if test -n "$LOCAL_LDFLAGS"
12726 then
12727         echo "$as_me:12727: checking if you want to link sample programs with rpath option" >&5
12728 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12729
12730 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12731 if test "${enable_rpath_link+set}" = set; then
12732   enableval="$enable_rpath_link"
12733   with_rpath_link=$enableval
12734 else
12735   with_rpath_link=yes
12736 fi;
12737         echo "$as_me:12737: result: $with_rpath_link" >&5
12738 echo "${ECHO_T}$with_rpath_link" >&6
12739         if test "$with_rpath_link" = no
12740         then
12741                 LOCAL_LDFLAGS=
12742                 LOCAL_LDFLAGS2=
12743         fi
12744 fi
12745
12746 ###############################################################################
12747
12748 ###   use option --enable-broken-linker to force on use of broken-linker support
12749
12750 echo "$as_me:12750: checking if you want broken-linker support code" >&5
12751 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12752
12753 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12754 if test "${enable_broken_linker+set}" = set; then
12755   enableval="$enable_broken_linker"
12756   with_broken_linker=$enableval
12757 else
12758   with_broken_linker=no
12759 fi;
12760 echo "$as_me:12760: result: $with_broken_linker" >&5
12761 echo "${ECHO_T}$with_broken_linker" >&6
12762
12763 : "${BROKEN_LINKER:=0}"
12764 if test "x$with_broken_linker" = xyes ; then
12765
12766 cat >>confdefs.h <<\EOF
12767 #define BROKEN_LINKER 1
12768 EOF
12769
12770         BROKEN_LINKER=1
12771 fi
12772
12773 # Check to define _XOPEN_SOURCE "automatically"
12774
12775 echo "$as_me:12775: checking if the POSIX test-macros are already defined" >&5
12776 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12777 if test "${cf_cv_posix_visible+set}" = set; then
12778   echo $ECHO_N "(cached) $ECHO_C" >&6
12779 else
12780
12781 cat >"conftest.$ac_ext" <<_ACEOF
12782 #line 12782 "configure"
12783 #include "confdefs.h"
12784 #include <stdio.h>
12785 int
12786 main (void)
12787 {
12788
12789 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12790         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12791         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12792         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12793 #error conflicting symbols found
12794 #endif
12795
12796   ;
12797   return 0;
12798 }
12799 _ACEOF
12800 rm -f "conftest.$ac_objext"
12801 if { (eval echo "$as_me:12801: \"$ac_compile\"") >&5
12802   (eval $ac_compile) 2>&5
12803   ac_status=$?
12804   echo "$as_me:12804: \$? = $ac_status" >&5
12805   (exit "$ac_status"); } &&
12806          { ac_try='test -s "conftest.$ac_objext"'
12807   { (eval echo "$as_me:12807: \"$ac_try\"") >&5
12808   (eval $ac_try) 2>&5
12809   ac_status=$?
12810   echo "$as_me:12810: \$? = $ac_status" >&5
12811   (exit "$ac_status"); }; }; then
12812   cf_cv_posix_visible=no
12813 else
12814   echo "$as_me: failed program was:" >&5
12815 cat "conftest.$ac_ext" >&5
12816 cf_cv_posix_visible=yes
12817 fi
12818 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12819
12820 fi
12821 echo "$as_me:12821: result: $cf_cv_posix_visible" >&5
12822 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12823
12824 if test "$cf_cv_posix_visible" = no; then
12825
12826 cf_XOPEN_SOURCE=600
12827 cf_POSIX_C_SOURCE=199506L
12828 cf_xopen_source=
12829
12830 case "$host_os" in
12831 (aix[4-7]*)
12832         cf_xopen_source="-D_ALL_SOURCE"
12833         ;;
12834 (darwin[0-8].*)
12835         cf_xopen_source="-D_APPLE_C_SOURCE"
12836         ;;
12837 (darwin*)
12838         cf_xopen_source="-D_DARWIN_C_SOURCE"
12839         cf_XOPEN_SOURCE=
12840         ;;
12841 (freebsd*|dragonfly*|midnightbsd*)
12842         # 5.x headers associate
12843         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12844         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12845         cf_POSIX_C_SOURCE=200112L
12846         cf_XOPEN_SOURCE=600
12847         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12848         ;;
12849 (hpux11*)
12850         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12851         ;;
12852 (hpux*)
12853         cf_xopen_source="-D_HPUX_SOURCE"
12854         ;;
12855 (irix[56].*)
12856         cf_xopen_source="-D_SGI_SOURCE"
12857         cf_XOPEN_SOURCE=
12858         ;;
12859 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc)
12860
12861 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12862
12863 echo "$as_me:12863: checking if this is the GNU C library" >&5
12864 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12865 if test "${cf_cv_gnu_library+set}" = set; then
12866   echo $ECHO_N "(cached) $ECHO_C" >&6
12867 else
12868
12869 cat >"conftest.$ac_ext" <<_ACEOF
12870 #line 12870 "configure"
12871 #include "confdefs.h"
12872 #include <sys/types.h>
12873 int
12874 main (void)
12875 {
12876
12877         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12878                 return 0;
12879         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12880                 return 0;
12881         #else
12882         #       error not GNU C library
12883         #endif
12884   ;
12885   return 0;
12886 }
12887 _ACEOF
12888 rm -f "conftest.$ac_objext"
12889 if { (eval echo "$as_me:12889: \"$ac_compile\"") >&5
12890   (eval $ac_compile) 2>&5
12891   ac_status=$?
12892   echo "$as_me:12892: \$? = $ac_status" >&5
12893   (exit "$ac_status"); } &&
12894          { ac_try='test -s "conftest.$ac_objext"'
12895   { (eval echo "$as_me:12895: \"$ac_try\"") >&5
12896   (eval $ac_try) 2>&5
12897   ac_status=$?
12898   echo "$as_me:12898: \$? = $ac_status" >&5
12899   (exit "$ac_status"); }; }; then
12900   cf_cv_gnu_library=yes
12901 else
12902   echo "$as_me: failed program was:" >&5
12903 cat "conftest.$ac_ext" >&5
12904 cf_cv_gnu_library=no
12905 fi
12906 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12907
12908 fi
12909 echo "$as_me:12909: result: $cf_cv_gnu_library" >&5
12910 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12911
12912 if test x$cf_cv_gnu_library = xyes; then
12913
12914         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12915         # was changed to help a little.  newlib incorporated the change about 4
12916         # years later.
12917         echo "$as_me:12917: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12918 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12919 if test "${cf_cv_gnu_library_219+set}" = set; then
12920   echo $ECHO_N "(cached) $ECHO_C" >&6
12921 else
12922
12923                 cf_save="$CPPFLAGS"
12924
12925         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12926         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12927
12928                 cat >"conftest.$ac_ext" <<_ACEOF
12929 #line 12929 "configure"
12930 #include "confdefs.h"
12931 #include <sys/types.h>
12932 int
12933 main (void)
12934 {
12935
12936                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12937                                 return 0;
12938                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12939                                 return 0;
12940                         #else
12941                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12942                         #endif
12943   ;
12944   return 0;
12945 }
12946 _ACEOF
12947 rm -f "conftest.$ac_objext"
12948 if { (eval echo "$as_me:12948: \"$ac_compile\"") >&5
12949   (eval $ac_compile) 2>&5
12950   ac_status=$?
12951   echo "$as_me:12951: \$? = $ac_status" >&5
12952   (exit "$ac_status"); } &&
12953          { ac_try='test -s "conftest.$ac_objext"'
12954   { (eval echo "$as_me:12954: \"$ac_try\"") >&5
12955   (eval $ac_try) 2>&5
12956   ac_status=$?
12957   echo "$as_me:12957: \$? = $ac_status" >&5
12958   (exit "$ac_status"); }; }; then
12959   cf_cv_gnu_library_219=yes
12960 else
12961   echo "$as_me: failed program was:" >&5
12962 cat "conftest.$ac_ext" >&5
12963 cf_cv_gnu_library_219=no
12964 fi
12965 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12966                 CPPFLAGS="$cf_save"
12967
12968 fi
12969 echo "$as_me:12969: result: $cf_cv_gnu_library_219" >&5
12970 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12971
12972         if test "x$cf_cv_gnu_library_219" = xyes; then
12973                 cf_save="$CPPFLAGS"
12974                 echo "$as_me:12974: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12975 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12976 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12977   echo $ECHO_N "(cached) $ECHO_C" >&6
12978 else
12979
12980 cf_fix_cppflags=no
12981 cf_new_cflags=
12982 cf_new_cppflags=
12983 cf_new_extra_cppflags=
12984
12985 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12986 do
12987 case "$cf_fix_cppflags" in
12988 (no)
12989         case "$cf_add_cflags" in
12990         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12991                 case "$cf_add_cflags" in
12992                 (-D*)
12993                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12994
12995                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12996                                 && test -z "${cf_tst_cflags}" \
12997                                 && cf_fix_cppflags=yes
12998
12999                         if test "$cf_fix_cppflags" = yes ; then
13000
13001         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13002         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13003
13004                                 continue
13005                         elif test "${cf_tst_cflags}" = "\"'" ; then
13006
13007         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13008         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13009
13010                                 continue
13011                         fi
13012                         ;;
13013                 esac
13014                 case "$CPPFLAGS" in
13015                 (*$cf_add_cflags)
13016                         ;;
13017                 (*)
13018                         case "$cf_add_cflags" in
13019                         (-D*)
13020                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13021
13022 CPPFLAGS=`echo "$CPPFLAGS" | \
13023         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13024                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13025
13026                                 ;;
13027                         esac
13028
13029         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13030         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13031
13032                         ;;
13033                 esac
13034                 ;;
13035         (*)
13036
13037         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13038         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13039
13040                 ;;
13041         esac
13042         ;;
13043 (yes)
13044
13045         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13046         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13047
13048         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13049
13050         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13051                 && test -z "${cf_tst_cflags}" \
13052                 && cf_fix_cppflags=no
13053         ;;
13054 esac
13055 done
13056
13057 if test -n "$cf_new_cflags" ; then
13058
13059         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13060         CFLAGS="${CFLAGS}$cf_new_cflags"
13061
13062 fi
13063
13064 if test -n "$cf_new_cppflags" ; then
13065
13066         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13067         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13068
13069 fi
13070
13071 if test -n "$cf_new_extra_cppflags" ; then
13072
13073         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13074         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13075
13076 fi
13077
13078                         cat >"conftest.$ac_ext" <<_ACEOF
13079 #line 13079 "configure"
13080 #include "confdefs.h"
13081
13082                                 #include <limits.h>
13083                                 #include <sys/types.h>
13084
13085 int
13086 main (void)
13087 {
13088
13089                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
13090                                         return 0;
13091                                 #else
13092                                 #       error GNU C library is too old
13093                                 #endif
13094   ;
13095   return 0;
13096 }
13097 _ACEOF
13098 rm -f "conftest.$ac_objext"
13099 if { (eval echo "$as_me:13099: \"$ac_compile\"") >&5
13100   (eval $ac_compile) 2>&5
13101   ac_status=$?
13102   echo "$as_me:13102: \$? = $ac_status" >&5
13103   (exit "$ac_status"); } &&
13104          { ac_try='test -s "conftest.$ac_objext"'
13105   { (eval echo "$as_me:13105: \"$ac_try\"") >&5
13106   (eval $ac_try) 2>&5
13107   ac_status=$?
13108   echo "$as_me:13108: \$? = $ac_status" >&5
13109   (exit "$ac_status"); }; }; then
13110   cf_cv_gnu_dftsrc_219=yes
13111 else
13112   echo "$as_me: failed program was:" >&5
13113 cat "conftest.$ac_ext" >&5
13114 cf_cv_gnu_dftsrc_219=no
13115 fi
13116 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13117
13118 fi
13119 echo "$as_me:13119: result: $cf_cv_gnu_dftsrc_219" >&5
13120 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
13121                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
13122         else
13123                 cf_cv_gnu_dftsrc_219=maybe
13124         fi
13125
13126         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
13127
13128                 echo "$as_me:13128: checking if we must define _GNU_SOURCE" >&5
13129 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
13130 if test "${cf_cv_gnu_source+set}" = set; then
13131   echo $ECHO_N "(cached) $ECHO_C" >&6
13132 else
13133
13134                 cat >"conftest.$ac_ext" <<_ACEOF
13135 #line 13135 "configure"
13136 #include "confdefs.h"
13137 #include <sys/types.h>
13138 int
13139 main (void)
13140 {
13141
13142                         #ifndef _XOPEN_SOURCE
13143                         #error  expected _XOPEN_SOURCE to be defined
13144                         #endif
13145   ;
13146   return 0;
13147 }
13148 _ACEOF
13149 rm -f "conftest.$ac_objext"
13150 if { (eval echo "$as_me:13150: \"$ac_compile\"") >&5
13151   (eval $ac_compile) 2>&5
13152   ac_status=$?
13153   echo "$as_me:13153: \$? = $ac_status" >&5
13154   (exit "$ac_status"); } &&
13155          { ac_try='test -s "conftest.$ac_objext"'
13156   { (eval echo "$as_me:13156: \"$ac_try\"") >&5
13157   (eval $ac_try) 2>&5
13158   ac_status=$?
13159   echo "$as_me:13159: \$? = $ac_status" >&5
13160   (exit "$ac_status"); }; }; then
13161   cf_cv_gnu_source=no
13162 else
13163   echo "$as_me: failed program was:" >&5
13164 cat "conftest.$ac_ext" >&5
13165 cf_save="$CPPFLAGS"
13166
13167 cf_fix_cppflags=no
13168 cf_new_cflags=
13169 cf_new_cppflags=
13170 cf_new_extra_cppflags=
13171
13172 for cf_add_cflags in -D_GNU_SOURCE
13173 do
13174 case "$cf_fix_cppflags" in
13175 (no)
13176         case "$cf_add_cflags" in
13177         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13178                 case "$cf_add_cflags" in
13179                 (-D*)
13180                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13181
13182                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13183                                 && test -z "${cf_tst_cflags}" \
13184                                 && cf_fix_cppflags=yes
13185
13186                         if test "$cf_fix_cppflags" = yes ; then
13187
13188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13190
13191                                 continue
13192                         elif test "${cf_tst_cflags}" = "\"'" ; then
13193
13194         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13195         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13196
13197                                 continue
13198                         fi
13199                         ;;
13200                 esac
13201                 case "$CPPFLAGS" in
13202                 (*$cf_add_cflags)
13203                         ;;
13204                 (*)
13205                         case "$cf_add_cflags" in
13206                         (-D*)
13207                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13208
13209 CPPFLAGS=`echo "$CPPFLAGS" | \
13210         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13211                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13212
13213                                 ;;
13214                         esac
13215
13216         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13217         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13218
13219                         ;;
13220                 esac
13221                 ;;
13222         (*)
13223
13224         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13225         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13226
13227                 ;;
13228         esac
13229         ;;
13230 (yes)
13231
13232         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13233         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13234
13235         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13236
13237         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13238                 && test -z "${cf_tst_cflags}" \
13239                 && cf_fix_cppflags=no
13240         ;;
13241 esac
13242 done
13243
13244 if test -n "$cf_new_cflags" ; then
13245
13246         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13247         CFLAGS="${CFLAGS}$cf_new_cflags"
13248
13249 fi
13250
13251 if test -n "$cf_new_cppflags" ; then
13252
13253         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13254         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13255
13256 fi
13257
13258 if test -n "$cf_new_extra_cppflags" ; then
13259
13260         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13261         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13262
13263 fi
13264
13265                          cat >"conftest.$ac_ext" <<_ACEOF
13266 #line 13266 "configure"
13267 #include "confdefs.h"
13268 #include <sys/types.h>
13269 int
13270 main (void)
13271 {
13272
13273                                 #ifdef _XOPEN_SOURCE
13274                                 #error  expected _XOPEN_SOURCE to be undefined
13275                                 #endif
13276   ;
13277   return 0;
13278 }
13279 _ACEOF
13280 rm -f "conftest.$ac_objext"
13281 if { (eval echo "$as_me:13281: \"$ac_compile\"") >&5
13282   (eval $ac_compile) 2>&5
13283   ac_status=$?
13284   echo "$as_me:13284: \$? = $ac_status" >&5
13285   (exit "$ac_status"); } &&
13286          { ac_try='test -s "conftest.$ac_objext"'
13287   { (eval echo "$as_me:13287: \"$ac_try\"") >&5
13288   (eval $ac_try) 2>&5
13289   ac_status=$?
13290   echo "$as_me:13290: \$? = $ac_status" >&5
13291   (exit "$ac_status"); }; }; then
13292   cf_cv_gnu_source=no
13293 else
13294   echo "$as_me: failed program was:" >&5
13295 cat "conftest.$ac_ext" >&5
13296 cf_cv_gnu_source=yes
13297 fi
13298 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13299                         CPPFLAGS="$cf_save"
13300
13301 fi
13302 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13303
13304 fi
13305 echo "$as_me:13305: result: $cf_cv_gnu_source" >&5
13306 echo "${ECHO_T}$cf_cv_gnu_source" >&6
13307
13308                 if test "$cf_cv_gnu_source" = yes
13309                 then
13310                 echo "$as_me:13310: checking if we should also define _DEFAULT_SOURCE" >&5
13311 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
13312 if test "${cf_cv_default_source+set}" = set; then
13313   echo $ECHO_N "(cached) $ECHO_C" >&6
13314 else
13315
13316         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13317         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
13318
13319                         cat >"conftest.$ac_ext" <<_ACEOF
13320 #line 13320 "configure"
13321 #include "confdefs.h"
13322 #include <sys/types.h>
13323 int
13324 main (void)
13325 {
13326
13327                                 #ifdef _DEFAULT_SOURCE
13328                                 #error  expected _DEFAULT_SOURCE to be undefined
13329                                 #endif
13330   ;
13331   return 0;
13332 }
13333 _ACEOF
13334 rm -f "conftest.$ac_objext"
13335 if { (eval echo "$as_me:13335: \"$ac_compile\"") >&5
13336   (eval $ac_compile) 2>&5
13337   ac_status=$?
13338   echo "$as_me:13338: \$? = $ac_status" >&5
13339   (exit "$ac_status"); } &&
13340          { ac_try='test -s "conftest.$ac_objext"'
13341   { (eval echo "$as_me:13341: \"$ac_try\"") >&5
13342   (eval $ac_try) 2>&5
13343   ac_status=$?
13344   echo "$as_me:13344: \$? = $ac_status" >&5
13345   (exit "$ac_status"); }; }; then
13346   cf_cv_default_source=no
13347 else
13348   echo "$as_me: failed program was:" >&5
13349 cat "conftest.$ac_ext" >&5
13350 cf_cv_default_source=yes
13351 fi
13352 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13353
13354 fi
13355 echo "$as_me:13355: result: $cf_cv_default_source" >&5
13356 echo "${ECHO_T}$cf_cv_default_source" >&6
13357                         if test "$cf_cv_default_source" = yes
13358                         then
13359
13360         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13361         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
13362
13363                         fi
13364                 fi
13365         fi
13366
13367 fi
13368
13369         ;;
13370 (minix*)
13371         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
13372         ;;
13373 (mirbsd*)
13374         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
13375         cf_XOPEN_SOURCE=
13376
13377 if test "$cf_cv_posix_visible" = no; then
13378
13379 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13380
13381 cf_save_CFLAGS="$CFLAGS"
13382 cf_save_CPPFLAGS="$CPPFLAGS"
13383
13384 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13385         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13386                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13387
13388 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13389         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13390                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13391
13392 echo "$as_me:13392: checking if we should define _POSIX_C_SOURCE" >&5
13393 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13394 if test "${cf_cv_posix_c_source+set}" = set; then
13395   echo $ECHO_N "(cached) $ECHO_C" >&6
13396 else
13397
13398 echo "${as_me:-configure}:13398: testing if the symbol is already defined go no further ..." 1>&5
13399
13400         cat >"conftest.$ac_ext" <<_ACEOF
13401 #line 13401 "configure"
13402 #include "confdefs.h"
13403 #include <sys/types.h>
13404 int
13405 main (void)
13406 {
13407
13408 #ifndef _POSIX_C_SOURCE
13409 #error _POSIX_C_SOURCE is not defined
13410 #endif
13411   ;
13412   return 0;
13413 }
13414 _ACEOF
13415 rm -f "conftest.$ac_objext"
13416 if { (eval echo "$as_me:13416: \"$ac_compile\"") >&5
13417   (eval $ac_compile) 2>&5
13418   ac_status=$?
13419   echo "$as_me:13419: \$? = $ac_status" >&5
13420   (exit "$ac_status"); } &&
13421          { ac_try='test -s "conftest.$ac_objext"'
13422   { (eval echo "$as_me:13422: \"$ac_try\"") >&5
13423   (eval $ac_try) 2>&5
13424   ac_status=$?
13425   echo "$as_me:13425: \$? = $ac_status" >&5
13426   (exit "$ac_status"); }; }; then
13427   cf_cv_posix_c_source=no
13428 else
13429   echo "$as_me: failed program was:" >&5
13430 cat "conftest.$ac_ext" >&5
13431 cf_want_posix_source=no
13432          case .$cf_POSIX_C_SOURCE in
13433          (.[12]??*)
13434                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13435                 ;;
13436          (.2)
13437                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13438                 cf_want_posix_source=yes
13439                 ;;
13440          (.*)
13441                 cf_want_posix_source=yes
13442                 ;;
13443          esac
13444          if test "$cf_want_posix_source" = yes ; then
13445                 cat >"conftest.$ac_ext" <<_ACEOF
13446 #line 13446 "configure"
13447 #include "confdefs.h"
13448 #include <sys/types.h>
13449 int
13450 main (void)
13451 {
13452
13453 #ifdef _POSIX_SOURCE
13454 #error _POSIX_SOURCE is defined
13455 #endif
13456   ;
13457   return 0;
13458 }
13459 _ACEOF
13460 rm -f "conftest.$ac_objext"
13461 if { (eval echo "$as_me:13461: \"$ac_compile\"") >&5
13462   (eval $ac_compile) 2>&5
13463   ac_status=$?
13464   echo "$as_me:13464: \$? = $ac_status" >&5
13465   (exit "$ac_status"); } &&
13466          { ac_try='test -s "conftest.$ac_objext"'
13467   { (eval echo "$as_me:13467: \"$ac_try\"") >&5
13468   (eval $ac_try) 2>&5
13469   ac_status=$?
13470   echo "$as_me:13470: \$? = $ac_status" >&5
13471   (exit "$ac_status"); }; }; then
13472   :
13473 else
13474   echo "$as_me: failed program was:" >&5
13475 cat "conftest.$ac_ext" >&5
13476 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13477 fi
13478 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13479          fi
13480
13481 echo "${as_me:-configure}:13481: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13482
13483          CFLAGS="$cf_trim_CFLAGS"
13484          CPPFLAGS="$cf_trim_CPPFLAGS"
13485
13486         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13487         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13488
13489 echo "${as_me:-configure}:13489: testing if the second compile does not leave our definition intact error ..." 1>&5
13490
13491          cat >"conftest.$ac_ext" <<_ACEOF
13492 #line 13492 "configure"
13493 #include "confdefs.h"
13494 #include <sys/types.h>
13495 int
13496 main (void)
13497 {
13498
13499 #ifndef _POSIX_C_SOURCE
13500 #error _POSIX_C_SOURCE is not defined
13501 #endif
13502   ;
13503   return 0;
13504 }
13505 _ACEOF
13506 rm -f "conftest.$ac_objext"
13507 if { (eval echo "$as_me:13507: \"$ac_compile\"") >&5
13508   (eval $ac_compile) 2>&5
13509   ac_status=$?
13510   echo "$as_me:13510: \$? = $ac_status" >&5
13511   (exit "$ac_status"); } &&
13512          { ac_try='test -s "conftest.$ac_objext"'
13513   { (eval echo "$as_me:13513: \"$ac_try\"") >&5
13514   (eval $ac_try) 2>&5
13515   ac_status=$?
13516   echo "$as_me:13516: \$? = $ac_status" >&5
13517   (exit "$ac_status"); }; }; then
13518   :
13519 else
13520   echo "$as_me: failed program was:" >&5
13521 cat "conftest.$ac_ext" >&5
13522 cf_cv_posix_c_source=no
13523 fi
13524 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13525          CFLAGS="$cf_save_CFLAGS"
13526          CPPFLAGS="$cf_save_CPPFLAGS"
13527
13528 fi
13529 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13530
13531 fi
13532 echo "$as_me:13532: result: $cf_cv_posix_c_source" >&5
13533 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13534
13535 if test "$cf_cv_posix_c_source" != no ; then
13536         CFLAGS="$cf_trim_CFLAGS"
13537         CPPFLAGS="$cf_trim_CPPFLAGS"
13538
13539 cf_fix_cppflags=no
13540 cf_new_cflags=
13541 cf_new_cppflags=
13542 cf_new_extra_cppflags=
13543
13544 for cf_add_cflags in $cf_cv_posix_c_source
13545 do
13546 case "$cf_fix_cppflags" in
13547 (no)
13548         case "$cf_add_cflags" in
13549         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13550                 case "$cf_add_cflags" in
13551                 (-D*)
13552                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13553
13554                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13555                                 && test -z "${cf_tst_cflags}" \
13556                                 && cf_fix_cppflags=yes
13557
13558                         if test "$cf_fix_cppflags" = yes ; then
13559
13560         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13561         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13562
13563                                 continue
13564                         elif test "${cf_tst_cflags}" = "\"'" ; then
13565
13566         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13567         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13568
13569                                 continue
13570                         fi
13571                         ;;
13572                 esac
13573                 case "$CPPFLAGS" in
13574                 (*$cf_add_cflags)
13575                         ;;
13576                 (*)
13577                         case "$cf_add_cflags" in
13578                         (-D*)
13579                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13580
13581 CPPFLAGS=`echo "$CPPFLAGS" | \
13582         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13583                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13584
13585                                 ;;
13586                         esac
13587
13588         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13589         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13590
13591                         ;;
13592                 esac
13593                 ;;
13594         (*)
13595
13596         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13597         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13598
13599                 ;;
13600         esac
13601         ;;
13602 (yes)
13603
13604         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13605         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13606
13607         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13608
13609         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13610                 && test -z "${cf_tst_cflags}" \
13611                 && cf_fix_cppflags=no
13612         ;;
13613 esac
13614 done
13615
13616 if test -n "$cf_new_cflags" ; then
13617
13618         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13619         CFLAGS="${CFLAGS}$cf_new_cflags"
13620
13621 fi
13622
13623 if test -n "$cf_new_cppflags" ; then
13624
13625         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13626         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13627
13628 fi
13629
13630 if test -n "$cf_new_extra_cppflags" ; then
13631
13632         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13633         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13634
13635 fi
13636
13637 fi
13638
13639 fi # cf_cv_posix_visible
13640
13641         ;;
13642 (netbsd*)
13643         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13644         ;;
13645 (openbsd[6-9]*)
13646         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13647         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13648         # Abusing the conformance level is a workaround.
13649         { echo "$as_me:13649: WARNING: this system does not provide usable locale support" >&5
13650 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13651         cf_xopen_source="-D_BSD_SOURCE"
13652         cf_XOPEN_SOURCE=700
13653         ;;
13654 (openbsd[4-5]*)
13655         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13656         cf_xopen_source="-D_BSD_SOURCE"
13657         cf_XOPEN_SOURCE=600
13658         ;;
13659 (openbsd*)
13660         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13661         ;;
13662 (osf[45]*)
13663         cf_xopen_source="-D_OSF_SOURCE"
13664         ;;
13665 (nto-qnx*)
13666         cf_xopen_source="-D_QNX_SOURCE"
13667         ;;
13668 (sco*)
13669         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13670         ;;
13671 (solaris2.*)
13672         cf_xopen_source="-D__EXTENSIONS__"
13673         cf_cv_xopen_source=broken
13674         ;;
13675 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13676         cf_XOPEN_SOURCE=
13677         cf_POSIX_C_SOURCE=
13678         ;;
13679 (*)
13680
13681 echo "$as_me:13681: checking if we should define _XOPEN_SOURCE" >&5
13682 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13683 if test "${cf_cv_xopen_source+set}" = set; then
13684   echo $ECHO_N "(cached) $ECHO_C" >&6
13685 else
13686
13687         cat >"conftest.$ac_ext" <<_ACEOF
13688 #line 13688 "configure"
13689 #include "confdefs.h"
13690
13691 $ac_includes_default
13692
13693 int
13694 main (void)
13695 {
13696
13697 #ifndef _XOPEN_SOURCE
13698 #error _XOPEN_SOURCE is not defined
13699 #endif
13700
13701   ;
13702   return 0;
13703 }
13704 _ACEOF
13705 rm -f "conftest.$ac_objext"
13706 if { (eval echo "$as_me:13706: \"$ac_compile\"") >&5
13707   (eval $ac_compile) 2>&5
13708   ac_status=$?
13709   echo "$as_me:13709: \$? = $ac_status" >&5
13710   (exit "$ac_status"); } &&
13711          { ac_try='test -s "conftest.$ac_objext"'
13712   { (eval echo "$as_me:13712: \"$ac_try\"") >&5
13713   (eval $ac_try) 2>&5
13714   ac_status=$?
13715   echo "$as_me:13715: \$? = $ac_status" >&5
13716   (exit "$ac_status"); }; }; then
13717   cf_cv_xopen_source=no
13718 else
13719   echo "$as_me: failed program was:" >&5
13720 cat "conftest.$ac_ext" >&5
13721 cf_save="$CPPFLAGS"
13722
13723         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13724         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13725
13726          cat >"conftest.$ac_ext" <<_ACEOF
13727 #line 13727 "configure"
13728 #include "confdefs.h"
13729
13730 $ac_includes_default
13731
13732 int
13733 main (void)
13734 {
13735
13736 #ifndef _XOPEN_SOURCE
13737 #error _XOPEN_SOURCE is not defined
13738 #endif
13739
13740   ;
13741   return 0;
13742 }
13743 _ACEOF
13744 rm -f "conftest.$ac_objext"
13745 if { (eval echo "$as_me:13745: \"$ac_compile\"") >&5
13746   (eval $ac_compile) 2>&5
13747   ac_status=$?
13748   echo "$as_me:13748: \$? = $ac_status" >&5
13749   (exit "$ac_status"); } &&
13750          { ac_try='test -s "conftest.$ac_objext"'
13751   { (eval echo "$as_me:13751: \"$ac_try\"") >&5
13752   (eval $ac_try) 2>&5
13753   ac_status=$?
13754   echo "$as_me:13754: \$? = $ac_status" >&5
13755   (exit "$ac_status"); }; }; then
13756   cf_cv_xopen_source=no
13757 else
13758   echo "$as_me: failed program was:" >&5
13759 cat "conftest.$ac_ext" >&5
13760 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13761 fi
13762 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13763                 CPPFLAGS="$cf_save"
13764
13765 fi
13766 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13767
13768 fi
13769 echo "$as_me:13769: result: $cf_cv_xopen_source" >&5
13770 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13771
13772 if test "$cf_cv_xopen_source" != no ; then
13773
13774 CFLAGS=`echo "$CFLAGS" | \
13775         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13776                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13777
13778 CPPFLAGS=`echo "$CPPFLAGS" | \
13779         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13780                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13781
13782         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13783
13784 for cf_add_cflags in $cf_temp_xopen_source
13785 do
13786         case "x$cf_add_cflags" in
13787         (x-[DU]*)
13788
13789 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13790 while true
13791 do
13792         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'`
13793         test "$CFLAGS" != "$cf_old_cflag" || break
13794
13795         CFLAGS="$cf_old_cflag"
13796 done
13797
13798 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13799 while true
13800 do
13801         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'`
13802         test "$CPPFLAGS" != "$cf_old_cflag" || break
13803
13804         CPPFLAGS="$cf_old_cflag"
13805 done
13806
13807                 ;;
13808         esac
13809
13810 cf_fix_cppflags=no
13811 cf_new_cflags=
13812 cf_new_cppflags=
13813 cf_new_extra_cppflags=
13814
13815 for cf_add_cflags in $cf_add_cflags
13816 do
13817 case "$cf_fix_cppflags" in
13818 (no)
13819         case "$cf_add_cflags" in
13820         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13821                 case "$cf_add_cflags" in
13822                 (-D*)
13823                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13824
13825                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13826                                 && test -z "${cf_tst_cflags}" \
13827                                 && cf_fix_cppflags=yes
13828
13829                         if test "$cf_fix_cppflags" = yes ; then
13830
13831         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13832         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13833
13834                                 continue
13835                         elif test "${cf_tst_cflags}" = "\"'" ; then
13836
13837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13839
13840                                 continue
13841                         fi
13842                         ;;
13843                 esac
13844                 case "$CPPFLAGS" in
13845                 (*$cf_add_cflags)
13846                         ;;
13847                 (*)
13848                         case "$cf_add_cflags" in
13849                         (-D*)
13850                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13851
13852 CPPFLAGS=`echo "$CPPFLAGS" | \
13853         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13854                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13855
13856                                 ;;
13857                         esac
13858
13859         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13860         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13861
13862                         ;;
13863                 esac
13864                 ;;
13865         (*)
13866
13867         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13868         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13869
13870                 ;;
13871         esac
13872         ;;
13873 (yes)
13874
13875         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13876         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13877
13878         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13879
13880         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13881                 && test -z "${cf_tst_cflags}" \
13882                 && cf_fix_cppflags=no
13883         ;;
13884 esac
13885 done
13886
13887 if test -n "$cf_new_cflags" ; then
13888
13889         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13890         CFLAGS="${CFLAGS}$cf_new_cflags"
13891
13892 fi
13893
13894 if test -n "$cf_new_cppflags" ; then
13895
13896         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13897         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13898
13899 fi
13900
13901 if test -n "$cf_new_extra_cppflags" ; then
13902
13903         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13904         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13905
13906 fi
13907
13908 done
13909
13910 fi
13911
13912         cf_save_xopen_cppflags="$CPPFLAGS"
13913
13914 if test "$cf_cv_posix_visible" = no; then
13915
13916 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13917
13918 cf_save_CFLAGS="$CFLAGS"
13919 cf_save_CPPFLAGS="$CPPFLAGS"
13920
13921 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13922         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13923                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13924
13925 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13926         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13927                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13928
13929 echo "$as_me:13929: checking if we should define _POSIX_C_SOURCE" >&5
13930 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13931 if test "${cf_cv_posix_c_source+set}" = set; then
13932   echo $ECHO_N "(cached) $ECHO_C" >&6
13933 else
13934
13935 echo "${as_me:-configure}:13935: testing if the symbol is already defined go no further ..." 1>&5
13936
13937         cat >"conftest.$ac_ext" <<_ACEOF
13938 #line 13938 "configure"
13939 #include "confdefs.h"
13940 #include <sys/types.h>
13941 int
13942 main (void)
13943 {
13944
13945 #ifndef _POSIX_C_SOURCE
13946 #error _POSIX_C_SOURCE is not defined
13947 #endif
13948   ;
13949   return 0;
13950 }
13951 _ACEOF
13952 rm -f "conftest.$ac_objext"
13953 if { (eval echo "$as_me:13953: \"$ac_compile\"") >&5
13954   (eval $ac_compile) 2>&5
13955   ac_status=$?
13956   echo "$as_me:13956: \$? = $ac_status" >&5
13957   (exit "$ac_status"); } &&
13958          { ac_try='test -s "conftest.$ac_objext"'
13959   { (eval echo "$as_me:13959: \"$ac_try\"") >&5
13960   (eval $ac_try) 2>&5
13961   ac_status=$?
13962   echo "$as_me:13962: \$? = $ac_status" >&5
13963   (exit "$ac_status"); }; }; then
13964   cf_cv_posix_c_source=no
13965 else
13966   echo "$as_me: failed program was:" >&5
13967 cat "conftest.$ac_ext" >&5
13968 cf_want_posix_source=no
13969          case .$cf_POSIX_C_SOURCE in
13970          (.[12]??*)
13971                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13972                 ;;
13973          (.2)
13974                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13975                 cf_want_posix_source=yes
13976                 ;;
13977          (.*)
13978                 cf_want_posix_source=yes
13979                 ;;
13980          esac
13981          if test "$cf_want_posix_source" = yes ; then
13982                 cat >"conftest.$ac_ext" <<_ACEOF
13983 #line 13983 "configure"
13984 #include "confdefs.h"
13985 #include <sys/types.h>
13986 int
13987 main (void)
13988 {
13989
13990 #ifdef _POSIX_SOURCE
13991 #error _POSIX_SOURCE is defined
13992 #endif
13993   ;
13994   return 0;
13995 }
13996 _ACEOF
13997 rm -f "conftest.$ac_objext"
13998 if { (eval echo "$as_me:13998: \"$ac_compile\"") >&5
13999   (eval $ac_compile) 2>&5
14000   ac_status=$?
14001   echo "$as_me:14001: \$? = $ac_status" >&5
14002   (exit "$ac_status"); } &&
14003          { ac_try='test -s "conftest.$ac_objext"'
14004   { (eval echo "$as_me:14004: \"$ac_try\"") >&5
14005   (eval $ac_try) 2>&5
14006   ac_status=$?
14007   echo "$as_me:14007: \$? = $ac_status" >&5
14008   (exit "$ac_status"); }; }; then
14009   :
14010 else
14011   echo "$as_me: failed program was:" >&5
14012 cat "conftest.$ac_ext" >&5
14013 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
14014 fi
14015 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14016          fi
14017
14018 echo "${as_me:-configure}:14018: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
14019
14020          CFLAGS="$cf_trim_CFLAGS"
14021          CPPFLAGS="$cf_trim_CPPFLAGS"
14022
14023         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14024         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
14025
14026 echo "${as_me:-configure}:14026: testing if the second compile does not leave our definition intact error ..." 1>&5
14027
14028          cat >"conftest.$ac_ext" <<_ACEOF
14029 #line 14029 "configure"
14030 #include "confdefs.h"
14031 #include <sys/types.h>
14032 int
14033 main (void)
14034 {
14035
14036 #ifndef _POSIX_C_SOURCE
14037 #error _POSIX_C_SOURCE is not defined
14038 #endif
14039   ;
14040   return 0;
14041 }
14042 _ACEOF
14043 rm -f "conftest.$ac_objext"
14044 if { (eval echo "$as_me:14044: \"$ac_compile\"") >&5
14045   (eval $ac_compile) 2>&5
14046   ac_status=$?
14047   echo "$as_me:14047: \$? = $ac_status" >&5
14048   (exit "$ac_status"); } &&
14049          { ac_try='test -s "conftest.$ac_objext"'
14050   { (eval echo "$as_me:14050: \"$ac_try\"") >&5
14051   (eval $ac_try) 2>&5
14052   ac_status=$?
14053   echo "$as_me:14053: \$? = $ac_status" >&5
14054   (exit "$ac_status"); }; }; then
14055   :
14056 else
14057   echo "$as_me: failed program was:" >&5
14058 cat "conftest.$ac_ext" >&5
14059 cf_cv_posix_c_source=no
14060 fi
14061 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14062          CFLAGS="$cf_save_CFLAGS"
14063          CPPFLAGS="$cf_save_CPPFLAGS"
14064
14065 fi
14066 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14067
14068 fi
14069 echo "$as_me:14069: result: $cf_cv_posix_c_source" >&5
14070 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
14071
14072 if test "$cf_cv_posix_c_source" != no ; then
14073         CFLAGS="$cf_trim_CFLAGS"
14074         CPPFLAGS="$cf_trim_CPPFLAGS"
14075
14076 cf_fix_cppflags=no
14077 cf_new_cflags=
14078 cf_new_cppflags=
14079 cf_new_extra_cppflags=
14080
14081 for cf_add_cflags in $cf_cv_posix_c_source
14082 do
14083 case "$cf_fix_cppflags" in
14084 (no)
14085         case "$cf_add_cflags" in
14086         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14087                 case "$cf_add_cflags" in
14088                 (-D*)
14089                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14090
14091                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14092                                 && test -z "${cf_tst_cflags}" \
14093                                 && cf_fix_cppflags=yes
14094
14095                         if test "$cf_fix_cppflags" = yes ; then
14096
14097         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14098         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14099
14100                                 continue
14101                         elif test "${cf_tst_cflags}" = "\"'" ; then
14102
14103         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14104         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14105
14106                                 continue
14107                         fi
14108                         ;;
14109                 esac
14110                 case "$CPPFLAGS" in
14111                 (*$cf_add_cflags)
14112                         ;;
14113                 (*)
14114                         case "$cf_add_cflags" in
14115                         (-D*)
14116                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14117
14118 CPPFLAGS=`echo "$CPPFLAGS" | \
14119         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14120                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14121
14122                                 ;;
14123                         esac
14124
14125         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14126         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14127
14128                         ;;
14129                 esac
14130                 ;;
14131         (*)
14132
14133         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14134         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14135
14136                 ;;
14137         esac
14138         ;;
14139 (yes)
14140
14141         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14142         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14143
14144         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14145
14146         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14147                 && test -z "${cf_tst_cflags}" \
14148                 && cf_fix_cppflags=no
14149         ;;
14150 esac
14151 done
14152
14153 if test -n "$cf_new_cflags" ; then
14154
14155         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14156         CFLAGS="${CFLAGS}$cf_new_cflags"
14157
14158 fi
14159
14160 if test -n "$cf_new_cppflags" ; then
14161
14162         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14163         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14164
14165 fi
14166
14167 if test -n "$cf_new_extra_cppflags" ; then
14168
14169         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14170         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14171
14172 fi
14173
14174 fi
14175
14176 fi # cf_cv_posix_visible
14177
14178         # Some of these niche implementations use copy/paste, double-check...
14179         if test "$cf_cv_xopen_source" = no ; then
14180                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE" 1>&6
14181
14182 echo "${as_me:-configure}:14182: testing checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE ..." 1>&5
14183
14184                 cat >"conftest.$ac_ext" <<_ACEOF
14185 #line 14185 "configure"
14186 #include "confdefs.h"
14187
14188 $ac_includes_default
14189
14190 int
14191 main (void)
14192 {
14193
14194 #ifndef _XOPEN_SOURCE
14195 #error _XOPEN_SOURCE is not defined
14196 #endif
14197
14198   ;
14199   return 0;
14200 }
14201 _ACEOF
14202 rm -f "conftest.$ac_objext"
14203 if { (eval echo "$as_me:14203: \"$ac_compile\"") >&5
14204   (eval $ac_compile) 2>&5
14205   ac_status=$?
14206   echo "$as_me:14206: \$? = $ac_status" >&5
14207   (exit "$ac_status"); } &&
14208          { ac_try='test -s "conftest.$ac_objext"'
14209   { (eval echo "$as_me:14209: \"$ac_try\"") >&5
14210   (eval $ac_try) 2>&5
14211   ac_status=$?
14212   echo "$as_me:14212: \$? = $ac_status" >&5
14213   (exit "$ac_status"); }; }; then
14214   :
14215 else
14216   echo "$as_me: failed program was:" >&5
14217 cat "conftest.$ac_ext" >&5
14218
14219                         { echo "$as_me:14219: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
14220 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
14221                         CPPFLAGS="$cf_save_xopen_cppflags"
14222 fi
14223 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14224         fi
14225         ;;
14226 esac
14227
14228 if test -n "$cf_xopen_source" ; then
14229
14230 for cf_add_cflags in $cf_xopen_source
14231 do
14232         case "x$cf_add_cflags" in
14233         (x-[DU]*)
14234
14235 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14236 while true
14237 do
14238         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'`
14239         test "$CFLAGS" != "$cf_old_cflag" || break
14240         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
14241
14242 echo "${as_me:-configure}:14242: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
14243
14244         CFLAGS="$cf_old_cflag"
14245 done
14246
14247 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14248 while true
14249 do
14250         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'`
14251         test "$CPPFLAGS" != "$cf_old_cflag" || break
14252         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
14253
14254 echo "${as_me:-configure}:14254: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
14255
14256         CPPFLAGS="$cf_old_cflag"
14257 done
14258
14259                 ;;
14260         esac
14261
14262 cf_fix_cppflags=no
14263 cf_new_cflags=
14264 cf_new_cppflags=
14265 cf_new_extra_cppflags=
14266
14267 for cf_add_cflags in $cf_add_cflags
14268 do
14269 case "$cf_fix_cppflags" in
14270 (no)
14271         case "$cf_add_cflags" in
14272         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14273                 case "$cf_add_cflags" in
14274                 (-D*)
14275                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14276
14277                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14278                                 && test -z "${cf_tst_cflags}" \
14279                                 && cf_fix_cppflags=yes
14280
14281                         if test "$cf_fix_cppflags" = yes ; then
14282
14283         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14284         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14285
14286                                 continue
14287                         elif test "${cf_tst_cflags}" = "\"'" ; then
14288
14289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14291
14292                                 continue
14293                         fi
14294                         ;;
14295                 esac
14296                 case "$CPPFLAGS" in
14297                 (*$cf_add_cflags)
14298                         ;;
14299                 (*)
14300                         case "$cf_add_cflags" in
14301                         (-D*)
14302                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14303
14304 CPPFLAGS=`echo "$CPPFLAGS" | \
14305         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14306                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14307
14308                                 ;;
14309                         esac
14310
14311         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14312         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14313
14314                         ;;
14315                 esac
14316                 ;;
14317         (*)
14318
14319         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14320         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14321
14322                 ;;
14323         esac
14324         ;;
14325 (yes)
14326
14327         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14328         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14329
14330         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14331
14332         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14333                 && test -z "${cf_tst_cflags}" \
14334                 && cf_fix_cppflags=no
14335         ;;
14336 esac
14337 done
14338
14339 if test -n "$cf_new_cflags" ; then
14340         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14341
14342 echo "${as_me:-configure}:14342: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14343
14344         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14345         CFLAGS="${CFLAGS}$cf_new_cflags"
14346
14347 fi
14348
14349 if test -n "$cf_new_cppflags" ; then
14350         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14351
14352 echo "${as_me:-configure}:14352: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14353
14354         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14355         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14356
14357 fi
14358
14359 if test -n "$cf_new_extra_cppflags" ; then
14360         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14361
14362 echo "${as_me:-configure}:14362: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14363
14364         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14365         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14366
14367 fi
14368
14369 done
14370
14371 fi
14372
14373 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
14374         echo "$as_me:14374: checking if _XOPEN_SOURCE really is set" >&5
14375 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
14376         cat >"conftest.$ac_ext" <<_ACEOF
14377 #line 14377 "configure"
14378 #include "confdefs.h"
14379 #include <stdlib.h>
14380 int
14381 main (void)
14382 {
14383
14384 #ifndef _XOPEN_SOURCE
14385 #error _XOPEN_SOURCE is not defined
14386 #endif
14387   ;
14388   return 0;
14389 }
14390 _ACEOF
14391 rm -f "conftest.$ac_objext"
14392 if { (eval echo "$as_me:14392: \"$ac_compile\"") >&5
14393   (eval $ac_compile) 2>&5
14394   ac_status=$?
14395   echo "$as_me:14395: \$? = $ac_status" >&5
14396   (exit "$ac_status"); } &&
14397          { ac_try='test -s "conftest.$ac_objext"'
14398   { (eval echo "$as_me:14398: \"$ac_try\"") >&5
14399   (eval $ac_try) 2>&5
14400   ac_status=$?
14401   echo "$as_me:14401: \$? = $ac_status" >&5
14402   (exit "$ac_status"); }; }; then
14403   cf_XOPEN_SOURCE_set=yes
14404 else
14405   echo "$as_me: failed program was:" >&5
14406 cat "conftest.$ac_ext" >&5
14407 cf_XOPEN_SOURCE_set=no
14408 fi
14409 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14410         echo "$as_me:14410: result: $cf_XOPEN_SOURCE_set" >&5
14411 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14412         if test "$cf_XOPEN_SOURCE_set" = yes
14413         then
14414                 cat >"conftest.$ac_ext" <<_ACEOF
14415 #line 14415 "configure"
14416 #include "confdefs.h"
14417 #include <stdlib.h>
14418 int
14419 main (void)
14420 {
14421
14422 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14423 #error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14424 #endif
14425   ;
14426   return 0;
14427 }
14428 _ACEOF
14429 rm -f "conftest.$ac_objext"
14430 if { (eval echo "$as_me:14430: \"$ac_compile\"") >&5
14431   (eval $ac_compile) 2>&5
14432   ac_status=$?
14433   echo "$as_me:14433: \$? = $ac_status" >&5
14434   (exit "$ac_status"); } &&
14435          { ac_try='test -s "conftest.$ac_objext"'
14436   { (eval echo "$as_me:14436: \"$ac_try\"") >&5
14437   (eval $ac_try) 2>&5
14438   ac_status=$?
14439   echo "$as_me:14439: \$? = $ac_status" >&5
14440   (exit "$ac_status"); }; }; then
14441   cf_XOPEN_SOURCE_set_ok=yes
14442 else
14443   echo "$as_me: failed program was:" >&5
14444 cat "conftest.$ac_ext" >&5
14445 cf_XOPEN_SOURCE_set_ok=no
14446 fi
14447 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14448                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14449                 then
14450                         { echo "$as_me:14450: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14451 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14452                 fi
14453         else
14454
14455 echo "$as_me:14455: checking if we should define _XOPEN_SOURCE" >&5
14456 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14457 if test "${cf_cv_xopen_source+set}" = set; then
14458   echo $ECHO_N "(cached) $ECHO_C" >&6
14459 else
14460
14461         cat >"conftest.$ac_ext" <<_ACEOF
14462 #line 14462 "configure"
14463 #include "confdefs.h"
14464
14465 $ac_includes_default
14466
14467 int
14468 main (void)
14469 {
14470
14471 #ifndef _XOPEN_SOURCE
14472 #error _XOPEN_SOURCE is not defined
14473 #endif
14474
14475   ;
14476   return 0;
14477 }
14478 _ACEOF
14479 rm -f "conftest.$ac_objext"
14480 if { (eval echo "$as_me:14480: \"$ac_compile\"") >&5
14481   (eval $ac_compile) 2>&5
14482   ac_status=$?
14483   echo "$as_me:14483: \$? = $ac_status" >&5
14484   (exit "$ac_status"); } &&
14485          { ac_try='test -s "conftest.$ac_objext"'
14486   { (eval echo "$as_me:14486: \"$ac_try\"") >&5
14487   (eval $ac_try) 2>&5
14488   ac_status=$?
14489   echo "$as_me:14489: \$? = $ac_status" >&5
14490   (exit "$ac_status"); }; }; then
14491   cf_cv_xopen_source=no
14492 else
14493   echo "$as_me: failed program was:" >&5
14494 cat "conftest.$ac_ext" >&5
14495 cf_save="$CPPFLAGS"
14496
14497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14498         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14499
14500          cat >"conftest.$ac_ext" <<_ACEOF
14501 #line 14501 "configure"
14502 #include "confdefs.h"
14503
14504 $ac_includes_default
14505
14506 int
14507 main (void)
14508 {
14509
14510 #ifndef _XOPEN_SOURCE
14511 #error _XOPEN_SOURCE is not defined
14512 #endif
14513
14514   ;
14515   return 0;
14516 }
14517 _ACEOF
14518 rm -f "conftest.$ac_objext"
14519 if { (eval echo "$as_me:14519: \"$ac_compile\"") >&5
14520   (eval $ac_compile) 2>&5
14521   ac_status=$?
14522   echo "$as_me:14522: \$? = $ac_status" >&5
14523   (exit "$ac_status"); } &&
14524          { ac_try='test -s "conftest.$ac_objext"'
14525   { (eval echo "$as_me:14525: \"$ac_try\"") >&5
14526   (eval $ac_try) 2>&5
14527   ac_status=$?
14528   echo "$as_me:14528: \$? = $ac_status" >&5
14529   (exit "$ac_status"); }; }; then
14530   cf_cv_xopen_source=no
14531 else
14532   echo "$as_me: failed program was:" >&5
14533 cat "conftest.$ac_ext" >&5
14534 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14535 fi
14536 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14537                 CPPFLAGS="$cf_save"
14538
14539 fi
14540 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14541
14542 fi
14543 echo "$as_me:14543: result: $cf_cv_xopen_source" >&5
14544 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14545
14546 if test "$cf_cv_xopen_source" != no ; then
14547
14548 CFLAGS=`echo "$CFLAGS" | \
14549         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14550                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14551
14552 CPPFLAGS=`echo "$CPPFLAGS" | \
14553         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14554                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14555
14556         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14557
14558 for cf_add_cflags in $cf_temp_xopen_source
14559 do
14560         case "x$cf_add_cflags" in
14561         (x-[DU]*)
14562
14563 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14564 while true
14565 do
14566         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'`
14567         test "$CFLAGS" != "$cf_old_cflag" || break
14568
14569         CFLAGS="$cf_old_cflag"
14570 done
14571
14572 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14573 while true
14574 do
14575         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'`
14576         test "$CPPFLAGS" != "$cf_old_cflag" || break
14577
14578         CPPFLAGS="$cf_old_cflag"
14579 done
14580
14581                 ;;
14582         esac
14583
14584 cf_fix_cppflags=no
14585 cf_new_cflags=
14586 cf_new_cppflags=
14587 cf_new_extra_cppflags=
14588
14589 for cf_add_cflags in $cf_add_cflags
14590 do
14591 case "$cf_fix_cppflags" in
14592 (no)
14593         case "$cf_add_cflags" in
14594         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14595                 case "$cf_add_cflags" in
14596                 (-D*)
14597                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14598
14599                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14600                                 && test -z "${cf_tst_cflags}" \
14601                                 && cf_fix_cppflags=yes
14602
14603                         if test "$cf_fix_cppflags" = yes ; then
14604
14605         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14606         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14607
14608                                 continue
14609                         elif test "${cf_tst_cflags}" = "\"'" ; then
14610
14611         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14612         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14613
14614                                 continue
14615                         fi
14616                         ;;
14617                 esac
14618                 case "$CPPFLAGS" in
14619                 (*$cf_add_cflags)
14620                         ;;
14621                 (*)
14622                         case "$cf_add_cflags" in
14623                         (-D*)
14624                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14625
14626 CPPFLAGS=`echo "$CPPFLAGS" | \
14627         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14628                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14629
14630                                 ;;
14631                         esac
14632
14633         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14634         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14635
14636                         ;;
14637                 esac
14638                 ;;
14639         (*)
14640
14641         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14642         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14643
14644                 ;;
14645         esac
14646         ;;
14647 (yes)
14648
14649         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14650         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14651
14652         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14653
14654         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14655                 && test -z "${cf_tst_cflags}" \
14656                 && cf_fix_cppflags=no
14657         ;;
14658 esac
14659 done
14660
14661 if test -n "$cf_new_cflags" ; then
14662
14663         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14664         CFLAGS="${CFLAGS}$cf_new_cflags"
14665
14666 fi
14667
14668 if test -n "$cf_new_cppflags" ; then
14669
14670         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14671         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14672
14673 fi
14674
14675 if test -n "$cf_new_extra_cppflags" ; then
14676
14677         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14678         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14679
14680 fi
14681
14682 done
14683
14684 fi
14685
14686         fi
14687 fi
14688 fi # cf_cv_posix_visible
14689
14690 echo "$as_me:14690: checking for ANSI C header files" >&5
14691 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14692 if test "${ac_cv_header_stdc+set}" = set; then
14693   echo $ECHO_N "(cached) $ECHO_C" >&6
14694 else
14695   cat >"conftest.$ac_ext" <<_ACEOF
14696 #line 14696 "configure"
14697 #include "confdefs.h"
14698 #include <stdlib.h>
14699 #include <stdarg.h>
14700 #include <string.h>
14701 #include <float.h>
14702
14703 _ACEOF
14704 if { (eval echo "$as_me:14704: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14705   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14706   ac_status=$?
14707   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14708   rm -f conftest.er1
14709   cat conftest.err >&5
14710   echo "$as_me:14710: \$? = $ac_status" >&5
14711   (exit "$ac_status"); } >/dev/null; then
14712   if test -s conftest.err; then
14713     ac_cpp_err=$ac_c_preproc_warn_flag
14714   else
14715     ac_cpp_err=
14716   fi
14717 else
14718   ac_cpp_err=yes
14719 fi
14720 if test -z "$ac_cpp_err"; then
14721   ac_cv_header_stdc=yes
14722 else
14723   echo "$as_me: failed program was:" >&5
14724   cat "conftest.$ac_ext" >&5
14725   ac_cv_header_stdc=no
14726 fi
14727 rm -f conftest.err "conftest.$ac_ext"
14728
14729 if test $ac_cv_header_stdc = yes; then
14730   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14731   cat >"conftest.$ac_ext" <<_ACEOF
14732 #line 14732 "configure"
14733 #include "confdefs.h"
14734 #include <string.h>
14735
14736 _ACEOF
14737 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14738   $EGREP "memchr" >/dev/null 2>&1; then
14739   :
14740 else
14741   ac_cv_header_stdc=no
14742 fi
14743 rm -rf conftest*
14744
14745 fi
14746
14747 if test $ac_cv_header_stdc = yes; then
14748   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14749   cat >"conftest.$ac_ext" <<_ACEOF
14750 #line 14750 "configure"
14751 #include "confdefs.h"
14752 #include <stdlib.h>
14753
14754 _ACEOF
14755 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14756   $EGREP "free" >/dev/null 2>&1; then
14757   :
14758 else
14759   ac_cv_header_stdc=no
14760 fi
14761 rm -rf conftest*
14762
14763 fi
14764
14765 if test $ac_cv_header_stdc = yes; then
14766   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14767   if test "$cross_compiling" = yes; then
14768   :
14769 else
14770   cat >"conftest.$ac_ext" <<_ACEOF
14771 #line 14771 "configure"
14772 #include "confdefs.h"
14773 #include <ctype.h>
14774 #if ((' ' & 0x0FF) == 0x020)
14775 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14776 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14777 #else
14778 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14779                      || ('j' <= (c) && (c) <= 'r') \
14780                      || ('s' <= (c) && (c) <= 'z'))
14781 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14782 #endif
14783
14784 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14785 int
14786 main (void)
14787 {
14788   int i;
14789   for (i = 0; i < 256; i++)
14790     if (XOR (islower (i), ISLOWER (i))
14791         || toupper (i) != TOUPPER (i))
14792       $ac_main_return(2);
14793   $ac_main_return (0);
14794 }
14795 _ACEOF
14796 rm -f "conftest$ac_exeext"
14797 if { (eval echo "$as_me:14797: \"$ac_link\"") >&5
14798   (eval $ac_link) 2>&5
14799   ac_status=$?
14800   echo "$as_me:14800: \$? = $ac_status" >&5
14801   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
14802   { (eval echo "$as_me:14802: \"$ac_try\"") >&5
14803   (eval $ac_try) 2>&5
14804   ac_status=$?
14805   echo "$as_me:14805: \$? = $ac_status" >&5
14806   (exit "$ac_status"); }; }; then
14807   :
14808 else
14809   echo "$as_me: program exited with status $ac_status" >&5
14810 echo "$as_me: failed program was:" >&5
14811 cat "conftest.$ac_ext" >&5
14812 ac_cv_header_stdc=no
14813 fi
14814 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
14815 fi
14816 fi
14817 fi
14818 echo "$as_me:14818: result: $ac_cv_header_stdc" >&5
14819 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14820 if test $ac_cv_header_stdc = yes; then
14821
14822 cat >>confdefs.h <<\EOF
14823 #define STDC_HEADERS 1
14824 EOF
14825
14826 fi
14827
14828 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14829
14830 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14831                   inttypes.h stdint.h unistd.h
14832 do
14833 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14834 echo "$as_me:14834: checking for $ac_header" >&5
14835 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14836 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14837   echo $ECHO_N "(cached) $ECHO_C" >&6
14838 else
14839   cat >"conftest.$ac_ext" <<_ACEOF
14840 #line 14840 "configure"
14841 #include "confdefs.h"
14842 $ac_includes_default
14843 #include <$ac_header>
14844 _ACEOF
14845 rm -f "conftest.$ac_objext"
14846 if { (eval echo "$as_me:14846: \"$ac_compile\"") >&5
14847   (eval $ac_compile) 2>&5
14848   ac_status=$?
14849   echo "$as_me:14849: \$? = $ac_status" >&5
14850   (exit "$ac_status"); } &&
14851          { ac_try='test -s "conftest.$ac_objext"'
14852   { (eval echo "$as_me:14852: \"$ac_try\"") >&5
14853   (eval $ac_try) 2>&5
14854   ac_status=$?
14855   echo "$as_me:14855: \$? = $ac_status" >&5
14856   (exit "$ac_status"); }; }; then
14857   eval "$as_ac_Header=yes"
14858 else
14859   echo "$as_me: failed program was:" >&5
14860 cat "conftest.$ac_ext" >&5
14861 eval "$as_ac_Header=no"
14862 fi
14863 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14864 fi
14865 echo "$as_me:14865: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
14866 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
14867 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
14868   cat >>confdefs.h <<EOF
14869 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14870 EOF
14871
14872 fi
14873 done
14874
14875 echo "$as_me:14875: checking whether exit is declared" >&5
14876 echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6
14877 if test "${ac_cv_have_decl_exit+set}" = set; then
14878   echo $ECHO_N "(cached) $ECHO_C" >&6
14879 else
14880   cat >"conftest.$ac_ext" <<_ACEOF
14881 #line 14881 "configure"
14882 #include "confdefs.h"
14883 $ac_includes_default
14884 int
14885 main (void)
14886 {
14887 #ifndef exit
14888   (void) exit;
14889 #endif
14890
14891   ;
14892   return 0;
14893 }
14894 _ACEOF
14895 rm -f "conftest.$ac_objext"
14896 if { (eval echo "$as_me:14896: \"$ac_compile\"") >&5
14897   (eval $ac_compile) 2>&5
14898   ac_status=$?
14899   echo "$as_me:14899: \$? = $ac_status" >&5
14900   (exit "$ac_status"); } &&
14901          { ac_try='test -s "conftest.$ac_objext"'
14902   { (eval echo "$as_me:14902: \"$ac_try\"") >&5
14903   (eval $ac_try) 2>&5
14904   ac_status=$?
14905   echo "$as_me:14905: \$? = $ac_status" >&5
14906   (exit "$ac_status"); }; }; then
14907   ac_cv_have_decl_exit=yes
14908 else
14909   echo "$as_me: failed program was:" >&5
14910 cat "conftest.$ac_ext" >&5
14911 ac_cv_have_decl_exit=no
14912 fi
14913 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14914 fi
14915 echo "$as_me:14915: result: $ac_cv_have_decl_exit" >&5
14916 echo "${ECHO_T}$ac_cv_have_decl_exit" >&6
14917
14918 # Check whether --enable-largefile or --disable-largefile was given.
14919 if test "${enable_largefile+set}" = set; then
14920   enableval="$enable_largefile"
14921
14922 fi;
14923 if test "$enable_largefile" != no; then
14924
14925   echo "$as_me:14925: checking for special C compiler options needed for large files" >&5
14926 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14927 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14928   echo $ECHO_N "(cached) $ECHO_C" >&6
14929 else
14930   ac_cv_sys_largefile_CC=no
14931      if test "$GCC" != yes; then
14932        ac_save_CC=$CC
14933        while :; do
14934          # IRIX 6.2 and later do not support large files by default,
14935          # so use the C compiler's -n32 option if that helps.
14936          cat >"conftest.$ac_ext" <<_ACEOF
14937 #line 14937 "configure"
14938 #include "confdefs.h"
14939 #include <sys/types.h>
14940  /* Check that off_t can represent 2**63 - 1 correctly.
14941     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14942     since some C++ compilers masquerading as C compilers
14943     incorrectly reject 9223372036854775807.  */
14944 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14945   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14946                        && LARGE_OFF_T % 2147483647 == 1)
14947                       ? 1 : -1];
14948 int
14949 main (void)
14950 {
14951
14952   ;
14953   return 0;
14954 }
14955 _ACEOF
14956          rm -f "conftest.$ac_objext"
14957 if { (eval echo "$as_me:14957: \"$ac_compile\"") >&5
14958   (eval $ac_compile) 2>&5
14959   ac_status=$?
14960   echo "$as_me:14960: \$? = $ac_status" >&5
14961   (exit "$ac_status"); } &&
14962          { ac_try='test -s "conftest.$ac_objext"'
14963   { (eval echo "$as_me:14963: \"$ac_try\"") >&5
14964   (eval $ac_try) 2>&5
14965   ac_status=$?
14966   echo "$as_me:14966: \$? = $ac_status" >&5
14967   (exit "$ac_status"); }; }; then
14968   break
14969 else
14970   echo "$as_me: failed program was:" >&5
14971 cat "conftest.$ac_ext" >&5
14972 fi
14973 rm -f "conftest.$ac_objext"
14974          CC="$CC -n32"
14975          rm -f "conftest.$ac_objext"
14976 if { (eval echo "$as_me:14976: \"$ac_compile\"") >&5
14977   (eval $ac_compile) 2>&5
14978   ac_status=$?
14979   echo "$as_me:14979: \$? = $ac_status" >&5
14980   (exit "$ac_status"); } &&
14981          { ac_try='test -s "conftest.$ac_objext"'
14982   { (eval echo "$as_me:14982: \"$ac_try\"") >&5
14983   (eval $ac_try) 2>&5
14984   ac_status=$?
14985   echo "$as_me:14985: \$? = $ac_status" >&5
14986   (exit "$ac_status"); }; }; then
14987   ac_cv_sys_largefile_CC=' -n32'; break
14988 else
14989   echo "$as_me: failed program was:" >&5
14990 cat "conftest.$ac_ext" >&5
14991 fi
14992 rm -f "conftest.$ac_objext"
14993          break
14994        done
14995        CC=$ac_save_CC
14996        rm -f "conftest.$ac_ext"
14997     fi
14998 fi
14999 echo "$as_me:14999: result: $ac_cv_sys_largefile_CC" >&5
15000 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
15001   if test "$ac_cv_sys_largefile_CC" != no; then
15002     CC=$CC$ac_cv_sys_largefile_CC
15003   fi
15004
15005   echo "$as_me:15005: checking for _FILE_OFFSET_BITS value needed for large files" >&5
15006 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
15007 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
15008   echo $ECHO_N "(cached) $ECHO_C" >&6
15009 else
15010   while :; do
15011   ac_cv_sys_file_offset_bits=no
15012   cat >"conftest.$ac_ext" <<_ACEOF
15013 #line 15013 "configure"
15014 #include "confdefs.h"
15015 #include <sys/types.h>
15016  /* Check that off_t can represent 2**63 - 1 correctly.
15017     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15018     since some C++ compilers masquerading as C compilers
15019     incorrectly reject 9223372036854775807.  */
15020 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15021   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15022                        && LARGE_OFF_T % 2147483647 == 1)
15023                       ? 1 : -1];
15024 int
15025 main (void)
15026 {
15027
15028   ;
15029   return 0;
15030 }
15031 _ACEOF
15032 rm -f "conftest.$ac_objext"
15033 if { (eval echo "$as_me:15033: \"$ac_compile\"") >&5
15034   (eval $ac_compile) 2>&5
15035   ac_status=$?
15036   echo "$as_me:15036: \$? = $ac_status" >&5
15037   (exit "$ac_status"); } &&
15038          { ac_try='test -s "conftest.$ac_objext"'
15039   { (eval echo "$as_me:15039: \"$ac_try\"") >&5
15040   (eval $ac_try) 2>&5
15041   ac_status=$?
15042   echo "$as_me:15042: \$? = $ac_status" >&5
15043   (exit "$ac_status"); }; }; then
15044   break
15045 else
15046   echo "$as_me: failed program was:" >&5
15047 cat "conftest.$ac_ext" >&5
15048 fi
15049 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15050   cat >"conftest.$ac_ext" <<_ACEOF
15051 #line 15051 "configure"
15052 #include "confdefs.h"
15053 #define _FILE_OFFSET_BITS 64
15054 #include <sys/types.h>
15055  /* Check that off_t can represent 2**63 - 1 correctly.
15056     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15057     since some C++ compilers masquerading as C compilers
15058     incorrectly reject 9223372036854775807.  */
15059 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15060   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15061                        && LARGE_OFF_T % 2147483647 == 1)
15062                       ? 1 : -1];
15063 int
15064 main (void)
15065 {
15066
15067   ;
15068   return 0;
15069 }
15070 _ACEOF
15071 rm -f "conftest.$ac_objext"
15072 if { (eval echo "$as_me:15072: \"$ac_compile\"") >&5
15073   (eval $ac_compile) 2>&5
15074   ac_status=$?
15075   echo "$as_me:15075: \$? = $ac_status" >&5
15076   (exit "$ac_status"); } &&
15077          { ac_try='test -s "conftest.$ac_objext"'
15078   { (eval echo "$as_me:15078: \"$ac_try\"") >&5
15079   (eval $ac_try) 2>&5
15080   ac_status=$?
15081   echo "$as_me:15081: \$? = $ac_status" >&5
15082   (exit "$ac_status"); }; }; then
15083   ac_cv_sys_file_offset_bits=64; break
15084 else
15085   echo "$as_me: failed program was:" >&5
15086 cat "conftest.$ac_ext" >&5
15087 fi
15088 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15089   break
15090 done
15091 fi
15092 echo "$as_me:15092: result: $ac_cv_sys_file_offset_bits" >&5
15093 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
15094 if test "$ac_cv_sys_file_offset_bits" != no; then
15095
15096 cat >>confdefs.h <<EOF
15097 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
15098 EOF
15099
15100 fi
15101 rm -rf conftest*
15102   echo "$as_me:15102: checking for _LARGE_FILES value needed for large files" >&5
15103 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
15104 if test "${ac_cv_sys_large_files+set}" = set; then
15105   echo $ECHO_N "(cached) $ECHO_C" >&6
15106 else
15107   while :; do
15108   ac_cv_sys_large_files=no
15109   cat >"conftest.$ac_ext" <<_ACEOF
15110 #line 15110 "configure"
15111 #include "confdefs.h"
15112 #include <sys/types.h>
15113  /* Check that off_t can represent 2**63 - 1 correctly.
15114     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15115     since some C++ compilers masquerading as C compilers
15116     incorrectly reject 9223372036854775807.  */
15117 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15118   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15119                        && LARGE_OFF_T % 2147483647 == 1)
15120                       ? 1 : -1];
15121 int
15122 main (void)
15123 {
15124
15125   ;
15126   return 0;
15127 }
15128 _ACEOF
15129 rm -f "conftest.$ac_objext"
15130 if { (eval echo "$as_me:15130: \"$ac_compile\"") >&5
15131   (eval $ac_compile) 2>&5
15132   ac_status=$?
15133   echo "$as_me:15133: \$? = $ac_status" >&5
15134   (exit "$ac_status"); } &&
15135          { ac_try='test -s "conftest.$ac_objext"'
15136   { (eval echo "$as_me:15136: \"$ac_try\"") >&5
15137   (eval $ac_try) 2>&5
15138   ac_status=$?
15139   echo "$as_me:15139: \$? = $ac_status" >&5
15140   (exit "$ac_status"); }; }; then
15141   break
15142 else
15143   echo "$as_me: failed program was:" >&5
15144 cat "conftest.$ac_ext" >&5
15145 fi
15146 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15147   cat >"conftest.$ac_ext" <<_ACEOF
15148 #line 15148 "configure"
15149 #include "confdefs.h"
15150 #define _LARGE_FILES 1
15151 #include <sys/types.h>
15152  /* Check that off_t can represent 2**63 - 1 correctly.
15153     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15154     since some C++ compilers masquerading as C compilers
15155     incorrectly reject 9223372036854775807.  */
15156 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15157   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15158                        && LARGE_OFF_T % 2147483647 == 1)
15159                       ? 1 : -1];
15160 int
15161 main (void)
15162 {
15163
15164   ;
15165   return 0;
15166 }
15167 _ACEOF
15168 rm -f "conftest.$ac_objext"
15169 if { (eval echo "$as_me:15169: \"$ac_compile\"") >&5
15170   (eval $ac_compile) 2>&5
15171   ac_status=$?
15172   echo "$as_me:15172: \$? = $ac_status" >&5
15173   (exit "$ac_status"); } &&
15174          { ac_try='test -s "conftest.$ac_objext"'
15175   { (eval echo "$as_me:15175: \"$ac_try\"") >&5
15176   (eval $ac_try) 2>&5
15177   ac_status=$?
15178   echo "$as_me:15178: \$? = $ac_status" >&5
15179   (exit "$ac_status"); }; }; then
15180   ac_cv_sys_large_files=1; break
15181 else
15182   echo "$as_me: failed program was:" >&5
15183 cat "conftest.$ac_ext" >&5
15184 fi
15185 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15186   break
15187 done
15188 fi
15189 echo "$as_me:15189: result: $ac_cv_sys_large_files" >&5
15190 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
15191 if test "$ac_cv_sys_large_files" != no; then
15192
15193 cat >>confdefs.h <<EOF
15194 #define _LARGE_FILES $ac_cv_sys_large_files
15195 EOF
15196
15197 fi
15198 rm -rf conftest*
15199 fi
15200
15201         if test "$enable_largefile" != no ; then
15202         echo "$as_me:15202: checking for _LARGEFILE_SOURCE value needed for large files" >&5
15203 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
15204 if test "${ac_cv_sys_largefile_source+set}" = set; then
15205   echo $ECHO_N "(cached) $ECHO_C" >&6
15206 else
15207   while :; do
15208   ac_cv_sys_largefile_source=no
15209   cat >"conftest.$ac_ext" <<_ACEOF
15210 #line 15210 "configure"
15211 #include "confdefs.h"
15212 #include <stdio.h>
15213     #include <sys/types.h>
15214 int
15215 main (void)
15216 {
15217
15218     int (*my_fseeko)(FILE *, off_t, int) = fseeko;
15219     return my_fseeko(stdin, 0, 0);
15220   ;
15221   return 0;
15222 }
15223 _ACEOF
15224 rm -f "conftest.$ac_objext"
15225 if { (eval echo "$as_me:15225: \"$ac_compile\"") >&5
15226   (eval $ac_compile) 2>&5
15227   ac_status=$?
15228   echo "$as_me:15228: \$? = $ac_status" >&5
15229   (exit "$ac_status"); } &&
15230          { ac_try='test -s "conftest.$ac_objext"'
15231   { (eval echo "$as_me:15231: \"$ac_try\"") >&5
15232   (eval $ac_try) 2>&5
15233   ac_status=$?
15234   echo "$as_me:15234: \$? = $ac_status" >&5
15235   (exit "$ac_status"); }; }; then
15236   break
15237 else
15238   echo "$as_me: failed program was:" >&5
15239 cat "conftest.$ac_ext" >&5
15240 fi
15241 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15242   cat >"conftest.$ac_ext" <<_ACEOF
15243 #line 15243 "configure"
15244 #include "confdefs.h"
15245 #define _LARGEFILE_SOURCE 1
15246 #include <stdio.h>
15247     #include <sys/types.h>
15248 int
15249 main (void)
15250 {
15251
15252     int (*my_fseeko)(FILE *, off_t, int) = fseeko;
15253     return my_fseeko(stdin, 0, 0);
15254   ;
15255   return 0;
15256 }
15257 _ACEOF
15258 rm -f "conftest.$ac_objext"
15259 if { (eval echo "$as_me:15259: \"$ac_compile\"") >&5
15260   (eval $ac_compile) 2>&5
15261   ac_status=$?
15262   echo "$as_me:15262: \$? = $ac_status" >&5
15263   (exit "$ac_status"); } &&
15264          { ac_try='test -s "conftest.$ac_objext"'
15265   { (eval echo "$as_me:15265: \"$ac_try\"") >&5
15266   (eval $ac_try) 2>&5
15267   ac_status=$?
15268   echo "$as_me:15268: \$? = $ac_status" >&5
15269   (exit "$ac_status"); }; }; then
15270   ac_cv_sys_largefile_source=1; break
15271 else
15272   echo "$as_me: failed program was:" >&5
15273 cat "conftest.$ac_ext" >&5
15274 fi
15275 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15276   break
15277 done
15278 fi
15279 echo "$as_me:15279: result: $ac_cv_sys_largefile_source" >&5
15280 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
15281 if test "$ac_cv_sys_largefile_source" != no; then
15282
15283 cat >>confdefs.h <<EOF
15284 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
15285 EOF
15286
15287 fi
15288 rm -rf conftest*
15289
15290 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
15291 # in glibc 2.1.3, but that breaks too many other things.
15292 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
15293 echo "$as_me:15293: checking for fseeko" >&5
15294 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
15295 if test "${ac_cv_func_fseeko+set}" = set; then
15296   echo $ECHO_N "(cached) $ECHO_C" >&6
15297 else
15298   cat >"conftest.$ac_ext" <<_ACEOF
15299 #line 15299 "configure"
15300 #include "confdefs.h"
15301 #include <stdio.h>
15302                              #include <sys/types.h>
15303 int
15304 main (void)
15305 {
15306 int (*my_fseeko)(FILE *, off_t, int) = fseeko;
15307                             return my_fseeko && my_fseeko (stdin, 0, 0);
15308   ;
15309   return 0;
15310 }
15311 _ACEOF
15312 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15313 if { (eval echo "$as_me:15313: \"$ac_link\"") >&5
15314   (eval $ac_link) 2>&5
15315   ac_status=$?
15316   echo "$as_me:15316: \$? = $ac_status" >&5
15317   (exit "$ac_status"); } &&
15318          { ac_try='test -s "conftest$ac_exeext"'
15319   { (eval echo "$as_me:15319: \"$ac_try\"") >&5
15320   (eval $ac_try) 2>&5
15321   ac_status=$?
15322   echo "$as_me:15322: \$? = $ac_status" >&5
15323   (exit "$ac_status"); }; }; then
15324   ac_cv_func_fseeko=yes
15325 else
15326   echo "$as_me: failed program was:" >&5
15327 cat "conftest.$ac_ext" >&5
15328 ac_cv_func_fseeko=no
15329 fi
15330 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15331 fi
15332 echo "$as_me:15332: result: $ac_cv_func_fseeko" >&5
15333 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
15334 if test $ac_cv_func_fseeko = yes; then
15335
15336 cat >>confdefs.h <<\EOF
15337 #define HAVE_FSEEKO 1
15338 EOF
15339
15340 fi
15341
15342         # Normally we would collect these definitions in the config.h,
15343         # but (like _XOPEN_SOURCE), some environments rely on having these
15344         # defined before any of the system headers are included.  Another
15345         # case comes up with C++, e.g., on AIX the compiler compiles the
15346         # header files by themselves before looking at the body files it is
15347         # told to compile.  For ncurses, those header files do not include
15348         # the config.h
15349         if test "$ac_cv_sys_large_files" != no
15350         then
15351
15352         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15353         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
15354
15355         fi
15356         if test "$ac_cv_sys_largefile_source" != no
15357         then
15358
15359         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15360         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
15361
15362         fi
15363         if test "$ac_cv_sys_file_offset_bits" != no
15364         then
15365
15366         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15367         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
15368
15369         fi
15370
15371         echo "$as_me:15371: checking whether to use struct dirent64" >&5
15372 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
15373 if test "${cf_cv_struct_dirent64+set}" = set; then
15374   echo $ECHO_N "(cached) $ECHO_C" >&6
15375 else
15376
15377                 cat >"conftest.$ac_ext" <<_ACEOF
15378 #line 15378 "configure"
15379 #include "confdefs.h"
15380
15381 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
15382 #include <sys/types.h>
15383 #include <dirent.h>
15384
15385 #ifndef __REDIRECT
15386 /* if transitional largefile support is setup, this is true */
15387 extern struct dirent64 * readdir(DIR *);
15388 #endif
15389
15390 int
15391 main (void)
15392 {
15393
15394                 DIR *dp = opendir(".");
15395                 struct dirent64 *x = readdir(dp);
15396                 struct dirent *y = readdir(dp);
15397                 int z = x - y;
15398                 (void)z;
15399
15400   ;
15401   return 0;
15402 }
15403 _ACEOF
15404 rm -f "conftest.$ac_objext"
15405 if { (eval echo "$as_me:15405: \"$ac_compile\"") >&5
15406   (eval $ac_compile) 2>&5
15407   ac_status=$?
15408   echo "$as_me:15408: \$? = $ac_status" >&5
15409   (exit "$ac_status"); } &&
15410          { ac_try='test -s "conftest.$ac_objext"'
15411   { (eval echo "$as_me:15411: \"$ac_try\"") >&5
15412   (eval $ac_try) 2>&5
15413   ac_status=$?
15414   echo "$as_me:15414: \$? = $ac_status" >&5
15415   (exit "$ac_status"); }; }; then
15416   cf_cv_struct_dirent64=yes
15417 else
15418   echo "$as_me: failed program was:" >&5
15419 cat "conftest.$ac_ext" >&5
15420 cf_cv_struct_dirent64=no
15421 fi
15422 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15423
15424 fi
15425 echo "$as_me:15425: result: $cf_cv_struct_dirent64" >&5
15426 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
15427         test "$cf_cv_struct_dirent64" = yes &&
15428 cat >>confdefs.h <<\EOF
15429 #define HAVE_STRUCT_DIRENT64 1
15430 EOF
15431
15432         fi
15433
15434 ### Enable compiling-in rcs id's
15435 echo "$as_me:15435: checking if RCS identifiers should be compiled-in" >&5
15436 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
15437
15438 # Check whether --with-rcs-ids or --without-rcs-ids was given.
15439 if test "${with_rcs_ids+set}" = set; then
15440   withval="$with_rcs_ids"
15441   with_rcs_ids=$withval
15442 else
15443   with_rcs_ids=no
15444 fi;
15445 echo "$as_me:15445: result: $with_rcs_ids" >&5
15446 echo "${ECHO_T}$with_rcs_ids" >&6
15447 test "$with_rcs_ids" = yes &&
15448 cat >>confdefs.h <<\EOF
15449 #define USE_RCS_IDS 1
15450 EOF
15451
15452 ###############################################################################
15453
15454 ### Note that some functions (such as const) are normally disabled anyway.
15455 echo "$as_me:15455: checking if you want to build with function extensions" >&5
15456 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
15457
15458 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
15459 if test "${enable_ext_funcs+set}" = set; then
15460   enableval="$enable_ext_funcs"
15461   with_ext_funcs=$enableval
15462 else
15463   with_ext_funcs=yes
15464 fi;
15465 echo "$as_me:15465: result: $with_ext_funcs" >&5
15466 echo "${ECHO_T}$with_ext_funcs" >&6
15467 if test "$with_ext_funcs" = yes ; then
15468         NCURSES_EXT_FUNCS=1
15469
15470 cat >>confdefs.h <<\EOF
15471 #define HAVE_USE_DEFAULT_COLORS 1
15472 EOF
15473
15474 cat >>confdefs.h <<\EOF
15475 #define NCURSES_EXT_FUNCS 1
15476 EOF
15477
15478 else
15479         NCURSES_EXT_FUNCS=0
15480 fi
15481
15482 ###   use option --enable-const to turn on use of const beyond that in XSI.
15483 echo "$as_me:15483: checking for extended use of const keyword" >&5
15484 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
15485
15486 # Check whether --enable-const or --disable-const was given.
15487 if test "${enable_const+set}" = set; then
15488   enableval="$enable_const"
15489   with_ext_const=$enableval
15490 else
15491   with_ext_const=no
15492 fi;
15493 echo "$as_me:15493: result: $with_ext_const" >&5
15494 echo "${ECHO_T}$with_ext_const" >&6
15495 NCURSES_CONST='/*nothing*/'
15496 if test "$with_ext_const" = yes ; then
15497         NCURSES_CONST=const
15498 fi
15499
15500 ###############################################################################
15501 # These options are relatively safe to experiment with.
15502
15503 echo "$as_me:15503: checking if you want all development code" >&5
15504 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
15505
15506 # Check whether --with-develop or --without-develop was given.
15507 if test "${with_develop+set}" = set; then
15508   withval="$with_develop"
15509   with_develop=$withval
15510 else
15511   with_develop=no
15512 fi;
15513 echo "$as_me:15513: result: $with_develop" >&5
15514 echo "${ECHO_T}$with_develop" >&6
15515
15516 ###############################################################################
15517 # These are just experimental, probably should not be in a package:
15518
15519 # This is still experimental (20080329), but should ultimately be moved to
15520 # the script-block --with-normal, etc.
15521
15522 echo "$as_me:15522: checking if you want to link with the pthread library" >&5
15523 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
15524
15525 # Check whether --with-pthread or --without-pthread was given.
15526 if test "${with_pthread+set}" = set; then
15527   withval="$with_pthread"
15528   with_pthread=$withval
15529 else
15530   with_pthread=no
15531 fi;
15532 echo "$as_me:15532: result: $with_pthread" >&5
15533 echo "${ECHO_T}$with_pthread" >&6
15534
15535 if test "$with_pthread" != no ; then
15536         echo "$as_me:15536: checking for pthread.h" >&5
15537 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
15538 if test "${ac_cv_header_pthread_h+set}" = set; then
15539   echo $ECHO_N "(cached) $ECHO_C" >&6
15540 else
15541   cat >"conftest.$ac_ext" <<_ACEOF
15542 #line 15542 "configure"
15543 #include "confdefs.h"
15544 #include <pthread.h>
15545 _ACEOF
15546 if { (eval echo "$as_me:15546: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15547   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15548   ac_status=$?
15549   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15550   rm -f conftest.er1
15551   cat conftest.err >&5
15552   echo "$as_me:15552: \$? = $ac_status" >&5
15553   (exit "$ac_status"); } >/dev/null; then
15554   if test -s conftest.err; then
15555     ac_cpp_err=$ac_c_preproc_warn_flag
15556   else
15557     ac_cpp_err=
15558   fi
15559 else
15560   ac_cpp_err=yes
15561 fi
15562 if test -z "$ac_cpp_err"; then
15563   ac_cv_header_pthread_h=yes
15564 else
15565   echo "$as_me: failed program was:" >&5
15566   cat "conftest.$ac_ext" >&5
15567   ac_cv_header_pthread_h=no
15568 fi
15569 rm -f conftest.err "conftest.$ac_ext"
15570 fi
15571 echo "$as_me:15571: result: $ac_cv_header_pthread_h" >&5
15572 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
15573 if test "$ac_cv_header_pthread_h" = yes; then
15574
15575 cat >>confdefs.h <<\EOF
15576 #define HAVE_PTHREADS_H 1
15577 EOF
15578
15579         for cf_lib_pthread in pthread c_r
15580         do
15581             echo "$as_me:15581: checking if we can link with the $cf_lib_pthread library" >&5
15582 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
15583             cf_save_LIBS="$LIBS"
15584
15585 cf_add_libs="$LIBS"
15586 # reverse order
15587 cf_add_0lib=
15588 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15589 # filter duplicates
15590 for cf_add_1lib in $cf_add_0lib; do
15591         for cf_add_2lib in $cf_add_libs; do
15592                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15593                         cf_add_1lib=
15594                         break
15595                 fi
15596         done
15597         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15598 done
15599 LIBS="$cf_add_libs"
15600
15601             cat >"conftest.$ac_ext" <<_ACEOF
15602 #line 15602 "configure"
15603 #include "confdefs.h"
15604
15605 #include <pthread.h>
15606
15607 int
15608 main (void)
15609 {
15610
15611                 int rc = pthread_create(0,0,0,0);
15612                 int r2 = pthread_mutexattr_settype(0, 0);
15613
15614   ;
15615   return 0;
15616 }
15617 _ACEOF
15618 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15619 if { (eval echo "$as_me:15619: \"$ac_link\"") >&5
15620   (eval $ac_link) 2>&5
15621   ac_status=$?
15622   echo "$as_me:15622: \$? = $ac_status" >&5
15623   (exit "$ac_status"); } &&
15624          { ac_try='test -s "conftest$ac_exeext"'
15625   { (eval echo "$as_me:15625: \"$ac_try\"") >&5
15626   (eval $ac_try) 2>&5
15627   ac_status=$?
15628   echo "$as_me:15628: \$? = $ac_status" >&5
15629   (exit "$ac_status"); }; }; then
15630   with_pthread=yes
15631 else
15632   echo "$as_me: failed program was:" >&5
15633 cat "conftest.$ac_ext" >&5
15634 with_pthread=no
15635 fi
15636 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15637             LIBS="$cf_save_LIBS"
15638             echo "$as_me:15638: result: $with_pthread" >&5
15639 echo "${ECHO_T}$with_pthread" >&6
15640             test "$with_pthread" = yes && break
15641         done
15642
15643         if test "$with_pthread" = yes ; then
15644
15645 cf_add_libs="$LIBS"
15646 # reverse order
15647 cf_add_0lib=
15648 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15649 # filter duplicates
15650 for cf_add_1lib in $cf_add_0lib; do
15651         for cf_add_2lib in $cf_add_libs; do
15652                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15653                         cf_add_1lib=
15654                         break
15655                 fi
15656         done
15657         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15658 done
15659 LIBS="$cf_add_libs"
15660
15661 cat >>confdefs.h <<\EOF
15662 #define HAVE_LIBPTHREADS 1
15663 EOF
15664
15665         else
15666             { { echo "$as_me:15666: error: Cannot link with pthread library" >&5
15667 echo "$as_me: error: Cannot link with pthread library" >&2;}
15668    { (exit 1); exit 1; }; }
15669         fi
15670
15671 fi
15672
15673 fi
15674
15675 echo "$as_me:15675: checking if you want to use weak-symbols for pthreads" >&5
15676 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15677
15678 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15679 if test "${enable_weak_symbols+set}" = set; then
15680   enableval="$enable_weak_symbols"
15681   use_weak_symbols=$withval
15682 else
15683   use_weak_symbols=no
15684 fi;
15685 echo "$as_me:15685: result: $use_weak_symbols" >&5
15686 echo "${ECHO_T}$use_weak_symbols" >&6
15687 if test "$use_weak_symbols" = yes ; then
15688
15689 echo "$as_me:15689: checking if $CC supports weak symbols" >&5
15690 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15691 if test "${cf_cv_weak_symbols+set}" = set; then
15692   echo $ECHO_N "(cached) $ECHO_C" >&6
15693 else
15694
15695 cat >"conftest.$ac_ext" <<_ACEOF
15696 #line 15696 "configure"
15697 #include "confdefs.h"
15698
15699 #include <stdio.h>
15700 int
15701 main (void)
15702 {
15703
15704 #if defined(__GNUC__)
15705 #  if defined __USE_ISOC99
15706 #    define _cat_pragma(exp)    _Pragma(#exp)
15707 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15708 #  else
15709 #    define _weak_pragma(exp)
15710 #  endif
15711 #  define _declare(name)        __extension__ extern __typeof__(name) name
15712 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15713 #endif
15714
15715 weak_symbol(fopen);
15716
15717   ;
15718   return 0;
15719 }
15720 _ACEOF
15721 rm -f "conftest.$ac_objext"
15722 if { (eval echo "$as_me:15722: \"$ac_compile\"") >&5
15723   (eval $ac_compile) 2>&5
15724   ac_status=$?
15725   echo "$as_me:15725: \$? = $ac_status" >&5
15726   (exit "$ac_status"); } &&
15727          { ac_try='test -s "conftest.$ac_objext"'
15728   { (eval echo "$as_me:15728: \"$ac_try\"") >&5
15729   (eval $ac_try) 2>&5
15730   ac_status=$?
15731   echo "$as_me:15731: \$? = $ac_status" >&5
15732   (exit "$ac_status"); }; }; then
15733   cf_cv_weak_symbols=yes
15734 else
15735   echo "$as_me: failed program was:" >&5
15736 cat "conftest.$ac_ext" >&5
15737 cf_cv_weak_symbols=no
15738 fi
15739 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15740
15741 fi
15742 echo "$as_me:15742: result: $cf_cv_weak_symbols" >&5
15743 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15744
15745 else
15746         cf_cv_weak_symbols=no
15747 fi
15748
15749 if test $cf_cv_weak_symbols = yes ; then
15750
15751 cat >>confdefs.h <<\EOF
15752 #define USE_WEAK_SYMBOLS 1
15753 EOF
15754
15755 fi
15756
15757 PTHREAD=
15758 if test "$with_pthread" = "yes" ; then
15759
15760 cat >>confdefs.h <<\EOF
15761 #define USE_PTHREADS 1
15762 EOF
15763
15764         enable_reentrant=yes
15765         if test $cf_cv_weak_symbols = yes ; then
15766                 PTHREAD=-lpthread
15767         fi
15768 fi
15769
15770 # OpenSUSE is installing ncurses6, using reentrant option.
15771 echo "$as_me:15771: checking for _nc_TABSIZE" >&5
15772 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15773 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15774   echo $ECHO_N "(cached) $ECHO_C" >&6
15775 else
15776   cat >"conftest.$ac_ext" <<_ACEOF
15777 #line 15777 "configure"
15778 #include "confdefs.h"
15779 #define _nc_TABSIZE autoconf_temporary
15780 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15781 #undef _nc_TABSIZE
15782
15783 #ifdef __cplusplus
15784 extern "C"
15785 #endif
15786
15787 /* We use char because int might match the return type of a gcc2
15788    builtin and then its argument prototype would still apply.  */
15789 char _nc_TABSIZE (void);
15790
15791 int
15792 main (void)
15793 {
15794
15795 /* The GNU C library defines stubs for functions which it implements
15796     to always fail with ENOSYS.  Some functions are actually named
15797     something starting with __ and the normal name is an alias.  */
15798 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15799 #error found stub for _nc_TABSIZE
15800 #endif
15801
15802         return _nc_TABSIZE ();
15803   ;
15804   return 0;
15805 }
15806 _ACEOF
15807 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15808 if { (eval echo "$as_me:15808: \"$ac_link\"") >&5
15809   (eval $ac_link) 2>&5
15810   ac_status=$?
15811   echo "$as_me:15811: \$? = $ac_status" >&5
15812   (exit "$ac_status"); } &&
15813          { ac_try='test -s "conftest$ac_exeext"'
15814   { (eval echo "$as_me:15814: \"$ac_try\"") >&5
15815   (eval $ac_try) 2>&5
15816   ac_status=$?
15817   echo "$as_me:15817: \$? = $ac_status" >&5
15818   (exit "$ac_status"); }; }; then
15819   ac_cv_func__nc_TABSIZE=yes
15820 else
15821   echo "$as_me: failed program was:" >&5
15822 cat "conftest.$ac_ext" >&5
15823 ac_cv_func__nc_TABSIZE=no
15824 fi
15825 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15826 fi
15827 echo "$as_me:15827: result: $ac_cv_func__nc_TABSIZE" >&5
15828 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15829 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15830   assume_reentrant=yes
15831 else
15832   assume_reentrant=no
15833 fi
15834
15835 # Reentrant code has to be opaque; there's little advantage to making ncurses
15836 # opaque outside of that, so there is no --enable-opaque option.  We can use
15837 # this option without --with-pthreads, but this will be always set for
15838 # pthreads.
15839 echo "$as_me:15839: checking if you want experimental reentrant code" >&5
15840 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15841
15842 # Check whether --enable-reentrant or --disable-reentrant was given.
15843 if test "${enable_reentrant+set}" = set; then
15844   enableval="$enable_reentrant"
15845   with_reentrant=$enableval
15846 else
15847   with_reentrant=$assume_reentrant
15848 fi;
15849 echo "$as_me:15849: result: $with_reentrant" >&5
15850 echo "${ECHO_T}$with_reentrant" >&6
15851 if test "$with_reentrant" = yes ; then
15852         cf_cv_enable_reentrant=1
15853         if test $cf_cv_weak_symbols = yes ; then
15854
15855 # remove pthread library from $LIBS
15856 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15857
15858         elif test "$assume_reentrant" = no ; then
15859                 LIB_SUFFIX="t${LIB_SUFFIX}"
15860         fi
15861
15862 cat >>confdefs.h <<\EOF
15863 #define USE_REENTRANT 1
15864 EOF
15865
15866 else
15867         cf_cv_enable_reentrant=0
15868 fi
15869
15870 ### Allow using a different wrap-prefix
15871 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15872         echo "$as_me:15872: checking for prefix used to wrap public variables" >&5
15873 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15874
15875 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15876 if test "${with_wrap_prefix+set}" = set; then
15877   withval="$with_wrap_prefix"
15878   NCURSES_WRAP_PREFIX=$withval
15879 else
15880   NCURSES_WRAP_PREFIX=_nc_
15881 fi;
15882         echo "$as_me:15882: result: $NCURSES_WRAP_PREFIX" >&5
15883 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15884 else
15885         NCURSES_WRAP_PREFIX=_nc_
15886 fi
15887
15888 cat >>confdefs.h <<EOF
15889 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15890 EOF
15891
15892 ###############################################################################
15893
15894 ###     use option --disable-echo to suppress full display compiling commands
15895
15896 echo "$as_me:15896: checking if you want to see long compiling messages" >&5
15897 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15898
15899 # Check whether --enable-echo or --disable-echo was given.
15900 if test "${enable_echo+set}" = set; then
15901   enableval="$enable_echo"
15902   test "$enableval" != no && enableval=yes
15903         if test "$enableval" != "yes" ; then
15904
15905         ECHO_LT='--silent'
15906         ECHO_LD='@echo linking $@;'
15907         RULE_CC='@echo compiling $<'
15908         SHOW_CC='@echo compiling $@'
15909         ECHO_CC='@'
15910
15911         else
15912
15913         ECHO_LT=''
15914         ECHO_LD=''
15915         RULE_CC=''
15916         SHOW_CC=''
15917         ECHO_CC=''
15918
15919         fi
15920 else
15921   enableval=yes
15922
15923         ECHO_LT=''
15924         ECHO_LD=''
15925         RULE_CC=''
15926         SHOW_CC=''
15927         ECHO_CC=''
15928
15929 fi;
15930 echo "$as_me:15930: result: $enableval" >&5
15931 echo "${ECHO_T}$enableval" >&6
15932
15933 echo "$as_me:15933: checking if you want to use C11 _Noreturn feature" >&5
15934 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15935
15936 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15937 if test "${enable_stdnoreturn+set}" = set; then
15938   enableval="$enable_stdnoreturn"
15939   test "$enableval" != yes && enableval=no
15940         if test "$enableval" != "no" ; then
15941     enable_stdnoreturn=yes
15942         else
15943                 enable_stdnoreturn=no
15944         fi
15945 else
15946   enableval=no
15947         enable_stdnoreturn=no
15948
15949 fi;
15950 echo "$as_me:15950: result: $enable_stdnoreturn" >&5
15951 echo "${ECHO_T}$enable_stdnoreturn" >&6
15952
15953 if test $enable_stdnoreturn = yes; then
15954 echo "$as_me:15954: checking for C11 _Noreturn feature" >&5
15955 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15956 if test "${cf_cv_c11_noreturn+set}" = set; then
15957   echo $ECHO_N "(cached) $ECHO_C" >&6
15958 else
15959   cat >"conftest.$ac_ext" <<_ACEOF
15960 #line 15960 "configure"
15961 #include "confdefs.h"
15962
15963 $ac_includes_default
15964 #include <stdnoreturn.h>
15965 static _Noreturn void giveup(void) { exit(0); }
15966
15967 int
15968 main (void)
15969 {
15970 if (feof(stdin)) giveup()
15971   ;
15972   return 0;
15973 }
15974 _ACEOF
15975 rm -f "conftest.$ac_objext"
15976 if { (eval echo "$as_me:15976: \"$ac_compile\"") >&5
15977   (eval $ac_compile) 2>&5
15978   ac_status=$?
15979   echo "$as_me:15979: \$? = $ac_status" >&5
15980   (exit "$ac_status"); } &&
15981          { ac_try='test -s "conftest.$ac_objext"'
15982   { (eval echo "$as_me:15982: \"$ac_try\"") >&5
15983   (eval $ac_try) 2>&5
15984   ac_status=$?
15985   echo "$as_me:15985: \$? = $ac_status" >&5
15986   (exit "$ac_status"); }; }; then
15987   cf_cv_c11_noreturn=yes
15988 else
15989   echo "$as_me: failed program was:" >&5
15990 cat "conftest.$ac_ext" >&5
15991 cf_cv_c11_noreturn=no
15992 fi
15993 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15994
15995 fi
15996 echo "$as_me:15996: result: $cf_cv_c11_noreturn" >&5
15997 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15998 else
15999         cf_cv_c11_noreturn=no,
16000 fi
16001
16002 if test "$cf_cv_c11_noreturn" = yes; then
16003
16004 cat >>confdefs.h <<\EOF
16005 #define HAVE_STDNORETURN_H 1
16006 EOF
16007
16008 cat >>confdefs.h <<EOF
16009 #define STDC_NORETURN _Noreturn
16010 EOF
16011
16012         HAVE_STDNORETURN_H=1
16013 else
16014         HAVE_STDNORETURN_H=0
16015 fi
16016
16017 if test "$GCC" = yes || test "$GXX" = yes
16018 then
16019
16020 if test "$GCC" = yes || test "$GXX" = yes
16021 then
16022         case $CFLAGS in
16023         (*-Werror=*)
16024                 cf_temp_flags=
16025                 for cf_temp_scan in $CFLAGS
16026                 do
16027                         case "x$cf_temp_scan" in
16028                         (x-Werror=format*)
16029
16030         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16031         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16032
16033                                 ;;
16034                         (x-Werror=*)
16035
16036         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
16037         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
16038
16039                                 ;;
16040                         (*)
16041
16042         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16043         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16044
16045                                 ;;
16046                         esac
16047                 done
16048                 if test "x$CFLAGS" != "x$cf_temp_flags"
16049                 then
16050                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
16051
16052 echo "${as_me:-configure}:16052: testing repairing CFLAGS: $CFLAGS ..." 1>&5
16053
16054                         CFLAGS="$cf_temp_flags"
16055                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
16056
16057 echo "${as_me:-configure}:16057: testing ... fixed $CFLAGS ..." 1>&5
16058
16059                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
16060
16061 echo "${as_me:-configure}:16061: testing ... extra $EXTRA_CFLAGS ..." 1>&5
16062
16063                 fi
16064                 ;;
16065         esac
16066 fi
16067
16068 if test "$GCC" = yes || test "$GXX" = yes
16069 then
16070         case $CPPFLAGS in
16071         (*-Werror=*)
16072                 cf_temp_flags=
16073                 for cf_temp_scan in $CPPFLAGS
16074                 do
16075                         case "x$cf_temp_scan" in
16076                         (x-Werror=format*)
16077
16078         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16079         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16080
16081                                 ;;
16082                         (x-Werror=*)
16083
16084         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
16085         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
16086
16087                                 ;;
16088                         (*)
16089
16090         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16091         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16092
16093                                 ;;
16094                         esac
16095                 done
16096                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
16097                 then
16098                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
16099
16100 echo "${as_me:-configure}:16100: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
16101
16102                         CPPFLAGS="$cf_temp_flags"
16103                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
16104
16105 echo "${as_me:-configure}:16105: testing ... fixed $CPPFLAGS ..." 1>&5
16106
16107                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
16108
16109 echo "${as_me:-configure}:16109: testing ... extra $EXTRA_CFLAGS ..." 1>&5
16110
16111                 fi
16112                 ;;
16113         esac
16114 fi
16115
16116 if test "$GCC" = yes || test "$GXX" = yes
16117 then
16118         case $LDFLAGS in
16119         (*-Werror=*)
16120                 cf_temp_flags=
16121                 for cf_temp_scan in $LDFLAGS
16122                 do
16123                         case "x$cf_temp_scan" in
16124                         (x-Werror=format*)
16125
16126         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16127         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16128
16129                                 ;;
16130                         (x-Werror=*)
16131
16132         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
16133         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
16134
16135                                 ;;
16136                         (*)
16137
16138         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16139         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16140
16141                                 ;;
16142                         esac
16143                 done
16144                 if test "x$LDFLAGS" != "x$cf_temp_flags"
16145                 then
16146                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
16147
16148 echo "${as_me:-configure}:16148: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
16149
16150                         LDFLAGS="$cf_temp_flags"
16151                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
16152
16153 echo "${as_me:-configure}:16153: testing ... fixed $LDFLAGS ..." 1>&5
16154
16155                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
16156
16157 echo "${as_me:-configure}:16157: testing ... extra $EXTRA_CFLAGS ..." 1>&5
16158
16159                 fi
16160                 ;;
16161         esac
16162 fi
16163
16164 echo "$as_me:16164: checking if you want to turn on gcc warnings" >&5
16165 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16166
16167 # Check whether --enable-warnings or --disable-warnings was given.
16168 if test "${enable_warnings+set}" = set; then
16169   enableval="$enable_warnings"
16170   test "$enableval" != yes && enableval=no
16171         if test "$enableval" != "no" ; then
16172     enable_warnings=yes
16173         else
16174                 enable_warnings=no
16175         fi
16176 else
16177   enableval=no
16178         enable_warnings=no
16179
16180 fi;
16181 echo "$as_me:16181: result: $enable_warnings" >&5
16182 echo "${ECHO_T}$enable_warnings" >&6
16183 if test "$enable_warnings" = "yes"
16184 then
16185
16186 if test "x$have_x" = xyes; then
16187
16188 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
16189 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
16190 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
16191 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
16192 for cf_X_CFLAGS in $X_CFLAGS
16193 do
16194         case "x$cf_X_CFLAGS" in
16195         x-[IUD]*)
16196                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
16197                 ;;
16198         *)
16199                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
16200                 ;;
16201         esac
16202 done
16203
16204 cat >"conftest.$ac_ext" <<_ACEOF
16205 #line 16205 "configure"
16206 #include "confdefs.h"
16207
16208 #include <stdlib.h>
16209 #include <X11/Intrinsic.h>
16210
16211 int
16212 main (void)
16213 {
16214 String foo = malloc(1); free((void*)foo)
16215   ;
16216   return 0;
16217 }
16218 _ACEOF
16219 rm -f "conftest.$ac_objext"
16220 if { (eval echo "$as_me:16220: \"$ac_compile\"") >&5
16221   (eval $ac_compile) 2>&5
16222   ac_status=$?
16223   echo "$as_me:16223: \$? = $ac_status" >&5
16224   (exit "$ac_status"); } &&
16225          { ac_try='test -s "conftest.$ac_objext"'
16226   { (eval echo "$as_me:16226: \"$ac_try\"") >&5
16227   (eval $ac_try) 2>&5
16228   ac_status=$?
16229   echo "$as_me:16229: \$? = $ac_status" >&5
16230   (exit "$ac_status"); }; }; then
16231
16232 echo "$as_me:16232: checking for X11/Xt const-feature" >&5
16233 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
16234 if test "${cf_cv_const_x_string+set}" = set; then
16235   echo $ECHO_N "(cached) $ECHO_C" >&6
16236 else
16237
16238         cat >"conftest.$ac_ext" <<_ACEOF
16239 #line 16239 "configure"
16240 #include "confdefs.h"
16241
16242 #undef  _CONST_X_STRING
16243 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
16244 #undef  XTSTRINGDEFINES /* X11R5 and later */
16245 #include <stdlib.h>
16246 #include <X11/Intrinsic.h>
16247
16248 int
16249 main (void)
16250 {
16251 String foo = malloc(1); *foo = 0
16252   ;
16253   return 0;
16254 }
16255 _ACEOF
16256 rm -f "conftest.$ac_objext"
16257 if { (eval echo "$as_me:16257: \"$ac_compile\"") >&5
16258   (eval $ac_compile) 2>&5
16259   ac_status=$?
16260   echo "$as_me:16260: \$? = $ac_status" >&5
16261   (exit "$ac_status"); } &&
16262          { ac_try='test -s "conftest.$ac_objext"'
16263   { (eval echo "$as_me:16263: \"$ac_try\"") >&5
16264   (eval $ac_try) 2>&5
16265   ac_status=$?
16266   echo "$as_me:16266: \$? = $ac_status" >&5
16267   (exit "$ac_status"); }; }; then
16268
16269                         cf_cv_const_x_string=no
16270
16271 else
16272   echo "$as_me: failed program was:" >&5
16273 cat "conftest.$ac_ext" >&5
16274
16275                         cf_cv_const_x_string=yes
16276
16277 fi
16278 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16279
16280 fi
16281 echo "$as_me:16281: result: $cf_cv_const_x_string" >&5
16282 echo "${ECHO_T}$cf_cv_const_x_string" >&6
16283
16284 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
16285 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
16286 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
16287
16288 case "$cf_cv_const_x_string" in
16289 (no)
16290
16291         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16292         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
16293
16294         ;;
16295 (*)
16296
16297         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16298         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
16299
16300         ;;
16301 esac
16302
16303 else
16304   echo "$as_me: failed program was:" >&5
16305 cat "conftest.$ac_ext" >&5
16306 fi
16307 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16308  fi
16309 cat > "conftest.$ac_ext" <<EOF
16310 #line 16310 "${as_me:-configure}"
16311 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16312 EOF
16313 if test "$INTEL_COMPILER" = yes
16314 then
16315 # The "-wdXXX" options suppress warnings:
16316 # remark #1419: external declaration in primary source file
16317 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16318 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16319 # remark #193: zero used for undefined preprocessing identifier
16320 # remark #593: variable "curs_sb_left_arrow" was set but never used
16321 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16322 # remark #869: parameter "tw" was never referenced
16323 # remark #981: operands are evaluated in unspecified order
16324 # warning #279: controlling expression is constant
16325
16326         { echo "$as_me:16326: checking for $CC warning options..." >&5
16327 echo "$as_me: checking for $CC warning options..." >&6;}
16328         cf_save_CFLAGS="$CFLAGS"
16329         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
16330         for cf_opt in \
16331                 wd1419 \
16332                 wd1683 \
16333                 wd1684 \
16334                 wd193 \
16335                 wd593 \
16336                 wd279 \
16337                 wd810 \
16338                 wd869 \
16339                 wd981
16340         do
16341                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16342                 if { (eval echo "$as_me:16342: \"$ac_compile\"") >&5
16343   (eval $ac_compile) 2>&5
16344   ac_status=$?
16345   echo "$as_me:16345: \$? = $ac_status" >&5
16346   (exit "$ac_status"); }; then
16347                         test -n "$verbose" && echo "$as_me:16347: result: ... -$cf_opt" >&5
16348 echo "${ECHO_T}... -$cf_opt" >&6
16349                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16350                 fi
16351         done
16352         CFLAGS="$cf_save_CFLAGS"
16353 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
16354 then
16355         { echo "$as_me:16355: checking for $CC warning options..." >&5
16356 echo "$as_me: checking for $CC warning options..." >&6;}
16357         cf_save_CFLAGS="$CFLAGS"
16358         cf_warn_CONST=""
16359         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16360         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16361         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16362         for cf_opt in W Wall \
16363                 Wbad-function-cast \
16364                 Wcast-align \
16365                 Wcast-qual \
16366                 Wdeclaration-after-statement \
16367                 Wextra \
16368                 Winline \
16369                 Wmissing-declarations \
16370                 Wmissing-prototypes \
16371                 Wnested-externs \
16372                 Wpointer-arith \
16373                 Wshadow \
16374                 Wstrict-prototypes \
16375                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
16376         do
16377                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16378                 if { (eval echo "$as_me:16378: \"$ac_compile\"") >&5
16379   (eval $ac_compile) 2>&5
16380   ac_status=$?
16381   echo "$as_me:16381: \$? = $ac_status" >&5
16382   (exit "$ac_status"); }; then
16383                         test -n "$verbose" && echo "$as_me:16383: result: ... -$cf_opt" >&5
16384 echo "${ECHO_T}... -$cf_opt" >&6
16385                         case "$cf_opt" in
16386                         (Winline)
16387                                 case "$GCC_VERSION" in
16388                                 ([34].*)
16389                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16390
16391 echo "${as_me:-configure}:16391: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16392
16393                                         continue;;
16394                                 esac
16395                                 ;;
16396                         (Wpointer-arith)
16397                                 case "$GCC_VERSION" in
16398                                 ([12].*)
16399                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16400
16401 echo "${as_me:-configure}:16401: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16402
16403                                         continue;;
16404                                 esac
16405                                 ;;
16406                         esac
16407                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16408                 fi
16409         done
16410         CFLAGS="$cf_save_CFLAGS"
16411 fi
16412 rm -rf ./conftest*
16413
16414 fi
16415
16416 if test "$GCC" = yes || test "$GXX" = yes
16417 then
16418 cat > conftest.i <<EOF
16419 #ifndef GCC_PRINTF
16420 #define GCC_PRINTF 0
16421 #endif
16422 #ifndef GCC_SCANF
16423 #define GCC_SCANF 0
16424 #endif
16425 #ifndef GCC_NORETURN
16426 #define GCC_NORETURN /* nothing */
16427 #endif
16428 #ifndef GCC_UNUSED
16429 #define GCC_UNUSED /* nothing */
16430 #endif
16431 EOF
16432 if test "$GCC" = yes
16433 then
16434         { echo "$as_me:16434: checking for $CC __attribute__ directives..." >&5
16435 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16436 cat > "conftest.$ac_ext" <<EOF
16437 #line 16437 "${as_me:-configure}"
16438 #include <stdio.h>
16439 #include "confdefs.h"
16440 #include "conftest.h"
16441 #include "conftest.i"
16442 #if     GCC_PRINTF
16443 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16444 #else
16445 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16446 #endif
16447 #if     GCC_SCANF
16448 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16449 #else
16450 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16451 #endif
16452 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16453 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
16454 extern GCC_NORETURN void foo(void);
16455 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
16456 EOF
16457         cf_printf_attribute=no
16458         cf_scanf_attribute=no
16459         for cf_attribute in scanf printf unused noreturn
16460         do
16461
16462 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16463
16464                 cf_directive="__attribute__(($cf_attribute))"
16465                 echo "checking for $CC $cf_directive" 1>&5
16466
16467                 case "$cf_attribute" in
16468                 (printf)
16469                         cf_printf_attribute=yes
16470                         cat >conftest.h <<EOF
16471 #define GCC_$cf_ATTRIBUTE 1
16472 EOF
16473                         ;;
16474                 (scanf)
16475                         cf_scanf_attribute=yes
16476                         cat >conftest.h <<EOF
16477 #define GCC_$cf_ATTRIBUTE 1
16478 EOF
16479                         ;;
16480                 (*)
16481                         cat >conftest.h <<EOF
16482 #define GCC_$cf_ATTRIBUTE $cf_directive
16483 EOF
16484                         ;;
16485                 esac
16486
16487                 if { (eval echo "$as_me:16487: \"$ac_compile\"") >&5
16488   (eval $ac_compile) 2>&5
16489   ac_status=$?
16490   echo "$as_me:16490: \$? = $ac_status" >&5
16491   (exit "$ac_status"); }; then
16492                         test -n "$verbose" && echo "$as_me:16492: result: ... $cf_attribute" >&5
16493 echo "${ECHO_T}... $cf_attribute" >&6
16494                         cat conftest.h >>confdefs.h
16495                         case "$cf_attribute" in
16496                         (noreturn)
16497
16498 cat >>confdefs.h <<EOF
16499 #define GCC_NORETURN $cf_directive
16500 EOF
16501
16502                                 ;;
16503                         (printf)
16504                                 cf_value='/* nothing */'
16505                                 if test "$cf_printf_attribute" != no ; then
16506                                         cf_value='__attribute__((format(printf,fmt,var)))'
16507
16508 cat >>confdefs.h <<\EOF
16509 #define GCC_PRINTF 1
16510 EOF
16511
16512                                 fi
16513
16514 cat >>confdefs.h <<EOF
16515 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16516 EOF
16517
16518                                 ;;
16519                         (scanf)
16520                                 cf_value='/* nothing */'
16521                                 if test "$cf_scanf_attribute" != no ; then
16522                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16523
16524 cat >>confdefs.h <<\EOF
16525 #define GCC_SCANF 1
16526 EOF
16527
16528                                 fi
16529
16530 cat >>confdefs.h <<EOF
16531 #define GCC_SCANFLIKE(fmt,var) $cf_value
16532 EOF
16533
16534                                 ;;
16535                         (unused)
16536
16537 cat >>confdefs.h <<EOF
16538 #define GCC_UNUSED $cf_directive
16539 EOF
16540
16541                                 ;;
16542                         esac
16543                 fi
16544         done
16545 else
16546         ${FGREP-fgrep} define conftest.i >>confdefs.h
16547 fi
16548 rm -rf ./conftest*
16549 fi
16550
16551 fi
16552
16553 if test "x$enable_warnings" = "xyes"; then
16554
16555         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
16556
16557 fi
16558
16559 ###     use option --enable-assertions to turn on generation of assertion code
16560 echo "$as_me:16560: checking if you want to enable runtime assertions" >&5
16561 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
16562
16563 # Check whether --enable-assertions or --disable-assertions was given.
16564 if test "${enable_assertions+set}" = set; then
16565   enableval="$enable_assertions"
16566   with_assertions=$enableval
16567 else
16568   with_assertions=no
16569 fi;
16570 echo "$as_me:16570: result: $with_assertions" >&5
16571 echo "${ECHO_T}$with_assertions" >&6
16572 if test -n "$GCC"
16573 then
16574         if test "$with_assertions" = no
16575         then
16576                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
16577         else
16578
16579         ADAFLAGS="$ADAFLAGS -gnata"
16580
16581         fi
16582 fi
16583
16584 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
16585
16586 cat >>confdefs.h <<\EOF
16587 #define HAVE_NC_ALLOC_H 1
16588 EOF
16589
16590 ###     use option --enable-expanded to generate certain macros as functions
16591
16592 # Check whether --enable-expanded or --disable-expanded was given.
16593 if test "${enable_expanded+set}" = set; then
16594   enableval="$enable_expanded"
16595   test "$enableval" = yes &&
16596 cat >>confdefs.h <<\EOF
16597 #define NCURSES_EXPANDED 1
16598 EOF
16599
16600 fi;
16601
16602 ###     use option --disable-macros to suppress macros in favor of functions
16603
16604 # Check whether --enable-macros or --disable-macros was given.
16605 if test "${enable_macros+set}" = set; then
16606   enableval="$enable_macros"
16607   test "$enableval" = no &&
16608 cat >>confdefs.h <<\EOF
16609 #define NCURSES_NOMACROS 1
16610 EOF
16611
16612 fi;
16613
16614 # Normally we only add trace() to the debug-library.  Allow this to be
16615 # extended to all models of the ncurses library:
16616 cf_all_traces=no
16617 case "$CFLAGS $CPPFLAGS" in
16618 (*-DTRACE*)
16619         cf_all_traces=yes
16620         ;;
16621 esac
16622
16623 echo "$as_me:16623: checking whether to add trace feature to all models" >&5
16624 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16625
16626 # Check whether --with-trace or --without-trace was given.
16627 if test "${with_trace+set}" = set; then
16628   withval="$with_trace"
16629   cf_with_trace=$withval
16630 else
16631   cf_with_trace=$cf_all_traces
16632 fi;
16633 echo "$as_me:16633: result: $cf_with_trace" >&5
16634 echo "${ECHO_T}$cf_with_trace" >&6
16635
16636 if test "$cf_with_trace" = yes ; then
16637         ADA_TRACE=TRUE
16638
16639 cat >>confdefs.h <<\EOF
16640 #define TRACE 1
16641 EOF
16642
16643 else
16644         ADA_TRACE=FALSE
16645 fi
16646
16647 echo "$as_me:16647: checking if we want to use GNAT projects" >&5
16648 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16649
16650 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16651 if test "${enable_gnat_projects+set}" = set; then
16652   enableval="$enable_gnat_projects"
16653   test "$enableval" != no && enableval=yes
16654         if test "$enableval" != "yes" ; then
16655     enable_gnat_projects=no
16656         else
16657                 enable_gnat_projects=yes
16658         fi
16659 else
16660   enableval=yes
16661         enable_gnat_projects=yes
16662
16663 fi;
16664 echo "$as_me:16664: result: $enable_gnat_projects" >&5
16665 echo "${ECHO_T}$enable_gnat_projects" >&6
16666
16667 ###     Checks for libraries.
16668 case $cf_cv_system_name in
16669 (*mingw32*)
16670
16671 echo "$as_me:16671: checking if ssp library is needed" >&5
16672 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16673 if test "${cf_cv_need_libssp+set}" = set; then
16674   echo $ECHO_N "(cached) $ECHO_C" >&6
16675 else
16676
16677 cat >"conftest.$ac_ext" <<_ACEOF
16678 #line 16678 "configure"
16679 #include "confdefs.h"
16680
16681 #include <sys/types.h>
16682 #include <dirent.h>
16683
16684 int
16685 main (void)
16686 {
16687
16688        DIR *dp = opendir(".");
16689
16690   ;
16691   return 0;
16692 }
16693 _ACEOF
16694 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16695 if { (eval echo "$as_me:16695: \"$ac_link\"") >&5
16696   (eval $ac_link) 2>&5
16697   ac_status=$?
16698   echo "$as_me:16698: \$? = $ac_status" >&5
16699   (exit "$ac_status"); } &&
16700          { ac_try='test -s "conftest$ac_exeext"'
16701   { (eval echo "$as_me:16701: \"$ac_try\"") >&5
16702   (eval $ac_try) 2>&5
16703   ac_status=$?
16704   echo "$as_me:16704: \$? = $ac_status" >&5
16705   (exit "$ac_status"); }; }; then
16706   cf_cv_need_libssp=no
16707 else
16708   echo "$as_me: failed program was:" >&5
16709 cat "conftest.$ac_ext" >&5
16710
16711         cf_save_LIBS="$LIBS"
16712         LIBS="$LIBS -lssp"
16713         cat >"conftest.$ac_ext" <<_ACEOF
16714 #line 16714 "configure"
16715 #include "confdefs.h"
16716
16717 #include <sys/types.h>
16718 #include <dirent.h>
16719
16720 int
16721 main (void)
16722 {
16723
16724                    DIR *dp = opendir(".");
16725
16726   ;
16727   return 0;
16728 }
16729 _ACEOF
16730 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16731 if { (eval echo "$as_me:16731: \"$ac_link\"") >&5
16732   (eval $ac_link) 2>&5
16733   ac_status=$?
16734   echo "$as_me:16734: \$? = $ac_status" >&5
16735   (exit "$ac_status"); } &&
16736          { ac_try='test -s "conftest$ac_exeext"'
16737   { (eval echo "$as_me:16737: \"$ac_try\"") >&5
16738   (eval $ac_try) 2>&5
16739   ac_status=$?
16740   echo "$as_me:16740: \$? = $ac_status" >&5
16741   (exit "$ac_status"); }; }; then
16742   cf_cv_need_libssp=yes
16743 else
16744   echo "$as_me: failed program was:" >&5
16745 cat "conftest.$ac_ext" >&5
16746 cf_cv_need_libssp=maybe
16747 fi
16748 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16749         LIBS="$cf_save_LIBS"
16750
16751 fi
16752 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16753 fi
16754 echo "$as_me:16754: result: $cf_cv_need_libssp" >&5
16755 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16756
16757 if test "x$cf_cv_need_libssp" = xyes
16758 then
16759
16760 cf_add_libs="$LIBS"
16761 # reverse order
16762 cf_add_0lib=
16763 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16764 # filter duplicates
16765 for cf_add_1lib in $cf_add_0lib; do
16766         for cf_add_2lib in $cf_add_libs; do
16767                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16768                         cf_add_1lib=
16769                         break
16770                 fi
16771         done
16772         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16773 done
16774 LIBS="$cf_add_libs"
16775
16776 fi
16777
16778         ;;
16779 (*)
16780
16781 cf_save_libs="$LIBS"
16782 echo "$as_me:16782: checking for clock_gettime" >&5
16783 echo $ECHO_N "checking for clock_gettime... $ECHO_C" >&6
16784 if test "${ac_cv_func_clock_gettime+set}" = set; then
16785   echo $ECHO_N "(cached) $ECHO_C" >&6
16786 else
16787   cat >"conftest.$ac_ext" <<_ACEOF
16788 #line 16788 "configure"
16789 #include "confdefs.h"
16790 #define clock_gettime autoconf_temporary
16791 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16792 #undef clock_gettime
16793
16794 #ifdef __cplusplus
16795 extern "C"
16796 #endif
16797
16798 /* We use char because int might match the return type of a gcc2
16799    builtin and then its argument prototype would still apply.  */
16800 char clock_gettime (void);
16801
16802 int
16803 main (void)
16804 {
16805
16806 /* The GNU C library defines stubs for functions which it implements
16807     to always fail with ENOSYS.  Some functions are actually named
16808     something starting with __ and the normal name is an alias.  */
16809 #if defined (__stub_clock_gettime) || defined (__stub___clock_gettime)
16810 #error found stub for clock_gettime
16811 #endif
16812
16813         return clock_gettime ();
16814   ;
16815   return 0;
16816 }
16817 _ACEOF
16818 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16819 if { (eval echo "$as_me:16819: \"$ac_link\"") >&5
16820   (eval $ac_link) 2>&5
16821   ac_status=$?
16822   echo "$as_me:16822: \$? = $ac_status" >&5
16823   (exit "$ac_status"); } &&
16824          { ac_try='test -s "conftest$ac_exeext"'
16825   { (eval echo "$as_me:16825: \"$ac_try\"") >&5
16826   (eval $ac_try) 2>&5
16827   ac_status=$?
16828   echo "$as_me:16828: \$? = $ac_status" >&5
16829   (exit "$ac_status"); }; }; then
16830   ac_cv_func_clock_gettime=yes
16831 else
16832   echo "$as_me: failed program was:" >&5
16833 cat "conftest.$ac_ext" >&5
16834 ac_cv_func_clock_gettime=no
16835 fi
16836 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16837 fi
16838 echo "$as_me:16838: result: $ac_cv_func_clock_gettime" >&5
16839 echo "${ECHO_T}$ac_cv_func_clock_gettime" >&6
16840 if test "$ac_cv_func_clock_gettime" = yes; then
16841   cf_cv_test_clock_gettime=yes
16842 else
16843   echo "$as_me:16843: checking for clock_gettime in -lrt" >&5
16844 echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6
16845 if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then
16846   echo $ECHO_N "(cached) $ECHO_C" >&6
16847 else
16848   ac_check_lib_save_LIBS=$LIBS
16849 LIBS="-lrt  $LIBS"
16850 cat >"conftest.$ac_ext" <<_ACEOF
16851 #line 16851 "configure"
16852 #include "confdefs.h"
16853
16854 /* Override any gcc2 internal prototype to avoid an error.  */
16855 #ifdef __cplusplus
16856 extern "C"
16857 #endif
16858 /* We use char because int might match the return type of a gcc2
16859    builtin and then its argument prototype would still apply.  */
16860 char clock_gettime (void);
16861 int
16862 main (void)
16863 {
16864 clock_gettime ();
16865   ;
16866   return 0;
16867 }
16868 _ACEOF
16869 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16870 if { (eval echo "$as_me:16870: \"$ac_link\"") >&5
16871   (eval $ac_link) 2>&5
16872   ac_status=$?
16873   echo "$as_me:16873: \$? = $ac_status" >&5
16874   (exit "$ac_status"); } &&
16875          { ac_try='test -s "conftest$ac_exeext"'
16876   { (eval echo "$as_me:16876: \"$ac_try\"") >&5
16877   (eval $ac_try) 2>&5
16878   ac_status=$?
16879   echo "$as_me:16879: \$? = $ac_status" >&5
16880   (exit "$ac_status"); }; }; then
16881   ac_cv_lib_rt_clock_gettime=yes
16882 else
16883   echo "$as_me: failed program was:" >&5
16884 cat "conftest.$ac_ext" >&5
16885 ac_cv_lib_rt_clock_gettime=no
16886 fi
16887 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16888 LIBS=$ac_check_lib_save_LIBS
16889 fi
16890 echo "$as_me:16890: result: $ac_cv_lib_rt_clock_gettime" >&5
16891 echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6
16892 if test "$ac_cv_lib_rt_clock_gettime" = yes; then
16893   LIBS="-lrt $LIBS"
16894                  cf_cv_test_clock_gettime=yes
16895 else
16896   cf_cv_test_clock_gettime=no
16897 fi
16898
16899 fi
16900
16901 if test "$cf_cv_test_clock_gettime" = yes ; then
16902 echo "$as_me:16902: checking if clock_gettime links" >&5
16903 echo $ECHO_N "checking if clock_gettime links... $ECHO_C" >&6
16904 if test "${cf_cv_func_clock_gettime+set}" = set; then
16905   echo $ECHO_N "(cached) $ECHO_C" >&6
16906 else
16907
16908                 cat >"conftest.$ac_ext" <<_ACEOF
16909 #line 16909 "configure"
16910 #include "confdefs.h"
16911
16912 $ac_includes_default
16913 #include <time.h>
16914
16915 int
16916 main (void)
16917 {
16918 struct timespec ts;
16919                 int rc = clock_gettime(CLOCK_REALTIME, &ts)
16920                            + clock_gettime(CLOCK_MONOTONIC, &ts);
16921                  (void) rc; (void)ts
16922   ;
16923   return 0;
16924 }
16925 _ACEOF
16926 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16927 if { (eval echo "$as_me:16927: \"$ac_link\"") >&5
16928   (eval $ac_link) 2>&5
16929   ac_status=$?
16930   echo "$as_me:16930: \$? = $ac_status" >&5
16931   (exit "$ac_status"); } &&
16932          { ac_try='test -s "conftest$ac_exeext"'
16933   { (eval echo "$as_me:16933: \"$ac_try\"") >&5
16934   (eval $ac_try) 2>&5
16935   ac_status=$?
16936   echo "$as_me:16936: \$? = $ac_status" >&5
16937   (exit "$ac_status"); }; }; then
16938   cf_cv_func_clock_gettime=yes
16939 else
16940   echo "$as_me: failed program was:" >&5
16941 cat "conftest.$ac_ext" >&5
16942 cf_cv_func_clock_gettime=no
16943 fi
16944 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16945
16946 fi
16947 echo "$as_me:16947: result: $cf_cv_func_clock_gettime" >&5
16948 echo "${ECHO_T}$cf_cv_func_clock_gettime" >&6
16949 else
16950         cf_cv_func_clock_gettime=no
16951 fi
16952
16953 if test "$cf_cv_func_clock_gettime" = yes
16954 then
16955
16956 cat >>confdefs.h <<\EOF
16957 #define HAVE_CLOCK_GETTIME 1
16958 EOF
16959
16960 else
16961 echo "$as_me:16961: checking for gettimeofday" >&5
16962 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16963 if test "${ac_cv_func_gettimeofday+set}" = set; then
16964   echo $ECHO_N "(cached) $ECHO_C" >&6
16965 else
16966   cat >"conftest.$ac_ext" <<_ACEOF
16967 #line 16967 "configure"
16968 #include "confdefs.h"
16969 #define gettimeofday autoconf_temporary
16970 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16971 #undef gettimeofday
16972
16973 #ifdef __cplusplus
16974 extern "C"
16975 #endif
16976
16977 /* We use char because int might match the return type of a gcc2
16978    builtin and then its argument prototype would still apply.  */
16979 char gettimeofday (void);
16980
16981 int
16982 main (void)
16983 {
16984
16985 /* The GNU C library defines stubs for functions which it implements
16986     to always fail with ENOSYS.  Some functions are actually named
16987     something starting with __ and the normal name is an alias.  */
16988 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16989 #error found stub for gettimeofday
16990 #endif
16991
16992         return gettimeofday ();
16993   ;
16994   return 0;
16995 }
16996 _ACEOF
16997 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16998 if { (eval echo "$as_me:16998: \"$ac_link\"") >&5
16999   (eval $ac_link) 2>&5
17000   ac_status=$?
17001   echo "$as_me:17001: \$? = $ac_status" >&5
17002   (exit "$ac_status"); } &&
17003          { ac_try='test -s "conftest$ac_exeext"'
17004   { (eval echo "$as_me:17004: \"$ac_try\"") >&5
17005   (eval $ac_try) 2>&5
17006   ac_status=$?
17007   echo "$as_me:17007: \$? = $ac_status" >&5
17008   (exit "$ac_status"); }; }; then
17009   ac_cv_func_gettimeofday=yes
17010 else
17011   echo "$as_me: failed program was:" >&5
17012 cat "conftest.$ac_ext" >&5
17013 ac_cv_func_gettimeofday=no
17014 fi
17015 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17016 fi
17017 echo "$as_me:17017: result: $ac_cv_func_gettimeofday" >&5
17018 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
17019 if test "$ac_cv_func_gettimeofday" = yes; then
17020
17021 cat >>confdefs.h <<\EOF
17022 #define HAVE_GETTIMEOFDAY 1
17023 EOF
17024
17025 else
17026
17027 echo "$as_me:17027: checking for gettimeofday in -lbsd" >&5
17028 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
17029 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
17030   echo $ECHO_N "(cached) $ECHO_C" >&6
17031 else
17032   ac_check_lib_save_LIBS=$LIBS
17033 LIBS="-lbsd  $LIBS"
17034 cat >"conftest.$ac_ext" <<_ACEOF
17035 #line 17035 "configure"
17036 #include "confdefs.h"
17037
17038 /* Override any gcc2 internal prototype to avoid an error.  */
17039 #ifdef __cplusplus
17040 extern "C"
17041 #endif
17042 /* We use char because int might match the return type of a gcc2
17043    builtin and then its argument prototype would still apply.  */
17044 char gettimeofday (void);
17045 int
17046 main (void)
17047 {
17048 gettimeofday ();
17049   ;
17050   return 0;
17051 }
17052 _ACEOF
17053 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17054 if { (eval echo "$as_me:17054: \"$ac_link\"") >&5
17055   (eval $ac_link) 2>&5
17056   ac_status=$?
17057   echo "$as_me:17057: \$? = $ac_status" >&5
17058   (exit "$ac_status"); } &&
17059          { ac_try='test -s "conftest$ac_exeext"'
17060   { (eval echo "$as_me:17060: \"$ac_try\"") >&5
17061   (eval $ac_try) 2>&5
17062   ac_status=$?
17063   echo "$as_me:17063: \$? = $ac_status" >&5
17064   (exit "$ac_status"); }; }; then
17065   ac_cv_lib_bsd_gettimeofday=yes
17066 else
17067   echo "$as_me: failed program was:" >&5
17068 cat "conftest.$ac_ext" >&5
17069 ac_cv_lib_bsd_gettimeofday=no
17070 fi
17071 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17072 LIBS=$ac_check_lib_save_LIBS
17073 fi
17074 echo "$as_me:17074: result: $ac_cv_lib_bsd_gettimeofday" >&5
17075 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
17076 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
17077
17078 cat >>confdefs.h <<\EOF
17079 #define HAVE_GETTIMEOFDAY 1
17080 EOF
17081
17082 cf_add_libs="$LIBS"
17083 # reverse order
17084 cf_add_0lib=
17085 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17086 # filter duplicates
17087 for cf_add_1lib in $cf_add_0lib; do
17088         for cf_add_2lib in $cf_add_libs; do
17089                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17090                         cf_add_1lib=
17091                         break
17092                 fi
17093         done
17094         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17095 done
17096 LIBS="$cf_add_libs"
17097
17098 fi
17099
17100 fi
17101 fi
17102
17103         ;;
17104 esac
17105
17106 ###     Checks for header files.
17107 echo "$as_me:17107: checking for signed char" >&5
17108 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
17109 if test "${ac_cv_type_signed_char+set}" = set; then
17110   echo $ECHO_N "(cached) $ECHO_C" >&6
17111 else
17112   cat >"conftest.$ac_ext" <<_ACEOF
17113 #line 17113 "configure"
17114 #include "confdefs.h"
17115 $ac_includes_default
17116 int
17117 main (void)
17118 {
17119 if ((signed char *) 0)
17120   return 0;
17121 if (sizeof (signed char))
17122   return 0;
17123   ;
17124   return 0;
17125 }
17126 _ACEOF
17127 rm -f "conftest.$ac_objext"
17128 if { (eval echo "$as_me:17128: \"$ac_compile\"") >&5
17129   (eval $ac_compile) 2>&5
17130   ac_status=$?
17131   echo "$as_me:17131: \$? = $ac_status" >&5
17132   (exit "$ac_status"); } &&
17133          { ac_try='test -s "conftest.$ac_objext"'
17134   { (eval echo "$as_me:17134: \"$ac_try\"") >&5
17135   (eval $ac_try) 2>&5
17136   ac_status=$?
17137   echo "$as_me:17137: \$? = $ac_status" >&5
17138   (exit "$ac_status"); }; }; then
17139   ac_cv_type_signed_char=yes
17140 else
17141   echo "$as_me: failed program was:" >&5
17142 cat "conftest.$ac_ext" >&5
17143 ac_cv_type_signed_char=no
17144 fi
17145 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17146 fi
17147 echo "$as_me:17147: result: $ac_cv_type_signed_char" >&5
17148 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
17149
17150 echo "$as_me:17150: checking size of signed char" >&5
17151 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
17152 if test "${ac_cv_sizeof_signed_char+set}" = set; then
17153   echo $ECHO_N "(cached) $ECHO_C" >&6
17154 else
17155   if test "$ac_cv_type_signed_char" = yes; then
17156   if test "$cross_compiling" = yes; then
17157   # Depending upon the size, compute the lo and hi bounds.
17158 cat >"conftest.$ac_ext" <<_ACEOF
17159 #line 17159 "configure"
17160 #include "confdefs.h"
17161 $ac_includes_default
17162 int
17163 main (void)
17164 {
17165 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
17166   ;
17167   return 0;
17168 }
17169 _ACEOF
17170 rm -f "conftest.$ac_objext"
17171 if { (eval echo "$as_me:17171: \"$ac_compile\"") >&5
17172   (eval $ac_compile) 2>&5
17173   ac_status=$?
17174   echo "$as_me:17174: \$? = $ac_status" >&5
17175   (exit "$ac_status"); } &&
17176          { ac_try='test -s "conftest.$ac_objext"'
17177   { (eval echo "$as_me:17177: \"$ac_try\"") >&5
17178   (eval $ac_try) 2>&5
17179   ac_status=$?
17180   echo "$as_me:17180: \$? = $ac_status" >&5
17181   (exit "$ac_status"); }; }; then
17182   ac_lo=0 ac_mid=0
17183   while :; do
17184     cat >"conftest.$ac_ext" <<_ACEOF
17185 #line 17185 "configure"
17186 #include "confdefs.h"
17187 $ac_includes_default
17188 int
17189 main (void)
17190 {
17191 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
17192   ;
17193   return 0;
17194 }
17195 _ACEOF
17196 rm -f "conftest.$ac_objext"
17197 if { (eval echo "$as_me:17197: \"$ac_compile\"") >&5
17198   (eval $ac_compile) 2>&5
17199   ac_status=$?
17200   echo "$as_me:17200: \$? = $ac_status" >&5
17201   (exit "$ac_status"); } &&
17202          { ac_try='test -s "conftest.$ac_objext"'
17203   { (eval echo "$as_me:17203: \"$ac_try\"") >&5
17204   (eval $ac_try) 2>&5
17205   ac_status=$?
17206   echo "$as_me:17206: \$? = $ac_status" >&5
17207   (exit "$ac_status"); }; }; then
17208   ac_hi=$ac_mid; break
17209 else
17210   echo "$as_me: failed program was:" >&5
17211 cat "conftest.$ac_ext" >&5
17212 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
17213 fi
17214 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17215   done
17216 else
17217   echo "$as_me: failed program was:" >&5
17218 cat "conftest.$ac_ext" >&5
17219 ac_hi=-1 ac_mid=-1
17220   while :; do
17221     cat >"conftest.$ac_ext" <<_ACEOF
17222 #line 17222 "configure"
17223 #include "confdefs.h"
17224 $ac_includes_default
17225 int
17226 main (void)
17227 {
17228 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
17229   ;
17230   return 0;
17231 }
17232 _ACEOF
17233 rm -f "conftest.$ac_objext"
17234 if { (eval echo "$as_me:17234: \"$ac_compile\"") >&5
17235   (eval $ac_compile) 2>&5
17236   ac_status=$?
17237   echo "$as_me:17237: \$? = $ac_status" >&5
17238   (exit "$ac_status"); } &&
17239          { ac_try='test -s "conftest.$ac_objext"'
17240   { (eval echo "$as_me:17240: \"$ac_try\"") >&5
17241   (eval $ac_try) 2>&5
17242   ac_status=$?
17243   echo "$as_me:17243: \$? = $ac_status" >&5
17244   (exit "$ac_status"); }; }; then
17245   ac_lo=$ac_mid; break
17246 else
17247   echo "$as_me: failed program was:" >&5
17248 cat "conftest.$ac_ext" >&5
17249 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
17250 fi
17251 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17252   done
17253 fi
17254 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17255 # Binary search between lo and hi bounds.
17256 while test "x$ac_lo" != "x$ac_hi"; do
17257   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
17258   cat >"conftest.$ac_ext" <<_ACEOF
17259 #line 17259 "configure"
17260 #include "confdefs.h"
17261 $ac_includes_default
17262 int
17263 main (void)
17264 {
17265 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
17266   ;
17267   return 0;
17268 }
17269 _ACEOF
17270 rm -f "conftest.$ac_objext"
17271 if { (eval echo "$as_me:17271: \"$ac_compile\"") >&5
17272   (eval $ac_compile) 2>&5
17273   ac_status=$?
17274   echo "$as_me:17274: \$? = $ac_status" >&5
17275   (exit "$ac_status"); } &&
17276          { ac_try='test -s "conftest.$ac_objext"'
17277   { (eval echo "$as_me:17277: \"$ac_try\"") >&5
17278   (eval $ac_try) 2>&5
17279   ac_status=$?
17280   echo "$as_me:17280: \$? = $ac_status" >&5
17281   (exit "$ac_status"); }; }; then
17282   ac_hi=$ac_mid
17283 else
17284   echo "$as_me: failed program was:" >&5
17285 cat "conftest.$ac_ext" >&5
17286 ac_lo=`expr "$ac_mid" + 1`
17287 fi
17288 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17289 done
17290 ac_cv_sizeof_signed_char=$ac_lo
17291 else
17292   if test "$cross_compiling" = yes; then
17293   { { echo "$as_me:17293: error: cannot run test program while cross compiling" >&5
17294 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
17295    { (exit 1); exit 1; }; }
17296 else
17297   cat >"conftest.$ac_ext" <<_ACEOF
17298 #line 17298 "configure"
17299 #include "confdefs.h"
17300 $ac_includes_default
17301 int
17302 main (void)
17303 {
17304 FILE *f = fopen ("conftest.val", "w");
17305 if (!f)
17306   $ac_main_return (1);
17307 fprintf (f, "%ld", (long)(sizeof (signed char)));
17308 fclose (f);
17309   ;
17310   return 0;
17311 }
17312 _ACEOF
17313 rm -f "conftest$ac_exeext"
17314 if { (eval echo "$as_me:17314: \"$ac_link\"") >&5
17315   (eval $ac_link) 2>&5
17316   ac_status=$?
17317   echo "$as_me:17317: \$? = $ac_status" >&5
17318   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17319   { (eval echo "$as_me:17319: \"$ac_try\"") >&5
17320   (eval $ac_try) 2>&5
17321   ac_status=$?
17322   echo "$as_me:17322: \$? = $ac_status" >&5
17323   (exit "$ac_status"); }; }; then
17324   ac_cv_sizeof_signed_char=`cat conftest.val`
17325 else
17326   echo "$as_me: program exited with status $ac_status" >&5
17327 echo "$as_me: failed program was:" >&5
17328 cat "conftest.$ac_ext" >&5
17329 fi
17330 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17331 fi
17332 fi
17333 rm -f conftest.val
17334 else
17335   ac_cv_sizeof_signed_char=0
17336 fi
17337 fi
17338 echo "$as_me:17338: result: $ac_cv_sizeof_signed_char" >&5
17339 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
17340 cat >>confdefs.h <<EOF
17341 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
17342 EOF
17343
17344 ac_header_dirent=no
17345 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
17346   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
17347 echo "$as_me:17347: checking for $ac_hdr that defines DIR" >&5
17348 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
17349 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17350   echo $ECHO_N "(cached) $ECHO_C" >&6
17351 else
17352   cat >"conftest.$ac_ext" <<_ACEOF
17353 #line 17353 "configure"
17354 #include "confdefs.h"
17355 #include <sys/types.h>
17356 #include <$ac_hdr>
17357
17358 int
17359 main (void)
17360 {
17361 if ((DIR *) 0)
17362 return 0;
17363   ;
17364   return 0;
17365 }
17366 _ACEOF
17367 rm -f "conftest.$ac_objext"
17368 if { (eval echo "$as_me:17368: \"$ac_compile\"") >&5
17369   (eval $ac_compile) 2>&5
17370   ac_status=$?
17371   echo "$as_me:17371: \$? = $ac_status" >&5
17372   (exit "$ac_status"); } &&
17373          { ac_try='test -s "conftest.$ac_objext"'
17374   { (eval echo "$as_me:17374: \"$ac_try\"") >&5
17375   (eval $ac_try) 2>&5
17376   ac_status=$?
17377   echo "$as_me:17377: \$? = $ac_status" >&5
17378   (exit "$ac_status"); }; }; then
17379   eval "$as_ac_Header=yes"
17380 else
17381   echo "$as_me: failed program was:" >&5
17382 cat "conftest.$ac_ext" >&5
17383 eval "$as_ac_Header=no"
17384 fi
17385 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17386 fi
17387 echo "$as_me:17387: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17388 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17389 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17390   cat >>confdefs.h <<EOF
17391 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
17392 EOF
17393
17394 ac_header_dirent=$ac_hdr; break
17395 fi
17396
17397 done
17398 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
17399 if test $ac_header_dirent = dirent.h; then
17400   echo "$as_me:17400: checking for opendir in -ldir" >&5
17401 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
17402 if test "${ac_cv_lib_dir_opendir+set}" = set; then
17403   echo $ECHO_N "(cached) $ECHO_C" >&6
17404 else
17405   ac_check_lib_save_LIBS=$LIBS
17406 LIBS="-ldir  $LIBS"
17407 cat >"conftest.$ac_ext" <<_ACEOF
17408 #line 17408 "configure"
17409 #include "confdefs.h"
17410
17411 /* Override any gcc2 internal prototype to avoid an error.  */
17412 #ifdef __cplusplus
17413 extern "C"
17414 #endif
17415 /* We use char because int might match the return type of a gcc2
17416    builtin and then its argument prototype would still apply.  */
17417 char opendir (void);
17418 int
17419 main (void)
17420 {
17421 opendir ();
17422   ;
17423   return 0;
17424 }
17425 _ACEOF
17426 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17427 if { (eval echo "$as_me:17427: \"$ac_link\"") >&5
17428   (eval $ac_link) 2>&5
17429   ac_status=$?
17430   echo "$as_me:17430: \$? = $ac_status" >&5
17431   (exit "$ac_status"); } &&
17432          { ac_try='test -s "conftest$ac_exeext"'
17433   { (eval echo "$as_me:17433: \"$ac_try\"") >&5
17434   (eval $ac_try) 2>&5
17435   ac_status=$?
17436   echo "$as_me:17436: \$? = $ac_status" >&5
17437   (exit "$ac_status"); }; }; then
17438   ac_cv_lib_dir_opendir=yes
17439 else
17440   echo "$as_me: failed program was:" >&5
17441 cat "conftest.$ac_ext" >&5
17442 ac_cv_lib_dir_opendir=no
17443 fi
17444 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17445 LIBS=$ac_check_lib_save_LIBS
17446 fi
17447 echo "$as_me:17447: result: $ac_cv_lib_dir_opendir" >&5
17448 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17449 if test "$ac_cv_lib_dir_opendir" = yes; then
17450   LIBS="$LIBS -ldir"
17451 fi
17452
17453 else
17454   echo "$as_me:17454: checking for opendir in -lx" >&5
17455 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17456 if test "${ac_cv_lib_x_opendir+set}" = set; then
17457   echo $ECHO_N "(cached) $ECHO_C" >&6
17458 else
17459   ac_check_lib_save_LIBS=$LIBS
17460 LIBS="-lx  $LIBS"
17461 cat >"conftest.$ac_ext" <<_ACEOF
17462 #line 17462 "configure"
17463 #include "confdefs.h"
17464
17465 /* Override any gcc2 internal prototype to avoid an error.  */
17466 #ifdef __cplusplus
17467 extern "C"
17468 #endif
17469 /* We use char because int might match the return type of a gcc2
17470    builtin and then its argument prototype would still apply.  */
17471 char opendir (void);
17472 int
17473 main (void)
17474 {
17475 opendir ();
17476   ;
17477   return 0;
17478 }
17479 _ACEOF
17480 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17481 if { (eval echo "$as_me:17481: \"$ac_link\"") >&5
17482   (eval $ac_link) 2>&5
17483   ac_status=$?
17484   echo "$as_me:17484: \$? = $ac_status" >&5
17485   (exit "$ac_status"); } &&
17486          { ac_try='test -s "conftest$ac_exeext"'
17487   { (eval echo "$as_me:17487: \"$ac_try\"") >&5
17488   (eval $ac_try) 2>&5
17489   ac_status=$?
17490   echo "$as_me:17490: \$? = $ac_status" >&5
17491   (exit "$ac_status"); }; }; then
17492   ac_cv_lib_x_opendir=yes
17493 else
17494   echo "$as_me: failed program was:" >&5
17495 cat "conftest.$ac_ext" >&5
17496 ac_cv_lib_x_opendir=no
17497 fi
17498 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17499 LIBS=$ac_check_lib_save_LIBS
17500 fi
17501 echo "$as_me:17501: result: $ac_cv_lib_x_opendir" >&5
17502 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17503 if test "$ac_cv_lib_x_opendir" = yes; then
17504   LIBS="$LIBS -lx"
17505 fi
17506
17507 fi
17508
17509 echo "$as_me:17509: checking whether time.h and sys/time.h may both be included" >&5
17510 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17511 if test "${ac_cv_header_time+set}" = set; then
17512   echo $ECHO_N "(cached) $ECHO_C" >&6
17513 else
17514   cat >"conftest.$ac_ext" <<_ACEOF
17515 #line 17515 "configure"
17516 #include "confdefs.h"
17517 #include <sys/types.h>
17518 #include <sys/time.h>
17519 #include <time.h>
17520
17521 int
17522 main (void)
17523 {
17524 if ((struct tm *) 0)
17525 return 0;
17526   ;
17527   return 0;
17528 }
17529 _ACEOF
17530 rm -f "conftest.$ac_objext"
17531 if { (eval echo "$as_me:17531: \"$ac_compile\"") >&5
17532   (eval $ac_compile) 2>&5
17533   ac_status=$?
17534   echo "$as_me:17534: \$? = $ac_status" >&5
17535   (exit "$ac_status"); } &&
17536          { ac_try='test -s "conftest.$ac_objext"'
17537   { (eval echo "$as_me:17537: \"$ac_try\"") >&5
17538   (eval $ac_try) 2>&5
17539   ac_status=$?
17540   echo "$as_me:17540: \$? = $ac_status" >&5
17541   (exit "$ac_status"); }; }; then
17542   ac_cv_header_time=yes
17543 else
17544   echo "$as_me: failed program was:" >&5
17545 cat "conftest.$ac_ext" >&5
17546 ac_cv_header_time=no
17547 fi
17548 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17549 fi
17550 echo "$as_me:17550: result: $ac_cv_header_time" >&5
17551 echo "${ECHO_T}$ac_cv_header_time" >&6
17552 if test $ac_cv_header_time = yes; then
17553
17554 cat >>confdefs.h <<\EOF
17555 #define TIME_WITH_SYS_TIME 1
17556 EOF
17557
17558 fi
17559
17560 ###     checks for compiler characteristics
17561 ac_ext=c
17562 ac_cpp='$CPP $CPPFLAGS'
17563 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17564 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17565 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17566 ac_main_return="return"
17567
17568 echo "$as_me:17568: checking for an ANSI C-conforming const" >&5
17569 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17570 if test "${ac_cv_c_const+set}" = set; then
17571   echo $ECHO_N "(cached) $ECHO_C" >&6
17572 else
17573   cat >"conftest.$ac_ext" <<_ACEOF
17574 #line 17574 "configure"
17575 #include "confdefs.h"
17576
17577 int
17578 main (void)
17579 {
17580 /* FIXME: Include the comments suggested by Paul. */
17581 #ifndef __cplusplus
17582   /* Ultrix mips cc rejects this.  */
17583   typedef int charset[2];
17584   const charset x; (void)x;
17585   /* SunOS 4.1.1 cc rejects this.  */
17586   char const *const *ccp;
17587   char **p;
17588   /* NEC SVR4.0.2 mips cc rejects this.  */
17589   struct point {int x, y;};
17590   static struct point const zero = {0,0}; (void)zero;
17591   /* AIX XL C 1.02.0.0 rejects this.
17592      It does not let you subtract one const X* pointer from another in
17593      an arm of an if-expression whose if-part is not a constant
17594      expression */
17595   const char *g = "string";
17596   ccp = &g + (g ? g-g : 0);
17597   /* HPUX 7.0 cc rejects these. */
17598   ++ccp;
17599   p = (char**) ccp;
17600   ccp = (char const *const *) p;
17601   { /* SCO 3.2v4 cc rejects this.  */
17602     char *t;
17603     char const *s = 0 ? (char *) 0 : (char const *) 0;
17604
17605     *t++ = 0;
17606         (void)s;
17607   }
17608   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17609     int x[] = {25, 17};
17610     const int *foo = &x[0];
17611     ++foo;
17612         (void)foo;
17613   }
17614   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17615     typedef const int *iptr;
17616     iptr p = 0;
17617     ++p;
17618         (void)p;
17619   }
17620   { /* AIX XL C 1.02.0.0 rejects this saying
17621        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17622     struct s { int j; const int *ap[3]; };
17623     struct s *b; b->j = 5;
17624   }
17625   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17626     const int foo = 10;
17627         (void)foo;
17628   }
17629 #endif
17630
17631   ;
17632   return 0;
17633 }
17634 _ACEOF
17635 rm -f "conftest.$ac_objext"
17636 if { (eval echo "$as_me:17636: \"$ac_compile\"") >&5
17637   (eval $ac_compile) 2>&5
17638   ac_status=$?
17639   echo "$as_me:17639: \$? = $ac_status" >&5
17640   (exit "$ac_status"); } &&
17641          { ac_try='test -s "conftest.$ac_objext"'
17642   { (eval echo "$as_me:17642: \"$ac_try\"") >&5
17643   (eval $ac_try) 2>&5
17644   ac_status=$?
17645   echo "$as_me:17645: \$? = $ac_status" >&5
17646   (exit "$ac_status"); }; }; then
17647   ac_cv_c_const=yes
17648 else
17649   echo "$as_me: failed program was:" >&5
17650 cat "conftest.$ac_ext" >&5
17651 ac_cv_c_const=no
17652 fi
17653 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17654 fi
17655 echo "$as_me:17655: result: $ac_cv_c_const" >&5
17656 echo "${ECHO_T}$ac_cv_c_const" >&6
17657 if test $ac_cv_c_const = no; then
17658
17659 cat >>confdefs.h <<\EOF
17660 #define const
17661 EOF
17662
17663 fi
17664
17665 ###     Checks for external-data
17666
17667 echo "$as_me:17667: checking if data-only library module links" >&5
17668 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17669 if test "${cf_cv_link_dataonly+set}" = set; then
17670   echo $ECHO_N "(cached) $ECHO_C" >&6
17671 else
17672
17673         rm -f conftest.a
17674         cat >conftest.$ac_ext <<EOF
17675 #line 17675 "configure"
17676 int     testdata[3] = { 123, 456, 789 };
17677 EOF
17678         if { (eval echo "$as_me:17678: \"$ac_compile\"") >&5
17679   (eval $ac_compile) 2>&5
17680   ac_status=$?
17681   echo "$as_me:17681: \$? = $ac_status" >&5
17682   (exit "$ac_status"); } ; then
17683                 mv conftest.o data.o && \
17684                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17685         fi
17686         rm -f conftest.$ac_ext data.o
17687         cat >conftest.$ac_ext <<EOF
17688 #line 17688 "configure"
17689 extern int testfunc(void);
17690 #if defined(NeXT)
17691 int     testfunc(void)
17692 {
17693         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17694 }
17695 #else
17696 extern int testdata[3];
17697 int     testfunc(void)
17698 {
17699         return testdata[0] == 123
17700            &&  testdata[1] == 456
17701            &&  testdata[2] == 789;
17702 }
17703 #endif
17704 EOF
17705         if { (eval echo "$as_me:17705: \"$ac_compile\"") >&5
17706   (eval $ac_compile) 2>&5
17707   ac_status=$?
17708   echo "$as_me:17708: \$? = $ac_status" >&5
17709   (exit "$ac_status"); }; then
17710                 mv conftest.o func.o && \
17711                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17712         fi
17713         rm -f conftest.$ac_ext func.o
17714         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17715         cf_saveLIBS="$LIBS"
17716         LIBS="conftest.a $LIBS"
17717         if test "$cross_compiling" = yes; then
17718   cf_cv_link_dataonly=unknown
17719 else
17720   cat >"conftest.$ac_ext" <<_ACEOF
17721 #line 17721 "configure"
17722 #include "confdefs.h"
17723
17724         extern int testfunc(void);
17725         int main(void)
17726         {
17727                 ${cf_cv_main_return:-return} (!testfunc());
17728         }
17729
17730 _ACEOF
17731 rm -f "conftest$ac_exeext"
17732 if { (eval echo "$as_me:17732: \"$ac_link\"") >&5
17733   (eval $ac_link) 2>&5
17734   ac_status=$?
17735   echo "$as_me:17735: \$? = $ac_status" >&5
17736   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17737   { (eval echo "$as_me:17737: \"$ac_try\"") >&5
17738   (eval $ac_try) 2>&5
17739   ac_status=$?
17740   echo "$as_me:17740: \$? = $ac_status" >&5
17741   (exit "$ac_status"); }; }; then
17742   cf_cv_link_dataonly=yes
17743 else
17744   echo "$as_me: program exited with status $ac_status" >&5
17745 echo "$as_me: failed program was:" >&5
17746 cat "conftest.$ac_ext" >&5
17747 cf_cv_link_dataonly=no
17748 fi
17749 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17750 fi
17751         LIBS="$cf_saveLIBS"
17752
17753 fi
17754
17755 echo "$as_me:17755: result: $cf_cv_link_dataonly" >&5
17756 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17757
17758 if test "$cf_cv_link_dataonly" = no ; then
17759
17760 cat >>confdefs.h <<\EOF
17761 #define BROKEN_LINKER 1
17762 EOF
17763
17764         BROKEN_LINKER=1
17765 fi
17766
17767 ###     Checks for library functions.
17768
17769 for ac_header in \
17770 unistd.h \
17771
17772 do
17773 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17774 echo "$as_me:17774: checking for $ac_header" >&5
17775 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17776 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17777   echo $ECHO_N "(cached) $ECHO_C" >&6
17778 else
17779   cat >"conftest.$ac_ext" <<_ACEOF
17780 #line 17780 "configure"
17781 #include "confdefs.h"
17782 #include <$ac_header>
17783 _ACEOF
17784 if { (eval echo "$as_me:17784: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17785   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17786   ac_status=$?
17787   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17788   rm -f conftest.er1
17789   cat conftest.err >&5
17790   echo "$as_me:17790: \$? = $ac_status" >&5
17791   (exit "$ac_status"); } >/dev/null; then
17792   if test -s conftest.err; then
17793     ac_cpp_err=$ac_c_preproc_warn_flag
17794   else
17795     ac_cpp_err=
17796   fi
17797 else
17798   ac_cpp_err=yes
17799 fi
17800 if test -z "$ac_cpp_err"; then
17801   eval "$as_ac_Header=yes"
17802 else
17803   echo "$as_me: failed program was:" >&5
17804   cat "conftest.$ac_ext" >&5
17805   eval "$as_ac_Header=no"
17806 fi
17807 rm -f conftest.err "conftest.$ac_ext"
17808 fi
17809 echo "$as_me:17809: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17810 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17811 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17812   cat >>confdefs.h <<EOF
17813 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17814 EOF
17815
17816 fi
17817 done
17818
17819 echo "$as_me:17819: checking for working mkstemp" >&5
17820 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17821 if test "${cf_cv_func_mkstemp+set}" = set; then
17822   echo $ECHO_N "(cached) $ECHO_C" >&6
17823 else
17824
17825 rm -rf ./conftest*
17826 if test "$cross_compiling" = yes; then
17827   cf_cv_func_mkstemp=maybe
17828 else
17829   cat >"conftest.$ac_ext" <<_ACEOF
17830 #line 17830 "configure"
17831 #include "confdefs.h"
17832
17833 $ac_includes_default
17834
17835 int main(void)
17836 {
17837         static char tmpl[] = "conftestXXXXXX";
17838         char name[2][80];
17839         int n;
17840         int result = 0;
17841         int fd;
17842         struct stat sb;
17843
17844         umask(077);
17845         for (n = 0; n < 2; ++n) {
17846                 strcpy(name[n], tmpl);
17847                 if ((fd = mkstemp(name[n])) >= 0) {
17848                         if (!strcmp(name[n], tmpl)
17849                          || stat(name[n], &sb) != 0
17850                          || (sb.st_mode & S_IFMT) != S_IFREG
17851                          || (sb.st_mode & 077) != 0) {
17852                                 result = 1;
17853                         }
17854                         close(fd);
17855                 }
17856         }
17857         if (result == 0
17858          && !strcmp(name[0], name[1]))
17859                 result = 1;
17860         ${cf_cv_main_return:-return}(result);
17861 }
17862
17863 _ACEOF
17864 rm -f "conftest$ac_exeext"
17865 if { (eval echo "$as_me:17865: \"$ac_link\"") >&5
17866   (eval $ac_link) 2>&5
17867   ac_status=$?
17868   echo "$as_me:17868: \$? = $ac_status" >&5
17869   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17870   { (eval echo "$as_me:17870: \"$ac_try\"") >&5
17871   (eval $ac_try) 2>&5
17872   ac_status=$?
17873   echo "$as_me:17873: \$? = $ac_status" >&5
17874   (exit "$ac_status"); }; }; then
17875   cf_cv_func_mkstemp=yes
17876
17877 else
17878   echo "$as_me: program exited with status $ac_status" >&5
17879 echo "$as_me: failed program was:" >&5
17880 cat "conftest.$ac_ext" >&5
17881 cf_cv_func_mkstemp=no
17882
17883 fi
17884 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17885 fi
17886
17887 fi
17888 echo "$as_me:17888: result: $cf_cv_func_mkstemp" >&5
17889 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17890 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17891         echo "$as_me:17891: checking for mkstemp" >&5
17892 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17893 if test "${ac_cv_func_mkstemp+set}" = set; then
17894   echo $ECHO_N "(cached) $ECHO_C" >&6
17895 else
17896   cat >"conftest.$ac_ext" <<_ACEOF
17897 #line 17897 "configure"
17898 #include "confdefs.h"
17899 #define mkstemp autoconf_temporary
17900 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17901 #undef mkstemp
17902
17903 #ifdef __cplusplus
17904 extern "C"
17905 #endif
17906
17907 /* We use char because int might match the return type of a gcc2
17908    builtin and then its argument prototype would still apply.  */
17909 char mkstemp (void);
17910
17911 int
17912 main (void)
17913 {
17914
17915 /* The GNU C library defines stubs for functions which it implements
17916     to always fail with ENOSYS.  Some functions are actually named
17917     something starting with __ and the normal name is an alias.  */
17918 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17919 #error found stub for mkstemp
17920 #endif
17921
17922         return mkstemp ();
17923   ;
17924   return 0;
17925 }
17926 _ACEOF
17927 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17928 if { (eval echo "$as_me:17928: \"$ac_link\"") >&5
17929   (eval $ac_link) 2>&5
17930   ac_status=$?
17931   echo "$as_me:17931: \$? = $ac_status" >&5
17932   (exit "$ac_status"); } &&
17933          { ac_try='test -s "conftest$ac_exeext"'
17934   { (eval echo "$as_me:17934: \"$ac_try\"") >&5
17935   (eval $ac_try) 2>&5
17936   ac_status=$?
17937   echo "$as_me:17937: \$? = $ac_status" >&5
17938   (exit "$ac_status"); }; }; then
17939   ac_cv_func_mkstemp=yes
17940 else
17941   echo "$as_me: failed program was:" >&5
17942 cat "conftest.$ac_ext" >&5
17943 ac_cv_func_mkstemp=no
17944 fi
17945 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17946 fi
17947 echo "$as_me:17947: result: $ac_cv_func_mkstemp" >&5
17948 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17949
17950 fi
17951 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17952
17953 cat >>confdefs.h <<\EOF
17954 #define HAVE_MKSTEMP 1
17955 EOF
17956
17957 fi
17958
17959 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17960         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17961         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17962 fi
17963
17964 cf_with_ada=yes
17965 if test "$cf_with_ada" != "no" ; then
17966         if test "$cf_cv_prog_gnat_correct" = yes; then
17967
17968         echo "$as_me:17968: checking optimization options for ADAFLAGS" >&5
17969 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17970         case "$CFLAGS" in
17971         (*-g*)
17972
17973         ADAFLAGS="$ADAFLAGS -g"
17974
17975                 ;;
17976         esac
17977         case "$CFLAGS" in
17978         (*-O*)
17979                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17980
17981         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17982
17983                 ;;
17984         esac
17985         echo "$as_me:17985: result: $ADAFLAGS" >&5
17986 echo "${ECHO_T}$ADAFLAGS" >&6
17987
17988 echo "$as_me:17988: checking if GNATPREP supports -T option" >&5
17989 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17990 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17991   echo $ECHO_N "(cached) $ECHO_C" >&6
17992 else
17993
17994 cf_cv_gnatprep_opt_t=no
17995 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17996
17997 fi
17998 echo "$as_me:17998: result: $cf_cv_gnatprep_opt_t" >&5
17999 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
18000 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
18001
18002 echo "$as_me:18002: checking if GNAT supports generics" >&5
18003 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
18004 case "$cf_cv_gnat_version" in
18005 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
18006         cf_gnat_generics=yes
18007         ;;
18008 (*)
18009         cf_gnat_generics=no
18010         ;;
18011 esac
18012 echo "$as_me:18012: result: $cf_gnat_generics" >&5
18013 echo "${ECHO_T}$cf_gnat_generics" >&6
18014
18015 if test "$cf_gnat_generics" = yes
18016 then
18017         cf_compile_generics=generics
18018         cf_generic_objects="\${GENOBJS}"
18019 else
18020         cf_compile_generics=
18021         cf_generic_objects=
18022 fi
18023
18024 echo "$as_me:18024: checking if GNAT supports SIGINT" >&5
18025 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
18026 if test "${cf_cv_gnat_sigint+set}" = set; then
18027   echo $ECHO_N "(cached) $ECHO_C" >&6
18028 else
18029
18030 rm -rf ./conftest* ./*~conftest*
18031 cat >>conftest.ads <<CF_EOF
18032 with Ada.Interrupts.Names;
18033
18034 package ConfTest is
18035
18036    pragma Warnings (Off);  --  the next pragma exists since 3.11p
18037    pragma Unreserve_All_Interrupts;
18038    pragma Warnings (On);
18039
18040    protected Process is
18041       procedure Stop;
18042       function Continue return Boolean;
18043       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
18044    private
18045       Done : Boolean := False;
18046    end Process;
18047
18048 end ConfTest;
18049 CF_EOF
18050 cat >>conftest.adb <<CF_EOF
18051 package body ConfTest is
18052    protected body Process is
18053       procedure Stop is
18054       begin
18055          Done := True;
18056       end Stop;
18057       function Continue return Boolean is
18058       begin
18059          return not Done;
18060       end Continue;
18061    end Process;
18062 end ConfTest;
18063 CF_EOF
18064 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
18065       cf_cv_gnat_sigint=yes
18066 else
18067    cf_cv_gnat_sigint=no
18068 fi
18069 rm -rf ./conftest* ./*~conftest*
18070
18071 fi
18072 echo "$as_me:18072: result: $cf_cv_gnat_sigint" >&5
18073 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
18074
18075 if test "$cf_cv_gnat_sigint" = yes ; then
18076         USE_GNAT_SIGINT=""
18077 else
18078         USE_GNAT_SIGINT="#"
18079 fi
18080
18081 cf_gnat_libraries=no
18082 cf_gnat_projects=no
18083
18084 if test "$enable_gnat_projects" != no ; then
18085 echo "$as_me:18085: checking if GNAT supports project files" >&5
18086 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
18087 case "$cf_cv_gnat_version" in
18088 (3.[0-9]*)
18089         ;;
18090 (*)
18091         case "$cf_cv_system_name" in
18092         (cygwin*|msys*)
18093                 ;;
18094         (*)
18095                 rm -rf ./conftest* ./*~conftest*
18096                 if mkdir conftest.src conftest.bin conftest.lib
18097                 then
18098                         cd conftest.src
18099                         rm -rf ./conftest* ./*~conftest*
18100                         cat >>library.gpr <<CF_EOF
18101 project Library is
18102   Kind := External ("LIB_KIND");
18103   for Library_Name use "ConfTest";
18104   for Object_Dir use ".";
18105   for Library_ALI_Dir use External("LIBRARY_DIR");
18106   for Library_Version use External ("SONAME");
18107   for Library_Kind use Kind;
18108   for Library_Dir use External("BUILD_DIR");
18109   Source_Dir := External ("SOURCE_DIR");
18110   for Source_Dirs use (Source_Dir);
18111 end Library;
18112 CF_EOF
18113                         cat >>confpackage.ads <<CF_EOF
18114 package ConfPackage is
18115    procedure conftest;
18116 end ConfPackage;
18117 CF_EOF
18118                         cat >>confpackage.adb <<CF_EOF
18119 with Text_IO;
18120 package body ConfPackage is
18121    procedure conftest is
18122    begin
18123       Text_IO.Put ("Hello World");
18124       Text_IO.New_Line;
18125    end conftest;
18126 end ConfPackage;
18127 CF_EOF
18128                         if ( "$cf_ada_make" $ADAFLAGS \
18129                                         -Plibrary.gpr \
18130                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
18131                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
18132                                         -XSOURCE_DIR="`pwd`" \
18133                                         -XSONAME=libConfTest.so.1 \
18134                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
18135                                 cf_gnat_projects=yes
18136                         fi
18137                         cd ..
18138                 fi
18139                 if test -f conftest.lib/confpackage.ali
18140                 then
18141                         cf_gnat_libraries=yes
18142                 fi
18143                 rm -rf ./conftest* ./*~conftest*
18144                 ;;
18145         esac
18146         ;;
18147 esac
18148 echo "$as_me:18148: result: $cf_gnat_projects" >&5
18149 echo "${ECHO_T}$cf_gnat_projects" >&6
18150 fi # enable_gnat_projects
18151
18152 if test "$cf_gnat_projects" = yes
18153 then
18154         echo "$as_me:18154: checking if GNAT supports libraries" >&5
18155 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
18156         echo "$as_me:18156: result: $cf_gnat_libraries" >&5
18157 echo "${ECHO_T}$cf_gnat_libraries" >&6
18158 fi
18159
18160 USE_OLD_MAKERULES=""
18161 USE_GNAT_PROJECTS="#"
18162 USE_GNAT_MAKE_GPR="#"
18163 USE_GNAT_GPRBUILD="#"
18164
18165 if test "$cf_gnat_projects" = yes
18166 then
18167         USE_OLD_MAKERULES="#"
18168         USE_GNAT_PROJECTS=""
18169         if test "$cf_cv_VERSION_GPRBUILD" != no
18170         then
18171                 USE_GNAT_GPRBUILD=""
18172         elif test "$cf_cv_VERSION_GNATMAKE" != no
18173         then
18174                 USE_GNAT_MAKE_GPR=""
18175         else
18176                 { echo "$as_me:18176: WARNING: use old makefile rules since tools are missing" >&5
18177 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
18178         fi
18179 fi
18180
18181 if test "$cf_gnat_libraries" = yes
18182 then
18183         USE_GNAT_LIBRARIES=""
18184 else
18185         USE_GNAT_LIBRARIES="#"
18186 fi
18187
18188 echo "$as_me:18188: checking for Ada95 compiler" >&5
18189 echo $ECHO_N "checking for Ada95 compiler... $ECHO_C" >&6
18190
18191 # Check whether --with-ada-compiler or --without-ada-compiler was given.
18192 if test "${with_ada_compiler+set}" = set; then
18193   withval="$with_ada_compiler"
18194   cf_ada_compiler=$withval
18195 else
18196   cf_ada_compiler=gnatmake
18197 fi;
18198
18199 echo "$as_me:18199: result: $cf_ada_compiler" >&5
18200 echo "${ECHO_T}$cf_ada_compiler" >&6
18201
18202                 cf_ada_package=terminal_interface
18203
18204 echo "$as_me:18204: checking for Ada95 include directory" >&5
18205 echo $ECHO_N "checking for Ada95 include directory... $ECHO_C" >&6
18206
18207 # Check whether --with-ada-include or --without-ada-include was given.
18208 if test "${with_ada_include+set}" = set; then
18209   withval="$with_ada_include"
18210
18211 else
18212   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18213 fi; if test -n "$prefix/share/ada/adainclude" ; then
18214
18215 if test "x$prefix" != xNONE; then
18216         cf_path_syntax="$prefix"
18217 else
18218         cf_path_syntax="$ac_default_prefix"
18219 fi
18220
18221 case ".$withval" in
18222 (.\$\(*\)*|.\'*\'*)
18223         ;;
18224 (..|./*|.\\*)
18225         ;;
18226 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18227         ;;
18228 (.\$\{*prefix\}*|.\$\{*dir\}*)
18229         eval withval="$withval"
18230         case ".$withval" in
18231         (.NONE/*)
18232                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18233                 ;;
18234         esac
18235         ;;
18236 (.no|.NONE/*)
18237         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18238         ;;
18239 (*)
18240         { { echo "$as_me:18240: error: expected a pathname, not \"$withval\"" >&5
18241 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18242    { (exit 1); exit 1; }; }
18243         ;;
18244 esac
18245
18246 fi
18247 eval ADA_INCLUDE="$withval"
18248
18249 echo "$as_me:18249: result: $ADA_INCLUDE" >&5
18250 echo "${ECHO_T}$ADA_INCLUDE" >&6
18251
18252 echo "$as_me:18252: checking for Ada95 object directory" >&5
18253 echo $ECHO_N "checking for Ada95 object directory... $ECHO_C" >&6
18254
18255 # Check whether --with-ada-objects or --without-ada-objects was given.
18256 if test "${with_ada_objects+set}" = set; then
18257   withval="$with_ada_objects"
18258
18259 else
18260   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18261 fi; if test -n "$prefix/lib/ada/adalib" ; then
18262
18263 if test "x$prefix" != xNONE; then
18264         cf_path_syntax="$prefix"
18265 else
18266         cf_path_syntax="$ac_default_prefix"
18267 fi
18268
18269 case ".$withval" in
18270 (.\$\(*\)*|.\'*\'*)
18271         ;;
18272 (..|./*|.\\*)
18273         ;;
18274 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18275         ;;
18276 (.\$\{*prefix\}*|.\$\{*dir\}*)
18277         eval withval="$withval"
18278         case ".$withval" in
18279         (.NONE/*)
18280                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18281                 ;;
18282         esac
18283         ;;
18284 (.no|.NONE/*)
18285         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18286         ;;
18287 (*)
18288         { { echo "$as_me:18288: error: expected a pathname, not \"$withval\"" >&5
18289 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18290    { (exit 1); exit 1; }; }
18291         ;;
18292 esac
18293
18294 fi
18295 eval ADA_OBJECTS="$withval"
18296
18297 echo "$as_me:18297: result: $ADA_OBJECTS" >&5
18298 echo "${ECHO_T}$ADA_OBJECTS" >&6
18299
18300 echo "$as_me:18300: checking whether to build an Ada95 shared library" >&5
18301 echo $ECHO_N "checking whether to build an Ada95 shared library... $ECHO_C" >&6
18302
18303 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18304 if test "${with_ada_sharedlib+set}" = set; then
18305   withval="$with_ada_sharedlib"
18306   with_ada_sharedlib=$withval
18307 else
18308   with_ada_sharedlib=no
18309 fi;
18310 cf_ada_sharedlib_warn=no
18311
18312 if test "x$with_ada_sharedlib" != xno
18313 then
18314         if test "x$cf_gnat_projects" != xyes
18315         then
18316                 with_ada_sharedlib=no
18317                 cf_ada_sharedlib_warn=yes
18318         fi
18319 fi
18320
18321 echo "$as_me:18321: result: $with_ada_sharedlib" >&5
18322 echo "${ECHO_T}$with_ada_sharedlib" >&6
18323 if test "x$cf_ada_sharedlib_warn" != xno
18324 then
18325         { echo "$as_me:18325: WARNING: disabling Ada95 shared library since GNAT projects are not supported" >&5
18326 echo "$as_me: WARNING: disabling Ada95 shared library since GNAT projects are not supported" >&2;}
18327 fi
18328
18329 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18330 MAKE_ADA_SHAREDLIB="#"
18331
18332 if test "x$with_ada_sharedlib" != xno
18333 then
18334         MAKE_ADA_SHAREDLIB=
18335         if test "x$with_ada_sharedlib" != xyes
18336         then
18337                 ADA_SHAREDLIB="$with_ada_sharedlib"
18338         fi
18339 fi
18340
18341                 # allow the Ada binding to be renamed
18342
18343 echo "$as_me:18343: checking for Ada95 curses library name" >&5
18344 echo $ECHO_N "checking for Ada95 curses library name... $ECHO_C" >&6
18345
18346 # Check whether --with-ada-libname or --without-ada-libname was given.
18347 if test "${with_ada_libname+set}" = set; then
18348   withval="$with_ada_libname"
18349   ADA_LIBNAME=$withval
18350 else
18351   ADA_LIBNAME=AdaCurses
18352 fi;
18353 case "x$ADA_LIBNAME" in
18354 (x|xyes|xno)
18355         ADA_LIBNAME=AdaCurses
18356         ;;
18357 esac
18358
18359 echo "$as_me:18359: result: $ADA_LIBNAME" >&5
18360 echo "${ECHO_T}$ADA_LIBNAME" >&6
18361
18362         else
18363                 { { echo "$as_me:18363: error: No usable Ada compiler found" >&5
18364 echo "$as_me: error: No usable Ada compiler found" >&2;}
18365    { (exit 1); exit 1; }; }
18366         fi
18367 else
18368         { { echo "$as_me:18368: error: The Ada compiler is needed for this package" >&5
18369 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18370    { (exit 1); exit 1; }; }
18371 fi
18372
18373 ################################################################################
18374
18375 # not needed
18376 TINFO_LDFLAGS2=
18377
18378 TINFO_LIBS=
18379
18380 ### Construct the list of include-directories to be generated
18381
18382 if test "$srcdir" != "."; then
18383         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18384 fi
18385 CPPFLAGS="-I../include $CPPFLAGS"
18386 if test "$srcdir" != "."; then
18387         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18388 fi
18389 CPPFLAGS="-I. $CPPFLAGS"
18390
18391 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18392 if test "$srcdir" != "."; then
18393         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18394 fi
18395 if test "$GCC" != yes; then
18396         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18397 elif test "$includedir" != "/usr/include"; then
18398         if test "$includedir" = '${prefix}/include' ; then
18399                 if test x$prefix != x/usr ; then
18400                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18401                 fi
18402         else
18403                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18404         fi
18405 fi
18406
18407 ### Build up pieces for makefile rules
18408 echo "$as_me:18408: checking default library suffix" >&5
18409 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18410
18411         case $DFT_LWR_MODEL in
18412         (libtool) DFT_ARG_SUFFIX=''   ;;
18413         (normal)  DFT_ARG_SUFFIX=''   ;;
18414         (debug)   DFT_ARG_SUFFIX='_g' ;;
18415         (profile) DFT_ARG_SUFFIX='_p' ;;
18416         (shared)  DFT_ARG_SUFFIX=''   ;;
18417         esac
18418         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18419 echo "$as_me:18419: result: $DFT_ARG_SUFFIX" >&5
18420 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18421
18422 echo "$as_me:18422: checking default library-dependency suffix" >&5
18423 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18424
18425         case X$DFT_LWR_MODEL in
18426         (Xlibtool)
18427                 DFT_LIB_SUFFIX='.la'
18428                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18429                 ;;
18430         (Xdebug)
18431                 case "$cf_cv_system_name" in
18432                 (*-msvc*)
18433                         DFT_LIB_SUFFIX='_g.lib'
18434                         ;;
18435                 (*)
18436                         DFT_LIB_SUFFIX='_g.a'
18437                         ;;
18438                 esac
18439                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18440                 ;;
18441         (Xprofile)
18442                 case "$cf_cv_system_name" in
18443                 (*-msvc*)
18444                         DFT_LIB_SUFFIX='_p.lib'
18445                         ;;
18446                 (*)
18447                         DFT_LIB_SUFFIX='_p.a'
18448                         ;;
18449                 esac
18450                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18451                 ;;
18452         (Xshared)
18453                 case "$cf_cv_system_name" in
18454                 (aix[5-7]*)
18455                         DFT_LIB_SUFFIX='.so'
18456                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18457                         ;;
18458                 (*-msvc*)
18459                         DFT_LIB_SUFFIX='.dll'
18460                         DFT_DEP_SUFFIX='.dll.lib'
18461                         ;;
18462                 (cygwin*|msys*|mingw*)
18463                         DFT_LIB_SUFFIX='.dll'
18464                         DFT_DEP_SUFFIX='.dll.a'
18465                         ;;
18466                 (darwin*)
18467                         DFT_LIB_SUFFIX='.dylib'
18468                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18469                         ;;
18470                 (hpux*)
18471                         case "$target" in
18472                         (ia64*)
18473                                 DFT_LIB_SUFFIX='.so'
18474                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18475                                 ;;
18476                         (*)
18477                                 DFT_LIB_SUFFIX='.sl'
18478                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18479                                 ;;
18480                         esac
18481                         ;;
18482                 (*)
18483                         DFT_LIB_SUFFIX='.so'
18484                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18485                         ;;
18486                 esac
18487                 ;;
18488         (*)
18489                 case "$target" in
18490                 (*-msvc*)
18491                         DFT_LIB_SUFFIX='.lib'
18492                         ;;
18493                 (*)
18494                         DFT_LIB_SUFFIX='.a'
18495                         ;;
18496                 esac
18497                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18498                 ;;
18499         esac
18500         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18501         then
18502                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18503                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18504         fi
18505 echo "$as_me:18505: result: $DFT_DEP_SUFFIX" >&5
18506 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18507
18508 echo "$as_me:18508: checking default object directory" >&5
18509 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18510
18511         case $DFT_LWR_MODEL in
18512         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18513         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18514         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18515         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18516         (shared)
18517                 case "$cf_cv_system_name" in
18518                 (cygwin|msys)
18519                         DFT_OBJ_SUBDIR='objects' ;;
18520                 (*)
18521                         DFT_OBJ_SUBDIR='obj_s' ;;
18522                 esac
18523         esac
18524 echo "$as_me:18524: result: $DFT_OBJ_SUBDIR" >&5
18525 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18526
18527 ### Set up low-level terminfo dependencies for makefiles.
18528
18529 if test "$DFT_LWR_MODEL" = shared ; then
18530         case $cf_cv_system_name in
18531         (cygwin*)
18532                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18533                 ;;
18534         (msys*)
18535                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18536                 ;;
18537         esac
18538 fi
18539
18540 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18541
18542 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18543
18544 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18545
18546 ### Construct the list of subdirectories for which we'll customize makefiles
18547 ### with the appropriate compile-rules.
18548
18549 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18550
18551 cat >>confdefs.h <<EOF
18552 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18553 EOF
18554
18555 ################################################################################
18556
18557 TEST_ARG2=
18558
18559 TEST_LIBS2=
18560
18561 NCURSES_SHLIB2="sh -c"
18562
18563 ADA_SUBDIRS="include gen src doc"
18564 if test "x$cf_with_tests" != "xno" ; then
18565         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18566 fi
18567 for cf_dir in $ADA_SUBDIRS
18568 do
18569         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18570 done
18571
18572 NCURSES_TREE="#"
18573
18574 EXTERNAL_TREE=
18575
18576 # match layout used by make-tar.sh
18577 ADAHTML_DIR=../doc/ada
18578
18579 if test "x$cross_compiling" = xyes ; then
18580         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18581 else
18582         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18583 fi
18584
18585 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"
18586 ac_config_commands="$ac_config_commands default"
18587 cat >confcache <<\_ACEOF
18588 # This file is a shell script that caches the results of configure
18589 # tests run on this system so they can be shared between configure
18590 # scripts and configure runs, see configure's option --config-cache.
18591 # It is not useful on other systems.  If it contains results you don't
18592 # want to keep, you may remove or edit it.
18593 #
18594 # config.status only pays attention to the cache file if you give it
18595 # the --recheck option to rerun configure.
18596 #
18597 # `ac_cv_env_foo' variables (set or unset) will be overridden when
18598 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18599 # following values.
18600
18601 _ACEOF
18602
18603 # The following way of writing the cache mishandles newlines in values,
18604 # but we know of no workaround that is simple, portable, and efficient.
18605 # So, don't put newlines in cache variables' values.
18606 # Ultrix sh set writes to stderr and can't be redirected directly,
18607 # and sets the high bit in the cache file unless we assign to the vars.
18608 {
18609   (set) 2>&1 |
18610     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18611     *ac_space=\ *)
18612       # `set' does not quote correctly, so add quotes (double-quote
18613       # substitution turns \\\\ into \\, and sed turns \\ into \).
18614       sed -n \
18615         "s/'/'\\\\''/g;
18616           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18617       ;;
18618     *)
18619       # `set' quotes correctly as required by POSIX, so do not add quotes.
18620       sed -n \
18621         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18622       ;;
18623     esac;
18624 } |
18625   sed '
18626      t clear
18627      : clear
18628      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18629      t end
18630      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18631      : end' >>confcache
18632 if cmp -s $cache_file confcache; then :; else
18633   if test -w $cache_file; then
18634     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18635     cat confcache >$cache_file
18636   else
18637     echo "not updating unwritable cache $cache_file"
18638   fi
18639 fi
18640 rm -f confcache
18641
18642 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18643 # Let make expand exec_prefix.
18644 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18645
18646 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18647 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18648 # trailing colons and then remove the whole line if VPATH becomes empty
18649 # (actually we leave an empty line to preserve line numbers).
18650 if test "x$srcdir" = x.; then
18651   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18652 s/:*\$(srcdir):*/:/;
18653 s/:*\${srcdir}:*/:/;
18654 s/:*@srcdir@:*/:/;
18655 s/^\([^=]*=[    ]*\):*/\1/;
18656 s/:*$//;
18657 s/^[^=]*=[      ]*$//;
18658 }'
18659 fi
18660
18661 DEFS=-DHAVE_CONFIG_H
18662
18663 : "${CONFIG_STATUS=./config.status}"
18664 ac_clean_files_save=$ac_clean_files
18665 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18666 { echo "$as_me:18666: creating $CONFIG_STATUS" >&5
18667 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18668 cat >"$CONFIG_STATUS" <<_ACEOF
18669 #! $SHELL
18670 # Generated automatically by configure.
18671 # Run this file to recreate the current configuration.
18672 # Compiler output produced by configure, useful for debugging
18673 # configure, is in config.log if it exists.
18674
18675 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18676
18677 debug=false
18678 SHELL=\${CONFIG_SHELL-$SHELL}
18679 ac_cs_invocation="\$0 \$@"
18680
18681 CLICOLOR_FORCE= GREP_OPTIONS=
18682 unset CLICOLOR_FORCE GREP_OPTIONS
18683 _ACEOF
18684
18685 cat >>"$CONFIG_STATUS" <<\_ACEOF
18686 # Be Bourne compatible
18687 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18688   emulate sh
18689   NULLCMD=:
18690 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18691   set -o posix
18692 fi
18693
18694 # Name of the executable.
18695 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18696
18697 if expr a : '\(a\)' >/dev/null 2>&1; then
18698   as_expr="expr"
18699 else
18700   as_expr="false"
18701 fi
18702
18703 rm -f conf$$ conf$$.exe conf$$.file
18704 echo >conf$$.file
18705 if ln -s conf$$.file conf$$ 2>/dev/null; then
18706   # We could just check for DJGPP; but this test a) works b) is more generic
18707   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18708   if test -f conf$$.exe; then
18709     # Don't use ln at all; we don't have any links
18710     as_ln_s='cp -p'
18711   else
18712     as_ln_s='ln -s'
18713   fi
18714 elif ln conf$$.file conf$$ 2>/dev/null; then
18715   as_ln_s='ln'
18716 else
18717   as_ln_s='cp -p'
18718 fi
18719 rm -f conf$$ conf$$.exe conf$$.file
18720
18721 as_executable_p="test -f"
18722
18723 # Support unset when possible.
18724 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18725   as_unset="unset"
18726 else
18727   as_unset="false"
18728 fi
18729
18730 # NLS nuisances.
18731 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18732 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18733 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18734 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18735 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18736 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18737 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18738 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18739
18740 # IFS
18741 # We need space, tab and new line, in precisely that order.
18742 as_nl='
18743 '
18744 IFS="   $as_nl"
18745
18746 # CDPATH.
18747 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18748
18749 exec 6>&1
18750
18751 _ACEOF
18752
18753 # Files that config.status was made for.
18754 if test -n "$ac_config_files"; then
18755   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18756 fi
18757
18758 if test -n "$ac_config_headers"; then
18759   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18760 fi
18761
18762 if test -n "$ac_config_links"; then
18763   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18764 fi
18765
18766 if test -n "$ac_config_commands"; then
18767   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18768 fi
18769
18770 cat >>"$CONFIG_STATUS" <<\EOF
18771
18772 ac_cs_usage="\
18773 \`$as_me' instantiates files from templates according to the
18774 current configuration.
18775
18776 Usage: $0 [OPTIONS] [FILE]...
18777
18778   -h, --help       print this help, then exit
18779   -V, --version    print version number, then exit
18780   -d, --debug      don't remove temporary files
18781       --recheck    update $as_me by reconfiguring in the same conditions
18782   --file=FILE[:TEMPLATE]
18783                    instantiate the configuration file FILE
18784   --header=FILE[:TEMPLATE]
18785                    instantiate the configuration header FILE
18786
18787 Configuration files:
18788 $config_files
18789
18790 Configuration headers:
18791 $config_headers
18792
18793 Configuration commands:
18794 $config_commands
18795
18796 Report bugs to <dickey@invisible-island.net>."
18797 EOF
18798
18799 cat >>"$CONFIG_STATUS" <<EOF
18800 ac_cs_version="\\
18801 config.status
18802 configured by $0, generated by GNU Autoconf 2.52.20231210,
18803   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18804
18805 Copyright 2003-2022,2023        Thomas E. Dickey
18806 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18807 Free Software Foundation, Inc.
18808 This config.status script is free software; the Free Software Foundation
18809 gives unlimited permission to copy, distribute and modify it."
18810 srcdir="$srcdir"
18811 INSTALL="$INSTALL"
18812 EOF
18813
18814 cat >>"$CONFIG_STATUS" <<\EOF
18815 # If no file are specified by the user, then we need to provide default
18816 # value.  By we need to know if files were specified by the user.
18817 ac_need_defaults=:
18818 while test $# != 0
18819 do
18820   case $1 in
18821   --*=*)
18822     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18823     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18824     shift
18825     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18826     shift
18827     ;;
18828   -*);;
18829   *) # This is not an option, so the user has probably given explicit
18830      # arguments.
18831      ac_need_defaults=false;;
18832   esac
18833
18834   case $1 in
18835   # Handling of the options.
18836 EOF
18837 cat >>"$CONFIG_STATUS" <<EOF
18838   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18839     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18840     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18841 EOF
18842 cat >>"$CONFIG_STATUS" <<\EOF
18843   --version | --vers* | -V )
18844     echo "$ac_cs_version"; exit 0 ;;
18845   --he | --h)
18846     # Conflict between --help and --header
18847     { { echo "$as_me:18847: error: ambiguous option: $1
18848 Try \`$0 --help' for more information." >&5
18849 echo "$as_me: error: ambiguous option: $1
18850 Try \`$0 --help' for more information." >&2;}
18851    { (exit 1); exit 1; }; };;
18852   --help | --hel | -h )
18853     echo "$ac_cs_usage"; exit 0 ;;
18854   --debug | --d* | -d )
18855     debug=: ;;
18856   --file | --fil | --fi | --f )
18857     shift
18858     CONFIG_FILES="$CONFIG_FILES $1"
18859     ac_need_defaults=false;;
18860   --header | --heade | --head | --hea )
18861     shift
18862     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18863     ac_need_defaults=false;;
18864
18865   # This is an error.
18866   -*) { { echo "$as_me:18866: error: unrecognized option: $1
18867 Try \`$0 --help' for more information." >&5
18868 echo "$as_me: error: unrecognized option: $1
18869 Try \`$0 --help' for more information." >&2;}
18870    { (exit 1); exit 1; }; } ;;
18871
18872   *) ac_config_targets="$ac_config_targets $1" ;;
18873
18874   esac
18875   shift
18876 done
18877
18878 exec 5>>config.log
18879 cat >&5 << _ACEOF
18880
18881 ## ----------------------- ##
18882 ## Running config.status.  ##
18883 ## ----------------------- ##
18884
18885 This file was extended by $as_me 2.52.20231210, executed with
18886   CONFIG_FILES    = $CONFIG_FILES
18887   CONFIG_HEADERS  = $CONFIG_HEADERS
18888   CONFIG_LINKS    = $CONFIG_LINKS
18889   CONFIG_COMMANDS = $CONFIG_COMMANDS
18890   > "$ac_cs_invocation"
18891 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18892
18893 _ACEOF
18894 EOF
18895
18896 cat >>"$CONFIG_STATUS" <<EOF
18897 #
18898 # INIT-COMMANDS section.
18899 #
18900
18901 ### Special initialization commands, used to pass information from the
18902 ### configuration-run into config.status
18903
18904 AWK="$AWK"
18905 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18906 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18907 LIB_NAME="$LIB_NAME"
18908 LIB_PREFIX="$LIB_PREFIX"
18909 LIB_SUFFIX="$LIB_SUFFIX"
18910 LN_S="$LN_S"
18911 NCURSES_MAJOR="$NCURSES_MAJOR"
18912 NCURSES_MINOR="$NCURSES_MINOR"
18913 NCURSES_PATCH="$NCURSES_PATCH"
18914 PACKAGE="$PACKAGE"
18915 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18916 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18917 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18918 cf_cv_abi_version="$cf_cv_abi_version"
18919 cf_cv_rel_version="$cf_cv_rel_version"
18920 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18921 cf_cv_shared_soname='$cf_cv_shared_soname'
18922 cf_cv_shlib_version="$cf_cv_shlib_version"
18923 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18924 cf_cv_system_name="$cf_cv_system_name"
18925 host="$host"
18926 target="$target"
18927
18928 EOF
18929
18930 cat >>"$CONFIG_STATUS" <<\EOF
18931 for ac_config_target in $ac_config_targets
18932 do
18933   case "$ac_config_target" in
18934   # Handling of arguments.
18935   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18936   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18937   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18938   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18939   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18940   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18941   *) { { echo "$as_me:18941: error: invalid argument: $ac_config_target" >&5
18942 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18943    { (exit 1); exit 1; }; };;
18944   esac
18945 done
18946
18947 # If the user did not use the arguments to specify the items to instantiate,
18948 # then the envvar interface is used.  Set only those that are not.
18949 # We use the long form for the default assignment because of an extremely
18950 # bizarre bug on SunOS 4.1.3.
18951 if "$ac_need_defaults"; then
18952   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18953   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18954   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18955 fi
18956
18957 # Create a temporary directory, and hook for its removal unless debugging.
18958 $debug ||
18959 {
18960   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18961   trap '{ (exit 1); exit 1; }' 1 2 13 15
18962 }
18963
18964 # Create a (secure) tmp directory for tmp files.
18965 : "${TMPDIR=/tmp}"
18966 {
18967   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18968   test -n "$tmp" && test -d "$tmp"
18969 }  ||
18970 {
18971   tmp=$TMPDIR/cs$$-$RANDOM
18972   (umask 077 && mkdir "$tmp")
18973 } ||
18974 {
18975    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18976    { (exit 1); exit 1; }
18977 }
18978
18979 EOF
18980
18981 cat >>"$CONFIG_STATUS" <<EOF
18982
18983 #
18984 # CONFIG_FILES section.
18985 #
18986
18987 # No need to generate the scripts if there are no CONFIG_FILES.
18988 # This happens for instance when ./config.status config.h
18989 if test -n "\$CONFIG_FILES"; then
18990   # Protect against being on the right side of a sed subst in config.status.
18991   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18992    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
18993 s,@SHELL@,$SHELL,;t t
18994 s,@exec_prefix@,$exec_prefix,;t t
18995 s,@prefix@,$prefix,;t t
18996 s,@program_transform_name@,$program_transform_name,;t t
18997 s,@bindir@,$bindir,;t t
18998 s,@sbindir@,$sbindir,;t t
18999 s,@libexecdir@,$libexecdir,;t t
19000 s,@datarootdir@,$datarootdir,;t t
19001 s,@datadir@,$datadir,;t t
19002 s,@sysconfdir@,$sysconfdir,;t t
19003 s,@sharedstatedir@,$sharedstatedir,;t t
19004 s,@localstatedir@,$localstatedir,;t t
19005 s,@runstatedir@,$runstatedir,;t t
19006 s,@libdir@,$libdir,;t t
19007 s,@includedir@,$includedir,;t t
19008 s,@oldincludedir@,$oldincludedir,;t t
19009 s,@infodir@,$infodir,;t t
19010 s,@mandir@,$mandir,;t t
19011 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19012 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19013 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19014 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19015 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19016 s,@build_alias@,$build_alias,;t t
19017 s,@host_alias@,$host_alias,;t t
19018 s,@target_alias@,$target_alias,;t t
19019 s,@ECHO_C@,$ECHO_C,;t t
19020 s,@ECHO_N@,$ECHO_N,;t t
19021 s,@ECHO_T@,$ECHO_T,;t t
19022 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19023 s,@DEFS@,$DEFS,;t t
19024 s,@LIBS@,$LIBS,;t t
19025 s,@PACKAGE@,$PACKAGE,;t t
19026 s,@top_builddir@,$top_builddir,;t t
19027 s,@build@,$build,;t t
19028 s,@build_cpu@,$build_cpu,;t t
19029 s,@build_vendor@,$build_vendor,;t t
19030 s,@build_os@,$build_os,;t t
19031 s,@host@,$host,;t t
19032 s,@host_cpu@,$host_cpu,;t t
19033 s,@host_vendor@,$host_vendor,;t t
19034 s,@host_os@,$host_os,;t t
19035 s,@target@,$target,;t t
19036 s,@target_cpu@,$target_cpu,;t t
19037 s,@target_vendor@,$target_vendor,;t t
19038 s,@target_os@,$target_os,;t t
19039 s,@GREP@,$GREP,;t t
19040 s,@FGREP@,$FGREP,;t t
19041 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
19042 s,@M4_exists@,$M4_exists,;t t
19043 s,@cf_ada_make@,$cf_ada_make,;t t
19044 s,@cf_ada_config@,$cf_ada_config,;t t
19045 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
19046 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
19047 s,@cf_cv_path_gnatgcc@,$cf_cv_path_gnatgcc,;t t
19048 s,@CC@,$CC,;t t
19049 s,@CFLAGS@,$CFLAGS,;t t
19050 s,@LDFLAGS@,$LDFLAGS,;t t
19051 s,@CPPFLAGS@,$CPPFLAGS,;t t
19052 s,@ac_ct_CC@,$ac_ct_CC,;t t
19053 s,@EXEEXT@,$EXEEXT,;t t
19054 s,@OBJEXT@,$OBJEXT,;t t
19055 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19056 s,@CPP@,$CPP,;t t
19057 s,@EGREP@,$EGREP,;t t
19058 s,@AWK@,$AWK,;t t
19059 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19060 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19061 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19062 s,@LN_S@,$LN_S,;t t
19063 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
19064 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
19065 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19066 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19067 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
19068 s,@SET_MAKE@,$SET_MAKE,;t t
19069 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
19070 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
19071 s,@CTAGS@,$CTAGS,;t t
19072 s,@ETAGS@,$ETAGS,;t t
19073 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19074 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19075 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
19076 s,@RANLIB@,$RANLIB,;t t
19077 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
19078 s,@LD@,$LD,;t t
19079 s,@ac_ct_LD@,$ac_ct_LD,;t t
19080 s,@AR@,$AR,;t t
19081 s,@ac_ct_AR@,$ac_ct_AR,;t t
19082 s,@ARFLAGS@,$ARFLAGS,;t t
19083 s,@DESTDIR@,$DESTDIR,;t t
19084 s,@BUILD_CC@,$BUILD_CC,;t t
19085 s,@BUILD_CPP@,$BUILD_CPP,;t t
19086 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
19087 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
19088 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
19089 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
19090 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
19091 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
19092 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
19093 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19094 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19095 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19096 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
19097 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
19098 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
19099 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19100 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19101 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
19102 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
19103 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
19104 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
19105 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
19106 s,@CC_G_OPT@,$CC_G_OPT,;t t
19107 s,@LD_MODEL@,$LD_MODEL,;t t
19108 s,@shlibdir@,$shlibdir,;t t
19109 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
19110 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19111 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
19112 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19113 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
19114 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
19115 s,@LINK_PROGS@,$LINK_PROGS,;t t
19116 s,@LINK_TESTS@,$LINK_TESTS,;t t
19117 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19118 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19119 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
19120 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
19121 s,@RPATH_LIST@,$RPATH_LIST,;t t
19122 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
19123 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
19124 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
19125 s,@PTHREAD@,$PTHREAD,;t t
19126 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
19127 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19128 s,@ECHO_LT@,$ECHO_LT,;t t
19129 s,@ECHO_LD@,$ECHO_LD,;t t
19130 s,@RULE_CC@,$RULE_CC,;t t
19131 s,@SHOW_CC@,$SHOW_CC,;t t
19132 s,@ECHO_CC@,$ECHO_CC,;t t
19133 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19134 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
19135 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
19136 s,@ADAFLAGS@,$ADAFLAGS,;t t
19137 s,@ADA_TRACE@,$ADA_TRACE,;t t
19138 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
19139 s,@cf_compile_generics@,$cf_compile_generics,;t t
19140 s,@cf_generic_objects@,$cf_generic_objects,;t t
19141 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
19142 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
19143 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
19144 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
19145 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
19146 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
19147 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
19148 s,@cf_ada_package@,$cf_ada_package,;t t
19149 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
19150 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
19151 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
19152 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
19153 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
19154 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
19155 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19156 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
19157 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
19158 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19159 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19160 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
19161 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
19162 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
19163 s,@TEST_ARG2@,$TEST_ARG2,;t t
19164 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
19165 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
19166 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
19167 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
19168 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
19169 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
19170 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
19171 CEOF
19172
19173 EOF
19174
19175   cat >>"$CONFIG_STATUS" <<\EOF
19176   # Split the substitutions into bite-sized pieces for seds with
19177   # small command number limits, like on Digital OSF/1 and HP-UX.
19178   ac_max_sed_lines=48
19179   ac_sed_frag=1 # Number of current file.
19180   ac_beg=1 # First line for current file.
19181   ac_end=$ac_max_sed_lines # Line after last line for current file.
19182   ac_more_lines=:
19183   ac_sed_cmds=
19184   while "$ac_more_lines"; do
19185     if test "$ac_beg" -gt 1; then
19186       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19187     else
19188       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19189     fi
19190     if test ! -s "$tmp"/subs.frag; then
19191       ac_more_lines=false
19192     else
19193       # The purpose of the label and of the branching condition is to
19194       # speed up the sed processing (if there are no `@' at all, there
19195       # is no need to browse any of the substitutions).
19196       # These are the two extra sed commands mentioned above.
19197       (echo ':t
19198   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19199       # It is possible to make a multiline substitution using escaped newlines.
19200       # Ensure that we do not split the substitution between script fragments.
19201       ac_BEG=$ac_end
19202       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19203       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19204       if test -s "$tmp"/subs.next; then
19205         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19206         if test ! -s "$tmp"/subs.edit; then
19207           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19208           if test ! -s "$tmp"/subs.edit; then
19209             if test "$ac_beg" -gt 1; then
19210               ac_end=`expr "$ac_end" - 1`
19211               continue
19212             fi
19213           fi
19214         fi
19215       fi
19216
19217       if test -z "$ac_sed_cmds"; then
19218         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19219       else
19220         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19221       fi
19222       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19223       ac_beg=$ac_end
19224       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19225     fi
19226   done
19227   if test -z "$ac_sed_cmds"; then
19228     ac_sed_cmds="cat"
19229   fi
19230 fi # test -n "$CONFIG_FILES"
19231
19232 EOF
19233 cat >>"$CONFIG_STATUS" <<\EOF
19234 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19235   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19236   case "$ac_file" in
19237   - | *:- | *:-:* ) # input from stdin
19238         cat >"$tmp"/stdin
19239         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19240         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19241   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19242         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19243   * )   ac_file_in=$ac_file.in ;;
19244   esac
19245
19246   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19247   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19248          X"$ac_file" : 'X\(//\)[^/]' \| \
19249          X"$ac_file" : 'X\(//\)$' \| \
19250          X"$ac_file" : 'X\(/\)' \| \
19251          .     : '\(.\)' 2>/dev/null ||
19252 echo X"$ac_file" |
19253     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19254           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19255           /^X\(\/\/\)$/{ s//\1/; q; }
19256           /^X\(\/\).*/{ s//\1/; q; }
19257           s/.*/./; q'`
19258   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19259     { case "$ac_dir" in
19260   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19261   *)                      as_incr_dir=.;;
19262 esac
19263 as_dummy="$ac_dir"
19264 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19265   case $as_mkdir_dir in
19266     # Skip DOS drivespec
19267     ?:) as_incr_dir=$as_mkdir_dir ;;
19268     *)
19269       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19270       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19271     ;;
19272   esac
19273 done; }
19274
19275     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19276     # A "../" for each directory in $ac_dir_suffix.
19277     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19278   else
19279     ac_dir_suffix= ac_dots=
19280   fi
19281
19282   case "$srcdir" in
19283   .)  ac_srcdir=.
19284       if test -z "$ac_dots"; then
19285          ac_top_srcdir=.
19286       else
19287          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19288       fi ;;
19289   [\\/]* | ?:[\\/]* )
19290       ac_srcdir="$srcdir$ac_dir_suffix";
19291       ac_top_srcdir="$srcdir" ;;
19292   *) # Relative path.
19293     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19294     ac_top_srcdir="$ac_dots$srcdir" ;;
19295   esac
19296
19297   case $INSTALL in
19298   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19299   *) ac_INSTALL=$ac_dots$INSTALL ;;
19300   esac
19301
19302   if test x"$ac_file" != x-; then
19303     { echo "$as_me:19303: creating $ac_file" >&5
19304 echo "$as_me: creating $ac_file" >&6;}
19305     rm -f "$ac_file"
19306   fi
19307   # Let's still pretend it is `configure' which instantiates (i.e., don't
19308   # use $as_me), people would be surprised to read:
19309   #    /* config.h.  Generated automatically by config.status.  */
19310   configure_input="Generated automatically from `echo $ac_file_in |
19311                                                  sed 's,.*/,,'` by configure."
19312
19313   # First look for the input files in the build tree, otherwise in the
19314   # src tree.
19315   ac_file_inputs=`IFS=:
19316     for f in $ac_file_in; do
19317       case $f in
19318       -) echo "$tmp"/stdin ;;
19319       [\\/$]*)
19320          # Absolute (can't be DOS-style, as IFS=:)
19321          test -f "$f" || { { echo "$as_me:19321: error: cannot find input file: $f" >&5
19322 echo "$as_me: error: cannot find input file: $f" >&2;}
19323    { (exit 1); exit 1; }; }
19324          echo "$f";;
19325       *) # Relative
19326          if test -f "$f"; then
19327            # Build tree
19328            echo "$f"
19329          elif test -f "$srcdir/$f"; then
19330            # Source tree
19331            echo "$srcdir/$f"
19332          else
19333            # /dev/null tree
19334            { { echo "$as_me:19334: error: cannot find input file: $f" >&5
19335 echo "$as_me: error: cannot find input file: $f" >&2;}
19336    { (exit 1); exit 1; }; }
19337          fi;;
19338       esac
19339     done` || { (exit 1); exit 1; }
19340 EOF
19341 cat >>"$CONFIG_STATUS" <<\EOF
19342   ac_warn_datarootdir=no
19343   if test x"$ac_file" != x-; then
19344     for ac_item in $ac_file_inputs
19345     do
19346       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19347       if test -n "$ac_seen"; then
19348         ac_used=`grep '@datarootdir@' "$ac_item"`
19349         if test -z "$ac_used"; then
19350           { echo "$as_me:19350: WARNING: datarootdir was used implicitly but not set:
19351 $ac_seen" >&5
19352 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19353 $ac_seen" >&2;}
19354           ac_warn_datarootdir=yes
19355         fi
19356       fi
19357       ac_seen=`grep '${datarootdir}' "$ac_item"`
19358       if test -n "$ac_seen"; then
19359         { echo "$as_me:19359: WARNING: datarootdir was used explicitly but not set:
19360 $ac_seen" >&5
19361 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19362 $ac_seen" >&2;}
19363         ac_warn_datarootdir=yes
19364       fi
19365     done
19366   fi
19367
19368 if test "x$ac_warn_datarootdir" = xyes; then
19369   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19370 fi
19371
19372 EOF
19373 cat >>"$CONFIG_STATUS" <<EOF
19374   sed "$ac_vpsub
19375 $extrasub
19376 EOF
19377 cat >>"$CONFIG_STATUS" <<\EOF
19378 :t
19379 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19380 s,@configure_input@,$configure_input,;t t
19381 s,@srcdir@,$ac_srcdir,;t t
19382 s,@top_srcdir@,$ac_top_srcdir,;t t
19383 s,@INSTALL@,$ac_INSTALL,;t t
19384 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19385   rm -f "$tmp"/stdin
19386 EOF
19387 test -n "${FGREP}" || FGREP="grep -F"
19388 test -n "${EGREP}" || EGREP="grep -E"
19389 cat >>"$CONFIG_STATUS" <<EOF
19390   test -n "\${FGREP}" || FGREP="$FGREP"
19391   test -n "\${EGREP}" || EGREP="$EGREP"
19392 EOF
19393 cat >>"$CONFIG_STATUS" <<\EOF
19394   if test x"$ac_file" != x-; then
19395     cp "$tmp/out" "$ac_file"
19396
19397     for ac_name in prefix exec_prefix datarootdir
19398     do
19399         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19400         if test -n "$ac_seen"; then
19401             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19402             if test -z "$ac_init"; then
19403               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19404               { echo "$as_me:19404: WARNING: Variable $ac_name is used but was not set:
19405 $ac_seen" >&5
19406 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19407 $ac_seen" >&2;}
19408             fi
19409         fi
19410     done
19411     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19412     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19413     if test -s "$tmp"/out; then
19414       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19415       { echo "$as_me:19415: WARNING: Some variables may not be substituted:
19416 $ac_seen" >&5
19417 echo "$as_me: WARNING: Some variables may not be substituted:
19418 $ac_seen" >&2;}
19419     fi
19420   else
19421     cat "$tmp"/out
19422   fi
19423   rm -f "$tmp"/out
19424
19425 done
19426 EOF
19427 cat >>"$CONFIG_STATUS" <<\EOF
19428
19429 #
19430 # CONFIG_HEADER section.
19431 #
19432
19433 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19434 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19435 #
19436 # ac_d sets the value in "#define NAME VALUE" lines.
19437 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19438 ac_dB='[        ].*$,\1#\2'
19439 ac_dC=' '
19440 ac_dD=',;t'
19441 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19442 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19443 ac_iB='\([      ]\),\1#\2define\3'
19444 ac_iC=' '
19445 ac_iD='\4,;t'
19446 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19447 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19448 ac_uB='$,\1#\2define\3'
19449 ac_uC=' '
19450 ac_uD=',;t'
19451
19452 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19453   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19454   case "$ac_file" in
19455   - | *:- | *:-:* ) # input from stdin
19456         cat >"$tmp"/stdin
19457         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19458         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19459   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19460         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19461   * )   ac_file_in=$ac_file.in ;;
19462   esac
19463
19464   test x"$ac_file" != x- && { echo "$as_me:19464: creating $ac_file" >&5
19465 echo "$as_me: creating $ac_file" >&6;}
19466
19467   # First look for the input files in the build tree, otherwise in the
19468   # src tree.
19469   ac_file_inputs=`IFS=:
19470     for f in $ac_file_in; do
19471       case $f in
19472       -) echo "$tmp"/stdin ;;
19473       [\\/$]*)
19474          # Absolute (can't be DOS-style, as IFS=:)
19475          test -f "$f" || { { echo "$as_me:19475: error: cannot find input file: $f" >&5
19476 echo "$as_me: error: cannot find input file: $f" >&2;}
19477    { (exit 1); exit 1; }; }
19478          echo $f;;
19479       *) # Relative
19480          if test -f "$f"; then
19481            # Build tree
19482            echo $f
19483          elif test -f "$srcdir/$f"; then
19484            # Source tree
19485            echo "$srcdir/$f"
19486          else
19487            # /dev/null tree
19488            { { echo "$as_me:19488: error: cannot find input file: $f" >&5
19489 echo "$as_me: error: cannot find input file: $f" >&2;}
19490    { (exit 1); exit 1; }; }
19491          fi;;
19492       esac
19493     done` || { (exit 1); exit 1; }
19494   # Remove the trailing spaces.
19495   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19496
19497 EOF
19498
19499 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19500 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19501 # be either 'cat' or 'sort'.
19502 cat confdefs.h | uniq >conftest.vals
19503
19504 # Break up conftest.vals because some shells have a limit on
19505 # the size of here documents, and old seds have small limits too.
19506
19507 rm -f conftest.tail
19508 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19509 while grep . conftest.vals >/dev/null
19510 do
19511   # Write chunks of a limited-size here document to conftest.frag.
19512   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19513   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19514   echo 'CEOF' >> "$CONFIG_STATUS"
19515   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19516   rm -f conftest.vals
19517   mv conftest.tail conftest.vals
19518 done
19519 rm -f conftest.vals
19520
19521 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19522 # marker @DEFS@.
19523 echo '  cat >> conftest.edit <<CEOF
19524 /@DEFS@/r conftest.frag
19525 /@DEFS@/d
19526 CEOF
19527 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19528 rm -f "$tmp"/in
19529 mv "$tmp"/out "$tmp"/in
19530 rm -f conftest.edit conftest.frag
19531 ' >> "$CONFIG_STATUS"
19532
19533 cat >>"$CONFIG_STATUS" <<\EOF
19534   # Let's still pretend it is `configure' which instantiates (i.e., don't
19535   # use $as_me), people would be surprised to read:
19536   #    /* config.h.  Generated automatically by config.status.  */
19537   if test x"$ac_file" = x-; then
19538     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19539   else
19540     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19541   fi
19542   cat "$tmp"/in >>"$tmp"/config.h
19543   rm -f "$tmp"/in
19544   if test x"$ac_file" != x-; then
19545     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19546       { echo "$as_me:19546: $ac_file is unchanged" >&5
19547 echo "$as_me: $ac_file is unchanged" >&6;}
19548     else
19549       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19550          X"$ac_file" : 'X\(//\)[^/]' \| \
19551          X"$ac_file" : 'X\(//\)$' \| \
19552          X"$ac_file" : 'X\(/\)' \| \
19553          .     : '\(.\)' 2>/dev/null ||
19554 echo X"$ac_file" |
19555     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19556           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19557           /^X\(\/\/\)$/{ s//\1/; q; }
19558           /^X\(\/\).*/{ s//\1/; q; }
19559           s/.*/./; q'`
19560       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19561         { case "$ac_dir" in
19562   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19563   *)                      as_incr_dir=.;;
19564 esac
19565 as_dummy="$ac_dir"
19566 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19567   case $as_mkdir_dir in
19568     # Skip DOS drivespec
19569     ?:) as_incr_dir=$as_mkdir_dir ;;
19570     *)
19571       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19572       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19573     ;;
19574   esac
19575 done; }
19576
19577       fi
19578       rm -f "$ac_file"
19579       mv "$tmp/config.h" "$ac_file"
19580     fi
19581   else
19582     cat "$tmp"/config.h
19583     rm -f "$tmp"/config.h
19584   fi
19585 done
19586 EOF
19587 cat >>"$CONFIG_STATUS" <<\EOF
19588 #
19589 # CONFIG_COMMANDS section.
19590 #
19591 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19592   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19593   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19594
19595   case "$ac_dest" in
19596     default )
19597 $AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
19598 if test -z "$USE_OLD_MAKERULES" ; then
19599         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19600 fi
19601  ;;
19602   esac
19603 done
19604 EOF
19605
19606 cat >>"$CONFIG_STATUS" <<\EOF
19607
19608 { (exit 0); exit 0; }
19609 EOF
19610 chmod +x "$CONFIG_STATUS"
19611 ac_clean_files=$ac_clean_files_save
19612
19613 # configure is writing to config.log, and then calls config.status.
19614 # config.status does its own redirection, appending to config.log.
19615 # Unfortunately, on DOS this fails, as config.log is still kept open
19616 # by configure, so config.status won't be able to write to it; its
19617 # output is simply discarded.  So we exec the FD to /dev/null,
19618 # effectively closing config.log, so it can be properly (re)opened and
19619 # appended to by config.status.  When coming back to configure, we
19620 # need to make the FD available again.
19621 if test "$no_create" != yes; then
19622   ac_cs_success=:
19623   exec 5>/dev/null
19624   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19625   exec 5>>config.log
19626   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19627   # would make configure fail if this is the last instruction.
19628   "$ac_cs_success" || { (exit 1); exit 1; }
19629 fi
19630 ${MAKE:-make} preinstall