]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.3 - patch 20211113
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.84 .
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                 # works for pkgconf since version 0.8.3 (2012)
3308                 for cf_pkg_program in \
3309                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3310                         pkg-config \
3311                         pkgconf
3312                 do
3313                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3314                         test -n "$cf_search_path" && break
3315                 done
3316
3317                 # works for pkg-config since import in 2005 of original 2001 HP code.
3318                 test -z "$cf_search_path" && \
3319                 cf_search_path=`
3320                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3321 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3322         sub(\"^[^']*'\",\"\"); \
3323         sub(\"'.*\",\"\"); \
3324         printf \" %s\", \\$0; } \
3325 { next; } \
3326 "`
3327         fi
3328
3329         echo "$as_me:3329: result: $cf_search_path" >&5
3330 echo "${ECHO_T}$cf_search_path" >&6
3331
3332         ;;
3333 (*)
3334         ;;
3335 esac
3336
3337 echo "$as_me:3337: checking for first directory" >&5
3338 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3339 cf_pkg_config_path=none
3340 for cf_config in $cf_search_path
3341 do
3342         if test -d "$cf_config"
3343         then
3344                 cf_pkg_config_path=$cf_config
3345                 break
3346         fi
3347 done
3348 echo "$as_me:3348: result: $cf_pkg_config_path" >&5
3349 echo "${ECHO_T}$cf_pkg_config_path" >&6
3350
3351 if test "x$cf_pkg_config_path" != xnone ; then
3352         # limit this to the first directory found
3353         PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3354 fi
3355
3356 if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3357 then
3358         echo "$as_me:3358: checking for workaround" >&5
3359 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3360         if test "$prefix" = "NONE" ; then
3361                 cf_prefix="$ac_default_prefix"
3362         else
3363                 cf_prefix="$prefix"
3364         fi
3365         eval cf_libdir=$libdir
3366         cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3367         cf_backup=
3368         for cf_config in $cf_search_path
3369         do
3370                 case $cf_config in
3371                 $cf_libdir/pkgconfig)
3372                         PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3373                         break
3374                         ;;
3375                 *)
3376                         test -z "$cf_backup" && cf_backup=$cf_config
3377                         ;;
3378                 esac
3379         done
3380         test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3381         echo "$as_me:3381: result: $PKG_CONFIG_LIBDIR" >&5
3382 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3383 fi
3384
3385 echo "$as_me:3385: checking if you want to build test-programs" >&5
3386 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3387
3388 # Check whether --with-tests or --without-tests was given.
3389 if test "${with_tests+set}" = set; then
3390   withval="$with_tests"
3391   cf_with_tests=$withval
3392 else
3393   cf_with_tests=yes
3394 fi;
3395 echo "$as_me:3395: result: $cf_with_tests" >&5
3396 echo "${ECHO_T}$cf_with_tests" >&6
3397
3398 echo "$as_me:3398: checking if we should assume mixed-case filenames" >&5
3399 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3400
3401 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3402 if test "${enable_mixed_case+set}" = set; then
3403   enableval="$enable_mixed_case"
3404   enable_mixedcase=$enableval
3405 else
3406   enable_mixedcase=auto
3407 fi;
3408 echo "$as_me:3408: result: $enable_mixedcase" >&5
3409 echo "${ECHO_T}$enable_mixedcase" >&6
3410 if test "$enable_mixedcase" = "auto" ; then
3411
3412 echo "$as_me:3412: checking if filesystem supports mixed-case filenames" >&5
3413 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3414 if test "${cf_cv_mixedcase+set}" = set; then
3415   echo $ECHO_N "(cached) $ECHO_C" >&6
3416 else
3417
3418 if test "$cross_compiling" = yes ; then
3419         case "$target_alias" in
3420         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3421                 cf_cv_mixedcase=no
3422                 ;;
3423         (*)
3424                 cf_cv_mixedcase=yes
3425                 ;;
3426         esac
3427 else
3428         rm -f conftest CONFTEST
3429         echo test >conftest
3430         if test -f CONFTEST ; then
3431                 cf_cv_mixedcase=no
3432         else
3433                 cf_cv_mixedcase=yes
3434         fi
3435         rm -f conftest CONFTEST
3436 fi
3437
3438 fi
3439 echo "$as_me:3439: result: $cf_cv_mixedcase" >&5
3440 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3441 test "$cf_cv_mixedcase" = yes &&
3442 cat >>confdefs.h <<\EOF
3443 #define MIXEDCASE_FILENAMES 1
3444 EOF
3445
3446 else
3447         cf_cv_mixedcase=$enable_mixedcase
3448         if test "$enable_mixedcase" = "yes" ; then
3449                 cat >>confdefs.h <<\EOF
3450 #define MIXEDCASE_FILENAMES 1
3451 EOF
3452
3453         fi
3454 fi
3455
3456 # do this after mixed-case option (tags/TAGS is not as important as tic).
3457 echo "$as_me:3457: checking whether ${MAKE-make} sets \${MAKE}" >&5
3458 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3459 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3460 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3461   echo $ECHO_N "(cached) $ECHO_C" >&6
3462 else
3463   cat >conftest.make <<\EOF
3464 all:
3465         @echo 'ac_maketemp="${MAKE}"'
3466 EOF
3467 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3468 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3469 if test -n "$ac_maketemp"; then
3470   eval ac_cv_prog_make_${ac_make}_set=yes
3471 else
3472   eval ac_cv_prog_make_${ac_make}_set=no
3473 fi
3474 rm -f conftest.make
3475 fi
3476 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3477   echo "$as_me:3477: result: yes" >&5
3478 echo "${ECHO_T}yes" >&6
3479   SET_MAKE=
3480 else
3481   echo "$as_me:3481: result: no" >&5
3482 echo "${ECHO_T}no" >&6
3483   SET_MAKE="MAKE=${MAKE-make}"
3484 fi
3485
3486 echo "$as_me:3486: checking for \".PHONY\" make-support" >&5
3487 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3488 if test "${cf_cv_make_PHONY+set}" = set; then
3489   echo $ECHO_N "(cached) $ECHO_C" >&6
3490 else
3491
3492         rm -rf conftest*
3493         (
3494                 mkdir conftest || exit 1
3495                 cd conftest
3496                 cat >makefile <<'CF_EOF'
3497 .PHONY: always
3498 DATA=0
3499 always: always.out
3500         @echo "** making $@ $(DATA)"
3501 once: once.out
3502         @echo "** making $@ $(DATA)"
3503 always.out:
3504         @echo "** making $@ $(DATA)"
3505         echo $(DATA) > $@
3506 once.out:
3507         @echo "** making $@ $(DATA)"
3508         echo $(DATA) > $@
3509 CF_EOF
3510                 for cf_data in 1 2 3
3511                 do
3512                         ${MAKE:-make} always DATA=$cf_data
3513                         ${MAKE:-make} once   DATA=$cf_data
3514                         ${MAKE:-make} -t always once
3515                         if test -f always ; then
3516                                 echo "no (case 1)" > ../conftest.tmp
3517                         elif test ! -f always.out ; then
3518                                 echo "no (case 2)" > ../conftest.tmp
3519                         elif test ! -f once.out ; then
3520                                 echo "no (case 3)" > ../conftest.tmp
3521                         elif ! cmp -s always.out once.out ; then
3522                                 echo "no (case 4)" > ../conftest.tmp
3523                                 diff always.out once.out
3524                         else
3525                                 cf_check="`cat always.out`"
3526                                 if test "x$cf_check" != "x$cf_data" ; then
3527                                         echo "no (case 5)" > ../conftest.tmp
3528                                 else
3529                                         echo yes > ../conftest.tmp
3530                                         rm -f ./*.out
3531                                         continue
3532                                 fi
3533                         fi
3534                         break
3535                 done
3536         ) >&5 2>&1
3537         cf_cv_make_PHONY="`cat conftest.tmp`"
3538         rm -rf conftest*
3539
3540 fi
3541 echo "$as_me:3541: result: $cf_cv_make_PHONY" >&5
3542 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3543 MAKE_NO_PHONY="#"
3544 MAKE_PHONY="#"
3545 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3546 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3547
3548 for ac_prog in exctags ctags
3549 do
3550   # Extract the first word of "$ac_prog", so it can be a program name with args.
3551 set dummy $ac_prog; ac_word=$2
3552 echo "$as_me:3552: checking for $ac_word" >&5
3553 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3554 if test "${ac_cv_prog_CTAGS+set}" = set; then
3555   echo $ECHO_N "(cached) $ECHO_C" >&6
3556 else
3557   if test -n "$CTAGS"; then
3558   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3559 else
3560   ac_save_IFS=$IFS; IFS=$ac_path_separator
3561 ac_dummy="$PATH"
3562 for ac_dir in $ac_dummy; do
3563   IFS=$ac_save_IFS
3564   test -z "$ac_dir" && ac_dir=.
3565   $as_executable_p "$ac_dir/$ac_word" || continue
3566 ac_cv_prog_CTAGS="$ac_prog"
3567 echo "$as_me:3567: found $ac_dir/$ac_word" >&5
3568 break
3569 done
3570
3571 fi
3572 fi
3573 CTAGS=$ac_cv_prog_CTAGS
3574 if test -n "$CTAGS"; then
3575   echo "$as_me:3575: result: $CTAGS" >&5
3576 echo "${ECHO_T}$CTAGS" >&6
3577 else
3578   echo "$as_me:3578: result: no" >&5
3579 echo "${ECHO_T}no" >&6
3580 fi
3581
3582   test -n "$CTAGS" && break
3583 done
3584
3585 for ac_prog in exetags etags
3586 do
3587   # Extract the first word of "$ac_prog", so it can be a program name with args.
3588 set dummy $ac_prog; ac_word=$2
3589 echo "$as_me:3589: checking for $ac_word" >&5
3590 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3591 if test "${ac_cv_prog_ETAGS+set}" = set; then
3592   echo $ECHO_N "(cached) $ECHO_C" >&6
3593 else
3594   if test -n "$ETAGS"; then
3595   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3596 else
3597   ac_save_IFS=$IFS; IFS=$ac_path_separator
3598 ac_dummy="$PATH"
3599 for ac_dir in $ac_dummy; do
3600   IFS=$ac_save_IFS
3601   test -z "$ac_dir" && ac_dir=.
3602   $as_executable_p "$ac_dir/$ac_word" || continue
3603 ac_cv_prog_ETAGS="$ac_prog"
3604 echo "$as_me:3604: found $ac_dir/$ac_word" >&5
3605 break
3606 done
3607
3608 fi
3609 fi
3610 ETAGS=$ac_cv_prog_ETAGS
3611 if test -n "$ETAGS"; then
3612   echo "$as_me:3612: result: $ETAGS" >&5
3613 echo "${ECHO_T}$ETAGS" >&6
3614 else
3615   echo "$as_me:3615: result: no" >&5
3616 echo "${ECHO_T}no" >&6
3617 fi
3618
3619   test -n "$ETAGS" && break
3620 done
3621
3622 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3623 set dummy ${CTAGS:-ctags}; ac_word=$2
3624 echo "$as_me:3624: checking for $ac_word" >&5
3625 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3626 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3627   echo $ECHO_N "(cached) $ECHO_C" >&6
3628 else
3629   if test -n "$MAKE_LOWER_TAGS"; then
3630   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3631 else
3632   ac_save_IFS=$IFS; IFS=$ac_path_separator
3633 ac_dummy="$PATH"
3634 for ac_dir in $ac_dummy; do
3635   IFS=$ac_save_IFS
3636   test -z "$ac_dir" && ac_dir=.
3637   $as_executable_p "$ac_dir/$ac_word" || continue
3638 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3639 echo "$as_me:3639: found $ac_dir/$ac_word" >&5
3640 break
3641 done
3642
3643   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3644 fi
3645 fi
3646 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3647 if test -n "$MAKE_LOWER_TAGS"; then
3648   echo "$as_me:3648: result: $MAKE_LOWER_TAGS" >&5
3649 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3650 else
3651   echo "$as_me:3651: result: no" >&5
3652 echo "${ECHO_T}no" >&6
3653 fi
3654
3655 if test "$cf_cv_mixedcase" = yes ; then
3656         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3657 set dummy ${ETAGS:-etags}; ac_word=$2
3658 echo "$as_me:3658: checking for $ac_word" >&5
3659 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3660 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3661   echo $ECHO_N "(cached) $ECHO_C" >&6
3662 else
3663   if test -n "$MAKE_UPPER_TAGS"; then
3664   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3665 else
3666   ac_save_IFS=$IFS; IFS=$ac_path_separator
3667 ac_dummy="$PATH"
3668 for ac_dir in $ac_dummy; do
3669   IFS=$ac_save_IFS
3670   test -z "$ac_dir" && ac_dir=.
3671   $as_executable_p "$ac_dir/$ac_word" || continue
3672 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3673 echo "$as_me:3673: found $ac_dir/$ac_word" >&5
3674 break
3675 done
3676
3677   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3678 fi
3679 fi
3680 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3681 if test -n "$MAKE_UPPER_TAGS"; then
3682   echo "$as_me:3682: result: $MAKE_UPPER_TAGS" >&5
3683 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3684 else
3685   echo "$as_me:3685: result: no" >&5
3686 echo "${ECHO_T}no" >&6
3687 fi
3688
3689 else
3690         MAKE_UPPER_TAGS=no
3691 fi
3692
3693 if test "$MAKE_UPPER_TAGS" = yes ; then
3694         MAKE_UPPER_TAGS=
3695 else
3696         MAKE_UPPER_TAGS="#"
3697 fi
3698
3699 if test "$MAKE_LOWER_TAGS" = yes ; then
3700         MAKE_LOWER_TAGS=
3701 else
3702         MAKE_LOWER_TAGS="#"
3703 fi
3704
3705 echo "$as_me:3705: checking for makeflags variable" >&5
3706 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3707 if test "${cf_cv_makeflags+set}" = set; then
3708   echo $ECHO_N "(cached) $ECHO_C" >&6
3709 else
3710
3711         cf_cv_makeflags=''
3712         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3713         do
3714                 cat >cf_makeflags.tmp <<CF_EOF
3715 SHELL = $SHELL
3716 all :
3717         @ echo '.$cf_option'
3718 CF_EOF
3719                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3720                 case "$cf_result" in
3721                 (.*k|.*kw)
3722                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3723                         case "$cf_result" in
3724                         (.*CC=*)        cf_cv_makeflags=
3725                                 ;;
3726                         (*)     cf_cv_makeflags=$cf_option
3727                                 ;;
3728                         esac
3729                         break
3730                         ;;
3731                 (.-)
3732                         ;;
3733                 (*)
3734
3735 echo "${as_me:-configure}:3735: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3736
3737                         ;;
3738                 esac
3739         done
3740         rm -f cf_makeflags.tmp
3741
3742 fi
3743 echo "$as_me:3743: result: $cf_cv_makeflags" >&5
3744 echo "${ECHO_T}$cf_cv_makeflags" >&6
3745
3746 if test -n "$ac_tool_prefix"; then
3747   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3748 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3749 echo "$as_me:3749: checking for $ac_word" >&5
3750 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3751 if test "${ac_cv_prog_RANLIB+set}" = set; then
3752   echo $ECHO_N "(cached) $ECHO_C" >&6
3753 else
3754   if test -n "$RANLIB"; then
3755   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3756 else
3757   ac_save_IFS=$IFS; IFS=$ac_path_separator
3758 ac_dummy="$PATH"
3759 for ac_dir in $ac_dummy; do
3760   IFS=$ac_save_IFS
3761   test -z "$ac_dir" && ac_dir=.
3762   $as_executable_p "$ac_dir/$ac_word" || continue
3763 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3764 echo "$as_me:3764: found $ac_dir/$ac_word" >&5
3765 break
3766 done
3767
3768 fi
3769 fi
3770 RANLIB=$ac_cv_prog_RANLIB
3771 if test -n "$RANLIB"; then
3772   echo "$as_me:3772: result: $RANLIB" >&5
3773 echo "${ECHO_T}$RANLIB" >&6
3774 else
3775   echo "$as_me:3775: result: no" >&5
3776 echo "${ECHO_T}no" >&6
3777 fi
3778
3779 fi
3780 if test -z "$ac_cv_prog_RANLIB"; then
3781   ac_ct_RANLIB=$RANLIB
3782   # Extract the first word of "ranlib", so it can be a program name with args.
3783 set dummy ranlib; ac_word=$2
3784 echo "$as_me:3784: checking for $ac_word" >&5
3785 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3786 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3787   echo $ECHO_N "(cached) $ECHO_C" >&6
3788 else
3789   if test -n "$ac_ct_RANLIB"; then
3790   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3791 else
3792   ac_save_IFS=$IFS; IFS=$ac_path_separator
3793 ac_dummy="$PATH"
3794 for ac_dir in $ac_dummy; do
3795   IFS=$ac_save_IFS
3796   test -z "$ac_dir" && ac_dir=.
3797   $as_executable_p "$ac_dir/$ac_word" || continue
3798 ac_cv_prog_ac_ct_RANLIB="ranlib"
3799 echo "$as_me:3799: found $ac_dir/$ac_word" >&5
3800 break
3801 done
3802
3803   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3804 fi
3805 fi
3806 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3807 if test -n "$ac_ct_RANLIB"; then
3808   echo "$as_me:3808: result: $ac_ct_RANLIB" >&5
3809 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3810 else
3811   echo "$as_me:3811: result: no" >&5
3812 echo "${ECHO_T}no" >&6
3813 fi
3814
3815   RANLIB=$ac_ct_RANLIB
3816 else
3817   RANLIB="$ac_cv_prog_RANLIB"
3818 fi
3819
3820 if test -n "$ac_tool_prefix"; then
3821   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3822 set dummy ${ac_tool_prefix}ld; ac_word=$2
3823 echo "$as_me:3823: checking for $ac_word" >&5
3824 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3825 if test "${ac_cv_prog_LD+set}" = set; then
3826   echo $ECHO_N "(cached) $ECHO_C" >&6
3827 else
3828   if test -n "$LD"; then
3829   ac_cv_prog_LD="$LD" # Let the user override the test.
3830 else
3831   ac_save_IFS=$IFS; IFS=$ac_path_separator
3832 ac_dummy="$PATH"
3833 for ac_dir in $ac_dummy; do
3834   IFS=$ac_save_IFS
3835   test -z "$ac_dir" && ac_dir=.
3836   $as_executable_p "$ac_dir/$ac_word" || continue
3837 ac_cv_prog_LD="${ac_tool_prefix}ld"
3838 echo "$as_me:3838: found $ac_dir/$ac_word" >&5
3839 break
3840 done
3841
3842 fi
3843 fi
3844 LD=$ac_cv_prog_LD
3845 if test -n "$LD"; then
3846   echo "$as_me:3846: result: $LD" >&5
3847 echo "${ECHO_T}$LD" >&6
3848 else
3849   echo "$as_me:3849: result: no" >&5
3850 echo "${ECHO_T}no" >&6
3851 fi
3852
3853 fi
3854 if test -z "$ac_cv_prog_LD"; then
3855   ac_ct_LD=$LD
3856   # Extract the first word of "ld", so it can be a program name with args.
3857 set dummy ld; ac_word=$2
3858 echo "$as_me:3858: checking for $ac_word" >&5
3859 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3860 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3861   echo $ECHO_N "(cached) $ECHO_C" >&6
3862 else
3863   if test -n "$ac_ct_LD"; then
3864   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3865 else
3866   ac_save_IFS=$IFS; IFS=$ac_path_separator
3867 ac_dummy="$PATH"
3868 for ac_dir in $ac_dummy; do
3869   IFS=$ac_save_IFS
3870   test -z "$ac_dir" && ac_dir=.
3871   $as_executable_p "$ac_dir/$ac_word" || continue
3872 ac_cv_prog_ac_ct_LD="ld"
3873 echo "$as_me:3873: found $ac_dir/$ac_word" >&5
3874 break
3875 done
3876
3877   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3878 fi
3879 fi
3880 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3881 if test -n "$ac_ct_LD"; then
3882   echo "$as_me:3882: result: $ac_ct_LD" >&5
3883 echo "${ECHO_T}$ac_ct_LD" >&6
3884 else
3885   echo "$as_me:3885: result: no" >&5
3886 echo "${ECHO_T}no" >&6
3887 fi
3888
3889   LD=$ac_ct_LD
3890 else
3891   LD="$ac_cv_prog_LD"
3892 fi
3893
3894 if test -n "$ac_tool_prefix"; then
3895   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3896 set dummy ${ac_tool_prefix}ar; ac_word=$2
3897 echo "$as_me:3897: checking for $ac_word" >&5
3898 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3899 if test "${ac_cv_prog_AR+set}" = set; then
3900   echo $ECHO_N "(cached) $ECHO_C" >&6
3901 else
3902   if test -n "$AR"; then
3903   ac_cv_prog_AR="$AR" # Let the user override the test.
3904 else
3905   ac_save_IFS=$IFS; IFS=$ac_path_separator
3906 ac_dummy="$PATH"
3907 for ac_dir in $ac_dummy; do
3908   IFS=$ac_save_IFS
3909   test -z "$ac_dir" && ac_dir=.
3910   $as_executable_p "$ac_dir/$ac_word" || continue
3911 ac_cv_prog_AR="${ac_tool_prefix}ar"
3912 echo "$as_me:3912: found $ac_dir/$ac_word" >&5
3913 break
3914 done
3915
3916 fi
3917 fi
3918 AR=$ac_cv_prog_AR
3919 if test -n "$AR"; then
3920   echo "$as_me:3920: result: $AR" >&5
3921 echo "${ECHO_T}$AR" >&6
3922 else
3923   echo "$as_me:3923: result: no" >&5
3924 echo "${ECHO_T}no" >&6
3925 fi
3926
3927 fi
3928 if test -z "$ac_cv_prog_AR"; then
3929   ac_ct_AR=$AR
3930   # Extract the first word of "ar", so it can be a program name with args.
3931 set dummy ar; ac_word=$2
3932 echo "$as_me:3932: checking for $ac_word" >&5
3933 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3934 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3935   echo $ECHO_N "(cached) $ECHO_C" >&6
3936 else
3937   if test -n "$ac_ct_AR"; then
3938   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3939 else
3940   ac_save_IFS=$IFS; IFS=$ac_path_separator
3941 ac_dummy="$PATH"
3942 for ac_dir in $ac_dummy; do
3943   IFS=$ac_save_IFS
3944   test -z "$ac_dir" && ac_dir=.
3945   $as_executable_p "$ac_dir/$ac_word" || continue
3946 ac_cv_prog_ac_ct_AR="ar"
3947 echo "$as_me:3947: found $ac_dir/$ac_word" >&5
3948 break
3949 done
3950
3951   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3952 fi
3953 fi
3954 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3955 if test -n "$ac_ct_AR"; then
3956   echo "$as_me:3956: result: $ac_ct_AR" >&5
3957 echo "${ECHO_T}$ac_ct_AR" >&6
3958 else
3959   echo "$as_me:3959: result: no" >&5
3960 echo "${ECHO_T}no" >&6
3961 fi
3962
3963   AR=$ac_ct_AR
3964 else
3965   AR="$ac_cv_prog_AR"
3966 fi
3967
3968 if test -n "$ac_tool_prefix"; then
3969   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3970 set dummy ${ac_tool_prefix}ar; ac_word=$2
3971 echo "$as_me:3971: checking for $ac_word" >&5
3972 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3973 if test "${ac_cv_prog_AR+set}" = set; then
3974   echo $ECHO_N "(cached) $ECHO_C" >&6
3975 else
3976   if test -n "$AR"; then
3977   ac_cv_prog_AR="$AR" # Let the user override the test.
3978 else
3979   ac_save_IFS=$IFS; IFS=$ac_path_separator
3980 ac_dummy="$PATH"
3981 for ac_dir in $ac_dummy; do
3982   IFS=$ac_save_IFS
3983   test -z "$ac_dir" && ac_dir=.
3984   $as_executable_p "$ac_dir/$ac_word" || continue
3985 ac_cv_prog_AR="${ac_tool_prefix}ar"
3986 echo "$as_me:3986: found $ac_dir/$ac_word" >&5
3987 break
3988 done
3989
3990 fi
3991 fi
3992 AR=$ac_cv_prog_AR
3993 if test -n "$AR"; then
3994   echo "$as_me:3994: result: $AR" >&5
3995 echo "${ECHO_T}$AR" >&6
3996 else
3997   echo "$as_me:3997: result: no" >&5
3998 echo "${ECHO_T}no" >&6
3999 fi
4000
4001 fi
4002 if test -z "$ac_cv_prog_AR"; then
4003   ac_ct_AR=$AR
4004   # Extract the first word of "ar", so it can be a program name with args.
4005 set dummy ar; ac_word=$2
4006 echo "$as_me:4006: checking for $ac_word" >&5
4007 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4008 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4009   echo $ECHO_N "(cached) $ECHO_C" >&6
4010 else
4011   if test -n "$ac_ct_AR"; then
4012   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4013 else
4014   ac_save_IFS=$IFS; IFS=$ac_path_separator
4015 ac_dummy="$PATH"
4016 for ac_dir in $ac_dummy; do
4017   IFS=$ac_save_IFS
4018   test -z "$ac_dir" && ac_dir=.
4019   $as_executable_p "$ac_dir/$ac_word" || continue
4020 ac_cv_prog_ac_ct_AR="ar"
4021 echo "$as_me:4021: found $ac_dir/$ac_word" >&5
4022 break
4023 done
4024
4025   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4026 fi
4027 fi
4028 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4029 if test -n "$ac_ct_AR"; then
4030   echo "$as_me:4030: result: $ac_ct_AR" >&5
4031 echo "${ECHO_T}$ac_ct_AR" >&6
4032 else
4033   echo "$as_me:4033: result: no" >&5
4034 echo "${ECHO_T}no" >&6
4035 fi
4036
4037   AR=$ac_ct_AR
4038 else
4039   AR="$ac_cv_prog_AR"
4040 fi
4041
4042 echo "$as_me:4042: checking for options to update archives" >&5
4043 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4044 if test "${cf_cv_ar_flags+set}" = set; then
4045   echo $ECHO_N "(cached) $ECHO_C" >&6
4046 else
4047
4048         case "$cf_cv_system_name" in
4049         (*-msvc*)
4050                 cf_cv_ar_flags=''
4051                 cat >mk_static_lib.sh <<-EOF
4052                 #!$SHELL
4053                 MSVC_BIN="$AR"
4054                 out="\$1"
4055                 shift
4056                 exec \$MSVC_BIN -out:"\$out" \$@
4057                 EOF
4058                 chmod +x mk_static_lib.sh
4059                 AR=`pwd`/mk_static_lib.sh
4060                 ;;
4061         (*)
4062                 cf_cv_ar_flags=unknown
4063                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4064                 do
4065
4066                         # check if $ARFLAGS already contains this choice
4067                         if test "x$ARFLAGS" != "x" ; then
4068                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4069                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4070                                         cf_cv_ar_flags=
4071                                         break
4072                                 fi
4073                         fi
4074
4075                         rm -f "conftest.$ac_cv_objext"
4076                         rm -f conftest.a
4077
4078                         cat >"conftest.$ac_ext" <<EOF
4079 #line 4079 "configure"
4080 int     testdata[3] = { 123, 456, 789 };
4081 EOF
4082                         if { (eval echo "$as_me:4082: \"$ac_compile\"") >&5
4083   (eval $ac_compile) 2>&5
4084   ac_status=$?
4085   echo "$as_me:4085: \$? = $ac_status" >&5
4086   (exit "$ac_status"); } ; then
4087                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4088                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4089                                 if test -f conftest.a ; then
4090                                         cf_cv_ar_flags="$cf_ar_flags"
4091                                         break
4092                                 fi
4093                         else
4094                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4095
4096 echo "${as_me:-configure}:4096: testing cannot compile test-program ..." 1>&5
4097
4098                                 break
4099                         fi
4100                 done
4101                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4102                 ;;
4103         esac
4104
4105 fi
4106 echo "$as_me:4106: result: $cf_cv_ar_flags" >&5
4107 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4108
4109 if test -n "$ARFLAGS" ; then
4110         if test -n "$cf_cv_ar_flags" ; then
4111                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4112         fi
4113 else
4114         ARFLAGS=$cf_cv_ar_flags
4115 fi
4116
4117         echo "$as_me:4117: checking for PATH separator" >&5
4118 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4119         case "$cf_cv_system_name" in
4120         (os2*)  PATH_SEPARATOR=';'  ;;
4121         (*)     ${PATH_SEPARATOR:=':'}  ;;
4122         esac
4123
4124         echo "$as_me:4124: result: $PATH_SEPARATOR" >&5
4125 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4126
4127 echo "$as_me:4127: checking if you have specified an install-prefix" >&5
4128 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4129
4130 # Check whether --with-install-prefix or --without-install-prefix was given.
4131 if test "${with_install_prefix+set}" = set; then
4132   withval="$with_install_prefix"
4133   case "$withval" in
4134         (yes|no)
4135                 ;;
4136         (*)     DESTDIR="$withval"
4137                 ;;
4138         esac
4139 fi;
4140 echo "$as_me:4140: result: $DESTDIR" >&5
4141 echo "${ECHO_T}$DESTDIR" >&6
4142
4143 ###############################################################################
4144
4145 # If we're cross-compiling, allow the user to override the tools and their
4146 # options.  The configure script is oriented toward identifying the host
4147 # compiler, etc., but we need a build compiler to generate parts of the source.
4148
4149 if test "$cross_compiling" = yes ; then
4150
4151         # defaults that we might want to override
4152         : ${BUILD_CFLAGS:=''}
4153         : ${BUILD_CPPFLAGS:=''}
4154         : ${BUILD_LDFLAGS:=''}
4155         : ${BUILD_LIBS:=''}
4156         : ${BUILD_EXEEXT:='$x'}
4157         : ${BUILD_OBJEXT:='o'}
4158
4159 # Check whether --with-build-cc or --without-build-cc was given.
4160 if test "${with_build_cc+set}" = set; then
4161   withval="$with_build_cc"
4162   BUILD_CC="$withval"
4163 else
4164   for ac_prog in gcc clang c99 c89 cc cl
4165 do
4166   # Extract the first word of "$ac_prog", so it can be a program name with args.
4167 set dummy $ac_prog; ac_word=$2
4168 echo "$as_me:4168: checking for $ac_word" >&5
4169 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4170 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4171   echo $ECHO_N "(cached) $ECHO_C" >&6
4172 else
4173   if test -n "$BUILD_CC"; then
4174   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4175 else
4176   ac_save_IFS=$IFS; IFS=$ac_path_separator
4177 ac_dummy="$PATH"
4178 for ac_dir in $ac_dummy; do
4179   IFS=$ac_save_IFS
4180   test -z "$ac_dir" && ac_dir=.
4181   $as_executable_p "$ac_dir/$ac_word" || continue
4182 ac_cv_prog_BUILD_CC="$ac_prog"
4183 echo "$as_me:4183: found $ac_dir/$ac_word" >&5
4184 break
4185 done
4186
4187 fi
4188 fi
4189 BUILD_CC=$ac_cv_prog_BUILD_CC
4190 if test -n "$BUILD_CC"; then
4191   echo "$as_me:4191: result: $BUILD_CC" >&5
4192 echo "${ECHO_T}$BUILD_CC" >&6
4193 else
4194   echo "$as_me:4194: result: no" >&5
4195 echo "${ECHO_T}no" >&6
4196 fi
4197
4198   test -n "$BUILD_CC" && break
4199 done
4200 test -n "$BUILD_CC" || BUILD_CC="none"
4201
4202 fi;
4203         echo "$as_me:4203: checking for native build C compiler" >&5
4204 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4205         echo "$as_me:4205: result: $BUILD_CC" >&5
4206 echo "${ECHO_T}$BUILD_CC" >&6
4207
4208         echo "$as_me:4208: checking for native build C preprocessor" >&5
4209 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4210
4211 # Check whether --with-build-cpp or --without-build-cpp was given.
4212 if test "${with_build_cpp+set}" = set; then
4213   withval="$with_build_cpp"
4214   BUILD_CPP="$withval"
4215 else
4216   BUILD_CPP='${BUILD_CC} -E'
4217 fi;
4218         echo "$as_me:4218: result: $BUILD_CPP" >&5
4219 echo "${ECHO_T}$BUILD_CPP" >&6
4220
4221         echo "$as_me:4221: checking for native build C flags" >&5
4222 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4223
4224 # Check whether --with-build-cflags or --without-build-cflags was given.
4225 if test "${with_build_cflags+set}" = set; then
4226   withval="$with_build_cflags"
4227   BUILD_CFLAGS="$withval"
4228 fi;
4229         echo "$as_me:4229: result: $BUILD_CFLAGS" >&5
4230 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4231
4232         echo "$as_me:4232: checking for native build C preprocessor-flags" >&5
4233 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4234
4235 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4236 if test "${with_build_cppflags+set}" = set; then
4237   withval="$with_build_cppflags"
4238   BUILD_CPPFLAGS="$withval"
4239 fi;
4240         echo "$as_me:4240: result: $BUILD_CPPFLAGS" >&5
4241 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4242
4243         echo "$as_me:4243: checking for native build linker-flags" >&5
4244 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4245
4246 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4247 if test "${with_build_ldflags+set}" = set; then
4248   withval="$with_build_ldflags"
4249   BUILD_LDFLAGS="$withval"
4250 fi;
4251         echo "$as_me:4251: result: $BUILD_LDFLAGS" >&5
4252 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4253
4254         echo "$as_me:4254: checking for native build linker-libraries" >&5
4255 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4256
4257 # Check whether --with-build-libs or --without-build-libs was given.
4258 if test "${with_build_libs+set}" = set; then
4259   withval="$with_build_libs"
4260   BUILD_LIBS="$withval"
4261 fi;
4262         echo "$as_me:4262: result: $BUILD_LIBS" >&5
4263 echo "${ECHO_T}$BUILD_LIBS" >&6
4264
4265         # this assumes we're on Unix.
4266         BUILD_EXEEXT=
4267         BUILD_OBJEXT=o
4268
4269         : ${BUILD_CC:='${CC}'}
4270
4271         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4272                 { { echo "$as_me:4272: error: Cross-build requires two compilers.
4273 Use --with-build-cc to specify the native compiler." >&5
4274 echo "$as_me: error: Cross-build requires two compilers.
4275 Use --with-build-cc to specify the native compiler." >&2;}
4276    { (exit 1); exit 1; }; }
4277         fi
4278
4279 else
4280         : ${BUILD_CC:='${CC}'}
4281         : ${BUILD_CPP:='${CPP}'}
4282         : ${BUILD_CFLAGS:='${CFLAGS}'}
4283         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4284         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4285         : ${BUILD_LIBS:='${LIBS}'}
4286         : ${BUILD_EXEEXT:='$x'}
4287         : ${BUILD_OBJEXT:='o'}
4288 fi
4289
4290 ###############################################################################
4291
4292 ### Options to allow the user to specify the set of libraries which are used.
4293 ### Use "--without-normal --with-shared" to allow the default model to be
4294 ### shared, for example.
4295 cf_list_models=""
4296
4297 echo "$as_me:4297: checking if you want to build shared C-objects" >&5
4298 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4299
4300 # Check whether --with-shared or --without-shared was given.
4301 if test "${with_shared+set}" = set; then
4302   withval="$with_shared"
4303   with_shared=$withval
4304 else
4305   with_shared=no
4306 fi;
4307 echo "$as_me:4307: result: $with_shared" >&5
4308 echo "${ECHO_T}$with_shared" >&6
4309 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4310
4311 echo "$as_me:4311: checking for specified models" >&5
4312 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4313 test -z "$cf_list_models" && cf_list_models=normal
4314 echo "$as_me:4314: result: $cf_list_models" >&5
4315 echo "${ECHO_T}$cf_list_models" >&6
4316
4317 ### Use the first model as the default, and save its suffix for use in building
4318 ### up test-applications.
4319 echo "$as_me:4319: checking for default model" >&5
4320 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4321 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4322 echo "$as_me:4322: result: $DFT_LWR_MODEL" >&5
4323 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4324
4325 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4326
4327 echo "$as_me:4327: checking for specific curses-directory" >&5
4328 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4329
4330 # Check whether --with-curses-dir or --without-curses-dir was given.
4331 if test "${with_curses_dir+set}" = set; then
4332   withval="$with_curses_dir"
4333   cf_cv_curses_dir=$withval
4334 else
4335   cf_cv_curses_dir=no
4336 fi;
4337 echo "$as_me:4337: result: $cf_cv_curses_dir" >&5
4338 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4339
4340 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4341 then
4342
4343 if test "x$prefix" != xNONE; then
4344         cf_path_syntax="$prefix"
4345 else
4346         cf_path_syntax="$ac_default_prefix"
4347 fi
4348
4349 case ".$withval" in
4350 (.\$\(*\)*|.\'*\'*)
4351         ;;
4352 (..|./*|.\\*)
4353         ;;
4354 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4355         ;;
4356 (.\$\{*prefix\}*|.\$\{*dir\}*)
4357         eval withval="$withval"
4358         case ".$withval" in
4359         (.NONE/*)
4360                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4361                 ;;
4362         esac
4363         ;;
4364 (.no|.NONE/*)
4365         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4366         ;;
4367 (*)
4368         { { echo "$as_me:4368: error: expected a pathname, not \"$withval\"" >&5
4369 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4370    { (exit 1); exit 1; }; }
4371         ;;
4372 esac
4373
4374         if test -d "$cf_cv_curses_dir"
4375         then
4376
4377 if test -n "$cf_cv_curses_dir/include" ; then
4378   for cf_add_incdir in $cf_cv_curses_dir/include
4379   do
4380         while test "$cf_add_incdir" != /usr/include
4381         do
4382           if test -d "$cf_add_incdir"
4383           then
4384                 cf_have_incdir=no
4385                 if test -n "$CFLAGS$CPPFLAGS" ; then
4386                   # a loop is needed to ensure we can add subdirs of existing dirs
4387                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4388                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4389                           cf_have_incdir=yes; break
4390                         fi
4391                   done
4392                 fi
4393
4394                 if test "$cf_have_incdir" = no ; then
4395                   if test "$cf_add_incdir" = /usr/local/include ; then
4396                         if test "$GCC" = yes
4397                         then
4398                           cf_save_CPPFLAGS=$CPPFLAGS
4399
4400         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4401         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4402
4403                           cat >"conftest.$ac_ext" <<_ACEOF
4404 #line 4404 "configure"
4405 #include "confdefs.h"
4406 #include <stdio.h>
4407 int
4408 main (void)
4409 {
4410 printf("Hello")
4411   ;
4412   return 0;
4413 }
4414 _ACEOF
4415 rm -f "conftest.$ac_objext"
4416 if { (eval echo "$as_me:4416: \"$ac_compile\"") >&5
4417   (eval $ac_compile) 2>&5
4418   ac_status=$?
4419   echo "$as_me:4419: \$? = $ac_status" >&5
4420   (exit "$ac_status"); } &&
4421          { ac_try='test -s "conftest.$ac_objext"'
4422   { (eval echo "$as_me:4422: \"$ac_try\"") >&5
4423   (eval $ac_try) 2>&5
4424   ac_status=$?
4425   echo "$as_me:4425: \$? = $ac_status" >&5
4426   (exit "$ac_status"); }; }; then
4427   :
4428 else
4429   echo "$as_me: failed program was:" >&5
4430 cat "conftest.$ac_ext" >&5
4431 cf_have_incdir=yes
4432 fi
4433 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4434                           CPPFLAGS=$cf_save_CPPFLAGS
4435                         fi
4436                   fi
4437                 fi
4438
4439                 if test "$cf_have_incdir" = no ; then
4440                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4441
4442 echo "${as_me:-configure}:4442: testing adding $cf_add_incdir to include-path ..." 1>&5
4443
4444                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4445
4446                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4447                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4448                   cf_add_incdir="$cf_top_incdir"
4449                 else
4450                   break
4451                 fi
4452           else
4453                 break
4454           fi
4455         done
4456   done
4457 fi
4458
4459 if test -n "$cf_cv_curses_dir/lib" ; then
4460         for cf_add_libdir in $cf_cv_curses_dir/lib
4461         do
4462                 if test "$cf_add_libdir" = /usr/lib ; then
4463                         :
4464                 elif test -d "$cf_add_libdir"
4465                 then
4466                         cf_have_libdir=no
4467                         if test -n "$LDFLAGS$LIBS" ; then
4468                                 # a loop is needed to ensure we can add subdirs of existing dirs
4469                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4470                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4471                                                 cf_have_libdir=yes; break
4472                                         fi
4473                                 done
4474                         fi
4475                         if test "$cf_have_libdir" = no ; then
4476                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4477
4478 echo "${as_me:-configure}:4478: testing adding $cf_add_libdir to library-path ..." 1>&5
4479
4480                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4481                         fi
4482                 fi
4483         done
4484 fi
4485
4486         fi
4487 fi
4488
4489 cf_ncuconfig_root=ncurses
4490 cf_have_ncuconfig=no
4491
4492 if test "x${PKG_CONFIG:=none}" != xnone; then
4493         echo "$as_me:4493: checking pkg-config for $cf_ncuconfig_root" >&5
4494 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4495         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4496                 echo "$as_me:4496: result: yes" >&5
4497 echo "${ECHO_T}yes" >&6
4498
4499                 echo "$as_me:4499: checking if the $cf_ncuconfig_root package files work" >&5
4500 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4501                 cf_have_ncuconfig=unknown
4502
4503                 cf_save_CFLAGS="$CFLAGS"
4504                 cf_save_CPPFLAGS="$CPPFLAGS"
4505                 cf_save_LIBS="$LIBS"
4506
4507                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4508                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4509
4510                 # while -W for passing linker flags is prevalent, it is not "standard".
4511                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4512                 # incompatible _and_ non-standard -W option which gives an error.  Work
4513                 # around that pitfall.
4514                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4515                 (x*c[89]9@@*-W*)
4516
4517 cf_fix_cppflags=no
4518 cf_new_cflags=
4519 cf_new_cppflags=
4520 cf_new_extra_cppflags=
4521
4522 for cf_add_cflags in $cf_pkg_cflags
4523 do
4524 case "$cf_fix_cppflags" in
4525 (no)
4526         case "$cf_add_cflags" in
4527         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4528                 case "$cf_add_cflags" in
4529                 (-D*)
4530                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4531
4532                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4533                                 && test -z "${cf_tst_cflags}" \
4534                                 && cf_fix_cppflags=yes
4535
4536                         if test "$cf_fix_cppflags" = yes ; then
4537
4538         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4539         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4540
4541                                 continue
4542                         elif test "${cf_tst_cflags}" = "\"'" ; then
4543
4544         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4545         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4546
4547                                 continue
4548                         fi
4549                         ;;
4550                 esac
4551                 case "$CPPFLAGS" in
4552                 (*$cf_add_cflags)
4553                         ;;
4554                 (*)
4555                         case "$cf_add_cflags" in
4556                         (-D*)
4557                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4558
4559 CPPFLAGS=`echo "$CPPFLAGS" | \
4560         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4561                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4562
4563                                 ;;
4564                         esac
4565
4566         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4567         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4568
4569                         ;;
4570                 esac
4571                 ;;
4572         (*)
4573
4574         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4575         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4576
4577                 ;;
4578         esac
4579         ;;
4580 (yes)
4581
4582         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4583         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4584
4585         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4586
4587         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4588                 && test -z "${cf_tst_cflags}" \
4589                 && cf_fix_cppflags=no
4590         ;;
4591 esac
4592 done
4593
4594 if test -n "$cf_new_cflags" ; then
4595
4596         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4597         CFLAGS="${CFLAGS}$cf_new_cflags"
4598
4599 fi
4600
4601 if test -n "$cf_new_cppflags" ; then
4602
4603         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4604         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4605
4606 fi
4607
4608 if test -n "$cf_new_extra_cppflags" ; then
4609
4610         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4611         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4612
4613 fi
4614
4615 cf_add_libs="$LIBS"
4616 # reverse order
4617 cf_add_0lib=
4618 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4619 # filter duplicates
4620 for cf_add_1lib in $cf_add_0lib; do
4621         for cf_add_2lib in $cf_add_libs; do
4622                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4623                         cf_add_1lib=
4624                         break
4625                 fi
4626         done
4627         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4628 done
4629 LIBS="$cf_add_libs"
4630
4631                         cat >"conftest.$ac_ext" <<_ACEOF
4632 #line 4632 "configure"
4633 #include "confdefs.h"
4634 #include <${cf_cv_ncurses_header:-curses.h}>
4635 int
4636 main (void)
4637 {
4638 initscr(); mousemask(0,0); tigetstr((char *)0);
4639   ;
4640   return 0;
4641 }
4642 _ACEOF
4643 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4644 if { (eval echo "$as_me:4644: \"$ac_link\"") >&5
4645   (eval $ac_link) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit "$ac_status"); } &&
4649          { ac_try='test -s "conftest$ac_exeext"'
4650   { (eval echo "$as_me:4650: \"$ac_try\"") >&5
4651   (eval $ac_try) 2>&5
4652   ac_status=$?
4653   echo "$as_me:4653: \$? = $ac_status" >&5
4654   (exit "$ac_status"); }; }; then
4655   if test "$cross_compiling" = yes; then
4656   cf_test_ncuconfig=maybe
4657 else
4658   cat >"conftest.$ac_ext" <<_ACEOF
4659 #line 4659 "configure"
4660 #include "confdefs.h"
4661 #include <${cf_cv_ncurses_header:-curses.h}>
4662                                         int main(void)
4663                                         { const char *xx = curses_version(); return (xx == 0); }
4664 _ACEOF
4665 rm -f "conftest$ac_exeext"
4666 if { (eval echo "$as_me:4666: \"$ac_link\"") >&5
4667   (eval $ac_link) 2>&5
4668   ac_status=$?
4669   echo "$as_me:4669: \$? = $ac_status" >&5
4670   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4671   { (eval echo "$as_me:4671: \"$ac_try\"") >&5
4672   (eval $ac_try) 2>&5
4673   ac_status=$?
4674   echo "$as_me:4674: \$? = $ac_status" >&5
4675   (exit "$ac_status"); }; }; then
4676   cf_test_ncuconfig=yes
4677 else
4678   echo "$as_me: program exited with status $ac_status" >&5
4679 echo "$as_me: failed program was:" >&5
4680 cat "conftest.$ac_ext" >&5
4681 cf_test_ncuconfig=no
4682 fi
4683 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4684 fi
4685 else
4686   echo "$as_me: failed program was:" >&5
4687 cat "conftest.$ac_ext" >&5
4688 cf_test_ncuconfig=no
4689 fi
4690 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4691
4692                         CFLAGS="$cf_save_CFLAGS"
4693                         CPPFLAGS="$cf_save_CPPFLAGS"
4694                         LIBS="$cf_save_LIBS"
4695
4696                         if test "x$cf_test_ncuconfig" != xyes; then
4697                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4698                                 cf_pkg_cflags="$cf_temp"
4699                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4700                                 cf_pkg_libs="$cf_temp"
4701                         fi
4702                         ;;
4703                 esac
4704
4705 for cf_add_cflags in $cf_pkg_cflags
4706 do
4707         case "x$cf_add_cflags" in
4708         (x-[DU]*)
4709
4710 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4711 while true
4712 do
4713         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'`
4714         test "$CFLAGS" != "$cf_old_cflag" || break
4715
4716         CFLAGS="$cf_old_cflag"
4717 done
4718
4719 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4720 while true
4721 do
4722         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'`
4723         test "$CPPFLAGS" != "$cf_old_cflag" || break
4724
4725         CPPFLAGS="$cf_old_cflag"
4726 done
4727
4728                 ;;
4729         esac
4730
4731 cf_fix_cppflags=no
4732 cf_new_cflags=
4733 cf_new_cppflags=
4734 cf_new_extra_cppflags=
4735
4736 for cf_add_cflags in $cf_add_cflags
4737 do
4738 case "$cf_fix_cppflags" in
4739 (no)
4740         case "$cf_add_cflags" in
4741         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4742                 case "$cf_add_cflags" in
4743                 (-D*)
4744                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4745
4746                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4747                                 && test -z "${cf_tst_cflags}" \
4748                                 && cf_fix_cppflags=yes
4749
4750                         if test "$cf_fix_cppflags" = yes ; then
4751
4752         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4753         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4754
4755                                 continue
4756                         elif test "${cf_tst_cflags}" = "\"'" ; then
4757
4758         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4759         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4760
4761                                 continue
4762                         fi
4763                         ;;
4764                 esac
4765                 case "$CPPFLAGS" in
4766                 (*$cf_add_cflags)
4767                         ;;
4768                 (*)
4769                         case "$cf_add_cflags" in
4770                         (-D*)
4771                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4772
4773 CPPFLAGS=`echo "$CPPFLAGS" | \
4774         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4775                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4776
4777                                 ;;
4778                         esac
4779
4780         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4781         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4782
4783                         ;;
4784                 esac
4785                 ;;
4786         (*)
4787
4788         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4789         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4790
4791                 ;;
4792         esac
4793         ;;
4794 (yes)
4795
4796         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4797         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4798
4799         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4800
4801         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4802                 && test -z "${cf_tst_cflags}" \
4803                 && cf_fix_cppflags=no
4804         ;;
4805 esac
4806 done
4807
4808 if test -n "$cf_new_cflags" ; then
4809
4810         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4811         CFLAGS="${CFLAGS}$cf_new_cflags"
4812
4813 fi
4814
4815 if test -n "$cf_new_cppflags" ; then
4816
4817         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4818         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4819
4820 fi
4821
4822 if test -n "$cf_new_extra_cppflags" ; then
4823
4824         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4825         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4826
4827 fi
4828
4829 done
4830
4831 cf_add_libs="$LIBS"
4832 # reverse order
4833 cf_add_0lib=
4834 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4835 # filter duplicates
4836 for cf_add_1lib in $cf_add_0lib; do
4837         for cf_add_2lib in $cf_add_libs; do
4838                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4839                         cf_add_1lib=
4840                         break
4841                 fi
4842         done
4843         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4844 done
4845 LIBS="$cf_add_libs"
4846
4847                 cat >"conftest.$ac_ext" <<_ACEOF
4848 #line 4848 "configure"
4849 #include "confdefs.h"
4850 #include <${cf_cv_ncurses_header:-curses.h}>
4851 int
4852 main (void)
4853 {
4854 initscr(); mousemask(0,0); tigetstr((char *)0);
4855   ;
4856   return 0;
4857 }
4858 _ACEOF
4859 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4860 if { (eval echo "$as_me:4860: \"$ac_link\"") >&5
4861   (eval $ac_link) 2>&5
4862   ac_status=$?
4863   echo "$as_me:4863: \$? = $ac_status" >&5
4864   (exit "$ac_status"); } &&
4865          { ac_try='test -s "conftest$ac_exeext"'
4866   { (eval echo "$as_me:4866: \"$ac_try\"") >&5
4867   (eval $ac_try) 2>&5
4868   ac_status=$?
4869   echo "$as_me:4869: \$? = $ac_status" >&5
4870   (exit "$ac_status"); }; }; then
4871   if test "$cross_compiling" = yes; then
4872   cf_have_ncuconfig=maybe
4873 else
4874   cat >"conftest.$ac_ext" <<_ACEOF
4875 #line 4875 "configure"
4876 #include "confdefs.h"
4877 #include <${cf_cv_ncurses_header:-curses.h}>
4878                                 int main(void)
4879                                 { const char *xx = curses_version(); return (xx == 0); }
4880 _ACEOF
4881 rm -f "conftest$ac_exeext"
4882 if { (eval echo "$as_me:4882: \"$ac_link\"") >&5
4883   (eval $ac_link) 2>&5
4884   ac_status=$?
4885   echo "$as_me:4885: \$? = $ac_status" >&5
4886   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4887   { (eval echo "$as_me:4887: \"$ac_try\"") >&5
4888   (eval $ac_try) 2>&5
4889   ac_status=$?
4890   echo "$as_me:4890: \$? = $ac_status" >&5
4891   (exit "$ac_status"); }; }; then
4892   cf_have_ncuconfig=yes
4893 else
4894   echo "$as_me: program exited with status $ac_status" >&5
4895 echo "$as_me: failed program was:" >&5
4896 cat "conftest.$ac_ext" >&5
4897 cf_have_ncuconfig=no
4898 fi
4899 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4900 fi
4901 else
4902   echo "$as_me: failed program was:" >&5
4903 cat "conftest.$ac_ext" >&5
4904 cf_have_ncuconfig=no
4905 fi
4906 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4907                 echo "$as_me:4907: result: $cf_have_ncuconfig" >&5
4908 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4909                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4910                 if test "$cf_have_ncuconfig" != "yes"
4911                 then
4912                         CPPFLAGS="$cf_save_CPPFLAGS"
4913                         LIBS="$cf_save_LIBS"
4914                         NCURSES_CONFIG_PKG=none
4915                 else
4916
4917 cat >>confdefs.h <<\EOF
4918 #define NCURSES 1
4919 EOF
4920
4921                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4922
4923 echo "$as_me:4923: checking for terminfo header" >&5
4924 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4925 if test "${cf_cv_term_header+set}" = set; then
4926   echo $ECHO_N "(cached) $ECHO_C" >&6
4927 else
4928
4929 case "${cf_cv_ncurses_header}" in
4930 (*/ncurses.h|*/ncursesw.h)
4931         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4932         ;;
4933 (*)
4934         cf_term_header=term.h
4935         ;;
4936 esac
4937
4938 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4939 do
4940 cat >"conftest.$ac_ext" <<_ACEOF
4941 #line 4941 "configure"
4942 #include "confdefs.h"
4943 #include <stdio.h>
4944 #include <${cf_cv_ncurses_header:-curses.h}>
4945 #include <$cf_test>
4946
4947 int
4948 main (void)
4949 {
4950 int x = auto_left_margin; (void)x
4951   ;
4952   return 0;
4953 }
4954 _ACEOF
4955 rm -f "conftest.$ac_objext"
4956 if { (eval echo "$as_me:4956: \"$ac_compile\"") >&5
4957   (eval $ac_compile) 2>&5
4958   ac_status=$?
4959   echo "$as_me:4959: \$? = $ac_status" >&5
4960   (exit "$ac_status"); } &&
4961          { ac_try='test -s "conftest.$ac_objext"'
4962   { (eval echo "$as_me:4962: \"$ac_try\"") >&5
4963   (eval $ac_try) 2>&5
4964   ac_status=$?
4965   echo "$as_me:4965: \$? = $ac_status" >&5
4966   (exit "$ac_status"); }; }; then
4967
4968         cf_cv_term_header="$cf_test"
4969 else
4970   echo "$as_me: failed program was:" >&5
4971 cat "conftest.$ac_ext" >&5
4972
4973         cf_cv_term_header=unknown
4974
4975 fi
4976 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4977         test "$cf_cv_term_header" != unknown && break
4978 done
4979
4980 fi
4981 echo "$as_me:4981: result: $cf_cv_term_header" >&5
4982 echo "${ECHO_T}$cf_cv_term_header" >&6
4983
4984 # Set definitions to allow ifdef'ing to accommodate subdirectories
4985
4986 case "$cf_cv_term_header" in
4987 (*term.h)
4988
4989 cat >>confdefs.h <<\EOF
4990 #define HAVE_TERM_H 1
4991 EOF
4992
4993         ;;
4994 esac
4995
4996 case "$cf_cv_term_header" in
4997 (ncurses/term.h)
4998
4999 cat >>confdefs.h <<\EOF
5000 #define HAVE_NCURSES_TERM_H 1
5001 EOF
5002
5003         ;;
5004 (ncursesw/term.h)
5005
5006 cat >>confdefs.h <<\EOF
5007 #define HAVE_NCURSESW_TERM_H 1
5008 EOF
5009
5010         ;;
5011 esac
5012
5013                 fi
5014
5015         else
5016                 echo "$as_me:5016: result: no" >&5
5017 echo "${ECHO_T}no" >&6
5018                 NCURSES_CONFIG_PKG=none
5019         fi
5020 else
5021         NCURSES_CONFIG_PKG=none
5022 fi
5023
5024 if test "x$cf_have_ncuconfig" = "xno"; then
5025         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5026
5027 if test -n "$ac_tool_prefix"; then
5028   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5029   do
5030     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5031 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5032 echo "$as_me:5032: checking for $ac_word" >&5
5033 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5034 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5035   echo $ECHO_N "(cached) $ECHO_C" >&6
5036 else
5037   if test -n "$NCURSES_CONFIG"; then
5038   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5039 else
5040   ac_save_IFS=$IFS; IFS=$ac_path_separator
5041 ac_dummy="$PATH"
5042 for ac_dir in $ac_dummy; do
5043   IFS=$ac_save_IFS
5044   test -z "$ac_dir" && ac_dir=.
5045   $as_executable_p "$ac_dir/$ac_word" || continue
5046 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5047 echo "$as_me:5047: found $ac_dir/$ac_word" >&5
5048 break
5049 done
5050
5051 fi
5052 fi
5053 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5054 if test -n "$NCURSES_CONFIG"; then
5055   echo "$as_me:5055: result: $NCURSES_CONFIG" >&5
5056 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5057 else
5058   echo "$as_me:5058: result: no" >&5
5059 echo "${ECHO_T}no" >&6
5060 fi
5061
5062     test -n "$NCURSES_CONFIG" && break
5063   done
5064 fi
5065 if test -z "$NCURSES_CONFIG"; then
5066   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5067   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5068 do
5069   # Extract the first word of "$ac_prog", so it can be a program name with args.
5070 set dummy $ac_prog; ac_word=$2
5071 echo "$as_me:5071: checking for $ac_word" >&5
5072 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5073 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5074   echo $ECHO_N "(cached) $ECHO_C" >&6
5075 else
5076   if test -n "$ac_ct_NCURSES_CONFIG"; then
5077   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5078 else
5079   ac_save_IFS=$IFS; IFS=$ac_path_separator
5080 ac_dummy="$PATH"
5081 for ac_dir in $ac_dummy; do
5082   IFS=$ac_save_IFS
5083   test -z "$ac_dir" && ac_dir=.
5084   $as_executable_p "$ac_dir/$ac_word" || continue
5085 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5086 echo "$as_me:5086: found $ac_dir/$ac_word" >&5
5087 break
5088 done
5089
5090 fi
5091 fi
5092 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5093 if test -n "$ac_ct_NCURSES_CONFIG"; then
5094   echo "$as_me:5094: result: $ac_ct_NCURSES_CONFIG" >&5
5095 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5096 else
5097   echo "$as_me:5097: result: no" >&5
5098 echo "${ECHO_T}no" >&6
5099 fi
5100
5101   test -n "$ac_ct_NCURSES_CONFIG" && break
5102 done
5103 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5104
5105   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5106 fi
5107
5108         if test "$NCURSES_CONFIG" != none ; then
5109
5110 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5111 do
5112         case "x$cf_add_cflags" in
5113         (x-[DU]*)
5114
5115 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5116 while true
5117 do
5118         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'`
5119         test "$CFLAGS" != "$cf_old_cflag" || break
5120
5121         CFLAGS="$cf_old_cflag"
5122 done
5123
5124 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5125 while true
5126 do
5127         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'`
5128         test "$CPPFLAGS" != "$cf_old_cflag" || break
5129
5130         CPPFLAGS="$cf_old_cflag"
5131 done
5132
5133                 ;;
5134         esac
5135
5136 cf_fix_cppflags=no
5137 cf_new_cflags=
5138 cf_new_cppflags=
5139 cf_new_extra_cppflags=
5140
5141 for cf_add_cflags in $cf_add_cflags
5142 do
5143 case "$cf_fix_cppflags" in
5144 (no)
5145         case "$cf_add_cflags" in
5146         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5147                 case "$cf_add_cflags" in
5148                 (-D*)
5149                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5150
5151                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5152                                 && test -z "${cf_tst_cflags}" \
5153                                 && cf_fix_cppflags=yes
5154
5155                         if test "$cf_fix_cppflags" = yes ; then
5156
5157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5159
5160                                 continue
5161                         elif test "${cf_tst_cflags}" = "\"'" ; then
5162
5163         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5164         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5165
5166                                 continue
5167                         fi
5168                         ;;
5169                 esac
5170                 case "$CPPFLAGS" in
5171                 (*$cf_add_cflags)
5172                         ;;
5173                 (*)
5174                         case "$cf_add_cflags" in
5175                         (-D*)
5176                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5177
5178 CPPFLAGS=`echo "$CPPFLAGS" | \
5179         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5180                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5181
5182                                 ;;
5183                         esac
5184
5185         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5186         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5187
5188                         ;;
5189                 esac
5190                 ;;
5191         (*)
5192
5193         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5194         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5195
5196                 ;;
5197         esac
5198         ;;
5199 (yes)
5200
5201         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5202         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5203
5204         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5205
5206         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5207                 && test -z "${cf_tst_cflags}" \
5208                 && cf_fix_cppflags=no
5209         ;;
5210 esac
5211 done
5212
5213 if test -n "$cf_new_cflags" ; then
5214
5215         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5216         CFLAGS="${CFLAGS}$cf_new_cflags"
5217
5218 fi
5219
5220 if test -n "$cf_new_cppflags" ; then
5221
5222         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5223         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5224
5225 fi
5226
5227 if test -n "$cf_new_extra_cppflags" ; then
5228
5229         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5230         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5231
5232 fi
5233
5234 done
5235
5236 cf_add_libs="$LIBS"
5237 # reverse order
5238 cf_add_0lib=
5239 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5240 # filter duplicates
5241 for cf_add_1lib in $cf_add_0lib; do
5242         for cf_add_2lib in $cf_add_libs; do
5243                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5244                         cf_add_1lib=
5245                         break
5246                 fi
5247         done
5248         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5249 done
5250 LIBS="$cf_add_libs"
5251
5252                 # even with config script, some packages use no-override for curses.h
5253
5254 echo "$as_me:5254: checking if we have identified curses headers" >&5
5255 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5256 if test "${cf_cv_ncurses_header+set}" = set; then
5257   echo $ECHO_N "(cached) $ECHO_C" >&6
5258 else
5259
5260 cf_cv_ncurses_header=none
5261 for cf_header in \
5262         ncurses.h ncurses/ncurses.h \
5263         curses.h ncurses/curses.h
5264 do
5265 cat >"conftest.$ac_ext" <<_ACEOF
5266 #line 5266 "configure"
5267 #include "confdefs.h"
5268 #include <${cf_header}>
5269 int
5270 main (void)
5271 {
5272 initscr(); tgoto("?", 0,0)
5273   ;
5274   return 0;
5275 }
5276 _ACEOF
5277 rm -f "conftest.$ac_objext"
5278 if { (eval echo "$as_me:5278: \"$ac_compile\"") >&5
5279   (eval $ac_compile) 2>&5
5280   ac_status=$?
5281   echo "$as_me:5281: \$? = $ac_status" >&5
5282   (exit "$ac_status"); } &&
5283          { ac_try='test -s "conftest.$ac_objext"'
5284   { (eval echo "$as_me:5284: \"$ac_try\"") >&5
5285   (eval $ac_try) 2>&5
5286   ac_status=$?
5287   echo "$as_me:5287: \$? = $ac_status" >&5
5288   (exit "$ac_status"); }; }; then
5289   cf_cv_ncurses_header=$cf_header; break
5290 else
5291   echo "$as_me: failed program was:" >&5
5292 cat "conftest.$ac_ext" >&5
5293 fi
5294 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5295 done
5296
5297 fi
5298 echo "$as_me:5298: result: $cf_cv_ncurses_header" >&5
5299 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5300
5301 if test "$cf_cv_ncurses_header" = none ; then
5302         { { echo "$as_me:5302: error: No curses header-files found" >&5
5303 echo "$as_me: error: No curses header-files found" >&2;}
5304    { (exit 1); exit 1; }; }
5305 fi
5306
5307 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5308
5309 for ac_header in $cf_cv_ncurses_header
5310 do
5311 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5312 echo "$as_me:5312: checking for $ac_header" >&5
5313 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5314 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5315   echo $ECHO_N "(cached) $ECHO_C" >&6
5316 else
5317   cat >"conftest.$ac_ext" <<_ACEOF
5318 #line 5318 "configure"
5319 #include "confdefs.h"
5320 #include <$ac_header>
5321 _ACEOF
5322 if { (eval echo "$as_me:5322: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5323   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5324   ac_status=$?
5325   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5326   rm -f conftest.er1
5327   cat conftest.err >&5
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit "$ac_status"); } >/dev/null; then
5330   if test -s conftest.err; then
5331     ac_cpp_err=$ac_c_preproc_warn_flag
5332   else
5333     ac_cpp_err=
5334   fi
5335 else
5336   ac_cpp_err=yes
5337 fi
5338 if test -z "$ac_cpp_err"; then
5339   eval "$as_ac_Header=yes"
5340 else
5341   echo "$as_me: failed program was:" >&5
5342   cat "conftest.$ac_ext" >&5
5343   eval "$as_ac_Header=no"
5344 fi
5345 rm -f conftest.err "conftest.$ac_ext"
5346 fi
5347 echo "$as_me:5347: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5348 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5349 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5350   cat >>confdefs.h <<EOF
5351 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5352 EOF
5353
5354 fi
5355 done
5356
5357 cat >>confdefs.h <<\EOF
5358 #define NCURSES 1
5359 EOF
5360
5361 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5362
5363                 cat >>confdefs.h <<EOF
5364 #define $cf_nculib_ROOT 1
5365 EOF
5366
5367                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5368
5369         else
5370
5371 cf_ncuhdr_root=ncurses
5372
5373 test -n "$cf_cv_curses_dir" && \
5374 test "$cf_cv_curses_dir" != "no" && { \
5375
5376 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5377   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5378   do
5379         while test "$cf_add_incdir" != /usr/include
5380         do
5381           if test -d "$cf_add_incdir"
5382           then
5383                 cf_have_incdir=no
5384                 if test -n "$CFLAGS$CPPFLAGS" ; then
5385                   # a loop is needed to ensure we can add subdirs of existing dirs
5386                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5387                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5388                           cf_have_incdir=yes; break
5389                         fi
5390                   done
5391                 fi
5392
5393                 if test "$cf_have_incdir" = no ; then
5394                   if test "$cf_add_incdir" = /usr/local/include ; then
5395                         if test "$GCC" = yes
5396                         then
5397                           cf_save_CPPFLAGS=$CPPFLAGS
5398
5399         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5400         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5401
5402                           cat >"conftest.$ac_ext" <<_ACEOF
5403 #line 5403 "configure"
5404 #include "confdefs.h"
5405 #include <stdio.h>
5406 int
5407 main (void)
5408 {
5409 printf("Hello")
5410   ;
5411   return 0;
5412 }
5413 _ACEOF
5414 rm -f "conftest.$ac_objext"
5415 if { (eval echo "$as_me:5415: \"$ac_compile\"") >&5
5416   (eval $ac_compile) 2>&5
5417   ac_status=$?
5418   echo "$as_me:5418: \$? = $ac_status" >&5
5419   (exit "$ac_status"); } &&
5420          { ac_try='test -s "conftest.$ac_objext"'
5421   { (eval echo "$as_me:5421: \"$ac_try\"") >&5
5422   (eval $ac_try) 2>&5
5423   ac_status=$?
5424   echo "$as_me:5424: \$? = $ac_status" >&5
5425   (exit "$ac_status"); }; }; then
5426   :
5427 else
5428   echo "$as_me: failed program was:" >&5
5429 cat "conftest.$ac_ext" >&5
5430 cf_have_incdir=yes
5431 fi
5432 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5433                           CPPFLAGS=$cf_save_CPPFLAGS
5434                         fi
5435                   fi
5436                 fi
5437
5438                 if test "$cf_have_incdir" = no ; then
5439                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5440
5441 echo "${as_me:-configure}:5441: testing adding $cf_add_incdir to include-path ..." 1>&5
5442
5443                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5444
5445                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5446                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5447                   cf_add_incdir="$cf_top_incdir"
5448                 else
5449                   break
5450                 fi
5451           else
5452                 break
5453           fi
5454         done
5455   done
5456 fi
5457
5458 }
5459
5460 echo "$as_me:5460: checking for $cf_ncuhdr_root header in include-path" >&5
5461 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5462 if test "${cf_cv_ncurses_h+set}" = set; then
5463   echo $ECHO_N "(cached) $ECHO_C" >&6
5464 else
5465
5466         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5467         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5468         for cf_header in $cf_header_list
5469         do
5470
5471         cat >"conftest.$ac_ext" <<_ACEOF
5472 #line 5472 "configure"
5473 #include "confdefs.h"
5474
5475 #include <$cf_header>
5476 int
5477 main (void)
5478 {
5479
5480 #ifdef NCURSES_VERSION
5481
5482 printf("%s\\n", NCURSES_VERSION);
5483 #else
5484 #ifdef __NCURSES_H
5485 printf("old\\n");
5486 #else
5487         make an error
5488 #endif
5489 #endif
5490
5491   ;
5492   return 0;
5493 }
5494 _ACEOF
5495 rm -f "conftest.$ac_objext"
5496 if { (eval echo "$as_me:5496: \"$ac_compile\"") >&5
5497   (eval $ac_compile) 2>&5
5498   ac_status=$?
5499   echo "$as_me:5499: \$? = $ac_status" >&5
5500   (exit "$ac_status"); } &&
5501          { ac_try='test -s "conftest.$ac_objext"'
5502   { (eval echo "$as_me:5502: \"$ac_try\"") >&5
5503   (eval $ac_try) 2>&5
5504   ac_status=$?
5505   echo "$as_me:5505: \$? = $ac_status" >&5
5506   (exit "$ac_status"); }; }; then
5507   cf_cv_ncurses_h=$cf_header
5508
5509 else
5510   echo "$as_me: failed program was:" >&5
5511 cat "conftest.$ac_ext" >&5
5512 cf_cv_ncurses_h=no
5513 fi
5514 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5515
5516                 test "$cf_cv_ncurses_h" != no && break
5517         done
5518
5519 fi
5520 echo "$as_me:5520: result: $cf_cv_ncurses_h" >&5
5521 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5522
5523 if test "$cf_cv_ncurses_h" != no ; then
5524         cf_cv_ncurses_header=$cf_cv_ncurses_h
5525 else
5526
5527 echo "$as_me:5527: checking for $cf_ncuhdr_root include-path" >&5
5528 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5529 if test "${cf_cv_ncurses_h2+set}" = set; then
5530   echo $ECHO_N "(cached) $ECHO_C" >&6
5531 else
5532
5533         test -n "$verbose" && echo
5534
5535 cf_search=
5536
5537 # collect the current set of include-directories from compiler flags
5538 cf_header_path_list=""
5539 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5540         for cf_header_path in $CPPFLAGS $CFLAGS
5541         do
5542                 case "$cf_header_path" in
5543                 (-I*)
5544                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5545
5546 test "x$cf_header_path" != "xNONE" && \
5547 test -d "$cf_header_path" && \
5548  {
5549         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5550         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5551         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5552         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5553         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5554         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"
5555 }
5556
5557                         cf_header_path_list="$cf_header_path_list $cf_search"
5558                         ;;
5559                 esac
5560         done
5561 fi
5562
5563 # add the variations for the package we are looking for
5564
5565 cf_search=
5566
5567 test "x$prefix" != "xNONE" && \
5568 test -d "$prefix" && \
5569  {
5570         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5571         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5572         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5573         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5574         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5575         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5576 }
5577
5578 for cf_subdir_prefix in \
5579         /usr \
5580         /usr/local \
5581         /usr/pkg \
5582         /opt \
5583         /opt/local \
5584         $HOME
5585 do
5586
5587 test "x$cf_subdir_prefix" != "x$prefix" && \
5588 test -d "$cf_subdir_prefix" && \
5589 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5590         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5591         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5592         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5593         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5594         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5595         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"
5596 }
5597
5598 done
5599
5600 test "$includedir" != NONE && \
5601 test "$includedir" != "/usr/include" && \
5602 test -d "$includedir" && {
5603         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5604         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5605 }
5606
5607 test "$oldincludedir" != NONE && \
5608 test "$oldincludedir" != "/usr/include" && \
5609 test -d "$oldincludedir" && {
5610         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5611         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5612 }
5613
5614 cf_search="$cf_search $cf_header_path_list"
5615
5616         test -n "$verbose" && echo "search path $cf_search"
5617         cf_save2_CPPFLAGS="$CPPFLAGS"
5618         for cf_incdir in $cf_search
5619         do
5620
5621 if test -n "$cf_incdir" ; then
5622   for cf_add_incdir in $cf_incdir
5623   do
5624         while test "$cf_add_incdir" != /usr/include
5625         do
5626           if test -d "$cf_add_incdir"
5627           then
5628                 cf_have_incdir=no
5629                 if test -n "$CFLAGS$CPPFLAGS" ; then
5630                   # a loop is needed to ensure we can add subdirs of existing dirs
5631                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5632                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5633                           cf_have_incdir=yes; break
5634                         fi
5635                   done
5636                 fi
5637
5638                 if test "$cf_have_incdir" = no ; then
5639                   if test "$cf_add_incdir" = /usr/local/include ; then
5640                         if test "$GCC" = yes
5641                         then
5642                           cf_save_CPPFLAGS=$CPPFLAGS
5643
5644         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5645         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5646
5647                           cat >"conftest.$ac_ext" <<_ACEOF
5648 #line 5648 "configure"
5649 #include "confdefs.h"
5650 #include <stdio.h>
5651 int
5652 main (void)
5653 {
5654 printf("Hello")
5655   ;
5656   return 0;
5657 }
5658 _ACEOF
5659 rm -f "conftest.$ac_objext"
5660 if { (eval echo "$as_me:5660: \"$ac_compile\"") >&5
5661   (eval $ac_compile) 2>&5
5662   ac_status=$?
5663   echo "$as_me:5663: \$? = $ac_status" >&5
5664   (exit "$ac_status"); } &&
5665          { ac_try='test -s "conftest.$ac_objext"'
5666   { (eval echo "$as_me:5666: \"$ac_try\"") >&5
5667   (eval $ac_try) 2>&5
5668   ac_status=$?
5669   echo "$as_me:5669: \$? = $ac_status" >&5
5670   (exit "$ac_status"); }; }; then
5671   :
5672 else
5673   echo "$as_me: failed program was:" >&5
5674 cat "conftest.$ac_ext" >&5
5675 cf_have_incdir=yes
5676 fi
5677 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5678                           CPPFLAGS=$cf_save_CPPFLAGS
5679                         fi
5680                   fi
5681                 fi
5682
5683                 if test "$cf_have_incdir" = no ; then
5684                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5685
5686 echo "${as_me:-configure}:5686: testing adding $cf_add_incdir to include-path ..." 1>&5
5687
5688                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5689
5690                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5691                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5692                   cf_add_incdir="$cf_top_incdir"
5693                 else
5694                   break
5695                 fi
5696           else
5697                 break
5698           fi
5699         done
5700   done
5701 fi
5702
5703                 for cf_header in \
5704                         ncurses.h \
5705                         curses.h
5706                 do
5707
5708         cat >"conftest.$ac_ext" <<_ACEOF
5709 #line 5709 "configure"
5710 #include "confdefs.h"
5711
5712 #include <$cf_header>
5713 int
5714 main (void)
5715 {
5716
5717 #ifdef NCURSES_VERSION
5718
5719 printf("%s\\n", NCURSES_VERSION);
5720 #else
5721 #ifdef __NCURSES_H
5722 printf("old\\n");
5723 #else
5724         make an error
5725 #endif
5726 #endif
5727
5728   ;
5729   return 0;
5730 }
5731 _ACEOF
5732 rm -f "conftest.$ac_objext"
5733 if { (eval echo "$as_me:5733: \"$ac_compile\"") >&5
5734   (eval $ac_compile) 2>&5
5735   ac_status=$?
5736   echo "$as_me:5736: \$? = $ac_status" >&5
5737   (exit "$ac_status"); } &&
5738          { ac_try='test -s "conftest.$ac_objext"'
5739   { (eval echo "$as_me:5739: \"$ac_try\"") >&5
5740   (eval $ac_try) 2>&5
5741   ac_status=$?
5742   echo "$as_me:5742: \$? = $ac_status" >&5
5743   (exit "$ac_status"); }; }; then
5744   cf_cv_ncurses_h2=$cf_header
5745
5746 else
5747   echo "$as_me: failed program was:" >&5
5748 cat "conftest.$ac_ext" >&5
5749 cf_cv_ncurses_h2=no
5750 fi
5751 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5752
5753                         if test "$cf_cv_ncurses_h2" != no ; then
5754                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5755                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5756                                 break
5757                         fi
5758                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5759                 done
5760                 CPPFLAGS="$cf_save2_CPPFLAGS"
5761                 test "$cf_cv_ncurses_h2" != no && break
5762         done
5763         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5763: error: not found" >&5
5764 echo "$as_me: error: not found" >&2;}
5765    { (exit 1); exit 1; }; }
5766
5767 fi
5768 echo "$as_me:5768: result: $cf_cv_ncurses_h2" >&5
5769 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5770
5771         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5772         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5773         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5774                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5775         fi
5776
5777 if test -n "$cf_1st_incdir" ; then
5778   for cf_add_incdir in $cf_1st_incdir
5779   do
5780         while test "$cf_add_incdir" != /usr/include
5781         do
5782           if test -d "$cf_add_incdir"
5783           then
5784                 cf_have_incdir=no
5785                 if test -n "$CFLAGS$CPPFLAGS" ; then
5786                   # a loop is needed to ensure we can add subdirs of existing dirs
5787                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5788                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5789                           cf_have_incdir=yes; break
5790                         fi
5791                   done
5792                 fi
5793
5794                 if test "$cf_have_incdir" = no ; then
5795                   if test "$cf_add_incdir" = /usr/local/include ; then
5796                         if test "$GCC" = yes
5797                         then
5798                           cf_save_CPPFLAGS=$CPPFLAGS
5799
5800         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5801         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5802
5803                           cat >"conftest.$ac_ext" <<_ACEOF
5804 #line 5804 "configure"
5805 #include "confdefs.h"
5806 #include <stdio.h>
5807 int
5808 main (void)
5809 {
5810 printf("Hello")
5811   ;
5812   return 0;
5813 }
5814 _ACEOF
5815 rm -f "conftest.$ac_objext"
5816 if { (eval echo "$as_me:5816: \"$ac_compile\"") >&5
5817   (eval $ac_compile) 2>&5
5818   ac_status=$?
5819   echo "$as_me:5819: \$? = $ac_status" >&5
5820   (exit "$ac_status"); } &&
5821          { ac_try='test -s "conftest.$ac_objext"'
5822   { (eval echo "$as_me:5822: \"$ac_try\"") >&5
5823   (eval $ac_try) 2>&5
5824   ac_status=$?
5825   echo "$as_me:5825: \$? = $ac_status" >&5
5826   (exit "$ac_status"); }; }; then
5827   :
5828 else
5829   echo "$as_me: failed program was:" >&5
5830 cat "conftest.$ac_ext" >&5
5831 cf_have_incdir=yes
5832 fi
5833 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5834                           CPPFLAGS=$cf_save_CPPFLAGS
5835                         fi
5836                   fi
5837                 fi
5838
5839                 if test "$cf_have_incdir" = no ; then
5840                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5841
5842 echo "${as_me:-configure}:5842: testing adding $cf_add_incdir to include-path ..." 1>&5
5843
5844                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5845
5846                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5847                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5848                   cf_add_incdir="$cf_top_incdir"
5849                 else
5850                   break
5851                 fi
5852           else
5853                 break
5854           fi
5855         done
5856   done
5857 fi
5858
5859 fi
5860
5861 # Set definitions to allow ifdef'ing for ncurses.h
5862
5863 case "$cf_cv_ncurses_header" in
5864 (*ncurses.h)
5865
5866 cat >>confdefs.h <<\EOF
5867 #define HAVE_NCURSES_H 1
5868 EOF
5869
5870         ;;
5871 esac
5872
5873 case "$cf_cv_ncurses_header" in
5874 (ncurses/curses.h|ncurses/ncurses.h)
5875
5876 cat >>confdefs.h <<\EOF
5877 #define HAVE_NCURSES_NCURSES_H 1
5878 EOF
5879
5880         ;;
5881 (ncursesw/curses.h|ncursesw/ncurses.h)
5882
5883 cat >>confdefs.h <<\EOF
5884 #define HAVE_NCURSESW_NCURSES_H 1
5885 EOF
5886
5887         ;;
5888 esac
5889
5890 echo "$as_me:5890: checking for terminfo header" >&5
5891 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5892 if test "${cf_cv_term_header+set}" = set; then
5893   echo $ECHO_N "(cached) $ECHO_C" >&6
5894 else
5895
5896 case "${cf_cv_ncurses_header}" in
5897 (*/ncurses.h|*/ncursesw.h)
5898         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5899         ;;
5900 (*)
5901         cf_term_header=term.h
5902         ;;
5903 esac
5904
5905 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5906 do
5907 cat >"conftest.$ac_ext" <<_ACEOF
5908 #line 5908 "configure"
5909 #include "confdefs.h"
5910 #include <stdio.h>
5911 #include <${cf_cv_ncurses_header:-curses.h}>
5912 #include <$cf_test>
5913
5914 int
5915 main (void)
5916 {
5917 int x = auto_left_margin; (void)x
5918   ;
5919   return 0;
5920 }
5921 _ACEOF
5922 rm -f "conftest.$ac_objext"
5923 if { (eval echo "$as_me:5923: \"$ac_compile\"") >&5
5924   (eval $ac_compile) 2>&5
5925   ac_status=$?
5926   echo "$as_me:5926: \$? = $ac_status" >&5
5927   (exit "$ac_status"); } &&
5928          { ac_try='test -s "conftest.$ac_objext"'
5929   { (eval echo "$as_me:5929: \"$ac_try\"") >&5
5930   (eval $ac_try) 2>&5
5931   ac_status=$?
5932   echo "$as_me:5932: \$? = $ac_status" >&5
5933   (exit "$ac_status"); }; }; then
5934
5935         cf_cv_term_header="$cf_test"
5936 else
5937   echo "$as_me: failed program was:" >&5
5938 cat "conftest.$ac_ext" >&5
5939
5940         cf_cv_term_header=unknown
5941
5942 fi
5943 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5944         test "$cf_cv_term_header" != unknown && break
5945 done
5946
5947 fi
5948 echo "$as_me:5948: result: $cf_cv_term_header" >&5
5949 echo "${ECHO_T}$cf_cv_term_header" >&6
5950
5951 # Set definitions to allow ifdef'ing to accommodate subdirectories
5952
5953 case "$cf_cv_term_header" in
5954 (*term.h)
5955
5956 cat >>confdefs.h <<\EOF
5957 #define HAVE_TERM_H 1
5958 EOF
5959
5960         ;;
5961 esac
5962
5963 case "$cf_cv_term_header" in
5964 (ncurses/term.h)
5965
5966 cat >>confdefs.h <<\EOF
5967 #define HAVE_NCURSES_TERM_H 1
5968 EOF
5969
5970         ;;
5971 (ncursesw/term.h)
5972
5973 cat >>confdefs.h <<\EOF
5974 #define HAVE_NCURSESW_TERM_H 1
5975 EOF
5976
5977         ;;
5978 esac
5979
5980 # some applications need this, but should check for NCURSES_VERSION
5981
5982 cat >>confdefs.h <<\EOF
5983 #define NCURSES 1
5984 EOF
5985
5986 echo "$as_me:5986: checking for ncurses version" >&5
5987 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5988 if test "${cf_cv_ncurses_version+set}" = set; then
5989   echo $ECHO_N "(cached) $ECHO_C" >&6
5990 else
5991
5992         cf_cv_ncurses_version=no
5993         cf_tempfile=out$$
5994         rm -f "$cf_tempfile"
5995         if test "$cross_compiling" = yes; then
5996
5997         # This will not work if the preprocessor splits the line after the
5998         # Autoconf token.  The 'unproto' program does that.
5999         cat > "conftest.$ac_ext" <<EOF
6000 #include <${cf_cv_ncurses_header:-curses.h}>
6001 #undef Autoconf
6002 #ifdef NCURSES_VERSION
6003 Autoconf NCURSES_VERSION
6004 #else
6005 #ifdef __NCURSES_H
6006 Autoconf "old"
6007 #endif
6008 ;
6009 #endif
6010 EOF
6011         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6012         { (eval echo "$as_me:6012: \"$cf_try\"") >&5
6013   (eval $cf_try) 2>&5
6014   ac_status=$?
6015   echo "$as_me:6015: \$? = $ac_status" >&5
6016   (exit "$ac_status"); }
6017         if test -f conftest.out ; then
6018                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6019                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6020                 rm -f conftest.out
6021         fi
6022
6023 else
6024   cat >"conftest.$ac_ext" <<_ACEOF
6025 #line 6025 "configure"
6026 #include "confdefs.h"
6027
6028 #include <${cf_cv_ncurses_header:-curses.h}>
6029 #include <stdio.h>
6030 int main(void)
6031 {
6032         FILE *fp = fopen("$cf_tempfile", "w");
6033 #ifdef NCURSES_VERSION
6034 # ifdef NCURSES_VERSION_PATCH
6035         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6036 # else
6037         fprintf(fp, "%s\\n", NCURSES_VERSION);
6038 # endif
6039 #else
6040 # ifdef __NCURSES_H
6041         fprintf(fp, "old\\n");
6042 # else
6043         make an error
6044 # endif
6045 #endif
6046         ${cf_cv_main_return:-return}(0);
6047 }
6048 _ACEOF
6049 rm -f "conftest$ac_exeext"
6050 if { (eval echo "$as_me:6050: \"$ac_link\"") >&5
6051   (eval $ac_link) 2>&5
6052   ac_status=$?
6053   echo "$as_me:6053: \$? = $ac_status" >&5
6054   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6055   { (eval echo "$as_me:6055: \"$ac_try\"") >&5
6056   (eval $ac_try) 2>&5
6057   ac_status=$?
6058   echo "$as_me:6058: \$? = $ac_status" >&5
6059   (exit "$ac_status"); }; }; then
6060
6061         cf_cv_ncurses_version=`cat $cf_tempfile`
6062 else
6063   echo "$as_me: program exited with status $ac_status" >&5
6064 echo "$as_me: failed program was:" >&5
6065 cat "conftest.$ac_ext" >&5
6066 fi
6067 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6068 fi
6069         rm -f "$cf_tempfile"
6070
6071 fi
6072 echo "$as_me:6072: result: $cf_cv_ncurses_version" >&5
6073 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6074 test "$cf_cv_ncurses_version" = no ||
6075 cat >>confdefs.h <<\EOF
6076 #define NCURSES 1
6077 EOF
6078
6079 cf_nculib_root=ncurses
6080         # This works, except for the special case where we find gpm, but
6081         # ncurses is in a nonstandard location via $LIBS, and we really want
6082         # to link gpm.
6083 cf_ncurses_LIBS=""
6084 cf_ncurses_SAVE="$LIBS"
6085 echo "$as_me:6085: checking for Gpm_Open in -lgpm" >&5
6086 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6087 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6088   echo $ECHO_N "(cached) $ECHO_C" >&6
6089 else
6090   ac_check_lib_save_LIBS=$LIBS
6091 LIBS="-lgpm  $LIBS"
6092 cat >"conftest.$ac_ext" <<_ACEOF
6093 #line 6093 "configure"
6094 #include "confdefs.h"
6095
6096 /* Override any gcc2 internal prototype to avoid an error.  */
6097 #ifdef __cplusplus
6098 extern "C"
6099 #endif
6100 /* We use char because int might match the return type of a gcc2
6101    builtin and then its argument prototype would still apply.  */
6102 char Gpm_Open ();
6103 int
6104 main (void)
6105 {
6106 Gpm_Open ();
6107   ;
6108   return 0;
6109 }
6110 _ACEOF
6111 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6112 if { (eval echo "$as_me:6112: \"$ac_link\"") >&5
6113   (eval $ac_link) 2>&5
6114   ac_status=$?
6115   echo "$as_me:6115: \$? = $ac_status" >&5
6116   (exit "$ac_status"); } &&
6117          { ac_try='test -s "conftest$ac_exeext"'
6118   { (eval echo "$as_me:6118: \"$ac_try\"") >&5
6119   (eval $ac_try) 2>&5
6120   ac_status=$?
6121   echo "$as_me:6121: \$? = $ac_status" >&5
6122   (exit "$ac_status"); }; }; then
6123   ac_cv_lib_gpm_Gpm_Open=yes
6124 else
6125   echo "$as_me: failed program was:" >&5
6126 cat "conftest.$ac_ext" >&5
6127 ac_cv_lib_gpm_Gpm_Open=no
6128 fi
6129 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6130 LIBS=$ac_check_lib_save_LIBS
6131 fi
6132 echo "$as_me:6132: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6133 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6134 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6135   echo "$as_me:6135: checking for initscr in -lgpm" >&5
6136 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6137 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6138   echo $ECHO_N "(cached) $ECHO_C" >&6
6139 else
6140   ac_check_lib_save_LIBS=$LIBS
6141 LIBS="-lgpm  $LIBS"
6142 cat >"conftest.$ac_ext" <<_ACEOF
6143 #line 6143 "configure"
6144 #include "confdefs.h"
6145
6146 /* Override any gcc2 internal prototype to avoid an error.  */
6147 #ifdef __cplusplus
6148 extern "C"
6149 #endif
6150 /* We use char because int might match the return type of a gcc2
6151    builtin and then its argument prototype would still apply.  */
6152 char initscr ();
6153 int
6154 main (void)
6155 {
6156 initscr ();
6157   ;
6158   return 0;
6159 }
6160 _ACEOF
6161 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6162 if { (eval echo "$as_me:6162: \"$ac_link\"") >&5
6163   (eval $ac_link) 2>&5
6164   ac_status=$?
6165   echo "$as_me:6165: \$? = $ac_status" >&5
6166   (exit "$ac_status"); } &&
6167          { ac_try='test -s "conftest$ac_exeext"'
6168   { (eval echo "$as_me:6168: \"$ac_try\"") >&5
6169   (eval $ac_try) 2>&5
6170   ac_status=$?
6171   echo "$as_me:6171: \$? = $ac_status" >&5
6172   (exit "$ac_status"); }; }; then
6173   ac_cv_lib_gpm_initscr=yes
6174 else
6175   echo "$as_me: failed program was:" >&5
6176 cat "conftest.$ac_ext" >&5
6177 ac_cv_lib_gpm_initscr=no
6178 fi
6179 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6180 LIBS=$ac_check_lib_save_LIBS
6181 fi
6182 echo "$as_me:6182: result: $ac_cv_lib_gpm_initscr" >&5
6183 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6184 if test "$ac_cv_lib_gpm_initscr" = yes; then
6185   LIBS="$cf_ncurses_SAVE"
6186 else
6187   cf_ncurses_LIBS="-lgpm"
6188 fi
6189
6190 fi
6191
6192 case "$host_os" in
6193 (freebsd*)
6194         # This is only necessary if you are linking against an obsolete
6195         # version of ncurses (but it should do no harm, since it is static).
6196         if test "$cf_nculib_root" = ncurses ; then
6197                 echo "$as_me:6197: checking for tgoto in -lmytinfo" >&5
6198 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6199 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6200   echo $ECHO_N "(cached) $ECHO_C" >&6
6201 else
6202   ac_check_lib_save_LIBS=$LIBS
6203 LIBS="-lmytinfo  $LIBS"
6204 cat >"conftest.$ac_ext" <<_ACEOF
6205 #line 6205 "configure"
6206 #include "confdefs.h"
6207
6208 /* Override any gcc2 internal prototype to avoid an error.  */
6209 #ifdef __cplusplus
6210 extern "C"
6211 #endif
6212 /* We use char because int might match the return type of a gcc2
6213    builtin and then its argument prototype would still apply.  */
6214 char tgoto ();
6215 int
6216 main (void)
6217 {
6218 tgoto ();
6219   ;
6220   return 0;
6221 }
6222 _ACEOF
6223 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6224 if { (eval echo "$as_me:6224: \"$ac_link\"") >&5
6225   (eval $ac_link) 2>&5
6226   ac_status=$?
6227   echo "$as_me:6227: \$? = $ac_status" >&5
6228   (exit "$ac_status"); } &&
6229          { ac_try='test -s "conftest$ac_exeext"'
6230   { (eval echo "$as_me:6230: \"$ac_try\"") >&5
6231   (eval $ac_try) 2>&5
6232   ac_status=$?
6233   echo "$as_me:6233: \$? = $ac_status" >&5
6234   (exit "$ac_status"); }; }; then
6235   ac_cv_lib_mytinfo_tgoto=yes
6236 else
6237   echo "$as_me: failed program was:" >&5
6238 cat "conftest.$ac_ext" >&5
6239 ac_cv_lib_mytinfo_tgoto=no
6240 fi
6241 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6242 LIBS=$ac_check_lib_save_LIBS
6243 fi
6244 echo "$as_me:6244: result: $ac_cv_lib_mytinfo_tgoto" >&5
6245 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6246 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6247   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6248 fi
6249
6250         fi
6251         ;;
6252 esac
6253
6254 cf_add_libs="$LIBS"
6255 # reverse order
6256 cf_add_0lib=
6257 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6258 # filter duplicates
6259 for cf_add_1lib in $cf_add_0lib; do
6260         for cf_add_2lib in $cf_add_libs; do
6261                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6262                         cf_add_1lib=
6263                         break
6264                 fi
6265         done
6266         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6267 done
6268 LIBS="$cf_add_libs"
6269
6270 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6271 then
6272
6273 cf_add_libs="$LIBS"
6274 # reverse order
6275 cf_add_0lib=
6276 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6277 # filter duplicates
6278 for cf_add_1lib in $cf_add_0lib; do
6279         for cf_add_2lib in $cf_add_libs; do
6280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6281                         cf_add_1lib=
6282                         break
6283                 fi
6284         done
6285         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6286 done
6287 LIBS="$cf_add_libs"
6288
6289 else
6290
6291         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6292         cf_libdir=""
6293         echo "$as_me:6293: checking for initscr" >&5
6294 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6295 if test "${ac_cv_func_initscr+set}" = set; then
6296   echo $ECHO_N "(cached) $ECHO_C" >&6
6297 else
6298   cat >"conftest.$ac_ext" <<_ACEOF
6299 #line 6299 "configure"
6300 #include "confdefs.h"
6301 #define initscr autoconf_temporary
6302 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6303 #undef initscr
6304
6305 #ifdef __cplusplus
6306 extern "C"
6307 #endif
6308
6309 /* We use char because int might match the return type of a gcc2
6310    builtin and then its argument prototype would still apply.  */
6311 char initscr (void);
6312
6313 int
6314 main (void)
6315 {
6316
6317 /* The GNU C library defines stubs for functions which it implements
6318     to always fail with ENOSYS.  Some functions are actually named
6319     something starting with __ and the normal name is an alias.  */
6320 #if defined (__stub_initscr) || defined (__stub___initscr)
6321 #error found stub for initscr
6322 #endif
6323
6324         return initscr ();
6325   ;
6326   return 0;
6327 }
6328 _ACEOF
6329 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6330 if { (eval echo "$as_me:6330: \"$ac_link\"") >&5
6331   (eval $ac_link) 2>&5
6332   ac_status=$?
6333   echo "$as_me:6333: \$? = $ac_status" >&5
6334   (exit "$ac_status"); } &&
6335          { ac_try='test -s "conftest$ac_exeext"'
6336   { (eval echo "$as_me:6336: \"$ac_try\"") >&5
6337   (eval $ac_try) 2>&5
6338   ac_status=$?
6339   echo "$as_me:6339: \$? = $ac_status" >&5
6340   (exit "$ac_status"); }; }; then
6341   ac_cv_func_initscr=yes
6342 else
6343   echo "$as_me: failed program was:" >&5
6344 cat "conftest.$ac_ext" >&5
6345 ac_cv_func_initscr=no
6346 fi
6347 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6348 fi
6349 echo "$as_me:6349: result: $ac_cv_func_initscr" >&5
6350 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6351 if test "$ac_cv_func_initscr" = yes; then
6352   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6353 else
6354
6355                 cf_save_LIBS="$LIBS"
6356                 echo "$as_me:6356: checking for initscr in -l$cf_nculib_root" >&5
6357 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6358                 LIBS="-l$cf_nculib_root $LIBS"
6359                 cat >"conftest.$ac_ext" <<_ACEOF
6360 #line 6360 "configure"
6361 #include "confdefs.h"
6362 #include <${cf_cv_ncurses_header:-curses.h}>
6363 int
6364 main (void)
6365 {
6366 initscr()
6367   ;
6368   return 0;
6369 }
6370 _ACEOF
6371 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6372 if { (eval echo "$as_me:6372: \"$ac_link\"") >&5
6373   (eval $ac_link) 2>&5
6374   ac_status=$?
6375   echo "$as_me:6375: \$? = $ac_status" >&5
6376   (exit "$ac_status"); } &&
6377          { ac_try='test -s "conftest$ac_exeext"'
6378   { (eval echo "$as_me:6378: \"$ac_try\"") >&5
6379   (eval $ac_try) 2>&5
6380   ac_status=$?
6381   echo "$as_me:6381: \$? = $ac_status" >&5
6382   (exit "$ac_status"); }; }; then
6383   echo "$as_me:6383: result: yes" >&5
6384 echo "${ECHO_T}yes" >&6
6385                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6386
6387 else
6388   echo "$as_me: failed program was:" >&5
6389 cat "conftest.$ac_ext" >&5
6390 echo "$as_me:6390: result: no" >&5
6391 echo "${ECHO_T}no" >&6
6392
6393 cf_search=
6394 cf_library_path_list=""
6395 if test -n "${LDFLAGS}${LIBS}" ; then
6396         for cf_library_path in $LDFLAGS $LIBS
6397         do
6398                 case "$cf_library_path" in
6399                 (-L*)
6400                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6401
6402 test "x$cf_library_path" != "xNONE" && \
6403 test -d "$cf_library_path" && \
6404  {
6405         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6406         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6407         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6408         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6409         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6410         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"
6411 }
6412
6413                         cf_library_path_list="$cf_library_path_list $cf_search"
6414                         ;;
6415                 esac
6416         done
6417 fi
6418
6419 cf_search=
6420
6421 test "x$prefix" != "xNONE" && \
6422 test -d "$prefix" && \
6423  {
6424         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6425         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6426         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6427         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6428         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6429         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6430 }
6431
6432 for cf_subdir_prefix in \
6433         /usr \
6434         /usr/local \
6435         /usr/pkg \
6436         /opt \
6437         /opt/local \
6438         $HOME
6439 do
6440
6441 test "x$cf_subdir_prefix" != "x$prefix" && \
6442 test -d "$cf_subdir_prefix" && \
6443 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6444         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6445         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6446         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6447         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6448         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6449         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"
6450 }
6451
6452 done
6453
6454 cf_search="$cf_library_path_list $cf_search"
6455
6456                         for cf_libdir in $cf_search
6457                         do
6458                                 echo "$as_me:6458: checking for -l$cf_nculib_root in $cf_libdir" >&5
6459 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6460                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6461                                 cat >"conftest.$ac_ext" <<_ACEOF
6462 #line 6462 "configure"
6463 #include "confdefs.h"
6464 #include <${cf_cv_ncurses_header:-curses.h}>
6465 int
6466 main (void)
6467 {
6468 initscr()
6469   ;
6470   return 0;
6471 }
6472 _ACEOF
6473 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6474 if { (eval echo "$as_me:6474: \"$ac_link\"") >&5
6475   (eval $ac_link) 2>&5
6476   ac_status=$?
6477   echo "$as_me:6477: \$? = $ac_status" >&5
6478   (exit "$ac_status"); } &&
6479          { ac_try='test -s "conftest$ac_exeext"'
6480   { (eval echo "$as_me:6480: \"$ac_try\"") >&5
6481   (eval $ac_try) 2>&5
6482   ac_status=$?
6483   echo "$as_me:6483: \$? = $ac_status" >&5
6484   (exit "$ac_status"); }; }; then
6485   echo "$as_me:6485: result: yes" >&5
6486 echo "${ECHO_T}yes" >&6
6487                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6488                                          break
6489 else
6490   echo "$as_me: failed program was:" >&5
6491 cat "conftest.$ac_ext" >&5
6492 echo "$as_me:6492: result: no" >&5
6493 echo "${ECHO_T}no" >&6
6494                                          LIBS="$cf_save_LIBS"
6495 fi
6496 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6497                         done
6498
6499 fi
6500 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6501
6502 fi
6503
6504 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6505
6506 if test "$cf_found_library" = no ; then
6507         { { echo "$as_me:6507: error: Cannot link $cf_nculib_root library" >&5
6508 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6509    { (exit 1); exit 1; }; }
6510 fi
6511
6512 fi
6513
6514 if test -n "$cf_ncurses_LIBS" ; then
6515         echo "$as_me:6515: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6516 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6517         cf_ncurses_SAVE="$LIBS"
6518         for p in $cf_ncurses_LIBS ; do
6519                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6520                 if test "$q" != "$LIBS" ; then
6521                         LIBS="$q"
6522                 fi
6523         done
6524         cat >"conftest.$ac_ext" <<_ACEOF
6525 #line 6525 "configure"
6526 #include "confdefs.h"
6527 #include <${cf_cv_ncurses_header:-curses.h}>
6528 int
6529 main (void)
6530 {
6531 initscr(); mousemask(0,0); tigetstr((char *)0);
6532   ;
6533   return 0;
6534 }
6535 _ACEOF
6536 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6537 if { (eval echo "$as_me:6537: \"$ac_link\"") >&5
6538   (eval $ac_link) 2>&5
6539   ac_status=$?
6540   echo "$as_me:6540: \$? = $ac_status" >&5
6541   (exit "$ac_status"); } &&
6542          { ac_try='test -s "conftest$ac_exeext"'
6543   { (eval echo "$as_me:6543: \"$ac_try\"") >&5
6544   (eval $ac_try) 2>&5
6545   ac_status=$?
6546   echo "$as_me:6546: \$? = $ac_status" >&5
6547   (exit "$ac_status"); }; }; then
6548   echo "$as_me:6548: result: yes" >&5
6549 echo "${ECHO_T}yes" >&6
6550 else
6551   echo "$as_me: failed program was:" >&5
6552 cat "conftest.$ac_ext" >&5
6553 echo "$as_me:6553: result: no" >&5
6554 echo "${ECHO_T}no" >&6
6555                  LIBS="$cf_ncurses_SAVE"
6556 fi
6557 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6558 fi
6559
6560 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6561
6562 cat >>confdefs.h <<EOF
6563 #define $cf_nculib_ROOT 1
6564 EOF
6565
6566         fi
6567 else
6568         NCURSES_CONFIG=none
6569 fi
6570
6571 echo "$as_me:6571: checking if you want wide-character code" >&5
6572 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6573
6574 # Check whether --enable-widec or --disable-widec was given.
6575 if test "${enable_widec+set}" = set; then
6576   enableval="$enable_widec"
6577   with_widec=$enableval
6578 else
6579   with_widec=no
6580 fi;
6581 echo "$as_me:6581: result: $with_widec" >&5
6582 echo "${ECHO_T}$with_widec" >&6
6583 if test "$with_widec" = yes ; then
6584
6585 for ac_header in wchar.h
6586 do
6587 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6588 echo "$as_me:6588: checking for $ac_header" >&5
6589 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6590 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6591   echo $ECHO_N "(cached) $ECHO_C" >&6
6592 else
6593   cat >"conftest.$ac_ext" <<_ACEOF
6594 #line 6594 "configure"
6595 #include "confdefs.h"
6596 #include <$ac_header>
6597 _ACEOF
6598 if { (eval echo "$as_me:6598: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6599   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6600   ac_status=$?
6601   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6602   rm -f conftest.er1
6603   cat conftest.err >&5
6604   echo "$as_me:6604: \$? = $ac_status" >&5
6605   (exit "$ac_status"); } >/dev/null; then
6606   if test -s conftest.err; then
6607     ac_cpp_err=$ac_c_preproc_warn_flag
6608   else
6609     ac_cpp_err=
6610   fi
6611 else
6612   ac_cpp_err=yes
6613 fi
6614 if test -z "$ac_cpp_err"; then
6615   eval "$as_ac_Header=yes"
6616 else
6617   echo "$as_me: failed program was:" >&5
6618   cat "conftest.$ac_ext" >&5
6619   eval "$as_ac_Header=no"
6620 fi
6621 rm -f conftest.err "conftest.$ac_ext"
6622 fi
6623 echo "$as_me:6623: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6624 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6625 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6626   cat >>confdefs.h <<EOF
6627 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6628 EOF
6629
6630 fi
6631 done
6632
6633 echo "$as_me:6633: checking for multibyte character support" >&5
6634 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6635 if test "${cf_cv_utf8_lib+set}" = set; then
6636   echo $ECHO_N "(cached) $ECHO_C" >&6
6637 else
6638
6639         cf_save_LIBS="$LIBS"
6640         cat >"conftest.$ac_ext" <<_ACEOF
6641 #line 6641 "configure"
6642 #include "confdefs.h"
6643
6644 #include <stdlib.h>
6645 #include <stdio.h>
6646 #ifdef HAVE_WCHAR_H
6647 #include <wchar.h>
6648 #endif
6649
6650 int
6651 main (void)
6652 {
6653 putwc(0,0);
6654   ;
6655   return 0;
6656 }
6657 _ACEOF
6658 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6659 if { (eval echo "$as_me:6659: \"$ac_link\"") >&5
6660   (eval $ac_link) 2>&5
6661   ac_status=$?
6662   echo "$as_me:6662: \$? = $ac_status" >&5
6663   (exit "$ac_status"); } &&
6664          { ac_try='test -s "conftest$ac_exeext"'
6665   { (eval echo "$as_me:6665: \"$ac_try\"") >&5
6666   (eval $ac_try) 2>&5
6667   ac_status=$?
6668   echo "$as_me:6668: \$? = $ac_status" >&5
6669   (exit "$ac_status"); }; }; then
6670   cf_cv_utf8_lib=yes
6671 else
6672   echo "$as_me: failed program was:" >&5
6673 cat "conftest.$ac_ext" >&5
6674
6675 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6676 # will be set on completion of the AC_TRY_LINK below.
6677 cf_cv_header_path_utf8=
6678 cf_cv_library_path_utf8=
6679
6680 echo "${as_me:-configure}:6680: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6681
6682 cf_save_LIBS="$LIBS"
6683
6684 cat >"conftest.$ac_ext" <<_ACEOF
6685 #line 6685 "configure"
6686 #include "confdefs.h"
6687
6688 #include <libutf8.h>
6689 int
6690 main (void)
6691 {
6692 putwc(0,0);
6693   ;
6694   return 0;
6695 }
6696 _ACEOF
6697 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6698 if { (eval echo "$as_me:6698: \"$ac_link\"") >&5
6699   (eval $ac_link) 2>&5
6700   ac_status=$?
6701   echo "$as_me:6701: \$? = $ac_status" >&5
6702   (exit "$ac_status"); } &&
6703          { ac_try='test -s "conftest$ac_exeext"'
6704   { (eval echo "$as_me:6704: \"$ac_try\"") >&5
6705   (eval $ac_try) 2>&5
6706   ac_status=$?
6707   echo "$as_me:6707: \$? = $ac_status" >&5
6708   (exit "$ac_status"); }; }; then
6709
6710         cf_cv_find_linkage_utf8=yes
6711         cf_cv_header_path_utf8=/usr/include
6712         cf_cv_library_path_utf8=/usr/lib
6713
6714 else
6715   echo "$as_me: failed program was:" >&5
6716 cat "conftest.$ac_ext" >&5
6717
6718 LIBS="-lutf8  $cf_save_LIBS"
6719
6720 cat >"conftest.$ac_ext" <<_ACEOF
6721 #line 6721 "configure"
6722 #include "confdefs.h"
6723
6724 #include <libutf8.h>
6725 int
6726 main (void)
6727 {
6728 putwc(0,0);
6729   ;
6730   return 0;
6731 }
6732 _ACEOF
6733 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6734 if { (eval echo "$as_me:6734: \"$ac_link\"") >&5
6735   (eval $ac_link) 2>&5
6736   ac_status=$?
6737   echo "$as_me:6737: \$? = $ac_status" >&5
6738   (exit "$ac_status"); } &&
6739          { ac_try='test -s "conftest$ac_exeext"'
6740   { (eval echo "$as_me:6740: \"$ac_try\"") >&5
6741   (eval $ac_try) 2>&5
6742   ac_status=$?
6743   echo "$as_me:6743: \$? = $ac_status" >&5
6744   (exit "$ac_status"); }; }; then
6745
6746         cf_cv_find_linkage_utf8=yes
6747         cf_cv_header_path_utf8=/usr/include
6748         cf_cv_library_path_utf8=/usr/lib
6749         cf_cv_library_file_utf8="-lutf8"
6750
6751 else
6752   echo "$as_me: failed program was:" >&5
6753 cat "conftest.$ac_ext" >&5
6754
6755         cf_cv_find_linkage_utf8=no
6756         LIBS="$cf_save_LIBS"
6757
6758         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6759
6760 echo "${as_me:-configure}:6760: testing find linkage for utf8 library ..." 1>&5
6761
6762 echo "${as_me:-configure}:6762: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6763
6764         cf_save_CPPFLAGS="$CPPFLAGS"
6765         cf_test_CPPFLAGS="$CPPFLAGS"
6766
6767 cf_search=
6768
6769 # collect the current set of include-directories from compiler flags
6770 cf_header_path_list=""
6771 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6772         for cf_header_path in $CPPFLAGS $CFLAGS
6773         do
6774                 case "$cf_header_path" in
6775                 (-I*)
6776                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6777
6778 test "x$cf_header_path" != "xNONE" && \
6779 test -d "$cf_header_path" && \
6780  {
6781         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6782         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6783         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6784         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6785         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6786         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6787 }
6788
6789                         cf_header_path_list="$cf_header_path_list $cf_search"
6790                         ;;
6791                 esac
6792         done
6793 fi
6794
6795 # add the variations for the package we are looking for
6796
6797 cf_search=
6798
6799 test "x$prefix" != "xNONE" && \
6800 test -d "$prefix" && \
6801  {
6802         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6803         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6804         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6805         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6806         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6807         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6808 }
6809
6810 for cf_subdir_prefix in \
6811         /usr \
6812         /usr/local \
6813         /usr/pkg \
6814         /opt \
6815         /opt/local \
6816         $HOME
6817 do
6818
6819 test "x$cf_subdir_prefix" != "x$prefix" && \
6820 test -d "$cf_subdir_prefix" && \
6821 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6822         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6823         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6824         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6825         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6826         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6827         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6828 }
6829
6830 done
6831
6832 test "$includedir" != NONE && \
6833 test "$includedir" != "/usr/include" && \
6834 test -d "$includedir" && {
6835         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6836         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6837 }
6838
6839 test "$oldincludedir" != NONE && \
6840 test "$oldincludedir" != "/usr/include" && \
6841 test -d "$oldincludedir" && {
6842         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6843         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6844 }
6845
6846 cf_search="$cf_search $cf_header_path_list"
6847
6848         for cf_cv_header_path_utf8 in $cf_search
6849         do
6850                 if test -d "$cf_cv_header_path_utf8" ; then
6851                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6852
6853 echo "${as_me:-configure}:6853: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6854
6855                         CPPFLAGS="$cf_save_CPPFLAGS"
6856
6857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6858         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6859
6860                         cat >"conftest.$ac_ext" <<_ACEOF
6861 #line 6861 "configure"
6862 #include "confdefs.h"
6863
6864 #include <libutf8.h>
6865 int
6866 main (void)
6867 {
6868 putwc(0,0);
6869   ;
6870   return 0;
6871 }
6872 _ACEOF
6873 rm -f "conftest.$ac_objext"
6874 if { (eval echo "$as_me:6874: \"$ac_compile\"") >&5
6875   (eval $ac_compile) 2>&5
6876   ac_status=$?
6877   echo "$as_me:6877: \$? = $ac_status" >&5
6878   (exit "$ac_status"); } &&
6879          { ac_try='test -s "conftest.$ac_objext"'
6880   { (eval echo "$as_me:6880: \"$ac_try\"") >&5
6881   (eval $ac_try) 2>&5
6882   ac_status=$?
6883   echo "$as_me:6883: \$? = $ac_status" >&5
6884   (exit "$ac_status"); }; }; then
6885
6886                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6887
6888 echo "${as_me:-configure}:6888: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6889
6890                                 cf_cv_find_linkage_utf8=maybe
6891                                 cf_test_CPPFLAGS="$CPPFLAGS"
6892                                 break
6893 else
6894   echo "$as_me: failed program was:" >&5
6895 cat "conftest.$ac_ext" >&5
6896
6897                                 CPPFLAGS="$cf_save_CPPFLAGS"
6898
6899 fi
6900 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6901                 fi
6902         done
6903
6904         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6905
6906 echo "${as_me:-configure}:6906: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6907
6908                 cf_save_LIBS="$LIBS"
6909                 cf_save_LDFLAGS="$LDFLAGS"
6910
6911                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6912
6913 cf_search=
6914 cf_library_path_list=""
6915 if test -n "${LDFLAGS}${LIBS}" ; then
6916         for cf_library_path in $LDFLAGS $LIBS
6917         do
6918                 case "$cf_library_path" in
6919                 (-L*)
6920                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6921
6922 test "x$cf_library_path" != "xNONE" && \
6923 test -d "$cf_library_path" && \
6924  {
6925         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6926         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6927         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6928         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6929         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6930         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6931 }
6932
6933                         cf_library_path_list="$cf_library_path_list $cf_search"
6934                         ;;
6935                 esac
6936         done
6937 fi
6938
6939 cf_search=
6940
6941 test "x$prefix" != "xNONE" && \
6942 test -d "$prefix" && \
6943  {
6944         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6945         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6946         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6947         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6948         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6949         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6950 }
6951
6952 for cf_subdir_prefix in \
6953         /usr \
6954         /usr/local \
6955         /usr/pkg \
6956         /opt \
6957         /opt/local \
6958         $HOME
6959 do
6960
6961 test "x$cf_subdir_prefix" != "x$prefix" && \
6962 test -d "$cf_subdir_prefix" && \
6963 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6964         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6965         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6966         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6967         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6968         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6969         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6970 }
6971
6972 done
6973
6974 cf_search="$cf_library_path_list $cf_search"
6975
6976                         for cf_cv_library_path_utf8 in $cf_search
6977                         do
6978                                 if test -d "$cf_cv_library_path_utf8" ; then
6979                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6980
6981 echo "${as_me:-configure}:6981: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6982
6983                                         CPPFLAGS="$cf_test_CPPFLAGS"
6984                                         LIBS="-lutf8  $cf_save_LIBS"
6985                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6986                                         cat >"conftest.$ac_ext" <<_ACEOF
6987 #line 6987 "configure"
6988 #include "confdefs.h"
6989
6990 #include <libutf8.h>
6991 int
6992 main (void)
6993 {
6994 putwc(0,0);
6995   ;
6996   return 0;
6997 }
6998 _ACEOF
6999 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7000 if { (eval echo "$as_me:7000: \"$ac_link\"") >&5
7001   (eval $ac_link) 2>&5
7002   ac_status=$?
7003   echo "$as_me:7003: \$? = $ac_status" >&5
7004   (exit "$ac_status"); } &&
7005          { ac_try='test -s "conftest$ac_exeext"'
7006   { (eval echo "$as_me:7006: \"$ac_try\"") >&5
7007   (eval $ac_try) 2>&5
7008   ac_status=$?
7009   echo "$as_me:7009: \$? = $ac_status" >&5
7010   (exit "$ac_status"); }; }; then
7011
7012                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7013
7014 echo "${as_me:-configure}:7014: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7015
7016                                         cf_cv_find_linkage_utf8=yes
7017                                         cf_cv_library_file_utf8="-lutf8"
7018                                         break
7019 else
7020   echo "$as_me: failed program was:" >&5
7021 cat "conftest.$ac_ext" >&5
7022
7023                                         CPPFLAGS="$cf_save_CPPFLAGS"
7024                                         LIBS="$cf_save_LIBS"
7025                                         LDFLAGS="$cf_save_LDFLAGS"
7026
7027 fi
7028 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7029                                 fi
7030                         done
7031                         CPPFLAGS="$cf_save_CPPFLAGS"
7032                         LDFLAGS="$cf_save_LDFLAGS"
7033                 fi
7034
7035         else
7036                 cf_cv_find_linkage_utf8=no
7037         fi
7038
7039 fi
7040 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7041
7042 fi
7043 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7044
7045 LIBS="$cf_save_LIBS"
7046
7047 if test "$cf_cv_find_linkage_utf8" = yes ; then
7048 cf_cv_utf8_lib=add-on
7049 else
7050 cf_cv_utf8_lib=no
7051 fi
7052
7053 fi
7054 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7055 fi
7056 echo "$as_me:7056: result: $cf_cv_utf8_lib" >&5
7057 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7058
7059 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7060 # ncurses/ncursesw:
7061 if test "$cf_cv_utf8_lib" = "add-on" ; then
7062
7063 cat >>confdefs.h <<\EOF
7064 #define HAVE_LIBUTF8_H 1
7065 EOF
7066
7067 if test -n "$cf_cv_header_path_utf8" ; then
7068   for cf_add_incdir in $cf_cv_header_path_utf8
7069   do
7070         while test "$cf_add_incdir" != /usr/include
7071         do
7072           if test -d "$cf_add_incdir"
7073           then
7074                 cf_have_incdir=no
7075                 if test -n "$CFLAGS$CPPFLAGS" ; then
7076                   # a loop is needed to ensure we can add subdirs of existing dirs
7077                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7078                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7079                           cf_have_incdir=yes; break
7080                         fi
7081                   done
7082                 fi
7083
7084                 if test "$cf_have_incdir" = no ; then
7085                   if test "$cf_add_incdir" = /usr/local/include ; then
7086                         if test "$GCC" = yes
7087                         then
7088                           cf_save_CPPFLAGS=$CPPFLAGS
7089
7090         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7091         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7092
7093                           cat >"conftest.$ac_ext" <<_ACEOF
7094 #line 7094 "configure"
7095 #include "confdefs.h"
7096 #include <stdio.h>
7097 int
7098 main (void)
7099 {
7100 printf("Hello")
7101   ;
7102   return 0;
7103 }
7104 _ACEOF
7105 rm -f "conftest.$ac_objext"
7106 if { (eval echo "$as_me:7106: \"$ac_compile\"") >&5
7107   (eval $ac_compile) 2>&5
7108   ac_status=$?
7109   echo "$as_me:7109: \$? = $ac_status" >&5
7110   (exit "$ac_status"); } &&
7111          { ac_try='test -s "conftest.$ac_objext"'
7112   { (eval echo "$as_me:7112: \"$ac_try\"") >&5
7113   (eval $ac_try) 2>&5
7114   ac_status=$?
7115   echo "$as_me:7115: \$? = $ac_status" >&5
7116   (exit "$ac_status"); }; }; then
7117   :
7118 else
7119   echo "$as_me: failed program was:" >&5
7120 cat "conftest.$ac_ext" >&5
7121 cf_have_incdir=yes
7122 fi
7123 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7124                           CPPFLAGS=$cf_save_CPPFLAGS
7125                         fi
7126                   fi
7127                 fi
7128
7129                 if test "$cf_have_incdir" = no ; then
7130                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7131
7132 echo "${as_me:-configure}:7132: testing adding $cf_add_incdir to include-path ..." 1>&5
7133
7134                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7135
7136                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7137                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7138                   cf_add_incdir="$cf_top_incdir"
7139                 else
7140                   break
7141                 fi
7142           else
7143                 break
7144           fi
7145         done
7146   done
7147 fi
7148
7149 if test -n "$cf_cv_library_path_utf8" ; then
7150         for cf_add_libdir in $cf_cv_library_path_utf8
7151         do
7152                 if test "$cf_add_libdir" = /usr/lib ; then
7153                         :
7154                 elif test -d "$cf_add_libdir"
7155                 then
7156                         cf_have_libdir=no
7157                         if test -n "$LDFLAGS$LIBS" ; then
7158                                 # a loop is needed to ensure we can add subdirs of existing dirs
7159                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7160                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7161                                                 cf_have_libdir=yes; break
7162                                         fi
7163                                 done
7164                         fi
7165                         if test "$cf_have_libdir" = no ; then
7166                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7167
7168 echo "${as_me:-configure}:7168: testing adding $cf_add_libdir to library-path ..." 1>&5
7169
7170                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7171                         fi
7172                 fi
7173         done
7174 fi
7175
7176 cf_add_libs="$LIBS"
7177 # reverse order
7178 cf_add_0lib=
7179 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7180 # filter duplicates
7181 for cf_add_1lib in $cf_add_0lib; do
7182         for cf_add_2lib in $cf_add_libs; do
7183                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7184                         cf_add_1lib=
7185                         break
7186                 fi
7187         done
7188         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7189 done
7190 LIBS="$cf_add_libs"
7191
7192 fi
7193
7194 cf_ncuconfig_root=ncursesw
7195 cf_have_ncuconfig=no
7196
7197 if test "x${PKG_CONFIG:=none}" != xnone; then
7198         echo "$as_me:7198: checking pkg-config for $cf_ncuconfig_root" >&5
7199 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7200         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7201                 echo "$as_me:7201: result: yes" >&5
7202 echo "${ECHO_T}yes" >&6
7203
7204                 echo "$as_me:7204: checking if the $cf_ncuconfig_root package files work" >&5
7205 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7206                 cf_have_ncuconfig=unknown
7207
7208                 cf_save_CFLAGS="$CFLAGS"
7209                 cf_save_CPPFLAGS="$CPPFLAGS"
7210                 cf_save_LIBS="$LIBS"
7211
7212                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7213                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7214
7215                 # while -W for passing linker flags is prevalent, it is not "standard".
7216                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7217                 # incompatible _and_ non-standard -W option which gives an error.  Work
7218                 # around that pitfall.
7219                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7220                 (x*c[89]9@@*-W*)
7221
7222 cf_fix_cppflags=no
7223 cf_new_cflags=
7224 cf_new_cppflags=
7225 cf_new_extra_cppflags=
7226
7227 for cf_add_cflags in $cf_pkg_cflags
7228 do
7229 case "$cf_fix_cppflags" in
7230 (no)
7231         case "$cf_add_cflags" in
7232         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7233                 case "$cf_add_cflags" in
7234                 (-D*)
7235                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7236
7237                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7238                                 && test -z "${cf_tst_cflags}" \
7239                                 && cf_fix_cppflags=yes
7240
7241                         if test "$cf_fix_cppflags" = yes ; then
7242
7243         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7244         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7245
7246                                 continue
7247                         elif test "${cf_tst_cflags}" = "\"'" ; then
7248
7249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7251
7252                                 continue
7253                         fi
7254                         ;;
7255                 esac
7256                 case "$CPPFLAGS" in
7257                 (*$cf_add_cflags)
7258                         ;;
7259                 (*)
7260                         case "$cf_add_cflags" in
7261                         (-D*)
7262                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7263
7264 CPPFLAGS=`echo "$CPPFLAGS" | \
7265         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7266                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7267
7268                                 ;;
7269                         esac
7270
7271         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7272         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7273
7274                         ;;
7275                 esac
7276                 ;;
7277         (*)
7278
7279         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7280         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7281
7282                 ;;
7283         esac
7284         ;;
7285 (yes)
7286
7287         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7288         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7289
7290         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7291
7292         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7293                 && test -z "${cf_tst_cflags}" \
7294                 && cf_fix_cppflags=no
7295         ;;
7296 esac
7297 done
7298
7299 if test -n "$cf_new_cflags" ; then
7300
7301         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7302         CFLAGS="${CFLAGS}$cf_new_cflags"
7303
7304 fi
7305
7306 if test -n "$cf_new_cppflags" ; then
7307
7308         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7309         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7310
7311 fi
7312
7313 if test -n "$cf_new_extra_cppflags" ; then
7314
7315         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7316         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7317
7318 fi
7319
7320 cf_add_libs="$LIBS"
7321 # reverse order
7322 cf_add_0lib=
7323 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7324 # filter duplicates
7325 for cf_add_1lib in $cf_add_0lib; do
7326         for cf_add_2lib in $cf_add_libs; do
7327                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7328                         cf_add_1lib=
7329                         break
7330                 fi
7331         done
7332         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7333 done
7334 LIBS="$cf_add_libs"
7335
7336                         cat >"conftest.$ac_ext" <<_ACEOF
7337 #line 7337 "configure"
7338 #include "confdefs.h"
7339 #include <${cf_cv_ncurses_header:-curses.h}>
7340 int
7341 main (void)
7342 {
7343 initscr(); mousemask(0,0); tigetstr((char *)0);
7344   ;
7345   return 0;
7346 }
7347 _ACEOF
7348 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7349 if { (eval echo "$as_me:7349: \"$ac_link\"") >&5
7350   (eval $ac_link) 2>&5
7351   ac_status=$?
7352   echo "$as_me:7352: \$? = $ac_status" >&5
7353   (exit "$ac_status"); } &&
7354          { ac_try='test -s "conftest$ac_exeext"'
7355   { (eval echo "$as_me:7355: \"$ac_try\"") >&5
7356   (eval $ac_try) 2>&5
7357   ac_status=$?
7358   echo "$as_me:7358: \$? = $ac_status" >&5
7359   (exit "$ac_status"); }; }; then
7360   if test "$cross_compiling" = yes; then
7361   cf_test_ncuconfig=maybe
7362 else
7363   cat >"conftest.$ac_ext" <<_ACEOF
7364 #line 7364 "configure"
7365 #include "confdefs.h"
7366 #include <${cf_cv_ncurses_header:-curses.h}>
7367                                         int main(void)
7368                                         { const char *xx = curses_version(); return (xx == 0); }
7369 _ACEOF
7370 rm -f "conftest$ac_exeext"
7371 if { (eval echo "$as_me:7371: \"$ac_link\"") >&5
7372   (eval $ac_link) 2>&5
7373   ac_status=$?
7374   echo "$as_me:7374: \$? = $ac_status" >&5
7375   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7376   { (eval echo "$as_me:7376: \"$ac_try\"") >&5
7377   (eval $ac_try) 2>&5
7378   ac_status=$?
7379   echo "$as_me:7379: \$? = $ac_status" >&5
7380   (exit "$ac_status"); }; }; then
7381   cf_test_ncuconfig=yes
7382 else
7383   echo "$as_me: program exited with status $ac_status" >&5
7384 echo "$as_me: failed program was:" >&5
7385 cat "conftest.$ac_ext" >&5
7386 cf_test_ncuconfig=no
7387 fi
7388 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7389 fi
7390 else
7391   echo "$as_me: failed program was:" >&5
7392 cat "conftest.$ac_ext" >&5
7393 cf_test_ncuconfig=no
7394 fi
7395 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7396
7397                         CFLAGS="$cf_save_CFLAGS"
7398                         CPPFLAGS="$cf_save_CPPFLAGS"
7399                         LIBS="$cf_save_LIBS"
7400
7401                         if test "x$cf_test_ncuconfig" != xyes; then
7402                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7403                                 cf_pkg_cflags="$cf_temp"
7404                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7405                                 cf_pkg_libs="$cf_temp"
7406                         fi
7407                         ;;
7408                 esac
7409
7410 for cf_add_cflags in $cf_pkg_cflags
7411 do
7412         case "x$cf_add_cflags" in
7413         (x-[DU]*)
7414
7415 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7416 while true
7417 do
7418         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'`
7419         test "$CFLAGS" != "$cf_old_cflag" || break
7420
7421         CFLAGS="$cf_old_cflag"
7422 done
7423
7424 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7425 while true
7426 do
7427         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'`
7428         test "$CPPFLAGS" != "$cf_old_cflag" || break
7429
7430         CPPFLAGS="$cf_old_cflag"
7431 done
7432
7433                 ;;
7434         esac
7435
7436 cf_fix_cppflags=no
7437 cf_new_cflags=
7438 cf_new_cppflags=
7439 cf_new_extra_cppflags=
7440
7441 for cf_add_cflags in $cf_add_cflags
7442 do
7443 case "$cf_fix_cppflags" in
7444 (no)
7445         case "$cf_add_cflags" in
7446         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7447                 case "$cf_add_cflags" in
7448                 (-D*)
7449                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7450
7451                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7452                                 && test -z "${cf_tst_cflags}" \
7453                                 && cf_fix_cppflags=yes
7454
7455                         if test "$cf_fix_cppflags" = yes ; then
7456
7457         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7458         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7459
7460                                 continue
7461                         elif test "${cf_tst_cflags}" = "\"'" ; then
7462
7463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7465
7466                                 continue
7467                         fi
7468                         ;;
7469                 esac
7470                 case "$CPPFLAGS" in
7471                 (*$cf_add_cflags)
7472                         ;;
7473                 (*)
7474                         case "$cf_add_cflags" in
7475                         (-D*)
7476                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7477
7478 CPPFLAGS=`echo "$CPPFLAGS" | \
7479         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7480                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7481
7482                                 ;;
7483                         esac
7484
7485         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7486         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7487
7488                         ;;
7489                 esac
7490                 ;;
7491         (*)
7492
7493         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7494         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7495
7496                 ;;
7497         esac
7498         ;;
7499 (yes)
7500
7501         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7502         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7503
7504         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7505
7506         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7507                 && test -z "${cf_tst_cflags}" \
7508                 && cf_fix_cppflags=no
7509         ;;
7510 esac
7511 done
7512
7513 if test -n "$cf_new_cflags" ; then
7514
7515         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7516         CFLAGS="${CFLAGS}$cf_new_cflags"
7517
7518 fi
7519
7520 if test -n "$cf_new_cppflags" ; then
7521
7522         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7523         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7524
7525 fi
7526
7527 if test -n "$cf_new_extra_cppflags" ; then
7528
7529         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7530         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7531
7532 fi
7533
7534 done
7535
7536 cf_add_libs="$LIBS"
7537 # reverse order
7538 cf_add_0lib=
7539 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7540 # filter duplicates
7541 for cf_add_1lib in $cf_add_0lib; do
7542         for cf_add_2lib in $cf_add_libs; do
7543                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7544                         cf_add_1lib=
7545                         break
7546                 fi
7547         done
7548         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7549 done
7550 LIBS="$cf_add_libs"
7551
7552                 cat >"conftest.$ac_ext" <<_ACEOF
7553 #line 7553 "configure"
7554 #include "confdefs.h"
7555 #include <${cf_cv_ncurses_header:-curses.h}>
7556 int
7557 main (void)
7558 {
7559 initscr(); mousemask(0,0); tigetstr((char *)0);
7560   ;
7561   return 0;
7562 }
7563 _ACEOF
7564 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7565 if { (eval echo "$as_me:7565: \"$ac_link\"") >&5
7566   (eval $ac_link) 2>&5
7567   ac_status=$?
7568   echo "$as_me:7568: \$? = $ac_status" >&5
7569   (exit "$ac_status"); } &&
7570          { ac_try='test -s "conftest$ac_exeext"'
7571   { (eval echo "$as_me:7571: \"$ac_try\"") >&5
7572   (eval $ac_try) 2>&5
7573   ac_status=$?
7574   echo "$as_me:7574: \$? = $ac_status" >&5
7575   (exit "$ac_status"); }; }; then
7576   if test "$cross_compiling" = yes; then
7577   cf_have_ncuconfig=maybe
7578 else
7579   cat >"conftest.$ac_ext" <<_ACEOF
7580 #line 7580 "configure"
7581 #include "confdefs.h"
7582 #include <${cf_cv_ncurses_header:-curses.h}>
7583                                 int main(void)
7584                                 { const char *xx = curses_version(); return (xx == 0); }
7585 _ACEOF
7586 rm -f "conftest$ac_exeext"
7587 if { (eval echo "$as_me:7587: \"$ac_link\"") >&5
7588   (eval $ac_link) 2>&5
7589   ac_status=$?
7590   echo "$as_me:7590: \$? = $ac_status" >&5
7591   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7592   { (eval echo "$as_me:7592: \"$ac_try\"") >&5
7593   (eval $ac_try) 2>&5
7594   ac_status=$?
7595   echo "$as_me:7595: \$? = $ac_status" >&5
7596   (exit "$ac_status"); }; }; then
7597   cf_have_ncuconfig=yes
7598 else
7599   echo "$as_me: program exited with status $ac_status" >&5
7600 echo "$as_me: failed program was:" >&5
7601 cat "conftest.$ac_ext" >&5
7602 cf_have_ncuconfig=no
7603 fi
7604 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7605 fi
7606 else
7607   echo "$as_me: failed program was:" >&5
7608 cat "conftest.$ac_ext" >&5
7609 cf_have_ncuconfig=no
7610 fi
7611 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7612                 echo "$as_me:7612: result: $cf_have_ncuconfig" >&5
7613 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7614                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7615                 if test "$cf_have_ncuconfig" != "yes"
7616                 then
7617                         CPPFLAGS="$cf_save_CPPFLAGS"
7618                         LIBS="$cf_save_LIBS"
7619                         NCURSES_CONFIG_PKG=none
7620                 else
7621
7622 cat >>confdefs.h <<\EOF
7623 #define NCURSES 1
7624 EOF
7625
7626                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7627
7628 echo "$as_me:7628: checking for terminfo header" >&5
7629 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7630 if test "${cf_cv_term_header+set}" = set; then
7631   echo $ECHO_N "(cached) $ECHO_C" >&6
7632 else
7633
7634 case "${cf_cv_ncurses_header}" in
7635 (*/ncurses.h|*/ncursesw.h)
7636         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7637         ;;
7638 (*)
7639         cf_term_header=term.h
7640         ;;
7641 esac
7642
7643 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7644 do
7645 cat >"conftest.$ac_ext" <<_ACEOF
7646 #line 7646 "configure"
7647 #include "confdefs.h"
7648 #include <stdio.h>
7649 #include <${cf_cv_ncurses_header:-curses.h}>
7650 #include <$cf_test>
7651
7652 int
7653 main (void)
7654 {
7655 int x = auto_left_margin; (void)x
7656   ;
7657   return 0;
7658 }
7659 _ACEOF
7660 rm -f "conftest.$ac_objext"
7661 if { (eval echo "$as_me:7661: \"$ac_compile\"") >&5
7662   (eval $ac_compile) 2>&5
7663   ac_status=$?
7664   echo "$as_me:7664: \$? = $ac_status" >&5
7665   (exit "$ac_status"); } &&
7666          { ac_try='test -s "conftest.$ac_objext"'
7667   { (eval echo "$as_me:7667: \"$ac_try\"") >&5
7668   (eval $ac_try) 2>&5
7669   ac_status=$?
7670   echo "$as_me:7670: \$? = $ac_status" >&5
7671   (exit "$ac_status"); }; }; then
7672
7673         cf_cv_term_header="$cf_test"
7674 else
7675   echo "$as_me: failed program was:" >&5
7676 cat "conftest.$ac_ext" >&5
7677
7678         cf_cv_term_header=unknown
7679
7680 fi
7681 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7682         test "$cf_cv_term_header" != unknown && break
7683 done
7684
7685 fi
7686 echo "$as_me:7686: result: $cf_cv_term_header" >&5
7687 echo "${ECHO_T}$cf_cv_term_header" >&6
7688
7689 # Set definitions to allow ifdef'ing to accommodate subdirectories
7690
7691 case "$cf_cv_term_header" in
7692 (*term.h)
7693
7694 cat >>confdefs.h <<\EOF
7695 #define HAVE_TERM_H 1
7696 EOF
7697
7698         ;;
7699 esac
7700
7701 case "$cf_cv_term_header" in
7702 (ncurses/term.h)
7703
7704 cat >>confdefs.h <<\EOF
7705 #define HAVE_NCURSES_TERM_H 1
7706 EOF
7707
7708         ;;
7709 (ncursesw/term.h)
7710
7711 cat >>confdefs.h <<\EOF
7712 #define HAVE_NCURSESW_TERM_H 1
7713 EOF
7714
7715         ;;
7716 esac
7717
7718                 fi
7719
7720         else
7721                 echo "$as_me:7721: result: no" >&5
7722 echo "${ECHO_T}no" >&6
7723                 NCURSES_CONFIG_PKG=none
7724         fi
7725 else
7726         NCURSES_CONFIG_PKG=none
7727 fi
7728
7729 if test "x$cf_have_ncuconfig" = "xno"; then
7730         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7731
7732 if test -n "$ac_tool_prefix"; then
7733   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7734   do
7735     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7736 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7737 echo "$as_me:7737: checking for $ac_word" >&5
7738 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7739 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7740   echo $ECHO_N "(cached) $ECHO_C" >&6
7741 else
7742   if test -n "$NCURSES_CONFIG"; then
7743   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7744 else
7745   ac_save_IFS=$IFS; IFS=$ac_path_separator
7746 ac_dummy="$PATH"
7747 for ac_dir in $ac_dummy; do
7748   IFS=$ac_save_IFS
7749   test -z "$ac_dir" && ac_dir=.
7750   $as_executable_p "$ac_dir/$ac_word" || continue
7751 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7752 echo "$as_me:7752: found $ac_dir/$ac_word" >&5
7753 break
7754 done
7755
7756 fi
7757 fi
7758 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7759 if test -n "$NCURSES_CONFIG"; then
7760   echo "$as_me:7760: result: $NCURSES_CONFIG" >&5
7761 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7762 else
7763   echo "$as_me:7763: result: no" >&5
7764 echo "${ECHO_T}no" >&6
7765 fi
7766
7767     test -n "$NCURSES_CONFIG" && break
7768   done
7769 fi
7770 if test -z "$NCURSES_CONFIG"; then
7771   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7772   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7773 do
7774   # Extract the first word of "$ac_prog", so it can be a program name with args.
7775 set dummy $ac_prog; ac_word=$2
7776 echo "$as_me:7776: checking for $ac_word" >&5
7777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7778 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7779   echo $ECHO_N "(cached) $ECHO_C" >&6
7780 else
7781   if test -n "$ac_ct_NCURSES_CONFIG"; then
7782   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7783 else
7784   ac_save_IFS=$IFS; IFS=$ac_path_separator
7785 ac_dummy="$PATH"
7786 for ac_dir in $ac_dummy; do
7787   IFS=$ac_save_IFS
7788   test -z "$ac_dir" && ac_dir=.
7789   $as_executable_p "$ac_dir/$ac_word" || continue
7790 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7791 echo "$as_me:7791: found $ac_dir/$ac_word" >&5
7792 break
7793 done
7794
7795 fi
7796 fi
7797 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7798 if test -n "$ac_ct_NCURSES_CONFIG"; then
7799   echo "$as_me:7799: result: $ac_ct_NCURSES_CONFIG" >&5
7800 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7801 else
7802   echo "$as_me:7802: result: no" >&5
7803 echo "${ECHO_T}no" >&6
7804 fi
7805
7806   test -n "$ac_ct_NCURSES_CONFIG" && break
7807 done
7808 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7809
7810   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7811 fi
7812
7813         if test "$NCURSES_CONFIG" != none ; then
7814
7815 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7816 do
7817         case "x$cf_add_cflags" in
7818         (x-[DU]*)
7819
7820 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7821 while true
7822 do
7823         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'`
7824         test "$CFLAGS" != "$cf_old_cflag" || break
7825
7826         CFLAGS="$cf_old_cflag"
7827 done
7828
7829 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7830 while true
7831 do
7832         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'`
7833         test "$CPPFLAGS" != "$cf_old_cflag" || break
7834
7835         CPPFLAGS="$cf_old_cflag"
7836 done
7837
7838                 ;;
7839         esac
7840
7841 cf_fix_cppflags=no
7842 cf_new_cflags=
7843 cf_new_cppflags=
7844 cf_new_extra_cppflags=
7845
7846 for cf_add_cflags in $cf_add_cflags
7847 do
7848 case "$cf_fix_cppflags" in
7849 (no)
7850         case "$cf_add_cflags" in
7851         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7852                 case "$cf_add_cflags" in
7853                 (-D*)
7854                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7855
7856                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7857                                 && test -z "${cf_tst_cflags}" \
7858                                 && cf_fix_cppflags=yes
7859
7860                         if test "$cf_fix_cppflags" = yes ; then
7861
7862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7864
7865                                 continue
7866                         elif test "${cf_tst_cflags}" = "\"'" ; then
7867
7868         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7869         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7870
7871                                 continue
7872                         fi
7873                         ;;
7874                 esac
7875                 case "$CPPFLAGS" in
7876                 (*$cf_add_cflags)
7877                         ;;
7878                 (*)
7879                         case "$cf_add_cflags" in
7880                         (-D*)
7881                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7882
7883 CPPFLAGS=`echo "$CPPFLAGS" | \
7884         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7885                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7886
7887                                 ;;
7888                         esac
7889
7890         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7891         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7892
7893                         ;;
7894                 esac
7895                 ;;
7896         (*)
7897
7898         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7899         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7900
7901                 ;;
7902         esac
7903         ;;
7904 (yes)
7905
7906         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7907         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7908
7909         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7910
7911         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7912                 && test -z "${cf_tst_cflags}" \
7913                 && cf_fix_cppflags=no
7914         ;;
7915 esac
7916 done
7917
7918 if test -n "$cf_new_cflags" ; then
7919
7920         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7921         CFLAGS="${CFLAGS}$cf_new_cflags"
7922
7923 fi
7924
7925 if test -n "$cf_new_cppflags" ; then
7926
7927         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7928         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7929
7930 fi
7931
7932 if test -n "$cf_new_extra_cppflags" ; then
7933
7934         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7935         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7936
7937 fi
7938
7939 done
7940
7941 cf_add_libs="$LIBS"
7942 # reverse order
7943 cf_add_0lib=
7944 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7945 # filter duplicates
7946 for cf_add_1lib in $cf_add_0lib; do
7947         for cf_add_2lib in $cf_add_libs; do
7948                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7949                         cf_add_1lib=
7950                         break
7951                 fi
7952         done
7953         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7954 done
7955 LIBS="$cf_add_libs"
7956
7957                 # even with config script, some packages use no-override for curses.h
7958
7959 echo "$as_me:7959: checking if we have identified curses headers" >&5
7960 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7961 if test "${cf_cv_ncurses_header+set}" = set; then
7962   echo $ECHO_N "(cached) $ECHO_C" >&6
7963 else
7964
7965 cf_cv_ncurses_header=none
7966 for cf_header in \
7967         ncurses.h ncursesw/ncurses.h \
7968         curses.h ncursesw/curses.h
7969 do
7970 cat >"conftest.$ac_ext" <<_ACEOF
7971 #line 7971 "configure"
7972 #include "confdefs.h"
7973 #include <${cf_header}>
7974 int
7975 main (void)
7976 {
7977 initscr(); tgoto("?", 0,0)
7978   ;
7979   return 0;
7980 }
7981 _ACEOF
7982 rm -f "conftest.$ac_objext"
7983 if { (eval echo "$as_me:7983: \"$ac_compile\"") >&5
7984   (eval $ac_compile) 2>&5
7985   ac_status=$?
7986   echo "$as_me:7986: \$? = $ac_status" >&5
7987   (exit "$ac_status"); } &&
7988          { ac_try='test -s "conftest.$ac_objext"'
7989   { (eval echo "$as_me:7989: \"$ac_try\"") >&5
7990   (eval $ac_try) 2>&5
7991   ac_status=$?
7992   echo "$as_me:7992: \$? = $ac_status" >&5
7993   (exit "$ac_status"); }; }; then
7994   cf_cv_ncurses_header=$cf_header; break
7995 else
7996   echo "$as_me: failed program was:" >&5
7997 cat "conftest.$ac_ext" >&5
7998 fi
7999 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8000 done
8001
8002 fi
8003 echo "$as_me:8003: result: $cf_cv_ncurses_header" >&5
8004 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8005
8006 if test "$cf_cv_ncurses_header" = none ; then
8007         { { echo "$as_me:8007: error: No curses header-files found" >&5
8008 echo "$as_me: error: No curses header-files found" >&2;}
8009    { (exit 1); exit 1; }; }
8010 fi
8011
8012 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8013
8014 for ac_header in $cf_cv_ncurses_header
8015 do
8016 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8017 echo "$as_me:8017: checking for $ac_header" >&5
8018 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8019 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8020   echo $ECHO_N "(cached) $ECHO_C" >&6
8021 else
8022   cat >"conftest.$ac_ext" <<_ACEOF
8023 #line 8023 "configure"
8024 #include "confdefs.h"
8025 #include <$ac_header>
8026 _ACEOF
8027 if { (eval echo "$as_me:8027: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8028   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8029   ac_status=$?
8030   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8031   rm -f conftest.er1
8032   cat conftest.err >&5
8033   echo "$as_me:8033: \$? = $ac_status" >&5
8034   (exit "$ac_status"); } >/dev/null; then
8035   if test -s conftest.err; then
8036     ac_cpp_err=$ac_c_preproc_warn_flag
8037   else
8038     ac_cpp_err=
8039   fi
8040 else
8041   ac_cpp_err=yes
8042 fi
8043 if test -z "$ac_cpp_err"; then
8044   eval "$as_ac_Header=yes"
8045 else
8046   echo "$as_me: failed program was:" >&5
8047   cat "conftest.$ac_ext" >&5
8048   eval "$as_ac_Header=no"
8049 fi
8050 rm -f conftest.err "conftest.$ac_ext"
8051 fi
8052 echo "$as_me:8052: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8053 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8054 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8055   cat >>confdefs.h <<EOF
8056 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8057 EOF
8058
8059 fi
8060 done
8061
8062 cat >>confdefs.h <<\EOF
8063 #define NCURSES 1
8064 EOF
8065
8066 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8067
8068                 cat >>confdefs.h <<EOF
8069 #define $cf_nculib_ROOT 1
8070 EOF
8071
8072                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8073
8074         else
8075
8076 cf_ncuhdr_root=ncursesw
8077
8078 test -n "$cf_cv_curses_dir" && \
8079 test "$cf_cv_curses_dir" != "no" && { \
8080
8081 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8082   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8083   do
8084         while test "$cf_add_incdir" != /usr/include
8085         do
8086           if test -d "$cf_add_incdir"
8087           then
8088                 cf_have_incdir=no
8089                 if test -n "$CFLAGS$CPPFLAGS" ; then
8090                   # a loop is needed to ensure we can add subdirs of existing dirs
8091                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8092                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8093                           cf_have_incdir=yes; break
8094                         fi
8095                   done
8096                 fi
8097
8098                 if test "$cf_have_incdir" = no ; then
8099                   if test "$cf_add_incdir" = /usr/local/include ; then
8100                         if test "$GCC" = yes
8101                         then
8102                           cf_save_CPPFLAGS=$CPPFLAGS
8103
8104         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8105         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8106
8107                           cat >"conftest.$ac_ext" <<_ACEOF
8108 #line 8108 "configure"
8109 #include "confdefs.h"
8110 #include <stdio.h>
8111 int
8112 main (void)
8113 {
8114 printf("Hello")
8115   ;
8116   return 0;
8117 }
8118 _ACEOF
8119 rm -f "conftest.$ac_objext"
8120 if { (eval echo "$as_me:8120: \"$ac_compile\"") >&5
8121   (eval $ac_compile) 2>&5
8122   ac_status=$?
8123   echo "$as_me:8123: \$? = $ac_status" >&5
8124   (exit "$ac_status"); } &&
8125          { ac_try='test -s "conftest.$ac_objext"'
8126   { (eval echo "$as_me:8126: \"$ac_try\"") >&5
8127   (eval $ac_try) 2>&5
8128   ac_status=$?
8129   echo "$as_me:8129: \$? = $ac_status" >&5
8130   (exit "$ac_status"); }; }; then
8131   :
8132 else
8133   echo "$as_me: failed program was:" >&5
8134 cat "conftest.$ac_ext" >&5
8135 cf_have_incdir=yes
8136 fi
8137 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8138                           CPPFLAGS=$cf_save_CPPFLAGS
8139                         fi
8140                   fi
8141                 fi
8142
8143                 if test "$cf_have_incdir" = no ; then
8144                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8145
8146 echo "${as_me:-configure}:8146: testing adding $cf_add_incdir to include-path ..." 1>&5
8147
8148                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8149
8150                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8151                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8152                   cf_add_incdir="$cf_top_incdir"
8153                 else
8154                   break
8155                 fi
8156           else
8157                 break
8158           fi
8159         done
8160   done
8161 fi
8162
8163 }
8164
8165 echo "$as_me:8165: checking for $cf_ncuhdr_root header in include-path" >&5
8166 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8167 if test "${cf_cv_ncurses_h+set}" = set; then
8168   echo $ECHO_N "(cached) $ECHO_C" >&6
8169 else
8170
8171         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8172         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8173         for cf_header in $cf_header_list
8174         do
8175
8176         cat >"conftest.$ac_ext" <<_ACEOF
8177 #line 8177 "configure"
8178 #include "confdefs.h"
8179
8180 #define _XOPEN_SOURCE_EXTENDED
8181 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8182 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8183
8184 #include <$cf_header>
8185 int
8186 main (void)
8187 {
8188
8189 #ifdef NCURSES_VERSION
8190
8191 #ifndef WACS_BSSB
8192         make an error
8193 #endif
8194
8195 printf("%s\\n", NCURSES_VERSION);
8196 #else
8197 #ifdef __NCURSES_H
8198 printf("old\\n");
8199 #else
8200         make an error
8201 #endif
8202 #endif
8203
8204   ;
8205   return 0;
8206 }
8207 _ACEOF
8208 rm -f "conftest.$ac_objext"
8209 if { (eval echo "$as_me:8209: \"$ac_compile\"") >&5
8210   (eval $ac_compile) 2>&5
8211   ac_status=$?
8212   echo "$as_me:8212: \$? = $ac_status" >&5
8213   (exit "$ac_status"); } &&
8214          { ac_try='test -s "conftest.$ac_objext"'
8215   { (eval echo "$as_me:8215: \"$ac_try\"") >&5
8216   (eval $ac_try) 2>&5
8217   ac_status=$?
8218   echo "$as_me:8218: \$? = $ac_status" >&5
8219   (exit "$ac_status"); }; }; then
8220   cf_cv_ncurses_h=$cf_header
8221
8222 else
8223   echo "$as_me: failed program was:" >&5
8224 cat "conftest.$ac_ext" >&5
8225 cf_cv_ncurses_h=no
8226 fi
8227 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8228
8229                 test "$cf_cv_ncurses_h" != no && break
8230         done
8231
8232 fi
8233 echo "$as_me:8233: result: $cf_cv_ncurses_h" >&5
8234 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8235
8236 if test "$cf_cv_ncurses_h" != no ; then
8237         cf_cv_ncurses_header=$cf_cv_ncurses_h
8238 else
8239
8240 echo "$as_me:8240: checking for $cf_ncuhdr_root include-path" >&5
8241 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8242 if test "${cf_cv_ncurses_h2+set}" = set; then
8243   echo $ECHO_N "(cached) $ECHO_C" >&6
8244 else
8245
8246         test -n "$verbose" && echo
8247
8248 cf_search=
8249
8250 # collect the current set of include-directories from compiler flags
8251 cf_header_path_list=""
8252 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8253         for cf_header_path in $CPPFLAGS $CFLAGS
8254         do
8255                 case "$cf_header_path" in
8256                 (-I*)
8257                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8258
8259 test "x$cf_header_path" != "xNONE" && \
8260 test -d "$cf_header_path" && \
8261  {
8262         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8263         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8264         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8265         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8266         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8267         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"
8268 }
8269
8270                         cf_header_path_list="$cf_header_path_list $cf_search"
8271                         ;;
8272                 esac
8273         done
8274 fi
8275
8276 # add the variations for the package we are looking for
8277
8278 cf_search=
8279
8280 test "x$prefix" != "xNONE" && \
8281 test -d "$prefix" && \
8282  {
8283         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8284         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8285         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8286         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8287         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8288         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8289 }
8290
8291 for cf_subdir_prefix in \
8292         /usr \
8293         /usr/local \
8294         /usr/pkg \
8295         /opt \
8296         /opt/local \
8297         $HOME
8298 do
8299
8300 test "x$cf_subdir_prefix" != "x$prefix" && \
8301 test -d "$cf_subdir_prefix" && \
8302 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8303         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8304         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8305         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8306         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8307         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8308         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"
8309 }
8310
8311 done
8312
8313 test "$includedir" != NONE && \
8314 test "$includedir" != "/usr/include" && \
8315 test -d "$includedir" && {
8316         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8317         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8318 }
8319
8320 test "$oldincludedir" != NONE && \
8321 test "$oldincludedir" != "/usr/include" && \
8322 test -d "$oldincludedir" && {
8323         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8324         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8325 }
8326
8327 cf_search="$cf_search $cf_header_path_list"
8328
8329         test -n "$verbose" && echo "search path $cf_search"
8330         cf_save2_CPPFLAGS="$CPPFLAGS"
8331         for cf_incdir in $cf_search
8332         do
8333
8334 if test -n "$cf_incdir" ; then
8335   for cf_add_incdir in $cf_incdir
8336   do
8337         while test "$cf_add_incdir" != /usr/include
8338         do
8339           if test -d "$cf_add_incdir"
8340           then
8341                 cf_have_incdir=no
8342                 if test -n "$CFLAGS$CPPFLAGS" ; then
8343                   # a loop is needed to ensure we can add subdirs of existing dirs
8344                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8345                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8346                           cf_have_incdir=yes; break
8347                         fi
8348                   done
8349                 fi
8350
8351                 if test "$cf_have_incdir" = no ; then
8352                   if test "$cf_add_incdir" = /usr/local/include ; then
8353                         if test "$GCC" = yes
8354                         then
8355                           cf_save_CPPFLAGS=$CPPFLAGS
8356
8357         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8358         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8359
8360                           cat >"conftest.$ac_ext" <<_ACEOF
8361 #line 8361 "configure"
8362 #include "confdefs.h"
8363 #include <stdio.h>
8364 int
8365 main (void)
8366 {
8367 printf("Hello")
8368   ;
8369   return 0;
8370 }
8371 _ACEOF
8372 rm -f "conftest.$ac_objext"
8373 if { (eval echo "$as_me:8373: \"$ac_compile\"") >&5
8374   (eval $ac_compile) 2>&5
8375   ac_status=$?
8376   echo "$as_me:8376: \$? = $ac_status" >&5
8377   (exit "$ac_status"); } &&
8378          { ac_try='test -s "conftest.$ac_objext"'
8379   { (eval echo "$as_me:8379: \"$ac_try\"") >&5
8380   (eval $ac_try) 2>&5
8381   ac_status=$?
8382   echo "$as_me:8382: \$? = $ac_status" >&5
8383   (exit "$ac_status"); }; }; then
8384   :
8385 else
8386   echo "$as_me: failed program was:" >&5
8387 cat "conftest.$ac_ext" >&5
8388 cf_have_incdir=yes
8389 fi
8390 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8391                           CPPFLAGS=$cf_save_CPPFLAGS
8392                         fi
8393                   fi
8394                 fi
8395
8396                 if test "$cf_have_incdir" = no ; then
8397                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8398
8399 echo "${as_me:-configure}:8399: testing adding $cf_add_incdir to include-path ..." 1>&5
8400
8401                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8402
8403                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8404                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8405                   cf_add_incdir="$cf_top_incdir"
8406                 else
8407                   break
8408                 fi
8409           else
8410                 break
8411           fi
8412         done
8413   done
8414 fi
8415
8416                 for cf_header in \
8417                         ncurses.h \
8418                         curses.h
8419                 do
8420
8421         cat >"conftest.$ac_ext" <<_ACEOF
8422 #line 8422 "configure"
8423 #include "confdefs.h"
8424
8425 #include <$cf_header>
8426 int
8427 main (void)
8428 {
8429
8430 #ifdef NCURSES_VERSION
8431
8432 printf("%s\\n", NCURSES_VERSION);
8433 #else
8434 #ifdef __NCURSES_H
8435 printf("old\\n");
8436 #else
8437         make an error
8438 #endif
8439 #endif
8440
8441   ;
8442   return 0;
8443 }
8444 _ACEOF
8445 rm -f "conftest.$ac_objext"
8446 if { (eval echo "$as_me:8446: \"$ac_compile\"") >&5
8447   (eval $ac_compile) 2>&5
8448   ac_status=$?
8449   echo "$as_me:8449: \$? = $ac_status" >&5
8450   (exit "$ac_status"); } &&
8451          { ac_try='test -s "conftest.$ac_objext"'
8452   { (eval echo "$as_me:8452: \"$ac_try\"") >&5
8453   (eval $ac_try) 2>&5
8454   ac_status=$?
8455   echo "$as_me:8455: \$? = $ac_status" >&5
8456   (exit "$ac_status"); }; }; then
8457   cf_cv_ncurses_h2=$cf_header
8458
8459 else
8460   echo "$as_me: failed program was:" >&5
8461 cat "conftest.$ac_ext" >&5
8462 cf_cv_ncurses_h2=no
8463 fi
8464 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8465
8466                         if test "$cf_cv_ncurses_h2" != no ; then
8467                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8468                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8469                                 break
8470                         fi
8471                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8472                 done
8473                 CPPFLAGS="$cf_save2_CPPFLAGS"
8474                 test "$cf_cv_ncurses_h2" != no && break
8475         done
8476         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8476: error: not found" >&5
8477 echo "$as_me: error: not found" >&2;}
8478    { (exit 1); exit 1; }; }
8479
8480 fi
8481 echo "$as_me:8481: result: $cf_cv_ncurses_h2" >&5
8482 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8483
8484         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8485         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8486         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8487                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8488         fi
8489
8490 if test -n "$cf_1st_incdir" ; then
8491   for cf_add_incdir in $cf_1st_incdir
8492   do
8493         while test "$cf_add_incdir" != /usr/include
8494         do
8495           if test -d "$cf_add_incdir"
8496           then
8497                 cf_have_incdir=no
8498                 if test -n "$CFLAGS$CPPFLAGS" ; then
8499                   # a loop is needed to ensure we can add subdirs of existing dirs
8500                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8501                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8502                           cf_have_incdir=yes; break
8503                         fi
8504                   done
8505                 fi
8506
8507                 if test "$cf_have_incdir" = no ; then
8508                   if test "$cf_add_incdir" = /usr/local/include ; then
8509                         if test "$GCC" = yes
8510                         then
8511                           cf_save_CPPFLAGS=$CPPFLAGS
8512
8513         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8514         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8515
8516                           cat >"conftest.$ac_ext" <<_ACEOF
8517 #line 8517 "configure"
8518 #include "confdefs.h"
8519 #include <stdio.h>
8520 int
8521 main (void)
8522 {
8523 printf("Hello")
8524   ;
8525   return 0;
8526 }
8527 _ACEOF
8528 rm -f "conftest.$ac_objext"
8529 if { (eval echo "$as_me:8529: \"$ac_compile\"") >&5
8530   (eval $ac_compile) 2>&5
8531   ac_status=$?
8532   echo "$as_me:8532: \$? = $ac_status" >&5
8533   (exit "$ac_status"); } &&
8534          { ac_try='test -s "conftest.$ac_objext"'
8535   { (eval echo "$as_me:8535: \"$ac_try\"") >&5
8536   (eval $ac_try) 2>&5
8537   ac_status=$?
8538   echo "$as_me:8538: \$? = $ac_status" >&5
8539   (exit "$ac_status"); }; }; then
8540   :
8541 else
8542   echo "$as_me: failed program was:" >&5
8543 cat "conftest.$ac_ext" >&5
8544 cf_have_incdir=yes
8545 fi
8546 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8547                           CPPFLAGS=$cf_save_CPPFLAGS
8548                         fi
8549                   fi
8550                 fi
8551
8552                 if test "$cf_have_incdir" = no ; then
8553                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8554
8555 echo "${as_me:-configure}:8555: testing adding $cf_add_incdir to include-path ..." 1>&5
8556
8557                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8558
8559                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8560                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8561                   cf_add_incdir="$cf_top_incdir"
8562                 else
8563                   break
8564                 fi
8565           else
8566                 break
8567           fi
8568         done
8569   done
8570 fi
8571
8572 fi
8573
8574 # Set definitions to allow ifdef'ing for ncurses.h
8575
8576 case "$cf_cv_ncurses_header" in
8577 (*ncurses.h)
8578
8579 cat >>confdefs.h <<\EOF
8580 #define HAVE_NCURSES_H 1
8581 EOF
8582
8583         ;;
8584 esac
8585
8586 case "$cf_cv_ncurses_header" in
8587 (ncurses/curses.h|ncurses/ncurses.h)
8588
8589 cat >>confdefs.h <<\EOF
8590 #define HAVE_NCURSES_NCURSES_H 1
8591 EOF
8592
8593         ;;
8594 (ncursesw/curses.h|ncursesw/ncurses.h)
8595
8596 cat >>confdefs.h <<\EOF
8597 #define HAVE_NCURSESW_NCURSES_H 1
8598 EOF
8599
8600         ;;
8601 esac
8602
8603 echo "$as_me:8603: checking for terminfo header" >&5
8604 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8605 if test "${cf_cv_term_header+set}" = set; then
8606   echo $ECHO_N "(cached) $ECHO_C" >&6
8607 else
8608
8609 case "${cf_cv_ncurses_header}" in
8610 (*/ncurses.h|*/ncursesw.h)
8611         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8612         ;;
8613 (*)
8614         cf_term_header=term.h
8615         ;;
8616 esac
8617
8618 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8619 do
8620 cat >"conftest.$ac_ext" <<_ACEOF
8621 #line 8621 "configure"
8622 #include "confdefs.h"
8623 #include <stdio.h>
8624 #include <${cf_cv_ncurses_header:-curses.h}>
8625 #include <$cf_test>
8626
8627 int
8628 main (void)
8629 {
8630 int x = auto_left_margin; (void)x
8631   ;
8632   return 0;
8633 }
8634 _ACEOF
8635 rm -f "conftest.$ac_objext"
8636 if { (eval echo "$as_me:8636: \"$ac_compile\"") >&5
8637   (eval $ac_compile) 2>&5
8638   ac_status=$?
8639   echo "$as_me:8639: \$? = $ac_status" >&5
8640   (exit "$ac_status"); } &&
8641          { ac_try='test -s "conftest.$ac_objext"'
8642   { (eval echo "$as_me:8642: \"$ac_try\"") >&5
8643   (eval $ac_try) 2>&5
8644   ac_status=$?
8645   echo "$as_me:8645: \$? = $ac_status" >&5
8646   (exit "$ac_status"); }; }; then
8647
8648         cf_cv_term_header="$cf_test"
8649 else
8650   echo "$as_me: failed program was:" >&5
8651 cat "conftest.$ac_ext" >&5
8652
8653         cf_cv_term_header=unknown
8654
8655 fi
8656 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8657         test "$cf_cv_term_header" != unknown && break
8658 done
8659
8660 fi
8661 echo "$as_me:8661: result: $cf_cv_term_header" >&5
8662 echo "${ECHO_T}$cf_cv_term_header" >&6
8663
8664 # Set definitions to allow ifdef'ing to accommodate subdirectories
8665
8666 case "$cf_cv_term_header" in
8667 (*term.h)
8668
8669 cat >>confdefs.h <<\EOF
8670 #define HAVE_TERM_H 1
8671 EOF
8672
8673         ;;
8674 esac
8675
8676 case "$cf_cv_term_header" in
8677 (ncurses/term.h)
8678
8679 cat >>confdefs.h <<\EOF
8680 #define HAVE_NCURSES_TERM_H 1
8681 EOF
8682
8683         ;;
8684 (ncursesw/term.h)
8685
8686 cat >>confdefs.h <<\EOF
8687 #define HAVE_NCURSESW_TERM_H 1
8688 EOF
8689
8690         ;;
8691 esac
8692
8693 # some applications need this, but should check for NCURSES_VERSION
8694
8695 cat >>confdefs.h <<\EOF
8696 #define NCURSES 1
8697 EOF
8698
8699 echo "$as_me:8699: checking for ncurses version" >&5
8700 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8701 if test "${cf_cv_ncurses_version+set}" = set; then
8702   echo $ECHO_N "(cached) $ECHO_C" >&6
8703 else
8704
8705         cf_cv_ncurses_version=no
8706         cf_tempfile=out$$
8707         rm -f "$cf_tempfile"
8708         if test "$cross_compiling" = yes; then
8709
8710         # This will not work if the preprocessor splits the line after the
8711         # Autoconf token.  The 'unproto' program does that.
8712         cat > "conftest.$ac_ext" <<EOF
8713 #include <${cf_cv_ncurses_header:-curses.h}>
8714 #undef Autoconf
8715 #ifdef NCURSES_VERSION
8716 Autoconf NCURSES_VERSION
8717 #else
8718 #ifdef __NCURSES_H
8719 Autoconf "old"
8720 #endif
8721 ;
8722 #endif
8723 EOF
8724         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8725         { (eval echo "$as_me:8725: \"$cf_try\"") >&5
8726   (eval $cf_try) 2>&5
8727   ac_status=$?
8728   echo "$as_me:8728: \$? = $ac_status" >&5
8729   (exit "$ac_status"); }
8730         if test -f conftest.out ; then
8731                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8732                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8733                 rm -f conftest.out
8734         fi
8735
8736 else
8737   cat >"conftest.$ac_ext" <<_ACEOF
8738 #line 8738 "configure"
8739 #include "confdefs.h"
8740
8741 #include <${cf_cv_ncurses_header:-curses.h}>
8742 #include <stdio.h>
8743 int main(void)
8744 {
8745         FILE *fp = fopen("$cf_tempfile", "w");
8746 #ifdef NCURSES_VERSION
8747 # ifdef NCURSES_VERSION_PATCH
8748         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8749 # else
8750         fprintf(fp, "%s\\n", NCURSES_VERSION);
8751 # endif
8752 #else
8753 # ifdef __NCURSES_H
8754         fprintf(fp, "old\\n");
8755 # else
8756         make an error
8757 # endif
8758 #endif
8759         ${cf_cv_main_return:-return}(0);
8760 }
8761 _ACEOF
8762 rm -f "conftest$ac_exeext"
8763 if { (eval echo "$as_me:8763: \"$ac_link\"") >&5
8764   (eval $ac_link) 2>&5
8765   ac_status=$?
8766   echo "$as_me:8766: \$? = $ac_status" >&5
8767   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8768   { (eval echo "$as_me:8768: \"$ac_try\"") >&5
8769   (eval $ac_try) 2>&5
8770   ac_status=$?
8771   echo "$as_me:8771: \$? = $ac_status" >&5
8772   (exit "$ac_status"); }; }; then
8773
8774         cf_cv_ncurses_version=`cat $cf_tempfile`
8775 else
8776   echo "$as_me: program exited with status $ac_status" >&5
8777 echo "$as_me: failed program was:" >&5
8778 cat "conftest.$ac_ext" >&5
8779 fi
8780 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8781 fi
8782         rm -f "$cf_tempfile"
8783
8784 fi
8785 echo "$as_me:8785: result: $cf_cv_ncurses_version" >&5
8786 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8787 test "$cf_cv_ncurses_version" = no ||
8788 cat >>confdefs.h <<\EOF
8789 #define NCURSES 1
8790 EOF
8791
8792 cf_nculib_root=ncursesw
8793         # This works, except for the special case where we find gpm, but
8794         # ncurses is in a nonstandard location via $LIBS, and we really want
8795         # to link gpm.
8796 cf_ncurses_LIBS=""
8797 cf_ncurses_SAVE="$LIBS"
8798 echo "$as_me:8798: checking for Gpm_Open in -lgpm" >&5
8799 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8800 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8801   echo $ECHO_N "(cached) $ECHO_C" >&6
8802 else
8803   ac_check_lib_save_LIBS=$LIBS
8804 LIBS="-lgpm  $LIBS"
8805 cat >"conftest.$ac_ext" <<_ACEOF
8806 #line 8806 "configure"
8807 #include "confdefs.h"
8808
8809 /* Override any gcc2 internal prototype to avoid an error.  */
8810 #ifdef __cplusplus
8811 extern "C"
8812 #endif
8813 /* We use char because int might match the return type of a gcc2
8814    builtin and then its argument prototype would still apply.  */
8815 char Gpm_Open ();
8816 int
8817 main (void)
8818 {
8819 Gpm_Open ();
8820   ;
8821   return 0;
8822 }
8823 _ACEOF
8824 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8825 if { (eval echo "$as_me:8825: \"$ac_link\"") >&5
8826   (eval $ac_link) 2>&5
8827   ac_status=$?
8828   echo "$as_me:8828: \$? = $ac_status" >&5
8829   (exit "$ac_status"); } &&
8830          { ac_try='test -s "conftest$ac_exeext"'
8831   { (eval echo "$as_me:8831: \"$ac_try\"") >&5
8832   (eval $ac_try) 2>&5
8833   ac_status=$?
8834   echo "$as_me:8834: \$? = $ac_status" >&5
8835   (exit "$ac_status"); }; }; then
8836   ac_cv_lib_gpm_Gpm_Open=yes
8837 else
8838   echo "$as_me: failed program was:" >&5
8839 cat "conftest.$ac_ext" >&5
8840 ac_cv_lib_gpm_Gpm_Open=no
8841 fi
8842 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8843 LIBS=$ac_check_lib_save_LIBS
8844 fi
8845 echo "$as_me:8845: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8846 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8847 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8848   echo "$as_me:8848: checking for initscr in -lgpm" >&5
8849 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8850 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8851   echo $ECHO_N "(cached) $ECHO_C" >&6
8852 else
8853   ac_check_lib_save_LIBS=$LIBS
8854 LIBS="-lgpm  $LIBS"
8855 cat >"conftest.$ac_ext" <<_ACEOF
8856 #line 8856 "configure"
8857 #include "confdefs.h"
8858
8859 /* Override any gcc2 internal prototype to avoid an error.  */
8860 #ifdef __cplusplus
8861 extern "C"
8862 #endif
8863 /* We use char because int might match the return type of a gcc2
8864    builtin and then its argument prototype would still apply.  */
8865 char initscr ();
8866 int
8867 main (void)
8868 {
8869 initscr ();
8870   ;
8871   return 0;
8872 }
8873 _ACEOF
8874 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8875 if { (eval echo "$as_me:8875: \"$ac_link\"") >&5
8876   (eval $ac_link) 2>&5
8877   ac_status=$?
8878   echo "$as_me:8878: \$? = $ac_status" >&5
8879   (exit "$ac_status"); } &&
8880          { ac_try='test -s "conftest$ac_exeext"'
8881   { (eval echo "$as_me:8881: \"$ac_try\"") >&5
8882   (eval $ac_try) 2>&5
8883   ac_status=$?
8884   echo "$as_me:8884: \$? = $ac_status" >&5
8885   (exit "$ac_status"); }; }; then
8886   ac_cv_lib_gpm_initscr=yes
8887 else
8888   echo "$as_me: failed program was:" >&5
8889 cat "conftest.$ac_ext" >&5
8890 ac_cv_lib_gpm_initscr=no
8891 fi
8892 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8893 LIBS=$ac_check_lib_save_LIBS
8894 fi
8895 echo "$as_me:8895: result: $ac_cv_lib_gpm_initscr" >&5
8896 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8897 if test "$ac_cv_lib_gpm_initscr" = yes; then
8898   LIBS="$cf_ncurses_SAVE"
8899 else
8900   cf_ncurses_LIBS="-lgpm"
8901 fi
8902
8903 fi
8904
8905 case "$host_os" in
8906 (freebsd*)
8907         # This is only necessary if you are linking against an obsolete
8908         # version of ncurses (but it should do no harm, since it is static).
8909         if test "$cf_nculib_root" = ncurses ; then
8910                 echo "$as_me:8910: checking for tgoto in -lmytinfo" >&5
8911 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8912 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8913   echo $ECHO_N "(cached) $ECHO_C" >&6
8914 else
8915   ac_check_lib_save_LIBS=$LIBS
8916 LIBS="-lmytinfo  $LIBS"
8917 cat >"conftest.$ac_ext" <<_ACEOF
8918 #line 8918 "configure"
8919 #include "confdefs.h"
8920
8921 /* Override any gcc2 internal prototype to avoid an error.  */
8922 #ifdef __cplusplus
8923 extern "C"
8924 #endif
8925 /* We use char because int might match the return type of a gcc2
8926    builtin and then its argument prototype would still apply.  */
8927 char tgoto ();
8928 int
8929 main (void)
8930 {
8931 tgoto ();
8932   ;
8933   return 0;
8934 }
8935 _ACEOF
8936 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8937 if { (eval echo "$as_me:8937: \"$ac_link\"") >&5
8938   (eval $ac_link) 2>&5
8939   ac_status=$?
8940   echo "$as_me:8940: \$? = $ac_status" >&5
8941   (exit "$ac_status"); } &&
8942          { ac_try='test -s "conftest$ac_exeext"'
8943   { (eval echo "$as_me:8943: \"$ac_try\"") >&5
8944   (eval $ac_try) 2>&5
8945   ac_status=$?
8946   echo "$as_me:8946: \$? = $ac_status" >&5
8947   (exit "$ac_status"); }; }; then
8948   ac_cv_lib_mytinfo_tgoto=yes
8949 else
8950   echo "$as_me: failed program was:" >&5
8951 cat "conftest.$ac_ext" >&5
8952 ac_cv_lib_mytinfo_tgoto=no
8953 fi
8954 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8955 LIBS=$ac_check_lib_save_LIBS
8956 fi
8957 echo "$as_me:8957: result: $ac_cv_lib_mytinfo_tgoto" >&5
8958 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8959 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8960   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8961 fi
8962
8963         fi
8964         ;;
8965 esac
8966
8967 cf_add_libs="$LIBS"
8968 # reverse order
8969 cf_add_0lib=
8970 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8971 # filter duplicates
8972 for cf_add_1lib in $cf_add_0lib; do
8973         for cf_add_2lib in $cf_add_libs; do
8974                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8975                         cf_add_1lib=
8976                         break
8977                 fi
8978         done
8979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8980 done
8981 LIBS="$cf_add_libs"
8982
8983 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8984 then
8985
8986 cf_add_libs="$LIBS"
8987 # reverse order
8988 cf_add_0lib=
8989 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8990 # filter duplicates
8991 for cf_add_1lib in $cf_add_0lib; do
8992         for cf_add_2lib in $cf_add_libs; do
8993                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8994                         cf_add_1lib=
8995                         break
8996                 fi
8997         done
8998         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8999 done
9000 LIBS="$cf_add_libs"
9001
9002 else
9003
9004         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9005         cf_libdir=""
9006         echo "$as_me:9006: checking for initscr" >&5
9007 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9008 if test "${ac_cv_func_initscr+set}" = set; then
9009   echo $ECHO_N "(cached) $ECHO_C" >&6
9010 else
9011   cat >"conftest.$ac_ext" <<_ACEOF
9012 #line 9012 "configure"
9013 #include "confdefs.h"
9014 #define initscr autoconf_temporary
9015 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9016 #undef initscr
9017
9018 #ifdef __cplusplus
9019 extern "C"
9020 #endif
9021
9022 /* We use char because int might match the return type of a gcc2
9023    builtin and then its argument prototype would still apply.  */
9024 char initscr (void);
9025
9026 int
9027 main (void)
9028 {
9029
9030 /* The GNU C library defines stubs for functions which it implements
9031     to always fail with ENOSYS.  Some functions are actually named
9032     something starting with __ and the normal name is an alias.  */
9033 #if defined (__stub_initscr) || defined (__stub___initscr)
9034 #error found stub for initscr
9035 #endif
9036
9037         return initscr ();
9038   ;
9039   return 0;
9040 }
9041 _ACEOF
9042 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9043 if { (eval echo "$as_me:9043: \"$ac_link\"") >&5
9044   (eval $ac_link) 2>&5
9045   ac_status=$?
9046   echo "$as_me:9046: \$? = $ac_status" >&5
9047   (exit "$ac_status"); } &&
9048          { ac_try='test -s "conftest$ac_exeext"'
9049   { (eval echo "$as_me:9049: \"$ac_try\"") >&5
9050   (eval $ac_try) 2>&5
9051   ac_status=$?
9052   echo "$as_me:9052: \$? = $ac_status" >&5
9053   (exit "$ac_status"); }; }; then
9054   ac_cv_func_initscr=yes
9055 else
9056   echo "$as_me: failed program was:" >&5
9057 cat "conftest.$ac_ext" >&5
9058 ac_cv_func_initscr=no
9059 fi
9060 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9061 fi
9062 echo "$as_me:9062: result: $ac_cv_func_initscr" >&5
9063 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9064 if test "$ac_cv_func_initscr" = yes; then
9065   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9066 else
9067
9068                 cf_save_LIBS="$LIBS"
9069                 echo "$as_me:9069: checking for initscr in -l$cf_nculib_root" >&5
9070 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9071                 LIBS="-l$cf_nculib_root $LIBS"
9072                 cat >"conftest.$ac_ext" <<_ACEOF
9073 #line 9073 "configure"
9074 #include "confdefs.h"
9075 #include <${cf_cv_ncurses_header:-curses.h}>
9076 int
9077 main (void)
9078 {
9079 initscr()
9080   ;
9081   return 0;
9082 }
9083 _ACEOF
9084 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9085 if { (eval echo "$as_me:9085: \"$ac_link\"") >&5
9086   (eval $ac_link) 2>&5
9087   ac_status=$?
9088   echo "$as_me:9088: \$? = $ac_status" >&5
9089   (exit "$ac_status"); } &&
9090          { ac_try='test -s "conftest$ac_exeext"'
9091   { (eval echo "$as_me:9091: \"$ac_try\"") >&5
9092   (eval $ac_try) 2>&5
9093   ac_status=$?
9094   echo "$as_me:9094: \$? = $ac_status" >&5
9095   (exit "$ac_status"); }; }; then
9096   echo "$as_me:9096: result: yes" >&5
9097 echo "${ECHO_T}yes" >&6
9098                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9099
9100 else
9101   echo "$as_me: failed program was:" >&5
9102 cat "conftest.$ac_ext" >&5
9103 echo "$as_me:9103: result: no" >&5
9104 echo "${ECHO_T}no" >&6
9105
9106 cf_search=
9107 cf_library_path_list=""
9108 if test -n "${LDFLAGS}${LIBS}" ; then
9109         for cf_library_path in $LDFLAGS $LIBS
9110         do
9111                 case "$cf_library_path" in
9112                 (-L*)
9113                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9114
9115 test "x$cf_library_path" != "xNONE" && \
9116 test -d "$cf_library_path" && \
9117  {
9118         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9119         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9120         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9121         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9122         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9123         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"
9124 }
9125
9126                         cf_library_path_list="$cf_library_path_list $cf_search"
9127                         ;;
9128                 esac
9129         done
9130 fi
9131
9132 cf_search=
9133
9134 test "x$prefix" != "xNONE" && \
9135 test -d "$prefix" && \
9136  {
9137         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9138         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9139         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9140         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9141         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9142         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9143 }
9144
9145 for cf_subdir_prefix in \
9146         /usr \
9147         /usr/local \
9148         /usr/pkg \
9149         /opt \
9150         /opt/local \
9151         $HOME
9152 do
9153
9154 test "x$cf_subdir_prefix" != "x$prefix" && \
9155 test -d "$cf_subdir_prefix" && \
9156 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9157         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9158         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9159         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9160         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9161         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9162         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"
9163 }
9164
9165 done
9166
9167 cf_search="$cf_library_path_list $cf_search"
9168
9169                         for cf_libdir in $cf_search
9170                         do
9171                                 echo "$as_me:9171: checking for -l$cf_nculib_root in $cf_libdir" >&5
9172 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9173                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9174                                 cat >"conftest.$ac_ext" <<_ACEOF
9175 #line 9175 "configure"
9176 #include "confdefs.h"
9177 #include <${cf_cv_ncurses_header:-curses.h}>
9178 int
9179 main (void)
9180 {
9181 initscr()
9182   ;
9183   return 0;
9184 }
9185 _ACEOF
9186 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9187 if { (eval echo "$as_me:9187: \"$ac_link\"") >&5
9188   (eval $ac_link) 2>&5
9189   ac_status=$?
9190   echo "$as_me:9190: \$? = $ac_status" >&5
9191   (exit "$ac_status"); } &&
9192          { ac_try='test -s "conftest$ac_exeext"'
9193   { (eval echo "$as_me:9193: \"$ac_try\"") >&5
9194   (eval $ac_try) 2>&5
9195   ac_status=$?
9196   echo "$as_me:9196: \$? = $ac_status" >&5
9197   (exit "$ac_status"); }; }; then
9198   echo "$as_me:9198: result: yes" >&5
9199 echo "${ECHO_T}yes" >&6
9200                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9201                                          break
9202 else
9203   echo "$as_me: failed program was:" >&5
9204 cat "conftest.$ac_ext" >&5
9205 echo "$as_me:9205: result: no" >&5
9206 echo "${ECHO_T}no" >&6
9207                                          LIBS="$cf_save_LIBS"
9208 fi
9209 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9210                         done
9211
9212 fi
9213 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9214
9215 fi
9216
9217 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9218
9219 if test "$cf_found_library" = no ; then
9220         { { echo "$as_me:9220: error: Cannot link $cf_nculib_root library" >&5
9221 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9222    { (exit 1); exit 1; }; }
9223 fi
9224
9225 fi
9226
9227 if test -n "$cf_ncurses_LIBS" ; then
9228         echo "$as_me:9228: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9229 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9230         cf_ncurses_SAVE="$LIBS"
9231         for p in $cf_ncurses_LIBS ; do
9232                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9233                 if test "$q" != "$LIBS" ; then
9234                         LIBS="$q"
9235                 fi
9236         done
9237         cat >"conftest.$ac_ext" <<_ACEOF
9238 #line 9238 "configure"
9239 #include "confdefs.h"
9240 #include <${cf_cv_ncurses_header:-curses.h}>
9241 int
9242 main (void)
9243 {
9244 initscr(); mousemask(0,0); tigetstr((char *)0);
9245   ;
9246   return 0;
9247 }
9248 _ACEOF
9249 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9250 if { (eval echo "$as_me:9250: \"$ac_link\"") >&5
9251   (eval $ac_link) 2>&5
9252   ac_status=$?
9253   echo "$as_me:9253: \$? = $ac_status" >&5
9254   (exit "$ac_status"); } &&
9255          { ac_try='test -s "conftest$ac_exeext"'
9256   { (eval echo "$as_me:9256: \"$ac_try\"") >&5
9257   (eval $ac_try) 2>&5
9258   ac_status=$?
9259   echo "$as_me:9259: \$? = $ac_status" >&5
9260   (exit "$ac_status"); }; }; then
9261   echo "$as_me:9261: result: yes" >&5
9262 echo "${ECHO_T}yes" >&6
9263 else
9264   echo "$as_me: failed program was:" >&5
9265 cat "conftest.$ac_ext" >&5
9266 echo "$as_me:9266: result: no" >&5
9267 echo "${ECHO_T}no" >&6
9268                  LIBS="$cf_ncurses_SAVE"
9269 fi
9270 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9271 fi
9272
9273 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9274
9275 cat >>confdefs.h <<EOF
9276 #define $cf_nculib_ROOT 1
9277 EOF
9278
9279         fi
9280 else
9281         NCURSES_CONFIG=none
9282 fi
9283
9284 else
9285
9286 cf_ncuconfig_root=ncurses
9287 cf_have_ncuconfig=no
9288
9289 if test "x${PKG_CONFIG:=none}" != xnone; then
9290         echo "$as_me:9290: checking pkg-config for $cf_ncuconfig_root" >&5
9291 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9292         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9293                 echo "$as_me:9293: result: yes" >&5
9294 echo "${ECHO_T}yes" >&6
9295
9296                 echo "$as_me:9296: checking if the $cf_ncuconfig_root package files work" >&5
9297 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9298                 cf_have_ncuconfig=unknown
9299
9300                 cf_save_CFLAGS="$CFLAGS"
9301                 cf_save_CPPFLAGS="$CPPFLAGS"
9302                 cf_save_LIBS="$LIBS"
9303
9304                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9305                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9306
9307                 # while -W for passing linker flags is prevalent, it is not "standard".
9308                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9309                 # incompatible _and_ non-standard -W option which gives an error.  Work
9310                 # around that pitfall.
9311                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9312                 (x*c[89]9@@*-W*)
9313
9314 cf_fix_cppflags=no
9315 cf_new_cflags=
9316 cf_new_cppflags=
9317 cf_new_extra_cppflags=
9318
9319 for cf_add_cflags in $cf_pkg_cflags
9320 do
9321 case "$cf_fix_cppflags" in
9322 (no)
9323         case "$cf_add_cflags" in
9324         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9325                 case "$cf_add_cflags" in
9326                 (-D*)
9327                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9328
9329                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9330                                 && test -z "${cf_tst_cflags}" \
9331                                 && cf_fix_cppflags=yes
9332
9333                         if test "$cf_fix_cppflags" = yes ; then
9334
9335         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9336         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9337
9338                                 continue
9339                         elif test "${cf_tst_cflags}" = "\"'" ; then
9340
9341         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9342         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9343
9344                                 continue
9345                         fi
9346                         ;;
9347                 esac
9348                 case "$CPPFLAGS" in
9349                 (*$cf_add_cflags)
9350                         ;;
9351                 (*)
9352                         case "$cf_add_cflags" in
9353                         (-D*)
9354                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9355
9356 CPPFLAGS=`echo "$CPPFLAGS" | \
9357         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9358                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9359
9360                                 ;;
9361                         esac
9362
9363         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9364         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9365
9366                         ;;
9367                 esac
9368                 ;;
9369         (*)
9370
9371         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9372         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9373
9374                 ;;
9375         esac
9376         ;;
9377 (yes)
9378
9379         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9380         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9381
9382         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9383
9384         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9385                 && test -z "${cf_tst_cflags}" \
9386                 && cf_fix_cppflags=no
9387         ;;
9388 esac
9389 done
9390
9391 if test -n "$cf_new_cflags" ; then
9392
9393         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9394         CFLAGS="${CFLAGS}$cf_new_cflags"
9395
9396 fi
9397
9398 if test -n "$cf_new_cppflags" ; then
9399
9400         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9401         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9402
9403 fi
9404
9405 if test -n "$cf_new_extra_cppflags" ; then
9406
9407         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9408         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9409
9410 fi
9411
9412 cf_add_libs="$LIBS"
9413 # reverse order
9414 cf_add_0lib=
9415 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9416 # filter duplicates
9417 for cf_add_1lib in $cf_add_0lib; do
9418         for cf_add_2lib in $cf_add_libs; do
9419                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9420                         cf_add_1lib=
9421                         break
9422                 fi
9423         done
9424         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9425 done
9426 LIBS="$cf_add_libs"
9427
9428                         cat >"conftest.$ac_ext" <<_ACEOF
9429 #line 9429 "configure"
9430 #include "confdefs.h"
9431 #include <${cf_cv_ncurses_header:-curses.h}>
9432 int
9433 main (void)
9434 {
9435 initscr(); mousemask(0,0); tigetstr((char *)0);
9436   ;
9437   return 0;
9438 }
9439 _ACEOF
9440 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9441 if { (eval echo "$as_me:9441: \"$ac_link\"") >&5
9442   (eval $ac_link) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit "$ac_status"); } &&
9446          { ac_try='test -s "conftest$ac_exeext"'
9447   { (eval echo "$as_me:9447: \"$ac_try\"") >&5
9448   (eval $ac_try) 2>&5
9449   ac_status=$?
9450   echo "$as_me:9450: \$? = $ac_status" >&5
9451   (exit "$ac_status"); }; }; then
9452   if test "$cross_compiling" = yes; then
9453   cf_test_ncuconfig=maybe
9454 else
9455   cat >"conftest.$ac_ext" <<_ACEOF
9456 #line 9456 "configure"
9457 #include "confdefs.h"
9458 #include <${cf_cv_ncurses_header:-curses.h}>
9459                                         int main(void)
9460                                         { const char *xx = curses_version(); return (xx == 0); }
9461 _ACEOF
9462 rm -f "conftest$ac_exeext"
9463 if { (eval echo "$as_me:9463: \"$ac_link\"") >&5
9464   (eval $ac_link) 2>&5
9465   ac_status=$?
9466   echo "$as_me:9466: \$? = $ac_status" >&5
9467   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9468   { (eval echo "$as_me:9468: \"$ac_try\"") >&5
9469   (eval $ac_try) 2>&5
9470   ac_status=$?
9471   echo "$as_me:9471: \$? = $ac_status" >&5
9472   (exit "$ac_status"); }; }; then
9473   cf_test_ncuconfig=yes
9474 else
9475   echo "$as_me: program exited with status $ac_status" >&5
9476 echo "$as_me: failed program was:" >&5
9477 cat "conftest.$ac_ext" >&5
9478 cf_test_ncuconfig=no
9479 fi
9480 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9481 fi
9482 else
9483   echo "$as_me: failed program was:" >&5
9484 cat "conftest.$ac_ext" >&5
9485 cf_test_ncuconfig=no
9486 fi
9487 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9488
9489                         CFLAGS="$cf_save_CFLAGS"
9490                         CPPFLAGS="$cf_save_CPPFLAGS"
9491                         LIBS="$cf_save_LIBS"
9492
9493                         if test "x$cf_test_ncuconfig" != xyes; then
9494                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9495                                 cf_pkg_cflags="$cf_temp"
9496                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9497                                 cf_pkg_libs="$cf_temp"
9498                         fi
9499                         ;;
9500                 esac
9501
9502 for cf_add_cflags in $cf_pkg_cflags
9503 do
9504         case "x$cf_add_cflags" in
9505         (x-[DU]*)
9506
9507 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9508 while true
9509 do
9510         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'`
9511         test "$CFLAGS" != "$cf_old_cflag" || break
9512
9513         CFLAGS="$cf_old_cflag"
9514 done
9515
9516 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9517 while true
9518 do
9519         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'`
9520         test "$CPPFLAGS" != "$cf_old_cflag" || break
9521
9522         CPPFLAGS="$cf_old_cflag"
9523 done
9524
9525                 ;;
9526         esac
9527
9528 cf_fix_cppflags=no
9529 cf_new_cflags=
9530 cf_new_cppflags=
9531 cf_new_extra_cppflags=
9532
9533 for cf_add_cflags in $cf_add_cflags
9534 do
9535 case "$cf_fix_cppflags" in
9536 (no)
9537         case "$cf_add_cflags" in
9538         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9539                 case "$cf_add_cflags" in
9540                 (-D*)
9541                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9542
9543                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9544                                 && test -z "${cf_tst_cflags}" \
9545                                 && cf_fix_cppflags=yes
9546
9547                         if test "$cf_fix_cppflags" = yes ; then
9548
9549         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9550         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9551
9552                                 continue
9553                         elif test "${cf_tst_cflags}" = "\"'" ; then
9554
9555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9557
9558                                 continue
9559                         fi
9560                         ;;
9561                 esac
9562                 case "$CPPFLAGS" in
9563                 (*$cf_add_cflags)
9564                         ;;
9565                 (*)
9566                         case "$cf_add_cflags" in
9567                         (-D*)
9568                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9569
9570 CPPFLAGS=`echo "$CPPFLAGS" | \
9571         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9572                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9573
9574                                 ;;
9575                         esac
9576
9577         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9578         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9579
9580                         ;;
9581                 esac
9582                 ;;
9583         (*)
9584
9585         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9586         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9587
9588                 ;;
9589         esac
9590         ;;
9591 (yes)
9592
9593         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9594         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9595
9596         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9597
9598         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9599                 && test -z "${cf_tst_cflags}" \
9600                 && cf_fix_cppflags=no
9601         ;;
9602 esac
9603 done
9604
9605 if test -n "$cf_new_cflags" ; then
9606
9607         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9608         CFLAGS="${CFLAGS}$cf_new_cflags"
9609
9610 fi
9611
9612 if test -n "$cf_new_cppflags" ; then
9613
9614         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9615         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9616
9617 fi
9618
9619 if test -n "$cf_new_extra_cppflags" ; then
9620
9621         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9622         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9623
9624 fi
9625
9626 done
9627
9628 cf_add_libs="$LIBS"
9629 # reverse order
9630 cf_add_0lib=
9631 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9632 # filter duplicates
9633 for cf_add_1lib in $cf_add_0lib; do
9634         for cf_add_2lib in $cf_add_libs; do
9635                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9636                         cf_add_1lib=
9637                         break
9638                 fi
9639         done
9640         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9641 done
9642 LIBS="$cf_add_libs"
9643
9644                 cat >"conftest.$ac_ext" <<_ACEOF
9645 #line 9645 "configure"
9646 #include "confdefs.h"
9647 #include <${cf_cv_ncurses_header:-curses.h}>
9648 int
9649 main (void)
9650 {
9651 initscr(); mousemask(0,0); tigetstr((char *)0);
9652   ;
9653   return 0;
9654 }
9655 _ACEOF
9656 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9657 if { (eval echo "$as_me:9657: \"$ac_link\"") >&5
9658   (eval $ac_link) 2>&5
9659   ac_status=$?
9660   echo "$as_me:9660: \$? = $ac_status" >&5
9661   (exit "$ac_status"); } &&
9662          { ac_try='test -s "conftest$ac_exeext"'
9663   { (eval echo "$as_me:9663: \"$ac_try\"") >&5
9664   (eval $ac_try) 2>&5
9665   ac_status=$?
9666   echo "$as_me:9666: \$? = $ac_status" >&5
9667   (exit "$ac_status"); }; }; then
9668   if test "$cross_compiling" = yes; then
9669   cf_have_ncuconfig=maybe
9670 else
9671   cat >"conftest.$ac_ext" <<_ACEOF
9672 #line 9672 "configure"
9673 #include "confdefs.h"
9674 #include <${cf_cv_ncurses_header:-curses.h}>
9675                                 int main(void)
9676                                 { const char *xx = curses_version(); return (xx == 0); }
9677 _ACEOF
9678 rm -f "conftest$ac_exeext"
9679 if { (eval echo "$as_me:9679: \"$ac_link\"") >&5
9680   (eval $ac_link) 2>&5
9681   ac_status=$?
9682   echo "$as_me:9682: \$? = $ac_status" >&5
9683   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9684   { (eval echo "$as_me:9684: \"$ac_try\"") >&5
9685   (eval $ac_try) 2>&5
9686   ac_status=$?
9687   echo "$as_me:9687: \$? = $ac_status" >&5
9688   (exit "$ac_status"); }; }; then
9689   cf_have_ncuconfig=yes
9690 else
9691   echo "$as_me: program exited with status $ac_status" >&5
9692 echo "$as_me: failed program was:" >&5
9693 cat "conftest.$ac_ext" >&5
9694 cf_have_ncuconfig=no
9695 fi
9696 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9697 fi
9698 else
9699   echo "$as_me: failed program was:" >&5
9700 cat "conftest.$ac_ext" >&5
9701 cf_have_ncuconfig=no
9702 fi
9703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9704                 echo "$as_me:9704: result: $cf_have_ncuconfig" >&5
9705 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9706                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9707                 if test "$cf_have_ncuconfig" != "yes"
9708                 then
9709                         CPPFLAGS="$cf_save_CPPFLAGS"
9710                         LIBS="$cf_save_LIBS"
9711                         NCURSES_CONFIG_PKG=none
9712                 else
9713
9714 cat >>confdefs.h <<\EOF
9715 #define NCURSES 1
9716 EOF
9717
9718                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9719
9720 echo "$as_me:9720: checking for terminfo header" >&5
9721 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9722 if test "${cf_cv_term_header+set}" = set; then
9723   echo $ECHO_N "(cached) $ECHO_C" >&6
9724 else
9725
9726 case "${cf_cv_ncurses_header}" in
9727 (*/ncurses.h|*/ncursesw.h)
9728         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9729         ;;
9730 (*)
9731         cf_term_header=term.h
9732         ;;
9733 esac
9734
9735 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9736 do
9737 cat >"conftest.$ac_ext" <<_ACEOF
9738 #line 9738 "configure"
9739 #include "confdefs.h"
9740 #include <stdio.h>
9741 #include <${cf_cv_ncurses_header:-curses.h}>
9742 #include <$cf_test>
9743
9744 int
9745 main (void)
9746 {
9747 int x = auto_left_margin; (void)x
9748   ;
9749   return 0;
9750 }
9751 _ACEOF
9752 rm -f "conftest.$ac_objext"
9753 if { (eval echo "$as_me:9753: \"$ac_compile\"") >&5
9754   (eval $ac_compile) 2>&5
9755   ac_status=$?
9756   echo "$as_me:9756: \$? = $ac_status" >&5
9757   (exit "$ac_status"); } &&
9758          { ac_try='test -s "conftest.$ac_objext"'
9759   { (eval echo "$as_me:9759: \"$ac_try\"") >&5
9760   (eval $ac_try) 2>&5
9761   ac_status=$?
9762   echo "$as_me:9762: \$? = $ac_status" >&5
9763   (exit "$ac_status"); }; }; then
9764
9765         cf_cv_term_header="$cf_test"
9766 else
9767   echo "$as_me: failed program was:" >&5
9768 cat "conftest.$ac_ext" >&5
9769
9770         cf_cv_term_header=unknown
9771
9772 fi
9773 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9774         test "$cf_cv_term_header" != unknown && break
9775 done
9776
9777 fi
9778 echo "$as_me:9778: result: $cf_cv_term_header" >&5
9779 echo "${ECHO_T}$cf_cv_term_header" >&6
9780
9781 # Set definitions to allow ifdef'ing to accommodate subdirectories
9782
9783 case "$cf_cv_term_header" in
9784 (*term.h)
9785
9786 cat >>confdefs.h <<\EOF
9787 #define HAVE_TERM_H 1
9788 EOF
9789
9790         ;;
9791 esac
9792
9793 case "$cf_cv_term_header" in
9794 (ncurses/term.h)
9795
9796 cat >>confdefs.h <<\EOF
9797 #define HAVE_NCURSES_TERM_H 1
9798 EOF
9799
9800         ;;
9801 (ncursesw/term.h)
9802
9803 cat >>confdefs.h <<\EOF
9804 #define HAVE_NCURSESW_TERM_H 1
9805 EOF
9806
9807         ;;
9808 esac
9809
9810                 fi
9811
9812         else
9813                 echo "$as_me:9813: result: no" >&5
9814 echo "${ECHO_T}no" >&6
9815                 NCURSES_CONFIG_PKG=none
9816         fi
9817 else
9818         NCURSES_CONFIG_PKG=none
9819 fi
9820
9821 if test "x$cf_have_ncuconfig" = "xno"; then
9822         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9823
9824 if test -n "$ac_tool_prefix"; then
9825   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9826   do
9827     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9828 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9829 echo "$as_me:9829: checking for $ac_word" >&5
9830 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9831 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9832   echo $ECHO_N "(cached) $ECHO_C" >&6
9833 else
9834   if test -n "$NCURSES_CONFIG"; then
9835   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9836 else
9837   ac_save_IFS=$IFS; IFS=$ac_path_separator
9838 ac_dummy="$PATH"
9839 for ac_dir in $ac_dummy; do
9840   IFS=$ac_save_IFS
9841   test -z "$ac_dir" && ac_dir=.
9842   $as_executable_p "$ac_dir/$ac_word" || continue
9843 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9844 echo "$as_me:9844: found $ac_dir/$ac_word" >&5
9845 break
9846 done
9847
9848 fi
9849 fi
9850 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9851 if test -n "$NCURSES_CONFIG"; then
9852   echo "$as_me:9852: result: $NCURSES_CONFIG" >&5
9853 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9854 else
9855   echo "$as_me:9855: result: no" >&5
9856 echo "${ECHO_T}no" >&6
9857 fi
9858
9859     test -n "$NCURSES_CONFIG" && break
9860   done
9861 fi
9862 if test -z "$NCURSES_CONFIG"; then
9863   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9864   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9865 do
9866   # Extract the first word of "$ac_prog", so it can be a program name with args.
9867 set dummy $ac_prog; ac_word=$2
9868 echo "$as_me:9868: checking for $ac_word" >&5
9869 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9870 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9871   echo $ECHO_N "(cached) $ECHO_C" >&6
9872 else
9873   if test -n "$ac_ct_NCURSES_CONFIG"; then
9874   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9875 else
9876   ac_save_IFS=$IFS; IFS=$ac_path_separator
9877 ac_dummy="$PATH"
9878 for ac_dir in $ac_dummy; do
9879   IFS=$ac_save_IFS
9880   test -z "$ac_dir" && ac_dir=.
9881   $as_executable_p "$ac_dir/$ac_word" || continue
9882 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9883 echo "$as_me:9883: found $ac_dir/$ac_word" >&5
9884 break
9885 done
9886
9887 fi
9888 fi
9889 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9890 if test -n "$ac_ct_NCURSES_CONFIG"; then
9891   echo "$as_me:9891: result: $ac_ct_NCURSES_CONFIG" >&5
9892 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9893 else
9894   echo "$as_me:9894: result: no" >&5
9895 echo "${ECHO_T}no" >&6
9896 fi
9897
9898   test -n "$ac_ct_NCURSES_CONFIG" && break
9899 done
9900 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9901
9902   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9903 fi
9904
9905         if test "$NCURSES_CONFIG" != none ; then
9906
9907 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9908 do
9909         case "x$cf_add_cflags" in
9910         (x-[DU]*)
9911
9912 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9913 while true
9914 do
9915         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'`
9916         test "$CFLAGS" != "$cf_old_cflag" || break
9917
9918         CFLAGS="$cf_old_cflag"
9919 done
9920
9921 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9922 while true
9923 do
9924         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'`
9925         test "$CPPFLAGS" != "$cf_old_cflag" || break
9926
9927         CPPFLAGS="$cf_old_cflag"
9928 done
9929
9930                 ;;
9931         esac
9932
9933 cf_fix_cppflags=no
9934 cf_new_cflags=
9935 cf_new_cppflags=
9936 cf_new_extra_cppflags=
9937
9938 for cf_add_cflags in $cf_add_cflags
9939 do
9940 case "$cf_fix_cppflags" in
9941 (no)
9942         case "$cf_add_cflags" in
9943         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9944                 case "$cf_add_cflags" in
9945                 (-D*)
9946                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9947
9948                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9949                                 && test -z "${cf_tst_cflags}" \
9950                                 && cf_fix_cppflags=yes
9951
9952                         if test "$cf_fix_cppflags" = yes ; then
9953
9954         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9955         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9956
9957                                 continue
9958                         elif test "${cf_tst_cflags}" = "\"'" ; then
9959
9960         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9961         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9962
9963                                 continue
9964                         fi
9965                         ;;
9966                 esac
9967                 case "$CPPFLAGS" in
9968                 (*$cf_add_cflags)
9969                         ;;
9970                 (*)
9971                         case "$cf_add_cflags" in
9972                         (-D*)
9973                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9974
9975 CPPFLAGS=`echo "$CPPFLAGS" | \
9976         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9977                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9978
9979                                 ;;
9980                         esac
9981
9982         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9983         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9984
9985                         ;;
9986                 esac
9987                 ;;
9988         (*)
9989
9990         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9991         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9992
9993                 ;;
9994         esac
9995         ;;
9996 (yes)
9997
9998         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9999         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10000
10001         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10002
10003         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10004                 && test -z "${cf_tst_cflags}" \
10005                 && cf_fix_cppflags=no
10006         ;;
10007 esac
10008 done
10009
10010 if test -n "$cf_new_cflags" ; then
10011
10012         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10013         CFLAGS="${CFLAGS}$cf_new_cflags"
10014
10015 fi
10016
10017 if test -n "$cf_new_cppflags" ; then
10018
10019         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10020         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10021
10022 fi
10023
10024 if test -n "$cf_new_extra_cppflags" ; then
10025
10026         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10027         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10028
10029 fi
10030
10031 done
10032
10033 cf_add_libs="$LIBS"
10034 # reverse order
10035 cf_add_0lib=
10036 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10037 # filter duplicates
10038 for cf_add_1lib in $cf_add_0lib; do
10039         for cf_add_2lib in $cf_add_libs; do
10040                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10041                         cf_add_1lib=
10042                         break
10043                 fi
10044         done
10045         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10046 done
10047 LIBS="$cf_add_libs"
10048
10049                 # even with config script, some packages use no-override for curses.h
10050
10051 echo "$as_me:10051: checking if we have identified curses headers" >&5
10052 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10053 if test "${cf_cv_ncurses_header+set}" = set; then
10054   echo $ECHO_N "(cached) $ECHO_C" >&6
10055 else
10056
10057 cf_cv_ncurses_header=none
10058 for cf_header in \
10059         ncurses.h ncurses/ncurses.h \
10060         curses.h ncurses/curses.h
10061 do
10062 cat >"conftest.$ac_ext" <<_ACEOF
10063 #line 10063 "configure"
10064 #include "confdefs.h"
10065 #include <${cf_header}>
10066 int
10067 main (void)
10068 {
10069 initscr(); tgoto("?", 0,0)
10070   ;
10071   return 0;
10072 }
10073 _ACEOF
10074 rm -f "conftest.$ac_objext"
10075 if { (eval echo "$as_me:10075: \"$ac_compile\"") >&5
10076   (eval $ac_compile) 2>&5
10077   ac_status=$?
10078   echo "$as_me:10078: \$? = $ac_status" >&5
10079   (exit "$ac_status"); } &&
10080          { ac_try='test -s "conftest.$ac_objext"'
10081   { (eval echo "$as_me:10081: \"$ac_try\"") >&5
10082   (eval $ac_try) 2>&5
10083   ac_status=$?
10084   echo "$as_me:10084: \$? = $ac_status" >&5
10085   (exit "$ac_status"); }; }; then
10086   cf_cv_ncurses_header=$cf_header; break
10087 else
10088   echo "$as_me: failed program was:" >&5
10089 cat "conftest.$ac_ext" >&5
10090 fi
10091 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10092 done
10093
10094 fi
10095 echo "$as_me:10095: result: $cf_cv_ncurses_header" >&5
10096 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10097
10098 if test "$cf_cv_ncurses_header" = none ; then
10099         { { echo "$as_me:10099: error: No curses header-files found" >&5
10100 echo "$as_me: error: No curses header-files found" >&2;}
10101    { (exit 1); exit 1; }; }
10102 fi
10103
10104 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10105
10106 for ac_header in $cf_cv_ncurses_header
10107 do
10108 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10109 echo "$as_me:10109: checking for $ac_header" >&5
10110 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10111 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10112   echo $ECHO_N "(cached) $ECHO_C" >&6
10113 else
10114   cat >"conftest.$ac_ext" <<_ACEOF
10115 #line 10115 "configure"
10116 #include "confdefs.h"
10117 #include <$ac_header>
10118 _ACEOF
10119 if { (eval echo "$as_me:10119: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10120   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10121   ac_status=$?
10122   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10123   rm -f conftest.er1
10124   cat conftest.err >&5
10125   echo "$as_me:10125: \$? = $ac_status" >&5
10126   (exit "$ac_status"); } >/dev/null; then
10127   if test -s conftest.err; then
10128     ac_cpp_err=$ac_c_preproc_warn_flag
10129   else
10130     ac_cpp_err=
10131   fi
10132 else
10133   ac_cpp_err=yes
10134 fi
10135 if test -z "$ac_cpp_err"; then
10136   eval "$as_ac_Header=yes"
10137 else
10138   echo "$as_me: failed program was:" >&5
10139   cat "conftest.$ac_ext" >&5
10140   eval "$as_ac_Header=no"
10141 fi
10142 rm -f conftest.err "conftest.$ac_ext"
10143 fi
10144 echo "$as_me:10144: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10145 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10146 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10147   cat >>confdefs.h <<EOF
10148 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10149 EOF
10150
10151 fi
10152 done
10153
10154 cat >>confdefs.h <<\EOF
10155 #define NCURSES 1
10156 EOF
10157
10158 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10159
10160                 cat >>confdefs.h <<EOF
10161 #define $cf_nculib_ROOT 1
10162 EOF
10163
10164                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10165
10166         else
10167
10168 cf_ncuhdr_root=ncurses
10169
10170 test -n "$cf_cv_curses_dir" && \
10171 test "$cf_cv_curses_dir" != "no" && { \
10172
10173 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10174   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10175   do
10176         while test "$cf_add_incdir" != /usr/include
10177         do
10178           if test -d "$cf_add_incdir"
10179           then
10180                 cf_have_incdir=no
10181                 if test -n "$CFLAGS$CPPFLAGS" ; then
10182                   # a loop is needed to ensure we can add subdirs of existing dirs
10183                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10184                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10185                           cf_have_incdir=yes; break
10186                         fi
10187                   done
10188                 fi
10189
10190                 if test "$cf_have_incdir" = no ; then
10191                   if test "$cf_add_incdir" = /usr/local/include ; then
10192                         if test "$GCC" = yes
10193                         then
10194                           cf_save_CPPFLAGS=$CPPFLAGS
10195
10196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10197         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10198
10199                           cat >"conftest.$ac_ext" <<_ACEOF
10200 #line 10200 "configure"
10201 #include "confdefs.h"
10202 #include <stdio.h>
10203 int
10204 main (void)
10205 {
10206 printf("Hello")
10207   ;
10208   return 0;
10209 }
10210 _ACEOF
10211 rm -f "conftest.$ac_objext"
10212 if { (eval echo "$as_me:10212: \"$ac_compile\"") >&5
10213   (eval $ac_compile) 2>&5
10214   ac_status=$?
10215   echo "$as_me:10215: \$? = $ac_status" >&5
10216   (exit "$ac_status"); } &&
10217          { ac_try='test -s "conftest.$ac_objext"'
10218   { (eval echo "$as_me:10218: \"$ac_try\"") >&5
10219   (eval $ac_try) 2>&5
10220   ac_status=$?
10221   echo "$as_me:10221: \$? = $ac_status" >&5
10222   (exit "$ac_status"); }; }; then
10223   :
10224 else
10225   echo "$as_me: failed program was:" >&5
10226 cat "conftest.$ac_ext" >&5
10227 cf_have_incdir=yes
10228 fi
10229 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10230                           CPPFLAGS=$cf_save_CPPFLAGS
10231                         fi
10232                   fi
10233                 fi
10234
10235                 if test "$cf_have_incdir" = no ; then
10236                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10237
10238 echo "${as_me:-configure}:10238: testing adding $cf_add_incdir to include-path ..." 1>&5
10239
10240                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10241
10242                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10243                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10244                   cf_add_incdir="$cf_top_incdir"
10245                 else
10246                   break
10247                 fi
10248           else
10249                 break
10250           fi
10251         done
10252   done
10253 fi
10254
10255 }
10256
10257 echo "$as_me:10257: checking for $cf_ncuhdr_root header in include-path" >&5
10258 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10259 if test "${cf_cv_ncurses_h+set}" = set; then
10260   echo $ECHO_N "(cached) $ECHO_C" >&6
10261 else
10262
10263         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10264         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10265         for cf_header in $cf_header_list
10266         do
10267
10268         cat >"conftest.$ac_ext" <<_ACEOF
10269 #line 10269 "configure"
10270 #include "confdefs.h"
10271
10272 #include <$cf_header>
10273 int
10274 main (void)
10275 {
10276
10277 #ifdef NCURSES_VERSION
10278
10279 printf("%s\\n", NCURSES_VERSION);
10280 #else
10281 #ifdef __NCURSES_H
10282 printf("old\\n");
10283 #else
10284         make an error
10285 #endif
10286 #endif
10287
10288   ;
10289   return 0;
10290 }
10291 _ACEOF
10292 rm -f "conftest.$ac_objext"
10293 if { (eval echo "$as_me:10293: \"$ac_compile\"") >&5
10294   (eval $ac_compile) 2>&5
10295   ac_status=$?
10296   echo "$as_me:10296: \$? = $ac_status" >&5
10297   (exit "$ac_status"); } &&
10298          { ac_try='test -s "conftest.$ac_objext"'
10299   { (eval echo "$as_me:10299: \"$ac_try\"") >&5
10300   (eval $ac_try) 2>&5
10301   ac_status=$?
10302   echo "$as_me:10302: \$? = $ac_status" >&5
10303   (exit "$ac_status"); }; }; then
10304   cf_cv_ncurses_h=$cf_header
10305
10306 else
10307   echo "$as_me: failed program was:" >&5
10308 cat "conftest.$ac_ext" >&5
10309 cf_cv_ncurses_h=no
10310 fi
10311 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10312
10313                 test "$cf_cv_ncurses_h" != no && break
10314         done
10315
10316 fi
10317 echo "$as_me:10317: result: $cf_cv_ncurses_h" >&5
10318 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10319
10320 if test "$cf_cv_ncurses_h" != no ; then
10321         cf_cv_ncurses_header=$cf_cv_ncurses_h
10322 else
10323
10324 echo "$as_me:10324: checking for $cf_ncuhdr_root include-path" >&5
10325 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10326 if test "${cf_cv_ncurses_h2+set}" = set; then
10327   echo $ECHO_N "(cached) $ECHO_C" >&6
10328 else
10329
10330         test -n "$verbose" && echo
10331
10332 cf_search=
10333
10334 # collect the current set of include-directories from compiler flags
10335 cf_header_path_list=""
10336 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10337         for cf_header_path in $CPPFLAGS $CFLAGS
10338         do
10339                 case "$cf_header_path" in
10340                 (-I*)
10341                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10342
10343 test "x$cf_header_path" != "xNONE" && \
10344 test -d "$cf_header_path" && \
10345  {
10346         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10347         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10348         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10349         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10350         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10351         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"
10352 }
10353
10354                         cf_header_path_list="$cf_header_path_list $cf_search"
10355                         ;;
10356                 esac
10357         done
10358 fi
10359
10360 # add the variations for the package we are looking for
10361
10362 cf_search=
10363
10364 test "x$prefix" != "xNONE" && \
10365 test -d "$prefix" && \
10366  {
10367         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10368         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10369         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10370         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10371         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10372         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10373 }
10374
10375 for cf_subdir_prefix in \
10376         /usr \
10377         /usr/local \
10378         /usr/pkg \
10379         /opt \
10380         /opt/local \
10381         $HOME
10382 do
10383
10384 test "x$cf_subdir_prefix" != "x$prefix" && \
10385 test -d "$cf_subdir_prefix" && \
10386 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10387         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10388         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10389         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10390         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10391         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10392         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"
10393 }
10394
10395 done
10396
10397 test "$includedir" != NONE && \
10398 test "$includedir" != "/usr/include" && \
10399 test -d "$includedir" && {
10400         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10401         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10402 }
10403
10404 test "$oldincludedir" != NONE && \
10405 test "$oldincludedir" != "/usr/include" && \
10406 test -d "$oldincludedir" && {
10407         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10408         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10409 }
10410
10411 cf_search="$cf_search $cf_header_path_list"
10412
10413         test -n "$verbose" && echo "search path $cf_search"
10414         cf_save2_CPPFLAGS="$CPPFLAGS"
10415         for cf_incdir in $cf_search
10416         do
10417
10418 if test -n "$cf_incdir" ; then
10419   for cf_add_incdir in $cf_incdir
10420   do
10421         while test "$cf_add_incdir" != /usr/include
10422         do
10423           if test -d "$cf_add_incdir"
10424           then
10425                 cf_have_incdir=no
10426                 if test -n "$CFLAGS$CPPFLAGS" ; then
10427                   # a loop is needed to ensure we can add subdirs of existing dirs
10428                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10429                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10430                           cf_have_incdir=yes; break
10431                         fi
10432                   done
10433                 fi
10434
10435                 if test "$cf_have_incdir" = no ; then
10436                   if test "$cf_add_incdir" = /usr/local/include ; then
10437                         if test "$GCC" = yes
10438                         then
10439                           cf_save_CPPFLAGS=$CPPFLAGS
10440
10441         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10442         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10443
10444                           cat >"conftest.$ac_ext" <<_ACEOF
10445 #line 10445 "configure"
10446 #include "confdefs.h"
10447 #include <stdio.h>
10448 int
10449 main (void)
10450 {
10451 printf("Hello")
10452   ;
10453   return 0;
10454 }
10455 _ACEOF
10456 rm -f "conftest.$ac_objext"
10457 if { (eval echo "$as_me:10457: \"$ac_compile\"") >&5
10458   (eval $ac_compile) 2>&5
10459   ac_status=$?
10460   echo "$as_me:10460: \$? = $ac_status" >&5
10461   (exit "$ac_status"); } &&
10462          { ac_try='test -s "conftest.$ac_objext"'
10463   { (eval echo "$as_me:10463: \"$ac_try\"") >&5
10464   (eval $ac_try) 2>&5
10465   ac_status=$?
10466   echo "$as_me:10466: \$? = $ac_status" >&5
10467   (exit "$ac_status"); }; }; then
10468   :
10469 else
10470   echo "$as_me: failed program was:" >&5
10471 cat "conftest.$ac_ext" >&5
10472 cf_have_incdir=yes
10473 fi
10474 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10475                           CPPFLAGS=$cf_save_CPPFLAGS
10476                         fi
10477                   fi
10478                 fi
10479
10480                 if test "$cf_have_incdir" = no ; then
10481                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10482
10483 echo "${as_me:-configure}:10483: testing adding $cf_add_incdir to include-path ..." 1>&5
10484
10485                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10486
10487                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10488                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10489                   cf_add_incdir="$cf_top_incdir"
10490                 else
10491                   break
10492                 fi
10493           else
10494                 break
10495           fi
10496         done
10497   done
10498 fi
10499
10500                 for cf_header in \
10501                         ncurses.h \
10502                         curses.h
10503                 do
10504
10505         cat >"conftest.$ac_ext" <<_ACEOF
10506 #line 10506 "configure"
10507 #include "confdefs.h"
10508
10509 #include <$cf_header>
10510 int
10511 main (void)
10512 {
10513
10514 #ifdef NCURSES_VERSION
10515
10516 printf("%s\\n", NCURSES_VERSION);
10517 #else
10518 #ifdef __NCURSES_H
10519 printf("old\\n");
10520 #else
10521         make an error
10522 #endif
10523 #endif
10524
10525   ;
10526   return 0;
10527 }
10528 _ACEOF
10529 rm -f "conftest.$ac_objext"
10530 if { (eval echo "$as_me:10530: \"$ac_compile\"") >&5
10531   (eval $ac_compile) 2>&5
10532   ac_status=$?
10533   echo "$as_me:10533: \$? = $ac_status" >&5
10534   (exit "$ac_status"); } &&
10535          { ac_try='test -s "conftest.$ac_objext"'
10536   { (eval echo "$as_me:10536: \"$ac_try\"") >&5
10537   (eval $ac_try) 2>&5
10538   ac_status=$?
10539   echo "$as_me:10539: \$? = $ac_status" >&5
10540   (exit "$ac_status"); }; }; then
10541   cf_cv_ncurses_h2=$cf_header
10542
10543 else
10544   echo "$as_me: failed program was:" >&5
10545 cat "conftest.$ac_ext" >&5
10546 cf_cv_ncurses_h2=no
10547 fi
10548 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10549
10550                         if test "$cf_cv_ncurses_h2" != no ; then
10551                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10552                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10553                                 break
10554                         fi
10555                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10556                 done
10557                 CPPFLAGS="$cf_save2_CPPFLAGS"
10558                 test "$cf_cv_ncurses_h2" != no && break
10559         done
10560         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10560: error: not found" >&5
10561 echo "$as_me: error: not found" >&2;}
10562    { (exit 1); exit 1; }; }
10563
10564 fi
10565 echo "$as_me:10565: result: $cf_cv_ncurses_h2" >&5
10566 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10567
10568         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10569         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10570         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10571                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10572         fi
10573
10574 if test -n "$cf_1st_incdir" ; then
10575   for cf_add_incdir in $cf_1st_incdir
10576   do
10577         while test "$cf_add_incdir" != /usr/include
10578         do
10579           if test -d "$cf_add_incdir"
10580           then
10581                 cf_have_incdir=no
10582                 if test -n "$CFLAGS$CPPFLAGS" ; then
10583                   # a loop is needed to ensure we can add subdirs of existing dirs
10584                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10585                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10586                           cf_have_incdir=yes; break
10587                         fi
10588                   done
10589                 fi
10590
10591                 if test "$cf_have_incdir" = no ; then
10592                   if test "$cf_add_incdir" = /usr/local/include ; then
10593                         if test "$GCC" = yes
10594                         then
10595                           cf_save_CPPFLAGS=$CPPFLAGS
10596
10597         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10598         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10599
10600                           cat >"conftest.$ac_ext" <<_ACEOF
10601 #line 10601 "configure"
10602 #include "confdefs.h"
10603 #include <stdio.h>
10604 int
10605 main (void)
10606 {
10607 printf("Hello")
10608   ;
10609   return 0;
10610 }
10611 _ACEOF
10612 rm -f "conftest.$ac_objext"
10613 if { (eval echo "$as_me:10613: \"$ac_compile\"") >&5
10614   (eval $ac_compile) 2>&5
10615   ac_status=$?
10616   echo "$as_me:10616: \$? = $ac_status" >&5
10617   (exit "$ac_status"); } &&
10618          { ac_try='test -s "conftest.$ac_objext"'
10619   { (eval echo "$as_me:10619: \"$ac_try\"") >&5
10620   (eval $ac_try) 2>&5
10621   ac_status=$?
10622   echo "$as_me:10622: \$? = $ac_status" >&5
10623   (exit "$ac_status"); }; }; then
10624   :
10625 else
10626   echo "$as_me: failed program was:" >&5
10627 cat "conftest.$ac_ext" >&5
10628 cf_have_incdir=yes
10629 fi
10630 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10631                           CPPFLAGS=$cf_save_CPPFLAGS
10632                         fi
10633                   fi
10634                 fi
10635
10636                 if test "$cf_have_incdir" = no ; then
10637                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10638
10639 echo "${as_me:-configure}:10639: testing adding $cf_add_incdir to include-path ..." 1>&5
10640
10641                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10642
10643                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10644                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10645                   cf_add_incdir="$cf_top_incdir"
10646                 else
10647                   break
10648                 fi
10649           else
10650                 break
10651           fi
10652         done
10653   done
10654 fi
10655
10656 fi
10657
10658 # Set definitions to allow ifdef'ing for ncurses.h
10659
10660 case "$cf_cv_ncurses_header" in
10661 (*ncurses.h)
10662
10663 cat >>confdefs.h <<\EOF
10664 #define HAVE_NCURSES_H 1
10665 EOF
10666
10667         ;;
10668 esac
10669
10670 case "$cf_cv_ncurses_header" in
10671 (ncurses/curses.h|ncurses/ncurses.h)
10672
10673 cat >>confdefs.h <<\EOF
10674 #define HAVE_NCURSES_NCURSES_H 1
10675 EOF
10676
10677         ;;
10678 (ncursesw/curses.h|ncursesw/ncurses.h)
10679
10680 cat >>confdefs.h <<\EOF
10681 #define HAVE_NCURSESW_NCURSES_H 1
10682 EOF
10683
10684         ;;
10685 esac
10686
10687 echo "$as_me:10687: checking for terminfo header" >&5
10688 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10689 if test "${cf_cv_term_header+set}" = set; then
10690   echo $ECHO_N "(cached) $ECHO_C" >&6
10691 else
10692
10693 case "${cf_cv_ncurses_header}" in
10694 (*/ncurses.h|*/ncursesw.h)
10695         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10696         ;;
10697 (*)
10698         cf_term_header=term.h
10699         ;;
10700 esac
10701
10702 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10703 do
10704 cat >"conftest.$ac_ext" <<_ACEOF
10705 #line 10705 "configure"
10706 #include "confdefs.h"
10707 #include <stdio.h>
10708 #include <${cf_cv_ncurses_header:-curses.h}>
10709 #include <$cf_test>
10710
10711 int
10712 main (void)
10713 {
10714 int x = auto_left_margin; (void)x
10715   ;
10716   return 0;
10717 }
10718 _ACEOF
10719 rm -f "conftest.$ac_objext"
10720 if { (eval echo "$as_me:10720: \"$ac_compile\"") >&5
10721   (eval $ac_compile) 2>&5
10722   ac_status=$?
10723   echo "$as_me:10723: \$? = $ac_status" >&5
10724   (exit "$ac_status"); } &&
10725          { ac_try='test -s "conftest.$ac_objext"'
10726   { (eval echo "$as_me:10726: \"$ac_try\"") >&5
10727   (eval $ac_try) 2>&5
10728   ac_status=$?
10729   echo "$as_me:10729: \$? = $ac_status" >&5
10730   (exit "$ac_status"); }; }; then
10731
10732         cf_cv_term_header="$cf_test"
10733 else
10734   echo "$as_me: failed program was:" >&5
10735 cat "conftest.$ac_ext" >&5
10736
10737         cf_cv_term_header=unknown
10738
10739 fi
10740 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10741         test "$cf_cv_term_header" != unknown && break
10742 done
10743
10744 fi
10745 echo "$as_me:10745: result: $cf_cv_term_header" >&5
10746 echo "${ECHO_T}$cf_cv_term_header" >&6
10747
10748 # Set definitions to allow ifdef'ing to accommodate subdirectories
10749
10750 case "$cf_cv_term_header" in
10751 (*term.h)
10752
10753 cat >>confdefs.h <<\EOF
10754 #define HAVE_TERM_H 1
10755 EOF
10756
10757         ;;
10758 esac
10759
10760 case "$cf_cv_term_header" in
10761 (ncurses/term.h)
10762
10763 cat >>confdefs.h <<\EOF
10764 #define HAVE_NCURSES_TERM_H 1
10765 EOF
10766
10767         ;;
10768 (ncursesw/term.h)
10769
10770 cat >>confdefs.h <<\EOF
10771 #define HAVE_NCURSESW_TERM_H 1
10772 EOF
10773
10774         ;;
10775 esac
10776
10777 # some applications need this, but should check for NCURSES_VERSION
10778
10779 cat >>confdefs.h <<\EOF
10780 #define NCURSES 1
10781 EOF
10782
10783 echo "$as_me:10783: checking for ncurses version" >&5
10784 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10785 if test "${cf_cv_ncurses_version+set}" = set; then
10786   echo $ECHO_N "(cached) $ECHO_C" >&6
10787 else
10788
10789         cf_cv_ncurses_version=no
10790         cf_tempfile=out$$
10791         rm -f "$cf_tempfile"
10792         if test "$cross_compiling" = yes; then
10793
10794         # This will not work if the preprocessor splits the line after the
10795         # Autoconf token.  The 'unproto' program does that.
10796         cat > "conftest.$ac_ext" <<EOF
10797 #include <${cf_cv_ncurses_header:-curses.h}>
10798 #undef Autoconf
10799 #ifdef NCURSES_VERSION
10800 Autoconf NCURSES_VERSION
10801 #else
10802 #ifdef __NCURSES_H
10803 Autoconf "old"
10804 #endif
10805 ;
10806 #endif
10807 EOF
10808         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10809         { (eval echo "$as_me:10809: \"$cf_try\"") >&5
10810   (eval $cf_try) 2>&5
10811   ac_status=$?
10812   echo "$as_me:10812: \$? = $ac_status" >&5
10813   (exit "$ac_status"); }
10814         if test -f conftest.out ; then
10815                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10816                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10817                 rm -f conftest.out
10818         fi
10819
10820 else
10821   cat >"conftest.$ac_ext" <<_ACEOF
10822 #line 10822 "configure"
10823 #include "confdefs.h"
10824
10825 #include <${cf_cv_ncurses_header:-curses.h}>
10826 #include <stdio.h>
10827 int main(void)
10828 {
10829         FILE *fp = fopen("$cf_tempfile", "w");
10830 #ifdef NCURSES_VERSION
10831 # ifdef NCURSES_VERSION_PATCH
10832         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10833 # else
10834         fprintf(fp, "%s\\n", NCURSES_VERSION);
10835 # endif
10836 #else
10837 # ifdef __NCURSES_H
10838         fprintf(fp, "old\\n");
10839 # else
10840         make an error
10841 # endif
10842 #endif
10843         ${cf_cv_main_return:-return}(0);
10844 }
10845 _ACEOF
10846 rm -f "conftest$ac_exeext"
10847 if { (eval echo "$as_me:10847: \"$ac_link\"") >&5
10848   (eval $ac_link) 2>&5
10849   ac_status=$?
10850   echo "$as_me:10850: \$? = $ac_status" >&5
10851   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10852   { (eval echo "$as_me:10852: \"$ac_try\"") >&5
10853   (eval $ac_try) 2>&5
10854   ac_status=$?
10855   echo "$as_me:10855: \$? = $ac_status" >&5
10856   (exit "$ac_status"); }; }; then
10857
10858         cf_cv_ncurses_version=`cat $cf_tempfile`
10859 else
10860   echo "$as_me: program exited with status $ac_status" >&5
10861 echo "$as_me: failed program was:" >&5
10862 cat "conftest.$ac_ext" >&5
10863 fi
10864 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10865 fi
10866         rm -f "$cf_tempfile"
10867
10868 fi
10869 echo "$as_me:10869: result: $cf_cv_ncurses_version" >&5
10870 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10871 test "$cf_cv_ncurses_version" = no ||
10872 cat >>confdefs.h <<\EOF
10873 #define NCURSES 1
10874 EOF
10875
10876 cf_nculib_root=ncurses
10877         # This works, except for the special case where we find gpm, but
10878         # ncurses is in a nonstandard location via $LIBS, and we really want
10879         # to link gpm.
10880 cf_ncurses_LIBS=""
10881 cf_ncurses_SAVE="$LIBS"
10882 echo "$as_me:10882: checking for Gpm_Open in -lgpm" >&5
10883 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10884 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10885   echo $ECHO_N "(cached) $ECHO_C" >&6
10886 else
10887   ac_check_lib_save_LIBS=$LIBS
10888 LIBS="-lgpm  $LIBS"
10889 cat >"conftest.$ac_ext" <<_ACEOF
10890 #line 10890 "configure"
10891 #include "confdefs.h"
10892
10893 /* Override any gcc2 internal prototype to avoid an error.  */
10894 #ifdef __cplusplus
10895 extern "C"
10896 #endif
10897 /* We use char because int might match the return type of a gcc2
10898    builtin and then its argument prototype would still apply.  */
10899 char Gpm_Open ();
10900 int
10901 main (void)
10902 {
10903 Gpm_Open ();
10904   ;
10905   return 0;
10906 }
10907 _ACEOF
10908 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10909 if { (eval echo "$as_me:10909: \"$ac_link\"") >&5
10910   (eval $ac_link) 2>&5
10911   ac_status=$?
10912   echo "$as_me:10912: \$? = $ac_status" >&5
10913   (exit "$ac_status"); } &&
10914          { ac_try='test -s "conftest$ac_exeext"'
10915   { (eval echo "$as_me:10915: \"$ac_try\"") >&5
10916   (eval $ac_try) 2>&5
10917   ac_status=$?
10918   echo "$as_me:10918: \$? = $ac_status" >&5
10919   (exit "$ac_status"); }; }; then
10920   ac_cv_lib_gpm_Gpm_Open=yes
10921 else
10922   echo "$as_me: failed program was:" >&5
10923 cat "conftest.$ac_ext" >&5
10924 ac_cv_lib_gpm_Gpm_Open=no
10925 fi
10926 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10927 LIBS=$ac_check_lib_save_LIBS
10928 fi
10929 echo "$as_me:10929: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10930 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10931 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10932   echo "$as_me:10932: checking for initscr in -lgpm" >&5
10933 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10934 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10935   echo $ECHO_N "(cached) $ECHO_C" >&6
10936 else
10937   ac_check_lib_save_LIBS=$LIBS
10938 LIBS="-lgpm  $LIBS"
10939 cat >"conftest.$ac_ext" <<_ACEOF
10940 #line 10940 "configure"
10941 #include "confdefs.h"
10942
10943 /* Override any gcc2 internal prototype to avoid an error.  */
10944 #ifdef __cplusplus
10945 extern "C"
10946 #endif
10947 /* We use char because int might match the return type of a gcc2
10948    builtin and then its argument prototype would still apply.  */
10949 char initscr ();
10950 int
10951 main (void)
10952 {
10953 initscr ();
10954   ;
10955   return 0;
10956 }
10957 _ACEOF
10958 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10959 if { (eval echo "$as_me:10959: \"$ac_link\"") >&5
10960   (eval $ac_link) 2>&5
10961   ac_status=$?
10962   echo "$as_me:10962: \$? = $ac_status" >&5
10963   (exit "$ac_status"); } &&
10964          { ac_try='test -s "conftest$ac_exeext"'
10965   { (eval echo "$as_me:10965: \"$ac_try\"") >&5
10966   (eval $ac_try) 2>&5
10967   ac_status=$?
10968   echo "$as_me:10968: \$? = $ac_status" >&5
10969   (exit "$ac_status"); }; }; then
10970   ac_cv_lib_gpm_initscr=yes
10971 else
10972   echo "$as_me: failed program was:" >&5
10973 cat "conftest.$ac_ext" >&5
10974 ac_cv_lib_gpm_initscr=no
10975 fi
10976 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10977 LIBS=$ac_check_lib_save_LIBS
10978 fi
10979 echo "$as_me:10979: result: $ac_cv_lib_gpm_initscr" >&5
10980 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10981 if test "$ac_cv_lib_gpm_initscr" = yes; then
10982   LIBS="$cf_ncurses_SAVE"
10983 else
10984   cf_ncurses_LIBS="-lgpm"
10985 fi
10986
10987 fi
10988
10989 case "$host_os" in
10990 (freebsd*)
10991         # This is only necessary if you are linking against an obsolete
10992         # version of ncurses (but it should do no harm, since it is static).
10993         if test "$cf_nculib_root" = ncurses ; then
10994                 echo "$as_me:10994: checking for tgoto in -lmytinfo" >&5
10995 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10996 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10997   echo $ECHO_N "(cached) $ECHO_C" >&6
10998 else
10999   ac_check_lib_save_LIBS=$LIBS
11000 LIBS="-lmytinfo  $LIBS"
11001 cat >"conftest.$ac_ext" <<_ACEOF
11002 #line 11002 "configure"
11003 #include "confdefs.h"
11004
11005 /* Override any gcc2 internal prototype to avoid an error.  */
11006 #ifdef __cplusplus
11007 extern "C"
11008 #endif
11009 /* We use char because int might match the return type of a gcc2
11010    builtin and then its argument prototype would still apply.  */
11011 char tgoto ();
11012 int
11013 main (void)
11014 {
11015 tgoto ();
11016   ;
11017   return 0;
11018 }
11019 _ACEOF
11020 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11021 if { (eval echo "$as_me:11021: \"$ac_link\"") >&5
11022   (eval $ac_link) 2>&5
11023   ac_status=$?
11024   echo "$as_me:11024: \$? = $ac_status" >&5
11025   (exit "$ac_status"); } &&
11026          { ac_try='test -s "conftest$ac_exeext"'
11027   { (eval echo "$as_me:11027: \"$ac_try\"") >&5
11028   (eval $ac_try) 2>&5
11029   ac_status=$?
11030   echo "$as_me:11030: \$? = $ac_status" >&5
11031   (exit "$ac_status"); }; }; then
11032   ac_cv_lib_mytinfo_tgoto=yes
11033 else
11034   echo "$as_me: failed program was:" >&5
11035 cat "conftest.$ac_ext" >&5
11036 ac_cv_lib_mytinfo_tgoto=no
11037 fi
11038 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11039 LIBS=$ac_check_lib_save_LIBS
11040 fi
11041 echo "$as_me:11041: result: $ac_cv_lib_mytinfo_tgoto" >&5
11042 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11043 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11044   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11045 fi
11046
11047         fi
11048         ;;
11049 esac
11050
11051 cf_add_libs="$LIBS"
11052 # reverse order
11053 cf_add_0lib=
11054 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11055 # filter duplicates
11056 for cf_add_1lib in $cf_add_0lib; do
11057         for cf_add_2lib in $cf_add_libs; do
11058                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11059                         cf_add_1lib=
11060                         break
11061                 fi
11062         done
11063         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11064 done
11065 LIBS="$cf_add_libs"
11066
11067 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11068 then
11069
11070 cf_add_libs="$LIBS"
11071 # reverse order
11072 cf_add_0lib=
11073 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11074 # filter duplicates
11075 for cf_add_1lib in $cf_add_0lib; do
11076         for cf_add_2lib in $cf_add_libs; do
11077                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11078                         cf_add_1lib=
11079                         break
11080                 fi
11081         done
11082         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11083 done
11084 LIBS="$cf_add_libs"
11085
11086 else
11087
11088         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11089         cf_libdir=""
11090         echo "$as_me:11090: checking for initscr" >&5
11091 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11092 if test "${ac_cv_func_initscr+set}" = set; then
11093   echo $ECHO_N "(cached) $ECHO_C" >&6
11094 else
11095   cat >"conftest.$ac_ext" <<_ACEOF
11096 #line 11096 "configure"
11097 #include "confdefs.h"
11098 #define initscr autoconf_temporary
11099 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11100 #undef initscr
11101
11102 #ifdef __cplusplus
11103 extern "C"
11104 #endif
11105
11106 /* We use char because int might match the return type of a gcc2
11107    builtin and then its argument prototype would still apply.  */
11108 char initscr (void);
11109
11110 int
11111 main (void)
11112 {
11113
11114 /* The GNU C library defines stubs for functions which it implements
11115     to always fail with ENOSYS.  Some functions are actually named
11116     something starting with __ and the normal name is an alias.  */
11117 #if defined (__stub_initscr) || defined (__stub___initscr)
11118 #error found stub for initscr
11119 #endif
11120
11121         return initscr ();
11122   ;
11123   return 0;
11124 }
11125 _ACEOF
11126 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11127 if { (eval echo "$as_me:11127: \"$ac_link\"") >&5
11128   (eval $ac_link) 2>&5
11129   ac_status=$?
11130   echo "$as_me:11130: \$? = $ac_status" >&5
11131   (exit "$ac_status"); } &&
11132          { ac_try='test -s "conftest$ac_exeext"'
11133   { (eval echo "$as_me:11133: \"$ac_try\"") >&5
11134   (eval $ac_try) 2>&5
11135   ac_status=$?
11136   echo "$as_me:11136: \$? = $ac_status" >&5
11137   (exit "$ac_status"); }; }; then
11138   ac_cv_func_initscr=yes
11139 else
11140   echo "$as_me: failed program was:" >&5
11141 cat "conftest.$ac_ext" >&5
11142 ac_cv_func_initscr=no
11143 fi
11144 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11145 fi
11146 echo "$as_me:11146: result: $ac_cv_func_initscr" >&5
11147 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11148 if test "$ac_cv_func_initscr" = yes; then
11149   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11150 else
11151
11152                 cf_save_LIBS="$LIBS"
11153                 echo "$as_me:11153: checking for initscr in -l$cf_nculib_root" >&5
11154 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11155                 LIBS="-l$cf_nculib_root $LIBS"
11156                 cat >"conftest.$ac_ext" <<_ACEOF
11157 #line 11157 "configure"
11158 #include "confdefs.h"
11159 #include <${cf_cv_ncurses_header:-curses.h}>
11160 int
11161 main (void)
11162 {
11163 initscr()
11164   ;
11165   return 0;
11166 }
11167 _ACEOF
11168 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11169 if { (eval echo "$as_me:11169: \"$ac_link\"") >&5
11170   (eval $ac_link) 2>&5
11171   ac_status=$?
11172   echo "$as_me:11172: \$? = $ac_status" >&5
11173   (exit "$ac_status"); } &&
11174          { ac_try='test -s "conftest$ac_exeext"'
11175   { (eval echo "$as_me:11175: \"$ac_try\"") >&5
11176   (eval $ac_try) 2>&5
11177   ac_status=$?
11178   echo "$as_me:11178: \$? = $ac_status" >&5
11179   (exit "$ac_status"); }; }; then
11180   echo "$as_me:11180: result: yes" >&5
11181 echo "${ECHO_T}yes" >&6
11182                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11183
11184 else
11185   echo "$as_me: failed program was:" >&5
11186 cat "conftest.$ac_ext" >&5
11187 echo "$as_me:11187: result: no" >&5
11188 echo "${ECHO_T}no" >&6
11189
11190 cf_search=
11191 cf_library_path_list=""
11192 if test -n "${LDFLAGS}${LIBS}" ; then
11193         for cf_library_path in $LDFLAGS $LIBS
11194         do
11195                 case "$cf_library_path" in
11196                 (-L*)
11197                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11198
11199 test "x$cf_library_path" != "xNONE" && \
11200 test -d "$cf_library_path" && \
11201  {
11202         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11203         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11204         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11205         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11206         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11207         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"
11208 }
11209
11210                         cf_library_path_list="$cf_library_path_list $cf_search"
11211                         ;;
11212                 esac
11213         done
11214 fi
11215
11216 cf_search=
11217
11218 test "x$prefix" != "xNONE" && \
11219 test -d "$prefix" && \
11220  {
11221         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11222         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11223         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11224         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11225         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11226         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11227 }
11228
11229 for cf_subdir_prefix in \
11230         /usr \
11231         /usr/local \
11232         /usr/pkg \
11233         /opt \
11234         /opt/local \
11235         $HOME
11236 do
11237
11238 test "x$cf_subdir_prefix" != "x$prefix" && \
11239 test -d "$cf_subdir_prefix" && \
11240 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11241         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11242         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11243         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11244         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11245         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11246         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"
11247 }
11248
11249 done
11250
11251 cf_search="$cf_library_path_list $cf_search"
11252
11253                         for cf_libdir in $cf_search
11254                         do
11255                                 echo "$as_me:11255: checking for -l$cf_nculib_root in $cf_libdir" >&5
11256 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11257                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11258                                 cat >"conftest.$ac_ext" <<_ACEOF
11259 #line 11259 "configure"
11260 #include "confdefs.h"
11261 #include <${cf_cv_ncurses_header:-curses.h}>
11262 int
11263 main (void)
11264 {
11265 initscr()
11266   ;
11267   return 0;
11268 }
11269 _ACEOF
11270 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11271 if { (eval echo "$as_me:11271: \"$ac_link\"") >&5
11272   (eval $ac_link) 2>&5
11273   ac_status=$?
11274   echo "$as_me:11274: \$? = $ac_status" >&5
11275   (exit "$ac_status"); } &&
11276          { ac_try='test -s "conftest$ac_exeext"'
11277   { (eval echo "$as_me:11277: \"$ac_try\"") >&5
11278   (eval $ac_try) 2>&5
11279   ac_status=$?
11280   echo "$as_me:11280: \$? = $ac_status" >&5
11281   (exit "$ac_status"); }; }; then
11282   echo "$as_me:11282: result: yes" >&5
11283 echo "${ECHO_T}yes" >&6
11284                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11285                                          break
11286 else
11287   echo "$as_me: failed program was:" >&5
11288 cat "conftest.$ac_ext" >&5
11289 echo "$as_me:11289: result: no" >&5
11290 echo "${ECHO_T}no" >&6
11291                                          LIBS="$cf_save_LIBS"
11292 fi
11293 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11294                         done
11295
11296 fi
11297 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11298
11299 fi
11300
11301 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11302
11303 if test "$cf_found_library" = no ; then
11304         { { echo "$as_me:11304: error: Cannot link $cf_nculib_root library" >&5
11305 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11306    { (exit 1); exit 1; }; }
11307 fi
11308
11309 fi
11310
11311 if test -n "$cf_ncurses_LIBS" ; then
11312         echo "$as_me:11312: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11313 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11314         cf_ncurses_SAVE="$LIBS"
11315         for p in $cf_ncurses_LIBS ; do
11316                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11317                 if test "$q" != "$LIBS" ; then
11318                         LIBS="$q"
11319                 fi
11320         done
11321         cat >"conftest.$ac_ext" <<_ACEOF
11322 #line 11322 "configure"
11323 #include "confdefs.h"
11324 #include <${cf_cv_ncurses_header:-curses.h}>
11325 int
11326 main (void)
11327 {
11328 initscr(); mousemask(0,0); tigetstr((char *)0);
11329   ;
11330   return 0;
11331 }
11332 _ACEOF
11333 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11334 if { (eval echo "$as_me:11334: \"$ac_link\"") >&5
11335   (eval $ac_link) 2>&5
11336   ac_status=$?
11337   echo "$as_me:11337: \$? = $ac_status" >&5
11338   (exit "$ac_status"); } &&
11339          { ac_try='test -s "conftest$ac_exeext"'
11340   { (eval echo "$as_me:11340: \"$ac_try\"") >&5
11341   (eval $ac_try) 2>&5
11342   ac_status=$?
11343   echo "$as_me:11343: \$? = $ac_status" >&5
11344   (exit "$ac_status"); }; }; then
11345   echo "$as_me:11345: result: yes" >&5
11346 echo "${ECHO_T}yes" >&6
11347 else
11348   echo "$as_me: failed program was:" >&5
11349 cat "conftest.$ac_ext" >&5
11350 echo "$as_me:11350: result: no" >&5
11351 echo "${ECHO_T}no" >&6
11352                  LIBS="$cf_ncurses_SAVE"
11353 fi
11354 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11355 fi
11356
11357 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11358
11359 cat >>confdefs.h <<EOF
11360 #define $cf_nculib_ROOT 1
11361 EOF
11362
11363         fi
11364 else
11365         NCURSES_CONFIG=none
11366 fi
11367
11368 fi
11369
11370 if test "$NCURSES_CONFIG_PKG" != none ; then
11371         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11372
11373         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11374         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11375         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11376
11377         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11378         if test -z "$cf_cv_abi_version"
11379         then
11380                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11381         fi
11382
11383 elif test "$NCURSES_CONFIG" != none ; then
11384
11385         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11386
11387         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11388         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11389         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11390
11391         # ABI version is not available from headers
11392         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11393
11394 else
11395
11396         for cf_name in MAJOR MINOR PATCH
11397         do
11398         cat >conftest.$ac_ext <<CF_EOF
11399         #include <${cf_cv_ncurses_header:-curses.h}>
11400         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11401 CF_EOF
11402                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11403                 { (eval echo "$as_me:11403: \"$cf_try\"") >&5
11404   (eval $cf_try) 2>&5
11405   ac_status=$?
11406   echo "$as_me:11406: \$? = $ac_status" >&5
11407   (exit "$ac_status"); }
11408                 if test -f conftest.out ; then
11409                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11410                         eval NCURSES_$cf_name=\"$cf_result\"
11411                         # cat conftest.$ac_ext
11412                         # cat conftest.out
11413                 fi
11414         done
11415
11416         cf_cv_abi_version=${NCURSES_MAJOR}
11417
11418 fi
11419
11420 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11421
11422 cf_cv_timestamp=`date`
11423
11424 echo "$as_me:11424: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11425 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11426
11427 echo "$as_me:11427: checking if you want to have a library-prefix" >&5
11428 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11429
11430 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11431 if test "${with_lib_prefix+set}" = set; then
11432   withval="$with_lib_prefix"
11433   with_lib_prefix=$withval
11434 else
11435   with_lib_prefix=auto
11436 fi;
11437 echo "$as_me:11437: result: $with_lib_prefix" >&5
11438 echo "${ECHO_T}$with_lib_prefix" >&6
11439
11440 if test "$with_lib_prefix" = auto
11441 then
11442
11443         case "$cf_cv_system_name" in
11444         (OS/2*|os2*)
11445                 if test "$DFT_LWR_MODEL" = libtool; then
11446                         LIB_PREFIX='lib'
11447                 else
11448                         LIB_PREFIX=''
11449                 fi
11450                 ;;
11451         (*-msvc*)
11452                 LIB_PREFIX=''
11453                 ;;
11454         (*)     LIB_PREFIX='lib'
11455                 ;;
11456         esac
11457 cf_prefix=$LIB_PREFIX
11458
11459 elif test "$with_lib_prefix" = no
11460 then
11461         LIB_PREFIX=
11462 else
11463         LIB_PREFIX=$with_lib_prefix
11464 fi
11465
11466 LIB_SUFFIX=
11467
11468 ###############################################################################
11469
11470 if test X"$CC_G_OPT" = X"" ; then
11471         CC_G_OPT='-g'
11472         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11473 fi
11474
11475 echo "$as_me:11475: checking for default loader flags" >&5
11476 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11477 case $DFT_LWR_MODEL in
11478 (normal)  LD_MODEL=''   ;;
11479 (debug)   LD_MODEL=$CC_G_OPT ;;
11480 (profile) LD_MODEL='-pg';;
11481 (shared)  LD_MODEL=''   ;;
11482 esac
11483 echo "$as_me:11483: result: $LD_MODEL" >&5
11484 echo "${ECHO_T}$LD_MODEL" >&6
11485
11486 LD_RPATH_OPT=
11487 if test "x$cf_cv_enable_rpath" != xno
11488 then
11489         echo "$as_me:11489: checking for an rpath option" >&5
11490 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11491         case "$cf_cv_system_name" in
11492         (irix*)
11493                 if test "$GCC" = yes; then
11494                         LD_RPATH_OPT="-Wl,-rpath,"
11495                 else
11496                         LD_RPATH_OPT="-rpath "
11497                 fi
11498                 ;;
11499         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11500                 LD_RPATH_OPT="-Wl,-rpath,"
11501                 ;;
11502         (openbsd[2-9].*|mirbsd*)
11503                 LD_RPATH_OPT="-Wl,-rpath,"
11504                 ;;
11505         (dragonfly*)
11506                 LD_RPATH_OPT="-rpath "
11507                 ;;
11508         (netbsd*)
11509                 LD_RPATH_OPT="-Wl,-rpath,"
11510                 ;;
11511         (osf*|mls+*)
11512                 LD_RPATH_OPT="-rpath "
11513                 ;;
11514         (solaris2*)
11515                 LD_RPATH_OPT="-R"
11516                 ;;
11517         (*)
11518                 ;;
11519         esac
11520         echo "$as_me:11520: result: $LD_RPATH_OPT" >&5
11521 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11522
11523         case "x$LD_RPATH_OPT" in
11524         (x-R*)
11525                 echo "$as_me:11525: checking if we need a space after rpath option" >&5
11526 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11527                 cf_save_LIBS="$LIBS"
11528
11529 cf_add_libs="$LIBS"
11530 # reverse order
11531 cf_add_0lib=
11532 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11533 # filter duplicates
11534 for cf_add_1lib in $cf_add_0lib; do
11535         for cf_add_2lib in $cf_add_libs; do
11536                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11537                         cf_add_1lib=
11538                         break
11539                 fi
11540         done
11541         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11542 done
11543 LIBS="$cf_add_libs"
11544
11545                 cat >"conftest.$ac_ext" <<_ACEOF
11546 #line 11546 "configure"
11547 #include "confdefs.h"
11548
11549 int
11550 main (void)
11551 {
11552
11553   ;
11554   return 0;
11555 }
11556 _ACEOF
11557 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11558 if { (eval echo "$as_me:11558: \"$ac_link\"") >&5
11559   (eval $ac_link) 2>&5
11560   ac_status=$?
11561   echo "$as_me:11561: \$? = $ac_status" >&5
11562   (exit "$ac_status"); } &&
11563          { ac_try='test -s "conftest$ac_exeext"'
11564   { (eval echo "$as_me:11564: \"$ac_try\"") >&5
11565   (eval $ac_try) 2>&5
11566   ac_status=$?
11567   echo "$as_me:11567: \$? = $ac_status" >&5
11568   (exit "$ac_status"); }; }; then
11569   cf_rpath_space=no
11570 else
11571   echo "$as_me: failed program was:" >&5
11572 cat "conftest.$ac_ext" >&5
11573 cf_rpath_space=yes
11574 fi
11575 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11576                 LIBS="$cf_save_LIBS"
11577                 echo "$as_me:11577: result: $cf_rpath_space" >&5
11578 echo "${ECHO_T}$cf_rpath_space" >&6
11579                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11580                 ;;
11581         esac
11582 fi
11583
11584         RM_SHARED_OPTS=
11585         LOCAL_LDFLAGS=
11586         LOCAL_LDFLAGS2=
11587         LD_SHARED_OPTS=
11588         INSTALL_LIB="-m 644"
11589         : ${rel_builddir:=.}
11590
11591         shlibdir=$libdir
11592
11593         MAKE_DLLS="#"
11594
11595         cf_cv_do_symlinks=no
11596         cf_ld_rpath_opt=
11597         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11598
11599         echo "$as_me:11599: checking if release/abi version should be used for shared libs" >&5
11600 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11601
11602 # Check whether --with-shlib-version or --without-shlib-version was given.
11603 if test "${with_shlib_version+set}" = set; then
11604   withval="$with_shlib_version"
11605   test -z "$withval" && withval=auto
11606         case "$withval" in
11607         (yes)
11608                 cf_cv_shlib_version=auto
11609                 ;;
11610         (rel|abi|auto)
11611                 cf_cv_shlib_version=$withval
11612                 ;;
11613         (*)
11614                 echo "$as_me:11614: result: $withval" >&5
11615 echo "${ECHO_T}$withval" >&6
11616                 { { echo "$as_me:11616: error: option value must be one of: rel, abi, or auto" >&5
11617 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11618    { (exit 1); exit 1; }; }
11619                 ;;
11620         esac
11621
11622 else
11623   cf_cv_shlib_version=auto
11624 fi;
11625         echo "$as_me:11625: result: $cf_cv_shlib_version" >&5
11626 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11627
11628         cf_cv_rm_so_locs=no
11629         cf_try_cflags=
11630
11631         # Some less-capable ports of gcc support only -fpic
11632         CC_SHARED_OPTS=
11633
11634         cf_try_fPIC=no
11635         if test "$GCC" = yes
11636         then
11637                 cf_try_fPIC=yes
11638         else
11639                 case "$cf_cv_system_name" in
11640                 (*linux*)       # e.g., PGI compiler
11641                         cf_try_fPIC=yes
11642                         ;;
11643                 esac
11644         fi
11645
11646         if test "$cf_try_fPIC" = yes
11647         then
11648                 echo "$as_me:11648: checking which $CC option to use" >&5
11649 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11650                 cf_save_CFLAGS="$CFLAGS"
11651                 for CC_SHARED_OPTS in -fPIC -fpic ''
11652                 do
11653                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11654                         cat >"conftest.$ac_ext" <<_ACEOF
11655 #line 11655 "configure"
11656 #include "confdefs.h"
11657 #include <stdio.h>
11658 int
11659 main (void)
11660 {
11661 int x = 1
11662   ;
11663   return 0;
11664 }
11665 _ACEOF
11666 rm -f "conftest.$ac_objext"
11667 if { (eval echo "$as_me:11667: \"$ac_compile\"") >&5
11668   (eval $ac_compile) 2>&5
11669   ac_status=$?
11670   echo "$as_me:11670: \$? = $ac_status" >&5
11671   (exit "$ac_status"); } &&
11672          { ac_try='test -s "conftest.$ac_objext"'
11673   { (eval echo "$as_me:11673: \"$ac_try\"") >&5
11674   (eval $ac_try) 2>&5
11675   ac_status=$?
11676   echo "$as_me:11676: \$? = $ac_status" >&5
11677   (exit "$ac_status"); }; }; then
11678   break
11679 else
11680   echo "$as_me: failed program was:" >&5
11681 cat "conftest.$ac_ext" >&5
11682 fi
11683 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11684                 done
11685                 echo "$as_me:11685: result: $CC_SHARED_OPTS" >&5
11686 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11687                 CFLAGS="$cf_save_CFLAGS"
11688         fi
11689
11690         cf_cv_shlib_version_infix=no
11691
11692         case "$cf_cv_system_name" in
11693         (aix4.3-9*|aix[5-7]*)
11694                 if test "$GCC" = yes; then
11695                         CC_SHARED_OPTS='-Wl,-brtl'
11696                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11697                 else
11698                         CC_SHARED_OPTS='-brtl'
11699                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11700                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11701                 fi
11702                 ;;
11703         (beos*)
11704                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11705                 ;;
11706         (cygwin*)
11707                 CC_SHARED_OPTS=
11708                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11709                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11710                 cf_cv_shlib_version=cygdll
11711                 cf_cv_shlib_version_infix=cygdll
11712                 shlibdir=$bindir
11713                 MAKE_DLLS=
11714                 cat >mk_shared_lib.sh <<-CF_EOF
11715                 #!$SHELL
11716                 SHARED_LIB=\$1
11717                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11718                 shift
11719                 cat <<-EOF
11720                 Linking shared library
11721                 ** SHARED_LIB \$SHARED_LIB
11722                 ** IMPORT_LIB \$IMPORT_LIB
11723 EOF
11724                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11725 CF_EOF
11726                 chmod +x mk_shared_lib.sh
11727                 ;;
11728         (msys*)
11729                 CC_SHARED_OPTS=
11730                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11731                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11732                 cf_cv_shlib_version=msysdll
11733                 cf_cv_shlib_version_infix=msysdll
11734                 shlibdir=$bindir
11735                 MAKE_DLLS=
11736                 cat >mk_shared_lib.sh <<-CF_EOF
11737                 #!$SHELL
11738                 SHARED_LIB=\$1
11739                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11740                 shift
11741                 cat <<-EOF
11742                 Linking shared library
11743                 ** SHARED_LIB \$SHARED_LIB
11744                 ** IMPORT_LIB \$IMPORT_LIB
11745 EOF
11746                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11747 CF_EOF
11748                 chmod +x mk_shared_lib.sh
11749                 ;;
11750         (darwin*)
11751                 cf_try_cflags="no-cpp-precomp"
11752                 CC_SHARED_OPTS="-dynamic"
11753                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11754                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11755                 cf_cv_shlib_version_infix=yes
11756                 echo "$as_me:11756: checking if ld -search_paths_first works" >&5
11757 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11758 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11759   echo $ECHO_N "(cached) $ECHO_C" >&6
11760 else
11761
11762                         cf_save_LDFLAGS=$LDFLAGS
11763                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11764                         cat >"conftest.$ac_ext" <<_ACEOF
11765 #line 11765 "configure"
11766 #include "confdefs.h"
11767
11768 int
11769 main (void)
11770 {
11771 int i;
11772   ;
11773   return 0;
11774 }
11775 _ACEOF
11776 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11777 if { (eval echo "$as_me:11777: \"$ac_link\"") >&5
11778   (eval $ac_link) 2>&5
11779   ac_status=$?
11780   echo "$as_me:11780: \$? = $ac_status" >&5
11781   (exit "$ac_status"); } &&
11782          { ac_try='test -s "conftest$ac_exeext"'
11783   { (eval echo "$as_me:11783: \"$ac_try\"") >&5
11784   (eval $ac_try) 2>&5
11785   ac_status=$?
11786   echo "$as_me:11786: \$? = $ac_status" >&5
11787   (exit "$ac_status"); }; }; then
11788   cf_cv_ldflags_search_paths_first=yes
11789 else
11790   echo "$as_me: failed program was:" >&5
11791 cat "conftest.$ac_ext" >&5
11792 cf_cv_ldflags_search_paths_first=no
11793 fi
11794 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11795                                 LDFLAGS=$cf_save_LDFLAGS
11796 fi
11797 echo "$as_me:11797: result: $cf_cv_ldflags_search_paths_first" >&5
11798 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11799                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11800                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11801                 fi
11802                 ;;
11803         (haiku*)
11804
11805         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11806         if test "$cf_cv_shlib_version" = rel; then
11807                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11808         else
11809                 cf_cv_shared_soname='`basename $@`'
11810         fi
11811
11812                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11813                 ;;
11814         (hpux[7-8]*)
11815                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11816                 if test "$GCC" != yes; then
11817                         CC_SHARED_OPTS='+Z'
11818                 fi
11819                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11820                 INSTALL_LIB="-m 555"
11821                 ;;
11822         (hpux*)
11823                 # (tested with gcc 2.7.2 -- I don't have c89)
11824                 if test "$GCC" = yes; then
11825                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11826                 else
11827                         CC_SHARED_OPTS='+Z'
11828                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11829                 fi
11830                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11831                 # HP-UX shared libraries must be executable, and should be
11832                 # readonly to exploit a quirk in the memory manager.
11833                 INSTALL_LIB="-m 555"
11834                 ;;
11835         (interix*)
11836                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11837                 if test "$cf_cv_shlib_version" = rel; then
11838                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11839                 else
11840                         cf_shared_soname='`basename $@`'
11841                 fi
11842                 CC_SHARED_OPTS=
11843                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11844                 ;;
11845         (irix*)
11846                 if test "$cf_cv_enable_rpath" = yes ; then
11847                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11848                 fi
11849                 # tested with IRIX 5.2 and 'cc'.
11850                 if test "$GCC" != yes; then
11851                         CC_SHARED_OPTS='-KPIC'
11852                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11853                 else
11854                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11855                 fi
11856                 cf_cv_rm_so_locs=yes
11857                 ;;
11858         (linux*|gnu*|k*bsd*-gnu)
11859                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11860                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11861                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11862                 fi
11863                 if test "$cf_cv_enable_rpath" = yes ; then
11864                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11865                 fi
11866
11867         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11868         if test "$cf_cv_shlib_version" = rel; then
11869                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11870         else
11871                 cf_cv_shared_soname='`basename $@`'
11872         fi
11873
11874                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11875                 ;;
11876         (mingw*msvc*)
11877                 cf_cv_shlib_version=msvcdll
11878                 cf_cv_shlib_version_infix=msvcdll
11879                 shlibdir=$bindir
11880                 MAKE_DLLS=
11881                 if test "$DFT_LWR_MODEL" = "shared" ; then
11882                         LOCAL_LDFLAGS="-link -dll"
11883                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11884                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11885                 fi
11886                 CC_SHARED_OPTS=
11887                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11888                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11889                 cat >mk_shared_lib.sh <<-CF_EOF
11890                 #!$SHELL
11891                 SHARED_LIB=\$1
11892                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11893                 shift
11894                 my_ld=\$1
11895                 shift
11896                 cat <<-EOF
11897                 Linking shared library
11898                 ** SHARED LIB \$SHARED_LIB
11899                 ** IMPORT_LIB \$IMPORT_LIB
11900 EOF
11901                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11902                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11903                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11904 CF_EOF
11905                 chmod +x mk_shared_lib.sh
11906                 cat >mk_prog.sh <<-CF_EOF
11907                 #!$SHELL
11908                 shift
11909                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11910                 LD="$LD"
11911                 clopts=()
11912                 ldopts=("/subsystem:console")
11913                 libs=()
11914                 isdll=0
11915                 while test \$# -gt 0; do
11916                         case "\$1" in
11917                                 -link)
11918                                         # ignore -link argument
11919                                         ;;
11920                                 -M[TD] | -M[TD]d)
11921                                         # ignore runtime-library option
11922                                         ;;
11923                                 -dll)
11924                                         isdll=1
11925                                         ;;
11926                                 -W* | -w*)
11927                                         # ignore warnings
11928                                         ;;
11929                                 -D*)
11930                                         clopts+=("\$1")
11931                                         ;;
11932                                 -I*)
11933                                         clopts+=("\$1")
11934                                         ;;
11935                                 -l*)
11936                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11937                                         ;;
11938                                 -L*)
11939                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11940                                         ;;
11941                                 *.obj | *.o)
11942                                         ldopts+=("\$1")
11943                                         ;;
11944                                 -Wl,*)
11945                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11946                                                 ldopts+=("\${linkarg}")
11947                                         done
11948                                         ;;
11949                                 *.lib)
11950                                         ldopts+=("\$1")
11951                                         ;;
11952                                 -o)
11953                                         shift
11954                                         ldopts+=("-out:\$1")
11955                                         ;;
11956                                 *)
11957                                         clopts+=("\$1")
11958                                         ldopts+=("\$1")
11959                                         ;;
11960                         esac
11961                         shift
11962                 done
11963                 if [ "\$isdll" -ne 0 ]; then
11964                         for lib in \${libs[*]}; do
11965                                 ldopts+=("\$lib.dll.lib")
11966                         done
11967                 else
11968                         for lib in \${libs[*]}; do
11969                                 ldopts+=("\$lib.lib")
11970                         done
11971                 fi
11972                 cat <<-EOF
11973                 Creating program
11974                 ** ld options:   "\${ldopts[@]}"
11975 EOF
11976                 exec \$LD \${ldopts[@]}
11977 CF_EOF
11978                 chmod +x mk_prog.sh
11979                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11980                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11981                 ;;
11982         (mingw*)
11983                 cf_cv_shlib_version=mingw
11984                 cf_cv_shlib_version_infix=mingw
11985                 shlibdir=$bindir
11986                 MAKE_DLLS=
11987                 if test "$DFT_LWR_MODEL" = "shared" ; then
11988                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11989                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11990                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11991                 fi
11992                 CC_SHARED_OPTS=
11993                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11994                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11995                 cat >mk_shared_lib.sh <<-CF_EOF
11996                 #!$SHELL
11997                 SHARED_LIB=\$1
11998                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11999                 shift
12000                 cat <<-EOF
12001                 Linking shared library
12002                 ** SHARED_LIB \$SHARED_LIB
12003                 ** IMPORT_LIB \$IMPORT_LIB
12004 EOF
12005                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12006 CF_EOF
12007                 chmod +x mk_shared_lib.sh
12008                 ;;
12009         (openbsd[2-9].*|mirbsd*)
12010                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12011                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12012                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12013                 fi
12014                 if test "$cf_cv_enable_rpath" = yes ; then
12015                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12016                 fi
12017                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12018
12019         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12020         if test "$cf_cv_shlib_version" = rel; then
12021                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12022         else
12023                 cf_cv_shared_soname='`basename $@`'
12024         fi
12025
12026                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12027                 ;;
12028         (nskJ*)
12029                 CC_SHARED_OPTS=
12030                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12031                 ;;
12032         (nskL*)
12033                 CC_SHARED_OPTS=
12034                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12035                 ;;
12036         (nto-qnx*|openbsd*|freebsd[12].*)
12037                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12038                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12039                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12040                 ;;
12041         (dragonfly*|freebsd*)
12042                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12043                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12044                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12045                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12046                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12047                 fi
12048
12049         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12050         if test "$cf_cv_shlib_version" = rel; then
12051                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12052         else
12053                 cf_cv_shared_soname='`basename $@`'
12054         fi
12055
12056                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12057                 ;;
12058         (netbsd*)
12059                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12060                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12061                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12062                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12063                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12064                         if test "$cf_cv_shlib_version" = auto; then
12065                         if test -f /usr/libexec/ld.elf_so; then
12066                                 cf_cv_shlib_version=abi
12067                         else
12068                                 cf_cv_shlib_version=rel
12069                         fi
12070                         fi
12071
12072         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12073         if test "$cf_cv_shlib_version" = rel; then
12074                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12075         else
12076                 cf_cv_shared_soname='`basename $@`'
12077         fi
12078
12079                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12080                 else
12081                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12082                 fi
12083                 ;;
12084         (osf*|mls+*)
12085                 # tested with OSF/1 V3.2 and 'cc'
12086                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12087                 # link with shared libs).
12088                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12089                 case "$host_os" in
12090                 (osf4*)
12091                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12092                         ;;
12093                 esac
12094                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12095                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12096                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12097                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12098                 fi
12099                 cf_cv_rm_so_locs=yes
12100                 ;;
12101         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12102                 # tested with osr5.0.5
12103                 if test "$GCC" != yes; then
12104                         CC_SHARED_OPTS='-belf -KPIC'
12105                 fi
12106                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12107                 if test "$cf_cv_enable_rpath" = yes ; then
12108                         # only way is to set LD_RUN_PATH but no switch for it
12109                         RUN_PATH=$libdir
12110                 fi
12111                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12112                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12113                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12114                 ;;
12115         (sunos4*)
12116                 # tested with SunOS 4.1.1 and gcc 2.7.0
12117                 if test "$GCC" != yes; then
12118                         CC_SHARED_OPTS='-KPIC'
12119                 fi
12120                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12121                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12122                 ;;
12123         (solaris2*)
12124                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12125                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12126                 if test "$DFT_LWR_MODEL" = "shared" ; then
12127                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12128                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12129                 fi
12130                 if test "$cf_cv_enable_rpath" = yes ; then
12131                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12132                 fi
12133
12134         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12135         if test "$cf_cv_shlib_version" = rel; then
12136                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12137         else
12138                 cf_cv_shared_soname='`basename $@`'
12139         fi
12140
12141                 if test "$GCC" != yes; then
12142                         cf_save_CFLAGS="$CFLAGS"
12143                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12144                         do
12145                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12146                                 cat >"conftest.$ac_ext" <<_ACEOF
12147 #line 12147 "configure"
12148 #include "confdefs.h"
12149 #include <stdio.h>
12150 int
12151 main (void)
12152 {
12153 printf("Hello\\n");
12154   ;
12155   return 0;
12156 }
12157 _ACEOF
12158 rm -f "conftest.$ac_objext"
12159 if { (eval echo "$as_me:12159: \"$ac_compile\"") >&5
12160   (eval $ac_compile) 2>&5
12161   ac_status=$?
12162   echo "$as_me:12162: \$? = $ac_status" >&5
12163   (exit "$ac_status"); } &&
12164          { ac_try='test -s "conftest.$ac_objext"'
12165   { (eval echo "$as_me:12165: \"$ac_try\"") >&5
12166   (eval $ac_try) 2>&5
12167   ac_status=$?
12168   echo "$as_me:12168: \$? = $ac_status" >&5
12169   (exit "$ac_status"); }; }; then
12170   break
12171 else
12172   echo "$as_me: failed program was:" >&5
12173 cat "conftest.$ac_ext" >&5
12174 fi
12175 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12176                         done
12177                         CFLAGS="$cf_save_CFLAGS"
12178                         CC_SHARED_OPTS=$cf_shared_opts
12179                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12180                 else
12181                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12182                 fi
12183                 ;;
12184         (sysv5uw7*|unix_sv*)
12185                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12186                 if test "$GCC" != yes; then
12187                         CC_SHARED_OPTS='-KPIC'
12188                 fi
12189                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12190                 ;;
12191         (*)
12192                 CC_SHARED_OPTS='unknown'
12193                 MK_SHARED_LIB='echo unknown'
12194                 ;;
12195         esac
12196
12197         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12198         case "$cf_cv_shlib_version" in
12199         (rel|abi)
12200                 case "$MK_SHARED_LIB" in
12201                 (*'-o $@')
12202                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12203                         ;;
12204                 (*)
12205                         { echo "$as_me:12205: WARNING: ignored --with-shlib-version" >&5
12206 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12207                         ;;
12208                 esac
12209                 ;;
12210         esac
12211
12212         if test -n "$cf_try_cflags"
12213         then
12214 cat > conftest.$ac_ext <<EOF
12215 #line 12215 "${as_me:-configure}"
12216 #include <stdio.h>
12217 int main(int argc, char *argv[])
12218 {
12219         printf("hello\\n");
12220         return (argv[argc-1] == 0) ;
12221 }
12222 EOF
12223                 cf_save_CFLAGS="$CFLAGS"
12224                 for cf_opt in $cf_try_cflags
12225                 do
12226                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12227                         echo "$as_me:12227: checking if CFLAGS option -$cf_opt works" >&5
12228 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12229                         if { (eval echo "$as_me:12229: \"$ac_compile\"") >&5
12230   (eval $ac_compile) 2>&5
12231   ac_status=$?
12232   echo "$as_me:12232: \$? = $ac_status" >&5
12233   (exit "$ac_status"); }; then
12234                                 echo "$as_me:12234: result: yes" >&5
12235 echo "${ECHO_T}yes" >&6
12236                                 cf_save_CFLAGS="$CFLAGS"
12237                         else
12238                                 echo "$as_me:12238: result: no" >&5
12239 echo "${ECHO_T}no" >&6
12240                         fi
12241                 done
12242                 CFLAGS="$cf_save_CFLAGS"
12243         fi
12244
12245         # RPATH_LIST is a colon-separated list of directories
12246         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12247         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12248
12249         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12250
12251         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12252
12253 echo "${as_me:-configure}:12253: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12254
12255         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12256
12257 echo "${as_me:-configure}:12257: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12258
12259 # The test/sample programs in the original tree link using rpath option.
12260 # Make it optional for packagers.
12261 if test -n "$LOCAL_LDFLAGS"
12262 then
12263         echo "$as_me:12263: checking if you want to link sample programs with rpath option" >&5
12264 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12265
12266 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12267 if test "${enable_rpath_link+set}" = set; then
12268   enableval="$enable_rpath_link"
12269   with_rpath_link=$enableval
12270 else
12271   with_rpath_link=yes
12272 fi;
12273         echo "$as_me:12273: result: $with_rpath_link" >&5
12274 echo "${ECHO_T}$with_rpath_link" >&6
12275         if test "$with_rpath_link" = no
12276         then
12277                 LOCAL_LDFLAGS=
12278                 LOCAL_LDFLAGS2=
12279         fi
12280 fi
12281
12282 ###############################################################################
12283
12284 ###   use option --enable-broken-linker to force on use of broken-linker support
12285
12286 echo "$as_me:12286: checking if you want broken-linker support code" >&5
12287 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12288
12289 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12290 if test "${enable_broken_linker+set}" = set; then
12291   enableval="$enable_broken_linker"
12292   with_broken_linker=$enableval
12293 else
12294   with_broken_linker=no
12295 fi;
12296 echo "$as_me:12296: result: $with_broken_linker" >&5
12297 echo "${ECHO_T}$with_broken_linker" >&6
12298
12299 : "${BROKEN_LINKER:=0}"
12300 if test "x$with_broken_linker" = xyes ; then
12301
12302 cat >>confdefs.h <<\EOF
12303 #define BROKEN_LINKER 1
12304 EOF
12305
12306         BROKEN_LINKER=1
12307 fi
12308
12309 # Check to define _XOPEN_SOURCE "automatically"
12310
12311 echo "$as_me:12311: checking if the POSIX test-macros are already defined" >&5
12312 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12313 if test "${cf_cv_posix_visible+set}" = set; then
12314   echo $ECHO_N "(cached) $ECHO_C" >&6
12315 else
12316
12317 cat >"conftest.$ac_ext" <<_ACEOF
12318 #line 12318 "configure"
12319 #include "confdefs.h"
12320 #include <stdio.h>
12321 int
12322 main (void)
12323 {
12324
12325 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12326         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12327         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12328         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12329 #error conflicting symbols found
12330 #endif
12331
12332   ;
12333   return 0;
12334 }
12335 _ACEOF
12336 rm -f "conftest.$ac_objext"
12337 if { (eval echo "$as_me:12337: \"$ac_compile\"") >&5
12338   (eval $ac_compile) 2>&5
12339   ac_status=$?
12340   echo "$as_me:12340: \$? = $ac_status" >&5
12341   (exit "$ac_status"); } &&
12342          { ac_try='test -s "conftest.$ac_objext"'
12343   { (eval echo "$as_me:12343: \"$ac_try\"") >&5
12344   (eval $ac_try) 2>&5
12345   ac_status=$?
12346   echo "$as_me:12346: \$? = $ac_status" >&5
12347   (exit "$ac_status"); }; }; then
12348   cf_cv_posix_visible=no
12349 else
12350   echo "$as_me: failed program was:" >&5
12351 cat "conftest.$ac_ext" >&5
12352 cf_cv_posix_visible=yes
12353 fi
12354 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12355
12356 fi
12357 echo "$as_me:12357: result: $cf_cv_posix_visible" >&5
12358 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12359
12360 if test "$cf_cv_posix_visible" = no; then
12361
12362 cf_XOPEN_SOURCE=600
12363 cf_POSIX_C_SOURCE=199506L
12364 cf_xopen_source=
12365
12366 case "$host_os" in
12367 (aix[4-7]*)
12368         cf_xopen_source="-D_ALL_SOURCE"
12369         ;;
12370 (msys)
12371         cf_XOPEN_SOURCE=600
12372         ;;
12373 (darwin[0-8].*)
12374         cf_xopen_source="-D_APPLE_C_SOURCE"
12375         ;;
12376 (darwin*)
12377         cf_xopen_source="-D_DARWIN_C_SOURCE"
12378         cf_XOPEN_SOURCE=
12379         ;;
12380 (freebsd*|dragonfly*|midnightbsd*)
12381         # 5.x headers associate
12382         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12383         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12384         cf_POSIX_C_SOURCE=200112L
12385         cf_XOPEN_SOURCE=600
12386         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12387         ;;
12388 (hpux11*)
12389         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12390         ;;
12391 (hpux*)
12392         cf_xopen_source="-D_HPUX_SOURCE"
12393         ;;
12394 (irix[56].*)
12395         cf_xopen_source="-D_SGI_SOURCE"
12396         cf_XOPEN_SOURCE=
12397         ;;
12398 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12399
12400 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12401
12402 echo "$as_me:12402: checking if this is the GNU C library" >&5
12403 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12404 if test "${cf_cv_gnu_library+set}" = set; then
12405   echo $ECHO_N "(cached) $ECHO_C" >&6
12406 else
12407
12408 cat >"conftest.$ac_ext" <<_ACEOF
12409 #line 12409 "configure"
12410 #include "confdefs.h"
12411 #include <sys/types.h>
12412 int
12413 main (void)
12414 {
12415
12416         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12417                 return 0;
12418         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12419                 return 0;
12420         #else
12421         #       error not GNU C library
12422         #endif
12423   ;
12424   return 0;
12425 }
12426 _ACEOF
12427 rm -f "conftest.$ac_objext"
12428 if { (eval echo "$as_me:12428: \"$ac_compile\"") >&5
12429   (eval $ac_compile) 2>&5
12430   ac_status=$?
12431   echo "$as_me:12431: \$? = $ac_status" >&5
12432   (exit "$ac_status"); } &&
12433          { ac_try='test -s "conftest.$ac_objext"'
12434   { (eval echo "$as_me:12434: \"$ac_try\"") >&5
12435   (eval $ac_try) 2>&5
12436   ac_status=$?
12437   echo "$as_me:12437: \$? = $ac_status" >&5
12438   (exit "$ac_status"); }; }; then
12439   cf_cv_gnu_library=yes
12440 else
12441   echo "$as_me: failed program was:" >&5
12442 cat "conftest.$ac_ext" >&5
12443 cf_cv_gnu_library=no
12444 fi
12445 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12446
12447 fi
12448 echo "$as_me:12448: result: $cf_cv_gnu_library" >&5
12449 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12450
12451 if test x$cf_cv_gnu_library = xyes; then
12452
12453         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12454         # was changed to help a little.  newlib incorporated the change about 4
12455         # years later.
12456         echo "$as_me:12456: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12457 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12458 if test "${cf_cv_gnu_library_219+set}" = set; then
12459   echo $ECHO_N "(cached) $ECHO_C" >&6
12460 else
12461
12462                 cf_save="$CPPFLAGS"
12463
12464         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12465         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12466
12467                 cat >"conftest.$ac_ext" <<_ACEOF
12468 #line 12468 "configure"
12469 #include "confdefs.h"
12470 #include <sys/types.h>
12471 int
12472 main (void)
12473 {
12474
12475                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12476                                 return 0;
12477                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12478                                 return 0;
12479                         #else
12480                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12481                         #endif
12482   ;
12483   return 0;
12484 }
12485 _ACEOF
12486 rm -f "conftest.$ac_objext"
12487 if { (eval echo "$as_me:12487: \"$ac_compile\"") >&5
12488   (eval $ac_compile) 2>&5
12489   ac_status=$?
12490   echo "$as_me:12490: \$? = $ac_status" >&5
12491   (exit "$ac_status"); } &&
12492          { ac_try='test -s "conftest.$ac_objext"'
12493   { (eval echo "$as_me:12493: \"$ac_try\"") >&5
12494   (eval $ac_try) 2>&5
12495   ac_status=$?
12496   echo "$as_me:12496: \$? = $ac_status" >&5
12497   (exit "$ac_status"); }; }; then
12498   cf_cv_gnu_library_219=yes
12499 else
12500   echo "$as_me: failed program was:" >&5
12501 cat "conftest.$ac_ext" >&5
12502 cf_cv_gnu_library_219=no
12503 fi
12504 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12505                 CPPFLAGS="$cf_save"
12506
12507 fi
12508 echo "$as_me:12508: result: $cf_cv_gnu_library_219" >&5
12509 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12510
12511         if test "x$cf_cv_gnu_library_219" = xyes; then
12512                 cf_save="$CPPFLAGS"
12513                 echo "$as_me:12513: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12514 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12515 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12516   echo $ECHO_N "(cached) $ECHO_C" >&6
12517 else
12518
12519 cf_fix_cppflags=no
12520 cf_new_cflags=
12521 cf_new_cppflags=
12522 cf_new_extra_cppflags=
12523
12524 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12525 do
12526 case "$cf_fix_cppflags" in
12527 (no)
12528         case "$cf_add_cflags" in
12529         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12530                 case "$cf_add_cflags" in
12531                 (-D*)
12532                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12533
12534                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12535                                 && test -z "${cf_tst_cflags}" \
12536                                 && cf_fix_cppflags=yes
12537
12538                         if test "$cf_fix_cppflags" = yes ; then
12539
12540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12542
12543                                 continue
12544                         elif test "${cf_tst_cflags}" = "\"'" ; then
12545
12546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12548
12549                                 continue
12550                         fi
12551                         ;;
12552                 esac
12553                 case "$CPPFLAGS" in
12554                 (*$cf_add_cflags)
12555                         ;;
12556                 (*)
12557                         case "$cf_add_cflags" in
12558                         (-D*)
12559                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12560
12561 CPPFLAGS=`echo "$CPPFLAGS" | \
12562         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12563                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12564
12565                                 ;;
12566                         esac
12567
12568         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12569         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12570
12571                         ;;
12572                 esac
12573                 ;;
12574         (*)
12575
12576         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12577         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12578
12579                 ;;
12580         esac
12581         ;;
12582 (yes)
12583
12584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12586
12587         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12588
12589         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12590                 && test -z "${cf_tst_cflags}" \
12591                 && cf_fix_cppflags=no
12592         ;;
12593 esac
12594 done
12595
12596 if test -n "$cf_new_cflags" ; then
12597
12598         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12599         CFLAGS="${CFLAGS}$cf_new_cflags"
12600
12601 fi
12602
12603 if test -n "$cf_new_cppflags" ; then
12604
12605         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12606         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12607
12608 fi
12609
12610 if test -n "$cf_new_extra_cppflags" ; then
12611
12612         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12613         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12614
12615 fi
12616
12617                         cat >"conftest.$ac_ext" <<_ACEOF
12618 #line 12618 "configure"
12619 #include "confdefs.h"
12620
12621                                 #include <limits.h>
12622                                 #include <sys/types.h>
12623
12624 int
12625 main (void)
12626 {
12627
12628                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12629                                         return 0;
12630                                 #else
12631                                 #       error GNU C library is too old
12632                                 #endif
12633   ;
12634   return 0;
12635 }
12636 _ACEOF
12637 rm -f "conftest.$ac_objext"
12638 if { (eval echo "$as_me:12638: \"$ac_compile\"") >&5
12639   (eval $ac_compile) 2>&5
12640   ac_status=$?
12641   echo "$as_me:12641: \$? = $ac_status" >&5
12642   (exit "$ac_status"); } &&
12643          { ac_try='test -s "conftest.$ac_objext"'
12644   { (eval echo "$as_me:12644: \"$ac_try\"") >&5
12645   (eval $ac_try) 2>&5
12646   ac_status=$?
12647   echo "$as_me:12647: \$? = $ac_status" >&5
12648   (exit "$ac_status"); }; }; then
12649   cf_cv_gnu_dftsrc_219=yes
12650 else
12651   echo "$as_me: failed program was:" >&5
12652 cat "conftest.$ac_ext" >&5
12653 cf_cv_gnu_dftsrc_219=no
12654 fi
12655 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12656
12657 fi
12658 echo "$as_me:12658: result: $cf_cv_gnu_dftsrc_219" >&5
12659 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12660                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12661         else
12662                 cf_cv_gnu_dftsrc_219=maybe
12663         fi
12664
12665         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12666
12667                 echo "$as_me:12667: checking if we must define _GNU_SOURCE" >&5
12668 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12669 if test "${cf_cv_gnu_source+set}" = set; then
12670   echo $ECHO_N "(cached) $ECHO_C" >&6
12671 else
12672
12673                 cat >"conftest.$ac_ext" <<_ACEOF
12674 #line 12674 "configure"
12675 #include "confdefs.h"
12676 #include <sys/types.h>
12677 int
12678 main (void)
12679 {
12680
12681                         #ifndef _XOPEN_SOURCE
12682                         #error  expected _XOPEN_SOURCE to be defined
12683                         #endif
12684   ;
12685   return 0;
12686 }
12687 _ACEOF
12688 rm -f "conftest.$ac_objext"
12689 if { (eval echo "$as_me:12689: \"$ac_compile\"") >&5
12690   (eval $ac_compile) 2>&5
12691   ac_status=$?
12692   echo "$as_me:12692: \$? = $ac_status" >&5
12693   (exit "$ac_status"); } &&
12694          { ac_try='test -s "conftest.$ac_objext"'
12695   { (eval echo "$as_me:12695: \"$ac_try\"") >&5
12696   (eval $ac_try) 2>&5
12697   ac_status=$?
12698   echo "$as_me:12698: \$? = $ac_status" >&5
12699   (exit "$ac_status"); }; }; then
12700   cf_cv_gnu_source=no
12701 else
12702   echo "$as_me: failed program was:" >&5
12703 cat "conftest.$ac_ext" >&5
12704 cf_save="$CPPFLAGS"
12705
12706 cf_fix_cppflags=no
12707 cf_new_cflags=
12708 cf_new_cppflags=
12709 cf_new_extra_cppflags=
12710
12711 for cf_add_cflags in -D_GNU_SOURCE
12712 do
12713 case "$cf_fix_cppflags" in
12714 (no)
12715         case "$cf_add_cflags" in
12716         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12717                 case "$cf_add_cflags" in
12718                 (-D*)
12719                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12720
12721                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12722                                 && test -z "${cf_tst_cflags}" \
12723                                 && cf_fix_cppflags=yes
12724
12725                         if test "$cf_fix_cppflags" = yes ; then
12726
12727         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12728         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12729
12730                                 continue
12731                         elif test "${cf_tst_cflags}" = "\"'" ; then
12732
12733         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12734         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12735
12736                                 continue
12737                         fi
12738                         ;;
12739                 esac
12740                 case "$CPPFLAGS" in
12741                 (*$cf_add_cflags)
12742                         ;;
12743                 (*)
12744                         case "$cf_add_cflags" in
12745                         (-D*)
12746                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12747
12748 CPPFLAGS=`echo "$CPPFLAGS" | \
12749         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12750                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12751
12752                                 ;;
12753                         esac
12754
12755         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12756         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12757
12758                         ;;
12759                 esac
12760                 ;;
12761         (*)
12762
12763         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12764         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12765
12766                 ;;
12767         esac
12768         ;;
12769 (yes)
12770
12771         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12772         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12773
12774         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12775
12776         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12777                 && test -z "${cf_tst_cflags}" \
12778                 && cf_fix_cppflags=no
12779         ;;
12780 esac
12781 done
12782
12783 if test -n "$cf_new_cflags" ; then
12784
12785         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12786         CFLAGS="${CFLAGS}$cf_new_cflags"
12787
12788 fi
12789
12790 if test -n "$cf_new_cppflags" ; then
12791
12792         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12793         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12794
12795 fi
12796
12797 if test -n "$cf_new_extra_cppflags" ; then
12798
12799         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12800         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12801
12802 fi
12803
12804                          cat >"conftest.$ac_ext" <<_ACEOF
12805 #line 12805 "configure"
12806 #include "confdefs.h"
12807 #include <sys/types.h>
12808 int
12809 main (void)
12810 {
12811
12812                                 #ifdef _XOPEN_SOURCE
12813                                 #error  expected _XOPEN_SOURCE to be undefined
12814                                 #endif
12815   ;
12816   return 0;
12817 }
12818 _ACEOF
12819 rm -f "conftest.$ac_objext"
12820 if { (eval echo "$as_me:12820: \"$ac_compile\"") >&5
12821   (eval $ac_compile) 2>&5
12822   ac_status=$?
12823   echo "$as_me:12823: \$? = $ac_status" >&5
12824   (exit "$ac_status"); } &&
12825          { ac_try='test -s "conftest.$ac_objext"'
12826   { (eval echo "$as_me:12826: \"$ac_try\"") >&5
12827   (eval $ac_try) 2>&5
12828   ac_status=$?
12829   echo "$as_me:12829: \$? = $ac_status" >&5
12830   (exit "$ac_status"); }; }; then
12831   cf_cv_gnu_source=no
12832 else
12833   echo "$as_me: failed program was:" >&5
12834 cat "conftest.$ac_ext" >&5
12835 cf_cv_gnu_source=yes
12836 fi
12837 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12838                         CPPFLAGS="$cf_save"
12839
12840 fi
12841 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12842
12843 fi
12844 echo "$as_me:12844: result: $cf_cv_gnu_source" >&5
12845 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12846
12847                 if test "$cf_cv_gnu_source" = yes
12848                 then
12849                 echo "$as_me:12849: checking if we should also define _DEFAULT_SOURCE" >&5
12850 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12851 if test "${cf_cv_default_source+set}" = set; then
12852   echo $ECHO_N "(cached) $ECHO_C" >&6
12853 else
12854
12855         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12856         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12857
12858                         cat >"conftest.$ac_ext" <<_ACEOF
12859 #line 12859 "configure"
12860 #include "confdefs.h"
12861 #include <sys/types.h>
12862 int
12863 main (void)
12864 {
12865
12866                                 #ifdef _DEFAULT_SOURCE
12867                                 #error  expected _DEFAULT_SOURCE to be undefined
12868                                 #endif
12869   ;
12870   return 0;
12871 }
12872 _ACEOF
12873 rm -f "conftest.$ac_objext"
12874 if { (eval echo "$as_me:12874: \"$ac_compile\"") >&5
12875   (eval $ac_compile) 2>&5
12876   ac_status=$?
12877   echo "$as_me:12877: \$? = $ac_status" >&5
12878   (exit "$ac_status"); } &&
12879          { ac_try='test -s "conftest.$ac_objext"'
12880   { (eval echo "$as_me:12880: \"$ac_try\"") >&5
12881   (eval $ac_try) 2>&5
12882   ac_status=$?
12883   echo "$as_me:12883: \$? = $ac_status" >&5
12884   (exit "$ac_status"); }; }; then
12885   cf_cv_default_source=no
12886 else
12887   echo "$as_me: failed program was:" >&5
12888 cat "conftest.$ac_ext" >&5
12889 cf_cv_default_source=yes
12890 fi
12891 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12892
12893 fi
12894 echo "$as_me:12894: result: $cf_cv_default_source" >&5
12895 echo "${ECHO_T}$cf_cv_default_source" >&6
12896                         if test "$cf_cv_default_source" = yes
12897                         then
12898
12899         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12900         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12901
12902                         fi
12903                 fi
12904         fi
12905
12906 fi
12907
12908         ;;
12909 (minix*)
12910         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12911         ;;
12912 (mirbsd*)
12913         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12914         cf_XOPEN_SOURCE=
12915
12916 if test "$cf_cv_posix_visible" = no; then
12917
12918 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12919
12920 cf_save_CFLAGS="$CFLAGS"
12921 cf_save_CPPFLAGS="$CPPFLAGS"
12922
12923 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12924         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12925                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12926
12927 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12928         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12929                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12930
12931 echo "$as_me:12931: checking if we should define _POSIX_C_SOURCE" >&5
12932 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12933 if test "${cf_cv_posix_c_source+set}" = set; then
12934   echo $ECHO_N "(cached) $ECHO_C" >&6
12935 else
12936
12937 echo "${as_me:-configure}:12937: testing if the symbol is already defined go no further ..." 1>&5
12938
12939         cat >"conftest.$ac_ext" <<_ACEOF
12940 #line 12940 "configure"
12941 #include "confdefs.h"
12942 #include <sys/types.h>
12943 int
12944 main (void)
12945 {
12946
12947 #ifndef _POSIX_C_SOURCE
12948 make an error
12949 #endif
12950   ;
12951   return 0;
12952 }
12953 _ACEOF
12954 rm -f "conftest.$ac_objext"
12955 if { (eval echo "$as_me:12955: \"$ac_compile\"") >&5
12956   (eval $ac_compile) 2>&5
12957   ac_status=$?
12958   echo "$as_me:12958: \$? = $ac_status" >&5
12959   (exit "$ac_status"); } &&
12960          { ac_try='test -s "conftest.$ac_objext"'
12961   { (eval echo "$as_me:12961: \"$ac_try\"") >&5
12962   (eval $ac_try) 2>&5
12963   ac_status=$?
12964   echo "$as_me:12964: \$? = $ac_status" >&5
12965   (exit "$ac_status"); }; }; then
12966   cf_cv_posix_c_source=no
12967 else
12968   echo "$as_me: failed program was:" >&5
12969 cat "conftest.$ac_ext" >&5
12970 cf_want_posix_source=no
12971          case .$cf_POSIX_C_SOURCE in
12972          (.[12]??*)
12973                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12974                 ;;
12975          (.2)
12976                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12977                 cf_want_posix_source=yes
12978                 ;;
12979          (.*)
12980                 cf_want_posix_source=yes
12981                 ;;
12982          esac
12983          if test "$cf_want_posix_source" = yes ; then
12984                 cat >"conftest.$ac_ext" <<_ACEOF
12985 #line 12985 "configure"
12986 #include "confdefs.h"
12987 #include <sys/types.h>
12988 int
12989 main (void)
12990 {
12991
12992 #ifdef _POSIX_SOURCE
12993 make an error
12994 #endif
12995   ;
12996   return 0;
12997 }
12998 _ACEOF
12999 rm -f "conftest.$ac_objext"
13000 if { (eval echo "$as_me:13000: \"$ac_compile\"") >&5
13001   (eval $ac_compile) 2>&5
13002   ac_status=$?
13003   echo "$as_me:13003: \$? = $ac_status" >&5
13004   (exit "$ac_status"); } &&
13005          { ac_try='test -s "conftest.$ac_objext"'
13006   { (eval echo "$as_me:13006: \"$ac_try\"") >&5
13007   (eval $ac_try) 2>&5
13008   ac_status=$?
13009   echo "$as_me:13009: \$? = $ac_status" >&5
13010   (exit "$ac_status"); }; }; then
13011   :
13012 else
13013   echo "$as_me: failed program was:" >&5
13014 cat "conftest.$ac_ext" >&5
13015 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13016 fi
13017 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13018          fi
13019
13020 echo "${as_me:-configure}:13020: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13021
13022          CFLAGS="$cf_trim_CFLAGS"
13023          CPPFLAGS="$cf_trim_CPPFLAGS"
13024
13025         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13026         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13027
13028 echo "${as_me:-configure}:13028: testing if the second compile does not leave our definition intact error ..." 1>&5
13029
13030          cat >"conftest.$ac_ext" <<_ACEOF
13031 #line 13031 "configure"
13032 #include "confdefs.h"
13033 #include <sys/types.h>
13034 int
13035 main (void)
13036 {
13037
13038 #ifndef _POSIX_C_SOURCE
13039 make an error
13040 #endif
13041   ;
13042   return 0;
13043 }
13044 _ACEOF
13045 rm -f "conftest.$ac_objext"
13046 if { (eval echo "$as_me:13046: \"$ac_compile\"") >&5
13047   (eval $ac_compile) 2>&5
13048   ac_status=$?
13049   echo "$as_me:13049: \$? = $ac_status" >&5
13050   (exit "$ac_status"); } &&
13051          { ac_try='test -s "conftest.$ac_objext"'
13052   { (eval echo "$as_me:13052: \"$ac_try\"") >&5
13053   (eval $ac_try) 2>&5
13054   ac_status=$?
13055   echo "$as_me:13055: \$? = $ac_status" >&5
13056   (exit "$ac_status"); }; }; then
13057   :
13058 else
13059   echo "$as_me: failed program was:" >&5
13060 cat "conftest.$ac_ext" >&5
13061 cf_cv_posix_c_source=no
13062 fi
13063 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13064          CFLAGS="$cf_save_CFLAGS"
13065          CPPFLAGS="$cf_save_CPPFLAGS"
13066
13067 fi
13068 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13069
13070 fi
13071 echo "$as_me:13071: result: $cf_cv_posix_c_source" >&5
13072 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13073
13074 if test "$cf_cv_posix_c_source" != no ; then
13075         CFLAGS="$cf_trim_CFLAGS"
13076         CPPFLAGS="$cf_trim_CPPFLAGS"
13077
13078 cf_fix_cppflags=no
13079 cf_new_cflags=
13080 cf_new_cppflags=
13081 cf_new_extra_cppflags=
13082
13083 for cf_add_cflags in $cf_cv_posix_c_source
13084 do
13085 case "$cf_fix_cppflags" in
13086 (no)
13087         case "$cf_add_cflags" in
13088         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13089                 case "$cf_add_cflags" in
13090                 (-D*)
13091                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13092
13093                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13094                                 && test -z "${cf_tst_cflags}" \
13095                                 && cf_fix_cppflags=yes
13096
13097                         if test "$cf_fix_cppflags" = yes ; then
13098
13099         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13100         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13101
13102                                 continue
13103                         elif test "${cf_tst_cflags}" = "\"'" ; then
13104
13105         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13106         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13107
13108                                 continue
13109                         fi
13110                         ;;
13111                 esac
13112                 case "$CPPFLAGS" in
13113                 (*$cf_add_cflags)
13114                         ;;
13115                 (*)
13116                         case "$cf_add_cflags" in
13117                         (-D*)
13118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13119
13120 CPPFLAGS=`echo "$CPPFLAGS" | \
13121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13123
13124                                 ;;
13125                         esac
13126
13127         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13128         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13129
13130                         ;;
13131                 esac
13132                 ;;
13133         (*)
13134
13135         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13136         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13137
13138                 ;;
13139         esac
13140         ;;
13141 (yes)
13142
13143         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13144         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13145
13146         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13147
13148         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13149                 && test -z "${cf_tst_cflags}" \
13150                 && cf_fix_cppflags=no
13151         ;;
13152 esac
13153 done
13154
13155 if test -n "$cf_new_cflags" ; then
13156
13157         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13158         CFLAGS="${CFLAGS}$cf_new_cflags"
13159
13160 fi
13161
13162 if test -n "$cf_new_cppflags" ; then
13163
13164         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13165         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13166
13167 fi
13168
13169 if test -n "$cf_new_extra_cppflags" ; then
13170
13171         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13172         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13173
13174 fi
13175
13176 fi
13177
13178 fi # cf_cv_posix_visible
13179
13180         ;;
13181 (netbsd*)
13182         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13183         ;;
13184 (openbsd[6-9]*)
13185         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13186         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13187         # Abusing the conformance level is a workaround.
13188         { echo "$as_me:13188: WARNING: this system does not provide usable locale support" >&5
13189 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13190         cf_xopen_source="-D_BSD_SOURCE"
13191         cf_XOPEN_SOURCE=700
13192         ;;
13193 (openbsd[4-5]*)
13194         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13195         cf_xopen_source="-D_BSD_SOURCE"
13196         cf_XOPEN_SOURCE=600
13197         ;;
13198 (openbsd*)
13199         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13200         ;;
13201 (osf[45]*)
13202         cf_xopen_source="-D_OSF_SOURCE"
13203         ;;
13204 (nto-qnx*)
13205         cf_xopen_source="-D_QNX_SOURCE"
13206         ;;
13207 (sco*)
13208         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13209         ;;
13210 (solaris2.*)
13211         cf_xopen_source="-D__EXTENSIONS__"
13212         cf_cv_xopen_source=broken
13213         ;;
13214 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13215         cf_XOPEN_SOURCE=
13216         cf_POSIX_C_SOURCE=
13217         ;;
13218 (*)
13219
13220 echo "$as_me:13220: checking if we should define _XOPEN_SOURCE" >&5
13221 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13222 if test "${cf_cv_xopen_source+set}" = set; then
13223   echo $ECHO_N "(cached) $ECHO_C" >&6
13224 else
13225
13226         cat >"conftest.$ac_ext" <<_ACEOF
13227 #line 13227 "configure"
13228 #include "confdefs.h"
13229
13230 #include <stdlib.h>
13231 #include <string.h>
13232 #include <sys/types.h>
13233
13234 int
13235 main (void)
13236 {
13237
13238 #ifndef _XOPEN_SOURCE
13239 make an error
13240 #endif
13241   ;
13242   return 0;
13243 }
13244 _ACEOF
13245 rm -f "conftest.$ac_objext"
13246 if { (eval echo "$as_me:13246: \"$ac_compile\"") >&5
13247   (eval $ac_compile) 2>&5
13248   ac_status=$?
13249   echo "$as_me:13249: \$? = $ac_status" >&5
13250   (exit "$ac_status"); } &&
13251          { ac_try='test -s "conftest.$ac_objext"'
13252   { (eval echo "$as_me:13252: \"$ac_try\"") >&5
13253   (eval $ac_try) 2>&5
13254   ac_status=$?
13255   echo "$as_me:13255: \$? = $ac_status" >&5
13256   (exit "$ac_status"); }; }; then
13257   cf_cv_xopen_source=no
13258 else
13259   echo "$as_me: failed program was:" >&5
13260 cat "conftest.$ac_ext" >&5
13261 cf_save="$CPPFLAGS"
13262
13263         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13264         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13265
13266          cat >"conftest.$ac_ext" <<_ACEOF
13267 #line 13267 "configure"
13268 #include "confdefs.h"
13269
13270 #include <stdlib.h>
13271 #include <string.h>
13272 #include <sys/types.h>
13273
13274 int
13275 main (void)
13276 {
13277
13278 #ifdef _XOPEN_SOURCE
13279 make an error
13280 #endif
13281   ;
13282   return 0;
13283 }
13284 _ACEOF
13285 rm -f "conftest.$ac_objext"
13286 if { (eval echo "$as_me:13286: \"$ac_compile\"") >&5
13287   (eval $ac_compile) 2>&5
13288   ac_status=$?
13289   echo "$as_me:13289: \$? = $ac_status" >&5
13290   (exit "$ac_status"); } &&
13291          { ac_try='test -s "conftest.$ac_objext"'
13292   { (eval echo "$as_me:13292: \"$ac_try\"") >&5
13293   (eval $ac_try) 2>&5
13294   ac_status=$?
13295   echo "$as_me:13295: \$? = $ac_status" >&5
13296   (exit "$ac_status"); }; }; then
13297   cf_cv_xopen_source=no
13298 else
13299   echo "$as_me: failed program was:" >&5
13300 cat "conftest.$ac_ext" >&5
13301 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13302 fi
13303 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13304         CPPFLAGS="$cf_save"
13305
13306 fi
13307 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13308
13309 fi
13310 echo "$as_me:13310: result: $cf_cv_xopen_source" >&5
13311 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13312
13313 if test "$cf_cv_xopen_source" != no ; then
13314
13315 CFLAGS=`echo "$CFLAGS" | \
13316         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13317                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13318
13319 CPPFLAGS=`echo "$CPPFLAGS" | \
13320         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13321                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13322
13323         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13324
13325 for cf_add_cflags in $cf_temp_xopen_source
13326 do
13327         case "x$cf_add_cflags" in
13328         (x-[DU]*)
13329
13330 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13331 while true
13332 do
13333         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'`
13334         test "$CFLAGS" != "$cf_old_cflag" || break
13335
13336         CFLAGS="$cf_old_cflag"
13337 done
13338
13339 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13340 while true
13341 do
13342         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'`
13343         test "$CPPFLAGS" != "$cf_old_cflag" || break
13344
13345         CPPFLAGS="$cf_old_cflag"
13346 done
13347
13348                 ;;
13349         esac
13350
13351 cf_fix_cppflags=no
13352 cf_new_cflags=
13353 cf_new_cppflags=
13354 cf_new_extra_cppflags=
13355
13356 for cf_add_cflags in $cf_add_cflags
13357 do
13358 case "$cf_fix_cppflags" in
13359 (no)
13360         case "$cf_add_cflags" in
13361         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13362                 case "$cf_add_cflags" in
13363                 (-D*)
13364                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13365
13366                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13367                                 && test -z "${cf_tst_cflags}" \
13368                                 && cf_fix_cppflags=yes
13369
13370                         if test "$cf_fix_cppflags" = yes ; then
13371
13372         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13373         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13374
13375                                 continue
13376                         elif test "${cf_tst_cflags}" = "\"'" ; then
13377
13378         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13379         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13380
13381                                 continue
13382                         fi
13383                         ;;
13384                 esac
13385                 case "$CPPFLAGS" in
13386                 (*$cf_add_cflags)
13387                         ;;
13388                 (*)
13389                         case "$cf_add_cflags" in
13390                         (-D*)
13391                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13392
13393 CPPFLAGS=`echo "$CPPFLAGS" | \
13394         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13395                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13396
13397                                 ;;
13398                         esac
13399
13400         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13401         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13402
13403                         ;;
13404                 esac
13405                 ;;
13406         (*)
13407
13408         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13409         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13410
13411                 ;;
13412         esac
13413         ;;
13414 (yes)
13415
13416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13418
13419         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13420
13421         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13422                 && test -z "${cf_tst_cflags}" \
13423                 && cf_fix_cppflags=no
13424         ;;
13425 esac
13426 done
13427
13428 if test -n "$cf_new_cflags" ; then
13429
13430         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13431         CFLAGS="${CFLAGS}$cf_new_cflags"
13432
13433 fi
13434
13435 if test -n "$cf_new_cppflags" ; then
13436
13437         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13438         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13439
13440 fi
13441
13442 if test -n "$cf_new_extra_cppflags" ; then
13443
13444         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13445         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13446
13447 fi
13448
13449 done
13450
13451 fi
13452
13453 if test "$cf_cv_posix_visible" = no; then
13454
13455 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13456
13457 cf_save_CFLAGS="$CFLAGS"
13458 cf_save_CPPFLAGS="$CPPFLAGS"
13459
13460 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13461         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13462                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13463
13464 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13465         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13466                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13467
13468 echo "$as_me:13468: checking if we should define _POSIX_C_SOURCE" >&5
13469 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13470 if test "${cf_cv_posix_c_source+set}" = set; then
13471   echo $ECHO_N "(cached) $ECHO_C" >&6
13472 else
13473
13474 echo "${as_me:-configure}:13474: testing if the symbol is already defined go no further ..." 1>&5
13475
13476         cat >"conftest.$ac_ext" <<_ACEOF
13477 #line 13477 "configure"
13478 #include "confdefs.h"
13479 #include <sys/types.h>
13480 int
13481 main (void)
13482 {
13483
13484 #ifndef _POSIX_C_SOURCE
13485 make an error
13486 #endif
13487   ;
13488   return 0;
13489 }
13490 _ACEOF
13491 rm -f "conftest.$ac_objext"
13492 if { (eval echo "$as_me:13492: \"$ac_compile\"") >&5
13493   (eval $ac_compile) 2>&5
13494   ac_status=$?
13495   echo "$as_me:13495: \$? = $ac_status" >&5
13496   (exit "$ac_status"); } &&
13497          { ac_try='test -s "conftest.$ac_objext"'
13498   { (eval echo "$as_me:13498: \"$ac_try\"") >&5
13499   (eval $ac_try) 2>&5
13500   ac_status=$?
13501   echo "$as_me:13501: \$? = $ac_status" >&5
13502   (exit "$ac_status"); }; }; then
13503   cf_cv_posix_c_source=no
13504 else
13505   echo "$as_me: failed program was:" >&5
13506 cat "conftest.$ac_ext" >&5
13507 cf_want_posix_source=no
13508          case .$cf_POSIX_C_SOURCE in
13509          (.[12]??*)
13510                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13511                 ;;
13512          (.2)
13513                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13514                 cf_want_posix_source=yes
13515                 ;;
13516          (.*)
13517                 cf_want_posix_source=yes
13518                 ;;
13519          esac
13520          if test "$cf_want_posix_source" = yes ; then
13521                 cat >"conftest.$ac_ext" <<_ACEOF
13522 #line 13522 "configure"
13523 #include "confdefs.h"
13524 #include <sys/types.h>
13525 int
13526 main (void)
13527 {
13528
13529 #ifdef _POSIX_SOURCE
13530 make an error
13531 #endif
13532   ;
13533   return 0;
13534 }
13535 _ACEOF
13536 rm -f "conftest.$ac_objext"
13537 if { (eval echo "$as_me:13537: \"$ac_compile\"") >&5
13538   (eval $ac_compile) 2>&5
13539   ac_status=$?
13540   echo "$as_me:13540: \$? = $ac_status" >&5
13541   (exit "$ac_status"); } &&
13542          { ac_try='test -s "conftest.$ac_objext"'
13543   { (eval echo "$as_me:13543: \"$ac_try\"") >&5
13544   (eval $ac_try) 2>&5
13545   ac_status=$?
13546   echo "$as_me:13546: \$? = $ac_status" >&5
13547   (exit "$ac_status"); }; }; then
13548   :
13549 else
13550   echo "$as_me: failed program was:" >&5
13551 cat "conftest.$ac_ext" >&5
13552 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13553 fi
13554 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13555          fi
13556
13557 echo "${as_me:-configure}:13557: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13558
13559          CFLAGS="$cf_trim_CFLAGS"
13560          CPPFLAGS="$cf_trim_CPPFLAGS"
13561
13562         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13563         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13564
13565 echo "${as_me:-configure}:13565: testing if the second compile does not leave our definition intact error ..." 1>&5
13566
13567          cat >"conftest.$ac_ext" <<_ACEOF
13568 #line 13568 "configure"
13569 #include "confdefs.h"
13570 #include <sys/types.h>
13571 int
13572 main (void)
13573 {
13574
13575 #ifndef _POSIX_C_SOURCE
13576 make an error
13577 #endif
13578   ;
13579   return 0;
13580 }
13581 _ACEOF
13582 rm -f "conftest.$ac_objext"
13583 if { (eval echo "$as_me:13583: \"$ac_compile\"") >&5
13584   (eval $ac_compile) 2>&5
13585   ac_status=$?
13586   echo "$as_me:13586: \$? = $ac_status" >&5
13587   (exit "$ac_status"); } &&
13588          { ac_try='test -s "conftest.$ac_objext"'
13589   { (eval echo "$as_me:13589: \"$ac_try\"") >&5
13590   (eval $ac_try) 2>&5
13591   ac_status=$?
13592   echo "$as_me:13592: \$? = $ac_status" >&5
13593   (exit "$ac_status"); }; }; then
13594   :
13595 else
13596   echo "$as_me: failed program was:" >&5
13597 cat "conftest.$ac_ext" >&5
13598 cf_cv_posix_c_source=no
13599 fi
13600 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13601          CFLAGS="$cf_save_CFLAGS"
13602          CPPFLAGS="$cf_save_CPPFLAGS"
13603
13604 fi
13605 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13606
13607 fi
13608 echo "$as_me:13608: result: $cf_cv_posix_c_source" >&5
13609 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13610
13611 if test "$cf_cv_posix_c_source" != no ; then
13612         CFLAGS="$cf_trim_CFLAGS"
13613         CPPFLAGS="$cf_trim_CPPFLAGS"
13614
13615 cf_fix_cppflags=no
13616 cf_new_cflags=
13617 cf_new_cppflags=
13618 cf_new_extra_cppflags=
13619
13620 for cf_add_cflags in $cf_cv_posix_c_source
13621 do
13622 case "$cf_fix_cppflags" in
13623 (no)
13624         case "$cf_add_cflags" in
13625         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13626                 case "$cf_add_cflags" in
13627                 (-D*)
13628                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13629
13630                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13631                                 && test -z "${cf_tst_cflags}" \
13632                                 && cf_fix_cppflags=yes
13633
13634                         if test "$cf_fix_cppflags" = yes ; then
13635
13636         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13637         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13638
13639                                 continue
13640                         elif test "${cf_tst_cflags}" = "\"'" ; then
13641
13642         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13643         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13644
13645                                 continue
13646                         fi
13647                         ;;
13648                 esac
13649                 case "$CPPFLAGS" in
13650                 (*$cf_add_cflags)
13651                         ;;
13652                 (*)
13653                         case "$cf_add_cflags" in
13654                         (-D*)
13655                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13656
13657 CPPFLAGS=`echo "$CPPFLAGS" | \
13658         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13659                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13660
13661                                 ;;
13662                         esac
13663
13664         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13665         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13666
13667                         ;;
13668                 esac
13669                 ;;
13670         (*)
13671
13672         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13673         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13674
13675                 ;;
13676         esac
13677         ;;
13678 (yes)
13679
13680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13682
13683         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13684
13685         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13686                 && test -z "${cf_tst_cflags}" \
13687                 && cf_fix_cppflags=no
13688         ;;
13689 esac
13690 done
13691
13692 if test -n "$cf_new_cflags" ; then
13693
13694         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13695         CFLAGS="${CFLAGS}$cf_new_cflags"
13696
13697 fi
13698
13699 if test -n "$cf_new_cppflags" ; then
13700
13701         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13702         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13703
13704 fi
13705
13706 if test -n "$cf_new_extra_cppflags" ; then
13707
13708         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13709         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13710
13711 fi
13712
13713 fi
13714
13715 fi # cf_cv_posix_visible
13716
13717         ;;
13718 esac
13719
13720 if test -n "$cf_xopen_source" ; then
13721
13722 for cf_add_cflags in $cf_xopen_source
13723 do
13724         case "x$cf_add_cflags" in
13725         (x-[DU]*)
13726
13727 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13728 while true
13729 do
13730         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'`
13731         test "$CFLAGS" != "$cf_old_cflag" || break
13732         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13733
13734 echo "${as_me:-configure}:13734: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13735
13736         CFLAGS="$cf_old_cflag"
13737 done
13738
13739 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13740 while true
13741 do
13742         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'`
13743         test "$CPPFLAGS" != "$cf_old_cflag" || break
13744         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13745
13746 echo "${as_me:-configure}:13746: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13747
13748         CPPFLAGS="$cf_old_cflag"
13749 done
13750
13751                 ;;
13752         esac
13753
13754 cf_fix_cppflags=no
13755 cf_new_cflags=
13756 cf_new_cppflags=
13757 cf_new_extra_cppflags=
13758
13759 for cf_add_cflags in $cf_add_cflags
13760 do
13761 case "$cf_fix_cppflags" in
13762 (no)
13763         case "$cf_add_cflags" in
13764         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13765                 case "$cf_add_cflags" in
13766                 (-D*)
13767                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13768
13769                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13770                                 && test -z "${cf_tst_cflags}" \
13771                                 && cf_fix_cppflags=yes
13772
13773                         if test "$cf_fix_cppflags" = yes ; then
13774
13775         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13776         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13777
13778                                 continue
13779                         elif test "${cf_tst_cflags}" = "\"'" ; then
13780
13781         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13782         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13783
13784                                 continue
13785                         fi
13786                         ;;
13787                 esac
13788                 case "$CPPFLAGS" in
13789                 (*$cf_add_cflags)
13790                         ;;
13791                 (*)
13792                         case "$cf_add_cflags" in
13793                         (-D*)
13794                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13795
13796 CPPFLAGS=`echo "$CPPFLAGS" | \
13797         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13798                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13799
13800                                 ;;
13801                         esac
13802
13803         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13804         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13805
13806                         ;;
13807                 esac
13808                 ;;
13809         (*)
13810
13811         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13812         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13813
13814                 ;;
13815         esac
13816         ;;
13817 (yes)
13818
13819         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13820         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13821
13822         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13823
13824         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13825                 && test -z "${cf_tst_cflags}" \
13826                 && cf_fix_cppflags=no
13827         ;;
13828 esac
13829 done
13830
13831 if test -n "$cf_new_cflags" ; then
13832         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13833
13834 echo "${as_me:-configure}:13834: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13835
13836         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13837         CFLAGS="${CFLAGS}$cf_new_cflags"
13838
13839 fi
13840
13841 if test -n "$cf_new_cppflags" ; then
13842         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13843
13844 echo "${as_me:-configure}:13844: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13845
13846         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13847         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13848
13849 fi
13850
13851 if test -n "$cf_new_extra_cppflags" ; then
13852         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13853
13854 echo "${as_me:-configure}:13854: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13855
13856         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13857         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13858
13859 fi
13860
13861 done
13862
13863 fi
13864
13865 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13866         echo "$as_me:13866: checking if _XOPEN_SOURCE really is set" >&5
13867 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13868         cat >"conftest.$ac_ext" <<_ACEOF
13869 #line 13869 "configure"
13870 #include "confdefs.h"
13871 #include <stdlib.h>
13872 int
13873 main (void)
13874 {
13875
13876 #ifndef _XOPEN_SOURCE
13877 make an error
13878 #endif
13879   ;
13880   return 0;
13881 }
13882 _ACEOF
13883 rm -f "conftest.$ac_objext"
13884 if { (eval echo "$as_me:13884: \"$ac_compile\"") >&5
13885   (eval $ac_compile) 2>&5
13886   ac_status=$?
13887   echo "$as_me:13887: \$? = $ac_status" >&5
13888   (exit "$ac_status"); } &&
13889          { ac_try='test -s "conftest.$ac_objext"'
13890   { (eval echo "$as_me:13890: \"$ac_try\"") >&5
13891   (eval $ac_try) 2>&5
13892   ac_status=$?
13893   echo "$as_me:13893: \$? = $ac_status" >&5
13894   (exit "$ac_status"); }; }; then
13895   cf_XOPEN_SOURCE_set=yes
13896 else
13897   echo "$as_me: failed program was:" >&5
13898 cat "conftest.$ac_ext" >&5
13899 cf_XOPEN_SOURCE_set=no
13900 fi
13901 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13902         echo "$as_me:13902: result: $cf_XOPEN_SOURCE_set" >&5
13903 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13904         if test "$cf_XOPEN_SOURCE_set" = yes
13905         then
13906                 cat >"conftest.$ac_ext" <<_ACEOF
13907 #line 13907 "configure"
13908 #include "confdefs.h"
13909 #include <stdlib.h>
13910 int
13911 main (void)
13912 {
13913
13914 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13915 make an error
13916 #endif
13917   ;
13918   return 0;
13919 }
13920 _ACEOF
13921 rm -f "conftest.$ac_objext"
13922 if { (eval echo "$as_me:13922: \"$ac_compile\"") >&5
13923   (eval $ac_compile) 2>&5
13924   ac_status=$?
13925   echo "$as_me:13925: \$? = $ac_status" >&5
13926   (exit "$ac_status"); } &&
13927          { ac_try='test -s "conftest.$ac_objext"'
13928   { (eval echo "$as_me:13928: \"$ac_try\"") >&5
13929   (eval $ac_try) 2>&5
13930   ac_status=$?
13931   echo "$as_me:13931: \$? = $ac_status" >&5
13932   (exit "$ac_status"); }; }; then
13933   cf_XOPEN_SOURCE_set_ok=yes
13934 else
13935   echo "$as_me: failed program was:" >&5
13936 cat "conftest.$ac_ext" >&5
13937 cf_XOPEN_SOURCE_set_ok=no
13938 fi
13939 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13940                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13941                 then
13942                         { echo "$as_me:13942: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13943 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13944                 fi
13945         else
13946
13947 echo "$as_me:13947: checking if we should define _XOPEN_SOURCE" >&5
13948 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13949 if test "${cf_cv_xopen_source+set}" = set; then
13950   echo $ECHO_N "(cached) $ECHO_C" >&6
13951 else
13952
13953         cat >"conftest.$ac_ext" <<_ACEOF
13954 #line 13954 "configure"
13955 #include "confdefs.h"
13956
13957 #include <stdlib.h>
13958 #include <string.h>
13959 #include <sys/types.h>
13960
13961 int
13962 main (void)
13963 {
13964
13965 #ifndef _XOPEN_SOURCE
13966 make an error
13967 #endif
13968   ;
13969   return 0;
13970 }
13971 _ACEOF
13972 rm -f "conftest.$ac_objext"
13973 if { (eval echo "$as_me:13973: \"$ac_compile\"") >&5
13974   (eval $ac_compile) 2>&5
13975   ac_status=$?
13976   echo "$as_me:13976: \$? = $ac_status" >&5
13977   (exit "$ac_status"); } &&
13978          { ac_try='test -s "conftest.$ac_objext"'
13979   { (eval echo "$as_me:13979: \"$ac_try\"") >&5
13980   (eval $ac_try) 2>&5
13981   ac_status=$?
13982   echo "$as_me:13982: \$? = $ac_status" >&5
13983   (exit "$ac_status"); }; }; then
13984   cf_cv_xopen_source=no
13985 else
13986   echo "$as_me: failed program was:" >&5
13987 cat "conftest.$ac_ext" >&5
13988 cf_save="$CPPFLAGS"
13989
13990         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13991         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13992
13993          cat >"conftest.$ac_ext" <<_ACEOF
13994 #line 13994 "configure"
13995 #include "confdefs.h"
13996
13997 #include <stdlib.h>
13998 #include <string.h>
13999 #include <sys/types.h>
14000
14001 int
14002 main (void)
14003 {
14004
14005 #ifdef _XOPEN_SOURCE
14006 make an error
14007 #endif
14008   ;
14009   return 0;
14010 }
14011 _ACEOF
14012 rm -f "conftest.$ac_objext"
14013 if { (eval echo "$as_me:14013: \"$ac_compile\"") >&5
14014   (eval $ac_compile) 2>&5
14015   ac_status=$?
14016   echo "$as_me:14016: \$? = $ac_status" >&5
14017   (exit "$ac_status"); } &&
14018          { ac_try='test -s "conftest.$ac_objext"'
14019   { (eval echo "$as_me:14019: \"$ac_try\"") >&5
14020   (eval $ac_try) 2>&5
14021   ac_status=$?
14022   echo "$as_me:14022: \$? = $ac_status" >&5
14023   (exit "$ac_status"); }; }; then
14024   cf_cv_xopen_source=no
14025 else
14026   echo "$as_me: failed program was:" >&5
14027 cat "conftest.$ac_ext" >&5
14028 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14029 fi
14030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14031         CPPFLAGS="$cf_save"
14032
14033 fi
14034 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14035
14036 fi
14037 echo "$as_me:14037: result: $cf_cv_xopen_source" >&5
14038 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14039
14040 if test "$cf_cv_xopen_source" != no ; then
14041
14042 CFLAGS=`echo "$CFLAGS" | \
14043         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14044                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14045
14046 CPPFLAGS=`echo "$CPPFLAGS" | \
14047         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14048                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14049
14050         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14051
14052 for cf_add_cflags in $cf_temp_xopen_source
14053 do
14054         case "x$cf_add_cflags" in
14055         (x-[DU]*)
14056
14057 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14058 while true
14059 do
14060         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'`
14061         test "$CFLAGS" != "$cf_old_cflag" || break
14062
14063         CFLAGS="$cf_old_cflag"
14064 done
14065
14066 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14067 while true
14068 do
14069         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'`
14070         test "$CPPFLAGS" != "$cf_old_cflag" || break
14071
14072         CPPFLAGS="$cf_old_cflag"
14073 done
14074
14075                 ;;
14076         esac
14077
14078 cf_fix_cppflags=no
14079 cf_new_cflags=
14080 cf_new_cppflags=
14081 cf_new_extra_cppflags=
14082
14083 for cf_add_cflags in $cf_add_cflags
14084 do
14085 case "$cf_fix_cppflags" in
14086 (no)
14087         case "$cf_add_cflags" in
14088         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14089                 case "$cf_add_cflags" in
14090                 (-D*)
14091                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14092
14093                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14094                                 && test -z "${cf_tst_cflags}" \
14095                                 && cf_fix_cppflags=yes
14096
14097                         if test "$cf_fix_cppflags" = yes ; then
14098
14099         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14100         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14101
14102                                 continue
14103                         elif test "${cf_tst_cflags}" = "\"'" ; then
14104
14105         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14106         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14107
14108                                 continue
14109                         fi
14110                         ;;
14111                 esac
14112                 case "$CPPFLAGS" in
14113                 (*$cf_add_cflags)
14114                         ;;
14115                 (*)
14116                         case "$cf_add_cflags" in
14117                         (-D*)
14118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14119
14120 CPPFLAGS=`echo "$CPPFLAGS" | \
14121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14123
14124                                 ;;
14125                         esac
14126
14127         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14128         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14129
14130                         ;;
14131                 esac
14132                 ;;
14133         (*)
14134
14135         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14136         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14137
14138                 ;;
14139         esac
14140         ;;
14141 (yes)
14142
14143         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14144         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14145
14146         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14147
14148         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14149                 && test -z "${cf_tst_cflags}" \
14150                 && cf_fix_cppflags=no
14151         ;;
14152 esac
14153 done
14154
14155 if test -n "$cf_new_cflags" ; then
14156
14157         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14158         CFLAGS="${CFLAGS}$cf_new_cflags"
14159
14160 fi
14161
14162 if test -n "$cf_new_cppflags" ; then
14163
14164         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14165         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14166
14167 fi
14168
14169 if test -n "$cf_new_extra_cppflags" ; then
14170
14171         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14172         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14173
14174 fi
14175
14176 done
14177
14178 fi
14179
14180         fi
14181 fi
14182 fi # cf_cv_posix_visible
14183
14184 # Check whether --enable-largefile or --disable-largefile was given.
14185 if test "${enable_largefile+set}" = set; then
14186   enableval="$enable_largefile"
14187
14188 fi;
14189 if test "$enable_largefile" != no; then
14190
14191   echo "$as_me:14191: checking for special C compiler options needed for large files" >&5
14192 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14193 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14194   echo $ECHO_N "(cached) $ECHO_C" >&6
14195 else
14196   ac_cv_sys_largefile_CC=no
14197      if test "$GCC" != yes; then
14198        ac_save_CC=$CC
14199        while :; do
14200          # IRIX 6.2 and later do not support large files by default,
14201          # so use the C compiler's -n32 option if that helps.
14202          cat >"conftest.$ac_ext" <<_ACEOF
14203 #line 14203 "configure"
14204 #include "confdefs.h"
14205 #include <sys/types.h>
14206  /* Check that off_t can represent 2**63 - 1 correctly.
14207     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14208     since some C++ compilers masquerading as C compilers
14209     incorrectly reject 9223372036854775807.  */
14210 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14211   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14212                        && LARGE_OFF_T % 2147483647 == 1)
14213                       ? 1 : -1];
14214 int
14215 main (void)
14216 {
14217
14218   ;
14219   return 0;
14220 }
14221 _ACEOF
14222          rm -f "conftest.$ac_objext"
14223 if { (eval echo "$as_me:14223: \"$ac_compile\"") >&5
14224   (eval $ac_compile) 2>&5
14225   ac_status=$?
14226   echo "$as_me:14226: \$? = $ac_status" >&5
14227   (exit "$ac_status"); } &&
14228          { ac_try='test -s "conftest.$ac_objext"'
14229   { (eval echo "$as_me:14229: \"$ac_try\"") >&5
14230   (eval $ac_try) 2>&5
14231   ac_status=$?
14232   echo "$as_me:14232: \$? = $ac_status" >&5
14233   (exit "$ac_status"); }; }; then
14234   break
14235 else
14236   echo "$as_me: failed program was:" >&5
14237 cat "conftest.$ac_ext" >&5
14238 fi
14239 rm -f "conftest.$ac_objext"
14240          CC="$CC -n32"
14241          rm -f "conftest.$ac_objext"
14242 if { (eval echo "$as_me:14242: \"$ac_compile\"") >&5
14243   (eval $ac_compile) 2>&5
14244   ac_status=$?
14245   echo "$as_me:14245: \$? = $ac_status" >&5
14246   (exit "$ac_status"); } &&
14247          { ac_try='test -s "conftest.$ac_objext"'
14248   { (eval echo "$as_me:14248: \"$ac_try\"") >&5
14249   (eval $ac_try) 2>&5
14250   ac_status=$?
14251   echo "$as_me:14251: \$? = $ac_status" >&5
14252   (exit "$ac_status"); }; }; then
14253   ac_cv_sys_largefile_CC=' -n32'; break
14254 else
14255   echo "$as_me: failed program was:" >&5
14256 cat "conftest.$ac_ext" >&5
14257 fi
14258 rm -f "conftest.$ac_objext"
14259          break
14260        done
14261        CC=$ac_save_CC
14262        rm -f "conftest.$ac_ext"
14263     fi
14264 fi
14265 echo "$as_me:14265: result: $ac_cv_sys_largefile_CC" >&5
14266 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14267   if test "$ac_cv_sys_largefile_CC" != no; then
14268     CC=$CC$ac_cv_sys_largefile_CC
14269   fi
14270
14271   echo "$as_me:14271: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14272 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14273 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14274   echo $ECHO_N "(cached) $ECHO_C" >&6
14275 else
14276   while :; do
14277   ac_cv_sys_file_offset_bits=no
14278   cat >"conftest.$ac_ext" <<_ACEOF
14279 #line 14279 "configure"
14280 #include "confdefs.h"
14281 #include <sys/types.h>
14282  /* Check that off_t can represent 2**63 - 1 correctly.
14283     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14284     since some C++ compilers masquerading as C compilers
14285     incorrectly reject 9223372036854775807.  */
14286 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14287   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14288                        && LARGE_OFF_T % 2147483647 == 1)
14289                       ? 1 : -1];
14290 int
14291 main (void)
14292 {
14293
14294   ;
14295   return 0;
14296 }
14297 _ACEOF
14298 rm -f "conftest.$ac_objext"
14299 if { (eval echo "$as_me:14299: \"$ac_compile\"") >&5
14300   (eval $ac_compile) 2>&5
14301   ac_status=$?
14302   echo "$as_me:14302: \$? = $ac_status" >&5
14303   (exit "$ac_status"); } &&
14304          { ac_try='test -s "conftest.$ac_objext"'
14305   { (eval echo "$as_me:14305: \"$ac_try\"") >&5
14306   (eval $ac_try) 2>&5
14307   ac_status=$?
14308   echo "$as_me:14308: \$? = $ac_status" >&5
14309   (exit "$ac_status"); }; }; then
14310   break
14311 else
14312   echo "$as_me: failed program was:" >&5
14313 cat "conftest.$ac_ext" >&5
14314 fi
14315 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14316   cat >"conftest.$ac_ext" <<_ACEOF
14317 #line 14317 "configure"
14318 #include "confdefs.h"
14319 #define _FILE_OFFSET_BITS 64
14320 #include <sys/types.h>
14321  /* Check that off_t can represent 2**63 - 1 correctly.
14322     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14323     since some C++ compilers masquerading as C compilers
14324     incorrectly reject 9223372036854775807.  */
14325 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14326   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14327                        && LARGE_OFF_T % 2147483647 == 1)
14328                       ? 1 : -1];
14329 int
14330 main (void)
14331 {
14332
14333   ;
14334   return 0;
14335 }
14336 _ACEOF
14337 rm -f "conftest.$ac_objext"
14338 if { (eval echo "$as_me:14338: \"$ac_compile\"") >&5
14339   (eval $ac_compile) 2>&5
14340   ac_status=$?
14341   echo "$as_me:14341: \$? = $ac_status" >&5
14342   (exit "$ac_status"); } &&
14343          { ac_try='test -s "conftest.$ac_objext"'
14344   { (eval echo "$as_me:14344: \"$ac_try\"") >&5
14345   (eval $ac_try) 2>&5
14346   ac_status=$?
14347   echo "$as_me:14347: \$? = $ac_status" >&5
14348   (exit "$ac_status"); }; }; then
14349   ac_cv_sys_file_offset_bits=64; break
14350 else
14351   echo "$as_me: failed program was:" >&5
14352 cat "conftest.$ac_ext" >&5
14353 fi
14354 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14355   break
14356 done
14357 fi
14358 echo "$as_me:14358: result: $ac_cv_sys_file_offset_bits" >&5
14359 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14360 if test "$ac_cv_sys_file_offset_bits" != no; then
14361
14362 cat >>confdefs.h <<EOF
14363 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14364 EOF
14365
14366 fi
14367 rm -rf conftest*
14368   echo "$as_me:14368: checking for _LARGE_FILES value needed for large files" >&5
14369 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14370 if test "${ac_cv_sys_large_files+set}" = set; then
14371   echo $ECHO_N "(cached) $ECHO_C" >&6
14372 else
14373   while :; do
14374   ac_cv_sys_large_files=no
14375   cat >"conftest.$ac_ext" <<_ACEOF
14376 #line 14376 "configure"
14377 #include "confdefs.h"
14378 #include <sys/types.h>
14379  /* Check that off_t can represent 2**63 - 1 correctly.
14380     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14381     since some C++ compilers masquerading as C compilers
14382     incorrectly reject 9223372036854775807.  */
14383 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14384   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14385                        && LARGE_OFF_T % 2147483647 == 1)
14386                       ? 1 : -1];
14387 int
14388 main (void)
14389 {
14390
14391   ;
14392   return 0;
14393 }
14394 _ACEOF
14395 rm -f "conftest.$ac_objext"
14396 if { (eval echo "$as_me:14396: \"$ac_compile\"") >&5
14397   (eval $ac_compile) 2>&5
14398   ac_status=$?
14399   echo "$as_me:14399: \$? = $ac_status" >&5
14400   (exit "$ac_status"); } &&
14401          { ac_try='test -s "conftest.$ac_objext"'
14402   { (eval echo "$as_me:14402: \"$ac_try\"") >&5
14403   (eval $ac_try) 2>&5
14404   ac_status=$?
14405   echo "$as_me:14405: \$? = $ac_status" >&5
14406   (exit "$ac_status"); }; }; then
14407   break
14408 else
14409   echo "$as_me: failed program was:" >&5
14410 cat "conftest.$ac_ext" >&5
14411 fi
14412 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14413   cat >"conftest.$ac_ext" <<_ACEOF
14414 #line 14414 "configure"
14415 #include "confdefs.h"
14416 #define _LARGE_FILES 1
14417 #include <sys/types.h>
14418  /* Check that off_t can represent 2**63 - 1 correctly.
14419     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14420     since some C++ compilers masquerading as C compilers
14421     incorrectly reject 9223372036854775807.  */
14422 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14423   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14424                        && LARGE_OFF_T % 2147483647 == 1)
14425                       ? 1 : -1];
14426 int
14427 main (void)
14428 {
14429
14430   ;
14431   return 0;
14432 }
14433 _ACEOF
14434 rm -f "conftest.$ac_objext"
14435 if { (eval echo "$as_me:14435: \"$ac_compile\"") >&5
14436   (eval $ac_compile) 2>&5
14437   ac_status=$?
14438   echo "$as_me:14438: \$? = $ac_status" >&5
14439   (exit "$ac_status"); } &&
14440          { ac_try='test -s "conftest.$ac_objext"'
14441   { (eval echo "$as_me:14441: \"$ac_try\"") >&5
14442   (eval $ac_try) 2>&5
14443   ac_status=$?
14444   echo "$as_me:14444: \$? = $ac_status" >&5
14445   (exit "$ac_status"); }; }; then
14446   ac_cv_sys_large_files=1; break
14447 else
14448   echo "$as_me: failed program was:" >&5
14449 cat "conftest.$ac_ext" >&5
14450 fi
14451 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14452   break
14453 done
14454 fi
14455 echo "$as_me:14455: result: $ac_cv_sys_large_files" >&5
14456 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14457 if test "$ac_cv_sys_large_files" != no; then
14458
14459 cat >>confdefs.h <<EOF
14460 #define _LARGE_FILES $ac_cv_sys_large_files
14461 EOF
14462
14463 fi
14464 rm -rf conftest*
14465 fi
14466
14467         if test "$enable_largefile" != no ; then
14468         echo "$as_me:14468: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14469 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14470 if test "${ac_cv_sys_largefile_source+set}" = set; then
14471   echo $ECHO_N "(cached) $ECHO_C" >&6
14472 else
14473   while :; do
14474   ac_cv_sys_largefile_source=no
14475   cat >"conftest.$ac_ext" <<_ACEOF
14476 #line 14476 "configure"
14477 #include "confdefs.h"
14478 #include <stdio.h>
14479 int
14480 main (void)
14481 {
14482 return !fseeko;
14483   ;
14484   return 0;
14485 }
14486 _ACEOF
14487 rm -f "conftest.$ac_objext"
14488 if { (eval echo "$as_me:14488: \"$ac_compile\"") >&5
14489   (eval $ac_compile) 2>&5
14490   ac_status=$?
14491   echo "$as_me:14491: \$? = $ac_status" >&5
14492   (exit "$ac_status"); } &&
14493          { ac_try='test -s "conftest.$ac_objext"'
14494   { (eval echo "$as_me:14494: \"$ac_try\"") >&5
14495   (eval $ac_try) 2>&5
14496   ac_status=$?
14497   echo "$as_me:14497: \$? = $ac_status" >&5
14498   (exit "$ac_status"); }; }; then
14499   break
14500 else
14501   echo "$as_me: failed program was:" >&5
14502 cat "conftest.$ac_ext" >&5
14503 fi
14504 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14505   cat >"conftest.$ac_ext" <<_ACEOF
14506 #line 14506 "configure"
14507 #include "confdefs.h"
14508 #define _LARGEFILE_SOURCE 1
14509 #include <stdio.h>
14510 int
14511 main (void)
14512 {
14513 return !fseeko;
14514   ;
14515   return 0;
14516 }
14517 _ACEOF
14518 rm -f "conftest.$ac_objext"
14519 if { (eval echo "$as_me:14519: \"$ac_compile\"") >&5
14520   (eval $ac_compile) 2>&5
14521   ac_status=$?
14522   echo "$as_me:14522: \$? = $ac_status" >&5
14523   (exit "$ac_status"); } &&
14524          { ac_try='test -s "conftest.$ac_objext"'
14525   { (eval echo "$as_me:14525: \"$ac_try\"") >&5
14526   (eval $ac_try) 2>&5
14527   ac_status=$?
14528   echo "$as_me:14528: \$? = $ac_status" >&5
14529   (exit "$ac_status"); }; }; then
14530   ac_cv_sys_largefile_source=1; break
14531 else
14532   echo "$as_me: failed program was:" >&5
14533 cat "conftest.$ac_ext" >&5
14534 fi
14535 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14536   break
14537 done
14538 fi
14539 echo "$as_me:14539: result: $ac_cv_sys_largefile_source" >&5
14540 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14541 if test "$ac_cv_sys_largefile_source" != no; then
14542
14543 cat >>confdefs.h <<EOF
14544 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14545 EOF
14546
14547 fi
14548 rm -rf conftest*
14549
14550 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14551 # in glibc 2.1.3, but that breaks too many other things.
14552 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14553 echo "$as_me:14553: checking for fseeko" >&5
14554 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14555 if test "${ac_cv_func_fseeko+set}" = set; then
14556   echo $ECHO_N "(cached) $ECHO_C" >&6
14557 else
14558   cat >"conftest.$ac_ext" <<_ACEOF
14559 #line 14559 "configure"
14560 #include "confdefs.h"
14561 #include <stdio.h>
14562 int
14563 main (void)
14564 {
14565 return fseeko && fseeko (stdin, 0, 0);
14566   ;
14567   return 0;
14568 }
14569 _ACEOF
14570 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14571 if { (eval echo "$as_me:14571: \"$ac_link\"") >&5
14572   (eval $ac_link) 2>&5
14573   ac_status=$?
14574   echo "$as_me:14574: \$? = $ac_status" >&5
14575   (exit "$ac_status"); } &&
14576          { ac_try='test -s "conftest$ac_exeext"'
14577   { (eval echo "$as_me:14577: \"$ac_try\"") >&5
14578   (eval $ac_try) 2>&5
14579   ac_status=$?
14580   echo "$as_me:14580: \$? = $ac_status" >&5
14581   (exit "$ac_status"); }; }; then
14582   ac_cv_func_fseeko=yes
14583 else
14584   echo "$as_me: failed program was:" >&5
14585 cat "conftest.$ac_ext" >&5
14586 ac_cv_func_fseeko=no
14587 fi
14588 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14589 fi
14590 echo "$as_me:14590: result: $ac_cv_func_fseeko" >&5
14591 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14592 if test $ac_cv_func_fseeko = yes; then
14593
14594 cat >>confdefs.h <<\EOF
14595 #define HAVE_FSEEKO 1
14596 EOF
14597
14598 fi
14599
14600         # Normally we would collect these definitions in the config.h,
14601         # but (like _XOPEN_SOURCE), some environments rely on having these
14602         # defined before any of the system headers are included.  Another
14603         # case comes up with C++, e.g., on AIX the compiler compiles the
14604         # header files by themselves before looking at the body files it is
14605         # told to compile.  For ncurses, those header files do not include
14606         # the config.h
14607         if test "$ac_cv_sys_large_files" != no
14608         then
14609
14610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14611         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14612
14613         fi
14614         if test "$ac_cv_sys_largefile_source" != no
14615         then
14616
14617         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14618         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14619
14620         fi
14621         if test "$ac_cv_sys_file_offset_bits" != no
14622         then
14623
14624         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14625         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14626
14627         fi
14628
14629         echo "$as_me:14629: checking whether to use struct dirent64" >&5
14630 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14631 if test "${cf_cv_struct_dirent64+set}" = set; then
14632   echo $ECHO_N "(cached) $ECHO_C" >&6
14633 else
14634
14635                 cat >"conftest.$ac_ext" <<_ACEOF
14636 #line 14636 "configure"
14637 #include "confdefs.h"
14638
14639 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14640 #include <sys/types.h>
14641 #include <dirent.h>
14642
14643 int
14644 main (void)
14645 {
14646
14647                 /* if transitional largefile support is setup, this is true */
14648                 extern struct dirent64 * readdir(DIR *);
14649                 struct dirent64 *x = readdir((DIR *)0);
14650                 struct dirent *y = readdir((DIR *)0);
14651                 int z = x - y;
14652                 (void)z;
14653
14654   ;
14655   return 0;
14656 }
14657 _ACEOF
14658 rm -f "conftest.$ac_objext"
14659 if { (eval echo "$as_me:14659: \"$ac_compile\"") >&5
14660   (eval $ac_compile) 2>&5
14661   ac_status=$?
14662   echo "$as_me:14662: \$? = $ac_status" >&5
14663   (exit "$ac_status"); } &&
14664          { ac_try='test -s "conftest.$ac_objext"'
14665   { (eval echo "$as_me:14665: \"$ac_try\"") >&5
14666   (eval $ac_try) 2>&5
14667   ac_status=$?
14668   echo "$as_me:14668: \$? = $ac_status" >&5
14669   (exit "$ac_status"); }; }; then
14670   cf_cv_struct_dirent64=yes
14671 else
14672   echo "$as_me: failed program was:" >&5
14673 cat "conftest.$ac_ext" >&5
14674 cf_cv_struct_dirent64=no
14675 fi
14676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14677
14678 fi
14679 echo "$as_me:14679: result: $cf_cv_struct_dirent64" >&5
14680 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14681         test "$cf_cv_struct_dirent64" = yes &&
14682 cat >>confdefs.h <<\EOF
14683 #define HAVE_STRUCT_DIRENT64 1
14684 EOF
14685
14686         fi
14687
14688 ### Enable compiling-in rcs id's
14689 echo "$as_me:14689: checking if RCS identifiers should be compiled-in" >&5
14690 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14691
14692 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14693 if test "${with_rcs_ids+set}" = set; then
14694   withval="$with_rcs_ids"
14695   with_rcs_ids=$withval
14696 else
14697   with_rcs_ids=no
14698 fi;
14699 echo "$as_me:14699: result: $with_rcs_ids" >&5
14700 echo "${ECHO_T}$with_rcs_ids" >&6
14701 test "$with_rcs_ids" = yes &&
14702 cat >>confdefs.h <<\EOF
14703 #define USE_RCS_IDS 1
14704 EOF
14705
14706 ###############################################################################
14707
14708 ### Note that some functions (such as const) are normally disabled anyway.
14709 echo "$as_me:14709: checking if you want to build with function extensions" >&5
14710 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14711
14712 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14713 if test "${enable_ext_funcs+set}" = set; then
14714   enableval="$enable_ext_funcs"
14715   with_ext_funcs=$enableval
14716 else
14717   with_ext_funcs=yes
14718 fi;
14719 echo "$as_me:14719: result: $with_ext_funcs" >&5
14720 echo "${ECHO_T}$with_ext_funcs" >&6
14721 if test "$with_ext_funcs" = yes ; then
14722         NCURSES_EXT_FUNCS=1
14723
14724 cat >>confdefs.h <<\EOF
14725 #define HAVE_USE_DEFAULT_COLORS 1
14726 EOF
14727
14728 cat >>confdefs.h <<\EOF
14729 #define NCURSES_EXT_FUNCS 1
14730 EOF
14731
14732 else
14733         NCURSES_EXT_FUNCS=0
14734 fi
14735
14736 ###   use option --enable-const to turn on use of const beyond that in XSI.
14737 echo "$as_me:14737: checking for extended use of const keyword" >&5
14738 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14739
14740 # Check whether --enable-const or --disable-const was given.
14741 if test "${enable_const+set}" = set; then
14742   enableval="$enable_const"
14743   with_ext_const=$enableval
14744 else
14745   with_ext_const=no
14746 fi;
14747 echo "$as_me:14747: result: $with_ext_const" >&5
14748 echo "${ECHO_T}$with_ext_const" >&6
14749 NCURSES_CONST='/*nothing*/'
14750 if test "$with_ext_const" = yes ; then
14751         NCURSES_CONST=const
14752 fi
14753
14754 ###############################################################################
14755 # These options are relatively safe to experiment with.
14756
14757 echo "$as_me:14757: checking if you want all development code" >&5
14758 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14759
14760 # Check whether --with-develop or --without-develop was given.
14761 if test "${with_develop+set}" = set; then
14762   withval="$with_develop"
14763   with_develop=$withval
14764 else
14765   with_develop=no
14766 fi;
14767 echo "$as_me:14767: result: $with_develop" >&5
14768 echo "${ECHO_T}$with_develop" >&6
14769
14770 ###############################################################################
14771 # These are just experimental, probably should not be in a package:
14772
14773 # This is still experimental (20080329), but should ultimately be moved to
14774 # the script-block --with-normal, etc.
14775
14776 echo "$as_me:14776: checking if you want to link with the pthread library" >&5
14777 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14778
14779 # Check whether --with-pthread or --without-pthread was given.
14780 if test "${with_pthread+set}" = set; then
14781   withval="$with_pthread"
14782   with_pthread=$withval
14783 else
14784   with_pthread=no
14785 fi;
14786 echo "$as_me:14786: result: $with_pthread" >&5
14787 echo "${ECHO_T}$with_pthread" >&6
14788
14789 if test "$with_pthread" != no ; then
14790         echo "$as_me:14790: checking for pthread.h" >&5
14791 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14792 if test "${ac_cv_header_pthread_h+set}" = set; then
14793   echo $ECHO_N "(cached) $ECHO_C" >&6
14794 else
14795   cat >"conftest.$ac_ext" <<_ACEOF
14796 #line 14796 "configure"
14797 #include "confdefs.h"
14798 #include <pthread.h>
14799 _ACEOF
14800 if { (eval echo "$as_me:14800: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14801   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14802   ac_status=$?
14803   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14804   rm -f conftest.er1
14805   cat conftest.err >&5
14806   echo "$as_me:14806: \$? = $ac_status" >&5
14807   (exit "$ac_status"); } >/dev/null; then
14808   if test -s conftest.err; then
14809     ac_cpp_err=$ac_c_preproc_warn_flag
14810   else
14811     ac_cpp_err=
14812   fi
14813 else
14814   ac_cpp_err=yes
14815 fi
14816 if test -z "$ac_cpp_err"; then
14817   ac_cv_header_pthread_h=yes
14818 else
14819   echo "$as_me: failed program was:" >&5
14820   cat "conftest.$ac_ext" >&5
14821   ac_cv_header_pthread_h=no
14822 fi
14823 rm -f conftest.err "conftest.$ac_ext"
14824 fi
14825 echo "$as_me:14825: result: $ac_cv_header_pthread_h" >&5
14826 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14827 if test "$ac_cv_header_pthread_h" = yes; then
14828
14829 cat >>confdefs.h <<\EOF
14830 #define HAVE_PTHREADS_H 1
14831 EOF
14832
14833         for cf_lib_pthread in pthread c_r
14834         do
14835             echo "$as_me:14835: checking if we can link with the $cf_lib_pthread library" >&5
14836 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14837             cf_save_LIBS="$LIBS"
14838
14839 cf_add_libs="$LIBS"
14840 # reverse order
14841 cf_add_0lib=
14842 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14843 # filter duplicates
14844 for cf_add_1lib in $cf_add_0lib; do
14845         for cf_add_2lib in $cf_add_libs; do
14846                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14847                         cf_add_1lib=
14848                         break
14849                 fi
14850         done
14851         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14852 done
14853 LIBS="$cf_add_libs"
14854
14855             cat >"conftest.$ac_ext" <<_ACEOF
14856 #line 14856 "configure"
14857 #include "confdefs.h"
14858
14859 #include <pthread.h>
14860
14861 int
14862 main (void)
14863 {
14864
14865                 int rc = pthread_create(0,0,0,0);
14866                 int r2 = pthread_mutexattr_settype(0, 0);
14867
14868   ;
14869   return 0;
14870 }
14871 _ACEOF
14872 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14873 if { (eval echo "$as_me:14873: \"$ac_link\"") >&5
14874   (eval $ac_link) 2>&5
14875   ac_status=$?
14876   echo "$as_me:14876: \$? = $ac_status" >&5
14877   (exit "$ac_status"); } &&
14878          { ac_try='test -s "conftest$ac_exeext"'
14879   { (eval echo "$as_me:14879: \"$ac_try\"") >&5
14880   (eval $ac_try) 2>&5
14881   ac_status=$?
14882   echo "$as_me:14882: \$? = $ac_status" >&5
14883   (exit "$ac_status"); }; }; then
14884   with_pthread=yes
14885 else
14886   echo "$as_me: failed program was:" >&5
14887 cat "conftest.$ac_ext" >&5
14888 with_pthread=no
14889 fi
14890 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14891             LIBS="$cf_save_LIBS"
14892             echo "$as_me:14892: result: $with_pthread" >&5
14893 echo "${ECHO_T}$with_pthread" >&6
14894             test "$with_pthread" = yes && break
14895         done
14896
14897         if test "$with_pthread" = yes ; then
14898
14899 cf_add_libs="$LIBS"
14900 # reverse order
14901 cf_add_0lib=
14902 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14903 # filter duplicates
14904 for cf_add_1lib in $cf_add_0lib; do
14905         for cf_add_2lib in $cf_add_libs; do
14906                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14907                         cf_add_1lib=
14908                         break
14909                 fi
14910         done
14911         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14912 done
14913 LIBS="$cf_add_libs"
14914
14915 cat >>confdefs.h <<\EOF
14916 #define HAVE_LIBPTHREADS 1
14917 EOF
14918
14919         else
14920             { { echo "$as_me:14920: error: Cannot link with pthread library" >&5
14921 echo "$as_me: error: Cannot link with pthread library" >&2;}
14922    { (exit 1); exit 1; }; }
14923         fi
14924
14925 fi
14926
14927 fi
14928
14929 echo "$as_me:14929: checking if you want to use weak-symbols for pthreads" >&5
14930 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14931
14932 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14933 if test "${enable_weak_symbols+set}" = set; then
14934   enableval="$enable_weak_symbols"
14935   use_weak_symbols=$withval
14936 else
14937   use_weak_symbols=no
14938 fi;
14939 echo "$as_me:14939: result: $use_weak_symbols" >&5
14940 echo "${ECHO_T}$use_weak_symbols" >&6
14941 if test "$use_weak_symbols" = yes ; then
14942
14943 echo "$as_me:14943: checking if $CC supports weak symbols" >&5
14944 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14945 if test "${cf_cv_weak_symbols+set}" = set; then
14946   echo $ECHO_N "(cached) $ECHO_C" >&6
14947 else
14948
14949 cat >"conftest.$ac_ext" <<_ACEOF
14950 #line 14950 "configure"
14951 #include "confdefs.h"
14952
14953 #include <stdio.h>
14954 int
14955 main (void)
14956 {
14957
14958 #if defined(__GNUC__)
14959 #  if defined __USE_ISOC99
14960 #    define _cat_pragma(exp)    _Pragma(#exp)
14961 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14962 #  else
14963 #    define _weak_pragma(exp)
14964 #  endif
14965 #  define _declare(name)        __extension__ extern __typeof__(name) name
14966 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14967 #endif
14968
14969 weak_symbol(fopen);
14970
14971   ;
14972   return 0;
14973 }
14974 _ACEOF
14975 rm -f "conftest.$ac_objext"
14976 if { (eval echo "$as_me:14976: \"$ac_compile\"") >&5
14977   (eval $ac_compile) 2>&5
14978   ac_status=$?
14979   echo "$as_me:14979: \$? = $ac_status" >&5
14980   (exit "$ac_status"); } &&
14981          { ac_try='test -s "conftest.$ac_objext"'
14982   { (eval echo "$as_me:14982: \"$ac_try\"") >&5
14983   (eval $ac_try) 2>&5
14984   ac_status=$?
14985   echo "$as_me:14985: \$? = $ac_status" >&5
14986   (exit "$ac_status"); }; }; then
14987   cf_cv_weak_symbols=yes
14988 else
14989   echo "$as_me: failed program was:" >&5
14990 cat "conftest.$ac_ext" >&5
14991 cf_cv_weak_symbols=no
14992 fi
14993 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14994
14995 fi
14996 echo "$as_me:14996: result: $cf_cv_weak_symbols" >&5
14997 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14998
14999 else
15000         cf_cv_weak_symbols=no
15001 fi
15002
15003 if test $cf_cv_weak_symbols = yes ; then
15004
15005 cat >>confdefs.h <<\EOF
15006 #define USE_WEAK_SYMBOLS 1
15007 EOF
15008
15009 fi
15010
15011 PTHREAD=
15012 if test "$with_pthread" = "yes" ; then
15013
15014 cat >>confdefs.h <<\EOF
15015 #define USE_PTHREADS 1
15016 EOF
15017
15018         enable_reentrant=yes
15019         if test $cf_cv_weak_symbols = yes ; then
15020                 PTHREAD=-lpthread
15021         fi
15022 fi
15023
15024 # OpenSUSE is installing ncurses6, using reentrant option.
15025 echo "$as_me:15025: checking for _nc_TABSIZE" >&5
15026 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15027 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15028   echo $ECHO_N "(cached) $ECHO_C" >&6
15029 else
15030   cat >"conftest.$ac_ext" <<_ACEOF
15031 #line 15031 "configure"
15032 #include "confdefs.h"
15033 #define _nc_TABSIZE autoconf_temporary
15034 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15035 #undef _nc_TABSIZE
15036
15037 #ifdef __cplusplus
15038 extern "C"
15039 #endif
15040
15041 /* We use char because int might match the return type of a gcc2
15042    builtin and then its argument prototype would still apply.  */
15043 char _nc_TABSIZE (void);
15044
15045 int
15046 main (void)
15047 {
15048
15049 /* The GNU C library defines stubs for functions which it implements
15050     to always fail with ENOSYS.  Some functions are actually named
15051     something starting with __ and the normal name is an alias.  */
15052 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15053 #error found stub for _nc_TABSIZE
15054 #endif
15055
15056         return _nc_TABSIZE ();
15057   ;
15058   return 0;
15059 }
15060 _ACEOF
15061 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15062 if { (eval echo "$as_me:15062: \"$ac_link\"") >&5
15063   (eval $ac_link) 2>&5
15064   ac_status=$?
15065   echo "$as_me:15065: \$? = $ac_status" >&5
15066   (exit "$ac_status"); } &&
15067          { ac_try='test -s "conftest$ac_exeext"'
15068   { (eval echo "$as_me:15068: \"$ac_try\"") >&5
15069   (eval $ac_try) 2>&5
15070   ac_status=$?
15071   echo "$as_me:15071: \$? = $ac_status" >&5
15072   (exit "$ac_status"); }; }; then
15073   ac_cv_func__nc_TABSIZE=yes
15074 else
15075   echo "$as_me: failed program was:" >&5
15076 cat "conftest.$ac_ext" >&5
15077 ac_cv_func__nc_TABSIZE=no
15078 fi
15079 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15080 fi
15081 echo "$as_me:15081: result: $ac_cv_func__nc_TABSIZE" >&5
15082 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15083 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15084   assume_reentrant=yes
15085 else
15086   assume_reentrant=no
15087 fi
15088
15089 # Reentrant code has to be opaque; there's little advantage to making ncurses
15090 # opaque outside of that, so there is no --enable-opaque option.  We can use
15091 # this option without --with-pthreads, but this will be always set for
15092 # pthreads.
15093 echo "$as_me:15093: checking if you want experimental reentrant code" >&5
15094 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15095
15096 # Check whether --enable-reentrant or --disable-reentrant was given.
15097 if test "${enable_reentrant+set}" = set; then
15098   enableval="$enable_reentrant"
15099   with_reentrant=$enableval
15100 else
15101   with_reentrant=$assume_reentrant
15102 fi;
15103 echo "$as_me:15103: result: $with_reentrant" >&5
15104 echo "${ECHO_T}$with_reentrant" >&6
15105 if test "$with_reentrant" = yes ; then
15106         cf_cv_enable_reentrant=1
15107         if test $cf_cv_weak_symbols = yes ; then
15108
15109 # remove pthread library from $LIBS
15110 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15111
15112         elif test "$assume_reentrant" = no ; then
15113                 LIB_SUFFIX="t${LIB_SUFFIX}"
15114         fi
15115
15116 cat >>confdefs.h <<\EOF
15117 #define USE_REENTRANT 1
15118 EOF
15119
15120 else
15121         cf_cv_enable_reentrant=0
15122 fi
15123
15124 ### Allow using a different wrap-prefix
15125 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15126         echo "$as_me:15126: checking for prefix used to wrap public variables" >&5
15127 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15128
15129 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15130 if test "${with_wrap_prefix+set}" = set; then
15131   withval="$with_wrap_prefix"
15132   NCURSES_WRAP_PREFIX=$withval
15133 else
15134   NCURSES_WRAP_PREFIX=_nc_
15135 fi;
15136         echo "$as_me:15136: result: $NCURSES_WRAP_PREFIX" >&5
15137 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15138 else
15139         NCURSES_WRAP_PREFIX=_nc_
15140 fi
15141
15142 cat >>confdefs.h <<EOF
15143 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15144 EOF
15145
15146 ###############################################################################
15147
15148 ###     use option --disable-echo to suppress full display compiling commands
15149
15150 echo "$as_me:15150: checking if you want to see long compiling messages" >&5
15151 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15152
15153 # Check whether --enable-echo or --disable-echo was given.
15154 if test "${enable_echo+set}" = set; then
15155   enableval="$enable_echo"
15156   test "$enableval" != no && enableval=yes
15157         if test "$enableval" != "yes" ; then
15158
15159         ECHO_LT='--silent'
15160         ECHO_LD='@echo linking $@;'
15161         RULE_CC='@echo compiling $<'
15162         SHOW_CC='@echo compiling $@'
15163         ECHO_CC='@'
15164
15165         else
15166
15167         ECHO_LT=''
15168         ECHO_LD=''
15169         RULE_CC=''
15170         SHOW_CC=''
15171         ECHO_CC=''
15172
15173         fi
15174 else
15175   enableval=yes
15176
15177         ECHO_LT=''
15178         ECHO_LD=''
15179         RULE_CC=''
15180         SHOW_CC=''
15181         ECHO_CC=''
15182
15183 fi;
15184 echo "$as_me:15184: result: $enableval" >&5
15185 echo "${ECHO_T}$enableval" >&6
15186
15187 echo "$as_me:15187: checking if you want to use C11 _Noreturn feature" >&5
15188 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15189
15190 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15191 if test "${enable_stdnoreturn+set}" = set; then
15192   enableval="$enable_stdnoreturn"
15193   test "$enableval" != yes && enableval=no
15194         if test "$enableval" != "no" ; then
15195     enable_stdnoreturn=yes
15196         else
15197                 enable_stdnoreturn=no
15198         fi
15199 else
15200   enableval=no
15201         enable_stdnoreturn=no
15202
15203 fi;
15204 echo "$as_me:15204: result: $enable_stdnoreturn" >&5
15205 echo "${ECHO_T}$enable_stdnoreturn" >&6
15206
15207 if test $enable_stdnoreturn = yes; then
15208 echo "$as_me:15208: checking for C11 _Noreturn feature" >&5
15209 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15210 if test "${cf_cv_c11_noreturn+set}" = set; then
15211   echo $ECHO_N "(cached) $ECHO_C" >&6
15212 else
15213   cat >"conftest.$ac_ext" <<_ACEOF
15214 #line 15214 "configure"
15215 #include "confdefs.h"
15216
15217 #include <stdio.h>
15218 #include <stdlib.h>
15219 #include <stdnoreturn.h>
15220 static _Noreturn void giveup(void) { exit(0); }
15221
15222 int
15223 main (void)
15224 {
15225 if (feof(stdin)) giveup()
15226   ;
15227   return 0;
15228 }
15229 _ACEOF
15230 rm -f "conftest.$ac_objext"
15231 if { (eval echo "$as_me:15231: \"$ac_compile\"") >&5
15232   (eval $ac_compile) 2>&5
15233   ac_status=$?
15234   echo "$as_me:15234: \$? = $ac_status" >&5
15235   (exit "$ac_status"); } &&
15236          { ac_try='test -s "conftest.$ac_objext"'
15237   { (eval echo "$as_me:15237: \"$ac_try\"") >&5
15238   (eval $ac_try) 2>&5
15239   ac_status=$?
15240   echo "$as_me:15240: \$? = $ac_status" >&5
15241   (exit "$ac_status"); }; }; then
15242   cf_cv_c11_noreturn=yes
15243 else
15244   echo "$as_me: failed program was:" >&5
15245 cat "conftest.$ac_ext" >&5
15246 cf_cv_c11_noreturn=no
15247 fi
15248 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15249
15250 fi
15251 echo "$as_me:15251: result: $cf_cv_c11_noreturn" >&5
15252 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15253 else
15254         cf_cv_c11_noreturn=no,
15255 fi
15256
15257 if test "$cf_cv_c11_noreturn" = yes; then
15258
15259 cat >>confdefs.h <<\EOF
15260 #define HAVE_STDNORETURN_H 1
15261 EOF
15262
15263 cat >>confdefs.h <<EOF
15264 #define STDC_NORETURN _Noreturn
15265 EOF
15266
15267         HAVE_STDNORETURN_H=1
15268 else
15269         HAVE_STDNORETURN_H=0
15270 fi
15271
15272 if test "$GCC" = yes || test "$GXX" = yes
15273 then
15274
15275 if test "$GCC" = yes || test "$GXX" = yes
15276 then
15277         case $CFLAGS in
15278         (*-Werror=*)
15279                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15280
15281 echo "${as_me:-configure}:15281: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15282
15283                 cf_temp_flags=
15284                 for cf_temp_scan in $CFLAGS
15285                 do
15286                         case "x$cf_temp_scan" in
15287                         (x-Werror=*)
15288
15289         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15290         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15291
15292                                 ;;
15293                         (*)
15294
15295         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15296         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15297
15298                                 ;;
15299                         esac
15300                 done
15301                 CFLAGS="$cf_temp_flags"
15302                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15303
15304 echo "${as_me:-configure}:15304: testing ... fixed $CFLAGS ..." 1>&5
15305
15306                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15307
15308 echo "${as_me:-configure}:15308: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15309
15310                 ;;
15311         esac
15312 fi
15313
15314 if test "$GCC" = yes || test "$GXX" = yes
15315 then
15316         case $CPPFLAGS in
15317         (*-Werror=*)
15318                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15319
15320 echo "${as_me:-configure}:15320: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15321
15322                 cf_temp_flags=
15323                 for cf_temp_scan in $CPPFLAGS
15324                 do
15325                         case "x$cf_temp_scan" in
15326                         (x-Werror=*)
15327
15328         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15329         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15330
15331                                 ;;
15332                         (*)
15333
15334         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15335         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15336
15337                                 ;;
15338                         esac
15339                 done
15340                 CPPFLAGS="$cf_temp_flags"
15341                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15342
15343 echo "${as_me:-configure}:15343: testing ... fixed $CPPFLAGS ..." 1>&5
15344
15345                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15346
15347 echo "${as_me:-configure}:15347: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15348
15349                 ;;
15350         esac
15351 fi
15352
15353 if test "$GCC" = yes || test "$GXX" = yes
15354 then
15355         case $LDFLAGS in
15356         (*-Werror=*)
15357                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15358
15359 echo "${as_me:-configure}:15359: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15360
15361                 cf_temp_flags=
15362                 for cf_temp_scan in $LDFLAGS
15363                 do
15364                         case "x$cf_temp_scan" in
15365                         (x-Werror=*)
15366
15367         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15368         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15369
15370                                 ;;
15371                         (*)
15372
15373         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15374         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15375
15376                                 ;;
15377                         esac
15378                 done
15379                 LDFLAGS="$cf_temp_flags"
15380                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15381
15382 echo "${as_me:-configure}:15382: testing ... fixed $LDFLAGS ..." 1>&5
15383
15384                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15385
15386 echo "${as_me:-configure}:15386: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15387
15388                 ;;
15389         esac
15390 fi
15391
15392 echo "$as_me:15392: checking if you want to turn on gcc warnings" >&5
15393 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15394
15395 # Check whether --enable-warnings or --disable-warnings was given.
15396 if test "${enable_warnings+set}" = set; then
15397   enableval="$enable_warnings"
15398   test "$enableval" != yes && enableval=no
15399         if test "$enableval" != "no" ; then
15400     enable_warnings=yes
15401         else
15402                 enable_warnings=no
15403         fi
15404 else
15405   enableval=no
15406         enable_warnings=no
15407
15408 fi;
15409 echo "$as_me:15409: result: $enable_warnings" >&5
15410 echo "${ECHO_T}$enable_warnings" >&6
15411 if test "$enable_warnings" = "yes"
15412 then
15413
15414 if test "x$have_x" = xyes; then
15415
15416 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15417 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15418 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15419 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15420 for cf_X_CFLAGS in $X_CFLAGS
15421 do
15422         case "x$cf_X_CFLAGS" in
15423         x-[IUD]*)
15424                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15425                 ;;
15426         *)
15427                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15428                 ;;
15429         esac
15430 done
15431
15432 cat >"conftest.$ac_ext" <<_ACEOF
15433 #line 15433 "configure"
15434 #include "confdefs.h"
15435
15436 #include <stdlib.h>
15437 #include <X11/Intrinsic.h>
15438
15439 int
15440 main (void)
15441 {
15442 String foo = malloc(1); free((void*)foo)
15443   ;
15444   return 0;
15445 }
15446 _ACEOF
15447 rm -f "conftest.$ac_objext"
15448 if { (eval echo "$as_me:15448: \"$ac_compile\"") >&5
15449   (eval $ac_compile) 2>&5
15450   ac_status=$?
15451   echo "$as_me:15451: \$? = $ac_status" >&5
15452   (exit "$ac_status"); } &&
15453          { ac_try='test -s "conftest.$ac_objext"'
15454   { (eval echo "$as_me:15454: \"$ac_try\"") >&5
15455   (eval $ac_try) 2>&5
15456   ac_status=$?
15457   echo "$as_me:15457: \$? = $ac_status" >&5
15458   (exit "$ac_status"); }; }; then
15459
15460 echo "$as_me:15460: checking for X11/Xt const-feature" >&5
15461 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15462 if test "${cf_cv_const_x_string+set}" = set; then
15463   echo $ECHO_N "(cached) $ECHO_C" >&6
15464 else
15465
15466         cat >"conftest.$ac_ext" <<_ACEOF
15467 #line 15467 "configure"
15468 #include "confdefs.h"
15469
15470 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15471 #undef  XTSTRINGDEFINES /* X11R5 and later */
15472 #include <stdlib.h>
15473 #include <X11/Intrinsic.h>
15474
15475 int
15476 main (void)
15477 {
15478 String foo = malloc(1); *foo = 0
15479   ;
15480   return 0;
15481 }
15482 _ACEOF
15483 rm -f "conftest.$ac_objext"
15484 if { (eval echo "$as_me:15484: \"$ac_compile\"") >&5
15485   (eval $ac_compile) 2>&5
15486   ac_status=$?
15487   echo "$as_me:15487: \$? = $ac_status" >&5
15488   (exit "$ac_status"); } &&
15489          { ac_try='test -s "conftest.$ac_objext"'
15490   { (eval echo "$as_me:15490: \"$ac_try\"") >&5
15491   (eval $ac_try) 2>&5
15492   ac_status=$?
15493   echo "$as_me:15493: \$? = $ac_status" >&5
15494   (exit "$ac_status"); }; }; then
15495
15496                         cf_cv_const_x_string=no
15497
15498 else
15499   echo "$as_me: failed program was:" >&5
15500 cat "conftest.$ac_ext" >&5
15501
15502                         cf_cv_const_x_string=yes
15503
15504 fi
15505 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15506
15507 fi
15508 echo "$as_me:15508: result: $cf_cv_const_x_string" >&5
15509 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15510
15511 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15512 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15513 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15514
15515 case "$cf_cv_const_x_string" in
15516 (no)
15517
15518         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15519         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15520
15521         ;;
15522 (*)
15523
15524         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15525         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15526
15527         ;;
15528 esac
15529
15530 else
15531   echo "$as_me: failed program was:" >&5
15532 cat "conftest.$ac_ext" >&5
15533 fi
15534 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15535  fi
15536 cat > "conftest.$ac_ext" <<EOF
15537 #line 15537 "${as_me:-configure}"
15538 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15539 EOF
15540 if test "$INTEL_COMPILER" = yes
15541 then
15542 # The "-wdXXX" options suppress warnings:
15543 # remark #1419: external declaration in primary source file
15544 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15545 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15546 # remark #193: zero used for undefined preprocessing identifier
15547 # remark #593: variable "curs_sb_left_arrow" was set but never used
15548 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15549 # remark #869: parameter "tw" was never referenced
15550 # remark #981: operands are evaluated in unspecified order
15551 # warning #279: controlling expression is constant
15552
15553         { echo "$as_me:15553: checking for $CC warning options..." >&5
15554 echo "$as_me: checking for $CC warning options..." >&6;}
15555         cf_save_CFLAGS="$CFLAGS"
15556         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15557         for cf_opt in \
15558                 wd1419 \
15559                 wd1683 \
15560                 wd1684 \
15561                 wd193 \
15562                 wd593 \
15563                 wd279 \
15564                 wd810 \
15565                 wd869 \
15566                 wd981
15567         do
15568                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15569                 if { (eval echo "$as_me:15569: \"$ac_compile\"") >&5
15570   (eval $ac_compile) 2>&5
15571   ac_status=$?
15572   echo "$as_me:15572: \$? = $ac_status" >&5
15573   (exit "$ac_status"); }; then
15574                         test -n "$verbose" && echo "$as_me:15574: result: ... -$cf_opt" >&5
15575 echo "${ECHO_T}... -$cf_opt" >&6
15576                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15577                 fi
15578         done
15579         CFLAGS="$cf_save_CFLAGS"
15580 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15581 then
15582         { echo "$as_me:15582: checking for $CC warning options..." >&5
15583 echo "$as_me: checking for $CC warning options..." >&6;}
15584         cf_save_CFLAGS="$CFLAGS"
15585         cf_warn_CONST=""
15586         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15587         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15588         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15589         for cf_opt in W Wall \
15590                 Wbad-function-cast \
15591                 Wcast-align \
15592                 Wcast-qual \
15593                 Wdeclaration-after-statement \
15594                 Wextra \
15595                 Winline \
15596                 Wmissing-declarations \
15597                 Wmissing-prototypes \
15598                 Wnested-externs \
15599                 Wpointer-arith \
15600                 Wshadow \
15601                 Wstrict-prototypes \
15602                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15603         do
15604                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15605                 if { (eval echo "$as_me:15605: \"$ac_compile\"") >&5
15606   (eval $ac_compile) 2>&5
15607   ac_status=$?
15608   echo "$as_me:15608: \$? = $ac_status" >&5
15609   (exit "$ac_status"); }; then
15610                         test -n "$verbose" && echo "$as_me:15610: result: ... -$cf_opt" >&5
15611 echo "${ECHO_T}... -$cf_opt" >&6
15612                         case "$cf_opt" in
15613                         (Winline)
15614                                 case "$GCC_VERSION" in
15615                                 ([34].*)
15616                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15617
15618 echo "${as_me:-configure}:15618: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15619
15620                                         continue;;
15621                                 esac
15622                                 ;;
15623                         (Wpointer-arith)
15624                                 case "$GCC_VERSION" in
15625                                 ([12].*)
15626                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15627
15628 echo "${as_me:-configure}:15628: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15629
15630                                         continue;;
15631                                 esac
15632                                 ;;
15633                         esac
15634                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15635                 fi
15636         done
15637         CFLAGS="$cf_save_CFLAGS"
15638 fi
15639 rm -rf ./conftest*
15640
15641 fi
15642
15643 if test "$GCC" = yes || test "$GXX" = yes
15644 then
15645 cat > conftest.i <<EOF
15646 #ifndef GCC_PRINTF
15647 #define GCC_PRINTF 0
15648 #endif
15649 #ifndef GCC_SCANF
15650 #define GCC_SCANF 0
15651 #endif
15652 #ifndef GCC_NORETURN
15653 #define GCC_NORETURN /* nothing */
15654 #endif
15655 #ifndef GCC_UNUSED
15656 #define GCC_UNUSED /* nothing */
15657 #endif
15658 EOF
15659 if test "$GCC" = yes
15660 then
15661         { echo "$as_me:15661: checking for $CC __attribute__ directives..." >&5
15662 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15663 cat > "conftest.$ac_ext" <<EOF
15664 #line 15664 "${as_me:-configure}"
15665 #include "confdefs.h"
15666 #include "conftest.h"
15667 #include "conftest.i"
15668 #if     GCC_PRINTF
15669 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15670 #else
15671 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15672 #endif
15673 #if     GCC_SCANF
15674 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15675 #else
15676 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15677 #endif
15678 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15679 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15680 extern GCC_NORETURN void foo(void);
15681 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15682 EOF
15683         cf_printf_attribute=no
15684         cf_scanf_attribute=no
15685         for cf_attribute in scanf printf unused noreturn
15686         do
15687
15688 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15689
15690                 cf_directive="__attribute__(($cf_attribute))"
15691                 echo "checking for $CC $cf_directive" 1>&5
15692
15693                 case "$cf_attribute" in
15694                 (printf)
15695                         cf_printf_attribute=yes
15696                         cat >conftest.h <<EOF
15697 #define GCC_$cf_ATTRIBUTE 1
15698 EOF
15699                         ;;
15700                 (scanf)
15701                         cf_scanf_attribute=yes
15702                         cat >conftest.h <<EOF
15703 #define GCC_$cf_ATTRIBUTE 1
15704 EOF
15705                         ;;
15706                 (*)
15707                         cat >conftest.h <<EOF
15708 #define GCC_$cf_ATTRIBUTE $cf_directive
15709 EOF
15710                         ;;
15711                 esac
15712
15713                 if { (eval echo "$as_me:15713: \"$ac_compile\"") >&5
15714   (eval $ac_compile) 2>&5
15715   ac_status=$?
15716   echo "$as_me:15716: \$? = $ac_status" >&5
15717   (exit "$ac_status"); }; then
15718                         test -n "$verbose" && echo "$as_me:15718: result: ... $cf_attribute" >&5
15719 echo "${ECHO_T}... $cf_attribute" >&6
15720                         cat conftest.h >>confdefs.h
15721                         case "$cf_attribute" in
15722                         (noreturn)
15723
15724 cat >>confdefs.h <<EOF
15725 #define GCC_NORETURN $cf_directive
15726 EOF
15727
15728                                 ;;
15729                         (printf)
15730                                 cf_value='/* nothing */'
15731                                 if test "$cf_printf_attribute" != no ; then
15732                                         cf_value='__attribute__((format(printf,fmt,var)))'
15733
15734 cat >>confdefs.h <<\EOF
15735 #define GCC_PRINTF 1
15736 EOF
15737
15738                                 fi
15739
15740 cat >>confdefs.h <<EOF
15741 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15742 EOF
15743
15744                                 ;;
15745                         (scanf)
15746                                 cf_value='/* nothing */'
15747                                 if test "$cf_scanf_attribute" != no ; then
15748                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15749
15750 cat >>confdefs.h <<\EOF
15751 #define GCC_SCANF 1
15752 EOF
15753
15754                                 fi
15755
15756 cat >>confdefs.h <<EOF
15757 #define GCC_SCANFLIKE(fmt,var) $cf_value
15758 EOF
15759
15760                                 ;;
15761                         (unused)
15762
15763 cat >>confdefs.h <<EOF
15764 #define GCC_UNUSED $cf_directive
15765 EOF
15766
15767                                 ;;
15768                         esac
15769                 fi
15770         done
15771 else
15772         ${FGREP-fgrep} define conftest.i >>confdefs.h
15773 fi
15774 rm -rf ./conftest*
15775 fi
15776
15777 fi
15778
15779 if test "x$enable_warnings" = "xyes"; then
15780
15781         ADAFLAGS="$ADAFLAGS -gnatg"
15782
15783 fi
15784
15785 ###     use option --enable-assertions to turn on generation of assertion code
15786 echo "$as_me:15786: checking if you want to enable runtime assertions" >&5
15787 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15788
15789 # Check whether --enable-assertions or --disable-assertions was given.
15790 if test "${enable_assertions+set}" = set; then
15791   enableval="$enable_assertions"
15792   with_assertions=$enableval
15793 else
15794   with_assertions=no
15795 fi;
15796 echo "$as_me:15796: result: $with_assertions" >&5
15797 echo "${ECHO_T}$with_assertions" >&6
15798 if test -n "$GCC"
15799 then
15800         if test "$with_assertions" = no
15801         then
15802                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15803         else
15804
15805         ADAFLAGS="$ADAFLAGS -gnata"
15806
15807         fi
15808 fi
15809
15810 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15811
15812 cat >>confdefs.h <<\EOF
15813 #define HAVE_NC_ALLOC_H 1
15814 EOF
15815
15816 ###     use option --enable-expanded to generate certain macros as functions
15817
15818 # Check whether --enable-expanded or --disable-expanded was given.
15819 if test "${enable_expanded+set}" = set; then
15820   enableval="$enable_expanded"
15821   test "$enableval" = yes &&
15822 cat >>confdefs.h <<\EOF
15823 #define NCURSES_EXPANDED 1
15824 EOF
15825
15826 fi;
15827
15828 ###     use option --disable-macros to suppress macros in favor of functions
15829
15830 # Check whether --enable-macros or --disable-macros was given.
15831 if test "${enable_macros+set}" = set; then
15832   enableval="$enable_macros"
15833   test "$enableval" = no &&
15834 cat >>confdefs.h <<\EOF
15835 #define NCURSES_NOMACROS 1
15836 EOF
15837
15838 fi;
15839
15840 # Normally we only add trace() to the debug-library.  Allow this to be
15841 # extended to all models of the ncurses library:
15842 cf_all_traces=no
15843 case "$CFLAGS $CPPFLAGS" in
15844 (*-DTRACE*)
15845         cf_all_traces=yes
15846         ;;
15847 esac
15848
15849 echo "$as_me:15849: checking whether to add trace feature to all models" >&5
15850 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15851
15852 # Check whether --with-trace or --without-trace was given.
15853 if test "${with_trace+set}" = set; then
15854   withval="$with_trace"
15855   cf_with_trace=$withval
15856 else
15857   cf_with_trace=$cf_all_traces
15858 fi;
15859 echo "$as_me:15859: result: $cf_with_trace" >&5
15860 echo "${ECHO_T}$cf_with_trace" >&6
15861
15862 if test "$cf_with_trace" = yes ; then
15863         ADA_TRACE=TRUE
15864
15865 cf_fix_cppflags=no
15866 cf_new_cflags=
15867 cf_new_cppflags=
15868 cf_new_extra_cppflags=
15869
15870 for cf_add_cflags in -DTRACE
15871 do
15872 case "$cf_fix_cppflags" in
15873 (no)
15874         case "$cf_add_cflags" in
15875         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15876                 case "$cf_add_cflags" in
15877                 (-D*)
15878                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15879
15880                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15881                                 && test -z "${cf_tst_cflags}" \
15882                                 && cf_fix_cppflags=yes
15883
15884                         if test "$cf_fix_cppflags" = yes ; then
15885
15886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15888
15889                                 continue
15890                         elif test "${cf_tst_cflags}" = "\"'" ; then
15891
15892         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15893         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15894
15895                                 continue
15896                         fi
15897                         ;;
15898                 esac
15899                 case "$CPPFLAGS" in
15900                 (*$cf_add_cflags)
15901                         ;;
15902                 (*)
15903                         case "$cf_add_cflags" in
15904                         (-D*)
15905                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15906
15907 CPPFLAGS=`echo "$CPPFLAGS" | \
15908         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15909                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15910
15911                                 ;;
15912                         esac
15913
15914         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15915         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15916
15917                         ;;
15918                 esac
15919                 ;;
15920         (*)
15921
15922         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15923         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15924
15925                 ;;
15926         esac
15927         ;;
15928 (yes)
15929
15930         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15931         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15932
15933         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15934
15935         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15936                 && test -z "${cf_tst_cflags}" \
15937                 && cf_fix_cppflags=no
15938         ;;
15939 esac
15940 done
15941
15942 if test -n "$cf_new_cflags" ; then
15943
15944         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15945         CFLAGS="${CFLAGS}$cf_new_cflags"
15946
15947 fi
15948
15949 if test -n "$cf_new_cppflags" ; then
15950
15951         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15952         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15953
15954 fi
15955
15956 if test -n "$cf_new_extra_cppflags" ; then
15957
15958         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15959         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15960
15961 fi
15962
15963 else
15964         ADA_TRACE=FALSE
15965 fi
15966
15967 echo "$as_me:15967: checking if we want to use GNAT projects" >&5
15968 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15969
15970 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15971 if test "${enable_gnat_projects+set}" = set; then
15972   enableval="$enable_gnat_projects"
15973   test "$enableval" != no && enableval=yes
15974         if test "$enableval" != "yes" ; then
15975     enable_gnat_projects=no
15976         else
15977                 enable_gnat_projects=yes
15978         fi
15979 else
15980   enableval=yes
15981         enable_gnat_projects=yes
15982
15983 fi;
15984 echo "$as_me:15984: result: $enable_gnat_projects" >&5
15985 echo "${ECHO_T}$enable_gnat_projects" >&6
15986
15987 ###     Checks for libraries.
15988 case $cf_cv_system_name in
15989 (*mingw32*)
15990
15991 echo "$as_me:15991: checking if ssp library is needed" >&5
15992 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
15993 if test "${cf_cv_need_libssp+set}" = set; then
15994   echo $ECHO_N "(cached) $ECHO_C" >&6
15995 else
15996
15997 cat >"conftest.$ac_ext" <<_ACEOF
15998 #line 15998 "configure"
15999 #include "confdefs.h"
16000
16001 #include <sys/types.h>
16002 #include <dirent.h>
16003
16004 int
16005 main (void)
16006 {
16007
16008        DIR *dp = opendir(".");
16009
16010   ;
16011   return 0;
16012 }
16013 _ACEOF
16014 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16015 if { (eval echo "$as_me:16015: \"$ac_link\"") >&5
16016   (eval $ac_link) 2>&5
16017   ac_status=$?
16018   echo "$as_me:16018: \$? = $ac_status" >&5
16019   (exit "$ac_status"); } &&
16020          { ac_try='test -s "conftest$ac_exeext"'
16021   { (eval echo "$as_me:16021: \"$ac_try\"") >&5
16022   (eval $ac_try) 2>&5
16023   ac_status=$?
16024   echo "$as_me:16024: \$? = $ac_status" >&5
16025   (exit "$ac_status"); }; }; then
16026   cf_cv_need_libssp=no
16027 else
16028   echo "$as_me: failed program was:" >&5
16029 cat "conftest.$ac_ext" >&5
16030
16031         cf_save_LIBS="$LIBS"
16032         LIBS="$LIBS -lssp"
16033         cat >"conftest.$ac_ext" <<_ACEOF
16034 #line 16034 "configure"
16035 #include "confdefs.h"
16036
16037 #include <sys/types.h>
16038 #include <dirent.h>
16039
16040 int
16041 main (void)
16042 {
16043
16044                    DIR *dp = opendir(".");
16045
16046   ;
16047   return 0;
16048 }
16049 _ACEOF
16050 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16051 if { (eval echo "$as_me:16051: \"$ac_link\"") >&5
16052   (eval $ac_link) 2>&5
16053   ac_status=$?
16054   echo "$as_me:16054: \$? = $ac_status" >&5
16055   (exit "$ac_status"); } &&
16056          { ac_try='test -s "conftest$ac_exeext"'
16057   { (eval echo "$as_me:16057: \"$ac_try\"") >&5
16058   (eval $ac_try) 2>&5
16059   ac_status=$?
16060   echo "$as_me:16060: \$? = $ac_status" >&5
16061   (exit "$ac_status"); }; }; then
16062   cf_cv_need_libssp=yes
16063 else
16064   echo "$as_me: failed program was:" >&5
16065 cat "conftest.$ac_ext" >&5
16066 cf_cv_need_libssp=maybe
16067 fi
16068 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16069         LIBS="$cf_save_LIBS"
16070
16071 fi
16072 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16073 fi
16074 echo "$as_me:16074: result: $cf_cv_need_libssp" >&5
16075 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16076
16077 if test "x$cf_cv_need_libssp" = xyes
16078 then
16079
16080 cf_add_libs="$LIBS"
16081 # reverse order
16082 cf_add_0lib=
16083 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16084 # filter duplicates
16085 for cf_add_1lib in $cf_add_0lib; do
16086         for cf_add_2lib in $cf_add_libs; do
16087                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16088                         cf_add_1lib=
16089                         break
16090                 fi
16091         done
16092         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16093 done
16094 LIBS="$cf_add_libs"
16095
16096 fi
16097
16098         ;;
16099 (*)
16100 echo "$as_me:16100: checking for gettimeofday" >&5
16101 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
16102 if test "${ac_cv_func_gettimeofday+set}" = set; then
16103   echo $ECHO_N "(cached) $ECHO_C" >&6
16104 else
16105   cat >"conftest.$ac_ext" <<_ACEOF
16106 #line 16106 "configure"
16107 #include "confdefs.h"
16108 #define gettimeofday autoconf_temporary
16109 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16110 #undef gettimeofday
16111
16112 #ifdef __cplusplus
16113 extern "C"
16114 #endif
16115
16116 /* We use char because int might match the return type of a gcc2
16117    builtin and then its argument prototype would still apply.  */
16118 char gettimeofday (void);
16119
16120 int
16121 main (void)
16122 {
16123
16124 /* The GNU C library defines stubs for functions which it implements
16125     to always fail with ENOSYS.  Some functions are actually named
16126     something starting with __ and the normal name is an alias.  */
16127 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16128 #error found stub for gettimeofday
16129 #endif
16130
16131         return gettimeofday ();
16132   ;
16133   return 0;
16134 }
16135 _ACEOF
16136 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16137 if { (eval echo "$as_me:16137: \"$ac_link\"") >&5
16138   (eval $ac_link) 2>&5
16139   ac_status=$?
16140   echo "$as_me:16140: \$? = $ac_status" >&5
16141   (exit "$ac_status"); } &&
16142          { ac_try='test -s "conftest$ac_exeext"'
16143   { (eval echo "$as_me:16143: \"$ac_try\"") >&5
16144   (eval $ac_try) 2>&5
16145   ac_status=$?
16146   echo "$as_me:16146: \$? = $ac_status" >&5
16147   (exit "$ac_status"); }; }; then
16148   ac_cv_func_gettimeofday=yes
16149 else
16150   echo "$as_me: failed program was:" >&5
16151 cat "conftest.$ac_ext" >&5
16152 ac_cv_func_gettimeofday=no
16153 fi
16154 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16155 fi
16156 echo "$as_me:16156: result: $ac_cv_func_gettimeofday" >&5
16157 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16158 if test "$ac_cv_func_gettimeofday" = yes; then
16159   cat >>confdefs.h <<\EOF
16160 #define HAVE_GETTIMEOFDAY 1
16161 EOF
16162
16163 else
16164
16165 echo "$as_me:16165: checking for gettimeofday in -lbsd" >&5
16166 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16167 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16168   echo $ECHO_N "(cached) $ECHO_C" >&6
16169 else
16170   ac_check_lib_save_LIBS=$LIBS
16171 LIBS="-lbsd  $LIBS"
16172 cat >"conftest.$ac_ext" <<_ACEOF
16173 #line 16173 "configure"
16174 #include "confdefs.h"
16175
16176 /* Override any gcc2 internal prototype to avoid an error.  */
16177 #ifdef __cplusplus
16178 extern "C"
16179 #endif
16180 /* We use char because int might match the return type of a gcc2
16181    builtin and then its argument prototype would still apply.  */
16182 char gettimeofday ();
16183 int
16184 main (void)
16185 {
16186 gettimeofday ();
16187   ;
16188   return 0;
16189 }
16190 _ACEOF
16191 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16192 if { (eval echo "$as_me:16192: \"$ac_link\"") >&5
16193   (eval $ac_link) 2>&5
16194   ac_status=$?
16195   echo "$as_me:16195: \$? = $ac_status" >&5
16196   (exit "$ac_status"); } &&
16197          { ac_try='test -s "conftest$ac_exeext"'
16198   { (eval echo "$as_me:16198: \"$ac_try\"") >&5
16199   (eval $ac_try) 2>&5
16200   ac_status=$?
16201   echo "$as_me:16201: \$? = $ac_status" >&5
16202   (exit "$ac_status"); }; }; then
16203   ac_cv_lib_bsd_gettimeofday=yes
16204 else
16205   echo "$as_me: failed program was:" >&5
16206 cat "conftest.$ac_ext" >&5
16207 ac_cv_lib_bsd_gettimeofday=no
16208 fi
16209 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16210 LIBS=$ac_check_lib_save_LIBS
16211 fi
16212 echo "$as_me:16212: result: $ac_cv_lib_bsd_gettimeofday" >&5
16213 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16214 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16215
16216 cat >>confdefs.h <<\EOF
16217 #define HAVE_GETTIMEOFDAY 1
16218 EOF
16219
16220         LIBS="$LIBS -lbsd"
16221 fi
16222
16223 fi
16224         ;;
16225 esac
16226
16227 ###     Checks for header files.
16228 echo "$as_me:16228: checking for ANSI C header files" >&5
16229 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16230 if test "${ac_cv_header_stdc+set}" = set; then
16231   echo $ECHO_N "(cached) $ECHO_C" >&6
16232 else
16233   cat >"conftest.$ac_ext" <<_ACEOF
16234 #line 16234 "configure"
16235 #include "confdefs.h"
16236 #include <stdlib.h>
16237 #include <stdarg.h>
16238 #include <string.h>
16239 #include <float.h>
16240
16241 _ACEOF
16242 if { (eval echo "$as_me:16242: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16243   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16244   ac_status=$?
16245   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16246   rm -f conftest.er1
16247   cat conftest.err >&5
16248   echo "$as_me:16248: \$? = $ac_status" >&5
16249   (exit "$ac_status"); } >/dev/null; then
16250   if test -s conftest.err; then
16251     ac_cpp_err=$ac_c_preproc_warn_flag
16252   else
16253     ac_cpp_err=
16254   fi
16255 else
16256   ac_cpp_err=yes
16257 fi
16258 if test -z "$ac_cpp_err"; then
16259   ac_cv_header_stdc=yes
16260 else
16261   echo "$as_me: failed program was:" >&5
16262   cat "conftest.$ac_ext" >&5
16263   ac_cv_header_stdc=no
16264 fi
16265 rm -f conftest.err "conftest.$ac_ext"
16266
16267 if test $ac_cv_header_stdc = yes; then
16268   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16269   cat >"conftest.$ac_ext" <<_ACEOF
16270 #line 16270 "configure"
16271 #include "confdefs.h"
16272 #include <string.h>
16273
16274 _ACEOF
16275 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16276   $EGREP "memchr" >/dev/null 2>&1; then
16277   :
16278 else
16279   ac_cv_header_stdc=no
16280 fi
16281 rm -rf conftest*
16282
16283 fi
16284
16285 if test $ac_cv_header_stdc = yes; then
16286   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16287   cat >"conftest.$ac_ext" <<_ACEOF
16288 #line 16288 "configure"
16289 #include "confdefs.h"
16290 #include <stdlib.h>
16291
16292 _ACEOF
16293 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16294   $EGREP "free" >/dev/null 2>&1; then
16295   :
16296 else
16297   ac_cv_header_stdc=no
16298 fi
16299 rm -rf conftest*
16300
16301 fi
16302
16303 if test $ac_cv_header_stdc = yes; then
16304   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16305   if test "$cross_compiling" = yes; then
16306   :
16307 else
16308   cat >"conftest.$ac_ext" <<_ACEOF
16309 #line 16309 "configure"
16310 #include "confdefs.h"
16311 #include <ctype.h>
16312 #if ((' ' & 0x0FF) == 0x020)
16313 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16314 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16315 #else
16316 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16317                      || ('j' <= (c) && (c) <= 'r') \
16318                      || ('s' <= (c) && (c) <= 'z'))
16319 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16320 #endif
16321
16322 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16323 int
16324 main (void)
16325 {
16326   int i;
16327   for (i = 0; i < 256; i++)
16328     if (XOR (islower (i), ISLOWER (i))
16329         || toupper (i) != TOUPPER (i))
16330       $ac_main_return(2);
16331   $ac_main_return (0);
16332 }
16333 _ACEOF
16334 rm -f "conftest$ac_exeext"
16335 if { (eval echo "$as_me:16335: \"$ac_link\"") >&5
16336   (eval $ac_link) 2>&5
16337   ac_status=$?
16338   echo "$as_me:16338: \$? = $ac_status" >&5
16339   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16340   { (eval echo "$as_me:16340: \"$ac_try\"") >&5
16341   (eval $ac_try) 2>&5
16342   ac_status=$?
16343   echo "$as_me:16343: \$? = $ac_status" >&5
16344   (exit "$ac_status"); }; }; then
16345   :
16346 else
16347   echo "$as_me: program exited with status $ac_status" >&5
16348 echo "$as_me: failed program was:" >&5
16349 cat "conftest.$ac_ext" >&5
16350 ac_cv_header_stdc=no
16351 fi
16352 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16353 fi
16354 fi
16355 fi
16356 echo "$as_me:16356: result: $ac_cv_header_stdc" >&5
16357 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16358 if test $ac_cv_header_stdc = yes; then
16359
16360 cat >>confdefs.h <<\EOF
16361 #define STDC_HEADERS 1
16362 EOF
16363
16364 fi
16365
16366 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16367
16368 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16369                   inttypes.h stdint.h unistd.h
16370 do
16371 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16372 echo "$as_me:16372: checking for $ac_header" >&5
16373 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16374 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16375   echo $ECHO_N "(cached) $ECHO_C" >&6
16376 else
16377   cat >"conftest.$ac_ext" <<_ACEOF
16378 #line 16378 "configure"
16379 #include "confdefs.h"
16380 $ac_includes_default
16381 #include <$ac_header>
16382 _ACEOF
16383 rm -f "conftest.$ac_objext"
16384 if { (eval echo "$as_me:16384: \"$ac_compile\"") >&5
16385   (eval $ac_compile) 2>&5
16386   ac_status=$?
16387   echo "$as_me:16387: \$? = $ac_status" >&5
16388   (exit "$ac_status"); } &&
16389          { ac_try='test -s "conftest.$ac_objext"'
16390   { (eval echo "$as_me:16390: \"$ac_try\"") >&5
16391   (eval $ac_try) 2>&5
16392   ac_status=$?
16393   echo "$as_me:16393: \$? = $ac_status" >&5
16394   (exit "$ac_status"); }; }; then
16395   eval "$as_ac_Header=yes"
16396 else
16397   echo "$as_me: failed program was:" >&5
16398 cat "conftest.$ac_ext" >&5
16399 eval "$as_ac_Header=no"
16400 fi
16401 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16402 fi
16403 echo "$as_me:16403: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16404 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16405 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16406   cat >>confdefs.h <<EOF
16407 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16408 EOF
16409
16410 fi
16411 done
16412
16413 echo "$as_me:16413: checking for signed char" >&5
16414 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16415 if test "${ac_cv_type_signed_char+set}" = set; then
16416   echo $ECHO_N "(cached) $ECHO_C" >&6
16417 else
16418   cat >"conftest.$ac_ext" <<_ACEOF
16419 #line 16419 "configure"
16420 #include "confdefs.h"
16421 $ac_includes_default
16422 int
16423 main (void)
16424 {
16425 if ((signed char *) 0)
16426   return 0;
16427 if (sizeof (signed char))
16428   return 0;
16429   ;
16430   return 0;
16431 }
16432 _ACEOF
16433 rm -f "conftest.$ac_objext"
16434 if { (eval echo "$as_me:16434: \"$ac_compile\"") >&5
16435   (eval $ac_compile) 2>&5
16436   ac_status=$?
16437   echo "$as_me:16437: \$? = $ac_status" >&5
16438   (exit "$ac_status"); } &&
16439          { ac_try='test -s "conftest.$ac_objext"'
16440   { (eval echo "$as_me:16440: \"$ac_try\"") >&5
16441   (eval $ac_try) 2>&5
16442   ac_status=$?
16443   echo "$as_me:16443: \$? = $ac_status" >&5
16444   (exit "$ac_status"); }; }; then
16445   ac_cv_type_signed_char=yes
16446 else
16447   echo "$as_me: failed program was:" >&5
16448 cat "conftest.$ac_ext" >&5
16449 ac_cv_type_signed_char=no
16450 fi
16451 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16452 fi
16453 echo "$as_me:16453: result: $ac_cv_type_signed_char" >&5
16454 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16455
16456 echo "$as_me:16456: checking size of signed char" >&5
16457 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16458 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16459   echo $ECHO_N "(cached) $ECHO_C" >&6
16460 else
16461   if test "$ac_cv_type_signed_char" = yes; then
16462   if test "$cross_compiling" = yes; then
16463   # Depending upon the size, compute the lo and hi bounds.
16464 cat >"conftest.$ac_ext" <<_ACEOF
16465 #line 16465 "configure"
16466 #include "confdefs.h"
16467 $ac_includes_default
16468 int
16469 main (void)
16470 {
16471 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16472   ;
16473   return 0;
16474 }
16475 _ACEOF
16476 rm -f "conftest.$ac_objext"
16477 if { (eval echo "$as_me:16477: \"$ac_compile\"") >&5
16478   (eval $ac_compile) 2>&5
16479   ac_status=$?
16480   echo "$as_me:16480: \$? = $ac_status" >&5
16481   (exit "$ac_status"); } &&
16482          { ac_try='test -s "conftest.$ac_objext"'
16483   { (eval echo "$as_me:16483: \"$ac_try\"") >&5
16484   (eval $ac_try) 2>&5
16485   ac_status=$?
16486   echo "$as_me:16486: \$? = $ac_status" >&5
16487   (exit "$ac_status"); }; }; then
16488   ac_lo=0 ac_mid=0
16489   while :; do
16490     cat >"conftest.$ac_ext" <<_ACEOF
16491 #line 16491 "configure"
16492 #include "confdefs.h"
16493 $ac_includes_default
16494 int
16495 main (void)
16496 {
16497 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16498   ;
16499   return 0;
16500 }
16501 _ACEOF
16502 rm -f "conftest.$ac_objext"
16503 if { (eval echo "$as_me:16503: \"$ac_compile\"") >&5
16504   (eval $ac_compile) 2>&5
16505   ac_status=$?
16506   echo "$as_me:16506: \$? = $ac_status" >&5
16507   (exit "$ac_status"); } &&
16508          { ac_try='test -s "conftest.$ac_objext"'
16509   { (eval echo "$as_me:16509: \"$ac_try\"") >&5
16510   (eval $ac_try) 2>&5
16511   ac_status=$?
16512   echo "$as_me:16512: \$? = $ac_status" >&5
16513   (exit "$ac_status"); }; }; then
16514   ac_hi=$ac_mid; break
16515 else
16516   echo "$as_me: failed program was:" >&5
16517 cat "conftest.$ac_ext" >&5
16518 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16519 fi
16520 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16521   done
16522 else
16523   echo "$as_me: failed program was:" >&5
16524 cat "conftest.$ac_ext" >&5
16525 ac_hi=-1 ac_mid=-1
16526   while :; do
16527     cat >"conftest.$ac_ext" <<_ACEOF
16528 #line 16528 "configure"
16529 #include "confdefs.h"
16530 $ac_includes_default
16531 int
16532 main (void)
16533 {
16534 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16535   ;
16536   return 0;
16537 }
16538 _ACEOF
16539 rm -f "conftest.$ac_objext"
16540 if { (eval echo "$as_me:16540: \"$ac_compile\"") >&5
16541   (eval $ac_compile) 2>&5
16542   ac_status=$?
16543   echo "$as_me:16543: \$? = $ac_status" >&5
16544   (exit "$ac_status"); } &&
16545          { ac_try='test -s "conftest.$ac_objext"'
16546   { (eval echo "$as_me:16546: \"$ac_try\"") >&5
16547   (eval $ac_try) 2>&5
16548   ac_status=$?
16549   echo "$as_me:16549: \$? = $ac_status" >&5
16550   (exit "$ac_status"); }; }; then
16551   ac_lo=$ac_mid; break
16552 else
16553   echo "$as_me: failed program was:" >&5
16554 cat "conftest.$ac_ext" >&5
16555 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16556 fi
16557 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16558   done
16559 fi
16560 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16561 # Binary search between lo and hi bounds.
16562 while test "x$ac_lo" != "x$ac_hi"; do
16563   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16564   cat >"conftest.$ac_ext" <<_ACEOF
16565 #line 16565 "configure"
16566 #include "confdefs.h"
16567 $ac_includes_default
16568 int
16569 main (void)
16570 {
16571 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16572   ;
16573   return 0;
16574 }
16575 _ACEOF
16576 rm -f "conftest.$ac_objext"
16577 if { (eval echo "$as_me:16577: \"$ac_compile\"") >&5
16578   (eval $ac_compile) 2>&5
16579   ac_status=$?
16580   echo "$as_me:16580: \$? = $ac_status" >&5
16581   (exit "$ac_status"); } &&
16582          { ac_try='test -s "conftest.$ac_objext"'
16583   { (eval echo "$as_me:16583: \"$ac_try\"") >&5
16584   (eval $ac_try) 2>&5
16585   ac_status=$?
16586   echo "$as_me:16586: \$? = $ac_status" >&5
16587   (exit "$ac_status"); }; }; then
16588   ac_hi=$ac_mid
16589 else
16590   echo "$as_me: failed program was:" >&5
16591 cat "conftest.$ac_ext" >&5
16592 ac_lo=`expr "$ac_mid" + 1`
16593 fi
16594 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16595 done
16596 ac_cv_sizeof_signed_char=$ac_lo
16597 else
16598   if test "$cross_compiling" = yes; then
16599   { { echo "$as_me:16599: error: cannot run test program while cross compiling" >&5
16600 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16601    { (exit 1); exit 1; }; }
16602 else
16603   cat >"conftest.$ac_ext" <<_ACEOF
16604 #line 16604 "configure"
16605 #include "confdefs.h"
16606 $ac_includes_default
16607 int
16608 main (void)
16609 {
16610 FILE *f = fopen ("conftest.val", "w");
16611 if (!f)
16612   $ac_main_return (1);
16613 fprintf (f, "%ld", (long)(sizeof (signed char)));
16614 fclose (f);
16615   ;
16616   return 0;
16617 }
16618 _ACEOF
16619 rm -f "conftest$ac_exeext"
16620 if { (eval echo "$as_me:16620: \"$ac_link\"") >&5
16621   (eval $ac_link) 2>&5
16622   ac_status=$?
16623   echo "$as_me:16623: \$? = $ac_status" >&5
16624   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16625   { (eval echo "$as_me:16625: \"$ac_try\"") >&5
16626   (eval $ac_try) 2>&5
16627   ac_status=$?
16628   echo "$as_me:16628: \$? = $ac_status" >&5
16629   (exit "$ac_status"); }; }; then
16630   ac_cv_sizeof_signed_char=`cat conftest.val`
16631 else
16632   echo "$as_me: program exited with status $ac_status" >&5
16633 echo "$as_me: failed program was:" >&5
16634 cat "conftest.$ac_ext" >&5
16635 fi
16636 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16637 fi
16638 fi
16639 rm -f conftest.val
16640 else
16641   ac_cv_sizeof_signed_char=0
16642 fi
16643 fi
16644 echo "$as_me:16644: result: $ac_cv_sizeof_signed_char" >&5
16645 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16646 cat >>confdefs.h <<EOF
16647 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16648 EOF
16649
16650 echo "$as_me:16650: checking for ANSI C header files" >&5
16651 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16652 if test "${ac_cv_header_stdc+set}" = set; then
16653   echo $ECHO_N "(cached) $ECHO_C" >&6
16654 else
16655   cat >"conftest.$ac_ext" <<_ACEOF
16656 #line 16656 "configure"
16657 #include "confdefs.h"
16658 #include <stdlib.h>
16659 #include <stdarg.h>
16660 #include <string.h>
16661 #include <float.h>
16662
16663 _ACEOF
16664 if { (eval echo "$as_me:16664: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16665   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16666   ac_status=$?
16667   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16668   rm -f conftest.er1
16669   cat conftest.err >&5
16670   echo "$as_me:16670: \$? = $ac_status" >&5
16671   (exit "$ac_status"); } >/dev/null; then
16672   if test -s conftest.err; then
16673     ac_cpp_err=$ac_c_preproc_warn_flag
16674   else
16675     ac_cpp_err=
16676   fi
16677 else
16678   ac_cpp_err=yes
16679 fi
16680 if test -z "$ac_cpp_err"; then
16681   ac_cv_header_stdc=yes
16682 else
16683   echo "$as_me: failed program was:" >&5
16684   cat "conftest.$ac_ext" >&5
16685   ac_cv_header_stdc=no
16686 fi
16687 rm -f conftest.err "conftest.$ac_ext"
16688
16689 if test $ac_cv_header_stdc = yes; then
16690   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16691   cat >"conftest.$ac_ext" <<_ACEOF
16692 #line 16692 "configure"
16693 #include "confdefs.h"
16694 #include <string.h>
16695
16696 _ACEOF
16697 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16698   $EGREP "memchr" >/dev/null 2>&1; then
16699   :
16700 else
16701   ac_cv_header_stdc=no
16702 fi
16703 rm -rf conftest*
16704
16705 fi
16706
16707 if test $ac_cv_header_stdc = yes; then
16708   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16709   cat >"conftest.$ac_ext" <<_ACEOF
16710 #line 16710 "configure"
16711 #include "confdefs.h"
16712 #include <stdlib.h>
16713
16714 _ACEOF
16715 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16716   $EGREP "free" >/dev/null 2>&1; then
16717   :
16718 else
16719   ac_cv_header_stdc=no
16720 fi
16721 rm -rf conftest*
16722
16723 fi
16724
16725 if test $ac_cv_header_stdc = yes; then
16726   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16727   if test "$cross_compiling" = yes; then
16728   :
16729 else
16730   cat >"conftest.$ac_ext" <<_ACEOF
16731 #line 16731 "configure"
16732 #include "confdefs.h"
16733 #include <ctype.h>
16734 #if ((' ' & 0x0FF) == 0x020)
16735 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16736 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16737 #else
16738 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16739                      || ('j' <= (c) && (c) <= 'r') \
16740                      || ('s' <= (c) && (c) <= 'z'))
16741 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16742 #endif
16743
16744 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16745 int
16746 main (void)
16747 {
16748   int i;
16749   for (i = 0; i < 256; i++)
16750     if (XOR (islower (i), ISLOWER (i))
16751         || toupper (i) != TOUPPER (i))
16752       $ac_main_return(2);
16753   $ac_main_return (0);
16754 }
16755 _ACEOF
16756 rm -f "conftest$ac_exeext"
16757 if { (eval echo "$as_me:16757: \"$ac_link\"") >&5
16758   (eval $ac_link) 2>&5
16759   ac_status=$?
16760   echo "$as_me:16760: \$? = $ac_status" >&5
16761   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16762   { (eval echo "$as_me:16762: \"$ac_try\"") >&5
16763   (eval $ac_try) 2>&5
16764   ac_status=$?
16765   echo "$as_me:16765: \$? = $ac_status" >&5
16766   (exit "$ac_status"); }; }; then
16767   :
16768 else
16769   echo "$as_me: program exited with status $ac_status" >&5
16770 echo "$as_me: failed program was:" >&5
16771 cat "conftest.$ac_ext" >&5
16772 ac_cv_header_stdc=no
16773 fi
16774 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16775 fi
16776 fi
16777 fi
16778 echo "$as_me:16778: result: $ac_cv_header_stdc" >&5
16779 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16780 if test $ac_cv_header_stdc = yes; then
16781
16782 cat >>confdefs.h <<\EOF
16783 #define STDC_HEADERS 1
16784 EOF
16785
16786 fi
16787
16788 ac_header_dirent=no
16789 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16790   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16791 echo "$as_me:16791: checking for $ac_hdr that defines DIR" >&5
16792 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16793 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16794   echo $ECHO_N "(cached) $ECHO_C" >&6
16795 else
16796   cat >"conftest.$ac_ext" <<_ACEOF
16797 #line 16797 "configure"
16798 #include "confdefs.h"
16799 #include <sys/types.h>
16800 #include <$ac_hdr>
16801
16802 int
16803 main (void)
16804 {
16805 if ((DIR *) 0)
16806 return 0;
16807   ;
16808   return 0;
16809 }
16810 _ACEOF
16811 rm -f "conftest.$ac_objext"
16812 if { (eval echo "$as_me:16812: \"$ac_compile\"") >&5
16813   (eval $ac_compile) 2>&5
16814   ac_status=$?
16815   echo "$as_me:16815: \$? = $ac_status" >&5
16816   (exit "$ac_status"); } &&
16817          { ac_try='test -s "conftest.$ac_objext"'
16818   { (eval echo "$as_me:16818: \"$ac_try\"") >&5
16819   (eval $ac_try) 2>&5
16820   ac_status=$?
16821   echo "$as_me:16821: \$? = $ac_status" >&5
16822   (exit "$ac_status"); }; }; then
16823   eval "$as_ac_Header=yes"
16824 else
16825   echo "$as_me: failed program was:" >&5
16826 cat "conftest.$ac_ext" >&5
16827 eval "$as_ac_Header=no"
16828 fi
16829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16830 fi
16831 echo "$as_me:16831: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16832 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16833 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16834   cat >>confdefs.h <<EOF
16835 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16836 EOF
16837
16838 ac_header_dirent=$ac_hdr; break
16839 fi
16840
16841 done
16842 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16843 if test $ac_header_dirent = dirent.h; then
16844   echo "$as_me:16844: checking for opendir in -ldir" >&5
16845 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16846 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16847   echo $ECHO_N "(cached) $ECHO_C" >&6
16848 else
16849   ac_check_lib_save_LIBS=$LIBS
16850 LIBS="-ldir  $LIBS"
16851 cat >"conftest.$ac_ext" <<_ACEOF
16852 #line 16852 "configure"
16853 #include "confdefs.h"
16854
16855 /* Override any gcc2 internal prototype to avoid an error.  */
16856 #ifdef __cplusplus
16857 extern "C"
16858 #endif
16859 /* We use char because int might match the return type of a gcc2
16860    builtin and then its argument prototype would still apply.  */
16861 char opendir ();
16862 int
16863 main (void)
16864 {
16865 opendir ();
16866   ;
16867   return 0;
16868 }
16869 _ACEOF
16870 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16871 if { (eval echo "$as_me:16871: \"$ac_link\"") >&5
16872   (eval $ac_link) 2>&5
16873   ac_status=$?
16874   echo "$as_me:16874: \$? = $ac_status" >&5
16875   (exit "$ac_status"); } &&
16876          { ac_try='test -s "conftest$ac_exeext"'
16877   { (eval echo "$as_me:16877: \"$ac_try\"") >&5
16878   (eval $ac_try) 2>&5
16879   ac_status=$?
16880   echo "$as_me:16880: \$? = $ac_status" >&5
16881   (exit "$ac_status"); }; }; then
16882   ac_cv_lib_dir_opendir=yes
16883 else
16884   echo "$as_me: failed program was:" >&5
16885 cat "conftest.$ac_ext" >&5
16886 ac_cv_lib_dir_opendir=no
16887 fi
16888 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16889 LIBS=$ac_check_lib_save_LIBS
16890 fi
16891 echo "$as_me:16891: result: $ac_cv_lib_dir_opendir" >&5
16892 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16893 if test "$ac_cv_lib_dir_opendir" = yes; then
16894   LIBS="$LIBS -ldir"
16895 fi
16896
16897 else
16898   echo "$as_me:16898: checking for opendir in -lx" >&5
16899 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16900 if test "${ac_cv_lib_x_opendir+set}" = set; then
16901   echo $ECHO_N "(cached) $ECHO_C" >&6
16902 else
16903   ac_check_lib_save_LIBS=$LIBS
16904 LIBS="-lx  $LIBS"
16905 cat >"conftest.$ac_ext" <<_ACEOF
16906 #line 16906 "configure"
16907 #include "confdefs.h"
16908
16909 /* Override any gcc2 internal prototype to avoid an error.  */
16910 #ifdef __cplusplus
16911 extern "C"
16912 #endif
16913 /* We use char because int might match the return type of a gcc2
16914    builtin and then its argument prototype would still apply.  */
16915 char opendir ();
16916 int
16917 main (void)
16918 {
16919 opendir ();
16920   ;
16921   return 0;
16922 }
16923 _ACEOF
16924 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16925 if { (eval echo "$as_me:16925: \"$ac_link\"") >&5
16926   (eval $ac_link) 2>&5
16927   ac_status=$?
16928   echo "$as_me:16928: \$? = $ac_status" >&5
16929   (exit "$ac_status"); } &&
16930          { ac_try='test -s "conftest$ac_exeext"'
16931   { (eval echo "$as_me:16931: \"$ac_try\"") >&5
16932   (eval $ac_try) 2>&5
16933   ac_status=$?
16934   echo "$as_me:16934: \$? = $ac_status" >&5
16935   (exit "$ac_status"); }; }; then
16936   ac_cv_lib_x_opendir=yes
16937 else
16938   echo "$as_me: failed program was:" >&5
16939 cat "conftest.$ac_ext" >&5
16940 ac_cv_lib_x_opendir=no
16941 fi
16942 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16943 LIBS=$ac_check_lib_save_LIBS
16944 fi
16945 echo "$as_me:16945: result: $ac_cv_lib_x_opendir" >&5
16946 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16947 if test "$ac_cv_lib_x_opendir" = yes; then
16948   LIBS="$LIBS -lx"
16949 fi
16950
16951 fi
16952
16953 echo "$as_me:16953: checking whether time.h and sys/time.h may both be included" >&5
16954 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16955 if test "${ac_cv_header_time+set}" = set; then
16956   echo $ECHO_N "(cached) $ECHO_C" >&6
16957 else
16958   cat >"conftest.$ac_ext" <<_ACEOF
16959 #line 16959 "configure"
16960 #include "confdefs.h"
16961 #include <sys/types.h>
16962 #include <sys/time.h>
16963 #include <time.h>
16964
16965 int
16966 main (void)
16967 {
16968 if ((struct tm *) 0)
16969 return 0;
16970   ;
16971   return 0;
16972 }
16973 _ACEOF
16974 rm -f "conftest.$ac_objext"
16975 if { (eval echo "$as_me:16975: \"$ac_compile\"") >&5
16976   (eval $ac_compile) 2>&5
16977   ac_status=$?
16978   echo "$as_me:16978: \$? = $ac_status" >&5
16979   (exit "$ac_status"); } &&
16980          { ac_try='test -s "conftest.$ac_objext"'
16981   { (eval echo "$as_me:16981: \"$ac_try\"") >&5
16982   (eval $ac_try) 2>&5
16983   ac_status=$?
16984   echo "$as_me:16984: \$? = $ac_status" >&5
16985   (exit "$ac_status"); }; }; then
16986   ac_cv_header_time=yes
16987 else
16988   echo "$as_me: failed program was:" >&5
16989 cat "conftest.$ac_ext" >&5
16990 ac_cv_header_time=no
16991 fi
16992 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16993 fi
16994 echo "$as_me:16994: result: $ac_cv_header_time" >&5
16995 echo "${ECHO_T}$ac_cv_header_time" >&6
16996 if test $ac_cv_header_time = yes; then
16997
16998 cat >>confdefs.h <<\EOF
16999 #define TIME_WITH_SYS_TIME 1
17000 EOF
17001
17002 fi
17003
17004 ###     checks for compiler characteristics
17005 ac_ext=c
17006 ac_cpp='$CPP $CPPFLAGS'
17007 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17008 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17009 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17010 ac_main_return="return"
17011
17012 echo "$as_me:17012: checking for an ANSI C-conforming const" >&5
17013 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17014 if test "${ac_cv_c_const+set}" = set; then
17015   echo $ECHO_N "(cached) $ECHO_C" >&6
17016 else
17017   cat >"conftest.$ac_ext" <<_ACEOF
17018 #line 17018 "configure"
17019 #include "confdefs.h"
17020
17021 int
17022 main (void)
17023 {
17024 /* FIXME: Include the comments suggested by Paul. */
17025 #ifndef __cplusplus
17026   /* Ultrix mips cc rejects this.  */
17027   typedef int charset[2];
17028   const charset x;
17029   /* SunOS 4.1.1 cc rejects this.  */
17030   char const *const *ccp;
17031   char **p;
17032   /* NEC SVR4.0.2 mips cc rejects this.  */
17033   struct point {int x, y;};
17034   static struct point const zero = {0,0};
17035   /* AIX XL C 1.02.0.0 rejects this.
17036      It does not let you subtract one const X* pointer from another in
17037      an arm of an if-expression whose if-part is not a constant
17038      expression */
17039   const char *g = "string";
17040   ccp = &g + (g ? g-g : 0);
17041   /* HPUX 7.0 cc rejects these. */
17042   ++ccp;
17043   p = (char**) ccp;
17044   ccp = (char const *const *) p;
17045   { /* SCO 3.2v4 cc rejects this.  */
17046     char *t;
17047     char const *s = 0 ? (char *) 0 : (char const *) 0;
17048
17049     *t++ = 0;
17050   }
17051   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17052     int x[] = {25, 17};
17053     const int *foo = &x[0];
17054     ++foo;
17055   }
17056   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17057     typedef const int *iptr;
17058     iptr p = 0;
17059     ++p;
17060   }
17061   { /* AIX XL C 1.02.0.0 rejects this saying
17062        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17063     struct s { int j; const int *ap[3]; };
17064     struct s *b; b->j = 5;
17065   }
17066   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17067     const int foo = 10;
17068   }
17069 #endif
17070
17071   ;
17072   return 0;
17073 }
17074 _ACEOF
17075 rm -f "conftest.$ac_objext"
17076 if { (eval echo "$as_me:17076: \"$ac_compile\"") >&5
17077   (eval $ac_compile) 2>&5
17078   ac_status=$?
17079   echo "$as_me:17079: \$? = $ac_status" >&5
17080   (exit "$ac_status"); } &&
17081          { ac_try='test -s "conftest.$ac_objext"'
17082   { (eval echo "$as_me:17082: \"$ac_try\"") >&5
17083   (eval $ac_try) 2>&5
17084   ac_status=$?
17085   echo "$as_me:17085: \$? = $ac_status" >&5
17086   (exit "$ac_status"); }; }; then
17087   ac_cv_c_const=yes
17088 else
17089   echo "$as_me: failed program was:" >&5
17090 cat "conftest.$ac_ext" >&5
17091 ac_cv_c_const=no
17092 fi
17093 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17094 fi
17095 echo "$as_me:17095: result: $ac_cv_c_const" >&5
17096 echo "${ECHO_T}$ac_cv_c_const" >&6
17097 if test $ac_cv_c_const = no; then
17098
17099 cat >>confdefs.h <<\EOF
17100 #define const
17101 EOF
17102
17103 fi
17104
17105 ###     Checks for external-data
17106
17107 echo "$as_me:17107: checking if data-only library module links" >&5
17108 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17109 if test "${cf_cv_link_dataonly+set}" = set; then
17110   echo $ECHO_N "(cached) $ECHO_C" >&6
17111 else
17112
17113         rm -f conftest.a
17114         cat >conftest.$ac_ext <<EOF
17115 #line 17115 "configure"
17116 int     testdata[3] = { 123, 456, 789 };
17117 EOF
17118         if { (eval echo "$as_me:17118: \"$ac_compile\"") >&5
17119   (eval $ac_compile) 2>&5
17120   ac_status=$?
17121   echo "$as_me:17121: \$? = $ac_status" >&5
17122   (exit "$ac_status"); } ; then
17123                 mv conftest.o data.o && \
17124                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17125         fi
17126         rm -f conftest.$ac_ext data.o
17127         cat >conftest.$ac_ext <<EOF
17128 #line 17128 "configure"
17129 int     testfunc(void)
17130 {
17131 #if defined(NeXT)
17132         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17133 #else
17134         extern int testdata[3];
17135         return testdata[0] == 123
17136            &&  testdata[1] == 456
17137            &&  testdata[2] == 789;
17138 #endif
17139 }
17140 EOF
17141         if { (eval echo "$as_me:17141: \"$ac_compile\"") >&5
17142   (eval $ac_compile) 2>&5
17143   ac_status=$?
17144   echo "$as_me:17144: \$? = $ac_status" >&5
17145   (exit "$ac_status"); }; then
17146                 mv conftest.o func.o && \
17147                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17148         fi
17149         rm -f conftest.$ac_ext func.o
17150         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17151         cf_saveLIBS="$LIBS"
17152         LIBS="conftest.a $LIBS"
17153         if test "$cross_compiling" = yes; then
17154   cf_cv_link_dataonly=unknown
17155 else
17156   cat >"conftest.$ac_ext" <<_ACEOF
17157 #line 17157 "configure"
17158 #include "confdefs.h"
17159
17160         int main(void)
17161         {
17162                 extern int testfunc();
17163                 ${cf_cv_main_return:-return} (!testfunc());
17164         }
17165
17166 _ACEOF
17167 rm -f "conftest$ac_exeext"
17168 if { (eval echo "$as_me:17168: \"$ac_link\"") >&5
17169   (eval $ac_link) 2>&5
17170   ac_status=$?
17171   echo "$as_me:17171: \$? = $ac_status" >&5
17172   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17173   { (eval echo "$as_me:17173: \"$ac_try\"") >&5
17174   (eval $ac_try) 2>&5
17175   ac_status=$?
17176   echo "$as_me:17176: \$? = $ac_status" >&5
17177   (exit "$ac_status"); }; }; then
17178   cf_cv_link_dataonly=yes
17179 else
17180   echo "$as_me: program exited with status $ac_status" >&5
17181 echo "$as_me: failed program was:" >&5
17182 cat "conftest.$ac_ext" >&5
17183 cf_cv_link_dataonly=no
17184 fi
17185 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17186 fi
17187         LIBS="$cf_saveLIBS"
17188
17189 fi
17190
17191 echo "$as_me:17191: result: $cf_cv_link_dataonly" >&5
17192 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17193
17194 if test "$cf_cv_link_dataonly" = no ; then
17195
17196 cat >>confdefs.h <<\EOF
17197 #define BROKEN_LINKER 1
17198 EOF
17199
17200         BROKEN_LINKER=1
17201 fi
17202
17203 ###     Checks for library functions.
17204
17205 for ac_header in \
17206 unistd.h \
17207
17208 do
17209 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17210 echo "$as_me:17210: checking for $ac_header" >&5
17211 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17212 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17213   echo $ECHO_N "(cached) $ECHO_C" >&6
17214 else
17215   cat >"conftest.$ac_ext" <<_ACEOF
17216 #line 17216 "configure"
17217 #include "confdefs.h"
17218 #include <$ac_header>
17219 _ACEOF
17220 if { (eval echo "$as_me:17220: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17221   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17222   ac_status=$?
17223   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17224   rm -f conftest.er1
17225   cat conftest.err >&5
17226   echo "$as_me:17226: \$? = $ac_status" >&5
17227   (exit "$ac_status"); } >/dev/null; then
17228   if test -s conftest.err; then
17229     ac_cpp_err=$ac_c_preproc_warn_flag
17230   else
17231     ac_cpp_err=
17232   fi
17233 else
17234   ac_cpp_err=yes
17235 fi
17236 if test -z "$ac_cpp_err"; then
17237   eval "$as_ac_Header=yes"
17238 else
17239   echo "$as_me: failed program was:" >&5
17240   cat "conftest.$ac_ext" >&5
17241   eval "$as_ac_Header=no"
17242 fi
17243 rm -f conftest.err "conftest.$ac_ext"
17244 fi
17245 echo "$as_me:17245: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17246 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17247 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17248   cat >>confdefs.h <<EOF
17249 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17250 EOF
17251
17252 fi
17253 done
17254
17255 echo "$as_me:17255: checking for working mkstemp" >&5
17256 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17257 if test "${cf_cv_func_mkstemp+set}" = set; then
17258   echo $ECHO_N "(cached) $ECHO_C" >&6
17259 else
17260
17261 rm -rf ./conftest*
17262 if test "$cross_compiling" = yes; then
17263   cf_cv_func_mkstemp=maybe
17264 else
17265   cat >"conftest.$ac_ext" <<_ACEOF
17266 #line 17266 "configure"
17267 #include "confdefs.h"
17268
17269 #include <sys/types.h>
17270 #ifdef HAVE_UNISTD_H
17271 #include <unistd.h>
17272 #endif
17273 #include <stdlib.h>
17274 #include <stdio.h>
17275 #include <string.h>
17276 #include <sys/stat.h>
17277 int main(void)
17278 {
17279         char *tmpl = "conftestXXXXXX";
17280         char name[2][80];
17281         int n;
17282         int result = 0;
17283         int fd;
17284         struct stat sb;
17285
17286         umask(077);
17287         for (n = 0; n < 2; ++n) {
17288                 strcpy(name[n], tmpl);
17289                 if ((fd = mkstemp(name[n])) >= 0) {
17290                         if (!strcmp(name[n], tmpl)
17291                          || stat(name[n], &sb) != 0
17292                          || (sb.st_mode & S_IFMT) != S_IFREG
17293                          || (sb.st_mode & 077) != 0) {
17294                                 result = 1;
17295                         }
17296                         close(fd);
17297                 }
17298         }
17299         if (result == 0
17300          && !strcmp(name[0], name[1]))
17301                 result = 1;
17302         ${cf_cv_main_return:-return}(result);
17303 }
17304
17305 _ACEOF
17306 rm -f "conftest$ac_exeext"
17307 if { (eval echo "$as_me:17307: \"$ac_link\"") >&5
17308   (eval $ac_link) 2>&5
17309   ac_status=$?
17310   echo "$as_me:17310: \$? = $ac_status" >&5
17311   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17312   { (eval echo "$as_me:17312: \"$ac_try\"") >&5
17313   (eval $ac_try) 2>&5
17314   ac_status=$?
17315   echo "$as_me:17315: \$? = $ac_status" >&5
17316   (exit "$ac_status"); }; }; then
17317   cf_cv_func_mkstemp=yes
17318
17319 else
17320   echo "$as_me: program exited with status $ac_status" >&5
17321 echo "$as_me: failed program was:" >&5
17322 cat "conftest.$ac_ext" >&5
17323 cf_cv_func_mkstemp=no
17324
17325 fi
17326 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17327 fi
17328
17329 fi
17330 echo "$as_me:17330: result: $cf_cv_func_mkstemp" >&5
17331 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17332 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17333         echo "$as_me:17333: checking for mkstemp" >&5
17334 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17335 if test "${ac_cv_func_mkstemp+set}" = set; then
17336   echo $ECHO_N "(cached) $ECHO_C" >&6
17337 else
17338   cat >"conftest.$ac_ext" <<_ACEOF
17339 #line 17339 "configure"
17340 #include "confdefs.h"
17341 #define mkstemp autoconf_temporary
17342 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17343 #undef mkstemp
17344
17345 #ifdef __cplusplus
17346 extern "C"
17347 #endif
17348
17349 /* We use char because int might match the return type of a gcc2
17350    builtin and then its argument prototype would still apply.  */
17351 char mkstemp (void);
17352
17353 int
17354 main (void)
17355 {
17356
17357 /* The GNU C library defines stubs for functions which it implements
17358     to always fail with ENOSYS.  Some functions are actually named
17359     something starting with __ and the normal name is an alias.  */
17360 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17361 #error found stub for mkstemp
17362 #endif
17363
17364         return mkstemp ();
17365   ;
17366   return 0;
17367 }
17368 _ACEOF
17369 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17370 if { (eval echo "$as_me:17370: \"$ac_link\"") >&5
17371   (eval $ac_link) 2>&5
17372   ac_status=$?
17373   echo "$as_me:17373: \$? = $ac_status" >&5
17374   (exit "$ac_status"); } &&
17375          { ac_try='test -s "conftest$ac_exeext"'
17376   { (eval echo "$as_me:17376: \"$ac_try\"") >&5
17377   (eval $ac_try) 2>&5
17378   ac_status=$?
17379   echo "$as_me:17379: \$? = $ac_status" >&5
17380   (exit "$ac_status"); }; }; then
17381   ac_cv_func_mkstemp=yes
17382 else
17383   echo "$as_me: failed program was:" >&5
17384 cat "conftest.$ac_ext" >&5
17385 ac_cv_func_mkstemp=no
17386 fi
17387 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17388 fi
17389 echo "$as_me:17389: result: $ac_cv_func_mkstemp" >&5
17390 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17391
17392 fi
17393 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17394
17395 cat >>confdefs.h <<\EOF
17396 #define HAVE_MKSTEMP 1
17397 EOF
17398
17399 fi
17400
17401 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17402         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17403         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17404 fi
17405
17406 cf_with_ada=yes
17407 if test "$cf_with_ada" != "no" ; then
17408
17409 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17410 do
17411
17412 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17413
17414         unset ac_cv_path_cf_TEMP_gnat
17415         unset cf_TEMP_gnat
17416         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17417 set dummy $cf_prog_gnat; ac_word=$2
17418 echo "$as_me:17418: checking for $ac_word" >&5
17419 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17420 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17421   echo $ECHO_N "(cached) $ECHO_C" >&6
17422 else
17423   case $cf_TEMP_gnat in
17424   [\\/]* | ?:[\\/]*)
17425   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17426   ;;
17427   *)
17428   ac_save_IFS=$IFS; IFS=$ac_path_separator
17429 ac_dummy="$PATH"
17430 for ac_dir in $ac_dummy; do
17431   IFS=$ac_save_IFS
17432   test -z "$ac_dir" && ac_dir=.
17433   if $as_executable_p "$ac_dir/$ac_word"; then
17434    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17435    echo "$as_me:17435: found $ac_dir/$ac_word" >&5
17436    break
17437 fi
17438 done
17439
17440   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17441   ;;
17442 esac
17443 fi
17444 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17445
17446 if test -n "$cf_TEMP_gnat"; then
17447   echo "$as_me:17447: result: $cf_TEMP_gnat" >&5
17448 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17449 else
17450   echo "$as_me:17450: result: no" >&5
17451 echo "${ECHO_T}no" >&6
17452 fi
17453
17454         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17455
17456         if test "x$cf_TEMP_gnat" != xno; then
17457                 unset cf_cv_gnat_version
17458                 unset cf_TEMP_gnat
17459
17460 echo "$as_me:17460: checking for $cf_prog_gnat version" >&5
17461 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17462 if test "${cf_cv_gnat_version+set}" = set; then
17463   echo $ECHO_N "(cached) $ECHO_C" >&6
17464 else
17465
17466 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17467         grep '[0-9].[0-9][0-9]*' |\
17468         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17469
17470 fi
17471 echo "$as_me:17471: result: $cf_cv_gnat_version" >&5
17472 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17473 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17474 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17475
17476         fi
17477         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17478
17479         unset cf_TEMP_gnat
17480         unset cf_cv_gnat_version
17481         unset ac_cv_path_cf_TEMP_gnat
17482 done
17483
17484 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17485         cf_ada_make=
17486         cf_cv_prog_gnat_correct=no
17487 else
17488         cf_ada_make=gnatmake
17489         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17490                 # gprconfig is newer than gnatmake; we can continue...
17491                 cf_ada_config="##"
17492         else
17493                 rm -rf ./conftest* ./*~conftest*
17494                 if mkdir conftest.src
17495                 then
17496                         cf_ada_config=""
17497                         cd conftest.src
17498                         for cf_gprconfig in Ada C
17499                         do
17500                                 echo "$as_me:17500: checking for gprconfig name for $cf_gprconfig" >&5
17501 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17502                                 if test "$cf_gprconfig" = C
17503                                 then
17504                                         for cf_gprconfig_param in \
17505                                                 "$cf_gprconfig,,,,GNATGCC" \
17506                                                 "$cf_gprconfig,,,,GCC" \
17507                                                 "$cf_gprconfig"
17508                                         do
17509                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17510                                                 test -n "$cf_gprconfig_value" && break
17511                                         done
17512                                 else
17513                                         cf_gprconfig_param=$cf_gprconfig
17514                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17515                                 fi
17516                                 if test -n "$cf_gprconfig_value"
17517                                 then
17518                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17519                                         echo "$as_me:17519: result: $cf_gprconfig_value" >&5
17520 echo "${ECHO_T}$cf_gprconfig_value" >&6
17521                                 else
17522                                         echo "$as_me:17522: result: missing" >&5
17523 echo "${ECHO_T}missing" >&6
17524                                         cf_ada_config="#"
17525                                         break
17526                                 fi
17527                         done
17528                         cd ..
17529                         rm -rf ./conftest* ./*~conftest*
17530                 fi
17531         fi
17532         if test "x$cf_ada_config" != "x#"
17533         then
17534
17535 echo "$as_me:17535: checking for gnat version" >&5
17536 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17537 if test "${cf_cv_gnat_version+set}" = set; then
17538   echo $ECHO_N "(cached) $ECHO_C" >&6
17539 else
17540
17541 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17542         grep '[0-9].[0-9][0-9]*' |\
17543         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17544
17545 fi
17546 echo "$as_me:17546: result: $cf_cv_gnat_version" >&5
17547 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17548 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17549
17550 case "$cf_cv_gnat_version" in
17551 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17552         cf_cv_prog_gnat_correct=yes
17553         ;;
17554 (*)
17555         { echo "$as_me:17555: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17556 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17557         cf_cv_prog_gnat_correct=no
17558         ;;
17559 esac
17560
17561                 # Extract the first word of "m4", so it can be a program name with args.
17562 set dummy m4; ac_word=$2
17563 echo "$as_me:17563: checking for $ac_word" >&5
17564 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17565 if test "${ac_cv_prog_M4_exists+set}" = set; then
17566   echo $ECHO_N "(cached) $ECHO_C" >&6
17567 else
17568   if test -n "$M4_exists"; then
17569   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17570 else
17571   ac_save_IFS=$IFS; IFS=$ac_path_separator
17572 ac_dummy="$PATH"
17573 for ac_dir in $ac_dummy; do
17574   IFS=$ac_save_IFS
17575   test -z "$ac_dir" && ac_dir=.
17576   $as_executable_p "$ac_dir/$ac_word" || continue
17577 ac_cv_prog_M4_exists="yes"
17578 echo "$as_me:17578: found $ac_dir/$ac_word" >&5
17579 break
17580 done
17581
17582   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17583 fi
17584 fi
17585 M4_exists=$ac_cv_prog_M4_exists
17586 if test -n "$M4_exists"; then
17587   echo "$as_me:17587: result: $M4_exists" >&5
17588 echo "${ECHO_T}$M4_exists" >&6
17589 else
17590   echo "$as_me:17590: result: no" >&5
17591 echo "${ECHO_T}no" >&6
17592 fi
17593
17594                 if test "$ac_cv_prog_M4_exists" = no; then
17595                         cf_cv_prog_gnat_correct=no
17596                         { echo "$as_me:17596: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17597 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17598                 fi
17599                 if test "$cf_cv_prog_gnat_correct" = yes; then
17600                         echo "$as_me:17600: checking if GNAT works" >&5
17601 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17602
17603 rm -rf ./conftest* ./*~conftest*
17604 cat >>conftest.ads <<CF_EOF
17605 procedure conftest;
17606 CF_EOF
17607 cat >>conftest.adb <<CF_EOF
17608 with Text_IO;
17609 with GNAT.OS_Lib;
17610 procedure conftest is
17611 begin
17612    Text_IO.Put ("Hello World");
17613    Text_IO.New_Line;
17614    GNAT.OS_Lib.OS_Exit (0);
17615 end conftest;
17616 CF_EOF
17617 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17618    if ( ./conftest 1>&5 2>&1 ) ; then
17619       cf_cv_prog_gnat_correct=yes
17620    else
17621       cf_cv_prog_gnat_correct=no
17622    fi
17623 else
17624    cf_cv_prog_gnat_correct=no
17625 fi
17626 rm -rf ./conftest* ./*~conftest*
17627
17628                         echo "$as_me:17628: result: $cf_cv_prog_gnat_correct" >&5
17629 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17630                 fi
17631         else
17632                 cf_cv_prog_gnat_correct=no
17633         fi
17634 fi
17635
17636         if test "$cf_cv_prog_gnat_correct" = yes; then
17637
17638         echo "$as_me:17638: checking optimization options for ADAFLAGS" >&5
17639 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17640         case "$CFLAGS" in
17641         (*-g*)
17642
17643         ADAFLAGS="$ADAFLAGS -g"
17644
17645                 ;;
17646         esac
17647         case "$CFLAGS" in
17648         (*-O*)
17649                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17650
17651         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17652
17653                 ;;
17654         esac
17655         echo "$as_me:17655: result: $ADAFLAGS" >&5
17656 echo "${ECHO_T}$ADAFLAGS" >&6
17657
17658 echo "$as_me:17658: checking if GNATPREP supports -T option" >&5
17659 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17660 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17661   echo $ECHO_N "(cached) $ECHO_C" >&6
17662 else
17663
17664 cf_cv_gnatprep_opt_t=no
17665 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17666
17667 fi
17668 echo "$as_me:17668: result: $cf_cv_gnatprep_opt_t" >&5
17669 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17670 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17671
17672 echo "$as_me:17672: checking if GNAT supports generics" >&5
17673 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17674 case "$cf_cv_gnat_version" in
17675 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17676         cf_gnat_generics=yes
17677         ;;
17678 (*)
17679         cf_gnat_generics=no
17680         ;;
17681 esac
17682 echo "$as_me:17682: result: $cf_gnat_generics" >&5
17683 echo "${ECHO_T}$cf_gnat_generics" >&6
17684
17685 if test "$cf_gnat_generics" = yes
17686 then
17687         cf_compile_generics=generics
17688         cf_generic_objects="\${GENOBJS}"
17689 else
17690         cf_compile_generics=
17691         cf_generic_objects=
17692 fi
17693
17694 echo "$as_me:17694: checking if GNAT supports SIGINT" >&5
17695 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17696 if test "${cf_cv_gnat_sigint+set}" = set; then
17697   echo $ECHO_N "(cached) $ECHO_C" >&6
17698 else
17699
17700 rm -rf ./conftest* ./*~conftest*
17701 cat >>conftest.ads <<CF_EOF
17702 with Ada.Interrupts.Names;
17703
17704 package ConfTest is
17705
17706    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17707    pragma Unreserve_All_Interrupts;
17708    pragma Warnings (On);
17709
17710    protected Process is
17711       procedure Stop;
17712       function Continue return Boolean;
17713       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17714    private
17715       Done : Boolean := False;
17716    end Process;
17717
17718 end ConfTest;
17719 CF_EOF
17720 cat >>conftest.adb <<CF_EOF
17721 package body ConfTest is
17722    protected body Process is
17723       procedure Stop is
17724       begin
17725          Done := True;
17726       end Stop;
17727       function Continue return Boolean is
17728       begin
17729          return not Done;
17730       end Continue;
17731    end Process;
17732 end ConfTest;
17733 CF_EOF
17734 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17735       cf_cv_gnat_sigint=yes
17736 else
17737    cf_cv_gnat_sigint=no
17738 fi
17739 rm -rf ./conftest* ./*~conftest*
17740
17741 fi
17742 echo "$as_me:17742: result: $cf_cv_gnat_sigint" >&5
17743 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17744
17745 if test "$cf_cv_gnat_sigint" = yes ; then
17746         USE_GNAT_SIGINT=""
17747 else
17748         USE_GNAT_SIGINT="#"
17749 fi
17750
17751 cf_gnat_libraries=no
17752 cf_gnat_projects=no
17753
17754 if test "$enable_gnat_projects" != no ; then
17755 echo "$as_me:17755: checking if GNAT supports project files" >&5
17756 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17757 case "$cf_cv_gnat_version" in
17758 (3.[0-9]*)
17759         ;;
17760 (*)
17761         case "$cf_cv_system_name" in
17762         (cygwin*|msys*)
17763                 ;;
17764         (*)
17765                 rm -rf ./conftest* ./*~conftest*
17766                 if mkdir conftest.src conftest.bin conftest.lib
17767                 then
17768                         cd conftest.src
17769                         rm -rf ./conftest* ./*~conftest*
17770                         cat >>library.gpr <<CF_EOF
17771 project Library is
17772   Kind := External ("LIB_KIND");
17773   for Library_Name use "ConfTest";
17774   for Object_Dir use ".";
17775   for Library_ALI_Dir use External("LIBRARY_DIR");
17776   for Library_Version use External ("SONAME");
17777   for Library_Kind use Kind;
17778   for Library_Dir use External("BUILD_DIR");
17779   Source_Dir := External ("SOURCE_DIR");
17780   for Source_Dirs use (Source_Dir);
17781 end Library;
17782 CF_EOF
17783                         cat >>confpackage.ads <<CF_EOF
17784 package ConfPackage is
17785    procedure conftest;
17786 end ConfPackage;
17787 CF_EOF
17788                         cat >>confpackage.adb <<CF_EOF
17789 with Text_IO;
17790 package body ConfPackage is
17791    procedure conftest is
17792    begin
17793       Text_IO.Put ("Hello World");
17794       Text_IO.New_Line;
17795    end conftest;
17796 end ConfPackage;
17797 CF_EOF
17798                         if ( "$cf_ada_make" $ADAFLAGS \
17799                                         -Plibrary.gpr \
17800                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17801                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17802                                         -XSOURCE_DIR="`pwd`" \
17803                                         -XSONAME=libConfTest.so.1 \
17804                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17805                                 cf_gnat_projects=yes
17806                         fi
17807                         cd ..
17808                 fi
17809                 if test -f conftest.lib/confpackage.ali
17810                 then
17811                         cf_gnat_libraries=yes
17812                 fi
17813                 rm -rf ./conftest* ./*~conftest*
17814                 ;;
17815         esac
17816         ;;
17817 esac
17818 echo "$as_me:17818: result: $cf_gnat_projects" >&5
17819 echo "${ECHO_T}$cf_gnat_projects" >&6
17820 fi # enable_gnat_projects
17821
17822 if test "$cf_gnat_projects" = yes
17823 then
17824         echo "$as_me:17824: checking if GNAT supports libraries" >&5
17825 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17826         echo "$as_me:17826: result: $cf_gnat_libraries" >&5
17827 echo "${ECHO_T}$cf_gnat_libraries" >&6
17828 fi
17829
17830 USE_OLD_MAKERULES=""
17831 USE_GNAT_PROJECTS="#"
17832 USE_GNAT_MAKE_GPR="#"
17833 USE_GNAT_GPRBUILD="#"
17834
17835 if test "$cf_gnat_projects" = yes
17836 then
17837         USE_OLD_MAKERULES="#"
17838         USE_GNAT_PROJECTS=""
17839         if test "$cf_cv_VERSION_GPRBUILD" != no
17840         then
17841                 USE_GNAT_GPRBUILD=""
17842         elif test "$cf_cv_VERSION_GNATMAKE" != no
17843         then
17844                 USE_GNAT_MAKE_GPR=""
17845         else
17846                 { echo "$as_me:17846: WARNING: use old makefile rules since tools are missing" >&5
17847 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17848         fi
17849 fi
17850
17851 if test "$cf_gnat_libraries" = yes
17852 then
17853         USE_GNAT_LIBRARIES=""
17854 else
17855         USE_GNAT_LIBRARIES="#"
17856 fi
17857
17858 echo "$as_me:17858: checking for ada-compiler" >&5
17859 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17860
17861 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17862 if test "${with_ada_compiler+set}" = set; then
17863   withval="$with_ada_compiler"
17864   cf_ada_compiler=$withval
17865 else
17866   cf_ada_compiler=gnatmake
17867 fi;
17868
17869 echo "$as_me:17869: result: $cf_ada_compiler" >&5
17870 echo "${ECHO_T}$cf_ada_compiler" >&6
17871
17872                 cf_ada_package=terminal_interface
17873
17874 echo "$as_me:17874: checking for ada-include" >&5
17875 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17876
17877 # Check whether --with-ada-include or --without-ada-include was given.
17878 if test "${with_ada_include+set}" = set; then
17879   withval="$with_ada_include"
17880
17881 else
17882   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17883 fi; if test -n "$prefix/share/ada/adainclude" ; then
17884
17885 if test "x$prefix" != xNONE; then
17886         cf_path_syntax="$prefix"
17887 else
17888         cf_path_syntax="$ac_default_prefix"
17889 fi
17890
17891 case ".$withval" in
17892 (.\$\(*\)*|.\'*\'*)
17893         ;;
17894 (..|./*|.\\*)
17895         ;;
17896 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17897         ;;
17898 (.\$\{*prefix\}*|.\$\{*dir\}*)
17899         eval withval="$withval"
17900         case ".$withval" in
17901         (.NONE/*)
17902                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17903                 ;;
17904         esac
17905         ;;
17906 (.no|.NONE/*)
17907         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17908         ;;
17909 (*)
17910         { { echo "$as_me:17910: error: expected a pathname, not \"$withval\"" >&5
17911 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17912    { (exit 1); exit 1; }; }
17913         ;;
17914 esac
17915
17916 fi
17917 eval ADA_INCLUDE="$withval"
17918
17919 echo "$as_me:17919: result: $ADA_INCLUDE" >&5
17920 echo "${ECHO_T}$ADA_INCLUDE" >&6
17921
17922 echo "$as_me:17922: checking for ada-objects" >&5
17923 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17924
17925 # Check whether --with-ada-objects or --without-ada-objects was given.
17926 if test "${with_ada_objects+set}" = set; then
17927   withval="$with_ada_objects"
17928
17929 else
17930   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17931 fi; if test -n "$prefix/lib/ada/adalib" ; then
17932
17933 if test "x$prefix" != xNONE; then
17934         cf_path_syntax="$prefix"
17935 else
17936         cf_path_syntax="$ac_default_prefix"
17937 fi
17938
17939 case ".$withval" in
17940 (.\$\(*\)*|.\'*\'*)
17941         ;;
17942 (..|./*|.\\*)
17943         ;;
17944 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17945         ;;
17946 (.\$\{*prefix\}*|.\$\{*dir\}*)
17947         eval withval="$withval"
17948         case ".$withval" in
17949         (.NONE/*)
17950                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17951                 ;;
17952         esac
17953         ;;
17954 (.no|.NONE/*)
17955         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17956         ;;
17957 (*)
17958         { { echo "$as_me:17958: error: expected a pathname, not \"$withval\"" >&5
17959 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17960    { (exit 1); exit 1; }; }
17961         ;;
17962 esac
17963
17964 fi
17965 eval ADA_OBJECTS="$withval"
17966
17967 echo "$as_me:17967: result: $ADA_OBJECTS" >&5
17968 echo "${ECHO_T}$ADA_OBJECTS" >&6
17969
17970 echo "$as_me:17970: checking if an Ada95 shared-library should be built" >&5
17971 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17972
17973 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17974 if test "${with_ada_sharedlib+set}" = set; then
17975   withval="$with_ada_sharedlib"
17976   with_ada_sharedlib=$withval
17977 else
17978   with_ada_sharedlib=no
17979 fi;
17980 echo "$as_me:17980: result: $with_ada_sharedlib" >&5
17981 echo "${ECHO_T}$with_ada_sharedlib" >&6
17982
17983 if test "x$with_ada_sharedlib" != xno
17984 then
17985         if test "x$cf_gnat_projects" != xyes
17986         then
17987                 { echo "$as_me:17987: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17988 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17989                 with_ada_sharedlib=no
17990         fi
17991 fi
17992
17993 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17994 MAKE_ADA_SHAREDLIB="#"
17995
17996 if test "x$with_ada_sharedlib" != xno
17997 then
17998         MAKE_ADA_SHAREDLIB=
17999         if test "x$with_ada_sharedlib" != xyes
18000         then
18001                 ADA_SHAREDLIB="$with_ada_sharedlib"
18002         fi
18003 fi
18004
18005                 # allow the Ada binding to be renamed
18006
18007 echo "$as_me:18007: checking for ada-libname" >&5
18008 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
18009
18010 # Check whether --with-ada-libname or --without-ada-libname was given.
18011 if test "${with_ada_libname+set}" = set; then
18012   withval="$with_ada_libname"
18013   ADA_LIBNAME=$withval
18014 else
18015   ADA_LIBNAME=AdaCurses
18016 fi;
18017 case "x$ADA_LIBNAME" in
18018 (x|xyes|xno)
18019         ADA_LIBNAME=AdaCurses
18020         ;;
18021 esac
18022
18023 echo "$as_me:18023: result: $ADA_LIBNAME" >&5
18024 echo "${ECHO_T}$ADA_LIBNAME" >&6
18025
18026         else
18027                 { { echo "$as_me:18027: error: No usable Ada compiler found" >&5
18028 echo "$as_me: error: No usable Ada compiler found" >&2;}
18029    { (exit 1); exit 1; }; }
18030         fi
18031 else
18032         { { echo "$as_me:18032: error: The Ada compiler is needed for this package" >&5
18033 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18034    { (exit 1); exit 1; }; }
18035 fi
18036
18037 ################################################################################
18038
18039 # not needed
18040 TINFO_LDFLAGS2=
18041
18042 TINFO_LIBS=
18043
18044 ### Construct the list of include-directories to be generated
18045
18046 if test "$srcdir" != "."; then
18047         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18048 fi
18049 CPPFLAGS="-I../include $CPPFLAGS"
18050 if test "$srcdir" != "."; then
18051         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18052 fi
18053 CPPFLAGS="-I. $CPPFLAGS"
18054
18055 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18056 if test "$srcdir" != "."; then
18057         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18058 fi
18059 if test "$GCC" != yes; then
18060         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18061 elif test "$includedir" != "/usr/include"; then
18062         if test "$includedir" = '${prefix}/include' ; then
18063                 if test x$prefix != x/usr ; then
18064                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18065                 fi
18066         else
18067                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18068         fi
18069 fi
18070
18071 ### Build up pieces for makefile rules
18072 echo "$as_me:18072: checking default library suffix" >&5
18073 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18074
18075         case $DFT_LWR_MODEL in
18076         (libtool) DFT_ARG_SUFFIX=''   ;;
18077         (normal)  DFT_ARG_SUFFIX=''   ;;
18078         (debug)   DFT_ARG_SUFFIX='_g' ;;
18079         (profile) DFT_ARG_SUFFIX='_p' ;;
18080         (shared)  DFT_ARG_SUFFIX=''   ;;
18081         esac
18082         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18083 echo "$as_me:18083: result: $DFT_ARG_SUFFIX" >&5
18084 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18085
18086 echo "$as_me:18086: checking default library-dependency suffix" >&5
18087 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18088
18089         case X$DFT_LWR_MODEL in
18090         (Xlibtool)
18091                 DFT_LIB_SUFFIX='.la'
18092                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18093                 ;;
18094         (Xdebug)
18095                 case "$cf_cv_system_name" in
18096                 (*-msvc*)
18097                         DFT_LIB_SUFFIX='_g.lib'
18098                         ;;
18099                 (*)
18100                         DFT_LIB_SUFFIX='_g.a'
18101                         ;;
18102                 esac
18103                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18104                 ;;
18105         (Xprofile)
18106                 case "$cf_cv_system_name" in
18107                 (*-msvc*)
18108                         DFT_LIB_SUFFIX='_p.lib'
18109                         ;;
18110                 (*)
18111                         DFT_LIB_SUFFIX='_p.a'
18112                         ;;
18113                 esac
18114                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18115                 ;;
18116         (Xshared)
18117                 case "$cf_cv_system_name" in
18118                 (aix[5-7]*)
18119                         DFT_LIB_SUFFIX='.so'
18120                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18121                         ;;
18122                 (*-msvc*)
18123                         DFT_LIB_SUFFIX='.dll'
18124                         DFT_DEP_SUFFIX='.dll.lib'
18125                         ;;
18126                 (cygwin*|msys*|mingw*)
18127                         DFT_LIB_SUFFIX='.dll'
18128                         DFT_DEP_SUFFIX='.dll.a'
18129                         ;;
18130                 (darwin*)
18131                         DFT_LIB_SUFFIX='.dylib'
18132                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18133                         ;;
18134                 (hpux*)
18135                         case "$target" in
18136                         (ia64*)
18137                                 DFT_LIB_SUFFIX='.so'
18138                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18139                                 ;;
18140                         (*)
18141                                 DFT_LIB_SUFFIX='.sl'
18142                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18143                                 ;;
18144                         esac
18145                         ;;
18146                 (*)
18147                         DFT_LIB_SUFFIX='.so'
18148                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18149                         ;;
18150                 esac
18151                 ;;
18152         (*)
18153                 case "$target" in
18154                 (*-msvc*)
18155                         DFT_LIB_SUFFIX='.lib'
18156                         ;;
18157                 (*)
18158                         DFT_LIB_SUFFIX='.a'
18159                         ;;
18160                 esac
18161                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18162                 ;;
18163         esac
18164         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18165         then
18166                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18167                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18168         fi
18169 echo "$as_me:18169: result: $DFT_DEP_SUFFIX" >&5
18170 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18171
18172 echo "$as_me:18172: checking default object directory" >&5
18173 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18174
18175         case $DFT_LWR_MODEL in
18176         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18177         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18178         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18179         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18180         (shared)
18181                 case "$cf_cv_system_name" in
18182                 (cygwin|msys)
18183                         DFT_OBJ_SUBDIR='objects' ;;
18184                 (*)
18185                         DFT_OBJ_SUBDIR='obj_s' ;;
18186                 esac
18187         esac
18188 echo "$as_me:18188: result: $DFT_OBJ_SUBDIR" >&5
18189 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18190
18191 ### Set up low-level terminfo dependencies for makefiles.
18192
18193 if test "$DFT_LWR_MODEL" = shared ; then
18194         case $cf_cv_system_name in
18195         (cygwin*)
18196                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18197                 ;;
18198         (msys*)
18199                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18200                 ;;
18201         esac
18202 fi
18203
18204 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18205
18206 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18207
18208 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18209
18210 ### Construct the list of subdirectories for which we'll customize makefiles
18211 ### with the appropriate compile-rules.
18212
18213 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18214
18215 cat >>confdefs.h <<EOF
18216 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18217 EOF
18218
18219 ################################################################################
18220
18221 TEST_ARG2=
18222
18223 TEST_LIBS2=
18224
18225 NCURSES_SHLIB2="sh -c"
18226
18227 ADA_SUBDIRS="include gen src doc"
18228 if test "x$cf_with_tests" != "xno" ; then
18229         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18230 fi
18231 for cf_dir in $ADA_SUBDIRS
18232 do
18233         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18234 done
18235
18236 NCURSES_TREE="#"
18237
18238 EXTERNAL_TREE=
18239
18240 # match layout used by make-tar.sh
18241 ADAHTML_DIR=../doc/ada
18242
18243 if test "x$cross_compiling" = xyes ; then
18244         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18245 else
18246         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18247 fi
18248
18249 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"
18250 ac_config_commands="$ac_config_commands default"
18251 cat >confcache <<\_ACEOF
18252 # This file is a shell script that caches the results of configure
18253 # tests run on this system so they can be shared between configure
18254 # scripts and configure runs, see configure's option --config-cache.
18255 # It is not useful on other systems.  If it contains results you don't
18256 # want to keep, you may remove or edit it.
18257 #
18258 # config.status only pays attention to the cache file if you give it
18259 # the --recheck option to rerun configure.
18260 #
18261 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18262 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18263 # following values.
18264
18265 _ACEOF
18266
18267 # The following way of writing the cache mishandles newlines in values,
18268 # but we know of no workaround that is simple, portable, and efficient.
18269 # So, don't put newlines in cache variables' values.
18270 # Ultrix sh set writes to stderr and can't be redirected directly,
18271 # and sets the high bit in the cache file unless we assign to the vars.
18272 {
18273   (set) 2>&1 |
18274     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18275     *ac_space=\ *)
18276       # `set' does not quote correctly, so add quotes (double-quote
18277       # substitution turns \\\\ into \\, and sed turns \\ into \).
18278       sed -n \
18279         "s/'/'\\\\''/g;
18280           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18281       ;;
18282     *)
18283       # `set' quotes correctly as required by POSIX, so do not add quotes.
18284       sed -n \
18285         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18286       ;;
18287     esac;
18288 } |
18289   sed '
18290      t clear
18291      : clear
18292      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18293      t end
18294      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18295      : end' >>confcache
18296 if cmp -s $cache_file confcache; then :; else
18297   if test -w $cache_file; then
18298     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18299     cat confcache >$cache_file
18300   else
18301     echo "not updating unwritable cache $cache_file"
18302   fi
18303 fi
18304 rm -f confcache
18305
18306 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18307 # Let make expand exec_prefix.
18308 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18309
18310 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18311 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18312 # trailing colons and then remove the whole line if VPATH becomes empty
18313 # (actually we leave an empty line to preserve line numbers).
18314 if test "x$srcdir" = x.; then
18315   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18316 s/:*\$(srcdir):*/:/;
18317 s/:*\${srcdir}:*/:/;
18318 s/:*@srcdir@:*/:/;
18319 s/^\([^=]*=[    ]*\):*/\1/;
18320 s/:*$//;
18321 s/^[^=]*=[      ]*$//;
18322 }'
18323 fi
18324
18325 DEFS=-DHAVE_CONFIG_H
18326
18327 : "${CONFIG_STATUS=./config.status}"
18328 ac_clean_files_save=$ac_clean_files
18329 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18330 { echo "$as_me:18330: creating $CONFIG_STATUS" >&5
18331 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18332 cat >"$CONFIG_STATUS" <<_ACEOF
18333 #! $SHELL
18334 # Generated automatically by configure.
18335 # Run this file to recreate the current configuration.
18336 # Compiler output produced by configure, useful for debugging
18337 # configure, is in config.log if it exists.
18338
18339 debug=false
18340 SHELL=\${CONFIG_SHELL-$SHELL}
18341 ac_cs_invocation="\$0 \$@"
18342
18343 CLICOLOR_FORCE= GREP_OPTIONS=
18344 unset CLICOLOR_FORCE GREP_OPTIONS
18345 _ACEOF
18346
18347 cat >>"$CONFIG_STATUS" <<\_ACEOF
18348 # Be Bourne compatible
18349 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18350   emulate sh
18351   NULLCMD=:
18352 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18353   set -o posix
18354 fi
18355
18356 # Name of the executable.
18357 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18358
18359 if expr a : '\(a\)' >/dev/null 2>&1; then
18360   as_expr=expr
18361 else
18362   as_expr=false
18363 fi
18364
18365 rm -f conf$$ conf$$.exe conf$$.file
18366 echo >conf$$.file
18367 if ln -s conf$$.file conf$$ 2>/dev/null; then
18368   # We could just check for DJGPP; but this test a) works b) is more generic
18369   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18370   if test -f conf$$.exe; then
18371     # Don't use ln at all; we don't have any links
18372     as_ln_s='cp -p'
18373   else
18374     as_ln_s='ln -s'
18375   fi
18376 elif ln conf$$.file conf$$ 2>/dev/null; then
18377   as_ln_s=ln
18378 else
18379   as_ln_s='cp -p'
18380 fi
18381 rm -f conf$$ conf$$.exe conf$$.file
18382
18383 as_executable_p="test -f"
18384
18385 # Support unset when possible.
18386 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18387   as_unset="unset"
18388 else
18389   as_unset="false"
18390 fi
18391
18392 # NLS nuisances.
18393 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18394 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18395 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18396 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18397 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18398 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18399 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18400 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18401
18402 # IFS
18403 # We need space, tab and new line, in precisely that order.
18404 as_nl='
18405 '
18406 IFS="   $as_nl"
18407
18408 # CDPATH.
18409 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18410
18411 exec 6>&1
18412
18413 _ACEOF
18414
18415 # Files that config.status was made for.
18416 if test -n "$ac_config_files"; then
18417   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18418 fi
18419
18420 if test -n "$ac_config_headers"; then
18421   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18422 fi
18423
18424 if test -n "$ac_config_links"; then
18425   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18426 fi
18427
18428 if test -n "$ac_config_commands"; then
18429   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18430 fi
18431
18432 cat >>"$CONFIG_STATUS" <<\EOF
18433
18434 ac_cs_usage="\
18435 \`$as_me' instantiates files from templates according to the
18436 current configuration.
18437
18438 Usage: $0 [OPTIONS] [FILE]...
18439
18440   -h, --help       print this help, then exit
18441   -V, --version    print version number, then exit
18442   -d, --debug      don't remove temporary files
18443       --recheck    update $as_me by reconfiguring in the same conditions
18444   --file=FILE[:TEMPLATE]
18445                    instantiate the configuration file FILE
18446   --header=FILE[:TEMPLATE]
18447                    instantiate the configuration header FILE
18448
18449 Configuration files:
18450 $config_files
18451
18452 Configuration headers:
18453 $config_headers
18454
18455 Configuration commands:
18456 $config_commands
18457
18458 Report bugs to <dickey@invisible-island.net>."
18459 EOF
18460
18461 cat >>"$CONFIG_STATUS" <<EOF
18462 ac_cs_version="\\
18463 config.status
18464 configured by $0, generated by GNU Autoconf 2.52.20210509,
18465   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18466
18467 Copyright 2003-2020,2021        Thomas E. Dickey
18468 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18469 Free Software Foundation, Inc.
18470 This config.status script is free software; the Free Software Foundation
18471 gives unlimited permission to copy, distribute and modify it."
18472 srcdir="$srcdir"
18473 INSTALL="$INSTALL"
18474 EOF
18475
18476 cat >>"$CONFIG_STATUS" <<\EOF
18477 # If no file are specified by the user, then we need to provide default
18478 # value.  By we need to know if files were specified by the user.
18479 ac_need_defaults=:
18480 while test $# != 0
18481 do
18482   case $1 in
18483   --*=*)
18484     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18485     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18486     shift
18487     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18488     shift
18489     ;;
18490   -*);;
18491   *) # This is not an option, so the user has probably given explicit
18492      # arguments.
18493      ac_need_defaults=false;;
18494   esac
18495
18496   case $1 in
18497   # Handling of the options.
18498 EOF
18499 cat >>"$CONFIG_STATUS" <<EOF
18500   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18501     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18502     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18503 EOF
18504 cat >>"$CONFIG_STATUS" <<\EOF
18505   --version | --vers* | -V )
18506     echo "$ac_cs_version"; exit 0 ;;
18507   --he | --h)
18508     # Conflict between --help and --header
18509     { { echo "$as_me:18509: error: ambiguous option: $1
18510 Try \`$0 --help' for more information." >&5
18511 echo "$as_me: error: ambiguous option: $1
18512 Try \`$0 --help' for more information." >&2;}
18513    { (exit 1); exit 1; }; };;
18514   --help | --hel | -h )
18515     echo "$ac_cs_usage"; exit 0 ;;
18516   --debug | --d* | -d )
18517     debug=: ;;
18518   --file | --fil | --fi | --f )
18519     shift
18520     CONFIG_FILES="$CONFIG_FILES $1"
18521     ac_need_defaults=false;;
18522   --header | --heade | --head | --hea )
18523     shift
18524     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18525     ac_need_defaults=false;;
18526
18527   # This is an error.
18528   -*) { { echo "$as_me:18528: error: unrecognized option: $1
18529 Try \`$0 --help' for more information." >&5
18530 echo "$as_me: error: unrecognized option: $1
18531 Try \`$0 --help' for more information." >&2;}
18532    { (exit 1); exit 1; }; } ;;
18533
18534   *) ac_config_targets="$ac_config_targets $1" ;;
18535
18536   esac
18537   shift
18538 done
18539
18540 exec 5>>config.log
18541 cat >&5 << _ACEOF
18542
18543 ## ----------------------- ##
18544 ## Running config.status.  ##
18545 ## ----------------------- ##
18546
18547 This file was extended by $as_me 2.52.20210509, executed with
18548   CONFIG_FILES    = $CONFIG_FILES
18549   CONFIG_HEADERS  = $CONFIG_HEADERS
18550   CONFIG_LINKS    = $CONFIG_LINKS
18551   CONFIG_COMMANDS = $CONFIG_COMMANDS
18552   > "$ac_cs_invocation"
18553 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18554
18555 _ACEOF
18556 EOF
18557
18558 cat >>"$CONFIG_STATUS" <<EOF
18559 #
18560 # INIT-COMMANDS section.
18561 #
18562
18563 ### Special initialization commands, used to pass information from the
18564 ### configuration-run into config.status
18565
18566 AWK="$AWK"
18567 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18568 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18569 LIB_NAME="$LIB_NAME"
18570 LIB_PREFIX="$LIB_PREFIX"
18571 LIB_SUFFIX="$LIB_SUFFIX"
18572 LN_S="$LN_S"
18573 NCURSES_MAJOR="$NCURSES_MAJOR"
18574 NCURSES_MINOR="$NCURSES_MINOR"
18575 NCURSES_PATCH="$NCURSES_PATCH"
18576 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18577 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18578 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18579 cf_cv_abi_version="$cf_cv_abi_version"
18580 cf_cv_rel_version="$cf_cv_rel_version"
18581 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18582 cf_cv_shared_soname='$cf_cv_shared_soname'
18583 cf_cv_shlib_version="$cf_cv_shlib_version"
18584 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18585 cf_cv_system_name="$cf_cv_system_name"
18586 host="$host"
18587 target="$target"
18588
18589 EOF
18590
18591 cat >>"$CONFIG_STATUS" <<\EOF
18592 for ac_config_target in $ac_config_targets
18593 do
18594   case "$ac_config_target" in
18595   # Handling of arguments.
18596   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18597   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18598   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18599   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18600   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18601   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18602   *) { { echo "$as_me:18602: error: invalid argument: $ac_config_target" >&5
18603 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18604    { (exit 1); exit 1; }; };;
18605   esac
18606 done
18607
18608 # If the user did not use the arguments to specify the items to instantiate,
18609 # then the envvar interface is used.  Set only those that are not.
18610 # We use the long form for the default assignment because of an extremely
18611 # bizarre bug on SunOS 4.1.3.
18612 if "$ac_need_defaults"; then
18613   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18614   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18615   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18616 fi
18617
18618 # Create a temporary directory, and hook for its removal unless debugging.
18619 $debug ||
18620 {
18621   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18622   trap '{ (exit 1); exit 1; }' 1 2 13 15
18623 }
18624
18625 # Create a (secure) tmp directory for tmp files.
18626 : ${TMPDIR=/tmp}
18627 {
18628   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18629   test -n "$tmp" && test -d "$tmp"
18630 }  ||
18631 {
18632   tmp=$TMPDIR/cs$$-$RANDOM
18633   (umask 077 && mkdir $tmp)
18634 } ||
18635 {
18636    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18637    { (exit 1); exit 1; }
18638 }
18639
18640 EOF
18641
18642 cat >>"$CONFIG_STATUS" <<EOF
18643
18644 #
18645 # CONFIG_FILES section.
18646 #
18647
18648 # No need to generate the scripts if there are no CONFIG_FILES.
18649 # This happens for instance when ./config.status config.h
18650 if test -n "\$CONFIG_FILES"; then
18651   # Protect against being on the right side of a sed subst in config.status.
18652   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18653    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18654 s,@SHELL@,$SHELL,;t t
18655 s,@exec_prefix@,$exec_prefix,;t t
18656 s,@prefix@,$prefix,;t t
18657 s,@program_transform_name@,$program_transform_name,;t t
18658 s,@bindir@,$bindir,;t t
18659 s,@sbindir@,$sbindir,;t t
18660 s,@libexecdir@,$libexecdir,;t t
18661 s,@datarootdir@,$datarootdir,;t t
18662 s,@datadir@,$datadir,;t t
18663 s,@sysconfdir@,$sysconfdir,;t t
18664 s,@sharedstatedir@,$sharedstatedir,;t t
18665 s,@localstatedir@,$localstatedir,;t t
18666 s,@runstatedir@,$runstatedir,;t t
18667 s,@libdir@,$libdir,;t t
18668 s,@includedir@,$includedir,;t t
18669 s,@oldincludedir@,$oldincludedir,;t t
18670 s,@infodir@,$infodir,;t t
18671 s,@mandir@,$mandir,;t t
18672 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18673 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18674 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18675 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18676 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18677 s,@build_alias@,$build_alias,;t t
18678 s,@host_alias@,$host_alias,;t t
18679 s,@target_alias@,$target_alias,;t t
18680 s,@ECHO_C@,$ECHO_C,;t t
18681 s,@ECHO_N@,$ECHO_N,;t t
18682 s,@ECHO_T@,$ECHO_T,;t t
18683 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18684 s,@DEFS@,$DEFS,;t t
18685 s,@LIBS@,$LIBS,;t t
18686 s,@top_builddir@,$top_builddir,;t t
18687 s,@build@,$build,;t t
18688 s,@build_cpu@,$build_cpu,;t t
18689 s,@build_vendor@,$build_vendor,;t t
18690 s,@build_os@,$build_os,;t t
18691 s,@host@,$host,;t t
18692 s,@host_cpu@,$host_cpu,;t t
18693 s,@host_vendor@,$host_vendor,;t t
18694 s,@host_os@,$host_os,;t t
18695 s,@target@,$target,;t t
18696 s,@target_cpu@,$target_cpu,;t t
18697 s,@target_vendor@,$target_vendor,;t t
18698 s,@target_os@,$target_os,;t t
18699 s,@GREP@,$GREP,;t t
18700 s,@FGREP@,$FGREP,;t t
18701 s,@CC@,$CC,;t t
18702 s,@CFLAGS@,$CFLAGS,;t t
18703 s,@LDFLAGS@,$LDFLAGS,;t t
18704 s,@CPPFLAGS@,$CPPFLAGS,;t t
18705 s,@ac_ct_CC@,$ac_ct_CC,;t t
18706 s,@EXEEXT@,$EXEEXT,;t t
18707 s,@OBJEXT@,$OBJEXT,;t t
18708 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18709 s,@CPP@,$CPP,;t t
18710 s,@EGREP@,$EGREP,;t t
18711 s,@AWK@,$AWK,;t t
18712 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18713 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18714 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18715 s,@LN_S@,$LN_S,;t t
18716 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18717 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18718 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18719 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18720 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18721 s,@SET_MAKE@,$SET_MAKE,;t t
18722 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18723 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18724 s,@CTAGS@,$CTAGS,;t t
18725 s,@ETAGS@,$ETAGS,;t t
18726 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18727 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18728 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18729 s,@RANLIB@,$RANLIB,;t t
18730 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18731 s,@LD@,$LD,;t t
18732 s,@ac_ct_LD@,$ac_ct_LD,;t t
18733 s,@AR@,$AR,;t t
18734 s,@ac_ct_AR@,$ac_ct_AR,;t t
18735 s,@ARFLAGS@,$ARFLAGS,;t t
18736 s,@DESTDIR@,$DESTDIR,;t t
18737 s,@BUILD_CC@,$BUILD_CC,;t t
18738 s,@BUILD_CPP@,$BUILD_CPP,;t t
18739 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18740 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18741 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18742 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18743 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18744 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18745 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18746 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18747 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18748 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18749 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18750 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18751 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18752 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18753 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18754 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18755 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18756 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18757 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18758 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18759 s,@CC_G_OPT@,$CC_G_OPT,;t t
18760 s,@LD_MODEL@,$LD_MODEL,;t t
18761 s,@shlibdir@,$shlibdir,;t t
18762 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18763 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18764 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18765 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18766 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18767 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18768 s,@LINK_PROGS@,$LINK_PROGS,;t t
18769 s,@LINK_TESTS@,$LINK_TESTS,;t t
18770 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18771 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18772 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18773 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18774 s,@RPATH_LIST@,$RPATH_LIST,;t t
18775 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18776 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18777 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18778 s,@PTHREAD@,$PTHREAD,;t t
18779 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18780 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18781 s,@ECHO_LT@,$ECHO_LT,;t t
18782 s,@ECHO_LD@,$ECHO_LD,;t t
18783 s,@RULE_CC@,$RULE_CC,;t t
18784 s,@SHOW_CC@,$SHOW_CC,;t t
18785 s,@ECHO_CC@,$ECHO_CC,;t t
18786 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18787 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18788 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18789 s,@ADAFLAGS@,$ADAFLAGS,;t t
18790 s,@ADA_TRACE@,$ADA_TRACE,;t t
18791 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18792 s,@M4_exists@,$M4_exists,;t t
18793 s,@cf_ada_make@,$cf_ada_make,;t t
18794 s,@cf_ada_config@,$cf_ada_config,;t t
18795 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18796 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18797 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18798 s,@cf_compile_generics@,$cf_compile_generics,;t t
18799 s,@cf_generic_objects@,$cf_generic_objects,;t t
18800 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18801 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18802 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18803 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18804 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18805 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18806 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18807 s,@cf_ada_package@,$cf_ada_package,;t t
18808 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18809 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18810 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18811 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18812 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18813 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18814 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18815 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18816 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18817 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18818 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18819 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18820 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18821 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18822 s,@TEST_ARG2@,$TEST_ARG2,;t t
18823 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18824 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18825 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18826 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18827 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18828 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18829 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18830 CEOF
18831
18832 EOF
18833
18834   cat >>"$CONFIG_STATUS" <<\EOF
18835   # Split the substitutions into bite-sized pieces for seds with
18836   # small command number limits, like on Digital OSF/1 and HP-UX.
18837   ac_max_sed_lines=48
18838   ac_sed_frag=1 # Number of current file.
18839   ac_beg=1 # First line for current file.
18840   ac_end=$ac_max_sed_lines # Line after last line for current file.
18841   ac_more_lines=:
18842   ac_sed_cmds=
18843   while "$ac_more_lines"; do
18844     if test "$ac_beg" -gt 1; then
18845       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18846     else
18847       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18848     fi
18849     if test ! -s $tmp/subs.frag; then
18850       ac_more_lines=false
18851     else
18852       # The purpose of the label and of the branching condition is to
18853       # speed up the sed processing (if there are no `@' at all, there
18854       # is no need to browse any of the substitutions).
18855       # These are the two extra sed commands mentioned above.
18856       (echo ':t
18857   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18858       # It is possible to make a multiline substitution using escaped newlines.
18859       # Ensure that we do not split the substitution between script fragments.
18860       ac_BEG=$ac_end
18861       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18862       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18863       if test -s $tmp/subs.next; then
18864         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18865         if test ! -s $tmp/subs.edit; then
18866           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18867           if test ! -s $tmp/subs.edit; then
18868             if test "$ac_beg" -gt 1; then
18869               ac_end=`expr "$ac_end" - 1`
18870               continue
18871             fi
18872           fi
18873         fi
18874       fi
18875
18876       if test -z "$ac_sed_cmds"; then
18877         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18878       else
18879         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18880       fi
18881       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18882       ac_beg=$ac_end
18883       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18884     fi
18885   done
18886   if test -z "$ac_sed_cmds"; then
18887     ac_sed_cmds=cat
18888   fi
18889 fi # test -n "$CONFIG_FILES"
18890
18891 EOF
18892 cat >>"$CONFIG_STATUS" <<\EOF
18893 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18894   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18895   case "$ac_file" in
18896   - | *:- | *:-:* ) # input from stdin
18897         cat >$tmp/stdin
18898         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18899         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18900   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18901         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18902   * )   ac_file_in=$ac_file.in ;;
18903   esac
18904
18905   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18906   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18907          X"$ac_file" : 'X\(//\)[^/]' \| \
18908          X"$ac_file" : 'X\(//\)$' \| \
18909          X"$ac_file" : 'X\(/\)' \| \
18910          .     : '\(.\)' 2>/dev/null ||
18911 echo X"$ac_file" |
18912     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18913           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18914           /^X\(\/\/\)$/{ s//\1/; q; }
18915           /^X\(\/\).*/{ s//\1/; q; }
18916           s/.*/./; q'`
18917   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18918     { case "$ac_dir" in
18919   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18920   *)                      as_incr_dir=.;;
18921 esac
18922 as_dummy="$ac_dir"
18923 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18924   case $as_mkdir_dir in
18925     # Skip DOS drivespec
18926     ?:) as_incr_dir=$as_mkdir_dir ;;
18927     *)
18928       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18929       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18930     ;;
18931   esac
18932 done; }
18933
18934     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18935     # A "../" for each directory in $ac_dir_suffix.
18936     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18937   else
18938     ac_dir_suffix= ac_dots=
18939   fi
18940
18941   case "$srcdir" in
18942   .)  ac_srcdir=.
18943       if test -z "$ac_dots"; then
18944          ac_top_srcdir=.
18945       else
18946          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18947       fi ;;
18948   [\\/]* | ?:[\\/]* )
18949       ac_srcdir="$srcdir$ac_dir_suffix";
18950       ac_top_srcdir="$srcdir" ;;
18951   *) # Relative path.
18952     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18953     ac_top_srcdir="$ac_dots$srcdir" ;;
18954   esac
18955
18956   case $INSTALL in
18957   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18958   *) ac_INSTALL=$ac_dots$INSTALL ;;
18959   esac
18960
18961   if test x"$ac_file" != x-; then
18962     { echo "$as_me:18962: creating $ac_file" >&5
18963 echo "$as_me: creating $ac_file" >&6;}
18964     rm -f "$ac_file"
18965   fi
18966   # Let's still pretend it is `configure' which instantiates (i.e., don't
18967   # use $as_me), people would be surprised to read:
18968   #    /* config.h.  Generated automatically by config.status.  */
18969   configure_input="Generated automatically from `echo $ac_file_in |
18970                                                  sed 's,.*/,,'` by configure."
18971
18972   # First look for the input files in the build tree, otherwise in the
18973   # src tree.
18974   ac_file_inputs=`IFS=:
18975     for f in $ac_file_in; do
18976       case $f in
18977       -) echo $tmp/stdin ;;
18978       [\\/$]*)
18979          # Absolute (can't be DOS-style, as IFS=:)
18980          test -f "$f" || { { echo "$as_me:18980: error: cannot find input file: $f" >&5
18981 echo "$as_me: error: cannot find input file: $f" >&2;}
18982    { (exit 1); exit 1; }; }
18983          echo $f;;
18984       *) # Relative
18985          if test -f "$f"; then
18986            # Build tree
18987            echo $f
18988          elif test -f "$srcdir/$f"; then
18989            # Source tree
18990            echo "$srcdir/$f"
18991          else
18992            # /dev/null tree
18993            { { echo "$as_me:18993: error: cannot find input file: $f" >&5
18994 echo "$as_me: error: cannot find input file: $f" >&2;}
18995    { (exit 1); exit 1; }; }
18996          fi;;
18997       esac
18998     done` || { (exit 1); exit 1; }
18999 EOF
19000 cat >>"$CONFIG_STATUS" <<\EOF
19001   ac_warn_datarootdir=no
19002   if test x"$ac_file" != x-; then
19003     for ac_item in $ac_file_inputs
19004     do
19005       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19006       if test -n "$ac_seen"; then
19007         ac_used=`grep '@datarootdir@' "$ac_item"`
19008         if test -z "$ac_used"; then
19009           { echo "$as_me:19009: WARNING: datarootdir was used implicitly but not set:
19010 $ac_seen" >&5
19011 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19012 $ac_seen" >&2;}
19013           ac_warn_datarootdir=yes
19014         fi
19015       fi
19016       ac_seen=`grep '${datarootdir}' "$ac_item"`
19017       if test -n "$ac_seen"; then
19018         { echo "$as_me:19018: WARNING: datarootdir was used explicitly but not set:
19019 $ac_seen" >&5
19020 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19021 $ac_seen" >&2;}
19022         ac_warn_datarootdir=yes
19023       fi
19024     done
19025   fi
19026
19027 if test "x$ac_warn_datarootdir" = xyes; then
19028   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19029 fi
19030
19031 EOF
19032 cat >>"$CONFIG_STATUS" <<EOF
19033   sed "$ac_vpsub
19034 $extrasub
19035 EOF
19036 cat >>"$CONFIG_STATUS" <<\EOF
19037 :t
19038 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19039 s,@configure_input@,$configure_input,;t t
19040 s,@srcdir@,$ac_srcdir,;t t
19041 s,@top_srcdir@,$ac_top_srcdir,;t t
19042 s,@INSTALL@,$ac_INSTALL,;t t
19043 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19044   rm -f $tmp/stdin
19045   if test x"$ac_file" != x-; then
19046     cp "$tmp/out" "$ac_file"
19047
19048     for ac_name in prefix exec_prefix datarootdir
19049     do
19050         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
19051         if test -n "$ac_seen"; then
19052             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19053             if test -z "$ac_init"; then
19054               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19055               { echo "$as_me:19055: WARNING: Variable $ac_name is used but was not set:
19056 $ac_seen" >&5
19057 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19058 $ac_seen" >&2;}
19059             fi
19060         fi
19061     done
19062     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
19063     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
19064     if test -s $tmp/out; then
19065       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19066       { echo "$as_me:19066: WARNING: Some variables may not be substituted:
19067 $ac_seen" >&5
19068 echo "$as_me: WARNING: Some variables may not be substituted:
19069 $ac_seen" >&2;}
19070     fi
19071   else
19072     cat $tmp/out
19073   fi
19074   rm -f $tmp/out
19075
19076 done
19077 EOF
19078 cat >>"$CONFIG_STATUS" <<\EOF
19079
19080 #
19081 # CONFIG_HEADER section.
19082 #
19083
19084 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19085 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19086 #
19087 # ac_d sets the value in "#define NAME VALUE" lines.
19088 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19089 ac_dB='[        ].*$,\1#\2'
19090 ac_dC=' '
19091 ac_dD=',;t'
19092 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19093 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19094 ac_iB='\([      ]\),\1#\2define\3'
19095 ac_iC=' '
19096 ac_iD='\4,;t'
19097 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19098 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19099 ac_uB='$,\1#\2define\3'
19100 ac_uC=' '
19101 ac_uD=',;t'
19102
19103 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19104   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19105   case "$ac_file" in
19106   - | *:- | *:-:* ) # input from stdin
19107         cat >$tmp/stdin
19108         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19109         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19110   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19111         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19112   * )   ac_file_in=$ac_file.in ;;
19113   esac
19114
19115   test x"$ac_file" != x- && { echo "$as_me:19115: creating $ac_file" >&5
19116 echo "$as_me: creating $ac_file" >&6;}
19117
19118   # First look for the input files in the build tree, otherwise in the
19119   # src tree.
19120   ac_file_inputs=`IFS=:
19121     for f in $ac_file_in; do
19122       case $f in
19123       -) echo $tmp/stdin ;;
19124       [\\/$]*)
19125          # Absolute (can't be DOS-style, as IFS=:)
19126          test -f "$f" || { { echo "$as_me:19126: error: cannot find input file: $f" >&5
19127 echo "$as_me: error: cannot find input file: $f" >&2;}
19128    { (exit 1); exit 1; }; }
19129          echo $f;;
19130       *) # Relative
19131          if test -f "$f"; then
19132            # Build tree
19133            echo $f
19134          elif test -f "$srcdir/$f"; then
19135            # Source tree
19136            echo "$srcdir/$f"
19137          else
19138            # /dev/null tree
19139            { { echo "$as_me:19139: error: cannot find input file: $f" >&5
19140 echo "$as_me: error: cannot find input file: $f" >&2;}
19141    { (exit 1); exit 1; }; }
19142          fi;;
19143       esac
19144     done` || { (exit 1); exit 1; }
19145   # Remove the trailing spaces.
19146   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19147
19148 EOF
19149
19150 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19151 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19152 # be either 'cat' or 'sort'.
19153 cat confdefs.h | uniq >conftest.vals
19154
19155 # Break up conftest.vals because some shells have a limit on
19156 # the size of here documents, and old seds have small limits too.
19157
19158 rm -f conftest.tail
19159 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19160 while grep . conftest.vals >/dev/null
19161 do
19162   # Write chunks of a limited-size here document to conftest.frag.
19163   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19164   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19165   echo 'CEOF' >> "$CONFIG_STATUS"
19166   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19167   rm -f conftest.vals
19168   mv conftest.tail conftest.vals
19169 done
19170 rm -f conftest.vals
19171
19172 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19173 # marker @DEFS@.
19174 echo '  cat >> conftest.edit <<CEOF
19175 /@DEFS@/r conftest.frag
19176 /@DEFS@/d
19177 CEOF
19178 sed -f conftest.edit $tmp/in > $tmp/out
19179 rm -f $tmp/in
19180 mv $tmp/out $tmp/in
19181 rm -f conftest.edit conftest.frag
19182 ' >> "$CONFIG_STATUS"
19183
19184 cat >>"$CONFIG_STATUS" <<\EOF
19185   # Let's still pretend it is `configure' which instantiates (i.e., don't
19186   # use $as_me), people would be surprised to read:
19187   #    /* config.h.  Generated automatically by config.status.  */
19188   if test x"$ac_file" = x-; then
19189     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19190   else
19191     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19192   fi
19193   cat $tmp/in >>$tmp/config.h
19194   rm -f $tmp/in
19195   if test x"$ac_file" != x-; then
19196     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19197       { echo "$as_me:19197: $ac_file is unchanged" >&5
19198 echo "$as_me: $ac_file is unchanged" >&6;}
19199     else
19200       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19201          X"$ac_file" : 'X\(//\)[^/]' \| \
19202          X"$ac_file" : 'X\(//\)$' \| \
19203          X"$ac_file" : 'X\(/\)' \| \
19204          .     : '\(.\)' 2>/dev/null ||
19205 echo X"$ac_file" |
19206     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19207           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19208           /^X\(\/\/\)$/{ s//\1/; q; }
19209           /^X\(\/\).*/{ s//\1/; q; }
19210           s/.*/./; q'`
19211       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19212         { case "$ac_dir" in
19213   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19214   *)                      as_incr_dir=.;;
19215 esac
19216 as_dummy="$ac_dir"
19217 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19218   case $as_mkdir_dir in
19219     # Skip DOS drivespec
19220     ?:) as_incr_dir=$as_mkdir_dir ;;
19221     *)
19222       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19223       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19224     ;;
19225   esac
19226 done; }
19227
19228       fi
19229       rm -f "$ac_file"
19230       mv "$tmp/config.h" "$ac_file"
19231     fi
19232   else
19233     cat $tmp/config.h
19234     rm -f $tmp/config.h
19235   fi
19236 done
19237 EOF
19238 cat >>"$CONFIG_STATUS" <<\EOF
19239 #
19240 # CONFIG_COMMANDS section.
19241 #
19242 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19243   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19244   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19245
19246   case "$ac_dest" in
19247     default )
19248 if test -z "$USE_OLD_MAKERULES" ; then
19249         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19250 fi
19251  ;;
19252   esac
19253 done
19254 EOF
19255
19256 cat >>"$CONFIG_STATUS" <<\EOF
19257
19258 { (exit 0); exit 0; }
19259 EOF
19260 chmod +x "$CONFIG_STATUS"
19261 ac_clean_files=$ac_clean_files_save
19262
19263 # configure is writing to config.log, and then calls config.status.
19264 # config.status does its own redirection, appending to config.log.
19265 # Unfortunately, on DOS this fails, as config.log is still kept open
19266 # by configure, so config.status won't be able to write to it; its
19267 # output is simply discarded.  So we exec the FD to /dev/null,
19268 # effectively closing config.log, so it can be properly (re)opened and
19269 # appended to by config.status.  When coming back to configure, we
19270 # need to make the FD available again.
19271 if test "$no_create" != yes; then
19272   ac_cs_success=:
19273   exec 5>/dev/null
19274   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19275   exec 5>>config.log
19276   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19277   # would make configure fail if this is the last instruction.
19278   "$ac_cs_success" || { (exit 1); exit 1; }
19279 fi
19280 ${MAKE:-make} preinstall