]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.4 - patch 20240414
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.83 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20210509.
5 #
6 # Copyright 2003-2020,2021      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr=expr
38 else
39   as_expr=false
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s=ln
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2020,2021        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 top_builddir=`pwd`
1063
1064 ac_aux_dir=
1065 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1066   if test -f "$ac_dir/install-sh"; then
1067     ac_aux_dir=$ac_dir
1068     ac_install_sh="$ac_aux_dir/install-sh -c"
1069     break
1070   elif test -f "$ac_dir/install.sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install.sh -c"
1073     break
1074   elif test -f "$ac_dir/shtool"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/shtool install -c"
1077     break
1078   fi
1079 done
1080 if test -z "$ac_aux_dir"; then
1081   { { echo "$as_me:1081: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1082 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1086 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1087 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1088
1089 # Make sure we can run config.sub.
1090 $ac_config_sub sun4 >/dev/null 2>&1 ||
1091   { { echo "$as_me:1091: error: cannot run $ac_config_sub" >&5
1092 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1093    { (exit 1); exit 1; }; }
1094
1095 echo "$as_me:1095: checking build system type" >&5
1096 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1097 if test "${ac_cv_build+set}" = set; then
1098   echo $ECHO_N "(cached) $ECHO_C" >&6
1099 else
1100   ac_cv_build_alias=$build_alias
1101 test -z "$ac_cv_build_alias" &&
1102   ac_cv_build_alias=`$ac_config_guess`
1103 test -z "$ac_cv_build_alias" &&
1104   { { echo "$as_me:1104: error: cannot guess build type; you must specify one" >&5
1105 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1106    { (exit 1); exit 1; }; }
1107 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1108   { { echo "$as_me:1108: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1109 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1110    { (exit 1); exit 1; }; }
1111
1112 fi
1113 echo "$as_me:1113: result: $ac_cv_build" >&5
1114 echo "${ECHO_T}$ac_cv_build" >&6
1115 build=$ac_cv_build
1116 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1117 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1118 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1119
1120 echo "$as_me:1120: checking host system type" >&5
1121 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1122 if test "${ac_cv_host+set}" = set; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   ac_cv_host_alias=$host_alias
1126 test -z "$ac_cv_host_alias" &&
1127   ac_cv_host_alias=$ac_cv_build_alias
1128 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1129   { { echo "$as_me:1129: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1130 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1131    { (exit 1); exit 1; }; }
1132
1133 fi
1134 echo "$as_me:1134: result: $ac_cv_host" >&5
1135 echo "${ECHO_T}$ac_cv_host" >&6
1136 host=$ac_cv_host
1137 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1138 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1139 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1140
1141 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1142         echo "$as_me:1142: checking target system type" >&5
1143 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1144 if test "${ac_cv_target+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   ac_cv_target_alias=$target_alias
1148 test "x$ac_cv_target_alias" = "x" &&
1149   ac_cv_target_alias=$ac_cv_host_alias
1150 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1151   { { echo "$as_me:1151: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1152 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1153    { (exit 1); exit 1; }; }
1154
1155 fi
1156 echo "$as_me:1156: result: $ac_cv_target" >&5
1157 echo "${ECHO_T}$ac_cv_target" >&6
1158 target=$ac_cv_target
1159 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1160 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1161 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1162
1163 # The aliases save the names the user supplied, while $host etc.
1164 # will get canonicalized.
1165 test -n "$target_alias" &&
1166   test "$program_prefix$program_suffix$program_transform_name" = \
1167     NONENONEs,x,x, &&
1168   program_prefix=${target_alias}-
1169         system_name="$host_os"
1170 else
1171         system_name="`(uname -s -r) 2>/dev/null`"
1172         if test -z "$system_name" ; then
1173                 system_name="`(hostname) 2>/dev/null`"
1174         fi
1175 fi
1176 test -n "$system_name" &&
1177 cat >>confdefs.h <<EOF
1178 #define SYSTEM_NAME "$system_name"
1179 EOF
1180
1181 if test "${cf_cv_system_name+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   cf_cv_system_name="$system_name"
1185 fi
1186
1187 test -z "$system_name" && system_name="$cf_cv_system_name"
1188 test -n "$cf_cv_system_name" && echo "$as_me:1188: result: Configuring for $cf_cv_system_name" >&5
1189 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1190
1191 if test ".$system_name" != ".$cf_cv_system_name" ; then
1192         echo "$as_me:1192: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1193 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1194         { { echo "$as_me:1194: error: \"Please remove config.cache and try again.\"" >&5
1195 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1196    { (exit 1); exit 1; }; }
1197 fi
1198
1199 # Check whether --with-system-type or --without-system-type was given.
1200 if test "${with_system_type+set}" = set; then
1201   withval="$with_system_type"
1202   { echo "$as_me:1202: WARNING: overriding system type to $withval" >&5
1203 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1204         cf_cv_system_name=$withval
1205         host_os=$withval
1206
1207 fi;
1208
1209 ###     Save the given $CFLAGS to allow user-override.
1210 cf_user_CFLAGS="$CFLAGS"
1211
1212 ###     Default install-location
1213 for ac_prog in ggrep grep
1214 do
1215   # Extract the first word of "$ac_prog", so it can be a program name with args.
1216 set dummy $ac_prog; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_GREP+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$GREP"; then
1223   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_GREP="$ac_prog"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 GREP=$ac_cv_prog_GREP
1239 if test -n "$GREP"; then
1240   echo "$as_me:1240: result: $GREP" >&5
1241 echo "${ECHO_T}$GREP" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247   test -n "$GREP" && break
1248 done
1249 test -n "$GREP" || GREP=": "
1250
1251 echo "$as_me:1251: checking for fgrep" >&5
1252 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1253 if test "${ac_cv_path_FGREP+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1257    then ac_cv_path_FGREP="$GREP -F"
1258    else
1259      for ac_prog in gfgrep fgrep
1260 do
1261   # Extract the first word of "$ac_prog", so it can be a program name with args.
1262 set dummy $ac_prog; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_path_FGREP+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   case $FGREP in
1269   [\\/]* | ?:[\\/]*)
1270   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1271   ;;
1272   *)
1273   ac_save_IFS=$IFS; IFS=$ac_path_separator
1274 ac_dummy="$PATH"
1275 for ac_dir in $ac_dummy; do
1276   IFS=$ac_save_IFS
1277   test -z "$ac_dir" && ac_dir=.
1278   if $as_executable_p "$ac_dir/$ac_word"; then
1279    ac_cv_path_FGREP="$ac_dir/$ac_word"
1280    echo "$as_me:1280: found $ac_dir/$ac_word" >&5
1281    break
1282 fi
1283 done
1284
1285   ;;
1286 esac
1287 fi
1288 FGREP=$ac_cv_path_FGREP
1289
1290 if test -n "$FGREP"; then
1291   echo "$as_me:1291: result: $FGREP" >&5
1292 echo "${ECHO_T}$FGREP" >&6
1293 else
1294   echo "$as_me:1294: result: no" >&5
1295 echo "${ECHO_T}no" >&6
1296 fi
1297
1298   test -n "$FGREP" && break
1299 done
1300 test -n "$FGREP" || FGREP=": "
1301
1302      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1302: error: cannot find workable fgrep" >&5
1303 echo "$as_me: error: cannot find workable fgrep" >&2;}
1304    { (exit 1); exit 1; }; }
1305    fi
1306 fi
1307 echo "$as_me:1307: result: $ac_cv_path_FGREP" >&5
1308 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1309  FGREP="$ac_cv_path_FGREP"
1310
1311 echo "$as_me:1311: checking for prefix" >&5
1312 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1313 if test "x$prefix" = "xNONE" ; then
1314         case "$cf_cv_system_name" in
1315                 # non-vendor systems don't have a conflict
1316         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1317                 prefix=/usr
1318                 ;;
1319         (*)     prefix=$ac_default_prefix
1320                 ;;
1321         esac
1322 fi
1323 echo "$as_me:1323: result: $prefix" >&5
1324 echo "${ECHO_T}$prefix" >&6
1325
1326 if test "x$prefix" = "xNONE" ; then
1327 echo "$as_me:1327: checking for default include-directory" >&5
1328 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1329 test -n "$verbose" && echo 1>&6
1330 for cf_symbol in \
1331         "$includedir" \
1332         "$includedir/ncurses" \
1333         "$prefix/include" \
1334         "$prefix/include/ncurses" \
1335         /usr/local/include \
1336         /usr/local/include/ncurses \
1337         /usr/include \
1338         /usr/include/ncurses
1339 do
1340         cf_dir=`eval echo "$cf_symbol"`
1341         if test -f "$cf_dir/curses.h" ; then
1342         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1343                 includedir="$cf_symbol"
1344                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1345                 break
1346         fi
1347         fi
1348         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1349 done
1350 echo "$as_me:1350: result: $includedir" >&5
1351 echo "${ECHO_T}$includedir" >&6
1352 fi
1353
1354 ###     Checks for programs.
1355
1356 ac_ext=c
1357 ac_cpp='$CPP $CPPFLAGS'
1358 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1359 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1360 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1361 ac_main_return="return"
1362 if test -n "$ac_tool_prefix"; then
1363   for ac_prog in gnatgcc gcc cc
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in gnatgcc gcc cc
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo "$2"`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit "$ac_status"); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit "$ac_status"); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit "$ac_status"); }
1465
1466 cat >"conftest.$ac_ext" <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main (void)
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit "$ac_status"); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat "conftest.$ac_ext" >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit "$ac_status"); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe "conftest$ac_cv_exeext"
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit "$ac_status"); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f "conftest$ac_cv_exeext"
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f "conftest.$ac_ext"
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >"conftest.$ac_ext" <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main (void)
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit "$ac_status"); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat "conftest.$ac_ext" >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >"conftest.$ac_ext" <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main (void)
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f "conftest.$ac_objext"
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit "$ac_status"); } &&
1662          { ac_try='test -s "conftest.$ac_objext"'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit "$ac_status"); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat "conftest.$ac_ext" >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >"conftest.$ac_ext" <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main (void)
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f "conftest.$ac_objext"
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit "$ac_status"); } &&
1707          { ac_try='test -s "conftest.$ac_objext"'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit "$ac_status"); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat "conftest.$ac_ext" >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >"conftest.$ac_ext" <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f "conftest.$ac_objext"
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit "$ac_status"); } &&
1753          { ac_try='test -s "conftest.$ac_objext"'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit "$ac_status"); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >"conftest.$ac_ext" <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main (void)
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f "conftest.$ac_objext"
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit "$ac_status"); } &&
1787          { ac_try='test -s "conftest.$ac_objext"'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit "$ac_status"); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat "conftest.$ac_ext" >&5
1797 continue
1798 fi
1799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1800   cat >"conftest.$ac_ext" <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main (void)
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f "conftest.$ac_objext"
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit "$ac_status"); } &&
1818          { ac_try='test -s "conftest.$ac_objext"'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit "$ac_status"); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat "conftest.$ac_ext" >&5
1828 fi
1829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo "$ac_declaration"    >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1846 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return="return"
1849
1850 GCC_VERSION=none
1851 if test "$GCC" = yes ; then
1852         echo "$as_me:1852: checking version of $CC" >&5
1853 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1854         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1855         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1856         echo "$as_me:1856: result: $GCC_VERSION" >&5
1857 echo "${ECHO_T}$GCC_VERSION" >&6
1858 fi
1859
1860 INTEL_COMPILER=no
1861
1862 if test "$GCC" = yes ; then
1863         case "$host_os" in
1864         (linux*|gnu*)
1865                 echo "$as_me:1865: checking if this is really Intel C compiler" >&5
1866 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1867                 cf_save_CFLAGS="$CFLAGS"
1868                 CFLAGS="$CFLAGS -no-gcc"
1869                 cat >"conftest.$ac_ext" <<_ACEOF
1870 #line 1870 "configure"
1871 #include "confdefs.h"
1872
1873 int
1874 main (void)
1875 {
1876
1877 #ifdef __INTEL_COMPILER
1878 #else
1879 make an error
1880 #endif
1881
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 rm -f "conftest.$ac_objext"
1887 if { (eval echo "$as_me:1887: \"$ac_compile\"") >&5
1888   (eval $ac_compile) 2>&5
1889   ac_status=$?
1890   echo "$as_me:1890: \$? = $ac_status" >&5
1891   (exit "$ac_status"); } &&
1892          { ac_try='test -s "conftest.$ac_objext"'
1893   { (eval echo "$as_me:1893: \"$ac_try\"") >&5
1894   (eval $ac_try) 2>&5
1895   ac_status=$?
1896   echo "$as_me:1896: \$? = $ac_status" >&5
1897   (exit "$ac_status"); }; }; then
1898   INTEL_COMPILER=yes
1899 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1900
1901 else
1902   echo "$as_me: failed program was:" >&5
1903 cat "conftest.$ac_ext" >&5
1904 fi
1905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1906                 CFLAGS="$cf_save_CFLAGS"
1907                 echo "$as_me:1907: result: $INTEL_COMPILER" >&5
1908 echo "${ECHO_T}$INTEL_COMPILER" >&6
1909                 ;;
1910         esac
1911 fi
1912
1913 CLANG_COMPILER=no
1914
1915 if test "$GCC" = yes ; then
1916         echo "$as_me:1916: checking if this is really Clang C compiler" >&5
1917 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1918         cf_save_CFLAGS="$CFLAGS"
1919         cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   CLANG_COMPILER=yes
1949
1950 else
1951   echo "$as_me: failed program was:" >&5
1952 cat "conftest.$ac_ext" >&5
1953 fi
1954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1955         CFLAGS="$cf_save_CFLAGS"
1956         echo "$as_me:1956: result: $CLANG_COMPILER" >&5
1957 echo "${ECHO_T}$CLANG_COMPILER" >&6
1958 fi
1959
1960 CLANG_VERSION=none
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         case "$CC" in
1964         (c[1-9][0-9]|*/c[1-9][0-9])
1965                 { echo "$as_me:1965: WARNING: replacing broken compiler alias $CC" >&5
1966 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1967                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1968                 CC=clang
1969                 ;;
1970         esac
1971
1972         echo "$as_me:1972: checking version of $CC" >&5
1973 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1974         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1975         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1976         echo "$as_me:1976: result: $CLANG_VERSION" >&5
1977 echo "${ECHO_T}$CLANG_VERSION" >&6
1978
1979         for cf_clang_opt in \
1980                 -Qunused-arguments \
1981                 -Wno-error=implicit-function-declaration
1982         do
1983                 echo "$as_me:1983: checking if option $cf_clang_opt works" >&5
1984 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1985                 cf_save_CFLAGS="$CFLAGS"
1986                 CFLAGS="$CFLAGS $cf_clang_opt"
1987                 cat >"conftest.$ac_ext" <<_ACEOF
1988 #line 1988 "configure"
1989 #include "confdefs.h"
1990
1991                         #include <stdio.h>
1992 int
1993 main (void)
1994 {
1995
1996                         printf("hello!\\n");
1997   ;
1998   return 0;
1999 }
2000 _ACEOF
2001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2002 if { (eval echo "$as_me:2002: \"$ac_link\"") >&5
2003   (eval $ac_link) 2>&5
2004   ac_status=$?
2005   echo "$as_me:2005: \$? = $ac_status" >&5
2006   (exit "$ac_status"); } &&
2007          { ac_try='test -s "conftest$ac_exeext"'
2008   { (eval echo "$as_me:2008: \"$ac_try\"") >&5
2009   (eval $ac_try) 2>&5
2010   ac_status=$?
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit "$ac_status"); }; }; then
2013
2014                         cf_clang_optok=yes
2015 else
2016   echo "$as_me: failed program was:" >&5
2017 cat "conftest.$ac_ext" >&5
2018
2019                         cf_clang_optok=no
2020 fi
2021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2022                 echo "$as_me:2022: result: $cf_clang_optok" >&5
2023 echo "${ECHO_T}$cf_clang_optok" >&6
2024                 CFLAGS="$cf_save_CFLAGS"
2025                 if test "$cf_clang_optok" = yes; then
2026                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing adding option $cf_clang_opt ..." 1>&5
2029
2030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2031         CFLAGS="${CFLAGS}$cf_clang_opt"
2032
2033                 fi
2034         done
2035 fi
2036
2037 echo "$as_me:2037: checking for $CC option to accept ANSI C" >&5
2038 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2039 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2040   echo $ECHO_N "(cached) $ECHO_C" >&6
2041 else
2042   ac_cv_prog_cc_stdc=no
2043 ac_save_CC=$CC
2044 cat >"conftest.$ac_ext" <<_ACEOF
2045 #line 2045 "configure"
2046 #include "confdefs.h"
2047 #include <stdarg.h>
2048 #include <stdio.h>
2049 #include <sys/types.h>
2050 #include <sys/stat.h>
2051 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2052 struct buf { int x; };
2053 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2054 static char *e (p, i)
2055      char **p;
2056      int i;
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,'`
3283
3284 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3285 if test "${with_pkg_config_libdir+set}" = set; then
3286   withval="$with_pkg_config_libdir"
3287   cf_search_path=$withval
3288 else
3289   test "x$PKG_CONFIG" != xnone && cf_search_path=yes
3290 fi;
3291
3292 case x$cf_search_path in
3293 (x/*)
3294         ;;
3295 (xyes)
3296         cf_search_path=
3297         test -n "$verbose" && echo "    auto..." 1>&6
3298
3299 echo "${as_me:-configure}:3299: testing auto... ..." 1>&5
3300
3301         # Look for the library directory using the same prefix as the executable
3302         echo "$as_me:3302: checking for search-list" >&5
3303 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3304         if test "x$PKG_CONFIG" != xnone
3305         then
3306                 # works for pkg-config since version 0.24 (2009)
3307                 cf_pkg_program=`echo "$PKG_CONFIG" | sed -e 's,^.*/,,'`
3308                 cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3309
3310                 # works for pkgconf since version 0.8.3 (2012)
3311                 test -z "$cf_search_path" && \
3312                 cf_search_path=`pkgconf --variable=pc_path pkgconf 2>/dev/null | tr : ' '`
3313
3314                 # works for pkg-config since import in 2005 of original 2001 HP code.
3315                 test -z "$cf_search_path" && \
3316                 cf_search_path=`
3317                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3318 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3319         sub(\"^[^']*'\",\"\"); \
3320         sub(\"'.*\",\"\"); \
3321         printf \" %s\", \\$0; } \
3322 { next; } \
3323 "`
3324         fi
3325
3326         echo "$as_me:3326: result: $cf_search_path" >&5
3327 echo "${ECHO_T}$cf_search_path" >&6
3328
3329         ;;
3330 (*)
3331         ;;
3332 esac
3333
3334 echo "$as_me:3334: checking for first directory" >&5
3335 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3336 cf_pkg_config_path=none
3337 for cf_config in $cf_search_path
3338 do
3339         if test -d "$cf_config"
3340         then
3341                 cf_pkg_config_path=$cf_config
3342                 break
3343         fi
3344 done
3345 echo "$as_me:3345: result: $cf_pkg_config_path" >&5
3346 echo "${ECHO_T}$cf_pkg_config_path" >&6
3347
3348 if test "x$cf_pkg_config_path" != xnone ; then
3349         # limit this to the first directory found
3350         PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3351 fi
3352
3353 if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3354 then
3355         echo "$as_me:3355: checking for workaround" >&5
3356 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3357         if test "$prefix" = "NONE" ; then
3358                 cf_prefix="$ac_default_prefix"
3359         else
3360                 cf_prefix="$prefix"
3361         fi
3362         eval cf_libdir=$libdir
3363         cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3364         cf_backup=
3365         for cf_config in $cf_search_path
3366         do
3367                 case $cf_config in
3368                 $cf_libdir/pkgconfig)
3369                         PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3370                         break
3371                         ;;
3372                 *)
3373                         test -z "$cf_backup" && cf_backup=$cf_config
3374                         ;;
3375                 esac
3376         done
3377         test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3378         echo "$as_me:3378: result: $PKG_CONFIG_LIBDIR" >&5
3379 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3380 fi
3381
3382 echo "$as_me:3382: checking if you want to build test-programs" >&5
3383 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3384
3385 # Check whether --with-tests or --without-tests was given.
3386 if test "${with_tests+set}" = set; then
3387   withval="$with_tests"
3388   cf_with_tests=$withval
3389 else
3390   cf_with_tests=yes
3391 fi;
3392 echo "$as_me:3392: result: $cf_with_tests" >&5
3393 echo "${ECHO_T}$cf_with_tests" >&6
3394
3395 echo "$as_me:3395: checking if we should assume mixed-case filenames" >&5
3396 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3397
3398 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3399 if test "${enable_mixed_case+set}" = set; then
3400   enableval="$enable_mixed_case"
3401   enable_mixedcase=$enableval
3402 else
3403   enable_mixedcase=auto
3404 fi;
3405 echo "$as_me:3405: result: $enable_mixedcase" >&5
3406 echo "${ECHO_T}$enable_mixedcase" >&6
3407 if test "$enable_mixedcase" = "auto" ; then
3408
3409 echo "$as_me:3409: checking if filesystem supports mixed-case filenames" >&5
3410 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3411 if test "${cf_cv_mixedcase+set}" = set; then
3412   echo $ECHO_N "(cached) $ECHO_C" >&6
3413 else
3414
3415 if test "$cross_compiling" = yes ; then
3416         case "$target_alias" in
3417         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3418                 cf_cv_mixedcase=no
3419                 ;;
3420         (*)
3421                 cf_cv_mixedcase=yes
3422                 ;;
3423         esac
3424 else
3425         rm -f conftest CONFTEST
3426         echo test >conftest
3427         if test -f CONFTEST ; then
3428                 cf_cv_mixedcase=no
3429         else
3430                 cf_cv_mixedcase=yes
3431         fi
3432         rm -f conftest CONFTEST
3433 fi
3434
3435 fi
3436 echo "$as_me:3436: result: $cf_cv_mixedcase" >&5
3437 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3438 test "$cf_cv_mixedcase" = yes &&
3439 cat >>confdefs.h <<\EOF
3440 #define MIXEDCASE_FILENAMES 1
3441 EOF
3442
3443 else
3444         cf_cv_mixedcase=$enable_mixedcase
3445         if test "$enable_mixedcase" = "yes" ; then
3446                 cat >>confdefs.h <<\EOF
3447 #define MIXEDCASE_FILENAMES 1
3448 EOF
3449
3450         fi
3451 fi
3452
3453 # do this after mixed-case option (tags/TAGS is not as important as tic).
3454 echo "$as_me:3454: checking whether ${MAKE-make} sets \${MAKE}" >&5
3455 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3456 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3457 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3458   echo $ECHO_N "(cached) $ECHO_C" >&6
3459 else
3460   cat >conftest.make <<\EOF
3461 all:
3462         @echo 'ac_maketemp="${MAKE}"'
3463 EOF
3464 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3465 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3466 if test -n "$ac_maketemp"; then
3467   eval ac_cv_prog_make_${ac_make}_set=yes
3468 else
3469   eval ac_cv_prog_make_${ac_make}_set=no
3470 fi
3471 rm -f conftest.make
3472 fi
3473 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3474   echo "$as_me:3474: result: yes" >&5
3475 echo "${ECHO_T}yes" >&6
3476   SET_MAKE=
3477 else
3478   echo "$as_me:3478: result: no" >&5
3479 echo "${ECHO_T}no" >&6
3480   SET_MAKE="MAKE=${MAKE-make}"
3481 fi
3482
3483 echo "$as_me:3483: checking for \".PHONY\" make-support" >&5
3484 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3485 if test "${cf_cv_make_PHONY+set}" = set; then
3486   echo $ECHO_N "(cached) $ECHO_C" >&6
3487 else
3488
3489         rm -rf conftest*
3490         (
3491                 mkdir conftest || exit 1
3492                 cd conftest
3493                 cat >makefile <<'CF_EOF'
3494 .PHONY: always
3495 DATA=0
3496 always: always.out
3497         @echo "** making $@ $(DATA)"
3498 once: once.out
3499         @echo "** making $@ $(DATA)"
3500 always.out:
3501         @echo "** making $@ $(DATA)"
3502         echo $(DATA) > $@
3503 once.out:
3504         @echo "** making $@ $(DATA)"
3505         echo $(DATA) > $@
3506 CF_EOF
3507                 for cf_data in 1 2 3
3508                 do
3509                         ${MAKE:-make} always DATA=$cf_data
3510                         ${MAKE:-make} once   DATA=$cf_data
3511                         ${MAKE:-make} -t always once
3512                         if test -f always ; then
3513                                 echo "no (case 1)" > ../conftest.tmp
3514                         elif test ! -f always.out ; then
3515                                 echo "no (case 2)" > ../conftest.tmp
3516                         elif test ! -f once.out ; then
3517                                 echo "no (case 3)" > ../conftest.tmp
3518                         elif ! cmp -s always.out once.out ; then
3519                                 echo "no (case 4)" > ../conftest.tmp
3520                                 diff always.out once.out
3521                         else
3522                                 cf_check="`cat always.out`"
3523                                 if test "x$cf_check" != "x$cf_data" ; then
3524                                         echo "no (case 5)" > ../conftest.tmp
3525                                 else
3526                                         echo yes > ../conftest.tmp
3527                                         rm -f ./*.out
3528                                         continue
3529                                 fi
3530                         fi
3531                         break
3532                 done
3533         ) >&5 2>&1
3534         cf_cv_make_PHONY="`cat conftest.tmp`"
3535         rm -rf conftest*
3536
3537 fi
3538 echo "$as_me:3538: result: $cf_cv_make_PHONY" >&5
3539 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3540 MAKE_NO_PHONY="#"
3541 MAKE_PHONY="#"
3542 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3543 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3544
3545 for ac_prog in exctags ctags
3546 do
3547   # Extract the first word of "$ac_prog", so it can be a program name with args.
3548 set dummy $ac_prog; ac_word=$2
3549 echo "$as_me:3549: checking for $ac_word" >&5
3550 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3551 if test "${ac_cv_prog_CTAGS+set}" = set; then
3552   echo $ECHO_N "(cached) $ECHO_C" >&6
3553 else
3554   if test -n "$CTAGS"; then
3555   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3556 else
3557   ac_save_IFS=$IFS; IFS=$ac_path_separator
3558 ac_dummy="$PATH"
3559 for ac_dir in $ac_dummy; do
3560   IFS=$ac_save_IFS
3561   test -z "$ac_dir" && ac_dir=.
3562   $as_executable_p "$ac_dir/$ac_word" || continue
3563 ac_cv_prog_CTAGS="$ac_prog"
3564 echo "$as_me:3564: found $ac_dir/$ac_word" >&5
3565 break
3566 done
3567
3568 fi
3569 fi
3570 CTAGS=$ac_cv_prog_CTAGS
3571 if test -n "$CTAGS"; then
3572   echo "$as_me:3572: result: $CTAGS" >&5
3573 echo "${ECHO_T}$CTAGS" >&6
3574 else
3575   echo "$as_me:3575: result: no" >&5
3576 echo "${ECHO_T}no" >&6
3577 fi
3578
3579   test -n "$CTAGS" && break
3580 done
3581
3582 for ac_prog in exetags etags
3583 do
3584   # Extract the first word of "$ac_prog", so it can be a program name with args.
3585 set dummy $ac_prog; ac_word=$2
3586 echo "$as_me:3586: checking for $ac_word" >&5
3587 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3588 if test "${ac_cv_prog_ETAGS+set}" = set; then
3589   echo $ECHO_N "(cached) $ECHO_C" >&6
3590 else
3591   if test -n "$ETAGS"; then
3592   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3593 else
3594   ac_save_IFS=$IFS; IFS=$ac_path_separator
3595 ac_dummy="$PATH"
3596 for ac_dir in $ac_dummy; do
3597   IFS=$ac_save_IFS
3598   test -z "$ac_dir" && ac_dir=.
3599   $as_executable_p "$ac_dir/$ac_word" || continue
3600 ac_cv_prog_ETAGS="$ac_prog"
3601 echo "$as_me:3601: found $ac_dir/$ac_word" >&5
3602 break
3603 done
3604
3605 fi
3606 fi
3607 ETAGS=$ac_cv_prog_ETAGS
3608 if test -n "$ETAGS"; then
3609   echo "$as_me:3609: result: $ETAGS" >&5
3610 echo "${ECHO_T}$ETAGS" >&6
3611 else
3612   echo "$as_me:3612: result: no" >&5
3613 echo "${ECHO_T}no" >&6
3614 fi
3615
3616   test -n "$ETAGS" && break
3617 done
3618
3619 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3620 set dummy ${CTAGS:-ctags}; ac_word=$2
3621 echo "$as_me:3621: checking for $ac_word" >&5
3622 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3623 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3624   echo $ECHO_N "(cached) $ECHO_C" >&6
3625 else
3626   if test -n "$MAKE_LOWER_TAGS"; then
3627   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3628 else
3629   ac_save_IFS=$IFS; IFS=$ac_path_separator
3630 ac_dummy="$PATH"
3631 for ac_dir in $ac_dummy; do
3632   IFS=$ac_save_IFS
3633   test -z "$ac_dir" && ac_dir=.
3634   $as_executable_p "$ac_dir/$ac_word" || continue
3635 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3636 echo "$as_me:3636: found $ac_dir/$ac_word" >&5
3637 break
3638 done
3639
3640   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3641 fi
3642 fi
3643 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3644 if test -n "$MAKE_LOWER_TAGS"; then
3645   echo "$as_me:3645: result: $MAKE_LOWER_TAGS" >&5
3646 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3647 else
3648   echo "$as_me:3648: result: no" >&5
3649 echo "${ECHO_T}no" >&6
3650 fi
3651
3652 if test "$cf_cv_mixedcase" = yes ; then
3653         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3654 set dummy ${ETAGS:-etags}; ac_word=$2
3655 echo "$as_me:3655: checking for $ac_word" >&5
3656 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3657 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3658   echo $ECHO_N "(cached) $ECHO_C" >&6
3659 else
3660   if test -n "$MAKE_UPPER_TAGS"; then
3661   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3662 else
3663   ac_save_IFS=$IFS; IFS=$ac_path_separator
3664 ac_dummy="$PATH"
3665 for ac_dir in $ac_dummy; do
3666   IFS=$ac_save_IFS
3667   test -z "$ac_dir" && ac_dir=.
3668   $as_executable_p "$ac_dir/$ac_word" || continue
3669 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3670 echo "$as_me:3670: found $ac_dir/$ac_word" >&5
3671 break
3672 done
3673
3674   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3675 fi
3676 fi
3677 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3678 if test -n "$MAKE_UPPER_TAGS"; then
3679   echo "$as_me:3679: result: $MAKE_UPPER_TAGS" >&5
3680 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3681 else
3682   echo "$as_me:3682: result: no" >&5
3683 echo "${ECHO_T}no" >&6
3684 fi
3685
3686 else
3687         MAKE_UPPER_TAGS=no
3688 fi
3689
3690 if test "$MAKE_UPPER_TAGS" = yes ; then
3691         MAKE_UPPER_TAGS=
3692 else
3693         MAKE_UPPER_TAGS="#"
3694 fi
3695
3696 if test "$MAKE_LOWER_TAGS" = yes ; then
3697         MAKE_LOWER_TAGS=
3698 else
3699         MAKE_LOWER_TAGS="#"
3700 fi
3701
3702 echo "$as_me:3702: checking for makeflags variable" >&5
3703 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3704 if test "${cf_cv_makeflags+set}" = set; then
3705   echo $ECHO_N "(cached) $ECHO_C" >&6
3706 else
3707
3708         cf_cv_makeflags=''
3709         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3710         do
3711                 cat >cf_makeflags.tmp <<CF_EOF
3712 SHELL = $SHELL
3713 all :
3714         @ echo '.$cf_option'
3715 CF_EOF
3716                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3717                 case "$cf_result" in
3718                 (.*k|.*kw)
3719                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3720                         case "$cf_result" in
3721                         (.*CC=*)        cf_cv_makeflags=
3722                                 ;;
3723                         (*)     cf_cv_makeflags=$cf_option
3724                                 ;;
3725                         esac
3726                         break
3727                         ;;
3728                 (.-)
3729                         ;;
3730                 (*)
3731
3732 echo "${as_me:-configure}:3732: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3733
3734                         ;;
3735                 esac
3736         done
3737         rm -f cf_makeflags.tmp
3738
3739 fi
3740 echo "$as_me:3740: result: $cf_cv_makeflags" >&5
3741 echo "${ECHO_T}$cf_cv_makeflags" >&6
3742
3743 if test -n "$ac_tool_prefix"; then
3744   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3745 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3746 echo "$as_me:3746: checking for $ac_word" >&5
3747 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3748 if test "${ac_cv_prog_RANLIB+set}" = set; then
3749   echo $ECHO_N "(cached) $ECHO_C" >&6
3750 else
3751   if test -n "$RANLIB"; then
3752   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3753 else
3754   ac_save_IFS=$IFS; IFS=$ac_path_separator
3755 ac_dummy="$PATH"
3756 for ac_dir in $ac_dummy; do
3757   IFS=$ac_save_IFS
3758   test -z "$ac_dir" && ac_dir=.
3759   $as_executable_p "$ac_dir/$ac_word" || continue
3760 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3761 echo "$as_me:3761: found $ac_dir/$ac_word" >&5
3762 break
3763 done
3764
3765 fi
3766 fi
3767 RANLIB=$ac_cv_prog_RANLIB
3768 if test -n "$RANLIB"; then
3769   echo "$as_me:3769: result: $RANLIB" >&5
3770 echo "${ECHO_T}$RANLIB" >&6
3771 else
3772   echo "$as_me:3772: result: no" >&5
3773 echo "${ECHO_T}no" >&6
3774 fi
3775
3776 fi
3777 if test -z "$ac_cv_prog_RANLIB"; then
3778   ac_ct_RANLIB=$RANLIB
3779   # Extract the first word of "ranlib", so it can be a program name with args.
3780 set dummy ranlib; ac_word=$2
3781 echo "$as_me:3781: checking for $ac_word" >&5
3782 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3783 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3784   echo $ECHO_N "(cached) $ECHO_C" >&6
3785 else
3786   if test -n "$ac_ct_RANLIB"; then
3787   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3788 else
3789   ac_save_IFS=$IFS; IFS=$ac_path_separator
3790 ac_dummy="$PATH"
3791 for ac_dir in $ac_dummy; do
3792   IFS=$ac_save_IFS
3793   test -z "$ac_dir" && ac_dir=.
3794   $as_executable_p "$ac_dir/$ac_word" || continue
3795 ac_cv_prog_ac_ct_RANLIB="ranlib"
3796 echo "$as_me:3796: found $ac_dir/$ac_word" >&5
3797 break
3798 done
3799
3800   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3801 fi
3802 fi
3803 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3804 if test -n "$ac_ct_RANLIB"; then
3805   echo "$as_me:3805: result: $ac_ct_RANLIB" >&5
3806 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3807 else
3808   echo "$as_me:3808: result: no" >&5
3809 echo "${ECHO_T}no" >&6
3810 fi
3811
3812   RANLIB=$ac_ct_RANLIB
3813 else
3814   RANLIB="$ac_cv_prog_RANLIB"
3815 fi
3816
3817 if test -n "$ac_tool_prefix"; then
3818   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3819 set dummy ${ac_tool_prefix}ld; ac_word=$2
3820 echo "$as_me:3820: checking for $ac_word" >&5
3821 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3822 if test "${ac_cv_prog_LD+set}" = set; then
3823   echo $ECHO_N "(cached) $ECHO_C" >&6
3824 else
3825   if test -n "$LD"; then
3826   ac_cv_prog_LD="$LD" # Let the user override the test.
3827 else
3828   ac_save_IFS=$IFS; IFS=$ac_path_separator
3829 ac_dummy="$PATH"
3830 for ac_dir in $ac_dummy; do
3831   IFS=$ac_save_IFS
3832   test -z "$ac_dir" && ac_dir=.
3833   $as_executable_p "$ac_dir/$ac_word" || continue
3834 ac_cv_prog_LD="${ac_tool_prefix}ld"
3835 echo "$as_me:3835: found $ac_dir/$ac_word" >&5
3836 break
3837 done
3838
3839 fi
3840 fi
3841 LD=$ac_cv_prog_LD
3842 if test -n "$LD"; then
3843   echo "$as_me:3843: result: $LD" >&5
3844 echo "${ECHO_T}$LD" >&6
3845 else
3846   echo "$as_me:3846: result: no" >&5
3847 echo "${ECHO_T}no" >&6
3848 fi
3849
3850 fi
3851 if test -z "$ac_cv_prog_LD"; then
3852   ac_ct_LD=$LD
3853   # Extract the first word of "ld", so it can be a program name with args.
3854 set dummy ld; ac_word=$2
3855 echo "$as_me:3855: checking for $ac_word" >&5
3856 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3857 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3858   echo $ECHO_N "(cached) $ECHO_C" >&6
3859 else
3860   if test -n "$ac_ct_LD"; then
3861   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3862 else
3863   ac_save_IFS=$IFS; IFS=$ac_path_separator
3864 ac_dummy="$PATH"
3865 for ac_dir in $ac_dummy; do
3866   IFS=$ac_save_IFS
3867   test -z "$ac_dir" && ac_dir=.
3868   $as_executable_p "$ac_dir/$ac_word" || continue
3869 ac_cv_prog_ac_ct_LD="ld"
3870 echo "$as_me:3870: found $ac_dir/$ac_word" >&5
3871 break
3872 done
3873
3874   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3875 fi
3876 fi
3877 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3878 if test -n "$ac_ct_LD"; then
3879   echo "$as_me:3879: result: $ac_ct_LD" >&5
3880 echo "${ECHO_T}$ac_ct_LD" >&6
3881 else
3882   echo "$as_me:3882: result: no" >&5
3883 echo "${ECHO_T}no" >&6
3884 fi
3885
3886   LD=$ac_ct_LD
3887 else
3888   LD="$ac_cv_prog_LD"
3889 fi
3890
3891 if test -n "$ac_tool_prefix"; then
3892   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3893 set dummy ${ac_tool_prefix}ar; ac_word=$2
3894 echo "$as_me:3894: checking for $ac_word" >&5
3895 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3896 if test "${ac_cv_prog_AR+set}" = set; then
3897   echo $ECHO_N "(cached) $ECHO_C" >&6
3898 else
3899   if test -n "$AR"; then
3900   ac_cv_prog_AR="$AR" # Let the user override the test.
3901 else
3902   ac_save_IFS=$IFS; IFS=$ac_path_separator
3903 ac_dummy="$PATH"
3904 for ac_dir in $ac_dummy; do
3905   IFS=$ac_save_IFS
3906   test -z "$ac_dir" && ac_dir=.
3907   $as_executable_p "$ac_dir/$ac_word" || continue
3908 ac_cv_prog_AR="${ac_tool_prefix}ar"
3909 echo "$as_me:3909: found $ac_dir/$ac_word" >&5
3910 break
3911 done
3912
3913 fi
3914 fi
3915 AR=$ac_cv_prog_AR
3916 if test -n "$AR"; then
3917   echo "$as_me:3917: result: $AR" >&5
3918 echo "${ECHO_T}$AR" >&6
3919 else
3920   echo "$as_me:3920: result: no" >&5
3921 echo "${ECHO_T}no" >&6
3922 fi
3923
3924 fi
3925 if test -z "$ac_cv_prog_AR"; then
3926   ac_ct_AR=$AR
3927   # Extract the first word of "ar", so it can be a program name with args.
3928 set dummy ar; ac_word=$2
3929 echo "$as_me:3929: checking for $ac_word" >&5
3930 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3931 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3932   echo $ECHO_N "(cached) $ECHO_C" >&6
3933 else
3934   if test -n "$ac_ct_AR"; then
3935   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3936 else
3937   ac_save_IFS=$IFS; IFS=$ac_path_separator
3938 ac_dummy="$PATH"
3939 for ac_dir in $ac_dummy; do
3940   IFS=$ac_save_IFS
3941   test -z "$ac_dir" && ac_dir=.
3942   $as_executable_p "$ac_dir/$ac_word" || continue
3943 ac_cv_prog_ac_ct_AR="ar"
3944 echo "$as_me:3944: found $ac_dir/$ac_word" >&5
3945 break
3946 done
3947
3948   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3949 fi
3950 fi
3951 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3952 if test -n "$ac_ct_AR"; then
3953   echo "$as_me:3953: result: $ac_ct_AR" >&5
3954 echo "${ECHO_T}$ac_ct_AR" >&6
3955 else
3956   echo "$as_me:3956: result: no" >&5
3957 echo "${ECHO_T}no" >&6
3958 fi
3959
3960   AR=$ac_ct_AR
3961 else
3962   AR="$ac_cv_prog_AR"
3963 fi
3964
3965 if test -n "$ac_tool_prefix"; then
3966   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3967 set dummy ${ac_tool_prefix}ar; ac_word=$2
3968 echo "$as_me:3968: checking for $ac_word" >&5
3969 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3970 if test "${ac_cv_prog_AR+set}" = set; then
3971   echo $ECHO_N "(cached) $ECHO_C" >&6
3972 else
3973   if test -n "$AR"; then
3974   ac_cv_prog_AR="$AR" # Let the user override the test.
3975 else
3976   ac_save_IFS=$IFS; IFS=$ac_path_separator
3977 ac_dummy="$PATH"
3978 for ac_dir in $ac_dummy; do
3979   IFS=$ac_save_IFS
3980   test -z "$ac_dir" && ac_dir=.
3981   $as_executable_p "$ac_dir/$ac_word" || continue
3982 ac_cv_prog_AR="${ac_tool_prefix}ar"
3983 echo "$as_me:3983: found $ac_dir/$ac_word" >&5
3984 break
3985 done
3986
3987 fi
3988 fi
3989 AR=$ac_cv_prog_AR
3990 if test -n "$AR"; then
3991   echo "$as_me:3991: result: $AR" >&5
3992 echo "${ECHO_T}$AR" >&6
3993 else
3994   echo "$as_me:3994: result: no" >&5
3995 echo "${ECHO_T}no" >&6
3996 fi
3997
3998 fi
3999 if test -z "$ac_cv_prog_AR"; then
4000   ac_ct_AR=$AR
4001   # Extract the first word of "ar", so it can be a program name with args.
4002 set dummy ar; ac_word=$2
4003 echo "$as_me:4003: checking for $ac_word" >&5
4004 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4005 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4006   echo $ECHO_N "(cached) $ECHO_C" >&6
4007 else
4008   if test -n "$ac_ct_AR"; then
4009   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4010 else
4011   ac_save_IFS=$IFS; IFS=$ac_path_separator
4012 ac_dummy="$PATH"
4013 for ac_dir in $ac_dummy; do
4014   IFS=$ac_save_IFS
4015   test -z "$ac_dir" && ac_dir=.
4016   $as_executable_p "$ac_dir/$ac_word" || continue
4017 ac_cv_prog_ac_ct_AR="ar"
4018 echo "$as_me:4018: found $ac_dir/$ac_word" >&5
4019 break
4020 done
4021
4022   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4023 fi
4024 fi
4025 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4026 if test -n "$ac_ct_AR"; then
4027   echo "$as_me:4027: result: $ac_ct_AR" >&5
4028 echo "${ECHO_T}$ac_ct_AR" >&6
4029 else
4030   echo "$as_me:4030: result: no" >&5
4031 echo "${ECHO_T}no" >&6
4032 fi
4033
4034   AR=$ac_ct_AR
4035 else
4036   AR="$ac_cv_prog_AR"
4037 fi
4038
4039 echo "$as_me:4039: checking for options to update archives" >&5
4040 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4041 if test "${cf_cv_ar_flags+set}" = set; then
4042   echo $ECHO_N "(cached) $ECHO_C" >&6
4043 else
4044
4045         case "$cf_cv_system_name" in
4046         (*-msvc*)
4047                 cf_cv_ar_flags=''
4048                 cat >mk_static_lib.sh <<-EOF
4049                 #!$SHELL
4050                 MSVC_BIN="$AR"
4051                 out="\$1"
4052                 shift
4053                 exec \$MSVC_BIN -out:"\$out" \$@
4054                 EOF
4055                 chmod +x mk_static_lib.sh
4056                 AR=`pwd`/mk_static_lib.sh
4057                 ;;
4058         (*)
4059                 cf_cv_ar_flags=unknown
4060                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4061                 do
4062
4063                         # check if $ARFLAGS already contains this choice
4064                         if test "x$ARFLAGS" != "x" ; then
4065                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4066                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4067                                         cf_cv_ar_flags=
4068                                         break
4069                                 fi
4070                         fi
4071
4072                         rm -f "conftest.$ac_cv_objext"
4073                         rm -f conftest.a
4074
4075                         cat >"conftest.$ac_ext" <<EOF
4076 #line 4076 "configure"
4077 int     testdata[3] = { 123, 456, 789 };
4078 EOF
4079                         if { (eval echo "$as_me:4079: \"$ac_compile\"") >&5
4080   (eval $ac_compile) 2>&5
4081   ac_status=$?
4082   echo "$as_me:4082: \$? = $ac_status" >&5
4083   (exit "$ac_status"); } ; then
4084                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4085                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4086                                 if test -f conftest.a ; then
4087                                         cf_cv_ar_flags="$cf_ar_flags"
4088                                         break
4089                                 fi
4090                         else
4091                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4092
4093 echo "${as_me:-configure}:4093: testing cannot compile test-program ..." 1>&5
4094
4095                                 break
4096                         fi
4097                 done
4098                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4099                 ;;
4100         esac
4101
4102 fi
4103 echo "$as_me:4103: result: $cf_cv_ar_flags" >&5
4104 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4105
4106 if test -n "$ARFLAGS" ; then
4107         if test -n "$cf_cv_ar_flags" ; then
4108                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4109         fi
4110 else
4111         ARFLAGS=$cf_cv_ar_flags
4112 fi
4113
4114         echo "$as_me:4114: checking for PATH separator" >&5
4115 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4116         case "$cf_cv_system_name" in
4117         (os2*)  PATH_SEPARATOR=';'  ;;
4118         (*)     ${PATH_SEPARATOR:=':'}  ;;
4119         esac
4120
4121         echo "$as_me:4121: result: $PATH_SEPARATOR" >&5
4122 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4123
4124 echo "$as_me:4124: checking if you have specified an install-prefix" >&5
4125 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4126
4127 # Check whether --with-install-prefix or --without-install-prefix was given.
4128 if test "${with_install_prefix+set}" = set; then
4129   withval="$with_install_prefix"
4130   case "$withval" in
4131         (yes|no)
4132                 ;;
4133         (*)     DESTDIR="$withval"
4134                 ;;
4135         esac
4136 fi;
4137 echo "$as_me:4137: result: $DESTDIR" >&5
4138 echo "${ECHO_T}$DESTDIR" >&6
4139
4140 ###############################################################################
4141
4142 # If we're cross-compiling, allow the user to override the tools and their
4143 # options.  The configure script is oriented toward identifying the host
4144 # compiler, etc., but we need a build compiler to generate parts of the source.
4145
4146 if test "$cross_compiling" = yes ; then
4147
4148         # defaults that we might want to override
4149         : ${BUILD_CFLAGS:=''}
4150         : ${BUILD_CPPFLAGS:=''}
4151         : ${BUILD_LDFLAGS:=''}
4152         : ${BUILD_LIBS:=''}
4153         : ${BUILD_EXEEXT:='$x'}
4154         : ${BUILD_OBJEXT:='o'}
4155
4156 # Check whether --with-build-cc or --without-build-cc was given.
4157 if test "${with_build_cc+set}" = set; then
4158   withval="$with_build_cc"
4159   BUILD_CC="$withval"
4160 else
4161   for ac_prog in gcc clang c99 c89 cc cl
4162 do
4163   # Extract the first word of "$ac_prog", so it can be a program name with args.
4164 set dummy $ac_prog; ac_word=$2
4165 echo "$as_me:4165: checking for $ac_word" >&5
4166 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4167 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4168   echo $ECHO_N "(cached) $ECHO_C" >&6
4169 else
4170   if test -n "$BUILD_CC"; then
4171   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4172 else
4173   ac_save_IFS=$IFS; IFS=$ac_path_separator
4174 ac_dummy="$PATH"
4175 for ac_dir in $ac_dummy; do
4176   IFS=$ac_save_IFS
4177   test -z "$ac_dir" && ac_dir=.
4178   $as_executable_p "$ac_dir/$ac_word" || continue
4179 ac_cv_prog_BUILD_CC="$ac_prog"
4180 echo "$as_me:4180: found $ac_dir/$ac_word" >&5
4181 break
4182 done
4183
4184 fi
4185 fi
4186 BUILD_CC=$ac_cv_prog_BUILD_CC
4187 if test -n "$BUILD_CC"; then
4188   echo "$as_me:4188: result: $BUILD_CC" >&5
4189 echo "${ECHO_T}$BUILD_CC" >&6
4190 else
4191   echo "$as_me:4191: result: no" >&5
4192 echo "${ECHO_T}no" >&6
4193 fi
4194
4195   test -n "$BUILD_CC" && break
4196 done
4197 test -n "$BUILD_CC" || BUILD_CC="none"
4198
4199 fi;
4200         echo "$as_me:4200: checking for native build C compiler" >&5
4201 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4202         echo "$as_me:4202: result: $BUILD_CC" >&5
4203 echo "${ECHO_T}$BUILD_CC" >&6
4204
4205         echo "$as_me:4205: checking for native build C preprocessor" >&5
4206 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4207
4208 # Check whether --with-build-cpp or --without-build-cpp was given.
4209 if test "${with_build_cpp+set}" = set; then
4210   withval="$with_build_cpp"
4211   BUILD_CPP="$withval"
4212 else
4213   BUILD_CPP='${BUILD_CC} -E'
4214 fi;
4215         echo "$as_me:4215: result: $BUILD_CPP" >&5
4216 echo "${ECHO_T}$BUILD_CPP" >&6
4217
4218         echo "$as_me:4218: checking for native build C flags" >&5
4219 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4220
4221 # Check whether --with-build-cflags or --without-build-cflags was given.
4222 if test "${with_build_cflags+set}" = set; then
4223   withval="$with_build_cflags"
4224   BUILD_CFLAGS="$withval"
4225 fi;
4226         echo "$as_me:4226: result: $BUILD_CFLAGS" >&5
4227 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4228
4229         echo "$as_me:4229: checking for native build C preprocessor-flags" >&5
4230 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4231
4232 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4233 if test "${with_build_cppflags+set}" = set; then
4234   withval="$with_build_cppflags"
4235   BUILD_CPPFLAGS="$withval"
4236 fi;
4237         echo "$as_me:4237: result: $BUILD_CPPFLAGS" >&5
4238 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4239
4240         echo "$as_me:4240: checking for native build linker-flags" >&5
4241 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4242
4243 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4244 if test "${with_build_ldflags+set}" = set; then
4245   withval="$with_build_ldflags"
4246   BUILD_LDFLAGS="$withval"
4247 fi;
4248         echo "$as_me:4248: result: $BUILD_LDFLAGS" >&5
4249 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4250
4251         echo "$as_me:4251: checking for native build linker-libraries" >&5
4252 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4253
4254 # Check whether --with-build-libs or --without-build-libs was given.
4255 if test "${with_build_libs+set}" = set; then
4256   withval="$with_build_libs"
4257   BUILD_LIBS="$withval"
4258 fi;
4259         echo "$as_me:4259: result: $BUILD_LIBS" >&5
4260 echo "${ECHO_T}$BUILD_LIBS" >&6
4261
4262         # this assumes we're on Unix.
4263         BUILD_EXEEXT=
4264         BUILD_OBJEXT=o
4265
4266         : ${BUILD_CC:='${CC}'}
4267
4268         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4269                 { { echo "$as_me:4269: error: Cross-build requires two compilers.
4270 Use --with-build-cc to specify the native compiler." >&5
4271 echo "$as_me: error: Cross-build requires two compilers.
4272 Use --with-build-cc to specify the native compiler." >&2;}
4273    { (exit 1); exit 1; }; }
4274         fi
4275
4276 else
4277         : ${BUILD_CC:='${CC}'}
4278         : ${BUILD_CPP:='${CPP}'}
4279         : ${BUILD_CFLAGS:='${CFLAGS}'}
4280         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4281         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4282         : ${BUILD_LIBS:='${LIBS}'}
4283         : ${BUILD_EXEEXT:='$x'}
4284         : ${BUILD_OBJEXT:='o'}
4285 fi
4286
4287 ###############################################################################
4288
4289 ### Options to allow the user to specify the set of libraries which are used.
4290 ### Use "--without-normal --with-shared" to allow the default model to be
4291 ### shared, for example.
4292 cf_list_models=""
4293
4294 echo "$as_me:4294: checking if you want to build shared C-objects" >&5
4295 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4296
4297 # Check whether --with-shared or --without-shared was given.
4298 if test "${with_shared+set}" = set; then
4299   withval="$with_shared"
4300   with_shared=$withval
4301 else
4302   with_shared=no
4303 fi;
4304 echo "$as_me:4304: result: $with_shared" >&5
4305 echo "${ECHO_T}$with_shared" >&6
4306 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4307
4308 echo "$as_me:4308: checking for specified models" >&5
4309 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4310 test -z "$cf_list_models" && cf_list_models=normal
4311 echo "$as_me:4311: result: $cf_list_models" >&5
4312 echo "${ECHO_T}$cf_list_models" >&6
4313
4314 ### Use the first model as the default, and save its suffix for use in building
4315 ### up test-applications.
4316 echo "$as_me:4316: checking for default model" >&5
4317 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4318 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4319 echo "$as_me:4319: result: $DFT_LWR_MODEL" >&5
4320 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4321
4322 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4323
4324 echo "$as_me:4324: checking for specific curses-directory" >&5
4325 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4326
4327 # Check whether --with-curses-dir or --without-curses-dir was given.
4328 if test "${with_curses_dir+set}" = set; then
4329   withval="$with_curses_dir"
4330   cf_cv_curses_dir=$withval
4331 else
4332   cf_cv_curses_dir=no
4333 fi;
4334 echo "$as_me:4334: result: $cf_cv_curses_dir" >&5
4335 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4336
4337 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4338 then
4339
4340 if test "x$prefix" != xNONE; then
4341         cf_path_syntax="$prefix"
4342 else
4343         cf_path_syntax="$ac_default_prefix"
4344 fi
4345
4346 case ".$withval" in
4347 (.\$\(*\)*|.\'*\'*)
4348         ;;
4349 (..|./*|.\\*)
4350         ;;
4351 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4352         ;;
4353 (.\$\{*prefix\}*|.\$\{*dir\}*)
4354         eval withval="$withval"
4355         case ".$withval" in
4356         (.NONE/*)
4357                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4358                 ;;
4359         esac
4360         ;;
4361 (.no|.NONE/*)
4362         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4363         ;;
4364 (*)
4365         { { echo "$as_me:4365: error: expected a pathname, not \"$withval\"" >&5
4366 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4367    { (exit 1); exit 1; }; }
4368         ;;
4369 esac
4370
4371         if test -d "$cf_cv_curses_dir"
4372         then
4373
4374 if test -n "$cf_cv_curses_dir/include" ; then
4375   for cf_add_incdir in $cf_cv_curses_dir/include
4376   do
4377         while test "$cf_add_incdir" != /usr/include
4378         do
4379           if test -d "$cf_add_incdir"
4380           then
4381                 cf_have_incdir=no
4382                 if test -n "$CFLAGS$CPPFLAGS" ; then
4383                   # a loop is needed to ensure we can add subdirs of existing dirs
4384                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4385                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4386                           cf_have_incdir=yes; break
4387                         fi
4388                   done
4389                 fi
4390
4391                 if test "$cf_have_incdir" = no ; then
4392                   if test "$cf_add_incdir" = /usr/local/include ; then
4393                         if test "$GCC" = yes
4394                         then
4395                           cf_save_CPPFLAGS=$CPPFLAGS
4396
4397         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4398         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4399
4400                           cat >"conftest.$ac_ext" <<_ACEOF
4401 #line 4401 "configure"
4402 #include "confdefs.h"
4403 #include <stdio.h>
4404 int
4405 main (void)
4406 {
4407 printf("Hello")
4408   ;
4409   return 0;
4410 }
4411 _ACEOF
4412 rm -f "conftest.$ac_objext"
4413 if { (eval echo "$as_me:4413: \"$ac_compile\"") >&5
4414   (eval $ac_compile) 2>&5
4415   ac_status=$?
4416   echo "$as_me:4416: \$? = $ac_status" >&5
4417   (exit "$ac_status"); } &&
4418          { ac_try='test -s "conftest.$ac_objext"'
4419   { (eval echo "$as_me:4419: \"$ac_try\"") >&5
4420   (eval $ac_try) 2>&5
4421   ac_status=$?
4422   echo "$as_me:4422: \$? = $ac_status" >&5
4423   (exit "$ac_status"); }; }; then
4424   :
4425 else
4426   echo "$as_me: failed program was:" >&5
4427 cat "conftest.$ac_ext" >&5
4428 cf_have_incdir=yes
4429 fi
4430 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4431                           CPPFLAGS=$cf_save_CPPFLAGS
4432                         fi
4433                   fi
4434                 fi
4435
4436                 if test "$cf_have_incdir" = no ; then
4437                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4438
4439 echo "${as_me:-configure}:4439: testing adding $cf_add_incdir to include-path ..." 1>&5
4440
4441                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4442
4443                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4444                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4445                   cf_add_incdir="$cf_top_incdir"
4446                 else
4447                   break
4448                 fi
4449           else
4450                 break
4451           fi
4452         done
4453   done
4454 fi
4455
4456 if test -n "$cf_cv_curses_dir/lib" ; then
4457         for cf_add_libdir in $cf_cv_curses_dir/lib
4458         do
4459                 if test "$cf_add_libdir" = /usr/lib ; then
4460                         :
4461                 elif test -d "$cf_add_libdir"
4462                 then
4463                         cf_have_libdir=no
4464                         if test -n "$LDFLAGS$LIBS" ; then
4465                                 # a loop is needed to ensure we can add subdirs of existing dirs
4466                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4467                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4468                                                 cf_have_libdir=yes; break
4469                                         fi
4470                                 done
4471                         fi
4472                         if test "$cf_have_libdir" = no ; then
4473                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4474
4475 echo "${as_me:-configure}:4475: testing adding $cf_add_libdir to library-path ..." 1>&5
4476
4477                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4478                         fi
4479                 fi
4480         done
4481 fi
4482
4483         fi
4484 fi
4485
4486 cf_ncuconfig_root=ncurses
4487 cf_have_ncuconfig=no
4488
4489 if test "x${PKG_CONFIG:=none}" != xnone; then
4490         echo "$as_me:4490: checking pkg-config for $cf_ncuconfig_root" >&5
4491 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4492         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4493                 echo "$as_me:4493: result: yes" >&5
4494 echo "${ECHO_T}yes" >&6
4495
4496                 echo "$as_me:4496: checking if the $cf_ncuconfig_root package files work" >&5
4497 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4498                 cf_have_ncuconfig=unknown
4499
4500                 cf_save_CFLAGS="$CFLAGS"
4501                 cf_save_CPPFLAGS="$CPPFLAGS"
4502                 cf_save_LIBS="$LIBS"
4503
4504                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4505                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4506
4507                 # while -W for passing linker flags is prevalent, it is not "standard".
4508                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4509                 # incompatible _and_ non-standard -W option which gives an error.  Work
4510                 # around that pitfall.
4511                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4512                 (x*c[89]9@@*-W*)
4513
4514 cf_fix_cppflags=no
4515 cf_new_cflags=
4516 cf_new_cppflags=
4517 cf_new_extra_cppflags=
4518
4519 for cf_add_cflags in $cf_pkg_cflags
4520 do
4521 case "$cf_fix_cppflags" in
4522 (no)
4523         case "$cf_add_cflags" in
4524         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4525                 case "$cf_add_cflags" in
4526                 (-D*)
4527                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4528
4529                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4530                                 && test -z "${cf_tst_cflags}" \
4531                                 && cf_fix_cppflags=yes
4532
4533                         if test "$cf_fix_cppflags" = yes ; then
4534
4535         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4536         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4537
4538                                 continue
4539                         elif test "${cf_tst_cflags}" = "\"'" ; then
4540
4541         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4542         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4543
4544                                 continue
4545                         fi
4546                         ;;
4547                 esac
4548                 case "$CPPFLAGS" in
4549                 (*$cf_add_cflags)
4550                         ;;
4551                 (*)
4552                         case "$cf_add_cflags" in
4553                         (-D*)
4554                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4555
4556 CPPFLAGS=`echo "$CPPFLAGS" | \
4557         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4558                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4559
4560                                 ;;
4561                         esac
4562
4563         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4564         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4565
4566                         ;;
4567                 esac
4568                 ;;
4569         (*)
4570
4571         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4572         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4573
4574                 ;;
4575         esac
4576         ;;
4577 (yes)
4578
4579         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4580         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4581
4582         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4583
4584         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4585                 && test -z "${cf_tst_cflags}" \
4586                 && cf_fix_cppflags=no
4587         ;;
4588 esac
4589 done
4590
4591 if test -n "$cf_new_cflags" ; then
4592
4593         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4594         CFLAGS="${CFLAGS}$cf_new_cflags"
4595
4596 fi
4597
4598 if test -n "$cf_new_cppflags" ; then
4599
4600         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4601         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4602
4603 fi
4604
4605 if test -n "$cf_new_extra_cppflags" ; then
4606
4607         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4608         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4609
4610 fi
4611
4612 cf_add_libs="$LIBS"
4613 # reverse order
4614 cf_add_0lib=
4615 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4616 # filter duplicates
4617 for cf_add_1lib in $cf_add_0lib; do
4618         for cf_add_2lib in $cf_add_libs; do
4619                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4620                         cf_add_1lib=
4621                         break
4622                 fi
4623         done
4624         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4625 done
4626 LIBS="$cf_add_libs"
4627
4628                         cat >"conftest.$ac_ext" <<_ACEOF
4629 #line 4629 "configure"
4630 #include "confdefs.h"
4631 #include <${cf_cv_ncurses_header:-curses.h}>
4632 int
4633 main (void)
4634 {
4635 initscr(); mousemask(0,0); tigetstr((char *)0);
4636   ;
4637   return 0;
4638 }
4639 _ACEOF
4640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4641 if { (eval echo "$as_me:4641: \"$ac_link\"") >&5
4642   (eval $ac_link) 2>&5
4643   ac_status=$?
4644   echo "$as_me:4644: \$? = $ac_status" >&5
4645   (exit "$ac_status"); } &&
4646          { ac_try='test -s "conftest$ac_exeext"'
4647   { (eval echo "$as_me:4647: \"$ac_try\"") >&5
4648   (eval $ac_try) 2>&5
4649   ac_status=$?
4650   echo "$as_me:4650: \$? = $ac_status" >&5
4651   (exit "$ac_status"); }; }; then
4652   if test "$cross_compiling" = yes; then
4653   cf_test_ncuconfig=maybe
4654 else
4655   cat >"conftest.$ac_ext" <<_ACEOF
4656 #line 4656 "configure"
4657 #include "confdefs.h"
4658 #include <${cf_cv_ncurses_header:-curses.h}>
4659                                         int main(void)
4660                                         { const char *xx = curses_version(); return (xx == 0); }
4661 _ACEOF
4662 rm -f "conftest$ac_exeext"
4663 if { (eval echo "$as_me:4663: \"$ac_link\"") >&5
4664   (eval $ac_link) 2>&5
4665   ac_status=$?
4666   echo "$as_me:4666: \$? = $ac_status" >&5
4667   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4668   { (eval echo "$as_me:4668: \"$ac_try\"") >&5
4669   (eval $ac_try) 2>&5
4670   ac_status=$?
4671   echo "$as_me:4671: \$? = $ac_status" >&5
4672   (exit "$ac_status"); }; }; then
4673   cf_test_ncuconfig=yes
4674 else
4675   echo "$as_me: program exited with status $ac_status" >&5
4676 echo "$as_me: failed program was:" >&5
4677 cat "conftest.$ac_ext" >&5
4678 cf_test_ncuconfig=no
4679 fi
4680 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4681 fi
4682 else
4683   echo "$as_me: failed program was:" >&5
4684 cat "conftest.$ac_ext" >&5
4685 cf_test_ncuconfig=no
4686 fi
4687 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4688
4689                         CFLAGS="$cf_save_CFLAGS"
4690                         CPPFLAGS="$cf_save_CPPFLAGS"
4691                         LIBS="$cf_save_LIBS"
4692
4693                         if test "x$cf_test_ncuconfig" != xyes; then
4694                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4695                                 cf_pkg_cflags="$cf_temp"
4696                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4697                                 cf_pkg_libs="$cf_temp"
4698                         fi
4699                         ;;
4700                 esac
4701
4702 for cf_add_cflags in $cf_pkg_cflags
4703 do
4704         case "x$cf_add_cflags" in
4705         (x-[DU]*)
4706
4707 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4708 while true
4709 do
4710         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'`
4711         test "$CFLAGS" != "$cf_old_cflag" || break
4712
4713         CFLAGS="$cf_old_cflag"
4714 done
4715
4716 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4717 while true
4718 do
4719         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'`
4720         test "$CPPFLAGS" != "$cf_old_cflag" || break
4721
4722         CPPFLAGS="$cf_old_cflag"
4723 done
4724
4725                 ;;
4726         esac
4727
4728 cf_fix_cppflags=no
4729 cf_new_cflags=
4730 cf_new_cppflags=
4731 cf_new_extra_cppflags=
4732
4733 for cf_add_cflags in $cf_add_cflags
4734 do
4735 case "$cf_fix_cppflags" in
4736 (no)
4737         case "$cf_add_cflags" in
4738         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4739                 case "$cf_add_cflags" in
4740                 (-D*)
4741                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4742
4743                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4744                                 && test -z "${cf_tst_cflags}" \
4745                                 && cf_fix_cppflags=yes
4746
4747                         if test "$cf_fix_cppflags" = yes ; then
4748
4749         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4750         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4751
4752                                 continue
4753                         elif test "${cf_tst_cflags}" = "\"'" ; then
4754
4755         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4756         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4757
4758                                 continue
4759                         fi
4760                         ;;
4761                 esac
4762                 case "$CPPFLAGS" in
4763                 (*$cf_add_cflags)
4764                         ;;
4765                 (*)
4766                         case "$cf_add_cflags" in
4767                         (-D*)
4768                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4769
4770 CPPFLAGS=`echo "$CPPFLAGS" | \
4771         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4772                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4773
4774                                 ;;
4775                         esac
4776
4777         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4778         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4779
4780                         ;;
4781                 esac
4782                 ;;
4783         (*)
4784
4785         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4786         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4787
4788                 ;;
4789         esac
4790         ;;
4791 (yes)
4792
4793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4795
4796         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4797
4798         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4799                 && test -z "${cf_tst_cflags}" \
4800                 && cf_fix_cppflags=no
4801         ;;
4802 esac
4803 done
4804
4805 if test -n "$cf_new_cflags" ; then
4806
4807         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4808         CFLAGS="${CFLAGS}$cf_new_cflags"
4809
4810 fi
4811
4812 if test -n "$cf_new_cppflags" ; then
4813
4814         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4815         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4816
4817 fi
4818
4819 if test -n "$cf_new_extra_cppflags" ; then
4820
4821         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4822         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4823
4824 fi
4825
4826 done
4827
4828 cf_add_libs="$LIBS"
4829 # reverse order
4830 cf_add_0lib=
4831 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4832 # filter duplicates
4833 for cf_add_1lib in $cf_add_0lib; do
4834         for cf_add_2lib in $cf_add_libs; do
4835                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4836                         cf_add_1lib=
4837                         break
4838                 fi
4839         done
4840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4841 done
4842 LIBS="$cf_add_libs"
4843
4844                 cat >"conftest.$ac_ext" <<_ACEOF
4845 #line 4845 "configure"
4846 #include "confdefs.h"
4847 #include <${cf_cv_ncurses_header:-curses.h}>
4848 int
4849 main (void)
4850 {
4851 initscr(); mousemask(0,0); tigetstr((char *)0);
4852   ;
4853   return 0;
4854 }
4855 _ACEOF
4856 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4857 if { (eval echo "$as_me:4857: \"$ac_link\"") >&5
4858   (eval $ac_link) 2>&5
4859   ac_status=$?
4860   echo "$as_me:4860: \$? = $ac_status" >&5
4861   (exit "$ac_status"); } &&
4862          { ac_try='test -s "conftest$ac_exeext"'
4863   { (eval echo "$as_me:4863: \"$ac_try\"") >&5
4864   (eval $ac_try) 2>&5
4865   ac_status=$?
4866   echo "$as_me:4866: \$? = $ac_status" >&5
4867   (exit "$ac_status"); }; }; then
4868   if test "$cross_compiling" = yes; then
4869   cf_have_ncuconfig=maybe
4870 else
4871   cat >"conftest.$ac_ext" <<_ACEOF
4872 #line 4872 "configure"
4873 #include "confdefs.h"
4874 #include <${cf_cv_ncurses_header:-curses.h}>
4875                                 int main(void)
4876                                 { const char *xx = curses_version(); return (xx == 0); }
4877 _ACEOF
4878 rm -f "conftest$ac_exeext"
4879 if { (eval echo "$as_me:4879: \"$ac_link\"") >&5
4880   (eval $ac_link) 2>&5
4881   ac_status=$?
4882   echo "$as_me:4882: \$? = $ac_status" >&5
4883   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4884   { (eval echo "$as_me:4884: \"$ac_try\"") >&5
4885   (eval $ac_try) 2>&5
4886   ac_status=$?
4887   echo "$as_me:4887: \$? = $ac_status" >&5
4888   (exit "$ac_status"); }; }; then
4889   cf_have_ncuconfig=yes
4890 else
4891   echo "$as_me: program exited with status $ac_status" >&5
4892 echo "$as_me: failed program was:" >&5
4893 cat "conftest.$ac_ext" >&5
4894 cf_have_ncuconfig=no
4895 fi
4896 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4897 fi
4898 else
4899   echo "$as_me: failed program was:" >&5
4900 cat "conftest.$ac_ext" >&5
4901 cf_have_ncuconfig=no
4902 fi
4903 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4904                 echo "$as_me:4904: result: $cf_have_ncuconfig" >&5
4905 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4906                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4907                 if test "$cf_have_ncuconfig" != "yes"
4908                 then
4909                         CPPFLAGS="$cf_save_CPPFLAGS"
4910                         LIBS="$cf_save_LIBS"
4911                         NCURSES_CONFIG_PKG=none
4912                 else
4913
4914 cat >>confdefs.h <<\EOF
4915 #define NCURSES 1
4916 EOF
4917
4918                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4919
4920 echo "$as_me:4920: checking for terminfo header" >&5
4921 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4922 if test "${cf_cv_term_header+set}" = set; then
4923   echo $ECHO_N "(cached) $ECHO_C" >&6
4924 else
4925
4926 case "${cf_cv_ncurses_header}" in
4927 (*/ncurses.h|*/ncursesw.h)
4928         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4929         ;;
4930 (*)
4931         cf_term_header=term.h
4932         ;;
4933 esac
4934
4935 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4936 do
4937 cat >"conftest.$ac_ext" <<_ACEOF
4938 #line 4938 "configure"
4939 #include "confdefs.h"
4940 #include <stdio.h>
4941 #include <${cf_cv_ncurses_header:-curses.h}>
4942 #include <$cf_test>
4943
4944 int
4945 main (void)
4946 {
4947 int x = auto_left_margin; (void)x
4948   ;
4949   return 0;
4950 }
4951 _ACEOF
4952 rm -f "conftest.$ac_objext"
4953 if { (eval echo "$as_me:4953: \"$ac_compile\"") >&5
4954   (eval $ac_compile) 2>&5
4955   ac_status=$?
4956   echo "$as_me:4956: \$? = $ac_status" >&5
4957   (exit "$ac_status"); } &&
4958          { ac_try='test -s "conftest.$ac_objext"'
4959   { (eval echo "$as_me:4959: \"$ac_try\"") >&5
4960   (eval $ac_try) 2>&5
4961   ac_status=$?
4962   echo "$as_me:4962: \$? = $ac_status" >&5
4963   (exit "$ac_status"); }; }; then
4964
4965         cf_cv_term_header="$cf_test"
4966 else
4967   echo "$as_me: failed program was:" >&5
4968 cat "conftest.$ac_ext" >&5
4969
4970         cf_cv_term_header=unknown
4971
4972 fi
4973 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4974         test "$cf_cv_term_header" != unknown && break
4975 done
4976
4977 fi
4978 echo "$as_me:4978: result: $cf_cv_term_header" >&5
4979 echo "${ECHO_T}$cf_cv_term_header" >&6
4980
4981 # Set definitions to allow ifdef'ing to accommodate subdirectories
4982
4983 case "$cf_cv_term_header" in
4984 (*term.h)
4985
4986 cat >>confdefs.h <<\EOF
4987 #define HAVE_TERM_H 1
4988 EOF
4989
4990         ;;
4991 esac
4992
4993 case "$cf_cv_term_header" in
4994 (ncurses/term.h)
4995
4996 cat >>confdefs.h <<\EOF
4997 #define HAVE_NCURSES_TERM_H 1
4998 EOF
4999
5000         ;;
5001 (ncursesw/term.h)
5002
5003 cat >>confdefs.h <<\EOF
5004 #define HAVE_NCURSESW_TERM_H 1
5005 EOF
5006
5007         ;;
5008 esac
5009
5010                 fi
5011
5012         else
5013                 echo "$as_me:5013: result: no" >&5
5014 echo "${ECHO_T}no" >&6
5015                 NCURSES_CONFIG_PKG=none
5016         fi
5017 else
5018         NCURSES_CONFIG_PKG=none
5019 fi
5020
5021 if test "x$cf_have_ncuconfig" = "xno"; then
5022         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5023
5024 if test -n "$ac_tool_prefix"; then
5025   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5026   do
5027     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5028 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5029 echo "$as_me:5029: checking for $ac_word" >&5
5030 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5031 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5032   echo $ECHO_N "(cached) $ECHO_C" >&6
5033 else
5034   if test -n "$NCURSES_CONFIG"; then
5035   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5036 else
5037   ac_save_IFS=$IFS; IFS=$ac_path_separator
5038 ac_dummy="$PATH"
5039 for ac_dir in $ac_dummy; do
5040   IFS=$ac_save_IFS
5041   test -z "$ac_dir" && ac_dir=.
5042   $as_executable_p "$ac_dir/$ac_word" || continue
5043 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5044 echo "$as_me:5044: found $ac_dir/$ac_word" >&5
5045 break
5046 done
5047
5048 fi
5049 fi
5050 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5051 if test -n "$NCURSES_CONFIG"; then
5052   echo "$as_me:5052: result: $NCURSES_CONFIG" >&5
5053 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5054 else
5055   echo "$as_me:5055: result: no" >&5
5056 echo "${ECHO_T}no" >&6
5057 fi
5058
5059     test -n "$NCURSES_CONFIG" && break
5060   done
5061 fi
5062 if test -z "$NCURSES_CONFIG"; then
5063   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5064   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5065 do
5066   # Extract the first word of "$ac_prog", so it can be a program name with args.
5067 set dummy $ac_prog; ac_word=$2
5068 echo "$as_me:5068: checking for $ac_word" >&5
5069 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5070 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5071   echo $ECHO_N "(cached) $ECHO_C" >&6
5072 else
5073   if test -n "$ac_ct_NCURSES_CONFIG"; then
5074   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5075 else
5076   ac_save_IFS=$IFS; IFS=$ac_path_separator
5077 ac_dummy="$PATH"
5078 for ac_dir in $ac_dummy; do
5079   IFS=$ac_save_IFS
5080   test -z "$ac_dir" && ac_dir=.
5081   $as_executable_p "$ac_dir/$ac_word" || continue
5082 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5083 echo "$as_me:5083: found $ac_dir/$ac_word" >&5
5084 break
5085 done
5086
5087 fi
5088 fi
5089 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5090 if test -n "$ac_ct_NCURSES_CONFIG"; then
5091   echo "$as_me:5091: result: $ac_ct_NCURSES_CONFIG" >&5
5092 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5093 else
5094   echo "$as_me:5094: result: no" >&5
5095 echo "${ECHO_T}no" >&6
5096 fi
5097
5098   test -n "$ac_ct_NCURSES_CONFIG" && break
5099 done
5100 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5101
5102   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5103 fi
5104
5105         if test "$NCURSES_CONFIG" != none ; then
5106
5107 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5108 do
5109         case "x$cf_add_cflags" in
5110         (x-[DU]*)
5111
5112 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5113 while true
5114 do
5115         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'`
5116         test "$CFLAGS" != "$cf_old_cflag" || break
5117
5118         CFLAGS="$cf_old_cflag"
5119 done
5120
5121 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5122 while true
5123 do
5124         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'`
5125         test "$CPPFLAGS" != "$cf_old_cflag" || break
5126
5127         CPPFLAGS="$cf_old_cflag"
5128 done
5129
5130                 ;;
5131         esac
5132
5133 cf_fix_cppflags=no
5134 cf_new_cflags=
5135 cf_new_cppflags=
5136 cf_new_extra_cppflags=
5137
5138 for cf_add_cflags in $cf_add_cflags
5139 do
5140 case "$cf_fix_cppflags" in
5141 (no)
5142         case "$cf_add_cflags" in
5143         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5144                 case "$cf_add_cflags" in
5145                 (-D*)
5146                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5147
5148                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5149                                 && test -z "${cf_tst_cflags}" \
5150                                 && cf_fix_cppflags=yes
5151
5152                         if test "$cf_fix_cppflags" = yes ; then
5153
5154         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5155         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5156
5157                                 continue
5158                         elif test "${cf_tst_cflags}" = "\"'" ; then
5159
5160         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5161         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5162
5163                                 continue
5164                         fi
5165                         ;;
5166                 esac
5167                 case "$CPPFLAGS" in
5168                 (*$cf_add_cflags)
5169                         ;;
5170                 (*)
5171                         case "$cf_add_cflags" in
5172                         (-D*)
5173                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5174
5175 CPPFLAGS=`echo "$CPPFLAGS" | \
5176         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5177                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5178
5179                                 ;;
5180                         esac
5181
5182         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5183         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5184
5185                         ;;
5186                 esac
5187                 ;;
5188         (*)
5189
5190         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5191         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5192
5193                 ;;
5194         esac
5195         ;;
5196 (yes)
5197
5198         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5199         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5200
5201         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5202
5203         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5204                 && test -z "${cf_tst_cflags}" \
5205                 && cf_fix_cppflags=no
5206         ;;
5207 esac
5208 done
5209
5210 if test -n "$cf_new_cflags" ; then
5211
5212         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5213         CFLAGS="${CFLAGS}$cf_new_cflags"
5214
5215 fi
5216
5217 if test -n "$cf_new_cppflags" ; then
5218
5219         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5220         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5221
5222 fi
5223
5224 if test -n "$cf_new_extra_cppflags" ; then
5225
5226         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5227         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5228
5229 fi
5230
5231 done
5232
5233 cf_add_libs="$LIBS"
5234 # reverse order
5235 cf_add_0lib=
5236 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5237 # filter duplicates
5238 for cf_add_1lib in $cf_add_0lib; do
5239         for cf_add_2lib in $cf_add_libs; do
5240                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5241                         cf_add_1lib=
5242                         break
5243                 fi
5244         done
5245         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5246 done
5247 LIBS="$cf_add_libs"
5248
5249                 # even with config script, some packages use no-override for curses.h
5250
5251 echo "$as_me:5251: checking if we have identified curses headers" >&5
5252 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5253 if test "${cf_cv_ncurses_header+set}" = set; then
5254   echo $ECHO_N "(cached) $ECHO_C" >&6
5255 else
5256
5257 cf_cv_ncurses_header=none
5258 for cf_header in \
5259         ncurses.h ncurses/ncurses.h \
5260         curses.h ncurses/curses.h
5261 do
5262 cat >"conftest.$ac_ext" <<_ACEOF
5263 #line 5263 "configure"
5264 #include "confdefs.h"
5265 #include <${cf_header}>
5266 int
5267 main (void)
5268 {
5269 initscr(); tgoto("?", 0,0)
5270   ;
5271   return 0;
5272 }
5273 _ACEOF
5274 rm -f "conftest.$ac_objext"
5275 if { (eval echo "$as_me:5275: \"$ac_compile\"") >&5
5276   (eval $ac_compile) 2>&5
5277   ac_status=$?
5278   echo "$as_me:5278: \$? = $ac_status" >&5
5279   (exit "$ac_status"); } &&
5280          { ac_try='test -s "conftest.$ac_objext"'
5281   { (eval echo "$as_me:5281: \"$ac_try\"") >&5
5282   (eval $ac_try) 2>&5
5283   ac_status=$?
5284   echo "$as_me:5284: \$? = $ac_status" >&5
5285   (exit "$ac_status"); }; }; then
5286   cf_cv_ncurses_header=$cf_header; break
5287 else
5288   echo "$as_me: failed program was:" >&5
5289 cat "conftest.$ac_ext" >&5
5290 fi
5291 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5292 done
5293
5294 fi
5295 echo "$as_me:5295: result: $cf_cv_ncurses_header" >&5
5296 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5297
5298 if test "$cf_cv_ncurses_header" = none ; then
5299         { { echo "$as_me:5299: error: No curses header-files found" >&5
5300 echo "$as_me: error: No curses header-files found" >&2;}
5301    { (exit 1); exit 1; }; }
5302 fi
5303
5304 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5305
5306 for ac_header in $cf_cv_ncurses_header
5307 do
5308 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5309 echo "$as_me:5309: checking for $ac_header" >&5
5310 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5311 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5312   echo $ECHO_N "(cached) $ECHO_C" >&6
5313 else
5314   cat >"conftest.$ac_ext" <<_ACEOF
5315 #line 5315 "configure"
5316 #include "confdefs.h"
5317 #include <$ac_header>
5318 _ACEOF
5319 if { (eval echo "$as_me:5319: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5320   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5321   ac_status=$?
5322   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5323   rm -f conftest.er1
5324   cat conftest.err >&5
5325   echo "$as_me:5325: \$? = $ac_status" >&5
5326   (exit "$ac_status"); } >/dev/null; then
5327   if test -s conftest.err; then
5328     ac_cpp_err=$ac_c_preproc_warn_flag
5329   else
5330     ac_cpp_err=
5331   fi
5332 else
5333   ac_cpp_err=yes
5334 fi
5335 if test -z "$ac_cpp_err"; then
5336   eval "$as_ac_Header=yes"
5337 else
5338   echo "$as_me: failed program was:" >&5
5339   cat "conftest.$ac_ext" >&5
5340   eval "$as_ac_Header=no"
5341 fi
5342 rm -f conftest.err "conftest.$ac_ext"
5343 fi
5344 echo "$as_me:5344: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5345 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5346 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5347   cat >>confdefs.h <<EOF
5348 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5349 EOF
5350
5351 fi
5352 done
5353
5354 cat >>confdefs.h <<\EOF
5355 #define NCURSES 1
5356 EOF
5357
5358 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5359
5360                 cat >>confdefs.h <<EOF
5361 #define $cf_nculib_ROOT 1
5362 EOF
5363
5364                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5365
5366         else
5367
5368 cf_ncuhdr_root=ncurses
5369
5370 test -n "$cf_cv_curses_dir" && \
5371 test "$cf_cv_curses_dir" != "no" && { \
5372
5373 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5374   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5375   do
5376         while test "$cf_add_incdir" != /usr/include
5377         do
5378           if test -d "$cf_add_incdir"
5379           then
5380                 cf_have_incdir=no
5381                 if test -n "$CFLAGS$CPPFLAGS" ; then
5382                   # a loop is needed to ensure we can add subdirs of existing dirs
5383                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5384                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5385                           cf_have_incdir=yes; break
5386                         fi
5387                   done
5388                 fi
5389
5390                 if test "$cf_have_incdir" = no ; then
5391                   if test "$cf_add_incdir" = /usr/local/include ; then
5392                         if test "$GCC" = yes
5393                         then
5394                           cf_save_CPPFLAGS=$CPPFLAGS
5395
5396         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5397         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5398
5399                           cat >"conftest.$ac_ext" <<_ACEOF
5400 #line 5400 "configure"
5401 #include "confdefs.h"
5402 #include <stdio.h>
5403 int
5404 main (void)
5405 {
5406 printf("Hello")
5407   ;
5408   return 0;
5409 }
5410 _ACEOF
5411 rm -f "conftest.$ac_objext"
5412 if { (eval echo "$as_me:5412: \"$ac_compile\"") >&5
5413   (eval $ac_compile) 2>&5
5414   ac_status=$?
5415   echo "$as_me:5415: \$? = $ac_status" >&5
5416   (exit "$ac_status"); } &&
5417          { ac_try='test -s "conftest.$ac_objext"'
5418   { (eval echo "$as_me:5418: \"$ac_try\"") >&5
5419   (eval $ac_try) 2>&5
5420   ac_status=$?
5421   echo "$as_me:5421: \$? = $ac_status" >&5
5422   (exit "$ac_status"); }; }; then
5423   :
5424 else
5425   echo "$as_me: failed program was:" >&5
5426 cat "conftest.$ac_ext" >&5
5427 cf_have_incdir=yes
5428 fi
5429 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5430                           CPPFLAGS=$cf_save_CPPFLAGS
5431                         fi
5432                   fi
5433                 fi
5434
5435                 if test "$cf_have_incdir" = no ; then
5436                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5437
5438 echo "${as_me:-configure}:5438: testing adding $cf_add_incdir to include-path ..." 1>&5
5439
5440                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5441
5442                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5443                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5444                   cf_add_incdir="$cf_top_incdir"
5445                 else
5446                   break
5447                 fi
5448           else
5449                 break
5450           fi
5451         done
5452   done
5453 fi
5454
5455 }
5456
5457 echo "$as_me:5457: checking for $cf_ncuhdr_root header in include-path" >&5
5458 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5459 if test "${cf_cv_ncurses_h+set}" = set; then
5460   echo $ECHO_N "(cached) $ECHO_C" >&6
5461 else
5462
5463         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5464         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5465         for cf_header in $cf_header_list
5466         do
5467
5468         cat >"conftest.$ac_ext" <<_ACEOF
5469 #line 5469 "configure"
5470 #include "confdefs.h"
5471
5472 #include <$cf_header>
5473 int
5474 main (void)
5475 {
5476
5477 #ifdef NCURSES_VERSION
5478
5479 printf("%s\\n", NCURSES_VERSION);
5480 #else
5481 #ifdef __NCURSES_H
5482 printf("old\\n");
5483 #else
5484         make an error
5485 #endif
5486 #endif
5487
5488   ;
5489   return 0;
5490 }
5491 _ACEOF
5492 rm -f "conftest.$ac_objext"
5493 if { (eval echo "$as_me:5493: \"$ac_compile\"") >&5
5494   (eval $ac_compile) 2>&5
5495   ac_status=$?
5496   echo "$as_me:5496: \$? = $ac_status" >&5
5497   (exit "$ac_status"); } &&
5498          { ac_try='test -s "conftest.$ac_objext"'
5499   { (eval echo "$as_me:5499: \"$ac_try\"") >&5
5500   (eval $ac_try) 2>&5
5501   ac_status=$?
5502   echo "$as_me:5502: \$? = $ac_status" >&5
5503   (exit "$ac_status"); }; }; then
5504   cf_cv_ncurses_h=$cf_header
5505
5506 else
5507   echo "$as_me: failed program was:" >&5
5508 cat "conftest.$ac_ext" >&5
5509 cf_cv_ncurses_h=no
5510 fi
5511 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5512
5513                 test "$cf_cv_ncurses_h" != no && break
5514         done
5515
5516 fi
5517 echo "$as_me:5517: result: $cf_cv_ncurses_h" >&5
5518 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5519
5520 if test "$cf_cv_ncurses_h" != no ; then
5521         cf_cv_ncurses_header=$cf_cv_ncurses_h
5522 else
5523
5524 echo "$as_me:5524: checking for $cf_ncuhdr_root include-path" >&5
5525 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5526 if test "${cf_cv_ncurses_h2+set}" = set; then
5527   echo $ECHO_N "(cached) $ECHO_C" >&6
5528 else
5529
5530         test -n "$verbose" && echo
5531
5532 cf_search=
5533
5534 # collect the current set of include-directories from compiler flags
5535 cf_header_path_list=""
5536 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5537         for cf_header_path in $CPPFLAGS $CFLAGS
5538         do
5539                 case "$cf_header_path" in
5540                 (-I*)
5541                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5542
5543 test "x$cf_header_path" != "xNONE" && \
5544 test -d "$cf_header_path" && \
5545  {
5546         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5547         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5548         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5549         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5550         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5551         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"
5552 }
5553
5554                         cf_header_path_list="$cf_header_path_list $cf_search"
5555                         ;;
5556                 esac
5557         done
5558 fi
5559
5560 # add the variations for the package we are looking for
5561
5562 cf_search=
5563
5564 test "x$prefix" != "xNONE" && \
5565 test -d "$prefix" && \
5566  {
5567         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5568         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5569         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5570         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5571         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5572         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5573 }
5574
5575 for cf_subdir_prefix in \
5576         /usr \
5577         /usr/local \
5578         /usr/pkg \
5579         /opt \
5580         /opt/local \
5581         $HOME
5582 do
5583
5584 test "x$cf_subdir_prefix" != "x$prefix" && \
5585 test -d "$cf_subdir_prefix" && \
5586 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5587         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5588         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5589         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5590         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5591         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5592         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"
5593 }
5594
5595 done
5596
5597 test "$includedir" != NONE && \
5598 test "$includedir" != "/usr/include" && \
5599 test -d "$includedir" && {
5600         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5601         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5602 }
5603
5604 test "$oldincludedir" != NONE && \
5605 test "$oldincludedir" != "/usr/include" && \
5606 test -d "$oldincludedir" && {
5607         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5608         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5609 }
5610
5611 cf_search="$cf_search $cf_header_path_list"
5612
5613         test -n "$verbose" && echo "search path $cf_search"
5614         cf_save2_CPPFLAGS="$CPPFLAGS"
5615         for cf_incdir in $cf_search
5616         do
5617
5618 if test -n "$cf_incdir" ; then
5619   for cf_add_incdir in $cf_incdir
5620   do
5621         while test "$cf_add_incdir" != /usr/include
5622         do
5623           if test -d "$cf_add_incdir"
5624           then
5625                 cf_have_incdir=no
5626                 if test -n "$CFLAGS$CPPFLAGS" ; then
5627                   # a loop is needed to ensure we can add subdirs of existing dirs
5628                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5629                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5630                           cf_have_incdir=yes; break
5631                         fi
5632                   done
5633                 fi
5634
5635                 if test "$cf_have_incdir" = no ; then
5636                   if test "$cf_add_incdir" = /usr/local/include ; then
5637                         if test "$GCC" = yes
5638                         then
5639                           cf_save_CPPFLAGS=$CPPFLAGS
5640
5641         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5642         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5643
5644                           cat >"conftest.$ac_ext" <<_ACEOF
5645 #line 5645 "configure"
5646 #include "confdefs.h"
5647 #include <stdio.h>
5648 int
5649 main (void)
5650 {
5651 printf("Hello")
5652   ;
5653   return 0;
5654 }
5655 _ACEOF
5656 rm -f "conftest.$ac_objext"
5657 if { (eval echo "$as_me:5657: \"$ac_compile\"") >&5
5658   (eval $ac_compile) 2>&5
5659   ac_status=$?
5660   echo "$as_me:5660: \$? = $ac_status" >&5
5661   (exit "$ac_status"); } &&
5662          { ac_try='test -s "conftest.$ac_objext"'
5663   { (eval echo "$as_me:5663: \"$ac_try\"") >&5
5664   (eval $ac_try) 2>&5
5665   ac_status=$?
5666   echo "$as_me:5666: \$? = $ac_status" >&5
5667   (exit "$ac_status"); }; }; then
5668   :
5669 else
5670   echo "$as_me: failed program was:" >&5
5671 cat "conftest.$ac_ext" >&5
5672 cf_have_incdir=yes
5673 fi
5674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5675                           CPPFLAGS=$cf_save_CPPFLAGS
5676                         fi
5677                   fi
5678                 fi
5679
5680                 if test "$cf_have_incdir" = no ; then
5681                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5682
5683 echo "${as_me:-configure}:5683: testing adding $cf_add_incdir to include-path ..." 1>&5
5684
5685                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5686
5687                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5688                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5689                   cf_add_incdir="$cf_top_incdir"
5690                 else
5691                   break
5692                 fi
5693           else
5694                 break
5695           fi
5696         done
5697   done
5698 fi
5699
5700                 for cf_header in \
5701                         ncurses.h \
5702                         curses.h
5703                 do
5704
5705         cat >"conftest.$ac_ext" <<_ACEOF
5706 #line 5706 "configure"
5707 #include "confdefs.h"
5708
5709 #include <$cf_header>
5710 int
5711 main (void)
5712 {
5713
5714 #ifdef NCURSES_VERSION
5715
5716 printf("%s\\n", NCURSES_VERSION);
5717 #else
5718 #ifdef __NCURSES_H
5719 printf("old\\n");
5720 #else
5721         make an error
5722 #endif
5723 #endif
5724
5725   ;
5726   return 0;
5727 }
5728 _ACEOF
5729 rm -f "conftest.$ac_objext"
5730 if { (eval echo "$as_me:5730: \"$ac_compile\"") >&5
5731   (eval $ac_compile) 2>&5
5732   ac_status=$?
5733   echo "$as_me:5733: \$? = $ac_status" >&5
5734   (exit "$ac_status"); } &&
5735          { ac_try='test -s "conftest.$ac_objext"'
5736   { (eval echo "$as_me:5736: \"$ac_try\"") >&5
5737   (eval $ac_try) 2>&5
5738   ac_status=$?
5739   echo "$as_me:5739: \$? = $ac_status" >&5
5740   (exit "$ac_status"); }; }; then
5741   cf_cv_ncurses_h2=$cf_header
5742
5743 else
5744   echo "$as_me: failed program was:" >&5
5745 cat "conftest.$ac_ext" >&5
5746 cf_cv_ncurses_h2=no
5747 fi
5748 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5749
5750                         if test "$cf_cv_ncurses_h2" != no ; then
5751                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5752                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5753                                 break
5754                         fi
5755                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5756                 done
5757                 CPPFLAGS="$cf_save2_CPPFLAGS"
5758                 test "$cf_cv_ncurses_h2" != no && break
5759         done
5760         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5760: error: not found" >&5
5761 echo "$as_me: error: not found" >&2;}
5762    { (exit 1); exit 1; }; }
5763
5764 fi
5765 echo "$as_me:5765: result: $cf_cv_ncurses_h2" >&5
5766 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5767
5768         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5769         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5770         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5771                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5772         fi
5773
5774 if test -n "$cf_1st_incdir" ; then
5775   for cf_add_incdir in $cf_1st_incdir
5776   do
5777         while test "$cf_add_incdir" != /usr/include
5778         do
5779           if test -d "$cf_add_incdir"
5780           then
5781                 cf_have_incdir=no
5782                 if test -n "$CFLAGS$CPPFLAGS" ; then
5783                   # a loop is needed to ensure we can add subdirs of existing dirs
5784                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5785                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5786                           cf_have_incdir=yes; break
5787                         fi
5788                   done
5789                 fi
5790
5791                 if test "$cf_have_incdir" = no ; then
5792                   if test "$cf_add_incdir" = /usr/local/include ; then
5793                         if test "$GCC" = yes
5794                         then
5795                           cf_save_CPPFLAGS=$CPPFLAGS
5796
5797         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5798         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5799
5800                           cat >"conftest.$ac_ext" <<_ACEOF
5801 #line 5801 "configure"
5802 #include "confdefs.h"
5803 #include <stdio.h>
5804 int
5805 main (void)
5806 {
5807 printf("Hello")
5808   ;
5809   return 0;
5810 }
5811 _ACEOF
5812 rm -f "conftest.$ac_objext"
5813 if { (eval echo "$as_me:5813: \"$ac_compile\"") >&5
5814   (eval $ac_compile) 2>&5
5815   ac_status=$?
5816   echo "$as_me:5816: \$? = $ac_status" >&5
5817   (exit "$ac_status"); } &&
5818          { ac_try='test -s "conftest.$ac_objext"'
5819   { (eval echo "$as_me:5819: \"$ac_try\"") >&5
5820   (eval $ac_try) 2>&5
5821   ac_status=$?
5822   echo "$as_me:5822: \$? = $ac_status" >&5
5823   (exit "$ac_status"); }; }; then
5824   :
5825 else
5826   echo "$as_me: failed program was:" >&5
5827 cat "conftest.$ac_ext" >&5
5828 cf_have_incdir=yes
5829 fi
5830 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5831                           CPPFLAGS=$cf_save_CPPFLAGS
5832                         fi
5833                   fi
5834                 fi
5835
5836                 if test "$cf_have_incdir" = no ; then
5837                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5838
5839 echo "${as_me:-configure}:5839: testing adding $cf_add_incdir to include-path ..." 1>&5
5840
5841                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5842
5843                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5844                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5845                   cf_add_incdir="$cf_top_incdir"
5846                 else
5847                   break
5848                 fi
5849           else
5850                 break
5851           fi
5852         done
5853   done
5854 fi
5855
5856 fi
5857
5858 # Set definitions to allow ifdef'ing for ncurses.h
5859
5860 case "$cf_cv_ncurses_header" in
5861 (*ncurses.h)
5862
5863 cat >>confdefs.h <<\EOF
5864 #define HAVE_NCURSES_H 1
5865 EOF
5866
5867         ;;
5868 esac
5869
5870 case "$cf_cv_ncurses_header" in
5871 (ncurses/curses.h|ncurses/ncurses.h)
5872
5873 cat >>confdefs.h <<\EOF
5874 #define HAVE_NCURSES_NCURSES_H 1
5875 EOF
5876
5877         ;;
5878 (ncursesw/curses.h|ncursesw/ncurses.h)
5879
5880 cat >>confdefs.h <<\EOF
5881 #define HAVE_NCURSESW_NCURSES_H 1
5882 EOF
5883
5884         ;;
5885 esac
5886
5887 echo "$as_me:5887: checking for terminfo header" >&5
5888 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5889 if test "${cf_cv_term_header+set}" = set; then
5890   echo $ECHO_N "(cached) $ECHO_C" >&6
5891 else
5892
5893 case "${cf_cv_ncurses_header}" in
5894 (*/ncurses.h|*/ncursesw.h)
5895         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5896         ;;
5897 (*)
5898         cf_term_header=term.h
5899         ;;
5900 esac
5901
5902 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5903 do
5904 cat >"conftest.$ac_ext" <<_ACEOF
5905 #line 5905 "configure"
5906 #include "confdefs.h"
5907 #include <stdio.h>
5908 #include <${cf_cv_ncurses_header:-curses.h}>
5909 #include <$cf_test>
5910
5911 int
5912 main (void)
5913 {
5914 int x = auto_left_margin; (void)x
5915   ;
5916   return 0;
5917 }
5918 _ACEOF
5919 rm -f "conftest.$ac_objext"
5920 if { (eval echo "$as_me:5920: \"$ac_compile\"") >&5
5921   (eval $ac_compile) 2>&5
5922   ac_status=$?
5923   echo "$as_me:5923: \$? = $ac_status" >&5
5924   (exit "$ac_status"); } &&
5925          { ac_try='test -s "conftest.$ac_objext"'
5926   { (eval echo "$as_me:5926: \"$ac_try\"") >&5
5927   (eval $ac_try) 2>&5
5928   ac_status=$?
5929   echo "$as_me:5929: \$? = $ac_status" >&5
5930   (exit "$ac_status"); }; }; then
5931
5932         cf_cv_term_header="$cf_test"
5933 else
5934   echo "$as_me: failed program was:" >&5
5935 cat "conftest.$ac_ext" >&5
5936
5937         cf_cv_term_header=unknown
5938
5939 fi
5940 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5941         test "$cf_cv_term_header" != unknown && break
5942 done
5943
5944 fi
5945 echo "$as_me:5945: result: $cf_cv_term_header" >&5
5946 echo "${ECHO_T}$cf_cv_term_header" >&6
5947
5948 # Set definitions to allow ifdef'ing to accommodate subdirectories
5949
5950 case "$cf_cv_term_header" in
5951 (*term.h)
5952
5953 cat >>confdefs.h <<\EOF
5954 #define HAVE_TERM_H 1
5955 EOF
5956
5957         ;;
5958 esac
5959
5960 case "$cf_cv_term_header" in
5961 (ncurses/term.h)
5962
5963 cat >>confdefs.h <<\EOF
5964 #define HAVE_NCURSES_TERM_H 1
5965 EOF
5966
5967         ;;
5968 (ncursesw/term.h)
5969
5970 cat >>confdefs.h <<\EOF
5971 #define HAVE_NCURSESW_TERM_H 1
5972 EOF
5973
5974         ;;
5975 esac
5976
5977 # some applications need this, but should check for NCURSES_VERSION
5978
5979 cat >>confdefs.h <<\EOF
5980 #define NCURSES 1
5981 EOF
5982
5983 echo "$as_me:5983: checking for ncurses version" >&5
5984 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5985 if test "${cf_cv_ncurses_version+set}" = set; then
5986   echo $ECHO_N "(cached) $ECHO_C" >&6
5987 else
5988
5989         cf_cv_ncurses_version=no
5990         cf_tempfile=out$$
5991         rm -f "$cf_tempfile"
5992         if test "$cross_compiling" = yes; then
5993
5994         # This will not work if the preprocessor splits the line after the
5995         # Autoconf token.  The 'unproto' program does that.
5996         cat > "conftest.$ac_ext" <<EOF
5997 #include <${cf_cv_ncurses_header:-curses.h}>
5998 #undef Autoconf
5999 #ifdef NCURSES_VERSION
6000 Autoconf NCURSES_VERSION
6001 #else
6002 #ifdef __NCURSES_H
6003 Autoconf "old"
6004 #endif
6005 ;
6006 #endif
6007 EOF
6008         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6009         { (eval echo "$as_me:6009: \"$cf_try\"") >&5
6010   (eval $cf_try) 2>&5
6011   ac_status=$?
6012   echo "$as_me:6012: \$? = $ac_status" >&5
6013   (exit "$ac_status"); }
6014         if test -f conftest.out ; then
6015                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6016                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6017                 rm -f conftest.out
6018         fi
6019
6020 else
6021   cat >"conftest.$ac_ext" <<_ACEOF
6022 #line 6022 "configure"
6023 #include "confdefs.h"
6024
6025 #include <${cf_cv_ncurses_header:-curses.h}>
6026 #include <stdio.h>
6027 int main(void)
6028 {
6029         FILE *fp = fopen("$cf_tempfile", "w");
6030 #ifdef NCURSES_VERSION
6031 # ifdef NCURSES_VERSION_PATCH
6032         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6033 # else
6034         fprintf(fp, "%s\\n", NCURSES_VERSION);
6035 # endif
6036 #else
6037 # ifdef __NCURSES_H
6038         fprintf(fp, "old\\n");
6039 # else
6040         make an error
6041 # endif
6042 #endif
6043         ${cf_cv_main_return:-return}(0);
6044 }
6045 _ACEOF
6046 rm -f "conftest$ac_exeext"
6047 if { (eval echo "$as_me:6047: \"$ac_link\"") >&5
6048   (eval $ac_link) 2>&5
6049   ac_status=$?
6050   echo "$as_me:6050: \$? = $ac_status" >&5
6051   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6052   { (eval echo "$as_me:6052: \"$ac_try\"") >&5
6053   (eval $ac_try) 2>&5
6054   ac_status=$?
6055   echo "$as_me:6055: \$? = $ac_status" >&5
6056   (exit "$ac_status"); }; }; then
6057
6058         cf_cv_ncurses_version=`cat $cf_tempfile`
6059 else
6060   echo "$as_me: program exited with status $ac_status" >&5
6061 echo "$as_me: failed program was:" >&5
6062 cat "conftest.$ac_ext" >&5
6063 fi
6064 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6065 fi
6066         rm -f "$cf_tempfile"
6067
6068 fi
6069 echo "$as_me:6069: result: $cf_cv_ncurses_version" >&5
6070 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6071 test "$cf_cv_ncurses_version" = no ||
6072 cat >>confdefs.h <<\EOF
6073 #define NCURSES 1
6074 EOF
6075
6076 cf_nculib_root=ncurses
6077         # This works, except for the special case where we find gpm, but
6078         # ncurses is in a nonstandard location via $LIBS, and we really want
6079         # to link gpm.
6080 cf_ncurses_LIBS=""
6081 cf_ncurses_SAVE="$LIBS"
6082 echo "$as_me:6082: checking for Gpm_Open in -lgpm" >&5
6083 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6084 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6085   echo $ECHO_N "(cached) $ECHO_C" >&6
6086 else
6087   ac_check_lib_save_LIBS=$LIBS
6088 LIBS="-lgpm  $LIBS"
6089 cat >"conftest.$ac_ext" <<_ACEOF
6090 #line 6090 "configure"
6091 #include "confdefs.h"
6092
6093 /* Override any gcc2 internal prototype to avoid an error.  */
6094 #ifdef __cplusplus
6095 extern "C"
6096 #endif
6097 /* We use char because int might match the return type of a gcc2
6098    builtin and then its argument prototype would still apply.  */
6099 char Gpm_Open ();
6100 int
6101 main (void)
6102 {
6103 Gpm_Open ();
6104   ;
6105   return 0;
6106 }
6107 _ACEOF
6108 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6109 if { (eval echo "$as_me:6109: \"$ac_link\"") >&5
6110   (eval $ac_link) 2>&5
6111   ac_status=$?
6112   echo "$as_me:6112: \$? = $ac_status" >&5
6113   (exit "$ac_status"); } &&
6114          { ac_try='test -s "conftest$ac_exeext"'
6115   { (eval echo "$as_me:6115: \"$ac_try\"") >&5
6116   (eval $ac_try) 2>&5
6117   ac_status=$?
6118   echo "$as_me:6118: \$? = $ac_status" >&5
6119   (exit "$ac_status"); }; }; then
6120   ac_cv_lib_gpm_Gpm_Open=yes
6121 else
6122   echo "$as_me: failed program was:" >&5
6123 cat "conftest.$ac_ext" >&5
6124 ac_cv_lib_gpm_Gpm_Open=no
6125 fi
6126 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6127 LIBS=$ac_check_lib_save_LIBS
6128 fi
6129 echo "$as_me:6129: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6130 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6131 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6132   echo "$as_me:6132: checking for initscr in -lgpm" >&5
6133 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6134 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6135   echo $ECHO_N "(cached) $ECHO_C" >&6
6136 else
6137   ac_check_lib_save_LIBS=$LIBS
6138 LIBS="-lgpm  $LIBS"
6139 cat >"conftest.$ac_ext" <<_ACEOF
6140 #line 6140 "configure"
6141 #include "confdefs.h"
6142
6143 /* Override any gcc2 internal prototype to avoid an error.  */
6144 #ifdef __cplusplus
6145 extern "C"
6146 #endif
6147 /* We use char because int might match the return type of a gcc2
6148    builtin and then its argument prototype would still apply.  */
6149 char initscr ();
6150 int
6151 main (void)
6152 {
6153 initscr ();
6154   ;
6155   return 0;
6156 }
6157 _ACEOF
6158 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6159 if { (eval echo "$as_me:6159: \"$ac_link\"") >&5
6160   (eval $ac_link) 2>&5
6161   ac_status=$?
6162   echo "$as_me:6162: \$? = $ac_status" >&5
6163   (exit "$ac_status"); } &&
6164          { ac_try='test -s "conftest$ac_exeext"'
6165   { (eval echo "$as_me:6165: \"$ac_try\"") >&5
6166   (eval $ac_try) 2>&5
6167   ac_status=$?
6168   echo "$as_me:6168: \$? = $ac_status" >&5
6169   (exit "$ac_status"); }; }; then
6170   ac_cv_lib_gpm_initscr=yes
6171 else
6172   echo "$as_me: failed program was:" >&5
6173 cat "conftest.$ac_ext" >&5
6174 ac_cv_lib_gpm_initscr=no
6175 fi
6176 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6177 LIBS=$ac_check_lib_save_LIBS
6178 fi
6179 echo "$as_me:6179: result: $ac_cv_lib_gpm_initscr" >&5
6180 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6181 if test "$ac_cv_lib_gpm_initscr" = yes; then
6182   LIBS="$cf_ncurses_SAVE"
6183 else
6184   cf_ncurses_LIBS="-lgpm"
6185 fi
6186
6187 fi
6188
6189 case "$host_os" in
6190 (freebsd*)
6191         # This is only necessary if you are linking against an obsolete
6192         # version of ncurses (but it should do no harm, since it is static).
6193         if test "$cf_nculib_root" = ncurses ; then
6194                 echo "$as_me:6194: checking for tgoto in -lmytinfo" >&5
6195 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6196 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6197   echo $ECHO_N "(cached) $ECHO_C" >&6
6198 else
6199   ac_check_lib_save_LIBS=$LIBS
6200 LIBS="-lmytinfo  $LIBS"
6201 cat >"conftest.$ac_ext" <<_ACEOF
6202 #line 6202 "configure"
6203 #include "confdefs.h"
6204
6205 /* Override any gcc2 internal prototype to avoid an error.  */
6206 #ifdef __cplusplus
6207 extern "C"
6208 #endif
6209 /* We use char because int might match the return type of a gcc2
6210    builtin and then its argument prototype would still apply.  */
6211 char tgoto ();
6212 int
6213 main (void)
6214 {
6215 tgoto ();
6216   ;
6217   return 0;
6218 }
6219 _ACEOF
6220 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6221 if { (eval echo "$as_me:6221: \"$ac_link\"") >&5
6222   (eval $ac_link) 2>&5
6223   ac_status=$?
6224   echo "$as_me:6224: \$? = $ac_status" >&5
6225   (exit "$ac_status"); } &&
6226          { ac_try='test -s "conftest$ac_exeext"'
6227   { (eval echo "$as_me:6227: \"$ac_try\"") >&5
6228   (eval $ac_try) 2>&5
6229   ac_status=$?
6230   echo "$as_me:6230: \$? = $ac_status" >&5
6231   (exit "$ac_status"); }; }; then
6232   ac_cv_lib_mytinfo_tgoto=yes
6233 else
6234   echo "$as_me: failed program was:" >&5
6235 cat "conftest.$ac_ext" >&5
6236 ac_cv_lib_mytinfo_tgoto=no
6237 fi
6238 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6239 LIBS=$ac_check_lib_save_LIBS
6240 fi
6241 echo "$as_me:6241: result: $ac_cv_lib_mytinfo_tgoto" >&5
6242 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6243 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6244   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6245 fi
6246
6247         fi
6248         ;;
6249 esac
6250
6251 cf_add_libs="$LIBS"
6252 # reverse order
6253 cf_add_0lib=
6254 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6255 # filter duplicates
6256 for cf_add_1lib in $cf_add_0lib; do
6257         for cf_add_2lib in $cf_add_libs; do
6258                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6259                         cf_add_1lib=
6260                         break
6261                 fi
6262         done
6263         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6264 done
6265 LIBS="$cf_add_libs"
6266
6267 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6268 then
6269
6270 cf_add_libs="$LIBS"
6271 # reverse order
6272 cf_add_0lib=
6273 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6274 # filter duplicates
6275 for cf_add_1lib in $cf_add_0lib; do
6276         for cf_add_2lib in $cf_add_libs; do
6277                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6278                         cf_add_1lib=
6279                         break
6280                 fi
6281         done
6282         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6283 done
6284 LIBS="$cf_add_libs"
6285
6286 else
6287
6288         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6289         cf_libdir=""
6290         echo "$as_me:6290: checking for initscr" >&5
6291 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6292 if test "${ac_cv_func_initscr+set}" = set; then
6293   echo $ECHO_N "(cached) $ECHO_C" >&6
6294 else
6295   cat >"conftest.$ac_ext" <<_ACEOF
6296 #line 6296 "configure"
6297 #include "confdefs.h"
6298 #define initscr autoconf_temporary
6299 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6300 #undef initscr
6301
6302 #ifdef __cplusplus
6303 extern "C"
6304 #endif
6305
6306 /* We use char because int might match the return type of a gcc2
6307    builtin and then its argument prototype would still apply.  */
6308 char initscr (void);
6309
6310 int
6311 main (void)
6312 {
6313
6314 /* The GNU C library defines stubs for functions which it implements
6315     to always fail with ENOSYS.  Some functions are actually named
6316     something starting with __ and the normal name is an alias.  */
6317 #if defined (__stub_initscr) || defined (__stub___initscr)
6318 #error found stub for initscr
6319 #endif
6320
6321         return initscr ();
6322   ;
6323   return 0;
6324 }
6325 _ACEOF
6326 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6327 if { (eval echo "$as_me:6327: \"$ac_link\"") >&5
6328   (eval $ac_link) 2>&5
6329   ac_status=$?
6330   echo "$as_me:6330: \$? = $ac_status" >&5
6331   (exit "$ac_status"); } &&
6332          { ac_try='test -s "conftest$ac_exeext"'
6333   { (eval echo "$as_me:6333: \"$ac_try\"") >&5
6334   (eval $ac_try) 2>&5
6335   ac_status=$?
6336   echo "$as_me:6336: \$? = $ac_status" >&5
6337   (exit "$ac_status"); }; }; then
6338   ac_cv_func_initscr=yes
6339 else
6340   echo "$as_me: failed program was:" >&5
6341 cat "conftest.$ac_ext" >&5
6342 ac_cv_func_initscr=no
6343 fi
6344 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6345 fi
6346 echo "$as_me:6346: result: $ac_cv_func_initscr" >&5
6347 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6348 if test "$ac_cv_func_initscr" = yes; then
6349   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6350 else
6351
6352                 cf_save_LIBS="$LIBS"
6353                 echo "$as_me:6353: checking for initscr in -l$cf_nculib_root" >&5
6354 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6355                 LIBS="-l$cf_nculib_root $LIBS"
6356                 cat >"conftest.$ac_ext" <<_ACEOF
6357 #line 6357 "configure"
6358 #include "confdefs.h"
6359 #include <${cf_cv_ncurses_header:-curses.h}>
6360 int
6361 main (void)
6362 {
6363 initscr()
6364   ;
6365   return 0;
6366 }
6367 _ACEOF
6368 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6369 if { (eval echo "$as_me:6369: \"$ac_link\"") >&5
6370   (eval $ac_link) 2>&5
6371   ac_status=$?
6372   echo "$as_me:6372: \$? = $ac_status" >&5
6373   (exit "$ac_status"); } &&
6374          { ac_try='test -s "conftest$ac_exeext"'
6375   { (eval echo "$as_me:6375: \"$ac_try\"") >&5
6376   (eval $ac_try) 2>&5
6377   ac_status=$?
6378   echo "$as_me:6378: \$? = $ac_status" >&5
6379   (exit "$ac_status"); }; }; then
6380   echo "$as_me:6380: result: yes" >&5
6381 echo "${ECHO_T}yes" >&6
6382                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6383
6384 else
6385   echo "$as_me: failed program was:" >&5
6386 cat "conftest.$ac_ext" >&5
6387 echo "$as_me:6387: result: no" >&5
6388 echo "${ECHO_T}no" >&6
6389
6390 cf_search=
6391 cf_library_path_list=""
6392 if test -n "${LDFLAGS}${LIBS}" ; then
6393         for cf_library_path in $LDFLAGS $LIBS
6394         do
6395                 case "$cf_library_path" in
6396                 (-L*)
6397                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6398
6399 test "x$cf_library_path" != "xNONE" && \
6400 test -d "$cf_library_path" && \
6401  {
6402         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6403         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6404         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6405         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6406         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6407         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"
6408 }
6409
6410                         cf_library_path_list="$cf_library_path_list $cf_search"
6411                         ;;
6412                 esac
6413         done
6414 fi
6415
6416 cf_search=
6417
6418 test "x$prefix" != "xNONE" && \
6419 test -d "$prefix" && \
6420  {
6421         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6422         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6423         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6424         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6425         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6426         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6427 }
6428
6429 for cf_subdir_prefix in \
6430         /usr \
6431         /usr/local \
6432         /usr/pkg \
6433         /opt \
6434         /opt/local \
6435         $HOME
6436 do
6437
6438 test "x$cf_subdir_prefix" != "x$prefix" && \
6439 test -d "$cf_subdir_prefix" && \
6440 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6441         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6442         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6443         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6444         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6445         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6446         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"
6447 }
6448
6449 done
6450
6451 cf_search="$cf_library_path_list $cf_search"
6452
6453                         for cf_libdir in $cf_search
6454                         do
6455                                 echo "$as_me:6455: checking for -l$cf_nculib_root in $cf_libdir" >&5
6456 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6457                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6458                                 cat >"conftest.$ac_ext" <<_ACEOF
6459 #line 6459 "configure"
6460 #include "confdefs.h"
6461 #include <${cf_cv_ncurses_header:-curses.h}>
6462 int
6463 main (void)
6464 {
6465 initscr()
6466   ;
6467   return 0;
6468 }
6469 _ACEOF
6470 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6471 if { (eval echo "$as_me:6471: \"$ac_link\"") >&5
6472   (eval $ac_link) 2>&5
6473   ac_status=$?
6474   echo "$as_me:6474: \$? = $ac_status" >&5
6475   (exit "$ac_status"); } &&
6476          { ac_try='test -s "conftest$ac_exeext"'
6477   { (eval echo "$as_me:6477: \"$ac_try\"") >&5
6478   (eval $ac_try) 2>&5
6479   ac_status=$?
6480   echo "$as_me:6480: \$? = $ac_status" >&5
6481   (exit "$ac_status"); }; }; then
6482   echo "$as_me:6482: result: yes" >&5
6483 echo "${ECHO_T}yes" >&6
6484                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6485                                          break
6486 else
6487   echo "$as_me: failed program was:" >&5
6488 cat "conftest.$ac_ext" >&5
6489 echo "$as_me:6489: result: no" >&5
6490 echo "${ECHO_T}no" >&6
6491                                          LIBS="$cf_save_LIBS"
6492 fi
6493 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6494                         done
6495
6496 fi
6497 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6498
6499 fi
6500
6501 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6502
6503 if test "$cf_found_library" = no ; then
6504         { { echo "$as_me:6504: error: Cannot link $cf_nculib_root library" >&5
6505 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6506    { (exit 1); exit 1; }; }
6507 fi
6508
6509 fi
6510
6511 if test -n "$cf_ncurses_LIBS" ; then
6512         echo "$as_me:6512: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6513 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6514         cf_ncurses_SAVE="$LIBS"
6515         for p in $cf_ncurses_LIBS ; do
6516                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6517                 if test "$q" != "$LIBS" ; then
6518                         LIBS="$q"
6519                 fi
6520         done
6521         cat >"conftest.$ac_ext" <<_ACEOF
6522 #line 6522 "configure"
6523 #include "confdefs.h"
6524 #include <${cf_cv_ncurses_header:-curses.h}>
6525 int
6526 main (void)
6527 {
6528 initscr(); mousemask(0,0); tigetstr((char *)0);
6529   ;
6530   return 0;
6531 }
6532 _ACEOF
6533 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6534 if { (eval echo "$as_me:6534: \"$ac_link\"") >&5
6535   (eval $ac_link) 2>&5
6536   ac_status=$?
6537   echo "$as_me:6537: \$? = $ac_status" >&5
6538   (exit "$ac_status"); } &&
6539          { ac_try='test -s "conftest$ac_exeext"'
6540   { (eval echo "$as_me:6540: \"$ac_try\"") >&5
6541   (eval $ac_try) 2>&5
6542   ac_status=$?
6543   echo "$as_me:6543: \$? = $ac_status" >&5
6544   (exit "$ac_status"); }; }; then
6545   echo "$as_me:6545: result: yes" >&5
6546 echo "${ECHO_T}yes" >&6
6547 else
6548   echo "$as_me: failed program was:" >&5
6549 cat "conftest.$ac_ext" >&5
6550 echo "$as_me:6550: result: no" >&5
6551 echo "${ECHO_T}no" >&6
6552                  LIBS="$cf_ncurses_SAVE"
6553 fi
6554 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6555 fi
6556
6557 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6558
6559 cat >>confdefs.h <<EOF
6560 #define $cf_nculib_ROOT 1
6561 EOF
6562
6563         fi
6564 else
6565         NCURSES_CONFIG=none
6566 fi
6567
6568 echo "$as_me:6568: checking if you want wide-character code" >&5
6569 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6570
6571 # Check whether --enable-widec or --disable-widec was given.
6572 if test "${enable_widec+set}" = set; then
6573   enableval="$enable_widec"
6574   with_widec=$enableval
6575 else
6576   with_widec=no
6577 fi;
6578 echo "$as_me:6578: result: $with_widec" >&5
6579 echo "${ECHO_T}$with_widec" >&6
6580 if test "$with_widec" = yes ; then
6581
6582 for ac_header in wchar.h
6583 do
6584 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6585 echo "$as_me:6585: checking for $ac_header" >&5
6586 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6587 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6588   echo $ECHO_N "(cached) $ECHO_C" >&6
6589 else
6590   cat >"conftest.$ac_ext" <<_ACEOF
6591 #line 6591 "configure"
6592 #include "confdefs.h"
6593 #include <$ac_header>
6594 _ACEOF
6595 if { (eval echo "$as_me:6595: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6596   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6597   ac_status=$?
6598   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6599   rm -f conftest.er1
6600   cat conftest.err >&5
6601   echo "$as_me:6601: \$? = $ac_status" >&5
6602   (exit "$ac_status"); } >/dev/null; then
6603   if test -s conftest.err; then
6604     ac_cpp_err=$ac_c_preproc_warn_flag
6605   else
6606     ac_cpp_err=
6607   fi
6608 else
6609   ac_cpp_err=yes
6610 fi
6611 if test -z "$ac_cpp_err"; then
6612   eval "$as_ac_Header=yes"
6613 else
6614   echo "$as_me: failed program was:" >&5
6615   cat "conftest.$ac_ext" >&5
6616   eval "$as_ac_Header=no"
6617 fi
6618 rm -f conftest.err "conftest.$ac_ext"
6619 fi
6620 echo "$as_me:6620: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6621 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6622 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6623   cat >>confdefs.h <<EOF
6624 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6625 EOF
6626
6627 fi
6628 done
6629
6630 echo "$as_me:6630: checking for multibyte character support" >&5
6631 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6632 if test "${cf_cv_utf8_lib+set}" = set; then
6633   echo $ECHO_N "(cached) $ECHO_C" >&6
6634 else
6635
6636         cf_save_LIBS="$LIBS"
6637         cat >"conftest.$ac_ext" <<_ACEOF
6638 #line 6638 "configure"
6639 #include "confdefs.h"
6640
6641 #include <stdlib.h>
6642 #include <stdio.h>
6643 #ifdef HAVE_WCHAR_H
6644 #include <wchar.h>
6645 #endif
6646
6647 int
6648 main (void)
6649 {
6650 putwc(0,0);
6651   ;
6652   return 0;
6653 }
6654 _ACEOF
6655 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6656 if { (eval echo "$as_me:6656: \"$ac_link\"") >&5
6657   (eval $ac_link) 2>&5
6658   ac_status=$?
6659   echo "$as_me:6659: \$? = $ac_status" >&5
6660   (exit "$ac_status"); } &&
6661          { ac_try='test -s "conftest$ac_exeext"'
6662   { (eval echo "$as_me:6662: \"$ac_try\"") >&5
6663   (eval $ac_try) 2>&5
6664   ac_status=$?
6665   echo "$as_me:6665: \$? = $ac_status" >&5
6666   (exit "$ac_status"); }; }; then
6667   cf_cv_utf8_lib=yes
6668 else
6669   echo "$as_me: failed program was:" >&5
6670 cat "conftest.$ac_ext" >&5
6671
6672 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6673 # will be set on completion of the AC_TRY_LINK below.
6674 cf_cv_header_path_utf8=
6675 cf_cv_library_path_utf8=
6676
6677 echo "${as_me:-configure}:6677: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6678
6679 cf_save_LIBS="$LIBS"
6680
6681 cat >"conftest.$ac_ext" <<_ACEOF
6682 #line 6682 "configure"
6683 #include "confdefs.h"
6684
6685 #include <libutf8.h>
6686 int
6687 main (void)
6688 {
6689 putwc(0,0);
6690   ;
6691   return 0;
6692 }
6693 _ACEOF
6694 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6695 if { (eval echo "$as_me:6695: \"$ac_link\"") >&5
6696   (eval $ac_link) 2>&5
6697   ac_status=$?
6698   echo "$as_me:6698: \$? = $ac_status" >&5
6699   (exit "$ac_status"); } &&
6700          { ac_try='test -s "conftest$ac_exeext"'
6701   { (eval echo "$as_me:6701: \"$ac_try\"") >&5
6702   (eval $ac_try) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit "$ac_status"); }; }; then
6706
6707         cf_cv_find_linkage_utf8=yes
6708         cf_cv_header_path_utf8=/usr/include
6709         cf_cv_library_path_utf8=/usr/lib
6710
6711 else
6712   echo "$as_me: failed program was:" >&5
6713 cat "conftest.$ac_ext" >&5
6714
6715 LIBS="-lutf8  $cf_save_LIBS"
6716
6717 cat >"conftest.$ac_ext" <<_ACEOF
6718 #line 6718 "configure"
6719 #include "confdefs.h"
6720
6721 #include <libutf8.h>
6722 int
6723 main (void)
6724 {
6725 putwc(0,0);
6726   ;
6727   return 0;
6728 }
6729 _ACEOF
6730 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6731 if { (eval echo "$as_me:6731: \"$ac_link\"") >&5
6732   (eval $ac_link) 2>&5
6733   ac_status=$?
6734   echo "$as_me:6734: \$? = $ac_status" >&5
6735   (exit "$ac_status"); } &&
6736          { ac_try='test -s "conftest$ac_exeext"'
6737   { (eval echo "$as_me:6737: \"$ac_try\"") >&5
6738   (eval $ac_try) 2>&5
6739   ac_status=$?
6740   echo "$as_me:6740: \$? = $ac_status" >&5
6741   (exit "$ac_status"); }; }; then
6742
6743         cf_cv_find_linkage_utf8=yes
6744         cf_cv_header_path_utf8=/usr/include
6745         cf_cv_library_path_utf8=/usr/lib
6746         cf_cv_library_file_utf8="-lutf8"
6747
6748 else
6749   echo "$as_me: failed program was:" >&5
6750 cat "conftest.$ac_ext" >&5
6751
6752         cf_cv_find_linkage_utf8=no
6753         LIBS="$cf_save_LIBS"
6754
6755         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6756
6757 echo "${as_me:-configure}:6757: testing find linkage for utf8 library ..." 1>&5
6758
6759 echo "${as_me:-configure}:6759: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6760
6761         cf_save_CPPFLAGS="$CPPFLAGS"
6762         cf_test_CPPFLAGS="$CPPFLAGS"
6763
6764 cf_search=
6765
6766 # collect the current set of include-directories from compiler flags
6767 cf_header_path_list=""
6768 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6769         for cf_header_path in $CPPFLAGS $CFLAGS
6770         do
6771                 case "$cf_header_path" in
6772                 (-I*)
6773                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6774
6775 test "x$cf_header_path" != "xNONE" && \
6776 test -d "$cf_header_path" && \
6777  {
6778         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6779         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6780         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6781         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6782         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6783         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6784 }
6785
6786                         cf_header_path_list="$cf_header_path_list $cf_search"
6787                         ;;
6788                 esac
6789         done
6790 fi
6791
6792 # add the variations for the package we are looking for
6793
6794 cf_search=
6795
6796 test "x$prefix" != "xNONE" && \
6797 test -d "$prefix" && \
6798  {
6799         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6800         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6801         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6802         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6803         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6804         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6805 }
6806
6807 for cf_subdir_prefix in \
6808         /usr \
6809         /usr/local \
6810         /usr/pkg \
6811         /opt \
6812         /opt/local \
6813         $HOME
6814 do
6815
6816 test "x$cf_subdir_prefix" != "x$prefix" && \
6817 test -d "$cf_subdir_prefix" && \
6818 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6819         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6820         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6821         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6822         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6823         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6824         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6825 }
6826
6827 done
6828
6829 test "$includedir" != NONE && \
6830 test "$includedir" != "/usr/include" && \
6831 test -d "$includedir" && {
6832         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6833         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6834 }
6835
6836 test "$oldincludedir" != NONE && \
6837 test "$oldincludedir" != "/usr/include" && \
6838 test -d "$oldincludedir" && {
6839         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6840         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6841 }
6842
6843 cf_search="$cf_search $cf_header_path_list"
6844
6845         for cf_cv_header_path_utf8 in $cf_search
6846         do
6847                 if test -d "$cf_cv_header_path_utf8" ; then
6848                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6849
6850 echo "${as_me:-configure}:6850: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6851
6852                         CPPFLAGS="$cf_save_CPPFLAGS"
6853
6854         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6855         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6856
6857                         cat >"conftest.$ac_ext" <<_ACEOF
6858 #line 6858 "configure"
6859 #include "confdefs.h"
6860
6861 #include <libutf8.h>
6862 int
6863 main (void)
6864 {
6865 putwc(0,0);
6866   ;
6867   return 0;
6868 }
6869 _ACEOF
6870 rm -f "conftest.$ac_objext"
6871 if { (eval echo "$as_me:6871: \"$ac_compile\"") >&5
6872   (eval $ac_compile) 2>&5
6873   ac_status=$?
6874   echo "$as_me:6874: \$? = $ac_status" >&5
6875   (exit "$ac_status"); } &&
6876          { ac_try='test -s "conftest.$ac_objext"'
6877   { (eval echo "$as_me:6877: \"$ac_try\"") >&5
6878   (eval $ac_try) 2>&5
6879   ac_status=$?
6880   echo "$as_me:6880: \$? = $ac_status" >&5
6881   (exit "$ac_status"); }; }; then
6882
6883                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6884
6885 echo "${as_me:-configure}:6885: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6886
6887                                 cf_cv_find_linkage_utf8=maybe
6888                                 cf_test_CPPFLAGS="$CPPFLAGS"
6889                                 break
6890 else
6891   echo "$as_me: failed program was:" >&5
6892 cat "conftest.$ac_ext" >&5
6893
6894                                 CPPFLAGS="$cf_save_CPPFLAGS"
6895
6896 fi
6897 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6898                 fi
6899         done
6900
6901         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6902
6903 echo "${as_me:-configure}:6903: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6904
6905                 cf_save_LIBS="$LIBS"
6906                 cf_save_LDFLAGS="$LDFLAGS"
6907
6908                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6909
6910 cf_search=
6911 cf_library_path_list=""
6912 if test -n "${LDFLAGS}${LIBS}" ; then
6913         for cf_library_path in $LDFLAGS $LIBS
6914         do
6915                 case "$cf_library_path" in
6916                 (-L*)
6917                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6918
6919 test "x$cf_library_path" != "xNONE" && \
6920 test -d "$cf_library_path" && \
6921  {
6922         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6923         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6924         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6925         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6926         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6927         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6928 }
6929
6930                         cf_library_path_list="$cf_library_path_list $cf_search"
6931                         ;;
6932                 esac
6933         done
6934 fi
6935
6936 cf_search=
6937
6938 test "x$prefix" != "xNONE" && \
6939 test -d "$prefix" && \
6940  {
6941         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6942         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6943         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6944         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6945         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6946         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6947 }
6948
6949 for cf_subdir_prefix in \
6950         /usr \
6951         /usr/local \
6952         /usr/pkg \
6953         /opt \
6954         /opt/local \
6955         $HOME
6956 do
6957
6958 test "x$cf_subdir_prefix" != "x$prefix" && \
6959 test -d "$cf_subdir_prefix" && \
6960 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6961         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6962         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6963         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6964         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6965         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6966         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6967 }
6968
6969 done
6970
6971 cf_search="$cf_library_path_list $cf_search"
6972
6973                         for cf_cv_library_path_utf8 in $cf_search
6974                         do
6975                                 if test -d "$cf_cv_library_path_utf8" ; then
6976                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6977
6978 echo "${as_me:-configure}:6978: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6979
6980                                         CPPFLAGS="$cf_test_CPPFLAGS"
6981                                         LIBS="-lutf8  $cf_save_LIBS"
6982                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6983                                         cat >"conftest.$ac_ext" <<_ACEOF
6984 #line 6984 "configure"
6985 #include "confdefs.h"
6986
6987 #include <libutf8.h>
6988 int
6989 main (void)
6990 {
6991 putwc(0,0);
6992   ;
6993   return 0;
6994 }
6995 _ACEOF
6996 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6997 if { (eval echo "$as_me:6997: \"$ac_link\"") >&5
6998   (eval $ac_link) 2>&5
6999   ac_status=$?
7000   echo "$as_me:7000: \$? = $ac_status" >&5
7001   (exit "$ac_status"); } &&
7002          { ac_try='test -s "conftest$ac_exeext"'
7003   { (eval echo "$as_me:7003: \"$ac_try\"") >&5
7004   (eval $ac_try) 2>&5
7005   ac_status=$?
7006   echo "$as_me:7006: \$? = $ac_status" >&5
7007   (exit "$ac_status"); }; }; then
7008
7009                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7010
7011 echo "${as_me:-configure}:7011: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7012
7013                                         cf_cv_find_linkage_utf8=yes
7014                                         cf_cv_library_file_utf8="-lutf8"
7015                                         break
7016 else
7017   echo "$as_me: failed program was:" >&5
7018 cat "conftest.$ac_ext" >&5
7019
7020                                         CPPFLAGS="$cf_save_CPPFLAGS"
7021                                         LIBS="$cf_save_LIBS"
7022                                         LDFLAGS="$cf_save_LDFLAGS"
7023
7024 fi
7025 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7026                                 fi
7027                         done
7028                         CPPFLAGS="$cf_save_CPPFLAGS"
7029                         LDFLAGS="$cf_save_LDFLAGS"
7030                 fi
7031
7032         else
7033                 cf_cv_find_linkage_utf8=no
7034         fi
7035
7036 fi
7037 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7038
7039 fi
7040 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7041
7042 LIBS="$cf_save_LIBS"
7043
7044 if test "$cf_cv_find_linkage_utf8" = yes ; then
7045 cf_cv_utf8_lib=add-on
7046 else
7047 cf_cv_utf8_lib=no
7048 fi
7049
7050 fi
7051 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7052 fi
7053 echo "$as_me:7053: result: $cf_cv_utf8_lib" >&5
7054 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7055
7056 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7057 # ncurses/ncursesw:
7058 if test "$cf_cv_utf8_lib" = "add-on" ; then
7059
7060 cat >>confdefs.h <<\EOF
7061 #define HAVE_LIBUTF8_H 1
7062 EOF
7063
7064 if test -n "$cf_cv_header_path_utf8" ; then
7065   for cf_add_incdir in $cf_cv_header_path_utf8
7066   do
7067         while test "$cf_add_incdir" != /usr/include
7068         do
7069           if test -d "$cf_add_incdir"
7070           then
7071                 cf_have_incdir=no
7072                 if test -n "$CFLAGS$CPPFLAGS" ; then
7073                   # a loop is needed to ensure we can add subdirs of existing dirs
7074                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7075                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7076                           cf_have_incdir=yes; break
7077                         fi
7078                   done
7079                 fi
7080
7081                 if test "$cf_have_incdir" = no ; then
7082                   if test "$cf_add_incdir" = /usr/local/include ; then
7083                         if test "$GCC" = yes
7084                         then
7085                           cf_save_CPPFLAGS=$CPPFLAGS
7086
7087         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7088         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7089
7090                           cat >"conftest.$ac_ext" <<_ACEOF
7091 #line 7091 "configure"
7092 #include "confdefs.h"
7093 #include <stdio.h>
7094 int
7095 main (void)
7096 {
7097 printf("Hello")
7098   ;
7099   return 0;
7100 }
7101 _ACEOF
7102 rm -f "conftest.$ac_objext"
7103 if { (eval echo "$as_me:7103: \"$ac_compile\"") >&5
7104   (eval $ac_compile) 2>&5
7105   ac_status=$?
7106   echo "$as_me:7106: \$? = $ac_status" >&5
7107   (exit "$ac_status"); } &&
7108          { ac_try='test -s "conftest.$ac_objext"'
7109   { (eval echo "$as_me:7109: \"$ac_try\"") >&5
7110   (eval $ac_try) 2>&5
7111   ac_status=$?
7112   echo "$as_me:7112: \$? = $ac_status" >&5
7113   (exit "$ac_status"); }; }; then
7114   :
7115 else
7116   echo "$as_me: failed program was:" >&5
7117 cat "conftest.$ac_ext" >&5
7118 cf_have_incdir=yes
7119 fi
7120 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7121                           CPPFLAGS=$cf_save_CPPFLAGS
7122                         fi
7123                   fi
7124                 fi
7125
7126                 if test "$cf_have_incdir" = no ; then
7127                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7128
7129 echo "${as_me:-configure}:7129: testing adding $cf_add_incdir to include-path ..." 1>&5
7130
7131                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7132
7133                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7134                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7135                   cf_add_incdir="$cf_top_incdir"
7136                 else
7137                   break
7138                 fi
7139           else
7140                 break
7141           fi
7142         done
7143   done
7144 fi
7145
7146 if test -n "$cf_cv_library_path_utf8" ; then
7147         for cf_add_libdir in $cf_cv_library_path_utf8
7148         do
7149                 if test "$cf_add_libdir" = /usr/lib ; then
7150                         :
7151                 elif test -d "$cf_add_libdir"
7152                 then
7153                         cf_have_libdir=no
7154                         if test -n "$LDFLAGS$LIBS" ; then
7155                                 # a loop is needed to ensure we can add subdirs of existing dirs
7156                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7157                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7158                                                 cf_have_libdir=yes; break
7159                                         fi
7160                                 done
7161                         fi
7162                         if test "$cf_have_libdir" = no ; then
7163                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7164
7165 echo "${as_me:-configure}:7165: testing adding $cf_add_libdir to library-path ..." 1>&5
7166
7167                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7168                         fi
7169                 fi
7170         done
7171 fi
7172
7173 cf_add_libs="$LIBS"
7174 # reverse order
7175 cf_add_0lib=
7176 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7177 # filter duplicates
7178 for cf_add_1lib in $cf_add_0lib; do
7179         for cf_add_2lib in $cf_add_libs; do
7180                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7181                         cf_add_1lib=
7182                         break
7183                 fi
7184         done
7185         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7186 done
7187 LIBS="$cf_add_libs"
7188
7189 fi
7190
7191 cf_ncuconfig_root=ncursesw
7192 cf_have_ncuconfig=no
7193
7194 if test "x${PKG_CONFIG:=none}" != xnone; then
7195         echo "$as_me:7195: checking pkg-config for $cf_ncuconfig_root" >&5
7196 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7197         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7198                 echo "$as_me:7198: result: yes" >&5
7199 echo "${ECHO_T}yes" >&6
7200
7201                 echo "$as_me:7201: checking if the $cf_ncuconfig_root package files work" >&5
7202 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7203                 cf_have_ncuconfig=unknown
7204
7205                 cf_save_CFLAGS="$CFLAGS"
7206                 cf_save_CPPFLAGS="$CPPFLAGS"
7207                 cf_save_LIBS="$LIBS"
7208
7209                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7210                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7211
7212                 # while -W for passing linker flags is prevalent, it is not "standard".
7213                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7214                 # incompatible _and_ non-standard -W option which gives an error.  Work
7215                 # around that pitfall.
7216                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7217                 (x*c[89]9@@*-W*)
7218
7219 cf_fix_cppflags=no
7220 cf_new_cflags=
7221 cf_new_cppflags=
7222 cf_new_extra_cppflags=
7223
7224 for cf_add_cflags in $cf_pkg_cflags
7225 do
7226 case "$cf_fix_cppflags" in
7227 (no)
7228         case "$cf_add_cflags" in
7229         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7230                 case "$cf_add_cflags" in
7231                 (-D*)
7232                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7233
7234                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7235                                 && test -z "${cf_tst_cflags}" \
7236                                 && cf_fix_cppflags=yes
7237
7238                         if test "$cf_fix_cppflags" = yes ; then
7239
7240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7242
7243                                 continue
7244                         elif test "${cf_tst_cflags}" = "\"'" ; then
7245
7246         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7247         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7248
7249                                 continue
7250                         fi
7251                         ;;
7252                 esac
7253                 case "$CPPFLAGS" in
7254                 (*$cf_add_cflags)
7255                         ;;
7256                 (*)
7257                         case "$cf_add_cflags" in
7258                         (-D*)
7259                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7260
7261 CPPFLAGS=`echo "$CPPFLAGS" | \
7262         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7263                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7264
7265                                 ;;
7266                         esac
7267
7268         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7269         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7270
7271                         ;;
7272                 esac
7273                 ;;
7274         (*)
7275
7276         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7277         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7278
7279                 ;;
7280         esac
7281         ;;
7282 (yes)
7283
7284         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7285         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7286
7287         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7288
7289         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7290                 && test -z "${cf_tst_cflags}" \
7291                 && cf_fix_cppflags=no
7292         ;;
7293 esac
7294 done
7295
7296 if test -n "$cf_new_cflags" ; then
7297
7298         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7299         CFLAGS="${CFLAGS}$cf_new_cflags"
7300
7301 fi
7302
7303 if test -n "$cf_new_cppflags" ; then
7304
7305         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7306         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7307
7308 fi
7309
7310 if test -n "$cf_new_extra_cppflags" ; then
7311
7312         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7313         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7314
7315 fi
7316
7317 cf_add_libs="$LIBS"
7318 # reverse order
7319 cf_add_0lib=
7320 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7321 # filter duplicates
7322 for cf_add_1lib in $cf_add_0lib; do
7323         for cf_add_2lib in $cf_add_libs; do
7324                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7325                         cf_add_1lib=
7326                         break
7327                 fi
7328         done
7329         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7330 done
7331 LIBS="$cf_add_libs"
7332
7333                         cat >"conftest.$ac_ext" <<_ACEOF
7334 #line 7334 "configure"
7335 #include "confdefs.h"
7336 #include <${cf_cv_ncurses_header:-curses.h}>
7337 int
7338 main (void)
7339 {
7340 initscr(); mousemask(0,0); tigetstr((char *)0);
7341   ;
7342   return 0;
7343 }
7344 _ACEOF
7345 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7346 if { (eval echo "$as_me:7346: \"$ac_link\"") >&5
7347   (eval $ac_link) 2>&5
7348   ac_status=$?
7349   echo "$as_me:7349: \$? = $ac_status" >&5
7350   (exit "$ac_status"); } &&
7351          { ac_try='test -s "conftest$ac_exeext"'
7352   { (eval echo "$as_me:7352: \"$ac_try\"") >&5
7353   (eval $ac_try) 2>&5
7354   ac_status=$?
7355   echo "$as_me:7355: \$? = $ac_status" >&5
7356   (exit "$ac_status"); }; }; then
7357   if test "$cross_compiling" = yes; then
7358   cf_test_ncuconfig=maybe
7359 else
7360   cat >"conftest.$ac_ext" <<_ACEOF
7361 #line 7361 "configure"
7362 #include "confdefs.h"
7363 #include <${cf_cv_ncurses_header:-curses.h}>
7364                                         int main(void)
7365                                         { const char *xx = curses_version(); return (xx == 0); }
7366 _ACEOF
7367 rm -f "conftest$ac_exeext"
7368 if { (eval echo "$as_me:7368: \"$ac_link\"") >&5
7369   (eval $ac_link) 2>&5
7370   ac_status=$?
7371   echo "$as_me:7371: \$? = $ac_status" >&5
7372   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7373   { (eval echo "$as_me:7373: \"$ac_try\"") >&5
7374   (eval $ac_try) 2>&5
7375   ac_status=$?
7376   echo "$as_me:7376: \$? = $ac_status" >&5
7377   (exit "$ac_status"); }; }; then
7378   cf_test_ncuconfig=yes
7379 else
7380   echo "$as_me: program exited with status $ac_status" >&5
7381 echo "$as_me: failed program was:" >&5
7382 cat "conftest.$ac_ext" >&5
7383 cf_test_ncuconfig=no
7384 fi
7385 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7386 fi
7387 else
7388   echo "$as_me: failed program was:" >&5
7389 cat "conftest.$ac_ext" >&5
7390 cf_test_ncuconfig=no
7391 fi
7392 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7393
7394                         CFLAGS="$cf_save_CFLAGS"
7395                         CPPFLAGS="$cf_save_CPPFLAGS"
7396                         LIBS="$cf_save_LIBS"
7397
7398                         if test "x$cf_test_ncuconfig" != xyes; then
7399                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7400                                 cf_pkg_cflags="$cf_temp"
7401                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7402                                 cf_pkg_libs="$cf_temp"
7403                         fi
7404                         ;;
7405                 esac
7406
7407 for cf_add_cflags in $cf_pkg_cflags
7408 do
7409         case "x$cf_add_cflags" in
7410         (x-[DU]*)
7411
7412 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7413 while true
7414 do
7415         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'`
7416         test "$CFLAGS" != "$cf_old_cflag" || break
7417
7418         CFLAGS="$cf_old_cflag"
7419 done
7420
7421 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7422 while true
7423 do
7424         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'`
7425         test "$CPPFLAGS" != "$cf_old_cflag" || break
7426
7427         CPPFLAGS="$cf_old_cflag"
7428 done
7429
7430                 ;;
7431         esac
7432
7433 cf_fix_cppflags=no
7434 cf_new_cflags=
7435 cf_new_cppflags=
7436 cf_new_extra_cppflags=
7437
7438 for cf_add_cflags in $cf_add_cflags
7439 do
7440 case "$cf_fix_cppflags" in
7441 (no)
7442         case "$cf_add_cflags" in
7443         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7444                 case "$cf_add_cflags" in
7445                 (-D*)
7446                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7447
7448                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7449                                 && test -z "${cf_tst_cflags}" \
7450                                 && cf_fix_cppflags=yes
7451
7452                         if test "$cf_fix_cppflags" = yes ; then
7453
7454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7456
7457                                 continue
7458                         elif test "${cf_tst_cflags}" = "\"'" ; then
7459
7460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7462
7463                                 continue
7464                         fi
7465                         ;;
7466                 esac
7467                 case "$CPPFLAGS" in
7468                 (*$cf_add_cflags)
7469                         ;;
7470                 (*)
7471                         case "$cf_add_cflags" in
7472                         (-D*)
7473                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7474
7475 CPPFLAGS=`echo "$CPPFLAGS" | \
7476         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7477                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7478
7479                                 ;;
7480                         esac
7481
7482         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7483         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7484
7485                         ;;
7486                 esac
7487                 ;;
7488         (*)
7489
7490         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7491         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7492
7493                 ;;
7494         esac
7495         ;;
7496 (yes)
7497
7498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7500
7501         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7502
7503         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7504                 && test -z "${cf_tst_cflags}" \
7505                 && cf_fix_cppflags=no
7506         ;;
7507 esac
7508 done
7509
7510 if test -n "$cf_new_cflags" ; then
7511
7512         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7513         CFLAGS="${CFLAGS}$cf_new_cflags"
7514
7515 fi
7516
7517 if test -n "$cf_new_cppflags" ; then
7518
7519         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7520         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7521
7522 fi
7523
7524 if test -n "$cf_new_extra_cppflags" ; then
7525
7526         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7527         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7528
7529 fi
7530
7531 done
7532
7533 cf_add_libs="$LIBS"
7534 # reverse order
7535 cf_add_0lib=
7536 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7537 # filter duplicates
7538 for cf_add_1lib in $cf_add_0lib; do
7539         for cf_add_2lib in $cf_add_libs; do
7540                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7541                         cf_add_1lib=
7542                         break
7543                 fi
7544         done
7545         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7546 done
7547 LIBS="$cf_add_libs"
7548
7549                 cat >"conftest.$ac_ext" <<_ACEOF
7550 #line 7550 "configure"
7551 #include "confdefs.h"
7552 #include <${cf_cv_ncurses_header:-curses.h}>
7553 int
7554 main (void)
7555 {
7556 initscr(); mousemask(0,0); tigetstr((char *)0);
7557   ;
7558   return 0;
7559 }
7560 _ACEOF
7561 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7562 if { (eval echo "$as_me:7562: \"$ac_link\"") >&5
7563   (eval $ac_link) 2>&5
7564   ac_status=$?
7565   echo "$as_me:7565: \$? = $ac_status" >&5
7566   (exit "$ac_status"); } &&
7567          { ac_try='test -s "conftest$ac_exeext"'
7568   { (eval echo "$as_me:7568: \"$ac_try\"") >&5
7569   (eval $ac_try) 2>&5
7570   ac_status=$?
7571   echo "$as_me:7571: \$? = $ac_status" >&5
7572   (exit "$ac_status"); }; }; then
7573   if test "$cross_compiling" = yes; then
7574   cf_have_ncuconfig=maybe
7575 else
7576   cat >"conftest.$ac_ext" <<_ACEOF
7577 #line 7577 "configure"
7578 #include "confdefs.h"
7579 #include <${cf_cv_ncurses_header:-curses.h}>
7580                                 int main(void)
7581                                 { const char *xx = curses_version(); return (xx == 0); }
7582 _ACEOF
7583 rm -f "conftest$ac_exeext"
7584 if { (eval echo "$as_me:7584: \"$ac_link\"") >&5
7585   (eval $ac_link) 2>&5
7586   ac_status=$?
7587   echo "$as_me:7587: \$? = $ac_status" >&5
7588   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7589   { (eval echo "$as_me:7589: \"$ac_try\"") >&5
7590   (eval $ac_try) 2>&5
7591   ac_status=$?
7592   echo "$as_me:7592: \$? = $ac_status" >&5
7593   (exit "$ac_status"); }; }; then
7594   cf_have_ncuconfig=yes
7595 else
7596   echo "$as_me: program exited with status $ac_status" >&5
7597 echo "$as_me: failed program was:" >&5
7598 cat "conftest.$ac_ext" >&5
7599 cf_have_ncuconfig=no
7600 fi
7601 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7602 fi
7603 else
7604   echo "$as_me: failed program was:" >&5
7605 cat "conftest.$ac_ext" >&5
7606 cf_have_ncuconfig=no
7607 fi
7608 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7609                 echo "$as_me:7609: result: $cf_have_ncuconfig" >&5
7610 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7611                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7612                 if test "$cf_have_ncuconfig" != "yes"
7613                 then
7614                         CPPFLAGS="$cf_save_CPPFLAGS"
7615                         LIBS="$cf_save_LIBS"
7616                         NCURSES_CONFIG_PKG=none
7617                 else
7618
7619 cat >>confdefs.h <<\EOF
7620 #define NCURSES 1
7621 EOF
7622
7623                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7624
7625 echo "$as_me:7625: checking for terminfo header" >&5
7626 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7627 if test "${cf_cv_term_header+set}" = set; then
7628   echo $ECHO_N "(cached) $ECHO_C" >&6
7629 else
7630
7631 case "${cf_cv_ncurses_header}" in
7632 (*/ncurses.h|*/ncursesw.h)
7633         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7634         ;;
7635 (*)
7636         cf_term_header=term.h
7637         ;;
7638 esac
7639
7640 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7641 do
7642 cat >"conftest.$ac_ext" <<_ACEOF
7643 #line 7643 "configure"
7644 #include "confdefs.h"
7645 #include <stdio.h>
7646 #include <${cf_cv_ncurses_header:-curses.h}>
7647 #include <$cf_test>
7648
7649 int
7650 main (void)
7651 {
7652 int x = auto_left_margin; (void)x
7653   ;
7654   return 0;
7655 }
7656 _ACEOF
7657 rm -f "conftest.$ac_objext"
7658 if { (eval echo "$as_me:7658: \"$ac_compile\"") >&5
7659   (eval $ac_compile) 2>&5
7660   ac_status=$?
7661   echo "$as_me:7661: \$? = $ac_status" >&5
7662   (exit "$ac_status"); } &&
7663          { ac_try='test -s "conftest.$ac_objext"'
7664   { (eval echo "$as_me:7664: \"$ac_try\"") >&5
7665   (eval $ac_try) 2>&5
7666   ac_status=$?
7667   echo "$as_me:7667: \$? = $ac_status" >&5
7668   (exit "$ac_status"); }; }; then
7669
7670         cf_cv_term_header="$cf_test"
7671 else
7672   echo "$as_me: failed program was:" >&5
7673 cat "conftest.$ac_ext" >&5
7674
7675         cf_cv_term_header=unknown
7676
7677 fi
7678 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7679         test "$cf_cv_term_header" != unknown && break
7680 done
7681
7682 fi
7683 echo "$as_me:7683: result: $cf_cv_term_header" >&5
7684 echo "${ECHO_T}$cf_cv_term_header" >&6
7685
7686 # Set definitions to allow ifdef'ing to accommodate subdirectories
7687
7688 case "$cf_cv_term_header" in
7689 (*term.h)
7690
7691 cat >>confdefs.h <<\EOF
7692 #define HAVE_TERM_H 1
7693 EOF
7694
7695         ;;
7696 esac
7697
7698 case "$cf_cv_term_header" in
7699 (ncurses/term.h)
7700
7701 cat >>confdefs.h <<\EOF
7702 #define HAVE_NCURSES_TERM_H 1
7703 EOF
7704
7705         ;;
7706 (ncursesw/term.h)
7707
7708 cat >>confdefs.h <<\EOF
7709 #define HAVE_NCURSESW_TERM_H 1
7710 EOF
7711
7712         ;;
7713 esac
7714
7715                 fi
7716
7717         else
7718                 echo "$as_me:7718: result: no" >&5
7719 echo "${ECHO_T}no" >&6
7720                 NCURSES_CONFIG_PKG=none
7721         fi
7722 else
7723         NCURSES_CONFIG_PKG=none
7724 fi
7725
7726 if test "x$cf_have_ncuconfig" = "xno"; then
7727         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7728
7729 if test -n "$ac_tool_prefix"; then
7730   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7731   do
7732     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7733 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7734 echo "$as_me:7734: checking for $ac_word" >&5
7735 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7736 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7737   echo $ECHO_N "(cached) $ECHO_C" >&6
7738 else
7739   if test -n "$NCURSES_CONFIG"; then
7740   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7741 else
7742   ac_save_IFS=$IFS; IFS=$ac_path_separator
7743 ac_dummy="$PATH"
7744 for ac_dir in $ac_dummy; do
7745   IFS=$ac_save_IFS
7746   test -z "$ac_dir" && ac_dir=.
7747   $as_executable_p "$ac_dir/$ac_word" || continue
7748 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7749 echo "$as_me:7749: found $ac_dir/$ac_word" >&5
7750 break
7751 done
7752
7753 fi
7754 fi
7755 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7756 if test -n "$NCURSES_CONFIG"; then
7757   echo "$as_me:7757: result: $NCURSES_CONFIG" >&5
7758 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7759 else
7760   echo "$as_me:7760: result: no" >&5
7761 echo "${ECHO_T}no" >&6
7762 fi
7763
7764     test -n "$NCURSES_CONFIG" && break
7765   done
7766 fi
7767 if test -z "$NCURSES_CONFIG"; then
7768   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7769   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7770 do
7771   # Extract the first word of "$ac_prog", so it can be a program name with args.
7772 set dummy $ac_prog; ac_word=$2
7773 echo "$as_me:7773: checking for $ac_word" >&5
7774 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7775 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7776   echo $ECHO_N "(cached) $ECHO_C" >&6
7777 else
7778   if test -n "$ac_ct_NCURSES_CONFIG"; then
7779   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7780 else
7781   ac_save_IFS=$IFS; IFS=$ac_path_separator
7782 ac_dummy="$PATH"
7783 for ac_dir in $ac_dummy; do
7784   IFS=$ac_save_IFS
7785   test -z "$ac_dir" && ac_dir=.
7786   $as_executable_p "$ac_dir/$ac_word" || continue
7787 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7788 echo "$as_me:7788: found $ac_dir/$ac_word" >&5
7789 break
7790 done
7791
7792 fi
7793 fi
7794 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7795 if test -n "$ac_ct_NCURSES_CONFIG"; then
7796   echo "$as_me:7796: result: $ac_ct_NCURSES_CONFIG" >&5
7797 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7798 else
7799   echo "$as_me:7799: result: no" >&5
7800 echo "${ECHO_T}no" >&6
7801 fi
7802
7803   test -n "$ac_ct_NCURSES_CONFIG" && break
7804 done
7805 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7806
7807   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7808 fi
7809
7810         if test "$NCURSES_CONFIG" != none ; then
7811
7812 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7813 do
7814         case "x$cf_add_cflags" in
7815         (x-[DU]*)
7816
7817 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7818 while true
7819 do
7820         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'`
7821         test "$CFLAGS" != "$cf_old_cflag" || break
7822
7823         CFLAGS="$cf_old_cflag"
7824 done
7825
7826 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7827 while true
7828 do
7829         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'`
7830         test "$CPPFLAGS" != "$cf_old_cflag" || break
7831
7832         CPPFLAGS="$cf_old_cflag"
7833 done
7834
7835                 ;;
7836         esac
7837
7838 cf_fix_cppflags=no
7839 cf_new_cflags=
7840 cf_new_cppflags=
7841 cf_new_extra_cppflags=
7842
7843 for cf_add_cflags in $cf_add_cflags
7844 do
7845 case "$cf_fix_cppflags" in
7846 (no)
7847         case "$cf_add_cflags" in
7848         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7849                 case "$cf_add_cflags" in
7850                 (-D*)
7851                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7852
7853                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7854                                 && test -z "${cf_tst_cflags}" \
7855                                 && cf_fix_cppflags=yes
7856
7857                         if test "$cf_fix_cppflags" = yes ; then
7858
7859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7861
7862                                 continue
7863                         elif test "${cf_tst_cflags}" = "\"'" ; then
7864
7865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7867
7868                                 continue
7869                         fi
7870                         ;;
7871                 esac
7872                 case "$CPPFLAGS" in
7873                 (*$cf_add_cflags)
7874                         ;;
7875                 (*)
7876                         case "$cf_add_cflags" in
7877                         (-D*)
7878                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7879
7880 CPPFLAGS=`echo "$CPPFLAGS" | \
7881         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7882                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7883
7884                                 ;;
7885                         esac
7886
7887         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7888         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7889
7890                         ;;
7891                 esac
7892                 ;;
7893         (*)
7894
7895         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7896         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7897
7898                 ;;
7899         esac
7900         ;;
7901 (yes)
7902
7903         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7904         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7905
7906         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7907
7908         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7909                 && test -z "${cf_tst_cflags}" \
7910                 && cf_fix_cppflags=no
7911         ;;
7912 esac
7913 done
7914
7915 if test -n "$cf_new_cflags" ; then
7916
7917         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7918         CFLAGS="${CFLAGS}$cf_new_cflags"
7919
7920 fi
7921
7922 if test -n "$cf_new_cppflags" ; then
7923
7924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7925         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7926
7927 fi
7928
7929 if test -n "$cf_new_extra_cppflags" ; then
7930
7931         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7932         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7933
7934 fi
7935
7936 done
7937
7938 cf_add_libs="$LIBS"
7939 # reverse order
7940 cf_add_0lib=
7941 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7942 # filter duplicates
7943 for cf_add_1lib in $cf_add_0lib; do
7944         for cf_add_2lib in $cf_add_libs; do
7945                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7946                         cf_add_1lib=
7947                         break
7948                 fi
7949         done
7950         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7951 done
7952 LIBS="$cf_add_libs"
7953
7954                 # even with config script, some packages use no-override for curses.h
7955
7956 echo "$as_me:7956: checking if we have identified curses headers" >&5
7957 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7958 if test "${cf_cv_ncurses_header+set}" = set; then
7959   echo $ECHO_N "(cached) $ECHO_C" >&6
7960 else
7961
7962 cf_cv_ncurses_header=none
7963 for cf_header in \
7964         ncurses.h ncursesw/ncurses.h \
7965         curses.h ncursesw/curses.h
7966 do
7967 cat >"conftest.$ac_ext" <<_ACEOF
7968 #line 7968 "configure"
7969 #include "confdefs.h"
7970 #include <${cf_header}>
7971 int
7972 main (void)
7973 {
7974 initscr(); tgoto("?", 0,0)
7975   ;
7976   return 0;
7977 }
7978 _ACEOF
7979 rm -f "conftest.$ac_objext"
7980 if { (eval echo "$as_me:7980: \"$ac_compile\"") >&5
7981   (eval $ac_compile) 2>&5
7982   ac_status=$?
7983   echo "$as_me:7983: \$? = $ac_status" >&5
7984   (exit "$ac_status"); } &&
7985          { ac_try='test -s "conftest.$ac_objext"'
7986   { (eval echo "$as_me:7986: \"$ac_try\"") >&5
7987   (eval $ac_try) 2>&5
7988   ac_status=$?
7989   echo "$as_me:7989: \$? = $ac_status" >&5
7990   (exit "$ac_status"); }; }; then
7991   cf_cv_ncurses_header=$cf_header; break
7992 else
7993   echo "$as_me: failed program was:" >&5
7994 cat "conftest.$ac_ext" >&5
7995 fi
7996 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7997 done
7998
7999 fi
8000 echo "$as_me:8000: result: $cf_cv_ncurses_header" >&5
8001 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8002
8003 if test "$cf_cv_ncurses_header" = none ; then
8004         { { echo "$as_me:8004: error: No curses header-files found" >&5
8005 echo "$as_me: error: No curses header-files found" >&2;}
8006    { (exit 1); exit 1; }; }
8007 fi
8008
8009 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8010
8011 for ac_header in $cf_cv_ncurses_header
8012 do
8013 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8014 echo "$as_me:8014: checking for $ac_header" >&5
8015 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8016 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8017   echo $ECHO_N "(cached) $ECHO_C" >&6
8018 else
8019   cat >"conftest.$ac_ext" <<_ACEOF
8020 #line 8020 "configure"
8021 #include "confdefs.h"
8022 #include <$ac_header>
8023 _ACEOF
8024 if { (eval echo "$as_me:8024: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8025   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8026   ac_status=$?
8027   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8028   rm -f conftest.er1
8029   cat conftest.err >&5
8030   echo "$as_me:8030: \$? = $ac_status" >&5
8031   (exit "$ac_status"); } >/dev/null; then
8032   if test -s conftest.err; then
8033     ac_cpp_err=$ac_c_preproc_warn_flag
8034   else
8035     ac_cpp_err=
8036   fi
8037 else
8038   ac_cpp_err=yes
8039 fi
8040 if test -z "$ac_cpp_err"; then
8041   eval "$as_ac_Header=yes"
8042 else
8043   echo "$as_me: failed program was:" >&5
8044   cat "conftest.$ac_ext" >&5
8045   eval "$as_ac_Header=no"
8046 fi
8047 rm -f conftest.err "conftest.$ac_ext"
8048 fi
8049 echo "$as_me:8049: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8050 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8051 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8052   cat >>confdefs.h <<EOF
8053 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8054 EOF
8055
8056 fi
8057 done
8058
8059 cat >>confdefs.h <<\EOF
8060 #define NCURSES 1
8061 EOF
8062
8063 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8064
8065                 cat >>confdefs.h <<EOF
8066 #define $cf_nculib_ROOT 1
8067 EOF
8068
8069                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8070
8071         else
8072
8073 cf_ncuhdr_root=ncursesw
8074
8075 test -n "$cf_cv_curses_dir" && \
8076 test "$cf_cv_curses_dir" != "no" && { \
8077
8078 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8079   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8080   do
8081         while test "$cf_add_incdir" != /usr/include
8082         do
8083           if test -d "$cf_add_incdir"
8084           then
8085                 cf_have_incdir=no
8086                 if test -n "$CFLAGS$CPPFLAGS" ; then
8087                   # a loop is needed to ensure we can add subdirs of existing dirs
8088                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8089                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8090                           cf_have_incdir=yes; break
8091                         fi
8092                   done
8093                 fi
8094
8095                 if test "$cf_have_incdir" = no ; then
8096                   if test "$cf_add_incdir" = /usr/local/include ; then
8097                         if test "$GCC" = yes
8098                         then
8099                           cf_save_CPPFLAGS=$CPPFLAGS
8100
8101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8102         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8103
8104                           cat >"conftest.$ac_ext" <<_ACEOF
8105 #line 8105 "configure"
8106 #include "confdefs.h"
8107 #include <stdio.h>
8108 int
8109 main (void)
8110 {
8111 printf("Hello")
8112   ;
8113   return 0;
8114 }
8115 _ACEOF
8116 rm -f "conftest.$ac_objext"
8117 if { (eval echo "$as_me:8117: \"$ac_compile\"") >&5
8118   (eval $ac_compile) 2>&5
8119   ac_status=$?
8120   echo "$as_me:8120: \$? = $ac_status" >&5
8121   (exit "$ac_status"); } &&
8122          { ac_try='test -s "conftest.$ac_objext"'
8123   { (eval echo "$as_me:8123: \"$ac_try\"") >&5
8124   (eval $ac_try) 2>&5
8125   ac_status=$?
8126   echo "$as_me:8126: \$? = $ac_status" >&5
8127   (exit "$ac_status"); }; }; then
8128   :
8129 else
8130   echo "$as_me: failed program was:" >&5
8131 cat "conftest.$ac_ext" >&5
8132 cf_have_incdir=yes
8133 fi
8134 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8135                           CPPFLAGS=$cf_save_CPPFLAGS
8136                         fi
8137                   fi
8138                 fi
8139
8140                 if test "$cf_have_incdir" = no ; then
8141                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8142
8143 echo "${as_me:-configure}:8143: testing adding $cf_add_incdir to include-path ..." 1>&5
8144
8145                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8146
8147                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8148                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8149                   cf_add_incdir="$cf_top_incdir"
8150                 else
8151                   break
8152                 fi
8153           else
8154                 break
8155           fi
8156         done
8157   done
8158 fi
8159
8160 }
8161
8162 echo "$as_me:8162: checking for $cf_ncuhdr_root header in include-path" >&5
8163 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8164 if test "${cf_cv_ncurses_h+set}" = set; then
8165   echo $ECHO_N "(cached) $ECHO_C" >&6
8166 else
8167
8168         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8169         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8170         for cf_header in $cf_header_list
8171         do
8172
8173         cat >"conftest.$ac_ext" <<_ACEOF
8174 #line 8174 "configure"
8175 #include "confdefs.h"
8176
8177 #define _XOPEN_SOURCE_EXTENDED
8178 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8179 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8180
8181 #include <$cf_header>
8182 int
8183 main (void)
8184 {
8185
8186 #ifdef NCURSES_VERSION
8187
8188 #ifndef WACS_BSSB
8189         make an error
8190 #endif
8191
8192 printf("%s\\n", NCURSES_VERSION);
8193 #else
8194 #ifdef __NCURSES_H
8195 printf("old\\n");
8196 #else
8197         make an error
8198 #endif
8199 #endif
8200
8201   ;
8202   return 0;
8203 }
8204 _ACEOF
8205 rm -f "conftest.$ac_objext"
8206 if { (eval echo "$as_me:8206: \"$ac_compile\"") >&5
8207   (eval $ac_compile) 2>&5
8208   ac_status=$?
8209   echo "$as_me:8209: \$? = $ac_status" >&5
8210   (exit "$ac_status"); } &&
8211          { ac_try='test -s "conftest.$ac_objext"'
8212   { (eval echo "$as_me:8212: \"$ac_try\"") >&5
8213   (eval $ac_try) 2>&5
8214   ac_status=$?
8215   echo "$as_me:8215: \$? = $ac_status" >&5
8216   (exit "$ac_status"); }; }; then
8217   cf_cv_ncurses_h=$cf_header
8218
8219 else
8220   echo "$as_me: failed program was:" >&5
8221 cat "conftest.$ac_ext" >&5
8222 cf_cv_ncurses_h=no
8223 fi
8224 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8225
8226                 test "$cf_cv_ncurses_h" != no && break
8227         done
8228
8229 fi
8230 echo "$as_me:8230: result: $cf_cv_ncurses_h" >&5
8231 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8232
8233 if test "$cf_cv_ncurses_h" != no ; then
8234         cf_cv_ncurses_header=$cf_cv_ncurses_h
8235 else
8236
8237 echo "$as_me:8237: checking for $cf_ncuhdr_root include-path" >&5
8238 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8239 if test "${cf_cv_ncurses_h2+set}" = set; then
8240   echo $ECHO_N "(cached) $ECHO_C" >&6
8241 else
8242
8243         test -n "$verbose" && echo
8244
8245 cf_search=
8246
8247 # collect the current set of include-directories from compiler flags
8248 cf_header_path_list=""
8249 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8250         for cf_header_path in $CPPFLAGS $CFLAGS
8251         do
8252                 case "$cf_header_path" in
8253                 (-I*)
8254                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8255
8256 test "x$cf_header_path" != "xNONE" && \
8257 test -d "$cf_header_path" && \
8258  {
8259         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8260         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8261         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8262         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8263         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8264         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"
8265 }
8266
8267                         cf_header_path_list="$cf_header_path_list $cf_search"
8268                         ;;
8269                 esac
8270         done
8271 fi
8272
8273 # add the variations for the package we are looking for
8274
8275 cf_search=
8276
8277 test "x$prefix" != "xNONE" && \
8278 test -d "$prefix" && \
8279  {
8280         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8281         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8282         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8283         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8284         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8285         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8286 }
8287
8288 for cf_subdir_prefix in \
8289         /usr \
8290         /usr/local \
8291         /usr/pkg \
8292         /opt \
8293         /opt/local \
8294         $HOME
8295 do
8296
8297 test "x$cf_subdir_prefix" != "x$prefix" && \
8298 test -d "$cf_subdir_prefix" && \
8299 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8300         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8301         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8302         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8303         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8304         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8305         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"
8306 }
8307
8308 done
8309
8310 test "$includedir" != NONE && \
8311 test "$includedir" != "/usr/include" && \
8312 test -d "$includedir" && {
8313         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8314         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8315 }
8316
8317 test "$oldincludedir" != NONE && \
8318 test "$oldincludedir" != "/usr/include" && \
8319 test -d "$oldincludedir" && {
8320         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8321         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8322 }
8323
8324 cf_search="$cf_search $cf_header_path_list"
8325
8326         test -n "$verbose" && echo "search path $cf_search"
8327         cf_save2_CPPFLAGS="$CPPFLAGS"
8328         for cf_incdir in $cf_search
8329         do
8330
8331 if test -n "$cf_incdir" ; then
8332   for cf_add_incdir in $cf_incdir
8333   do
8334         while test "$cf_add_incdir" != /usr/include
8335         do
8336           if test -d "$cf_add_incdir"
8337           then
8338                 cf_have_incdir=no
8339                 if test -n "$CFLAGS$CPPFLAGS" ; then
8340                   # a loop is needed to ensure we can add subdirs of existing dirs
8341                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8342                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8343                           cf_have_incdir=yes; break
8344                         fi
8345                   done
8346                 fi
8347
8348                 if test "$cf_have_incdir" = no ; then
8349                   if test "$cf_add_incdir" = /usr/local/include ; then
8350                         if test "$GCC" = yes
8351                         then
8352                           cf_save_CPPFLAGS=$CPPFLAGS
8353
8354         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8355         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8356
8357                           cat >"conftest.$ac_ext" <<_ACEOF
8358 #line 8358 "configure"
8359 #include "confdefs.h"
8360 #include <stdio.h>
8361 int
8362 main (void)
8363 {
8364 printf("Hello")
8365   ;
8366   return 0;
8367 }
8368 _ACEOF
8369 rm -f "conftest.$ac_objext"
8370 if { (eval echo "$as_me:8370: \"$ac_compile\"") >&5
8371   (eval $ac_compile) 2>&5
8372   ac_status=$?
8373   echo "$as_me:8373: \$? = $ac_status" >&5
8374   (exit "$ac_status"); } &&
8375          { ac_try='test -s "conftest.$ac_objext"'
8376   { (eval echo "$as_me:8376: \"$ac_try\"") >&5
8377   (eval $ac_try) 2>&5
8378   ac_status=$?
8379   echo "$as_me:8379: \$? = $ac_status" >&5
8380   (exit "$ac_status"); }; }; then
8381   :
8382 else
8383   echo "$as_me: failed program was:" >&5
8384 cat "conftest.$ac_ext" >&5
8385 cf_have_incdir=yes
8386 fi
8387 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8388                           CPPFLAGS=$cf_save_CPPFLAGS
8389                         fi
8390                   fi
8391                 fi
8392
8393                 if test "$cf_have_incdir" = no ; then
8394                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8395
8396 echo "${as_me:-configure}:8396: testing adding $cf_add_incdir to include-path ..." 1>&5
8397
8398                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8399
8400                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8401                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8402                   cf_add_incdir="$cf_top_incdir"
8403                 else
8404                   break
8405                 fi
8406           else
8407                 break
8408           fi
8409         done
8410   done
8411 fi
8412
8413                 for cf_header in \
8414                         ncurses.h \
8415                         curses.h
8416                 do
8417
8418         cat >"conftest.$ac_ext" <<_ACEOF
8419 #line 8419 "configure"
8420 #include "confdefs.h"
8421
8422 #include <$cf_header>
8423 int
8424 main (void)
8425 {
8426
8427 #ifdef NCURSES_VERSION
8428
8429 printf("%s\\n", NCURSES_VERSION);
8430 #else
8431 #ifdef __NCURSES_H
8432 printf("old\\n");
8433 #else
8434         make an error
8435 #endif
8436 #endif
8437
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_h2=$cf_header
8455
8456 else
8457   echo "$as_me: failed program was:" >&5
8458 cat "conftest.$ac_ext" >&5
8459 cf_cv_ncurses_h2=no
8460 fi
8461 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8462
8463                         if test "$cf_cv_ncurses_h2" != no ; then
8464                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8465                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8466                                 break
8467                         fi
8468                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8469                 done
8470                 CPPFLAGS="$cf_save2_CPPFLAGS"
8471                 test "$cf_cv_ncurses_h2" != no && break
8472         done
8473         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8473: error: not found" >&5
8474 echo "$as_me: error: not found" >&2;}
8475    { (exit 1); exit 1; }; }
8476
8477 fi
8478 echo "$as_me:8478: result: $cf_cv_ncurses_h2" >&5
8479 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8480
8481         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8482         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8483         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8484                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8485         fi
8486
8487 if test -n "$cf_1st_incdir" ; then
8488   for cf_add_incdir in $cf_1st_incdir
8489   do
8490         while test "$cf_add_incdir" != /usr/include
8491         do
8492           if test -d "$cf_add_incdir"
8493           then
8494                 cf_have_incdir=no
8495                 if test -n "$CFLAGS$CPPFLAGS" ; then
8496                   # a loop is needed to ensure we can add subdirs of existing dirs
8497                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8498                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8499                           cf_have_incdir=yes; break
8500                         fi
8501                   done
8502                 fi
8503
8504                 if test "$cf_have_incdir" = no ; then
8505                   if test "$cf_add_incdir" = /usr/local/include ; then
8506                         if test "$GCC" = yes
8507                         then
8508                           cf_save_CPPFLAGS=$CPPFLAGS
8509
8510         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8511         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8512
8513                           cat >"conftest.$ac_ext" <<_ACEOF
8514 #line 8514 "configure"
8515 #include "confdefs.h"
8516 #include <stdio.h>
8517 int
8518 main (void)
8519 {
8520 printf("Hello")
8521   ;
8522   return 0;
8523 }
8524 _ACEOF
8525 rm -f "conftest.$ac_objext"
8526 if { (eval echo "$as_me:8526: \"$ac_compile\"") >&5
8527   (eval $ac_compile) 2>&5
8528   ac_status=$?
8529   echo "$as_me:8529: \$? = $ac_status" >&5
8530   (exit "$ac_status"); } &&
8531          { ac_try='test -s "conftest.$ac_objext"'
8532   { (eval echo "$as_me:8532: \"$ac_try\"") >&5
8533   (eval $ac_try) 2>&5
8534   ac_status=$?
8535   echo "$as_me:8535: \$? = $ac_status" >&5
8536   (exit "$ac_status"); }; }; then
8537   :
8538 else
8539   echo "$as_me: failed program was:" >&5
8540 cat "conftest.$ac_ext" >&5
8541 cf_have_incdir=yes
8542 fi
8543 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8544                           CPPFLAGS=$cf_save_CPPFLAGS
8545                         fi
8546                   fi
8547                 fi
8548
8549                 if test "$cf_have_incdir" = no ; then
8550                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8551
8552 echo "${as_me:-configure}:8552: testing adding $cf_add_incdir to include-path ..." 1>&5
8553
8554                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8555
8556                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8557                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8558                   cf_add_incdir="$cf_top_incdir"
8559                 else
8560                   break
8561                 fi
8562           else
8563                 break
8564           fi
8565         done
8566   done
8567 fi
8568
8569 fi
8570
8571 # Set definitions to allow ifdef'ing for ncurses.h
8572
8573 case "$cf_cv_ncurses_header" in
8574 (*ncurses.h)
8575
8576 cat >>confdefs.h <<\EOF
8577 #define HAVE_NCURSES_H 1
8578 EOF
8579
8580         ;;
8581 esac
8582
8583 case "$cf_cv_ncurses_header" in
8584 (ncurses/curses.h|ncurses/ncurses.h)
8585
8586 cat >>confdefs.h <<\EOF
8587 #define HAVE_NCURSES_NCURSES_H 1
8588 EOF
8589
8590         ;;
8591 (ncursesw/curses.h|ncursesw/ncurses.h)
8592
8593 cat >>confdefs.h <<\EOF
8594 #define HAVE_NCURSESW_NCURSES_H 1
8595 EOF
8596
8597         ;;
8598 esac
8599
8600 echo "$as_me:8600: checking for terminfo header" >&5
8601 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8602 if test "${cf_cv_term_header+set}" = set; then
8603   echo $ECHO_N "(cached) $ECHO_C" >&6
8604 else
8605
8606 case "${cf_cv_ncurses_header}" in
8607 (*/ncurses.h|*/ncursesw.h)
8608         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8609         ;;
8610 (*)
8611         cf_term_header=term.h
8612         ;;
8613 esac
8614
8615 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8616 do
8617 cat >"conftest.$ac_ext" <<_ACEOF
8618 #line 8618 "configure"
8619 #include "confdefs.h"
8620 #include <stdio.h>
8621 #include <${cf_cv_ncurses_header:-curses.h}>
8622 #include <$cf_test>
8623
8624 int
8625 main (void)
8626 {
8627 int x = auto_left_margin; (void)x
8628   ;
8629   return 0;
8630 }
8631 _ACEOF
8632 rm -f "conftest.$ac_objext"
8633 if { (eval echo "$as_me:8633: \"$ac_compile\"") >&5
8634   (eval $ac_compile) 2>&5
8635   ac_status=$?
8636   echo "$as_me:8636: \$? = $ac_status" >&5
8637   (exit "$ac_status"); } &&
8638          { ac_try='test -s "conftest.$ac_objext"'
8639   { (eval echo "$as_me:8639: \"$ac_try\"") >&5
8640   (eval $ac_try) 2>&5
8641   ac_status=$?
8642   echo "$as_me:8642: \$? = $ac_status" >&5
8643   (exit "$ac_status"); }; }; then
8644
8645         cf_cv_term_header="$cf_test"
8646 else
8647   echo "$as_me: failed program was:" >&5
8648 cat "conftest.$ac_ext" >&5
8649
8650         cf_cv_term_header=unknown
8651
8652 fi
8653 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8654         test "$cf_cv_term_header" != unknown && break
8655 done
8656
8657 fi
8658 echo "$as_me:8658: result: $cf_cv_term_header" >&5
8659 echo "${ECHO_T}$cf_cv_term_header" >&6
8660
8661 # Set definitions to allow ifdef'ing to accommodate subdirectories
8662
8663 case "$cf_cv_term_header" in
8664 (*term.h)
8665
8666 cat >>confdefs.h <<\EOF
8667 #define HAVE_TERM_H 1
8668 EOF
8669
8670         ;;
8671 esac
8672
8673 case "$cf_cv_term_header" in
8674 (ncurses/term.h)
8675
8676 cat >>confdefs.h <<\EOF
8677 #define HAVE_NCURSES_TERM_H 1
8678 EOF
8679
8680         ;;
8681 (ncursesw/term.h)
8682
8683 cat >>confdefs.h <<\EOF
8684 #define HAVE_NCURSESW_TERM_H 1
8685 EOF
8686
8687         ;;
8688 esac
8689
8690 # some applications need this, but should check for NCURSES_VERSION
8691
8692 cat >>confdefs.h <<\EOF
8693 #define NCURSES 1
8694 EOF
8695
8696 echo "$as_me:8696: checking for ncurses version" >&5
8697 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8698 if test "${cf_cv_ncurses_version+set}" = set; then
8699   echo $ECHO_N "(cached) $ECHO_C" >&6
8700 else
8701
8702         cf_cv_ncurses_version=no
8703         cf_tempfile=out$$
8704         rm -f "$cf_tempfile"
8705         if test "$cross_compiling" = yes; then
8706
8707         # This will not work if the preprocessor splits the line after the
8708         # Autoconf token.  The 'unproto' program does that.
8709         cat > "conftest.$ac_ext" <<EOF
8710 #include <${cf_cv_ncurses_header:-curses.h}>
8711 #undef Autoconf
8712 #ifdef NCURSES_VERSION
8713 Autoconf NCURSES_VERSION
8714 #else
8715 #ifdef __NCURSES_H
8716 Autoconf "old"
8717 #endif
8718 ;
8719 #endif
8720 EOF
8721         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8722         { (eval echo "$as_me:8722: \"$cf_try\"") >&5
8723   (eval $cf_try) 2>&5
8724   ac_status=$?
8725   echo "$as_me:8725: \$? = $ac_status" >&5
8726   (exit "$ac_status"); }
8727         if test -f conftest.out ; then
8728                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8729                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8730                 rm -f conftest.out
8731         fi
8732
8733 else
8734   cat >"conftest.$ac_ext" <<_ACEOF
8735 #line 8735 "configure"
8736 #include "confdefs.h"
8737
8738 #include <${cf_cv_ncurses_header:-curses.h}>
8739 #include <stdio.h>
8740 int main(void)
8741 {
8742         FILE *fp = fopen("$cf_tempfile", "w");
8743 #ifdef NCURSES_VERSION
8744 # ifdef NCURSES_VERSION_PATCH
8745         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8746 # else
8747         fprintf(fp, "%s\\n", NCURSES_VERSION);
8748 # endif
8749 #else
8750 # ifdef __NCURSES_H
8751         fprintf(fp, "old\\n");
8752 # else
8753         make an error
8754 # endif
8755 #endif
8756         ${cf_cv_main_return:-return}(0);
8757 }
8758 _ACEOF
8759 rm -f "conftest$ac_exeext"
8760 if { (eval echo "$as_me:8760: \"$ac_link\"") >&5
8761   (eval $ac_link) 2>&5
8762   ac_status=$?
8763   echo "$as_me:8763: \$? = $ac_status" >&5
8764   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8765   { (eval echo "$as_me:8765: \"$ac_try\"") >&5
8766   (eval $ac_try) 2>&5
8767   ac_status=$?
8768   echo "$as_me:8768: \$? = $ac_status" >&5
8769   (exit "$ac_status"); }; }; then
8770
8771         cf_cv_ncurses_version=`cat $cf_tempfile`
8772 else
8773   echo "$as_me: program exited with status $ac_status" >&5
8774 echo "$as_me: failed program was:" >&5
8775 cat "conftest.$ac_ext" >&5
8776 fi
8777 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8778 fi
8779         rm -f "$cf_tempfile"
8780
8781 fi
8782 echo "$as_me:8782: result: $cf_cv_ncurses_version" >&5
8783 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8784 test "$cf_cv_ncurses_version" = no ||
8785 cat >>confdefs.h <<\EOF
8786 #define NCURSES 1
8787 EOF
8788
8789 cf_nculib_root=ncursesw
8790         # This works, except for the special case where we find gpm, but
8791         # ncurses is in a nonstandard location via $LIBS, and we really want
8792         # to link gpm.
8793 cf_ncurses_LIBS=""
8794 cf_ncurses_SAVE="$LIBS"
8795 echo "$as_me:8795: checking for Gpm_Open in -lgpm" >&5
8796 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8797 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8798   echo $ECHO_N "(cached) $ECHO_C" >&6
8799 else
8800   ac_check_lib_save_LIBS=$LIBS
8801 LIBS="-lgpm  $LIBS"
8802 cat >"conftest.$ac_ext" <<_ACEOF
8803 #line 8803 "configure"
8804 #include "confdefs.h"
8805
8806 /* Override any gcc2 internal prototype to avoid an error.  */
8807 #ifdef __cplusplus
8808 extern "C"
8809 #endif
8810 /* We use char because int might match the return type of a gcc2
8811    builtin and then its argument prototype would still apply.  */
8812 char Gpm_Open ();
8813 int
8814 main (void)
8815 {
8816 Gpm_Open ();
8817   ;
8818   return 0;
8819 }
8820 _ACEOF
8821 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8822 if { (eval echo "$as_me:8822: \"$ac_link\"") >&5
8823   (eval $ac_link) 2>&5
8824   ac_status=$?
8825   echo "$as_me:8825: \$? = $ac_status" >&5
8826   (exit "$ac_status"); } &&
8827          { ac_try='test -s "conftest$ac_exeext"'
8828   { (eval echo "$as_me:8828: \"$ac_try\"") >&5
8829   (eval $ac_try) 2>&5
8830   ac_status=$?
8831   echo "$as_me:8831: \$? = $ac_status" >&5
8832   (exit "$ac_status"); }; }; then
8833   ac_cv_lib_gpm_Gpm_Open=yes
8834 else
8835   echo "$as_me: failed program was:" >&5
8836 cat "conftest.$ac_ext" >&5
8837 ac_cv_lib_gpm_Gpm_Open=no
8838 fi
8839 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8840 LIBS=$ac_check_lib_save_LIBS
8841 fi
8842 echo "$as_me:8842: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8843 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8844 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8845   echo "$as_me:8845: checking for initscr in -lgpm" >&5
8846 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8847 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8848   echo $ECHO_N "(cached) $ECHO_C" >&6
8849 else
8850   ac_check_lib_save_LIBS=$LIBS
8851 LIBS="-lgpm  $LIBS"
8852 cat >"conftest.$ac_ext" <<_ACEOF
8853 #line 8853 "configure"
8854 #include "confdefs.h"
8855
8856 /* Override any gcc2 internal prototype to avoid an error.  */
8857 #ifdef __cplusplus
8858 extern "C"
8859 #endif
8860 /* We use char because int might match the return type of a gcc2
8861    builtin and then its argument prototype would still apply.  */
8862 char initscr ();
8863 int
8864 main (void)
8865 {
8866 initscr ();
8867   ;
8868   return 0;
8869 }
8870 _ACEOF
8871 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8872 if { (eval echo "$as_me:8872: \"$ac_link\"") >&5
8873   (eval $ac_link) 2>&5
8874   ac_status=$?
8875   echo "$as_me:8875: \$? = $ac_status" >&5
8876   (exit "$ac_status"); } &&
8877          { ac_try='test -s "conftest$ac_exeext"'
8878   { (eval echo "$as_me:8878: \"$ac_try\"") >&5
8879   (eval $ac_try) 2>&5
8880   ac_status=$?
8881   echo "$as_me:8881: \$? = $ac_status" >&5
8882   (exit "$ac_status"); }; }; then
8883   ac_cv_lib_gpm_initscr=yes
8884 else
8885   echo "$as_me: failed program was:" >&5
8886 cat "conftest.$ac_ext" >&5
8887 ac_cv_lib_gpm_initscr=no
8888 fi
8889 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8890 LIBS=$ac_check_lib_save_LIBS
8891 fi
8892 echo "$as_me:8892: result: $ac_cv_lib_gpm_initscr" >&5
8893 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8894 if test "$ac_cv_lib_gpm_initscr" = yes; then
8895   LIBS="$cf_ncurses_SAVE"
8896 else
8897   cf_ncurses_LIBS="-lgpm"
8898 fi
8899
8900 fi
8901
8902 case "$host_os" in
8903 (freebsd*)
8904         # This is only necessary if you are linking against an obsolete
8905         # version of ncurses (but it should do no harm, since it is static).
8906         if test "$cf_nculib_root" = ncurses ; then
8907                 echo "$as_me:8907: checking for tgoto in -lmytinfo" >&5
8908 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8909 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8910   echo $ECHO_N "(cached) $ECHO_C" >&6
8911 else
8912   ac_check_lib_save_LIBS=$LIBS
8913 LIBS="-lmytinfo  $LIBS"
8914 cat >"conftest.$ac_ext" <<_ACEOF
8915 #line 8915 "configure"
8916 #include "confdefs.h"
8917
8918 /* Override any gcc2 internal prototype to avoid an error.  */
8919 #ifdef __cplusplus
8920 extern "C"
8921 #endif
8922 /* We use char because int might match the return type of a gcc2
8923    builtin and then its argument prototype would still apply.  */
8924 char tgoto ();
8925 int
8926 main (void)
8927 {
8928 tgoto ();
8929   ;
8930   return 0;
8931 }
8932 _ACEOF
8933 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8934 if { (eval echo "$as_me:8934: \"$ac_link\"") >&5
8935   (eval $ac_link) 2>&5
8936   ac_status=$?
8937   echo "$as_me:8937: \$? = $ac_status" >&5
8938   (exit "$ac_status"); } &&
8939          { ac_try='test -s "conftest$ac_exeext"'
8940   { (eval echo "$as_me:8940: \"$ac_try\"") >&5
8941   (eval $ac_try) 2>&5
8942   ac_status=$?
8943   echo "$as_me:8943: \$? = $ac_status" >&5
8944   (exit "$ac_status"); }; }; then
8945   ac_cv_lib_mytinfo_tgoto=yes
8946 else
8947   echo "$as_me: failed program was:" >&5
8948 cat "conftest.$ac_ext" >&5
8949 ac_cv_lib_mytinfo_tgoto=no
8950 fi
8951 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8952 LIBS=$ac_check_lib_save_LIBS
8953 fi
8954 echo "$as_me:8954: result: $ac_cv_lib_mytinfo_tgoto" >&5
8955 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8956 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8957   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8958 fi
8959
8960         fi
8961         ;;
8962 esac
8963
8964 cf_add_libs="$LIBS"
8965 # reverse order
8966 cf_add_0lib=
8967 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8968 # filter duplicates
8969 for cf_add_1lib in $cf_add_0lib; do
8970         for cf_add_2lib in $cf_add_libs; do
8971                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8972                         cf_add_1lib=
8973                         break
8974                 fi
8975         done
8976         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8977 done
8978 LIBS="$cf_add_libs"
8979
8980 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8981 then
8982
8983 cf_add_libs="$LIBS"
8984 # reverse order
8985 cf_add_0lib=
8986 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8987 # filter duplicates
8988 for cf_add_1lib in $cf_add_0lib; do
8989         for cf_add_2lib in $cf_add_libs; do
8990                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8991                         cf_add_1lib=
8992                         break
8993                 fi
8994         done
8995         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8996 done
8997 LIBS="$cf_add_libs"
8998
8999 else
9000
9001         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9002         cf_libdir=""
9003         echo "$as_me:9003: checking for initscr" >&5
9004 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9005 if test "${ac_cv_func_initscr+set}" = set; then
9006   echo $ECHO_N "(cached) $ECHO_C" >&6
9007 else
9008   cat >"conftest.$ac_ext" <<_ACEOF
9009 #line 9009 "configure"
9010 #include "confdefs.h"
9011 #define initscr autoconf_temporary
9012 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9013 #undef initscr
9014
9015 #ifdef __cplusplus
9016 extern "C"
9017 #endif
9018
9019 /* We use char because int might match the return type of a gcc2
9020    builtin and then its argument prototype would still apply.  */
9021 char initscr (void);
9022
9023 int
9024 main (void)
9025 {
9026
9027 /* The GNU C library defines stubs for functions which it implements
9028     to always fail with ENOSYS.  Some functions are actually named
9029     something starting with __ and the normal name is an alias.  */
9030 #if defined (__stub_initscr) || defined (__stub___initscr)
9031 #error found stub for initscr
9032 #endif
9033
9034         return initscr ();
9035   ;
9036   return 0;
9037 }
9038 _ACEOF
9039 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9040 if { (eval echo "$as_me:9040: \"$ac_link\"") >&5
9041   (eval $ac_link) 2>&5
9042   ac_status=$?
9043   echo "$as_me:9043: \$? = $ac_status" >&5
9044   (exit "$ac_status"); } &&
9045          { ac_try='test -s "conftest$ac_exeext"'
9046   { (eval echo "$as_me:9046: \"$ac_try\"") >&5
9047   (eval $ac_try) 2>&5
9048   ac_status=$?
9049   echo "$as_me:9049: \$? = $ac_status" >&5
9050   (exit "$ac_status"); }; }; then
9051   ac_cv_func_initscr=yes
9052 else
9053   echo "$as_me: failed program was:" >&5
9054 cat "conftest.$ac_ext" >&5
9055 ac_cv_func_initscr=no
9056 fi
9057 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9058 fi
9059 echo "$as_me:9059: result: $ac_cv_func_initscr" >&5
9060 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9061 if test "$ac_cv_func_initscr" = yes; then
9062   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9063 else
9064
9065                 cf_save_LIBS="$LIBS"
9066                 echo "$as_me:9066: checking for initscr in -l$cf_nculib_root" >&5
9067 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9068                 LIBS="-l$cf_nculib_root $LIBS"
9069                 cat >"conftest.$ac_ext" <<_ACEOF
9070 #line 9070 "configure"
9071 #include "confdefs.h"
9072 #include <${cf_cv_ncurses_header:-curses.h}>
9073 int
9074 main (void)
9075 {
9076 initscr()
9077   ;
9078   return 0;
9079 }
9080 _ACEOF
9081 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9082 if { (eval echo "$as_me:9082: \"$ac_link\"") >&5
9083   (eval $ac_link) 2>&5
9084   ac_status=$?
9085   echo "$as_me:9085: \$? = $ac_status" >&5
9086   (exit "$ac_status"); } &&
9087          { ac_try='test -s "conftest$ac_exeext"'
9088   { (eval echo "$as_me:9088: \"$ac_try\"") >&5
9089   (eval $ac_try) 2>&5
9090   ac_status=$?
9091   echo "$as_me:9091: \$? = $ac_status" >&5
9092   (exit "$ac_status"); }; }; then
9093   echo "$as_me:9093: result: yes" >&5
9094 echo "${ECHO_T}yes" >&6
9095                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9096
9097 else
9098   echo "$as_me: failed program was:" >&5
9099 cat "conftest.$ac_ext" >&5
9100 echo "$as_me:9100: result: no" >&5
9101 echo "${ECHO_T}no" >&6
9102
9103 cf_search=
9104 cf_library_path_list=""
9105 if test -n "${LDFLAGS}${LIBS}" ; then
9106         for cf_library_path in $LDFLAGS $LIBS
9107         do
9108                 case "$cf_library_path" in
9109                 (-L*)
9110                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9111
9112 test "x$cf_library_path" != "xNONE" && \
9113 test -d "$cf_library_path" && \
9114  {
9115         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9116         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9117         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9118         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9119         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9120         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"
9121 }
9122
9123                         cf_library_path_list="$cf_library_path_list $cf_search"
9124                         ;;
9125                 esac
9126         done
9127 fi
9128
9129 cf_search=
9130
9131 test "x$prefix" != "xNONE" && \
9132 test -d "$prefix" && \
9133  {
9134         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9135         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9136         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9137         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9138         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9139         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9140 }
9141
9142 for cf_subdir_prefix in \
9143         /usr \
9144         /usr/local \
9145         /usr/pkg \
9146         /opt \
9147         /opt/local \
9148         $HOME
9149 do
9150
9151 test "x$cf_subdir_prefix" != "x$prefix" && \
9152 test -d "$cf_subdir_prefix" && \
9153 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9154         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9155         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9156         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9157         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9158         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9159         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"
9160 }
9161
9162 done
9163
9164 cf_search="$cf_library_path_list $cf_search"
9165
9166                         for cf_libdir in $cf_search
9167                         do
9168                                 echo "$as_me:9168: checking for -l$cf_nculib_root in $cf_libdir" >&5
9169 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9170                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9171                                 cat >"conftest.$ac_ext" <<_ACEOF
9172 #line 9172 "configure"
9173 #include "confdefs.h"
9174 #include <${cf_cv_ncurses_header:-curses.h}>
9175 int
9176 main (void)
9177 {
9178 initscr()
9179   ;
9180   return 0;
9181 }
9182 _ACEOF
9183 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9184 if { (eval echo "$as_me:9184: \"$ac_link\"") >&5
9185   (eval $ac_link) 2>&5
9186   ac_status=$?
9187   echo "$as_me:9187: \$? = $ac_status" >&5
9188   (exit "$ac_status"); } &&
9189          { ac_try='test -s "conftest$ac_exeext"'
9190   { (eval echo "$as_me:9190: \"$ac_try\"") >&5
9191   (eval $ac_try) 2>&5
9192   ac_status=$?
9193   echo "$as_me:9193: \$? = $ac_status" >&5
9194   (exit "$ac_status"); }; }; then
9195   echo "$as_me:9195: result: yes" >&5
9196 echo "${ECHO_T}yes" >&6
9197                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9198                                          break
9199 else
9200   echo "$as_me: failed program was:" >&5
9201 cat "conftest.$ac_ext" >&5
9202 echo "$as_me:9202: result: no" >&5
9203 echo "${ECHO_T}no" >&6
9204                                          LIBS="$cf_save_LIBS"
9205 fi
9206 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9207                         done
9208
9209 fi
9210 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9211
9212 fi
9213
9214 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9215
9216 if test "$cf_found_library" = no ; then
9217         { { echo "$as_me:9217: error: Cannot link $cf_nculib_root library" >&5
9218 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9219    { (exit 1); exit 1; }; }
9220 fi
9221
9222 fi
9223
9224 if test -n "$cf_ncurses_LIBS" ; then
9225         echo "$as_me:9225: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9226 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9227         cf_ncurses_SAVE="$LIBS"
9228         for p in $cf_ncurses_LIBS ; do
9229                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9230                 if test "$q" != "$LIBS" ; then
9231                         LIBS="$q"
9232                 fi
9233         done
9234         cat >"conftest.$ac_ext" <<_ACEOF
9235 #line 9235 "configure"
9236 #include "confdefs.h"
9237 #include <${cf_cv_ncurses_header:-curses.h}>
9238 int
9239 main (void)
9240 {
9241 initscr(); mousemask(0,0); tigetstr((char *)0);
9242   ;
9243   return 0;
9244 }
9245 _ACEOF
9246 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9247 if { (eval echo "$as_me:9247: \"$ac_link\"") >&5
9248   (eval $ac_link) 2>&5
9249   ac_status=$?
9250   echo "$as_me:9250: \$? = $ac_status" >&5
9251   (exit "$ac_status"); } &&
9252          { ac_try='test -s "conftest$ac_exeext"'
9253   { (eval echo "$as_me:9253: \"$ac_try\"") >&5
9254   (eval $ac_try) 2>&5
9255   ac_status=$?
9256   echo "$as_me:9256: \$? = $ac_status" >&5
9257   (exit "$ac_status"); }; }; then
9258   echo "$as_me:9258: result: yes" >&5
9259 echo "${ECHO_T}yes" >&6
9260 else
9261   echo "$as_me: failed program was:" >&5
9262 cat "conftest.$ac_ext" >&5
9263 echo "$as_me:9263: result: no" >&5
9264 echo "${ECHO_T}no" >&6
9265                  LIBS="$cf_ncurses_SAVE"
9266 fi
9267 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9268 fi
9269
9270 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9271
9272 cat >>confdefs.h <<EOF
9273 #define $cf_nculib_ROOT 1
9274 EOF
9275
9276         fi
9277 else
9278         NCURSES_CONFIG=none
9279 fi
9280
9281 else
9282
9283 cf_ncuconfig_root=ncurses
9284 cf_have_ncuconfig=no
9285
9286 if test "x${PKG_CONFIG:=none}" != xnone; then
9287         echo "$as_me:9287: checking pkg-config for $cf_ncuconfig_root" >&5
9288 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9289         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9290                 echo "$as_me:9290: result: yes" >&5
9291 echo "${ECHO_T}yes" >&6
9292
9293                 echo "$as_me:9293: checking if the $cf_ncuconfig_root package files work" >&5
9294 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9295                 cf_have_ncuconfig=unknown
9296
9297                 cf_save_CFLAGS="$CFLAGS"
9298                 cf_save_CPPFLAGS="$CPPFLAGS"
9299                 cf_save_LIBS="$LIBS"
9300
9301                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9302                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9303
9304                 # while -W for passing linker flags is prevalent, it is not "standard".
9305                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9306                 # incompatible _and_ non-standard -W option which gives an error.  Work
9307                 # around that pitfall.
9308                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9309                 (x*c[89]9@@*-W*)
9310
9311 cf_fix_cppflags=no
9312 cf_new_cflags=
9313 cf_new_cppflags=
9314 cf_new_extra_cppflags=
9315
9316 for cf_add_cflags in $cf_pkg_cflags
9317 do
9318 case "$cf_fix_cppflags" in
9319 (no)
9320         case "$cf_add_cflags" in
9321         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9322                 case "$cf_add_cflags" in
9323                 (-D*)
9324                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9325
9326                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9327                                 && test -z "${cf_tst_cflags}" \
9328                                 && cf_fix_cppflags=yes
9329
9330                         if test "$cf_fix_cppflags" = yes ; then
9331
9332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9334
9335                                 continue
9336                         elif test "${cf_tst_cflags}" = "\"'" ; then
9337
9338         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9339         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9340
9341                                 continue
9342                         fi
9343                         ;;
9344                 esac
9345                 case "$CPPFLAGS" in
9346                 (*$cf_add_cflags)
9347                         ;;
9348                 (*)
9349                         case "$cf_add_cflags" in
9350                         (-D*)
9351                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9352
9353 CPPFLAGS=`echo "$CPPFLAGS" | \
9354         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9355                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9356
9357                                 ;;
9358                         esac
9359
9360         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9361         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9362
9363                         ;;
9364                 esac
9365                 ;;
9366         (*)
9367
9368         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9369         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9370
9371                 ;;
9372         esac
9373         ;;
9374 (yes)
9375
9376         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9377         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9378
9379         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9380
9381         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9382                 && test -z "${cf_tst_cflags}" \
9383                 && cf_fix_cppflags=no
9384         ;;
9385 esac
9386 done
9387
9388 if test -n "$cf_new_cflags" ; then
9389
9390         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9391         CFLAGS="${CFLAGS}$cf_new_cflags"
9392
9393 fi
9394
9395 if test -n "$cf_new_cppflags" ; then
9396
9397         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9398         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9399
9400 fi
9401
9402 if test -n "$cf_new_extra_cppflags" ; then
9403
9404         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9405         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9406
9407 fi
9408
9409 cf_add_libs="$LIBS"
9410 # reverse order
9411 cf_add_0lib=
9412 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9413 # filter duplicates
9414 for cf_add_1lib in $cf_add_0lib; do
9415         for cf_add_2lib in $cf_add_libs; do
9416                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9417                         cf_add_1lib=
9418                         break
9419                 fi
9420         done
9421         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9422 done
9423 LIBS="$cf_add_libs"
9424
9425                         cat >"conftest.$ac_ext" <<_ACEOF
9426 #line 9426 "configure"
9427 #include "confdefs.h"
9428 #include <${cf_cv_ncurses_header:-curses.h}>
9429 int
9430 main (void)
9431 {
9432 initscr(); mousemask(0,0); tigetstr((char *)0);
9433   ;
9434   return 0;
9435 }
9436 _ACEOF
9437 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9438 if { (eval echo "$as_me:9438: \"$ac_link\"") >&5
9439   (eval $ac_link) 2>&5
9440   ac_status=$?
9441   echo "$as_me:9441: \$? = $ac_status" >&5
9442   (exit "$ac_status"); } &&
9443          { ac_try='test -s "conftest$ac_exeext"'
9444   { (eval echo "$as_me:9444: \"$ac_try\"") >&5
9445   (eval $ac_try) 2>&5
9446   ac_status=$?
9447   echo "$as_me:9447: \$? = $ac_status" >&5
9448   (exit "$ac_status"); }; }; then
9449   if test "$cross_compiling" = yes; then
9450   cf_test_ncuconfig=maybe
9451 else
9452   cat >"conftest.$ac_ext" <<_ACEOF
9453 #line 9453 "configure"
9454 #include "confdefs.h"
9455 #include <${cf_cv_ncurses_header:-curses.h}>
9456                                         int main(void)
9457                                         { const char *xx = curses_version(); return (xx == 0); }
9458 _ACEOF
9459 rm -f "conftest$ac_exeext"
9460 if { (eval echo "$as_me:9460: \"$ac_link\"") >&5
9461   (eval $ac_link) 2>&5
9462   ac_status=$?
9463   echo "$as_me:9463: \$? = $ac_status" >&5
9464   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9465   { (eval echo "$as_me:9465: \"$ac_try\"") >&5
9466   (eval $ac_try) 2>&5
9467   ac_status=$?
9468   echo "$as_me:9468: \$? = $ac_status" >&5
9469   (exit "$ac_status"); }; }; then
9470   cf_test_ncuconfig=yes
9471 else
9472   echo "$as_me: program exited with status $ac_status" >&5
9473 echo "$as_me: failed program was:" >&5
9474 cat "conftest.$ac_ext" >&5
9475 cf_test_ncuconfig=no
9476 fi
9477 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9478 fi
9479 else
9480   echo "$as_me: failed program was:" >&5
9481 cat "conftest.$ac_ext" >&5
9482 cf_test_ncuconfig=no
9483 fi
9484 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9485
9486                         CFLAGS="$cf_save_CFLAGS"
9487                         CPPFLAGS="$cf_save_CPPFLAGS"
9488                         LIBS="$cf_save_LIBS"
9489
9490                         if test "x$cf_test_ncuconfig" != xyes; then
9491                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9492                                 cf_pkg_cflags="$cf_temp"
9493                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9494                                 cf_pkg_libs="$cf_temp"
9495                         fi
9496                         ;;
9497                 esac
9498
9499 for cf_add_cflags in $cf_pkg_cflags
9500 do
9501         case "x$cf_add_cflags" in
9502         (x-[DU]*)
9503
9504 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9505 while true
9506 do
9507         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'`
9508         test "$CFLAGS" != "$cf_old_cflag" || break
9509
9510         CFLAGS="$cf_old_cflag"
9511 done
9512
9513 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9514 while true
9515 do
9516         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'`
9517         test "$CPPFLAGS" != "$cf_old_cflag" || break
9518
9519         CPPFLAGS="$cf_old_cflag"
9520 done
9521
9522                 ;;
9523         esac
9524
9525 cf_fix_cppflags=no
9526 cf_new_cflags=
9527 cf_new_cppflags=
9528 cf_new_extra_cppflags=
9529
9530 for cf_add_cflags in $cf_add_cflags
9531 do
9532 case "$cf_fix_cppflags" in
9533 (no)
9534         case "$cf_add_cflags" in
9535         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9536                 case "$cf_add_cflags" in
9537                 (-D*)
9538                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9539
9540                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9541                                 && test -z "${cf_tst_cflags}" \
9542                                 && cf_fix_cppflags=yes
9543
9544                         if test "$cf_fix_cppflags" = yes ; then
9545
9546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9548
9549                                 continue
9550                         elif test "${cf_tst_cflags}" = "\"'" ; then
9551
9552         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9553         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9554
9555                                 continue
9556                         fi
9557                         ;;
9558                 esac
9559                 case "$CPPFLAGS" in
9560                 (*$cf_add_cflags)
9561                         ;;
9562                 (*)
9563                         case "$cf_add_cflags" in
9564                         (-D*)
9565                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9566
9567 CPPFLAGS=`echo "$CPPFLAGS" | \
9568         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9569                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9570
9571                                 ;;
9572                         esac
9573
9574         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9575         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9576
9577                         ;;
9578                 esac
9579                 ;;
9580         (*)
9581
9582         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9583         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9584
9585                 ;;
9586         esac
9587         ;;
9588 (yes)
9589
9590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9592
9593         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9594
9595         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9596                 && test -z "${cf_tst_cflags}" \
9597                 && cf_fix_cppflags=no
9598         ;;
9599 esac
9600 done
9601
9602 if test -n "$cf_new_cflags" ; then
9603
9604         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9605         CFLAGS="${CFLAGS}$cf_new_cflags"
9606
9607 fi
9608
9609 if test -n "$cf_new_cppflags" ; then
9610
9611         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9612         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9613
9614 fi
9615
9616 if test -n "$cf_new_extra_cppflags" ; then
9617
9618         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9619         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9620
9621 fi
9622
9623 done
9624
9625 cf_add_libs="$LIBS"
9626 # reverse order
9627 cf_add_0lib=
9628 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9629 # filter duplicates
9630 for cf_add_1lib in $cf_add_0lib; do
9631         for cf_add_2lib in $cf_add_libs; do
9632                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9633                         cf_add_1lib=
9634                         break
9635                 fi
9636         done
9637         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9638 done
9639 LIBS="$cf_add_libs"
9640
9641                 cat >"conftest.$ac_ext" <<_ACEOF
9642 #line 9642 "configure"
9643 #include "confdefs.h"
9644 #include <${cf_cv_ncurses_header:-curses.h}>
9645 int
9646 main (void)
9647 {
9648 initscr(); mousemask(0,0); tigetstr((char *)0);
9649   ;
9650   return 0;
9651 }
9652 _ACEOF
9653 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9654 if { (eval echo "$as_me:9654: \"$ac_link\"") >&5
9655   (eval $ac_link) 2>&5
9656   ac_status=$?
9657   echo "$as_me:9657: \$? = $ac_status" >&5
9658   (exit "$ac_status"); } &&
9659          { ac_try='test -s "conftest$ac_exeext"'
9660   { (eval echo "$as_me:9660: \"$ac_try\"") >&5
9661   (eval $ac_try) 2>&5
9662   ac_status=$?
9663   echo "$as_me:9663: \$? = $ac_status" >&5
9664   (exit "$ac_status"); }; }; then
9665   if test "$cross_compiling" = yes; then
9666   cf_have_ncuconfig=maybe
9667 else
9668   cat >"conftest.$ac_ext" <<_ACEOF
9669 #line 9669 "configure"
9670 #include "confdefs.h"
9671 #include <${cf_cv_ncurses_header:-curses.h}>
9672                                 int main(void)
9673                                 { const char *xx = curses_version(); return (xx == 0); }
9674 _ACEOF
9675 rm -f "conftest$ac_exeext"
9676 if { (eval echo "$as_me:9676: \"$ac_link\"") >&5
9677   (eval $ac_link) 2>&5
9678   ac_status=$?
9679   echo "$as_me:9679: \$? = $ac_status" >&5
9680   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9681   { (eval echo "$as_me:9681: \"$ac_try\"") >&5
9682   (eval $ac_try) 2>&5
9683   ac_status=$?
9684   echo "$as_me:9684: \$? = $ac_status" >&5
9685   (exit "$ac_status"); }; }; then
9686   cf_have_ncuconfig=yes
9687 else
9688   echo "$as_me: program exited with status $ac_status" >&5
9689 echo "$as_me: failed program was:" >&5
9690 cat "conftest.$ac_ext" >&5
9691 cf_have_ncuconfig=no
9692 fi
9693 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9694 fi
9695 else
9696   echo "$as_me: failed program was:" >&5
9697 cat "conftest.$ac_ext" >&5
9698 cf_have_ncuconfig=no
9699 fi
9700 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9701                 echo "$as_me:9701: result: $cf_have_ncuconfig" >&5
9702 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9703                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9704                 if test "$cf_have_ncuconfig" != "yes"
9705                 then
9706                         CPPFLAGS="$cf_save_CPPFLAGS"
9707                         LIBS="$cf_save_LIBS"
9708                         NCURSES_CONFIG_PKG=none
9709                 else
9710
9711 cat >>confdefs.h <<\EOF
9712 #define NCURSES 1
9713 EOF
9714
9715                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9716
9717 echo "$as_me:9717: checking for terminfo header" >&5
9718 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9719 if test "${cf_cv_term_header+set}" = set; then
9720   echo $ECHO_N "(cached) $ECHO_C" >&6
9721 else
9722
9723 case "${cf_cv_ncurses_header}" in
9724 (*/ncurses.h|*/ncursesw.h)
9725         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9726         ;;
9727 (*)
9728         cf_term_header=term.h
9729         ;;
9730 esac
9731
9732 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9733 do
9734 cat >"conftest.$ac_ext" <<_ACEOF
9735 #line 9735 "configure"
9736 #include "confdefs.h"
9737 #include <stdio.h>
9738 #include <${cf_cv_ncurses_header:-curses.h}>
9739 #include <$cf_test>
9740
9741 int
9742 main (void)
9743 {
9744 int x = auto_left_margin; (void)x
9745   ;
9746   return 0;
9747 }
9748 _ACEOF
9749 rm -f "conftest.$ac_objext"
9750 if { (eval echo "$as_me:9750: \"$ac_compile\"") >&5
9751   (eval $ac_compile) 2>&5
9752   ac_status=$?
9753   echo "$as_me:9753: \$? = $ac_status" >&5
9754   (exit "$ac_status"); } &&
9755          { ac_try='test -s "conftest.$ac_objext"'
9756   { (eval echo "$as_me:9756: \"$ac_try\"") >&5
9757   (eval $ac_try) 2>&5
9758   ac_status=$?
9759   echo "$as_me:9759: \$? = $ac_status" >&5
9760   (exit "$ac_status"); }; }; then
9761
9762         cf_cv_term_header="$cf_test"
9763 else
9764   echo "$as_me: failed program was:" >&5
9765 cat "conftest.$ac_ext" >&5
9766
9767         cf_cv_term_header=unknown
9768
9769 fi
9770 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9771         test "$cf_cv_term_header" != unknown && break
9772 done
9773
9774 fi
9775 echo "$as_me:9775: result: $cf_cv_term_header" >&5
9776 echo "${ECHO_T}$cf_cv_term_header" >&6
9777
9778 # Set definitions to allow ifdef'ing to accommodate subdirectories
9779
9780 case "$cf_cv_term_header" in
9781 (*term.h)
9782
9783 cat >>confdefs.h <<\EOF
9784 #define HAVE_TERM_H 1
9785 EOF
9786
9787         ;;
9788 esac
9789
9790 case "$cf_cv_term_header" in
9791 (ncurses/term.h)
9792
9793 cat >>confdefs.h <<\EOF
9794 #define HAVE_NCURSES_TERM_H 1
9795 EOF
9796
9797         ;;
9798 (ncursesw/term.h)
9799
9800 cat >>confdefs.h <<\EOF
9801 #define HAVE_NCURSESW_TERM_H 1
9802 EOF
9803
9804         ;;
9805 esac
9806
9807                 fi
9808
9809         else
9810                 echo "$as_me:9810: result: no" >&5
9811 echo "${ECHO_T}no" >&6
9812                 NCURSES_CONFIG_PKG=none
9813         fi
9814 else
9815         NCURSES_CONFIG_PKG=none
9816 fi
9817
9818 if test "x$cf_have_ncuconfig" = "xno"; then
9819         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9820
9821 if test -n "$ac_tool_prefix"; then
9822   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9823   do
9824     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9825 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9826 echo "$as_me:9826: checking for $ac_word" >&5
9827 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9828 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9829   echo $ECHO_N "(cached) $ECHO_C" >&6
9830 else
9831   if test -n "$NCURSES_CONFIG"; then
9832   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9833 else
9834   ac_save_IFS=$IFS; IFS=$ac_path_separator
9835 ac_dummy="$PATH"
9836 for ac_dir in $ac_dummy; do
9837   IFS=$ac_save_IFS
9838   test -z "$ac_dir" && ac_dir=.
9839   $as_executable_p "$ac_dir/$ac_word" || continue
9840 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9841 echo "$as_me:9841: found $ac_dir/$ac_word" >&5
9842 break
9843 done
9844
9845 fi
9846 fi
9847 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9848 if test -n "$NCURSES_CONFIG"; then
9849   echo "$as_me:9849: result: $NCURSES_CONFIG" >&5
9850 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9851 else
9852   echo "$as_me:9852: result: no" >&5
9853 echo "${ECHO_T}no" >&6
9854 fi
9855
9856     test -n "$NCURSES_CONFIG" && break
9857   done
9858 fi
9859 if test -z "$NCURSES_CONFIG"; then
9860   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9861   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9862 do
9863   # Extract the first word of "$ac_prog", so it can be a program name with args.
9864 set dummy $ac_prog; ac_word=$2
9865 echo "$as_me:9865: checking for $ac_word" >&5
9866 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9867 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9868   echo $ECHO_N "(cached) $ECHO_C" >&6
9869 else
9870   if test -n "$ac_ct_NCURSES_CONFIG"; then
9871   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9872 else
9873   ac_save_IFS=$IFS; IFS=$ac_path_separator
9874 ac_dummy="$PATH"
9875 for ac_dir in $ac_dummy; do
9876   IFS=$ac_save_IFS
9877   test -z "$ac_dir" && ac_dir=.
9878   $as_executable_p "$ac_dir/$ac_word" || continue
9879 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9880 echo "$as_me:9880: found $ac_dir/$ac_word" >&5
9881 break
9882 done
9883
9884 fi
9885 fi
9886 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9887 if test -n "$ac_ct_NCURSES_CONFIG"; then
9888   echo "$as_me:9888: result: $ac_ct_NCURSES_CONFIG" >&5
9889 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9890 else
9891   echo "$as_me:9891: result: no" >&5
9892 echo "${ECHO_T}no" >&6
9893 fi
9894
9895   test -n "$ac_ct_NCURSES_CONFIG" && break
9896 done
9897 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9898
9899   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9900 fi
9901
9902         if test "$NCURSES_CONFIG" != none ; then
9903
9904 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9905 do
9906         case "x$cf_add_cflags" in
9907         (x-[DU]*)
9908
9909 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9910 while true
9911 do
9912         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'`
9913         test "$CFLAGS" != "$cf_old_cflag" || break
9914
9915         CFLAGS="$cf_old_cflag"
9916 done
9917
9918 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9919 while true
9920 do
9921         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'`
9922         test "$CPPFLAGS" != "$cf_old_cflag" || break
9923
9924         CPPFLAGS="$cf_old_cflag"
9925 done
9926
9927                 ;;
9928         esac
9929
9930 cf_fix_cppflags=no
9931 cf_new_cflags=
9932 cf_new_cppflags=
9933 cf_new_extra_cppflags=
9934
9935 for cf_add_cflags in $cf_add_cflags
9936 do
9937 case "$cf_fix_cppflags" in
9938 (no)
9939         case "$cf_add_cflags" in
9940         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9941                 case "$cf_add_cflags" in
9942                 (-D*)
9943                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9944
9945                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9946                                 && test -z "${cf_tst_cflags}" \
9947                                 && cf_fix_cppflags=yes
9948
9949                         if test "$cf_fix_cppflags" = yes ; then
9950
9951         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9952         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9953
9954                                 continue
9955                         elif test "${cf_tst_cflags}" = "\"'" ; then
9956
9957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9959
9960                                 continue
9961                         fi
9962                         ;;
9963                 esac
9964                 case "$CPPFLAGS" in
9965                 (*$cf_add_cflags)
9966                         ;;
9967                 (*)
9968                         case "$cf_add_cflags" in
9969                         (-D*)
9970                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9971
9972 CPPFLAGS=`echo "$CPPFLAGS" | \
9973         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9974                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9975
9976                                 ;;
9977                         esac
9978
9979         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9980         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9981
9982                         ;;
9983                 esac
9984                 ;;
9985         (*)
9986
9987         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9988         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9989
9990                 ;;
9991         esac
9992         ;;
9993 (yes)
9994
9995         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9996         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9997
9998         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9999
10000         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10001                 && test -z "${cf_tst_cflags}" \
10002                 && cf_fix_cppflags=no
10003         ;;
10004 esac
10005 done
10006
10007 if test -n "$cf_new_cflags" ; then
10008
10009         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10010         CFLAGS="${CFLAGS}$cf_new_cflags"
10011
10012 fi
10013
10014 if test -n "$cf_new_cppflags" ; then
10015
10016         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10017         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10018
10019 fi
10020
10021 if test -n "$cf_new_extra_cppflags" ; then
10022
10023         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10024         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10025
10026 fi
10027
10028 done
10029
10030 cf_add_libs="$LIBS"
10031 # reverse order
10032 cf_add_0lib=
10033 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10034 # filter duplicates
10035 for cf_add_1lib in $cf_add_0lib; do
10036         for cf_add_2lib in $cf_add_libs; do
10037                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10038                         cf_add_1lib=
10039                         break
10040                 fi
10041         done
10042         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10043 done
10044 LIBS="$cf_add_libs"
10045
10046                 # even with config script, some packages use no-override for curses.h
10047
10048 echo "$as_me:10048: checking if we have identified curses headers" >&5
10049 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10050 if test "${cf_cv_ncurses_header+set}" = set; then
10051   echo $ECHO_N "(cached) $ECHO_C" >&6
10052 else
10053
10054 cf_cv_ncurses_header=none
10055 for cf_header in \
10056         ncurses.h ncurses/ncurses.h \
10057         curses.h ncurses/curses.h
10058 do
10059 cat >"conftest.$ac_ext" <<_ACEOF
10060 #line 10060 "configure"
10061 #include "confdefs.h"
10062 #include <${cf_header}>
10063 int
10064 main (void)
10065 {
10066 initscr(); tgoto("?", 0,0)
10067   ;
10068   return 0;
10069 }
10070 _ACEOF
10071 rm -f "conftest.$ac_objext"
10072 if { (eval echo "$as_me:10072: \"$ac_compile\"") >&5
10073   (eval $ac_compile) 2>&5
10074   ac_status=$?
10075   echo "$as_me:10075: \$? = $ac_status" >&5
10076   (exit "$ac_status"); } &&
10077          { ac_try='test -s "conftest.$ac_objext"'
10078   { (eval echo "$as_me:10078: \"$ac_try\"") >&5
10079   (eval $ac_try) 2>&5
10080   ac_status=$?
10081   echo "$as_me:10081: \$? = $ac_status" >&5
10082   (exit "$ac_status"); }; }; then
10083   cf_cv_ncurses_header=$cf_header; break
10084 else
10085   echo "$as_me: failed program was:" >&5
10086 cat "conftest.$ac_ext" >&5
10087 fi
10088 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10089 done
10090
10091 fi
10092 echo "$as_me:10092: result: $cf_cv_ncurses_header" >&5
10093 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10094
10095 if test "$cf_cv_ncurses_header" = none ; then
10096         { { echo "$as_me:10096: error: No curses header-files found" >&5
10097 echo "$as_me: error: No curses header-files found" >&2;}
10098    { (exit 1); exit 1; }; }
10099 fi
10100
10101 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10102
10103 for ac_header in $cf_cv_ncurses_header
10104 do
10105 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10106 echo "$as_me:10106: checking for $ac_header" >&5
10107 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10108 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10109   echo $ECHO_N "(cached) $ECHO_C" >&6
10110 else
10111   cat >"conftest.$ac_ext" <<_ACEOF
10112 #line 10112 "configure"
10113 #include "confdefs.h"
10114 #include <$ac_header>
10115 _ACEOF
10116 if { (eval echo "$as_me:10116: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10117   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10118   ac_status=$?
10119   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10120   rm -f conftest.er1
10121   cat conftest.err >&5
10122   echo "$as_me:10122: \$? = $ac_status" >&5
10123   (exit "$ac_status"); } >/dev/null; then
10124   if test -s conftest.err; then
10125     ac_cpp_err=$ac_c_preproc_warn_flag
10126   else
10127     ac_cpp_err=
10128   fi
10129 else
10130   ac_cpp_err=yes
10131 fi
10132 if test -z "$ac_cpp_err"; then
10133   eval "$as_ac_Header=yes"
10134 else
10135   echo "$as_me: failed program was:" >&5
10136   cat "conftest.$ac_ext" >&5
10137   eval "$as_ac_Header=no"
10138 fi
10139 rm -f conftest.err "conftest.$ac_ext"
10140 fi
10141 echo "$as_me:10141: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10142 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10143 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10144   cat >>confdefs.h <<EOF
10145 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10146 EOF
10147
10148 fi
10149 done
10150
10151 cat >>confdefs.h <<\EOF
10152 #define NCURSES 1
10153 EOF
10154
10155 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10156
10157                 cat >>confdefs.h <<EOF
10158 #define $cf_nculib_ROOT 1
10159 EOF
10160
10161                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10162
10163         else
10164
10165 cf_ncuhdr_root=ncurses
10166
10167 test -n "$cf_cv_curses_dir" && \
10168 test "$cf_cv_curses_dir" != "no" && { \
10169
10170 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10171   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10172   do
10173         while test "$cf_add_incdir" != /usr/include
10174         do
10175           if test -d "$cf_add_incdir"
10176           then
10177                 cf_have_incdir=no
10178                 if test -n "$CFLAGS$CPPFLAGS" ; then
10179                   # a loop is needed to ensure we can add subdirs of existing dirs
10180                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10181                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10182                           cf_have_incdir=yes; break
10183                         fi
10184                   done
10185                 fi
10186
10187                 if test "$cf_have_incdir" = no ; then
10188                   if test "$cf_add_incdir" = /usr/local/include ; then
10189                         if test "$GCC" = yes
10190                         then
10191                           cf_save_CPPFLAGS=$CPPFLAGS
10192
10193         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10194         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10195
10196                           cat >"conftest.$ac_ext" <<_ACEOF
10197 #line 10197 "configure"
10198 #include "confdefs.h"
10199 #include <stdio.h>
10200 int
10201 main (void)
10202 {
10203 printf("Hello")
10204   ;
10205   return 0;
10206 }
10207 _ACEOF
10208 rm -f "conftest.$ac_objext"
10209 if { (eval echo "$as_me:10209: \"$ac_compile\"") >&5
10210   (eval $ac_compile) 2>&5
10211   ac_status=$?
10212   echo "$as_me:10212: \$? = $ac_status" >&5
10213   (exit "$ac_status"); } &&
10214          { ac_try='test -s "conftest.$ac_objext"'
10215   { (eval echo "$as_me:10215: \"$ac_try\"") >&5
10216   (eval $ac_try) 2>&5
10217   ac_status=$?
10218   echo "$as_me:10218: \$? = $ac_status" >&5
10219   (exit "$ac_status"); }; }; then
10220   :
10221 else
10222   echo "$as_me: failed program was:" >&5
10223 cat "conftest.$ac_ext" >&5
10224 cf_have_incdir=yes
10225 fi
10226 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10227                           CPPFLAGS=$cf_save_CPPFLAGS
10228                         fi
10229                   fi
10230                 fi
10231
10232                 if test "$cf_have_incdir" = no ; then
10233                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10234
10235 echo "${as_me:-configure}:10235: testing adding $cf_add_incdir to include-path ..." 1>&5
10236
10237                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10238
10239                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10240                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10241                   cf_add_incdir="$cf_top_incdir"
10242                 else
10243                   break
10244                 fi
10245           else
10246                 break
10247           fi
10248         done
10249   done
10250 fi
10251
10252 }
10253
10254 echo "$as_me:10254: checking for $cf_ncuhdr_root header in include-path" >&5
10255 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10256 if test "${cf_cv_ncurses_h+set}" = set; then
10257   echo $ECHO_N "(cached) $ECHO_C" >&6
10258 else
10259
10260         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10261         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10262         for cf_header in $cf_header_list
10263         do
10264
10265         cat >"conftest.$ac_ext" <<_ACEOF
10266 #line 10266 "configure"
10267 #include "confdefs.h"
10268
10269 #include <$cf_header>
10270 int
10271 main (void)
10272 {
10273
10274 #ifdef NCURSES_VERSION
10275
10276 printf("%s\\n", NCURSES_VERSION);
10277 #else
10278 #ifdef __NCURSES_H
10279 printf("old\\n");
10280 #else
10281         make an error
10282 #endif
10283 #endif
10284
10285   ;
10286   return 0;
10287 }
10288 _ACEOF
10289 rm -f "conftest.$ac_objext"
10290 if { (eval echo "$as_me:10290: \"$ac_compile\"") >&5
10291   (eval $ac_compile) 2>&5
10292   ac_status=$?
10293   echo "$as_me:10293: \$? = $ac_status" >&5
10294   (exit "$ac_status"); } &&
10295          { ac_try='test -s "conftest.$ac_objext"'
10296   { (eval echo "$as_me:10296: \"$ac_try\"") >&5
10297   (eval $ac_try) 2>&5
10298   ac_status=$?
10299   echo "$as_me:10299: \$? = $ac_status" >&5
10300   (exit "$ac_status"); }; }; then
10301   cf_cv_ncurses_h=$cf_header
10302
10303 else
10304   echo "$as_me: failed program was:" >&5
10305 cat "conftest.$ac_ext" >&5
10306 cf_cv_ncurses_h=no
10307 fi
10308 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10309
10310                 test "$cf_cv_ncurses_h" != no && break
10311         done
10312
10313 fi
10314 echo "$as_me:10314: result: $cf_cv_ncurses_h" >&5
10315 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10316
10317 if test "$cf_cv_ncurses_h" != no ; then
10318         cf_cv_ncurses_header=$cf_cv_ncurses_h
10319 else
10320
10321 echo "$as_me:10321: checking for $cf_ncuhdr_root include-path" >&5
10322 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10323 if test "${cf_cv_ncurses_h2+set}" = set; then
10324   echo $ECHO_N "(cached) $ECHO_C" >&6
10325 else
10326
10327         test -n "$verbose" && echo
10328
10329 cf_search=
10330
10331 # collect the current set of include-directories from compiler flags
10332 cf_header_path_list=""
10333 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10334         for cf_header_path in $CPPFLAGS $CFLAGS
10335         do
10336                 case "$cf_header_path" in
10337                 (-I*)
10338                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10339
10340 test "x$cf_header_path" != "xNONE" && \
10341 test -d "$cf_header_path" && \
10342  {
10343         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10344         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10345         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10346         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10347         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10348         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"
10349 }
10350
10351                         cf_header_path_list="$cf_header_path_list $cf_search"
10352                         ;;
10353                 esac
10354         done
10355 fi
10356
10357 # add the variations for the package we are looking for
10358
10359 cf_search=
10360
10361 test "x$prefix" != "xNONE" && \
10362 test -d "$prefix" && \
10363  {
10364         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10365         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10366         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10367         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10368         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10369         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10370 }
10371
10372 for cf_subdir_prefix in \
10373         /usr \
10374         /usr/local \
10375         /usr/pkg \
10376         /opt \
10377         /opt/local \
10378         $HOME
10379 do
10380
10381 test "x$cf_subdir_prefix" != "x$prefix" && \
10382 test -d "$cf_subdir_prefix" && \
10383 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10384         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10385         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10386         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10387         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10388         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10389         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"
10390 }
10391
10392 done
10393
10394 test "$includedir" != NONE && \
10395 test "$includedir" != "/usr/include" && \
10396 test -d "$includedir" && {
10397         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10398         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10399 }
10400
10401 test "$oldincludedir" != NONE && \
10402 test "$oldincludedir" != "/usr/include" && \
10403 test -d "$oldincludedir" && {
10404         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10405         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10406 }
10407
10408 cf_search="$cf_search $cf_header_path_list"
10409
10410         test -n "$verbose" && echo "search path $cf_search"
10411         cf_save2_CPPFLAGS="$CPPFLAGS"
10412         for cf_incdir in $cf_search
10413         do
10414
10415 if test -n "$cf_incdir" ; then
10416   for cf_add_incdir in $cf_incdir
10417   do
10418         while test "$cf_add_incdir" != /usr/include
10419         do
10420           if test -d "$cf_add_incdir"
10421           then
10422                 cf_have_incdir=no
10423                 if test -n "$CFLAGS$CPPFLAGS" ; then
10424                   # a loop is needed to ensure we can add subdirs of existing dirs
10425                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10426                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10427                           cf_have_incdir=yes; break
10428                         fi
10429                   done
10430                 fi
10431
10432                 if test "$cf_have_incdir" = no ; then
10433                   if test "$cf_add_incdir" = /usr/local/include ; then
10434                         if test "$GCC" = yes
10435                         then
10436                           cf_save_CPPFLAGS=$CPPFLAGS
10437
10438         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10439         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10440
10441                           cat >"conftest.$ac_ext" <<_ACEOF
10442 #line 10442 "configure"
10443 #include "confdefs.h"
10444 #include <stdio.h>
10445 int
10446 main (void)
10447 {
10448 printf("Hello")
10449   ;
10450   return 0;
10451 }
10452 _ACEOF
10453 rm -f "conftest.$ac_objext"
10454 if { (eval echo "$as_me:10454: \"$ac_compile\"") >&5
10455   (eval $ac_compile) 2>&5
10456   ac_status=$?
10457   echo "$as_me:10457: \$? = $ac_status" >&5
10458   (exit "$ac_status"); } &&
10459          { ac_try='test -s "conftest.$ac_objext"'
10460   { (eval echo "$as_me:10460: \"$ac_try\"") >&5
10461   (eval $ac_try) 2>&5
10462   ac_status=$?
10463   echo "$as_me:10463: \$? = $ac_status" >&5
10464   (exit "$ac_status"); }; }; then
10465   :
10466 else
10467   echo "$as_me: failed program was:" >&5
10468 cat "conftest.$ac_ext" >&5
10469 cf_have_incdir=yes
10470 fi
10471 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10472                           CPPFLAGS=$cf_save_CPPFLAGS
10473                         fi
10474                   fi
10475                 fi
10476
10477                 if test "$cf_have_incdir" = no ; then
10478                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10479
10480 echo "${as_me:-configure}:10480: testing adding $cf_add_incdir to include-path ..." 1>&5
10481
10482                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10483
10484                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10485                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10486                   cf_add_incdir="$cf_top_incdir"
10487                 else
10488                   break
10489                 fi
10490           else
10491                 break
10492           fi
10493         done
10494   done
10495 fi
10496
10497                 for cf_header in \
10498                         ncurses.h \
10499                         curses.h
10500                 do
10501
10502         cat >"conftest.$ac_ext" <<_ACEOF
10503 #line 10503 "configure"
10504 #include "confdefs.h"
10505
10506 #include <$cf_header>
10507 int
10508 main (void)
10509 {
10510
10511 #ifdef NCURSES_VERSION
10512
10513 printf("%s\\n", NCURSES_VERSION);
10514 #else
10515 #ifdef __NCURSES_H
10516 printf("old\\n");
10517 #else
10518         make an error
10519 #endif
10520 #endif
10521
10522   ;
10523   return 0;
10524 }
10525 _ACEOF
10526 rm -f "conftest.$ac_objext"
10527 if { (eval echo "$as_me:10527: \"$ac_compile\"") >&5
10528   (eval $ac_compile) 2>&5
10529   ac_status=$?
10530   echo "$as_me:10530: \$? = $ac_status" >&5
10531   (exit "$ac_status"); } &&
10532          { ac_try='test -s "conftest.$ac_objext"'
10533   { (eval echo "$as_me:10533: \"$ac_try\"") >&5
10534   (eval $ac_try) 2>&5
10535   ac_status=$?
10536   echo "$as_me:10536: \$? = $ac_status" >&5
10537   (exit "$ac_status"); }; }; then
10538   cf_cv_ncurses_h2=$cf_header
10539
10540 else
10541   echo "$as_me: failed program was:" >&5
10542 cat "conftest.$ac_ext" >&5
10543 cf_cv_ncurses_h2=no
10544 fi
10545 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10546
10547                         if test "$cf_cv_ncurses_h2" != no ; then
10548                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10549                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10550                                 break
10551                         fi
10552                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10553                 done
10554                 CPPFLAGS="$cf_save2_CPPFLAGS"
10555                 test "$cf_cv_ncurses_h2" != no && break
10556         done
10557         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10557: error: not found" >&5
10558 echo "$as_me: error: not found" >&2;}
10559    { (exit 1); exit 1; }; }
10560
10561 fi
10562 echo "$as_me:10562: result: $cf_cv_ncurses_h2" >&5
10563 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10564
10565         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10566         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10567         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10568                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10569         fi
10570
10571 if test -n "$cf_1st_incdir" ; then
10572   for cf_add_incdir in $cf_1st_incdir
10573   do
10574         while test "$cf_add_incdir" != /usr/include
10575         do
10576           if test -d "$cf_add_incdir"
10577           then
10578                 cf_have_incdir=no
10579                 if test -n "$CFLAGS$CPPFLAGS" ; then
10580                   # a loop is needed to ensure we can add subdirs of existing dirs
10581                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10582                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10583                           cf_have_incdir=yes; break
10584                         fi
10585                   done
10586                 fi
10587
10588                 if test "$cf_have_incdir" = no ; then
10589                   if test "$cf_add_incdir" = /usr/local/include ; then
10590                         if test "$GCC" = yes
10591                         then
10592                           cf_save_CPPFLAGS=$CPPFLAGS
10593
10594         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10595         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10596
10597                           cat >"conftest.$ac_ext" <<_ACEOF
10598 #line 10598 "configure"
10599 #include "confdefs.h"
10600 #include <stdio.h>
10601 int
10602 main (void)
10603 {
10604 printf("Hello")
10605   ;
10606   return 0;
10607 }
10608 _ACEOF
10609 rm -f "conftest.$ac_objext"
10610 if { (eval echo "$as_me:10610: \"$ac_compile\"") >&5
10611   (eval $ac_compile) 2>&5
10612   ac_status=$?
10613   echo "$as_me:10613: \$? = $ac_status" >&5
10614   (exit "$ac_status"); } &&
10615          { ac_try='test -s "conftest.$ac_objext"'
10616   { (eval echo "$as_me:10616: \"$ac_try\"") >&5
10617   (eval $ac_try) 2>&5
10618   ac_status=$?
10619   echo "$as_me:10619: \$? = $ac_status" >&5
10620   (exit "$ac_status"); }; }; then
10621   :
10622 else
10623   echo "$as_me: failed program was:" >&5
10624 cat "conftest.$ac_ext" >&5
10625 cf_have_incdir=yes
10626 fi
10627 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10628                           CPPFLAGS=$cf_save_CPPFLAGS
10629                         fi
10630                   fi
10631                 fi
10632
10633                 if test "$cf_have_incdir" = no ; then
10634                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10635
10636 echo "${as_me:-configure}:10636: testing adding $cf_add_incdir to include-path ..." 1>&5
10637
10638                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10639
10640                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10641                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10642                   cf_add_incdir="$cf_top_incdir"
10643                 else
10644                   break
10645                 fi
10646           else
10647                 break
10648           fi
10649         done
10650   done
10651 fi
10652
10653 fi
10654
10655 # Set definitions to allow ifdef'ing for ncurses.h
10656
10657 case "$cf_cv_ncurses_header" in
10658 (*ncurses.h)
10659
10660 cat >>confdefs.h <<\EOF
10661 #define HAVE_NCURSES_H 1
10662 EOF
10663
10664         ;;
10665 esac
10666
10667 case "$cf_cv_ncurses_header" in
10668 (ncurses/curses.h|ncurses/ncurses.h)
10669
10670 cat >>confdefs.h <<\EOF
10671 #define HAVE_NCURSES_NCURSES_H 1
10672 EOF
10673
10674         ;;
10675 (ncursesw/curses.h|ncursesw/ncurses.h)
10676
10677 cat >>confdefs.h <<\EOF
10678 #define HAVE_NCURSESW_NCURSES_H 1
10679 EOF
10680
10681         ;;
10682 esac
10683
10684 echo "$as_me:10684: checking for terminfo header" >&5
10685 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10686 if test "${cf_cv_term_header+set}" = set; then
10687   echo $ECHO_N "(cached) $ECHO_C" >&6
10688 else
10689
10690 case "${cf_cv_ncurses_header}" in
10691 (*/ncurses.h|*/ncursesw.h)
10692         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10693         ;;
10694 (*)
10695         cf_term_header=term.h
10696         ;;
10697 esac
10698
10699 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10700 do
10701 cat >"conftest.$ac_ext" <<_ACEOF
10702 #line 10702 "configure"
10703 #include "confdefs.h"
10704 #include <stdio.h>
10705 #include <${cf_cv_ncurses_header:-curses.h}>
10706 #include <$cf_test>
10707
10708 int
10709 main (void)
10710 {
10711 int x = auto_left_margin; (void)x
10712   ;
10713   return 0;
10714 }
10715 _ACEOF
10716 rm -f "conftest.$ac_objext"
10717 if { (eval echo "$as_me:10717: \"$ac_compile\"") >&5
10718   (eval $ac_compile) 2>&5
10719   ac_status=$?
10720   echo "$as_me:10720: \$? = $ac_status" >&5
10721   (exit "$ac_status"); } &&
10722          { ac_try='test -s "conftest.$ac_objext"'
10723   { (eval echo "$as_me:10723: \"$ac_try\"") >&5
10724   (eval $ac_try) 2>&5
10725   ac_status=$?
10726   echo "$as_me:10726: \$? = $ac_status" >&5
10727   (exit "$ac_status"); }; }; then
10728
10729         cf_cv_term_header="$cf_test"
10730 else
10731   echo "$as_me: failed program was:" >&5
10732 cat "conftest.$ac_ext" >&5
10733
10734         cf_cv_term_header=unknown
10735
10736 fi
10737 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10738         test "$cf_cv_term_header" != unknown && break
10739 done
10740
10741 fi
10742 echo "$as_me:10742: result: $cf_cv_term_header" >&5
10743 echo "${ECHO_T}$cf_cv_term_header" >&6
10744
10745 # Set definitions to allow ifdef'ing to accommodate subdirectories
10746
10747 case "$cf_cv_term_header" in
10748 (*term.h)
10749
10750 cat >>confdefs.h <<\EOF
10751 #define HAVE_TERM_H 1
10752 EOF
10753
10754         ;;
10755 esac
10756
10757 case "$cf_cv_term_header" in
10758 (ncurses/term.h)
10759
10760 cat >>confdefs.h <<\EOF
10761 #define HAVE_NCURSES_TERM_H 1
10762 EOF
10763
10764         ;;
10765 (ncursesw/term.h)
10766
10767 cat >>confdefs.h <<\EOF
10768 #define HAVE_NCURSESW_TERM_H 1
10769 EOF
10770
10771         ;;
10772 esac
10773
10774 # some applications need this, but should check for NCURSES_VERSION
10775
10776 cat >>confdefs.h <<\EOF
10777 #define NCURSES 1
10778 EOF
10779
10780 echo "$as_me:10780: checking for ncurses version" >&5
10781 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10782 if test "${cf_cv_ncurses_version+set}" = set; then
10783   echo $ECHO_N "(cached) $ECHO_C" >&6
10784 else
10785
10786         cf_cv_ncurses_version=no
10787         cf_tempfile=out$$
10788         rm -f "$cf_tempfile"
10789         if test "$cross_compiling" = yes; then
10790
10791         # This will not work if the preprocessor splits the line after the
10792         # Autoconf token.  The 'unproto' program does that.
10793         cat > "conftest.$ac_ext" <<EOF
10794 #include <${cf_cv_ncurses_header:-curses.h}>
10795 #undef Autoconf
10796 #ifdef NCURSES_VERSION
10797 Autoconf NCURSES_VERSION
10798 #else
10799 #ifdef __NCURSES_H
10800 Autoconf "old"
10801 #endif
10802 ;
10803 #endif
10804 EOF
10805         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10806         { (eval echo "$as_me:10806: \"$cf_try\"") >&5
10807   (eval $cf_try) 2>&5
10808   ac_status=$?
10809   echo "$as_me:10809: \$? = $ac_status" >&5
10810   (exit "$ac_status"); }
10811         if test -f conftest.out ; then
10812                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10813                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10814                 rm -f conftest.out
10815         fi
10816
10817 else
10818   cat >"conftest.$ac_ext" <<_ACEOF
10819 #line 10819 "configure"
10820 #include "confdefs.h"
10821
10822 #include <${cf_cv_ncurses_header:-curses.h}>
10823 #include <stdio.h>
10824 int main(void)
10825 {
10826         FILE *fp = fopen("$cf_tempfile", "w");
10827 #ifdef NCURSES_VERSION
10828 # ifdef NCURSES_VERSION_PATCH
10829         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10830 # else
10831         fprintf(fp, "%s\\n", NCURSES_VERSION);
10832 # endif
10833 #else
10834 # ifdef __NCURSES_H
10835         fprintf(fp, "old\\n");
10836 # else
10837         make an error
10838 # endif
10839 #endif
10840         ${cf_cv_main_return:-return}(0);
10841 }
10842 _ACEOF
10843 rm -f "conftest$ac_exeext"
10844 if { (eval echo "$as_me:10844: \"$ac_link\"") >&5
10845   (eval $ac_link) 2>&5
10846   ac_status=$?
10847   echo "$as_me:10847: \$? = $ac_status" >&5
10848   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10849   { (eval echo "$as_me:10849: \"$ac_try\"") >&5
10850   (eval $ac_try) 2>&5
10851   ac_status=$?
10852   echo "$as_me:10852: \$? = $ac_status" >&5
10853   (exit "$ac_status"); }; }; then
10854
10855         cf_cv_ncurses_version=`cat $cf_tempfile`
10856 else
10857   echo "$as_me: program exited with status $ac_status" >&5
10858 echo "$as_me: failed program was:" >&5
10859 cat "conftest.$ac_ext" >&5
10860 fi
10861 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10862 fi
10863         rm -f "$cf_tempfile"
10864
10865 fi
10866 echo "$as_me:10866: result: $cf_cv_ncurses_version" >&5
10867 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10868 test "$cf_cv_ncurses_version" = no ||
10869 cat >>confdefs.h <<\EOF
10870 #define NCURSES 1
10871 EOF
10872
10873 cf_nculib_root=ncurses
10874         # This works, except for the special case where we find gpm, but
10875         # ncurses is in a nonstandard location via $LIBS, and we really want
10876         # to link gpm.
10877 cf_ncurses_LIBS=""
10878 cf_ncurses_SAVE="$LIBS"
10879 echo "$as_me:10879: checking for Gpm_Open in -lgpm" >&5
10880 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10881 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10882   echo $ECHO_N "(cached) $ECHO_C" >&6
10883 else
10884   ac_check_lib_save_LIBS=$LIBS
10885 LIBS="-lgpm  $LIBS"
10886 cat >"conftest.$ac_ext" <<_ACEOF
10887 #line 10887 "configure"
10888 #include "confdefs.h"
10889
10890 /* Override any gcc2 internal prototype to avoid an error.  */
10891 #ifdef __cplusplus
10892 extern "C"
10893 #endif
10894 /* We use char because int might match the return type of a gcc2
10895    builtin and then its argument prototype would still apply.  */
10896 char Gpm_Open ();
10897 int
10898 main (void)
10899 {
10900 Gpm_Open ();
10901   ;
10902   return 0;
10903 }
10904 _ACEOF
10905 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10906 if { (eval echo "$as_me:10906: \"$ac_link\"") >&5
10907   (eval $ac_link) 2>&5
10908   ac_status=$?
10909   echo "$as_me:10909: \$? = $ac_status" >&5
10910   (exit "$ac_status"); } &&
10911          { ac_try='test -s "conftest$ac_exeext"'
10912   { (eval echo "$as_me:10912: \"$ac_try\"") >&5
10913   (eval $ac_try) 2>&5
10914   ac_status=$?
10915   echo "$as_me:10915: \$? = $ac_status" >&5
10916   (exit "$ac_status"); }; }; then
10917   ac_cv_lib_gpm_Gpm_Open=yes
10918 else
10919   echo "$as_me: failed program was:" >&5
10920 cat "conftest.$ac_ext" >&5
10921 ac_cv_lib_gpm_Gpm_Open=no
10922 fi
10923 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10924 LIBS=$ac_check_lib_save_LIBS
10925 fi
10926 echo "$as_me:10926: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10927 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10928 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10929   echo "$as_me:10929: checking for initscr in -lgpm" >&5
10930 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10931 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10932   echo $ECHO_N "(cached) $ECHO_C" >&6
10933 else
10934   ac_check_lib_save_LIBS=$LIBS
10935 LIBS="-lgpm  $LIBS"
10936 cat >"conftest.$ac_ext" <<_ACEOF
10937 #line 10937 "configure"
10938 #include "confdefs.h"
10939
10940 /* Override any gcc2 internal prototype to avoid an error.  */
10941 #ifdef __cplusplus
10942 extern "C"
10943 #endif
10944 /* We use char because int might match the return type of a gcc2
10945    builtin and then its argument prototype would still apply.  */
10946 char initscr ();
10947 int
10948 main (void)
10949 {
10950 initscr ();
10951   ;
10952   return 0;
10953 }
10954 _ACEOF
10955 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10956 if { (eval echo "$as_me:10956: \"$ac_link\"") >&5
10957   (eval $ac_link) 2>&5
10958   ac_status=$?
10959   echo "$as_me:10959: \$? = $ac_status" >&5
10960   (exit "$ac_status"); } &&
10961          { ac_try='test -s "conftest$ac_exeext"'
10962   { (eval echo "$as_me:10962: \"$ac_try\"") >&5
10963   (eval $ac_try) 2>&5
10964   ac_status=$?
10965   echo "$as_me:10965: \$? = $ac_status" >&5
10966   (exit "$ac_status"); }; }; then
10967   ac_cv_lib_gpm_initscr=yes
10968 else
10969   echo "$as_me: failed program was:" >&5
10970 cat "conftest.$ac_ext" >&5
10971 ac_cv_lib_gpm_initscr=no
10972 fi
10973 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10974 LIBS=$ac_check_lib_save_LIBS
10975 fi
10976 echo "$as_me:10976: result: $ac_cv_lib_gpm_initscr" >&5
10977 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10978 if test "$ac_cv_lib_gpm_initscr" = yes; then
10979   LIBS="$cf_ncurses_SAVE"
10980 else
10981   cf_ncurses_LIBS="-lgpm"
10982 fi
10983
10984 fi
10985
10986 case "$host_os" in
10987 (freebsd*)
10988         # This is only necessary if you are linking against an obsolete
10989         # version of ncurses (but it should do no harm, since it is static).
10990         if test "$cf_nculib_root" = ncurses ; then
10991                 echo "$as_me:10991: checking for tgoto in -lmytinfo" >&5
10992 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10993 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10994   echo $ECHO_N "(cached) $ECHO_C" >&6
10995 else
10996   ac_check_lib_save_LIBS=$LIBS
10997 LIBS="-lmytinfo  $LIBS"
10998 cat >"conftest.$ac_ext" <<_ACEOF
10999 #line 10999 "configure"
11000 #include "confdefs.h"
11001
11002 /* Override any gcc2 internal prototype to avoid an error.  */
11003 #ifdef __cplusplus
11004 extern "C"
11005 #endif
11006 /* We use char because int might match the return type of a gcc2
11007    builtin and then its argument prototype would still apply.  */
11008 char tgoto ();
11009 int
11010 main (void)
11011 {
11012 tgoto ();
11013   ;
11014   return 0;
11015 }
11016 _ACEOF
11017 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11018 if { (eval echo "$as_me:11018: \"$ac_link\"") >&5
11019   (eval $ac_link) 2>&5
11020   ac_status=$?
11021   echo "$as_me:11021: \$? = $ac_status" >&5
11022   (exit "$ac_status"); } &&
11023          { ac_try='test -s "conftest$ac_exeext"'
11024   { (eval echo "$as_me:11024: \"$ac_try\"") >&5
11025   (eval $ac_try) 2>&5
11026   ac_status=$?
11027   echo "$as_me:11027: \$? = $ac_status" >&5
11028   (exit "$ac_status"); }; }; then
11029   ac_cv_lib_mytinfo_tgoto=yes
11030 else
11031   echo "$as_me: failed program was:" >&5
11032 cat "conftest.$ac_ext" >&5
11033 ac_cv_lib_mytinfo_tgoto=no
11034 fi
11035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11036 LIBS=$ac_check_lib_save_LIBS
11037 fi
11038 echo "$as_me:11038: result: $ac_cv_lib_mytinfo_tgoto" >&5
11039 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11040 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11041   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11042 fi
11043
11044         fi
11045         ;;
11046 esac
11047
11048 cf_add_libs="$LIBS"
11049 # reverse order
11050 cf_add_0lib=
11051 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11052 # filter duplicates
11053 for cf_add_1lib in $cf_add_0lib; do
11054         for cf_add_2lib in $cf_add_libs; do
11055                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11056                         cf_add_1lib=
11057                         break
11058                 fi
11059         done
11060         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11061 done
11062 LIBS="$cf_add_libs"
11063
11064 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11065 then
11066
11067 cf_add_libs="$LIBS"
11068 # reverse order
11069 cf_add_0lib=
11070 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11071 # filter duplicates
11072 for cf_add_1lib in $cf_add_0lib; do
11073         for cf_add_2lib in $cf_add_libs; do
11074                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11075                         cf_add_1lib=
11076                         break
11077                 fi
11078         done
11079         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11080 done
11081 LIBS="$cf_add_libs"
11082
11083 else
11084
11085         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11086         cf_libdir=""
11087         echo "$as_me:11087: checking for initscr" >&5
11088 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11089 if test "${ac_cv_func_initscr+set}" = set; then
11090   echo $ECHO_N "(cached) $ECHO_C" >&6
11091 else
11092   cat >"conftest.$ac_ext" <<_ACEOF
11093 #line 11093 "configure"
11094 #include "confdefs.h"
11095 #define initscr autoconf_temporary
11096 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11097 #undef initscr
11098
11099 #ifdef __cplusplus
11100 extern "C"
11101 #endif
11102
11103 /* We use char because int might match the return type of a gcc2
11104    builtin and then its argument prototype would still apply.  */
11105 char initscr (void);
11106
11107 int
11108 main (void)
11109 {
11110
11111 /* The GNU C library defines stubs for functions which it implements
11112     to always fail with ENOSYS.  Some functions are actually named
11113     something starting with __ and the normal name is an alias.  */
11114 #if defined (__stub_initscr) || defined (__stub___initscr)
11115 #error found stub for initscr
11116 #endif
11117
11118         return initscr ();
11119   ;
11120   return 0;
11121 }
11122 _ACEOF
11123 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11124 if { (eval echo "$as_me:11124: \"$ac_link\"") >&5
11125   (eval $ac_link) 2>&5
11126   ac_status=$?
11127   echo "$as_me:11127: \$? = $ac_status" >&5
11128   (exit "$ac_status"); } &&
11129          { ac_try='test -s "conftest$ac_exeext"'
11130   { (eval echo "$as_me:11130: \"$ac_try\"") >&5
11131   (eval $ac_try) 2>&5
11132   ac_status=$?
11133   echo "$as_me:11133: \$? = $ac_status" >&5
11134   (exit "$ac_status"); }; }; then
11135   ac_cv_func_initscr=yes
11136 else
11137   echo "$as_me: failed program was:" >&5
11138 cat "conftest.$ac_ext" >&5
11139 ac_cv_func_initscr=no
11140 fi
11141 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11142 fi
11143 echo "$as_me:11143: result: $ac_cv_func_initscr" >&5
11144 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11145 if test "$ac_cv_func_initscr" = yes; then
11146   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11147 else
11148
11149                 cf_save_LIBS="$LIBS"
11150                 echo "$as_me:11150: checking for initscr in -l$cf_nculib_root" >&5
11151 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11152                 LIBS="-l$cf_nculib_root $LIBS"
11153                 cat >"conftest.$ac_ext" <<_ACEOF
11154 #line 11154 "configure"
11155 #include "confdefs.h"
11156 #include <${cf_cv_ncurses_header:-curses.h}>
11157 int
11158 main (void)
11159 {
11160 initscr()
11161   ;
11162   return 0;
11163 }
11164 _ACEOF
11165 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11166 if { (eval echo "$as_me:11166: \"$ac_link\"") >&5
11167   (eval $ac_link) 2>&5
11168   ac_status=$?
11169   echo "$as_me:11169: \$? = $ac_status" >&5
11170   (exit "$ac_status"); } &&
11171          { ac_try='test -s "conftest$ac_exeext"'
11172   { (eval echo "$as_me:11172: \"$ac_try\"") >&5
11173   (eval $ac_try) 2>&5
11174   ac_status=$?
11175   echo "$as_me:11175: \$? = $ac_status" >&5
11176   (exit "$ac_status"); }; }; then
11177   echo "$as_me:11177: result: yes" >&5
11178 echo "${ECHO_T}yes" >&6
11179                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11180
11181 else
11182   echo "$as_me: failed program was:" >&5
11183 cat "conftest.$ac_ext" >&5
11184 echo "$as_me:11184: result: no" >&5
11185 echo "${ECHO_T}no" >&6
11186
11187 cf_search=
11188 cf_library_path_list=""
11189 if test -n "${LDFLAGS}${LIBS}" ; then
11190         for cf_library_path in $LDFLAGS $LIBS
11191         do
11192                 case "$cf_library_path" in
11193                 (-L*)
11194                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11195
11196 test "x$cf_library_path" != "xNONE" && \
11197 test -d "$cf_library_path" && \
11198  {
11199         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11200         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11201         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11202         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11203         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11204         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"
11205 }
11206
11207                         cf_library_path_list="$cf_library_path_list $cf_search"
11208                         ;;
11209                 esac
11210         done
11211 fi
11212
11213 cf_search=
11214
11215 test "x$prefix" != "xNONE" && \
11216 test -d "$prefix" && \
11217  {
11218         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11219         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11220         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11221         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11222         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11223         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11224 }
11225
11226 for cf_subdir_prefix in \
11227         /usr \
11228         /usr/local \
11229         /usr/pkg \
11230         /opt \
11231         /opt/local \
11232         $HOME
11233 do
11234
11235 test "x$cf_subdir_prefix" != "x$prefix" && \
11236 test -d "$cf_subdir_prefix" && \
11237 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11238         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11239         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11240         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11241         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11242         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11243         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"
11244 }
11245
11246 done
11247
11248 cf_search="$cf_library_path_list $cf_search"
11249
11250                         for cf_libdir in $cf_search
11251                         do
11252                                 echo "$as_me:11252: checking for -l$cf_nculib_root in $cf_libdir" >&5
11253 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11254                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11255                                 cat >"conftest.$ac_ext" <<_ACEOF
11256 #line 11256 "configure"
11257 #include "confdefs.h"
11258 #include <${cf_cv_ncurses_header:-curses.h}>
11259 int
11260 main (void)
11261 {
11262 initscr()
11263   ;
11264   return 0;
11265 }
11266 _ACEOF
11267 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11268 if { (eval echo "$as_me:11268: \"$ac_link\"") >&5
11269   (eval $ac_link) 2>&5
11270   ac_status=$?
11271   echo "$as_me:11271: \$? = $ac_status" >&5
11272   (exit "$ac_status"); } &&
11273          { ac_try='test -s "conftest$ac_exeext"'
11274   { (eval echo "$as_me:11274: \"$ac_try\"") >&5
11275   (eval $ac_try) 2>&5
11276   ac_status=$?
11277   echo "$as_me:11277: \$? = $ac_status" >&5
11278   (exit "$ac_status"); }; }; then
11279   echo "$as_me:11279: result: yes" >&5
11280 echo "${ECHO_T}yes" >&6
11281                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11282                                          break
11283 else
11284   echo "$as_me: failed program was:" >&5
11285 cat "conftest.$ac_ext" >&5
11286 echo "$as_me:11286: result: no" >&5
11287 echo "${ECHO_T}no" >&6
11288                                          LIBS="$cf_save_LIBS"
11289 fi
11290 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11291                         done
11292
11293 fi
11294 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11295
11296 fi
11297
11298 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11299
11300 if test "$cf_found_library" = no ; then
11301         { { echo "$as_me:11301: error: Cannot link $cf_nculib_root library" >&5
11302 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11303    { (exit 1); exit 1; }; }
11304 fi
11305
11306 fi
11307
11308 if test -n "$cf_ncurses_LIBS" ; then
11309         echo "$as_me:11309: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11310 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11311         cf_ncurses_SAVE="$LIBS"
11312         for p in $cf_ncurses_LIBS ; do
11313                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11314                 if test "$q" != "$LIBS" ; then
11315                         LIBS="$q"
11316                 fi
11317         done
11318         cat >"conftest.$ac_ext" <<_ACEOF
11319 #line 11319 "configure"
11320 #include "confdefs.h"
11321 #include <${cf_cv_ncurses_header:-curses.h}>
11322 int
11323 main (void)
11324 {
11325 initscr(); mousemask(0,0); tigetstr((char *)0);
11326   ;
11327   return 0;
11328 }
11329 _ACEOF
11330 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11331 if { (eval echo "$as_me:11331: \"$ac_link\"") >&5
11332   (eval $ac_link) 2>&5
11333   ac_status=$?
11334   echo "$as_me:11334: \$? = $ac_status" >&5
11335   (exit "$ac_status"); } &&
11336          { ac_try='test -s "conftest$ac_exeext"'
11337   { (eval echo "$as_me:11337: \"$ac_try\"") >&5
11338   (eval $ac_try) 2>&5
11339   ac_status=$?
11340   echo "$as_me:11340: \$? = $ac_status" >&5
11341   (exit "$ac_status"); }; }; then
11342   echo "$as_me:11342: result: yes" >&5
11343 echo "${ECHO_T}yes" >&6
11344 else
11345   echo "$as_me: failed program was:" >&5
11346 cat "conftest.$ac_ext" >&5
11347 echo "$as_me:11347: result: no" >&5
11348 echo "${ECHO_T}no" >&6
11349                  LIBS="$cf_ncurses_SAVE"
11350 fi
11351 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11352 fi
11353
11354 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11355
11356 cat >>confdefs.h <<EOF
11357 #define $cf_nculib_ROOT 1
11358 EOF
11359
11360         fi
11361 else
11362         NCURSES_CONFIG=none
11363 fi
11364
11365 fi
11366
11367 if test "$NCURSES_CONFIG_PKG" != none ; then
11368         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11369
11370         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11371         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11372         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11373
11374         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11375         if test -z "$cf_cv_abi_version"
11376         then
11377                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11378         fi
11379
11380 elif test "$NCURSES_CONFIG" != none ; then
11381
11382         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11383
11384         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11385         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11386         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11387
11388         # ABI version is not available from headers
11389         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11390
11391 else
11392
11393         for cf_name in MAJOR MINOR PATCH
11394         do
11395         cat >conftest.$ac_ext <<CF_EOF
11396         #include <${cf_cv_ncurses_header:-curses.h}>
11397         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11398 CF_EOF
11399                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11400                 { (eval echo "$as_me:11400: \"$cf_try\"") >&5
11401   (eval $cf_try) 2>&5
11402   ac_status=$?
11403   echo "$as_me:11403: \$? = $ac_status" >&5
11404   (exit "$ac_status"); }
11405                 if test -f conftest.out ; then
11406                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11407                         eval NCURSES_$cf_name=\"$cf_result\"
11408                         # cat conftest.$ac_ext
11409                         # cat conftest.out
11410                 fi
11411         done
11412
11413         cf_cv_abi_version=${NCURSES_MAJOR}
11414
11415 fi
11416
11417 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11418
11419 cf_cv_timestamp=`date`
11420
11421 echo "$as_me:11421: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11422 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11423
11424 echo "$as_me:11424: checking if you want to have a library-prefix" >&5
11425 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11426
11427 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11428 if test "${with_lib_prefix+set}" = set; then
11429   withval="$with_lib_prefix"
11430   with_lib_prefix=$withval
11431 else
11432   with_lib_prefix=auto
11433 fi;
11434 echo "$as_me:11434: result: $with_lib_prefix" >&5
11435 echo "${ECHO_T}$with_lib_prefix" >&6
11436
11437 if test "$with_lib_prefix" = auto
11438 then
11439
11440         case "$cf_cv_system_name" in
11441         (OS/2*|os2*)
11442                 if test "$DFT_LWR_MODEL" = libtool; then
11443                         LIB_PREFIX='lib'
11444                 else
11445                         LIB_PREFIX=''
11446                 fi
11447                 ;;
11448         (*-msvc*)
11449                 LIB_PREFIX=''
11450                 ;;
11451         (*)     LIB_PREFIX='lib'
11452                 ;;
11453         esac
11454 cf_prefix=$LIB_PREFIX
11455
11456 elif test "$with_lib_prefix" = no
11457 then
11458         LIB_PREFIX=
11459 else
11460         LIB_PREFIX=$with_lib_prefix
11461 fi
11462
11463 LIB_SUFFIX=
11464
11465 ###############################################################################
11466
11467 if test X"$CC_G_OPT" = X"" ; then
11468         CC_G_OPT='-g'
11469         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11470 fi
11471
11472 echo "$as_me:11472: checking for default loader flags" >&5
11473 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11474 case $DFT_LWR_MODEL in
11475 (normal)  LD_MODEL=''   ;;
11476 (debug)   LD_MODEL=$CC_G_OPT ;;
11477 (profile) LD_MODEL='-pg';;
11478 (shared)  LD_MODEL=''   ;;
11479 esac
11480 echo "$as_me:11480: result: $LD_MODEL" >&5
11481 echo "${ECHO_T}$LD_MODEL" >&6
11482
11483 LD_RPATH_OPT=
11484 if test "x$cf_cv_enable_rpath" != xno
11485 then
11486         echo "$as_me:11486: checking for an rpath option" >&5
11487 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11488         case "$cf_cv_system_name" in
11489         (irix*)
11490                 if test "$GCC" = yes; then
11491                         LD_RPATH_OPT="-Wl,-rpath,"
11492                 else
11493                         LD_RPATH_OPT="-rpath "
11494                 fi
11495                 ;;
11496         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11497                 LD_RPATH_OPT="-Wl,-rpath,"
11498                 ;;
11499         (openbsd[2-9].*|mirbsd*)
11500                 LD_RPATH_OPT="-Wl,-rpath,"
11501                 ;;
11502         (dragonfly*)
11503                 LD_RPATH_OPT="-rpath "
11504                 ;;
11505         (netbsd*)
11506                 LD_RPATH_OPT="-Wl,-rpath,"
11507                 ;;
11508         (osf*|mls+*)
11509                 LD_RPATH_OPT="-rpath "
11510                 ;;
11511         (solaris2*)
11512                 LD_RPATH_OPT="-R"
11513                 ;;
11514         (*)
11515                 ;;
11516         esac
11517         echo "$as_me:11517: result: $LD_RPATH_OPT" >&5
11518 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11519
11520         case "x$LD_RPATH_OPT" in
11521         (x-R*)
11522                 echo "$as_me:11522: checking if we need a space after rpath option" >&5
11523 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11524                 cf_save_LIBS="$LIBS"
11525
11526 cf_add_libs="$LIBS"
11527 # reverse order
11528 cf_add_0lib=
11529 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11530 # filter duplicates
11531 for cf_add_1lib in $cf_add_0lib; do
11532         for cf_add_2lib in $cf_add_libs; do
11533                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11534                         cf_add_1lib=
11535                         break
11536                 fi
11537         done
11538         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11539 done
11540 LIBS="$cf_add_libs"
11541
11542                 cat >"conftest.$ac_ext" <<_ACEOF
11543 #line 11543 "configure"
11544 #include "confdefs.h"
11545
11546 int
11547 main (void)
11548 {
11549
11550   ;
11551   return 0;
11552 }
11553 _ACEOF
11554 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11555 if { (eval echo "$as_me:11555: \"$ac_link\"") >&5
11556   (eval $ac_link) 2>&5
11557   ac_status=$?
11558   echo "$as_me:11558: \$? = $ac_status" >&5
11559   (exit "$ac_status"); } &&
11560          { ac_try='test -s "conftest$ac_exeext"'
11561   { (eval echo "$as_me:11561: \"$ac_try\"") >&5
11562   (eval $ac_try) 2>&5
11563   ac_status=$?
11564   echo "$as_me:11564: \$? = $ac_status" >&5
11565   (exit "$ac_status"); }; }; then
11566   cf_rpath_space=no
11567 else
11568   echo "$as_me: failed program was:" >&5
11569 cat "conftest.$ac_ext" >&5
11570 cf_rpath_space=yes
11571 fi
11572 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11573                 LIBS="$cf_save_LIBS"
11574                 echo "$as_me:11574: result: $cf_rpath_space" >&5
11575 echo "${ECHO_T}$cf_rpath_space" >&6
11576                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11577                 ;;
11578         esac
11579 fi
11580
11581         RM_SHARED_OPTS=
11582         LOCAL_LDFLAGS=
11583         LOCAL_LDFLAGS2=
11584         LD_SHARED_OPTS=
11585         INSTALL_LIB="-m 644"
11586         : ${rel_builddir:=.}
11587
11588         shlibdir=$libdir
11589
11590         MAKE_DLLS="#"
11591
11592         cf_cv_do_symlinks=no
11593         cf_ld_rpath_opt=
11594         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11595
11596         echo "$as_me:11596: checking if release/abi version should be used for shared libs" >&5
11597 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11598
11599 # Check whether --with-shlib-version or --without-shlib-version was given.
11600 if test "${with_shlib_version+set}" = set; then
11601   withval="$with_shlib_version"
11602   test -z "$withval" && withval=auto
11603         case "$withval" in
11604         (yes)
11605                 cf_cv_shlib_version=auto
11606                 ;;
11607         (rel|abi|auto)
11608                 cf_cv_shlib_version=$withval
11609                 ;;
11610         (*)
11611                 echo "$as_me:11611: result: $withval" >&5
11612 echo "${ECHO_T}$withval" >&6
11613                 { { echo "$as_me:11613: error: option value must be one of: rel, abi, or auto" >&5
11614 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11615    { (exit 1); exit 1; }; }
11616                 ;;
11617         esac
11618
11619 else
11620   cf_cv_shlib_version=auto
11621 fi;
11622         echo "$as_me:11622: result: $cf_cv_shlib_version" >&5
11623 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11624
11625         cf_cv_rm_so_locs=no
11626         cf_try_cflags=
11627
11628         # Some less-capable ports of gcc support only -fpic
11629         CC_SHARED_OPTS=
11630
11631         cf_try_fPIC=no
11632         if test "$GCC" = yes
11633         then
11634                 cf_try_fPIC=yes
11635         else
11636                 case "$cf_cv_system_name" in
11637                 (*linux*)       # e.g., PGI compiler
11638                         cf_try_fPIC=yes
11639                         ;;
11640                 esac
11641         fi
11642
11643         if test "$cf_try_fPIC" = yes
11644         then
11645                 echo "$as_me:11645: checking which $CC option to use" >&5
11646 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11647                 cf_save_CFLAGS="$CFLAGS"
11648                 for CC_SHARED_OPTS in -fPIC -fpic ''
11649                 do
11650                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11651                         cat >"conftest.$ac_ext" <<_ACEOF
11652 #line 11652 "configure"
11653 #include "confdefs.h"
11654 #include <stdio.h>
11655 int
11656 main (void)
11657 {
11658 int x = 1
11659   ;
11660   return 0;
11661 }
11662 _ACEOF
11663 rm -f "conftest.$ac_objext"
11664 if { (eval echo "$as_me:11664: \"$ac_compile\"") >&5
11665   (eval $ac_compile) 2>&5
11666   ac_status=$?
11667   echo "$as_me:11667: \$? = $ac_status" >&5
11668   (exit "$ac_status"); } &&
11669          { ac_try='test -s "conftest.$ac_objext"'
11670   { (eval echo "$as_me:11670: \"$ac_try\"") >&5
11671   (eval $ac_try) 2>&5
11672   ac_status=$?
11673   echo "$as_me:11673: \$? = $ac_status" >&5
11674   (exit "$ac_status"); }; }; then
11675   break
11676 else
11677   echo "$as_me: failed program was:" >&5
11678 cat "conftest.$ac_ext" >&5
11679 fi
11680 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11681                 done
11682                 echo "$as_me:11682: result: $CC_SHARED_OPTS" >&5
11683 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11684                 CFLAGS="$cf_save_CFLAGS"
11685         fi
11686
11687         cf_cv_shlib_version_infix=no
11688
11689         case "$cf_cv_system_name" in
11690         (aix4.3-9*|aix[5-7]*)
11691                 if test "$GCC" = yes; then
11692                         CC_SHARED_OPTS='-Wl,-brtl'
11693                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11694                 else
11695                         CC_SHARED_OPTS='-brtl'
11696                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11697                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11698                 fi
11699                 ;;
11700         (beos*)
11701                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11702                 ;;
11703         (cygwin*)
11704                 CC_SHARED_OPTS=
11705                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11706                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11707                 cf_cv_shlib_version=cygdll
11708                 cf_cv_shlib_version_infix=cygdll
11709                 shlibdir=$bindir
11710                 MAKE_DLLS=
11711                 cat >mk_shared_lib.sh <<-CF_EOF
11712                 #!$SHELL
11713                 SHARED_LIB=\$1
11714                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11715                 shift
11716                 cat <<-EOF
11717                 Linking shared library
11718                 ** SHARED_LIB \$SHARED_LIB
11719                 ** IMPORT_LIB \$IMPORT_LIB
11720 EOF
11721                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11722 CF_EOF
11723                 chmod +x mk_shared_lib.sh
11724                 ;;
11725         (msys*)
11726                 CC_SHARED_OPTS=
11727                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11728                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11729                 cf_cv_shlib_version=msysdll
11730                 cf_cv_shlib_version_infix=msysdll
11731                 shlibdir=$bindir
11732                 MAKE_DLLS=
11733                 cat >mk_shared_lib.sh <<-CF_EOF
11734                 #!$SHELL
11735                 SHARED_LIB=\$1
11736                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11737                 shift
11738                 cat <<-EOF
11739                 Linking shared library
11740                 ** SHARED_LIB \$SHARED_LIB
11741                 ** IMPORT_LIB \$IMPORT_LIB
11742 EOF
11743                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11744 CF_EOF
11745                 chmod +x mk_shared_lib.sh
11746                 ;;
11747         (darwin*)
11748                 cf_try_cflags="no-cpp-precomp"
11749                 CC_SHARED_OPTS="-dynamic"
11750                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11751                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11752                 cf_cv_shlib_version_infix=yes
11753                 echo "$as_me:11753: checking if ld -search_paths_first works" >&5
11754 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11755 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11756   echo $ECHO_N "(cached) $ECHO_C" >&6
11757 else
11758
11759                         cf_save_LDFLAGS=$LDFLAGS
11760                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11761                         cat >"conftest.$ac_ext" <<_ACEOF
11762 #line 11762 "configure"
11763 #include "confdefs.h"
11764
11765 int
11766 main (void)
11767 {
11768 int i;
11769   ;
11770   return 0;
11771 }
11772 _ACEOF
11773 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11774 if { (eval echo "$as_me:11774: \"$ac_link\"") >&5
11775   (eval $ac_link) 2>&5
11776   ac_status=$?
11777   echo "$as_me:11777: \$? = $ac_status" >&5
11778   (exit "$ac_status"); } &&
11779          { ac_try='test -s "conftest$ac_exeext"'
11780   { (eval echo "$as_me:11780: \"$ac_try\"") >&5
11781   (eval $ac_try) 2>&5
11782   ac_status=$?
11783   echo "$as_me:11783: \$? = $ac_status" >&5
11784   (exit "$ac_status"); }; }; then
11785   cf_cv_ldflags_search_paths_first=yes
11786 else
11787   echo "$as_me: failed program was:" >&5
11788 cat "conftest.$ac_ext" >&5
11789 cf_cv_ldflags_search_paths_first=no
11790 fi
11791 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11792                                 LDFLAGS=$cf_save_LDFLAGS
11793 fi
11794 echo "$as_me:11794: result: $cf_cv_ldflags_search_paths_first" >&5
11795 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11796                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11797                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11798                 fi
11799                 ;;
11800         (haiku*)
11801
11802         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11803         if test "$cf_cv_shlib_version" = rel; then
11804                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11805         else
11806                 cf_cv_shared_soname='`basename $@`'
11807         fi
11808
11809                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11810                 ;;
11811         (hpux[7-8]*)
11812                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11813                 if test "$GCC" != yes; then
11814                         CC_SHARED_OPTS='+Z'
11815                 fi
11816                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11817                 INSTALL_LIB="-m 555"
11818                 ;;
11819         (hpux*)
11820                 # (tested with gcc 2.7.2 -- I don't have c89)
11821                 if test "$GCC" = yes; then
11822                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11823                 else
11824                         CC_SHARED_OPTS='+Z'
11825                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11826                 fi
11827                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11828                 # HP-UX shared libraries must be executable, and should be
11829                 # readonly to exploit a quirk in the memory manager.
11830                 INSTALL_LIB="-m 555"
11831                 ;;
11832         (interix*)
11833                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11834                 if test "$cf_cv_shlib_version" = rel; then
11835                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11836                 else
11837                         cf_shared_soname='`basename $@`'
11838                 fi
11839                 CC_SHARED_OPTS=
11840                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11841                 ;;
11842         (irix*)
11843                 if test "$cf_cv_enable_rpath" = yes ; then
11844                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11845                 fi
11846                 # tested with IRIX 5.2 and 'cc'.
11847                 if test "$GCC" != yes; then
11848                         CC_SHARED_OPTS='-KPIC'
11849                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11850                 else
11851                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11852                 fi
11853                 cf_cv_rm_so_locs=yes
11854                 ;;
11855         (linux*|gnu*|k*bsd*-gnu)
11856                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11857                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11858                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11859                 fi
11860                 if test "$cf_cv_enable_rpath" = yes ; then
11861                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11862                 fi
11863
11864         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11865         if test "$cf_cv_shlib_version" = rel; then
11866                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11867         else
11868                 cf_cv_shared_soname='`basename $@`'
11869         fi
11870
11871                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11872                 ;;
11873         (mingw*msvc*)
11874                 cf_cv_shlib_version=msvcdll
11875                 cf_cv_shlib_version_infix=msvcdll
11876                 shlibdir=$bindir
11877                 MAKE_DLLS=
11878                 if test "$DFT_LWR_MODEL" = "shared" ; then
11879                         LOCAL_LDFLAGS="-link -dll"
11880                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11881                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11882                 fi
11883                 CC_SHARED_OPTS=
11884                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11885                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11886                 cat >mk_shared_lib.sh <<-CF_EOF
11887                 #!$SHELL
11888                 SHARED_LIB=\$1
11889                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11890                 shift
11891                 my_ld=\$1
11892                 shift
11893                 cat <<-EOF
11894                 Linking shared library
11895                 ** SHARED LIB \$SHARED_LIB
11896                 ** IMPORT_LIB \$IMPORT_LIB
11897 EOF
11898                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11899                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11900                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11901 CF_EOF
11902                 chmod +x mk_shared_lib.sh
11903                 cat >mk_prog.sh <<-CF_EOF
11904                 #!$SHELL
11905                 shift
11906                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11907                 LD="$LD"
11908                 clopts=()
11909                 ldopts=("/subsystem:console")
11910                 libs=()
11911                 isdll=0
11912                 while test \$# -gt 0; do
11913                         case "\$1" in
11914                                 -link)
11915                                         # ignore -link argument
11916                                         ;;
11917                                 -M[TD] | -M[TD]d)
11918                                         # ignore runtime-library option
11919                                         ;;
11920                                 -dll)
11921                                         isdll=1
11922                                         ;;
11923                                 -W* | -w*)
11924                                         # ignore warnings
11925                                         ;;
11926                                 -D*)
11927                                         clopts+=("\$1")
11928                                         ;;
11929                                 -I*)
11930                                         clopts+=("\$1")
11931                                         ;;
11932                                 -l*)
11933                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11934                                         ;;
11935                                 -L*)
11936                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11937                                         ;;
11938                                 *.obj | *.o)
11939                                         ldopts+=("\$1")
11940                                         ;;
11941                                 -Wl,*)
11942                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11943                                                 ldopts+=("\${linkarg}")
11944                                         done
11945                                         ;;
11946                                 *.lib)
11947                                         ldopts+=("\$1")
11948                                         ;;
11949                                 -o)
11950                                         shift
11951                                         ldopts+=("-out:\$1")
11952                                         ;;
11953                                 *)
11954                                         clopts+=("\$1")
11955                                         ldopts+=("\$1")
11956                                         ;;
11957                         esac
11958                         shift
11959                 done
11960                 if [ "\$isdll" -ne 0 ]; then
11961                         for lib in \${libs[*]}; do
11962                                 ldopts+=("\$lib.dll.lib")
11963                         done
11964                 else
11965                         for lib in \${libs[*]}; do
11966                                 ldopts+=("\$lib.lib")
11967                         done
11968                 fi
11969                 cat <<-EOF
11970                 Creating program
11971                 ** ld options:   "\${ldopts[@]}"
11972 EOF
11973                 exec \$LD \${ldopts[@]}
11974 CF_EOF
11975                 chmod +x mk_prog.sh
11976                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11977                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11978                 ;;
11979         (mingw*)
11980                 cf_cv_shlib_version=mingw
11981                 cf_cv_shlib_version_infix=mingw
11982                 shlibdir=$bindir
11983                 MAKE_DLLS=
11984                 if test "$DFT_LWR_MODEL" = "shared" ; then
11985                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11986                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11987                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11988                 fi
11989                 CC_SHARED_OPTS=
11990                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11991                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11992                 cat >mk_shared_lib.sh <<-CF_EOF
11993                 #!$SHELL
11994                 SHARED_LIB=\$1
11995                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11996                 shift
11997                 cat <<-EOF
11998                 Linking shared library
11999                 ** SHARED_LIB \$SHARED_LIB
12000                 ** IMPORT_LIB \$IMPORT_LIB
12001 EOF
12002                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12003 CF_EOF
12004                 chmod +x mk_shared_lib.sh
12005                 ;;
12006         (openbsd[2-9].*|mirbsd*)
12007                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12008                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12009                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12010                 fi
12011                 if test "$cf_cv_enable_rpath" = yes ; then
12012                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12013                 fi
12014                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12015
12016         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12017         if test "$cf_cv_shlib_version" = rel; then
12018                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12019         else
12020                 cf_cv_shared_soname='`basename $@`'
12021         fi
12022
12023                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12024                 ;;
12025         (nskJ*)
12026                 CC_SHARED_OPTS=
12027                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12028                 ;;
12029         (nskL*)
12030                 CC_SHARED_OPTS=
12031                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12032                 ;;
12033         (nto-qnx*|openbsd*|freebsd[12].*)
12034                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12035                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12036                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12037                 ;;
12038         (dragonfly*|freebsd*)
12039                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12040                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12041                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12042                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12043                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12044                 fi
12045
12046         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12047         if test "$cf_cv_shlib_version" = rel; then
12048                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12049         else
12050                 cf_cv_shared_soname='`basename $@`'
12051         fi
12052
12053                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12054                 ;;
12055         (netbsd*)
12056                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12057                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12058                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12059                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12060                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12061                         if test "$cf_cv_shlib_version" = auto; then
12062                         if test -f /usr/libexec/ld.elf_so; then
12063                                 cf_cv_shlib_version=abi
12064                         else
12065                                 cf_cv_shlib_version=rel
12066                         fi
12067                         fi
12068
12069         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12070         if test "$cf_cv_shlib_version" = rel; then
12071                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12072         else
12073                 cf_cv_shared_soname='`basename $@`'
12074         fi
12075
12076                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12077                 else
12078                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12079                 fi
12080                 ;;
12081         (osf*|mls+*)
12082                 # tested with OSF/1 V3.2 and 'cc'
12083                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12084                 # link with shared libs).
12085                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12086                 case "$host_os" in
12087                 (osf4*)
12088                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12089                         ;;
12090                 esac
12091                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12092                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12093                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12094                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12095                 fi
12096                 cf_cv_rm_so_locs=yes
12097                 ;;
12098         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12099                 # tested with osr5.0.5
12100                 if test "$GCC" != yes; then
12101                         CC_SHARED_OPTS='-belf -KPIC'
12102                 fi
12103                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12104                 if test "$cf_cv_enable_rpath" = yes ; then
12105                         # only way is to set LD_RUN_PATH but no switch for it
12106                         RUN_PATH=$libdir
12107                 fi
12108                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12109                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12110                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12111                 ;;
12112         (sunos4*)
12113                 # tested with SunOS 4.1.1 and gcc 2.7.0
12114                 if test "$GCC" != yes; then
12115                         CC_SHARED_OPTS='-KPIC'
12116                 fi
12117                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12118                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12119                 ;;
12120         (solaris2*)
12121                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12122                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12123                 if test "$DFT_LWR_MODEL" = "shared" ; then
12124                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12125                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12126                 fi
12127                 if test "$cf_cv_enable_rpath" = yes ; then
12128                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12129                 fi
12130
12131         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12132         if test "$cf_cv_shlib_version" = rel; then
12133                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12134         else
12135                 cf_cv_shared_soname='`basename $@`'
12136         fi
12137
12138                 if test "$GCC" != yes; then
12139                         cf_save_CFLAGS="$CFLAGS"
12140                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12141                         do
12142                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12143                                 cat >"conftest.$ac_ext" <<_ACEOF
12144 #line 12144 "configure"
12145 #include "confdefs.h"
12146 #include <stdio.h>
12147 int
12148 main (void)
12149 {
12150 printf("Hello\\n");
12151   ;
12152   return 0;
12153 }
12154 _ACEOF
12155 rm -f "conftest.$ac_objext"
12156 if { (eval echo "$as_me:12156: \"$ac_compile\"") >&5
12157   (eval $ac_compile) 2>&5
12158   ac_status=$?
12159   echo "$as_me:12159: \$? = $ac_status" >&5
12160   (exit "$ac_status"); } &&
12161          { ac_try='test -s "conftest.$ac_objext"'
12162   { (eval echo "$as_me:12162: \"$ac_try\"") >&5
12163   (eval $ac_try) 2>&5
12164   ac_status=$?
12165   echo "$as_me:12165: \$? = $ac_status" >&5
12166   (exit "$ac_status"); }; }; then
12167   break
12168 else
12169   echo "$as_me: failed program was:" >&5
12170 cat "conftest.$ac_ext" >&5
12171 fi
12172 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12173                         done
12174                         CFLAGS="$cf_save_CFLAGS"
12175                         CC_SHARED_OPTS=$cf_shared_opts
12176                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12177                 else
12178                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12179                 fi
12180                 ;;
12181         (sysv5uw7*|unix_sv*)
12182                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12183                 if test "$GCC" != yes; then
12184                         CC_SHARED_OPTS='-KPIC'
12185                 fi
12186                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12187                 ;;
12188         (*)
12189                 CC_SHARED_OPTS='unknown'
12190                 MK_SHARED_LIB='echo unknown'
12191                 ;;
12192         esac
12193
12194         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12195         case "$cf_cv_shlib_version" in
12196         (rel|abi)
12197                 case "$MK_SHARED_LIB" in
12198                 (*'-o $@')
12199                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12200                         ;;
12201                 (*)
12202                         { echo "$as_me:12202: WARNING: ignored --with-shlib-version" >&5
12203 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12204                         ;;
12205                 esac
12206                 ;;
12207         esac
12208
12209         if test -n "$cf_try_cflags"
12210         then
12211 cat > conftest.$ac_ext <<EOF
12212 #line 12212 "${as_me:-configure}"
12213 #include <stdio.h>
12214 int main(int argc, char *argv[])
12215 {
12216         printf("hello\\n");
12217         return (argv[argc-1] == 0) ;
12218 }
12219 EOF
12220                 cf_save_CFLAGS="$CFLAGS"
12221                 for cf_opt in $cf_try_cflags
12222                 do
12223                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12224                         echo "$as_me:12224: checking if CFLAGS option -$cf_opt works" >&5
12225 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12226                         if { (eval echo "$as_me:12226: \"$ac_compile\"") >&5
12227   (eval $ac_compile) 2>&5
12228   ac_status=$?
12229   echo "$as_me:12229: \$? = $ac_status" >&5
12230   (exit "$ac_status"); }; then
12231                                 echo "$as_me:12231: result: yes" >&5
12232 echo "${ECHO_T}yes" >&6
12233                                 cf_save_CFLAGS="$CFLAGS"
12234                         else
12235                                 echo "$as_me:12235: result: no" >&5
12236 echo "${ECHO_T}no" >&6
12237                         fi
12238                 done
12239                 CFLAGS="$cf_save_CFLAGS"
12240         fi
12241
12242         # RPATH_LIST is a colon-separated list of directories
12243         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12244         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12245
12246         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12247
12248         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12249
12250 echo "${as_me:-configure}:12250: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12251
12252         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12253
12254 echo "${as_me:-configure}:12254: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12255
12256 # The test/sample programs in the original tree link using rpath option.
12257 # Make it optional for packagers.
12258 if test -n "$LOCAL_LDFLAGS"
12259 then
12260         echo "$as_me:12260: checking if you want to link sample programs with rpath option" >&5
12261 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12262
12263 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12264 if test "${enable_rpath_link+set}" = set; then
12265   enableval="$enable_rpath_link"
12266   with_rpath_link=$enableval
12267 else
12268   with_rpath_link=yes
12269 fi;
12270         echo "$as_me:12270: result: $with_rpath_link" >&5
12271 echo "${ECHO_T}$with_rpath_link" >&6
12272         if test "$with_rpath_link" = no
12273         then
12274                 LOCAL_LDFLAGS=
12275                 LOCAL_LDFLAGS2=
12276         fi
12277 fi
12278
12279 ###############################################################################
12280
12281 ###   use option --enable-broken-linker to force on use of broken-linker support
12282
12283 echo "$as_me:12283: checking if you want broken-linker support code" >&5
12284 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12285
12286 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12287 if test "${enable_broken_linker+set}" = set; then
12288   enableval="$enable_broken_linker"
12289   with_broken_linker=$enableval
12290 else
12291   with_broken_linker=no
12292 fi;
12293 echo "$as_me:12293: result: $with_broken_linker" >&5
12294 echo "${ECHO_T}$with_broken_linker" >&6
12295
12296 : "${BROKEN_LINKER:=0}"
12297 if test "x$with_broken_linker" = xyes ; then
12298
12299 cat >>confdefs.h <<\EOF
12300 #define BROKEN_LINKER 1
12301 EOF
12302
12303         BROKEN_LINKER=1
12304 fi
12305
12306 # Check to define _XOPEN_SOURCE "automatically"
12307
12308 echo "$as_me:12308: checking if the POSIX test-macros are already defined" >&5
12309 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12310 if test "${cf_cv_posix_visible+set}" = set; then
12311   echo $ECHO_N "(cached) $ECHO_C" >&6
12312 else
12313
12314 cat >"conftest.$ac_ext" <<_ACEOF
12315 #line 12315 "configure"
12316 #include "confdefs.h"
12317 #include <stdio.h>
12318 int
12319 main (void)
12320 {
12321
12322 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12323         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12324         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12325         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12326 #error conflicting symbols found
12327 #endif
12328
12329   ;
12330   return 0;
12331 }
12332 _ACEOF
12333 rm -f "conftest.$ac_objext"
12334 if { (eval echo "$as_me:12334: \"$ac_compile\"") >&5
12335   (eval $ac_compile) 2>&5
12336   ac_status=$?
12337   echo "$as_me:12337: \$? = $ac_status" >&5
12338   (exit "$ac_status"); } &&
12339          { ac_try='test -s "conftest.$ac_objext"'
12340   { (eval echo "$as_me:12340: \"$ac_try\"") >&5
12341   (eval $ac_try) 2>&5
12342   ac_status=$?
12343   echo "$as_me:12343: \$? = $ac_status" >&5
12344   (exit "$ac_status"); }; }; then
12345   cf_cv_posix_visible=no
12346 else
12347   echo "$as_me: failed program was:" >&5
12348 cat "conftest.$ac_ext" >&5
12349 cf_cv_posix_visible=yes
12350 fi
12351 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12352
12353 fi
12354 echo "$as_me:12354: result: $cf_cv_posix_visible" >&5
12355 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12356
12357 if test "$cf_cv_posix_visible" = no; then
12358
12359 cf_XOPEN_SOURCE=600
12360 cf_POSIX_C_SOURCE=199506L
12361 cf_xopen_source=
12362
12363 case "$host_os" in
12364 (aix[4-7]*)
12365         cf_xopen_source="-D_ALL_SOURCE"
12366         ;;
12367 (msys)
12368         cf_XOPEN_SOURCE=600
12369         ;;
12370 (darwin[0-8].*)
12371         cf_xopen_source="-D_APPLE_C_SOURCE"
12372         ;;
12373 (darwin*)
12374         cf_xopen_source="-D_DARWIN_C_SOURCE"
12375         cf_XOPEN_SOURCE=
12376         ;;
12377 (freebsd*|dragonfly*|midnightbsd*)
12378         # 5.x headers associate
12379         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12380         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12381         cf_POSIX_C_SOURCE=200112L
12382         cf_XOPEN_SOURCE=600
12383         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12384         ;;
12385 (hpux11*)
12386         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12387         ;;
12388 (hpux*)
12389         cf_xopen_source="-D_HPUX_SOURCE"
12390         ;;
12391 (irix[56].*)
12392         cf_xopen_source="-D_SGI_SOURCE"
12393         cf_XOPEN_SOURCE=
12394         ;;
12395 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12396
12397 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12398
12399 echo "$as_me:12399: checking if this is the GNU C library" >&5
12400 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12401 if test "${cf_cv_gnu_library+set}" = set; then
12402   echo $ECHO_N "(cached) $ECHO_C" >&6
12403 else
12404
12405 cat >"conftest.$ac_ext" <<_ACEOF
12406 #line 12406 "configure"
12407 #include "confdefs.h"
12408 #include <sys/types.h>
12409 int
12410 main (void)
12411 {
12412
12413         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12414                 return 0;
12415         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12416                 return 0;
12417         #else
12418         #       error not GNU C library
12419         #endif
12420   ;
12421   return 0;
12422 }
12423 _ACEOF
12424 rm -f "conftest.$ac_objext"
12425 if { (eval echo "$as_me:12425: \"$ac_compile\"") >&5
12426   (eval $ac_compile) 2>&5
12427   ac_status=$?
12428   echo "$as_me:12428: \$? = $ac_status" >&5
12429   (exit "$ac_status"); } &&
12430          { ac_try='test -s "conftest.$ac_objext"'
12431   { (eval echo "$as_me:12431: \"$ac_try\"") >&5
12432   (eval $ac_try) 2>&5
12433   ac_status=$?
12434   echo "$as_me:12434: \$? = $ac_status" >&5
12435   (exit "$ac_status"); }; }; then
12436   cf_cv_gnu_library=yes
12437 else
12438   echo "$as_me: failed program was:" >&5
12439 cat "conftest.$ac_ext" >&5
12440 cf_cv_gnu_library=no
12441 fi
12442 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12443
12444 fi
12445 echo "$as_me:12445: result: $cf_cv_gnu_library" >&5
12446 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12447
12448 if test x$cf_cv_gnu_library = xyes; then
12449
12450         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12451         # was changed to help a little.  newlib incorporated the change about 4
12452         # years later.
12453         echo "$as_me:12453: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12454 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12455 if test "${cf_cv_gnu_library_219+set}" = set; then
12456   echo $ECHO_N "(cached) $ECHO_C" >&6
12457 else
12458
12459                 cf_save="$CPPFLAGS"
12460
12461         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12462         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12463
12464                 cat >"conftest.$ac_ext" <<_ACEOF
12465 #line 12465 "configure"
12466 #include "confdefs.h"
12467 #include <sys/types.h>
12468 int
12469 main (void)
12470 {
12471
12472                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12473                                 return 0;
12474                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12475                                 return 0;
12476                         #else
12477                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12478                         #endif
12479   ;
12480   return 0;
12481 }
12482 _ACEOF
12483 rm -f "conftest.$ac_objext"
12484 if { (eval echo "$as_me:12484: \"$ac_compile\"") >&5
12485   (eval $ac_compile) 2>&5
12486   ac_status=$?
12487   echo "$as_me:12487: \$? = $ac_status" >&5
12488   (exit "$ac_status"); } &&
12489          { ac_try='test -s "conftest.$ac_objext"'
12490   { (eval echo "$as_me:12490: \"$ac_try\"") >&5
12491   (eval $ac_try) 2>&5
12492   ac_status=$?
12493   echo "$as_me:12493: \$? = $ac_status" >&5
12494   (exit "$ac_status"); }; }; then
12495   cf_cv_gnu_library_219=yes
12496 else
12497   echo "$as_me: failed program was:" >&5
12498 cat "conftest.$ac_ext" >&5
12499 cf_cv_gnu_library_219=no
12500 fi
12501 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12502                 CPPFLAGS="$cf_save"
12503
12504 fi
12505 echo "$as_me:12505: result: $cf_cv_gnu_library_219" >&5
12506 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12507
12508         if test "x$cf_cv_gnu_library_219" = xyes; then
12509                 cf_save="$CPPFLAGS"
12510                 echo "$as_me:12510: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12511 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12512 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12513   echo $ECHO_N "(cached) $ECHO_C" >&6
12514 else
12515
12516 cf_fix_cppflags=no
12517 cf_new_cflags=
12518 cf_new_cppflags=
12519 cf_new_extra_cppflags=
12520
12521 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12522 do
12523 case "$cf_fix_cppflags" in
12524 (no)
12525         case "$cf_add_cflags" in
12526         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12527                 case "$cf_add_cflags" in
12528                 (-D*)
12529                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12530
12531                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12532                                 && test -z "${cf_tst_cflags}" \
12533                                 && cf_fix_cppflags=yes
12534
12535                         if test "$cf_fix_cppflags" = yes ; then
12536
12537         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12538         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12539
12540                                 continue
12541                         elif test "${cf_tst_cflags}" = "\"'" ; then
12542
12543         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12544         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12545
12546                                 continue
12547                         fi
12548                         ;;
12549                 esac
12550                 case "$CPPFLAGS" in
12551                 (*$cf_add_cflags)
12552                         ;;
12553                 (*)
12554                         case "$cf_add_cflags" in
12555                         (-D*)
12556                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12557
12558 CPPFLAGS=`echo "$CPPFLAGS" | \
12559         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12560                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12561
12562                                 ;;
12563                         esac
12564
12565         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12566         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12567
12568                         ;;
12569                 esac
12570                 ;;
12571         (*)
12572
12573         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12574         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12575
12576                 ;;
12577         esac
12578         ;;
12579 (yes)
12580
12581         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12582         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12583
12584         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12585
12586         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12587                 && test -z "${cf_tst_cflags}" \
12588                 && cf_fix_cppflags=no
12589         ;;
12590 esac
12591 done
12592
12593 if test -n "$cf_new_cflags" ; then
12594
12595         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12596         CFLAGS="${CFLAGS}$cf_new_cflags"
12597
12598 fi
12599
12600 if test -n "$cf_new_cppflags" ; then
12601
12602         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12603         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12604
12605 fi
12606
12607 if test -n "$cf_new_extra_cppflags" ; then
12608
12609         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12610         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12611
12612 fi
12613
12614                         cat >"conftest.$ac_ext" <<_ACEOF
12615 #line 12615 "configure"
12616 #include "confdefs.h"
12617
12618                                 #include <limits.h>
12619                                 #include <sys/types.h>
12620
12621 int
12622 main (void)
12623 {
12624
12625                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12626                                         return 0;
12627                                 #else
12628                                 #       error GNU C library is too old
12629                                 #endif
12630   ;
12631   return 0;
12632 }
12633 _ACEOF
12634 rm -f "conftest.$ac_objext"
12635 if { (eval echo "$as_me:12635: \"$ac_compile\"") >&5
12636   (eval $ac_compile) 2>&5
12637   ac_status=$?
12638   echo "$as_me:12638: \$? = $ac_status" >&5
12639   (exit "$ac_status"); } &&
12640          { ac_try='test -s "conftest.$ac_objext"'
12641   { (eval echo "$as_me:12641: \"$ac_try\"") >&5
12642   (eval $ac_try) 2>&5
12643   ac_status=$?
12644   echo "$as_me:12644: \$? = $ac_status" >&5
12645   (exit "$ac_status"); }; }; then
12646   cf_cv_gnu_dftsrc_219=yes
12647 else
12648   echo "$as_me: failed program was:" >&5
12649 cat "conftest.$ac_ext" >&5
12650 cf_cv_gnu_dftsrc_219=no
12651 fi
12652 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12653
12654 fi
12655 echo "$as_me:12655: result: $cf_cv_gnu_dftsrc_219" >&5
12656 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12657                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12658         else
12659                 cf_cv_gnu_dftsrc_219=maybe
12660         fi
12661
12662         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12663
12664                 echo "$as_me:12664: checking if we must define _GNU_SOURCE" >&5
12665 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12666 if test "${cf_cv_gnu_source+set}" = set; then
12667   echo $ECHO_N "(cached) $ECHO_C" >&6
12668 else
12669
12670                 cat >"conftest.$ac_ext" <<_ACEOF
12671 #line 12671 "configure"
12672 #include "confdefs.h"
12673 #include <sys/types.h>
12674 int
12675 main (void)
12676 {
12677
12678                         #ifndef _XOPEN_SOURCE
12679                         #error  expected _XOPEN_SOURCE to be defined
12680                         #endif
12681   ;
12682   return 0;
12683 }
12684 _ACEOF
12685 rm -f "conftest.$ac_objext"
12686 if { (eval echo "$as_me:12686: \"$ac_compile\"") >&5
12687   (eval $ac_compile) 2>&5
12688   ac_status=$?
12689   echo "$as_me:12689: \$? = $ac_status" >&5
12690   (exit "$ac_status"); } &&
12691          { ac_try='test -s "conftest.$ac_objext"'
12692   { (eval echo "$as_me:12692: \"$ac_try\"") >&5
12693   (eval $ac_try) 2>&5
12694   ac_status=$?
12695   echo "$as_me:12695: \$? = $ac_status" >&5
12696   (exit "$ac_status"); }; }; then
12697   cf_cv_gnu_source=no
12698 else
12699   echo "$as_me: failed program was:" >&5
12700 cat "conftest.$ac_ext" >&5
12701 cf_save="$CPPFLAGS"
12702
12703 cf_fix_cppflags=no
12704 cf_new_cflags=
12705 cf_new_cppflags=
12706 cf_new_extra_cppflags=
12707
12708 for cf_add_cflags in -D_GNU_SOURCE
12709 do
12710 case "$cf_fix_cppflags" in
12711 (no)
12712         case "$cf_add_cflags" in
12713         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12714                 case "$cf_add_cflags" in
12715                 (-D*)
12716                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12717
12718                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12719                                 && test -z "${cf_tst_cflags}" \
12720                                 && cf_fix_cppflags=yes
12721
12722                         if test "$cf_fix_cppflags" = yes ; then
12723
12724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12726
12727                                 continue
12728                         elif test "${cf_tst_cflags}" = "\"'" ; then
12729
12730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12732
12733                                 continue
12734                         fi
12735                         ;;
12736                 esac
12737                 case "$CPPFLAGS" in
12738                 (*$cf_add_cflags)
12739                         ;;
12740                 (*)
12741                         case "$cf_add_cflags" in
12742                         (-D*)
12743                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12744
12745 CPPFLAGS=`echo "$CPPFLAGS" | \
12746         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12747                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12748
12749                                 ;;
12750                         esac
12751
12752         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12753         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12754
12755                         ;;
12756                 esac
12757                 ;;
12758         (*)
12759
12760         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12761         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12762
12763                 ;;
12764         esac
12765         ;;
12766 (yes)
12767
12768         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12769         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12770
12771         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12772
12773         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12774                 && test -z "${cf_tst_cflags}" \
12775                 && cf_fix_cppflags=no
12776         ;;
12777 esac
12778 done
12779
12780 if test -n "$cf_new_cflags" ; then
12781
12782         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12783         CFLAGS="${CFLAGS}$cf_new_cflags"
12784
12785 fi
12786
12787 if test -n "$cf_new_cppflags" ; then
12788
12789         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12790         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12791
12792 fi
12793
12794 if test -n "$cf_new_extra_cppflags" ; then
12795
12796         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12797         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12798
12799 fi
12800
12801                          cat >"conftest.$ac_ext" <<_ACEOF
12802 #line 12802 "configure"
12803 #include "confdefs.h"
12804 #include <sys/types.h>
12805 int
12806 main (void)
12807 {
12808
12809                                 #ifdef _XOPEN_SOURCE
12810                                 #error  expected _XOPEN_SOURCE to be undefined
12811                                 #endif
12812   ;
12813   return 0;
12814 }
12815 _ACEOF
12816 rm -f "conftest.$ac_objext"
12817 if { (eval echo "$as_me:12817: \"$ac_compile\"") >&5
12818   (eval $ac_compile) 2>&5
12819   ac_status=$?
12820   echo "$as_me:12820: \$? = $ac_status" >&5
12821   (exit "$ac_status"); } &&
12822          { ac_try='test -s "conftest.$ac_objext"'
12823   { (eval echo "$as_me:12823: \"$ac_try\"") >&5
12824   (eval $ac_try) 2>&5
12825   ac_status=$?
12826   echo "$as_me:12826: \$? = $ac_status" >&5
12827   (exit "$ac_status"); }; }; then
12828   cf_cv_gnu_source=no
12829 else
12830   echo "$as_me: failed program was:" >&5
12831 cat "conftest.$ac_ext" >&5
12832 cf_cv_gnu_source=yes
12833 fi
12834 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12835                         CPPFLAGS="$cf_save"
12836
12837 fi
12838 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12839
12840 fi
12841 echo "$as_me:12841: result: $cf_cv_gnu_source" >&5
12842 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12843
12844                 if test "$cf_cv_gnu_source" = yes
12845                 then
12846                 echo "$as_me:12846: checking if we should also define _DEFAULT_SOURCE" >&5
12847 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12848 if test "${cf_cv_default_source+set}" = set; then
12849   echo $ECHO_N "(cached) $ECHO_C" >&6
12850 else
12851
12852         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12853         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12854
12855                         cat >"conftest.$ac_ext" <<_ACEOF
12856 #line 12856 "configure"
12857 #include "confdefs.h"
12858 #include <sys/types.h>
12859 int
12860 main (void)
12861 {
12862
12863                                 #ifdef _DEFAULT_SOURCE
12864                                 #error  expected _DEFAULT_SOURCE to be undefined
12865                                 #endif
12866   ;
12867   return 0;
12868 }
12869 _ACEOF
12870 rm -f "conftest.$ac_objext"
12871 if { (eval echo "$as_me:12871: \"$ac_compile\"") >&5
12872   (eval $ac_compile) 2>&5
12873   ac_status=$?
12874   echo "$as_me:12874: \$? = $ac_status" >&5
12875   (exit "$ac_status"); } &&
12876          { ac_try='test -s "conftest.$ac_objext"'
12877   { (eval echo "$as_me:12877: \"$ac_try\"") >&5
12878   (eval $ac_try) 2>&5
12879   ac_status=$?
12880   echo "$as_me:12880: \$? = $ac_status" >&5
12881   (exit "$ac_status"); }; }; then
12882   cf_cv_default_source=no
12883 else
12884   echo "$as_me: failed program was:" >&5
12885 cat "conftest.$ac_ext" >&5
12886 cf_cv_default_source=yes
12887 fi
12888 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12889
12890 fi
12891 echo "$as_me:12891: result: $cf_cv_default_source" >&5
12892 echo "${ECHO_T}$cf_cv_default_source" >&6
12893                         if test "$cf_cv_default_source" = yes
12894                         then
12895
12896         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12897         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12898
12899                         fi
12900                 fi
12901         fi
12902
12903 fi
12904
12905         ;;
12906 (minix*)
12907         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12908         ;;
12909 (mirbsd*)
12910         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12911         cf_XOPEN_SOURCE=
12912
12913 if test "$cf_cv_posix_visible" = no; then
12914
12915 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12916
12917 cf_save_CFLAGS="$CFLAGS"
12918 cf_save_CPPFLAGS="$CPPFLAGS"
12919
12920 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12921         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12922                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12923
12924 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12925         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12926                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12927
12928 echo "$as_me:12928: checking if we should define _POSIX_C_SOURCE" >&5
12929 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12930 if test "${cf_cv_posix_c_source+set}" = set; then
12931   echo $ECHO_N "(cached) $ECHO_C" >&6
12932 else
12933
12934 echo "${as_me:-configure}:12934: testing if the symbol is already defined go no further ..." 1>&5
12935
12936         cat >"conftest.$ac_ext" <<_ACEOF
12937 #line 12937 "configure"
12938 #include "confdefs.h"
12939 #include <sys/types.h>
12940 int
12941 main (void)
12942 {
12943
12944 #ifndef _POSIX_C_SOURCE
12945 make an error
12946 #endif
12947   ;
12948   return 0;
12949 }
12950 _ACEOF
12951 rm -f "conftest.$ac_objext"
12952 if { (eval echo "$as_me:12952: \"$ac_compile\"") >&5
12953   (eval $ac_compile) 2>&5
12954   ac_status=$?
12955   echo "$as_me:12955: \$? = $ac_status" >&5
12956   (exit "$ac_status"); } &&
12957          { ac_try='test -s "conftest.$ac_objext"'
12958   { (eval echo "$as_me:12958: \"$ac_try\"") >&5
12959   (eval $ac_try) 2>&5
12960   ac_status=$?
12961   echo "$as_me:12961: \$? = $ac_status" >&5
12962   (exit "$ac_status"); }; }; then
12963   cf_cv_posix_c_source=no
12964 else
12965   echo "$as_me: failed program was:" >&5
12966 cat "conftest.$ac_ext" >&5
12967 cf_want_posix_source=no
12968          case .$cf_POSIX_C_SOURCE in
12969          (.[12]??*)
12970                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12971                 ;;
12972          (.2)
12973                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12974                 cf_want_posix_source=yes
12975                 ;;
12976          (.*)
12977                 cf_want_posix_source=yes
12978                 ;;
12979          esac
12980          if test "$cf_want_posix_source" = yes ; then
12981                 cat >"conftest.$ac_ext" <<_ACEOF
12982 #line 12982 "configure"
12983 #include "confdefs.h"
12984 #include <sys/types.h>
12985 int
12986 main (void)
12987 {
12988
12989 #ifdef _POSIX_SOURCE
12990 make an error
12991 #endif
12992   ;
12993   return 0;
12994 }
12995 _ACEOF
12996 rm -f "conftest.$ac_objext"
12997 if { (eval echo "$as_me:12997: \"$ac_compile\"") >&5
12998   (eval $ac_compile) 2>&5
12999   ac_status=$?
13000   echo "$as_me:13000: \$? = $ac_status" >&5
13001   (exit "$ac_status"); } &&
13002          { ac_try='test -s "conftest.$ac_objext"'
13003   { (eval echo "$as_me:13003: \"$ac_try\"") >&5
13004   (eval $ac_try) 2>&5
13005   ac_status=$?
13006   echo "$as_me:13006: \$? = $ac_status" >&5
13007   (exit "$ac_status"); }; }; then
13008   :
13009 else
13010   echo "$as_me: failed program was:" >&5
13011 cat "conftest.$ac_ext" >&5
13012 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13013 fi
13014 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13015          fi
13016
13017 echo "${as_me:-configure}:13017: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13018
13019          CFLAGS="$cf_trim_CFLAGS"
13020          CPPFLAGS="$cf_trim_CPPFLAGS"
13021
13022         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13023         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13024
13025 echo "${as_me:-configure}:13025: testing if the second compile does not leave our definition intact error ..." 1>&5
13026
13027          cat >"conftest.$ac_ext" <<_ACEOF
13028 #line 13028 "configure"
13029 #include "confdefs.h"
13030 #include <sys/types.h>
13031 int
13032 main (void)
13033 {
13034
13035 #ifndef _POSIX_C_SOURCE
13036 make an error
13037 #endif
13038   ;
13039   return 0;
13040 }
13041 _ACEOF
13042 rm -f "conftest.$ac_objext"
13043 if { (eval echo "$as_me:13043: \"$ac_compile\"") >&5
13044   (eval $ac_compile) 2>&5
13045   ac_status=$?
13046   echo "$as_me:13046: \$? = $ac_status" >&5
13047   (exit "$ac_status"); } &&
13048          { ac_try='test -s "conftest.$ac_objext"'
13049   { (eval echo "$as_me:13049: \"$ac_try\"") >&5
13050   (eval $ac_try) 2>&5
13051   ac_status=$?
13052   echo "$as_me:13052: \$? = $ac_status" >&5
13053   (exit "$ac_status"); }; }; then
13054   :
13055 else
13056   echo "$as_me: failed program was:" >&5
13057 cat "conftest.$ac_ext" >&5
13058 cf_cv_posix_c_source=no
13059 fi
13060 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13061          CFLAGS="$cf_save_CFLAGS"
13062          CPPFLAGS="$cf_save_CPPFLAGS"
13063
13064 fi
13065 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13066
13067 fi
13068 echo "$as_me:13068: result: $cf_cv_posix_c_source" >&5
13069 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13070
13071 if test "$cf_cv_posix_c_source" != no ; then
13072         CFLAGS="$cf_trim_CFLAGS"
13073         CPPFLAGS="$cf_trim_CPPFLAGS"
13074
13075 cf_fix_cppflags=no
13076 cf_new_cflags=
13077 cf_new_cppflags=
13078 cf_new_extra_cppflags=
13079
13080 for cf_add_cflags in $cf_cv_posix_c_source
13081 do
13082 case "$cf_fix_cppflags" in
13083 (no)
13084         case "$cf_add_cflags" in
13085         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13086                 case "$cf_add_cflags" in
13087                 (-D*)
13088                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13089
13090                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13091                                 && test -z "${cf_tst_cflags}" \
13092                                 && cf_fix_cppflags=yes
13093
13094                         if test "$cf_fix_cppflags" = yes ; then
13095
13096         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13097         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13098
13099                                 continue
13100                         elif test "${cf_tst_cflags}" = "\"'" ; then
13101
13102         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13103         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13104
13105                                 continue
13106                         fi
13107                         ;;
13108                 esac
13109                 case "$CPPFLAGS" in
13110                 (*$cf_add_cflags)
13111                         ;;
13112                 (*)
13113                         case "$cf_add_cflags" in
13114                         (-D*)
13115                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13116
13117 CPPFLAGS=`echo "$CPPFLAGS" | \
13118         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13119                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13120
13121                                 ;;
13122                         esac
13123
13124         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13125         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13126
13127                         ;;
13128                 esac
13129                 ;;
13130         (*)
13131
13132         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13133         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13134
13135                 ;;
13136         esac
13137         ;;
13138 (yes)
13139
13140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13142
13143         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13144
13145         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13146                 && test -z "${cf_tst_cflags}" \
13147                 && cf_fix_cppflags=no
13148         ;;
13149 esac
13150 done
13151
13152 if test -n "$cf_new_cflags" ; then
13153
13154         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13155         CFLAGS="${CFLAGS}$cf_new_cflags"
13156
13157 fi
13158
13159 if test -n "$cf_new_cppflags" ; then
13160
13161         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13162         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13163
13164 fi
13165
13166 if test -n "$cf_new_extra_cppflags" ; then
13167
13168         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13169         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13170
13171 fi
13172
13173 fi
13174
13175 fi # cf_cv_posix_visible
13176
13177         ;;
13178 (netbsd*)
13179         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13180         ;;
13181 (openbsd[6-9]*)
13182         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13183         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13184         # Abusing the conformance level is a workaround.
13185         { echo "$as_me:13185: WARNING: this system does not provide usable locale support" >&5
13186 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13187         cf_xopen_source="-D_BSD_SOURCE"
13188         cf_XOPEN_SOURCE=700
13189         ;;
13190 (openbsd[4-5]*)
13191         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13192         cf_xopen_source="-D_BSD_SOURCE"
13193         cf_XOPEN_SOURCE=600
13194         ;;
13195 (openbsd*)
13196         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13197         ;;
13198 (osf[45]*)
13199         cf_xopen_source="-D_OSF_SOURCE"
13200         ;;
13201 (nto-qnx*)
13202         cf_xopen_source="-D_QNX_SOURCE"
13203         ;;
13204 (sco*)
13205         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13206         ;;
13207 (solaris2.*)
13208         cf_xopen_source="-D__EXTENSIONS__"
13209         cf_cv_xopen_source=broken
13210         ;;
13211 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13212         cf_XOPEN_SOURCE=
13213         cf_POSIX_C_SOURCE=
13214         ;;
13215 (*)
13216
13217 echo "$as_me:13217: checking if we should define _XOPEN_SOURCE" >&5
13218 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13219 if test "${cf_cv_xopen_source+set}" = set; then
13220   echo $ECHO_N "(cached) $ECHO_C" >&6
13221 else
13222
13223         cat >"conftest.$ac_ext" <<_ACEOF
13224 #line 13224 "configure"
13225 #include "confdefs.h"
13226
13227 #include <stdlib.h>
13228 #include <string.h>
13229 #include <sys/types.h>
13230
13231 int
13232 main (void)
13233 {
13234
13235 #ifndef _XOPEN_SOURCE
13236 make an error
13237 #endif
13238   ;
13239   return 0;
13240 }
13241 _ACEOF
13242 rm -f "conftest.$ac_objext"
13243 if { (eval echo "$as_me:13243: \"$ac_compile\"") >&5
13244   (eval $ac_compile) 2>&5
13245   ac_status=$?
13246   echo "$as_me:13246: \$? = $ac_status" >&5
13247   (exit "$ac_status"); } &&
13248          { ac_try='test -s "conftest.$ac_objext"'
13249   { (eval echo "$as_me:13249: \"$ac_try\"") >&5
13250   (eval $ac_try) 2>&5
13251   ac_status=$?
13252   echo "$as_me:13252: \$? = $ac_status" >&5
13253   (exit "$ac_status"); }; }; then
13254   cf_cv_xopen_source=no
13255 else
13256   echo "$as_me: failed program was:" >&5
13257 cat "conftest.$ac_ext" >&5
13258 cf_save="$CPPFLAGS"
13259
13260         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13261         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13262
13263          cat >"conftest.$ac_ext" <<_ACEOF
13264 #line 13264 "configure"
13265 #include "confdefs.h"
13266
13267 #include <stdlib.h>
13268 #include <string.h>
13269 #include <sys/types.h>
13270
13271 int
13272 main (void)
13273 {
13274
13275 #ifdef _XOPEN_SOURCE
13276 make an error
13277 #endif
13278   ;
13279   return 0;
13280 }
13281 _ACEOF
13282 rm -f "conftest.$ac_objext"
13283 if { (eval echo "$as_me:13283: \"$ac_compile\"") >&5
13284   (eval $ac_compile) 2>&5
13285   ac_status=$?
13286   echo "$as_me:13286: \$? = $ac_status" >&5
13287   (exit "$ac_status"); } &&
13288          { ac_try='test -s "conftest.$ac_objext"'
13289   { (eval echo "$as_me:13289: \"$ac_try\"") >&5
13290   (eval $ac_try) 2>&5
13291   ac_status=$?
13292   echo "$as_me:13292: \$? = $ac_status" >&5
13293   (exit "$ac_status"); }; }; then
13294   cf_cv_xopen_source=no
13295 else
13296   echo "$as_me: failed program was:" >&5
13297 cat "conftest.$ac_ext" >&5
13298 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13299 fi
13300 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13301         CPPFLAGS="$cf_save"
13302
13303 fi
13304 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13305
13306 fi
13307 echo "$as_me:13307: result: $cf_cv_xopen_source" >&5
13308 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13309
13310 if test "$cf_cv_xopen_source" != no ; then
13311
13312 CFLAGS=`echo "$CFLAGS" | \
13313         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13314                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13315
13316 CPPFLAGS=`echo "$CPPFLAGS" | \
13317         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13318                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13319
13320         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13321
13322 for cf_add_cflags in $cf_temp_xopen_source
13323 do
13324         case "x$cf_add_cflags" in
13325         (x-[DU]*)
13326
13327 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13328 while true
13329 do
13330         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'`
13331         test "$CFLAGS" != "$cf_old_cflag" || break
13332
13333         CFLAGS="$cf_old_cflag"
13334 done
13335
13336 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13337 while true
13338 do
13339         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'`
13340         test "$CPPFLAGS" != "$cf_old_cflag" || break
13341
13342         CPPFLAGS="$cf_old_cflag"
13343 done
13344
13345                 ;;
13346         esac
13347
13348 cf_fix_cppflags=no
13349 cf_new_cflags=
13350 cf_new_cppflags=
13351 cf_new_extra_cppflags=
13352
13353 for cf_add_cflags in $cf_add_cflags
13354 do
13355 case "$cf_fix_cppflags" in
13356 (no)
13357         case "$cf_add_cflags" in
13358         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13359                 case "$cf_add_cflags" in
13360                 (-D*)
13361                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13362
13363                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13364                                 && test -z "${cf_tst_cflags}" \
13365                                 && cf_fix_cppflags=yes
13366
13367                         if test "$cf_fix_cppflags" = yes ; then
13368
13369         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13370         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13371
13372                                 continue
13373                         elif test "${cf_tst_cflags}" = "\"'" ; then
13374
13375         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13376         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13377
13378                                 continue
13379                         fi
13380                         ;;
13381                 esac
13382                 case "$CPPFLAGS" in
13383                 (*$cf_add_cflags)
13384                         ;;
13385                 (*)
13386                         case "$cf_add_cflags" in
13387                         (-D*)
13388                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13389
13390 CPPFLAGS=`echo "$CPPFLAGS" | \
13391         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13392                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13393
13394                                 ;;
13395                         esac
13396
13397         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13398         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13399
13400                         ;;
13401                 esac
13402                 ;;
13403         (*)
13404
13405         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13406         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13407
13408                 ;;
13409         esac
13410         ;;
13411 (yes)
13412
13413         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13414         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13415
13416         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13417
13418         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13419                 && test -z "${cf_tst_cflags}" \
13420                 && cf_fix_cppflags=no
13421         ;;
13422 esac
13423 done
13424
13425 if test -n "$cf_new_cflags" ; then
13426
13427         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13428         CFLAGS="${CFLAGS}$cf_new_cflags"
13429
13430 fi
13431
13432 if test -n "$cf_new_cppflags" ; then
13433
13434         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13435         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13436
13437 fi
13438
13439 if test -n "$cf_new_extra_cppflags" ; then
13440
13441         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13442         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13443
13444 fi
13445
13446 done
13447
13448 fi
13449
13450 if test "$cf_cv_posix_visible" = no; then
13451
13452 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13453
13454 cf_save_CFLAGS="$CFLAGS"
13455 cf_save_CPPFLAGS="$CPPFLAGS"
13456
13457 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13458         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13459                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13460
13461 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13462         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13463                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13464
13465 echo "$as_me:13465: checking if we should define _POSIX_C_SOURCE" >&5
13466 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13467 if test "${cf_cv_posix_c_source+set}" = set; then
13468   echo $ECHO_N "(cached) $ECHO_C" >&6
13469 else
13470
13471 echo "${as_me:-configure}:13471: testing if the symbol is already defined go no further ..." 1>&5
13472
13473         cat >"conftest.$ac_ext" <<_ACEOF
13474 #line 13474 "configure"
13475 #include "confdefs.h"
13476 #include <sys/types.h>
13477 int
13478 main (void)
13479 {
13480
13481 #ifndef _POSIX_C_SOURCE
13482 make an error
13483 #endif
13484   ;
13485   return 0;
13486 }
13487 _ACEOF
13488 rm -f "conftest.$ac_objext"
13489 if { (eval echo "$as_me:13489: \"$ac_compile\"") >&5
13490   (eval $ac_compile) 2>&5
13491   ac_status=$?
13492   echo "$as_me:13492: \$? = $ac_status" >&5
13493   (exit "$ac_status"); } &&
13494          { ac_try='test -s "conftest.$ac_objext"'
13495   { (eval echo "$as_me:13495: \"$ac_try\"") >&5
13496   (eval $ac_try) 2>&5
13497   ac_status=$?
13498   echo "$as_me:13498: \$? = $ac_status" >&5
13499   (exit "$ac_status"); }; }; then
13500   cf_cv_posix_c_source=no
13501 else
13502   echo "$as_me: failed program was:" >&5
13503 cat "conftest.$ac_ext" >&5
13504 cf_want_posix_source=no
13505          case .$cf_POSIX_C_SOURCE in
13506          (.[12]??*)
13507                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13508                 ;;
13509          (.2)
13510                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13511                 cf_want_posix_source=yes
13512                 ;;
13513          (.*)
13514                 cf_want_posix_source=yes
13515                 ;;
13516          esac
13517          if test "$cf_want_posix_source" = yes ; then
13518                 cat >"conftest.$ac_ext" <<_ACEOF
13519 #line 13519 "configure"
13520 #include "confdefs.h"
13521 #include <sys/types.h>
13522 int
13523 main (void)
13524 {
13525
13526 #ifdef _POSIX_SOURCE
13527 make an error
13528 #endif
13529   ;
13530   return 0;
13531 }
13532 _ACEOF
13533 rm -f "conftest.$ac_objext"
13534 if { (eval echo "$as_me:13534: \"$ac_compile\"") >&5
13535   (eval $ac_compile) 2>&5
13536   ac_status=$?
13537   echo "$as_me:13537: \$? = $ac_status" >&5
13538   (exit "$ac_status"); } &&
13539          { ac_try='test -s "conftest.$ac_objext"'
13540   { (eval echo "$as_me:13540: \"$ac_try\"") >&5
13541   (eval $ac_try) 2>&5
13542   ac_status=$?
13543   echo "$as_me:13543: \$? = $ac_status" >&5
13544   (exit "$ac_status"); }; }; then
13545   :
13546 else
13547   echo "$as_me: failed program was:" >&5
13548 cat "conftest.$ac_ext" >&5
13549 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13550 fi
13551 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13552          fi
13553
13554 echo "${as_me:-configure}:13554: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13555
13556          CFLAGS="$cf_trim_CFLAGS"
13557          CPPFLAGS="$cf_trim_CPPFLAGS"
13558
13559         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13560         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13561
13562 echo "${as_me:-configure}:13562: testing if the second compile does not leave our definition intact error ..." 1>&5
13563
13564          cat >"conftest.$ac_ext" <<_ACEOF
13565 #line 13565 "configure"
13566 #include "confdefs.h"
13567 #include <sys/types.h>
13568 int
13569 main (void)
13570 {
13571
13572 #ifndef _POSIX_C_SOURCE
13573 make an error
13574 #endif
13575   ;
13576   return 0;
13577 }
13578 _ACEOF
13579 rm -f "conftest.$ac_objext"
13580 if { (eval echo "$as_me:13580: \"$ac_compile\"") >&5
13581   (eval $ac_compile) 2>&5
13582   ac_status=$?
13583   echo "$as_me:13583: \$? = $ac_status" >&5
13584   (exit "$ac_status"); } &&
13585          { ac_try='test -s "conftest.$ac_objext"'
13586   { (eval echo "$as_me:13586: \"$ac_try\"") >&5
13587   (eval $ac_try) 2>&5
13588   ac_status=$?
13589   echo "$as_me:13589: \$? = $ac_status" >&5
13590   (exit "$ac_status"); }; }; then
13591   :
13592 else
13593   echo "$as_me: failed program was:" >&5
13594 cat "conftest.$ac_ext" >&5
13595 cf_cv_posix_c_source=no
13596 fi
13597 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13598          CFLAGS="$cf_save_CFLAGS"
13599          CPPFLAGS="$cf_save_CPPFLAGS"
13600
13601 fi
13602 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13603
13604 fi
13605 echo "$as_me:13605: result: $cf_cv_posix_c_source" >&5
13606 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13607
13608 if test "$cf_cv_posix_c_source" != no ; then
13609         CFLAGS="$cf_trim_CFLAGS"
13610         CPPFLAGS="$cf_trim_CPPFLAGS"
13611
13612 cf_fix_cppflags=no
13613 cf_new_cflags=
13614 cf_new_cppflags=
13615 cf_new_extra_cppflags=
13616
13617 for cf_add_cflags in $cf_cv_posix_c_source
13618 do
13619 case "$cf_fix_cppflags" in
13620 (no)
13621         case "$cf_add_cflags" in
13622         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13623                 case "$cf_add_cflags" in
13624                 (-D*)
13625                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13626
13627                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13628                                 && test -z "${cf_tst_cflags}" \
13629                                 && cf_fix_cppflags=yes
13630
13631                         if test "$cf_fix_cppflags" = yes ; then
13632
13633         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13634         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13635
13636                                 continue
13637                         elif test "${cf_tst_cflags}" = "\"'" ; then
13638
13639         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13640         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13641
13642                                 continue
13643                         fi
13644                         ;;
13645                 esac
13646                 case "$CPPFLAGS" in
13647                 (*$cf_add_cflags)
13648                         ;;
13649                 (*)
13650                         case "$cf_add_cflags" in
13651                         (-D*)
13652                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13653
13654 CPPFLAGS=`echo "$CPPFLAGS" | \
13655         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13656                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13657
13658                                 ;;
13659                         esac
13660
13661         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13662         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13663
13664                         ;;
13665                 esac
13666                 ;;
13667         (*)
13668
13669         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13670         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13671
13672                 ;;
13673         esac
13674         ;;
13675 (yes)
13676
13677         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13678         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13679
13680         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13681
13682         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13683                 && test -z "${cf_tst_cflags}" \
13684                 && cf_fix_cppflags=no
13685         ;;
13686 esac
13687 done
13688
13689 if test -n "$cf_new_cflags" ; then
13690
13691         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13692         CFLAGS="${CFLAGS}$cf_new_cflags"
13693
13694 fi
13695
13696 if test -n "$cf_new_cppflags" ; then
13697
13698         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13699         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13700
13701 fi
13702
13703 if test -n "$cf_new_extra_cppflags" ; then
13704
13705         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13706         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13707
13708 fi
13709
13710 fi
13711
13712 fi # cf_cv_posix_visible
13713
13714         ;;
13715 esac
13716
13717 if test -n "$cf_xopen_source" ; then
13718
13719 for cf_add_cflags in $cf_xopen_source
13720 do
13721         case "x$cf_add_cflags" in
13722         (x-[DU]*)
13723
13724 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13725 while true
13726 do
13727         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'`
13728         test "$CFLAGS" != "$cf_old_cflag" || break
13729         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13730
13731 echo "${as_me:-configure}:13731: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13732
13733         CFLAGS="$cf_old_cflag"
13734 done
13735
13736 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13737 while true
13738 do
13739         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'`
13740         test "$CPPFLAGS" != "$cf_old_cflag" || break
13741         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13742
13743 echo "${as_me:-configure}:13743: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13744
13745         CPPFLAGS="$cf_old_cflag"
13746 done
13747
13748                 ;;
13749         esac
13750
13751 cf_fix_cppflags=no
13752 cf_new_cflags=
13753 cf_new_cppflags=
13754 cf_new_extra_cppflags=
13755
13756 for cf_add_cflags in $cf_add_cflags
13757 do
13758 case "$cf_fix_cppflags" in
13759 (no)
13760         case "$cf_add_cflags" in
13761         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13762                 case "$cf_add_cflags" in
13763                 (-D*)
13764                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13765
13766                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13767                                 && test -z "${cf_tst_cflags}" \
13768                                 && cf_fix_cppflags=yes
13769
13770                         if test "$cf_fix_cppflags" = yes ; then
13771
13772         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13773         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13774
13775                                 continue
13776                         elif test "${cf_tst_cflags}" = "\"'" ; then
13777
13778         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13779         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13780
13781                                 continue
13782                         fi
13783                         ;;
13784                 esac
13785                 case "$CPPFLAGS" in
13786                 (*$cf_add_cflags)
13787                         ;;
13788                 (*)
13789                         case "$cf_add_cflags" in
13790                         (-D*)
13791                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13792
13793 CPPFLAGS=`echo "$CPPFLAGS" | \
13794         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13795                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13796
13797                                 ;;
13798                         esac
13799
13800         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13801         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13802
13803                         ;;
13804                 esac
13805                 ;;
13806         (*)
13807
13808         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13809         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13810
13811                 ;;
13812         esac
13813         ;;
13814 (yes)
13815
13816         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13817         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13818
13819         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13820
13821         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13822                 && test -z "${cf_tst_cflags}" \
13823                 && cf_fix_cppflags=no
13824         ;;
13825 esac
13826 done
13827
13828 if test -n "$cf_new_cflags" ; then
13829         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13830
13831 echo "${as_me:-configure}:13831: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13832
13833         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13834         CFLAGS="${CFLAGS}$cf_new_cflags"
13835
13836 fi
13837
13838 if test -n "$cf_new_cppflags" ; then
13839         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13840
13841 echo "${as_me:-configure}:13841: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13842
13843         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13844         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13845
13846 fi
13847
13848 if test -n "$cf_new_extra_cppflags" ; then
13849         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13850
13851 echo "${as_me:-configure}:13851: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13852
13853         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13854         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13855
13856 fi
13857
13858 done
13859
13860 fi
13861
13862 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13863         echo "$as_me:13863: checking if _XOPEN_SOURCE really is set" >&5
13864 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13865         cat >"conftest.$ac_ext" <<_ACEOF
13866 #line 13866 "configure"
13867 #include "confdefs.h"
13868 #include <stdlib.h>
13869 int
13870 main (void)
13871 {
13872
13873 #ifndef _XOPEN_SOURCE
13874 make an error
13875 #endif
13876   ;
13877   return 0;
13878 }
13879 _ACEOF
13880 rm -f "conftest.$ac_objext"
13881 if { (eval echo "$as_me:13881: \"$ac_compile\"") >&5
13882   (eval $ac_compile) 2>&5
13883   ac_status=$?
13884   echo "$as_me:13884: \$? = $ac_status" >&5
13885   (exit "$ac_status"); } &&
13886          { ac_try='test -s "conftest.$ac_objext"'
13887   { (eval echo "$as_me:13887: \"$ac_try\"") >&5
13888   (eval $ac_try) 2>&5
13889   ac_status=$?
13890   echo "$as_me:13890: \$? = $ac_status" >&5
13891   (exit "$ac_status"); }; }; then
13892   cf_XOPEN_SOURCE_set=yes
13893 else
13894   echo "$as_me: failed program was:" >&5
13895 cat "conftest.$ac_ext" >&5
13896 cf_XOPEN_SOURCE_set=no
13897 fi
13898 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13899         echo "$as_me:13899: result: $cf_XOPEN_SOURCE_set" >&5
13900 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13901         if test "$cf_XOPEN_SOURCE_set" = yes
13902         then
13903                 cat >"conftest.$ac_ext" <<_ACEOF
13904 #line 13904 "configure"
13905 #include "confdefs.h"
13906 #include <stdlib.h>
13907 int
13908 main (void)
13909 {
13910
13911 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13912 make an error
13913 #endif
13914   ;
13915   return 0;
13916 }
13917 _ACEOF
13918 rm -f "conftest.$ac_objext"
13919 if { (eval echo "$as_me:13919: \"$ac_compile\"") >&5
13920   (eval $ac_compile) 2>&5
13921   ac_status=$?
13922   echo "$as_me:13922: \$? = $ac_status" >&5
13923   (exit "$ac_status"); } &&
13924          { ac_try='test -s "conftest.$ac_objext"'
13925   { (eval echo "$as_me:13925: \"$ac_try\"") >&5
13926   (eval $ac_try) 2>&5
13927   ac_status=$?
13928   echo "$as_me:13928: \$? = $ac_status" >&5
13929   (exit "$ac_status"); }; }; then
13930   cf_XOPEN_SOURCE_set_ok=yes
13931 else
13932   echo "$as_me: failed program was:" >&5
13933 cat "conftest.$ac_ext" >&5
13934 cf_XOPEN_SOURCE_set_ok=no
13935 fi
13936 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13937                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13938                 then
13939                         { echo "$as_me:13939: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13940 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13941                 fi
13942         else
13943
13944 echo "$as_me:13944: checking if we should define _XOPEN_SOURCE" >&5
13945 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13946 if test "${cf_cv_xopen_source+set}" = set; then
13947   echo $ECHO_N "(cached) $ECHO_C" >&6
13948 else
13949
13950         cat >"conftest.$ac_ext" <<_ACEOF
13951 #line 13951 "configure"
13952 #include "confdefs.h"
13953
13954 #include <stdlib.h>
13955 #include <string.h>
13956 #include <sys/types.h>
13957
13958 int
13959 main (void)
13960 {
13961
13962 #ifndef _XOPEN_SOURCE
13963 make an error
13964 #endif
13965   ;
13966   return 0;
13967 }
13968 _ACEOF
13969 rm -f "conftest.$ac_objext"
13970 if { (eval echo "$as_me:13970: \"$ac_compile\"") >&5
13971   (eval $ac_compile) 2>&5
13972   ac_status=$?
13973   echo "$as_me:13973: \$? = $ac_status" >&5
13974   (exit "$ac_status"); } &&
13975          { ac_try='test -s "conftest.$ac_objext"'
13976   { (eval echo "$as_me:13976: \"$ac_try\"") >&5
13977   (eval $ac_try) 2>&5
13978   ac_status=$?
13979   echo "$as_me:13979: \$? = $ac_status" >&5
13980   (exit "$ac_status"); }; }; then
13981   cf_cv_xopen_source=no
13982 else
13983   echo "$as_me: failed program was:" >&5
13984 cat "conftest.$ac_ext" >&5
13985 cf_save="$CPPFLAGS"
13986
13987         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13988         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13989
13990          cat >"conftest.$ac_ext" <<_ACEOF
13991 #line 13991 "configure"
13992 #include "confdefs.h"
13993
13994 #include <stdlib.h>
13995 #include <string.h>
13996 #include <sys/types.h>
13997
13998 int
13999 main (void)
14000 {
14001
14002 #ifdef _XOPEN_SOURCE
14003 make an error
14004 #endif
14005   ;
14006   return 0;
14007 }
14008 _ACEOF
14009 rm -f "conftest.$ac_objext"
14010 if { (eval echo "$as_me:14010: \"$ac_compile\"") >&5
14011   (eval $ac_compile) 2>&5
14012   ac_status=$?
14013   echo "$as_me:14013: \$? = $ac_status" >&5
14014   (exit "$ac_status"); } &&
14015          { ac_try='test -s "conftest.$ac_objext"'
14016   { (eval echo "$as_me:14016: \"$ac_try\"") >&5
14017   (eval $ac_try) 2>&5
14018   ac_status=$?
14019   echo "$as_me:14019: \$? = $ac_status" >&5
14020   (exit "$ac_status"); }; }; then
14021   cf_cv_xopen_source=no
14022 else
14023   echo "$as_me: failed program was:" >&5
14024 cat "conftest.$ac_ext" >&5
14025 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14026 fi
14027 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14028         CPPFLAGS="$cf_save"
14029
14030 fi
14031 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14032
14033 fi
14034 echo "$as_me:14034: result: $cf_cv_xopen_source" >&5
14035 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14036
14037 if test "$cf_cv_xopen_source" != no ; then
14038
14039 CFLAGS=`echo "$CFLAGS" | \
14040         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14041                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14042
14043 CPPFLAGS=`echo "$CPPFLAGS" | \
14044         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14045                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14046
14047         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14048
14049 for cf_add_cflags in $cf_temp_xopen_source
14050 do
14051         case "x$cf_add_cflags" in
14052         (x-[DU]*)
14053
14054 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14055 while true
14056 do
14057         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'`
14058         test "$CFLAGS" != "$cf_old_cflag" || break
14059
14060         CFLAGS="$cf_old_cflag"
14061 done
14062
14063 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14064 while true
14065 do
14066         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'`
14067         test "$CPPFLAGS" != "$cf_old_cflag" || break
14068
14069         CPPFLAGS="$cf_old_cflag"
14070 done
14071
14072                 ;;
14073         esac
14074
14075 cf_fix_cppflags=no
14076 cf_new_cflags=
14077 cf_new_cppflags=
14078 cf_new_extra_cppflags=
14079
14080 for cf_add_cflags in $cf_add_cflags
14081 do
14082 case "$cf_fix_cppflags" in
14083 (no)
14084         case "$cf_add_cflags" in
14085         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14086                 case "$cf_add_cflags" in
14087                 (-D*)
14088                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14089
14090                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14091                                 && test -z "${cf_tst_cflags}" \
14092                                 && cf_fix_cppflags=yes
14093
14094                         if test "$cf_fix_cppflags" = yes ; then
14095
14096         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14097         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14098
14099                                 continue
14100                         elif test "${cf_tst_cflags}" = "\"'" ; then
14101
14102         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14103         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14104
14105                                 continue
14106                         fi
14107                         ;;
14108                 esac
14109                 case "$CPPFLAGS" in
14110                 (*$cf_add_cflags)
14111                         ;;
14112                 (*)
14113                         case "$cf_add_cflags" in
14114                         (-D*)
14115                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14116
14117 CPPFLAGS=`echo "$CPPFLAGS" | \
14118         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14119                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14120
14121                                 ;;
14122                         esac
14123
14124         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14125         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14126
14127                         ;;
14128                 esac
14129                 ;;
14130         (*)
14131
14132         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14133         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14134
14135                 ;;
14136         esac
14137         ;;
14138 (yes)
14139
14140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14142
14143         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14144
14145         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14146                 && test -z "${cf_tst_cflags}" \
14147                 && cf_fix_cppflags=no
14148         ;;
14149 esac
14150 done
14151
14152 if test -n "$cf_new_cflags" ; then
14153
14154         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14155         CFLAGS="${CFLAGS}$cf_new_cflags"
14156
14157 fi
14158
14159 if test -n "$cf_new_cppflags" ; then
14160
14161         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14162         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14163
14164 fi
14165
14166 if test -n "$cf_new_extra_cppflags" ; then
14167
14168         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14169         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14170
14171 fi
14172
14173 done
14174
14175 fi
14176
14177         fi
14178 fi
14179 fi # cf_cv_posix_visible
14180
14181 # Check whether --enable-largefile or --disable-largefile was given.
14182 if test "${enable_largefile+set}" = set; then
14183   enableval="$enable_largefile"
14184
14185 fi;
14186 if test "$enable_largefile" != no; then
14187
14188   echo "$as_me:14188: checking for special C compiler options needed for large files" >&5
14189 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14190 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14191   echo $ECHO_N "(cached) $ECHO_C" >&6
14192 else
14193   ac_cv_sys_largefile_CC=no
14194      if test "$GCC" != yes; then
14195        ac_save_CC=$CC
14196        while :; do
14197          # IRIX 6.2 and later do not support large files by default,
14198          # so use the C compiler's -n32 option if that helps.
14199          cat >"conftest.$ac_ext" <<_ACEOF
14200 #line 14200 "configure"
14201 #include "confdefs.h"
14202 #include <sys/types.h>
14203  /* Check that off_t can represent 2**63 - 1 correctly.
14204     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14205     since some C++ compilers masquerading as C compilers
14206     incorrectly reject 9223372036854775807.  */
14207 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14208   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14209                        && LARGE_OFF_T % 2147483647 == 1)
14210                       ? 1 : -1];
14211 int
14212 main (void)
14213 {
14214
14215   ;
14216   return 0;
14217 }
14218 _ACEOF
14219          rm -f "conftest.$ac_objext"
14220 if { (eval echo "$as_me:14220: \"$ac_compile\"") >&5
14221   (eval $ac_compile) 2>&5
14222   ac_status=$?
14223   echo "$as_me:14223: \$? = $ac_status" >&5
14224   (exit "$ac_status"); } &&
14225          { ac_try='test -s "conftest.$ac_objext"'
14226   { (eval echo "$as_me:14226: \"$ac_try\"") >&5
14227   (eval $ac_try) 2>&5
14228   ac_status=$?
14229   echo "$as_me:14229: \$? = $ac_status" >&5
14230   (exit "$ac_status"); }; }; then
14231   break
14232 else
14233   echo "$as_me: failed program was:" >&5
14234 cat "conftest.$ac_ext" >&5
14235 fi
14236 rm -f "conftest.$ac_objext"
14237          CC="$CC -n32"
14238          rm -f "conftest.$ac_objext"
14239 if { (eval echo "$as_me:14239: \"$ac_compile\"") >&5
14240   (eval $ac_compile) 2>&5
14241   ac_status=$?
14242   echo "$as_me:14242: \$? = $ac_status" >&5
14243   (exit "$ac_status"); } &&
14244          { ac_try='test -s "conftest.$ac_objext"'
14245   { (eval echo "$as_me:14245: \"$ac_try\"") >&5
14246   (eval $ac_try) 2>&5
14247   ac_status=$?
14248   echo "$as_me:14248: \$? = $ac_status" >&5
14249   (exit "$ac_status"); }; }; then
14250   ac_cv_sys_largefile_CC=' -n32'; break
14251 else
14252   echo "$as_me: failed program was:" >&5
14253 cat "conftest.$ac_ext" >&5
14254 fi
14255 rm -f "conftest.$ac_objext"
14256          break
14257        done
14258        CC=$ac_save_CC
14259        rm -f "conftest.$ac_ext"
14260     fi
14261 fi
14262 echo "$as_me:14262: result: $ac_cv_sys_largefile_CC" >&5
14263 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14264   if test "$ac_cv_sys_largefile_CC" != no; then
14265     CC=$CC$ac_cv_sys_largefile_CC
14266   fi
14267
14268   echo "$as_me:14268: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14269 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14270 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14271   echo $ECHO_N "(cached) $ECHO_C" >&6
14272 else
14273   while :; do
14274   ac_cv_sys_file_offset_bits=no
14275   cat >"conftest.$ac_ext" <<_ACEOF
14276 #line 14276 "configure"
14277 #include "confdefs.h"
14278 #include <sys/types.h>
14279  /* Check that off_t can represent 2**63 - 1 correctly.
14280     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14281     since some C++ compilers masquerading as C compilers
14282     incorrectly reject 9223372036854775807.  */
14283 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14284   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14285                        && LARGE_OFF_T % 2147483647 == 1)
14286                       ? 1 : -1];
14287 int
14288 main (void)
14289 {
14290
14291   ;
14292   return 0;
14293 }
14294 _ACEOF
14295 rm -f "conftest.$ac_objext"
14296 if { (eval echo "$as_me:14296: \"$ac_compile\"") >&5
14297   (eval $ac_compile) 2>&5
14298   ac_status=$?
14299   echo "$as_me:14299: \$? = $ac_status" >&5
14300   (exit "$ac_status"); } &&
14301          { ac_try='test -s "conftest.$ac_objext"'
14302   { (eval echo "$as_me:14302: \"$ac_try\"") >&5
14303   (eval $ac_try) 2>&5
14304   ac_status=$?
14305   echo "$as_me:14305: \$? = $ac_status" >&5
14306   (exit "$ac_status"); }; }; then
14307   break
14308 else
14309   echo "$as_me: failed program was:" >&5
14310 cat "conftest.$ac_ext" >&5
14311 fi
14312 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14313   cat >"conftest.$ac_ext" <<_ACEOF
14314 #line 14314 "configure"
14315 #include "confdefs.h"
14316 #define _FILE_OFFSET_BITS 64
14317 #include <sys/types.h>
14318  /* Check that off_t can represent 2**63 - 1 correctly.
14319     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14320     since some C++ compilers masquerading as C compilers
14321     incorrectly reject 9223372036854775807.  */
14322 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14323   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14324                        && LARGE_OFF_T % 2147483647 == 1)
14325                       ? 1 : -1];
14326 int
14327 main (void)
14328 {
14329
14330   ;
14331   return 0;
14332 }
14333 _ACEOF
14334 rm -f "conftest.$ac_objext"
14335 if { (eval echo "$as_me:14335: \"$ac_compile\"") >&5
14336   (eval $ac_compile) 2>&5
14337   ac_status=$?
14338   echo "$as_me:14338: \$? = $ac_status" >&5
14339   (exit "$ac_status"); } &&
14340          { ac_try='test -s "conftest.$ac_objext"'
14341   { (eval echo "$as_me:14341: \"$ac_try\"") >&5
14342   (eval $ac_try) 2>&5
14343   ac_status=$?
14344   echo "$as_me:14344: \$? = $ac_status" >&5
14345   (exit "$ac_status"); }; }; then
14346   ac_cv_sys_file_offset_bits=64; break
14347 else
14348   echo "$as_me: failed program was:" >&5
14349 cat "conftest.$ac_ext" >&5
14350 fi
14351 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14352   break
14353 done
14354 fi
14355 echo "$as_me:14355: result: $ac_cv_sys_file_offset_bits" >&5
14356 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14357 if test "$ac_cv_sys_file_offset_bits" != no; then
14358
14359 cat >>confdefs.h <<EOF
14360 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14361 EOF
14362
14363 fi
14364 rm -rf conftest*
14365   echo "$as_me:14365: checking for _LARGE_FILES value needed for large files" >&5
14366 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14367 if test "${ac_cv_sys_large_files+set}" = set; then
14368   echo $ECHO_N "(cached) $ECHO_C" >&6
14369 else
14370   while :; do
14371   ac_cv_sys_large_files=no
14372   cat >"conftest.$ac_ext" <<_ACEOF
14373 #line 14373 "configure"
14374 #include "confdefs.h"
14375 #include <sys/types.h>
14376  /* Check that off_t can represent 2**63 - 1 correctly.
14377     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14378     since some C++ compilers masquerading as C compilers
14379     incorrectly reject 9223372036854775807.  */
14380 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14381   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14382                        && LARGE_OFF_T % 2147483647 == 1)
14383                       ? 1 : -1];
14384 int
14385 main (void)
14386 {
14387
14388   ;
14389   return 0;
14390 }
14391 _ACEOF
14392 rm -f "conftest.$ac_objext"
14393 if { (eval echo "$as_me:14393: \"$ac_compile\"") >&5
14394   (eval $ac_compile) 2>&5
14395   ac_status=$?
14396   echo "$as_me:14396: \$? = $ac_status" >&5
14397   (exit "$ac_status"); } &&
14398          { ac_try='test -s "conftest.$ac_objext"'
14399   { (eval echo "$as_me:14399: \"$ac_try\"") >&5
14400   (eval $ac_try) 2>&5
14401   ac_status=$?
14402   echo "$as_me:14402: \$? = $ac_status" >&5
14403   (exit "$ac_status"); }; }; then
14404   break
14405 else
14406   echo "$as_me: failed program was:" >&5
14407 cat "conftest.$ac_ext" >&5
14408 fi
14409 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14410   cat >"conftest.$ac_ext" <<_ACEOF
14411 #line 14411 "configure"
14412 #include "confdefs.h"
14413 #define _LARGE_FILES 1
14414 #include <sys/types.h>
14415  /* Check that off_t can represent 2**63 - 1 correctly.
14416     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14417     since some C++ compilers masquerading as C compilers
14418     incorrectly reject 9223372036854775807.  */
14419 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14420   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14421                        && LARGE_OFF_T % 2147483647 == 1)
14422                       ? 1 : -1];
14423 int
14424 main (void)
14425 {
14426
14427   ;
14428   return 0;
14429 }
14430 _ACEOF
14431 rm -f "conftest.$ac_objext"
14432 if { (eval echo "$as_me:14432: \"$ac_compile\"") >&5
14433   (eval $ac_compile) 2>&5
14434   ac_status=$?
14435   echo "$as_me:14435: \$? = $ac_status" >&5
14436   (exit "$ac_status"); } &&
14437          { ac_try='test -s "conftest.$ac_objext"'
14438   { (eval echo "$as_me:14438: \"$ac_try\"") >&5
14439   (eval $ac_try) 2>&5
14440   ac_status=$?
14441   echo "$as_me:14441: \$? = $ac_status" >&5
14442   (exit "$ac_status"); }; }; then
14443   ac_cv_sys_large_files=1; break
14444 else
14445   echo "$as_me: failed program was:" >&5
14446 cat "conftest.$ac_ext" >&5
14447 fi
14448 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14449   break
14450 done
14451 fi
14452 echo "$as_me:14452: result: $ac_cv_sys_large_files" >&5
14453 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14454 if test "$ac_cv_sys_large_files" != no; then
14455
14456 cat >>confdefs.h <<EOF
14457 #define _LARGE_FILES $ac_cv_sys_large_files
14458 EOF
14459
14460 fi
14461 rm -rf conftest*
14462 fi
14463
14464         if test "$enable_largefile" != no ; then
14465         echo "$as_me:14465: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14466 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14467 if test "${ac_cv_sys_largefile_source+set}" = set; then
14468   echo $ECHO_N "(cached) $ECHO_C" >&6
14469 else
14470   while :; do
14471   ac_cv_sys_largefile_source=no
14472   cat >"conftest.$ac_ext" <<_ACEOF
14473 #line 14473 "configure"
14474 #include "confdefs.h"
14475 #include <stdio.h>
14476 int
14477 main (void)
14478 {
14479 return !fseeko;
14480   ;
14481   return 0;
14482 }
14483 _ACEOF
14484 rm -f "conftest.$ac_objext"
14485 if { (eval echo "$as_me:14485: \"$ac_compile\"") >&5
14486   (eval $ac_compile) 2>&5
14487   ac_status=$?
14488   echo "$as_me:14488: \$? = $ac_status" >&5
14489   (exit "$ac_status"); } &&
14490          { ac_try='test -s "conftest.$ac_objext"'
14491   { (eval echo "$as_me:14491: \"$ac_try\"") >&5
14492   (eval $ac_try) 2>&5
14493   ac_status=$?
14494   echo "$as_me:14494: \$? = $ac_status" >&5
14495   (exit "$ac_status"); }; }; then
14496   break
14497 else
14498   echo "$as_me: failed program was:" >&5
14499 cat "conftest.$ac_ext" >&5
14500 fi
14501 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14502   cat >"conftest.$ac_ext" <<_ACEOF
14503 #line 14503 "configure"
14504 #include "confdefs.h"
14505 #define _LARGEFILE_SOURCE 1
14506 #include <stdio.h>
14507 int
14508 main (void)
14509 {
14510 return !fseeko;
14511   ;
14512   return 0;
14513 }
14514 _ACEOF
14515 rm -f "conftest.$ac_objext"
14516 if { (eval echo "$as_me:14516: \"$ac_compile\"") >&5
14517   (eval $ac_compile) 2>&5
14518   ac_status=$?
14519   echo "$as_me:14519: \$? = $ac_status" >&5
14520   (exit "$ac_status"); } &&
14521          { ac_try='test -s "conftest.$ac_objext"'
14522   { (eval echo "$as_me:14522: \"$ac_try\"") >&5
14523   (eval $ac_try) 2>&5
14524   ac_status=$?
14525   echo "$as_me:14525: \$? = $ac_status" >&5
14526   (exit "$ac_status"); }; }; then
14527   ac_cv_sys_largefile_source=1; break
14528 else
14529   echo "$as_me: failed program was:" >&5
14530 cat "conftest.$ac_ext" >&5
14531 fi
14532 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14533   break
14534 done
14535 fi
14536 echo "$as_me:14536: result: $ac_cv_sys_largefile_source" >&5
14537 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14538 if test "$ac_cv_sys_largefile_source" != no; then
14539
14540 cat >>confdefs.h <<EOF
14541 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14542 EOF
14543
14544 fi
14545 rm -rf conftest*
14546
14547 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14548 # in glibc 2.1.3, but that breaks too many other things.
14549 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14550 echo "$as_me:14550: checking for fseeko" >&5
14551 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14552 if test "${ac_cv_func_fseeko+set}" = set; then
14553   echo $ECHO_N "(cached) $ECHO_C" >&6
14554 else
14555   cat >"conftest.$ac_ext" <<_ACEOF
14556 #line 14556 "configure"
14557 #include "confdefs.h"
14558 #include <stdio.h>
14559 int
14560 main (void)
14561 {
14562 return fseeko && fseeko (stdin, 0, 0);
14563   ;
14564   return 0;
14565 }
14566 _ACEOF
14567 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14568 if { (eval echo "$as_me:14568: \"$ac_link\"") >&5
14569   (eval $ac_link) 2>&5
14570   ac_status=$?
14571   echo "$as_me:14571: \$? = $ac_status" >&5
14572   (exit "$ac_status"); } &&
14573          { ac_try='test -s "conftest$ac_exeext"'
14574   { (eval echo "$as_me:14574: \"$ac_try\"") >&5
14575   (eval $ac_try) 2>&5
14576   ac_status=$?
14577   echo "$as_me:14577: \$? = $ac_status" >&5
14578   (exit "$ac_status"); }; }; then
14579   ac_cv_func_fseeko=yes
14580 else
14581   echo "$as_me: failed program was:" >&5
14582 cat "conftest.$ac_ext" >&5
14583 ac_cv_func_fseeko=no
14584 fi
14585 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14586 fi
14587 echo "$as_me:14587: result: $ac_cv_func_fseeko" >&5
14588 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14589 if test $ac_cv_func_fseeko = yes; then
14590
14591 cat >>confdefs.h <<\EOF
14592 #define HAVE_FSEEKO 1
14593 EOF
14594
14595 fi
14596
14597         # Normally we would collect these definitions in the config.h,
14598         # but (like _XOPEN_SOURCE), some environments rely on having these
14599         # defined before any of the system headers are included.  Another
14600         # case comes up with C++, e.g., on AIX the compiler compiles the
14601         # header files by themselves before looking at the body files it is
14602         # told to compile.  For ncurses, those header files do not include
14603         # the config.h
14604         if test "$ac_cv_sys_large_files" != no
14605         then
14606
14607         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14608         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14609
14610         fi
14611         if test "$ac_cv_sys_largefile_source" != no
14612         then
14613
14614         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14615         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14616
14617         fi
14618         if test "$ac_cv_sys_file_offset_bits" != no
14619         then
14620
14621         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14622         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14623
14624         fi
14625
14626         echo "$as_me:14626: checking whether to use struct dirent64" >&5
14627 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14628 if test "${cf_cv_struct_dirent64+set}" = set; then
14629   echo $ECHO_N "(cached) $ECHO_C" >&6
14630 else
14631
14632                 cat >"conftest.$ac_ext" <<_ACEOF
14633 #line 14633 "configure"
14634 #include "confdefs.h"
14635
14636 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14637 #include <sys/types.h>
14638 #include <dirent.h>
14639
14640 int
14641 main (void)
14642 {
14643
14644                 /* if transitional largefile support is setup, this is true */
14645                 extern struct dirent64 * readdir(DIR *);
14646                 struct dirent64 *x = readdir((DIR *)0);
14647                 struct dirent *y = readdir((DIR *)0);
14648                 int z = x - y;
14649                 (void)z;
14650
14651   ;
14652   return 0;
14653 }
14654 _ACEOF
14655 rm -f "conftest.$ac_objext"
14656 if { (eval echo "$as_me:14656: \"$ac_compile\"") >&5
14657   (eval $ac_compile) 2>&5
14658   ac_status=$?
14659   echo "$as_me:14659: \$? = $ac_status" >&5
14660   (exit "$ac_status"); } &&
14661          { ac_try='test -s "conftest.$ac_objext"'
14662   { (eval echo "$as_me:14662: \"$ac_try\"") >&5
14663   (eval $ac_try) 2>&5
14664   ac_status=$?
14665   echo "$as_me:14665: \$? = $ac_status" >&5
14666   (exit "$ac_status"); }; }; then
14667   cf_cv_struct_dirent64=yes
14668 else
14669   echo "$as_me: failed program was:" >&5
14670 cat "conftest.$ac_ext" >&5
14671 cf_cv_struct_dirent64=no
14672 fi
14673 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14674
14675 fi
14676 echo "$as_me:14676: result: $cf_cv_struct_dirent64" >&5
14677 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14678         test "$cf_cv_struct_dirent64" = yes &&
14679 cat >>confdefs.h <<\EOF
14680 #define HAVE_STRUCT_DIRENT64 1
14681 EOF
14682
14683         fi
14684
14685 ### Enable compiling-in rcs id's
14686 echo "$as_me:14686: checking if RCS identifiers should be compiled-in" >&5
14687 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14688
14689 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14690 if test "${with_rcs_ids+set}" = set; then
14691   withval="$with_rcs_ids"
14692   with_rcs_ids=$withval
14693 else
14694   with_rcs_ids=no
14695 fi;
14696 echo "$as_me:14696: result: $with_rcs_ids" >&5
14697 echo "${ECHO_T}$with_rcs_ids" >&6
14698 test "$with_rcs_ids" = yes &&
14699 cat >>confdefs.h <<\EOF
14700 #define USE_RCS_IDS 1
14701 EOF
14702
14703 ###############################################################################
14704
14705 ### Note that some functions (such as const) are normally disabled anyway.
14706 echo "$as_me:14706: checking if you want to build with function extensions" >&5
14707 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14708
14709 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14710 if test "${enable_ext_funcs+set}" = set; then
14711   enableval="$enable_ext_funcs"
14712   with_ext_funcs=$enableval
14713 else
14714   with_ext_funcs=yes
14715 fi;
14716 echo "$as_me:14716: result: $with_ext_funcs" >&5
14717 echo "${ECHO_T}$with_ext_funcs" >&6
14718 if test "$with_ext_funcs" = yes ; then
14719         NCURSES_EXT_FUNCS=1
14720
14721 cat >>confdefs.h <<\EOF
14722 #define HAVE_USE_DEFAULT_COLORS 1
14723 EOF
14724
14725 cat >>confdefs.h <<\EOF
14726 #define NCURSES_EXT_FUNCS 1
14727 EOF
14728
14729 else
14730         NCURSES_EXT_FUNCS=0
14731 fi
14732
14733 ###   use option --enable-const to turn on use of const beyond that in XSI.
14734 echo "$as_me:14734: checking for extended use of const keyword" >&5
14735 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14736
14737 # Check whether --enable-const or --disable-const was given.
14738 if test "${enable_const+set}" = set; then
14739   enableval="$enable_const"
14740   with_ext_const=$enableval
14741 else
14742   with_ext_const=no
14743 fi;
14744 echo "$as_me:14744: result: $with_ext_const" >&5
14745 echo "${ECHO_T}$with_ext_const" >&6
14746 NCURSES_CONST='/*nothing*/'
14747 if test "$with_ext_const" = yes ; then
14748         NCURSES_CONST=const
14749 fi
14750
14751 ###############################################################################
14752 # These options are relatively safe to experiment with.
14753
14754 echo "$as_me:14754: checking if you want all development code" >&5
14755 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14756
14757 # Check whether --with-develop or --without-develop was given.
14758 if test "${with_develop+set}" = set; then
14759   withval="$with_develop"
14760   with_develop=$withval
14761 else
14762   with_develop=no
14763 fi;
14764 echo "$as_me:14764: result: $with_develop" >&5
14765 echo "${ECHO_T}$with_develop" >&6
14766
14767 ###############################################################################
14768 # These are just experimental, probably should not be in a package:
14769
14770 # This is still experimental (20080329), but should ultimately be moved to
14771 # the script-block --with-normal, etc.
14772
14773 echo "$as_me:14773: checking if you want to link with the pthread library" >&5
14774 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14775
14776 # Check whether --with-pthread or --without-pthread was given.
14777 if test "${with_pthread+set}" = set; then
14778   withval="$with_pthread"
14779   with_pthread=$withval
14780 else
14781   with_pthread=no
14782 fi;
14783 echo "$as_me:14783: result: $with_pthread" >&5
14784 echo "${ECHO_T}$with_pthread" >&6
14785
14786 if test "$with_pthread" != no ; then
14787         echo "$as_me:14787: checking for pthread.h" >&5
14788 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14789 if test "${ac_cv_header_pthread_h+set}" = set; then
14790   echo $ECHO_N "(cached) $ECHO_C" >&6
14791 else
14792   cat >"conftest.$ac_ext" <<_ACEOF
14793 #line 14793 "configure"
14794 #include "confdefs.h"
14795 #include <pthread.h>
14796 _ACEOF
14797 if { (eval echo "$as_me:14797: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14798   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14799   ac_status=$?
14800   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14801   rm -f conftest.er1
14802   cat conftest.err >&5
14803   echo "$as_me:14803: \$? = $ac_status" >&5
14804   (exit "$ac_status"); } >/dev/null; then
14805   if test -s conftest.err; then
14806     ac_cpp_err=$ac_c_preproc_warn_flag
14807   else
14808     ac_cpp_err=
14809   fi
14810 else
14811   ac_cpp_err=yes
14812 fi
14813 if test -z "$ac_cpp_err"; then
14814   ac_cv_header_pthread_h=yes
14815 else
14816   echo "$as_me: failed program was:" >&5
14817   cat "conftest.$ac_ext" >&5
14818   ac_cv_header_pthread_h=no
14819 fi
14820 rm -f conftest.err "conftest.$ac_ext"
14821 fi
14822 echo "$as_me:14822: result: $ac_cv_header_pthread_h" >&5
14823 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14824 if test "$ac_cv_header_pthread_h" = yes; then
14825
14826 cat >>confdefs.h <<\EOF
14827 #define HAVE_PTHREADS_H 1
14828 EOF
14829
14830         for cf_lib_pthread in pthread c_r
14831         do
14832             echo "$as_me:14832: checking if we can link with the $cf_lib_pthread library" >&5
14833 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14834             cf_save_LIBS="$LIBS"
14835
14836 cf_add_libs="$LIBS"
14837 # reverse order
14838 cf_add_0lib=
14839 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14840 # filter duplicates
14841 for cf_add_1lib in $cf_add_0lib; do
14842         for cf_add_2lib in $cf_add_libs; do
14843                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14844                         cf_add_1lib=
14845                         break
14846                 fi
14847         done
14848         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14849 done
14850 LIBS="$cf_add_libs"
14851
14852             cat >"conftest.$ac_ext" <<_ACEOF
14853 #line 14853 "configure"
14854 #include "confdefs.h"
14855
14856 #include <pthread.h>
14857
14858 int
14859 main (void)
14860 {
14861
14862                 int rc = pthread_create(0,0,0,0);
14863                 int r2 = pthread_mutexattr_settype(0, 0);
14864
14865   ;
14866   return 0;
14867 }
14868 _ACEOF
14869 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14870 if { (eval echo "$as_me:14870: \"$ac_link\"") >&5
14871   (eval $ac_link) 2>&5
14872   ac_status=$?
14873   echo "$as_me:14873: \$? = $ac_status" >&5
14874   (exit "$ac_status"); } &&
14875          { ac_try='test -s "conftest$ac_exeext"'
14876   { (eval echo "$as_me:14876: \"$ac_try\"") >&5
14877   (eval $ac_try) 2>&5
14878   ac_status=$?
14879   echo "$as_me:14879: \$? = $ac_status" >&5
14880   (exit "$ac_status"); }; }; then
14881   with_pthread=yes
14882 else
14883   echo "$as_me: failed program was:" >&5
14884 cat "conftest.$ac_ext" >&5
14885 with_pthread=no
14886 fi
14887 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14888             LIBS="$cf_save_LIBS"
14889             echo "$as_me:14889: result: $with_pthread" >&5
14890 echo "${ECHO_T}$with_pthread" >&6
14891             test "$with_pthread" = yes && break
14892         done
14893
14894         if test "$with_pthread" = yes ; then
14895
14896 cf_add_libs="$LIBS"
14897 # reverse order
14898 cf_add_0lib=
14899 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14900 # filter duplicates
14901 for cf_add_1lib in $cf_add_0lib; do
14902         for cf_add_2lib in $cf_add_libs; do
14903                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14904                         cf_add_1lib=
14905                         break
14906                 fi
14907         done
14908         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14909 done
14910 LIBS="$cf_add_libs"
14911
14912 cat >>confdefs.h <<\EOF
14913 #define HAVE_LIBPTHREADS 1
14914 EOF
14915
14916         else
14917             { { echo "$as_me:14917: error: Cannot link with pthread library" >&5
14918 echo "$as_me: error: Cannot link with pthread library" >&2;}
14919    { (exit 1); exit 1; }; }
14920         fi
14921
14922 fi
14923
14924 fi
14925
14926 echo "$as_me:14926: checking if you want to use weak-symbols for pthreads" >&5
14927 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14928
14929 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14930 if test "${enable_weak_symbols+set}" = set; then
14931   enableval="$enable_weak_symbols"
14932   use_weak_symbols=$withval
14933 else
14934   use_weak_symbols=no
14935 fi;
14936 echo "$as_me:14936: result: $use_weak_symbols" >&5
14937 echo "${ECHO_T}$use_weak_symbols" >&6
14938 if test "$use_weak_symbols" = yes ; then
14939
14940 echo "$as_me:14940: checking if $CC supports weak symbols" >&5
14941 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14942 if test "${cf_cv_weak_symbols+set}" = set; then
14943   echo $ECHO_N "(cached) $ECHO_C" >&6
14944 else
14945
14946 cat >"conftest.$ac_ext" <<_ACEOF
14947 #line 14947 "configure"
14948 #include "confdefs.h"
14949
14950 #include <stdio.h>
14951 int
14952 main (void)
14953 {
14954
14955 #if defined(__GNUC__)
14956 #  if defined __USE_ISOC99
14957 #    define _cat_pragma(exp)    _Pragma(#exp)
14958 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14959 #  else
14960 #    define _weak_pragma(exp)
14961 #  endif
14962 #  define _declare(name)        __extension__ extern __typeof__(name) name
14963 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14964 #endif
14965
14966 weak_symbol(fopen);
14967
14968   ;
14969   return 0;
14970 }
14971 _ACEOF
14972 rm -f "conftest.$ac_objext"
14973 if { (eval echo "$as_me:14973: \"$ac_compile\"") >&5
14974   (eval $ac_compile) 2>&5
14975   ac_status=$?
14976   echo "$as_me:14976: \$? = $ac_status" >&5
14977   (exit "$ac_status"); } &&
14978          { ac_try='test -s "conftest.$ac_objext"'
14979   { (eval echo "$as_me:14979: \"$ac_try\"") >&5
14980   (eval $ac_try) 2>&5
14981   ac_status=$?
14982   echo "$as_me:14982: \$? = $ac_status" >&5
14983   (exit "$ac_status"); }; }; then
14984   cf_cv_weak_symbols=yes
14985 else
14986   echo "$as_me: failed program was:" >&5
14987 cat "conftest.$ac_ext" >&5
14988 cf_cv_weak_symbols=no
14989 fi
14990 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14991
14992 fi
14993 echo "$as_me:14993: result: $cf_cv_weak_symbols" >&5
14994 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14995
14996 else
14997         cf_cv_weak_symbols=no
14998 fi
14999
15000 if test $cf_cv_weak_symbols = yes ; then
15001
15002 cat >>confdefs.h <<\EOF
15003 #define USE_WEAK_SYMBOLS 1
15004 EOF
15005
15006 fi
15007
15008 PTHREAD=
15009 if test "$with_pthread" = "yes" ; then
15010
15011 cat >>confdefs.h <<\EOF
15012 #define USE_PTHREADS 1
15013 EOF
15014
15015         enable_reentrant=yes
15016         if test $cf_cv_weak_symbols = yes ; then
15017                 PTHREAD=-lpthread
15018         fi
15019 fi
15020
15021 # OpenSUSE is installing ncurses6, using reentrant option.
15022 echo "$as_me:15022: checking for _nc_TABSIZE" >&5
15023 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15024 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15025   echo $ECHO_N "(cached) $ECHO_C" >&6
15026 else
15027   cat >"conftest.$ac_ext" <<_ACEOF
15028 #line 15028 "configure"
15029 #include "confdefs.h"
15030 #define _nc_TABSIZE autoconf_temporary
15031 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15032 #undef _nc_TABSIZE
15033
15034 #ifdef __cplusplus
15035 extern "C"
15036 #endif
15037
15038 /* We use char because int might match the return type of a gcc2
15039    builtin and then its argument prototype would still apply.  */
15040 char _nc_TABSIZE (void);
15041
15042 int
15043 main (void)
15044 {
15045
15046 /* The GNU C library defines stubs for functions which it implements
15047     to always fail with ENOSYS.  Some functions are actually named
15048     something starting with __ and the normal name is an alias.  */
15049 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15050 #error found stub for _nc_TABSIZE
15051 #endif
15052
15053         return _nc_TABSIZE ();
15054   ;
15055   return 0;
15056 }
15057 _ACEOF
15058 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15059 if { (eval echo "$as_me:15059: \"$ac_link\"") >&5
15060   (eval $ac_link) 2>&5
15061   ac_status=$?
15062   echo "$as_me:15062: \$? = $ac_status" >&5
15063   (exit "$ac_status"); } &&
15064          { ac_try='test -s "conftest$ac_exeext"'
15065   { (eval echo "$as_me:15065: \"$ac_try\"") >&5
15066   (eval $ac_try) 2>&5
15067   ac_status=$?
15068   echo "$as_me:15068: \$? = $ac_status" >&5
15069   (exit "$ac_status"); }; }; then
15070   ac_cv_func__nc_TABSIZE=yes
15071 else
15072   echo "$as_me: failed program was:" >&5
15073 cat "conftest.$ac_ext" >&5
15074 ac_cv_func__nc_TABSIZE=no
15075 fi
15076 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15077 fi
15078 echo "$as_me:15078: result: $ac_cv_func__nc_TABSIZE" >&5
15079 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15080 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15081   assume_reentrant=yes
15082 else
15083   assume_reentrant=no
15084 fi
15085
15086 # Reentrant code has to be opaque; there's little advantage to making ncurses
15087 # opaque outside of that, so there is no --enable-opaque option.  We can use
15088 # this option without --with-pthreads, but this will be always set for
15089 # pthreads.
15090 echo "$as_me:15090: checking if you want experimental reentrant code" >&5
15091 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15092
15093 # Check whether --enable-reentrant or --disable-reentrant was given.
15094 if test "${enable_reentrant+set}" = set; then
15095   enableval="$enable_reentrant"
15096   with_reentrant=$enableval
15097 else
15098   with_reentrant=$assume_reentrant
15099 fi;
15100 echo "$as_me:15100: result: $with_reentrant" >&5
15101 echo "${ECHO_T}$with_reentrant" >&6
15102 if test "$with_reentrant" = yes ; then
15103         cf_cv_enable_reentrant=1
15104         if test $cf_cv_weak_symbols = yes ; then
15105
15106 # remove pthread library from $LIBS
15107 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15108
15109         elif test "$assume_reentrant" = no ; then
15110                 LIB_SUFFIX="t${LIB_SUFFIX}"
15111         fi
15112
15113 cat >>confdefs.h <<\EOF
15114 #define USE_REENTRANT 1
15115 EOF
15116
15117 else
15118         cf_cv_enable_reentrant=0
15119 fi
15120
15121 ### Allow using a different wrap-prefix
15122 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15123         echo "$as_me:15123: checking for prefix used to wrap public variables" >&5
15124 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15125
15126 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15127 if test "${with_wrap_prefix+set}" = set; then
15128   withval="$with_wrap_prefix"
15129   NCURSES_WRAP_PREFIX=$withval
15130 else
15131   NCURSES_WRAP_PREFIX=_nc_
15132 fi;
15133         echo "$as_me:15133: result: $NCURSES_WRAP_PREFIX" >&5
15134 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15135 else
15136         NCURSES_WRAP_PREFIX=_nc_
15137 fi
15138
15139 cat >>confdefs.h <<EOF
15140 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15141 EOF
15142
15143 ###############################################################################
15144
15145 ###     use option --disable-echo to suppress full display compiling commands
15146
15147 echo "$as_me:15147: checking if you want to see long compiling messages" >&5
15148 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15149
15150 # Check whether --enable-echo or --disable-echo was given.
15151 if test "${enable_echo+set}" = set; then
15152   enableval="$enable_echo"
15153   test "$enableval" != no && enableval=yes
15154         if test "$enableval" != "yes" ; then
15155
15156         ECHO_LT='--silent'
15157         ECHO_LD='@echo linking $@;'
15158         RULE_CC='@echo compiling $<'
15159         SHOW_CC='@echo compiling $@'
15160         ECHO_CC='@'
15161
15162         else
15163
15164         ECHO_LT=''
15165         ECHO_LD=''
15166         RULE_CC=''
15167         SHOW_CC=''
15168         ECHO_CC=''
15169
15170         fi
15171 else
15172   enableval=yes
15173
15174         ECHO_LT=''
15175         ECHO_LD=''
15176         RULE_CC=''
15177         SHOW_CC=''
15178         ECHO_CC=''
15179
15180 fi;
15181 echo "$as_me:15181: result: $enableval" >&5
15182 echo "${ECHO_T}$enableval" >&6
15183
15184 echo "$as_me:15184: checking if you want to use C11 _Noreturn feature" >&5
15185 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15186
15187 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15188 if test "${enable_stdnoreturn+set}" = set; then
15189   enableval="$enable_stdnoreturn"
15190   test "$enableval" != yes && enableval=no
15191         if test "$enableval" != "no" ; then
15192     enable_stdnoreturn=yes
15193         else
15194                 enable_stdnoreturn=no
15195         fi
15196 else
15197   enableval=no
15198         enable_stdnoreturn=no
15199
15200 fi;
15201 echo "$as_me:15201: result: $enable_stdnoreturn" >&5
15202 echo "${ECHO_T}$enable_stdnoreturn" >&6
15203
15204 if test $enable_stdnoreturn = yes; then
15205 echo "$as_me:15205: checking for C11 _Noreturn feature" >&5
15206 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15207 if test "${cf_cv_c11_noreturn+set}" = set; then
15208   echo $ECHO_N "(cached) $ECHO_C" >&6
15209 else
15210   cat >"conftest.$ac_ext" <<_ACEOF
15211 #line 15211 "configure"
15212 #include "confdefs.h"
15213
15214 #include <stdio.h>
15215 #include <stdlib.h>
15216 #include <stdnoreturn.h>
15217 static _Noreturn void giveup(void) { exit(0); }
15218
15219 int
15220 main (void)
15221 {
15222 if (feof(stdin)) giveup()
15223   ;
15224   return 0;
15225 }
15226 _ACEOF
15227 rm -f "conftest.$ac_objext"
15228 if { (eval echo "$as_me:15228: \"$ac_compile\"") >&5
15229   (eval $ac_compile) 2>&5
15230   ac_status=$?
15231   echo "$as_me:15231: \$? = $ac_status" >&5
15232   (exit "$ac_status"); } &&
15233          { ac_try='test -s "conftest.$ac_objext"'
15234   { (eval echo "$as_me:15234: \"$ac_try\"") >&5
15235   (eval $ac_try) 2>&5
15236   ac_status=$?
15237   echo "$as_me:15237: \$? = $ac_status" >&5
15238   (exit "$ac_status"); }; }; then
15239   cf_cv_c11_noreturn=yes
15240 else
15241   echo "$as_me: failed program was:" >&5
15242 cat "conftest.$ac_ext" >&5
15243 cf_cv_c11_noreturn=no
15244 fi
15245 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15246
15247 fi
15248 echo "$as_me:15248: result: $cf_cv_c11_noreturn" >&5
15249 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15250 else
15251         cf_cv_c11_noreturn=no,
15252 fi
15253
15254 if test "$cf_cv_c11_noreturn" = yes; then
15255
15256 cat >>confdefs.h <<\EOF
15257 #define HAVE_STDNORETURN_H 1
15258 EOF
15259
15260 cat >>confdefs.h <<EOF
15261 #define STDC_NORETURN _Noreturn
15262 EOF
15263
15264         HAVE_STDNORETURN_H=1
15265 else
15266         HAVE_STDNORETURN_H=0
15267 fi
15268
15269 if test "$GCC" = yes || test "$GXX" = yes
15270 then
15271
15272 if test "$GCC" = yes || test "$GXX" = yes
15273 then
15274         case $CFLAGS in
15275         (*-Werror=*)
15276                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15277
15278 echo "${as_me:-configure}:15278: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15279
15280                 cf_temp_flags=
15281                 for cf_temp_scan in $CFLAGS
15282                 do
15283                         case "x$cf_temp_scan" in
15284                         (x-Werror=*)
15285
15286         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15287         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15288
15289                                 ;;
15290                         (*)
15291
15292         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15293         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15294
15295                                 ;;
15296                         esac
15297                 done
15298                 CFLAGS="$cf_temp_flags"
15299                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15300
15301 echo "${as_me:-configure}:15301: testing ... fixed $CFLAGS ..." 1>&5
15302
15303                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15304
15305 echo "${as_me:-configure}:15305: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15306
15307                 ;;
15308         esac
15309 fi
15310
15311 if test "$GCC" = yes || test "$GXX" = yes
15312 then
15313         case $CPPFLAGS in
15314         (*-Werror=*)
15315                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15316
15317 echo "${as_me:-configure}:15317: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15318
15319                 cf_temp_flags=
15320                 for cf_temp_scan in $CPPFLAGS
15321                 do
15322                         case "x$cf_temp_scan" in
15323                         (x-Werror=*)
15324
15325         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15326         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15327
15328                                 ;;
15329                         (*)
15330
15331         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15332         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15333
15334                                 ;;
15335                         esac
15336                 done
15337                 CPPFLAGS="$cf_temp_flags"
15338                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15339
15340 echo "${as_me:-configure}:15340: testing ... fixed $CPPFLAGS ..." 1>&5
15341
15342                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15343
15344 echo "${as_me:-configure}:15344: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15345
15346                 ;;
15347         esac
15348 fi
15349
15350 if test "$GCC" = yes || test "$GXX" = yes
15351 then
15352         case $LDFLAGS in
15353         (*-Werror=*)
15354                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15355
15356 echo "${as_me:-configure}:15356: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15357
15358                 cf_temp_flags=
15359                 for cf_temp_scan in $LDFLAGS
15360                 do
15361                         case "x$cf_temp_scan" in
15362                         (x-Werror=*)
15363
15364         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15365         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15366
15367                                 ;;
15368                         (*)
15369
15370         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15371         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15372
15373                                 ;;
15374                         esac
15375                 done
15376                 LDFLAGS="$cf_temp_flags"
15377                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15378
15379 echo "${as_me:-configure}:15379: testing ... fixed $LDFLAGS ..." 1>&5
15380
15381                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15382
15383 echo "${as_me:-configure}:15383: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15384
15385                 ;;
15386         esac
15387 fi
15388
15389 echo "$as_me:15389: checking if you want to turn on gcc warnings" >&5
15390 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15391
15392 # Check whether --enable-warnings or --disable-warnings was given.
15393 if test "${enable_warnings+set}" = set; then
15394   enableval="$enable_warnings"
15395   test "$enableval" != yes && enableval=no
15396         if test "$enableval" != "no" ; then
15397     enable_warnings=yes
15398         else
15399                 enable_warnings=no
15400         fi
15401 else
15402   enableval=no
15403         enable_warnings=no
15404
15405 fi;
15406 echo "$as_me:15406: result: $enable_warnings" >&5
15407 echo "${ECHO_T}$enable_warnings" >&6
15408 if test "$enable_warnings" = "yes"
15409 then
15410
15411 if test "x$have_x" = xyes; then
15412
15413 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15414 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15415 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15416 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15417 for cf_X_CFLAGS in $X_CFLAGS
15418 do
15419         case "x$cf_X_CFLAGS" in
15420         x-[IUD]*)
15421                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15422                 ;;
15423         *)
15424                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15425                 ;;
15426         esac
15427 done
15428
15429 cat >"conftest.$ac_ext" <<_ACEOF
15430 #line 15430 "configure"
15431 #include "confdefs.h"
15432
15433 #include <stdlib.h>
15434 #include <X11/Intrinsic.h>
15435
15436 int
15437 main (void)
15438 {
15439 String foo = malloc(1); free((void*)foo)
15440   ;
15441   return 0;
15442 }
15443 _ACEOF
15444 rm -f "conftest.$ac_objext"
15445 if { (eval echo "$as_me:15445: \"$ac_compile\"") >&5
15446   (eval $ac_compile) 2>&5
15447   ac_status=$?
15448   echo "$as_me:15448: \$? = $ac_status" >&5
15449   (exit "$ac_status"); } &&
15450          { ac_try='test -s "conftest.$ac_objext"'
15451   { (eval echo "$as_me:15451: \"$ac_try\"") >&5
15452   (eval $ac_try) 2>&5
15453   ac_status=$?
15454   echo "$as_me:15454: \$? = $ac_status" >&5
15455   (exit "$ac_status"); }; }; then
15456
15457 echo "$as_me:15457: checking for X11/Xt const-feature" >&5
15458 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15459 if test "${cf_cv_const_x_string+set}" = set; then
15460   echo $ECHO_N "(cached) $ECHO_C" >&6
15461 else
15462
15463         cat >"conftest.$ac_ext" <<_ACEOF
15464 #line 15464 "configure"
15465 #include "confdefs.h"
15466
15467 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15468 #undef  XTSTRINGDEFINES /* X11R5 and later */
15469 #include <stdlib.h>
15470 #include <X11/Intrinsic.h>
15471
15472 int
15473 main (void)
15474 {
15475 String foo = malloc(1); *foo = 0
15476   ;
15477   return 0;
15478 }
15479 _ACEOF
15480 rm -f "conftest.$ac_objext"
15481 if { (eval echo "$as_me:15481: \"$ac_compile\"") >&5
15482   (eval $ac_compile) 2>&5
15483   ac_status=$?
15484   echo "$as_me:15484: \$? = $ac_status" >&5
15485   (exit "$ac_status"); } &&
15486          { ac_try='test -s "conftest.$ac_objext"'
15487   { (eval echo "$as_me:15487: \"$ac_try\"") >&5
15488   (eval $ac_try) 2>&5
15489   ac_status=$?
15490   echo "$as_me:15490: \$? = $ac_status" >&5
15491   (exit "$ac_status"); }; }; then
15492
15493                         cf_cv_const_x_string=no
15494
15495 else
15496   echo "$as_me: failed program was:" >&5
15497 cat "conftest.$ac_ext" >&5
15498
15499                         cf_cv_const_x_string=yes
15500
15501 fi
15502 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15503
15504 fi
15505 echo "$as_me:15505: result: $cf_cv_const_x_string" >&5
15506 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15507
15508 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15509 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15510 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15511
15512 case "$cf_cv_const_x_string" in
15513 (no)
15514
15515         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15516         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15517
15518         ;;
15519 (*)
15520
15521         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15522         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15523
15524         ;;
15525 esac
15526
15527 else
15528   echo "$as_me: failed program was:" >&5
15529 cat "conftest.$ac_ext" >&5
15530 fi
15531 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15532  fi
15533 cat > "conftest.$ac_ext" <<EOF
15534 #line 15534 "${as_me:-configure}"
15535 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15536 EOF
15537 if test "$INTEL_COMPILER" = yes
15538 then
15539 # The "-wdXXX" options suppress warnings:
15540 # remark #1419: external declaration in primary source file
15541 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15542 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15543 # remark #193: zero used for undefined preprocessing identifier
15544 # remark #593: variable "curs_sb_left_arrow" was set but never used
15545 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15546 # remark #869: parameter "tw" was never referenced
15547 # remark #981: operands are evaluated in unspecified order
15548 # warning #279: controlling expression is constant
15549
15550         { echo "$as_me:15550: checking for $CC warning options..." >&5
15551 echo "$as_me: checking for $CC warning options..." >&6;}
15552         cf_save_CFLAGS="$CFLAGS"
15553         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15554         for cf_opt in \
15555                 wd1419 \
15556                 wd1683 \
15557                 wd1684 \
15558                 wd193 \
15559                 wd593 \
15560                 wd279 \
15561                 wd810 \
15562                 wd869 \
15563                 wd981
15564         do
15565                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15566                 if { (eval echo "$as_me:15566: \"$ac_compile\"") >&5
15567   (eval $ac_compile) 2>&5
15568   ac_status=$?
15569   echo "$as_me:15569: \$? = $ac_status" >&5
15570   (exit "$ac_status"); }; then
15571                         test -n "$verbose" && echo "$as_me:15571: result: ... -$cf_opt" >&5
15572 echo "${ECHO_T}... -$cf_opt" >&6
15573                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15574                 fi
15575         done
15576         CFLAGS="$cf_save_CFLAGS"
15577 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15578 then
15579         { echo "$as_me:15579: checking for $CC warning options..." >&5
15580 echo "$as_me: checking for $CC warning options..." >&6;}
15581         cf_save_CFLAGS="$CFLAGS"
15582         cf_warn_CONST=""
15583         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15584         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15585         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15586         for cf_opt in W Wall \
15587                 Wbad-function-cast \
15588                 Wcast-align \
15589                 Wcast-qual \
15590                 Wdeclaration-after-statement \
15591                 Wextra \
15592                 Winline \
15593                 Wmissing-declarations \
15594                 Wmissing-prototypes \
15595                 Wnested-externs \
15596                 Wpointer-arith \
15597                 Wshadow \
15598                 Wstrict-prototypes \
15599                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15600         do
15601                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15602                 if { (eval echo "$as_me:15602: \"$ac_compile\"") >&5
15603   (eval $ac_compile) 2>&5
15604   ac_status=$?
15605   echo "$as_me:15605: \$? = $ac_status" >&5
15606   (exit "$ac_status"); }; then
15607                         test -n "$verbose" && echo "$as_me:15607: result: ... -$cf_opt" >&5
15608 echo "${ECHO_T}... -$cf_opt" >&6
15609                         case "$cf_opt" in
15610                         (Winline)
15611                                 case "$GCC_VERSION" in
15612                                 ([34].*)
15613                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15614
15615 echo "${as_me:-configure}:15615: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15616
15617                                         continue;;
15618                                 esac
15619                                 ;;
15620                         (Wpointer-arith)
15621                                 case "$GCC_VERSION" in
15622                                 ([12].*)
15623                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15624
15625 echo "${as_me:-configure}:15625: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15626
15627                                         continue;;
15628                                 esac
15629                                 ;;
15630                         esac
15631                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15632                 fi
15633         done
15634         CFLAGS="$cf_save_CFLAGS"
15635 fi
15636 rm -rf ./conftest*
15637
15638 fi
15639
15640 if test "$GCC" = yes || test "$GXX" = yes
15641 then
15642 cat > conftest.i <<EOF
15643 #ifndef GCC_PRINTF
15644 #define GCC_PRINTF 0
15645 #endif
15646 #ifndef GCC_SCANF
15647 #define GCC_SCANF 0
15648 #endif
15649 #ifndef GCC_NORETURN
15650 #define GCC_NORETURN /* nothing */
15651 #endif
15652 #ifndef GCC_UNUSED
15653 #define GCC_UNUSED /* nothing */
15654 #endif
15655 EOF
15656 if test "$GCC" = yes
15657 then
15658         { echo "$as_me:15658: checking for $CC __attribute__ directives..." >&5
15659 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15660 cat > "conftest.$ac_ext" <<EOF
15661 #line 15661 "${as_me:-configure}"
15662 #include "confdefs.h"
15663 #include "conftest.h"
15664 #include "conftest.i"
15665 #if     GCC_PRINTF
15666 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15667 #else
15668 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15669 #endif
15670 #if     GCC_SCANF
15671 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15672 #else
15673 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15674 #endif
15675 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15676 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15677 extern GCC_NORETURN void foo(void);
15678 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15679 EOF
15680         cf_printf_attribute=no
15681         cf_scanf_attribute=no
15682         for cf_attribute in scanf printf unused noreturn
15683         do
15684
15685 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15686
15687                 cf_directive="__attribute__(($cf_attribute))"
15688                 echo "checking for $CC $cf_directive" 1>&5
15689
15690                 case "$cf_attribute" in
15691                 (printf)
15692                         cf_printf_attribute=yes
15693                         cat >conftest.h <<EOF
15694 #define GCC_$cf_ATTRIBUTE 1
15695 EOF
15696                         ;;
15697                 (scanf)
15698                         cf_scanf_attribute=yes
15699                         cat >conftest.h <<EOF
15700 #define GCC_$cf_ATTRIBUTE 1
15701 EOF
15702                         ;;
15703                 (*)
15704                         cat >conftest.h <<EOF
15705 #define GCC_$cf_ATTRIBUTE $cf_directive
15706 EOF
15707                         ;;
15708                 esac
15709
15710                 if { (eval echo "$as_me:15710: \"$ac_compile\"") >&5
15711   (eval $ac_compile) 2>&5
15712   ac_status=$?
15713   echo "$as_me:15713: \$? = $ac_status" >&5
15714   (exit "$ac_status"); }; then
15715                         test -n "$verbose" && echo "$as_me:15715: result: ... $cf_attribute" >&5
15716 echo "${ECHO_T}... $cf_attribute" >&6
15717                         cat conftest.h >>confdefs.h
15718                         case "$cf_attribute" in
15719                         (noreturn)
15720
15721 cat >>confdefs.h <<EOF
15722 #define GCC_NORETURN $cf_directive
15723 EOF
15724
15725                                 ;;
15726                         (printf)
15727                                 cf_value='/* nothing */'
15728                                 if test "$cf_printf_attribute" != no ; then
15729                                         cf_value='__attribute__((format(printf,fmt,var)))'
15730
15731 cat >>confdefs.h <<\EOF
15732 #define GCC_PRINTF 1
15733 EOF
15734
15735                                 fi
15736
15737 cat >>confdefs.h <<EOF
15738 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15739 EOF
15740
15741                                 ;;
15742                         (scanf)
15743                                 cf_value='/* nothing */'
15744                                 if test "$cf_scanf_attribute" != no ; then
15745                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15746
15747 cat >>confdefs.h <<\EOF
15748 #define GCC_SCANF 1
15749 EOF
15750
15751                                 fi
15752
15753 cat >>confdefs.h <<EOF
15754 #define GCC_SCANFLIKE(fmt,var) $cf_value
15755 EOF
15756
15757                                 ;;
15758                         (unused)
15759
15760 cat >>confdefs.h <<EOF
15761 #define GCC_UNUSED $cf_directive
15762 EOF
15763
15764                                 ;;
15765                         esac
15766                 fi
15767         done
15768 else
15769         ${FGREP-fgrep} define conftest.i >>confdefs.h
15770 fi
15771 rm -rf ./conftest*
15772 fi
15773
15774 fi
15775
15776 if test "x$enable_warnings" = "xyes"; then
15777
15778         ADAFLAGS="$ADAFLAGS -gnatg"
15779
15780 fi
15781
15782 ###     use option --enable-assertions to turn on generation of assertion code
15783 echo "$as_me:15783: checking if you want to enable runtime assertions" >&5
15784 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15785
15786 # Check whether --enable-assertions or --disable-assertions was given.
15787 if test "${enable_assertions+set}" = set; then
15788   enableval="$enable_assertions"
15789   with_assertions=$enableval
15790 else
15791   with_assertions=no
15792 fi;
15793 echo "$as_me:15793: result: $with_assertions" >&5
15794 echo "${ECHO_T}$with_assertions" >&6
15795 if test -n "$GCC"
15796 then
15797         if test "$with_assertions" = no
15798         then
15799                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15800         else
15801
15802         ADAFLAGS="$ADAFLAGS -gnata"
15803
15804         fi
15805 fi
15806
15807 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15808
15809 cat >>confdefs.h <<\EOF
15810 #define HAVE_NC_ALLOC_H 1
15811 EOF
15812
15813 ###     use option --enable-expanded to generate certain macros as functions
15814
15815 # Check whether --enable-expanded or --disable-expanded was given.
15816 if test "${enable_expanded+set}" = set; then
15817   enableval="$enable_expanded"
15818   test "$enableval" = yes &&
15819 cat >>confdefs.h <<\EOF
15820 #define NCURSES_EXPANDED 1
15821 EOF
15822
15823 fi;
15824
15825 ###     use option --disable-macros to suppress macros in favor of functions
15826
15827 # Check whether --enable-macros or --disable-macros was given.
15828 if test "${enable_macros+set}" = set; then
15829   enableval="$enable_macros"
15830   test "$enableval" = no &&
15831 cat >>confdefs.h <<\EOF
15832 #define NCURSES_NOMACROS 1
15833 EOF
15834
15835 fi;
15836
15837 # Normally we only add trace() to the debug-library.  Allow this to be
15838 # extended to all models of the ncurses library:
15839 cf_all_traces=no
15840 case "$CFLAGS $CPPFLAGS" in
15841 (*-DTRACE*)
15842         cf_all_traces=yes
15843         ;;
15844 esac
15845
15846 echo "$as_me:15846: checking whether to add trace feature to all models" >&5
15847 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15848
15849 # Check whether --with-trace or --without-trace was given.
15850 if test "${with_trace+set}" = set; then
15851   withval="$with_trace"
15852   cf_with_trace=$withval
15853 else
15854   cf_with_trace=$cf_all_traces
15855 fi;
15856 echo "$as_me:15856: result: $cf_with_trace" >&5
15857 echo "${ECHO_T}$cf_with_trace" >&6
15858
15859 if test "$cf_with_trace" = yes ; then
15860         ADA_TRACE=TRUE
15861
15862 cf_fix_cppflags=no
15863 cf_new_cflags=
15864 cf_new_cppflags=
15865 cf_new_extra_cppflags=
15866
15867 for cf_add_cflags in -DTRACE
15868 do
15869 case "$cf_fix_cppflags" in
15870 (no)
15871         case "$cf_add_cflags" in
15872         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15873                 case "$cf_add_cflags" in
15874                 (-D*)
15875                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15876
15877                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15878                                 && test -z "${cf_tst_cflags}" \
15879                                 && cf_fix_cppflags=yes
15880
15881                         if test "$cf_fix_cppflags" = yes ; then
15882
15883         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15884         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15885
15886                                 continue
15887                         elif test "${cf_tst_cflags}" = "\"'" ; then
15888
15889         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15890         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15891
15892                                 continue
15893                         fi
15894                         ;;
15895                 esac
15896                 case "$CPPFLAGS" in
15897                 (*$cf_add_cflags)
15898                         ;;
15899                 (*)
15900                         case "$cf_add_cflags" in
15901                         (-D*)
15902                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15903
15904 CPPFLAGS=`echo "$CPPFLAGS" | \
15905         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15906                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15907
15908                                 ;;
15909                         esac
15910
15911         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15912         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15913
15914                         ;;
15915                 esac
15916                 ;;
15917         (*)
15918
15919         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15920         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15921
15922                 ;;
15923         esac
15924         ;;
15925 (yes)
15926
15927         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15928         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15929
15930         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15931
15932         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15933                 && test -z "${cf_tst_cflags}" \
15934                 && cf_fix_cppflags=no
15935         ;;
15936 esac
15937 done
15938
15939 if test -n "$cf_new_cflags" ; then
15940
15941         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15942         CFLAGS="${CFLAGS}$cf_new_cflags"
15943
15944 fi
15945
15946 if test -n "$cf_new_cppflags" ; then
15947
15948         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15949         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15950
15951 fi
15952
15953 if test -n "$cf_new_extra_cppflags" ; then
15954
15955         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15956         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15957
15958 fi
15959
15960 else
15961         ADA_TRACE=FALSE
15962 fi
15963
15964 echo "$as_me:15964: checking if we want to use GNAT projects" >&5
15965 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15966
15967 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15968 if test "${enable_gnat_projects+set}" = set; then
15969   enableval="$enable_gnat_projects"
15970   test "$enableval" != no && enableval=yes
15971         if test "$enableval" != "yes" ; then
15972     enable_gnat_projects=no
15973         else
15974                 enable_gnat_projects=yes
15975         fi
15976 else
15977   enableval=yes
15978         enable_gnat_projects=yes
15979
15980 fi;
15981 echo "$as_me:15981: result: $enable_gnat_projects" >&5
15982 echo "${ECHO_T}$enable_gnat_projects" >&6
15983
15984 ###     Checks for libraries.
15985 case $cf_cv_system_name in
15986 (*mingw32*)
15987         ;;
15988 (*)
15989 echo "$as_me:15989: checking for gettimeofday" >&5
15990 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15991 if test "${ac_cv_func_gettimeofday+set}" = set; then
15992   echo $ECHO_N "(cached) $ECHO_C" >&6
15993 else
15994   cat >"conftest.$ac_ext" <<_ACEOF
15995 #line 15995 "configure"
15996 #include "confdefs.h"
15997 #define gettimeofday autoconf_temporary
15998 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15999 #undef gettimeofday
16000
16001 #ifdef __cplusplus
16002 extern "C"
16003 #endif
16004
16005 /* We use char because int might match the return type of a gcc2
16006    builtin and then its argument prototype would still apply.  */
16007 char gettimeofday (void);
16008
16009 int
16010 main (void)
16011 {
16012
16013 /* The GNU C library defines stubs for functions which it implements
16014     to always fail with ENOSYS.  Some functions are actually named
16015     something starting with __ and the normal name is an alias.  */
16016 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16017 #error found stub for gettimeofday
16018 #endif
16019
16020         return gettimeofday ();
16021   ;
16022   return 0;
16023 }
16024 _ACEOF
16025 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16026 if { (eval echo "$as_me:16026: \"$ac_link\"") >&5
16027   (eval $ac_link) 2>&5
16028   ac_status=$?
16029   echo "$as_me:16029: \$? = $ac_status" >&5
16030   (exit "$ac_status"); } &&
16031          { ac_try='test -s "conftest$ac_exeext"'
16032   { (eval echo "$as_me:16032: \"$ac_try\"") >&5
16033   (eval $ac_try) 2>&5
16034   ac_status=$?
16035   echo "$as_me:16035: \$? = $ac_status" >&5
16036   (exit "$ac_status"); }; }; then
16037   ac_cv_func_gettimeofday=yes
16038 else
16039   echo "$as_me: failed program was:" >&5
16040 cat "conftest.$ac_ext" >&5
16041 ac_cv_func_gettimeofday=no
16042 fi
16043 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16044 fi
16045 echo "$as_me:16045: result: $ac_cv_func_gettimeofday" >&5
16046 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16047 if test "$ac_cv_func_gettimeofday" = yes; then
16048   cat >>confdefs.h <<\EOF
16049 #define HAVE_GETTIMEOFDAY 1
16050 EOF
16051
16052 else
16053
16054 echo "$as_me:16054: checking for gettimeofday in -lbsd" >&5
16055 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16056 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16057   echo $ECHO_N "(cached) $ECHO_C" >&6
16058 else
16059   ac_check_lib_save_LIBS=$LIBS
16060 LIBS="-lbsd  $LIBS"
16061 cat >"conftest.$ac_ext" <<_ACEOF
16062 #line 16062 "configure"
16063 #include "confdefs.h"
16064
16065 /* Override any gcc2 internal prototype to avoid an error.  */
16066 #ifdef __cplusplus
16067 extern "C"
16068 #endif
16069 /* We use char because int might match the return type of a gcc2
16070    builtin and then its argument prototype would still apply.  */
16071 char gettimeofday ();
16072 int
16073 main (void)
16074 {
16075 gettimeofday ();
16076   ;
16077   return 0;
16078 }
16079 _ACEOF
16080 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16081 if { (eval echo "$as_me:16081: \"$ac_link\"") >&5
16082   (eval $ac_link) 2>&5
16083   ac_status=$?
16084   echo "$as_me:16084: \$? = $ac_status" >&5
16085   (exit "$ac_status"); } &&
16086          { ac_try='test -s "conftest$ac_exeext"'
16087   { (eval echo "$as_me:16087: \"$ac_try\"") >&5
16088   (eval $ac_try) 2>&5
16089   ac_status=$?
16090   echo "$as_me:16090: \$? = $ac_status" >&5
16091   (exit "$ac_status"); }; }; then
16092   ac_cv_lib_bsd_gettimeofday=yes
16093 else
16094   echo "$as_me: failed program was:" >&5
16095 cat "conftest.$ac_ext" >&5
16096 ac_cv_lib_bsd_gettimeofday=no
16097 fi
16098 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16099 LIBS=$ac_check_lib_save_LIBS
16100 fi
16101 echo "$as_me:16101: result: $ac_cv_lib_bsd_gettimeofday" >&5
16102 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16103 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16104
16105 cat >>confdefs.h <<\EOF
16106 #define HAVE_GETTIMEOFDAY 1
16107 EOF
16108
16109         LIBS="$LIBS -lbsd"
16110 fi
16111
16112 fi
16113         ;;
16114 esac
16115
16116 ###     Checks for header files.
16117 echo "$as_me:16117: checking for ANSI C header files" >&5
16118 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16119 if test "${ac_cv_header_stdc+set}" = set; then
16120   echo $ECHO_N "(cached) $ECHO_C" >&6
16121 else
16122   cat >"conftest.$ac_ext" <<_ACEOF
16123 #line 16123 "configure"
16124 #include "confdefs.h"
16125 #include <stdlib.h>
16126 #include <stdarg.h>
16127 #include <string.h>
16128 #include <float.h>
16129
16130 _ACEOF
16131 if { (eval echo "$as_me:16131: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16132   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16133   ac_status=$?
16134   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16135   rm -f conftest.er1
16136   cat conftest.err >&5
16137   echo "$as_me:16137: \$? = $ac_status" >&5
16138   (exit "$ac_status"); } >/dev/null; then
16139   if test -s conftest.err; then
16140     ac_cpp_err=$ac_c_preproc_warn_flag
16141   else
16142     ac_cpp_err=
16143   fi
16144 else
16145   ac_cpp_err=yes
16146 fi
16147 if test -z "$ac_cpp_err"; then
16148   ac_cv_header_stdc=yes
16149 else
16150   echo "$as_me: failed program was:" >&5
16151   cat "conftest.$ac_ext" >&5
16152   ac_cv_header_stdc=no
16153 fi
16154 rm -f conftest.err "conftest.$ac_ext"
16155
16156 if test $ac_cv_header_stdc = yes; then
16157   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16158   cat >"conftest.$ac_ext" <<_ACEOF
16159 #line 16159 "configure"
16160 #include "confdefs.h"
16161 #include <string.h>
16162
16163 _ACEOF
16164 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16165   $EGREP "memchr" >/dev/null 2>&1; then
16166   :
16167 else
16168   ac_cv_header_stdc=no
16169 fi
16170 rm -rf conftest*
16171
16172 fi
16173
16174 if test $ac_cv_header_stdc = yes; then
16175   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16176   cat >"conftest.$ac_ext" <<_ACEOF
16177 #line 16177 "configure"
16178 #include "confdefs.h"
16179 #include <stdlib.h>
16180
16181 _ACEOF
16182 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16183   $EGREP "free" >/dev/null 2>&1; then
16184   :
16185 else
16186   ac_cv_header_stdc=no
16187 fi
16188 rm -rf conftest*
16189
16190 fi
16191
16192 if test $ac_cv_header_stdc = yes; then
16193   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16194   if test "$cross_compiling" = yes; then
16195   :
16196 else
16197   cat >"conftest.$ac_ext" <<_ACEOF
16198 #line 16198 "configure"
16199 #include "confdefs.h"
16200 #include <ctype.h>
16201 #if ((' ' & 0x0FF) == 0x020)
16202 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16203 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16204 #else
16205 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16206                      || ('j' <= (c) && (c) <= 'r') \
16207                      || ('s' <= (c) && (c) <= 'z'))
16208 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16209 #endif
16210
16211 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16212 int
16213 main (void)
16214 {
16215   int i;
16216   for (i = 0; i < 256; i++)
16217     if (XOR (islower (i), ISLOWER (i))
16218         || toupper (i) != TOUPPER (i))
16219       $ac_main_return(2);
16220   $ac_main_return (0);
16221 }
16222 _ACEOF
16223 rm -f "conftest$ac_exeext"
16224 if { (eval echo "$as_me:16224: \"$ac_link\"") >&5
16225   (eval $ac_link) 2>&5
16226   ac_status=$?
16227   echo "$as_me:16227: \$? = $ac_status" >&5
16228   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16229   { (eval echo "$as_me:16229: \"$ac_try\"") >&5
16230   (eval $ac_try) 2>&5
16231   ac_status=$?
16232   echo "$as_me:16232: \$? = $ac_status" >&5
16233   (exit "$ac_status"); }; }; then
16234   :
16235 else
16236   echo "$as_me: program exited with status $ac_status" >&5
16237 echo "$as_me: failed program was:" >&5
16238 cat "conftest.$ac_ext" >&5
16239 ac_cv_header_stdc=no
16240 fi
16241 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16242 fi
16243 fi
16244 fi
16245 echo "$as_me:16245: result: $ac_cv_header_stdc" >&5
16246 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16247 if test $ac_cv_header_stdc = yes; then
16248
16249 cat >>confdefs.h <<\EOF
16250 #define STDC_HEADERS 1
16251 EOF
16252
16253 fi
16254
16255 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16256
16257 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16258                   inttypes.h stdint.h unistd.h
16259 do
16260 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16261 echo "$as_me:16261: checking for $ac_header" >&5
16262 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16263 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16264   echo $ECHO_N "(cached) $ECHO_C" >&6
16265 else
16266   cat >"conftest.$ac_ext" <<_ACEOF
16267 #line 16267 "configure"
16268 #include "confdefs.h"
16269 $ac_includes_default
16270 #include <$ac_header>
16271 _ACEOF
16272 rm -f "conftest.$ac_objext"
16273 if { (eval echo "$as_me:16273: \"$ac_compile\"") >&5
16274   (eval $ac_compile) 2>&5
16275   ac_status=$?
16276   echo "$as_me:16276: \$? = $ac_status" >&5
16277   (exit "$ac_status"); } &&
16278          { ac_try='test -s "conftest.$ac_objext"'
16279   { (eval echo "$as_me:16279: \"$ac_try\"") >&5
16280   (eval $ac_try) 2>&5
16281   ac_status=$?
16282   echo "$as_me:16282: \$? = $ac_status" >&5
16283   (exit "$ac_status"); }; }; then
16284   eval "$as_ac_Header=yes"
16285 else
16286   echo "$as_me: failed program was:" >&5
16287 cat "conftest.$ac_ext" >&5
16288 eval "$as_ac_Header=no"
16289 fi
16290 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16291 fi
16292 echo "$as_me:16292: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16293 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16294 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16295   cat >>confdefs.h <<EOF
16296 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16297 EOF
16298
16299 fi
16300 done
16301
16302 echo "$as_me:16302: checking for signed char" >&5
16303 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16304 if test "${ac_cv_type_signed_char+set}" = set; then
16305   echo $ECHO_N "(cached) $ECHO_C" >&6
16306 else
16307   cat >"conftest.$ac_ext" <<_ACEOF
16308 #line 16308 "configure"
16309 #include "confdefs.h"
16310 $ac_includes_default
16311 int
16312 main (void)
16313 {
16314 if ((signed char *) 0)
16315   return 0;
16316 if (sizeof (signed char))
16317   return 0;
16318   ;
16319   return 0;
16320 }
16321 _ACEOF
16322 rm -f "conftest.$ac_objext"
16323 if { (eval echo "$as_me:16323: \"$ac_compile\"") >&5
16324   (eval $ac_compile) 2>&5
16325   ac_status=$?
16326   echo "$as_me:16326: \$? = $ac_status" >&5
16327   (exit "$ac_status"); } &&
16328          { ac_try='test -s "conftest.$ac_objext"'
16329   { (eval echo "$as_me:16329: \"$ac_try\"") >&5
16330   (eval $ac_try) 2>&5
16331   ac_status=$?
16332   echo "$as_me:16332: \$? = $ac_status" >&5
16333   (exit "$ac_status"); }; }; then
16334   ac_cv_type_signed_char=yes
16335 else
16336   echo "$as_me: failed program was:" >&5
16337 cat "conftest.$ac_ext" >&5
16338 ac_cv_type_signed_char=no
16339 fi
16340 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16341 fi
16342 echo "$as_me:16342: result: $ac_cv_type_signed_char" >&5
16343 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16344
16345 echo "$as_me:16345: checking size of signed char" >&5
16346 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16347 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16348   echo $ECHO_N "(cached) $ECHO_C" >&6
16349 else
16350   if test "$ac_cv_type_signed_char" = yes; then
16351   if test "$cross_compiling" = yes; then
16352   # Depending upon the size, compute the lo and hi bounds.
16353 cat >"conftest.$ac_ext" <<_ACEOF
16354 #line 16354 "configure"
16355 #include "confdefs.h"
16356 $ac_includes_default
16357 int
16358 main (void)
16359 {
16360 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16361   ;
16362   return 0;
16363 }
16364 _ACEOF
16365 rm -f "conftest.$ac_objext"
16366 if { (eval echo "$as_me:16366: \"$ac_compile\"") >&5
16367   (eval $ac_compile) 2>&5
16368   ac_status=$?
16369   echo "$as_me:16369: \$? = $ac_status" >&5
16370   (exit "$ac_status"); } &&
16371          { ac_try='test -s "conftest.$ac_objext"'
16372   { (eval echo "$as_me:16372: \"$ac_try\"") >&5
16373   (eval $ac_try) 2>&5
16374   ac_status=$?
16375   echo "$as_me:16375: \$? = $ac_status" >&5
16376   (exit "$ac_status"); }; }; then
16377   ac_lo=0 ac_mid=0
16378   while :; do
16379     cat >"conftest.$ac_ext" <<_ACEOF
16380 #line 16380 "configure"
16381 #include "confdefs.h"
16382 $ac_includes_default
16383 int
16384 main (void)
16385 {
16386 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16387   ;
16388   return 0;
16389 }
16390 _ACEOF
16391 rm -f "conftest.$ac_objext"
16392 if { (eval echo "$as_me:16392: \"$ac_compile\"") >&5
16393   (eval $ac_compile) 2>&5
16394   ac_status=$?
16395   echo "$as_me:16395: \$? = $ac_status" >&5
16396   (exit "$ac_status"); } &&
16397          { ac_try='test -s "conftest.$ac_objext"'
16398   { (eval echo "$as_me:16398: \"$ac_try\"") >&5
16399   (eval $ac_try) 2>&5
16400   ac_status=$?
16401   echo "$as_me:16401: \$? = $ac_status" >&5
16402   (exit "$ac_status"); }; }; then
16403   ac_hi=$ac_mid; break
16404 else
16405   echo "$as_me: failed program was:" >&5
16406 cat "conftest.$ac_ext" >&5
16407 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16408 fi
16409 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16410   done
16411 else
16412   echo "$as_me: failed program was:" >&5
16413 cat "conftest.$ac_ext" >&5
16414 ac_hi=-1 ac_mid=-1
16415   while :; do
16416     cat >"conftest.$ac_ext" <<_ACEOF
16417 #line 16417 "configure"
16418 #include "confdefs.h"
16419 $ac_includes_default
16420 int
16421 main (void)
16422 {
16423 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16424   ;
16425   return 0;
16426 }
16427 _ACEOF
16428 rm -f "conftest.$ac_objext"
16429 if { (eval echo "$as_me:16429: \"$ac_compile\"") >&5
16430   (eval $ac_compile) 2>&5
16431   ac_status=$?
16432   echo "$as_me:16432: \$? = $ac_status" >&5
16433   (exit "$ac_status"); } &&
16434          { ac_try='test -s "conftest.$ac_objext"'
16435   { (eval echo "$as_me:16435: \"$ac_try\"") >&5
16436   (eval $ac_try) 2>&5
16437   ac_status=$?
16438   echo "$as_me:16438: \$? = $ac_status" >&5
16439   (exit "$ac_status"); }; }; then
16440   ac_lo=$ac_mid; break
16441 else
16442   echo "$as_me: failed program was:" >&5
16443 cat "conftest.$ac_ext" >&5
16444 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16445 fi
16446 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16447   done
16448 fi
16449 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16450 # Binary search between lo and hi bounds.
16451 while test "x$ac_lo" != "x$ac_hi"; do
16452   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16453   cat >"conftest.$ac_ext" <<_ACEOF
16454 #line 16454 "configure"
16455 #include "confdefs.h"
16456 $ac_includes_default
16457 int
16458 main (void)
16459 {
16460 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16461   ;
16462   return 0;
16463 }
16464 _ACEOF
16465 rm -f "conftest.$ac_objext"
16466 if { (eval echo "$as_me:16466: \"$ac_compile\"") >&5
16467   (eval $ac_compile) 2>&5
16468   ac_status=$?
16469   echo "$as_me:16469: \$? = $ac_status" >&5
16470   (exit "$ac_status"); } &&
16471          { ac_try='test -s "conftest.$ac_objext"'
16472   { (eval echo "$as_me:16472: \"$ac_try\"") >&5
16473   (eval $ac_try) 2>&5
16474   ac_status=$?
16475   echo "$as_me:16475: \$? = $ac_status" >&5
16476   (exit "$ac_status"); }; }; then
16477   ac_hi=$ac_mid
16478 else
16479   echo "$as_me: failed program was:" >&5
16480 cat "conftest.$ac_ext" >&5
16481 ac_lo=`expr "$ac_mid" + 1`
16482 fi
16483 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16484 done
16485 ac_cv_sizeof_signed_char=$ac_lo
16486 else
16487   if test "$cross_compiling" = yes; then
16488   { { echo "$as_me:16488: error: cannot run test program while cross compiling" >&5
16489 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16490    { (exit 1); exit 1; }; }
16491 else
16492   cat >"conftest.$ac_ext" <<_ACEOF
16493 #line 16493 "configure"
16494 #include "confdefs.h"
16495 $ac_includes_default
16496 int
16497 main (void)
16498 {
16499 FILE *f = fopen ("conftest.val", "w");
16500 if (!f)
16501   $ac_main_return (1);
16502 fprintf (f, "%ld", (long)(sizeof (signed char)));
16503 fclose (f);
16504   ;
16505   return 0;
16506 }
16507 _ACEOF
16508 rm -f "conftest$ac_exeext"
16509 if { (eval echo "$as_me:16509: \"$ac_link\"") >&5
16510   (eval $ac_link) 2>&5
16511   ac_status=$?
16512   echo "$as_me:16512: \$? = $ac_status" >&5
16513   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16514   { (eval echo "$as_me:16514: \"$ac_try\"") >&5
16515   (eval $ac_try) 2>&5
16516   ac_status=$?
16517   echo "$as_me:16517: \$? = $ac_status" >&5
16518   (exit "$ac_status"); }; }; then
16519   ac_cv_sizeof_signed_char=`cat conftest.val`
16520 else
16521   echo "$as_me: program exited with status $ac_status" >&5
16522 echo "$as_me: failed program was:" >&5
16523 cat "conftest.$ac_ext" >&5
16524 fi
16525 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16526 fi
16527 fi
16528 rm -f conftest.val
16529 else
16530   ac_cv_sizeof_signed_char=0
16531 fi
16532 fi
16533 echo "$as_me:16533: result: $ac_cv_sizeof_signed_char" >&5
16534 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16535 cat >>confdefs.h <<EOF
16536 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16537 EOF
16538
16539 echo "$as_me:16539: checking for ANSI C header files" >&5
16540 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16541 if test "${ac_cv_header_stdc+set}" = set; then
16542   echo $ECHO_N "(cached) $ECHO_C" >&6
16543 else
16544   cat >"conftest.$ac_ext" <<_ACEOF
16545 #line 16545 "configure"
16546 #include "confdefs.h"
16547 #include <stdlib.h>
16548 #include <stdarg.h>
16549 #include <string.h>
16550 #include <float.h>
16551
16552 _ACEOF
16553 if { (eval echo "$as_me:16553: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16554   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16555   ac_status=$?
16556   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16557   rm -f conftest.er1
16558   cat conftest.err >&5
16559   echo "$as_me:16559: \$? = $ac_status" >&5
16560   (exit "$ac_status"); } >/dev/null; then
16561   if test -s conftest.err; then
16562     ac_cpp_err=$ac_c_preproc_warn_flag
16563   else
16564     ac_cpp_err=
16565   fi
16566 else
16567   ac_cpp_err=yes
16568 fi
16569 if test -z "$ac_cpp_err"; then
16570   ac_cv_header_stdc=yes
16571 else
16572   echo "$as_me: failed program was:" >&5
16573   cat "conftest.$ac_ext" >&5
16574   ac_cv_header_stdc=no
16575 fi
16576 rm -f conftest.err "conftest.$ac_ext"
16577
16578 if test $ac_cv_header_stdc = yes; then
16579   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16580   cat >"conftest.$ac_ext" <<_ACEOF
16581 #line 16581 "configure"
16582 #include "confdefs.h"
16583 #include <string.h>
16584
16585 _ACEOF
16586 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16587   $EGREP "memchr" >/dev/null 2>&1; then
16588   :
16589 else
16590   ac_cv_header_stdc=no
16591 fi
16592 rm -rf conftest*
16593
16594 fi
16595
16596 if test $ac_cv_header_stdc = yes; then
16597   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16598   cat >"conftest.$ac_ext" <<_ACEOF
16599 #line 16599 "configure"
16600 #include "confdefs.h"
16601 #include <stdlib.h>
16602
16603 _ACEOF
16604 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16605   $EGREP "free" >/dev/null 2>&1; then
16606   :
16607 else
16608   ac_cv_header_stdc=no
16609 fi
16610 rm -rf conftest*
16611
16612 fi
16613
16614 if test $ac_cv_header_stdc = yes; then
16615   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16616   if test "$cross_compiling" = yes; then
16617   :
16618 else
16619   cat >"conftest.$ac_ext" <<_ACEOF
16620 #line 16620 "configure"
16621 #include "confdefs.h"
16622 #include <ctype.h>
16623 #if ((' ' & 0x0FF) == 0x020)
16624 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16625 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16626 #else
16627 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16628                      || ('j' <= (c) && (c) <= 'r') \
16629                      || ('s' <= (c) && (c) <= 'z'))
16630 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16631 #endif
16632
16633 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16634 int
16635 main (void)
16636 {
16637   int i;
16638   for (i = 0; i < 256; i++)
16639     if (XOR (islower (i), ISLOWER (i))
16640         || toupper (i) != TOUPPER (i))
16641       $ac_main_return(2);
16642   $ac_main_return (0);
16643 }
16644 _ACEOF
16645 rm -f "conftest$ac_exeext"
16646 if { (eval echo "$as_me:16646: \"$ac_link\"") >&5
16647   (eval $ac_link) 2>&5
16648   ac_status=$?
16649   echo "$as_me:16649: \$? = $ac_status" >&5
16650   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16651   { (eval echo "$as_me:16651: \"$ac_try\"") >&5
16652   (eval $ac_try) 2>&5
16653   ac_status=$?
16654   echo "$as_me:16654: \$? = $ac_status" >&5
16655   (exit "$ac_status"); }; }; then
16656   :
16657 else
16658   echo "$as_me: program exited with status $ac_status" >&5
16659 echo "$as_me: failed program was:" >&5
16660 cat "conftest.$ac_ext" >&5
16661 ac_cv_header_stdc=no
16662 fi
16663 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16664 fi
16665 fi
16666 fi
16667 echo "$as_me:16667: result: $ac_cv_header_stdc" >&5
16668 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16669 if test $ac_cv_header_stdc = yes; then
16670
16671 cat >>confdefs.h <<\EOF
16672 #define STDC_HEADERS 1
16673 EOF
16674
16675 fi
16676
16677 ac_header_dirent=no
16678 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16679   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16680 echo "$as_me:16680: checking for $ac_hdr that defines DIR" >&5
16681 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16682 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16683   echo $ECHO_N "(cached) $ECHO_C" >&6
16684 else
16685   cat >"conftest.$ac_ext" <<_ACEOF
16686 #line 16686 "configure"
16687 #include "confdefs.h"
16688 #include <sys/types.h>
16689 #include <$ac_hdr>
16690
16691 int
16692 main (void)
16693 {
16694 if ((DIR *) 0)
16695 return 0;
16696   ;
16697   return 0;
16698 }
16699 _ACEOF
16700 rm -f "conftest.$ac_objext"
16701 if { (eval echo "$as_me:16701: \"$ac_compile\"") >&5
16702   (eval $ac_compile) 2>&5
16703   ac_status=$?
16704   echo "$as_me:16704: \$? = $ac_status" >&5
16705   (exit "$ac_status"); } &&
16706          { ac_try='test -s "conftest.$ac_objext"'
16707   { (eval echo "$as_me:16707: \"$ac_try\"") >&5
16708   (eval $ac_try) 2>&5
16709   ac_status=$?
16710   echo "$as_me:16710: \$? = $ac_status" >&5
16711   (exit "$ac_status"); }; }; then
16712   eval "$as_ac_Header=yes"
16713 else
16714   echo "$as_me: failed program was:" >&5
16715 cat "conftest.$ac_ext" >&5
16716 eval "$as_ac_Header=no"
16717 fi
16718 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16719 fi
16720 echo "$as_me:16720: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16721 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16722 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16723   cat >>confdefs.h <<EOF
16724 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16725 EOF
16726
16727 ac_header_dirent=$ac_hdr; break
16728 fi
16729
16730 done
16731 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16732 if test $ac_header_dirent = dirent.h; then
16733   echo "$as_me:16733: checking for opendir in -ldir" >&5
16734 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16735 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16736   echo $ECHO_N "(cached) $ECHO_C" >&6
16737 else
16738   ac_check_lib_save_LIBS=$LIBS
16739 LIBS="-ldir  $LIBS"
16740 cat >"conftest.$ac_ext" <<_ACEOF
16741 #line 16741 "configure"
16742 #include "confdefs.h"
16743
16744 /* Override any gcc2 internal prototype to avoid an error.  */
16745 #ifdef __cplusplus
16746 extern "C"
16747 #endif
16748 /* We use char because int might match the return type of a gcc2
16749    builtin and then its argument prototype would still apply.  */
16750 char opendir ();
16751 int
16752 main (void)
16753 {
16754 opendir ();
16755   ;
16756   return 0;
16757 }
16758 _ACEOF
16759 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16760 if { (eval echo "$as_me:16760: \"$ac_link\"") >&5
16761   (eval $ac_link) 2>&5
16762   ac_status=$?
16763   echo "$as_me:16763: \$? = $ac_status" >&5
16764   (exit "$ac_status"); } &&
16765          { ac_try='test -s "conftest$ac_exeext"'
16766   { (eval echo "$as_me:16766: \"$ac_try\"") >&5
16767   (eval $ac_try) 2>&5
16768   ac_status=$?
16769   echo "$as_me:16769: \$? = $ac_status" >&5
16770   (exit "$ac_status"); }; }; then
16771   ac_cv_lib_dir_opendir=yes
16772 else
16773   echo "$as_me: failed program was:" >&5
16774 cat "conftest.$ac_ext" >&5
16775 ac_cv_lib_dir_opendir=no
16776 fi
16777 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16778 LIBS=$ac_check_lib_save_LIBS
16779 fi
16780 echo "$as_me:16780: result: $ac_cv_lib_dir_opendir" >&5
16781 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16782 if test "$ac_cv_lib_dir_opendir" = yes; then
16783   LIBS="$LIBS -ldir"
16784 fi
16785
16786 else
16787   echo "$as_me:16787: checking for opendir in -lx" >&5
16788 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16789 if test "${ac_cv_lib_x_opendir+set}" = set; then
16790   echo $ECHO_N "(cached) $ECHO_C" >&6
16791 else
16792   ac_check_lib_save_LIBS=$LIBS
16793 LIBS="-lx  $LIBS"
16794 cat >"conftest.$ac_ext" <<_ACEOF
16795 #line 16795 "configure"
16796 #include "confdefs.h"
16797
16798 /* Override any gcc2 internal prototype to avoid an error.  */
16799 #ifdef __cplusplus
16800 extern "C"
16801 #endif
16802 /* We use char because int might match the return type of a gcc2
16803    builtin and then its argument prototype would still apply.  */
16804 char opendir ();
16805 int
16806 main (void)
16807 {
16808 opendir ();
16809   ;
16810   return 0;
16811 }
16812 _ACEOF
16813 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16814 if { (eval echo "$as_me:16814: \"$ac_link\"") >&5
16815   (eval $ac_link) 2>&5
16816   ac_status=$?
16817   echo "$as_me:16817: \$? = $ac_status" >&5
16818   (exit "$ac_status"); } &&
16819          { ac_try='test -s "conftest$ac_exeext"'
16820   { (eval echo "$as_me:16820: \"$ac_try\"") >&5
16821   (eval $ac_try) 2>&5
16822   ac_status=$?
16823   echo "$as_me:16823: \$? = $ac_status" >&5
16824   (exit "$ac_status"); }; }; then
16825   ac_cv_lib_x_opendir=yes
16826 else
16827   echo "$as_me: failed program was:" >&5
16828 cat "conftest.$ac_ext" >&5
16829 ac_cv_lib_x_opendir=no
16830 fi
16831 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16832 LIBS=$ac_check_lib_save_LIBS
16833 fi
16834 echo "$as_me:16834: result: $ac_cv_lib_x_opendir" >&5
16835 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16836 if test "$ac_cv_lib_x_opendir" = yes; then
16837   LIBS="$LIBS -lx"
16838 fi
16839
16840 fi
16841
16842 echo "$as_me:16842: checking whether time.h and sys/time.h may both be included" >&5
16843 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16844 if test "${ac_cv_header_time+set}" = set; then
16845   echo $ECHO_N "(cached) $ECHO_C" >&6
16846 else
16847   cat >"conftest.$ac_ext" <<_ACEOF
16848 #line 16848 "configure"
16849 #include "confdefs.h"
16850 #include <sys/types.h>
16851 #include <sys/time.h>
16852 #include <time.h>
16853
16854 int
16855 main (void)
16856 {
16857 if ((struct tm *) 0)
16858 return 0;
16859   ;
16860   return 0;
16861 }
16862 _ACEOF
16863 rm -f "conftest.$ac_objext"
16864 if { (eval echo "$as_me:16864: \"$ac_compile\"") >&5
16865   (eval $ac_compile) 2>&5
16866   ac_status=$?
16867   echo "$as_me:16867: \$? = $ac_status" >&5
16868   (exit "$ac_status"); } &&
16869          { ac_try='test -s "conftest.$ac_objext"'
16870   { (eval echo "$as_me:16870: \"$ac_try\"") >&5
16871   (eval $ac_try) 2>&5
16872   ac_status=$?
16873   echo "$as_me:16873: \$? = $ac_status" >&5
16874   (exit "$ac_status"); }; }; then
16875   ac_cv_header_time=yes
16876 else
16877   echo "$as_me: failed program was:" >&5
16878 cat "conftest.$ac_ext" >&5
16879 ac_cv_header_time=no
16880 fi
16881 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16882 fi
16883 echo "$as_me:16883: result: $ac_cv_header_time" >&5
16884 echo "${ECHO_T}$ac_cv_header_time" >&6
16885 if test $ac_cv_header_time = yes; then
16886
16887 cat >>confdefs.h <<\EOF
16888 #define TIME_WITH_SYS_TIME 1
16889 EOF
16890
16891 fi
16892
16893 ###     checks for compiler characteristics
16894 ac_ext=c
16895 ac_cpp='$CPP $CPPFLAGS'
16896 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16897 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16898 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16899 ac_main_return="return"
16900
16901 echo "$as_me:16901: checking for an ANSI C-conforming const" >&5
16902 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16903 if test "${ac_cv_c_const+set}" = set; then
16904   echo $ECHO_N "(cached) $ECHO_C" >&6
16905 else
16906   cat >"conftest.$ac_ext" <<_ACEOF
16907 #line 16907 "configure"
16908 #include "confdefs.h"
16909
16910 int
16911 main (void)
16912 {
16913 /* FIXME: Include the comments suggested by Paul. */
16914 #ifndef __cplusplus
16915   /* Ultrix mips cc rejects this.  */
16916   typedef int charset[2];
16917   const charset x;
16918   /* SunOS 4.1.1 cc rejects this.  */
16919   char const *const *ccp;
16920   char **p;
16921   /* NEC SVR4.0.2 mips cc rejects this.  */
16922   struct point {int x, y;};
16923   static struct point const zero = {0,0};
16924   /* AIX XL C 1.02.0.0 rejects this.
16925      It does not let you subtract one const X* pointer from another in
16926      an arm of an if-expression whose if-part is not a constant
16927      expression */
16928   const char *g = "string";
16929   ccp = &g + (g ? g-g : 0);
16930   /* HPUX 7.0 cc rejects these. */
16931   ++ccp;
16932   p = (char**) ccp;
16933   ccp = (char const *const *) p;
16934   { /* SCO 3.2v4 cc rejects this.  */
16935     char *t;
16936     char const *s = 0 ? (char *) 0 : (char const *) 0;
16937
16938     *t++ = 0;
16939   }
16940   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16941     int x[] = {25, 17};
16942     const int *foo = &x[0];
16943     ++foo;
16944   }
16945   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16946     typedef const int *iptr;
16947     iptr p = 0;
16948     ++p;
16949   }
16950   { /* AIX XL C 1.02.0.0 rejects this saying
16951        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16952     struct s { int j; const int *ap[3]; };
16953     struct s *b; b->j = 5;
16954   }
16955   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16956     const int foo = 10;
16957   }
16958 #endif
16959
16960   ;
16961   return 0;
16962 }
16963 _ACEOF
16964 rm -f "conftest.$ac_objext"
16965 if { (eval echo "$as_me:16965: \"$ac_compile\"") >&5
16966   (eval $ac_compile) 2>&5
16967   ac_status=$?
16968   echo "$as_me:16968: \$? = $ac_status" >&5
16969   (exit "$ac_status"); } &&
16970          { ac_try='test -s "conftest.$ac_objext"'
16971   { (eval echo "$as_me:16971: \"$ac_try\"") >&5
16972   (eval $ac_try) 2>&5
16973   ac_status=$?
16974   echo "$as_me:16974: \$? = $ac_status" >&5
16975   (exit "$ac_status"); }; }; then
16976   ac_cv_c_const=yes
16977 else
16978   echo "$as_me: failed program was:" >&5
16979 cat "conftest.$ac_ext" >&5
16980 ac_cv_c_const=no
16981 fi
16982 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16983 fi
16984 echo "$as_me:16984: result: $ac_cv_c_const" >&5
16985 echo "${ECHO_T}$ac_cv_c_const" >&6
16986 if test $ac_cv_c_const = no; then
16987
16988 cat >>confdefs.h <<\EOF
16989 #define const
16990 EOF
16991
16992 fi
16993
16994 ###     Checks for external-data
16995
16996 echo "$as_me:16996: checking if data-only library module links" >&5
16997 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16998 if test "${cf_cv_link_dataonly+set}" = set; then
16999   echo $ECHO_N "(cached) $ECHO_C" >&6
17000 else
17001
17002         rm -f conftest.a
17003         cat >conftest.$ac_ext <<EOF
17004 #line 17004 "configure"
17005 int     testdata[3] = { 123, 456, 789 };
17006 EOF
17007         if { (eval echo "$as_me:17007: \"$ac_compile\"") >&5
17008   (eval $ac_compile) 2>&5
17009   ac_status=$?
17010   echo "$as_me:17010: \$? = $ac_status" >&5
17011   (exit "$ac_status"); } ; then
17012                 mv conftest.o data.o && \
17013                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17014         fi
17015         rm -f conftest.$ac_ext data.o
17016         cat >conftest.$ac_ext <<EOF
17017 #line 17017 "configure"
17018 int     testfunc(void)
17019 {
17020 #if defined(NeXT)
17021         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17022 #else
17023         extern int testdata[3];
17024         return testdata[0] == 123
17025            &&  testdata[1] == 456
17026            &&  testdata[2] == 789;
17027 #endif
17028 }
17029 EOF
17030         if { (eval echo "$as_me:17030: \"$ac_compile\"") >&5
17031   (eval $ac_compile) 2>&5
17032   ac_status=$?
17033   echo "$as_me:17033: \$? = $ac_status" >&5
17034   (exit "$ac_status"); }; then
17035                 mv conftest.o func.o && \
17036                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17037         fi
17038         rm -f conftest.$ac_ext func.o
17039         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17040         cf_saveLIBS="$LIBS"
17041         LIBS="conftest.a $LIBS"
17042         if test "$cross_compiling" = yes; then
17043   cf_cv_link_dataonly=unknown
17044 else
17045   cat >"conftest.$ac_ext" <<_ACEOF
17046 #line 17046 "configure"
17047 #include "confdefs.h"
17048
17049         int main(void)
17050         {
17051                 extern int testfunc();
17052                 ${cf_cv_main_return:-return} (!testfunc());
17053         }
17054
17055 _ACEOF
17056 rm -f "conftest$ac_exeext"
17057 if { (eval echo "$as_me:17057: \"$ac_link\"") >&5
17058   (eval $ac_link) 2>&5
17059   ac_status=$?
17060   echo "$as_me:17060: \$? = $ac_status" >&5
17061   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17062   { (eval echo "$as_me:17062: \"$ac_try\"") >&5
17063   (eval $ac_try) 2>&5
17064   ac_status=$?
17065   echo "$as_me:17065: \$? = $ac_status" >&5
17066   (exit "$ac_status"); }; }; then
17067   cf_cv_link_dataonly=yes
17068 else
17069   echo "$as_me: program exited with status $ac_status" >&5
17070 echo "$as_me: failed program was:" >&5
17071 cat "conftest.$ac_ext" >&5
17072 cf_cv_link_dataonly=no
17073 fi
17074 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17075 fi
17076         LIBS="$cf_saveLIBS"
17077
17078 fi
17079
17080 echo "$as_me:17080: result: $cf_cv_link_dataonly" >&5
17081 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17082
17083 if test "$cf_cv_link_dataonly" = no ; then
17084
17085 cat >>confdefs.h <<\EOF
17086 #define BROKEN_LINKER 1
17087 EOF
17088
17089         BROKEN_LINKER=1
17090 fi
17091
17092 ###     Checks for library functions.
17093
17094 for ac_header in \
17095 unistd.h \
17096
17097 do
17098 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17099 echo "$as_me:17099: checking for $ac_header" >&5
17100 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17101 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17102   echo $ECHO_N "(cached) $ECHO_C" >&6
17103 else
17104   cat >"conftest.$ac_ext" <<_ACEOF
17105 #line 17105 "configure"
17106 #include "confdefs.h"
17107 #include <$ac_header>
17108 _ACEOF
17109 if { (eval echo "$as_me:17109: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17110   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17111   ac_status=$?
17112   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17113   rm -f conftest.er1
17114   cat conftest.err >&5
17115   echo "$as_me:17115: \$? = $ac_status" >&5
17116   (exit "$ac_status"); } >/dev/null; then
17117   if test -s conftest.err; then
17118     ac_cpp_err=$ac_c_preproc_warn_flag
17119   else
17120     ac_cpp_err=
17121   fi
17122 else
17123   ac_cpp_err=yes
17124 fi
17125 if test -z "$ac_cpp_err"; then
17126   eval "$as_ac_Header=yes"
17127 else
17128   echo "$as_me: failed program was:" >&5
17129   cat "conftest.$ac_ext" >&5
17130   eval "$as_ac_Header=no"
17131 fi
17132 rm -f conftest.err "conftest.$ac_ext"
17133 fi
17134 echo "$as_me:17134: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17135 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17136 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17137   cat >>confdefs.h <<EOF
17138 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17139 EOF
17140
17141 fi
17142 done
17143
17144 echo "$as_me:17144: checking for working mkstemp" >&5
17145 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17146 if test "${cf_cv_func_mkstemp+set}" = set; then
17147   echo $ECHO_N "(cached) $ECHO_C" >&6
17148 else
17149
17150 rm -rf ./conftest*
17151 if test "$cross_compiling" = yes; then
17152   cf_cv_func_mkstemp=maybe
17153 else
17154   cat >"conftest.$ac_ext" <<_ACEOF
17155 #line 17155 "configure"
17156 #include "confdefs.h"
17157
17158 #include <sys/types.h>
17159 #ifdef HAVE_UNISTD_H
17160 #include <unistd.h>
17161 #endif
17162 #include <stdlib.h>
17163 #include <stdio.h>
17164 #include <string.h>
17165 #include <sys/stat.h>
17166 int main(void)
17167 {
17168         char *tmpl = "conftestXXXXXX";
17169         char name[2][80];
17170         int n;
17171         int result = 0;
17172         int fd;
17173         struct stat sb;
17174
17175         umask(077);
17176         for (n = 0; n < 2; ++n) {
17177                 strcpy(name[n], tmpl);
17178                 if ((fd = mkstemp(name[n])) >= 0) {
17179                         if (!strcmp(name[n], tmpl)
17180                          || stat(name[n], &sb) != 0
17181                          || (sb.st_mode & S_IFMT) != S_IFREG
17182                          || (sb.st_mode & 077) != 0) {
17183                                 result = 1;
17184                         }
17185                         close(fd);
17186                 }
17187         }
17188         if (result == 0
17189          && !strcmp(name[0], name[1]))
17190                 result = 1;
17191         ${cf_cv_main_return:-return}(result);
17192 }
17193
17194 _ACEOF
17195 rm -f "conftest$ac_exeext"
17196 if { (eval echo "$as_me:17196: \"$ac_link\"") >&5
17197   (eval $ac_link) 2>&5
17198   ac_status=$?
17199   echo "$as_me:17199: \$? = $ac_status" >&5
17200   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17201   { (eval echo "$as_me:17201: \"$ac_try\"") >&5
17202   (eval $ac_try) 2>&5
17203   ac_status=$?
17204   echo "$as_me:17204: \$? = $ac_status" >&5
17205   (exit "$ac_status"); }; }; then
17206   cf_cv_func_mkstemp=yes
17207
17208 else
17209   echo "$as_me: program exited with status $ac_status" >&5
17210 echo "$as_me: failed program was:" >&5
17211 cat "conftest.$ac_ext" >&5
17212 cf_cv_func_mkstemp=no
17213
17214 fi
17215 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17216 fi
17217
17218 fi
17219 echo "$as_me:17219: result: $cf_cv_func_mkstemp" >&5
17220 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17221 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17222         echo "$as_me:17222: checking for mkstemp" >&5
17223 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17224 if test "${ac_cv_func_mkstemp+set}" = set; then
17225   echo $ECHO_N "(cached) $ECHO_C" >&6
17226 else
17227   cat >"conftest.$ac_ext" <<_ACEOF
17228 #line 17228 "configure"
17229 #include "confdefs.h"
17230 #define mkstemp autoconf_temporary
17231 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17232 #undef mkstemp
17233
17234 #ifdef __cplusplus
17235 extern "C"
17236 #endif
17237
17238 /* We use char because int might match the return type of a gcc2
17239    builtin and then its argument prototype would still apply.  */
17240 char mkstemp (void);
17241
17242 int
17243 main (void)
17244 {
17245
17246 /* The GNU C library defines stubs for functions which it implements
17247     to always fail with ENOSYS.  Some functions are actually named
17248     something starting with __ and the normal name is an alias.  */
17249 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17250 #error found stub for mkstemp
17251 #endif
17252
17253         return mkstemp ();
17254   ;
17255   return 0;
17256 }
17257 _ACEOF
17258 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17259 if { (eval echo "$as_me:17259: \"$ac_link\"") >&5
17260   (eval $ac_link) 2>&5
17261   ac_status=$?
17262   echo "$as_me:17262: \$? = $ac_status" >&5
17263   (exit "$ac_status"); } &&
17264          { ac_try='test -s "conftest$ac_exeext"'
17265   { (eval echo "$as_me:17265: \"$ac_try\"") >&5
17266   (eval $ac_try) 2>&5
17267   ac_status=$?
17268   echo "$as_me:17268: \$? = $ac_status" >&5
17269   (exit "$ac_status"); }; }; then
17270   ac_cv_func_mkstemp=yes
17271 else
17272   echo "$as_me: failed program was:" >&5
17273 cat "conftest.$ac_ext" >&5
17274 ac_cv_func_mkstemp=no
17275 fi
17276 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17277 fi
17278 echo "$as_me:17278: result: $ac_cv_func_mkstemp" >&5
17279 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17280
17281 fi
17282 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17283
17284 cat >>confdefs.h <<\EOF
17285 #define HAVE_MKSTEMP 1
17286 EOF
17287
17288 fi
17289
17290 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17291         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17292         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17293 fi
17294
17295 cf_with_ada=yes
17296 if test "$cf_with_ada" != "no" ; then
17297
17298 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17299 do
17300
17301 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17302
17303         unset ac_cv_path_cf_TEMP_gnat
17304         unset cf_TEMP_gnat
17305         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17306 set dummy $cf_prog_gnat; ac_word=$2
17307 echo "$as_me:17307: checking for $ac_word" >&5
17308 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17309 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17310   echo $ECHO_N "(cached) $ECHO_C" >&6
17311 else
17312   case $cf_TEMP_gnat in
17313   [\\/]* | ?:[\\/]*)
17314   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17315   ;;
17316   *)
17317   ac_save_IFS=$IFS; IFS=$ac_path_separator
17318 ac_dummy="$PATH"
17319 for ac_dir in $ac_dummy; do
17320   IFS=$ac_save_IFS
17321   test -z "$ac_dir" && ac_dir=.
17322   if $as_executable_p "$ac_dir/$ac_word"; then
17323    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17324    echo "$as_me:17324: found $ac_dir/$ac_word" >&5
17325    break
17326 fi
17327 done
17328
17329   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17330   ;;
17331 esac
17332 fi
17333 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17334
17335 if test -n "$cf_TEMP_gnat"; then
17336   echo "$as_me:17336: result: $cf_TEMP_gnat" >&5
17337 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17338 else
17339   echo "$as_me:17339: result: no" >&5
17340 echo "${ECHO_T}no" >&6
17341 fi
17342
17343         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17344
17345         if test "x$cf_TEMP_gnat" != xno; then
17346                 unset cf_cv_gnat_version
17347                 unset cf_TEMP_gnat
17348
17349 echo "$as_me:17349: checking for $cf_prog_gnat version" >&5
17350 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17351 if test "${cf_cv_gnat_version+set}" = set; then
17352   echo $ECHO_N "(cached) $ECHO_C" >&6
17353 else
17354
17355 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17356         grep '[0-9].[0-9][0-9]*' |\
17357         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17358
17359 fi
17360 echo "$as_me:17360: result: $cf_cv_gnat_version" >&5
17361 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17362 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17363 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17364
17365         fi
17366         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17367
17368         unset cf_TEMP_gnat
17369         unset cf_cv_gnat_version
17370         unset ac_cv_path_cf_TEMP_gnat
17371 done
17372
17373 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17374         cf_ada_make=
17375         cf_cv_prog_gnat_correct=no
17376 else
17377         cf_ada_make=gnatmake
17378         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17379                 # gprconfig is newer than gnatmake; we can continue...
17380                 cf_ada_config="##"
17381         else
17382                 rm -rf ./conftest* ./*~conftest*
17383                 if mkdir conftest.src
17384                 then
17385                         cf_ada_config=""
17386                         cd conftest.src
17387                         for cf_gprconfig in Ada C
17388                         do
17389                                 echo "$as_me:17389: checking for gprconfig name for $cf_gprconfig" >&5
17390 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17391                                 if test "$cf_gprconfig" = C
17392                                 then
17393                                         for cf_gprconfig_param in \
17394                                                 "$cf_gprconfig,,,,GNATGCC" \
17395                                                 "$cf_gprconfig,,,,GCC" \
17396                                                 "$cf_gprconfig"
17397                                         do
17398                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17399                                                 test -n "$cf_gprconfig_value" && break
17400                                         done
17401                                 else
17402                                         cf_gprconfig_param=$cf_gprconfig
17403                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17404                                 fi
17405                                 if test -n "$cf_gprconfig_value"
17406                                 then
17407                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17408                                         echo "$as_me:17408: result: $cf_gprconfig_value" >&5
17409 echo "${ECHO_T}$cf_gprconfig_value" >&6
17410                                 else
17411                                         echo "$as_me:17411: result: missing" >&5
17412 echo "${ECHO_T}missing" >&6
17413                                         cf_ada_config="#"
17414                                         break
17415                                 fi
17416                         done
17417                         cd ..
17418                         rm -rf ./conftest* ./*~conftest*
17419                 fi
17420         fi
17421         if test "x$cf_ada_config" != "x#"
17422         then
17423
17424 echo "$as_me:17424: checking for gnat version" >&5
17425 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17426 if test "${cf_cv_gnat_version+set}" = set; then
17427   echo $ECHO_N "(cached) $ECHO_C" >&6
17428 else
17429
17430 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17431         grep '[0-9].[0-9][0-9]*' |\
17432         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17433
17434 fi
17435 echo "$as_me:17435: result: $cf_cv_gnat_version" >&5
17436 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17437 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17438
17439 case "$cf_cv_gnat_version" in
17440 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17441         cf_cv_prog_gnat_correct=yes
17442         ;;
17443 (*)
17444         { echo "$as_me:17444: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17445 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17446         cf_cv_prog_gnat_correct=no
17447         ;;
17448 esac
17449
17450                 # Extract the first word of "m4", so it can be a program name with args.
17451 set dummy m4; ac_word=$2
17452 echo "$as_me:17452: checking for $ac_word" >&5
17453 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17454 if test "${ac_cv_prog_M4_exists+set}" = set; then
17455   echo $ECHO_N "(cached) $ECHO_C" >&6
17456 else
17457   if test -n "$M4_exists"; then
17458   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17459 else
17460   ac_save_IFS=$IFS; IFS=$ac_path_separator
17461 ac_dummy="$PATH"
17462 for ac_dir in $ac_dummy; do
17463   IFS=$ac_save_IFS
17464   test -z "$ac_dir" && ac_dir=.
17465   $as_executable_p "$ac_dir/$ac_word" || continue
17466 ac_cv_prog_M4_exists="yes"
17467 echo "$as_me:17467: found $ac_dir/$ac_word" >&5
17468 break
17469 done
17470
17471   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17472 fi
17473 fi
17474 M4_exists=$ac_cv_prog_M4_exists
17475 if test -n "$M4_exists"; then
17476   echo "$as_me:17476: result: $M4_exists" >&5
17477 echo "${ECHO_T}$M4_exists" >&6
17478 else
17479   echo "$as_me:17479: result: no" >&5
17480 echo "${ECHO_T}no" >&6
17481 fi
17482
17483                 if test "$ac_cv_prog_M4_exists" = no; then
17484                         cf_cv_prog_gnat_correct=no
17485                         { echo "$as_me:17485: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17486 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17487                 fi
17488                 if test "$cf_cv_prog_gnat_correct" = yes; then
17489                         echo "$as_me:17489: checking if GNAT works" >&5
17490 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17491
17492 rm -rf ./conftest* ./*~conftest*
17493 cat >>conftest.ads <<CF_EOF
17494 procedure conftest;
17495 CF_EOF
17496 cat >>conftest.adb <<CF_EOF
17497 with Text_IO;
17498 with GNAT.OS_Lib;
17499 procedure conftest is
17500 begin
17501    Text_IO.Put ("Hello World");
17502    Text_IO.New_Line;
17503    GNAT.OS_Lib.OS_Exit (0);
17504 end conftest;
17505 CF_EOF
17506 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17507    if ( ./conftest 1>&5 2>&1 ) ; then
17508       cf_cv_prog_gnat_correct=yes
17509    else
17510       cf_cv_prog_gnat_correct=no
17511    fi
17512 else
17513    cf_cv_prog_gnat_correct=no
17514 fi
17515 rm -rf ./conftest* ./*~conftest*
17516
17517                         echo "$as_me:17517: result: $cf_cv_prog_gnat_correct" >&5
17518 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17519                 fi
17520         else
17521                 cf_cv_prog_gnat_correct=no
17522         fi
17523 fi
17524
17525         if test "$cf_cv_prog_gnat_correct" = yes; then
17526
17527         echo "$as_me:17527: checking optimization options for ADAFLAGS" >&5
17528 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17529         case "$CFLAGS" in
17530         (*-g*)
17531
17532         ADAFLAGS="$ADAFLAGS -g"
17533
17534                 ;;
17535         esac
17536         case "$CFLAGS" in
17537         (*-O*)
17538                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17539
17540         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17541
17542                 ;;
17543         esac
17544         echo "$as_me:17544: result: $ADAFLAGS" >&5
17545 echo "${ECHO_T}$ADAFLAGS" >&6
17546
17547 echo "$as_me:17547: checking if GNATPREP supports -T option" >&5
17548 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17549 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17550   echo $ECHO_N "(cached) $ECHO_C" >&6
17551 else
17552
17553 cf_cv_gnatprep_opt_t=no
17554 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17555
17556 fi
17557 echo "$as_me:17557: result: $cf_cv_gnatprep_opt_t" >&5
17558 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17559 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17560
17561 echo "$as_me:17561: checking if GNAT supports generics" >&5
17562 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17563 case "$cf_cv_gnat_version" in
17564 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17565         cf_gnat_generics=yes
17566         ;;
17567 (*)
17568         cf_gnat_generics=no
17569         ;;
17570 esac
17571 echo "$as_me:17571: result: $cf_gnat_generics" >&5
17572 echo "${ECHO_T}$cf_gnat_generics" >&6
17573
17574 if test "$cf_gnat_generics" = yes
17575 then
17576         cf_compile_generics=generics
17577         cf_generic_objects="\${GENOBJS}"
17578 else
17579         cf_compile_generics=
17580         cf_generic_objects=
17581 fi
17582
17583 echo "$as_me:17583: checking if GNAT supports SIGINT" >&5
17584 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17585 if test "${cf_cv_gnat_sigint+set}" = set; then
17586   echo $ECHO_N "(cached) $ECHO_C" >&6
17587 else
17588
17589 rm -rf ./conftest* ./*~conftest*
17590 cat >>conftest.ads <<CF_EOF
17591 with Ada.Interrupts.Names;
17592
17593 package ConfTest is
17594
17595    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17596    pragma Unreserve_All_Interrupts;
17597    pragma Warnings (On);
17598
17599    protected Process is
17600       procedure Stop;
17601       function Continue return Boolean;
17602       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17603    private
17604       Done : Boolean := False;
17605    end Process;
17606
17607 end ConfTest;
17608 CF_EOF
17609 cat >>conftest.adb <<CF_EOF
17610 package body ConfTest is
17611    protected body Process is
17612       procedure Stop is
17613       begin
17614          Done := True;
17615       end Stop;
17616       function Continue return Boolean is
17617       begin
17618          return not Done;
17619       end Continue;
17620    end Process;
17621 end ConfTest;
17622 CF_EOF
17623 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17624       cf_cv_gnat_sigint=yes
17625 else
17626    cf_cv_gnat_sigint=no
17627 fi
17628 rm -rf ./conftest* ./*~conftest*
17629
17630 fi
17631 echo "$as_me:17631: result: $cf_cv_gnat_sigint" >&5
17632 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17633
17634 if test "$cf_cv_gnat_sigint" = yes ; then
17635         USE_GNAT_SIGINT=""
17636 else
17637         USE_GNAT_SIGINT="#"
17638 fi
17639
17640 cf_gnat_libraries=no
17641 cf_gnat_projects=no
17642
17643 if test "$enable_gnat_projects" != no ; then
17644 echo "$as_me:17644: checking if GNAT supports project files" >&5
17645 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17646 case "$cf_cv_gnat_version" in
17647 (3.[0-9]*)
17648         ;;
17649 (*)
17650         case "$cf_cv_system_name" in
17651         (cygwin*|msys*)
17652                 ;;
17653         (*)
17654                 rm -rf ./conftest* ./*~conftest*
17655                 if mkdir conftest.src conftest.bin conftest.lib
17656                 then
17657                         cd conftest.src
17658                         rm -rf ./conftest* ./*~conftest*
17659                         cat >>library.gpr <<CF_EOF
17660 project Library is
17661   Kind := External ("LIB_KIND");
17662   for Library_Name use "ConfTest";
17663   for Object_Dir use ".";
17664   for Library_ALI_Dir use External("LIBRARY_DIR");
17665   for Library_Version use External ("SONAME");
17666   for Library_Kind use Kind;
17667   for Library_Dir use External("BUILD_DIR");
17668   Source_Dir := External ("SOURCE_DIR");
17669   for Source_Dirs use (Source_Dir);
17670 end Library;
17671 CF_EOF
17672                         cat >>confpackage.ads <<CF_EOF
17673 package ConfPackage is
17674    procedure conftest;
17675 end ConfPackage;
17676 CF_EOF
17677                         cat >>confpackage.adb <<CF_EOF
17678 with Text_IO;
17679 package body ConfPackage is
17680    procedure conftest is
17681    begin
17682       Text_IO.Put ("Hello World");
17683       Text_IO.New_Line;
17684    end conftest;
17685 end ConfPackage;
17686 CF_EOF
17687                         if ( "$cf_ada_make" $ADAFLAGS \
17688                                         -Plibrary.gpr \
17689                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17690                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17691                                         -XSOURCE_DIR="`pwd`" \
17692                                         -XSONAME=libConfTest.so.1 \
17693                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17694                                 cf_gnat_projects=yes
17695                         fi
17696                         cd ..
17697                 fi
17698                 if test -f conftest.lib/confpackage.ali
17699                 then
17700                         cf_gnat_libraries=yes
17701                 fi
17702                 rm -rf ./conftest* ./*~conftest*
17703                 ;;
17704         esac
17705         ;;
17706 esac
17707 echo "$as_me:17707: result: $cf_gnat_projects" >&5
17708 echo "${ECHO_T}$cf_gnat_projects" >&6
17709 fi # enable_gnat_projects
17710
17711 if test "$cf_gnat_projects" = yes
17712 then
17713         echo "$as_me:17713: checking if GNAT supports libraries" >&5
17714 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17715         echo "$as_me:17715: result: $cf_gnat_libraries" >&5
17716 echo "${ECHO_T}$cf_gnat_libraries" >&6
17717 fi
17718
17719 USE_OLD_MAKERULES=""
17720 USE_GNAT_PROJECTS="#"
17721 USE_GNAT_MAKE_GPR="#"
17722 USE_GNAT_GPRBUILD="#"
17723
17724 if test "$cf_gnat_projects" = yes
17725 then
17726         USE_OLD_MAKERULES="#"
17727         USE_GNAT_PROJECTS=""
17728         if test "$cf_cv_VERSION_GPRBUILD" != no
17729         then
17730                 USE_GNAT_GPRBUILD=""
17731         elif test "$cf_cv_VERSION_GNATMAKE" != no
17732         then
17733                 USE_GNAT_MAKE_GPR=""
17734         else
17735                 { echo "$as_me:17735: WARNING: use old makefile rules since tools are missing" >&5
17736 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17737         fi
17738 fi
17739
17740 if test "$cf_gnat_libraries" = yes
17741 then
17742         USE_GNAT_LIBRARIES=""
17743 else
17744         USE_GNAT_LIBRARIES="#"
17745 fi
17746
17747 echo "$as_me:17747: checking for ada-compiler" >&5
17748 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17749
17750 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17751 if test "${with_ada_compiler+set}" = set; then
17752   withval="$with_ada_compiler"
17753   cf_ada_compiler=$withval
17754 else
17755   cf_ada_compiler=gnatmake
17756 fi;
17757
17758 echo "$as_me:17758: result: $cf_ada_compiler" >&5
17759 echo "${ECHO_T}$cf_ada_compiler" >&6
17760
17761                 cf_ada_package=terminal_interface
17762
17763 echo "$as_me:17763: checking for ada-include" >&5
17764 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17765
17766 # Check whether --with-ada-include or --without-ada-include was given.
17767 if test "${with_ada_include+set}" = set; then
17768   withval="$with_ada_include"
17769
17770 else
17771   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17772 fi; if test -n "$prefix/share/ada/adainclude" ; then
17773
17774 if test "x$prefix" != xNONE; then
17775         cf_path_syntax="$prefix"
17776 else
17777         cf_path_syntax="$ac_default_prefix"
17778 fi
17779
17780 case ".$withval" in
17781 (.\$\(*\)*|.\'*\'*)
17782         ;;
17783 (..|./*|.\\*)
17784         ;;
17785 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17786         ;;
17787 (.\$\{*prefix\}*|.\$\{*dir\}*)
17788         eval withval="$withval"
17789         case ".$withval" in
17790         (.NONE/*)
17791                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17792                 ;;
17793         esac
17794         ;;
17795 (.no|.NONE/*)
17796         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17797         ;;
17798 (*)
17799         { { echo "$as_me:17799: error: expected a pathname, not \"$withval\"" >&5
17800 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17801    { (exit 1); exit 1; }; }
17802         ;;
17803 esac
17804
17805 fi
17806 eval ADA_INCLUDE="$withval"
17807
17808 echo "$as_me:17808: result: $ADA_INCLUDE" >&5
17809 echo "${ECHO_T}$ADA_INCLUDE" >&6
17810
17811 echo "$as_me:17811: checking for ada-objects" >&5
17812 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17813
17814 # Check whether --with-ada-objects or --without-ada-objects was given.
17815 if test "${with_ada_objects+set}" = set; then
17816   withval="$with_ada_objects"
17817
17818 else
17819   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17820 fi; if test -n "$prefix/lib/ada/adalib" ; then
17821
17822 if test "x$prefix" != xNONE; then
17823         cf_path_syntax="$prefix"
17824 else
17825         cf_path_syntax="$ac_default_prefix"
17826 fi
17827
17828 case ".$withval" in
17829 (.\$\(*\)*|.\'*\'*)
17830         ;;
17831 (..|./*|.\\*)
17832         ;;
17833 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17834         ;;
17835 (.\$\{*prefix\}*|.\$\{*dir\}*)
17836         eval withval="$withval"
17837         case ".$withval" in
17838         (.NONE/*)
17839                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17840                 ;;
17841         esac
17842         ;;
17843 (.no|.NONE/*)
17844         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17845         ;;
17846 (*)
17847         { { echo "$as_me:17847: error: expected a pathname, not \"$withval\"" >&5
17848 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17849    { (exit 1); exit 1; }; }
17850         ;;
17851 esac
17852
17853 fi
17854 eval ADA_OBJECTS="$withval"
17855
17856 echo "$as_me:17856: result: $ADA_OBJECTS" >&5
17857 echo "${ECHO_T}$ADA_OBJECTS" >&6
17858
17859 echo "$as_me:17859: checking if an Ada95 shared-library should be built" >&5
17860 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17861
17862 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17863 if test "${with_ada_sharedlib+set}" = set; then
17864   withval="$with_ada_sharedlib"
17865   with_ada_sharedlib=$withval
17866 else
17867   with_ada_sharedlib=no
17868 fi;
17869 echo "$as_me:17869: result: $with_ada_sharedlib" >&5
17870 echo "${ECHO_T}$with_ada_sharedlib" >&6
17871
17872 if test "x$with_ada_sharedlib" != xno
17873 then
17874         if test "x$cf_gnat_projects" != xyes
17875         then
17876                 { echo "$as_me:17876: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17877 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17878                 with_ada_sharedlib=no
17879         fi
17880 fi
17881
17882 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17883 MAKE_ADA_SHAREDLIB="#"
17884
17885 if test "x$with_ada_sharedlib" != xno
17886 then
17887         MAKE_ADA_SHAREDLIB=
17888         if test "x$with_ada_sharedlib" != xyes
17889         then
17890                 ADA_SHAREDLIB="$with_ada_sharedlib"
17891         fi
17892 fi
17893
17894                 # allow the Ada binding to be renamed
17895
17896 echo "$as_me:17896: checking for ada-libname" >&5
17897 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17898
17899 # Check whether --with-ada-libname or --without-ada-libname was given.
17900 if test "${with_ada_libname+set}" = set; then
17901   withval="$with_ada_libname"
17902   ADA_LIBNAME=$withval
17903 else
17904   ADA_LIBNAME=AdaCurses
17905 fi;
17906 case "x$ADA_LIBNAME" in
17907 (x|xyes|xno)
17908         ADA_LIBNAME=AdaCurses
17909         ;;
17910 esac
17911
17912 echo "$as_me:17912: result: $ADA_LIBNAME" >&5
17913 echo "${ECHO_T}$ADA_LIBNAME" >&6
17914
17915         else
17916                 { { echo "$as_me:17916: error: No usable Ada compiler found" >&5
17917 echo "$as_me: error: No usable Ada compiler found" >&2;}
17918    { (exit 1); exit 1; }; }
17919         fi
17920 else
17921         { { echo "$as_me:17921: error: The Ada compiler is needed for this package" >&5
17922 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17923    { (exit 1); exit 1; }; }
17924 fi
17925
17926 ################################################################################
17927
17928 # not needed
17929 TINFO_LDFLAGS2=
17930
17931 TINFO_LIBS=
17932
17933 ### Construct the list of include-directories to be generated
17934
17935 if test "$srcdir" != "."; then
17936         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17937 fi
17938 CPPFLAGS="-I../include $CPPFLAGS"
17939 if test "$srcdir" != "."; then
17940         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17941 fi
17942 CPPFLAGS="-I. $CPPFLAGS"
17943
17944 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17945 if test "$srcdir" != "."; then
17946         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17947 fi
17948 if test "$GCC" != yes; then
17949         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17950 elif test "$includedir" != "/usr/include"; then
17951         if test "$includedir" = '${prefix}/include' ; then
17952                 if test x$prefix != x/usr ; then
17953                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17954                 fi
17955         else
17956                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17957         fi
17958 fi
17959
17960 ### Build up pieces for makefile rules
17961 echo "$as_me:17961: checking default library suffix" >&5
17962 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17963
17964         case $DFT_LWR_MODEL in
17965         (libtool) DFT_ARG_SUFFIX=''   ;;
17966         (normal)  DFT_ARG_SUFFIX=''   ;;
17967         (debug)   DFT_ARG_SUFFIX='_g' ;;
17968         (profile) DFT_ARG_SUFFIX='_p' ;;
17969         (shared)  DFT_ARG_SUFFIX=''   ;;
17970         esac
17971         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17972 echo "$as_me:17972: result: $DFT_ARG_SUFFIX" >&5
17973 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17974
17975 echo "$as_me:17975: checking default library-dependency suffix" >&5
17976 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17977
17978         case X$DFT_LWR_MODEL in
17979         (Xlibtool)
17980                 DFT_LIB_SUFFIX='.la'
17981                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17982                 ;;
17983         (Xdebug)
17984                 case "$cf_cv_system_name" in
17985                 (*-msvc*)
17986                         DFT_LIB_SUFFIX='_g.lib'
17987                         ;;
17988                 (*)
17989                         DFT_LIB_SUFFIX='_g.a'
17990                         ;;
17991                 esac
17992                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17993                 ;;
17994         (Xprofile)
17995                 case "$cf_cv_system_name" in
17996                 (*-msvc*)
17997                         DFT_LIB_SUFFIX='_p.lib'
17998                         ;;
17999                 (*)
18000                         DFT_LIB_SUFFIX='_p.a'
18001                         ;;
18002                 esac
18003                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18004                 ;;
18005         (Xshared)
18006                 case "$cf_cv_system_name" in
18007                 (aix[5-7]*)
18008                         DFT_LIB_SUFFIX='.so'
18009                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18010                         ;;
18011                 (*-msvc*)
18012                         DFT_LIB_SUFFIX='.dll'
18013                         DFT_DEP_SUFFIX='.dll.lib'
18014                         ;;
18015                 (cygwin*|msys*|mingw*)
18016                         DFT_LIB_SUFFIX='.dll'
18017                         DFT_DEP_SUFFIX='.dll.a'
18018                         ;;
18019                 (darwin*)
18020                         DFT_LIB_SUFFIX='.dylib'
18021                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18022                         ;;
18023                 (hpux*)
18024                         case "$target" in
18025                         (ia64*)
18026                                 DFT_LIB_SUFFIX='.so'
18027                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18028                                 ;;
18029                         (*)
18030                                 DFT_LIB_SUFFIX='.sl'
18031                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18032                                 ;;
18033                         esac
18034                         ;;
18035                 (*)
18036                         DFT_LIB_SUFFIX='.so'
18037                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18038                         ;;
18039                 esac
18040                 ;;
18041         (*)
18042                 case "$target" in
18043                 (*-msvc*)
18044                         DFT_LIB_SUFFIX='.lib'
18045                         ;;
18046                 (*)
18047                         DFT_LIB_SUFFIX='.a'
18048                         ;;
18049                 esac
18050                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18051                 ;;
18052         esac
18053         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18054         then
18055                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18056                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18057         fi
18058 echo "$as_me:18058: result: $DFT_DEP_SUFFIX" >&5
18059 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18060
18061 echo "$as_me:18061: checking default object directory" >&5
18062 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18063
18064         case $DFT_LWR_MODEL in
18065         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18066         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18067         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18068         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18069         (shared)
18070                 case "$cf_cv_system_name" in
18071                 (cygwin|msys)
18072                         DFT_OBJ_SUBDIR='objects' ;;
18073                 (*)
18074                         DFT_OBJ_SUBDIR='obj_s' ;;
18075                 esac
18076         esac
18077 echo "$as_me:18077: result: $DFT_OBJ_SUBDIR" >&5
18078 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18079
18080 ### Set up low-level terminfo dependencies for makefiles.
18081
18082 if test "$DFT_LWR_MODEL" = shared ; then
18083         case $cf_cv_system_name in
18084         (cygwin*)
18085                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18086                 ;;
18087         (msys*)
18088                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18089                 ;;
18090         esac
18091 fi
18092
18093 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18094
18095 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18096
18097 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18098
18099 ### Construct the list of subdirectories for which we'll customize makefiles
18100 ### with the appropriate compile-rules.
18101
18102 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18103
18104 cat >>confdefs.h <<EOF
18105 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18106 EOF
18107
18108 ################################################################################
18109
18110 TEST_ARG2=
18111
18112 TEST_LIBS2=
18113
18114 NCURSES_SHLIB2="sh -c"
18115
18116 ADA_SUBDIRS="include gen src doc"
18117 if test "x$cf_with_tests" != "xno" ; then
18118         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18119 fi
18120 for cf_dir in $ADA_SUBDIRS
18121 do
18122         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18123 done
18124
18125 NCURSES_TREE="#"
18126
18127 EXTERNAL_TREE=
18128
18129 # match layout used by make-tar.sh
18130 ADAHTML_DIR=../doc/ada
18131
18132 if test "x$cross_compiling" = xyes ; then
18133         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18134 else
18135         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18136 fi
18137
18138 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"
18139 ac_config_commands="$ac_config_commands default"
18140 cat >confcache <<\_ACEOF
18141 # This file is a shell script that caches the results of configure
18142 # tests run on this system so they can be shared between configure
18143 # scripts and configure runs, see configure's option --config-cache.
18144 # It is not useful on other systems.  If it contains results you don't
18145 # want to keep, you may remove or edit it.
18146 #
18147 # config.status only pays attention to the cache file if you give it
18148 # the --recheck option to rerun configure.
18149 #
18150 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18151 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18152 # following values.
18153
18154 _ACEOF
18155
18156 # The following way of writing the cache mishandles newlines in values,
18157 # but we know of no workaround that is simple, portable, and efficient.
18158 # So, don't put newlines in cache variables' values.
18159 # Ultrix sh set writes to stderr and can't be redirected directly,
18160 # and sets the high bit in the cache file unless we assign to the vars.
18161 {
18162   (set) 2>&1 |
18163     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18164     *ac_space=\ *)
18165       # `set' does not quote correctly, so add quotes (double-quote
18166       # substitution turns \\\\ into \\, and sed turns \\ into \).
18167       sed -n \
18168         "s/'/'\\\\''/g;
18169           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18170       ;;
18171     *)
18172       # `set' quotes correctly as required by POSIX, so do not add quotes.
18173       sed -n \
18174         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18175       ;;
18176     esac;
18177 } |
18178   sed '
18179      t clear
18180      : clear
18181      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18182      t end
18183      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18184      : end' >>confcache
18185 if cmp -s $cache_file confcache; then :; else
18186   if test -w $cache_file; then
18187     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18188     cat confcache >$cache_file
18189   else
18190     echo "not updating unwritable cache $cache_file"
18191   fi
18192 fi
18193 rm -f confcache
18194
18195 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18196 # Let make expand exec_prefix.
18197 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18198
18199 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18200 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18201 # trailing colons and then remove the whole line if VPATH becomes empty
18202 # (actually we leave an empty line to preserve line numbers).
18203 if test "x$srcdir" = x.; then
18204   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18205 s/:*\$(srcdir):*/:/;
18206 s/:*\${srcdir}:*/:/;
18207 s/:*@srcdir@:*/:/;
18208 s/^\([^=]*=[    ]*\):*/\1/;
18209 s/:*$//;
18210 s/^[^=]*=[      ]*$//;
18211 }'
18212 fi
18213
18214 DEFS=-DHAVE_CONFIG_H
18215
18216 : "${CONFIG_STATUS=./config.status}"
18217 ac_clean_files_save=$ac_clean_files
18218 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18219 { echo "$as_me:18219: creating $CONFIG_STATUS" >&5
18220 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18221 cat >"$CONFIG_STATUS" <<_ACEOF
18222 #! $SHELL
18223 # Generated automatically by configure.
18224 # Run this file to recreate the current configuration.
18225 # Compiler output produced by configure, useful for debugging
18226 # configure, is in config.log if it exists.
18227
18228 debug=false
18229 SHELL=\${CONFIG_SHELL-$SHELL}
18230 ac_cs_invocation="\$0 \$@"
18231
18232 CLICOLOR_FORCE= GREP_OPTIONS=
18233 unset CLICOLOR_FORCE GREP_OPTIONS
18234 _ACEOF
18235
18236 cat >>"$CONFIG_STATUS" <<\_ACEOF
18237 # Be Bourne compatible
18238 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18239   emulate sh
18240   NULLCMD=:
18241 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18242   set -o posix
18243 fi
18244
18245 # Name of the executable.
18246 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18247
18248 if expr a : '\(a\)' >/dev/null 2>&1; then
18249   as_expr=expr
18250 else
18251   as_expr=false
18252 fi
18253
18254 rm -f conf$$ conf$$.exe conf$$.file
18255 echo >conf$$.file
18256 if ln -s conf$$.file conf$$ 2>/dev/null; then
18257   # We could just check for DJGPP; but this test a) works b) is more generic
18258   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18259   if test -f conf$$.exe; then
18260     # Don't use ln at all; we don't have any links
18261     as_ln_s='cp -p'
18262   else
18263     as_ln_s='ln -s'
18264   fi
18265 elif ln conf$$.file conf$$ 2>/dev/null; then
18266   as_ln_s=ln
18267 else
18268   as_ln_s='cp -p'
18269 fi
18270 rm -f conf$$ conf$$.exe conf$$.file
18271
18272 as_executable_p="test -f"
18273
18274 # Support unset when possible.
18275 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18276   as_unset="unset"
18277 else
18278   as_unset="false"
18279 fi
18280
18281 # NLS nuisances.
18282 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18283 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18284 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18285 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18286 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18287 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18288 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18289 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18290
18291 # IFS
18292 # We need space, tab and new line, in precisely that order.
18293 as_nl='
18294 '
18295 IFS="   $as_nl"
18296
18297 # CDPATH.
18298 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18299
18300 exec 6>&1
18301
18302 _ACEOF
18303
18304 # Files that config.status was made for.
18305 if test -n "$ac_config_files"; then
18306   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18307 fi
18308
18309 if test -n "$ac_config_headers"; then
18310   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18311 fi
18312
18313 if test -n "$ac_config_links"; then
18314   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18315 fi
18316
18317 if test -n "$ac_config_commands"; then
18318   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18319 fi
18320
18321 cat >>"$CONFIG_STATUS" <<\EOF
18322
18323 ac_cs_usage="\
18324 \`$as_me' instantiates files from templates according to the
18325 current configuration.
18326
18327 Usage: $0 [OPTIONS] [FILE]...
18328
18329   -h, --help       print this help, then exit
18330   -V, --version    print version number, then exit
18331   -d, --debug      don't remove temporary files
18332       --recheck    update $as_me by reconfiguring in the same conditions
18333   --file=FILE[:TEMPLATE]
18334                    instantiate the configuration file FILE
18335   --header=FILE[:TEMPLATE]
18336                    instantiate the configuration header FILE
18337
18338 Configuration files:
18339 $config_files
18340
18341 Configuration headers:
18342 $config_headers
18343
18344 Configuration commands:
18345 $config_commands
18346
18347 Report bugs to <dickey@invisible-island.net>."
18348 EOF
18349
18350 cat >>"$CONFIG_STATUS" <<EOF
18351 ac_cs_version="\\
18352 config.status
18353 configured by $0, generated by GNU Autoconf 2.52.20210509,
18354   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18355
18356 Copyright 2003-2020,2021        Thomas E. Dickey
18357 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18358 Free Software Foundation, Inc.
18359 This config.status script is free software; the Free Software Foundation
18360 gives unlimited permission to copy, distribute and modify it."
18361 srcdir="$srcdir"
18362 INSTALL="$INSTALL"
18363 EOF
18364
18365 cat >>"$CONFIG_STATUS" <<\EOF
18366 # If no file are specified by the user, then we need to provide default
18367 # value.  By we need to know if files were specified by the user.
18368 ac_need_defaults=:
18369 while test $# != 0
18370 do
18371   case $1 in
18372   --*=*)
18373     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18374     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18375     shift
18376     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18377     shift
18378     ;;
18379   -*);;
18380   *) # This is not an option, so the user has probably given explicit
18381      # arguments.
18382      ac_need_defaults=false;;
18383   esac
18384
18385   case $1 in
18386   # Handling of the options.
18387 EOF
18388 cat >>"$CONFIG_STATUS" <<EOF
18389   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18390     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18391     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18392 EOF
18393 cat >>"$CONFIG_STATUS" <<\EOF
18394   --version | --vers* | -V )
18395     echo "$ac_cs_version"; exit 0 ;;
18396   --he | --h)
18397     # Conflict between --help and --header
18398     { { echo "$as_me:18398: error: ambiguous option: $1
18399 Try \`$0 --help' for more information." >&5
18400 echo "$as_me: error: ambiguous option: $1
18401 Try \`$0 --help' for more information." >&2;}
18402    { (exit 1); exit 1; }; };;
18403   --help | --hel | -h )
18404     echo "$ac_cs_usage"; exit 0 ;;
18405   --debug | --d* | -d )
18406     debug=: ;;
18407   --file | --fil | --fi | --f )
18408     shift
18409     CONFIG_FILES="$CONFIG_FILES $1"
18410     ac_need_defaults=false;;
18411   --header | --heade | --head | --hea )
18412     shift
18413     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18414     ac_need_defaults=false;;
18415
18416   # This is an error.
18417   -*) { { echo "$as_me:18417: error: unrecognized option: $1
18418 Try \`$0 --help' for more information." >&5
18419 echo "$as_me: error: unrecognized option: $1
18420 Try \`$0 --help' for more information." >&2;}
18421    { (exit 1); exit 1; }; } ;;
18422
18423   *) ac_config_targets="$ac_config_targets $1" ;;
18424
18425   esac
18426   shift
18427 done
18428
18429 exec 5>>config.log
18430 cat >&5 << _ACEOF
18431
18432 ## ----------------------- ##
18433 ## Running config.status.  ##
18434 ## ----------------------- ##
18435
18436 This file was extended by $as_me 2.52.20210509, executed with
18437   CONFIG_FILES    = $CONFIG_FILES
18438   CONFIG_HEADERS  = $CONFIG_HEADERS
18439   CONFIG_LINKS    = $CONFIG_LINKS
18440   CONFIG_COMMANDS = $CONFIG_COMMANDS
18441   > "$ac_cs_invocation"
18442 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18443
18444 _ACEOF
18445 EOF
18446
18447 cat >>"$CONFIG_STATUS" <<EOF
18448 #
18449 # INIT-COMMANDS section.
18450 #
18451
18452 ### Special initialization commands, used to pass information from the
18453 ### configuration-run into config.status
18454
18455 AWK="$AWK"
18456 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18457 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18458 LIB_NAME="$LIB_NAME"
18459 LIB_PREFIX="$LIB_PREFIX"
18460 LIB_SUFFIX="$LIB_SUFFIX"
18461 LN_S="$LN_S"
18462 NCURSES_MAJOR="$NCURSES_MAJOR"
18463 NCURSES_MINOR="$NCURSES_MINOR"
18464 NCURSES_PATCH="$NCURSES_PATCH"
18465 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18466 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18467 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18468 cf_cv_abi_version="$cf_cv_abi_version"
18469 cf_cv_rel_version="$cf_cv_rel_version"
18470 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18471 cf_cv_shared_soname='$cf_cv_shared_soname'
18472 cf_cv_shlib_version="$cf_cv_shlib_version"
18473 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18474 cf_cv_system_name="$cf_cv_system_name"
18475 host="$host"
18476 target="$target"
18477
18478 EOF
18479
18480 cat >>"$CONFIG_STATUS" <<\EOF
18481 for ac_config_target in $ac_config_targets
18482 do
18483   case "$ac_config_target" in
18484   # Handling of arguments.
18485   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18486   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18487   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18488   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18489   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18490   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18491   *) { { echo "$as_me:18491: error: invalid argument: $ac_config_target" >&5
18492 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18493    { (exit 1); exit 1; }; };;
18494   esac
18495 done
18496
18497 # If the user did not use the arguments to specify the items to instantiate,
18498 # then the envvar interface is used.  Set only those that are not.
18499 # We use the long form for the default assignment because of an extremely
18500 # bizarre bug on SunOS 4.1.3.
18501 if "$ac_need_defaults"; then
18502   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18503   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18504   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18505 fi
18506
18507 # Create a temporary directory, and hook for its removal unless debugging.
18508 $debug ||
18509 {
18510   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18511   trap '{ (exit 1); exit 1; }' 1 2 13 15
18512 }
18513
18514 # Create a (secure) tmp directory for tmp files.
18515 : ${TMPDIR=/tmp}
18516 {
18517   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18518   test -n "$tmp" && test -d "$tmp"
18519 }  ||
18520 {
18521   tmp=$TMPDIR/cs$$-$RANDOM
18522   (umask 077 && mkdir $tmp)
18523 } ||
18524 {
18525    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18526    { (exit 1); exit 1; }
18527 }
18528
18529 EOF
18530
18531 cat >>"$CONFIG_STATUS" <<EOF
18532
18533 #
18534 # CONFIG_FILES section.
18535 #
18536
18537 # No need to generate the scripts if there are no CONFIG_FILES.
18538 # This happens for instance when ./config.status config.h
18539 if test -n "\$CONFIG_FILES"; then
18540   # Protect against being on the right side of a sed subst in config.status.
18541   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18542    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18543 s,@SHELL@,$SHELL,;t t
18544 s,@exec_prefix@,$exec_prefix,;t t
18545 s,@prefix@,$prefix,;t t
18546 s,@program_transform_name@,$program_transform_name,;t t
18547 s,@bindir@,$bindir,;t t
18548 s,@sbindir@,$sbindir,;t t
18549 s,@libexecdir@,$libexecdir,;t t
18550 s,@datarootdir@,$datarootdir,;t t
18551 s,@datadir@,$datadir,;t t
18552 s,@sysconfdir@,$sysconfdir,;t t
18553 s,@sharedstatedir@,$sharedstatedir,;t t
18554 s,@localstatedir@,$localstatedir,;t t
18555 s,@runstatedir@,$runstatedir,;t t
18556 s,@libdir@,$libdir,;t t
18557 s,@includedir@,$includedir,;t t
18558 s,@oldincludedir@,$oldincludedir,;t t
18559 s,@infodir@,$infodir,;t t
18560 s,@mandir@,$mandir,;t t
18561 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18562 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18563 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18564 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18565 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18566 s,@build_alias@,$build_alias,;t t
18567 s,@host_alias@,$host_alias,;t t
18568 s,@target_alias@,$target_alias,;t t
18569 s,@ECHO_C@,$ECHO_C,;t t
18570 s,@ECHO_N@,$ECHO_N,;t t
18571 s,@ECHO_T@,$ECHO_T,;t t
18572 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18573 s,@DEFS@,$DEFS,;t t
18574 s,@LIBS@,$LIBS,;t t
18575 s,@top_builddir@,$top_builddir,;t t
18576 s,@build@,$build,;t t
18577 s,@build_cpu@,$build_cpu,;t t
18578 s,@build_vendor@,$build_vendor,;t t
18579 s,@build_os@,$build_os,;t t
18580 s,@host@,$host,;t t
18581 s,@host_cpu@,$host_cpu,;t t
18582 s,@host_vendor@,$host_vendor,;t t
18583 s,@host_os@,$host_os,;t t
18584 s,@target@,$target,;t t
18585 s,@target_cpu@,$target_cpu,;t t
18586 s,@target_vendor@,$target_vendor,;t t
18587 s,@target_os@,$target_os,;t t
18588 s,@GREP@,$GREP,;t t
18589 s,@FGREP@,$FGREP,;t t
18590 s,@CC@,$CC,;t t
18591 s,@CFLAGS@,$CFLAGS,;t t
18592 s,@LDFLAGS@,$LDFLAGS,;t t
18593 s,@CPPFLAGS@,$CPPFLAGS,;t t
18594 s,@ac_ct_CC@,$ac_ct_CC,;t t
18595 s,@EXEEXT@,$EXEEXT,;t t
18596 s,@OBJEXT@,$OBJEXT,;t t
18597 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18598 s,@CPP@,$CPP,;t t
18599 s,@EGREP@,$EGREP,;t t
18600 s,@AWK@,$AWK,;t t
18601 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18602 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18603 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18604 s,@LN_S@,$LN_S,;t t
18605 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18606 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18607 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18608 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18609 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18610 s,@SET_MAKE@,$SET_MAKE,;t t
18611 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18612 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18613 s,@CTAGS@,$CTAGS,;t t
18614 s,@ETAGS@,$ETAGS,;t t
18615 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18616 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18617 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18618 s,@RANLIB@,$RANLIB,;t t
18619 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18620 s,@LD@,$LD,;t t
18621 s,@ac_ct_LD@,$ac_ct_LD,;t t
18622 s,@AR@,$AR,;t t
18623 s,@ac_ct_AR@,$ac_ct_AR,;t t
18624 s,@ARFLAGS@,$ARFLAGS,;t t
18625 s,@DESTDIR@,$DESTDIR,;t t
18626 s,@BUILD_CC@,$BUILD_CC,;t t
18627 s,@BUILD_CPP@,$BUILD_CPP,;t t
18628 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18629 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18630 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18631 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18632 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18633 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18634 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18635 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18636 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18637 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18638 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18639 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18640 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18641 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18642 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18643 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18644 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18645 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18646 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18647 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18648 s,@CC_G_OPT@,$CC_G_OPT,;t t
18649 s,@LD_MODEL@,$LD_MODEL,;t t
18650 s,@shlibdir@,$shlibdir,;t t
18651 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18652 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18653 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18654 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18655 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18656 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18657 s,@LINK_PROGS@,$LINK_PROGS,;t t
18658 s,@LINK_TESTS@,$LINK_TESTS,;t t
18659 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18660 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18661 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18662 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18663 s,@RPATH_LIST@,$RPATH_LIST,;t t
18664 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18665 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18666 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18667 s,@PTHREAD@,$PTHREAD,;t t
18668 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18669 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18670 s,@ECHO_LT@,$ECHO_LT,;t t
18671 s,@ECHO_LD@,$ECHO_LD,;t t
18672 s,@RULE_CC@,$RULE_CC,;t t
18673 s,@SHOW_CC@,$SHOW_CC,;t t
18674 s,@ECHO_CC@,$ECHO_CC,;t t
18675 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18676 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18677 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18678 s,@ADAFLAGS@,$ADAFLAGS,;t t
18679 s,@ADA_TRACE@,$ADA_TRACE,;t t
18680 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18681 s,@M4_exists@,$M4_exists,;t t
18682 s,@cf_ada_make@,$cf_ada_make,;t t
18683 s,@cf_ada_config@,$cf_ada_config,;t t
18684 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18685 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18686 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18687 s,@cf_compile_generics@,$cf_compile_generics,;t t
18688 s,@cf_generic_objects@,$cf_generic_objects,;t t
18689 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18690 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18691 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18692 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18693 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18694 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18695 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18696 s,@cf_ada_package@,$cf_ada_package,;t t
18697 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18698 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18699 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18700 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18701 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18702 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18703 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18704 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18705 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18706 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18707 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18708 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18709 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18710 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18711 s,@TEST_ARG2@,$TEST_ARG2,;t t
18712 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18713 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18714 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18715 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18716 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18717 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18718 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18719 CEOF
18720
18721 EOF
18722
18723   cat >>"$CONFIG_STATUS" <<\EOF
18724   # Split the substitutions into bite-sized pieces for seds with
18725   # small command number limits, like on Digital OSF/1 and HP-UX.
18726   ac_max_sed_lines=48
18727   ac_sed_frag=1 # Number of current file.
18728   ac_beg=1 # First line for current file.
18729   ac_end=$ac_max_sed_lines # Line after last line for current file.
18730   ac_more_lines=:
18731   ac_sed_cmds=
18732   while "$ac_more_lines"; do
18733     if test "$ac_beg" -gt 1; then
18734       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18735     else
18736       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18737     fi
18738     if test ! -s $tmp/subs.frag; then
18739       ac_more_lines=false
18740     else
18741       # The purpose of the label and of the branching condition is to
18742       # speed up the sed processing (if there are no `@' at all, there
18743       # is no need to browse any of the substitutions).
18744       # These are the two extra sed commands mentioned above.
18745       (echo ':t
18746   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18747       # It is possible to make a multiline substitution using escaped newlines.
18748       # Ensure that we do not split the substitution between script fragments.
18749       ac_BEG=$ac_end
18750       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18751       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18752       if test -s $tmp/subs.next; then
18753         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18754         if test ! -s $tmp/subs.edit; then
18755           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18756           if test ! -s $tmp/subs.edit; then
18757             if test "$ac_beg" -gt 1; then
18758               ac_end=`expr "$ac_end" - 1`
18759               continue
18760             fi
18761           fi
18762         fi
18763       fi
18764
18765       if test -z "$ac_sed_cmds"; then
18766         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18767       else
18768         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18769       fi
18770       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18771       ac_beg=$ac_end
18772       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18773     fi
18774   done
18775   if test -z "$ac_sed_cmds"; then
18776     ac_sed_cmds=cat
18777   fi
18778 fi # test -n "$CONFIG_FILES"
18779
18780 EOF
18781 cat >>"$CONFIG_STATUS" <<\EOF
18782 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18783   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18784   case "$ac_file" in
18785   - | *:- | *:-:* ) # input from stdin
18786         cat >$tmp/stdin
18787         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18788         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18789   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18790         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18791   * )   ac_file_in=$ac_file.in ;;
18792   esac
18793
18794   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18795   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18796          X"$ac_file" : 'X\(//\)[^/]' \| \
18797          X"$ac_file" : 'X\(//\)$' \| \
18798          X"$ac_file" : 'X\(/\)' \| \
18799          .     : '\(.\)' 2>/dev/null ||
18800 echo X"$ac_file" |
18801     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18802           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18803           /^X\(\/\/\)$/{ s//\1/; q; }
18804           /^X\(\/\).*/{ s//\1/; q; }
18805           s/.*/./; q'`
18806   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18807     { case "$ac_dir" in
18808   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18809   *)                      as_incr_dir=.;;
18810 esac
18811 as_dummy="$ac_dir"
18812 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18813   case $as_mkdir_dir in
18814     # Skip DOS drivespec
18815     ?:) as_incr_dir=$as_mkdir_dir ;;
18816     *)
18817       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18818       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18819     ;;
18820   esac
18821 done; }
18822
18823     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18824     # A "../" for each directory in $ac_dir_suffix.
18825     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18826   else
18827     ac_dir_suffix= ac_dots=
18828   fi
18829
18830   case "$srcdir" in
18831   .)  ac_srcdir=.
18832       if test -z "$ac_dots"; then
18833          ac_top_srcdir=.
18834       else
18835          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18836       fi ;;
18837   [\\/]* | ?:[\\/]* )
18838       ac_srcdir="$srcdir$ac_dir_suffix";
18839       ac_top_srcdir="$srcdir" ;;
18840   *) # Relative path.
18841     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18842     ac_top_srcdir="$ac_dots$srcdir" ;;
18843   esac
18844
18845   case $INSTALL in
18846   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18847   *) ac_INSTALL=$ac_dots$INSTALL ;;
18848   esac
18849
18850   if test x"$ac_file" != x-; then
18851     { echo "$as_me:18851: creating $ac_file" >&5
18852 echo "$as_me: creating $ac_file" >&6;}
18853     rm -f "$ac_file"
18854   fi
18855   # Let's still pretend it is `configure' which instantiates (i.e., don't
18856   # use $as_me), people would be surprised to read:
18857   #    /* config.h.  Generated automatically by config.status.  */
18858   configure_input="Generated automatically from `echo $ac_file_in |
18859                                                  sed 's,.*/,,'` by configure."
18860
18861   # First look for the input files in the build tree, otherwise in the
18862   # src tree.
18863   ac_file_inputs=`IFS=:
18864     for f in $ac_file_in; do
18865       case $f in
18866       -) echo $tmp/stdin ;;
18867       [\\/$]*)
18868          # Absolute (can't be DOS-style, as IFS=:)
18869          test -f "$f" || { { echo "$as_me:18869: error: cannot find input file: $f" >&5
18870 echo "$as_me: error: cannot find input file: $f" >&2;}
18871    { (exit 1); exit 1; }; }
18872          echo $f;;
18873       *) # Relative
18874          if test -f "$f"; then
18875            # Build tree
18876            echo $f
18877          elif test -f "$srcdir/$f"; then
18878            # Source tree
18879            echo "$srcdir/$f"
18880          else
18881            # /dev/null tree
18882            { { echo "$as_me:18882: error: cannot find input file: $f" >&5
18883 echo "$as_me: error: cannot find input file: $f" >&2;}
18884    { (exit 1); exit 1; }; }
18885          fi;;
18886       esac
18887     done` || { (exit 1); exit 1; }
18888 EOF
18889 cat >>"$CONFIG_STATUS" <<\EOF
18890   ac_warn_datarootdir=no
18891   if test x"$ac_file" != x-; then
18892     for ac_item in $ac_file_inputs
18893     do
18894       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18895       if test -n "$ac_seen"; then
18896         ac_used=`grep '@datarootdir@' "$ac_item"`
18897         if test -z "$ac_used"; then
18898           { echo "$as_me:18898: WARNING: datarootdir was used implicitly but not set:
18899 $ac_seen" >&5
18900 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18901 $ac_seen" >&2;}
18902           ac_warn_datarootdir=yes
18903         fi
18904       fi
18905       ac_seen=`grep '${datarootdir}' "$ac_item"`
18906       if test -n "$ac_seen"; then
18907         { echo "$as_me:18907: WARNING: datarootdir was used explicitly but not set:
18908 $ac_seen" >&5
18909 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18910 $ac_seen" >&2;}
18911         ac_warn_datarootdir=yes
18912       fi
18913     done
18914   fi
18915
18916 if test "x$ac_warn_datarootdir" = xyes; then
18917   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18918 fi
18919
18920 EOF
18921 cat >>"$CONFIG_STATUS" <<EOF
18922   sed "$ac_vpsub
18923 $extrasub
18924 EOF
18925 cat >>"$CONFIG_STATUS" <<\EOF
18926 :t
18927 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18928 s,@configure_input@,$configure_input,;t t
18929 s,@srcdir@,$ac_srcdir,;t t
18930 s,@top_srcdir@,$ac_top_srcdir,;t t
18931 s,@INSTALL@,$ac_INSTALL,;t t
18932 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18933   rm -f $tmp/stdin
18934   if test x"$ac_file" != x-; then
18935     cp "$tmp/out" "$ac_file"
18936
18937     for ac_name in prefix exec_prefix datarootdir
18938     do
18939         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18940         if test -n "$ac_seen"; then
18941             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18942             if test -z "$ac_init"; then
18943               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18944               { echo "$as_me:18944: WARNING: Variable $ac_name is used but was not set:
18945 $ac_seen" >&5
18946 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18947 $ac_seen" >&2;}
18948             fi
18949         fi
18950     done
18951     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18952     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18953     if test -s $tmp/out; then
18954       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18955       { echo "$as_me:18955: WARNING: Some variables may not be substituted:
18956 $ac_seen" >&5
18957 echo "$as_me: WARNING: Some variables may not be substituted:
18958 $ac_seen" >&2;}
18959     fi
18960   else
18961     cat $tmp/out
18962   fi
18963   rm -f $tmp/out
18964
18965 done
18966 EOF
18967 cat >>"$CONFIG_STATUS" <<\EOF
18968
18969 #
18970 # CONFIG_HEADER section.
18971 #
18972
18973 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18974 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18975 #
18976 # ac_d sets the value in "#define NAME VALUE" lines.
18977 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18978 ac_dB='[        ].*$,\1#\2'
18979 ac_dC=' '
18980 ac_dD=',;t'
18981 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18982 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18983 ac_iB='\([      ]\),\1#\2define\3'
18984 ac_iC=' '
18985 ac_iD='\4,;t'
18986 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18987 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18988 ac_uB='$,\1#\2define\3'
18989 ac_uC=' '
18990 ac_uD=',;t'
18991
18992 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18993   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18994   case "$ac_file" in
18995   - | *:- | *:-:* ) # input from stdin
18996         cat >$tmp/stdin
18997         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18998         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18999   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19000         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19001   * )   ac_file_in=$ac_file.in ;;
19002   esac
19003
19004   test x"$ac_file" != x- && { echo "$as_me:19004: creating $ac_file" >&5
19005 echo "$as_me: creating $ac_file" >&6;}
19006
19007   # First look for the input files in the build tree, otherwise in the
19008   # src tree.
19009   ac_file_inputs=`IFS=:
19010     for f in $ac_file_in; do
19011       case $f in
19012       -) echo $tmp/stdin ;;
19013       [\\/$]*)
19014          # Absolute (can't be DOS-style, as IFS=:)
19015          test -f "$f" || { { echo "$as_me:19015: error: cannot find input file: $f" >&5
19016 echo "$as_me: error: cannot find input file: $f" >&2;}
19017    { (exit 1); exit 1; }; }
19018          echo $f;;
19019       *) # Relative
19020          if test -f "$f"; then
19021            # Build tree
19022            echo $f
19023          elif test -f "$srcdir/$f"; then
19024            # Source tree
19025            echo "$srcdir/$f"
19026          else
19027            # /dev/null tree
19028            { { echo "$as_me:19028: error: cannot find input file: $f" >&5
19029 echo "$as_me: error: cannot find input file: $f" >&2;}
19030    { (exit 1); exit 1; }; }
19031          fi;;
19032       esac
19033     done` || { (exit 1); exit 1; }
19034   # Remove the trailing spaces.
19035   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19036
19037 EOF
19038
19039 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19040 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19041 # be either 'cat' or 'sort'.
19042 cat confdefs.h | uniq >conftest.vals
19043
19044 # Break up conftest.vals because some shells have a limit on
19045 # the size of here documents, and old seds have small limits too.
19046
19047 rm -f conftest.tail
19048 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19049 while grep . conftest.vals >/dev/null
19050 do
19051   # Write chunks of a limited-size here document to conftest.frag.
19052   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19053   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19054   echo 'CEOF' >> "$CONFIG_STATUS"
19055   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19056   rm -f conftest.vals
19057   mv conftest.tail conftest.vals
19058 done
19059 rm -f conftest.vals
19060
19061 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19062 # marker @DEFS@.
19063 echo '  cat >> conftest.edit <<CEOF
19064 /@DEFS@/r conftest.frag
19065 /@DEFS@/d
19066 CEOF
19067 sed -f conftest.edit $tmp/in > $tmp/out
19068 rm -f $tmp/in
19069 mv $tmp/out $tmp/in
19070 rm -f conftest.edit conftest.frag
19071 ' >> "$CONFIG_STATUS"
19072
19073 cat >>"$CONFIG_STATUS" <<\EOF
19074   # Let's still pretend it is `configure' which instantiates (i.e., don't
19075   # use $as_me), people would be surprised to read:
19076   #    /* config.h.  Generated automatically by config.status.  */
19077   if test x"$ac_file" = x-; then
19078     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19079   else
19080     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19081   fi
19082   cat $tmp/in >>$tmp/config.h
19083   rm -f $tmp/in
19084   if test x"$ac_file" != x-; then
19085     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19086       { echo "$as_me:19086: $ac_file is unchanged" >&5
19087 echo "$as_me: $ac_file is unchanged" >&6;}
19088     else
19089       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19090          X"$ac_file" : 'X\(//\)[^/]' \| \
19091          X"$ac_file" : 'X\(//\)$' \| \
19092          X"$ac_file" : 'X\(/\)' \| \
19093          .     : '\(.\)' 2>/dev/null ||
19094 echo X"$ac_file" |
19095     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19096           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19097           /^X\(\/\/\)$/{ s//\1/; q; }
19098           /^X\(\/\).*/{ s//\1/; q; }
19099           s/.*/./; q'`
19100       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19101         { case "$ac_dir" in
19102   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19103   *)                      as_incr_dir=.;;
19104 esac
19105 as_dummy="$ac_dir"
19106 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19107   case $as_mkdir_dir in
19108     # Skip DOS drivespec
19109     ?:) as_incr_dir=$as_mkdir_dir ;;
19110     *)
19111       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19112       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19113     ;;
19114   esac
19115 done; }
19116
19117       fi
19118       rm -f "$ac_file"
19119       mv "$tmp/config.h" "$ac_file"
19120     fi
19121   else
19122     cat $tmp/config.h
19123     rm -f $tmp/config.h
19124   fi
19125 done
19126 EOF
19127 cat >>"$CONFIG_STATUS" <<\EOF
19128 #
19129 # CONFIG_COMMANDS section.
19130 #
19131 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19132   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19133   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19134
19135   case "$ac_dest" in
19136     default )
19137 if test -z "$USE_OLD_MAKERULES" ; then
19138         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19139 fi
19140  ;;
19141   esac
19142 done
19143 EOF
19144
19145 cat >>"$CONFIG_STATUS" <<\EOF
19146
19147 { (exit 0); exit 0; }
19148 EOF
19149 chmod +x "$CONFIG_STATUS"
19150 ac_clean_files=$ac_clean_files_save
19151
19152 # configure is writing to config.log, and then calls config.status.
19153 # config.status does its own redirection, appending to config.log.
19154 # Unfortunately, on DOS this fails, as config.log is still kept open
19155 # by configure, so config.status won't be able to write to it; its
19156 # output is simply discarded.  So we exec the FD to /dev/null,
19157 # effectively closing config.log, so it can be properly (re)opened and
19158 # appended to by config.status.  When coming back to configure, we
19159 # need to make the FD available again.
19160 if test "$no_create" != yes; then
19161   ac_cs_success=:
19162   exec 5>/dev/null
19163   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19164   exec 5>>config.log
19165   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19166   # would make configure fail if this is the last instruction.
19167   "$ac_cs_success" || { (exit 1); exit 1; }
19168 fi
19169 ${MAKE:-make} preinstall