]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20211016
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.83 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20210509.
5 #
6 # Copyright 2003-2020,2021      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr=expr
38 else
39   as_expr=false
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s=ln
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2020,2021        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 top_builddir=`pwd`
1063
1064 ac_aux_dir=
1065 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1066   if test -f "$ac_dir/install-sh"; then
1067     ac_aux_dir=$ac_dir
1068     ac_install_sh="$ac_aux_dir/install-sh -c"
1069     break
1070   elif test -f "$ac_dir/install.sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install.sh -c"
1073     break
1074   elif test -f "$ac_dir/shtool"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/shtool install -c"
1077     break
1078   fi
1079 done
1080 if test -z "$ac_aux_dir"; then
1081   { { echo "$as_me:1081: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1082 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1086 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1087 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1088
1089 # Make sure we can run config.sub.
1090 $ac_config_sub sun4 >/dev/null 2>&1 ||
1091   { { echo "$as_me:1091: error: cannot run $ac_config_sub" >&5
1092 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1093    { (exit 1); exit 1; }; }
1094
1095 echo "$as_me:1095: checking build system type" >&5
1096 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1097 if test "${ac_cv_build+set}" = set; then
1098   echo $ECHO_N "(cached) $ECHO_C" >&6
1099 else
1100   ac_cv_build_alias=$build_alias
1101 test -z "$ac_cv_build_alias" &&
1102   ac_cv_build_alias=`$ac_config_guess`
1103 test -z "$ac_cv_build_alias" &&
1104   { { echo "$as_me:1104: error: cannot guess build type; you must specify one" >&5
1105 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1106    { (exit 1); exit 1; }; }
1107 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1108   { { echo "$as_me:1108: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1109 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1110    { (exit 1); exit 1; }; }
1111
1112 fi
1113 echo "$as_me:1113: result: $ac_cv_build" >&5
1114 echo "${ECHO_T}$ac_cv_build" >&6
1115 build=$ac_cv_build
1116 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1117 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1118 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1119
1120 echo "$as_me:1120: checking host system type" >&5
1121 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1122 if test "${ac_cv_host+set}" = set; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   ac_cv_host_alias=$host_alias
1126 test -z "$ac_cv_host_alias" &&
1127   ac_cv_host_alias=$ac_cv_build_alias
1128 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1129   { { echo "$as_me:1129: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1130 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1131    { (exit 1); exit 1; }; }
1132
1133 fi
1134 echo "$as_me:1134: result: $ac_cv_host" >&5
1135 echo "${ECHO_T}$ac_cv_host" >&6
1136 host=$ac_cv_host
1137 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1138 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1139 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1140
1141 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1142         echo "$as_me:1142: checking target system type" >&5
1143 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1144 if test "${ac_cv_target+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   ac_cv_target_alias=$target_alias
1148 test "x$ac_cv_target_alias" = "x" &&
1149   ac_cv_target_alias=$ac_cv_host_alias
1150 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1151   { { echo "$as_me:1151: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1152 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1153    { (exit 1); exit 1; }; }
1154
1155 fi
1156 echo "$as_me:1156: result: $ac_cv_target" >&5
1157 echo "${ECHO_T}$ac_cv_target" >&6
1158 target=$ac_cv_target
1159 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1160 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1161 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1162
1163 # The aliases save the names the user supplied, while $host etc.
1164 # will get canonicalized.
1165 test -n "$target_alias" &&
1166   test "$program_prefix$program_suffix$program_transform_name" = \
1167     NONENONEs,x,x, &&
1168   program_prefix=${target_alias}-
1169         system_name="$host_os"
1170 else
1171         system_name="`(uname -s -r) 2>/dev/null`"
1172         if test -z "$system_name" ; then
1173                 system_name="`(hostname) 2>/dev/null`"
1174         fi
1175 fi
1176 test -n "$system_name" &&
1177 cat >>confdefs.h <<EOF
1178 #define SYSTEM_NAME "$system_name"
1179 EOF
1180
1181 if test "${cf_cv_system_name+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   cf_cv_system_name="$system_name"
1185 fi
1186
1187 test -z "$system_name" && system_name="$cf_cv_system_name"
1188 test -n "$cf_cv_system_name" && echo "$as_me:1188: result: Configuring for $cf_cv_system_name" >&5
1189 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1190
1191 if test ".$system_name" != ".$cf_cv_system_name" ; then
1192         echo "$as_me:1192: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1193 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1194         { { echo "$as_me:1194: error: \"Please remove config.cache and try again.\"" >&5
1195 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1196    { (exit 1); exit 1; }; }
1197 fi
1198
1199 # Check whether --with-system-type or --without-system-type was given.
1200 if test "${with_system_type+set}" = set; then
1201   withval="$with_system_type"
1202   { echo "$as_me:1202: WARNING: overriding system type to $withval" >&5
1203 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1204         cf_cv_system_name=$withval
1205         host_os=$withval
1206
1207 fi;
1208
1209 ###     Save the given $CFLAGS to allow user-override.
1210 cf_user_CFLAGS="$CFLAGS"
1211
1212 ###     Default install-location
1213 for ac_prog in ggrep grep
1214 do
1215   # Extract the first word of "$ac_prog", so it can be a program name with args.
1216 set dummy $ac_prog; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_GREP+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$GREP"; then
1223   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_GREP="$ac_prog"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 GREP=$ac_cv_prog_GREP
1239 if test -n "$GREP"; then
1240   echo "$as_me:1240: result: $GREP" >&5
1241 echo "${ECHO_T}$GREP" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247   test -n "$GREP" && break
1248 done
1249 test -n "$GREP" || GREP=": "
1250
1251 echo "$as_me:1251: checking for fgrep" >&5
1252 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1253 if test "${ac_cv_path_FGREP+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1257    then ac_cv_path_FGREP="$GREP -F"
1258    else
1259      for ac_prog in gfgrep fgrep
1260 do
1261   # Extract the first word of "$ac_prog", so it can be a program name with args.
1262 set dummy $ac_prog; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_path_FGREP+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   case $FGREP in
1269   [\\/]* | ?:[\\/]*)
1270   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1271   ;;
1272   *)
1273   ac_save_IFS=$IFS; IFS=$ac_path_separator
1274 ac_dummy="$PATH"
1275 for ac_dir in $ac_dummy; do
1276   IFS=$ac_save_IFS
1277   test -z "$ac_dir" && ac_dir=.
1278   if $as_executable_p "$ac_dir/$ac_word"; then
1279    ac_cv_path_FGREP="$ac_dir/$ac_word"
1280    echo "$as_me:1280: found $ac_dir/$ac_word" >&5
1281    break
1282 fi
1283 done
1284
1285   ;;
1286 esac
1287 fi
1288 FGREP=$ac_cv_path_FGREP
1289
1290 if test -n "$FGREP"; then
1291   echo "$as_me:1291: result: $FGREP" >&5
1292 echo "${ECHO_T}$FGREP" >&6
1293 else
1294   echo "$as_me:1294: result: no" >&5
1295 echo "${ECHO_T}no" >&6
1296 fi
1297
1298   test -n "$FGREP" && break
1299 done
1300 test -n "$FGREP" || FGREP=": "
1301
1302      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1302: error: cannot find workable fgrep" >&5
1303 echo "$as_me: error: cannot find workable fgrep" >&2;}
1304    { (exit 1); exit 1; }; }
1305    fi
1306 fi
1307 echo "$as_me:1307: result: $ac_cv_path_FGREP" >&5
1308 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1309  FGREP="$ac_cv_path_FGREP"
1310
1311 echo "$as_me:1311: checking for prefix" >&5
1312 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1313 if test "x$prefix" = "xNONE" ; then
1314         case "$cf_cv_system_name" in
1315                 # non-vendor systems don't have a conflict
1316         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1317                 prefix=/usr
1318                 ;;
1319         (*)     prefix=$ac_default_prefix
1320                 ;;
1321         esac
1322 fi
1323 echo "$as_me:1323: result: $prefix" >&5
1324 echo "${ECHO_T}$prefix" >&6
1325
1326 if test "x$prefix" = "xNONE" ; then
1327 echo "$as_me:1327: checking for default include-directory" >&5
1328 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1329 test -n "$verbose" && echo 1>&6
1330 for cf_symbol in \
1331         "$includedir" \
1332         "$includedir/ncurses" \
1333         "$prefix/include" \
1334         "$prefix/include/ncurses" \
1335         /usr/local/include \
1336         /usr/local/include/ncurses \
1337         /usr/include \
1338         /usr/include/ncurses
1339 do
1340         cf_dir=`eval echo "$cf_symbol"`
1341         if test -f "$cf_dir/curses.h" ; then
1342         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1343                 includedir="$cf_symbol"
1344                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1345                 break
1346         fi
1347         fi
1348         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1349 done
1350 echo "$as_me:1350: result: $includedir" >&5
1351 echo "${ECHO_T}$includedir" >&6
1352 fi
1353
1354 ###     Checks for programs.
1355
1356 ac_ext=c
1357 ac_cpp='$CPP $CPPFLAGS'
1358 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1359 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1360 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1361 ac_main_return="return"
1362 if test -n "$ac_tool_prefix"; then
1363   for ac_prog in gnatgcc gcc cc
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in gnatgcc gcc cc
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo "$2"`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit "$ac_status"); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit "$ac_status"); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit "$ac_status"); }
1465
1466 cat >"conftest.$ac_ext" <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main (void)
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit "$ac_status"); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat "conftest.$ac_ext" >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit "$ac_status"); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe "conftest$ac_cv_exeext"
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit "$ac_status"); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f "conftest$ac_cv_exeext"
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f "conftest.$ac_ext"
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >"conftest.$ac_ext" <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main (void)
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit "$ac_status"); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat "conftest.$ac_ext" >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >"conftest.$ac_ext" <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main (void)
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f "conftest.$ac_objext"
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit "$ac_status"); } &&
1662          { ac_try='test -s "conftest.$ac_objext"'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit "$ac_status"); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat "conftest.$ac_ext" >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >"conftest.$ac_ext" <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main (void)
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f "conftest.$ac_objext"
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit "$ac_status"); } &&
1707          { ac_try='test -s "conftest.$ac_objext"'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit "$ac_status"); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat "conftest.$ac_ext" >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >"conftest.$ac_ext" <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f "conftest.$ac_objext"
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit "$ac_status"); } &&
1753          { ac_try='test -s "conftest.$ac_objext"'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit "$ac_status"); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >"conftest.$ac_ext" <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main (void)
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f "conftest.$ac_objext"
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit "$ac_status"); } &&
1787          { ac_try='test -s "conftest.$ac_objext"'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit "$ac_status"); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat "conftest.$ac_ext" >&5
1797 continue
1798 fi
1799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1800   cat >"conftest.$ac_ext" <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main (void)
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f "conftest.$ac_objext"
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit "$ac_status"); } &&
1818          { ac_try='test -s "conftest.$ac_objext"'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit "$ac_status"); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat "conftest.$ac_ext" >&5
1828 fi
1829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo "$ac_declaration"    >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1846 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return="return"
1849
1850 GCC_VERSION=none
1851 if test "$GCC" = yes ; then
1852         echo "$as_me:1852: checking version of $CC" >&5
1853 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1854         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1855         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1856         echo "$as_me:1856: result: $GCC_VERSION" >&5
1857 echo "${ECHO_T}$GCC_VERSION" >&6
1858 fi
1859
1860 INTEL_COMPILER=no
1861
1862 if test "$GCC" = yes ; then
1863         case "$host_os" in
1864         (linux*|gnu*)
1865                 echo "$as_me:1865: checking if this is really Intel C compiler" >&5
1866 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1867                 cf_save_CFLAGS="$CFLAGS"
1868                 CFLAGS="$CFLAGS -no-gcc"
1869                 cat >"conftest.$ac_ext" <<_ACEOF
1870 #line 1870 "configure"
1871 #include "confdefs.h"
1872
1873 int
1874 main (void)
1875 {
1876
1877 #ifdef __INTEL_COMPILER
1878 #else
1879 make an error
1880 #endif
1881
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 rm -f "conftest.$ac_objext"
1887 if { (eval echo "$as_me:1887: \"$ac_compile\"") >&5
1888   (eval $ac_compile) 2>&5
1889   ac_status=$?
1890   echo "$as_me:1890: \$? = $ac_status" >&5
1891   (exit "$ac_status"); } &&
1892          { ac_try='test -s "conftest.$ac_objext"'
1893   { (eval echo "$as_me:1893: \"$ac_try\"") >&5
1894   (eval $ac_try) 2>&5
1895   ac_status=$?
1896   echo "$as_me:1896: \$? = $ac_status" >&5
1897   (exit "$ac_status"); }; }; then
1898   INTEL_COMPILER=yes
1899 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1900
1901 else
1902   echo "$as_me: failed program was:" >&5
1903 cat "conftest.$ac_ext" >&5
1904 fi
1905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1906                 CFLAGS="$cf_save_CFLAGS"
1907                 echo "$as_me:1907: result: $INTEL_COMPILER" >&5
1908 echo "${ECHO_T}$INTEL_COMPILER" >&6
1909                 ;;
1910         esac
1911 fi
1912
1913 CLANG_COMPILER=no
1914
1915 if test "$GCC" = yes ; then
1916         echo "$as_me:1916: checking if this is really Clang C compiler" >&5
1917 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1918         cf_save_CFLAGS="$CFLAGS"
1919         cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   CLANG_COMPILER=yes
1949
1950 else
1951   echo "$as_me: failed program was:" >&5
1952 cat "conftest.$ac_ext" >&5
1953 fi
1954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1955         CFLAGS="$cf_save_CFLAGS"
1956         echo "$as_me:1956: result: $CLANG_COMPILER" >&5
1957 echo "${ECHO_T}$CLANG_COMPILER" >&6
1958 fi
1959
1960 CLANG_VERSION=none
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         case "$CC" in
1964         (c[1-9][0-9]|*/c[1-9][0-9])
1965                 { echo "$as_me:1965: WARNING: replacing broken compiler alias $CC" >&5
1966 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1967                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1968                 CC=clang
1969                 ;;
1970         esac
1971
1972         echo "$as_me:1972: checking version of $CC" >&5
1973 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1974         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1975         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1976         echo "$as_me:1976: result: $CLANG_VERSION" >&5
1977 echo "${ECHO_T}$CLANG_VERSION" >&6
1978
1979         for cf_clang_opt in \
1980                 -Qunused-arguments \
1981                 -Wno-error=implicit-function-declaration
1982         do
1983                 echo "$as_me:1983: checking if option $cf_clang_opt works" >&5
1984 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1985                 cf_save_CFLAGS="$CFLAGS"
1986                 CFLAGS="$CFLAGS $cf_clang_opt"
1987                 cat >"conftest.$ac_ext" <<_ACEOF
1988 #line 1988 "configure"
1989 #include "confdefs.h"
1990
1991                         #include <stdio.h>
1992 int
1993 main (void)
1994 {
1995
1996                         printf("hello!\\n");
1997   ;
1998   return 0;
1999 }
2000 _ACEOF
2001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2002 if { (eval echo "$as_me:2002: \"$ac_link\"") >&5
2003   (eval $ac_link) 2>&5
2004   ac_status=$?
2005   echo "$as_me:2005: \$? = $ac_status" >&5
2006   (exit "$ac_status"); } &&
2007          { ac_try='test -s "conftest$ac_exeext"'
2008   { (eval echo "$as_me:2008: \"$ac_try\"") >&5
2009   (eval $ac_try) 2>&5
2010   ac_status=$?
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit "$ac_status"); }; }; then
2013
2014                         cf_clang_optok=yes
2015 else
2016   echo "$as_me: failed program was:" >&5
2017 cat "conftest.$ac_ext" >&5
2018
2019                         cf_clang_optok=no
2020 fi
2021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2022                 echo "$as_me:2022: result: $cf_clang_optok" >&5
2023 echo "${ECHO_T}$cf_clang_optok" >&6
2024                 CFLAGS="$cf_save_CFLAGS"
2025                 if test "$cf_clang_optok" = yes; then
2026                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing adding option $cf_clang_opt ..." 1>&5
2029
2030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2031         CFLAGS="${CFLAGS}$cf_clang_opt"
2032
2033                 fi
2034         done
2035 fi
2036
2037 echo "$as_me:2037: checking for $CC option to accept ANSI C" >&5
2038 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2039 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2040   echo $ECHO_N "(cached) $ECHO_C" >&6
2041 else
2042   ac_cv_prog_cc_stdc=no
2043 ac_save_CC=$CC
2044 cat >"conftest.$ac_ext" <<_ACEOF
2045 #line 2045 "configure"
2046 #include "confdefs.h"
2047 #include <stdarg.h>
2048 #include <stdio.h>
2049 #include <sys/types.h>
2050 #include <sys/stat.h>
2051 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2052 struct buf { int x; };
2053 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2054 static char *e (p, i)
2055      char **p;
2056      int i;
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,'`
3283
3284 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3285 if test "${with_pkg_config_libdir+set}" = set; then
3286   withval="$with_pkg_config_libdir"
3287   cf_search_path=$withval
3288 else
3289   test "x$PKG_CONFIG" != xnone && cf_search_path=yes
3290 fi;
3291
3292 case x$cf_search_path in
3293 (x/*)
3294         ;;
3295 (xyes)
3296         cf_search_path=
3297         test -n "$verbose" && echo "    auto..." 1>&6
3298
3299 echo "${as_me:-configure}:3299: testing auto... ..." 1>&5
3300
3301         # Look for the library directory using the same prefix as the executable
3302         echo "$as_me:3302: checking for search-list" >&5
3303 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3304         if test "x$PKG_CONFIG" = xnone
3305         then
3306                 cf_path=$prefix
3307         else
3308                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3309                 cf_search_path=`
3310                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | awk "\
3311 /^Scanning directory #[1-9][0-9]* '.*'$/{ \
3312         sub(\"^[^']*'\",\"\"); \
3313         sub(\"'.*\",\"\"); \
3314         printf \" %s\", \\$0; } \
3315 /trying path:/{
3316         sub(\"^.* trying path: \",\"\");
3317         sub(\" for no-such-package.*$\",\"\");
3318         printf \" %s\", \\$0;
3319 }
3320 { next; } \
3321 "`
3322         fi
3323
3324         if test -z "$cf_search_path"
3325         then
3326                 # If you don't like using the default architecture, you have to specify
3327                 # the intended library directory and corresponding compiler/linker
3328                 # options.
3329                 #
3330                 # This case allows for Debian's 2014-flavor of multiarch, along with
3331                 # the most common variations before that point.  Some other variants
3332                 # spell the directory differently, e.g., "pkg-config", and put it in
3333                 # unusual places.
3334                 #
3335                 # pkg-config has always been poorly standardized, which is ironic...
3336                 case x`(arch) 2>/dev/null` in
3337                 (*64)
3338                         cf_test_path="\
3339                                 $cf_path/lib/*64-linux-gnu \
3340                                 $cf_path/share \
3341                                 $cf_path/lib64 \
3342                                 $cf_path/lib32 \
3343                                 $cf_path/lib"
3344                         ;;
3345                 (*)
3346                         cf_test_path="\
3347                                 $cf_path/lib/*-linux-gnu \
3348                                 $cf_path/share \
3349                                 $cf_path/lib32 \
3350                                 $cf_path/lib \
3351                                 $cf_path/libdata"
3352                         ;;
3353                 esac
3354                 for cf_config in $cf_test_path
3355                 do
3356                         test -d "$cf_config/pkgconfig" && cf_search_path="$cf_search_path $cf_config/pkgconfig"
3357                 done
3358         fi
3359
3360         echo "$as_me:3360: result: $cf_search_path" >&5
3361 echo "${ECHO_T}$cf_search_path" >&6
3362
3363         ;;
3364 (*)
3365         ;;
3366 esac
3367
3368 echo "$as_me:3368: checking for first directory" >&5
3369 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3370 cf_pkg_config_path=none
3371 for cf_config in $cf_search_path
3372 do
3373         if test -d "$cf_config"
3374         then
3375                 cf_pkg_config_path=$cf_config
3376                 break
3377         fi
3378 done
3379 echo "$as_me:3379: result: $cf_pkg_config_path" >&5
3380 echo "${ECHO_T}$cf_pkg_config_path" >&6
3381
3382 if test "x$cf_pkg_config_path" != xno ; then
3383         # limit this to the first directory found
3384         PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3385 fi
3386
3387 echo "$as_me:3387: checking if you want to build test-programs" >&5
3388 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3389
3390 # Check whether --with-tests or --without-tests was given.
3391 if test "${with_tests+set}" = set; then
3392   withval="$with_tests"
3393   cf_with_tests=$withval
3394 else
3395   cf_with_tests=yes
3396 fi;
3397 echo "$as_me:3397: result: $cf_with_tests" >&5
3398 echo "${ECHO_T}$cf_with_tests" >&6
3399
3400 echo "$as_me:3400: checking if we should assume mixed-case filenames" >&5
3401 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3402
3403 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3404 if test "${enable_mixed_case+set}" = set; then
3405   enableval="$enable_mixed_case"
3406   enable_mixedcase=$enableval
3407 else
3408   enable_mixedcase=auto
3409 fi;
3410 echo "$as_me:3410: result: $enable_mixedcase" >&5
3411 echo "${ECHO_T}$enable_mixedcase" >&6
3412 if test "$enable_mixedcase" = "auto" ; then
3413
3414 echo "$as_me:3414: checking if filesystem supports mixed-case filenames" >&5
3415 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3416 if test "${cf_cv_mixedcase+set}" = set; then
3417   echo $ECHO_N "(cached) $ECHO_C" >&6
3418 else
3419
3420 if test "$cross_compiling" = yes ; then
3421         case "$target_alias" in
3422         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3423                 cf_cv_mixedcase=no
3424                 ;;
3425         (*)
3426                 cf_cv_mixedcase=yes
3427                 ;;
3428         esac
3429 else
3430         rm -f conftest CONFTEST
3431         echo test >conftest
3432         if test -f CONFTEST ; then
3433                 cf_cv_mixedcase=no
3434         else
3435                 cf_cv_mixedcase=yes
3436         fi
3437         rm -f conftest CONFTEST
3438 fi
3439
3440 fi
3441 echo "$as_me:3441: result: $cf_cv_mixedcase" >&5
3442 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3443 test "$cf_cv_mixedcase" = yes &&
3444 cat >>confdefs.h <<\EOF
3445 #define MIXEDCASE_FILENAMES 1
3446 EOF
3447
3448 else
3449         cf_cv_mixedcase=$enable_mixedcase
3450         if test "$enable_mixedcase" = "yes" ; then
3451                 cat >>confdefs.h <<\EOF
3452 #define MIXEDCASE_FILENAMES 1
3453 EOF
3454
3455         fi
3456 fi
3457
3458 # do this after mixed-case option (tags/TAGS is not as important as tic).
3459 echo "$as_me:3459: checking whether ${MAKE-make} sets \${MAKE}" >&5
3460 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3461 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3462 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3463   echo $ECHO_N "(cached) $ECHO_C" >&6
3464 else
3465   cat >conftest.make <<\EOF
3466 all:
3467         @echo 'ac_maketemp="${MAKE}"'
3468 EOF
3469 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3470 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3471 if test -n "$ac_maketemp"; then
3472   eval ac_cv_prog_make_${ac_make}_set=yes
3473 else
3474   eval ac_cv_prog_make_${ac_make}_set=no
3475 fi
3476 rm -f conftest.make
3477 fi
3478 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3479   echo "$as_me:3479: result: yes" >&5
3480 echo "${ECHO_T}yes" >&6
3481   SET_MAKE=
3482 else
3483   echo "$as_me:3483: result: no" >&5
3484 echo "${ECHO_T}no" >&6
3485   SET_MAKE="MAKE=${MAKE-make}"
3486 fi
3487
3488 echo "$as_me:3488: checking for \".PHONY\" make-support" >&5
3489 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3490 if test "${cf_cv_make_PHONY+set}" = set; then
3491   echo $ECHO_N "(cached) $ECHO_C" >&6
3492 else
3493
3494         rm -rf conftest*
3495         (
3496                 mkdir conftest || exit 1
3497                 cd conftest
3498                 cat >makefile <<'CF_EOF'
3499 .PHONY: always
3500 DATA=0
3501 always: always.out
3502         @echo "** making $@ $(DATA)"
3503 once: once.out
3504         @echo "** making $@ $(DATA)"
3505 always.out:
3506         @echo "** making $@ $(DATA)"
3507         echo $(DATA) > $@
3508 once.out:
3509         @echo "** making $@ $(DATA)"
3510         echo $(DATA) > $@
3511 CF_EOF
3512                 for cf_data in 1 2 3
3513                 do
3514                         ${MAKE:-make} always DATA=$cf_data
3515                         ${MAKE:-make} once   DATA=$cf_data
3516                         ${MAKE:-make} -t always once
3517                         if test -f always ; then
3518                                 echo "no (case 1)" > ../conftest.tmp
3519                         elif test ! -f always.out ; then
3520                                 echo "no (case 2)" > ../conftest.tmp
3521                         elif test ! -f once.out ; then
3522                                 echo "no (case 3)" > ../conftest.tmp
3523                         elif ! cmp -s always.out once.out ; then
3524                                 echo "no (case 4)" > ../conftest.tmp
3525                                 diff always.out once.out
3526                         else
3527                                 cf_check="`cat always.out`"
3528                                 if test "x$cf_check" != "x$cf_data" ; then
3529                                         echo "no (case 5)" > ../conftest.tmp
3530                                 else
3531                                         echo yes > ../conftest.tmp
3532                                         rm -f ./*.out
3533                                         continue
3534                                 fi
3535                         fi
3536                         break
3537                 done
3538         ) >&5 2>&1
3539         cf_cv_make_PHONY="`cat conftest.tmp`"
3540         rm -rf conftest*
3541
3542 fi
3543 echo "$as_me:3543: result: $cf_cv_make_PHONY" >&5
3544 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3545 MAKE_NO_PHONY="#"
3546 MAKE_PHONY="#"
3547 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3548 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3549
3550 for ac_prog in exctags ctags
3551 do
3552   # Extract the first word of "$ac_prog", so it can be a program name with args.
3553 set dummy $ac_prog; ac_word=$2
3554 echo "$as_me:3554: checking for $ac_word" >&5
3555 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3556 if test "${ac_cv_prog_CTAGS+set}" = set; then
3557   echo $ECHO_N "(cached) $ECHO_C" >&6
3558 else
3559   if test -n "$CTAGS"; then
3560   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3561 else
3562   ac_save_IFS=$IFS; IFS=$ac_path_separator
3563 ac_dummy="$PATH"
3564 for ac_dir in $ac_dummy; do
3565   IFS=$ac_save_IFS
3566   test -z "$ac_dir" && ac_dir=.
3567   $as_executable_p "$ac_dir/$ac_word" || continue
3568 ac_cv_prog_CTAGS="$ac_prog"
3569 echo "$as_me:3569: found $ac_dir/$ac_word" >&5
3570 break
3571 done
3572
3573 fi
3574 fi
3575 CTAGS=$ac_cv_prog_CTAGS
3576 if test -n "$CTAGS"; then
3577   echo "$as_me:3577: result: $CTAGS" >&5
3578 echo "${ECHO_T}$CTAGS" >&6
3579 else
3580   echo "$as_me:3580: result: no" >&5
3581 echo "${ECHO_T}no" >&6
3582 fi
3583
3584   test -n "$CTAGS" && break
3585 done
3586
3587 for ac_prog in exetags etags
3588 do
3589   # Extract the first word of "$ac_prog", so it can be a program name with args.
3590 set dummy $ac_prog; ac_word=$2
3591 echo "$as_me:3591: checking for $ac_word" >&5
3592 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3593 if test "${ac_cv_prog_ETAGS+set}" = set; then
3594   echo $ECHO_N "(cached) $ECHO_C" >&6
3595 else
3596   if test -n "$ETAGS"; then
3597   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3598 else
3599   ac_save_IFS=$IFS; IFS=$ac_path_separator
3600 ac_dummy="$PATH"
3601 for ac_dir in $ac_dummy; do
3602   IFS=$ac_save_IFS
3603   test -z "$ac_dir" && ac_dir=.
3604   $as_executable_p "$ac_dir/$ac_word" || continue
3605 ac_cv_prog_ETAGS="$ac_prog"
3606 echo "$as_me:3606: found $ac_dir/$ac_word" >&5
3607 break
3608 done
3609
3610 fi
3611 fi
3612 ETAGS=$ac_cv_prog_ETAGS
3613 if test -n "$ETAGS"; then
3614   echo "$as_me:3614: result: $ETAGS" >&5
3615 echo "${ECHO_T}$ETAGS" >&6
3616 else
3617   echo "$as_me:3617: result: no" >&5
3618 echo "${ECHO_T}no" >&6
3619 fi
3620
3621   test -n "$ETAGS" && break
3622 done
3623
3624 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3625 set dummy ${CTAGS:-ctags}; ac_word=$2
3626 echo "$as_me:3626: checking for $ac_word" >&5
3627 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3628 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3629   echo $ECHO_N "(cached) $ECHO_C" >&6
3630 else
3631   if test -n "$MAKE_LOWER_TAGS"; then
3632   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3633 else
3634   ac_save_IFS=$IFS; IFS=$ac_path_separator
3635 ac_dummy="$PATH"
3636 for ac_dir in $ac_dummy; do
3637   IFS=$ac_save_IFS
3638   test -z "$ac_dir" && ac_dir=.
3639   $as_executable_p "$ac_dir/$ac_word" || continue
3640 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3641 echo "$as_me:3641: found $ac_dir/$ac_word" >&5
3642 break
3643 done
3644
3645   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3646 fi
3647 fi
3648 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3649 if test -n "$MAKE_LOWER_TAGS"; then
3650   echo "$as_me:3650: result: $MAKE_LOWER_TAGS" >&5
3651 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3652 else
3653   echo "$as_me:3653: result: no" >&5
3654 echo "${ECHO_T}no" >&6
3655 fi
3656
3657 if test "$cf_cv_mixedcase" = yes ; then
3658         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3659 set dummy ${ETAGS:-etags}; ac_word=$2
3660 echo "$as_me:3660: checking for $ac_word" >&5
3661 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3662 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3663   echo $ECHO_N "(cached) $ECHO_C" >&6
3664 else
3665   if test -n "$MAKE_UPPER_TAGS"; then
3666   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3667 else
3668   ac_save_IFS=$IFS; IFS=$ac_path_separator
3669 ac_dummy="$PATH"
3670 for ac_dir in $ac_dummy; do
3671   IFS=$ac_save_IFS
3672   test -z "$ac_dir" && ac_dir=.
3673   $as_executable_p "$ac_dir/$ac_word" || continue
3674 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3675 echo "$as_me:3675: found $ac_dir/$ac_word" >&5
3676 break
3677 done
3678
3679   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3680 fi
3681 fi
3682 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3683 if test -n "$MAKE_UPPER_TAGS"; then
3684   echo "$as_me:3684: result: $MAKE_UPPER_TAGS" >&5
3685 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3686 else
3687   echo "$as_me:3687: result: no" >&5
3688 echo "${ECHO_T}no" >&6
3689 fi
3690
3691 else
3692         MAKE_UPPER_TAGS=no
3693 fi
3694
3695 if test "$MAKE_UPPER_TAGS" = yes ; then
3696         MAKE_UPPER_TAGS=
3697 else
3698         MAKE_UPPER_TAGS="#"
3699 fi
3700
3701 if test "$MAKE_LOWER_TAGS" = yes ; then
3702         MAKE_LOWER_TAGS=
3703 else
3704         MAKE_LOWER_TAGS="#"
3705 fi
3706
3707 echo "$as_me:3707: checking for makeflags variable" >&5
3708 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3709 if test "${cf_cv_makeflags+set}" = set; then
3710   echo $ECHO_N "(cached) $ECHO_C" >&6
3711 else
3712
3713         cf_cv_makeflags=''
3714         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3715         do
3716                 cat >cf_makeflags.tmp <<CF_EOF
3717 SHELL = $SHELL
3718 all :
3719         @ echo '.$cf_option'
3720 CF_EOF
3721                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3722                 case "$cf_result" in
3723                 (.*k|.*kw)
3724                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3725                         case "$cf_result" in
3726                         (.*CC=*)        cf_cv_makeflags=
3727                                 ;;
3728                         (*)     cf_cv_makeflags=$cf_option
3729                                 ;;
3730                         esac
3731                         break
3732                         ;;
3733                 (.-)
3734                         ;;
3735                 (*)
3736
3737 echo "${as_me:-configure}:3737: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3738
3739                         ;;
3740                 esac
3741         done
3742         rm -f cf_makeflags.tmp
3743
3744 fi
3745 echo "$as_me:3745: result: $cf_cv_makeflags" >&5
3746 echo "${ECHO_T}$cf_cv_makeflags" >&6
3747
3748 if test -n "$ac_tool_prefix"; then
3749   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3750 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3751 echo "$as_me:3751: checking for $ac_word" >&5
3752 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3753 if test "${ac_cv_prog_RANLIB+set}" = set; then
3754   echo $ECHO_N "(cached) $ECHO_C" >&6
3755 else
3756   if test -n "$RANLIB"; then
3757   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3758 else
3759   ac_save_IFS=$IFS; IFS=$ac_path_separator
3760 ac_dummy="$PATH"
3761 for ac_dir in $ac_dummy; do
3762   IFS=$ac_save_IFS
3763   test -z "$ac_dir" && ac_dir=.
3764   $as_executable_p "$ac_dir/$ac_word" || continue
3765 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3766 echo "$as_me:3766: found $ac_dir/$ac_word" >&5
3767 break
3768 done
3769
3770 fi
3771 fi
3772 RANLIB=$ac_cv_prog_RANLIB
3773 if test -n "$RANLIB"; then
3774   echo "$as_me:3774: result: $RANLIB" >&5
3775 echo "${ECHO_T}$RANLIB" >&6
3776 else
3777   echo "$as_me:3777: result: no" >&5
3778 echo "${ECHO_T}no" >&6
3779 fi
3780
3781 fi
3782 if test -z "$ac_cv_prog_RANLIB"; then
3783   ac_ct_RANLIB=$RANLIB
3784   # Extract the first word of "ranlib", so it can be a program name with args.
3785 set dummy ranlib; ac_word=$2
3786 echo "$as_me:3786: checking for $ac_word" >&5
3787 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3788 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3789   echo $ECHO_N "(cached) $ECHO_C" >&6
3790 else
3791   if test -n "$ac_ct_RANLIB"; then
3792   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3793 else
3794   ac_save_IFS=$IFS; IFS=$ac_path_separator
3795 ac_dummy="$PATH"
3796 for ac_dir in $ac_dummy; do
3797   IFS=$ac_save_IFS
3798   test -z "$ac_dir" && ac_dir=.
3799   $as_executable_p "$ac_dir/$ac_word" || continue
3800 ac_cv_prog_ac_ct_RANLIB="ranlib"
3801 echo "$as_me:3801: found $ac_dir/$ac_word" >&5
3802 break
3803 done
3804
3805   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3806 fi
3807 fi
3808 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3809 if test -n "$ac_ct_RANLIB"; then
3810   echo "$as_me:3810: result: $ac_ct_RANLIB" >&5
3811 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3812 else
3813   echo "$as_me:3813: result: no" >&5
3814 echo "${ECHO_T}no" >&6
3815 fi
3816
3817   RANLIB=$ac_ct_RANLIB
3818 else
3819   RANLIB="$ac_cv_prog_RANLIB"
3820 fi
3821
3822 if test -n "$ac_tool_prefix"; then
3823   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3824 set dummy ${ac_tool_prefix}ld; ac_word=$2
3825 echo "$as_me:3825: checking for $ac_word" >&5
3826 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3827 if test "${ac_cv_prog_LD+set}" = set; then
3828   echo $ECHO_N "(cached) $ECHO_C" >&6
3829 else
3830   if test -n "$LD"; then
3831   ac_cv_prog_LD="$LD" # Let the user override the test.
3832 else
3833   ac_save_IFS=$IFS; IFS=$ac_path_separator
3834 ac_dummy="$PATH"
3835 for ac_dir in $ac_dummy; do
3836   IFS=$ac_save_IFS
3837   test -z "$ac_dir" && ac_dir=.
3838   $as_executable_p "$ac_dir/$ac_word" || continue
3839 ac_cv_prog_LD="${ac_tool_prefix}ld"
3840 echo "$as_me:3840: found $ac_dir/$ac_word" >&5
3841 break
3842 done
3843
3844 fi
3845 fi
3846 LD=$ac_cv_prog_LD
3847 if test -n "$LD"; then
3848   echo "$as_me:3848: result: $LD" >&5
3849 echo "${ECHO_T}$LD" >&6
3850 else
3851   echo "$as_me:3851: result: no" >&5
3852 echo "${ECHO_T}no" >&6
3853 fi
3854
3855 fi
3856 if test -z "$ac_cv_prog_LD"; then
3857   ac_ct_LD=$LD
3858   # Extract the first word of "ld", so it can be a program name with args.
3859 set dummy ld; ac_word=$2
3860 echo "$as_me:3860: checking for $ac_word" >&5
3861 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3862 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3863   echo $ECHO_N "(cached) $ECHO_C" >&6
3864 else
3865   if test -n "$ac_ct_LD"; then
3866   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3867 else
3868   ac_save_IFS=$IFS; IFS=$ac_path_separator
3869 ac_dummy="$PATH"
3870 for ac_dir in $ac_dummy; do
3871   IFS=$ac_save_IFS
3872   test -z "$ac_dir" && ac_dir=.
3873   $as_executable_p "$ac_dir/$ac_word" || continue
3874 ac_cv_prog_ac_ct_LD="ld"
3875 echo "$as_me:3875: found $ac_dir/$ac_word" >&5
3876 break
3877 done
3878
3879   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3880 fi
3881 fi
3882 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3883 if test -n "$ac_ct_LD"; then
3884   echo "$as_me:3884: result: $ac_ct_LD" >&5
3885 echo "${ECHO_T}$ac_ct_LD" >&6
3886 else
3887   echo "$as_me:3887: result: no" >&5
3888 echo "${ECHO_T}no" >&6
3889 fi
3890
3891   LD=$ac_ct_LD
3892 else
3893   LD="$ac_cv_prog_LD"
3894 fi
3895
3896 if test -n "$ac_tool_prefix"; then
3897   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3898 set dummy ${ac_tool_prefix}ar; ac_word=$2
3899 echo "$as_me:3899: checking for $ac_word" >&5
3900 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3901 if test "${ac_cv_prog_AR+set}" = set; then
3902   echo $ECHO_N "(cached) $ECHO_C" >&6
3903 else
3904   if test -n "$AR"; then
3905   ac_cv_prog_AR="$AR" # Let the user override the test.
3906 else
3907   ac_save_IFS=$IFS; IFS=$ac_path_separator
3908 ac_dummy="$PATH"
3909 for ac_dir in $ac_dummy; do
3910   IFS=$ac_save_IFS
3911   test -z "$ac_dir" && ac_dir=.
3912   $as_executable_p "$ac_dir/$ac_word" || continue
3913 ac_cv_prog_AR="${ac_tool_prefix}ar"
3914 echo "$as_me:3914: found $ac_dir/$ac_word" >&5
3915 break
3916 done
3917
3918 fi
3919 fi
3920 AR=$ac_cv_prog_AR
3921 if test -n "$AR"; then
3922   echo "$as_me:3922: result: $AR" >&5
3923 echo "${ECHO_T}$AR" >&6
3924 else
3925   echo "$as_me:3925: result: no" >&5
3926 echo "${ECHO_T}no" >&6
3927 fi
3928
3929 fi
3930 if test -z "$ac_cv_prog_AR"; then
3931   ac_ct_AR=$AR
3932   # Extract the first word of "ar", so it can be a program name with args.
3933 set dummy ar; ac_word=$2
3934 echo "$as_me:3934: checking for $ac_word" >&5
3935 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3936 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3937   echo $ECHO_N "(cached) $ECHO_C" >&6
3938 else
3939   if test -n "$ac_ct_AR"; then
3940   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3941 else
3942   ac_save_IFS=$IFS; IFS=$ac_path_separator
3943 ac_dummy="$PATH"
3944 for ac_dir in $ac_dummy; do
3945   IFS=$ac_save_IFS
3946   test -z "$ac_dir" && ac_dir=.
3947   $as_executable_p "$ac_dir/$ac_word" || continue
3948 ac_cv_prog_ac_ct_AR="ar"
3949 echo "$as_me:3949: found $ac_dir/$ac_word" >&5
3950 break
3951 done
3952
3953   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3954 fi
3955 fi
3956 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3957 if test -n "$ac_ct_AR"; then
3958   echo "$as_me:3958: result: $ac_ct_AR" >&5
3959 echo "${ECHO_T}$ac_ct_AR" >&6
3960 else
3961   echo "$as_me:3961: result: no" >&5
3962 echo "${ECHO_T}no" >&6
3963 fi
3964
3965   AR=$ac_ct_AR
3966 else
3967   AR="$ac_cv_prog_AR"
3968 fi
3969
3970 if test -n "$ac_tool_prefix"; then
3971   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3972 set dummy ${ac_tool_prefix}ar; ac_word=$2
3973 echo "$as_me:3973: checking for $ac_word" >&5
3974 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3975 if test "${ac_cv_prog_AR+set}" = set; then
3976   echo $ECHO_N "(cached) $ECHO_C" >&6
3977 else
3978   if test -n "$AR"; then
3979   ac_cv_prog_AR="$AR" # Let the user override the test.
3980 else
3981   ac_save_IFS=$IFS; IFS=$ac_path_separator
3982 ac_dummy="$PATH"
3983 for ac_dir in $ac_dummy; do
3984   IFS=$ac_save_IFS
3985   test -z "$ac_dir" && ac_dir=.
3986   $as_executable_p "$ac_dir/$ac_word" || continue
3987 ac_cv_prog_AR="${ac_tool_prefix}ar"
3988 echo "$as_me:3988: found $ac_dir/$ac_word" >&5
3989 break
3990 done
3991
3992 fi
3993 fi
3994 AR=$ac_cv_prog_AR
3995 if test -n "$AR"; then
3996   echo "$as_me:3996: result: $AR" >&5
3997 echo "${ECHO_T}$AR" >&6
3998 else
3999   echo "$as_me:3999: result: no" >&5
4000 echo "${ECHO_T}no" >&6
4001 fi
4002
4003 fi
4004 if test -z "$ac_cv_prog_AR"; then
4005   ac_ct_AR=$AR
4006   # Extract the first word of "ar", so it can be a program name with args.
4007 set dummy ar; ac_word=$2
4008 echo "$as_me:4008: checking for $ac_word" >&5
4009 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4010 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4011   echo $ECHO_N "(cached) $ECHO_C" >&6
4012 else
4013   if test -n "$ac_ct_AR"; then
4014   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4015 else
4016   ac_save_IFS=$IFS; IFS=$ac_path_separator
4017 ac_dummy="$PATH"
4018 for ac_dir in $ac_dummy; do
4019   IFS=$ac_save_IFS
4020   test -z "$ac_dir" && ac_dir=.
4021   $as_executable_p "$ac_dir/$ac_word" || continue
4022 ac_cv_prog_ac_ct_AR="ar"
4023 echo "$as_me:4023: found $ac_dir/$ac_word" >&5
4024 break
4025 done
4026
4027   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4028 fi
4029 fi
4030 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4031 if test -n "$ac_ct_AR"; then
4032   echo "$as_me:4032: result: $ac_ct_AR" >&5
4033 echo "${ECHO_T}$ac_ct_AR" >&6
4034 else
4035   echo "$as_me:4035: result: no" >&5
4036 echo "${ECHO_T}no" >&6
4037 fi
4038
4039   AR=$ac_ct_AR
4040 else
4041   AR="$ac_cv_prog_AR"
4042 fi
4043
4044 echo "$as_me:4044: checking for options to update archives" >&5
4045 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4046 if test "${cf_cv_ar_flags+set}" = set; then
4047   echo $ECHO_N "(cached) $ECHO_C" >&6
4048 else
4049
4050         case "$cf_cv_system_name" in
4051         (*-msvc*)
4052                 cf_cv_ar_flags=''
4053                 cat >mk_static_lib.sh <<-EOF
4054                 #!$SHELL
4055                 MSVC_BIN="$AR"
4056                 out="\$1"
4057                 shift
4058                 exec \$MSVC_BIN -out:"\$out" \$@
4059                 EOF
4060                 chmod +x mk_static_lib.sh
4061                 AR=`pwd`/mk_static_lib.sh
4062                 ;;
4063         (*)
4064                 cf_cv_ar_flags=unknown
4065                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4066                 do
4067
4068                         # check if $ARFLAGS already contains this choice
4069                         if test "x$ARFLAGS" != "x" ; then
4070                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4071                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4072                                         cf_cv_ar_flags=
4073                                         break
4074                                 fi
4075                         fi
4076
4077                         rm -f "conftest.$ac_cv_objext"
4078                         rm -f conftest.a
4079
4080                         cat >"conftest.$ac_ext" <<EOF
4081 #line 4081 "configure"
4082 int     testdata[3] = { 123, 456, 789 };
4083 EOF
4084                         if { (eval echo "$as_me:4084: \"$ac_compile\"") >&5
4085   (eval $ac_compile) 2>&5
4086   ac_status=$?
4087   echo "$as_me:4087: \$? = $ac_status" >&5
4088   (exit "$ac_status"); } ; then
4089                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4090                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4091                                 if test -f conftest.a ; then
4092                                         cf_cv_ar_flags="$cf_ar_flags"
4093                                         break
4094                                 fi
4095                         else
4096                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4097
4098 echo "${as_me:-configure}:4098: testing cannot compile test-program ..." 1>&5
4099
4100                                 break
4101                         fi
4102                 done
4103                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4104                 ;;
4105         esac
4106
4107 fi
4108 echo "$as_me:4108: result: $cf_cv_ar_flags" >&5
4109 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4110
4111 if test -n "$ARFLAGS" ; then
4112         if test -n "$cf_cv_ar_flags" ; then
4113                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4114         fi
4115 else
4116         ARFLAGS=$cf_cv_ar_flags
4117 fi
4118
4119         echo "$as_me:4119: checking for PATH separator" >&5
4120 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4121         case "$cf_cv_system_name" in
4122         (os2*)  PATH_SEPARATOR=';'  ;;
4123         (*)     ${PATH_SEPARATOR:=':'}  ;;
4124         esac
4125
4126         echo "$as_me:4126: result: $PATH_SEPARATOR" >&5
4127 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4128
4129 echo "$as_me:4129: checking if you have specified an install-prefix" >&5
4130 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4131
4132 # Check whether --with-install-prefix or --without-install-prefix was given.
4133 if test "${with_install_prefix+set}" = set; then
4134   withval="$with_install_prefix"
4135   case "$withval" in
4136         (yes|no)
4137                 ;;
4138         (*)     DESTDIR="$withval"
4139                 ;;
4140         esac
4141 fi;
4142 echo "$as_me:4142: result: $DESTDIR" >&5
4143 echo "${ECHO_T}$DESTDIR" >&6
4144
4145 ###############################################################################
4146
4147 # If we're cross-compiling, allow the user to override the tools and their
4148 # options.  The configure script is oriented toward identifying the host
4149 # compiler, etc., but we need a build compiler to generate parts of the source.
4150
4151 if test "$cross_compiling" = yes ; then
4152
4153         # defaults that we might want to override
4154         : ${BUILD_CFLAGS:=''}
4155         : ${BUILD_CPPFLAGS:=''}
4156         : ${BUILD_LDFLAGS:=''}
4157         : ${BUILD_LIBS:=''}
4158         : ${BUILD_EXEEXT:='$x'}
4159         : ${BUILD_OBJEXT:='o'}
4160
4161 # Check whether --with-build-cc or --without-build-cc was given.
4162 if test "${with_build_cc+set}" = set; then
4163   withval="$with_build_cc"
4164   BUILD_CC="$withval"
4165 else
4166   for ac_prog in gcc clang c99 c89 cc cl
4167 do
4168   # Extract the first word of "$ac_prog", so it can be a program name with args.
4169 set dummy $ac_prog; ac_word=$2
4170 echo "$as_me:4170: checking for $ac_word" >&5
4171 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4172 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4173   echo $ECHO_N "(cached) $ECHO_C" >&6
4174 else
4175   if test -n "$BUILD_CC"; then
4176   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4177 else
4178   ac_save_IFS=$IFS; IFS=$ac_path_separator
4179 ac_dummy="$PATH"
4180 for ac_dir in $ac_dummy; do
4181   IFS=$ac_save_IFS
4182   test -z "$ac_dir" && ac_dir=.
4183   $as_executable_p "$ac_dir/$ac_word" || continue
4184 ac_cv_prog_BUILD_CC="$ac_prog"
4185 echo "$as_me:4185: found $ac_dir/$ac_word" >&5
4186 break
4187 done
4188
4189 fi
4190 fi
4191 BUILD_CC=$ac_cv_prog_BUILD_CC
4192 if test -n "$BUILD_CC"; then
4193   echo "$as_me:4193: result: $BUILD_CC" >&5
4194 echo "${ECHO_T}$BUILD_CC" >&6
4195 else
4196   echo "$as_me:4196: result: no" >&5
4197 echo "${ECHO_T}no" >&6
4198 fi
4199
4200   test -n "$BUILD_CC" && break
4201 done
4202 test -n "$BUILD_CC" || BUILD_CC="none"
4203
4204 fi;
4205         echo "$as_me:4205: checking for native build C compiler" >&5
4206 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4207         echo "$as_me:4207: result: $BUILD_CC" >&5
4208 echo "${ECHO_T}$BUILD_CC" >&6
4209
4210         echo "$as_me:4210: checking for native build C preprocessor" >&5
4211 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4212
4213 # Check whether --with-build-cpp or --without-build-cpp was given.
4214 if test "${with_build_cpp+set}" = set; then
4215   withval="$with_build_cpp"
4216   BUILD_CPP="$withval"
4217 else
4218   BUILD_CPP='${BUILD_CC} -E'
4219 fi;
4220         echo "$as_me:4220: result: $BUILD_CPP" >&5
4221 echo "${ECHO_T}$BUILD_CPP" >&6
4222
4223         echo "$as_me:4223: checking for native build C flags" >&5
4224 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4225
4226 # Check whether --with-build-cflags or --without-build-cflags was given.
4227 if test "${with_build_cflags+set}" = set; then
4228   withval="$with_build_cflags"
4229   BUILD_CFLAGS="$withval"
4230 fi;
4231         echo "$as_me:4231: result: $BUILD_CFLAGS" >&5
4232 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4233
4234         echo "$as_me:4234: checking for native build C preprocessor-flags" >&5
4235 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4236
4237 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4238 if test "${with_build_cppflags+set}" = set; then
4239   withval="$with_build_cppflags"
4240   BUILD_CPPFLAGS="$withval"
4241 fi;
4242         echo "$as_me:4242: result: $BUILD_CPPFLAGS" >&5
4243 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4244
4245         echo "$as_me:4245: checking for native build linker-flags" >&5
4246 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4247
4248 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4249 if test "${with_build_ldflags+set}" = set; then
4250   withval="$with_build_ldflags"
4251   BUILD_LDFLAGS="$withval"
4252 fi;
4253         echo "$as_me:4253: result: $BUILD_LDFLAGS" >&5
4254 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4255
4256         echo "$as_me:4256: checking for native build linker-libraries" >&5
4257 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4258
4259 # Check whether --with-build-libs or --without-build-libs was given.
4260 if test "${with_build_libs+set}" = set; then
4261   withval="$with_build_libs"
4262   BUILD_LIBS="$withval"
4263 fi;
4264         echo "$as_me:4264: result: $BUILD_LIBS" >&5
4265 echo "${ECHO_T}$BUILD_LIBS" >&6
4266
4267         # this assumes we're on Unix.
4268         BUILD_EXEEXT=
4269         BUILD_OBJEXT=o
4270
4271         : ${BUILD_CC:='${CC}'}
4272
4273         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4274                 { { echo "$as_me:4274: error: Cross-build requires two compilers.
4275 Use --with-build-cc to specify the native compiler." >&5
4276 echo "$as_me: error: Cross-build requires two compilers.
4277 Use --with-build-cc to specify the native compiler." >&2;}
4278    { (exit 1); exit 1; }; }
4279         fi
4280
4281 else
4282         : ${BUILD_CC:='${CC}'}
4283         : ${BUILD_CPP:='${CPP}'}
4284         : ${BUILD_CFLAGS:='${CFLAGS}'}
4285         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4286         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4287         : ${BUILD_LIBS:='${LIBS}'}
4288         : ${BUILD_EXEEXT:='$x'}
4289         : ${BUILD_OBJEXT:='o'}
4290 fi
4291
4292 ###############################################################################
4293
4294 ### Options to allow the user to specify the set of libraries which are used.
4295 ### Use "--without-normal --with-shared" to allow the default model to be
4296 ### shared, for example.
4297 cf_list_models=""
4298
4299 echo "$as_me:4299: checking if you want to build shared C-objects" >&5
4300 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4301
4302 # Check whether --with-shared or --without-shared was given.
4303 if test "${with_shared+set}" = set; then
4304   withval="$with_shared"
4305   with_shared=$withval
4306 else
4307   with_shared=no
4308 fi;
4309 echo "$as_me:4309: result: $with_shared" >&5
4310 echo "${ECHO_T}$with_shared" >&6
4311 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4312
4313 echo "$as_me:4313: checking for specified models" >&5
4314 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4315 test -z "$cf_list_models" && cf_list_models=normal
4316 echo "$as_me:4316: result: $cf_list_models" >&5
4317 echo "${ECHO_T}$cf_list_models" >&6
4318
4319 ### Use the first model as the default, and save its suffix for use in building
4320 ### up test-applications.
4321 echo "$as_me:4321: checking for default model" >&5
4322 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4323 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4324 echo "$as_me:4324: result: $DFT_LWR_MODEL" >&5
4325 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4326
4327 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4328
4329 echo "$as_me:4329: checking for specific curses-directory" >&5
4330 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4331
4332 # Check whether --with-curses-dir or --without-curses-dir was given.
4333 if test "${with_curses_dir+set}" = set; then
4334   withval="$with_curses_dir"
4335   cf_cv_curses_dir=$withval
4336 else
4337   cf_cv_curses_dir=no
4338 fi;
4339 echo "$as_me:4339: result: $cf_cv_curses_dir" >&5
4340 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4341
4342 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4343 then
4344
4345 if test "x$prefix" != xNONE; then
4346         cf_path_syntax="$prefix"
4347 else
4348         cf_path_syntax="$ac_default_prefix"
4349 fi
4350
4351 case ".$withval" in
4352 (.\$\(*\)*|.\'*\'*)
4353         ;;
4354 (..|./*|.\\*)
4355         ;;
4356 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4357         ;;
4358 (.\$\{*prefix\}*|.\$\{*dir\}*)
4359         eval withval="$withval"
4360         case ".$withval" in
4361         (.NONE/*)
4362                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4363                 ;;
4364         esac
4365         ;;
4366 (.no|.NONE/*)
4367         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4368         ;;
4369 (*)
4370         { { echo "$as_me:4370: error: expected a pathname, not \"$withval\"" >&5
4371 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4372    { (exit 1); exit 1; }; }
4373         ;;
4374 esac
4375
4376         if test -d "$cf_cv_curses_dir"
4377         then
4378
4379 if test -n "$cf_cv_curses_dir/include" ; then
4380   for cf_add_incdir in $cf_cv_curses_dir/include
4381   do
4382         while test "$cf_add_incdir" != /usr/include
4383         do
4384           if test -d "$cf_add_incdir"
4385           then
4386                 cf_have_incdir=no
4387                 if test -n "$CFLAGS$CPPFLAGS" ; then
4388                   # a loop is needed to ensure we can add subdirs of existing dirs
4389                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4390                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4391                           cf_have_incdir=yes; break
4392                         fi
4393                   done
4394                 fi
4395
4396                 if test "$cf_have_incdir" = no ; then
4397                   if test "$cf_add_incdir" = /usr/local/include ; then
4398                         if test "$GCC" = yes
4399                         then
4400                           cf_save_CPPFLAGS=$CPPFLAGS
4401
4402         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4403         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4404
4405                           cat >"conftest.$ac_ext" <<_ACEOF
4406 #line 4406 "configure"
4407 #include "confdefs.h"
4408 #include <stdio.h>
4409 int
4410 main (void)
4411 {
4412 printf("Hello")
4413   ;
4414   return 0;
4415 }
4416 _ACEOF
4417 rm -f "conftest.$ac_objext"
4418 if { (eval echo "$as_me:4418: \"$ac_compile\"") >&5
4419   (eval $ac_compile) 2>&5
4420   ac_status=$?
4421   echo "$as_me:4421: \$? = $ac_status" >&5
4422   (exit "$ac_status"); } &&
4423          { ac_try='test -s "conftest.$ac_objext"'
4424   { (eval echo "$as_me:4424: \"$ac_try\"") >&5
4425   (eval $ac_try) 2>&5
4426   ac_status=$?
4427   echo "$as_me:4427: \$? = $ac_status" >&5
4428   (exit "$ac_status"); }; }; then
4429   :
4430 else
4431   echo "$as_me: failed program was:" >&5
4432 cat "conftest.$ac_ext" >&5
4433 cf_have_incdir=yes
4434 fi
4435 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4436                           CPPFLAGS=$cf_save_CPPFLAGS
4437                         fi
4438                   fi
4439                 fi
4440
4441                 if test "$cf_have_incdir" = no ; then
4442                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4443
4444 echo "${as_me:-configure}:4444: testing adding $cf_add_incdir to include-path ..." 1>&5
4445
4446                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4447
4448                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4449                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4450                   cf_add_incdir="$cf_top_incdir"
4451                 else
4452                   break
4453                 fi
4454           else
4455                 break
4456           fi
4457         done
4458   done
4459 fi
4460
4461 if test -n "$cf_cv_curses_dir/lib" ; then
4462         for cf_add_libdir in $cf_cv_curses_dir/lib
4463         do
4464                 if test "$cf_add_libdir" = /usr/lib ; then
4465                         :
4466                 elif test -d "$cf_add_libdir"
4467                 then
4468                         cf_have_libdir=no
4469                         if test -n "$LDFLAGS$LIBS" ; then
4470                                 # a loop is needed to ensure we can add subdirs of existing dirs
4471                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4472                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4473                                                 cf_have_libdir=yes; break
4474                                         fi
4475                                 done
4476                         fi
4477                         if test "$cf_have_libdir" = no ; then
4478                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4479
4480 echo "${as_me:-configure}:4480: testing adding $cf_add_libdir to library-path ..." 1>&5
4481
4482                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4483                         fi
4484                 fi
4485         done
4486 fi
4487
4488         fi
4489 fi
4490
4491 cf_ncuconfig_root=ncurses
4492 cf_have_ncuconfig=no
4493
4494 if test "x${PKG_CONFIG:=none}" != xnone; then
4495         echo "$as_me:4495: checking pkg-config for $cf_ncuconfig_root" >&5
4496 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4497         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4498                 echo "$as_me:4498: result: yes" >&5
4499 echo "${ECHO_T}yes" >&6
4500
4501                 echo "$as_me:4501: checking if the $cf_ncuconfig_root package files work" >&5
4502 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4503                 cf_have_ncuconfig=unknown
4504
4505                 cf_save_CFLAGS="$CFLAGS"
4506                 cf_save_CPPFLAGS="$CPPFLAGS"
4507                 cf_save_LIBS="$LIBS"
4508
4509                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4510                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4511
4512                 # while -W for passing linker flags is prevalent, it is not "standard".
4513                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4514                 # incompatible _and_ non-standard -W option which gives an error.  Work
4515                 # around that pitfall.
4516                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4517                 (x*c[89]9@@*-W*)
4518
4519 cf_fix_cppflags=no
4520 cf_new_cflags=
4521 cf_new_cppflags=
4522 cf_new_extra_cppflags=
4523
4524 for cf_add_cflags in $cf_pkg_cflags
4525 do
4526 case "$cf_fix_cppflags" in
4527 (no)
4528         case "$cf_add_cflags" in
4529         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4530                 case "$cf_add_cflags" in
4531                 (-D*)
4532                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4533
4534                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4535                                 && test -z "${cf_tst_cflags}" \
4536                                 && cf_fix_cppflags=yes
4537
4538                         if test "$cf_fix_cppflags" = yes ; then
4539
4540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4542
4543                                 continue
4544                         elif test "${cf_tst_cflags}" = "\"'" ; then
4545
4546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4548
4549                                 continue
4550                         fi
4551                         ;;
4552                 esac
4553                 case "$CPPFLAGS" in
4554                 (*$cf_add_cflags)
4555                         ;;
4556                 (*)
4557                         case "$cf_add_cflags" in
4558                         (-D*)
4559                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4560
4561 CPPFLAGS=`echo "$CPPFLAGS" | \
4562         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4563                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4564
4565                                 ;;
4566                         esac
4567
4568         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4569         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4570
4571                         ;;
4572                 esac
4573                 ;;
4574         (*)
4575
4576         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4577         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4578
4579                 ;;
4580         esac
4581         ;;
4582 (yes)
4583
4584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4586
4587         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4588
4589         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4590                 && test -z "${cf_tst_cflags}" \
4591                 && cf_fix_cppflags=no
4592         ;;
4593 esac
4594 done
4595
4596 if test -n "$cf_new_cflags" ; then
4597
4598         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4599         CFLAGS="${CFLAGS}$cf_new_cflags"
4600
4601 fi
4602
4603 if test -n "$cf_new_cppflags" ; then
4604
4605         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4606         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4607
4608 fi
4609
4610 if test -n "$cf_new_extra_cppflags" ; then
4611
4612         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4613         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4614
4615 fi
4616
4617 cf_add_libs="$LIBS"
4618 # reverse order
4619 cf_add_0lib=
4620 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4621 # filter duplicates
4622 for cf_add_1lib in $cf_add_0lib; do
4623         for cf_add_2lib in $cf_add_libs; do
4624                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4625                         cf_add_1lib=
4626                         break
4627                 fi
4628         done
4629         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4630 done
4631 LIBS="$cf_add_libs"
4632
4633                         cat >"conftest.$ac_ext" <<_ACEOF
4634 #line 4634 "configure"
4635 #include "confdefs.h"
4636 #include <${cf_cv_ncurses_header:-curses.h}>
4637 int
4638 main (void)
4639 {
4640 initscr(); mousemask(0,0); tigetstr((char *)0);
4641   ;
4642   return 0;
4643 }
4644 _ACEOF
4645 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4646 if { (eval echo "$as_me:4646: \"$ac_link\"") >&5
4647   (eval $ac_link) 2>&5
4648   ac_status=$?
4649   echo "$as_me:4649: \$? = $ac_status" >&5
4650   (exit "$ac_status"); } &&
4651          { ac_try='test -s "conftest$ac_exeext"'
4652   { (eval echo "$as_me:4652: \"$ac_try\"") >&5
4653   (eval $ac_try) 2>&5
4654   ac_status=$?
4655   echo "$as_me:4655: \$? = $ac_status" >&5
4656   (exit "$ac_status"); }; }; then
4657   if test "$cross_compiling" = yes; then
4658   cf_test_ncuconfig=maybe
4659 else
4660   cat >"conftest.$ac_ext" <<_ACEOF
4661 #line 4661 "configure"
4662 #include "confdefs.h"
4663 #include <${cf_cv_ncurses_header:-curses.h}>
4664                                         int main(void)
4665                                         { const char *xx = curses_version(); return (xx == 0); }
4666 _ACEOF
4667 rm -f "conftest$ac_exeext"
4668 if { (eval echo "$as_me:4668: \"$ac_link\"") >&5
4669   (eval $ac_link) 2>&5
4670   ac_status=$?
4671   echo "$as_me:4671: \$? = $ac_status" >&5
4672   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4673   { (eval echo "$as_me:4673: \"$ac_try\"") >&5
4674   (eval $ac_try) 2>&5
4675   ac_status=$?
4676   echo "$as_me:4676: \$? = $ac_status" >&5
4677   (exit "$ac_status"); }; }; then
4678   cf_test_ncuconfig=yes
4679 else
4680   echo "$as_me: program exited with status $ac_status" >&5
4681 echo "$as_me: failed program was:" >&5
4682 cat "conftest.$ac_ext" >&5
4683 cf_test_ncuconfig=no
4684 fi
4685 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4686 fi
4687 else
4688   echo "$as_me: failed program was:" >&5
4689 cat "conftest.$ac_ext" >&5
4690 cf_test_ncuconfig=no
4691 fi
4692 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4693
4694                         CFLAGS="$cf_save_CFLAGS"
4695                         CPPFLAGS="$cf_save_CPPFLAGS"
4696                         LIBS="$cf_save_LIBS"
4697
4698                         if test "x$cf_test_ncuconfig" != xyes; then
4699                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4700                                 cf_pkg_cflags="$cf_temp"
4701                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4702                                 cf_pkg_libs="$cf_temp"
4703                         fi
4704                         ;;
4705                 esac
4706
4707 for cf_add_cflags in $cf_pkg_cflags
4708 do
4709         case "x$cf_add_cflags" in
4710         (x-[DU]*)
4711
4712 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4713 while true
4714 do
4715         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'`
4716         test "$CFLAGS" != "$cf_old_cflag" || break
4717
4718         CFLAGS="$cf_old_cflag"
4719 done
4720
4721 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4722 while true
4723 do
4724         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'`
4725         test "$CPPFLAGS" != "$cf_old_cflag" || break
4726
4727         CPPFLAGS="$cf_old_cflag"
4728 done
4729
4730                 ;;
4731         esac
4732
4733 cf_fix_cppflags=no
4734 cf_new_cflags=
4735 cf_new_cppflags=
4736 cf_new_extra_cppflags=
4737
4738 for cf_add_cflags in $cf_add_cflags
4739 do
4740 case "$cf_fix_cppflags" in
4741 (no)
4742         case "$cf_add_cflags" in
4743         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4744                 case "$cf_add_cflags" in
4745                 (-D*)
4746                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4747
4748                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4749                                 && test -z "${cf_tst_cflags}" \
4750                                 && cf_fix_cppflags=yes
4751
4752                         if test "$cf_fix_cppflags" = yes ; then
4753
4754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4756
4757                                 continue
4758                         elif test "${cf_tst_cflags}" = "\"'" ; then
4759
4760         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4761         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4762
4763                                 continue
4764                         fi
4765                         ;;
4766                 esac
4767                 case "$CPPFLAGS" in
4768                 (*$cf_add_cflags)
4769                         ;;
4770                 (*)
4771                         case "$cf_add_cflags" in
4772                         (-D*)
4773                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4774
4775 CPPFLAGS=`echo "$CPPFLAGS" | \
4776         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4777                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4778
4779                                 ;;
4780                         esac
4781
4782         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4783         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4784
4785                         ;;
4786                 esac
4787                 ;;
4788         (*)
4789
4790         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4791         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4792
4793                 ;;
4794         esac
4795         ;;
4796 (yes)
4797
4798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4800
4801         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4802
4803         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4804                 && test -z "${cf_tst_cflags}" \
4805                 && cf_fix_cppflags=no
4806         ;;
4807 esac
4808 done
4809
4810 if test -n "$cf_new_cflags" ; then
4811
4812         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4813         CFLAGS="${CFLAGS}$cf_new_cflags"
4814
4815 fi
4816
4817 if test -n "$cf_new_cppflags" ; then
4818
4819         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4820         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4821
4822 fi
4823
4824 if test -n "$cf_new_extra_cppflags" ; then
4825
4826         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4827         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4828
4829 fi
4830
4831 done
4832
4833 cf_add_libs="$LIBS"
4834 # reverse order
4835 cf_add_0lib=
4836 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4837 # filter duplicates
4838 for cf_add_1lib in $cf_add_0lib; do
4839         for cf_add_2lib in $cf_add_libs; do
4840                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4841                         cf_add_1lib=
4842                         break
4843                 fi
4844         done
4845         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4846 done
4847 LIBS="$cf_add_libs"
4848
4849                 cat >"conftest.$ac_ext" <<_ACEOF
4850 #line 4850 "configure"
4851 #include "confdefs.h"
4852 #include <${cf_cv_ncurses_header:-curses.h}>
4853 int
4854 main (void)
4855 {
4856 initscr(); mousemask(0,0); tigetstr((char *)0);
4857   ;
4858   return 0;
4859 }
4860 _ACEOF
4861 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4862 if { (eval echo "$as_me:4862: \"$ac_link\"") >&5
4863   (eval $ac_link) 2>&5
4864   ac_status=$?
4865   echo "$as_me:4865: \$? = $ac_status" >&5
4866   (exit "$ac_status"); } &&
4867          { ac_try='test -s "conftest$ac_exeext"'
4868   { (eval echo "$as_me:4868: \"$ac_try\"") >&5
4869   (eval $ac_try) 2>&5
4870   ac_status=$?
4871   echo "$as_me:4871: \$? = $ac_status" >&5
4872   (exit "$ac_status"); }; }; then
4873   if test "$cross_compiling" = yes; then
4874   cf_have_ncuconfig=maybe
4875 else
4876   cat >"conftest.$ac_ext" <<_ACEOF
4877 #line 4877 "configure"
4878 #include "confdefs.h"
4879 #include <${cf_cv_ncurses_header:-curses.h}>
4880                                 int main(void)
4881                                 { const char *xx = curses_version(); return (xx == 0); }
4882 _ACEOF
4883 rm -f "conftest$ac_exeext"
4884 if { (eval echo "$as_me:4884: \"$ac_link\"") >&5
4885   (eval $ac_link) 2>&5
4886   ac_status=$?
4887   echo "$as_me:4887: \$? = $ac_status" >&5
4888   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4889   { (eval echo "$as_me:4889: \"$ac_try\"") >&5
4890   (eval $ac_try) 2>&5
4891   ac_status=$?
4892   echo "$as_me:4892: \$? = $ac_status" >&5
4893   (exit "$ac_status"); }; }; then
4894   cf_have_ncuconfig=yes
4895 else
4896   echo "$as_me: program exited with status $ac_status" >&5
4897 echo "$as_me: failed program was:" >&5
4898 cat "conftest.$ac_ext" >&5
4899 cf_have_ncuconfig=no
4900 fi
4901 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4902 fi
4903 else
4904   echo "$as_me: failed program was:" >&5
4905 cat "conftest.$ac_ext" >&5
4906 cf_have_ncuconfig=no
4907 fi
4908 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4909                 echo "$as_me:4909: result: $cf_have_ncuconfig" >&5
4910 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4911                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4912                 if test "$cf_have_ncuconfig" != "yes"
4913                 then
4914                         CPPFLAGS="$cf_save_CPPFLAGS"
4915                         LIBS="$cf_save_LIBS"
4916                         NCURSES_CONFIG_PKG=none
4917                 else
4918
4919 cat >>confdefs.h <<\EOF
4920 #define NCURSES 1
4921 EOF
4922
4923                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4924
4925 echo "$as_me:4925: checking for terminfo header" >&5
4926 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4927 if test "${cf_cv_term_header+set}" = set; then
4928   echo $ECHO_N "(cached) $ECHO_C" >&6
4929 else
4930
4931 case "${cf_cv_ncurses_header}" in
4932 (*/ncurses.h|*/ncursesw.h)
4933         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4934         ;;
4935 (*)
4936         cf_term_header=term.h
4937         ;;
4938 esac
4939
4940 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4941 do
4942 cat >"conftest.$ac_ext" <<_ACEOF
4943 #line 4943 "configure"
4944 #include "confdefs.h"
4945 #include <stdio.h>
4946 #include <${cf_cv_ncurses_header:-curses.h}>
4947 #include <$cf_test>
4948
4949 int
4950 main (void)
4951 {
4952 int x = auto_left_margin; (void)x
4953   ;
4954   return 0;
4955 }
4956 _ACEOF
4957 rm -f "conftest.$ac_objext"
4958 if { (eval echo "$as_me:4958: \"$ac_compile\"") >&5
4959   (eval $ac_compile) 2>&5
4960   ac_status=$?
4961   echo "$as_me:4961: \$? = $ac_status" >&5
4962   (exit "$ac_status"); } &&
4963          { ac_try='test -s "conftest.$ac_objext"'
4964   { (eval echo "$as_me:4964: \"$ac_try\"") >&5
4965   (eval $ac_try) 2>&5
4966   ac_status=$?
4967   echo "$as_me:4967: \$? = $ac_status" >&5
4968   (exit "$ac_status"); }; }; then
4969
4970         cf_cv_term_header="$cf_test"
4971 else
4972   echo "$as_me: failed program was:" >&5
4973 cat "conftest.$ac_ext" >&5
4974
4975         cf_cv_term_header=unknown
4976
4977 fi
4978 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4979         test "$cf_cv_term_header" != unknown && break
4980 done
4981
4982 fi
4983 echo "$as_me:4983: result: $cf_cv_term_header" >&5
4984 echo "${ECHO_T}$cf_cv_term_header" >&6
4985
4986 # Set definitions to allow ifdef'ing to accommodate subdirectories
4987
4988 case "$cf_cv_term_header" in
4989 (*term.h)
4990
4991 cat >>confdefs.h <<\EOF
4992 #define HAVE_TERM_H 1
4993 EOF
4994
4995         ;;
4996 esac
4997
4998 case "$cf_cv_term_header" in
4999 (ncurses/term.h)
5000
5001 cat >>confdefs.h <<\EOF
5002 #define HAVE_NCURSES_TERM_H 1
5003 EOF
5004
5005         ;;
5006 (ncursesw/term.h)
5007
5008 cat >>confdefs.h <<\EOF
5009 #define HAVE_NCURSESW_TERM_H 1
5010 EOF
5011
5012         ;;
5013 esac
5014
5015                 fi
5016
5017         else
5018                 echo "$as_me:5018: result: no" >&5
5019 echo "${ECHO_T}no" >&6
5020                 NCURSES_CONFIG_PKG=none
5021         fi
5022 else
5023         NCURSES_CONFIG_PKG=none
5024 fi
5025
5026 if test "x$cf_have_ncuconfig" = "xno"; then
5027         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5028
5029 if test -n "$ac_tool_prefix"; then
5030   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5031   do
5032     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5033 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5034 echo "$as_me:5034: checking for $ac_word" >&5
5035 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5036 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5037   echo $ECHO_N "(cached) $ECHO_C" >&6
5038 else
5039   if test -n "$NCURSES_CONFIG"; then
5040   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5041 else
5042   ac_save_IFS=$IFS; IFS=$ac_path_separator
5043 ac_dummy="$PATH"
5044 for ac_dir in $ac_dummy; do
5045   IFS=$ac_save_IFS
5046   test -z "$ac_dir" && ac_dir=.
5047   $as_executable_p "$ac_dir/$ac_word" || continue
5048 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5049 echo "$as_me:5049: found $ac_dir/$ac_word" >&5
5050 break
5051 done
5052
5053 fi
5054 fi
5055 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5056 if test -n "$NCURSES_CONFIG"; then
5057   echo "$as_me:5057: result: $NCURSES_CONFIG" >&5
5058 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5059 else
5060   echo "$as_me:5060: result: no" >&5
5061 echo "${ECHO_T}no" >&6
5062 fi
5063
5064     test -n "$NCURSES_CONFIG" && break
5065   done
5066 fi
5067 if test -z "$NCURSES_CONFIG"; then
5068   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5069   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5070 do
5071   # Extract the first word of "$ac_prog", so it can be a program name with args.
5072 set dummy $ac_prog; ac_word=$2
5073 echo "$as_me:5073: checking for $ac_word" >&5
5074 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5075 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5076   echo $ECHO_N "(cached) $ECHO_C" >&6
5077 else
5078   if test -n "$ac_ct_NCURSES_CONFIG"; then
5079   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5080 else
5081   ac_save_IFS=$IFS; IFS=$ac_path_separator
5082 ac_dummy="$PATH"
5083 for ac_dir in $ac_dummy; do
5084   IFS=$ac_save_IFS
5085   test -z "$ac_dir" && ac_dir=.
5086   $as_executable_p "$ac_dir/$ac_word" || continue
5087 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5088 echo "$as_me:5088: found $ac_dir/$ac_word" >&5
5089 break
5090 done
5091
5092 fi
5093 fi
5094 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5095 if test -n "$ac_ct_NCURSES_CONFIG"; then
5096   echo "$as_me:5096: result: $ac_ct_NCURSES_CONFIG" >&5
5097 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5098 else
5099   echo "$as_me:5099: result: no" >&5
5100 echo "${ECHO_T}no" >&6
5101 fi
5102
5103   test -n "$ac_ct_NCURSES_CONFIG" && break
5104 done
5105 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5106
5107   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5108 fi
5109
5110         if test "$NCURSES_CONFIG" != none ; then
5111
5112 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5113 do
5114         case "x$cf_add_cflags" in
5115         (x-[DU]*)
5116
5117 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5118 while true
5119 do
5120         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'`
5121         test "$CFLAGS" != "$cf_old_cflag" || break
5122
5123         CFLAGS="$cf_old_cflag"
5124 done
5125
5126 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5127 while true
5128 do
5129         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'`
5130         test "$CPPFLAGS" != "$cf_old_cflag" || break
5131
5132         CPPFLAGS="$cf_old_cflag"
5133 done
5134
5135                 ;;
5136         esac
5137
5138 cf_fix_cppflags=no
5139 cf_new_cflags=
5140 cf_new_cppflags=
5141 cf_new_extra_cppflags=
5142
5143 for cf_add_cflags in $cf_add_cflags
5144 do
5145 case "$cf_fix_cppflags" in
5146 (no)
5147         case "$cf_add_cflags" in
5148         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5149                 case "$cf_add_cflags" in
5150                 (-D*)
5151                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5152
5153                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5154                                 && test -z "${cf_tst_cflags}" \
5155                                 && cf_fix_cppflags=yes
5156
5157                         if test "$cf_fix_cppflags" = yes ; then
5158
5159         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5160         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5161
5162                                 continue
5163                         elif test "${cf_tst_cflags}" = "\"'" ; then
5164
5165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5167
5168                                 continue
5169                         fi
5170                         ;;
5171                 esac
5172                 case "$CPPFLAGS" in
5173                 (*$cf_add_cflags)
5174                         ;;
5175                 (*)
5176                         case "$cf_add_cflags" in
5177                         (-D*)
5178                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5179
5180 CPPFLAGS=`echo "$CPPFLAGS" | \
5181         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5182                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5183
5184                                 ;;
5185                         esac
5186
5187         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5188         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5189
5190                         ;;
5191                 esac
5192                 ;;
5193         (*)
5194
5195         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5196         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5197
5198                 ;;
5199         esac
5200         ;;
5201 (yes)
5202
5203         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5204         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5205
5206         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5207
5208         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5209                 && test -z "${cf_tst_cflags}" \
5210                 && cf_fix_cppflags=no
5211         ;;
5212 esac
5213 done
5214
5215 if test -n "$cf_new_cflags" ; then
5216
5217         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5218         CFLAGS="${CFLAGS}$cf_new_cflags"
5219
5220 fi
5221
5222 if test -n "$cf_new_cppflags" ; then
5223
5224         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5225         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5226
5227 fi
5228
5229 if test -n "$cf_new_extra_cppflags" ; then
5230
5231         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5232         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5233
5234 fi
5235
5236 done
5237
5238 cf_add_libs="$LIBS"
5239 # reverse order
5240 cf_add_0lib=
5241 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5242 # filter duplicates
5243 for cf_add_1lib in $cf_add_0lib; do
5244         for cf_add_2lib in $cf_add_libs; do
5245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5246                         cf_add_1lib=
5247                         break
5248                 fi
5249         done
5250         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5251 done
5252 LIBS="$cf_add_libs"
5253
5254                 # even with config script, some packages use no-override for curses.h
5255
5256 echo "$as_me:5256: checking if we have identified curses headers" >&5
5257 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5258 if test "${cf_cv_ncurses_header+set}" = set; then
5259   echo $ECHO_N "(cached) $ECHO_C" >&6
5260 else
5261
5262 cf_cv_ncurses_header=none
5263 for cf_header in \
5264         ncurses.h ncurses/ncurses.h \
5265         curses.h ncurses/curses.h
5266 do
5267 cat >"conftest.$ac_ext" <<_ACEOF
5268 #line 5268 "configure"
5269 #include "confdefs.h"
5270 #include <${cf_header}>
5271 int
5272 main (void)
5273 {
5274 initscr(); tgoto("?", 0,0)
5275   ;
5276   return 0;
5277 }
5278 _ACEOF
5279 rm -f "conftest.$ac_objext"
5280 if { (eval echo "$as_me:5280: \"$ac_compile\"") >&5
5281   (eval $ac_compile) 2>&5
5282   ac_status=$?
5283   echo "$as_me:5283: \$? = $ac_status" >&5
5284   (exit "$ac_status"); } &&
5285          { ac_try='test -s "conftest.$ac_objext"'
5286   { (eval echo "$as_me:5286: \"$ac_try\"") >&5
5287   (eval $ac_try) 2>&5
5288   ac_status=$?
5289   echo "$as_me:5289: \$? = $ac_status" >&5
5290   (exit "$ac_status"); }; }; then
5291   cf_cv_ncurses_header=$cf_header; break
5292 else
5293   echo "$as_me: failed program was:" >&5
5294 cat "conftest.$ac_ext" >&5
5295 fi
5296 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5297 done
5298
5299 fi
5300 echo "$as_me:5300: result: $cf_cv_ncurses_header" >&5
5301 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5302
5303 if test "$cf_cv_ncurses_header" = none ; then
5304         { { echo "$as_me:5304: error: No curses header-files found" >&5
5305 echo "$as_me: error: No curses header-files found" >&2;}
5306    { (exit 1); exit 1; }; }
5307 fi
5308
5309 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5310
5311 for ac_header in $cf_cv_ncurses_header
5312 do
5313 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5314 echo "$as_me:5314: checking for $ac_header" >&5
5315 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5316 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5317   echo $ECHO_N "(cached) $ECHO_C" >&6
5318 else
5319   cat >"conftest.$ac_ext" <<_ACEOF
5320 #line 5320 "configure"
5321 #include "confdefs.h"
5322 #include <$ac_header>
5323 _ACEOF
5324 if { (eval echo "$as_me:5324: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5325   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5326   ac_status=$?
5327   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5328   rm -f conftest.er1
5329   cat conftest.err >&5
5330   echo "$as_me:5330: \$? = $ac_status" >&5
5331   (exit "$ac_status"); } >/dev/null; then
5332   if test -s conftest.err; then
5333     ac_cpp_err=$ac_c_preproc_warn_flag
5334   else
5335     ac_cpp_err=
5336   fi
5337 else
5338   ac_cpp_err=yes
5339 fi
5340 if test -z "$ac_cpp_err"; then
5341   eval "$as_ac_Header=yes"
5342 else
5343   echo "$as_me: failed program was:" >&5
5344   cat "conftest.$ac_ext" >&5
5345   eval "$as_ac_Header=no"
5346 fi
5347 rm -f conftest.err "conftest.$ac_ext"
5348 fi
5349 echo "$as_me:5349: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5350 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5351 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5352   cat >>confdefs.h <<EOF
5353 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5354 EOF
5355
5356 fi
5357 done
5358
5359 cat >>confdefs.h <<\EOF
5360 #define NCURSES 1
5361 EOF
5362
5363 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5364
5365                 cat >>confdefs.h <<EOF
5366 #define $cf_nculib_ROOT 1
5367 EOF
5368
5369                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5370
5371         else
5372
5373 cf_ncuhdr_root=ncurses
5374
5375 test -n "$cf_cv_curses_dir" && \
5376 test "$cf_cv_curses_dir" != "no" && { \
5377
5378 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5379   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5380   do
5381         while test "$cf_add_incdir" != /usr/include
5382         do
5383           if test -d "$cf_add_incdir"
5384           then
5385                 cf_have_incdir=no
5386                 if test -n "$CFLAGS$CPPFLAGS" ; then
5387                   # a loop is needed to ensure we can add subdirs of existing dirs
5388                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5389                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5390                           cf_have_incdir=yes; break
5391                         fi
5392                   done
5393                 fi
5394
5395                 if test "$cf_have_incdir" = no ; then
5396                   if test "$cf_add_incdir" = /usr/local/include ; then
5397                         if test "$GCC" = yes
5398                         then
5399                           cf_save_CPPFLAGS=$CPPFLAGS
5400
5401         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5402         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5403
5404                           cat >"conftest.$ac_ext" <<_ACEOF
5405 #line 5405 "configure"
5406 #include "confdefs.h"
5407 #include <stdio.h>
5408 int
5409 main (void)
5410 {
5411 printf("Hello")
5412   ;
5413   return 0;
5414 }
5415 _ACEOF
5416 rm -f "conftest.$ac_objext"
5417 if { (eval echo "$as_me:5417: \"$ac_compile\"") >&5
5418   (eval $ac_compile) 2>&5
5419   ac_status=$?
5420   echo "$as_me:5420: \$? = $ac_status" >&5
5421   (exit "$ac_status"); } &&
5422          { ac_try='test -s "conftest.$ac_objext"'
5423   { (eval echo "$as_me:5423: \"$ac_try\"") >&5
5424   (eval $ac_try) 2>&5
5425   ac_status=$?
5426   echo "$as_me:5426: \$? = $ac_status" >&5
5427   (exit "$ac_status"); }; }; then
5428   :
5429 else
5430   echo "$as_me: failed program was:" >&5
5431 cat "conftest.$ac_ext" >&5
5432 cf_have_incdir=yes
5433 fi
5434 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5435                           CPPFLAGS=$cf_save_CPPFLAGS
5436                         fi
5437                   fi
5438                 fi
5439
5440                 if test "$cf_have_incdir" = no ; then
5441                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5442
5443 echo "${as_me:-configure}:5443: testing adding $cf_add_incdir to include-path ..." 1>&5
5444
5445                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5446
5447                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5448                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5449                   cf_add_incdir="$cf_top_incdir"
5450                 else
5451                   break
5452                 fi
5453           else
5454                 break
5455           fi
5456         done
5457   done
5458 fi
5459
5460 }
5461
5462 echo "$as_me:5462: checking for $cf_ncuhdr_root header in include-path" >&5
5463 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5464 if test "${cf_cv_ncurses_h+set}" = set; then
5465   echo $ECHO_N "(cached) $ECHO_C" >&6
5466 else
5467
5468         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5469         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5470         for cf_header in $cf_header_list
5471         do
5472
5473         cat >"conftest.$ac_ext" <<_ACEOF
5474 #line 5474 "configure"
5475 #include "confdefs.h"
5476
5477 #include <$cf_header>
5478 int
5479 main (void)
5480 {
5481
5482 #ifdef NCURSES_VERSION
5483
5484 printf("%s\\n", NCURSES_VERSION);
5485 #else
5486 #ifdef __NCURSES_H
5487 printf("old\\n");
5488 #else
5489         make an error
5490 #endif
5491 #endif
5492
5493   ;
5494   return 0;
5495 }
5496 _ACEOF
5497 rm -f "conftest.$ac_objext"
5498 if { (eval echo "$as_me:5498: \"$ac_compile\"") >&5
5499   (eval $ac_compile) 2>&5
5500   ac_status=$?
5501   echo "$as_me:5501: \$? = $ac_status" >&5
5502   (exit "$ac_status"); } &&
5503          { ac_try='test -s "conftest.$ac_objext"'
5504   { (eval echo "$as_me:5504: \"$ac_try\"") >&5
5505   (eval $ac_try) 2>&5
5506   ac_status=$?
5507   echo "$as_me:5507: \$? = $ac_status" >&5
5508   (exit "$ac_status"); }; }; then
5509   cf_cv_ncurses_h=$cf_header
5510
5511 else
5512   echo "$as_me: failed program was:" >&5
5513 cat "conftest.$ac_ext" >&5
5514 cf_cv_ncurses_h=no
5515 fi
5516 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5517
5518                 test "$cf_cv_ncurses_h" != no && break
5519         done
5520
5521 fi
5522 echo "$as_me:5522: result: $cf_cv_ncurses_h" >&5
5523 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5524
5525 if test "$cf_cv_ncurses_h" != no ; then
5526         cf_cv_ncurses_header=$cf_cv_ncurses_h
5527 else
5528
5529 echo "$as_me:5529: checking for $cf_ncuhdr_root include-path" >&5
5530 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5531 if test "${cf_cv_ncurses_h2+set}" = set; then
5532   echo $ECHO_N "(cached) $ECHO_C" >&6
5533 else
5534
5535         test -n "$verbose" && echo
5536
5537 cf_search=
5538
5539 # collect the current set of include-directories from compiler flags
5540 cf_header_path_list=""
5541 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5542         for cf_header_path in $CPPFLAGS $CFLAGS
5543         do
5544                 case "$cf_header_path" in
5545                 (-I*)
5546                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5547
5548 test "x$cf_header_path" != "xNONE" && \
5549 test -d "$cf_header_path" && \
5550  {
5551         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5552         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5553         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5554         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5555         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5556         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"
5557 }
5558
5559                         cf_header_path_list="$cf_header_path_list $cf_search"
5560                         ;;
5561                 esac
5562         done
5563 fi
5564
5565 # add the variations for the package we are looking for
5566
5567 cf_search=
5568
5569 test "x$prefix" != "xNONE" && \
5570 test -d "$prefix" && \
5571  {
5572         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5573         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5574         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5575         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5576         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5577         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5578 }
5579
5580 for cf_subdir_prefix in \
5581         /usr \
5582         /usr/local \
5583         /usr/pkg \
5584         /opt \
5585         /opt/local \
5586         $HOME
5587 do
5588
5589 test "x$cf_subdir_prefix" != "x$prefix" && \
5590 test -d "$cf_subdir_prefix" && \
5591 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5592         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5593         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5594         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5595         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5596         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5597         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"
5598 }
5599
5600 done
5601
5602 test "$includedir" != NONE && \
5603 test "$includedir" != "/usr/include" && \
5604 test -d "$includedir" && {
5605         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5606         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5607 }
5608
5609 test "$oldincludedir" != NONE && \
5610 test "$oldincludedir" != "/usr/include" && \
5611 test -d "$oldincludedir" && {
5612         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5613         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5614 }
5615
5616 cf_search="$cf_search $cf_header_path_list"
5617
5618         test -n "$verbose" && echo "search path $cf_search"
5619         cf_save2_CPPFLAGS="$CPPFLAGS"
5620         for cf_incdir in $cf_search
5621         do
5622
5623 if test -n "$cf_incdir" ; then
5624   for cf_add_incdir in $cf_incdir
5625   do
5626         while test "$cf_add_incdir" != /usr/include
5627         do
5628           if test -d "$cf_add_incdir"
5629           then
5630                 cf_have_incdir=no
5631                 if test -n "$CFLAGS$CPPFLAGS" ; then
5632                   # a loop is needed to ensure we can add subdirs of existing dirs
5633                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5634                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5635                           cf_have_incdir=yes; break
5636                         fi
5637                   done
5638                 fi
5639
5640                 if test "$cf_have_incdir" = no ; then
5641                   if test "$cf_add_incdir" = /usr/local/include ; then
5642                         if test "$GCC" = yes
5643                         then
5644                           cf_save_CPPFLAGS=$CPPFLAGS
5645
5646         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5647         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5648
5649                           cat >"conftest.$ac_ext" <<_ACEOF
5650 #line 5650 "configure"
5651 #include "confdefs.h"
5652 #include <stdio.h>
5653 int
5654 main (void)
5655 {
5656 printf("Hello")
5657   ;
5658   return 0;
5659 }
5660 _ACEOF
5661 rm -f "conftest.$ac_objext"
5662 if { (eval echo "$as_me:5662: \"$ac_compile\"") >&5
5663   (eval $ac_compile) 2>&5
5664   ac_status=$?
5665   echo "$as_me:5665: \$? = $ac_status" >&5
5666   (exit "$ac_status"); } &&
5667          { ac_try='test -s "conftest.$ac_objext"'
5668   { (eval echo "$as_me:5668: \"$ac_try\"") >&5
5669   (eval $ac_try) 2>&5
5670   ac_status=$?
5671   echo "$as_me:5671: \$? = $ac_status" >&5
5672   (exit "$ac_status"); }; }; then
5673   :
5674 else
5675   echo "$as_me: failed program was:" >&5
5676 cat "conftest.$ac_ext" >&5
5677 cf_have_incdir=yes
5678 fi
5679 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5680                           CPPFLAGS=$cf_save_CPPFLAGS
5681                         fi
5682                   fi
5683                 fi
5684
5685                 if test "$cf_have_incdir" = no ; then
5686                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5687
5688 echo "${as_me:-configure}:5688: testing adding $cf_add_incdir to include-path ..." 1>&5
5689
5690                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5691
5692                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5693                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5694                   cf_add_incdir="$cf_top_incdir"
5695                 else
5696                   break
5697                 fi
5698           else
5699                 break
5700           fi
5701         done
5702   done
5703 fi
5704
5705                 for cf_header in \
5706                         ncurses.h \
5707                         curses.h
5708                 do
5709
5710         cat >"conftest.$ac_ext" <<_ACEOF
5711 #line 5711 "configure"
5712 #include "confdefs.h"
5713
5714 #include <$cf_header>
5715 int
5716 main (void)
5717 {
5718
5719 #ifdef NCURSES_VERSION
5720
5721 printf("%s\\n", NCURSES_VERSION);
5722 #else
5723 #ifdef __NCURSES_H
5724 printf("old\\n");
5725 #else
5726         make an error
5727 #endif
5728 #endif
5729
5730   ;
5731   return 0;
5732 }
5733 _ACEOF
5734 rm -f "conftest.$ac_objext"
5735 if { (eval echo "$as_me:5735: \"$ac_compile\"") >&5
5736   (eval $ac_compile) 2>&5
5737   ac_status=$?
5738   echo "$as_me:5738: \$? = $ac_status" >&5
5739   (exit "$ac_status"); } &&
5740          { ac_try='test -s "conftest.$ac_objext"'
5741   { (eval echo "$as_me:5741: \"$ac_try\"") >&5
5742   (eval $ac_try) 2>&5
5743   ac_status=$?
5744   echo "$as_me:5744: \$? = $ac_status" >&5
5745   (exit "$ac_status"); }; }; then
5746   cf_cv_ncurses_h2=$cf_header
5747
5748 else
5749   echo "$as_me: failed program was:" >&5
5750 cat "conftest.$ac_ext" >&5
5751 cf_cv_ncurses_h2=no
5752 fi
5753 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5754
5755                         if test "$cf_cv_ncurses_h2" != no ; then
5756                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5757                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5758                                 break
5759                         fi
5760                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5761                 done
5762                 CPPFLAGS="$cf_save2_CPPFLAGS"
5763                 test "$cf_cv_ncurses_h2" != no && break
5764         done
5765         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5765: error: not found" >&5
5766 echo "$as_me: error: not found" >&2;}
5767    { (exit 1); exit 1; }; }
5768
5769 fi
5770 echo "$as_me:5770: result: $cf_cv_ncurses_h2" >&5
5771 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5772
5773         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5774         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5775         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5776                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5777         fi
5778
5779 if test -n "$cf_1st_incdir" ; then
5780   for cf_add_incdir in $cf_1st_incdir
5781   do
5782         while test "$cf_add_incdir" != /usr/include
5783         do
5784           if test -d "$cf_add_incdir"
5785           then
5786                 cf_have_incdir=no
5787                 if test -n "$CFLAGS$CPPFLAGS" ; then
5788                   # a loop is needed to ensure we can add subdirs of existing dirs
5789                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5790                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5791                           cf_have_incdir=yes; break
5792                         fi
5793                   done
5794                 fi
5795
5796                 if test "$cf_have_incdir" = no ; then
5797                   if test "$cf_add_incdir" = /usr/local/include ; then
5798                         if test "$GCC" = yes
5799                         then
5800                           cf_save_CPPFLAGS=$CPPFLAGS
5801
5802         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5803         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5804
5805                           cat >"conftest.$ac_ext" <<_ACEOF
5806 #line 5806 "configure"
5807 #include "confdefs.h"
5808 #include <stdio.h>
5809 int
5810 main (void)
5811 {
5812 printf("Hello")
5813   ;
5814   return 0;
5815 }
5816 _ACEOF
5817 rm -f "conftest.$ac_objext"
5818 if { (eval echo "$as_me:5818: \"$ac_compile\"") >&5
5819   (eval $ac_compile) 2>&5
5820   ac_status=$?
5821   echo "$as_me:5821: \$? = $ac_status" >&5
5822   (exit "$ac_status"); } &&
5823          { ac_try='test -s "conftest.$ac_objext"'
5824   { (eval echo "$as_me:5824: \"$ac_try\"") >&5
5825   (eval $ac_try) 2>&5
5826   ac_status=$?
5827   echo "$as_me:5827: \$? = $ac_status" >&5
5828   (exit "$ac_status"); }; }; then
5829   :
5830 else
5831   echo "$as_me: failed program was:" >&5
5832 cat "conftest.$ac_ext" >&5
5833 cf_have_incdir=yes
5834 fi
5835 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5836                           CPPFLAGS=$cf_save_CPPFLAGS
5837                         fi
5838                   fi
5839                 fi
5840
5841                 if test "$cf_have_incdir" = no ; then
5842                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5843
5844 echo "${as_me:-configure}:5844: testing adding $cf_add_incdir to include-path ..." 1>&5
5845
5846                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5847
5848                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5849                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5850                   cf_add_incdir="$cf_top_incdir"
5851                 else
5852                   break
5853                 fi
5854           else
5855                 break
5856           fi
5857         done
5858   done
5859 fi
5860
5861 fi
5862
5863 # Set definitions to allow ifdef'ing for ncurses.h
5864
5865 case "$cf_cv_ncurses_header" in
5866 (*ncurses.h)
5867
5868 cat >>confdefs.h <<\EOF
5869 #define HAVE_NCURSES_H 1
5870 EOF
5871
5872         ;;
5873 esac
5874
5875 case "$cf_cv_ncurses_header" in
5876 (ncurses/curses.h|ncurses/ncurses.h)
5877
5878 cat >>confdefs.h <<\EOF
5879 #define HAVE_NCURSES_NCURSES_H 1
5880 EOF
5881
5882         ;;
5883 (ncursesw/curses.h|ncursesw/ncurses.h)
5884
5885 cat >>confdefs.h <<\EOF
5886 #define HAVE_NCURSESW_NCURSES_H 1
5887 EOF
5888
5889         ;;
5890 esac
5891
5892 echo "$as_me:5892: checking for terminfo header" >&5
5893 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5894 if test "${cf_cv_term_header+set}" = set; then
5895   echo $ECHO_N "(cached) $ECHO_C" >&6
5896 else
5897
5898 case "${cf_cv_ncurses_header}" in
5899 (*/ncurses.h|*/ncursesw.h)
5900         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5901         ;;
5902 (*)
5903         cf_term_header=term.h
5904         ;;
5905 esac
5906
5907 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5908 do
5909 cat >"conftest.$ac_ext" <<_ACEOF
5910 #line 5910 "configure"
5911 #include "confdefs.h"
5912 #include <stdio.h>
5913 #include <${cf_cv_ncurses_header:-curses.h}>
5914 #include <$cf_test>
5915
5916 int
5917 main (void)
5918 {
5919 int x = auto_left_margin; (void)x
5920   ;
5921   return 0;
5922 }
5923 _ACEOF
5924 rm -f "conftest.$ac_objext"
5925 if { (eval echo "$as_me:5925: \"$ac_compile\"") >&5
5926   (eval $ac_compile) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit "$ac_status"); } &&
5930          { ac_try='test -s "conftest.$ac_objext"'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit "$ac_status"); }; }; then
5936
5937         cf_cv_term_header="$cf_test"
5938 else
5939   echo "$as_me: failed program was:" >&5
5940 cat "conftest.$ac_ext" >&5
5941
5942         cf_cv_term_header=unknown
5943
5944 fi
5945 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5946         test "$cf_cv_term_header" != unknown && break
5947 done
5948
5949 fi
5950 echo "$as_me:5950: result: $cf_cv_term_header" >&5
5951 echo "${ECHO_T}$cf_cv_term_header" >&6
5952
5953 # Set definitions to allow ifdef'ing to accommodate subdirectories
5954
5955 case "$cf_cv_term_header" in
5956 (*term.h)
5957
5958 cat >>confdefs.h <<\EOF
5959 #define HAVE_TERM_H 1
5960 EOF
5961
5962         ;;
5963 esac
5964
5965 case "$cf_cv_term_header" in
5966 (ncurses/term.h)
5967
5968 cat >>confdefs.h <<\EOF
5969 #define HAVE_NCURSES_TERM_H 1
5970 EOF
5971
5972         ;;
5973 (ncursesw/term.h)
5974
5975 cat >>confdefs.h <<\EOF
5976 #define HAVE_NCURSESW_TERM_H 1
5977 EOF
5978
5979         ;;
5980 esac
5981
5982 # some applications need this, but should check for NCURSES_VERSION
5983
5984 cat >>confdefs.h <<\EOF
5985 #define NCURSES 1
5986 EOF
5987
5988 echo "$as_me:5988: checking for ncurses version" >&5
5989 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5990 if test "${cf_cv_ncurses_version+set}" = set; then
5991   echo $ECHO_N "(cached) $ECHO_C" >&6
5992 else
5993
5994         cf_cv_ncurses_version=no
5995         cf_tempfile=out$$
5996         rm -f "$cf_tempfile"
5997         if test "$cross_compiling" = yes; then
5998
5999         # This will not work if the preprocessor splits the line after the
6000         # Autoconf token.  The 'unproto' program does that.
6001         cat > "conftest.$ac_ext" <<EOF
6002 #include <${cf_cv_ncurses_header:-curses.h}>
6003 #undef Autoconf
6004 #ifdef NCURSES_VERSION
6005 Autoconf NCURSES_VERSION
6006 #else
6007 #ifdef __NCURSES_H
6008 Autoconf "old"
6009 #endif
6010 ;
6011 #endif
6012 EOF
6013         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6014         { (eval echo "$as_me:6014: \"$cf_try\"") >&5
6015   (eval $cf_try) 2>&5
6016   ac_status=$?
6017   echo "$as_me:6017: \$? = $ac_status" >&5
6018   (exit "$ac_status"); }
6019         if test -f conftest.out ; then
6020                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6021                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6022                 rm -f conftest.out
6023         fi
6024
6025 else
6026   cat >"conftest.$ac_ext" <<_ACEOF
6027 #line 6027 "configure"
6028 #include "confdefs.h"
6029
6030 #include <${cf_cv_ncurses_header:-curses.h}>
6031 #include <stdio.h>
6032 int main(void)
6033 {
6034         FILE *fp = fopen("$cf_tempfile", "w");
6035 #ifdef NCURSES_VERSION
6036 # ifdef NCURSES_VERSION_PATCH
6037         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6038 # else
6039         fprintf(fp, "%s\\n", NCURSES_VERSION);
6040 # endif
6041 #else
6042 # ifdef __NCURSES_H
6043         fprintf(fp, "old\\n");
6044 # else
6045         make an error
6046 # endif
6047 #endif
6048         ${cf_cv_main_return:-return}(0);
6049 }
6050 _ACEOF
6051 rm -f "conftest$ac_exeext"
6052 if { (eval echo "$as_me:6052: \"$ac_link\"") >&5
6053   (eval $ac_link) 2>&5
6054   ac_status=$?
6055   echo "$as_me:6055: \$? = $ac_status" >&5
6056   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6057   { (eval echo "$as_me:6057: \"$ac_try\"") >&5
6058   (eval $ac_try) 2>&5
6059   ac_status=$?
6060   echo "$as_me:6060: \$? = $ac_status" >&5
6061   (exit "$ac_status"); }; }; then
6062
6063         cf_cv_ncurses_version=`cat $cf_tempfile`
6064 else
6065   echo "$as_me: program exited with status $ac_status" >&5
6066 echo "$as_me: failed program was:" >&5
6067 cat "conftest.$ac_ext" >&5
6068 fi
6069 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6070 fi
6071         rm -f "$cf_tempfile"
6072
6073 fi
6074 echo "$as_me:6074: result: $cf_cv_ncurses_version" >&5
6075 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6076 test "$cf_cv_ncurses_version" = no ||
6077 cat >>confdefs.h <<\EOF
6078 #define NCURSES 1
6079 EOF
6080
6081 cf_nculib_root=ncurses
6082         # This works, except for the special case where we find gpm, but
6083         # ncurses is in a nonstandard location via $LIBS, and we really want
6084         # to link gpm.
6085 cf_ncurses_LIBS=""
6086 cf_ncurses_SAVE="$LIBS"
6087 echo "$as_me:6087: checking for Gpm_Open in -lgpm" >&5
6088 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6089 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6090   echo $ECHO_N "(cached) $ECHO_C" >&6
6091 else
6092   ac_check_lib_save_LIBS=$LIBS
6093 LIBS="-lgpm  $LIBS"
6094 cat >"conftest.$ac_ext" <<_ACEOF
6095 #line 6095 "configure"
6096 #include "confdefs.h"
6097
6098 /* Override any gcc2 internal prototype to avoid an error.  */
6099 #ifdef __cplusplus
6100 extern "C"
6101 #endif
6102 /* We use char because int might match the return type of a gcc2
6103    builtin and then its argument prototype would still apply.  */
6104 char Gpm_Open ();
6105 int
6106 main (void)
6107 {
6108 Gpm_Open ();
6109   ;
6110   return 0;
6111 }
6112 _ACEOF
6113 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6114 if { (eval echo "$as_me:6114: \"$ac_link\"") >&5
6115   (eval $ac_link) 2>&5
6116   ac_status=$?
6117   echo "$as_me:6117: \$? = $ac_status" >&5
6118   (exit "$ac_status"); } &&
6119          { ac_try='test -s "conftest$ac_exeext"'
6120   { (eval echo "$as_me:6120: \"$ac_try\"") >&5
6121   (eval $ac_try) 2>&5
6122   ac_status=$?
6123   echo "$as_me:6123: \$? = $ac_status" >&5
6124   (exit "$ac_status"); }; }; then
6125   ac_cv_lib_gpm_Gpm_Open=yes
6126 else
6127   echo "$as_me: failed program was:" >&5
6128 cat "conftest.$ac_ext" >&5
6129 ac_cv_lib_gpm_Gpm_Open=no
6130 fi
6131 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6132 LIBS=$ac_check_lib_save_LIBS
6133 fi
6134 echo "$as_me:6134: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6135 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6136 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6137   echo "$as_me:6137: checking for initscr in -lgpm" >&5
6138 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6139 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6140   echo $ECHO_N "(cached) $ECHO_C" >&6
6141 else
6142   ac_check_lib_save_LIBS=$LIBS
6143 LIBS="-lgpm  $LIBS"
6144 cat >"conftest.$ac_ext" <<_ACEOF
6145 #line 6145 "configure"
6146 #include "confdefs.h"
6147
6148 /* Override any gcc2 internal prototype to avoid an error.  */
6149 #ifdef __cplusplus
6150 extern "C"
6151 #endif
6152 /* We use char because int might match the return type of a gcc2
6153    builtin and then its argument prototype would still apply.  */
6154 char initscr ();
6155 int
6156 main (void)
6157 {
6158 initscr ();
6159   ;
6160   return 0;
6161 }
6162 _ACEOF
6163 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6164 if { (eval echo "$as_me:6164: \"$ac_link\"") >&5
6165   (eval $ac_link) 2>&5
6166   ac_status=$?
6167   echo "$as_me:6167: \$? = $ac_status" >&5
6168   (exit "$ac_status"); } &&
6169          { ac_try='test -s "conftest$ac_exeext"'
6170   { (eval echo "$as_me:6170: \"$ac_try\"") >&5
6171   (eval $ac_try) 2>&5
6172   ac_status=$?
6173   echo "$as_me:6173: \$? = $ac_status" >&5
6174   (exit "$ac_status"); }; }; then
6175   ac_cv_lib_gpm_initscr=yes
6176 else
6177   echo "$as_me: failed program was:" >&5
6178 cat "conftest.$ac_ext" >&5
6179 ac_cv_lib_gpm_initscr=no
6180 fi
6181 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6182 LIBS=$ac_check_lib_save_LIBS
6183 fi
6184 echo "$as_me:6184: result: $ac_cv_lib_gpm_initscr" >&5
6185 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6186 if test "$ac_cv_lib_gpm_initscr" = yes; then
6187   LIBS="$cf_ncurses_SAVE"
6188 else
6189   cf_ncurses_LIBS="-lgpm"
6190 fi
6191
6192 fi
6193
6194 case "$host_os" in
6195 (freebsd*)
6196         # This is only necessary if you are linking against an obsolete
6197         # version of ncurses (but it should do no harm, since it is static).
6198         if test "$cf_nculib_root" = ncurses ; then
6199                 echo "$as_me:6199: checking for tgoto in -lmytinfo" >&5
6200 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6201 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6202   echo $ECHO_N "(cached) $ECHO_C" >&6
6203 else
6204   ac_check_lib_save_LIBS=$LIBS
6205 LIBS="-lmytinfo  $LIBS"
6206 cat >"conftest.$ac_ext" <<_ACEOF
6207 #line 6207 "configure"
6208 #include "confdefs.h"
6209
6210 /* Override any gcc2 internal prototype to avoid an error.  */
6211 #ifdef __cplusplus
6212 extern "C"
6213 #endif
6214 /* We use char because int might match the return type of a gcc2
6215    builtin and then its argument prototype would still apply.  */
6216 char tgoto ();
6217 int
6218 main (void)
6219 {
6220 tgoto ();
6221   ;
6222   return 0;
6223 }
6224 _ACEOF
6225 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6226 if { (eval echo "$as_me:6226: \"$ac_link\"") >&5
6227   (eval $ac_link) 2>&5
6228   ac_status=$?
6229   echo "$as_me:6229: \$? = $ac_status" >&5
6230   (exit "$ac_status"); } &&
6231          { ac_try='test -s "conftest$ac_exeext"'
6232   { (eval echo "$as_me:6232: \"$ac_try\"") >&5
6233   (eval $ac_try) 2>&5
6234   ac_status=$?
6235   echo "$as_me:6235: \$? = $ac_status" >&5
6236   (exit "$ac_status"); }; }; then
6237   ac_cv_lib_mytinfo_tgoto=yes
6238 else
6239   echo "$as_me: failed program was:" >&5
6240 cat "conftest.$ac_ext" >&5
6241 ac_cv_lib_mytinfo_tgoto=no
6242 fi
6243 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6244 LIBS=$ac_check_lib_save_LIBS
6245 fi
6246 echo "$as_me:6246: result: $ac_cv_lib_mytinfo_tgoto" >&5
6247 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6248 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6249   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6250 fi
6251
6252         fi
6253         ;;
6254 esac
6255
6256 cf_add_libs="$LIBS"
6257 # reverse order
6258 cf_add_0lib=
6259 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6260 # filter duplicates
6261 for cf_add_1lib in $cf_add_0lib; do
6262         for cf_add_2lib in $cf_add_libs; do
6263                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6264                         cf_add_1lib=
6265                         break
6266                 fi
6267         done
6268         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6269 done
6270 LIBS="$cf_add_libs"
6271
6272 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6273 then
6274
6275 cf_add_libs="$LIBS"
6276 # reverse order
6277 cf_add_0lib=
6278 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6279 # filter duplicates
6280 for cf_add_1lib in $cf_add_0lib; do
6281         for cf_add_2lib in $cf_add_libs; do
6282                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6283                         cf_add_1lib=
6284                         break
6285                 fi
6286         done
6287         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6288 done
6289 LIBS="$cf_add_libs"
6290
6291 else
6292
6293         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6294         cf_libdir=""
6295         echo "$as_me:6295: checking for initscr" >&5
6296 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6297 if test "${ac_cv_func_initscr+set}" = set; then
6298   echo $ECHO_N "(cached) $ECHO_C" >&6
6299 else
6300   cat >"conftest.$ac_ext" <<_ACEOF
6301 #line 6301 "configure"
6302 #include "confdefs.h"
6303 #define initscr autoconf_temporary
6304 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6305 #undef initscr
6306
6307 #ifdef __cplusplus
6308 extern "C"
6309 #endif
6310
6311 /* We use char because int might match the return type of a gcc2
6312    builtin and then its argument prototype would still apply.  */
6313 char initscr (void);
6314
6315 int
6316 main (void)
6317 {
6318
6319 /* The GNU C library defines stubs for functions which it implements
6320     to always fail with ENOSYS.  Some functions are actually named
6321     something starting with __ and the normal name is an alias.  */
6322 #if defined (__stub_initscr) || defined (__stub___initscr)
6323 #error found stub for initscr
6324 #endif
6325
6326         return initscr ();
6327   ;
6328   return 0;
6329 }
6330 _ACEOF
6331 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6332 if { (eval echo "$as_me:6332: \"$ac_link\"") >&5
6333   (eval $ac_link) 2>&5
6334   ac_status=$?
6335   echo "$as_me:6335: \$? = $ac_status" >&5
6336   (exit "$ac_status"); } &&
6337          { ac_try='test -s "conftest$ac_exeext"'
6338   { (eval echo "$as_me:6338: \"$ac_try\"") >&5
6339   (eval $ac_try) 2>&5
6340   ac_status=$?
6341   echo "$as_me:6341: \$? = $ac_status" >&5
6342   (exit "$ac_status"); }; }; then
6343   ac_cv_func_initscr=yes
6344 else
6345   echo "$as_me: failed program was:" >&5
6346 cat "conftest.$ac_ext" >&5
6347 ac_cv_func_initscr=no
6348 fi
6349 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6350 fi
6351 echo "$as_me:6351: result: $ac_cv_func_initscr" >&5
6352 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6353 if test "$ac_cv_func_initscr" = yes; then
6354   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6355 else
6356
6357                 cf_save_LIBS="$LIBS"
6358                 echo "$as_me:6358: checking for initscr in -l$cf_nculib_root" >&5
6359 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6360                 LIBS="-l$cf_nculib_root $LIBS"
6361                 cat >"conftest.$ac_ext" <<_ACEOF
6362 #line 6362 "configure"
6363 #include "confdefs.h"
6364 #include <${cf_cv_ncurses_header:-curses.h}>
6365 int
6366 main (void)
6367 {
6368 initscr()
6369   ;
6370   return 0;
6371 }
6372 _ACEOF
6373 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6374 if { (eval echo "$as_me:6374: \"$ac_link\"") >&5
6375   (eval $ac_link) 2>&5
6376   ac_status=$?
6377   echo "$as_me:6377: \$? = $ac_status" >&5
6378   (exit "$ac_status"); } &&
6379          { ac_try='test -s "conftest$ac_exeext"'
6380   { (eval echo "$as_me:6380: \"$ac_try\"") >&5
6381   (eval $ac_try) 2>&5
6382   ac_status=$?
6383   echo "$as_me:6383: \$? = $ac_status" >&5
6384   (exit "$ac_status"); }; }; then
6385   echo "$as_me:6385: result: yes" >&5
6386 echo "${ECHO_T}yes" >&6
6387                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6388
6389 else
6390   echo "$as_me: failed program was:" >&5
6391 cat "conftest.$ac_ext" >&5
6392 echo "$as_me:6392: result: no" >&5
6393 echo "${ECHO_T}no" >&6
6394
6395 cf_search=
6396 cf_library_path_list=""
6397 if test -n "${LDFLAGS}${LIBS}" ; then
6398         for cf_library_path in $LDFLAGS $LIBS
6399         do
6400                 case "$cf_library_path" in
6401                 (-L*)
6402                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6403
6404 test "x$cf_library_path" != "xNONE" && \
6405 test -d "$cf_library_path" && \
6406  {
6407         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6408         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6409         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6410         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6411         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6412         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"
6413 }
6414
6415                         cf_library_path_list="$cf_library_path_list $cf_search"
6416                         ;;
6417                 esac
6418         done
6419 fi
6420
6421 cf_search=
6422
6423 test "x$prefix" != "xNONE" && \
6424 test -d "$prefix" && \
6425  {
6426         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6427         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6428         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6429         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6430         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6431         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6432 }
6433
6434 for cf_subdir_prefix in \
6435         /usr \
6436         /usr/local \
6437         /usr/pkg \
6438         /opt \
6439         /opt/local \
6440         $HOME
6441 do
6442
6443 test "x$cf_subdir_prefix" != "x$prefix" && \
6444 test -d "$cf_subdir_prefix" && \
6445 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6446         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6447         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6448         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6449         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6450         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6451         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"
6452 }
6453
6454 done
6455
6456 cf_search="$cf_library_path_list $cf_search"
6457
6458                         for cf_libdir in $cf_search
6459                         do
6460                                 echo "$as_me:6460: checking for -l$cf_nculib_root in $cf_libdir" >&5
6461 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6462                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6463                                 cat >"conftest.$ac_ext" <<_ACEOF
6464 #line 6464 "configure"
6465 #include "confdefs.h"
6466 #include <${cf_cv_ncurses_header:-curses.h}>
6467 int
6468 main (void)
6469 {
6470 initscr()
6471   ;
6472   return 0;
6473 }
6474 _ACEOF
6475 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6476 if { (eval echo "$as_me:6476: \"$ac_link\"") >&5
6477   (eval $ac_link) 2>&5
6478   ac_status=$?
6479   echo "$as_me:6479: \$? = $ac_status" >&5
6480   (exit "$ac_status"); } &&
6481          { ac_try='test -s "conftest$ac_exeext"'
6482   { (eval echo "$as_me:6482: \"$ac_try\"") >&5
6483   (eval $ac_try) 2>&5
6484   ac_status=$?
6485   echo "$as_me:6485: \$? = $ac_status" >&5
6486   (exit "$ac_status"); }; }; then
6487   echo "$as_me:6487: result: yes" >&5
6488 echo "${ECHO_T}yes" >&6
6489                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6490                                          break
6491 else
6492   echo "$as_me: failed program was:" >&5
6493 cat "conftest.$ac_ext" >&5
6494 echo "$as_me:6494: result: no" >&5
6495 echo "${ECHO_T}no" >&6
6496                                          LIBS="$cf_save_LIBS"
6497 fi
6498 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6499                         done
6500
6501 fi
6502 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6503
6504 fi
6505
6506 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6507
6508 if test "$cf_found_library" = no ; then
6509         { { echo "$as_me:6509: error: Cannot link $cf_nculib_root library" >&5
6510 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6511    { (exit 1); exit 1; }; }
6512 fi
6513
6514 fi
6515
6516 if test -n "$cf_ncurses_LIBS" ; then
6517         echo "$as_me:6517: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6518 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6519         cf_ncurses_SAVE="$LIBS"
6520         for p in $cf_ncurses_LIBS ; do
6521                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6522                 if test "$q" != "$LIBS" ; then
6523                         LIBS="$q"
6524                 fi
6525         done
6526         cat >"conftest.$ac_ext" <<_ACEOF
6527 #line 6527 "configure"
6528 #include "confdefs.h"
6529 #include <${cf_cv_ncurses_header:-curses.h}>
6530 int
6531 main (void)
6532 {
6533 initscr(); mousemask(0,0); tigetstr((char *)0);
6534   ;
6535   return 0;
6536 }
6537 _ACEOF
6538 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6539 if { (eval echo "$as_me:6539: \"$ac_link\"") >&5
6540   (eval $ac_link) 2>&5
6541   ac_status=$?
6542   echo "$as_me:6542: \$? = $ac_status" >&5
6543   (exit "$ac_status"); } &&
6544          { ac_try='test -s "conftest$ac_exeext"'
6545   { (eval echo "$as_me:6545: \"$ac_try\"") >&5
6546   (eval $ac_try) 2>&5
6547   ac_status=$?
6548   echo "$as_me:6548: \$? = $ac_status" >&5
6549   (exit "$ac_status"); }; }; then
6550   echo "$as_me:6550: result: yes" >&5
6551 echo "${ECHO_T}yes" >&6
6552 else
6553   echo "$as_me: failed program was:" >&5
6554 cat "conftest.$ac_ext" >&5
6555 echo "$as_me:6555: result: no" >&5
6556 echo "${ECHO_T}no" >&6
6557                  LIBS="$cf_ncurses_SAVE"
6558 fi
6559 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6560 fi
6561
6562 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6563
6564 cat >>confdefs.h <<EOF
6565 #define $cf_nculib_ROOT 1
6566 EOF
6567
6568         fi
6569 else
6570         NCURSES_CONFIG=none
6571 fi
6572
6573 echo "$as_me:6573: checking if you want wide-character code" >&5
6574 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6575
6576 # Check whether --enable-widec or --disable-widec was given.
6577 if test "${enable_widec+set}" = set; then
6578   enableval="$enable_widec"
6579   with_widec=$enableval
6580 else
6581   with_widec=no
6582 fi;
6583 echo "$as_me:6583: result: $with_widec" >&5
6584 echo "${ECHO_T}$with_widec" >&6
6585 if test "$with_widec" = yes ; then
6586
6587 for ac_header in wchar.h
6588 do
6589 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6590 echo "$as_me:6590: checking for $ac_header" >&5
6591 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6592 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6593   echo $ECHO_N "(cached) $ECHO_C" >&6
6594 else
6595   cat >"conftest.$ac_ext" <<_ACEOF
6596 #line 6596 "configure"
6597 #include "confdefs.h"
6598 #include <$ac_header>
6599 _ACEOF
6600 if { (eval echo "$as_me:6600: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6601   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6602   ac_status=$?
6603   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6604   rm -f conftest.er1
6605   cat conftest.err >&5
6606   echo "$as_me:6606: \$? = $ac_status" >&5
6607   (exit "$ac_status"); } >/dev/null; then
6608   if test -s conftest.err; then
6609     ac_cpp_err=$ac_c_preproc_warn_flag
6610   else
6611     ac_cpp_err=
6612   fi
6613 else
6614   ac_cpp_err=yes
6615 fi
6616 if test -z "$ac_cpp_err"; then
6617   eval "$as_ac_Header=yes"
6618 else
6619   echo "$as_me: failed program was:" >&5
6620   cat "conftest.$ac_ext" >&5
6621   eval "$as_ac_Header=no"
6622 fi
6623 rm -f conftest.err "conftest.$ac_ext"
6624 fi
6625 echo "$as_me:6625: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6626 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6627 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6628   cat >>confdefs.h <<EOF
6629 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6630 EOF
6631
6632 fi
6633 done
6634
6635 echo "$as_me:6635: checking for multibyte character support" >&5
6636 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6637 if test "${cf_cv_utf8_lib+set}" = set; then
6638   echo $ECHO_N "(cached) $ECHO_C" >&6
6639 else
6640
6641         cf_save_LIBS="$LIBS"
6642         cat >"conftest.$ac_ext" <<_ACEOF
6643 #line 6643 "configure"
6644 #include "confdefs.h"
6645
6646 #include <stdlib.h>
6647 #include <stdio.h>
6648 #ifdef HAVE_WCHAR_H
6649 #include <wchar.h>
6650 #endif
6651
6652 int
6653 main (void)
6654 {
6655 putwc(0,0);
6656   ;
6657   return 0;
6658 }
6659 _ACEOF
6660 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6661 if { (eval echo "$as_me:6661: \"$ac_link\"") >&5
6662   (eval $ac_link) 2>&5
6663   ac_status=$?
6664   echo "$as_me:6664: \$? = $ac_status" >&5
6665   (exit "$ac_status"); } &&
6666          { ac_try='test -s "conftest$ac_exeext"'
6667   { (eval echo "$as_me:6667: \"$ac_try\"") >&5
6668   (eval $ac_try) 2>&5
6669   ac_status=$?
6670   echo "$as_me:6670: \$? = $ac_status" >&5
6671   (exit "$ac_status"); }; }; then
6672   cf_cv_utf8_lib=yes
6673 else
6674   echo "$as_me: failed program was:" >&5
6675 cat "conftest.$ac_ext" >&5
6676
6677 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6678 # will be set on completion of the AC_TRY_LINK below.
6679 cf_cv_header_path_utf8=
6680 cf_cv_library_path_utf8=
6681
6682 echo "${as_me:-configure}:6682: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6683
6684 cf_save_LIBS="$LIBS"
6685
6686 cat >"conftest.$ac_ext" <<_ACEOF
6687 #line 6687 "configure"
6688 #include "confdefs.h"
6689
6690 #include <libutf8.h>
6691 int
6692 main (void)
6693 {
6694 putwc(0,0);
6695   ;
6696   return 0;
6697 }
6698 _ACEOF
6699 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6700 if { (eval echo "$as_me:6700: \"$ac_link\"") >&5
6701   (eval $ac_link) 2>&5
6702   ac_status=$?
6703   echo "$as_me:6703: \$? = $ac_status" >&5
6704   (exit "$ac_status"); } &&
6705          { ac_try='test -s "conftest$ac_exeext"'
6706   { (eval echo "$as_me:6706: \"$ac_try\"") >&5
6707   (eval $ac_try) 2>&5
6708   ac_status=$?
6709   echo "$as_me:6709: \$? = $ac_status" >&5
6710   (exit "$ac_status"); }; }; then
6711
6712         cf_cv_find_linkage_utf8=yes
6713         cf_cv_header_path_utf8=/usr/include
6714         cf_cv_library_path_utf8=/usr/lib
6715
6716 else
6717   echo "$as_me: failed program was:" >&5
6718 cat "conftest.$ac_ext" >&5
6719
6720 LIBS="-lutf8  $cf_save_LIBS"
6721
6722 cat >"conftest.$ac_ext" <<_ACEOF
6723 #line 6723 "configure"
6724 #include "confdefs.h"
6725
6726 #include <libutf8.h>
6727 int
6728 main (void)
6729 {
6730 putwc(0,0);
6731   ;
6732   return 0;
6733 }
6734 _ACEOF
6735 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6736 if { (eval echo "$as_me:6736: \"$ac_link\"") >&5
6737   (eval $ac_link) 2>&5
6738   ac_status=$?
6739   echo "$as_me:6739: \$? = $ac_status" >&5
6740   (exit "$ac_status"); } &&
6741          { ac_try='test -s "conftest$ac_exeext"'
6742   { (eval echo "$as_me:6742: \"$ac_try\"") >&5
6743   (eval $ac_try) 2>&5
6744   ac_status=$?
6745   echo "$as_me:6745: \$? = $ac_status" >&5
6746   (exit "$ac_status"); }; }; then
6747
6748         cf_cv_find_linkage_utf8=yes
6749         cf_cv_header_path_utf8=/usr/include
6750         cf_cv_library_path_utf8=/usr/lib
6751         cf_cv_library_file_utf8="-lutf8"
6752
6753 else
6754   echo "$as_me: failed program was:" >&5
6755 cat "conftest.$ac_ext" >&5
6756
6757         cf_cv_find_linkage_utf8=no
6758         LIBS="$cf_save_LIBS"
6759
6760         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6761
6762 echo "${as_me:-configure}:6762: testing find linkage for utf8 library ..." 1>&5
6763
6764 echo "${as_me:-configure}:6764: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6765
6766         cf_save_CPPFLAGS="$CPPFLAGS"
6767         cf_test_CPPFLAGS="$CPPFLAGS"
6768
6769 cf_search=
6770
6771 # collect the current set of include-directories from compiler flags
6772 cf_header_path_list=""
6773 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6774         for cf_header_path in $CPPFLAGS $CFLAGS
6775         do
6776                 case "$cf_header_path" in
6777                 (-I*)
6778                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6779
6780 test "x$cf_header_path" != "xNONE" && \
6781 test -d "$cf_header_path" && \
6782  {
6783         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6784         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6785         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6786         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6787         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6788         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6789 }
6790
6791                         cf_header_path_list="$cf_header_path_list $cf_search"
6792                         ;;
6793                 esac
6794         done
6795 fi
6796
6797 # add the variations for the package we are looking for
6798
6799 cf_search=
6800
6801 test "x$prefix" != "xNONE" && \
6802 test -d "$prefix" && \
6803  {
6804         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6805         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6806         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6807         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6808         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6809         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6810 }
6811
6812 for cf_subdir_prefix in \
6813         /usr \
6814         /usr/local \
6815         /usr/pkg \
6816         /opt \
6817         /opt/local \
6818         $HOME
6819 do
6820
6821 test "x$cf_subdir_prefix" != "x$prefix" && \
6822 test -d "$cf_subdir_prefix" && \
6823 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6824         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6825         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6826         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6827         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6828         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6829         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6830 }
6831
6832 done
6833
6834 test "$includedir" != NONE && \
6835 test "$includedir" != "/usr/include" && \
6836 test -d "$includedir" && {
6837         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6838         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6839 }
6840
6841 test "$oldincludedir" != NONE && \
6842 test "$oldincludedir" != "/usr/include" && \
6843 test -d "$oldincludedir" && {
6844         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6845         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6846 }
6847
6848 cf_search="$cf_search $cf_header_path_list"
6849
6850         for cf_cv_header_path_utf8 in $cf_search
6851         do
6852                 if test -d "$cf_cv_header_path_utf8" ; then
6853                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6854
6855 echo "${as_me:-configure}:6855: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6856
6857                         CPPFLAGS="$cf_save_CPPFLAGS"
6858
6859         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6860         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6861
6862                         cat >"conftest.$ac_ext" <<_ACEOF
6863 #line 6863 "configure"
6864 #include "confdefs.h"
6865
6866 #include <libutf8.h>
6867 int
6868 main (void)
6869 {
6870 putwc(0,0);
6871   ;
6872   return 0;
6873 }
6874 _ACEOF
6875 rm -f "conftest.$ac_objext"
6876 if { (eval echo "$as_me:6876: \"$ac_compile\"") >&5
6877   (eval $ac_compile) 2>&5
6878   ac_status=$?
6879   echo "$as_me:6879: \$? = $ac_status" >&5
6880   (exit "$ac_status"); } &&
6881          { ac_try='test -s "conftest.$ac_objext"'
6882   { (eval echo "$as_me:6882: \"$ac_try\"") >&5
6883   (eval $ac_try) 2>&5
6884   ac_status=$?
6885   echo "$as_me:6885: \$? = $ac_status" >&5
6886   (exit "$ac_status"); }; }; then
6887
6888                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6889
6890 echo "${as_me:-configure}:6890: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6891
6892                                 cf_cv_find_linkage_utf8=maybe
6893                                 cf_test_CPPFLAGS="$CPPFLAGS"
6894                                 break
6895 else
6896   echo "$as_me: failed program was:" >&5
6897 cat "conftest.$ac_ext" >&5
6898
6899                                 CPPFLAGS="$cf_save_CPPFLAGS"
6900
6901 fi
6902 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6903                 fi
6904         done
6905
6906         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6907
6908 echo "${as_me:-configure}:6908: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6909
6910                 cf_save_LIBS="$LIBS"
6911                 cf_save_LDFLAGS="$LDFLAGS"
6912
6913                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6914
6915 cf_search=
6916 cf_library_path_list=""
6917 if test -n "${LDFLAGS}${LIBS}" ; then
6918         for cf_library_path in $LDFLAGS $LIBS
6919         do
6920                 case "$cf_library_path" in
6921                 (-L*)
6922                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6923
6924 test "x$cf_library_path" != "xNONE" && \
6925 test -d "$cf_library_path" && \
6926  {
6927         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6928         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6929         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6930         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6931         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6932         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6933 }
6934
6935                         cf_library_path_list="$cf_library_path_list $cf_search"
6936                         ;;
6937                 esac
6938         done
6939 fi
6940
6941 cf_search=
6942
6943 test "x$prefix" != "xNONE" && \
6944 test -d "$prefix" && \
6945  {
6946         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6947         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6948         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6949         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6950         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6951         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6952 }
6953
6954 for cf_subdir_prefix in \
6955         /usr \
6956         /usr/local \
6957         /usr/pkg \
6958         /opt \
6959         /opt/local \
6960         $HOME
6961 do
6962
6963 test "x$cf_subdir_prefix" != "x$prefix" && \
6964 test -d "$cf_subdir_prefix" && \
6965 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6966         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6967         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6968         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6969         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6970         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6971         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6972 }
6973
6974 done
6975
6976 cf_search="$cf_library_path_list $cf_search"
6977
6978                         for cf_cv_library_path_utf8 in $cf_search
6979                         do
6980                                 if test -d "$cf_cv_library_path_utf8" ; then
6981                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6982
6983 echo "${as_me:-configure}:6983: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6984
6985                                         CPPFLAGS="$cf_test_CPPFLAGS"
6986                                         LIBS="-lutf8  $cf_save_LIBS"
6987                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6988                                         cat >"conftest.$ac_ext" <<_ACEOF
6989 #line 6989 "configure"
6990 #include "confdefs.h"
6991
6992 #include <libutf8.h>
6993 int
6994 main (void)
6995 {
6996 putwc(0,0);
6997   ;
6998   return 0;
6999 }
7000 _ACEOF
7001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7002 if { (eval echo "$as_me:7002: \"$ac_link\"") >&5
7003   (eval $ac_link) 2>&5
7004   ac_status=$?
7005   echo "$as_me:7005: \$? = $ac_status" >&5
7006   (exit "$ac_status"); } &&
7007          { ac_try='test -s "conftest$ac_exeext"'
7008   { (eval echo "$as_me:7008: \"$ac_try\"") >&5
7009   (eval $ac_try) 2>&5
7010   ac_status=$?
7011   echo "$as_me:7011: \$? = $ac_status" >&5
7012   (exit "$ac_status"); }; }; then
7013
7014                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7015
7016 echo "${as_me:-configure}:7016: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7017
7018                                         cf_cv_find_linkage_utf8=yes
7019                                         cf_cv_library_file_utf8="-lutf8"
7020                                         break
7021 else
7022   echo "$as_me: failed program was:" >&5
7023 cat "conftest.$ac_ext" >&5
7024
7025                                         CPPFLAGS="$cf_save_CPPFLAGS"
7026                                         LIBS="$cf_save_LIBS"
7027                                         LDFLAGS="$cf_save_LDFLAGS"
7028
7029 fi
7030 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7031                                 fi
7032                         done
7033                         CPPFLAGS="$cf_save_CPPFLAGS"
7034                         LDFLAGS="$cf_save_LDFLAGS"
7035                 fi
7036
7037         else
7038                 cf_cv_find_linkage_utf8=no
7039         fi
7040
7041 fi
7042 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7043
7044 fi
7045 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7046
7047 LIBS="$cf_save_LIBS"
7048
7049 if test "$cf_cv_find_linkage_utf8" = yes ; then
7050 cf_cv_utf8_lib=add-on
7051 else
7052 cf_cv_utf8_lib=no
7053 fi
7054
7055 fi
7056 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7057 fi
7058 echo "$as_me:7058: result: $cf_cv_utf8_lib" >&5
7059 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7060
7061 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7062 # ncurses/ncursesw:
7063 if test "$cf_cv_utf8_lib" = "add-on" ; then
7064
7065 cat >>confdefs.h <<\EOF
7066 #define HAVE_LIBUTF8_H 1
7067 EOF
7068
7069 if test -n "$cf_cv_header_path_utf8" ; then
7070   for cf_add_incdir in $cf_cv_header_path_utf8
7071   do
7072         while test "$cf_add_incdir" != /usr/include
7073         do
7074           if test -d "$cf_add_incdir"
7075           then
7076                 cf_have_incdir=no
7077                 if test -n "$CFLAGS$CPPFLAGS" ; then
7078                   # a loop is needed to ensure we can add subdirs of existing dirs
7079                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7080                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7081                           cf_have_incdir=yes; break
7082                         fi
7083                   done
7084                 fi
7085
7086                 if test "$cf_have_incdir" = no ; then
7087                   if test "$cf_add_incdir" = /usr/local/include ; then
7088                         if test "$GCC" = yes
7089                         then
7090                           cf_save_CPPFLAGS=$CPPFLAGS
7091
7092         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7093         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7094
7095                           cat >"conftest.$ac_ext" <<_ACEOF
7096 #line 7096 "configure"
7097 #include "confdefs.h"
7098 #include <stdio.h>
7099 int
7100 main (void)
7101 {
7102 printf("Hello")
7103   ;
7104   return 0;
7105 }
7106 _ACEOF
7107 rm -f "conftest.$ac_objext"
7108 if { (eval echo "$as_me:7108: \"$ac_compile\"") >&5
7109   (eval $ac_compile) 2>&5
7110   ac_status=$?
7111   echo "$as_me:7111: \$? = $ac_status" >&5
7112   (exit "$ac_status"); } &&
7113          { ac_try='test -s "conftest.$ac_objext"'
7114   { (eval echo "$as_me:7114: \"$ac_try\"") >&5
7115   (eval $ac_try) 2>&5
7116   ac_status=$?
7117   echo "$as_me:7117: \$? = $ac_status" >&5
7118   (exit "$ac_status"); }; }; then
7119   :
7120 else
7121   echo "$as_me: failed program was:" >&5
7122 cat "conftest.$ac_ext" >&5
7123 cf_have_incdir=yes
7124 fi
7125 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7126                           CPPFLAGS=$cf_save_CPPFLAGS
7127                         fi
7128                   fi
7129                 fi
7130
7131                 if test "$cf_have_incdir" = no ; then
7132                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7133
7134 echo "${as_me:-configure}:7134: testing adding $cf_add_incdir to include-path ..." 1>&5
7135
7136                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7137
7138                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7139                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7140                   cf_add_incdir="$cf_top_incdir"
7141                 else
7142                   break
7143                 fi
7144           else
7145                 break
7146           fi
7147         done
7148   done
7149 fi
7150
7151 if test -n "$cf_cv_library_path_utf8" ; then
7152         for cf_add_libdir in $cf_cv_library_path_utf8
7153         do
7154                 if test "$cf_add_libdir" = /usr/lib ; then
7155                         :
7156                 elif test -d "$cf_add_libdir"
7157                 then
7158                         cf_have_libdir=no
7159                         if test -n "$LDFLAGS$LIBS" ; then
7160                                 # a loop is needed to ensure we can add subdirs of existing dirs
7161                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7162                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7163                                                 cf_have_libdir=yes; break
7164                                         fi
7165                                 done
7166                         fi
7167                         if test "$cf_have_libdir" = no ; then
7168                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7169
7170 echo "${as_me:-configure}:7170: testing adding $cf_add_libdir to library-path ..." 1>&5
7171
7172                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7173                         fi
7174                 fi
7175         done
7176 fi
7177
7178 cf_add_libs="$LIBS"
7179 # reverse order
7180 cf_add_0lib=
7181 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7182 # filter duplicates
7183 for cf_add_1lib in $cf_add_0lib; do
7184         for cf_add_2lib in $cf_add_libs; do
7185                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7186                         cf_add_1lib=
7187                         break
7188                 fi
7189         done
7190         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7191 done
7192 LIBS="$cf_add_libs"
7193
7194 fi
7195
7196 cf_ncuconfig_root=ncursesw
7197 cf_have_ncuconfig=no
7198
7199 if test "x${PKG_CONFIG:=none}" != xnone; then
7200         echo "$as_me:7200: checking pkg-config for $cf_ncuconfig_root" >&5
7201 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7202         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7203                 echo "$as_me:7203: result: yes" >&5
7204 echo "${ECHO_T}yes" >&6
7205
7206                 echo "$as_me:7206: checking if the $cf_ncuconfig_root package files work" >&5
7207 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7208                 cf_have_ncuconfig=unknown
7209
7210                 cf_save_CFLAGS="$CFLAGS"
7211                 cf_save_CPPFLAGS="$CPPFLAGS"
7212                 cf_save_LIBS="$LIBS"
7213
7214                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7215                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7216
7217                 # while -W for passing linker flags is prevalent, it is not "standard".
7218                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7219                 # incompatible _and_ non-standard -W option which gives an error.  Work
7220                 # around that pitfall.
7221                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7222                 (x*c[89]9@@*-W*)
7223
7224 cf_fix_cppflags=no
7225 cf_new_cflags=
7226 cf_new_cppflags=
7227 cf_new_extra_cppflags=
7228
7229 for cf_add_cflags in $cf_pkg_cflags
7230 do
7231 case "$cf_fix_cppflags" in
7232 (no)
7233         case "$cf_add_cflags" in
7234         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7235                 case "$cf_add_cflags" in
7236                 (-D*)
7237                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7238
7239                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7240                                 && test -z "${cf_tst_cflags}" \
7241                                 && cf_fix_cppflags=yes
7242
7243                         if test "$cf_fix_cppflags" = yes ; then
7244
7245         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7246         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7247
7248                                 continue
7249                         elif test "${cf_tst_cflags}" = "\"'" ; then
7250
7251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7253
7254                                 continue
7255                         fi
7256                         ;;
7257                 esac
7258                 case "$CPPFLAGS" in
7259                 (*$cf_add_cflags)
7260                         ;;
7261                 (*)
7262                         case "$cf_add_cflags" in
7263                         (-D*)
7264                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7265
7266 CPPFLAGS=`echo "$CPPFLAGS" | \
7267         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7268                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7269
7270                                 ;;
7271                         esac
7272
7273         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7274         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7275
7276                         ;;
7277                 esac
7278                 ;;
7279         (*)
7280
7281         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7282         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7283
7284                 ;;
7285         esac
7286         ;;
7287 (yes)
7288
7289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7291
7292         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7293
7294         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7295                 && test -z "${cf_tst_cflags}" \
7296                 && cf_fix_cppflags=no
7297         ;;
7298 esac
7299 done
7300
7301 if test -n "$cf_new_cflags" ; then
7302
7303         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7304         CFLAGS="${CFLAGS}$cf_new_cflags"
7305
7306 fi
7307
7308 if test -n "$cf_new_cppflags" ; then
7309
7310         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7311         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7312
7313 fi
7314
7315 if test -n "$cf_new_extra_cppflags" ; then
7316
7317         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7318         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7319
7320 fi
7321
7322 cf_add_libs="$LIBS"
7323 # reverse order
7324 cf_add_0lib=
7325 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7326 # filter duplicates
7327 for cf_add_1lib in $cf_add_0lib; do
7328         for cf_add_2lib in $cf_add_libs; do
7329                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7330                         cf_add_1lib=
7331                         break
7332                 fi
7333         done
7334         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7335 done
7336 LIBS="$cf_add_libs"
7337
7338                         cat >"conftest.$ac_ext" <<_ACEOF
7339 #line 7339 "configure"
7340 #include "confdefs.h"
7341 #include <${cf_cv_ncurses_header:-curses.h}>
7342 int
7343 main (void)
7344 {
7345 initscr(); mousemask(0,0); tigetstr((char *)0);
7346   ;
7347   return 0;
7348 }
7349 _ACEOF
7350 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7351 if { (eval echo "$as_me:7351: \"$ac_link\"") >&5
7352   (eval $ac_link) 2>&5
7353   ac_status=$?
7354   echo "$as_me:7354: \$? = $ac_status" >&5
7355   (exit "$ac_status"); } &&
7356          { ac_try='test -s "conftest$ac_exeext"'
7357   { (eval echo "$as_me:7357: \"$ac_try\"") >&5
7358   (eval $ac_try) 2>&5
7359   ac_status=$?
7360   echo "$as_me:7360: \$? = $ac_status" >&5
7361   (exit "$ac_status"); }; }; then
7362   if test "$cross_compiling" = yes; then
7363   cf_test_ncuconfig=maybe
7364 else
7365   cat >"conftest.$ac_ext" <<_ACEOF
7366 #line 7366 "configure"
7367 #include "confdefs.h"
7368 #include <${cf_cv_ncurses_header:-curses.h}>
7369                                         int main(void)
7370                                         { const char *xx = curses_version(); return (xx == 0); }
7371 _ACEOF
7372 rm -f "conftest$ac_exeext"
7373 if { (eval echo "$as_me:7373: \"$ac_link\"") >&5
7374   (eval $ac_link) 2>&5
7375   ac_status=$?
7376   echo "$as_me:7376: \$? = $ac_status" >&5
7377   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7378   { (eval echo "$as_me:7378: \"$ac_try\"") >&5
7379   (eval $ac_try) 2>&5
7380   ac_status=$?
7381   echo "$as_me:7381: \$? = $ac_status" >&5
7382   (exit "$ac_status"); }; }; then
7383   cf_test_ncuconfig=yes
7384 else
7385   echo "$as_me: program exited with status $ac_status" >&5
7386 echo "$as_me: failed program was:" >&5
7387 cat "conftest.$ac_ext" >&5
7388 cf_test_ncuconfig=no
7389 fi
7390 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7391 fi
7392 else
7393   echo "$as_me: failed program was:" >&5
7394 cat "conftest.$ac_ext" >&5
7395 cf_test_ncuconfig=no
7396 fi
7397 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7398
7399                         CFLAGS="$cf_save_CFLAGS"
7400                         CPPFLAGS="$cf_save_CPPFLAGS"
7401                         LIBS="$cf_save_LIBS"
7402
7403                         if test "x$cf_test_ncuconfig" != xyes; then
7404                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7405                                 cf_pkg_cflags="$cf_temp"
7406                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7407                                 cf_pkg_libs="$cf_temp"
7408                         fi
7409                         ;;
7410                 esac
7411
7412 for cf_add_cflags in $cf_pkg_cflags
7413 do
7414         case "x$cf_add_cflags" in
7415         (x-[DU]*)
7416
7417 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7418 while true
7419 do
7420         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'`
7421         test "$CFLAGS" != "$cf_old_cflag" || break
7422
7423         CFLAGS="$cf_old_cflag"
7424 done
7425
7426 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7427 while true
7428 do
7429         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'`
7430         test "$CPPFLAGS" != "$cf_old_cflag" || break
7431
7432         CPPFLAGS="$cf_old_cflag"
7433 done
7434
7435                 ;;
7436         esac
7437
7438 cf_fix_cppflags=no
7439 cf_new_cflags=
7440 cf_new_cppflags=
7441 cf_new_extra_cppflags=
7442
7443 for cf_add_cflags in $cf_add_cflags
7444 do
7445 case "$cf_fix_cppflags" in
7446 (no)
7447         case "$cf_add_cflags" in
7448         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7449                 case "$cf_add_cflags" in
7450                 (-D*)
7451                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7452
7453                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7454                                 && test -z "${cf_tst_cflags}" \
7455                                 && cf_fix_cppflags=yes
7456
7457                         if test "$cf_fix_cppflags" = yes ; then
7458
7459         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7460         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7461
7462                                 continue
7463                         elif test "${cf_tst_cflags}" = "\"'" ; then
7464
7465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7467
7468                                 continue
7469                         fi
7470                         ;;
7471                 esac
7472                 case "$CPPFLAGS" in
7473                 (*$cf_add_cflags)
7474                         ;;
7475                 (*)
7476                         case "$cf_add_cflags" in
7477                         (-D*)
7478                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7479
7480 CPPFLAGS=`echo "$CPPFLAGS" | \
7481         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7482                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7483
7484                                 ;;
7485                         esac
7486
7487         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7488         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7489
7490                         ;;
7491                 esac
7492                 ;;
7493         (*)
7494
7495         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7496         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7497
7498                 ;;
7499         esac
7500         ;;
7501 (yes)
7502
7503         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7504         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7505
7506         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7507
7508         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7509                 && test -z "${cf_tst_cflags}" \
7510                 && cf_fix_cppflags=no
7511         ;;
7512 esac
7513 done
7514
7515 if test -n "$cf_new_cflags" ; then
7516
7517         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7518         CFLAGS="${CFLAGS}$cf_new_cflags"
7519
7520 fi
7521
7522 if test -n "$cf_new_cppflags" ; then
7523
7524         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7525         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7526
7527 fi
7528
7529 if test -n "$cf_new_extra_cppflags" ; then
7530
7531         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7532         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7533
7534 fi
7535
7536 done
7537
7538 cf_add_libs="$LIBS"
7539 # reverse order
7540 cf_add_0lib=
7541 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7542 # filter duplicates
7543 for cf_add_1lib in $cf_add_0lib; do
7544         for cf_add_2lib in $cf_add_libs; do
7545                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7546                         cf_add_1lib=
7547                         break
7548                 fi
7549         done
7550         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7551 done
7552 LIBS="$cf_add_libs"
7553
7554                 cat >"conftest.$ac_ext" <<_ACEOF
7555 #line 7555 "configure"
7556 #include "confdefs.h"
7557 #include <${cf_cv_ncurses_header:-curses.h}>
7558 int
7559 main (void)
7560 {
7561 initscr(); mousemask(0,0); tigetstr((char *)0);
7562   ;
7563   return 0;
7564 }
7565 _ACEOF
7566 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7567 if { (eval echo "$as_me:7567: \"$ac_link\"") >&5
7568   (eval $ac_link) 2>&5
7569   ac_status=$?
7570   echo "$as_me:7570: \$? = $ac_status" >&5
7571   (exit "$ac_status"); } &&
7572          { ac_try='test -s "conftest$ac_exeext"'
7573   { (eval echo "$as_me:7573: \"$ac_try\"") >&5
7574   (eval $ac_try) 2>&5
7575   ac_status=$?
7576   echo "$as_me:7576: \$? = $ac_status" >&5
7577   (exit "$ac_status"); }; }; then
7578   if test "$cross_compiling" = yes; then
7579   cf_have_ncuconfig=maybe
7580 else
7581   cat >"conftest.$ac_ext" <<_ACEOF
7582 #line 7582 "configure"
7583 #include "confdefs.h"
7584 #include <${cf_cv_ncurses_header:-curses.h}>
7585                                 int main(void)
7586                                 { const char *xx = curses_version(); return (xx == 0); }
7587 _ACEOF
7588 rm -f "conftest$ac_exeext"
7589 if { (eval echo "$as_me:7589: \"$ac_link\"") >&5
7590   (eval $ac_link) 2>&5
7591   ac_status=$?
7592   echo "$as_me:7592: \$? = $ac_status" >&5
7593   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7594   { (eval echo "$as_me:7594: \"$ac_try\"") >&5
7595   (eval $ac_try) 2>&5
7596   ac_status=$?
7597   echo "$as_me:7597: \$? = $ac_status" >&5
7598   (exit "$ac_status"); }; }; then
7599   cf_have_ncuconfig=yes
7600 else
7601   echo "$as_me: program exited with status $ac_status" >&5
7602 echo "$as_me: failed program was:" >&5
7603 cat "conftest.$ac_ext" >&5
7604 cf_have_ncuconfig=no
7605 fi
7606 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7607 fi
7608 else
7609   echo "$as_me: failed program was:" >&5
7610 cat "conftest.$ac_ext" >&5
7611 cf_have_ncuconfig=no
7612 fi
7613 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7614                 echo "$as_me:7614: result: $cf_have_ncuconfig" >&5
7615 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7616                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7617                 if test "$cf_have_ncuconfig" != "yes"
7618                 then
7619                         CPPFLAGS="$cf_save_CPPFLAGS"
7620                         LIBS="$cf_save_LIBS"
7621                         NCURSES_CONFIG_PKG=none
7622                 else
7623
7624 cat >>confdefs.h <<\EOF
7625 #define NCURSES 1
7626 EOF
7627
7628                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7629
7630 echo "$as_me:7630: checking for terminfo header" >&5
7631 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7632 if test "${cf_cv_term_header+set}" = set; then
7633   echo $ECHO_N "(cached) $ECHO_C" >&6
7634 else
7635
7636 case "${cf_cv_ncurses_header}" in
7637 (*/ncurses.h|*/ncursesw.h)
7638         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7639         ;;
7640 (*)
7641         cf_term_header=term.h
7642         ;;
7643 esac
7644
7645 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7646 do
7647 cat >"conftest.$ac_ext" <<_ACEOF
7648 #line 7648 "configure"
7649 #include "confdefs.h"
7650 #include <stdio.h>
7651 #include <${cf_cv_ncurses_header:-curses.h}>
7652 #include <$cf_test>
7653
7654 int
7655 main (void)
7656 {
7657 int x = auto_left_margin; (void)x
7658   ;
7659   return 0;
7660 }
7661 _ACEOF
7662 rm -f "conftest.$ac_objext"
7663 if { (eval echo "$as_me:7663: \"$ac_compile\"") >&5
7664   (eval $ac_compile) 2>&5
7665   ac_status=$?
7666   echo "$as_me:7666: \$? = $ac_status" >&5
7667   (exit "$ac_status"); } &&
7668          { ac_try='test -s "conftest.$ac_objext"'
7669   { (eval echo "$as_me:7669: \"$ac_try\"") >&5
7670   (eval $ac_try) 2>&5
7671   ac_status=$?
7672   echo "$as_me:7672: \$? = $ac_status" >&5
7673   (exit "$ac_status"); }; }; then
7674
7675         cf_cv_term_header="$cf_test"
7676 else
7677   echo "$as_me: failed program was:" >&5
7678 cat "conftest.$ac_ext" >&5
7679
7680         cf_cv_term_header=unknown
7681
7682 fi
7683 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7684         test "$cf_cv_term_header" != unknown && break
7685 done
7686
7687 fi
7688 echo "$as_me:7688: result: $cf_cv_term_header" >&5
7689 echo "${ECHO_T}$cf_cv_term_header" >&6
7690
7691 # Set definitions to allow ifdef'ing to accommodate subdirectories
7692
7693 case "$cf_cv_term_header" in
7694 (*term.h)
7695
7696 cat >>confdefs.h <<\EOF
7697 #define HAVE_TERM_H 1
7698 EOF
7699
7700         ;;
7701 esac
7702
7703 case "$cf_cv_term_header" in
7704 (ncurses/term.h)
7705
7706 cat >>confdefs.h <<\EOF
7707 #define HAVE_NCURSES_TERM_H 1
7708 EOF
7709
7710         ;;
7711 (ncursesw/term.h)
7712
7713 cat >>confdefs.h <<\EOF
7714 #define HAVE_NCURSESW_TERM_H 1
7715 EOF
7716
7717         ;;
7718 esac
7719
7720                 fi
7721
7722         else
7723                 echo "$as_me:7723: result: no" >&5
7724 echo "${ECHO_T}no" >&6
7725                 NCURSES_CONFIG_PKG=none
7726         fi
7727 else
7728         NCURSES_CONFIG_PKG=none
7729 fi
7730
7731 if test "x$cf_have_ncuconfig" = "xno"; then
7732         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7733
7734 if test -n "$ac_tool_prefix"; then
7735   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7736   do
7737     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7738 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7739 echo "$as_me:7739: checking for $ac_word" >&5
7740 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7741 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7742   echo $ECHO_N "(cached) $ECHO_C" >&6
7743 else
7744   if test -n "$NCURSES_CONFIG"; then
7745   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7746 else
7747   ac_save_IFS=$IFS; IFS=$ac_path_separator
7748 ac_dummy="$PATH"
7749 for ac_dir in $ac_dummy; do
7750   IFS=$ac_save_IFS
7751   test -z "$ac_dir" && ac_dir=.
7752   $as_executable_p "$ac_dir/$ac_word" || continue
7753 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7754 echo "$as_me:7754: found $ac_dir/$ac_word" >&5
7755 break
7756 done
7757
7758 fi
7759 fi
7760 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7761 if test -n "$NCURSES_CONFIG"; then
7762   echo "$as_me:7762: result: $NCURSES_CONFIG" >&5
7763 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7764 else
7765   echo "$as_me:7765: result: no" >&5
7766 echo "${ECHO_T}no" >&6
7767 fi
7768
7769     test -n "$NCURSES_CONFIG" && break
7770   done
7771 fi
7772 if test -z "$NCURSES_CONFIG"; then
7773   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7774   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7775 do
7776   # Extract the first word of "$ac_prog", so it can be a program name with args.
7777 set dummy $ac_prog; ac_word=$2
7778 echo "$as_me:7778: checking for $ac_word" >&5
7779 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7780 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7781   echo $ECHO_N "(cached) $ECHO_C" >&6
7782 else
7783   if test -n "$ac_ct_NCURSES_CONFIG"; then
7784   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7785 else
7786   ac_save_IFS=$IFS; IFS=$ac_path_separator
7787 ac_dummy="$PATH"
7788 for ac_dir in $ac_dummy; do
7789   IFS=$ac_save_IFS
7790   test -z "$ac_dir" && ac_dir=.
7791   $as_executable_p "$ac_dir/$ac_word" || continue
7792 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7793 echo "$as_me:7793: found $ac_dir/$ac_word" >&5
7794 break
7795 done
7796
7797 fi
7798 fi
7799 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7800 if test -n "$ac_ct_NCURSES_CONFIG"; then
7801   echo "$as_me:7801: result: $ac_ct_NCURSES_CONFIG" >&5
7802 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7803 else
7804   echo "$as_me:7804: result: no" >&5
7805 echo "${ECHO_T}no" >&6
7806 fi
7807
7808   test -n "$ac_ct_NCURSES_CONFIG" && break
7809 done
7810 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7811
7812   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7813 fi
7814
7815         if test "$NCURSES_CONFIG" != none ; then
7816
7817 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7818 do
7819         case "x$cf_add_cflags" in
7820         (x-[DU]*)
7821
7822 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7823 while true
7824 do
7825         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'`
7826         test "$CFLAGS" != "$cf_old_cflag" || break
7827
7828         CFLAGS="$cf_old_cflag"
7829 done
7830
7831 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7832 while true
7833 do
7834         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'`
7835         test "$CPPFLAGS" != "$cf_old_cflag" || break
7836
7837         CPPFLAGS="$cf_old_cflag"
7838 done
7839
7840                 ;;
7841         esac
7842
7843 cf_fix_cppflags=no
7844 cf_new_cflags=
7845 cf_new_cppflags=
7846 cf_new_extra_cppflags=
7847
7848 for cf_add_cflags in $cf_add_cflags
7849 do
7850 case "$cf_fix_cppflags" in
7851 (no)
7852         case "$cf_add_cflags" in
7853         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7854                 case "$cf_add_cflags" in
7855                 (-D*)
7856                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7857
7858                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7859                                 && test -z "${cf_tst_cflags}" \
7860                                 && cf_fix_cppflags=yes
7861
7862                         if test "$cf_fix_cppflags" = yes ; then
7863
7864         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7865         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7866
7867                                 continue
7868                         elif test "${cf_tst_cflags}" = "\"'" ; then
7869
7870         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7871         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7872
7873                                 continue
7874                         fi
7875                         ;;
7876                 esac
7877                 case "$CPPFLAGS" in
7878                 (*$cf_add_cflags)
7879                         ;;
7880                 (*)
7881                         case "$cf_add_cflags" in
7882                         (-D*)
7883                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7884
7885 CPPFLAGS=`echo "$CPPFLAGS" | \
7886         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7887                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7888
7889                                 ;;
7890                         esac
7891
7892         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7893         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7894
7895                         ;;
7896                 esac
7897                 ;;
7898         (*)
7899
7900         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7901         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7902
7903                 ;;
7904         esac
7905         ;;
7906 (yes)
7907
7908         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7909         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7910
7911         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7912
7913         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7914                 && test -z "${cf_tst_cflags}" \
7915                 && cf_fix_cppflags=no
7916         ;;
7917 esac
7918 done
7919
7920 if test -n "$cf_new_cflags" ; then
7921
7922         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7923         CFLAGS="${CFLAGS}$cf_new_cflags"
7924
7925 fi
7926
7927 if test -n "$cf_new_cppflags" ; then
7928
7929         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7930         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7931
7932 fi
7933
7934 if test -n "$cf_new_extra_cppflags" ; then
7935
7936         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7937         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7938
7939 fi
7940
7941 done
7942
7943 cf_add_libs="$LIBS"
7944 # reverse order
7945 cf_add_0lib=
7946 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7947 # filter duplicates
7948 for cf_add_1lib in $cf_add_0lib; do
7949         for cf_add_2lib in $cf_add_libs; do
7950                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7951                         cf_add_1lib=
7952                         break
7953                 fi
7954         done
7955         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7956 done
7957 LIBS="$cf_add_libs"
7958
7959                 # even with config script, some packages use no-override for curses.h
7960
7961 echo "$as_me:7961: checking if we have identified curses headers" >&5
7962 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7963 if test "${cf_cv_ncurses_header+set}" = set; then
7964   echo $ECHO_N "(cached) $ECHO_C" >&6
7965 else
7966
7967 cf_cv_ncurses_header=none
7968 for cf_header in \
7969         ncurses.h ncursesw/ncurses.h \
7970         curses.h ncursesw/curses.h
7971 do
7972 cat >"conftest.$ac_ext" <<_ACEOF
7973 #line 7973 "configure"
7974 #include "confdefs.h"
7975 #include <${cf_header}>
7976 int
7977 main (void)
7978 {
7979 initscr(); tgoto("?", 0,0)
7980   ;
7981   return 0;
7982 }
7983 _ACEOF
7984 rm -f "conftest.$ac_objext"
7985 if { (eval echo "$as_me:7985: \"$ac_compile\"") >&5
7986   (eval $ac_compile) 2>&5
7987   ac_status=$?
7988   echo "$as_me:7988: \$? = $ac_status" >&5
7989   (exit "$ac_status"); } &&
7990          { ac_try='test -s "conftest.$ac_objext"'
7991   { (eval echo "$as_me:7991: \"$ac_try\"") >&5
7992   (eval $ac_try) 2>&5
7993   ac_status=$?
7994   echo "$as_me:7994: \$? = $ac_status" >&5
7995   (exit "$ac_status"); }; }; then
7996   cf_cv_ncurses_header=$cf_header; break
7997 else
7998   echo "$as_me: failed program was:" >&5
7999 cat "conftest.$ac_ext" >&5
8000 fi
8001 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8002 done
8003
8004 fi
8005 echo "$as_me:8005: result: $cf_cv_ncurses_header" >&5
8006 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8007
8008 if test "$cf_cv_ncurses_header" = none ; then
8009         { { echo "$as_me:8009: error: No curses header-files found" >&5
8010 echo "$as_me: error: No curses header-files found" >&2;}
8011    { (exit 1); exit 1; }; }
8012 fi
8013
8014 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8015
8016 for ac_header in $cf_cv_ncurses_header
8017 do
8018 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8019 echo "$as_me:8019: checking for $ac_header" >&5
8020 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8021 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8022   echo $ECHO_N "(cached) $ECHO_C" >&6
8023 else
8024   cat >"conftest.$ac_ext" <<_ACEOF
8025 #line 8025 "configure"
8026 #include "confdefs.h"
8027 #include <$ac_header>
8028 _ACEOF
8029 if { (eval echo "$as_me:8029: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8030   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8031   ac_status=$?
8032   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8033   rm -f conftest.er1
8034   cat conftest.err >&5
8035   echo "$as_me:8035: \$? = $ac_status" >&5
8036   (exit "$ac_status"); } >/dev/null; then
8037   if test -s conftest.err; then
8038     ac_cpp_err=$ac_c_preproc_warn_flag
8039   else
8040     ac_cpp_err=
8041   fi
8042 else
8043   ac_cpp_err=yes
8044 fi
8045 if test -z "$ac_cpp_err"; then
8046   eval "$as_ac_Header=yes"
8047 else
8048   echo "$as_me: failed program was:" >&5
8049   cat "conftest.$ac_ext" >&5
8050   eval "$as_ac_Header=no"
8051 fi
8052 rm -f conftest.err "conftest.$ac_ext"
8053 fi
8054 echo "$as_me:8054: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8055 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8056 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8057   cat >>confdefs.h <<EOF
8058 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8059 EOF
8060
8061 fi
8062 done
8063
8064 cat >>confdefs.h <<\EOF
8065 #define NCURSES 1
8066 EOF
8067
8068 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8069
8070                 cat >>confdefs.h <<EOF
8071 #define $cf_nculib_ROOT 1
8072 EOF
8073
8074                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8075
8076         else
8077
8078 cf_ncuhdr_root=ncursesw
8079
8080 test -n "$cf_cv_curses_dir" && \
8081 test "$cf_cv_curses_dir" != "no" && { \
8082
8083 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8084   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8085   do
8086         while test "$cf_add_incdir" != /usr/include
8087         do
8088           if test -d "$cf_add_incdir"
8089           then
8090                 cf_have_incdir=no
8091                 if test -n "$CFLAGS$CPPFLAGS" ; then
8092                   # a loop is needed to ensure we can add subdirs of existing dirs
8093                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8094                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8095                           cf_have_incdir=yes; break
8096                         fi
8097                   done
8098                 fi
8099
8100                 if test "$cf_have_incdir" = no ; then
8101                   if test "$cf_add_incdir" = /usr/local/include ; then
8102                         if test "$GCC" = yes
8103                         then
8104                           cf_save_CPPFLAGS=$CPPFLAGS
8105
8106         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8107         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8108
8109                           cat >"conftest.$ac_ext" <<_ACEOF
8110 #line 8110 "configure"
8111 #include "confdefs.h"
8112 #include <stdio.h>
8113 int
8114 main (void)
8115 {
8116 printf("Hello")
8117   ;
8118   return 0;
8119 }
8120 _ACEOF
8121 rm -f "conftest.$ac_objext"
8122 if { (eval echo "$as_me:8122: \"$ac_compile\"") >&5
8123   (eval $ac_compile) 2>&5
8124   ac_status=$?
8125   echo "$as_me:8125: \$? = $ac_status" >&5
8126   (exit "$ac_status"); } &&
8127          { ac_try='test -s "conftest.$ac_objext"'
8128   { (eval echo "$as_me:8128: \"$ac_try\"") >&5
8129   (eval $ac_try) 2>&5
8130   ac_status=$?
8131   echo "$as_me:8131: \$? = $ac_status" >&5
8132   (exit "$ac_status"); }; }; then
8133   :
8134 else
8135   echo "$as_me: failed program was:" >&5
8136 cat "conftest.$ac_ext" >&5
8137 cf_have_incdir=yes
8138 fi
8139 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8140                           CPPFLAGS=$cf_save_CPPFLAGS
8141                         fi
8142                   fi
8143                 fi
8144
8145                 if test "$cf_have_incdir" = no ; then
8146                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8147
8148 echo "${as_me:-configure}:8148: testing adding $cf_add_incdir to include-path ..." 1>&5
8149
8150                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8151
8152                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8153                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8154                   cf_add_incdir="$cf_top_incdir"
8155                 else
8156                   break
8157                 fi
8158           else
8159                 break
8160           fi
8161         done
8162   done
8163 fi
8164
8165 }
8166
8167 echo "$as_me:8167: checking for $cf_ncuhdr_root header in include-path" >&5
8168 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8169 if test "${cf_cv_ncurses_h+set}" = set; then
8170   echo $ECHO_N "(cached) $ECHO_C" >&6
8171 else
8172
8173         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8174         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8175         for cf_header in $cf_header_list
8176         do
8177
8178         cat >"conftest.$ac_ext" <<_ACEOF
8179 #line 8179 "configure"
8180 #include "confdefs.h"
8181
8182 #define _XOPEN_SOURCE_EXTENDED
8183 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8184 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8185
8186 #include <$cf_header>
8187 int
8188 main (void)
8189 {
8190
8191 #ifdef NCURSES_VERSION
8192
8193 #ifndef WACS_BSSB
8194         make an error
8195 #endif
8196
8197 printf("%s\\n", NCURSES_VERSION);
8198 #else
8199 #ifdef __NCURSES_H
8200 printf("old\\n");
8201 #else
8202         make an error
8203 #endif
8204 #endif
8205
8206   ;
8207   return 0;
8208 }
8209 _ACEOF
8210 rm -f "conftest.$ac_objext"
8211 if { (eval echo "$as_me:8211: \"$ac_compile\"") >&5
8212   (eval $ac_compile) 2>&5
8213   ac_status=$?
8214   echo "$as_me:8214: \$? = $ac_status" >&5
8215   (exit "$ac_status"); } &&
8216          { ac_try='test -s "conftest.$ac_objext"'
8217   { (eval echo "$as_me:8217: \"$ac_try\"") >&5
8218   (eval $ac_try) 2>&5
8219   ac_status=$?
8220   echo "$as_me:8220: \$? = $ac_status" >&5
8221   (exit "$ac_status"); }; }; then
8222   cf_cv_ncurses_h=$cf_header
8223
8224 else
8225   echo "$as_me: failed program was:" >&5
8226 cat "conftest.$ac_ext" >&5
8227 cf_cv_ncurses_h=no
8228 fi
8229 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8230
8231                 test "$cf_cv_ncurses_h" != no && break
8232         done
8233
8234 fi
8235 echo "$as_me:8235: result: $cf_cv_ncurses_h" >&5
8236 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8237
8238 if test "$cf_cv_ncurses_h" != no ; then
8239         cf_cv_ncurses_header=$cf_cv_ncurses_h
8240 else
8241
8242 echo "$as_me:8242: checking for $cf_ncuhdr_root include-path" >&5
8243 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8244 if test "${cf_cv_ncurses_h2+set}" = set; then
8245   echo $ECHO_N "(cached) $ECHO_C" >&6
8246 else
8247
8248         test -n "$verbose" && echo
8249
8250 cf_search=
8251
8252 # collect the current set of include-directories from compiler flags
8253 cf_header_path_list=""
8254 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8255         for cf_header_path in $CPPFLAGS $CFLAGS
8256         do
8257                 case "$cf_header_path" in
8258                 (-I*)
8259                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8260
8261 test "x$cf_header_path" != "xNONE" && \
8262 test -d "$cf_header_path" && \
8263  {
8264         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8265         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8266         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8267         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8268         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8269         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"
8270 }
8271
8272                         cf_header_path_list="$cf_header_path_list $cf_search"
8273                         ;;
8274                 esac
8275         done
8276 fi
8277
8278 # add the variations for the package we are looking for
8279
8280 cf_search=
8281
8282 test "x$prefix" != "xNONE" && \
8283 test -d "$prefix" && \
8284  {
8285         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8286         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8287         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8288         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8289         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8290         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8291 }
8292
8293 for cf_subdir_prefix in \
8294         /usr \
8295         /usr/local \
8296         /usr/pkg \
8297         /opt \
8298         /opt/local \
8299         $HOME
8300 do
8301
8302 test "x$cf_subdir_prefix" != "x$prefix" && \
8303 test -d "$cf_subdir_prefix" && \
8304 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8305         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8306         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8307         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8308         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8309         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8310         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"
8311 }
8312
8313 done
8314
8315 test "$includedir" != NONE && \
8316 test "$includedir" != "/usr/include" && \
8317 test -d "$includedir" && {
8318         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8319         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8320 }
8321
8322 test "$oldincludedir" != NONE && \
8323 test "$oldincludedir" != "/usr/include" && \
8324 test -d "$oldincludedir" && {
8325         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8326         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8327 }
8328
8329 cf_search="$cf_search $cf_header_path_list"
8330
8331         test -n "$verbose" && echo "search path $cf_search"
8332         cf_save2_CPPFLAGS="$CPPFLAGS"
8333         for cf_incdir in $cf_search
8334         do
8335
8336 if test -n "$cf_incdir" ; then
8337   for cf_add_incdir in $cf_incdir
8338   do
8339         while test "$cf_add_incdir" != /usr/include
8340         do
8341           if test -d "$cf_add_incdir"
8342           then
8343                 cf_have_incdir=no
8344                 if test -n "$CFLAGS$CPPFLAGS" ; then
8345                   # a loop is needed to ensure we can add subdirs of existing dirs
8346                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8347                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8348                           cf_have_incdir=yes; break
8349                         fi
8350                   done
8351                 fi
8352
8353                 if test "$cf_have_incdir" = no ; then
8354                   if test "$cf_add_incdir" = /usr/local/include ; then
8355                         if test "$GCC" = yes
8356                         then
8357                           cf_save_CPPFLAGS=$CPPFLAGS
8358
8359         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8360         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8361
8362                           cat >"conftest.$ac_ext" <<_ACEOF
8363 #line 8363 "configure"
8364 #include "confdefs.h"
8365 #include <stdio.h>
8366 int
8367 main (void)
8368 {
8369 printf("Hello")
8370   ;
8371   return 0;
8372 }
8373 _ACEOF
8374 rm -f "conftest.$ac_objext"
8375 if { (eval echo "$as_me:8375: \"$ac_compile\"") >&5
8376   (eval $ac_compile) 2>&5
8377   ac_status=$?
8378   echo "$as_me:8378: \$? = $ac_status" >&5
8379   (exit "$ac_status"); } &&
8380          { ac_try='test -s "conftest.$ac_objext"'
8381   { (eval echo "$as_me:8381: \"$ac_try\"") >&5
8382   (eval $ac_try) 2>&5
8383   ac_status=$?
8384   echo "$as_me:8384: \$? = $ac_status" >&5
8385   (exit "$ac_status"); }; }; then
8386   :
8387 else
8388   echo "$as_me: failed program was:" >&5
8389 cat "conftest.$ac_ext" >&5
8390 cf_have_incdir=yes
8391 fi
8392 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8393                           CPPFLAGS=$cf_save_CPPFLAGS
8394                         fi
8395                   fi
8396                 fi
8397
8398                 if test "$cf_have_incdir" = no ; then
8399                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8400
8401 echo "${as_me:-configure}:8401: testing adding $cf_add_incdir to include-path ..." 1>&5
8402
8403                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8404
8405                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8406                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8407                   cf_add_incdir="$cf_top_incdir"
8408                 else
8409                   break
8410                 fi
8411           else
8412                 break
8413           fi
8414         done
8415   done
8416 fi
8417
8418                 for cf_header in \
8419                         ncurses.h \
8420                         curses.h
8421                 do
8422
8423         cat >"conftest.$ac_ext" <<_ACEOF
8424 #line 8424 "configure"
8425 #include "confdefs.h"
8426
8427 #include <$cf_header>
8428 int
8429 main (void)
8430 {
8431
8432 #ifdef NCURSES_VERSION
8433
8434 printf("%s\\n", NCURSES_VERSION);
8435 #else
8436 #ifdef __NCURSES_H
8437 printf("old\\n");
8438 #else
8439         make an error
8440 #endif
8441 #endif
8442
8443   ;
8444   return 0;
8445 }
8446 _ACEOF
8447 rm -f "conftest.$ac_objext"
8448 if { (eval echo "$as_me:8448: \"$ac_compile\"") >&5
8449   (eval $ac_compile) 2>&5
8450   ac_status=$?
8451   echo "$as_me:8451: \$? = $ac_status" >&5
8452   (exit "$ac_status"); } &&
8453          { ac_try='test -s "conftest.$ac_objext"'
8454   { (eval echo "$as_me:8454: \"$ac_try\"") >&5
8455   (eval $ac_try) 2>&5
8456   ac_status=$?
8457   echo "$as_me:8457: \$? = $ac_status" >&5
8458   (exit "$ac_status"); }; }; then
8459   cf_cv_ncurses_h2=$cf_header
8460
8461 else
8462   echo "$as_me: failed program was:" >&5
8463 cat "conftest.$ac_ext" >&5
8464 cf_cv_ncurses_h2=no
8465 fi
8466 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8467
8468                         if test "$cf_cv_ncurses_h2" != no ; then
8469                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8470                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8471                                 break
8472                         fi
8473                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8474                 done
8475                 CPPFLAGS="$cf_save2_CPPFLAGS"
8476                 test "$cf_cv_ncurses_h2" != no && break
8477         done
8478         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8478: error: not found" >&5
8479 echo "$as_me: error: not found" >&2;}
8480    { (exit 1); exit 1; }; }
8481
8482 fi
8483 echo "$as_me:8483: result: $cf_cv_ncurses_h2" >&5
8484 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8485
8486         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8487         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8488         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8489                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8490         fi
8491
8492 if test -n "$cf_1st_incdir" ; then
8493   for cf_add_incdir in $cf_1st_incdir
8494   do
8495         while test "$cf_add_incdir" != /usr/include
8496         do
8497           if test -d "$cf_add_incdir"
8498           then
8499                 cf_have_incdir=no
8500                 if test -n "$CFLAGS$CPPFLAGS" ; then
8501                   # a loop is needed to ensure we can add subdirs of existing dirs
8502                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8503                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8504                           cf_have_incdir=yes; break
8505                         fi
8506                   done
8507                 fi
8508
8509                 if test "$cf_have_incdir" = no ; then
8510                   if test "$cf_add_incdir" = /usr/local/include ; then
8511                         if test "$GCC" = yes
8512                         then
8513                           cf_save_CPPFLAGS=$CPPFLAGS
8514
8515         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8516         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8517
8518                           cat >"conftest.$ac_ext" <<_ACEOF
8519 #line 8519 "configure"
8520 #include "confdefs.h"
8521 #include <stdio.h>
8522 int
8523 main (void)
8524 {
8525 printf("Hello")
8526   ;
8527   return 0;
8528 }
8529 _ACEOF
8530 rm -f "conftest.$ac_objext"
8531 if { (eval echo "$as_me:8531: \"$ac_compile\"") >&5
8532   (eval $ac_compile) 2>&5
8533   ac_status=$?
8534   echo "$as_me:8534: \$? = $ac_status" >&5
8535   (exit "$ac_status"); } &&
8536          { ac_try='test -s "conftest.$ac_objext"'
8537   { (eval echo "$as_me:8537: \"$ac_try\"") >&5
8538   (eval $ac_try) 2>&5
8539   ac_status=$?
8540   echo "$as_me:8540: \$? = $ac_status" >&5
8541   (exit "$ac_status"); }; }; then
8542   :
8543 else
8544   echo "$as_me: failed program was:" >&5
8545 cat "conftest.$ac_ext" >&5
8546 cf_have_incdir=yes
8547 fi
8548 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8549                           CPPFLAGS=$cf_save_CPPFLAGS
8550                         fi
8551                   fi
8552                 fi
8553
8554                 if test "$cf_have_incdir" = no ; then
8555                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8556
8557 echo "${as_me:-configure}:8557: testing adding $cf_add_incdir to include-path ..." 1>&5
8558
8559                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8560
8561                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8562                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8563                   cf_add_incdir="$cf_top_incdir"
8564                 else
8565                   break
8566                 fi
8567           else
8568                 break
8569           fi
8570         done
8571   done
8572 fi
8573
8574 fi
8575
8576 # Set definitions to allow ifdef'ing for ncurses.h
8577
8578 case "$cf_cv_ncurses_header" in
8579 (*ncurses.h)
8580
8581 cat >>confdefs.h <<\EOF
8582 #define HAVE_NCURSES_H 1
8583 EOF
8584
8585         ;;
8586 esac
8587
8588 case "$cf_cv_ncurses_header" in
8589 (ncurses/curses.h|ncurses/ncurses.h)
8590
8591 cat >>confdefs.h <<\EOF
8592 #define HAVE_NCURSES_NCURSES_H 1
8593 EOF
8594
8595         ;;
8596 (ncursesw/curses.h|ncursesw/ncurses.h)
8597
8598 cat >>confdefs.h <<\EOF
8599 #define HAVE_NCURSESW_NCURSES_H 1
8600 EOF
8601
8602         ;;
8603 esac
8604
8605 echo "$as_me:8605: checking for terminfo header" >&5
8606 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8607 if test "${cf_cv_term_header+set}" = set; then
8608   echo $ECHO_N "(cached) $ECHO_C" >&6
8609 else
8610
8611 case "${cf_cv_ncurses_header}" in
8612 (*/ncurses.h|*/ncursesw.h)
8613         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8614         ;;
8615 (*)
8616         cf_term_header=term.h
8617         ;;
8618 esac
8619
8620 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8621 do
8622 cat >"conftest.$ac_ext" <<_ACEOF
8623 #line 8623 "configure"
8624 #include "confdefs.h"
8625 #include <stdio.h>
8626 #include <${cf_cv_ncurses_header:-curses.h}>
8627 #include <$cf_test>
8628
8629 int
8630 main (void)
8631 {
8632 int x = auto_left_margin; (void)x
8633   ;
8634   return 0;
8635 }
8636 _ACEOF
8637 rm -f "conftest.$ac_objext"
8638 if { (eval echo "$as_me:8638: \"$ac_compile\"") >&5
8639   (eval $ac_compile) 2>&5
8640   ac_status=$?
8641   echo "$as_me:8641: \$? = $ac_status" >&5
8642   (exit "$ac_status"); } &&
8643          { ac_try='test -s "conftest.$ac_objext"'
8644   { (eval echo "$as_me:8644: \"$ac_try\"") >&5
8645   (eval $ac_try) 2>&5
8646   ac_status=$?
8647   echo "$as_me:8647: \$? = $ac_status" >&5
8648   (exit "$ac_status"); }; }; then
8649
8650         cf_cv_term_header="$cf_test"
8651 else
8652   echo "$as_me: failed program was:" >&5
8653 cat "conftest.$ac_ext" >&5
8654
8655         cf_cv_term_header=unknown
8656
8657 fi
8658 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8659         test "$cf_cv_term_header" != unknown && break
8660 done
8661
8662 fi
8663 echo "$as_me:8663: result: $cf_cv_term_header" >&5
8664 echo "${ECHO_T}$cf_cv_term_header" >&6
8665
8666 # Set definitions to allow ifdef'ing to accommodate subdirectories
8667
8668 case "$cf_cv_term_header" in
8669 (*term.h)
8670
8671 cat >>confdefs.h <<\EOF
8672 #define HAVE_TERM_H 1
8673 EOF
8674
8675         ;;
8676 esac
8677
8678 case "$cf_cv_term_header" in
8679 (ncurses/term.h)
8680
8681 cat >>confdefs.h <<\EOF
8682 #define HAVE_NCURSES_TERM_H 1
8683 EOF
8684
8685         ;;
8686 (ncursesw/term.h)
8687
8688 cat >>confdefs.h <<\EOF
8689 #define HAVE_NCURSESW_TERM_H 1
8690 EOF
8691
8692         ;;
8693 esac
8694
8695 # some applications need this, but should check for NCURSES_VERSION
8696
8697 cat >>confdefs.h <<\EOF
8698 #define NCURSES 1
8699 EOF
8700
8701 echo "$as_me:8701: checking for ncurses version" >&5
8702 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8703 if test "${cf_cv_ncurses_version+set}" = set; then
8704   echo $ECHO_N "(cached) $ECHO_C" >&6
8705 else
8706
8707         cf_cv_ncurses_version=no
8708         cf_tempfile=out$$
8709         rm -f "$cf_tempfile"
8710         if test "$cross_compiling" = yes; then
8711
8712         # This will not work if the preprocessor splits the line after the
8713         # Autoconf token.  The 'unproto' program does that.
8714         cat > "conftest.$ac_ext" <<EOF
8715 #include <${cf_cv_ncurses_header:-curses.h}>
8716 #undef Autoconf
8717 #ifdef NCURSES_VERSION
8718 Autoconf NCURSES_VERSION
8719 #else
8720 #ifdef __NCURSES_H
8721 Autoconf "old"
8722 #endif
8723 ;
8724 #endif
8725 EOF
8726         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8727         { (eval echo "$as_me:8727: \"$cf_try\"") >&5
8728   (eval $cf_try) 2>&5
8729   ac_status=$?
8730   echo "$as_me:8730: \$? = $ac_status" >&5
8731   (exit "$ac_status"); }
8732         if test -f conftest.out ; then
8733                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8734                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8735                 rm -f conftest.out
8736         fi
8737
8738 else
8739   cat >"conftest.$ac_ext" <<_ACEOF
8740 #line 8740 "configure"
8741 #include "confdefs.h"
8742
8743 #include <${cf_cv_ncurses_header:-curses.h}>
8744 #include <stdio.h>
8745 int main(void)
8746 {
8747         FILE *fp = fopen("$cf_tempfile", "w");
8748 #ifdef NCURSES_VERSION
8749 # ifdef NCURSES_VERSION_PATCH
8750         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8751 # else
8752         fprintf(fp, "%s\\n", NCURSES_VERSION);
8753 # endif
8754 #else
8755 # ifdef __NCURSES_H
8756         fprintf(fp, "old\\n");
8757 # else
8758         make an error
8759 # endif
8760 #endif
8761         ${cf_cv_main_return:-return}(0);
8762 }
8763 _ACEOF
8764 rm -f "conftest$ac_exeext"
8765 if { (eval echo "$as_me:8765: \"$ac_link\"") >&5
8766   (eval $ac_link) 2>&5
8767   ac_status=$?
8768   echo "$as_me:8768: \$? = $ac_status" >&5
8769   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8770   { (eval echo "$as_me:8770: \"$ac_try\"") >&5
8771   (eval $ac_try) 2>&5
8772   ac_status=$?
8773   echo "$as_me:8773: \$? = $ac_status" >&5
8774   (exit "$ac_status"); }; }; then
8775
8776         cf_cv_ncurses_version=`cat $cf_tempfile`
8777 else
8778   echo "$as_me: program exited with status $ac_status" >&5
8779 echo "$as_me: failed program was:" >&5
8780 cat "conftest.$ac_ext" >&5
8781 fi
8782 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8783 fi
8784         rm -f "$cf_tempfile"
8785
8786 fi
8787 echo "$as_me:8787: result: $cf_cv_ncurses_version" >&5
8788 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8789 test "$cf_cv_ncurses_version" = no ||
8790 cat >>confdefs.h <<\EOF
8791 #define NCURSES 1
8792 EOF
8793
8794 cf_nculib_root=ncursesw
8795         # This works, except for the special case where we find gpm, but
8796         # ncurses is in a nonstandard location via $LIBS, and we really want
8797         # to link gpm.
8798 cf_ncurses_LIBS=""
8799 cf_ncurses_SAVE="$LIBS"
8800 echo "$as_me:8800: checking for Gpm_Open in -lgpm" >&5
8801 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8802 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8803   echo $ECHO_N "(cached) $ECHO_C" >&6
8804 else
8805   ac_check_lib_save_LIBS=$LIBS
8806 LIBS="-lgpm  $LIBS"
8807 cat >"conftest.$ac_ext" <<_ACEOF
8808 #line 8808 "configure"
8809 #include "confdefs.h"
8810
8811 /* Override any gcc2 internal prototype to avoid an error.  */
8812 #ifdef __cplusplus
8813 extern "C"
8814 #endif
8815 /* We use char because int might match the return type of a gcc2
8816    builtin and then its argument prototype would still apply.  */
8817 char Gpm_Open ();
8818 int
8819 main (void)
8820 {
8821 Gpm_Open ();
8822   ;
8823   return 0;
8824 }
8825 _ACEOF
8826 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8827 if { (eval echo "$as_me:8827: \"$ac_link\"") >&5
8828   (eval $ac_link) 2>&5
8829   ac_status=$?
8830   echo "$as_me:8830: \$? = $ac_status" >&5
8831   (exit "$ac_status"); } &&
8832          { ac_try='test -s "conftest$ac_exeext"'
8833   { (eval echo "$as_me:8833: \"$ac_try\"") >&5
8834   (eval $ac_try) 2>&5
8835   ac_status=$?
8836   echo "$as_me:8836: \$? = $ac_status" >&5
8837   (exit "$ac_status"); }; }; then
8838   ac_cv_lib_gpm_Gpm_Open=yes
8839 else
8840   echo "$as_me: failed program was:" >&5
8841 cat "conftest.$ac_ext" >&5
8842 ac_cv_lib_gpm_Gpm_Open=no
8843 fi
8844 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8845 LIBS=$ac_check_lib_save_LIBS
8846 fi
8847 echo "$as_me:8847: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8848 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8849 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8850   echo "$as_me:8850: checking for initscr in -lgpm" >&5
8851 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8852 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8853   echo $ECHO_N "(cached) $ECHO_C" >&6
8854 else
8855   ac_check_lib_save_LIBS=$LIBS
8856 LIBS="-lgpm  $LIBS"
8857 cat >"conftest.$ac_ext" <<_ACEOF
8858 #line 8858 "configure"
8859 #include "confdefs.h"
8860
8861 /* Override any gcc2 internal prototype to avoid an error.  */
8862 #ifdef __cplusplus
8863 extern "C"
8864 #endif
8865 /* We use char because int might match the return type of a gcc2
8866    builtin and then its argument prototype would still apply.  */
8867 char initscr ();
8868 int
8869 main (void)
8870 {
8871 initscr ();
8872   ;
8873   return 0;
8874 }
8875 _ACEOF
8876 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8877 if { (eval echo "$as_me:8877: \"$ac_link\"") >&5
8878   (eval $ac_link) 2>&5
8879   ac_status=$?
8880   echo "$as_me:8880: \$? = $ac_status" >&5
8881   (exit "$ac_status"); } &&
8882          { ac_try='test -s "conftest$ac_exeext"'
8883   { (eval echo "$as_me:8883: \"$ac_try\"") >&5
8884   (eval $ac_try) 2>&5
8885   ac_status=$?
8886   echo "$as_me:8886: \$? = $ac_status" >&5
8887   (exit "$ac_status"); }; }; then
8888   ac_cv_lib_gpm_initscr=yes
8889 else
8890   echo "$as_me: failed program was:" >&5
8891 cat "conftest.$ac_ext" >&5
8892 ac_cv_lib_gpm_initscr=no
8893 fi
8894 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8895 LIBS=$ac_check_lib_save_LIBS
8896 fi
8897 echo "$as_me:8897: result: $ac_cv_lib_gpm_initscr" >&5
8898 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8899 if test "$ac_cv_lib_gpm_initscr" = yes; then
8900   LIBS="$cf_ncurses_SAVE"
8901 else
8902   cf_ncurses_LIBS="-lgpm"
8903 fi
8904
8905 fi
8906
8907 case "$host_os" in
8908 (freebsd*)
8909         # This is only necessary if you are linking against an obsolete
8910         # version of ncurses (but it should do no harm, since it is static).
8911         if test "$cf_nculib_root" = ncurses ; then
8912                 echo "$as_me:8912: checking for tgoto in -lmytinfo" >&5
8913 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8914 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8915   echo $ECHO_N "(cached) $ECHO_C" >&6
8916 else
8917   ac_check_lib_save_LIBS=$LIBS
8918 LIBS="-lmytinfo  $LIBS"
8919 cat >"conftest.$ac_ext" <<_ACEOF
8920 #line 8920 "configure"
8921 #include "confdefs.h"
8922
8923 /* Override any gcc2 internal prototype to avoid an error.  */
8924 #ifdef __cplusplus
8925 extern "C"
8926 #endif
8927 /* We use char because int might match the return type of a gcc2
8928    builtin and then its argument prototype would still apply.  */
8929 char tgoto ();
8930 int
8931 main (void)
8932 {
8933 tgoto ();
8934   ;
8935   return 0;
8936 }
8937 _ACEOF
8938 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8939 if { (eval echo "$as_me:8939: \"$ac_link\"") >&5
8940   (eval $ac_link) 2>&5
8941   ac_status=$?
8942   echo "$as_me:8942: \$? = $ac_status" >&5
8943   (exit "$ac_status"); } &&
8944          { ac_try='test -s "conftest$ac_exeext"'
8945   { (eval echo "$as_me:8945: \"$ac_try\"") >&5
8946   (eval $ac_try) 2>&5
8947   ac_status=$?
8948   echo "$as_me:8948: \$? = $ac_status" >&5
8949   (exit "$ac_status"); }; }; then
8950   ac_cv_lib_mytinfo_tgoto=yes
8951 else
8952   echo "$as_me: failed program was:" >&5
8953 cat "conftest.$ac_ext" >&5
8954 ac_cv_lib_mytinfo_tgoto=no
8955 fi
8956 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8957 LIBS=$ac_check_lib_save_LIBS
8958 fi
8959 echo "$as_me:8959: result: $ac_cv_lib_mytinfo_tgoto" >&5
8960 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8961 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8962   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8963 fi
8964
8965         fi
8966         ;;
8967 esac
8968
8969 cf_add_libs="$LIBS"
8970 # reverse order
8971 cf_add_0lib=
8972 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8973 # filter duplicates
8974 for cf_add_1lib in $cf_add_0lib; do
8975         for cf_add_2lib in $cf_add_libs; do
8976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8977                         cf_add_1lib=
8978                         break
8979                 fi
8980         done
8981         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8982 done
8983 LIBS="$cf_add_libs"
8984
8985 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8986 then
8987
8988 cf_add_libs="$LIBS"
8989 # reverse order
8990 cf_add_0lib=
8991 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8992 # filter duplicates
8993 for cf_add_1lib in $cf_add_0lib; do
8994         for cf_add_2lib in $cf_add_libs; do
8995                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8996                         cf_add_1lib=
8997                         break
8998                 fi
8999         done
9000         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9001 done
9002 LIBS="$cf_add_libs"
9003
9004 else
9005
9006         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9007         cf_libdir=""
9008         echo "$as_me:9008: checking for initscr" >&5
9009 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9010 if test "${ac_cv_func_initscr+set}" = set; then
9011   echo $ECHO_N "(cached) $ECHO_C" >&6
9012 else
9013   cat >"conftest.$ac_ext" <<_ACEOF
9014 #line 9014 "configure"
9015 #include "confdefs.h"
9016 #define initscr autoconf_temporary
9017 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9018 #undef initscr
9019
9020 #ifdef __cplusplus
9021 extern "C"
9022 #endif
9023
9024 /* We use char because int might match the return type of a gcc2
9025    builtin and then its argument prototype would still apply.  */
9026 char initscr (void);
9027
9028 int
9029 main (void)
9030 {
9031
9032 /* The GNU C library defines stubs for functions which it implements
9033     to always fail with ENOSYS.  Some functions are actually named
9034     something starting with __ and the normal name is an alias.  */
9035 #if defined (__stub_initscr) || defined (__stub___initscr)
9036 #error found stub for initscr
9037 #endif
9038
9039         return initscr ();
9040   ;
9041   return 0;
9042 }
9043 _ACEOF
9044 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9045 if { (eval echo "$as_me:9045: \"$ac_link\"") >&5
9046   (eval $ac_link) 2>&5
9047   ac_status=$?
9048   echo "$as_me:9048: \$? = $ac_status" >&5
9049   (exit "$ac_status"); } &&
9050          { ac_try='test -s "conftest$ac_exeext"'
9051   { (eval echo "$as_me:9051: \"$ac_try\"") >&5
9052   (eval $ac_try) 2>&5
9053   ac_status=$?
9054   echo "$as_me:9054: \$? = $ac_status" >&5
9055   (exit "$ac_status"); }; }; then
9056   ac_cv_func_initscr=yes
9057 else
9058   echo "$as_me: failed program was:" >&5
9059 cat "conftest.$ac_ext" >&5
9060 ac_cv_func_initscr=no
9061 fi
9062 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9063 fi
9064 echo "$as_me:9064: result: $ac_cv_func_initscr" >&5
9065 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9066 if test "$ac_cv_func_initscr" = yes; then
9067   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9068 else
9069
9070                 cf_save_LIBS="$LIBS"
9071                 echo "$as_me:9071: checking for initscr in -l$cf_nculib_root" >&5
9072 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9073                 LIBS="-l$cf_nculib_root $LIBS"
9074                 cat >"conftest.$ac_ext" <<_ACEOF
9075 #line 9075 "configure"
9076 #include "confdefs.h"
9077 #include <${cf_cv_ncurses_header:-curses.h}>
9078 int
9079 main (void)
9080 {
9081 initscr()
9082   ;
9083   return 0;
9084 }
9085 _ACEOF
9086 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9087 if { (eval echo "$as_me:9087: \"$ac_link\"") >&5
9088   (eval $ac_link) 2>&5
9089   ac_status=$?
9090   echo "$as_me:9090: \$? = $ac_status" >&5
9091   (exit "$ac_status"); } &&
9092          { ac_try='test -s "conftest$ac_exeext"'
9093   { (eval echo "$as_me:9093: \"$ac_try\"") >&5
9094   (eval $ac_try) 2>&5
9095   ac_status=$?
9096   echo "$as_me:9096: \$? = $ac_status" >&5
9097   (exit "$ac_status"); }; }; then
9098   echo "$as_me:9098: result: yes" >&5
9099 echo "${ECHO_T}yes" >&6
9100                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9101
9102 else
9103   echo "$as_me: failed program was:" >&5
9104 cat "conftest.$ac_ext" >&5
9105 echo "$as_me:9105: result: no" >&5
9106 echo "${ECHO_T}no" >&6
9107
9108 cf_search=
9109 cf_library_path_list=""
9110 if test -n "${LDFLAGS}${LIBS}" ; then
9111         for cf_library_path in $LDFLAGS $LIBS
9112         do
9113                 case "$cf_library_path" in
9114                 (-L*)
9115                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9116
9117 test "x$cf_library_path" != "xNONE" && \
9118 test -d "$cf_library_path" && \
9119  {
9120         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9121         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9122         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9123         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9124         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9125         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"
9126 }
9127
9128                         cf_library_path_list="$cf_library_path_list $cf_search"
9129                         ;;
9130                 esac
9131         done
9132 fi
9133
9134 cf_search=
9135
9136 test "x$prefix" != "xNONE" && \
9137 test -d "$prefix" && \
9138  {
9139         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9140         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9141         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9142         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9143         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9144         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9145 }
9146
9147 for cf_subdir_prefix in \
9148         /usr \
9149         /usr/local \
9150         /usr/pkg \
9151         /opt \
9152         /opt/local \
9153         $HOME
9154 do
9155
9156 test "x$cf_subdir_prefix" != "x$prefix" && \
9157 test -d "$cf_subdir_prefix" && \
9158 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9159         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9160         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9161         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9162         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9163         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9164         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"
9165 }
9166
9167 done
9168
9169 cf_search="$cf_library_path_list $cf_search"
9170
9171                         for cf_libdir in $cf_search
9172                         do
9173                                 echo "$as_me:9173: checking for -l$cf_nculib_root in $cf_libdir" >&5
9174 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9175                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9176                                 cat >"conftest.$ac_ext" <<_ACEOF
9177 #line 9177 "configure"
9178 #include "confdefs.h"
9179 #include <${cf_cv_ncurses_header:-curses.h}>
9180 int
9181 main (void)
9182 {
9183 initscr()
9184   ;
9185   return 0;
9186 }
9187 _ACEOF
9188 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9189 if { (eval echo "$as_me:9189: \"$ac_link\"") >&5
9190   (eval $ac_link) 2>&5
9191   ac_status=$?
9192   echo "$as_me:9192: \$? = $ac_status" >&5
9193   (exit "$ac_status"); } &&
9194          { ac_try='test -s "conftest$ac_exeext"'
9195   { (eval echo "$as_me:9195: \"$ac_try\"") >&5
9196   (eval $ac_try) 2>&5
9197   ac_status=$?
9198   echo "$as_me:9198: \$? = $ac_status" >&5
9199   (exit "$ac_status"); }; }; then
9200   echo "$as_me:9200: result: yes" >&5
9201 echo "${ECHO_T}yes" >&6
9202                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9203                                          break
9204 else
9205   echo "$as_me: failed program was:" >&5
9206 cat "conftest.$ac_ext" >&5
9207 echo "$as_me:9207: result: no" >&5
9208 echo "${ECHO_T}no" >&6
9209                                          LIBS="$cf_save_LIBS"
9210 fi
9211 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9212                         done
9213
9214 fi
9215 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9216
9217 fi
9218
9219 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9220
9221 if test "$cf_found_library" = no ; then
9222         { { echo "$as_me:9222: error: Cannot link $cf_nculib_root library" >&5
9223 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9224    { (exit 1); exit 1; }; }
9225 fi
9226
9227 fi
9228
9229 if test -n "$cf_ncurses_LIBS" ; then
9230         echo "$as_me:9230: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9231 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9232         cf_ncurses_SAVE="$LIBS"
9233         for p in $cf_ncurses_LIBS ; do
9234                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9235                 if test "$q" != "$LIBS" ; then
9236                         LIBS="$q"
9237                 fi
9238         done
9239         cat >"conftest.$ac_ext" <<_ACEOF
9240 #line 9240 "configure"
9241 #include "confdefs.h"
9242 #include <${cf_cv_ncurses_header:-curses.h}>
9243 int
9244 main (void)
9245 {
9246 initscr(); mousemask(0,0); tigetstr((char *)0);
9247   ;
9248   return 0;
9249 }
9250 _ACEOF
9251 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9252 if { (eval echo "$as_me:9252: \"$ac_link\"") >&5
9253   (eval $ac_link) 2>&5
9254   ac_status=$?
9255   echo "$as_me:9255: \$? = $ac_status" >&5
9256   (exit "$ac_status"); } &&
9257          { ac_try='test -s "conftest$ac_exeext"'
9258   { (eval echo "$as_me:9258: \"$ac_try\"") >&5
9259   (eval $ac_try) 2>&5
9260   ac_status=$?
9261   echo "$as_me:9261: \$? = $ac_status" >&5
9262   (exit "$ac_status"); }; }; then
9263   echo "$as_me:9263: result: yes" >&5
9264 echo "${ECHO_T}yes" >&6
9265 else
9266   echo "$as_me: failed program was:" >&5
9267 cat "conftest.$ac_ext" >&5
9268 echo "$as_me:9268: result: no" >&5
9269 echo "${ECHO_T}no" >&6
9270                  LIBS="$cf_ncurses_SAVE"
9271 fi
9272 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9273 fi
9274
9275 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9276
9277 cat >>confdefs.h <<EOF
9278 #define $cf_nculib_ROOT 1
9279 EOF
9280
9281         fi
9282 else
9283         NCURSES_CONFIG=none
9284 fi
9285
9286 else
9287
9288 cf_ncuconfig_root=ncurses
9289 cf_have_ncuconfig=no
9290
9291 if test "x${PKG_CONFIG:=none}" != xnone; then
9292         echo "$as_me:9292: checking pkg-config for $cf_ncuconfig_root" >&5
9293 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9294         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9295                 echo "$as_me:9295: result: yes" >&5
9296 echo "${ECHO_T}yes" >&6
9297
9298                 echo "$as_me:9298: checking if the $cf_ncuconfig_root package files work" >&5
9299 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9300                 cf_have_ncuconfig=unknown
9301
9302                 cf_save_CFLAGS="$CFLAGS"
9303                 cf_save_CPPFLAGS="$CPPFLAGS"
9304                 cf_save_LIBS="$LIBS"
9305
9306                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9307                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9308
9309                 # while -W for passing linker flags is prevalent, it is not "standard".
9310                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9311                 # incompatible _and_ non-standard -W option which gives an error.  Work
9312                 # around that pitfall.
9313                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9314                 (x*c[89]9@@*-W*)
9315
9316 cf_fix_cppflags=no
9317 cf_new_cflags=
9318 cf_new_cppflags=
9319 cf_new_extra_cppflags=
9320
9321 for cf_add_cflags in $cf_pkg_cflags
9322 do
9323 case "$cf_fix_cppflags" in
9324 (no)
9325         case "$cf_add_cflags" in
9326         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9327                 case "$cf_add_cflags" in
9328                 (-D*)
9329                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9330
9331                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9332                                 && test -z "${cf_tst_cflags}" \
9333                                 && cf_fix_cppflags=yes
9334
9335                         if test "$cf_fix_cppflags" = yes ; then
9336
9337         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9338         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9339
9340                                 continue
9341                         elif test "${cf_tst_cflags}" = "\"'" ; then
9342
9343         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9344         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9345
9346                                 continue
9347                         fi
9348                         ;;
9349                 esac
9350                 case "$CPPFLAGS" in
9351                 (*$cf_add_cflags)
9352                         ;;
9353                 (*)
9354                         case "$cf_add_cflags" in
9355                         (-D*)
9356                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9357
9358 CPPFLAGS=`echo "$CPPFLAGS" | \
9359         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9360                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9361
9362                                 ;;
9363                         esac
9364
9365         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9366         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9367
9368                         ;;
9369                 esac
9370                 ;;
9371         (*)
9372
9373         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9374         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9375
9376                 ;;
9377         esac
9378         ;;
9379 (yes)
9380
9381         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9382         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9383
9384         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9385
9386         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9387                 && test -z "${cf_tst_cflags}" \
9388                 && cf_fix_cppflags=no
9389         ;;
9390 esac
9391 done
9392
9393 if test -n "$cf_new_cflags" ; then
9394
9395         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9396         CFLAGS="${CFLAGS}$cf_new_cflags"
9397
9398 fi
9399
9400 if test -n "$cf_new_cppflags" ; then
9401
9402         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9403         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9404
9405 fi
9406
9407 if test -n "$cf_new_extra_cppflags" ; then
9408
9409         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9410         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9411
9412 fi
9413
9414 cf_add_libs="$LIBS"
9415 # reverse order
9416 cf_add_0lib=
9417 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9418 # filter duplicates
9419 for cf_add_1lib in $cf_add_0lib; do
9420         for cf_add_2lib in $cf_add_libs; do
9421                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9422                         cf_add_1lib=
9423                         break
9424                 fi
9425         done
9426         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9427 done
9428 LIBS="$cf_add_libs"
9429
9430                         cat >"conftest.$ac_ext" <<_ACEOF
9431 #line 9431 "configure"
9432 #include "confdefs.h"
9433 #include <${cf_cv_ncurses_header:-curses.h}>
9434 int
9435 main (void)
9436 {
9437 initscr(); mousemask(0,0); tigetstr((char *)0);
9438   ;
9439   return 0;
9440 }
9441 _ACEOF
9442 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9443 if { (eval echo "$as_me:9443: \"$ac_link\"") >&5
9444   (eval $ac_link) 2>&5
9445   ac_status=$?
9446   echo "$as_me:9446: \$? = $ac_status" >&5
9447   (exit "$ac_status"); } &&
9448          { ac_try='test -s "conftest$ac_exeext"'
9449   { (eval echo "$as_me:9449: \"$ac_try\"") >&5
9450   (eval $ac_try) 2>&5
9451   ac_status=$?
9452   echo "$as_me:9452: \$? = $ac_status" >&5
9453   (exit "$ac_status"); }; }; then
9454   if test "$cross_compiling" = yes; then
9455   cf_test_ncuconfig=maybe
9456 else
9457   cat >"conftest.$ac_ext" <<_ACEOF
9458 #line 9458 "configure"
9459 #include "confdefs.h"
9460 #include <${cf_cv_ncurses_header:-curses.h}>
9461                                         int main(void)
9462                                         { const char *xx = curses_version(); return (xx == 0); }
9463 _ACEOF
9464 rm -f "conftest$ac_exeext"
9465 if { (eval echo "$as_me:9465: \"$ac_link\"") >&5
9466   (eval $ac_link) 2>&5
9467   ac_status=$?
9468   echo "$as_me:9468: \$? = $ac_status" >&5
9469   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9470   { (eval echo "$as_me:9470: \"$ac_try\"") >&5
9471   (eval $ac_try) 2>&5
9472   ac_status=$?
9473   echo "$as_me:9473: \$? = $ac_status" >&5
9474   (exit "$ac_status"); }; }; then
9475   cf_test_ncuconfig=yes
9476 else
9477   echo "$as_me: program exited with status $ac_status" >&5
9478 echo "$as_me: failed program was:" >&5
9479 cat "conftest.$ac_ext" >&5
9480 cf_test_ncuconfig=no
9481 fi
9482 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9483 fi
9484 else
9485   echo "$as_me: failed program was:" >&5
9486 cat "conftest.$ac_ext" >&5
9487 cf_test_ncuconfig=no
9488 fi
9489 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9490
9491                         CFLAGS="$cf_save_CFLAGS"
9492                         CPPFLAGS="$cf_save_CPPFLAGS"
9493                         LIBS="$cf_save_LIBS"
9494
9495                         if test "x$cf_test_ncuconfig" != xyes; then
9496                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9497                                 cf_pkg_cflags="$cf_temp"
9498                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9499                                 cf_pkg_libs="$cf_temp"
9500                         fi
9501                         ;;
9502                 esac
9503
9504 for cf_add_cflags in $cf_pkg_cflags
9505 do
9506         case "x$cf_add_cflags" in
9507         (x-[DU]*)
9508
9509 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9510 while true
9511 do
9512         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'`
9513         test "$CFLAGS" != "$cf_old_cflag" || break
9514
9515         CFLAGS="$cf_old_cflag"
9516 done
9517
9518 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9519 while true
9520 do
9521         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'`
9522         test "$CPPFLAGS" != "$cf_old_cflag" || break
9523
9524         CPPFLAGS="$cf_old_cflag"
9525 done
9526
9527                 ;;
9528         esac
9529
9530 cf_fix_cppflags=no
9531 cf_new_cflags=
9532 cf_new_cppflags=
9533 cf_new_extra_cppflags=
9534
9535 for cf_add_cflags in $cf_add_cflags
9536 do
9537 case "$cf_fix_cppflags" in
9538 (no)
9539         case "$cf_add_cflags" in
9540         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9541                 case "$cf_add_cflags" in
9542                 (-D*)
9543                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9544
9545                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9546                                 && test -z "${cf_tst_cflags}" \
9547                                 && cf_fix_cppflags=yes
9548
9549                         if test "$cf_fix_cppflags" = yes ; then
9550
9551         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9552         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9553
9554                                 continue
9555                         elif test "${cf_tst_cflags}" = "\"'" ; then
9556
9557         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9558         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9559
9560                                 continue
9561                         fi
9562                         ;;
9563                 esac
9564                 case "$CPPFLAGS" in
9565                 (*$cf_add_cflags)
9566                         ;;
9567                 (*)
9568                         case "$cf_add_cflags" in
9569                         (-D*)
9570                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9571
9572 CPPFLAGS=`echo "$CPPFLAGS" | \
9573         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9574                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9575
9576                                 ;;
9577                         esac
9578
9579         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9580         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9581
9582                         ;;
9583                 esac
9584                 ;;
9585         (*)
9586
9587         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9588         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9589
9590                 ;;
9591         esac
9592         ;;
9593 (yes)
9594
9595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9597
9598         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9599
9600         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9601                 && test -z "${cf_tst_cflags}" \
9602                 && cf_fix_cppflags=no
9603         ;;
9604 esac
9605 done
9606
9607 if test -n "$cf_new_cflags" ; then
9608
9609         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9610         CFLAGS="${CFLAGS}$cf_new_cflags"
9611
9612 fi
9613
9614 if test -n "$cf_new_cppflags" ; then
9615
9616         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9617         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9618
9619 fi
9620
9621 if test -n "$cf_new_extra_cppflags" ; then
9622
9623         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9624         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9625
9626 fi
9627
9628 done
9629
9630 cf_add_libs="$LIBS"
9631 # reverse order
9632 cf_add_0lib=
9633 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9634 # filter duplicates
9635 for cf_add_1lib in $cf_add_0lib; do
9636         for cf_add_2lib in $cf_add_libs; do
9637                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9638                         cf_add_1lib=
9639                         break
9640                 fi
9641         done
9642         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9643 done
9644 LIBS="$cf_add_libs"
9645
9646                 cat >"conftest.$ac_ext" <<_ACEOF
9647 #line 9647 "configure"
9648 #include "confdefs.h"
9649 #include <${cf_cv_ncurses_header:-curses.h}>
9650 int
9651 main (void)
9652 {
9653 initscr(); mousemask(0,0); tigetstr((char *)0);
9654   ;
9655   return 0;
9656 }
9657 _ACEOF
9658 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9659 if { (eval echo "$as_me:9659: \"$ac_link\"") >&5
9660   (eval $ac_link) 2>&5
9661   ac_status=$?
9662   echo "$as_me:9662: \$? = $ac_status" >&5
9663   (exit "$ac_status"); } &&
9664          { ac_try='test -s "conftest$ac_exeext"'
9665   { (eval echo "$as_me:9665: \"$ac_try\"") >&5
9666   (eval $ac_try) 2>&5
9667   ac_status=$?
9668   echo "$as_me:9668: \$? = $ac_status" >&5
9669   (exit "$ac_status"); }; }; then
9670   if test "$cross_compiling" = yes; then
9671   cf_have_ncuconfig=maybe
9672 else
9673   cat >"conftest.$ac_ext" <<_ACEOF
9674 #line 9674 "configure"
9675 #include "confdefs.h"
9676 #include <${cf_cv_ncurses_header:-curses.h}>
9677                                 int main(void)
9678                                 { const char *xx = curses_version(); return (xx == 0); }
9679 _ACEOF
9680 rm -f "conftest$ac_exeext"
9681 if { (eval echo "$as_me:9681: \"$ac_link\"") >&5
9682   (eval $ac_link) 2>&5
9683   ac_status=$?
9684   echo "$as_me:9684: \$? = $ac_status" >&5
9685   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9686   { (eval echo "$as_me:9686: \"$ac_try\"") >&5
9687   (eval $ac_try) 2>&5
9688   ac_status=$?
9689   echo "$as_me:9689: \$? = $ac_status" >&5
9690   (exit "$ac_status"); }; }; then
9691   cf_have_ncuconfig=yes
9692 else
9693   echo "$as_me: program exited with status $ac_status" >&5
9694 echo "$as_me: failed program was:" >&5
9695 cat "conftest.$ac_ext" >&5
9696 cf_have_ncuconfig=no
9697 fi
9698 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9699 fi
9700 else
9701   echo "$as_me: failed program was:" >&5
9702 cat "conftest.$ac_ext" >&5
9703 cf_have_ncuconfig=no
9704 fi
9705 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9706                 echo "$as_me:9706: result: $cf_have_ncuconfig" >&5
9707 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9708                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9709                 if test "$cf_have_ncuconfig" != "yes"
9710                 then
9711                         CPPFLAGS="$cf_save_CPPFLAGS"
9712                         LIBS="$cf_save_LIBS"
9713                         NCURSES_CONFIG_PKG=none
9714                 else
9715
9716 cat >>confdefs.h <<\EOF
9717 #define NCURSES 1
9718 EOF
9719
9720                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9721
9722 echo "$as_me:9722: checking for terminfo header" >&5
9723 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9724 if test "${cf_cv_term_header+set}" = set; then
9725   echo $ECHO_N "(cached) $ECHO_C" >&6
9726 else
9727
9728 case "${cf_cv_ncurses_header}" in
9729 (*/ncurses.h|*/ncursesw.h)
9730         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9731         ;;
9732 (*)
9733         cf_term_header=term.h
9734         ;;
9735 esac
9736
9737 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9738 do
9739 cat >"conftest.$ac_ext" <<_ACEOF
9740 #line 9740 "configure"
9741 #include "confdefs.h"
9742 #include <stdio.h>
9743 #include <${cf_cv_ncurses_header:-curses.h}>
9744 #include <$cf_test>
9745
9746 int
9747 main (void)
9748 {
9749 int x = auto_left_margin; (void)x
9750   ;
9751   return 0;
9752 }
9753 _ACEOF
9754 rm -f "conftest.$ac_objext"
9755 if { (eval echo "$as_me:9755: \"$ac_compile\"") >&5
9756   (eval $ac_compile) 2>&5
9757   ac_status=$?
9758   echo "$as_me:9758: \$? = $ac_status" >&5
9759   (exit "$ac_status"); } &&
9760          { ac_try='test -s "conftest.$ac_objext"'
9761   { (eval echo "$as_me:9761: \"$ac_try\"") >&5
9762   (eval $ac_try) 2>&5
9763   ac_status=$?
9764   echo "$as_me:9764: \$? = $ac_status" >&5
9765   (exit "$ac_status"); }; }; then
9766
9767         cf_cv_term_header="$cf_test"
9768 else
9769   echo "$as_me: failed program was:" >&5
9770 cat "conftest.$ac_ext" >&5
9771
9772         cf_cv_term_header=unknown
9773
9774 fi
9775 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9776         test "$cf_cv_term_header" != unknown && break
9777 done
9778
9779 fi
9780 echo "$as_me:9780: result: $cf_cv_term_header" >&5
9781 echo "${ECHO_T}$cf_cv_term_header" >&6
9782
9783 # Set definitions to allow ifdef'ing to accommodate subdirectories
9784
9785 case "$cf_cv_term_header" in
9786 (*term.h)
9787
9788 cat >>confdefs.h <<\EOF
9789 #define HAVE_TERM_H 1
9790 EOF
9791
9792         ;;
9793 esac
9794
9795 case "$cf_cv_term_header" in
9796 (ncurses/term.h)
9797
9798 cat >>confdefs.h <<\EOF
9799 #define HAVE_NCURSES_TERM_H 1
9800 EOF
9801
9802         ;;
9803 (ncursesw/term.h)
9804
9805 cat >>confdefs.h <<\EOF
9806 #define HAVE_NCURSESW_TERM_H 1
9807 EOF
9808
9809         ;;
9810 esac
9811
9812                 fi
9813
9814         else
9815                 echo "$as_me:9815: result: no" >&5
9816 echo "${ECHO_T}no" >&6
9817                 NCURSES_CONFIG_PKG=none
9818         fi
9819 else
9820         NCURSES_CONFIG_PKG=none
9821 fi
9822
9823 if test "x$cf_have_ncuconfig" = "xno"; then
9824         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9825
9826 if test -n "$ac_tool_prefix"; then
9827   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9828   do
9829     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9830 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9831 echo "$as_me:9831: checking for $ac_word" >&5
9832 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9833 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9834   echo $ECHO_N "(cached) $ECHO_C" >&6
9835 else
9836   if test -n "$NCURSES_CONFIG"; then
9837   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9838 else
9839   ac_save_IFS=$IFS; IFS=$ac_path_separator
9840 ac_dummy="$PATH"
9841 for ac_dir in $ac_dummy; do
9842   IFS=$ac_save_IFS
9843   test -z "$ac_dir" && ac_dir=.
9844   $as_executable_p "$ac_dir/$ac_word" || continue
9845 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9846 echo "$as_me:9846: found $ac_dir/$ac_word" >&5
9847 break
9848 done
9849
9850 fi
9851 fi
9852 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9853 if test -n "$NCURSES_CONFIG"; then
9854   echo "$as_me:9854: result: $NCURSES_CONFIG" >&5
9855 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9856 else
9857   echo "$as_me:9857: result: no" >&5
9858 echo "${ECHO_T}no" >&6
9859 fi
9860
9861     test -n "$NCURSES_CONFIG" && break
9862   done
9863 fi
9864 if test -z "$NCURSES_CONFIG"; then
9865   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9866   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9867 do
9868   # Extract the first word of "$ac_prog", so it can be a program name with args.
9869 set dummy $ac_prog; ac_word=$2
9870 echo "$as_me:9870: checking for $ac_word" >&5
9871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9872 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9873   echo $ECHO_N "(cached) $ECHO_C" >&6
9874 else
9875   if test -n "$ac_ct_NCURSES_CONFIG"; then
9876   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9877 else
9878   ac_save_IFS=$IFS; IFS=$ac_path_separator
9879 ac_dummy="$PATH"
9880 for ac_dir in $ac_dummy; do
9881   IFS=$ac_save_IFS
9882   test -z "$ac_dir" && ac_dir=.
9883   $as_executable_p "$ac_dir/$ac_word" || continue
9884 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9885 echo "$as_me:9885: found $ac_dir/$ac_word" >&5
9886 break
9887 done
9888
9889 fi
9890 fi
9891 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9892 if test -n "$ac_ct_NCURSES_CONFIG"; then
9893   echo "$as_me:9893: result: $ac_ct_NCURSES_CONFIG" >&5
9894 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9895 else
9896   echo "$as_me:9896: result: no" >&5
9897 echo "${ECHO_T}no" >&6
9898 fi
9899
9900   test -n "$ac_ct_NCURSES_CONFIG" && break
9901 done
9902 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9903
9904   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9905 fi
9906
9907         if test "$NCURSES_CONFIG" != none ; then
9908
9909 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9910 do
9911         case "x$cf_add_cflags" in
9912         (x-[DU]*)
9913
9914 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9915 while true
9916 do
9917         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'`
9918         test "$CFLAGS" != "$cf_old_cflag" || break
9919
9920         CFLAGS="$cf_old_cflag"
9921 done
9922
9923 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9924 while true
9925 do
9926         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'`
9927         test "$CPPFLAGS" != "$cf_old_cflag" || break
9928
9929         CPPFLAGS="$cf_old_cflag"
9930 done
9931
9932                 ;;
9933         esac
9934
9935 cf_fix_cppflags=no
9936 cf_new_cflags=
9937 cf_new_cppflags=
9938 cf_new_extra_cppflags=
9939
9940 for cf_add_cflags in $cf_add_cflags
9941 do
9942 case "$cf_fix_cppflags" in
9943 (no)
9944         case "$cf_add_cflags" in
9945         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9946                 case "$cf_add_cflags" in
9947                 (-D*)
9948                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9949
9950                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9951                                 && test -z "${cf_tst_cflags}" \
9952                                 && cf_fix_cppflags=yes
9953
9954                         if test "$cf_fix_cppflags" = yes ; then
9955
9956         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9957         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9958
9959                                 continue
9960                         elif test "${cf_tst_cflags}" = "\"'" ; then
9961
9962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9964
9965                                 continue
9966                         fi
9967                         ;;
9968                 esac
9969                 case "$CPPFLAGS" in
9970                 (*$cf_add_cflags)
9971                         ;;
9972                 (*)
9973                         case "$cf_add_cflags" in
9974                         (-D*)
9975                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9976
9977 CPPFLAGS=`echo "$CPPFLAGS" | \
9978         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9979                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9980
9981                                 ;;
9982                         esac
9983
9984         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9985         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9986
9987                         ;;
9988                 esac
9989                 ;;
9990         (*)
9991
9992         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9993         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9994
9995                 ;;
9996         esac
9997         ;;
9998 (yes)
9999
10000         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10001         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10002
10003         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10004
10005         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10006                 && test -z "${cf_tst_cflags}" \
10007                 && cf_fix_cppflags=no
10008         ;;
10009 esac
10010 done
10011
10012 if test -n "$cf_new_cflags" ; then
10013
10014         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10015         CFLAGS="${CFLAGS}$cf_new_cflags"
10016
10017 fi
10018
10019 if test -n "$cf_new_cppflags" ; then
10020
10021         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10022         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10023
10024 fi
10025
10026 if test -n "$cf_new_extra_cppflags" ; then
10027
10028         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10029         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10030
10031 fi
10032
10033 done
10034
10035 cf_add_libs="$LIBS"
10036 # reverse order
10037 cf_add_0lib=
10038 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10039 # filter duplicates
10040 for cf_add_1lib in $cf_add_0lib; do
10041         for cf_add_2lib in $cf_add_libs; do
10042                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10043                         cf_add_1lib=
10044                         break
10045                 fi
10046         done
10047         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10048 done
10049 LIBS="$cf_add_libs"
10050
10051                 # even with config script, some packages use no-override for curses.h
10052
10053 echo "$as_me:10053: checking if we have identified curses headers" >&5
10054 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10055 if test "${cf_cv_ncurses_header+set}" = set; then
10056   echo $ECHO_N "(cached) $ECHO_C" >&6
10057 else
10058
10059 cf_cv_ncurses_header=none
10060 for cf_header in \
10061         ncurses.h ncurses/ncurses.h \
10062         curses.h ncurses/curses.h
10063 do
10064 cat >"conftest.$ac_ext" <<_ACEOF
10065 #line 10065 "configure"
10066 #include "confdefs.h"
10067 #include <${cf_header}>
10068 int
10069 main (void)
10070 {
10071 initscr(); tgoto("?", 0,0)
10072   ;
10073   return 0;
10074 }
10075 _ACEOF
10076 rm -f "conftest.$ac_objext"
10077 if { (eval echo "$as_me:10077: \"$ac_compile\"") >&5
10078   (eval $ac_compile) 2>&5
10079   ac_status=$?
10080   echo "$as_me:10080: \$? = $ac_status" >&5
10081   (exit "$ac_status"); } &&
10082          { ac_try='test -s "conftest.$ac_objext"'
10083   { (eval echo "$as_me:10083: \"$ac_try\"") >&5
10084   (eval $ac_try) 2>&5
10085   ac_status=$?
10086   echo "$as_me:10086: \$? = $ac_status" >&5
10087   (exit "$ac_status"); }; }; then
10088   cf_cv_ncurses_header=$cf_header; break
10089 else
10090   echo "$as_me: failed program was:" >&5
10091 cat "conftest.$ac_ext" >&5
10092 fi
10093 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10094 done
10095
10096 fi
10097 echo "$as_me:10097: result: $cf_cv_ncurses_header" >&5
10098 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10099
10100 if test "$cf_cv_ncurses_header" = none ; then
10101         { { echo "$as_me:10101: error: No curses header-files found" >&5
10102 echo "$as_me: error: No curses header-files found" >&2;}
10103    { (exit 1); exit 1; }; }
10104 fi
10105
10106 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10107
10108 for ac_header in $cf_cv_ncurses_header
10109 do
10110 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10111 echo "$as_me:10111: checking for $ac_header" >&5
10112 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10113 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10114   echo $ECHO_N "(cached) $ECHO_C" >&6
10115 else
10116   cat >"conftest.$ac_ext" <<_ACEOF
10117 #line 10117 "configure"
10118 #include "confdefs.h"
10119 #include <$ac_header>
10120 _ACEOF
10121 if { (eval echo "$as_me:10121: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10122   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10123   ac_status=$?
10124   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10125   rm -f conftest.er1
10126   cat conftest.err >&5
10127   echo "$as_me:10127: \$? = $ac_status" >&5
10128   (exit "$ac_status"); } >/dev/null; then
10129   if test -s conftest.err; then
10130     ac_cpp_err=$ac_c_preproc_warn_flag
10131   else
10132     ac_cpp_err=
10133   fi
10134 else
10135   ac_cpp_err=yes
10136 fi
10137 if test -z "$ac_cpp_err"; then
10138   eval "$as_ac_Header=yes"
10139 else
10140   echo "$as_me: failed program was:" >&5
10141   cat "conftest.$ac_ext" >&5
10142   eval "$as_ac_Header=no"
10143 fi
10144 rm -f conftest.err "conftest.$ac_ext"
10145 fi
10146 echo "$as_me:10146: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10147 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10148 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10149   cat >>confdefs.h <<EOF
10150 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10151 EOF
10152
10153 fi
10154 done
10155
10156 cat >>confdefs.h <<\EOF
10157 #define NCURSES 1
10158 EOF
10159
10160 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10161
10162                 cat >>confdefs.h <<EOF
10163 #define $cf_nculib_ROOT 1
10164 EOF
10165
10166                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10167
10168         else
10169
10170 cf_ncuhdr_root=ncurses
10171
10172 test -n "$cf_cv_curses_dir" && \
10173 test "$cf_cv_curses_dir" != "no" && { \
10174
10175 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10176   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10177   do
10178         while test "$cf_add_incdir" != /usr/include
10179         do
10180           if test -d "$cf_add_incdir"
10181           then
10182                 cf_have_incdir=no
10183                 if test -n "$CFLAGS$CPPFLAGS" ; then
10184                   # a loop is needed to ensure we can add subdirs of existing dirs
10185                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10186                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10187                           cf_have_incdir=yes; break
10188                         fi
10189                   done
10190                 fi
10191
10192                 if test "$cf_have_incdir" = no ; then
10193                   if test "$cf_add_incdir" = /usr/local/include ; then
10194                         if test "$GCC" = yes
10195                         then
10196                           cf_save_CPPFLAGS=$CPPFLAGS
10197
10198         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10199         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10200
10201                           cat >"conftest.$ac_ext" <<_ACEOF
10202 #line 10202 "configure"
10203 #include "confdefs.h"
10204 #include <stdio.h>
10205 int
10206 main (void)
10207 {
10208 printf("Hello")
10209   ;
10210   return 0;
10211 }
10212 _ACEOF
10213 rm -f "conftest.$ac_objext"
10214 if { (eval echo "$as_me:10214: \"$ac_compile\"") >&5
10215   (eval $ac_compile) 2>&5
10216   ac_status=$?
10217   echo "$as_me:10217: \$? = $ac_status" >&5
10218   (exit "$ac_status"); } &&
10219          { ac_try='test -s "conftest.$ac_objext"'
10220   { (eval echo "$as_me:10220: \"$ac_try\"") >&5
10221   (eval $ac_try) 2>&5
10222   ac_status=$?
10223   echo "$as_me:10223: \$? = $ac_status" >&5
10224   (exit "$ac_status"); }; }; then
10225   :
10226 else
10227   echo "$as_me: failed program was:" >&5
10228 cat "conftest.$ac_ext" >&5
10229 cf_have_incdir=yes
10230 fi
10231 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10232                           CPPFLAGS=$cf_save_CPPFLAGS
10233                         fi
10234                   fi
10235                 fi
10236
10237                 if test "$cf_have_incdir" = no ; then
10238                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10239
10240 echo "${as_me:-configure}:10240: testing adding $cf_add_incdir to include-path ..." 1>&5
10241
10242                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10243
10244                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10245                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10246                   cf_add_incdir="$cf_top_incdir"
10247                 else
10248                   break
10249                 fi
10250           else
10251                 break
10252           fi
10253         done
10254   done
10255 fi
10256
10257 }
10258
10259 echo "$as_me:10259: checking for $cf_ncuhdr_root header in include-path" >&5
10260 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10261 if test "${cf_cv_ncurses_h+set}" = set; then
10262   echo $ECHO_N "(cached) $ECHO_C" >&6
10263 else
10264
10265         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10266         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10267         for cf_header in $cf_header_list
10268         do
10269
10270         cat >"conftest.$ac_ext" <<_ACEOF
10271 #line 10271 "configure"
10272 #include "confdefs.h"
10273
10274 #include <$cf_header>
10275 int
10276 main (void)
10277 {
10278
10279 #ifdef NCURSES_VERSION
10280
10281 printf("%s\\n", NCURSES_VERSION);
10282 #else
10283 #ifdef __NCURSES_H
10284 printf("old\\n");
10285 #else
10286         make an error
10287 #endif
10288 #endif
10289
10290   ;
10291   return 0;
10292 }
10293 _ACEOF
10294 rm -f "conftest.$ac_objext"
10295 if { (eval echo "$as_me:10295: \"$ac_compile\"") >&5
10296   (eval $ac_compile) 2>&5
10297   ac_status=$?
10298   echo "$as_me:10298: \$? = $ac_status" >&5
10299   (exit "$ac_status"); } &&
10300          { ac_try='test -s "conftest.$ac_objext"'
10301   { (eval echo "$as_me:10301: \"$ac_try\"") >&5
10302   (eval $ac_try) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit "$ac_status"); }; }; then
10306   cf_cv_ncurses_h=$cf_header
10307
10308 else
10309   echo "$as_me: failed program was:" >&5
10310 cat "conftest.$ac_ext" >&5
10311 cf_cv_ncurses_h=no
10312 fi
10313 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10314
10315                 test "$cf_cv_ncurses_h" != no && break
10316         done
10317
10318 fi
10319 echo "$as_me:10319: result: $cf_cv_ncurses_h" >&5
10320 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10321
10322 if test "$cf_cv_ncurses_h" != no ; then
10323         cf_cv_ncurses_header=$cf_cv_ncurses_h
10324 else
10325
10326 echo "$as_me:10326: checking for $cf_ncuhdr_root include-path" >&5
10327 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10328 if test "${cf_cv_ncurses_h2+set}" = set; then
10329   echo $ECHO_N "(cached) $ECHO_C" >&6
10330 else
10331
10332         test -n "$verbose" && echo
10333
10334 cf_search=
10335
10336 # collect the current set of include-directories from compiler flags
10337 cf_header_path_list=""
10338 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10339         for cf_header_path in $CPPFLAGS $CFLAGS
10340         do
10341                 case "$cf_header_path" in
10342                 (-I*)
10343                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10344
10345 test "x$cf_header_path" != "xNONE" && \
10346 test -d "$cf_header_path" && \
10347  {
10348         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10349         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10350         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10351         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10352         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10353         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"
10354 }
10355
10356                         cf_header_path_list="$cf_header_path_list $cf_search"
10357                         ;;
10358                 esac
10359         done
10360 fi
10361
10362 # add the variations for the package we are looking for
10363
10364 cf_search=
10365
10366 test "x$prefix" != "xNONE" && \
10367 test -d "$prefix" && \
10368  {
10369         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10370         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10371         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10372         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10373         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10374         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10375 }
10376
10377 for cf_subdir_prefix in \
10378         /usr \
10379         /usr/local \
10380         /usr/pkg \
10381         /opt \
10382         /opt/local \
10383         $HOME
10384 do
10385
10386 test "x$cf_subdir_prefix" != "x$prefix" && \
10387 test -d "$cf_subdir_prefix" && \
10388 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10389         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10390         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10391         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10392         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10393         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10394         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"
10395 }
10396
10397 done
10398
10399 test "$includedir" != NONE && \
10400 test "$includedir" != "/usr/include" && \
10401 test -d "$includedir" && {
10402         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10403         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10404 }
10405
10406 test "$oldincludedir" != NONE && \
10407 test "$oldincludedir" != "/usr/include" && \
10408 test -d "$oldincludedir" && {
10409         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10410         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10411 }
10412
10413 cf_search="$cf_search $cf_header_path_list"
10414
10415         test -n "$verbose" && echo "search path $cf_search"
10416         cf_save2_CPPFLAGS="$CPPFLAGS"
10417         for cf_incdir in $cf_search
10418         do
10419
10420 if test -n "$cf_incdir" ; then
10421   for cf_add_incdir in $cf_incdir
10422   do
10423         while test "$cf_add_incdir" != /usr/include
10424         do
10425           if test -d "$cf_add_incdir"
10426           then
10427                 cf_have_incdir=no
10428                 if test -n "$CFLAGS$CPPFLAGS" ; then
10429                   # a loop is needed to ensure we can add subdirs of existing dirs
10430                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10431                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10432                           cf_have_incdir=yes; break
10433                         fi
10434                   done
10435                 fi
10436
10437                 if test "$cf_have_incdir" = no ; then
10438                   if test "$cf_add_incdir" = /usr/local/include ; then
10439                         if test "$GCC" = yes
10440                         then
10441                           cf_save_CPPFLAGS=$CPPFLAGS
10442
10443         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10444         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10445
10446                           cat >"conftest.$ac_ext" <<_ACEOF
10447 #line 10447 "configure"
10448 #include "confdefs.h"
10449 #include <stdio.h>
10450 int
10451 main (void)
10452 {
10453 printf("Hello")
10454   ;
10455   return 0;
10456 }
10457 _ACEOF
10458 rm -f "conftest.$ac_objext"
10459 if { (eval echo "$as_me:10459: \"$ac_compile\"") >&5
10460   (eval $ac_compile) 2>&5
10461   ac_status=$?
10462   echo "$as_me:10462: \$? = $ac_status" >&5
10463   (exit "$ac_status"); } &&
10464          { ac_try='test -s "conftest.$ac_objext"'
10465   { (eval echo "$as_me:10465: \"$ac_try\"") >&5
10466   (eval $ac_try) 2>&5
10467   ac_status=$?
10468   echo "$as_me:10468: \$? = $ac_status" >&5
10469   (exit "$ac_status"); }; }; then
10470   :
10471 else
10472   echo "$as_me: failed program was:" >&5
10473 cat "conftest.$ac_ext" >&5
10474 cf_have_incdir=yes
10475 fi
10476 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10477                           CPPFLAGS=$cf_save_CPPFLAGS
10478                         fi
10479                   fi
10480                 fi
10481
10482                 if test "$cf_have_incdir" = no ; then
10483                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10484
10485 echo "${as_me:-configure}:10485: testing adding $cf_add_incdir to include-path ..." 1>&5
10486
10487                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10488
10489                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10490                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10491                   cf_add_incdir="$cf_top_incdir"
10492                 else
10493                   break
10494                 fi
10495           else
10496                 break
10497           fi
10498         done
10499   done
10500 fi
10501
10502                 for cf_header in \
10503                         ncurses.h \
10504                         curses.h
10505                 do
10506
10507         cat >"conftest.$ac_ext" <<_ACEOF
10508 #line 10508 "configure"
10509 #include "confdefs.h"
10510
10511 #include <$cf_header>
10512 int
10513 main (void)
10514 {
10515
10516 #ifdef NCURSES_VERSION
10517
10518 printf("%s\\n", NCURSES_VERSION);
10519 #else
10520 #ifdef __NCURSES_H
10521 printf("old\\n");
10522 #else
10523         make an error
10524 #endif
10525 #endif
10526
10527   ;
10528   return 0;
10529 }
10530 _ACEOF
10531 rm -f "conftest.$ac_objext"
10532 if { (eval echo "$as_me:10532: \"$ac_compile\"") >&5
10533   (eval $ac_compile) 2>&5
10534   ac_status=$?
10535   echo "$as_me:10535: \$? = $ac_status" >&5
10536   (exit "$ac_status"); } &&
10537          { ac_try='test -s "conftest.$ac_objext"'
10538   { (eval echo "$as_me:10538: \"$ac_try\"") >&5
10539   (eval $ac_try) 2>&5
10540   ac_status=$?
10541   echo "$as_me:10541: \$? = $ac_status" >&5
10542   (exit "$ac_status"); }; }; then
10543   cf_cv_ncurses_h2=$cf_header
10544
10545 else
10546   echo "$as_me: failed program was:" >&5
10547 cat "conftest.$ac_ext" >&5
10548 cf_cv_ncurses_h2=no
10549 fi
10550 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10551
10552                         if test "$cf_cv_ncurses_h2" != no ; then
10553                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10554                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10555                                 break
10556                         fi
10557                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10558                 done
10559                 CPPFLAGS="$cf_save2_CPPFLAGS"
10560                 test "$cf_cv_ncurses_h2" != no && break
10561         done
10562         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10562: error: not found" >&5
10563 echo "$as_me: error: not found" >&2;}
10564    { (exit 1); exit 1; }; }
10565
10566 fi
10567 echo "$as_me:10567: result: $cf_cv_ncurses_h2" >&5
10568 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10569
10570         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10571         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10572         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10573                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10574         fi
10575
10576 if test -n "$cf_1st_incdir" ; then
10577   for cf_add_incdir in $cf_1st_incdir
10578   do
10579         while test "$cf_add_incdir" != /usr/include
10580         do
10581           if test -d "$cf_add_incdir"
10582           then
10583                 cf_have_incdir=no
10584                 if test -n "$CFLAGS$CPPFLAGS" ; then
10585                   # a loop is needed to ensure we can add subdirs of existing dirs
10586                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10587                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10588                           cf_have_incdir=yes; break
10589                         fi
10590                   done
10591                 fi
10592
10593                 if test "$cf_have_incdir" = no ; then
10594                   if test "$cf_add_incdir" = /usr/local/include ; then
10595                         if test "$GCC" = yes
10596                         then
10597                           cf_save_CPPFLAGS=$CPPFLAGS
10598
10599         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10600         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10601
10602                           cat >"conftest.$ac_ext" <<_ACEOF
10603 #line 10603 "configure"
10604 #include "confdefs.h"
10605 #include <stdio.h>
10606 int
10607 main (void)
10608 {
10609 printf("Hello")
10610   ;
10611   return 0;
10612 }
10613 _ACEOF
10614 rm -f "conftest.$ac_objext"
10615 if { (eval echo "$as_me:10615: \"$ac_compile\"") >&5
10616   (eval $ac_compile) 2>&5
10617   ac_status=$?
10618   echo "$as_me:10618: \$? = $ac_status" >&5
10619   (exit "$ac_status"); } &&
10620          { ac_try='test -s "conftest.$ac_objext"'
10621   { (eval echo "$as_me:10621: \"$ac_try\"") >&5
10622   (eval $ac_try) 2>&5
10623   ac_status=$?
10624   echo "$as_me:10624: \$? = $ac_status" >&5
10625   (exit "$ac_status"); }; }; then
10626   :
10627 else
10628   echo "$as_me: failed program was:" >&5
10629 cat "conftest.$ac_ext" >&5
10630 cf_have_incdir=yes
10631 fi
10632 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10633                           CPPFLAGS=$cf_save_CPPFLAGS
10634                         fi
10635                   fi
10636                 fi
10637
10638                 if test "$cf_have_incdir" = no ; then
10639                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10640
10641 echo "${as_me:-configure}:10641: testing adding $cf_add_incdir to include-path ..." 1>&5
10642
10643                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10644
10645                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10646                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10647                   cf_add_incdir="$cf_top_incdir"
10648                 else
10649                   break
10650                 fi
10651           else
10652                 break
10653           fi
10654         done
10655   done
10656 fi
10657
10658 fi
10659
10660 # Set definitions to allow ifdef'ing for ncurses.h
10661
10662 case "$cf_cv_ncurses_header" in
10663 (*ncurses.h)
10664
10665 cat >>confdefs.h <<\EOF
10666 #define HAVE_NCURSES_H 1
10667 EOF
10668
10669         ;;
10670 esac
10671
10672 case "$cf_cv_ncurses_header" in
10673 (ncurses/curses.h|ncurses/ncurses.h)
10674
10675 cat >>confdefs.h <<\EOF
10676 #define HAVE_NCURSES_NCURSES_H 1
10677 EOF
10678
10679         ;;
10680 (ncursesw/curses.h|ncursesw/ncurses.h)
10681
10682 cat >>confdefs.h <<\EOF
10683 #define HAVE_NCURSESW_NCURSES_H 1
10684 EOF
10685
10686         ;;
10687 esac
10688
10689 echo "$as_me:10689: checking for terminfo header" >&5
10690 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10691 if test "${cf_cv_term_header+set}" = set; then
10692   echo $ECHO_N "(cached) $ECHO_C" >&6
10693 else
10694
10695 case "${cf_cv_ncurses_header}" in
10696 (*/ncurses.h|*/ncursesw.h)
10697         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10698         ;;
10699 (*)
10700         cf_term_header=term.h
10701         ;;
10702 esac
10703
10704 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10705 do
10706 cat >"conftest.$ac_ext" <<_ACEOF
10707 #line 10707 "configure"
10708 #include "confdefs.h"
10709 #include <stdio.h>
10710 #include <${cf_cv_ncurses_header:-curses.h}>
10711 #include <$cf_test>
10712
10713 int
10714 main (void)
10715 {
10716 int x = auto_left_margin; (void)x
10717   ;
10718   return 0;
10719 }
10720 _ACEOF
10721 rm -f "conftest.$ac_objext"
10722 if { (eval echo "$as_me:10722: \"$ac_compile\"") >&5
10723   (eval $ac_compile) 2>&5
10724   ac_status=$?
10725   echo "$as_me:10725: \$? = $ac_status" >&5
10726   (exit "$ac_status"); } &&
10727          { ac_try='test -s "conftest.$ac_objext"'
10728   { (eval echo "$as_me:10728: \"$ac_try\"") >&5
10729   (eval $ac_try) 2>&5
10730   ac_status=$?
10731   echo "$as_me:10731: \$? = $ac_status" >&5
10732   (exit "$ac_status"); }; }; then
10733
10734         cf_cv_term_header="$cf_test"
10735 else
10736   echo "$as_me: failed program was:" >&5
10737 cat "conftest.$ac_ext" >&5
10738
10739         cf_cv_term_header=unknown
10740
10741 fi
10742 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10743         test "$cf_cv_term_header" != unknown && break
10744 done
10745
10746 fi
10747 echo "$as_me:10747: result: $cf_cv_term_header" >&5
10748 echo "${ECHO_T}$cf_cv_term_header" >&6
10749
10750 # Set definitions to allow ifdef'ing to accommodate subdirectories
10751
10752 case "$cf_cv_term_header" in
10753 (*term.h)
10754
10755 cat >>confdefs.h <<\EOF
10756 #define HAVE_TERM_H 1
10757 EOF
10758
10759         ;;
10760 esac
10761
10762 case "$cf_cv_term_header" in
10763 (ncurses/term.h)
10764
10765 cat >>confdefs.h <<\EOF
10766 #define HAVE_NCURSES_TERM_H 1
10767 EOF
10768
10769         ;;
10770 (ncursesw/term.h)
10771
10772 cat >>confdefs.h <<\EOF
10773 #define HAVE_NCURSESW_TERM_H 1
10774 EOF
10775
10776         ;;
10777 esac
10778
10779 # some applications need this, but should check for NCURSES_VERSION
10780
10781 cat >>confdefs.h <<\EOF
10782 #define NCURSES 1
10783 EOF
10784
10785 echo "$as_me:10785: checking for ncurses version" >&5
10786 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10787 if test "${cf_cv_ncurses_version+set}" = set; then
10788   echo $ECHO_N "(cached) $ECHO_C" >&6
10789 else
10790
10791         cf_cv_ncurses_version=no
10792         cf_tempfile=out$$
10793         rm -f "$cf_tempfile"
10794         if test "$cross_compiling" = yes; then
10795
10796         # This will not work if the preprocessor splits the line after the
10797         # Autoconf token.  The 'unproto' program does that.
10798         cat > "conftest.$ac_ext" <<EOF
10799 #include <${cf_cv_ncurses_header:-curses.h}>
10800 #undef Autoconf
10801 #ifdef NCURSES_VERSION
10802 Autoconf NCURSES_VERSION
10803 #else
10804 #ifdef __NCURSES_H
10805 Autoconf "old"
10806 #endif
10807 ;
10808 #endif
10809 EOF
10810         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10811         { (eval echo "$as_me:10811: \"$cf_try\"") >&5
10812   (eval $cf_try) 2>&5
10813   ac_status=$?
10814   echo "$as_me:10814: \$? = $ac_status" >&5
10815   (exit "$ac_status"); }
10816         if test -f conftest.out ; then
10817                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10818                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10819                 rm -f conftest.out
10820         fi
10821
10822 else
10823   cat >"conftest.$ac_ext" <<_ACEOF
10824 #line 10824 "configure"
10825 #include "confdefs.h"
10826
10827 #include <${cf_cv_ncurses_header:-curses.h}>
10828 #include <stdio.h>
10829 int main(void)
10830 {
10831         FILE *fp = fopen("$cf_tempfile", "w");
10832 #ifdef NCURSES_VERSION
10833 # ifdef NCURSES_VERSION_PATCH
10834         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10835 # else
10836         fprintf(fp, "%s\\n", NCURSES_VERSION);
10837 # endif
10838 #else
10839 # ifdef __NCURSES_H
10840         fprintf(fp, "old\\n");
10841 # else
10842         make an error
10843 # endif
10844 #endif
10845         ${cf_cv_main_return:-return}(0);
10846 }
10847 _ACEOF
10848 rm -f "conftest$ac_exeext"
10849 if { (eval echo "$as_me:10849: \"$ac_link\"") >&5
10850   (eval $ac_link) 2>&5
10851   ac_status=$?
10852   echo "$as_me:10852: \$? = $ac_status" >&5
10853   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10854   { (eval echo "$as_me:10854: \"$ac_try\"") >&5
10855   (eval $ac_try) 2>&5
10856   ac_status=$?
10857   echo "$as_me:10857: \$? = $ac_status" >&5
10858   (exit "$ac_status"); }; }; then
10859
10860         cf_cv_ncurses_version=`cat $cf_tempfile`
10861 else
10862   echo "$as_me: program exited with status $ac_status" >&5
10863 echo "$as_me: failed program was:" >&5
10864 cat "conftest.$ac_ext" >&5
10865 fi
10866 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10867 fi
10868         rm -f "$cf_tempfile"
10869
10870 fi
10871 echo "$as_me:10871: result: $cf_cv_ncurses_version" >&5
10872 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10873 test "$cf_cv_ncurses_version" = no ||
10874 cat >>confdefs.h <<\EOF
10875 #define NCURSES 1
10876 EOF
10877
10878 cf_nculib_root=ncurses
10879         # This works, except for the special case where we find gpm, but
10880         # ncurses is in a nonstandard location via $LIBS, and we really want
10881         # to link gpm.
10882 cf_ncurses_LIBS=""
10883 cf_ncurses_SAVE="$LIBS"
10884 echo "$as_me:10884: checking for Gpm_Open in -lgpm" >&5
10885 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10886 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10887   echo $ECHO_N "(cached) $ECHO_C" >&6
10888 else
10889   ac_check_lib_save_LIBS=$LIBS
10890 LIBS="-lgpm  $LIBS"
10891 cat >"conftest.$ac_ext" <<_ACEOF
10892 #line 10892 "configure"
10893 #include "confdefs.h"
10894
10895 /* Override any gcc2 internal prototype to avoid an error.  */
10896 #ifdef __cplusplus
10897 extern "C"
10898 #endif
10899 /* We use char because int might match the return type of a gcc2
10900    builtin and then its argument prototype would still apply.  */
10901 char Gpm_Open ();
10902 int
10903 main (void)
10904 {
10905 Gpm_Open ();
10906   ;
10907   return 0;
10908 }
10909 _ACEOF
10910 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10911 if { (eval echo "$as_me:10911: \"$ac_link\"") >&5
10912   (eval $ac_link) 2>&5
10913   ac_status=$?
10914   echo "$as_me:10914: \$? = $ac_status" >&5
10915   (exit "$ac_status"); } &&
10916          { ac_try='test -s "conftest$ac_exeext"'
10917   { (eval echo "$as_me:10917: \"$ac_try\"") >&5
10918   (eval $ac_try) 2>&5
10919   ac_status=$?
10920   echo "$as_me:10920: \$? = $ac_status" >&5
10921   (exit "$ac_status"); }; }; then
10922   ac_cv_lib_gpm_Gpm_Open=yes
10923 else
10924   echo "$as_me: failed program was:" >&5
10925 cat "conftest.$ac_ext" >&5
10926 ac_cv_lib_gpm_Gpm_Open=no
10927 fi
10928 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10929 LIBS=$ac_check_lib_save_LIBS
10930 fi
10931 echo "$as_me:10931: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10932 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10933 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10934   echo "$as_me:10934: checking for initscr in -lgpm" >&5
10935 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10936 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10937   echo $ECHO_N "(cached) $ECHO_C" >&6
10938 else
10939   ac_check_lib_save_LIBS=$LIBS
10940 LIBS="-lgpm  $LIBS"
10941 cat >"conftest.$ac_ext" <<_ACEOF
10942 #line 10942 "configure"
10943 #include "confdefs.h"
10944
10945 /* Override any gcc2 internal prototype to avoid an error.  */
10946 #ifdef __cplusplus
10947 extern "C"
10948 #endif
10949 /* We use char because int might match the return type of a gcc2
10950    builtin and then its argument prototype would still apply.  */
10951 char initscr ();
10952 int
10953 main (void)
10954 {
10955 initscr ();
10956   ;
10957   return 0;
10958 }
10959 _ACEOF
10960 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10961 if { (eval echo "$as_me:10961: \"$ac_link\"") >&5
10962   (eval $ac_link) 2>&5
10963   ac_status=$?
10964   echo "$as_me:10964: \$? = $ac_status" >&5
10965   (exit "$ac_status"); } &&
10966          { ac_try='test -s "conftest$ac_exeext"'
10967   { (eval echo "$as_me:10967: \"$ac_try\"") >&5
10968   (eval $ac_try) 2>&5
10969   ac_status=$?
10970   echo "$as_me:10970: \$? = $ac_status" >&5
10971   (exit "$ac_status"); }; }; then
10972   ac_cv_lib_gpm_initscr=yes
10973 else
10974   echo "$as_me: failed program was:" >&5
10975 cat "conftest.$ac_ext" >&5
10976 ac_cv_lib_gpm_initscr=no
10977 fi
10978 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10979 LIBS=$ac_check_lib_save_LIBS
10980 fi
10981 echo "$as_me:10981: result: $ac_cv_lib_gpm_initscr" >&5
10982 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10983 if test "$ac_cv_lib_gpm_initscr" = yes; then
10984   LIBS="$cf_ncurses_SAVE"
10985 else
10986   cf_ncurses_LIBS="-lgpm"
10987 fi
10988
10989 fi
10990
10991 case "$host_os" in
10992 (freebsd*)
10993         # This is only necessary if you are linking against an obsolete
10994         # version of ncurses (but it should do no harm, since it is static).
10995         if test "$cf_nculib_root" = ncurses ; then
10996                 echo "$as_me:10996: checking for tgoto in -lmytinfo" >&5
10997 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10998 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10999   echo $ECHO_N "(cached) $ECHO_C" >&6
11000 else
11001   ac_check_lib_save_LIBS=$LIBS
11002 LIBS="-lmytinfo  $LIBS"
11003 cat >"conftest.$ac_ext" <<_ACEOF
11004 #line 11004 "configure"
11005 #include "confdefs.h"
11006
11007 /* Override any gcc2 internal prototype to avoid an error.  */
11008 #ifdef __cplusplus
11009 extern "C"
11010 #endif
11011 /* We use char because int might match the return type of a gcc2
11012    builtin and then its argument prototype would still apply.  */
11013 char tgoto ();
11014 int
11015 main (void)
11016 {
11017 tgoto ();
11018   ;
11019   return 0;
11020 }
11021 _ACEOF
11022 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11023 if { (eval echo "$as_me:11023: \"$ac_link\"") >&5
11024   (eval $ac_link) 2>&5
11025   ac_status=$?
11026   echo "$as_me:11026: \$? = $ac_status" >&5
11027   (exit "$ac_status"); } &&
11028          { ac_try='test -s "conftest$ac_exeext"'
11029   { (eval echo "$as_me:11029: \"$ac_try\"") >&5
11030   (eval $ac_try) 2>&5
11031   ac_status=$?
11032   echo "$as_me:11032: \$? = $ac_status" >&5
11033   (exit "$ac_status"); }; }; then
11034   ac_cv_lib_mytinfo_tgoto=yes
11035 else
11036   echo "$as_me: failed program was:" >&5
11037 cat "conftest.$ac_ext" >&5
11038 ac_cv_lib_mytinfo_tgoto=no
11039 fi
11040 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11041 LIBS=$ac_check_lib_save_LIBS
11042 fi
11043 echo "$as_me:11043: result: $ac_cv_lib_mytinfo_tgoto" >&5
11044 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11045 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11046   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11047 fi
11048
11049         fi
11050         ;;
11051 esac
11052
11053 cf_add_libs="$LIBS"
11054 # reverse order
11055 cf_add_0lib=
11056 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11057 # filter duplicates
11058 for cf_add_1lib in $cf_add_0lib; do
11059         for cf_add_2lib in $cf_add_libs; do
11060                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11061                         cf_add_1lib=
11062                         break
11063                 fi
11064         done
11065         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11066 done
11067 LIBS="$cf_add_libs"
11068
11069 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11070 then
11071
11072 cf_add_libs="$LIBS"
11073 # reverse order
11074 cf_add_0lib=
11075 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11076 # filter duplicates
11077 for cf_add_1lib in $cf_add_0lib; do
11078         for cf_add_2lib in $cf_add_libs; do
11079                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11080                         cf_add_1lib=
11081                         break
11082                 fi
11083         done
11084         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11085 done
11086 LIBS="$cf_add_libs"
11087
11088 else
11089
11090         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11091         cf_libdir=""
11092         echo "$as_me:11092: checking for initscr" >&5
11093 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11094 if test "${ac_cv_func_initscr+set}" = set; then
11095   echo $ECHO_N "(cached) $ECHO_C" >&6
11096 else
11097   cat >"conftest.$ac_ext" <<_ACEOF
11098 #line 11098 "configure"
11099 #include "confdefs.h"
11100 #define initscr autoconf_temporary
11101 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11102 #undef initscr
11103
11104 #ifdef __cplusplus
11105 extern "C"
11106 #endif
11107
11108 /* We use char because int might match the return type of a gcc2
11109    builtin and then its argument prototype would still apply.  */
11110 char initscr (void);
11111
11112 int
11113 main (void)
11114 {
11115
11116 /* The GNU C library defines stubs for functions which it implements
11117     to always fail with ENOSYS.  Some functions are actually named
11118     something starting with __ and the normal name is an alias.  */
11119 #if defined (__stub_initscr) || defined (__stub___initscr)
11120 #error found stub for initscr
11121 #endif
11122
11123         return initscr ();
11124   ;
11125   return 0;
11126 }
11127 _ACEOF
11128 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11129 if { (eval echo "$as_me:11129: \"$ac_link\"") >&5
11130   (eval $ac_link) 2>&5
11131   ac_status=$?
11132   echo "$as_me:11132: \$? = $ac_status" >&5
11133   (exit "$ac_status"); } &&
11134          { ac_try='test -s "conftest$ac_exeext"'
11135   { (eval echo "$as_me:11135: \"$ac_try\"") >&5
11136   (eval $ac_try) 2>&5
11137   ac_status=$?
11138   echo "$as_me:11138: \$? = $ac_status" >&5
11139   (exit "$ac_status"); }; }; then
11140   ac_cv_func_initscr=yes
11141 else
11142   echo "$as_me: failed program was:" >&5
11143 cat "conftest.$ac_ext" >&5
11144 ac_cv_func_initscr=no
11145 fi
11146 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11147 fi
11148 echo "$as_me:11148: result: $ac_cv_func_initscr" >&5
11149 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11150 if test "$ac_cv_func_initscr" = yes; then
11151   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11152 else
11153
11154                 cf_save_LIBS="$LIBS"
11155                 echo "$as_me:11155: checking for initscr in -l$cf_nculib_root" >&5
11156 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11157                 LIBS="-l$cf_nculib_root $LIBS"
11158                 cat >"conftest.$ac_ext" <<_ACEOF
11159 #line 11159 "configure"
11160 #include "confdefs.h"
11161 #include <${cf_cv_ncurses_header:-curses.h}>
11162 int
11163 main (void)
11164 {
11165 initscr()
11166   ;
11167   return 0;
11168 }
11169 _ACEOF
11170 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11171 if { (eval echo "$as_me:11171: \"$ac_link\"") >&5
11172   (eval $ac_link) 2>&5
11173   ac_status=$?
11174   echo "$as_me:11174: \$? = $ac_status" >&5
11175   (exit "$ac_status"); } &&
11176          { ac_try='test -s "conftest$ac_exeext"'
11177   { (eval echo "$as_me:11177: \"$ac_try\"") >&5
11178   (eval $ac_try) 2>&5
11179   ac_status=$?
11180   echo "$as_me:11180: \$? = $ac_status" >&5
11181   (exit "$ac_status"); }; }; then
11182   echo "$as_me:11182: result: yes" >&5
11183 echo "${ECHO_T}yes" >&6
11184                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11185
11186 else
11187   echo "$as_me: failed program was:" >&5
11188 cat "conftest.$ac_ext" >&5
11189 echo "$as_me:11189: result: no" >&5
11190 echo "${ECHO_T}no" >&6
11191
11192 cf_search=
11193 cf_library_path_list=""
11194 if test -n "${LDFLAGS}${LIBS}" ; then
11195         for cf_library_path in $LDFLAGS $LIBS
11196         do
11197                 case "$cf_library_path" in
11198                 (-L*)
11199                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11200
11201 test "x$cf_library_path" != "xNONE" && \
11202 test -d "$cf_library_path" && \
11203  {
11204         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11205         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11206         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11207         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11208         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11209         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"
11210 }
11211
11212                         cf_library_path_list="$cf_library_path_list $cf_search"
11213                         ;;
11214                 esac
11215         done
11216 fi
11217
11218 cf_search=
11219
11220 test "x$prefix" != "xNONE" && \
11221 test -d "$prefix" && \
11222  {
11223         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11224         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11225         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11226         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11227         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11228         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11229 }
11230
11231 for cf_subdir_prefix in \
11232         /usr \
11233         /usr/local \
11234         /usr/pkg \
11235         /opt \
11236         /opt/local \
11237         $HOME
11238 do
11239
11240 test "x$cf_subdir_prefix" != "x$prefix" && \
11241 test -d "$cf_subdir_prefix" && \
11242 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11243         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11244         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11245         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11246         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11247         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11248         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"
11249 }
11250
11251 done
11252
11253 cf_search="$cf_library_path_list $cf_search"
11254
11255                         for cf_libdir in $cf_search
11256                         do
11257                                 echo "$as_me:11257: checking for -l$cf_nculib_root in $cf_libdir" >&5
11258 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11259                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11260                                 cat >"conftest.$ac_ext" <<_ACEOF
11261 #line 11261 "configure"
11262 #include "confdefs.h"
11263 #include <${cf_cv_ncurses_header:-curses.h}>
11264 int
11265 main (void)
11266 {
11267 initscr()
11268   ;
11269   return 0;
11270 }
11271 _ACEOF
11272 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11273 if { (eval echo "$as_me:11273: \"$ac_link\"") >&5
11274   (eval $ac_link) 2>&5
11275   ac_status=$?
11276   echo "$as_me:11276: \$? = $ac_status" >&5
11277   (exit "$ac_status"); } &&
11278          { ac_try='test -s "conftest$ac_exeext"'
11279   { (eval echo "$as_me:11279: \"$ac_try\"") >&5
11280   (eval $ac_try) 2>&5
11281   ac_status=$?
11282   echo "$as_me:11282: \$? = $ac_status" >&5
11283   (exit "$ac_status"); }; }; then
11284   echo "$as_me:11284: result: yes" >&5
11285 echo "${ECHO_T}yes" >&6
11286                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11287                                          break
11288 else
11289   echo "$as_me: failed program was:" >&5
11290 cat "conftest.$ac_ext" >&5
11291 echo "$as_me:11291: result: no" >&5
11292 echo "${ECHO_T}no" >&6
11293                                          LIBS="$cf_save_LIBS"
11294 fi
11295 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11296                         done
11297
11298 fi
11299 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11300
11301 fi
11302
11303 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11304
11305 if test "$cf_found_library" = no ; then
11306         { { echo "$as_me:11306: error: Cannot link $cf_nculib_root library" >&5
11307 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11308    { (exit 1); exit 1; }; }
11309 fi
11310
11311 fi
11312
11313 if test -n "$cf_ncurses_LIBS" ; then
11314         echo "$as_me:11314: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11315 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11316         cf_ncurses_SAVE="$LIBS"
11317         for p in $cf_ncurses_LIBS ; do
11318                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11319                 if test "$q" != "$LIBS" ; then
11320                         LIBS="$q"
11321                 fi
11322         done
11323         cat >"conftest.$ac_ext" <<_ACEOF
11324 #line 11324 "configure"
11325 #include "confdefs.h"
11326 #include <${cf_cv_ncurses_header:-curses.h}>
11327 int
11328 main (void)
11329 {
11330 initscr(); mousemask(0,0); tigetstr((char *)0);
11331   ;
11332   return 0;
11333 }
11334 _ACEOF
11335 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11336 if { (eval echo "$as_me:11336: \"$ac_link\"") >&5
11337   (eval $ac_link) 2>&5
11338   ac_status=$?
11339   echo "$as_me:11339: \$? = $ac_status" >&5
11340   (exit "$ac_status"); } &&
11341          { ac_try='test -s "conftest$ac_exeext"'
11342   { (eval echo "$as_me:11342: \"$ac_try\"") >&5
11343   (eval $ac_try) 2>&5
11344   ac_status=$?
11345   echo "$as_me:11345: \$? = $ac_status" >&5
11346   (exit "$ac_status"); }; }; then
11347   echo "$as_me:11347: result: yes" >&5
11348 echo "${ECHO_T}yes" >&6
11349 else
11350   echo "$as_me: failed program was:" >&5
11351 cat "conftest.$ac_ext" >&5
11352 echo "$as_me:11352: result: no" >&5
11353 echo "${ECHO_T}no" >&6
11354                  LIBS="$cf_ncurses_SAVE"
11355 fi
11356 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11357 fi
11358
11359 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11360
11361 cat >>confdefs.h <<EOF
11362 #define $cf_nculib_ROOT 1
11363 EOF
11364
11365         fi
11366 else
11367         NCURSES_CONFIG=none
11368 fi
11369
11370 fi
11371
11372 if test "$NCURSES_CONFIG_PKG" != none ; then
11373         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11374
11375         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11376         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11377         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11378
11379         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11380         if test -z "$cf_cv_abi_version"
11381         then
11382                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11383         fi
11384
11385 elif test "$NCURSES_CONFIG" != none ; then
11386
11387         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11388
11389         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11390         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11391         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11392
11393         # ABI version is not available from headers
11394         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11395
11396 else
11397
11398         for cf_name in MAJOR MINOR PATCH
11399         do
11400         cat >conftest.$ac_ext <<CF_EOF
11401         #include <${cf_cv_ncurses_header:-curses.h}>
11402         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11403 CF_EOF
11404                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11405                 { (eval echo "$as_me:11405: \"$cf_try\"") >&5
11406   (eval $cf_try) 2>&5
11407   ac_status=$?
11408   echo "$as_me:11408: \$? = $ac_status" >&5
11409   (exit "$ac_status"); }
11410                 if test -f conftest.out ; then
11411                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11412                         eval NCURSES_$cf_name=\"$cf_result\"
11413                         # cat conftest.$ac_ext
11414                         # cat conftest.out
11415                 fi
11416         done
11417
11418         cf_cv_abi_version=${NCURSES_MAJOR}
11419
11420 fi
11421
11422 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11423
11424 cf_cv_timestamp=`date`
11425
11426 echo "$as_me:11426: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11427 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11428
11429 echo "$as_me:11429: checking if you want to have a library-prefix" >&5
11430 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11431
11432 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11433 if test "${with_lib_prefix+set}" = set; then
11434   withval="$with_lib_prefix"
11435   with_lib_prefix=$withval
11436 else
11437   with_lib_prefix=auto
11438 fi;
11439 echo "$as_me:11439: result: $with_lib_prefix" >&5
11440 echo "${ECHO_T}$with_lib_prefix" >&6
11441
11442 if test "$with_lib_prefix" = auto
11443 then
11444
11445         case "$cf_cv_system_name" in
11446         (OS/2*|os2*)
11447                 if test "$DFT_LWR_MODEL" = libtool; then
11448                         LIB_PREFIX='lib'
11449                 else
11450                         LIB_PREFIX=''
11451                 fi
11452                 ;;
11453         (*-msvc*)
11454                 LIB_PREFIX=''
11455                 ;;
11456         (*)     LIB_PREFIX='lib'
11457                 ;;
11458         esac
11459 cf_prefix=$LIB_PREFIX
11460
11461 elif test "$with_lib_prefix" = no
11462 then
11463         LIB_PREFIX=
11464 else
11465         LIB_PREFIX=$with_lib_prefix
11466 fi
11467
11468 LIB_SUFFIX=
11469
11470 ###############################################################################
11471
11472 if test X"$CC_G_OPT" = X"" ; then
11473         CC_G_OPT='-g'
11474         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11475 fi
11476
11477 echo "$as_me:11477: checking for default loader flags" >&5
11478 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11479 case $DFT_LWR_MODEL in
11480 (normal)  LD_MODEL=''   ;;
11481 (debug)   LD_MODEL=$CC_G_OPT ;;
11482 (profile) LD_MODEL='-pg';;
11483 (shared)  LD_MODEL=''   ;;
11484 esac
11485 echo "$as_me:11485: result: $LD_MODEL" >&5
11486 echo "${ECHO_T}$LD_MODEL" >&6
11487
11488 LD_RPATH_OPT=
11489 if test "x$cf_cv_enable_rpath" != xno
11490 then
11491         echo "$as_me:11491: checking for an rpath option" >&5
11492 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11493         case "$cf_cv_system_name" in
11494         (irix*)
11495                 if test "$GCC" = yes; then
11496                         LD_RPATH_OPT="-Wl,-rpath,"
11497                 else
11498                         LD_RPATH_OPT="-rpath "
11499                 fi
11500                 ;;
11501         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11502                 LD_RPATH_OPT="-Wl,-rpath,"
11503                 ;;
11504         (openbsd[2-9].*|mirbsd*)
11505                 LD_RPATH_OPT="-Wl,-rpath,"
11506                 ;;
11507         (dragonfly*)
11508                 LD_RPATH_OPT="-rpath "
11509                 ;;
11510         (netbsd*)
11511                 LD_RPATH_OPT="-Wl,-rpath,"
11512                 ;;
11513         (osf*|mls+*)
11514                 LD_RPATH_OPT="-rpath "
11515                 ;;
11516         (solaris2*)
11517                 LD_RPATH_OPT="-R"
11518                 ;;
11519         (*)
11520                 ;;
11521         esac
11522         echo "$as_me:11522: result: $LD_RPATH_OPT" >&5
11523 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11524
11525         case "x$LD_RPATH_OPT" in
11526         (x-R*)
11527                 echo "$as_me:11527: checking if we need a space after rpath option" >&5
11528 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11529                 cf_save_LIBS="$LIBS"
11530
11531 cf_add_libs="$LIBS"
11532 # reverse order
11533 cf_add_0lib=
11534 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11535 # filter duplicates
11536 for cf_add_1lib in $cf_add_0lib; do
11537         for cf_add_2lib in $cf_add_libs; do
11538                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11539                         cf_add_1lib=
11540                         break
11541                 fi
11542         done
11543         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11544 done
11545 LIBS="$cf_add_libs"
11546
11547                 cat >"conftest.$ac_ext" <<_ACEOF
11548 #line 11548 "configure"
11549 #include "confdefs.h"
11550
11551 int
11552 main (void)
11553 {
11554
11555   ;
11556   return 0;
11557 }
11558 _ACEOF
11559 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11560 if { (eval echo "$as_me:11560: \"$ac_link\"") >&5
11561   (eval $ac_link) 2>&5
11562   ac_status=$?
11563   echo "$as_me:11563: \$? = $ac_status" >&5
11564   (exit "$ac_status"); } &&
11565          { ac_try='test -s "conftest$ac_exeext"'
11566   { (eval echo "$as_me:11566: \"$ac_try\"") >&5
11567   (eval $ac_try) 2>&5
11568   ac_status=$?
11569   echo "$as_me:11569: \$? = $ac_status" >&5
11570   (exit "$ac_status"); }; }; then
11571   cf_rpath_space=no
11572 else
11573   echo "$as_me: failed program was:" >&5
11574 cat "conftest.$ac_ext" >&5
11575 cf_rpath_space=yes
11576 fi
11577 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11578                 LIBS="$cf_save_LIBS"
11579                 echo "$as_me:11579: result: $cf_rpath_space" >&5
11580 echo "${ECHO_T}$cf_rpath_space" >&6
11581                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11582                 ;;
11583         esac
11584 fi
11585
11586         RM_SHARED_OPTS=
11587         LOCAL_LDFLAGS=
11588         LOCAL_LDFLAGS2=
11589         LD_SHARED_OPTS=
11590         INSTALL_LIB="-m 644"
11591         : ${rel_builddir:=.}
11592
11593         shlibdir=$libdir
11594
11595         MAKE_DLLS="#"
11596
11597         cf_cv_do_symlinks=no
11598         cf_ld_rpath_opt=
11599         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11600
11601         echo "$as_me:11601: checking if release/abi version should be used for shared libs" >&5
11602 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11603
11604 # Check whether --with-shlib-version or --without-shlib-version was given.
11605 if test "${with_shlib_version+set}" = set; then
11606   withval="$with_shlib_version"
11607   test -z "$withval" && withval=auto
11608         case "$withval" in
11609         (yes)
11610                 cf_cv_shlib_version=auto
11611                 ;;
11612         (rel|abi|auto)
11613                 cf_cv_shlib_version=$withval
11614                 ;;
11615         (*)
11616                 echo "$as_me:11616: result: $withval" >&5
11617 echo "${ECHO_T}$withval" >&6
11618                 { { echo "$as_me:11618: error: option value must be one of: rel, abi, or auto" >&5
11619 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11620    { (exit 1); exit 1; }; }
11621                 ;;
11622         esac
11623
11624 else
11625   cf_cv_shlib_version=auto
11626 fi;
11627         echo "$as_me:11627: result: $cf_cv_shlib_version" >&5
11628 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11629
11630         cf_cv_rm_so_locs=no
11631         cf_try_cflags=
11632
11633         # Some less-capable ports of gcc support only -fpic
11634         CC_SHARED_OPTS=
11635
11636         cf_try_fPIC=no
11637         if test "$GCC" = yes
11638         then
11639                 cf_try_fPIC=yes
11640         else
11641                 case "$cf_cv_system_name" in
11642                 (*linux*)       # e.g., PGI compiler
11643                         cf_try_fPIC=yes
11644                         ;;
11645                 esac
11646         fi
11647
11648         if test "$cf_try_fPIC" = yes
11649         then
11650                 echo "$as_me:11650: checking which $CC option to use" >&5
11651 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11652                 cf_save_CFLAGS="$CFLAGS"
11653                 for CC_SHARED_OPTS in -fPIC -fpic ''
11654                 do
11655                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11656                         cat >"conftest.$ac_ext" <<_ACEOF
11657 #line 11657 "configure"
11658 #include "confdefs.h"
11659 #include <stdio.h>
11660 int
11661 main (void)
11662 {
11663 int x = 1
11664   ;
11665   return 0;
11666 }
11667 _ACEOF
11668 rm -f "conftest.$ac_objext"
11669 if { (eval echo "$as_me:11669: \"$ac_compile\"") >&5
11670   (eval $ac_compile) 2>&5
11671   ac_status=$?
11672   echo "$as_me:11672: \$? = $ac_status" >&5
11673   (exit "$ac_status"); } &&
11674          { ac_try='test -s "conftest.$ac_objext"'
11675   { (eval echo "$as_me:11675: \"$ac_try\"") >&5
11676   (eval $ac_try) 2>&5
11677   ac_status=$?
11678   echo "$as_me:11678: \$? = $ac_status" >&5
11679   (exit "$ac_status"); }; }; then
11680   break
11681 else
11682   echo "$as_me: failed program was:" >&5
11683 cat "conftest.$ac_ext" >&5
11684 fi
11685 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11686                 done
11687                 echo "$as_me:11687: result: $CC_SHARED_OPTS" >&5
11688 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11689                 CFLAGS="$cf_save_CFLAGS"
11690         fi
11691
11692         cf_cv_shlib_version_infix=no
11693
11694         case "$cf_cv_system_name" in
11695         (aix4.3-9*|aix[5-7]*)
11696                 if test "$GCC" = yes; then
11697                         CC_SHARED_OPTS='-Wl,-brtl'
11698                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11699                 else
11700                         CC_SHARED_OPTS='-brtl'
11701                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11702                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11703                 fi
11704                 ;;
11705         (beos*)
11706                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11707                 ;;
11708         (cygwin*)
11709                 CC_SHARED_OPTS=
11710                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11711                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11712                 cf_cv_shlib_version=cygdll
11713                 cf_cv_shlib_version_infix=cygdll
11714                 shlibdir=$bindir
11715                 MAKE_DLLS=
11716                 cat >mk_shared_lib.sh <<-CF_EOF
11717                 #!$SHELL
11718                 SHARED_LIB=\$1
11719                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11720                 shift
11721                 cat <<-EOF
11722                 Linking shared library
11723                 ** SHARED_LIB \$SHARED_LIB
11724                 ** IMPORT_LIB \$IMPORT_LIB
11725 EOF
11726                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11727 CF_EOF
11728                 chmod +x mk_shared_lib.sh
11729                 ;;
11730         (msys*)
11731                 CC_SHARED_OPTS=
11732                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11733                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11734                 cf_cv_shlib_version=msysdll
11735                 cf_cv_shlib_version_infix=msysdll
11736                 shlibdir=$bindir
11737                 MAKE_DLLS=
11738                 cat >mk_shared_lib.sh <<-CF_EOF
11739                 #!$SHELL
11740                 SHARED_LIB=\$1
11741                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11742                 shift
11743                 cat <<-EOF
11744                 Linking shared library
11745                 ** SHARED_LIB \$SHARED_LIB
11746                 ** IMPORT_LIB \$IMPORT_LIB
11747 EOF
11748                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11749 CF_EOF
11750                 chmod +x mk_shared_lib.sh
11751                 ;;
11752         (darwin*)
11753                 cf_try_cflags="no-cpp-precomp"
11754                 CC_SHARED_OPTS="-dynamic"
11755                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11756                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11757                 cf_cv_shlib_version_infix=yes
11758                 echo "$as_me:11758: checking if ld -search_paths_first works" >&5
11759 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11760 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11761   echo $ECHO_N "(cached) $ECHO_C" >&6
11762 else
11763
11764                         cf_save_LDFLAGS=$LDFLAGS
11765                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11766                         cat >"conftest.$ac_ext" <<_ACEOF
11767 #line 11767 "configure"
11768 #include "confdefs.h"
11769
11770 int
11771 main (void)
11772 {
11773 int i;
11774   ;
11775   return 0;
11776 }
11777 _ACEOF
11778 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11779 if { (eval echo "$as_me:11779: \"$ac_link\"") >&5
11780   (eval $ac_link) 2>&5
11781   ac_status=$?
11782   echo "$as_me:11782: \$? = $ac_status" >&5
11783   (exit "$ac_status"); } &&
11784          { ac_try='test -s "conftest$ac_exeext"'
11785   { (eval echo "$as_me:11785: \"$ac_try\"") >&5
11786   (eval $ac_try) 2>&5
11787   ac_status=$?
11788   echo "$as_me:11788: \$? = $ac_status" >&5
11789   (exit "$ac_status"); }; }; then
11790   cf_cv_ldflags_search_paths_first=yes
11791 else
11792   echo "$as_me: failed program was:" >&5
11793 cat "conftest.$ac_ext" >&5
11794 cf_cv_ldflags_search_paths_first=no
11795 fi
11796 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11797                                 LDFLAGS=$cf_save_LDFLAGS
11798 fi
11799 echo "$as_me:11799: result: $cf_cv_ldflags_search_paths_first" >&5
11800 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11801                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11802                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11803                 fi
11804                 ;;
11805         (haiku*)
11806
11807         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11808         if test "$cf_cv_shlib_version" = rel; then
11809                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11810         else
11811                 cf_cv_shared_soname='`basename $@`'
11812         fi
11813
11814                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11815                 ;;
11816         (hpux[7-8]*)
11817                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11818                 if test "$GCC" != yes; then
11819                         CC_SHARED_OPTS='+Z'
11820                 fi
11821                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11822                 INSTALL_LIB="-m 555"
11823                 ;;
11824         (hpux*)
11825                 # (tested with gcc 2.7.2 -- I don't have c89)
11826                 if test "$GCC" = yes; then
11827                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11828                 else
11829                         CC_SHARED_OPTS='+Z'
11830                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11831                 fi
11832                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11833                 # HP-UX shared libraries must be executable, and should be
11834                 # readonly to exploit a quirk in the memory manager.
11835                 INSTALL_LIB="-m 555"
11836                 ;;
11837         (interix*)
11838                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11839                 if test "$cf_cv_shlib_version" = rel; then
11840                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11841                 else
11842                         cf_shared_soname='`basename $@`'
11843                 fi
11844                 CC_SHARED_OPTS=
11845                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11846                 ;;
11847         (irix*)
11848                 if test "$cf_cv_enable_rpath" = yes ; then
11849                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11850                 fi
11851                 # tested with IRIX 5.2 and 'cc'.
11852                 if test "$GCC" != yes; then
11853                         CC_SHARED_OPTS='-KPIC'
11854                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11855                 else
11856                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11857                 fi
11858                 cf_cv_rm_so_locs=yes
11859                 ;;
11860         (linux*|gnu*|k*bsd*-gnu)
11861                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11862                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11863                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11864                 fi
11865                 if test "$cf_cv_enable_rpath" = yes ; then
11866                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11867                 fi
11868
11869         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11870         if test "$cf_cv_shlib_version" = rel; then
11871                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11872         else
11873                 cf_cv_shared_soname='`basename $@`'
11874         fi
11875
11876                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11877                 ;;
11878         (mingw*msvc*)
11879                 cf_cv_shlib_version=msvcdll
11880                 cf_cv_shlib_version_infix=msvcdll
11881                 shlibdir=$bindir
11882                 MAKE_DLLS=
11883                 if test "$DFT_LWR_MODEL" = "shared" ; then
11884                         LOCAL_LDFLAGS="-link -dll"
11885                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11886                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11887                 fi
11888                 CC_SHARED_OPTS=
11889                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11890                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11891                 cat >mk_shared_lib.sh <<-CF_EOF
11892                 #!$SHELL
11893                 SHARED_LIB=\$1
11894                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11895                 shift
11896                 my_ld=\$1
11897                 shift
11898                 cat <<-EOF
11899                 Linking shared library
11900                 ** SHARED LIB \$SHARED_LIB
11901                 ** IMPORT_LIB \$IMPORT_LIB
11902 EOF
11903                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11904                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11905                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11906 CF_EOF
11907                 chmod +x mk_shared_lib.sh
11908                 cat >mk_prog.sh <<-CF_EOF
11909                 #!$SHELL
11910                 shift
11911                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11912                 LD="$LD"
11913                 clopts=()
11914                 ldopts=("/subsystem:console")
11915                 libs=()
11916                 isdll=0
11917                 while test \$# -gt 0; do
11918                         case "\$1" in
11919                                 -link)
11920                                         # ignore -link argument
11921                                         ;;
11922                                 -M[TD] | -M[TD]d)
11923                                         # ignore runtime-library option
11924                                         ;;
11925                                 -dll)
11926                                         isdll=1
11927                                         ;;
11928                                 -W* | -w*)
11929                                         # ignore warnings
11930                                         ;;
11931                                 -D*)
11932                                         clopts+=("\$1")
11933                                         ;;
11934                                 -I*)
11935                                         clopts+=("\$1")
11936                                         ;;
11937                                 -l*)
11938                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11939                                         ;;
11940                                 -L*)
11941                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11942                                         ;;
11943                                 *.obj | *.o)
11944                                         ldopts+=("\$1")
11945                                         ;;
11946                                 -Wl,*)
11947                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11948                                                 ldopts+=("\${linkarg}")
11949                                         done
11950                                         ;;
11951                                 *.lib)
11952                                         ldopts+=("\$1")
11953                                         ;;
11954                                 -o)
11955                                         shift
11956                                         ldopts+=("-out:\$1")
11957                                         ;;
11958                                 *)
11959                                         clopts+=("\$1")
11960                                         ldopts+=("\$1")
11961                                         ;;
11962                         esac
11963                         shift
11964                 done
11965                 if [ "\$isdll" -ne 0 ]; then
11966                         for lib in \${libs[*]}; do
11967                                 ldopts+=("\$lib.dll.lib")
11968                         done
11969                 else
11970                         for lib in \${libs[*]}; do
11971                                 ldopts+=("\$lib.lib")
11972                         done
11973                 fi
11974                 cat <<-EOF
11975                 Creating program
11976                 ** ld options:   "\${ldopts[@]}"
11977 EOF
11978                 exec \$LD \${ldopts[@]}
11979 CF_EOF
11980                 chmod +x mk_prog.sh
11981                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11982                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11983                 ;;
11984         (mingw*)
11985                 cf_cv_shlib_version=mingw
11986                 cf_cv_shlib_version_infix=mingw
11987                 shlibdir=$bindir
11988                 MAKE_DLLS=
11989                 if test "$DFT_LWR_MODEL" = "shared" ; then
11990                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11991                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11992                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11993                 fi
11994                 CC_SHARED_OPTS=
11995                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11996                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11997                 cat >mk_shared_lib.sh <<-CF_EOF
11998                 #!$SHELL
11999                 SHARED_LIB=\$1
12000                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12001                 shift
12002                 cat <<-EOF
12003                 Linking shared library
12004                 ** SHARED_LIB \$SHARED_LIB
12005                 ** IMPORT_LIB \$IMPORT_LIB
12006 EOF
12007                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12008 CF_EOF
12009                 chmod +x mk_shared_lib.sh
12010                 ;;
12011         (openbsd[2-9].*|mirbsd*)
12012                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12013                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12014                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12015                 fi
12016                 if test "$cf_cv_enable_rpath" = yes ; then
12017                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12018                 fi
12019                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12020
12021         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12022         if test "$cf_cv_shlib_version" = rel; then
12023                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12024         else
12025                 cf_cv_shared_soname='`basename $@`'
12026         fi
12027
12028                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12029                 ;;
12030         (nskJ*)
12031                 CC_SHARED_OPTS=
12032                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12033                 ;;
12034         (nskL*)
12035                 CC_SHARED_OPTS=
12036                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12037                 ;;
12038         (nto-qnx*|openbsd*|freebsd[12].*)
12039                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12040                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12041                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12042                 ;;
12043         (dragonfly*|freebsd*)
12044                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12045                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12046                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12047                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12048                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12049                 fi
12050
12051         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12052         if test "$cf_cv_shlib_version" = rel; then
12053                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12054         else
12055                 cf_cv_shared_soname='`basename $@`'
12056         fi
12057
12058                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12059                 ;;
12060         (netbsd*)
12061                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12062                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12063                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12064                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12065                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12066                         if test "$cf_cv_shlib_version" = auto; then
12067                         if test -f /usr/libexec/ld.elf_so; then
12068                                 cf_cv_shlib_version=abi
12069                         else
12070                                 cf_cv_shlib_version=rel
12071                         fi
12072                         fi
12073
12074         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12075         if test "$cf_cv_shlib_version" = rel; then
12076                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12077         else
12078                 cf_cv_shared_soname='`basename $@`'
12079         fi
12080
12081                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12082                 else
12083                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12084                 fi
12085                 ;;
12086         (osf*|mls+*)
12087                 # tested with OSF/1 V3.2 and 'cc'
12088                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12089                 # link with shared libs).
12090                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12091                 case "$host_os" in
12092                 (osf4*)
12093                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12094                         ;;
12095                 esac
12096                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12097                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12098                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12099                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12100                 fi
12101                 cf_cv_rm_so_locs=yes
12102                 ;;
12103         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12104                 # tested with osr5.0.5
12105                 if test "$GCC" != yes; then
12106                         CC_SHARED_OPTS='-belf -KPIC'
12107                 fi
12108                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12109                 if test "$cf_cv_enable_rpath" = yes ; then
12110                         # only way is to set LD_RUN_PATH but no switch for it
12111                         RUN_PATH=$libdir
12112                 fi
12113                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12114                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12115                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12116                 ;;
12117         (sunos4*)
12118                 # tested with SunOS 4.1.1 and gcc 2.7.0
12119                 if test "$GCC" != yes; then
12120                         CC_SHARED_OPTS='-KPIC'
12121                 fi
12122                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12123                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12124                 ;;
12125         (solaris2*)
12126                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12127                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12128                 if test "$DFT_LWR_MODEL" = "shared" ; then
12129                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12130                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12131                 fi
12132                 if test "$cf_cv_enable_rpath" = yes ; then
12133                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12134                 fi
12135
12136         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12137         if test "$cf_cv_shlib_version" = rel; then
12138                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12139         else
12140                 cf_cv_shared_soname='`basename $@`'
12141         fi
12142
12143                 if test "$GCC" != yes; then
12144                         cf_save_CFLAGS="$CFLAGS"
12145                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12146                         do
12147                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12148                                 cat >"conftest.$ac_ext" <<_ACEOF
12149 #line 12149 "configure"
12150 #include "confdefs.h"
12151 #include <stdio.h>
12152 int
12153 main (void)
12154 {
12155 printf("Hello\\n");
12156   ;
12157   return 0;
12158 }
12159 _ACEOF
12160 rm -f "conftest.$ac_objext"
12161 if { (eval echo "$as_me:12161: \"$ac_compile\"") >&5
12162   (eval $ac_compile) 2>&5
12163   ac_status=$?
12164   echo "$as_me:12164: \$? = $ac_status" >&5
12165   (exit "$ac_status"); } &&
12166          { ac_try='test -s "conftest.$ac_objext"'
12167   { (eval echo "$as_me:12167: \"$ac_try\"") >&5
12168   (eval $ac_try) 2>&5
12169   ac_status=$?
12170   echo "$as_me:12170: \$? = $ac_status" >&5
12171   (exit "$ac_status"); }; }; then
12172   break
12173 else
12174   echo "$as_me: failed program was:" >&5
12175 cat "conftest.$ac_ext" >&5
12176 fi
12177 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12178                         done
12179                         CFLAGS="$cf_save_CFLAGS"
12180                         CC_SHARED_OPTS=$cf_shared_opts
12181                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12182                 else
12183                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12184                 fi
12185                 ;;
12186         (sysv5uw7*|unix_sv*)
12187                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12188                 if test "$GCC" != yes; then
12189                         CC_SHARED_OPTS='-KPIC'
12190                 fi
12191                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12192                 ;;
12193         (*)
12194                 CC_SHARED_OPTS='unknown'
12195                 MK_SHARED_LIB='echo unknown'
12196                 ;;
12197         esac
12198
12199         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12200         case "$cf_cv_shlib_version" in
12201         (rel|abi)
12202                 case "$MK_SHARED_LIB" in
12203                 (*'-o $@')
12204                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12205                         ;;
12206                 (*)
12207                         { echo "$as_me:12207: WARNING: ignored --with-shlib-version" >&5
12208 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12209                         ;;
12210                 esac
12211                 ;;
12212         esac
12213
12214         if test -n "$cf_try_cflags"
12215         then
12216 cat > conftest.$ac_ext <<EOF
12217 #line 12217 "${as_me:-configure}"
12218 #include <stdio.h>
12219 int main(int argc, char *argv[])
12220 {
12221         printf("hello\\n");
12222         return (argv[argc-1] == 0) ;
12223 }
12224 EOF
12225                 cf_save_CFLAGS="$CFLAGS"
12226                 for cf_opt in $cf_try_cflags
12227                 do
12228                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12229                         echo "$as_me:12229: checking if CFLAGS option -$cf_opt works" >&5
12230 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12231                         if { (eval echo "$as_me:12231: \"$ac_compile\"") >&5
12232   (eval $ac_compile) 2>&5
12233   ac_status=$?
12234   echo "$as_me:12234: \$? = $ac_status" >&5
12235   (exit "$ac_status"); }; then
12236                                 echo "$as_me:12236: result: yes" >&5
12237 echo "${ECHO_T}yes" >&6
12238                                 cf_save_CFLAGS="$CFLAGS"
12239                         else
12240                                 echo "$as_me:12240: result: no" >&5
12241 echo "${ECHO_T}no" >&6
12242                         fi
12243                 done
12244                 CFLAGS="$cf_save_CFLAGS"
12245         fi
12246
12247         # RPATH_LIST is a colon-separated list of directories
12248         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12249         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12250
12251         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12252
12253         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12254
12255 echo "${as_me:-configure}:12255: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12256
12257         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12258
12259 echo "${as_me:-configure}:12259: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12260
12261 # The test/sample programs in the original tree link using rpath option.
12262 # Make it optional for packagers.
12263 if test -n "$LOCAL_LDFLAGS"
12264 then
12265         echo "$as_me:12265: checking if you want to link sample programs with rpath option" >&5
12266 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12267
12268 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12269 if test "${enable_rpath_link+set}" = set; then
12270   enableval="$enable_rpath_link"
12271   with_rpath_link=$enableval
12272 else
12273   with_rpath_link=yes
12274 fi;
12275         echo "$as_me:12275: result: $with_rpath_link" >&5
12276 echo "${ECHO_T}$with_rpath_link" >&6
12277         if test "$with_rpath_link" = no
12278         then
12279                 LOCAL_LDFLAGS=
12280                 LOCAL_LDFLAGS2=
12281         fi
12282 fi
12283
12284 ###############################################################################
12285
12286 ###   use option --enable-broken-linker to force on use of broken-linker support
12287
12288 echo "$as_me:12288: checking if you want broken-linker support code" >&5
12289 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12290
12291 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12292 if test "${enable_broken_linker+set}" = set; then
12293   enableval="$enable_broken_linker"
12294   with_broken_linker=$enableval
12295 else
12296   with_broken_linker=no
12297 fi;
12298 echo "$as_me:12298: result: $with_broken_linker" >&5
12299 echo "${ECHO_T}$with_broken_linker" >&6
12300
12301 : "${BROKEN_LINKER:=0}"
12302 if test "x$with_broken_linker" = xyes ; then
12303
12304 cat >>confdefs.h <<\EOF
12305 #define BROKEN_LINKER 1
12306 EOF
12307
12308         BROKEN_LINKER=1
12309 fi
12310
12311 # Check to define _XOPEN_SOURCE "automatically"
12312
12313 echo "$as_me:12313: checking if the POSIX test-macros are already defined" >&5
12314 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12315 if test "${cf_cv_posix_visible+set}" = set; then
12316   echo $ECHO_N "(cached) $ECHO_C" >&6
12317 else
12318
12319 cat >"conftest.$ac_ext" <<_ACEOF
12320 #line 12320 "configure"
12321 #include "confdefs.h"
12322 #include <stdio.h>
12323 int
12324 main (void)
12325 {
12326
12327 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12328         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12329         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12330         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12331 #error conflicting symbols found
12332 #endif
12333
12334   ;
12335   return 0;
12336 }
12337 _ACEOF
12338 rm -f "conftest.$ac_objext"
12339 if { (eval echo "$as_me:12339: \"$ac_compile\"") >&5
12340   (eval $ac_compile) 2>&5
12341   ac_status=$?
12342   echo "$as_me:12342: \$? = $ac_status" >&5
12343   (exit "$ac_status"); } &&
12344          { ac_try='test -s "conftest.$ac_objext"'
12345   { (eval echo "$as_me:12345: \"$ac_try\"") >&5
12346   (eval $ac_try) 2>&5
12347   ac_status=$?
12348   echo "$as_me:12348: \$? = $ac_status" >&5
12349   (exit "$ac_status"); }; }; then
12350   cf_cv_posix_visible=no
12351 else
12352   echo "$as_me: failed program was:" >&5
12353 cat "conftest.$ac_ext" >&5
12354 cf_cv_posix_visible=yes
12355 fi
12356 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12357
12358 fi
12359 echo "$as_me:12359: result: $cf_cv_posix_visible" >&5
12360 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12361
12362 if test "$cf_cv_posix_visible" = no; then
12363
12364 cf_XOPEN_SOURCE=600
12365 cf_POSIX_C_SOURCE=199506L
12366 cf_xopen_source=
12367
12368 case "$host_os" in
12369 (aix[4-7]*)
12370         cf_xopen_source="-D_ALL_SOURCE"
12371         ;;
12372 (msys)
12373         cf_XOPEN_SOURCE=600
12374         ;;
12375 (darwin[0-8].*)
12376         cf_xopen_source="-D_APPLE_C_SOURCE"
12377         ;;
12378 (darwin*)
12379         cf_xopen_source="-D_DARWIN_C_SOURCE"
12380         cf_XOPEN_SOURCE=
12381         ;;
12382 (freebsd*|dragonfly*|midnightbsd*)
12383         # 5.x headers associate
12384         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12385         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12386         cf_POSIX_C_SOURCE=200112L
12387         cf_XOPEN_SOURCE=600
12388         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12389         ;;
12390 (hpux11*)
12391         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12392         ;;
12393 (hpux*)
12394         cf_xopen_source="-D_HPUX_SOURCE"
12395         ;;
12396 (irix[56].*)
12397         cf_xopen_source="-D_SGI_SOURCE"
12398         cf_XOPEN_SOURCE=
12399         ;;
12400 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12401
12402 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12403
12404 echo "$as_me:12404: checking if this is the GNU C library" >&5
12405 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12406 if test "${cf_cv_gnu_library+set}" = set; then
12407   echo $ECHO_N "(cached) $ECHO_C" >&6
12408 else
12409
12410 cat >"conftest.$ac_ext" <<_ACEOF
12411 #line 12411 "configure"
12412 #include "confdefs.h"
12413 #include <sys/types.h>
12414 int
12415 main (void)
12416 {
12417
12418         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12419                 return 0;
12420         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12421                 return 0;
12422         #else
12423         #       error not GNU C library
12424         #endif
12425   ;
12426   return 0;
12427 }
12428 _ACEOF
12429 rm -f "conftest.$ac_objext"
12430 if { (eval echo "$as_me:12430: \"$ac_compile\"") >&5
12431   (eval $ac_compile) 2>&5
12432   ac_status=$?
12433   echo "$as_me:12433: \$? = $ac_status" >&5
12434   (exit "$ac_status"); } &&
12435          { ac_try='test -s "conftest.$ac_objext"'
12436   { (eval echo "$as_me:12436: \"$ac_try\"") >&5
12437   (eval $ac_try) 2>&5
12438   ac_status=$?
12439   echo "$as_me:12439: \$? = $ac_status" >&5
12440   (exit "$ac_status"); }; }; then
12441   cf_cv_gnu_library=yes
12442 else
12443   echo "$as_me: failed program was:" >&5
12444 cat "conftest.$ac_ext" >&5
12445 cf_cv_gnu_library=no
12446 fi
12447 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12448
12449 fi
12450 echo "$as_me:12450: result: $cf_cv_gnu_library" >&5
12451 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12452
12453 if test x$cf_cv_gnu_library = xyes; then
12454
12455         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12456         # was changed to help a little.  newlib incorporated the change about 4
12457         # years later.
12458         echo "$as_me:12458: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12459 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12460 if test "${cf_cv_gnu_library_219+set}" = set; then
12461   echo $ECHO_N "(cached) $ECHO_C" >&6
12462 else
12463
12464                 cf_save="$CPPFLAGS"
12465
12466         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12467         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12468
12469                 cat >"conftest.$ac_ext" <<_ACEOF
12470 #line 12470 "configure"
12471 #include "confdefs.h"
12472 #include <sys/types.h>
12473 int
12474 main (void)
12475 {
12476
12477                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12478                                 return 0;
12479                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12480                                 return 0;
12481                         #else
12482                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12483                         #endif
12484   ;
12485   return 0;
12486 }
12487 _ACEOF
12488 rm -f "conftest.$ac_objext"
12489 if { (eval echo "$as_me:12489: \"$ac_compile\"") >&5
12490   (eval $ac_compile) 2>&5
12491   ac_status=$?
12492   echo "$as_me:12492: \$? = $ac_status" >&5
12493   (exit "$ac_status"); } &&
12494          { ac_try='test -s "conftest.$ac_objext"'
12495   { (eval echo "$as_me:12495: \"$ac_try\"") >&5
12496   (eval $ac_try) 2>&5
12497   ac_status=$?
12498   echo "$as_me:12498: \$? = $ac_status" >&5
12499   (exit "$ac_status"); }; }; then
12500   cf_cv_gnu_library_219=yes
12501 else
12502   echo "$as_me: failed program was:" >&5
12503 cat "conftest.$ac_ext" >&5
12504 cf_cv_gnu_library_219=no
12505 fi
12506 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12507                 CPPFLAGS="$cf_save"
12508
12509 fi
12510 echo "$as_me:12510: result: $cf_cv_gnu_library_219" >&5
12511 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12512
12513         if test "x$cf_cv_gnu_library_219" = xyes; then
12514                 cf_save="$CPPFLAGS"
12515                 echo "$as_me:12515: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12516 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12517 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12518   echo $ECHO_N "(cached) $ECHO_C" >&6
12519 else
12520
12521 cf_fix_cppflags=no
12522 cf_new_cflags=
12523 cf_new_cppflags=
12524 cf_new_extra_cppflags=
12525
12526 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12527 do
12528 case "$cf_fix_cppflags" in
12529 (no)
12530         case "$cf_add_cflags" in
12531         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12532                 case "$cf_add_cflags" in
12533                 (-D*)
12534                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12535
12536                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12537                                 && test -z "${cf_tst_cflags}" \
12538                                 && cf_fix_cppflags=yes
12539
12540                         if test "$cf_fix_cppflags" = yes ; then
12541
12542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12544
12545                                 continue
12546                         elif test "${cf_tst_cflags}" = "\"'" ; then
12547
12548         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12549         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12550
12551                                 continue
12552                         fi
12553                         ;;
12554                 esac
12555                 case "$CPPFLAGS" in
12556                 (*$cf_add_cflags)
12557                         ;;
12558                 (*)
12559                         case "$cf_add_cflags" in
12560                         (-D*)
12561                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12562
12563 CPPFLAGS=`echo "$CPPFLAGS" | \
12564         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12565                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12566
12567                                 ;;
12568                         esac
12569
12570         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12571         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12572
12573                         ;;
12574                 esac
12575                 ;;
12576         (*)
12577
12578         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12579         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12580
12581                 ;;
12582         esac
12583         ;;
12584 (yes)
12585
12586         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12587         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12588
12589         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12590
12591         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12592                 && test -z "${cf_tst_cflags}" \
12593                 && cf_fix_cppflags=no
12594         ;;
12595 esac
12596 done
12597
12598 if test -n "$cf_new_cflags" ; then
12599
12600         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12601         CFLAGS="${CFLAGS}$cf_new_cflags"
12602
12603 fi
12604
12605 if test -n "$cf_new_cppflags" ; then
12606
12607         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12608         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12609
12610 fi
12611
12612 if test -n "$cf_new_extra_cppflags" ; then
12613
12614         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12615         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12616
12617 fi
12618
12619                         cat >"conftest.$ac_ext" <<_ACEOF
12620 #line 12620 "configure"
12621 #include "confdefs.h"
12622
12623                                 #include <limits.h>
12624                                 #include <sys/types.h>
12625
12626 int
12627 main (void)
12628 {
12629
12630                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12631                                         return 0;
12632                                 #else
12633                                 #       error GNU C library is too old
12634                                 #endif
12635   ;
12636   return 0;
12637 }
12638 _ACEOF
12639 rm -f "conftest.$ac_objext"
12640 if { (eval echo "$as_me:12640: \"$ac_compile\"") >&5
12641   (eval $ac_compile) 2>&5
12642   ac_status=$?
12643   echo "$as_me:12643: \$? = $ac_status" >&5
12644   (exit "$ac_status"); } &&
12645          { ac_try='test -s "conftest.$ac_objext"'
12646   { (eval echo "$as_me:12646: \"$ac_try\"") >&5
12647   (eval $ac_try) 2>&5
12648   ac_status=$?
12649   echo "$as_me:12649: \$? = $ac_status" >&5
12650   (exit "$ac_status"); }; }; then
12651   cf_cv_gnu_dftsrc_219=yes
12652 else
12653   echo "$as_me: failed program was:" >&5
12654 cat "conftest.$ac_ext" >&5
12655 cf_cv_gnu_dftsrc_219=no
12656 fi
12657 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12658
12659 fi
12660 echo "$as_me:12660: result: $cf_cv_gnu_dftsrc_219" >&5
12661 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12662                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12663         else
12664                 cf_cv_gnu_dftsrc_219=maybe
12665         fi
12666
12667         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12668
12669                 echo "$as_me:12669: checking if we must define _GNU_SOURCE" >&5
12670 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12671 if test "${cf_cv_gnu_source+set}" = set; then
12672   echo $ECHO_N "(cached) $ECHO_C" >&6
12673 else
12674
12675                 cat >"conftest.$ac_ext" <<_ACEOF
12676 #line 12676 "configure"
12677 #include "confdefs.h"
12678 #include <sys/types.h>
12679 int
12680 main (void)
12681 {
12682
12683                         #ifndef _XOPEN_SOURCE
12684                         #error  expected _XOPEN_SOURCE to be defined
12685                         #endif
12686   ;
12687   return 0;
12688 }
12689 _ACEOF
12690 rm -f "conftest.$ac_objext"
12691 if { (eval echo "$as_me:12691: \"$ac_compile\"") >&5
12692   (eval $ac_compile) 2>&5
12693   ac_status=$?
12694   echo "$as_me:12694: \$? = $ac_status" >&5
12695   (exit "$ac_status"); } &&
12696          { ac_try='test -s "conftest.$ac_objext"'
12697   { (eval echo "$as_me:12697: \"$ac_try\"") >&5
12698   (eval $ac_try) 2>&5
12699   ac_status=$?
12700   echo "$as_me:12700: \$? = $ac_status" >&5
12701   (exit "$ac_status"); }; }; then
12702   cf_cv_gnu_source=no
12703 else
12704   echo "$as_me: failed program was:" >&5
12705 cat "conftest.$ac_ext" >&5
12706 cf_save="$CPPFLAGS"
12707
12708 cf_fix_cppflags=no
12709 cf_new_cflags=
12710 cf_new_cppflags=
12711 cf_new_extra_cppflags=
12712
12713 for cf_add_cflags in -D_GNU_SOURCE
12714 do
12715 case "$cf_fix_cppflags" in
12716 (no)
12717         case "$cf_add_cflags" in
12718         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12719                 case "$cf_add_cflags" in
12720                 (-D*)
12721                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12722
12723                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12724                                 && test -z "${cf_tst_cflags}" \
12725                                 && cf_fix_cppflags=yes
12726
12727                         if test "$cf_fix_cppflags" = yes ; then
12728
12729         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12730         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12731
12732                                 continue
12733                         elif test "${cf_tst_cflags}" = "\"'" ; then
12734
12735         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12736         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12737
12738                                 continue
12739                         fi
12740                         ;;
12741                 esac
12742                 case "$CPPFLAGS" in
12743                 (*$cf_add_cflags)
12744                         ;;
12745                 (*)
12746                         case "$cf_add_cflags" in
12747                         (-D*)
12748                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12749
12750 CPPFLAGS=`echo "$CPPFLAGS" | \
12751         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12752                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12753
12754                                 ;;
12755                         esac
12756
12757         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12758         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12759
12760                         ;;
12761                 esac
12762                 ;;
12763         (*)
12764
12765         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12766         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12767
12768                 ;;
12769         esac
12770         ;;
12771 (yes)
12772
12773         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12774         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12775
12776         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12777
12778         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12779                 && test -z "${cf_tst_cflags}" \
12780                 && cf_fix_cppflags=no
12781         ;;
12782 esac
12783 done
12784
12785 if test -n "$cf_new_cflags" ; then
12786
12787         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12788         CFLAGS="${CFLAGS}$cf_new_cflags"
12789
12790 fi
12791
12792 if test -n "$cf_new_cppflags" ; then
12793
12794         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12795         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12796
12797 fi
12798
12799 if test -n "$cf_new_extra_cppflags" ; then
12800
12801         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12802         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12803
12804 fi
12805
12806                          cat >"conftest.$ac_ext" <<_ACEOF
12807 #line 12807 "configure"
12808 #include "confdefs.h"
12809 #include <sys/types.h>
12810 int
12811 main (void)
12812 {
12813
12814                                 #ifdef _XOPEN_SOURCE
12815                                 #error  expected _XOPEN_SOURCE to be undefined
12816                                 #endif
12817   ;
12818   return 0;
12819 }
12820 _ACEOF
12821 rm -f "conftest.$ac_objext"
12822 if { (eval echo "$as_me:12822: \"$ac_compile\"") >&5
12823   (eval $ac_compile) 2>&5
12824   ac_status=$?
12825   echo "$as_me:12825: \$? = $ac_status" >&5
12826   (exit "$ac_status"); } &&
12827          { ac_try='test -s "conftest.$ac_objext"'
12828   { (eval echo "$as_me:12828: \"$ac_try\"") >&5
12829   (eval $ac_try) 2>&5
12830   ac_status=$?
12831   echo "$as_me:12831: \$? = $ac_status" >&5
12832   (exit "$ac_status"); }; }; then
12833   cf_cv_gnu_source=no
12834 else
12835   echo "$as_me: failed program was:" >&5
12836 cat "conftest.$ac_ext" >&5
12837 cf_cv_gnu_source=yes
12838 fi
12839 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12840                         CPPFLAGS="$cf_save"
12841
12842 fi
12843 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12844
12845 fi
12846 echo "$as_me:12846: result: $cf_cv_gnu_source" >&5
12847 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12848
12849                 if test "$cf_cv_gnu_source" = yes
12850                 then
12851                 echo "$as_me:12851: checking if we should also define _DEFAULT_SOURCE" >&5
12852 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12853 if test "${cf_cv_default_source+set}" = set; then
12854   echo $ECHO_N "(cached) $ECHO_C" >&6
12855 else
12856
12857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12858         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12859
12860                         cat >"conftest.$ac_ext" <<_ACEOF
12861 #line 12861 "configure"
12862 #include "confdefs.h"
12863 #include <sys/types.h>
12864 int
12865 main (void)
12866 {
12867
12868                                 #ifdef _DEFAULT_SOURCE
12869                                 #error  expected _DEFAULT_SOURCE to be undefined
12870                                 #endif
12871   ;
12872   return 0;
12873 }
12874 _ACEOF
12875 rm -f "conftest.$ac_objext"
12876 if { (eval echo "$as_me:12876: \"$ac_compile\"") >&5
12877   (eval $ac_compile) 2>&5
12878   ac_status=$?
12879   echo "$as_me:12879: \$? = $ac_status" >&5
12880   (exit "$ac_status"); } &&
12881          { ac_try='test -s "conftest.$ac_objext"'
12882   { (eval echo "$as_me:12882: \"$ac_try\"") >&5
12883   (eval $ac_try) 2>&5
12884   ac_status=$?
12885   echo "$as_me:12885: \$? = $ac_status" >&5
12886   (exit "$ac_status"); }; }; then
12887   cf_cv_default_source=no
12888 else
12889   echo "$as_me: failed program was:" >&5
12890 cat "conftest.$ac_ext" >&5
12891 cf_cv_default_source=yes
12892 fi
12893 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12894
12895 fi
12896 echo "$as_me:12896: result: $cf_cv_default_source" >&5
12897 echo "${ECHO_T}$cf_cv_default_source" >&6
12898                         if test "$cf_cv_default_source" = yes
12899                         then
12900
12901         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12902         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12903
12904                         fi
12905                 fi
12906         fi
12907
12908 fi
12909
12910         ;;
12911 (minix*)
12912         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12913         ;;
12914 (mirbsd*)
12915         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12916         cf_XOPEN_SOURCE=
12917
12918 if test "$cf_cv_posix_visible" = no; then
12919
12920 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12921
12922 cf_save_CFLAGS="$CFLAGS"
12923 cf_save_CPPFLAGS="$CPPFLAGS"
12924
12925 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12926         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12927                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12928
12929 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12930         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12931                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12932
12933 echo "$as_me:12933: checking if we should define _POSIX_C_SOURCE" >&5
12934 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12935 if test "${cf_cv_posix_c_source+set}" = set; then
12936   echo $ECHO_N "(cached) $ECHO_C" >&6
12937 else
12938
12939 echo "${as_me:-configure}:12939: testing if the symbol is already defined go no further ..." 1>&5
12940
12941         cat >"conftest.$ac_ext" <<_ACEOF
12942 #line 12942 "configure"
12943 #include "confdefs.h"
12944 #include <sys/types.h>
12945 int
12946 main (void)
12947 {
12948
12949 #ifndef _POSIX_C_SOURCE
12950 make an error
12951 #endif
12952   ;
12953   return 0;
12954 }
12955 _ACEOF
12956 rm -f "conftest.$ac_objext"
12957 if { (eval echo "$as_me:12957: \"$ac_compile\"") >&5
12958   (eval $ac_compile) 2>&5
12959   ac_status=$?
12960   echo "$as_me:12960: \$? = $ac_status" >&5
12961   (exit "$ac_status"); } &&
12962          { ac_try='test -s "conftest.$ac_objext"'
12963   { (eval echo "$as_me:12963: \"$ac_try\"") >&5
12964   (eval $ac_try) 2>&5
12965   ac_status=$?
12966   echo "$as_me:12966: \$? = $ac_status" >&5
12967   (exit "$ac_status"); }; }; then
12968   cf_cv_posix_c_source=no
12969 else
12970   echo "$as_me: failed program was:" >&5
12971 cat "conftest.$ac_ext" >&5
12972 cf_want_posix_source=no
12973          case .$cf_POSIX_C_SOURCE in
12974          (.[12]??*)
12975                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12976                 ;;
12977          (.2)
12978                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12979                 cf_want_posix_source=yes
12980                 ;;
12981          (.*)
12982                 cf_want_posix_source=yes
12983                 ;;
12984          esac
12985          if test "$cf_want_posix_source" = yes ; then
12986                 cat >"conftest.$ac_ext" <<_ACEOF
12987 #line 12987 "configure"
12988 #include "confdefs.h"
12989 #include <sys/types.h>
12990 int
12991 main (void)
12992 {
12993
12994 #ifdef _POSIX_SOURCE
12995 make an error
12996 #endif
12997   ;
12998   return 0;
12999 }
13000 _ACEOF
13001 rm -f "conftest.$ac_objext"
13002 if { (eval echo "$as_me:13002: \"$ac_compile\"") >&5
13003   (eval $ac_compile) 2>&5
13004   ac_status=$?
13005   echo "$as_me:13005: \$? = $ac_status" >&5
13006   (exit "$ac_status"); } &&
13007          { ac_try='test -s "conftest.$ac_objext"'
13008   { (eval echo "$as_me:13008: \"$ac_try\"") >&5
13009   (eval $ac_try) 2>&5
13010   ac_status=$?
13011   echo "$as_me:13011: \$? = $ac_status" >&5
13012   (exit "$ac_status"); }; }; then
13013   :
13014 else
13015   echo "$as_me: failed program was:" >&5
13016 cat "conftest.$ac_ext" >&5
13017 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13018 fi
13019 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13020          fi
13021
13022 echo "${as_me:-configure}:13022: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13023
13024          CFLAGS="$cf_trim_CFLAGS"
13025          CPPFLAGS="$cf_trim_CPPFLAGS"
13026
13027         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13028         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13029
13030 echo "${as_me:-configure}:13030: testing if the second compile does not leave our definition intact error ..." 1>&5
13031
13032          cat >"conftest.$ac_ext" <<_ACEOF
13033 #line 13033 "configure"
13034 #include "confdefs.h"
13035 #include <sys/types.h>
13036 int
13037 main (void)
13038 {
13039
13040 #ifndef _POSIX_C_SOURCE
13041 make an error
13042 #endif
13043   ;
13044   return 0;
13045 }
13046 _ACEOF
13047 rm -f "conftest.$ac_objext"
13048 if { (eval echo "$as_me:13048: \"$ac_compile\"") >&5
13049   (eval $ac_compile) 2>&5
13050   ac_status=$?
13051   echo "$as_me:13051: \$? = $ac_status" >&5
13052   (exit "$ac_status"); } &&
13053          { ac_try='test -s "conftest.$ac_objext"'
13054   { (eval echo "$as_me:13054: \"$ac_try\"") >&5
13055   (eval $ac_try) 2>&5
13056   ac_status=$?
13057   echo "$as_me:13057: \$? = $ac_status" >&5
13058   (exit "$ac_status"); }; }; then
13059   :
13060 else
13061   echo "$as_me: failed program was:" >&5
13062 cat "conftest.$ac_ext" >&5
13063 cf_cv_posix_c_source=no
13064 fi
13065 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13066          CFLAGS="$cf_save_CFLAGS"
13067          CPPFLAGS="$cf_save_CPPFLAGS"
13068
13069 fi
13070 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13071
13072 fi
13073 echo "$as_me:13073: result: $cf_cv_posix_c_source" >&5
13074 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13075
13076 if test "$cf_cv_posix_c_source" != no ; then
13077         CFLAGS="$cf_trim_CFLAGS"
13078         CPPFLAGS="$cf_trim_CPPFLAGS"
13079
13080 cf_fix_cppflags=no
13081 cf_new_cflags=
13082 cf_new_cppflags=
13083 cf_new_extra_cppflags=
13084
13085 for cf_add_cflags in $cf_cv_posix_c_source
13086 do
13087 case "$cf_fix_cppflags" in
13088 (no)
13089         case "$cf_add_cflags" in
13090         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13091                 case "$cf_add_cflags" in
13092                 (-D*)
13093                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13094
13095                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13096                                 && test -z "${cf_tst_cflags}" \
13097                                 && cf_fix_cppflags=yes
13098
13099                         if test "$cf_fix_cppflags" = yes ; then
13100
13101         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13102         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13103
13104                                 continue
13105                         elif test "${cf_tst_cflags}" = "\"'" ; then
13106
13107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13109
13110                                 continue
13111                         fi
13112                         ;;
13113                 esac
13114                 case "$CPPFLAGS" in
13115                 (*$cf_add_cflags)
13116                         ;;
13117                 (*)
13118                         case "$cf_add_cflags" in
13119                         (-D*)
13120                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13121
13122 CPPFLAGS=`echo "$CPPFLAGS" | \
13123         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13124                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13125
13126                                 ;;
13127                         esac
13128
13129         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13130         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13131
13132                         ;;
13133                 esac
13134                 ;;
13135         (*)
13136
13137         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13138         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13139
13140                 ;;
13141         esac
13142         ;;
13143 (yes)
13144
13145         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13146         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13147
13148         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13149
13150         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13151                 && test -z "${cf_tst_cflags}" \
13152                 && cf_fix_cppflags=no
13153         ;;
13154 esac
13155 done
13156
13157 if test -n "$cf_new_cflags" ; then
13158
13159         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13160         CFLAGS="${CFLAGS}$cf_new_cflags"
13161
13162 fi
13163
13164 if test -n "$cf_new_cppflags" ; then
13165
13166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13167         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13168
13169 fi
13170
13171 if test -n "$cf_new_extra_cppflags" ; then
13172
13173         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13174         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13175
13176 fi
13177
13178 fi
13179
13180 fi # cf_cv_posix_visible
13181
13182         ;;
13183 (netbsd*)
13184         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13185         ;;
13186 (openbsd[6-9]*)
13187         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13188         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13189         # Abusing the conformance level is a workaround.
13190         { echo "$as_me:13190: WARNING: this system does not provide usable locale support" >&5
13191 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13192         cf_xopen_source="-D_BSD_SOURCE"
13193         cf_XOPEN_SOURCE=700
13194         ;;
13195 (openbsd[4-5]*)
13196         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13197         cf_xopen_source="-D_BSD_SOURCE"
13198         cf_XOPEN_SOURCE=600
13199         ;;
13200 (openbsd*)
13201         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13202         ;;
13203 (osf[45]*)
13204         cf_xopen_source="-D_OSF_SOURCE"
13205         ;;
13206 (nto-qnx*)
13207         cf_xopen_source="-D_QNX_SOURCE"
13208         ;;
13209 (sco*)
13210         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13211         ;;
13212 (solaris2.*)
13213         cf_xopen_source="-D__EXTENSIONS__"
13214         cf_cv_xopen_source=broken
13215         ;;
13216 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13217         cf_XOPEN_SOURCE=
13218         cf_POSIX_C_SOURCE=
13219         ;;
13220 (*)
13221
13222 echo "$as_me:13222: checking if we should define _XOPEN_SOURCE" >&5
13223 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13224 if test "${cf_cv_xopen_source+set}" = set; then
13225   echo $ECHO_N "(cached) $ECHO_C" >&6
13226 else
13227
13228         cat >"conftest.$ac_ext" <<_ACEOF
13229 #line 13229 "configure"
13230 #include "confdefs.h"
13231
13232 #include <stdlib.h>
13233 #include <string.h>
13234 #include <sys/types.h>
13235
13236 int
13237 main (void)
13238 {
13239
13240 #ifndef _XOPEN_SOURCE
13241 make an error
13242 #endif
13243   ;
13244   return 0;
13245 }
13246 _ACEOF
13247 rm -f "conftest.$ac_objext"
13248 if { (eval echo "$as_me:13248: \"$ac_compile\"") >&5
13249   (eval $ac_compile) 2>&5
13250   ac_status=$?
13251   echo "$as_me:13251: \$? = $ac_status" >&5
13252   (exit "$ac_status"); } &&
13253          { ac_try='test -s "conftest.$ac_objext"'
13254   { (eval echo "$as_me:13254: \"$ac_try\"") >&5
13255   (eval $ac_try) 2>&5
13256   ac_status=$?
13257   echo "$as_me:13257: \$? = $ac_status" >&5
13258   (exit "$ac_status"); }; }; then
13259   cf_cv_xopen_source=no
13260 else
13261   echo "$as_me: failed program was:" >&5
13262 cat "conftest.$ac_ext" >&5
13263 cf_save="$CPPFLAGS"
13264
13265         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13266         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13267
13268          cat >"conftest.$ac_ext" <<_ACEOF
13269 #line 13269 "configure"
13270 #include "confdefs.h"
13271
13272 #include <stdlib.h>
13273 #include <string.h>
13274 #include <sys/types.h>
13275
13276 int
13277 main (void)
13278 {
13279
13280 #ifdef _XOPEN_SOURCE
13281 make an error
13282 #endif
13283   ;
13284   return 0;
13285 }
13286 _ACEOF
13287 rm -f "conftest.$ac_objext"
13288 if { (eval echo "$as_me:13288: \"$ac_compile\"") >&5
13289   (eval $ac_compile) 2>&5
13290   ac_status=$?
13291   echo "$as_me:13291: \$? = $ac_status" >&5
13292   (exit "$ac_status"); } &&
13293          { ac_try='test -s "conftest.$ac_objext"'
13294   { (eval echo "$as_me:13294: \"$ac_try\"") >&5
13295   (eval $ac_try) 2>&5
13296   ac_status=$?
13297   echo "$as_me:13297: \$? = $ac_status" >&5
13298   (exit "$ac_status"); }; }; then
13299   cf_cv_xopen_source=no
13300 else
13301   echo "$as_me: failed program was:" >&5
13302 cat "conftest.$ac_ext" >&5
13303 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13304 fi
13305 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13306         CPPFLAGS="$cf_save"
13307
13308 fi
13309 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13310
13311 fi
13312 echo "$as_me:13312: result: $cf_cv_xopen_source" >&5
13313 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13314
13315 if test "$cf_cv_xopen_source" != no ; then
13316
13317 CFLAGS=`echo "$CFLAGS" | \
13318         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13319                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13320
13321 CPPFLAGS=`echo "$CPPFLAGS" | \
13322         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13323                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13324
13325         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13326
13327 for cf_add_cflags in $cf_temp_xopen_source
13328 do
13329         case "x$cf_add_cflags" in
13330         (x-[DU]*)
13331
13332 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13333 while true
13334 do
13335         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'`
13336         test "$CFLAGS" != "$cf_old_cflag" || break
13337
13338         CFLAGS="$cf_old_cflag"
13339 done
13340
13341 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13342 while true
13343 do
13344         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'`
13345         test "$CPPFLAGS" != "$cf_old_cflag" || break
13346
13347         CPPFLAGS="$cf_old_cflag"
13348 done
13349
13350                 ;;
13351         esac
13352
13353 cf_fix_cppflags=no
13354 cf_new_cflags=
13355 cf_new_cppflags=
13356 cf_new_extra_cppflags=
13357
13358 for cf_add_cflags in $cf_add_cflags
13359 do
13360 case "$cf_fix_cppflags" in
13361 (no)
13362         case "$cf_add_cflags" in
13363         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13364                 case "$cf_add_cflags" in
13365                 (-D*)
13366                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13367
13368                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13369                                 && test -z "${cf_tst_cflags}" \
13370                                 && cf_fix_cppflags=yes
13371
13372                         if test "$cf_fix_cppflags" = yes ; then
13373
13374         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13375         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13376
13377                                 continue
13378                         elif test "${cf_tst_cflags}" = "\"'" ; then
13379
13380         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13381         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13382
13383                                 continue
13384                         fi
13385                         ;;
13386                 esac
13387                 case "$CPPFLAGS" in
13388                 (*$cf_add_cflags)
13389                         ;;
13390                 (*)
13391                         case "$cf_add_cflags" in
13392                         (-D*)
13393                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13394
13395 CPPFLAGS=`echo "$CPPFLAGS" | \
13396         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13397                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13398
13399                                 ;;
13400                         esac
13401
13402         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13403         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13404
13405                         ;;
13406                 esac
13407                 ;;
13408         (*)
13409
13410         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13411         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13412
13413                 ;;
13414         esac
13415         ;;
13416 (yes)
13417
13418         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13419         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13420
13421         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13422
13423         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13424                 && test -z "${cf_tst_cflags}" \
13425                 && cf_fix_cppflags=no
13426         ;;
13427 esac
13428 done
13429
13430 if test -n "$cf_new_cflags" ; then
13431
13432         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13433         CFLAGS="${CFLAGS}$cf_new_cflags"
13434
13435 fi
13436
13437 if test -n "$cf_new_cppflags" ; then
13438
13439         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13440         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13441
13442 fi
13443
13444 if test -n "$cf_new_extra_cppflags" ; then
13445
13446         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13447         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13448
13449 fi
13450
13451 done
13452
13453 fi
13454
13455 if test "$cf_cv_posix_visible" = no; then
13456
13457 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13458
13459 cf_save_CFLAGS="$CFLAGS"
13460 cf_save_CPPFLAGS="$CPPFLAGS"
13461
13462 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13463         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13464                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13465
13466 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13467         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13468                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13469
13470 echo "$as_me:13470: checking if we should define _POSIX_C_SOURCE" >&5
13471 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13472 if test "${cf_cv_posix_c_source+set}" = set; then
13473   echo $ECHO_N "(cached) $ECHO_C" >&6
13474 else
13475
13476 echo "${as_me:-configure}:13476: testing if the symbol is already defined go no further ..." 1>&5
13477
13478         cat >"conftest.$ac_ext" <<_ACEOF
13479 #line 13479 "configure"
13480 #include "confdefs.h"
13481 #include <sys/types.h>
13482 int
13483 main (void)
13484 {
13485
13486 #ifndef _POSIX_C_SOURCE
13487 make an error
13488 #endif
13489   ;
13490   return 0;
13491 }
13492 _ACEOF
13493 rm -f "conftest.$ac_objext"
13494 if { (eval echo "$as_me:13494: \"$ac_compile\"") >&5
13495   (eval $ac_compile) 2>&5
13496   ac_status=$?
13497   echo "$as_me:13497: \$? = $ac_status" >&5
13498   (exit "$ac_status"); } &&
13499          { ac_try='test -s "conftest.$ac_objext"'
13500   { (eval echo "$as_me:13500: \"$ac_try\"") >&5
13501   (eval $ac_try) 2>&5
13502   ac_status=$?
13503   echo "$as_me:13503: \$? = $ac_status" >&5
13504   (exit "$ac_status"); }; }; then
13505   cf_cv_posix_c_source=no
13506 else
13507   echo "$as_me: failed program was:" >&5
13508 cat "conftest.$ac_ext" >&5
13509 cf_want_posix_source=no
13510          case .$cf_POSIX_C_SOURCE in
13511          (.[12]??*)
13512                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13513                 ;;
13514          (.2)
13515                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13516                 cf_want_posix_source=yes
13517                 ;;
13518          (.*)
13519                 cf_want_posix_source=yes
13520                 ;;
13521          esac
13522          if test "$cf_want_posix_source" = yes ; then
13523                 cat >"conftest.$ac_ext" <<_ACEOF
13524 #line 13524 "configure"
13525 #include "confdefs.h"
13526 #include <sys/types.h>
13527 int
13528 main (void)
13529 {
13530
13531 #ifdef _POSIX_SOURCE
13532 make an error
13533 #endif
13534   ;
13535   return 0;
13536 }
13537 _ACEOF
13538 rm -f "conftest.$ac_objext"
13539 if { (eval echo "$as_me:13539: \"$ac_compile\"") >&5
13540   (eval $ac_compile) 2>&5
13541   ac_status=$?
13542   echo "$as_me:13542: \$? = $ac_status" >&5
13543   (exit "$ac_status"); } &&
13544          { ac_try='test -s "conftest.$ac_objext"'
13545   { (eval echo "$as_me:13545: \"$ac_try\"") >&5
13546   (eval $ac_try) 2>&5
13547   ac_status=$?
13548   echo "$as_me:13548: \$? = $ac_status" >&5
13549   (exit "$ac_status"); }; }; then
13550   :
13551 else
13552   echo "$as_me: failed program was:" >&5
13553 cat "conftest.$ac_ext" >&5
13554 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13555 fi
13556 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13557          fi
13558
13559 echo "${as_me:-configure}:13559: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13560
13561          CFLAGS="$cf_trim_CFLAGS"
13562          CPPFLAGS="$cf_trim_CPPFLAGS"
13563
13564         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13565         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13566
13567 echo "${as_me:-configure}:13567: testing if the second compile does not leave our definition intact error ..." 1>&5
13568
13569          cat >"conftest.$ac_ext" <<_ACEOF
13570 #line 13570 "configure"
13571 #include "confdefs.h"
13572 #include <sys/types.h>
13573 int
13574 main (void)
13575 {
13576
13577 #ifndef _POSIX_C_SOURCE
13578 make an error
13579 #endif
13580   ;
13581   return 0;
13582 }
13583 _ACEOF
13584 rm -f "conftest.$ac_objext"
13585 if { (eval echo "$as_me:13585: \"$ac_compile\"") >&5
13586   (eval $ac_compile) 2>&5
13587   ac_status=$?
13588   echo "$as_me:13588: \$? = $ac_status" >&5
13589   (exit "$ac_status"); } &&
13590          { ac_try='test -s "conftest.$ac_objext"'
13591   { (eval echo "$as_me:13591: \"$ac_try\"") >&5
13592   (eval $ac_try) 2>&5
13593   ac_status=$?
13594   echo "$as_me:13594: \$? = $ac_status" >&5
13595   (exit "$ac_status"); }; }; then
13596   :
13597 else
13598   echo "$as_me: failed program was:" >&5
13599 cat "conftest.$ac_ext" >&5
13600 cf_cv_posix_c_source=no
13601 fi
13602 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13603          CFLAGS="$cf_save_CFLAGS"
13604          CPPFLAGS="$cf_save_CPPFLAGS"
13605
13606 fi
13607 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13608
13609 fi
13610 echo "$as_me:13610: result: $cf_cv_posix_c_source" >&5
13611 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13612
13613 if test "$cf_cv_posix_c_source" != no ; then
13614         CFLAGS="$cf_trim_CFLAGS"
13615         CPPFLAGS="$cf_trim_CPPFLAGS"
13616
13617 cf_fix_cppflags=no
13618 cf_new_cflags=
13619 cf_new_cppflags=
13620 cf_new_extra_cppflags=
13621
13622 for cf_add_cflags in $cf_cv_posix_c_source
13623 do
13624 case "$cf_fix_cppflags" in
13625 (no)
13626         case "$cf_add_cflags" in
13627         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13628                 case "$cf_add_cflags" in
13629                 (-D*)
13630                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13631
13632                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13633                                 && test -z "${cf_tst_cflags}" \
13634                                 && cf_fix_cppflags=yes
13635
13636                         if test "$cf_fix_cppflags" = yes ; then
13637
13638         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13639         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13640
13641                                 continue
13642                         elif test "${cf_tst_cflags}" = "\"'" ; then
13643
13644         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13645         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13646
13647                                 continue
13648                         fi
13649                         ;;
13650                 esac
13651                 case "$CPPFLAGS" in
13652                 (*$cf_add_cflags)
13653                         ;;
13654                 (*)
13655                         case "$cf_add_cflags" in
13656                         (-D*)
13657                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13658
13659 CPPFLAGS=`echo "$CPPFLAGS" | \
13660         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13661                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13662
13663                                 ;;
13664                         esac
13665
13666         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13667         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13668
13669                         ;;
13670                 esac
13671                 ;;
13672         (*)
13673
13674         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13675         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13676
13677                 ;;
13678         esac
13679         ;;
13680 (yes)
13681
13682         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13683         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13684
13685         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13686
13687         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13688                 && test -z "${cf_tst_cflags}" \
13689                 && cf_fix_cppflags=no
13690         ;;
13691 esac
13692 done
13693
13694 if test -n "$cf_new_cflags" ; then
13695
13696         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13697         CFLAGS="${CFLAGS}$cf_new_cflags"
13698
13699 fi
13700
13701 if test -n "$cf_new_cppflags" ; then
13702
13703         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13704         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13705
13706 fi
13707
13708 if test -n "$cf_new_extra_cppflags" ; then
13709
13710         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13711         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13712
13713 fi
13714
13715 fi
13716
13717 fi # cf_cv_posix_visible
13718
13719         ;;
13720 esac
13721
13722 if test -n "$cf_xopen_source" ; then
13723
13724 for cf_add_cflags in $cf_xopen_source
13725 do
13726         case "x$cf_add_cflags" in
13727         (x-[DU]*)
13728
13729 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13730 while true
13731 do
13732         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'`
13733         test "$CFLAGS" != "$cf_old_cflag" || break
13734         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13735
13736 echo "${as_me:-configure}:13736: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13737
13738         CFLAGS="$cf_old_cflag"
13739 done
13740
13741 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13742 while true
13743 do
13744         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'`
13745         test "$CPPFLAGS" != "$cf_old_cflag" || break
13746         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13747
13748 echo "${as_me:-configure}:13748: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13749
13750         CPPFLAGS="$cf_old_cflag"
13751 done
13752
13753                 ;;
13754         esac
13755
13756 cf_fix_cppflags=no
13757 cf_new_cflags=
13758 cf_new_cppflags=
13759 cf_new_extra_cppflags=
13760
13761 for cf_add_cflags in $cf_add_cflags
13762 do
13763 case "$cf_fix_cppflags" in
13764 (no)
13765         case "$cf_add_cflags" in
13766         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13767                 case "$cf_add_cflags" in
13768                 (-D*)
13769                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13770
13771                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13772                                 && test -z "${cf_tst_cflags}" \
13773                                 && cf_fix_cppflags=yes
13774
13775                         if test "$cf_fix_cppflags" = yes ; then
13776
13777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13779
13780                                 continue
13781                         elif test "${cf_tst_cflags}" = "\"'" ; then
13782
13783         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13784         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13785
13786                                 continue
13787                         fi
13788                         ;;
13789                 esac
13790                 case "$CPPFLAGS" in
13791                 (*$cf_add_cflags)
13792                         ;;
13793                 (*)
13794                         case "$cf_add_cflags" in
13795                         (-D*)
13796                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13797
13798 CPPFLAGS=`echo "$CPPFLAGS" | \
13799         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13800                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13801
13802                                 ;;
13803                         esac
13804
13805         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13806         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13807
13808                         ;;
13809                 esac
13810                 ;;
13811         (*)
13812
13813         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13814         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13815
13816                 ;;
13817         esac
13818         ;;
13819 (yes)
13820
13821         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13822         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13823
13824         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13825
13826         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13827                 && test -z "${cf_tst_cflags}" \
13828                 && cf_fix_cppflags=no
13829         ;;
13830 esac
13831 done
13832
13833 if test -n "$cf_new_cflags" ; then
13834         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13835
13836 echo "${as_me:-configure}:13836: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13837
13838         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13839         CFLAGS="${CFLAGS}$cf_new_cflags"
13840
13841 fi
13842
13843 if test -n "$cf_new_cppflags" ; then
13844         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13845
13846 echo "${as_me:-configure}:13846: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13847
13848         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13849         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13850
13851 fi
13852
13853 if test -n "$cf_new_extra_cppflags" ; then
13854         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13855
13856 echo "${as_me:-configure}:13856: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13857
13858         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13859         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13860
13861 fi
13862
13863 done
13864
13865 fi
13866
13867 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13868         echo "$as_me:13868: checking if _XOPEN_SOURCE really is set" >&5
13869 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13870         cat >"conftest.$ac_ext" <<_ACEOF
13871 #line 13871 "configure"
13872 #include "confdefs.h"
13873 #include <stdlib.h>
13874 int
13875 main (void)
13876 {
13877
13878 #ifndef _XOPEN_SOURCE
13879 make an error
13880 #endif
13881   ;
13882   return 0;
13883 }
13884 _ACEOF
13885 rm -f "conftest.$ac_objext"
13886 if { (eval echo "$as_me:13886: \"$ac_compile\"") >&5
13887   (eval $ac_compile) 2>&5
13888   ac_status=$?
13889   echo "$as_me:13889: \$? = $ac_status" >&5
13890   (exit "$ac_status"); } &&
13891          { ac_try='test -s "conftest.$ac_objext"'
13892   { (eval echo "$as_me:13892: \"$ac_try\"") >&5
13893   (eval $ac_try) 2>&5
13894   ac_status=$?
13895   echo "$as_me:13895: \$? = $ac_status" >&5
13896   (exit "$ac_status"); }; }; then
13897   cf_XOPEN_SOURCE_set=yes
13898 else
13899   echo "$as_me: failed program was:" >&5
13900 cat "conftest.$ac_ext" >&5
13901 cf_XOPEN_SOURCE_set=no
13902 fi
13903 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13904         echo "$as_me:13904: result: $cf_XOPEN_SOURCE_set" >&5
13905 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13906         if test "$cf_XOPEN_SOURCE_set" = yes
13907         then
13908                 cat >"conftest.$ac_ext" <<_ACEOF
13909 #line 13909 "configure"
13910 #include "confdefs.h"
13911 #include <stdlib.h>
13912 int
13913 main (void)
13914 {
13915
13916 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13917 make an error
13918 #endif
13919   ;
13920   return 0;
13921 }
13922 _ACEOF
13923 rm -f "conftest.$ac_objext"
13924 if { (eval echo "$as_me:13924: \"$ac_compile\"") >&5
13925   (eval $ac_compile) 2>&5
13926   ac_status=$?
13927   echo "$as_me:13927: \$? = $ac_status" >&5
13928   (exit "$ac_status"); } &&
13929          { ac_try='test -s "conftest.$ac_objext"'
13930   { (eval echo "$as_me:13930: \"$ac_try\"") >&5
13931   (eval $ac_try) 2>&5
13932   ac_status=$?
13933   echo "$as_me:13933: \$? = $ac_status" >&5
13934   (exit "$ac_status"); }; }; then
13935   cf_XOPEN_SOURCE_set_ok=yes
13936 else
13937   echo "$as_me: failed program was:" >&5
13938 cat "conftest.$ac_ext" >&5
13939 cf_XOPEN_SOURCE_set_ok=no
13940 fi
13941 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13942                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13943                 then
13944                         { echo "$as_me:13944: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13945 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13946                 fi
13947         else
13948
13949 echo "$as_me:13949: checking if we should define _XOPEN_SOURCE" >&5
13950 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13951 if test "${cf_cv_xopen_source+set}" = set; then
13952   echo $ECHO_N "(cached) $ECHO_C" >&6
13953 else
13954
13955         cat >"conftest.$ac_ext" <<_ACEOF
13956 #line 13956 "configure"
13957 #include "confdefs.h"
13958
13959 #include <stdlib.h>
13960 #include <string.h>
13961 #include <sys/types.h>
13962
13963 int
13964 main (void)
13965 {
13966
13967 #ifndef _XOPEN_SOURCE
13968 make an error
13969 #endif
13970   ;
13971   return 0;
13972 }
13973 _ACEOF
13974 rm -f "conftest.$ac_objext"
13975 if { (eval echo "$as_me:13975: \"$ac_compile\"") >&5
13976   (eval $ac_compile) 2>&5
13977   ac_status=$?
13978   echo "$as_me:13978: \$? = $ac_status" >&5
13979   (exit "$ac_status"); } &&
13980          { ac_try='test -s "conftest.$ac_objext"'
13981   { (eval echo "$as_me:13981: \"$ac_try\"") >&5
13982   (eval $ac_try) 2>&5
13983   ac_status=$?
13984   echo "$as_me:13984: \$? = $ac_status" >&5
13985   (exit "$ac_status"); }; }; then
13986   cf_cv_xopen_source=no
13987 else
13988   echo "$as_me: failed program was:" >&5
13989 cat "conftest.$ac_ext" >&5
13990 cf_save="$CPPFLAGS"
13991
13992         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13993         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13994
13995          cat >"conftest.$ac_ext" <<_ACEOF
13996 #line 13996 "configure"
13997 #include "confdefs.h"
13998
13999 #include <stdlib.h>
14000 #include <string.h>
14001 #include <sys/types.h>
14002
14003 int
14004 main (void)
14005 {
14006
14007 #ifdef _XOPEN_SOURCE
14008 make an error
14009 #endif
14010   ;
14011   return 0;
14012 }
14013 _ACEOF
14014 rm -f "conftest.$ac_objext"
14015 if { (eval echo "$as_me:14015: \"$ac_compile\"") >&5
14016   (eval $ac_compile) 2>&5
14017   ac_status=$?
14018   echo "$as_me:14018: \$? = $ac_status" >&5
14019   (exit "$ac_status"); } &&
14020          { ac_try='test -s "conftest.$ac_objext"'
14021   { (eval echo "$as_me:14021: \"$ac_try\"") >&5
14022   (eval $ac_try) 2>&5
14023   ac_status=$?
14024   echo "$as_me:14024: \$? = $ac_status" >&5
14025   (exit "$ac_status"); }; }; then
14026   cf_cv_xopen_source=no
14027 else
14028   echo "$as_me: failed program was:" >&5
14029 cat "conftest.$ac_ext" >&5
14030 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14031 fi
14032 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14033         CPPFLAGS="$cf_save"
14034
14035 fi
14036 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14037
14038 fi
14039 echo "$as_me:14039: result: $cf_cv_xopen_source" >&5
14040 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14041
14042 if test "$cf_cv_xopen_source" != no ; then
14043
14044 CFLAGS=`echo "$CFLAGS" | \
14045         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14046                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14047
14048 CPPFLAGS=`echo "$CPPFLAGS" | \
14049         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14050                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14051
14052         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14053
14054 for cf_add_cflags in $cf_temp_xopen_source
14055 do
14056         case "x$cf_add_cflags" in
14057         (x-[DU]*)
14058
14059 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14060 while true
14061 do
14062         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'`
14063         test "$CFLAGS" != "$cf_old_cflag" || break
14064
14065         CFLAGS="$cf_old_cflag"
14066 done
14067
14068 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14069 while true
14070 do
14071         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'`
14072         test "$CPPFLAGS" != "$cf_old_cflag" || break
14073
14074         CPPFLAGS="$cf_old_cflag"
14075 done
14076
14077                 ;;
14078         esac
14079
14080 cf_fix_cppflags=no
14081 cf_new_cflags=
14082 cf_new_cppflags=
14083 cf_new_extra_cppflags=
14084
14085 for cf_add_cflags in $cf_add_cflags
14086 do
14087 case "$cf_fix_cppflags" in
14088 (no)
14089         case "$cf_add_cflags" in
14090         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14091                 case "$cf_add_cflags" in
14092                 (-D*)
14093                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14094
14095                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14096                                 && test -z "${cf_tst_cflags}" \
14097                                 && cf_fix_cppflags=yes
14098
14099                         if test "$cf_fix_cppflags" = yes ; then
14100
14101         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14102         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14103
14104                                 continue
14105                         elif test "${cf_tst_cflags}" = "\"'" ; then
14106
14107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14109
14110                                 continue
14111                         fi
14112                         ;;
14113                 esac
14114                 case "$CPPFLAGS" in
14115                 (*$cf_add_cflags)
14116                         ;;
14117                 (*)
14118                         case "$cf_add_cflags" in
14119                         (-D*)
14120                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14121
14122 CPPFLAGS=`echo "$CPPFLAGS" | \
14123         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14124                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14125
14126                                 ;;
14127                         esac
14128
14129         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14130         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14131
14132                         ;;
14133                 esac
14134                 ;;
14135         (*)
14136
14137         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14138         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14139
14140                 ;;
14141         esac
14142         ;;
14143 (yes)
14144
14145         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14146         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14147
14148         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14149
14150         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14151                 && test -z "${cf_tst_cflags}" \
14152                 && cf_fix_cppflags=no
14153         ;;
14154 esac
14155 done
14156
14157 if test -n "$cf_new_cflags" ; then
14158
14159         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14160         CFLAGS="${CFLAGS}$cf_new_cflags"
14161
14162 fi
14163
14164 if test -n "$cf_new_cppflags" ; then
14165
14166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14167         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14168
14169 fi
14170
14171 if test -n "$cf_new_extra_cppflags" ; then
14172
14173         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14174         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14175
14176 fi
14177
14178 done
14179
14180 fi
14181
14182         fi
14183 fi
14184 fi # cf_cv_posix_visible
14185
14186 # Check whether --enable-largefile or --disable-largefile was given.
14187 if test "${enable_largefile+set}" = set; then
14188   enableval="$enable_largefile"
14189
14190 fi;
14191 if test "$enable_largefile" != no; then
14192
14193   echo "$as_me:14193: checking for special C compiler options needed for large files" >&5
14194 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14195 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14196   echo $ECHO_N "(cached) $ECHO_C" >&6
14197 else
14198   ac_cv_sys_largefile_CC=no
14199      if test "$GCC" != yes; then
14200        ac_save_CC=$CC
14201        while :; do
14202          # IRIX 6.2 and later do not support large files by default,
14203          # so use the C compiler's -n32 option if that helps.
14204          cat >"conftest.$ac_ext" <<_ACEOF
14205 #line 14205 "configure"
14206 #include "confdefs.h"
14207 #include <sys/types.h>
14208  /* Check that off_t can represent 2**63 - 1 correctly.
14209     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14210     since some C++ compilers masquerading as C compilers
14211     incorrectly reject 9223372036854775807.  */
14212 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14213   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14214                        && LARGE_OFF_T % 2147483647 == 1)
14215                       ? 1 : -1];
14216 int
14217 main (void)
14218 {
14219
14220   ;
14221   return 0;
14222 }
14223 _ACEOF
14224          rm -f "conftest.$ac_objext"
14225 if { (eval echo "$as_me:14225: \"$ac_compile\"") >&5
14226   (eval $ac_compile) 2>&5
14227   ac_status=$?
14228   echo "$as_me:14228: \$? = $ac_status" >&5
14229   (exit "$ac_status"); } &&
14230          { ac_try='test -s "conftest.$ac_objext"'
14231   { (eval echo "$as_me:14231: \"$ac_try\"") >&5
14232   (eval $ac_try) 2>&5
14233   ac_status=$?
14234   echo "$as_me:14234: \$? = $ac_status" >&5
14235   (exit "$ac_status"); }; }; then
14236   break
14237 else
14238   echo "$as_me: failed program was:" >&5
14239 cat "conftest.$ac_ext" >&5
14240 fi
14241 rm -f "conftest.$ac_objext"
14242          CC="$CC -n32"
14243          rm -f "conftest.$ac_objext"
14244 if { (eval echo "$as_me:14244: \"$ac_compile\"") >&5
14245   (eval $ac_compile) 2>&5
14246   ac_status=$?
14247   echo "$as_me:14247: \$? = $ac_status" >&5
14248   (exit "$ac_status"); } &&
14249          { ac_try='test -s "conftest.$ac_objext"'
14250   { (eval echo "$as_me:14250: \"$ac_try\"") >&5
14251   (eval $ac_try) 2>&5
14252   ac_status=$?
14253   echo "$as_me:14253: \$? = $ac_status" >&5
14254   (exit "$ac_status"); }; }; then
14255   ac_cv_sys_largefile_CC=' -n32'; break
14256 else
14257   echo "$as_me: failed program was:" >&5
14258 cat "conftest.$ac_ext" >&5
14259 fi
14260 rm -f "conftest.$ac_objext"
14261          break
14262        done
14263        CC=$ac_save_CC
14264        rm -f "conftest.$ac_ext"
14265     fi
14266 fi
14267 echo "$as_me:14267: result: $ac_cv_sys_largefile_CC" >&5
14268 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14269   if test "$ac_cv_sys_largefile_CC" != no; then
14270     CC=$CC$ac_cv_sys_largefile_CC
14271   fi
14272
14273   echo "$as_me:14273: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14274 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14275 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14276   echo $ECHO_N "(cached) $ECHO_C" >&6
14277 else
14278   while :; do
14279   ac_cv_sys_file_offset_bits=no
14280   cat >"conftest.$ac_ext" <<_ACEOF
14281 #line 14281 "configure"
14282 #include "confdefs.h"
14283 #include <sys/types.h>
14284  /* Check that off_t can represent 2**63 - 1 correctly.
14285     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14286     since some C++ compilers masquerading as C compilers
14287     incorrectly reject 9223372036854775807.  */
14288 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14289   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14290                        && LARGE_OFF_T % 2147483647 == 1)
14291                       ? 1 : -1];
14292 int
14293 main (void)
14294 {
14295
14296   ;
14297   return 0;
14298 }
14299 _ACEOF
14300 rm -f "conftest.$ac_objext"
14301 if { (eval echo "$as_me:14301: \"$ac_compile\"") >&5
14302   (eval $ac_compile) 2>&5
14303   ac_status=$?
14304   echo "$as_me:14304: \$? = $ac_status" >&5
14305   (exit "$ac_status"); } &&
14306          { ac_try='test -s "conftest.$ac_objext"'
14307   { (eval echo "$as_me:14307: \"$ac_try\"") >&5
14308   (eval $ac_try) 2>&5
14309   ac_status=$?
14310   echo "$as_me:14310: \$? = $ac_status" >&5
14311   (exit "$ac_status"); }; }; then
14312   break
14313 else
14314   echo "$as_me: failed program was:" >&5
14315 cat "conftest.$ac_ext" >&5
14316 fi
14317 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14318   cat >"conftest.$ac_ext" <<_ACEOF
14319 #line 14319 "configure"
14320 #include "confdefs.h"
14321 #define _FILE_OFFSET_BITS 64
14322 #include <sys/types.h>
14323  /* Check that off_t can represent 2**63 - 1 correctly.
14324     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14325     since some C++ compilers masquerading as C compilers
14326     incorrectly reject 9223372036854775807.  */
14327 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14328   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14329                        && LARGE_OFF_T % 2147483647 == 1)
14330                       ? 1 : -1];
14331 int
14332 main (void)
14333 {
14334
14335   ;
14336   return 0;
14337 }
14338 _ACEOF
14339 rm -f "conftest.$ac_objext"
14340 if { (eval echo "$as_me:14340: \"$ac_compile\"") >&5
14341   (eval $ac_compile) 2>&5
14342   ac_status=$?
14343   echo "$as_me:14343: \$? = $ac_status" >&5
14344   (exit "$ac_status"); } &&
14345          { ac_try='test -s "conftest.$ac_objext"'
14346   { (eval echo "$as_me:14346: \"$ac_try\"") >&5
14347   (eval $ac_try) 2>&5
14348   ac_status=$?
14349   echo "$as_me:14349: \$? = $ac_status" >&5
14350   (exit "$ac_status"); }; }; then
14351   ac_cv_sys_file_offset_bits=64; break
14352 else
14353   echo "$as_me: failed program was:" >&5
14354 cat "conftest.$ac_ext" >&5
14355 fi
14356 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14357   break
14358 done
14359 fi
14360 echo "$as_me:14360: result: $ac_cv_sys_file_offset_bits" >&5
14361 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14362 if test "$ac_cv_sys_file_offset_bits" != no; then
14363
14364 cat >>confdefs.h <<EOF
14365 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14366 EOF
14367
14368 fi
14369 rm -rf conftest*
14370   echo "$as_me:14370: checking for _LARGE_FILES value needed for large files" >&5
14371 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14372 if test "${ac_cv_sys_large_files+set}" = set; then
14373   echo $ECHO_N "(cached) $ECHO_C" >&6
14374 else
14375   while :; do
14376   ac_cv_sys_large_files=no
14377   cat >"conftest.$ac_ext" <<_ACEOF
14378 #line 14378 "configure"
14379 #include "confdefs.h"
14380 #include <sys/types.h>
14381  /* Check that off_t can represent 2**63 - 1 correctly.
14382     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14383     since some C++ compilers masquerading as C compilers
14384     incorrectly reject 9223372036854775807.  */
14385 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14386   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14387                        && LARGE_OFF_T % 2147483647 == 1)
14388                       ? 1 : -1];
14389 int
14390 main (void)
14391 {
14392
14393   ;
14394   return 0;
14395 }
14396 _ACEOF
14397 rm -f "conftest.$ac_objext"
14398 if { (eval echo "$as_me:14398: \"$ac_compile\"") >&5
14399   (eval $ac_compile) 2>&5
14400   ac_status=$?
14401   echo "$as_me:14401: \$? = $ac_status" >&5
14402   (exit "$ac_status"); } &&
14403          { ac_try='test -s "conftest.$ac_objext"'
14404   { (eval echo "$as_me:14404: \"$ac_try\"") >&5
14405   (eval $ac_try) 2>&5
14406   ac_status=$?
14407   echo "$as_me:14407: \$? = $ac_status" >&5
14408   (exit "$ac_status"); }; }; then
14409   break
14410 else
14411   echo "$as_me: failed program was:" >&5
14412 cat "conftest.$ac_ext" >&5
14413 fi
14414 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14415   cat >"conftest.$ac_ext" <<_ACEOF
14416 #line 14416 "configure"
14417 #include "confdefs.h"
14418 #define _LARGE_FILES 1
14419 #include <sys/types.h>
14420  /* Check that off_t can represent 2**63 - 1 correctly.
14421     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14422     since some C++ compilers masquerading as C compilers
14423     incorrectly reject 9223372036854775807.  */
14424 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14425   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14426                        && LARGE_OFF_T % 2147483647 == 1)
14427                       ? 1 : -1];
14428 int
14429 main (void)
14430 {
14431
14432   ;
14433   return 0;
14434 }
14435 _ACEOF
14436 rm -f "conftest.$ac_objext"
14437 if { (eval echo "$as_me:14437: \"$ac_compile\"") >&5
14438   (eval $ac_compile) 2>&5
14439   ac_status=$?
14440   echo "$as_me:14440: \$? = $ac_status" >&5
14441   (exit "$ac_status"); } &&
14442          { ac_try='test -s "conftest.$ac_objext"'
14443   { (eval echo "$as_me:14443: \"$ac_try\"") >&5
14444   (eval $ac_try) 2>&5
14445   ac_status=$?
14446   echo "$as_me:14446: \$? = $ac_status" >&5
14447   (exit "$ac_status"); }; }; then
14448   ac_cv_sys_large_files=1; break
14449 else
14450   echo "$as_me: failed program was:" >&5
14451 cat "conftest.$ac_ext" >&5
14452 fi
14453 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14454   break
14455 done
14456 fi
14457 echo "$as_me:14457: result: $ac_cv_sys_large_files" >&5
14458 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14459 if test "$ac_cv_sys_large_files" != no; then
14460
14461 cat >>confdefs.h <<EOF
14462 #define _LARGE_FILES $ac_cv_sys_large_files
14463 EOF
14464
14465 fi
14466 rm -rf conftest*
14467 fi
14468
14469         if test "$enable_largefile" != no ; then
14470         echo "$as_me:14470: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14471 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14472 if test "${ac_cv_sys_largefile_source+set}" = set; then
14473   echo $ECHO_N "(cached) $ECHO_C" >&6
14474 else
14475   while :; do
14476   ac_cv_sys_largefile_source=no
14477   cat >"conftest.$ac_ext" <<_ACEOF
14478 #line 14478 "configure"
14479 #include "confdefs.h"
14480 #include <stdio.h>
14481 int
14482 main (void)
14483 {
14484 return !fseeko;
14485   ;
14486   return 0;
14487 }
14488 _ACEOF
14489 rm -f "conftest.$ac_objext"
14490 if { (eval echo "$as_me:14490: \"$ac_compile\"") >&5
14491   (eval $ac_compile) 2>&5
14492   ac_status=$?
14493   echo "$as_me:14493: \$? = $ac_status" >&5
14494   (exit "$ac_status"); } &&
14495          { ac_try='test -s "conftest.$ac_objext"'
14496   { (eval echo "$as_me:14496: \"$ac_try\"") >&5
14497   (eval $ac_try) 2>&5
14498   ac_status=$?
14499   echo "$as_me:14499: \$? = $ac_status" >&5
14500   (exit "$ac_status"); }; }; then
14501   break
14502 else
14503   echo "$as_me: failed program was:" >&5
14504 cat "conftest.$ac_ext" >&5
14505 fi
14506 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14507   cat >"conftest.$ac_ext" <<_ACEOF
14508 #line 14508 "configure"
14509 #include "confdefs.h"
14510 #define _LARGEFILE_SOURCE 1
14511 #include <stdio.h>
14512 int
14513 main (void)
14514 {
14515 return !fseeko;
14516   ;
14517   return 0;
14518 }
14519 _ACEOF
14520 rm -f "conftest.$ac_objext"
14521 if { (eval echo "$as_me:14521: \"$ac_compile\"") >&5
14522   (eval $ac_compile) 2>&5
14523   ac_status=$?
14524   echo "$as_me:14524: \$? = $ac_status" >&5
14525   (exit "$ac_status"); } &&
14526          { ac_try='test -s "conftest.$ac_objext"'
14527   { (eval echo "$as_me:14527: \"$ac_try\"") >&5
14528   (eval $ac_try) 2>&5
14529   ac_status=$?
14530   echo "$as_me:14530: \$? = $ac_status" >&5
14531   (exit "$ac_status"); }; }; then
14532   ac_cv_sys_largefile_source=1; break
14533 else
14534   echo "$as_me: failed program was:" >&5
14535 cat "conftest.$ac_ext" >&5
14536 fi
14537 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14538   break
14539 done
14540 fi
14541 echo "$as_me:14541: result: $ac_cv_sys_largefile_source" >&5
14542 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14543 if test "$ac_cv_sys_largefile_source" != no; then
14544
14545 cat >>confdefs.h <<EOF
14546 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14547 EOF
14548
14549 fi
14550 rm -rf conftest*
14551
14552 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14553 # in glibc 2.1.3, but that breaks too many other things.
14554 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14555 echo "$as_me:14555: checking for fseeko" >&5
14556 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14557 if test "${ac_cv_func_fseeko+set}" = set; then
14558   echo $ECHO_N "(cached) $ECHO_C" >&6
14559 else
14560   cat >"conftest.$ac_ext" <<_ACEOF
14561 #line 14561 "configure"
14562 #include "confdefs.h"
14563 #include <stdio.h>
14564 int
14565 main (void)
14566 {
14567 return fseeko && fseeko (stdin, 0, 0);
14568   ;
14569   return 0;
14570 }
14571 _ACEOF
14572 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14573 if { (eval echo "$as_me:14573: \"$ac_link\"") >&5
14574   (eval $ac_link) 2>&5
14575   ac_status=$?
14576   echo "$as_me:14576: \$? = $ac_status" >&5
14577   (exit "$ac_status"); } &&
14578          { ac_try='test -s "conftest$ac_exeext"'
14579   { (eval echo "$as_me:14579: \"$ac_try\"") >&5
14580   (eval $ac_try) 2>&5
14581   ac_status=$?
14582   echo "$as_me:14582: \$? = $ac_status" >&5
14583   (exit "$ac_status"); }; }; then
14584   ac_cv_func_fseeko=yes
14585 else
14586   echo "$as_me: failed program was:" >&5
14587 cat "conftest.$ac_ext" >&5
14588 ac_cv_func_fseeko=no
14589 fi
14590 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14591 fi
14592 echo "$as_me:14592: result: $ac_cv_func_fseeko" >&5
14593 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14594 if test $ac_cv_func_fseeko = yes; then
14595
14596 cat >>confdefs.h <<\EOF
14597 #define HAVE_FSEEKO 1
14598 EOF
14599
14600 fi
14601
14602         # Normally we would collect these definitions in the config.h,
14603         # but (like _XOPEN_SOURCE), some environments rely on having these
14604         # defined before any of the system headers are included.  Another
14605         # case comes up with C++, e.g., on AIX the compiler compiles the
14606         # header files by themselves before looking at the body files it is
14607         # told to compile.  For ncurses, those header files do not include
14608         # the config.h
14609         if test "$ac_cv_sys_large_files" != no
14610         then
14611
14612         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14613         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14614
14615         fi
14616         if test "$ac_cv_sys_largefile_source" != no
14617         then
14618
14619         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14620         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14621
14622         fi
14623         if test "$ac_cv_sys_file_offset_bits" != no
14624         then
14625
14626         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14627         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14628
14629         fi
14630
14631         echo "$as_me:14631: checking whether to use struct dirent64" >&5
14632 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14633 if test "${cf_cv_struct_dirent64+set}" = set; then
14634   echo $ECHO_N "(cached) $ECHO_C" >&6
14635 else
14636
14637                 cat >"conftest.$ac_ext" <<_ACEOF
14638 #line 14638 "configure"
14639 #include "confdefs.h"
14640
14641 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14642 #include <sys/types.h>
14643 #include <dirent.h>
14644
14645 int
14646 main (void)
14647 {
14648
14649                 /* if transitional largefile support is setup, this is true */
14650                 extern struct dirent64 * readdir(DIR *);
14651                 struct dirent64 *x = readdir((DIR *)0);
14652                 struct dirent *y = readdir((DIR *)0);
14653                 int z = x - y;
14654                 (void)z;
14655
14656   ;
14657   return 0;
14658 }
14659 _ACEOF
14660 rm -f "conftest.$ac_objext"
14661 if { (eval echo "$as_me:14661: \"$ac_compile\"") >&5
14662   (eval $ac_compile) 2>&5
14663   ac_status=$?
14664   echo "$as_me:14664: \$? = $ac_status" >&5
14665   (exit "$ac_status"); } &&
14666          { ac_try='test -s "conftest.$ac_objext"'
14667   { (eval echo "$as_me:14667: \"$ac_try\"") >&5
14668   (eval $ac_try) 2>&5
14669   ac_status=$?
14670   echo "$as_me:14670: \$? = $ac_status" >&5
14671   (exit "$ac_status"); }; }; then
14672   cf_cv_struct_dirent64=yes
14673 else
14674   echo "$as_me: failed program was:" >&5
14675 cat "conftest.$ac_ext" >&5
14676 cf_cv_struct_dirent64=no
14677 fi
14678 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14679
14680 fi
14681 echo "$as_me:14681: result: $cf_cv_struct_dirent64" >&5
14682 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14683         test "$cf_cv_struct_dirent64" = yes &&
14684 cat >>confdefs.h <<\EOF
14685 #define HAVE_STRUCT_DIRENT64 1
14686 EOF
14687
14688         fi
14689
14690 ### Enable compiling-in rcs id's
14691 echo "$as_me:14691: checking if RCS identifiers should be compiled-in" >&5
14692 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14693
14694 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14695 if test "${with_rcs_ids+set}" = set; then
14696   withval="$with_rcs_ids"
14697   with_rcs_ids=$withval
14698 else
14699   with_rcs_ids=no
14700 fi;
14701 echo "$as_me:14701: result: $with_rcs_ids" >&5
14702 echo "${ECHO_T}$with_rcs_ids" >&6
14703 test "$with_rcs_ids" = yes &&
14704 cat >>confdefs.h <<\EOF
14705 #define USE_RCS_IDS 1
14706 EOF
14707
14708 ###############################################################################
14709
14710 ### Note that some functions (such as const) are normally disabled anyway.
14711 echo "$as_me:14711: checking if you want to build with function extensions" >&5
14712 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14713
14714 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14715 if test "${enable_ext_funcs+set}" = set; then
14716   enableval="$enable_ext_funcs"
14717   with_ext_funcs=$enableval
14718 else
14719   with_ext_funcs=yes
14720 fi;
14721 echo "$as_me:14721: result: $with_ext_funcs" >&5
14722 echo "${ECHO_T}$with_ext_funcs" >&6
14723 if test "$with_ext_funcs" = yes ; then
14724         NCURSES_EXT_FUNCS=1
14725
14726 cat >>confdefs.h <<\EOF
14727 #define HAVE_USE_DEFAULT_COLORS 1
14728 EOF
14729
14730 cat >>confdefs.h <<\EOF
14731 #define NCURSES_EXT_FUNCS 1
14732 EOF
14733
14734 else
14735         NCURSES_EXT_FUNCS=0
14736 fi
14737
14738 ###   use option --enable-const to turn on use of const beyond that in XSI.
14739 echo "$as_me:14739: checking for extended use of const keyword" >&5
14740 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14741
14742 # Check whether --enable-const or --disable-const was given.
14743 if test "${enable_const+set}" = set; then
14744   enableval="$enable_const"
14745   with_ext_const=$enableval
14746 else
14747   with_ext_const=no
14748 fi;
14749 echo "$as_me:14749: result: $with_ext_const" >&5
14750 echo "${ECHO_T}$with_ext_const" >&6
14751 NCURSES_CONST='/*nothing*/'
14752 if test "$with_ext_const" = yes ; then
14753         NCURSES_CONST=const
14754 fi
14755
14756 ###############################################################################
14757 # These options are relatively safe to experiment with.
14758
14759 echo "$as_me:14759: checking if you want all development code" >&5
14760 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14761
14762 # Check whether --with-develop or --without-develop was given.
14763 if test "${with_develop+set}" = set; then
14764   withval="$with_develop"
14765   with_develop=$withval
14766 else
14767   with_develop=no
14768 fi;
14769 echo "$as_me:14769: result: $with_develop" >&5
14770 echo "${ECHO_T}$with_develop" >&6
14771
14772 ###############################################################################
14773 # These are just experimental, probably should not be in a package:
14774
14775 # This is still experimental (20080329), but should ultimately be moved to
14776 # the script-block --with-normal, etc.
14777
14778 echo "$as_me:14778: checking if you want to link with the pthread library" >&5
14779 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14780
14781 # Check whether --with-pthread or --without-pthread was given.
14782 if test "${with_pthread+set}" = set; then
14783   withval="$with_pthread"
14784   with_pthread=$withval
14785 else
14786   with_pthread=no
14787 fi;
14788 echo "$as_me:14788: result: $with_pthread" >&5
14789 echo "${ECHO_T}$with_pthread" >&6
14790
14791 if test "$with_pthread" != no ; then
14792         echo "$as_me:14792: checking for pthread.h" >&5
14793 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14794 if test "${ac_cv_header_pthread_h+set}" = set; then
14795   echo $ECHO_N "(cached) $ECHO_C" >&6
14796 else
14797   cat >"conftest.$ac_ext" <<_ACEOF
14798 #line 14798 "configure"
14799 #include "confdefs.h"
14800 #include <pthread.h>
14801 _ACEOF
14802 if { (eval echo "$as_me:14802: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14803   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14804   ac_status=$?
14805   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14806   rm -f conftest.er1
14807   cat conftest.err >&5
14808   echo "$as_me:14808: \$? = $ac_status" >&5
14809   (exit "$ac_status"); } >/dev/null; then
14810   if test -s conftest.err; then
14811     ac_cpp_err=$ac_c_preproc_warn_flag
14812   else
14813     ac_cpp_err=
14814   fi
14815 else
14816   ac_cpp_err=yes
14817 fi
14818 if test -z "$ac_cpp_err"; then
14819   ac_cv_header_pthread_h=yes
14820 else
14821   echo "$as_me: failed program was:" >&5
14822   cat "conftest.$ac_ext" >&5
14823   ac_cv_header_pthread_h=no
14824 fi
14825 rm -f conftest.err "conftest.$ac_ext"
14826 fi
14827 echo "$as_me:14827: result: $ac_cv_header_pthread_h" >&5
14828 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14829 if test "$ac_cv_header_pthread_h" = yes; then
14830
14831 cat >>confdefs.h <<\EOF
14832 #define HAVE_PTHREADS_H 1
14833 EOF
14834
14835         for cf_lib_pthread in pthread c_r
14836         do
14837             echo "$as_me:14837: checking if we can link with the $cf_lib_pthread library" >&5
14838 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14839             cf_save_LIBS="$LIBS"
14840
14841 cf_add_libs="$LIBS"
14842 # reverse order
14843 cf_add_0lib=
14844 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14845 # filter duplicates
14846 for cf_add_1lib in $cf_add_0lib; do
14847         for cf_add_2lib in $cf_add_libs; do
14848                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14849                         cf_add_1lib=
14850                         break
14851                 fi
14852         done
14853         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14854 done
14855 LIBS="$cf_add_libs"
14856
14857             cat >"conftest.$ac_ext" <<_ACEOF
14858 #line 14858 "configure"
14859 #include "confdefs.h"
14860
14861 #include <pthread.h>
14862
14863 int
14864 main (void)
14865 {
14866
14867                 int rc = pthread_create(0,0,0,0);
14868                 int r2 = pthread_mutexattr_settype(0, 0);
14869
14870   ;
14871   return 0;
14872 }
14873 _ACEOF
14874 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14875 if { (eval echo "$as_me:14875: \"$ac_link\"") >&5
14876   (eval $ac_link) 2>&5
14877   ac_status=$?
14878   echo "$as_me:14878: \$? = $ac_status" >&5
14879   (exit "$ac_status"); } &&
14880          { ac_try='test -s "conftest$ac_exeext"'
14881   { (eval echo "$as_me:14881: \"$ac_try\"") >&5
14882   (eval $ac_try) 2>&5
14883   ac_status=$?
14884   echo "$as_me:14884: \$? = $ac_status" >&5
14885   (exit "$ac_status"); }; }; then
14886   with_pthread=yes
14887 else
14888   echo "$as_me: failed program was:" >&5
14889 cat "conftest.$ac_ext" >&5
14890 with_pthread=no
14891 fi
14892 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14893             LIBS="$cf_save_LIBS"
14894             echo "$as_me:14894: result: $with_pthread" >&5
14895 echo "${ECHO_T}$with_pthread" >&6
14896             test "$with_pthread" = yes && break
14897         done
14898
14899         if test "$with_pthread" = yes ; then
14900
14901 cf_add_libs="$LIBS"
14902 # reverse order
14903 cf_add_0lib=
14904 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14905 # filter duplicates
14906 for cf_add_1lib in $cf_add_0lib; do
14907         for cf_add_2lib in $cf_add_libs; do
14908                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14909                         cf_add_1lib=
14910                         break
14911                 fi
14912         done
14913         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14914 done
14915 LIBS="$cf_add_libs"
14916
14917 cat >>confdefs.h <<\EOF
14918 #define HAVE_LIBPTHREADS 1
14919 EOF
14920
14921         else
14922             { { echo "$as_me:14922: error: Cannot link with pthread library" >&5
14923 echo "$as_me: error: Cannot link with pthread library" >&2;}
14924    { (exit 1); exit 1; }; }
14925         fi
14926
14927 fi
14928
14929 fi
14930
14931 echo "$as_me:14931: checking if you want to use weak-symbols for pthreads" >&5
14932 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14933
14934 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14935 if test "${enable_weak_symbols+set}" = set; then
14936   enableval="$enable_weak_symbols"
14937   use_weak_symbols=$withval
14938 else
14939   use_weak_symbols=no
14940 fi;
14941 echo "$as_me:14941: result: $use_weak_symbols" >&5
14942 echo "${ECHO_T}$use_weak_symbols" >&6
14943 if test "$use_weak_symbols" = yes ; then
14944
14945 echo "$as_me:14945: checking if $CC supports weak symbols" >&5
14946 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14947 if test "${cf_cv_weak_symbols+set}" = set; then
14948   echo $ECHO_N "(cached) $ECHO_C" >&6
14949 else
14950
14951 cat >"conftest.$ac_ext" <<_ACEOF
14952 #line 14952 "configure"
14953 #include "confdefs.h"
14954
14955 #include <stdio.h>
14956 int
14957 main (void)
14958 {
14959
14960 #if defined(__GNUC__)
14961 #  if defined __USE_ISOC99
14962 #    define _cat_pragma(exp)    _Pragma(#exp)
14963 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14964 #  else
14965 #    define _weak_pragma(exp)
14966 #  endif
14967 #  define _declare(name)        __extension__ extern __typeof__(name) name
14968 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14969 #endif
14970
14971 weak_symbol(fopen);
14972
14973   ;
14974   return 0;
14975 }
14976 _ACEOF
14977 rm -f "conftest.$ac_objext"
14978 if { (eval echo "$as_me:14978: \"$ac_compile\"") >&5
14979   (eval $ac_compile) 2>&5
14980   ac_status=$?
14981   echo "$as_me:14981: \$? = $ac_status" >&5
14982   (exit "$ac_status"); } &&
14983          { ac_try='test -s "conftest.$ac_objext"'
14984   { (eval echo "$as_me:14984: \"$ac_try\"") >&5
14985   (eval $ac_try) 2>&5
14986   ac_status=$?
14987   echo "$as_me:14987: \$? = $ac_status" >&5
14988   (exit "$ac_status"); }; }; then
14989   cf_cv_weak_symbols=yes
14990 else
14991   echo "$as_me: failed program was:" >&5
14992 cat "conftest.$ac_ext" >&5
14993 cf_cv_weak_symbols=no
14994 fi
14995 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14996
14997 fi
14998 echo "$as_me:14998: result: $cf_cv_weak_symbols" >&5
14999 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15000
15001 else
15002         cf_cv_weak_symbols=no
15003 fi
15004
15005 if test $cf_cv_weak_symbols = yes ; then
15006
15007 cat >>confdefs.h <<\EOF
15008 #define USE_WEAK_SYMBOLS 1
15009 EOF
15010
15011 fi
15012
15013 PTHREAD=
15014 if test "$with_pthread" = "yes" ; then
15015
15016 cat >>confdefs.h <<\EOF
15017 #define USE_PTHREADS 1
15018 EOF
15019
15020         enable_reentrant=yes
15021         if test $cf_cv_weak_symbols = yes ; then
15022                 PTHREAD=-lpthread
15023         fi
15024 fi
15025
15026 # OpenSUSE is installing ncurses6, using reentrant option.
15027 echo "$as_me:15027: checking for _nc_TABSIZE" >&5
15028 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15029 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15030   echo $ECHO_N "(cached) $ECHO_C" >&6
15031 else
15032   cat >"conftest.$ac_ext" <<_ACEOF
15033 #line 15033 "configure"
15034 #include "confdefs.h"
15035 #define _nc_TABSIZE autoconf_temporary
15036 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15037 #undef _nc_TABSIZE
15038
15039 #ifdef __cplusplus
15040 extern "C"
15041 #endif
15042
15043 /* We use char because int might match the return type of a gcc2
15044    builtin and then its argument prototype would still apply.  */
15045 char _nc_TABSIZE (void);
15046
15047 int
15048 main (void)
15049 {
15050
15051 /* The GNU C library defines stubs for functions which it implements
15052     to always fail with ENOSYS.  Some functions are actually named
15053     something starting with __ and the normal name is an alias.  */
15054 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15055 #error found stub for _nc_TABSIZE
15056 #endif
15057
15058         return _nc_TABSIZE ();
15059   ;
15060   return 0;
15061 }
15062 _ACEOF
15063 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15064 if { (eval echo "$as_me:15064: \"$ac_link\"") >&5
15065   (eval $ac_link) 2>&5
15066   ac_status=$?
15067   echo "$as_me:15067: \$? = $ac_status" >&5
15068   (exit "$ac_status"); } &&
15069          { ac_try='test -s "conftest$ac_exeext"'
15070   { (eval echo "$as_me:15070: \"$ac_try\"") >&5
15071   (eval $ac_try) 2>&5
15072   ac_status=$?
15073   echo "$as_me:15073: \$? = $ac_status" >&5
15074   (exit "$ac_status"); }; }; then
15075   ac_cv_func__nc_TABSIZE=yes
15076 else
15077   echo "$as_me: failed program was:" >&5
15078 cat "conftest.$ac_ext" >&5
15079 ac_cv_func__nc_TABSIZE=no
15080 fi
15081 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15082 fi
15083 echo "$as_me:15083: result: $ac_cv_func__nc_TABSIZE" >&5
15084 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15085 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15086   assume_reentrant=yes
15087 else
15088   assume_reentrant=no
15089 fi
15090
15091 # Reentrant code has to be opaque; there's little advantage to making ncurses
15092 # opaque outside of that, so there is no --enable-opaque option.  We can use
15093 # this option without --with-pthreads, but this will be always set for
15094 # pthreads.
15095 echo "$as_me:15095: checking if you want experimental reentrant code" >&5
15096 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15097
15098 # Check whether --enable-reentrant or --disable-reentrant was given.
15099 if test "${enable_reentrant+set}" = set; then
15100   enableval="$enable_reentrant"
15101   with_reentrant=$enableval
15102 else
15103   with_reentrant=$assume_reentrant
15104 fi;
15105 echo "$as_me:15105: result: $with_reentrant" >&5
15106 echo "${ECHO_T}$with_reentrant" >&6
15107 if test "$with_reentrant" = yes ; then
15108         cf_cv_enable_reentrant=1
15109         if test $cf_cv_weak_symbols = yes ; then
15110
15111 # remove pthread library from $LIBS
15112 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15113
15114         elif test "$assume_reentrant" = no ; then
15115                 LIB_SUFFIX="t${LIB_SUFFIX}"
15116         fi
15117
15118 cat >>confdefs.h <<\EOF
15119 #define USE_REENTRANT 1
15120 EOF
15121
15122 else
15123         cf_cv_enable_reentrant=0
15124 fi
15125
15126 ### Allow using a different wrap-prefix
15127 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15128         echo "$as_me:15128: checking for prefix used to wrap public variables" >&5
15129 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15130
15131 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15132 if test "${with_wrap_prefix+set}" = set; then
15133   withval="$with_wrap_prefix"
15134   NCURSES_WRAP_PREFIX=$withval
15135 else
15136   NCURSES_WRAP_PREFIX=_nc_
15137 fi;
15138         echo "$as_me:15138: result: $NCURSES_WRAP_PREFIX" >&5
15139 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15140 else
15141         NCURSES_WRAP_PREFIX=_nc_
15142 fi
15143
15144 cat >>confdefs.h <<EOF
15145 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15146 EOF
15147
15148 ###############################################################################
15149
15150 ###     use option --disable-echo to suppress full display compiling commands
15151
15152 echo "$as_me:15152: checking if you want to see long compiling messages" >&5
15153 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15154
15155 # Check whether --enable-echo or --disable-echo was given.
15156 if test "${enable_echo+set}" = set; then
15157   enableval="$enable_echo"
15158   test "$enableval" != no && enableval=yes
15159         if test "$enableval" != "yes" ; then
15160
15161         ECHO_LT='--silent'
15162         ECHO_LD='@echo linking $@;'
15163         RULE_CC='@echo compiling $<'
15164         SHOW_CC='@echo compiling $@'
15165         ECHO_CC='@'
15166
15167         else
15168
15169         ECHO_LT=''
15170         ECHO_LD=''
15171         RULE_CC=''
15172         SHOW_CC=''
15173         ECHO_CC=''
15174
15175         fi
15176 else
15177   enableval=yes
15178
15179         ECHO_LT=''
15180         ECHO_LD=''
15181         RULE_CC=''
15182         SHOW_CC=''
15183         ECHO_CC=''
15184
15185 fi;
15186 echo "$as_me:15186: result: $enableval" >&5
15187 echo "${ECHO_T}$enableval" >&6
15188
15189 echo "$as_me:15189: checking if you want to use C11 _Noreturn feature" >&5
15190 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15191
15192 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15193 if test "${enable_stdnoreturn+set}" = set; then
15194   enableval="$enable_stdnoreturn"
15195   test "$enableval" != yes && enableval=no
15196         if test "$enableval" != "no" ; then
15197     enable_stdnoreturn=yes
15198         else
15199                 enable_stdnoreturn=no
15200         fi
15201 else
15202   enableval=no
15203         enable_stdnoreturn=no
15204
15205 fi;
15206 echo "$as_me:15206: result: $enable_stdnoreturn" >&5
15207 echo "${ECHO_T}$enable_stdnoreturn" >&6
15208
15209 if test $enable_stdnoreturn = yes; then
15210 echo "$as_me:15210: checking for C11 _Noreturn feature" >&5
15211 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15212 if test "${cf_cv_c11_noreturn+set}" = set; then
15213   echo $ECHO_N "(cached) $ECHO_C" >&6
15214 else
15215   cat >"conftest.$ac_ext" <<_ACEOF
15216 #line 15216 "configure"
15217 #include "confdefs.h"
15218
15219 #include <stdio.h>
15220 #include <stdlib.h>
15221 #include <stdnoreturn.h>
15222 static _Noreturn void giveup(void) { exit(0); }
15223
15224 int
15225 main (void)
15226 {
15227 if (feof(stdin)) giveup()
15228   ;
15229   return 0;
15230 }
15231 _ACEOF
15232 rm -f "conftest.$ac_objext"
15233 if { (eval echo "$as_me:15233: \"$ac_compile\"") >&5
15234   (eval $ac_compile) 2>&5
15235   ac_status=$?
15236   echo "$as_me:15236: \$? = $ac_status" >&5
15237   (exit "$ac_status"); } &&
15238          { ac_try='test -s "conftest.$ac_objext"'
15239   { (eval echo "$as_me:15239: \"$ac_try\"") >&5
15240   (eval $ac_try) 2>&5
15241   ac_status=$?
15242   echo "$as_me:15242: \$? = $ac_status" >&5
15243   (exit "$ac_status"); }; }; then
15244   cf_cv_c11_noreturn=yes
15245 else
15246   echo "$as_me: failed program was:" >&5
15247 cat "conftest.$ac_ext" >&5
15248 cf_cv_c11_noreturn=no
15249 fi
15250 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15251
15252 fi
15253 echo "$as_me:15253: result: $cf_cv_c11_noreturn" >&5
15254 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15255 else
15256         cf_cv_c11_noreturn=no,
15257 fi
15258
15259 if test "$cf_cv_c11_noreturn" = yes; then
15260
15261 cat >>confdefs.h <<\EOF
15262 #define HAVE_STDNORETURN_H 1
15263 EOF
15264
15265 cat >>confdefs.h <<EOF
15266 #define STDC_NORETURN _Noreturn
15267 EOF
15268
15269         HAVE_STDNORETURN_H=1
15270 else
15271         HAVE_STDNORETURN_H=0
15272 fi
15273
15274 if test "$GCC" = yes || test "$GXX" = yes
15275 then
15276
15277 if test "$GCC" = yes || test "$GXX" = yes
15278 then
15279         case $CFLAGS in
15280         (*-Werror=*)
15281                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15282
15283 echo "${as_me:-configure}:15283: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15284
15285                 cf_temp_flags=
15286                 for cf_temp_scan in $CFLAGS
15287                 do
15288                         case "x$cf_temp_scan" in
15289                         (x-Werror=*)
15290
15291         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15292         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15293
15294                                 ;;
15295                         (*)
15296
15297         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15298         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15299
15300                                 ;;
15301                         esac
15302                 done
15303                 CFLAGS="$cf_temp_flags"
15304                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15305
15306 echo "${as_me:-configure}:15306: testing ... fixed $CFLAGS ..." 1>&5
15307
15308                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15309
15310 echo "${as_me:-configure}:15310: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15311
15312                 ;;
15313         esac
15314 fi
15315
15316 if test "$GCC" = yes || test "$GXX" = yes
15317 then
15318         case $CPPFLAGS in
15319         (*-Werror=*)
15320                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15321
15322 echo "${as_me:-configure}:15322: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15323
15324                 cf_temp_flags=
15325                 for cf_temp_scan in $CPPFLAGS
15326                 do
15327                         case "x$cf_temp_scan" in
15328                         (x-Werror=*)
15329
15330         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15331         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15332
15333                                 ;;
15334                         (*)
15335
15336         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15337         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15338
15339                                 ;;
15340                         esac
15341                 done
15342                 CPPFLAGS="$cf_temp_flags"
15343                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15344
15345 echo "${as_me:-configure}:15345: testing ... fixed $CPPFLAGS ..." 1>&5
15346
15347                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15348
15349 echo "${as_me:-configure}:15349: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15350
15351                 ;;
15352         esac
15353 fi
15354
15355 if test "$GCC" = yes || test "$GXX" = yes
15356 then
15357         case $LDFLAGS in
15358         (*-Werror=*)
15359                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15360
15361 echo "${as_me:-configure}:15361: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15362
15363                 cf_temp_flags=
15364                 for cf_temp_scan in $LDFLAGS
15365                 do
15366                         case "x$cf_temp_scan" in
15367                         (x-Werror=*)
15368
15369         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15370         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15371
15372                                 ;;
15373                         (*)
15374
15375         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15376         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15377
15378                                 ;;
15379                         esac
15380                 done
15381                 LDFLAGS="$cf_temp_flags"
15382                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15383
15384 echo "${as_me:-configure}:15384: testing ... fixed $LDFLAGS ..." 1>&5
15385
15386                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15387
15388 echo "${as_me:-configure}:15388: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15389
15390                 ;;
15391         esac
15392 fi
15393
15394 echo "$as_me:15394: checking if you want to turn on gcc warnings" >&5
15395 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15396
15397 # Check whether --enable-warnings or --disable-warnings was given.
15398 if test "${enable_warnings+set}" = set; then
15399   enableval="$enable_warnings"
15400   test "$enableval" != yes && enableval=no
15401         if test "$enableval" != "no" ; then
15402     enable_warnings=yes
15403         else
15404                 enable_warnings=no
15405         fi
15406 else
15407   enableval=no
15408         enable_warnings=no
15409
15410 fi;
15411 echo "$as_me:15411: result: $enable_warnings" >&5
15412 echo "${ECHO_T}$enable_warnings" >&6
15413 if test "$enable_warnings" = "yes"
15414 then
15415
15416 if test "x$have_x" = xyes; then
15417
15418 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15419 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15420 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15421 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15422 for cf_X_CFLAGS in $X_CFLAGS
15423 do
15424         case "x$cf_X_CFLAGS" in
15425         x-[IUD]*)
15426                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15427                 ;;
15428         *)
15429                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15430                 ;;
15431         esac
15432 done
15433
15434 cat >"conftest.$ac_ext" <<_ACEOF
15435 #line 15435 "configure"
15436 #include "confdefs.h"
15437
15438 #include <stdlib.h>
15439 #include <X11/Intrinsic.h>
15440
15441 int
15442 main (void)
15443 {
15444 String foo = malloc(1); free((void*)foo)
15445   ;
15446   return 0;
15447 }
15448 _ACEOF
15449 rm -f "conftest.$ac_objext"
15450 if { (eval echo "$as_me:15450: \"$ac_compile\"") >&5
15451   (eval $ac_compile) 2>&5
15452   ac_status=$?
15453   echo "$as_me:15453: \$? = $ac_status" >&5
15454   (exit "$ac_status"); } &&
15455          { ac_try='test -s "conftest.$ac_objext"'
15456   { (eval echo "$as_me:15456: \"$ac_try\"") >&5
15457   (eval $ac_try) 2>&5
15458   ac_status=$?
15459   echo "$as_me:15459: \$? = $ac_status" >&5
15460   (exit "$ac_status"); }; }; then
15461
15462 echo "$as_me:15462: checking for X11/Xt const-feature" >&5
15463 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15464 if test "${cf_cv_const_x_string+set}" = set; then
15465   echo $ECHO_N "(cached) $ECHO_C" >&6
15466 else
15467
15468         cat >"conftest.$ac_ext" <<_ACEOF
15469 #line 15469 "configure"
15470 #include "confdefs.h"
15471
15472 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15473 #undef  XTSTRINGDEFINES /* X11R5 and later */
15474 #include <stdlib.h>
15475 #include <X11/Intrinsic.h>
15476
15477 int
15478 main (void)
15479 {
15480 String foo = malloc(1); *foo = 0
15481   ;
15482   return 0;
15483 }
15484 _ACEOF
15485 rm -f "conftest.$ac_objext"
15486 if { (eval echo "$as_me:15486: \"$ac_compile\"") >&5
15487   (eval $ac_compile) 2>&5
15488   ac_status=$?
15489   echo "$as_me:15489: \$? = $ac_status" >&5
15490   (exit "$ac_status"); } &&
15491          { ac_try='test -s "conftest.$ac_objext"'
15492   { (eval echo "$as_me:15492: \"$ac_try\"") >&5
15493   (eval $ac_try) 2>&5
15494   ac_status=$?
15495   echo "$as_me:15495: \$? = $ac_status" >&5
15496   (exit "$ac_status"); }; }; then
15497
15498                         cf_cv_const_x_string=no
15499
15500 else
15501   echo "$as_me: failed program was:" >&5
15502 cat "conftest.$ac_ext" >&5
15503
15504                         cf_cv_const_x_string=yes
15505
15506 fi
15507 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15508
15509 fi
15510 echo "$as_me:15510: result: $cf_cv_const_x_string" >&5
15511 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15512
15513 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15514 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15515 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15516
15517 case "$cf_cv_const_x_string" in
15518 (no)
15519
15520         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15521         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15522
15523         ;;
15524 (*)
15525
15526         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15527         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15528
15529         ;;
15530 esac
15531
15532 else
15533   echo "$as_me: failed program was:" >&5
15534 cat "conftest.$ac_ext" >&5
15535 fi
15536 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15537  fi
15538 cat > "conftest.$ac_ext" <<EOF
15539 #line 15539 "${as_me:-configure}"
15540 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15541 EOF
15542 if test "$INTEL_COMPILER" = yes
15543 then
15544 # The "-wdXXX" options suppress warnings:
15545 # remark #1419: external declaration in primary source file
15546 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15547 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15548 # remark #193: zero used for undefined preprocessing identifier
15549 # remark #593: variable "curs_sb_left_arrow" was set but never used
15550 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15551 # remark #869: parameter "tw" was never referenced
15552 # remark #981: operands are evaluated in unspecified order
15553 # warning #279: controlling expression is constant
15554
15555         { echo "$as_me:15555: checking for $CC warning options..." >&5
15556 echo "$as_me: checking for $CC warning options..." >&6;}
15557         cf_save_CFLAGS="$CFLAGS"
15558         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15559         for cf_opt in \
15560                 wd1419 \
15561                 wd1683 \
15562                 wd1684 \
15563                 wd193 \
15564                 wd593 \
15565                 wd279 \
15566                 wd810 \
15567                 wd869 \
15568                 wd981
15569         do
15570                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15571                 if { (eval echo "$as_me:15571: \"$ac_compile\"") >&5
15572   (eval $ac_compile) 2>&5
15573   ac_status=$?
15574   echo "$as_me:15574: \$? = $ac_status" >&5
15575   (exit "$ac_status"); }; then
15576                         test -n "$verbose" && echo "$as_me:15576: result: ... -$cf_opt" >&5
15577 echo "${ECHO_T}... -$cf_opt" >&6
15578                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15579                 fi
15580         done
15581         CFLAGS="$cf_save_CFLAGS"
15582 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15583 then
15584         { echo "$as_me:15584: checking for $CC warning options..." >&5
15585 echo "$as_me: checking for $CC warning options..." >&6;}
15586         cf_save_CFLAGS="$CFLAGS"
15587         cf_warn_CONST=""
15588         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15589         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15590         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15591         for cf_opt in W Wall \
15592                 Wbad-function-cast \
15593                 Wcast-align \
15594                 Wcast-qual \
15595                 Wdeclaration-after-statement \
15596                 Wextra \
15597                 Winline \
15598                 Wmissing-declarations \
15599                 Wmissing-prototypes \
15600                 Wnested-externs \
15601                 Wpointer-arith \
15602                 Wshadow \
15603                 Wstrict-prototypes \
15604                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15605         do
15606                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15607                 if { (eval echo "$as_me:15607: \"$ac_compile\"") >&5
15608   (eval $ac_compile) 2>&5
15609   ac_status=$?
15610   echo "$as_me:15610: \$? = $ac_status" >&5
15611   (exit "$ac_status"); }; then
15612                         test -n "$verbose" && echo "$as_me:15612: result: ... -$cf_opt" >&5
15613 echo "${ECHO_T}... -$cf_opt" >&6
15614                         case "$cf_opt" in
15615                         (Winline)
15616                                 case "$GCC_VERSION" in
15617                                 ([34].*)
15618                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15619
15620 echo "${as_me:-configure}:15620: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15621
15622                                         continue;;
15623                                 esac
15624                                 ;;
15625                         (Wpointer-arith)
15626                                 case "$GCC_VERSION" in
15627                                 ([12].*)
15628                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15629
15630 echo "${as_me:-configure}:15630: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15631
15632                                         continue;;
15633                                 esac
15634                                 ;;
15635                         esac
15636                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15637                 fi
15638         done
15639         CFLAGS="$cf_save_CFLAGS"
15640 fi
15641 rm -rf ./conftest*
15642
15643 fi
15644
15645 if test "$GCC" = yes || test "$GXX" = yes
15646 then
15647 cat > conftest.i <<EOF
15648 #ifndef GCC_PRINTF
15649 #define GCC_PRINTF 0
15650 #endif
15651 #ifndef GCC_SCANF
15652 #define GCC_SCANF 0
15653 #endif
15654 #ifndef GCC_NORETURN
15655 #define GCC_NORETURN /* nothing */
15656 #endif
15657 #ifndef GCC_UNUSED
15658 #define GCC_UNUSED /* nothing */
15659 #endif
15660 EOF
15661 if test "$GCC" = yes
15662 then
15663         { echo "$as_me:15663: checking for $CC __attribute__ directives..." >&5
15664 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15665 cat > "conftest.$ac_ext" <<EOF
15666 #line 15666 "${as_me:-configure}"
15667 #include "confdefs.h"
15668 #include "conftest.h"
15669 #include "conftest.i"
15670 #if     GCC_PRINTF
15671 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15672 #else
15673 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15674 #endif
15675 #if     GCC_SCANF
15676 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15677 #else
15678 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15679 #endif
15680 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15681 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15682 extern GCC_NORETURN void foo(void);
15683 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15684 EOF
15685         cf_printf_attribute=no
15686         cf_scanf_attribute=no
15687         for cf_attribute in scanf printf unused noreturn
15688         do
15689
15690 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15691
15692                 cf_directive="__attribute__(($cf_attribute))"
15693                 echo "checking for $CC $cf_directive" 1>&5
15694
15695                 case "$cf_attribute" in
15696                 (printf)
15697                         cf_printf_attribute=yes
15698                         cat >conftest.h <<EOF
15699 #define GCC_$cf_ATTRIBUTE 1
15700 EOF
15701                         ;;
15702                 (scanf)
15703                         cf_scanf_attribute=yes
15704                         cat >conftest.h <<EOF
15705 #define GCC_$cf_ATTRIBUTE 1
15706 EOF
15707                         ;;
15708                 (*)
15709                         cat >conftest.h <<EOF
15710 #define GCC_$cf_ATTRIBUTE $cf_directive
15711 EOF
15712                         ;;
15713                 esac
15714
15715                 if { (eval echo "$as_me:15715: \"$ac_compile\"") >&5
15716   (eval $ac_compile) 2>&5
15717   ac_status=$?
15718   echo "$as_me:15718: \$? = $ac_status" >&5
15719   (exit "$ac_status"); }; then
15720                         test -n "$verbose" && echo "$as_me:15720: result: ... $cf_attribute" >&5
15721 echo "${ECHO_T}... $cf_attribute" >&6
15722                         cat conftest.h >>confdefs.h
15723                         case "$cf_attribute" in
15724                         (noreturn)
15725
15726 cat >>confdefs.h <<EOF
15727 #define GCC_NORETURN $cf_directive
15728 EOF
15729
15730                                 ;;
15731                         (printf)
15732                                 cf_value='/* nothing */'
15733                                 if test "$cf_printf_attribute" != no ; then
15734                                         cf_value='__attribute__((format(printf,fmt,var)))'
15735
15736 cat >>confdefs.h <<\EOF
15737 #define GCC_PRINTF 1
15738 EOF
15739
15740                                 fi
15741
15742 cat >>confdefs.h <<EOF
15743 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15744 EOF
15745
15746                                 ;;
15747                         (scanf)
15748                                 cf_value='/* nothing */'
15749                                 if test "$cf_scanf_attribute" != no ; then
15750                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15751
15752 cat >>confdefs.h <<\EOF
15753 #define GCC_SCANF 1
15754 EOF
15755
15756                                 fi
15757
15758 cat >>confdefs.h <<EOF
15759 #define GCC_SCANFLIKE(fmt,var) $cf_value
15760 EOF
15761
15762                                 ;;
15763                         (unused)
15764
15765 cat >>confdefs.h <<EOF
15766 #define GCC_UNUSED $cf_directive
15767 EOF
15768
15769                                 ;;
15770                         esac
15771                 fi
15772         done
15773 else
15774         ${FGREP-fgrep} define conftest.i >>confdefs.h
15775 fi
15776 rm -rf ./conftest*
15777 fi
15778
15779 fi
15780
15781 if test "x$enable_warnings" = "xyes"; then
15782
15783         ADAFLAGS="$ADAFLAGS -gnatg"
15784
15785 fi
15786
15787 ###     use option --enable-assertions to turn on generation of assertion code
15788 echo "$as_me:15788: checking if you want to enable runtime assertions" >&5
15789 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15790
15791 # Check whether --enable-assertions or --disable-assertions was given.
15792 if test "${enable_assertions+set}" = set; then
15793   enableval="$enable_assertions"
15794   with_assertions=$enableval
15795 else
15796   with_assertions=no
15797 fi;
15798 echo "$as_me:15798: result: $with_assertions" >&5
15799 echo "${ECHO_T}$with_assertions" >&6
15800 if test -n "$GCC"
15801 then
15802         if test "$with_assertions" = no
15803         then
15804                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15805         else
15806
15807         ADAFLAGS="$ADAFLAGS -gnata"
15808
15809         fi
15810 fi
15811
15812 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15813
15814 cat >>confdefs.h <<\EOF
15815 #define HAVE_NC_ALLOC_H 1
15816 EOF
15817
15818 ###     use option --enable-expanded to generate certain macros as functions
15819
15820 # Check whether --enable-expanded or --disable-expanded was given.
15821 if test "${enable_expanded+set}" = set; then
15822   enableval="$enable_expanded"
15823   test "$enableval" = yes &&
15824 cat >>confdefs.h <<\EOF
15825 #define NCURSES_EXPANDED 1
15826 EOF
15827
15828 fi;
15829
15830 ###     use option --disable-macros to suppress macros in favor of functions
15831
15832 # Check whether --enable-macros or --disable-macros was given.
15833 if test "${enable_macros+set}" = set; then
15834   enableval="$enable_macros"
15835   test "$enableval" = no &&
15836 cat >>confdefs.h <<\EOF
15837 #define NCURSES_NOMACROS 1
15838 EOF
15839
15840 fi;
15841
15842 # Normally we only add trace() to the debug-library.  Allow this to be
15843 # extended to all models of the ncurses library:
15844 cf_all_traces=no
15845 case "$CFLAGS $CPPFLAGS" in
15846 (*-DTRACE*)
15847         cf_all_traces=yes
15848         ;;
15849 esac
15850
15851 echo "$as_me:15851: checking whether to add trace feature to all models" >&5
15852 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15853
15854 # Check whether --with-trace or --without-trace was given.
15855 if test "${with_trace+set}" = set; then
15856   withval="$with_trace"
15857   cf_with_trace=$withval
15858 else
15859   cf_with_trace=$cf_all_traces
15860 fi;
15861 echo "$as_me:15861: result: $cf_with_trace" >&5
15862 echo "${ECHO_T}$cf_with_trace" >&6
15863
15864 if test "$cf_with_trace" = yes ; then
15865         ADA_TRACE=TRUE
15866
15867 cf_fix_cppflags=no
15868 cf_new_cflags=
15869 cf_new_cppflags=
15870 cf_new_extra_cppflags=
15871
15872 for cf_add_cflags in -DTRACE
15873 do
15874 case "$cf_fix_cppflags" in
15875 (no)
15876         case "$cf_add_cflags" in
15877         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15878                 case "$cf_add_cflags" in
15879                 (-D*)
15880                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15881
15882                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15883                                 && test -z "${cf_tst_cflags}" \
15884                                 && cf_fix_cppflags=yes
15885
15886                         if test "$cf_fix_cppflags" = yes ; then
15887
15888         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15889         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15890
15891                                 continue
15892                         elif test "${cf_tst_cflags}" = "\"'" ; then
15893
15894         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15895         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15896
15897                                 continue
15898                         fi
15899                         ;;
15900                 esac
15901                 case "$CPPFLAGS" in
15902                 (*$cf_add_cflags)
15903                         ;;
15904                 (*)
15905                         case "$cf_add_cflags" in
15906                         (-D*)
15907                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15908
15909 CPPFLAGS=`echo "$CPPFLAGS" | \
15910         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15911                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15912
15913                                 ;;
15914                         esac
15915
15916         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15917         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15918
15919                         ;;
15920                 esac
15921                 ;;
15922         (*)
15923
15924         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15925         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15926
15927                 ;;
15928         esac
15929         ;;
15930 (yes)
15931
15932         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15933         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15934
15935         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15936
15937         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15938                 && test -z "${cf_tst_cflags}" \
15939                 && cf_fix_cppflags=no
15940         ;;
15941 esac
15942 done
15943
15944 if test -n "$cf_new_cflags" ; then
15945
15946         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15947         CFLAGS="${CFLAGS}$cf_new_cflags"
15948
15949 fi
15950
15951 if test -n "$cf_new_cppflags" ; then
15952
15953         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15954         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15955
15956 fi
15957
15958 if test -n "$cf_new_extra_cppflags" ; then
15959
15960         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15961         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15962
15963 fi
15964
15965 else
15966         ADA_TRACE=FALSE
15967 fi
15968
15969 echo "$as_me:15969: checking if we want to use GNAT projects" >&5
15970 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15971
15972 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15973 if test "${enable_gnat_projects+set}" = set; then
15974   enableval="$enable_gnat_projects"
15975   test "$enableval" != no && enableval=yes
15976         if test "$enableval" != "yes" ; then
15977     enable_gnat_projects=no
15978         else
15979                 enable_gnat_projects=yes
15980         fi
15981 else
15982   enableval=yes
15983         enable_gnat_projects=yes
15984
15985 fi;
15986 echo "$as_me:15986: result: $enable_gnat_projects" >&5
15987 echo "${ECHO_T}$enable_gnat_projects" >&6
15988
15989 ###     Checks for libraries.
15990 case $cf_cv_system_name in
15991 (*mingw32*)
15992         ;;
15993 (*)
15994 echo "$as_me:15994: checking for gettimeofday" >&5
15995 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15996 if test "${ac_cv_func_gettimeofday+set}" = set; then
15997   echo $ECHO_N "(cached) $ECHO_C" >&6
15998 else
15999   cat >"conftest.$ac_ext" <<_ACEOF
16000 #line 16000 "configure"
16001 #include "confdefs.h"
16002 #define gettimeofday autoconf_temporary
16003 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16004 #undef gettimeofday
16005
16006 #ifdef __cplusplus
16007 extern "C"
16008 #endif
16009
16010 /* We use char because int might match the return type of a gcc2
16011    builtin and then its argument prototype would still apply.  */
16012 char gettimeofday (void);
16013
16014 int
16015 main (void)
16016 {
16017
16018 /* The GNU C library defines stubs for functions which it implements
16019     to always fail with ENOSYS.  Some functions are actually named
16020     something starting with __ and the normal name is an alias.  */
16021 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
16022 #error found stub for gettimeofday
16023 #endif
16024
16025         return gettimeofday ();
16026   ;
16027   return 0;
16028 }
16029 _ACEOF
16030 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16031 if { (eval echo "$as_me:16031: \"$ac_link\"") >&5
16032   (eval $ac_link) 2>&5
16033   ac_status=$?
16034   echo "$as_me:16034: \$? = $ac_status" >&5
16035   (exit "$ac_status"); } &&
16036          { ac_try='test -s "conftest$ac_exeext"'
16037   { (eval echo "$as_me:16037: \"$ac_try\"") >&5
16038   (eval $ac_try) 2>&5
16039   ac_status=$?
16040   echo "$as_me:16040: \$? = $ac_status" >&5
16041   (exit "$ac_status"); }; }; then
16042   ac_cv_func_gettimeofday=yes
16043 else
16044   echo "$as_me: failed program was:" >&5
16045 cat "conftest.$ac_ext" >&5
16046 ac_cv_func_gettimeofday=no
16047 fi
16048 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16049 fi
16050 echo "$as_me:16050: result: $ac_cv_func_gettimeofday" >&5
16051 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16052 if test "$ac_cv_func_gettimeofday" = yes; then
16053   cat >>confdefs.h <<\EOF
16054 #define HAVE_GETTIMEOFDAY 1
16055 EOF
16056
16057 else
16058
16059 echo "$as_me:16059: checking for gettimeofday in -lbsd" >&5
16060 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16061 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16062   echo $ECHO_N "(cached) $ECHO_C" >&6
16063 else
16064   ac_check_lib_save_LIBS=$LIBS
16065 LIBS="-lbsd  $LIBS"
16066 cat >"conftest.$ac_ext" <<_ACEOF
16067 #line 16067 "configure"
16068 #include "confdefs.h"
16069
16070 /* Override any gcc2 internal prototype to avoid an error.  */
16071 #ifdef __cplusplus
16072 extern "C"
16073 #endif
16074 /* We use char because int might match the return type of a gcc2
16075    builtin and then its argument prototype would still apply.  */
16076 char gettimeofday ();
16077 int
16078 main (void)
16079 {
16080 gettimeofday ();
16081   ;
16082   return 0;
16083 }
16084 _ACEOF
16085 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16086 if { (eval echo "$as_me:16086: \"$ac_link\"") >&5
16087   (eval $ac_link) 2>&5
16088   ac_status=$?
16089   echo "$as_me:16089: \$? = $ac_status" >&5
16090   (exit "$ac_status"); } &&
16091          { ac_try='test -s "conftest$ac_exeext"'
16092   { (eval echo "$as_me:16092: \"$ac_try\"") >&5
16093   (eval $ac_try) 2>&5
16094   ac_status=$?
16095   echo "$as_me:16095: \$? = $ac_status" >&5
16096   (exit "$ac_status"); }; }; then
16097   ac_cv_lib_bsd_gettimeofday=yes
16098 else
16099   echo "$as_me: failed program was:" >&5
16100 cat "conftest.$ac_ext" >&5
16101 ac_cv_lib_bsd_gettimeofday=no
16102 fi
16103 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16104 LIBS=$ac_check_lib_save_LIBS
16105 fi
16106 echo "$as_me:16106: result: $ac_cv_lib_bsd_gettimeofday" >&5
16107 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16108 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16109
16110 cat >>confdefs.h <<\EOF
16111 #define HAVE_GETTIMEOFDAY 1
16112 EOF
16113
16114         LIBS="$LIBS -lbsd"
16115 fi
16116
16117 fi
16118         ;;
16119 esac
16120
16121 ###     Checks for header files.
16122 echo "$as_me:16122: checking for ANSI C header files" >&5
16123 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16124 if test "${ac_cv_header_stdc+set}" = set; then
16125   echo $ECHO_N "(cached) $ECHO_C" >&6
16126 else
16127   cat >"conftest.$ac_ext" <<_ACEOF
16128 #line 16128 "configure"
16129 #include "confdefs.h"
16130 #include <stdlib.h>
16131 #include <stdarg.h>
16132 #include <string.h>
16133 #include <float.h>
16134
16135 _ACEOF
16136 if { (eval echo "$as_me:16136: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16137   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16138   ac_status=$?
16139   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16140   rm -f conftest.er1
16141   cat conftest.err >&5
16142   echo "$as_me:16142: \$? = $ac_status" >&5
16143   (exit "$ac_status"); } >/dev/null; then
16144   if test -s conftest.err; then
16145     ac_cpp_err=$ac_c_preproc_warn_flag
16146   else
16147     ac_cpp_err=
16148   fi
16149 else
16150   ac_cpp_err=yes
16151 fi
16152 if test -z "$ac_cpp_err"; then
16153   ac_cv_header_stdc=yes
16154 else
16155   echo "$as_me: failed program was:" >&5
16156   cat "conftest.$ac_ext" >&5
16157   ac_cv_header_stdc=no
16158 fi
16159 rm -f conftest.err "conftest.$ac_ext"
16160
16161 if test $ac_cv_header_stdc = yes; then
16162   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16163   cat >"conftest.$ac_ext" <<_ACEOF
16164 #line 16164 "configure"
16165 #include "confdefs.h"
16166 #include <string.h>
16167
16168 _ACEOF
16169 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16170   $EGREP "memchr" >/dev/null 2>&1; then
16171   :
16172 else
16173   ac_cv_header_stdc=no
16174 fi
16175 rm -rf conftest*
16176
16177 fi
16178
16179 if test $ac_cv_header_stdc = yes; then
16180   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16181   cat >"conftest.$ac_ext" <<_ACEOF
16182 #line 16182 "configure"
16183 #include "confdefs.h"
16184 #include <stdlib.h>
16185
16186 _ACEOF
16187 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16188   $EGREP "free" >/dev/null 2>&1; then
16189   :
16190 else
16191   ac_cv_header_stdc=no
16192 fi
16193 rm -rf conftest*
16194
16195 fi
16196
16197 if test $ac_cv_header_stdc = yes; then
16198   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16199   if test "$cross_compiling" = yes; then
16200   :
16201 else
16202   cat >"conftest.$ac_ext" <<_ACEOF
16203 #line 16203 "configure"
16204 #include "confdefs.h"
16205 #include <ctype.h>
16206 #if ((' ' & 0x0FF) == 0x020)
16207 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16208 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16209 #else
16210 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16211                      || ('j' <= (c) && (c) <= 'r') \
16212                      || ('s' <= (c) && (c) <= 'z'))
16213 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16214 #endif
16215
16216 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16217 int
16218 main (void)
16219 {
16220   int i;
16221   for (i = 0; i < 256; i++)
16222     if (XOR (islower (i), ISLOWER (i))
16223         || toupper (i) != TOUPPER (i))
16224       $ac_main_return(2);
16225   $ac_main_return (0);
16226 }
16227 _ACEOF
16228 rm -f "conftest$ac_exeext"
16229 if { (eval echo "$as_me:16229: \"$ac_link\"") >&5
16230   (eval $ac_link) 2>&5
16231   ac_status=$?
16232   echo "$as_me:16232: \$? = $ac_status" >&5
16233   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16234   { (eval echo "$as_me:16234: \"$ac_try\"") >&5
16235   (eval $ac_try) 2>&5
16236   ac_status=$?
16237   echo "$as_me:16237: \$? = $ac_status" >&5
16238   (exit "$ac_status"); }; }; then
16239   :
16240 else
16241   echo "$as_me: program exited with status $ac_status" >&5
16242 echo "$as_me: failed program was:" >&5
16243 cat "conftest.$ac_ext" >&5
16244 ac_cv_header_stdc=no
16245 fi
16246 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16247 fi
16248 fi
16249 fi
16250 echo "$as_me:16250: result: $ac_cv_header_stdc" >&5
16251 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16252 if test $ac_cv_header_stdc = yes; then
16253
16254 cat >>confdefs.h <<\EOF
16255 #define STDC_HEADERS 1
16256 EOF
16257
16258 fi
16259
16260 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16261
16262 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16263                   inttypes.h stdint.h unistd.h
16264 do
16265 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16266 echo "$as_me:16266: checking for $ac_header" >&5
16267 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16268 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16269   echo $ECHO_N "(cached) $ECHO_C" >&6
16270 else
16271   cat >"conftest.$ac_ext" <<_ACEOF
16272 #line 16272 "configure"
16273 #include "confdefs.h"
16274 $ac_includes_default
16275 #include <$ac_header>
16276 _ACEOF
16277 rm -f "conftest.$ac_objext"
16278 if { (eval echo "$as_me:16278: \"$ac_compile\"") >&5
16279   (eval $ac_compile) 2>&5
16280   ac_status=$?
16281   echo "$as_me:16281: \$? = $ac_status" >&5
16282   (exit "$ac_status"); } &&
16283          { ac_try='test -s "conftest.$ac_objext"'
16284   { (eval echo "$as_me:16284: \"$ac_try\"") >&5
16285   (eval $ac_try) 2>&5
16286   ac_status=$?
16287   echo "$as_me:16287: \$? = $ac_status" >&5
16288   (exit "$ac_status"); }; }; then
16289   eval "$as_ac_Header=yes"
16290 else
16291   echo "$as_me: failed program was:" >&5
16292 cat "conftest.$ac_ext" >&5
16293 eval "$as_ac_Header=no"
16294 fi
16295 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16296 fi
16297 echo "$as_me:16297: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16298 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16299 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16300   cat >>confdefs.h <<EOF
16301 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16302 EOF
16303
16304 fi
16305 done
16306
16307 echo "$as_me:16307: checking for signed char" >&5
16308 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16309 if test "${ac_cv_type_signed_char+set}" = set; then
16310   echo $ECHO_N "(cached) $ECHO_C" >&6
16311 else
16312   cat >"conftest.$ac_ext" <<_ACEOF
16313 #line 16313 "configure"
16314 #include "confdefs.h"
16315 $ac_includes_default
16316 int
16317 main (void)
16318 {
16319 if ((signed char *) 0)
16320   return 0;
16321 if (sizeof (signed char))
16322   return 0;
16323   ;
16324   return 0;
16325 }
16326 _ACEOF
16327 rm -f "conftest.$ac_objext"
16328 if { (eval echo "$as_me:16328: \"$ac_compile\"") >&5
16329   (eval $ac_compile) 2>&5
16330   ac_status=$?
16331   echo "$as_me:16331: \$? = $ac_status" >&5
16332   (exit "$ac_status"); } &&
16333          { ac_try='test -s "conftest.$ac_objext"'
16334   { (eval echo "$as_me:16334: \"$ac_try\"") >&5
16335   (eval $ac_try) 2>&5
16336   ac_status=$?
16337   echo "$as_me:16337: \$? = $ac_status" >&5
16338   (exit "$ac_status"); }; }; then
16339   ac_cv_type_signed_char=yes
16340 else
16341   echo "$as_me: failed program was:" >&5
16342 cat "conftest.$ac_ext" >&5
16343 ac_cv_type_signed_char=no
16344 fi
16345 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16346 fi
16347 echo "$as_me:16347: result: $ac_cv_type_signed_char" >&5
16348 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16349
16350 echo "$as_me:16350: checking size of signed char" >&5
16351 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16352 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16353   echo $ECHO_N "(cached) $ECHO_C" >&6
16354 else
16355   if test "$ac_cv_type_signed_char" = yes; then
16356   if test "$cross_compiling" = yes; then
16357   # Depending upon the size, compute the lo and hi bounds.
16358 cat >"conftest.$ac_ext" <<_ACEOF
16359 #line 16359 "configure"
16360 #include "confdefs.h"
16361 $ac_includes_default
16362 int
16363 main (void)
16364 {
16365 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16366   ;
16367   return 0;
16368 }
16369 _ACEOF
16370 rm -f "conftest.$ac_objext"
16371 if { (eval echo "$as_me:16371: \"$ac_compile\"") >&5
16372   (eval $ac_compile) 2>&5
16373   ac_status=$?
16374   echo "$as_me:16374: \$? = $ac_status" >&5
16375   (exit "$ac_status"); } &&
16376          { ac_try='test -s "conftest.$ac_objext"'
16377   { (eval echo "$as_me:16377: \"$ac_try\"") >&5
16378   (eval $ac_try) 2>&5
16379   ac_status=$?
16380   echo "$as_me:16380: \$? = $ac_status" >&5
16381   (exit "$ac_status"); }; }; then
16382   ac_lo=0 ac_mid=0
16383   while :; do
16384     cat >"conftest.$ac_ext" <<_ACEOF
16385 #line 16385 "configure"
16386 #include "confdefs.h"
16387 $ac_includes_default
16388 int
16389 main (void)
16390 {
16391 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16392   ;
16393   return 0;
16394 }
16395 _ACEOF
16396 rm -f "conftest.$ac_objext"
16397 if { (eval echo "$as_me:16397: \"$ac_compile\"") >&5
16398   (eval $ac_compile) 2>&5
16399   ac_status=$?
16400   echo "$as_me:16400: \$? = $ac_status" >&5
16401   (exit "$ac_status"); } &&
16402          { ac_try='test -s "conftest.$ac_objext"'
16403   { (eval echo "$as_me:16403: \"$ac_try\"") >&5
16404   (eval $ac_try) 2>&5
16405   ac_status=$?
16406   echo "$as_me:16406: \$? = $ac_status" >&5
16407   (exit "$ac_status"); }; }; then
16408   ac_hi=$ac_mid; break
16409 else
16410   echo "$as_me: failed program was:" >&5
16411 cat "conftest.$ac_ext" >&5
16412 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16413 fi
16414 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16415   done
16416 else
16417   echo "$as_me: failed program was:" >&5
16418 cat "conftest.$ac_ext" >&5
16419 ac_hi=-1 ac_mid=-1
16420   while :; do
16421     cat >"conftest.$ac_ext" <<_ACEOF
16422 #line 16422 "configure"
16423 #include "confdefs.h"
16424 $ac_includes_default
16425 int
16426 main (void)
16427 {
16428 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
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_lo=$ac_mid; break
16446 else
16447   echo "$as_me: failed program was:" >&5
16448 cat "conftest.$ac_ext" >&5
16449 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16450 fi
16451 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16452   done
16453 fi
16454 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16455 # Binary search between lo and hi bounds.
16456 while test "x$ac_lo" != "x$ac_hi"; do
16457   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16458   cat >"conftest.$ac_ext" <<_ACEOF
16459 #line 16459 "configure"
16460 #include "confdefs.h"
16461 $ac_includes_default
16462 int
16463 main (void)
16464 {
16465 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16466   ;
16467   return 0;
16468 }
16469 _ACEOF
16470 rm -f "conftest.$ac_objext"
16471 if { (eval echo "$as_me:16471: \"$ac_compile\"") >&5
16472   (eval $ac_compile) 2>&5
16473   ac_status=$?
16474   echo "$as_me:16474: \$? = $ac_status" >&5
16475   (exit "$ac_status"); } &&
16476          { ac_try='test -s "conftest.$ac_objext"'
16477   { (eval echo "$as_me:16477: \"$ac_try\"") >&5
16478   (eval $ac_try) 2>&5
16479   ac_status=$?
16480   echo "$as_me:16480: \$? = $ac_status" >&5
16481   (exit "$ac_status"); }; }; then
16482   ac_hi=$ac_mid
16483 else
16484   echo "$as_me: failed program was:" >&5
16485 cat "conftest.$ac_ext" >&5
16486 ac_lo=`expr "$ac_mid" + 1`
16487 fi
16488 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16489 done
16490 ac_cv_sizeof_signed_char=$ac_lo
16491 else
16492   if test "$cross_compiling" = yes; then
16493   { { echo "$as_me:16493: error: cannot run test program while cross compiling" >&5
16494 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16495    { (exit 1); exit 1; }; }
16496 else
16497   cat >"conftest.$ac_ext" <<_ACEOF
16498 #line 16498 "configure"
16499 #include "confdefs.h"
16500 $ac_includes_default
16501 int
16502 main (void)
16503 {
16504 FILE *f = fopen ("conftest.val", "w");
16505 if (!f)
16506   $ac_main_return (1);
16507 fprintf (f, "%ld", (long)(sizeof (signed char)));
16508 fclose (f);
16509   ;
16510   return 0;
16511 }
16512 _ACEOF
16513 rm -f "conftest$ac_exeext"
16514 if { (eval echo "$as_me:16514: \"$ac_link\"") >&5
16515   (eval $ac_link) 2>&5
16516   ac_status=$?
16517   echo "$as_me:16517: \$? = $ac_status" >&5
16518   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16519   { (eval echo "$as_me:16519: \"$ac_try\"") >&5
16520   (eval $ac_try) 2>&5
16521   ac_status=$?
16522   echo "$as_me:16522: \$? = $ac_status" >&5
16523   (exit "$ac_status"); }; }; then
16524   ac_cv_sizeof_signed_char=`cat conftest.val`
16525 else
16526   echo "$as_me: program exited with status $ac_status" >&5
16527 echo "$as_me: failed program was:" >&5
16528 cat "conftest.$ac_ext" >&5
16529 fi
16530 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16531 fi
16532 fi
16533 rm -f conftest.val
16534 else
16535   ac_cv_sizeof_signed_char=0
16536 fi
16537 fi
16538 echo "$as_me:16538: result: $ac_cv_sizeof_signed_char" >&5
16539 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16540 cat >>confdefs.h <<EOF
16541 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16542 EOF
16543
16544 echo "$as_me:16544: checking for ANSI C header files" >&5
16545 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16546 if test "${ac_cv_header_stdc+set}" = set; then
16547   echo $ECHO_N "(cached) $ECHO_C" >&6
16548 else
16549   cat >"conftest.$ac_ext" <<_ACEOF
16550 #line 16550 "configure"
16551 #include "confdefs.h"
16552 #include <stdlib.h>
16553 #include <stdarg.h>
16554 #include <string.h>
16555 #include <float.h>
16556
16557 _ACEOF
16558 if { (eval echo "$as_me:16558: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16559   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16560   ac_status=$?
16561   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16562   rm -f conftest.er1
16563   cat conftest.err >&5
16564   echo "$as_me:16564: \$? = $ac_status" >&5
16565   (exit "$ac_status"); } >/dev/null; then
16566   if test -s conftest.err; then
16567     ac_cpp_err=$ac_c_preproc_warn_flag
16568   else
16569     ac_cpp_err=
16570   fi
16571 else
16572   ac_cpp_err=yes
16573 fi
16574 if test -z "$ac_cpp_err"; then
16575   ac_cv_header_stdc=yes
16576 else
16577   echo "$as_me: failed program was:" >&5
16578   cat "conftest.$ac_ext" >&5
16579   ac_cv_header_stdc=no
16580 fi
16581 rm -f conftest.err "conftest.$ac_ext"
16582
16583 if test $ac_cv_header_stdc = yes; then
16584   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16585   cat >"conftest.$ac_ext" <<_ACEOF
16586 #line 16586 "configure"
16587 #include "confdefs.h"
16588 #include <string.h>
16589
16590 _ACEOF
16591 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16592   $EGREP "memchr" >/dev/null 2>&1; then
16593   :
16594 else
16595   ac_cv_header_stdc=no
16596 fi
16597 rm -rf conftest*
16598
16599 fi
16600
16601 if test $ac_cv_header_stdc = yes; then
16602   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16603   cat >"conftest.$ac_ext" <<_ACEOF
16604 #line 16604 "configure"
16605 #include "confdefs.h"
16606 #include <stdlib.h>
16607
16608 _ACEOF
16609 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16610   $EGREP "free" >/dev/null 2>&1; then
16611   :
16612 else
16613   ac_cv_header_stdc=no
16614 fi
16615 rm -rf conftest*
16616
16617 fi
16618
16619 if test $ac_cv_header_stdc = yes; then
16620   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16621   if test "$cross_compiling" = yes; then
16622   :
16623 else
16624   cat >"conftest.$ac_ext" <<_ACEOF
16625 #line 16625 "configure"
16626 #include "confdefs.h"
16627 #include <ctype.h>
16628 #if ((' ' & 0x0FF) == 0x020)
16629 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16630 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16631 #else
16632 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16633                      || ('j' <= (c) && (c) <= 'r') \
16634                      || ('s' <= (c) && (c) <= 'z'))
16635 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16636 #endif
16637
16638 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16639 int
16640 main (void)
16641 {
16642   int i;
16643   for (i = 0; i < 256; i++)
16644     if (XOR (islower (i), ISLOWER (i))
16645         || toupper (i) != TOUPPER (i))
16646       $ac_main_return(2);
16647   $ac_main_return (0);
16648 }
16649 _ACEOF
16650 rm -f "conftest$ac_exeext"
16651 if { (eval echo "$as_me:16651: \"$ac_link\"") >&5
16652   (eval $ac_link) 2>&5
16653   ac_status=$?
16654   echo "$as_me:16654: \$? = $ac_status" >&5
16655   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16656   { (eval echo "$as_me:16656: \"$ac_try\"") >&5
16657   (eval $ac_try) 2>&5
16658   ac_status=$?
16659   echo "$as_me:16659: \$? = $ac_status" >&5
16660   (exit "$ac_status"); }; }; then
16661   :
16662 else
16663   echo "$as_me: program exited with status $ac_status" >&5
16664 echo "$as_me: failed program was:" >&5
16665 cat "conftest.$ac_ext" >&5
16666 ac_cv_header_stdc=no
16667 fi
16668 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16669 fi
16670 fi
16671 fi
16672 echo "$as_me:16672: result: $ac_cv_header_stdc" >&5
16673 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16674 if test $ac_cv_header_stdc = yes; then
16675
16676 cat >>confdefs.h <<\EOF
16677 #define STDC_HEADERS 1
16678 EOF
16679
16680 fi
16681
16682 ac_header_dirent=no
16683 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16684   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16685 echo "$as_me:16685: checking for $ac_hdr that defines DIR" >&5
16686 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16687 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16688   echo $ECHO_N "(cached) $ECHO_C" >&6
16689 else
16690   cat >"conftest.$ac_ext" <<_ACEOF
16691 #line 16691 "configure"
16692 #include "confdefs.h"
16693 #include <sys/types.h>
16694 #include <$ac_hdr>
16695
16696 int
16697 main (void)
16698 {
16699 if ((DIR *) 0)
16700 return 0;
16701   ;
16702   return 0;
16703 }
16704 _ACEOF
16705 rm -f "conftest.$ac_objext"
16706 if { (eval echo "$as_me:16706: \"$ac_compile\"") >&5
16707   (eval $ac_compile) 2>&5
16708   ac_status=$?
16709   echo "$as_me:16709: \$? = $ac_status" >&5
16710   (exit "$ac_status"); } &&
16711          { ac_try='test -s "conftest.$ac_objext"'
16712   { (eval echo "$as_me:16712: \"$ac_try\"") >&5
16713   (eval $ac_try) 2>&5
16714   ac_status=$?
16715   echo "$as_me:16715: \$? = $ac_status" >&5
16716   (exit "$ac_status"); }; }; then
16717   eval "$as_ac_Header=yes"
16718 else
16719   echo "$as_me: failed program was:" >&5
16720 cat "conftest.$ac_ext" >&5
16721 eval "$as_ac_Header=no"
16722 fi
16723 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16724 fi
16725 echo "$as_me:16725: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16726 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16727 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16728   cat >>confdefs.h <<EOF
16729 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16730 EOF
16731
16732 ac_header_dirent=$ac_hdr; break
16733 fi
16734
16735 done
16736 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16737 if test $ac_header_dirent = dirent.h; then
16738   echo "$as_me:16738: checking for opendir in -ldir" >&5
16739 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16740 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16741   echo $ECHO_N "(cached) $ECHO_C" >&6
16742 else
16743   ac_check_lib_save_LIBS=$LIBS
16744 LIBS="-ldir  $LIBS"
16745 cat >"conftest.$ac_ext" <<_ACEOF
16746 #line 16746 "configure"
16747 #include "confdefs.h"
16748
16749 /* Override any gcc2 internal prototype to avoid an error.  */
16750 #ifdef __cplusplus
16751 extern "C"
16752 #endif
16753 /* We use char because int might match the return type of a gcc2
16754    builtin and then its argument prototype would still apply.  */
16755 char opendir ();
16756 int
16757 main (void)
16758 {
16759 opendir ();
16760   ;
16761   return 0;
16762 }
16763 _ACEOF
16764 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16765 if { (eval echo "$as_me:16765: \"$ac_link\"") >&5
16766   (eval $ac_link) 2>&5
16767   ac_status=$?
16768   echo "$as_me:16768: \$? = $ac_status" >&5
16769   (exit "$ac_status"); } &&
16770          { ac_try='test -s "conftest$ac_exeext"'
16771   { (eval echo "$as_me:16771: \"$ac_try\"") >&5
16772   (eval $ac_try) 2>&5
16773   ac_status=$?
16774   echo "$as_me:16774: \$? = $ac_status" >&5
16775   (exit "$ac_status"); }; }; then
16776   ac_cv_lib_dir_opendir=yes
16777 else
16778   echo "$as_me: failed program was:" >&5
16779 cat "conftest.$ac_ext" >&5
16780 ac_cv_lib_dir_opendir=no
16781 fi
16782 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16783 LIBS=$ac_check_lib_save_LIBS
16784 fi
16785 echo "$as_me:16785: result: $ac_cv_lib_dir_opendir" >&5
16786 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16787 if test "$ac_cv_lib_dir_opendir" = yes; then
16788   LIBS="$LIBS -ldir"
16789 fi
16790
16791 else
16792   echo "$as_me:16792: checking for opendir in -lx" >&5
16793 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16794 if test "${ac_cv_lib_x_opendir+set}" = set; then
16795   echo $ECHO_N "(cached) $ECHO_C" >&6
16796 else
16797   ac_check_lib_save_LIBS=$LIBS
16798 LIBS="-lx  $LIBS"
16799 cat >"conftest.$ac_ext" <<_ACEOF
16800 #line 16800 "configure"
16801 #include "confdefs.h"
16802
16803 /* Override any gcc2 internal prototype to avoid an error.  */
16804 #ifdef __cplusplus
16805 extern "C"
16806 #endif
16807 /* We use char because int might match the return type of a gcc2
16808    builtin and then its argument prototype would still apply.  */
16809 char opendir ();
16810 int
16811 main (void)
16812 {
16813 opendir ();
16814   ;
16815   return 0;
16816 }
16817 _ACEOF
16818 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16819 if { (eval echo "$as_me:16819: \"$ac_link\"") >&5
16820   (eval $ac_link) 2>&5
16821   ac_status=$?
16822   echo "$as_me:16822: \$? = $ac_status" >&5
16823   (exit "$ac_status"); } &&
16824          { ac_try='test -s "conftest$ac_exeext"'
16825   { (eval echo "$as_me:16825: \"$ac_try\"") >&5
16826   (eval $ac_try) 2>&5
16827   ac_status=$?
16828   echo "$as_me:16828: \$? = $ac_status" >&5
16829   (exit "$ac_status"); }; }; then
16830   ac_cv_lib_x_opendir=yes
16831 else
16832   echo "$as_me: failed program was:" >&5
16833 cat "conftest.$ac_ext" >&5
16834 ac_cv_lib_x_opendir=no
16835 fi
16836 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16837 LIBS=$ac_check_lib_save_LIBS
16838 fi
16839 echo "$as_me:16839: result: $ac_cv_lib_x_opendir" >&5
16840 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16841 if test "$ac_cv_lib_x_opendir" = yes; then
16842   LIBS="$LIBS -lx"
16843 fi
16844
16845 fi
16846
16847 echo "$as_me:16847: checking whether time.h and sys/time.h may both be included" >&5
16848 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16849 if test "${ac_cv_header_time+set}" = set; then
16850   echo $ECHO_N "(cached) $ECHO_C" >&6
16851 else
16852   cat >"conftest.$ac_ext" <<_ACEOF
16853 #line 16853 "configure"
16854 #include "confdefs.h"
16855 #include <sys/types.h>
16856 #include <sys/time.h>
16857 #include <time.h>
16858
16859 int
16860 main (void)
16861 {
16862 if ((struct tm *) 0)
16863 return 0;
16864   ;
16865   return 0;
16866 }
16867 _ACEOF
16868 rm -f "conftest.$ac_objext"
16869 if { (eval echo "$as_me:16869: \"$ac_compile\"") >&5
16870   (eval $ac_compile) 2>&5
16871   ac_status=$?
16872   echo "$as_me:16872: \$? = $ac_status" >&5
16873   (exit "$ac_status"); } &&
16874          { ac_try='test -s "conftest.$ac_objext"'
16875   { (eval echo "$as_me:16875: \"$ac_try\"") >&5
16876   (eval $ac_try) 2>&5
16877   ac_status=$?
16878   echo "$as_me:16878: \$? = $ac_status" >&5
16879   (exit "$ac_status"); }; }; then
16880   ac_cv_header_time=yes
16881 else
16882   echo "$as_me: failed program was:" >&5
16883 cat "conftest.$ac_ext" >&5
16884 ac_cv_header_time=no
16885 fi
16886 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16887 fi
16888 echo "$as_me:16888: result: $ac_cv_header_time" >&5
16889 echo "${ECHO_T}$ac_cv_header_time" >&6
16890 if test $ac_cv_header_time = yes; then
16891
16892 cat >>confdefs.h <<\EOF
16893 #define TIME_WITH_SYS_TIME 1
16894 EOF
16895
16896 fi
16897
16898 ###     checks for compiler characteristics
16899 ac_ext=c
16900 ac_cpp='$CPP $CPPFLAGS'
16901 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16902 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16903 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16904 ac_main_return="return"
16905
16906 echo "$as_me:16906: checking for an ANSI C-conforming const" >&5
16907 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16908 if test "${ac_cv_c_const+set}" = set; then
16909   echo $ECHO_N "(cached) $ECHO_C" >&6
16910 else
16911   cat >"conftest.$ac_ext" <<_ACEOF
16912 #line 16912 "configure"
16913 #include "confdefs.h"
16914
16915 int
16916 main (void)
16917 {
16918 /* FIXME: Include the comments suggested by Paul. */
16919 #ifndef __cplusplus
16920   /* Ultrix mips cc rejects this.  */
16921   typedef int charset[2];
16922   const charset x;
16923   /* SunOS 4.1.1 cc rejects this.  */
16924   char const *const *ccp;
16925   char **p;
16926   /* NEC SVR4.0.2 mips cc rejects this.  */
16927   struct point {int x, y;};
16928   static struct point const zero = {0,0};
16929   /* AIX XL C 1.02.0.0 rejects this.
16930      It does not let you subtract one const X* pointer from another in
16931      an arm of an if-expression whose if-part is not a constant
16932      expression */
16933   const char *g = "string";
16934   ccp = &g + (g ? g-g : 0);
16935   /* HPUX 7.0 cc rejects these. */
16936   ++ccp;
16937   p = (char**) ccp;
16938   ccp = (char const *const *) p;
16939   { /* SCO 3.2v4 cc rejects this.  */
16940     char *t;
16941     char const *s = 0 ? (char *) 0 : (char const *) 0;
16942
16943     *t++ = 0;
16944   }
16945   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16946     int x[] = {25, 17};
16947     const int *foo = &x[0];
16948     ++foo;
16949   }
16950   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16951     typedef const int *iptr;
16952     iptr p = 0;
16953     ++p;
16954   }
16955   { /* AIX XL C 1.02.0.0 rejects this saying
16956        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16957     struct s { int j; const int *ap[3]; };
16958     struct s *b; b->j = 5;
16959   }
16960   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16961     const int foo = 10;
16962   }
16963 #endif
16964
16965   ;
16966   return 0;
16967 }
16968 _ACEOF
16969 rm -f "conftest.$ac_objext"
16970 if { (eval echo "$as_me:16970: \"$ac_compile\"") >&5
16971   (eval $ac_compile) 2>&5
16972   ac_status=$?
16973   echo "$as_me:16973: \$? = $ac_status" >&5
16974   (exit "$ac_status"); } &&
16975          { ac_try='test -s "conftest.$ac_objext"'
16976   { (eval echo "$as_me:16976: \"$ac_try\"") >&5
16977   (eval $ac_try) 2>&5
16978   ac_status=$?
16979   echo "$as_me:16979: \$? = $ac_status" >&5
16980   (exit "$ac_status"); }; }; then
16981   ac_cv_c_const=yes
16982 else
16983   echo "$as_me: failed program was:" >&5
16984 cat "conftest.$ac_ext" >&5
16985 ac_cv_c_const=no
16986 fi
16987 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16988 fi
16989 echo "$as_me:16989: result: $ac_cv_c_const" >&5
16990 echo "${ECHO_T}$ac_cv_c_const" >&6
16991 if test $ac_cv_c_const = no; then
16992
16993 cat >>confdefs.h <<\EOF
16994 #define const
16995 EOF
16996
16997 fi
16998
16999 ###     Checks for external-data
17000
17001 echo "$as_me:17001: checking if data-only library module links" >&5
17002 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17003 if test "${cf_cv_link_dataonly+set}" = set; then
17004   echo $ECHO_N "(cached) $ECHO_C" >&6
17005 else
17006
17007         rm -f conftest.a
17008         cat >conftest.$ac_ext <<EOF
17009 #line 17009 "configure"
17010 int     testdata[3] = { 123, 456, 789 };
17011 EOF
17012         if { (eval echo "$as_me:17012: \"$ac_compile\"") >&5
17013   (eval $ac_compile) 2>&5
17014   ac_status=$?
17015   echo "$as_me:17015: \$? = $ac_status" >&5
17016   (exit "$ac_status"); } ; then
17017                 mv conftest.o data.o && \
17018                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17019         fi
17020         rm -f conftest.$ac_ext data.o
17021         cat >conftest.$ac_ext <<EOF
17022 #line 17022 "configure"
17023 int     testfunc(void)
17024 {
17025 #if defined(NeXT)
17026         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17027 #else
17028         extern int testdata[3];
17029         return testdata[0] == 123
17030            &&  testdata[1] == 456
17031            &&  testdata[2] == 789;
17032 #endif
17033 }
17034 EOF
17035         if { (eval echo "$as_me:17035: \"$ac_compile\"") >&5
17036   (eval $ac_compile) 2>&5
17037   ac_status=$?
17038   echo "$as_me:17038: \$? = $ac_status" >&5
17039   (exit "$ac_status"); }; then
17040                 mv conftest.o func.o && \
17041                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17042         fi
17043         rm -f conftest.$ac_ext func.o
17044         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17045         cf_saveLIBS="$LIBS"
17046         LIBS="conftest.a $LIBS"
17047         if test "$cross_compiling" = yes; then
17048   cf_cv_link_dataonly=unknown
17049 else
17050   cat >"conftest.$ac_ext" <<_ACEOF
17051 #line 17051 "configure"
17052 #include "confdefs.h"
17053
17054         int main(void)
17055         {
17056                 extern int testfunc();
17057                 ${cf_cv_main_return:-return} (!testfunc());
17058         }
17059
17060 _ACEOF
17061 rm -f "conftest$ac_exeext"
17062 if { (eval echo "$as_me:17062: \"$ac_link\"") >&5
17063   (eval $ac_link) 2>&5
17064   ac_status=$?
17065   echo "$as_me:17065: \$? = $ac_status" >&5
17066   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17067   { (eval echo "$as_me:17067: \"$ac_try\"") >&5
17068   (eval $ac_try) 2>&5
17069   ac_status=$?
17070   echo "$as_me:17070: \$? = $ac_status" >&5
17071   (exit "$ac_status"); }; }; then
17072   cf_cv_link_dataonly=yes
17073 else
17074   echo "$as_me: program exited with status $ac_status" >&5
17075 echo "$as_me: failed program was:" >&5
17076 cat "conftest.$ac_ext" >&5
17077 cf_cv_link_dataonly=no
17078 fi
17079 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17080 fi
17081         LIBS="$cf_saveLIBS"
17082
17083 fi
17084
17085 echo "$as_me:17085: result: $cf_cv_link_dataonly" >&5
17086 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17087
17088 if test "$cf_cv_link_dataonly" = no ; then
17089
17090 cat >>confdefs.h <<\EOF
17091 #define BROKEN_LINKER 1
17092 EOF
17093
17094         BROKEN_LINKER=1
17095 fi
17096
17097 ###     Checks for library functions.
17098
17099 for ac_header in \
17100 unistd.h \
17101
17102 do
17103 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17104 echo "$as_me:17104: checking for $ac_header" >&5
17105 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17106 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17107   echo $ECHO_N "(cached) $ECHO_C" >&6
17108 else
17109   cat >"conftest.$ac_ext" <<_ACEOF
17110 #line 17110 "configure"
17111 #include "confdefs.h"
17112 #include <$ac_header>
17113 _ACEOF
17114 if { (eval echo "$as_me:17114: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17115   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17116   ac_status=$?
17117   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17118   rm -f conftest.er1
17119   cat conftest.err >&5
17120   echo "$as_me:17120: \$? = $ac_status" >&5
17121   (exit "$ac_status"); } >/dev/null; then
17122   if test -s conftest.err; then
17123     ac_cpp_err=$ac_c_preproc_warn_flag
17124   else
17125     ac_cpp_err=
17126   fi
17127 else
17128   ac_cpp_err=yes
17129 fi
17130 if test -z "$ac_cpp_err"; then
17131   eval "$as_ac_Header=yes"
17132 else
17133   echo "$as_me: failed program was:" >&5
17134   cat "conftest.$ac_ext" >&5
17135   eval "$as_ac_Header=no"
17136 fi
17137 rm -f conftest.err "conftest.$ac_ext"
17138 fi
17139 echo "$as_me:17139: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17140 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17141 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17142   cat >>confdefs.h <<EOF
17143 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17144 EOF
17145
17146 fi
17147 done
17148
17149 echo "$as_me:17149: checking for working mkstemp" >&5
17150 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17151 if test "${cf_cv_func_mkstemp+set}" = set; then
17152   echo $ECHO_N "(cached) $ECHO_C" >&6
17153 else
17154
17155 rm -rf ./conftest*
17156 if test "$cross_compiling" = yes; then
17157   cf_cv_func_mkstemp=maybe
17158 else
17159   cat >"conftest.$ac_ext" <<_ACEOF
17160 #line 17160 "configure"
17161 #include "confdefs.h"
17162
17163 #include <sys/types.h>
17164 #ifdef HAVE_UNISTD_H
17165 #include <unistd.h>
17166 #endif
17167 #include <stdlib.h>
17168 #include <stdio.h>
17169 #include <string.h>
17170 #include <sys/stat.h>
17171 int main(void)
17172 {
17173         char *tmpl = "conftestXXXXXX";
17174         char name[2][80];
17175         int n;
17176         int result = 0;
17177         int fd;
17178         struct stat sb;
17179
17180         umask(077);
17181         for (n = 0; n < 2; ++n) {
17182                 strcpy(name[n], tmpl);
17183                 if ((fd = mkstemp(name[n])) >= 0) {
17184                         if (!strcmp(name[n], tmpl)
17185                          || stat(name[n], &sb) != 0
17186                          || (sb.st_mode & S_IFMT) != S_IFREG
17187                          || (sb.st_mode & 077) != 0) {
17188                                 result = 1;
17189                         }
17190                         close(fd);
17191                 }
17192         }
17193         if (result == 0
17194          && !strcmp(name[0], name[1]))
17195                 result = 1;
17196         ${cf_cv_main_return:-return}(result);
17197 }
17198
17199 _ACEOF
17200 rm -f "conftest$ac_exeext"
17201 if { (eval echo "$as_me:17201: \"$ac_link\"") >&5
17202   (eval $ac_link) 2>&5
17203   ac_status=$?
17204   echo "$as_me:17204: \$? = $ac_status" >&5
17205   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17206   { (eval echo "$as_me:17206: \"$ac_try\"") >&5
17207   (eval $ac_try) 2>&5
17208   ac_status=$?
17209   echo "$as_me:17209: \$? = $ac_status" >&5
17210   (exit "$ac_status"); }; }; then
17211   cf_cv_func_mkstemp=yes
17212
17213 else
17214   echo "$as_me: program exited with status $ac_status" >&5
17215 echo "$as_me: failed program was:" >&5
17216 cat "conftest.$ac_ext" >&5
17217 cf_cv_func_mkstemp=no
17218
17219 fi
17220 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17221 fi
17222
17223 fi
17224 echo "$as_me:17224: result: $cf_cv_func_mkstemp" >&5
17225 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17226 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17227         echo "$as_me:17227: checking for mkstemp" >&5
17228 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17229 if test "${ac_cv_func_mkstemp+set}" = set; then
17230   echo $ECHO_N "(cached) $ECHO_C" >&6
17231 else
17232   cat >"conftest.$ac_ext" <<_ACEOF
17233 #line 17233 "configure"
17234 #include "confdefs.h"
17235 #define mkstemp autoconf_temporary
17236 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17237 #undef mkstemp
17238
17239 #ifdef __cplusplus
17240 extern "C"
17241 #endif
17242
17243 /* We use char because int might match the return type of a gcc2
17244    builtin and then its argument prototype would still apply.  */
17245 char mkstemp (void);
17246
17247 int
17248 main (void)
17249 {
17250
17251 /* The GNU C library defines stubs for functions which it implements
17252     to always fail with ENOSYS.  Some functions are actually named
17253     something starting with __ and the normal name is an alias.  */
17254 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17255 #error found stub for mkstemp
17256 #endif
17257
17258         return mkstemp ();
17259   ;
17260   return 0;
17261 }
17262 _ACEOF
17263 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17264 if { (eval echo "$as_me:17264: \"$ac_link\"") >&5
17265   (eval $ac_link) 2>&5
17266   ac_status=$?
17267   echo "$as_me:17267: \$? = $ac_status" >&5
17268   (exit "$ac_status"); } &&
17269          { ac_try='test -s "conftest$ac_exeext"'
17270   { (eval echo "$as_me:17270: \"$ac_try\"") >&5
17271   (eval $ac_try) 2>&5
17272   ac_status=$?
17273   echo "$as_me:17273: \$? = $ac_status" >&5
17274   (exit "$ac_status"); }; }; then
17275   ac_cv_func_mkstemp=yes
17276 else
17277   echo "$as_me: failed program was:" >&5
17278 cat "conftest.$ac_ext" >&5
17279 ac_cv_func_mkstemp=no
17280 fi
17281 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17282 fi
17283 echo "$as_me:17283: result: $ac_cv_func_mkstemp" >&5
17284 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17285
17286 fi
17287 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17288
17289 cat >>confdefs.h <<\EOF
17290 #define HAVE_MKSTEMP 1
17291 EOF
17292
17293 fi
17294
17295 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17296         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17297         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17298 fi
17299
17300 cf_with_ada=yes
17301 if test "$cf_with_ada" != "no" ; then
17302
17303 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17304 do
17305
17306 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17307
17308         unset ac_cv_path_cf_TEMP_gnat
17309         unset cf_TEMP_gnat
17310         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17311 set dummy $cf_prog_gnat; ac_word=$2
17312 echo "$as_me:17312: checking for $ac_word" >&5
17313 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17314 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17315   echo $ECHO_N "(cached) $ECHO_C" >&6
17316 else
17317   case $cf_TEMP_gnat in
17318   [\\/]* | ?:[\\/]*)
17319   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17320   ;;
17321   *)
17322   ac_save_IFS=$IFS; IFS=$ac_path_separator
17323 ac_dummy="$PATH"
17324 for ac_dir in $ac_dummy; do
17325   IFS=$ac_save_IFS
17326   test -z "$ac_dir" && ac_dir=.
17327   if $as_executable_p "$ac_dir/$ac_word"; then
17328    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17329    echo "$as_me:17329: found $ac_dir/$ac_word" >&5
17330    break
17331 fi
17332 done
17333
17334   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17335   ;;
17336 esac
17337 fi
17338 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17339
17340 if test -n "$cf_TEMP_gnat"; then
17341   echo "$as_me:17341: result: $cf_TEMP_gnat" >&5
17342 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17343 else
17344   echo "$as_me:17344: result: no" >&5
17345 echo "${ECHO_T}no" >&6
17346 fi
17347
17348         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17349
17350         if test "x$cf_TEMP_gnat" != xno; then
17351                 unset cf_cv_gnat_version
17352                 unset cf_TEMP_gnat
17353
17354 echo "$as_me:17354: checking for $cf_prog_gnat version" >&5
17355 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17356 if test "${cf_cv_gnat_version+set}" = set; then
17357   echo $ECHO_N "(cached) $ECHO_C" >&6
17358 else
17359
17360 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17361         grep '[0-9].[0-9][0-9]*' |\
17362         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17363
17364 fi
17365 echo "$as_me:17365: result: $cf_cv_gnat_version" >&5
17366 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17367 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17368 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17369
17370         fi
17371         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17372
17373         unset cf_TEMP_gnat
17374         unset cf_cv_gnat_version
17375         unset ac_cv_path_cf_TEMP_gnat
17376 done
17377
17378 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17379         cf_ada_make=
17380         cf_cv_prog_gnat_correct=no
17381 else
17382         cf_ada_make=gnatmake
17383         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17384                 # gprconfig is newer than gnatmake; we can continue...
17385                 cf_ada_config="##"
17386         else
17387                 rm -rf ./conftest* ./*~conftest*
17388                 if mkdir conftest.src
17389                 then
17390                         cf_ada_config=""
17391                         cd conftest.src
17392                         for cf_gprconfig in Ada C
17393                         do
17394                                 echo "$as_me:17394: checking for gprconfig name for $cf_gprconfig" >&5
17395 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17396                                 if test "$cf_gprconfig" = C
17397                                 then
17398                                         for cf_gprconfig_param in \
17399                                                 "$cf_gprconfig,,,,GNATGCC" \
17400                                                 "$cf_gprconfig,,,,GCC" \
17401                                                 "$cf_gprconfig"
17402                                         do
17403                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17404                                                 test -n "$cf_gprconfig_value" && break
17405                                         done
17406                                 else
17407                                         cf_gprconfig_param=$cf_gprconfig
17408                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17409                                 fi
17410                                 if test -n "$cf_gprconfig_value"
17411                                 then
17412                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17413                                         echo "$as_me:17413: result: $cf_gprconfig_value" >&5
17414 echo "${ECHO_T}$cf_gprconfig_value" >&6
17415                                 else
17416                                         echo "$as_me:17416: result: missing" >&5
17417 echo "${ECHO_T}missing" >&6
17418                                         cf_ada_config="#"
17419                                         break
17420                                 fi
17421                         done
17422                         cd ..
17423                         rm -rf ./conftest* ./*~conftest*
17424                 fi
17425         fi
17426         if test "x$cf_ada_config" != "x#"
17427         then
17428
17429 echo "$as_me:17429: checking for gnat version" >&5
17430 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17431 if test "${cf_cv_gnat_version+set}" = set; then
17432   echo $ECHO_N "(cached) $ECHO_C" >&6
17433 else
17434
17435 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17436         grep '[0-9].[0-9][0-9]*' |\
17437         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17438
17439 fi
17440 echo "$as_me:17440: result: $cf_cv_gnat_version" >&5
17441 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17442 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17443
17444 case "$cf_cv_gnat_version" in
17445 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17446         cf_cv_prog_gnat_correct=yes
17447         ;;
17448 (*)
17449         { echo "$as_me:17449: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17450 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17451         cf_cv_prog_gnat_correct=no
17452         ;;
17453 esac
17454
17455                 # Extract the first word of "m4", so it can be a program name with args.
17456 set dummy m4; ac_word=$2
17457 echo "$as_me:17457: checking for $ac_word" >&5
17458 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17459 if test "${ac_cv_prog_M4_exists+set}" = set; then
17460   echo $ECHO_N "(cached) $ECHO_C" >&6
17461 else
17462   if test -n "$M4_exists"; then
17463   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17464 else
17465   ac_save_IFS=$IFS; IFS=$ac_path_separator
17466 ac_dummy="$PATH"
17467 for ac_dir in $ac_dummy; do
17468   IFS=$ac_save_IFS
17469   test -z "$ac_dir" && ac_dir=.
17470   $as_executable_p "$ac_dir/$ac_word" || continue
17471 ac_cv_prog_M4_exists="yes"
17472 echo "$as_me:17472: found $ac_dir/$ac_word" >&5
17473 break
17474 done
17475
17476   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17477 fi
17478 fi
17479 M4_exists=$ac_cv_prog_M4_exists
17480 if test -n "$M4_exists"; then
17481   echo "$as_me:17481: result: $M4_exists" >&5
17482 echo "${ECHO_T}$M4_exists" >&6
17483 else
17484   echo "$as_me:17484: result: no" >&5
17485 echo "${ECHO_T}no" >&6
17486 fi
17487
17488                 if test "$ac_cv_prog_M4_exists" = no; then
17489                         cf_cv_prog_gnat_correct=no
17490                         { echo "$as_me:17490: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17491 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17492                 fi
17493                 if test "$cf_cv_prog_gnat_correct" = yes; then
17494                         echo "$as_me:17494: checking if GNAT works" >&5
17495 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17496
17497 rm -rf ./conftest* ./*~conftest*
17498 cat >>conftest.ads <<CF_EOF
17499 procedure conftest;
17500 CF_EOF
17501 cat >>conftest.adb <<CF_EOF
17502 with Text_IO;
17503 with GNAT.OS_Lib;
17504 procedure conftest is
17505 begin
17506    Text_IO.Put ("Hello World");
17507    Text_IO.New_Line;
17508    GNAT.OS_Lib.OS_Exit (0);
17509 end conftest;
17510 CF_EOF
17511 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17512    if ( ./conftest 1>&5 2>&1 ) ; then
17513       cf_cv_prog_gnat_correct=yes
17514    else
17515       cf_cv_prog_gnat_correct=no
17516    fi
17517 else
17518    cf_cv_prog_gnat_correct=no
17519 fi
17520 rm -rf ./conftest* ./*~conftest*
17521
17522                         echo "$as_me:17522: result: $cf_cv_prog_gnat_correct" >&5
17523 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17524                 fi
17525         else
17526                 cf_cv_prog_gnat_correct=no
17527         fi
17528 fi
17529
17530         if test "$cf_cv_prog_gnat_correct" = yes; then
17531
17532         echo "$as_me:17532: checking optimization options for ADAFLAGS" >&5
17533 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17534         case "$CFLAGS" in
17535         (*-g*)
17536
17537         ADAFLAGS="$ADAFLAGS -g"
17538
17539                 ;;
17540         esac
17541         case "$CFLAGS" in
17542         (*-O*)
17543                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17544
17545         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17546
17547                 ;;
17548         esac
17549         echo "$as_me:17549: result: $ADAFLAGS" >&5
17550 echo "${ECHO_T}$ADAFLAGS" >&6
17551
17552 echo "$as_me:17552: checking if GNATPREP supports -T option" >&5
17553 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17554 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17555   echo $ECHO_N "(cached) $ECHO_C" >&6
17556 else
17557
17558 cf_cv_gnatprep_opt_t=no
17559 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17560
17561 fi
17562 echo "$as_me:17562: result: $cf_cv_gnatprep_opt_t" >&5
17563 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17564 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17565
17566 echo "$as_me:17566: checking if GNAT supports generics" >&5
17567 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17568 case "$cf_cv_gnat_version" in
17569 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17570         cf_gnat_generics=yes
17571         ;;
17572 (*)
17573         cf_gnat_generics=no
17574         ;;
17575 esac
17576 echo "$as_me:17576: result: $cf_gnat_generics" >&5
17577 echo "${ECHO_T}$cf_gnat_generics" >&6
17578
17579 if test "$cf_gnat_generics" = yes
17580 then
17581         cf_compile_generics=generics
17582         cf_generic_objects="\${GENOBJS}"
17583 else
17584         cf_compile_generics=
17585         cf_generic_objects=
17586 fi
17587
17588 echo "$as_me:17588: checking if GNAT supports SIGINT" >&5
17589 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17590 if test "${cf_cv_gnat_sigint+set}" = set; then
17591   echo $ECHO_N "(cached) $ECHO_C" >&6
17592 else
17593
17594 rm -rf ./conftest* ./*~conftest*
17595 cat >>conftest.ads <<CF_EOF
17596 with Ada.Interrupts.Names;
17597
17598 package ConfTest is
17599
17600    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17601    pragma Unreserve_All_Interrupts;
17602    pragma Warnings (On);
17603
17604    protected Process is
17605       procedure Stop;
17606       function Continue return Boolean;
17607       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17608    private
17609       Done : Boolean := False;
17610    end Process;
17611
17612 end ConfTest;
17613 CF_EOF
17614 cat >>conftest.adb <<CF_EOF
17615 package body ConfTest is
17616    protected body Process is
17617       procedure Stop is
17618       begin
17619          Done := True;
17620       end Stop;
17621       function Continue return Boolean is
17622       begin
17623          return not Done;
17624       end Continue;
17625    end Process;
17626 end ConfTest;
17627 CF_EOF
17628 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17629       cf_cv_gnat_sigint=yes
17630 else
17631    cf_cv_gnat_sigint=no
17632 fi
17633 rm -rf ./conftest* ./*~conftest*
17634
17635 fi
17636 echo "$as_me:17636: result: $cf_cv_gnat_sigint" >&5
17637 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17638
17639 if test "$cf_cv_gnat_sigint" = yes ; then
17640         USE_GNAT_SIGINT=""
17641 else
17642         USE_GNAT_SIGINT="#"
17643 fi
17644
17645 cf_gnat_libraries=no
17646 cf_gnat_projects=no
17647
17648 if test "$enable_gnat_projects" != no ; then
17649 echo "$as_me:17649: checking if GNAT supports project files" >&5
17650 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17651 case "$cf_cv_gnat_version" in
17652 (3.[0-9]*)
17653         ;;
17654 (*)
17655         case "$cf_cv_system_name" in
17656         (cygwin*|msys*)
17657                 ;;
17658         (*)
17659                 rm -rf ./conftest* ./*~conftest*
17660                 if mkdir conftest.src conftest.bin conftest.lib
17661                 then
17662                         cd conftest.src
17663                         rm -rf ./conftest* ./*~conftest*
17664                         cat >>library.gpr <<CF_EOF
17665 project Library is
17666   Kind := External ("LIB_KIND");
17667   for Library_Name use "ConfTest";
17668   for Object_Dir use ".";
17669   for Library_ALI_Dir use External("LIBRARY_DIR");
17670   for Library_Version use External ("SONAME");
17671   for Library_Kind use Kind;
17672   for Library_Dir use External("BUILD_DIR");
17673   Source_Dir := External ("SOURCE_DIR");
17674   for Source_Dirs use (Source_Dir);
17675 end Library;
17676 CF_EOF
17677                         cat >>confpackage.ads <<CF_EOF
17678 package ConfPackage is
17679    procedure conftest;
17680 end ConfPackage;
17681 CF_EOF
17682                         cat >>confpackage.adb <<CF_EOF
17683 with Text_IO;
17684 package body ConfPackage is
17685    procedure conftest is
17686    begin
17687       Text_IO.Put ("Hello World");
17688       Text_IO.New_Line;
17689    end conftest;
17690 end ConfPackage;
17691 CF_EOF
17692                         if ( "$cf_ada_make" $ADAFLAGS \
17693                                         -Plibrary.gpr \
17694                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17695                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17696                                         -XSOURCE_DIR="`pwd`" \
17697                                         -XSONAME=libConfTest.so.1 \
17698                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17699                                 cf_gnat_projects=yes
17700                         fi
17701                         cd ..
17702                 fi
17703                 if test -f conftest.lib/confpackage.ali
17704                 then
17705                         cf_gnat_libraries=yes
17706                 fi
17707                 rm -rf ./conftest* ./*~conftest*
17708                 ;;
17709         esac
17710         ;;
17711 esac
17712 echo "$as_me:17712: result: $cf_gnat_projects" >&5
17713 echo "${ECHO_T}$cf_gnat_projects" >&6
17714 fi # enable_gnat_projects
17715
17716 if test "$cf_gnat_projects" = yes
17717 then
17718         echo "$as_me:17718: checking if GNAT supports libraries" >&5
17719 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17720         echo "$as_me:17720: result: $cf_gnat_libraries" >&5
17721 echo "${ECHO_T}$cf_gnat_libraries" >&6
17722 fi
17723
17724 USE_OLD_MAKERULES=""
17725 USE_GNAT_PROJECTS="#"
17726 USE_GNAT_MAKE_GPR="#"
17727 USE_GNAT_GPRBUILD="#"
17728
17729 if test "$cf_gnat_projects" = yes
17730 then
17731         USE_OLD_MAKERULES="#"
17732         USE_GNAT_PROJECTS=""
17733         if test "$cf_cv_VERSION_GPRBUILD" != no
17734         then
17735                 USE_GNAT_GPRBUILD=""
17736         elif test "$cf_cv_VERSION_GNATMAKE" != no
17737         then
17738                 USE_GNAT_MAKE_GPR=""
17739         else
17740                 { echo "$as_me:17740: WARNING: use old makefile rules since tools are missing" >&5
17741 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17742         fi
17743 fi
17744
17745 if test "$cf_gnat_libraries" = yes
17746 then
17747         USE_GNAT_LIBRARIES=""
17748 else
17749         USE_GNAT_LIBRARIES="#"
17750 fi
17751
17752 echo "$as_me:17752: checking for ada-compiler" >&5
17753 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17754
17755 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17756 if test "${with_ada_compiler+set}" = set; then
17757   withval="$with_ada_compiler"
17758   cf_ada_compiler=$withval
17759 else
17760   cf_ada_compiler=gnatmake
17761 fi;
17762
17763 echo "$as_me:17763: result: $cf_ada_compiler" >&5
17764 echo "${ECHO_T}$cf_ada_compiler" >&6
17765
17766                 cf_ada_package=terminal_interface
17767
17768 echo "$as_me:17768: checking for ada-include" >&5
17769 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17770
17771 # Check whether --with-ada-include or --without-ada-include was given.
17772 if test "${with_ada_include+set}" = set; then
17773   withval="$with_ada_include"
17774
17775 else
17776   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17777 fi; if test -n "$prefix/share/ada/adainclude" ; then
17778
17779 if test "x$prefix" != xNONE; then
17780         cf_path_syntax="$prefix"
17781 else
17782         cf_path_syntax="$ac_default_prefix"
17783 fi
17784
17785 case ".$withval" in
17786 (.\$\(*\)*|.\'*\'*)
17787         ;;
17788 (..|./*|.\\*)
17789         ;;
17790 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17791         ;;
17792 (.\$\{*prefix\}*|.\$\{*dir\}*)
17793         eval withval="$withval"
17794         case ".$withval" in
17795         (.NONE/*)
17796                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17797                 ;;
17798         esac
17799         ;;
17800 (.no|.NONE/*)
17801         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17802         ;;
17803 (*)
17804         { { echo "$as_me:17804: error: expected a pathname, not \"$withval\"" >&5
17805 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17806    { (exit 1); exit 1; }; }
17807         ;;
17808 esac
17809
17810 fi
17811 eval ADA_INCLUDE="$withval"
17812
17813 echo "$as_me:17813: result: $ADA_INCLUDE" >&5
17814 echo "${ECHO_T}$ADA_INCLUDE" >&6
17815
17816 echo "$as_me:17816: checking for ada-objects" >&5
17817 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17818
17819 # Check whether --with-ada-objects or --without-ada-objects was given.
17820 if test "${with_ada_objects+set}" = set; then
17821   withval="$with_ada_objects"
17822
17823 else
17824   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17825 fi; if test -n "$prefix/lib/ada/adalib" ; then
17826
17827 if test "x$prefix" != xNONE; then
17828         cf_path_syntax="$prefix"
17829 else
17830         cf_path_syntax="$ac_default_prefix"
17831 fi
17832
17833 case ".$withval" in
17834 (.\$\(*\)*|.\'*\'*)
17835         ;;
17836 (..|./*|.\\*)
17837         ;;
17838 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17839         ;;
17840 (.\$\{*prefix\}*|.\$\{*dir\}*)
17841         eval withval="$withval"
17842         case ".$withval" in
17843         (.NONE/*)
17844                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17845                 ;;
17846         esac
17847         ;;
17848 (.no|.NONE/*)
17849         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17850         ;;
17851 (*)
17852         { { echo "$as_me:17852: error: expected a pathname, not \"$withval\"" >&5
17853 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17854    { (exit 1); exit 1; }; }
17855         ;;
17856 esac
17857
17858 fi
17859 eval ADA_OBJECTS="$withval"
17860
17861 echo "$as_me:17861: result: $ADA_OBJECTS" >&5
17862 echo "${ECHO_T}$ADA_OBJECTS" >&6
17863
17864 echo "$as_me:17864: checking if an Ada95 shared-library should be built" >&5
17865 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17866
17867 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17868 if test "${with_ada_sharedlib+set}" = set; then
17869   withval="$with_ada_sharedlib"
17870   with_ada_sharedlib=$withval
17871 else
17872   with_ada_sharedlib=no
17873 fi;
17874 echo "$as_me:17874: result: $with_ada_sharedlib" >&5
17875 echo "${ECHO_T}$with_ada_sharedlib" >&6
17876
17877 if test "x$with_ada_sharedlib" != xno
17878 then
17879         if test "x$cf_gnat_projects" != xyes
17880         then
17881                 { echo "$as_me:17881: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17882 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17883                 with_ada_sharedlib=no
17884         fi
17885 fi
17886
17887 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17888 MAKE_ADA_SHAREDLIB="#"
17889
17890 if test "x$with_ada_sharedlib" != xno
17891 then
17892         MAKE_ADA_SHAREDLIB=
17893         if test "x$with_ada_sharedlib" != xyes
17894         then
17895                 ADA_SHAREDLIB="$with_ada_sharedlib"
17896         fi
17897 fi
17898
17899                 # allow the Ada binding to be renamed
17900
17901 echo "$as_me:17901: checking for ada-libname" >&5
17902 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17903
17904 # Check whether --with-ada-libname or --without-ada-libname was given.
17905 if test "${with_ada_libname+set}" = set; then
17906   withval="$with_ada_libname"
17907   ADA_LIBNAME=$withval
17908 else
17909   ADA_LIBNAME=AdaCurses
17910 fi;
17911 case "x$ADA_LIBNAME" in
17912 (x|xyes|xno)
17913         ADA_LIBNAME=AdaCurses
17914         ;;
17915 esac
17916
17917 echo "$as_me:17917: result: $ADA_LIBNAME" >&5
17918 echo "${ECHO_T}$ADA_LIBNAME" >&6
17919
17920         else
17921                 { { echo "$as_me:17921: error: No usable Ada compiler found" >&5
17922 echo "$as_me: error: No usable Ada compiler found" >&2;}
17923    { (exit 1); exit 1; }; }
17924         fi
17925 else
17926         { { echo "$as_me:17926: error: The Ada compiler is needed for this package" >&5
17927 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17928    { (exit 1); exit 1; }; }
17929 fi
17930
17931 ################################################################################
17932
17933 # not needed
17934 TINFO_LDFLAGS2=
17935
17936 TINFO_LIBS=
17937
17938 ### Construct the list of include-directories to be generated
17939
17940 if test "$srcdir" != "."; then
17941         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17942 fi
17943 CPPFLAGS="-I../include $CPPFLAGS"
17944 if test "$srcdir" != "."; then
17945         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17946 fi
17947 CPPFLAGS="-I. $CPPFLAGS"
17948
17949 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17950 if test "$srcdir" != "."; then
17951         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17952 fi
17953 if test "$GCC" != yes; then
17954         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17955 elif test "$includedir" != "/usr/include"; then
17956         if test "$includedir" = '${prefix}/include' ; then
17957                 if test x$prefix != x/usr ; then
17958                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17959                 fi
17960         else
17961                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17962         fi
17963 fi
17964
17965 ### Build up pieces for makefile rules
17966 echo "$as_me:17966: checking default library suffix" >&5
17967 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17968
17969         case $DFT_LWR_MODEL in
17970         (libtool) DFT_ARG_SUFFIX=''   ;;
17971         (normal)  DFT_ARG_SUFFIX=''   ;;
17972         (debug)   DFT_ARG_SUFFIX='_g' ;;
17973         (profile) DFT_ARG_SUFFIX='_p' ;;
17974         (shared)  DFT_ARG_SUFFIX=''   ;;
17975         esac
17976         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17977 echo "$as_me:17977: result: $DFT_ARG_SUFFIX" >&5
17978 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17979
17980 echo "$as_me:17980: checking default library-dependency suffix" >&5
17981 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17982
17983         case X$DFT_LWR_MODEL in
17984         (Xlibtool)
17985                 DFT_LIB_SUFFIX='.la'
17986                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17987                 ;;
17988         (Xdebug)
17989                 case "$cf_cv_system_name" in
17990                 (*-msvc*)
17991                         DFT_LIB_SUFFIX='_g.lib'
17992                         ;;
17993                 (*)
17994                         DFT_LIB_SUFFIX='_g.a'
17995                         ;;
17996                 esac
17997                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17998                 ;;
17999         (Xprofile)
18000                 case "$cf_cv_system_name" in
18001                 (*-msvc*)
18002                         DFT_LIB_SUFFIX='_p.lib'
18003                         ;;
18004                 (*)
18005                         DFT_LIB_SUFFIX='_p.a'
18006                         ;;
18007                 esac
18008                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18009                 ;;
18010         (Xshared)
18011                 case "$cf_cv_system_name" in
18012                 (aix[5-7]*)
18013                         DFT_LIB_SUFFIX='.so'
18014                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18015                         ;;
18016                 (*-msvc*)
18017                         DFT_LIB_SUFFIX='.dll'
18018                         DFT_DEP_SUFFIX='.dll.lib'
18019                         ;;
18020                 (cygwin*|msys*|mingw*)
18021                         DFT_LIB_SUFFIX='.dll'
18022                         DFT_DEP_SUFFIX='.dll.a'
18023                         ;;
18024                 (darwin*)
18025                         DFT_LIB_SUFFIX='.dylib'
18026                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18027                         ;;
18028                 (hpux*)
18029                         case "$target" in
18030                         (ia64*)
18031                                 DFT_LIB_SUFFIX='.so'
18032                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18033                                 ;;
18034                         (*)
18035                                 DFT_LIB_SUFFIX='.sl'
18036                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18037                                 ;;
18038                         esac
18039                         ;;
18040                 (*)
18041                         DFT_LIB_SUFFIX='.so'
18042                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18043                         ;;
18044                 esac
18045                 ;;
18046         (*)
18047                 case "$target" in
18048                 (*-msvc*)
18049                         DFT_LIB_SUFFIX='.lib'
18050                         ;;
18051                 (*)
18052                         DFT_LIB_SUFFIX='.a'
18053                         ;;
18054                 esac
18055                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18056                 ;;
18057         esac
18058         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18059         then
18060                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18061                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18062         fi
18063 echo "$as_me:18063: result: $DFT_DEP_SUFFIX" >&5
18064 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18065
18066 echo "$as_me:18066: checking default object directory" >&5
18067 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18068
18069         case $DFT_LWR_MODEL in
18070         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18071         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18072         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18073         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18074         (shared)
18075                 case "$cf_cv_system_name" in
18076                 (cygwin|msys)
18077                         DFT_OBJ_SUBDIR='objects' ;;
18078                 (*)
18079                         DFT_OBJ_SUBDIR='obj_s' ;;
18080                 esac
18081         esac
18082 echo "$as_me:18082: result: $DFT_OBJ_SUBDIR" >&5
18083 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18084
18085 ### Set up low-level terminfo dependencies for makefiles.
18086
18087 if test "$DFT_LWR_MODEL" = shared ; then
18088         case $cf_cv_system_name in
18089         (cygwin*)
18090                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18091                 ;;
18092         (msys*)
18093                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18094                 ;;
18095         esac
18096 fi
18097
18098 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18099
18100 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18101
18102 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18103
18104 ### Construct the list of subdirectories for which we'll customize makefiles
18105 ### with the appropriate compile-rules.
18106
18107 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18108
18109 cat >>confdefs.h <<EOF
18110 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18111 EOF
18112
18113 ################################################################################
18114
18115 TEST_ARG2=
18116
18117 TEST_LIBS2=
18118
18119 NCURSES_SHLIB2="sh -c"
18120
18121 ADA_SUBDIRS="include gen src doc"
18122 if test "x$cf_with_tests" != "xno" ; then
18123         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18124 fi
18125 for cf_dir in $ADA_SUBDIRS
18126 do
18127         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18128 done
18129
18130 NCURSES_TREE="#"
18131
18132 EXTERNAL_TREE=
18133
18134 # match layout used by make-tar.sh
18135 ADAHTML_DIR=../doc/ada
18136
18137 if test "x$cross_compiling" = xyes ; then
18138         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18139 else
18140         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18141 fi
18142
18143 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"
18144 ac_config_commands="$ac_config_commands default"
18145 cat >confcache <<\_ACEOF
18146 # This file is a shell script that caches the results of configure
18147 # tests run on this system so they can be shared between configure
18148 # scripts and configure runs, see configure's option --config-cache.
18149 # It is not useful on other systems.  If it contains results you don't
18150 # want to keep, you may remove or edit it.
18151 #
18152 # config.status only pays attention to the cache file if you give it
18153 # the --recheck option to rerun configure.
18154 #
18155 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18156 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18157 # following values.
18158
18159 _ACEOF
18160
18161 # The following way of writing the cache mishandles newlines in values,
18162 # but we know of no workaround that is simple, portable, and efficient.
18163 # So, don't put newlines in cache variables' values.
18164 # Ultrix sh set writes to stderr and can't be redirected directly,
18165 # and sets the high bit in the cache file unless we assign to the vars.
18166 {
18167   (set) 2>&1 |
18168     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18169     *ac_space=\ *)
18170       # `set' does not quote correctly, so add quotes (double-quote
18171       # substitution turns \\\\ into \\, and sed turns \\ into \).
18172       sed -n \
18173         "s/'/'\\\\''/g;
18174           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18175       ;;
18176     *)
18177       # `set' quotes correctly as required by POSIX, so do not add quotes.
18178       sed -n \
18179         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18180       ;;
18181     esac;
18182 } |
18183   sed '
18184      t clear
18185      : clear
18186      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18187      t end
18188      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18189      : end' >>confcache
18190 if cmp -s $cache_file confcache; then :; else
18191   if test -w $cache_file; then
18192     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18193     cat confcache >$cache_file
18194   else
18195     echo "not updating unwritable cache $cache_file"
18196   fi
18197 fi
18198 rm -f confcache
18199
18200 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18201 # Let make expand exec_prefix.
18202 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18203
18204 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18205 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18206 # trailing colons and then remove the whole line if VPATH becomes empty
18207 # (actually we leave an empty line to preserve line numbers).
18208 if test "x$srcdir" = x.; then
18209   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18210 s/:*\$(srcdir):*/:/;
18211 s/:*\${srcdir}:*/:/;
18212 s/:*@srcdir@:*/:/;
18213 s/^\([^=]*=[    ]*\):*/\1/;
18214 s/:*$//;
18215 s/^[^=]*=[      ]*$//;
18216 }'
18217 fi
18218
18219 DEFS=-DHAVE_CONFIG_H
18220
18221 : "${CONFIG_STATUS=./config.status}"
18222 ac_clean_files_save=$ac_clean_files
18223 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18224 { echo "$as_me:18224: creating $CONFIG_STATUS" >&5
18225 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18226 cat >"$CONFIG_STATUS" <<_ACEOF
18227 #! $SHELL
18228 # Generated automatically by configure.
18229 # Run this file to recreate the current configuration.
18230 # Compiler output produced by configure, useful for debugging
18231 # configure, is in config.log if it exists.
18232
18233 debug=false
18234 SHELL=\${CONFIG_SHELL-$SHELL}
18235 ac_cs_invocation="\$0 \$@"
18236
18237 CLICOLOR_FORCE= GREP_OPTIONS=
18238 unset CLICOLOR_FORCE GREP_OPTIONS
18239 _ACEOF
18240
18241 cat >>"$CONFIG_STATUS" <<\_ACEOF
18242 # Be Bourne compatible
18243 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18244   emulate sh
18245   NULLCMD=:
18246 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18247   set -o posix
18248 fi
18249
18250 # Name of the executable.
18251 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18252
18253 if expr a : '\(a\)' >/dev/null 2>&1; then
18254   as_expr=expr
18255 else
18256   as_expr=false
18257 fi
18258
18259 rm -f conf$$ conf$$.exe conf$$.file
18260 echo >conf$$.file
18261 if ln -s conf$$.file conf$$ 2>/dev/null; then
18262   # We could just check for DJGPP; but this test a) works b) is more generic
18263   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18264   if test -f conf$$.exe; then
18265     # Don't use ln at all; we don't have any links
18266     as_ln_s='cp -p'
18267   else
18268     as_ln_s='ln -s'
18269   fi
18270 elif ln conf$$.file conf$$ 2>/dev/null; then
18271   as_ln_s=ln
18272 else
18273   as_ln_s='cp -p'
18274 fi
18275 rm -f conf$$ conf$$.exe conf$$.file
18276
18277 as_executable_p="test -f"
18278
18279 # Support unset when possible.
18280 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18281   as_unset="unset"
18282 else
18283   as_unset="false"
18284 fi
18285
18286 # NLS nuisances.
18287 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18288 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18289 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18290 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18291 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18292 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18293 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18294 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18295
18296 # IFS
18297 # We need space, tab and new line, in precisely that order.
18298 as_nl='
18299 '
18300 IFS="   $as_nl"
18301
18302 # CDPATH.
18303 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18304
18305 exec 6>&1
18306
18307 _ACEOF
18308
18309 # Files that config.status was made for.
18310 if test -n "$ac_config_files"; then
18311   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18312 fi
18313
18314 if test -n "$ac_config_headers"; then
18315   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18316 fi
18317
18318 if test -n "$ac_config_links"; then
18319   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18320 fi
18321
18322 if test -n "$ac_config_commands"; then
18323   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18324 fi
18325
18326 cat >>"$CONFIG_STATUS" <<\EOF
18327
18328 ac_cs_usage="\
18329 \`$as_me' instantiates files from templates according to the
18330 current configuration.
18331
18332 Usage: $0 [OPTIONS] [FILE]...
18333
18334   -h, --help       print this help, then exit
18335   -V, --version    print version number, then exit
18336   -d, --debug      don't remove temporary files
18337       --recheck    update $as_me by reconfiguring in the same conditions
18338   --file=FILE[:TEMPLATE]
18339                    instantiate the configuration file FILE
18340   --header=FILE[:TEMPLATE]
18341                    instantiate the configuration header FILE
18342
18343 Configuration files:
18344 $config_files
18345
18346 Configuration headers:
18347 $config_headers
18348
18349 Configuration commands:
18350 $config_commands
18351
18352 Report bugs to <dickey@invisible-island.net>."
18353 EOF
18354
18355 cat >>"$CONFIG_STATUS" <<EOF
18356 ac_cs_version="\\
18357 config.status
18358 configured by $0, generated by GNU Autoconf 2.52.20210509,
18359   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18360
18361 Copyright 2003-2020,2021        Thomas E. Dickey
18362 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18363 Free Software Foundation, Inc.
18364 This config.status script is free software; the Free Software Foundation
18365 gives unlimited permission to copy, distribute and modify it."
18366 srcdir="$srcdir"
18367 INSTALL="$INSTALL"
18368 EOF
18369
18370 cat >>"$CONFIG_STATUS" <<\EOF
18371 # If no file are specified by the user, then we need to provide default
18372 # value.  By we need to know if files were specified by the user.
18373 ac_need_defaults=:
18374 while test $# != 0
18375 do
18376   case $1 in
18377   --*=*)
18378     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18379     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18380     shift
18381     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18382     shift
18383     ;;
18384   -*);;
18385   *) # This is not an option, so the user has probably given explicit
18386      # arguments.
18387      ac_need_defaults=false;;
18388   esac
18389
18390   case $1 in
18391   # Handling of the options.
18392 EOF
18393 cat >>"$CONFIG_STATUS" <<EOF
18394   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18395     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18396     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18397 EOF
18398 cat >>"$CONFIG_STATUS" <<\EOF
18399   --version | --vers* | -V )
18400     echo "$ac_cs_version"; exit 0 ;;
18401   --he | --h)
18402     # Conflict between --help and --header
18403     { { echo "$as_me:18403: error: ambiguous option: $1
18404 Try \`$0 --help' for more information." >&5
18405 echo "$as_me: error: ambiguous option: $1
18406 Try \`$0 --help' for more information." >&2;}
18407    { (exit 1); exit 1; }; };;
18408   --help | --hel | -h )
18409     echo "$ac_cs_usage"; exit 0 ;;
18410   --debug | --d* | -d )
18411     debug=: ;;
18412   --file | --fil | --fi | --f )
18413     shift
18414     CONFIG_FILES="$CONFIG_FILES $1"
18415     ac_need_defaults=false;;
18416   --header | --heade | --head | --hea )
18417     shift
18418     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18419     ac_need_defaults=false;;
18420
18421   # This is an error.
18422   -*) { { echo "$as_me:18422: error: unrecognized option: $1
18423 Try \`$0 --help' for more information." >&5
18424 echo "$as_me: error: unrecognized option: $1
18425 Try \`$0 --help' for more information." >&2;}
18426    { (exit 1); exit 1; }; } ;;
18427
18428   *) ac_config_targets="$ac_config_targets $1" ;;
18429
18430   esac
18431   shift
18432 done
18433
18434 exec 5>>config.log
18435 cat >&5 << _ACEOF
18436
18437 ## ----------------------- ##
18438 ## Running config.status.  ##
18439 ## ----------------------- ##
18440
18441 This file was extended by $as_me 2.52.20210509, executed with
18442   CONFIG_FILES    = $CONFIG_FILES
18443   CONFIG_HEADERS  = $CONFIG_HEADERS
18444   CONFIG_LINKS    = $CONFIG_LINKS
18445   CONFIG_COMMANDS = $CONFIG_COMMANDS
18446   > "$ac_cs_invocation"
18447 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18448
18449 _ACEOF
18450 EOF
18451
18452 cat >>"$CONFIG_STATUS" <<EOF
18453 #
18454 # INIT-COMMANDS section.
18455 #
18456
18457 ### Special initialization commands, used to pass information from the
18458 ### configuration-run into config.status
18459
18460 AWK="$AWK"
18461 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18462 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18463 LIB_NAME="$LIB_NAME"
18464 LIB_PREFIX="$LIB_PREFIX"
18465 LIB_SUFFIX="$LIB_SUFFIX"
18466 LN_S="$LN_S"
18467 NCURSES_MAJOR="$NCURSES_MAJOR"
18468 NCURSES_MINOR="$NCURSES_MINOR"
18469 NCURSES_PATCH="$NCURSES_PATCH"
18470 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18471 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18472 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18473 cf_cv_abi_version="$cf_cv_abi_version"
18474 cf_cv_rel_version="$cf_cv_rel_version"
18475 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18476 cf_cv_shared_soname='$cf_cv_shared_soname'
18477 cf_cv_shlib_version="$cf_cv_shlib_version"
18478 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18479 cf_cv_system_name="$cf_cv_system_name"
18480 host="$host"
18481 target="$target"
18482
18483 EOF
18484
18485 cat >>"$CONFIG_STATUS" <<\EOF
18486 for ac_config_target in $ac_config_targets
18487 do
18488   case "$ac_config_target" in
18489   # Handling of arguments.
18490   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18491   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18492   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18493   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18494   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18495   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18496   *) { { echo "$as_me:18496: error: invalid argument: $ac_config_target" >&5
18497 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18498    { (exit 1); exit 1; }; };;
18499   esac
18500 done
18501
18502 # If the user did not use the arguments to specify the items to instantiate,
18503 # then the envvar interface is used.  Set only those that are not.
18504 # We use the long form for the default assignment because of an extremely
18505 # bizarre bug on SunOS 4.1.3.
18506 if "$ac_need_defaults"; then
18507   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18508   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18509   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18510 fi
18511
18512 # Create a temporary directory, and hook for its removal unless debugging.
18513 $debug ||
18514 {
18515   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18516   trap '{ (exit 1); exit 1; }' 1 2 13 15
18517 }
18518
18519 # Create a (secure) tmp directory for tmp files.
18520 : ${TMPDIR=/tmp}
18521 {
18522   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18523   test -n "$tmp" && test -d "$tmp"
18524 }  ||
18525 {
18526   tmp=$TMPDIR/cs$$-$RANDOM
18527   (umask 077 && mkdir $tmp)
18528 } ||
18529 {
18530    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18531    { (exit 1); exit 1; }
18532 }
18533
18534 EOF
18535
18536 cat >>"$CONFIG_STATUS" <<EOF
18537
18538 #
18539 # CONFIG_FILES section.
18540 #
18541
18542 # No need to generate the scripts if there are no CONFIG_FILES.
18543 # This happens for instance when ./config.status config.h
18544 if test -n "\$CONFIG_FILES"; then
18545   # Protect against being on the right side of a sed subst in config.status.
18546   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18547    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18548 s,@SHELL@,$SHELL,;t t
18549 s,@exec_prefix@,$exec_prefix,;t t
18550 s,@prefix@,$prefix,;t t
18551 s,@program_transform_name@,$program_transform_name,;t t
18552 s,@bindir@,$bindir,;t t
18553 s,@sbindir@,$sbindir,;t t
18554 s,@libexecdir@,$libexecdir,;t t
18555 s,@datarootdir@,$datarootdir,;t t
18556 s,@datadir@,$datadir,;t t
18557 s,@sysconfdir@,$sysconfdir,;t t
18558 s,@sharedstatedir@,$sharedstatedir,;t t
18559 s,@localstatedir@,$localstatedir,;t t
18560 s,@runstatedir@,$runstatedir,;t t
18561 s,@libdir@,$libdir,;t t
18562 s,@includedir@,$includedir,;t t
18563 s,@oldincludedir@,$oldincludedir,;t t
18564 s,@infodir@,$infodir,;t t
18565 s,@mandir@,$mandir,;t t
18566 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18567 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18568 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18569 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18570 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18571 s,@build_alias@,$build_alias,;t t
18572 s,@host_alias@,$host_alias,;t t
18573 s,@target_alias@,$target_alias,;t t
18574 s,@ECHO_C@,$ECHO_C,;t t
18575 s,@ECHO_N@,$ECHO_N,;t t
18576 s,@ECHO_T@,$ECHO_T,;t t
18577 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18578 s,@DEFS@,$DEFS,;t t
18579 s,@LIBS@,$LIBS,;t t
18580 s,@top_builddir@,$top_builddir,;t t
18581 s,@build@,$build,;t t
18582 s,@build_cpu@,$build_cpu,;t t
18583 s,@build_vendor@,$build_vendor,;t t
18584 s,@build_os@,$build_os,;t t
18585 s,@host@,$host,;t t
18586 s,@host_cpu@,$host_cpu,;t t
18587 s,@host_vendor@,$host_vendor,;t t
18588 s,@host_os@,$host_os,;t t
18589 s,@target@,$target,;t t
18590 s,@target_cpu@,$target_cpu,;t t
18591 s,@target_vendor@,$target_vendor,;t t
18592 s,@target_os@,$target_os,;t t
18593 s,@GREP@,$GREP,;t t
18594 s,@FGREP@,$FGREP,;t t
18595 s,@CC@,$CC,;t t
18596 s,@CFLAGS@,$CFLAGS,;t t
18597 s,@LDFLAGS@,$LDFLAGS,;t t
18598 s,@CPPFLAGS@,$CPPFLAGS,;t t
18599 s,@ac_ct_CC@,$ac_ct_CC,;t t
18600 s,@EXEEXT@,$EXEEXT,;t t
18601 s,@OBJEXT@,$OBJEXT,;t t
18602 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18603 s,@CPP@,$CPP,;t t
18604 s,@EGREP@,$EGREP,;t t
18605 s,@AWK@,$AWK,;t t
18606 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18607 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18608 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18609 s,@LN_S@,$LN_S,;t t
18610 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18611 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18612 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18613 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18614 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18615 s,@SET_MAKE@,$SET_MAKE,;t t
18616 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18617 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18618 s,@CTAGS@,$CTAGS,;t t
18619 s,@ETAGS@,$ETAGS,;t t
18620 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18621 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18622 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18623 s,@RANLIB@,$RANLIB,;t t
18624 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18625 s,@LD@,$LD,;t t
18626 s,@ac_ct_LD@,$ac_ct_LD,;t t
18627 s,@AR@,$AR,;t t
18628 s,@ac_ct_AR@,$ac_ct_AR,;t t
18629 s,@ARFLAGS@,$ARFLAGS,;t t
18630 s,@DESTDIR@,$DESTDIR,;t t
18631 s,@BUILD_CC@,$BUILD_CC,;t t
18632 s,@BUILD_CPP@,$BUILD_CPP,;t t
18633 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18634 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18635 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18636 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18637 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18638 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18639 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18640 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18641 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18642 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18643 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18644 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18645 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18646 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18647 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18648 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18649 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18650 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18651 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18652 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18653 s,@CC_G_OPT@,$CC_G_OPT,;t t
18654 s,@LD_MODEL@,$LD_MODEL,;t t
18655 s,@shlibdir@,$shlibdir,;t t
18656 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18657 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18658 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18659 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18660 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18661 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18662 s,@LINK_PROGS@,$LINK_PROGS,;t t
18663 s,@LINK_TESTS@,$LINK_TESTS,;t t
18664 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18665 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18666 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18667 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18668 s,@RPATH_LIST@,$RPATH_LIST,;t t
18669 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18670 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18671 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18672 s,@PTHREAD@,$PTHREAD,;t t
18673 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18674 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18675 s,@ECHO_LT@,$ECHO_LT,;t t
18676 s,@ECHO_LD@,$ECHO_LD,;t t
18677 s,@RULE_CC@,$RULE_CC,;t t
18678 s,@SHOW_CC@,$SHOW_CC,;t t
18679 s,@ECHO_CC@,$ECHO_CC,;t t
18680 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18681 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18682 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18683 s,@ADAFLAGS@,$ADAFLAGS,;t t
18684 s,@ADA_TRACE@,$ADA_TRACE,;t t
18685 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18686 s,@M4_exists@,$M4_exists,;t t
18687 s,@cf_ada_make@,$cf_ada_make,;t t
18688 s,@cf_ada_config@,$cf_ada_config,;t t
18689 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18690 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18691 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18692 s,@cf_compile_generics@,$cf_compile_generics,;t t
18693 s,@cf_generic_objects@,$cf_generic_objects,;t t
18694 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18695 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18696 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18697 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18698 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18699 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18700 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18701 s,@cf_ada_package@,$cf_ada_package,;t t
18702 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18703 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18704 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18705 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18706 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18707 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18708 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18709 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18710 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18711 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18712 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18713 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18714 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18715 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18716 s,@TEST_ARG2@,$TEST_ARG2,;t t
18717 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18718 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18719 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18720 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18721 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18722 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18723 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18724 CEOF
18725
18726 EOF
18727
18728   cat >>"$CONFIG_STATUS" <<\EOF
18729   # Split the substitutions into bite-sized pieces for seds with
18730   # small command number limits, like on Digital OSF/1 and HP-UX.
18731   ac_max_sed_lines=48
18732   ac_sed_frag=1 # Number of current file.
18733   ac_beg=1 # First line for current file.
18734   ac_end=$ac_max_sed_lines # Line after last line for current file.
18735   ac_more_lines=:
18736   ac_sed_cmds=
18737   while "$ac_more_lines"; do
18738     if test "$ac_beg" -gt 1; then
18739       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18740     else
18741       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18742     fi
18743     if test ! -s $tmp/subs.frag; then
18744       ac_more_lines=false
18745     else
18746       # The purpose of the label and of the branching condition is to
18747       # speed up the sed processing (if there are no `@' at all, there
18748       # is no need to browse any of the substitutions).
18749       # These are the two extra sed commands mentioned above.
18750       (echo ':t
18751   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18752       # It is possible to make a multiline substitution using escaped newlines.
18753       # Ensure that we do not split the substitution between script fragments.
18754       ac_BEG=$ac_end
18755       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18756       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18757       if test -s $tmp/subs.next; then
18758         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18759         if test ! -s $tmp/subs.edit; then
18760           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18761           if test ! -s $tmp/subs.edit; then
18762             if test "$ac_beg" -gt 1; then
18763               ac_end=`expr "$ac_end" - 1`
18764               continue
18765             fi
18766           fi
18767         fi
18768       fi
18769
18770       if test -z "$ac_sed_cmds"; then
18771         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18772       else
18773         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18774       fi
18775       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18776       ac_beg=$ac_end
18777       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18778     fi
18779   done
18780   if test -z "$ac_sed_cmds"; then
18781     ac_sed_cmds=cat
18782   fi
18783 fi # test -n "$CONFIG_FILES"
18784
18785 EOF
18786 cat >>"$CONFIG_STATUS" <<\EOF
18787 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18788   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18789   case "$ac_file" in
18790   - | *:- | *:-:* ) # input from stdin
18791         cat >$tmp/stdin
18792         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18793         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18794   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18795         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18796   * )   ac_file_in=$ac_file.in ;;
18797   esac
18798
18799   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18800   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18801          X"$ac_file" : 'X\(//\)[^/]' \| \
18802          X"$ac_file" : 'X\(//\)$' \| \
18803          X"$ac_file" : 'X\(/\)' \| \
18804          .     : '\(.\)' 2>/dev/null ||
18805 echo X"$ac_file" |
18806     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18807           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18808           /^X\(\/\/\)$/{ s//\1/; q; }
18809           /^X\(\/\).*/{ s//\1/; q; }
18810           s/.*/./; q'`
18811   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18812     { case "$ac_dir" in
18813   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18814   *)                      as_incr_dir=.;;
18815 esac
18816 as_dummy="$ac_dir"
18817 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18818   case $as_mkdir_dir in
18819     # Skip DOS drivespec
18820     ?:) as_incr_dir=$as_mkdir_dir ;;
18821     *)
18822       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18823       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18824     ;;
18825   esac
18826 done; }
18827
18828     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18829     # A "../" for each directory in $ac_dir_suffix.
18830     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18831   else
18832     ac_dir_suffix= ac_dots=
18833   fi
18834
18835   case "$srcdir" in
18836   .)  ac_srcdir=.
18837       if test -z "$ac_dots"; then
18838          ac_top_srcdir=.
18839       else
18840          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18841       fi ;;
18842   [\\/]* | ?:[\\/]* )
18843       ac_srcdir="$srcdir$ac_dir_suffix";
18844       ac_top_srcdir="$srcdir" ;;
18845   *) # Relative path.
18846     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18847     ac_top_srcdir="$ac_dots$srcdir" ;;
18848   esac
18849
18850   case $INSTALL in
18851   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18852   *) ac_INSTALL=$ac_dots$INSTALL ;;
18853   esac
18854
18855   if test x"$ac_file" != x-; then
18856     { echo "$as_me:18856: creating $ac_file" >&5
18857 echo "$as_me: creating $ac_file" >&6;}
18858     rm -f "$ac_file"
18859   fi
18860   # Let's still pretend it is `configure' which instantiates (i.e., don't
18861   # use $as_me), people would be surprised to read:
18862   #    /* config.h.  Generated automatically by config.status.  */
18863   configure_input="Generated automatically from `echo $ac_file_in |
18864                                                  sed 's,.*/,,'` by configure."
18865
18866   # First look for the input files in the build tree, otherwise in the
18867   # src tree.
18868   ac_file_inputs=`IFS=:
18869     for f in $ac_file_in; do
18870       case $f in
18871       -) echo $tmp/stdin ;;
18872       [\\/$]*)
18873          # Absolute (can't be DOS-style, as IFS=:)
18874          test -f "$f" || { { echo "$as_me:18874: error: cannot find input file: $f" >&5
18875 echo "$as_me: error: cannot find input file: $f" >&2;}
18876    { (exit 1); exit 1; }; }
18877          echo $f;;
18878       *) # Relative
18879          if test -f "$f"; then
18880            # Build tree
18881            echo $f
18882          elif test -f "$srcdir/$f"; then
18883            # Source tree
18884            echo "$srcdir/$f"
18885          else
18886            # /dev/null tree
18887            { { echo "$as_me:18887: error: cannot find input file: $f" >&5
18888 echo "$as_me: error: cannot find input file: $f" >&2;}
18889    { (exit 1); exit 1; }; }
18890          fi;;
18891       esac
18892     done` || { (exit 1); exit 1; }
18893 EOF
18894 cat >>"$CONFIG_STATUS" <<\EOF
18895   ac_warn_datarootdir=no
18896   if test x"$ac_file" != x-; then
18897     for ac_item in $ac_file_inputs
18898     do
18899       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18900       if test -n "$ac_seen"; then
18901         ac_used=`grep '@datarootdir@' "$ac_item"`
18902         if test -z "$ac_used"; then
18903           { echo "$as_me:18903: WARNING: datarootdir was used implicitly but not set:
18904 $ac_seen" >&5
18905 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18906 $ac_seen" >&2;}
18907           ac_warn_datarootdir=yes
18908         fi
18909       fi
18910       ac_seen=`grep '${datarootdir}' "$ac_item"`
18911       if test -n "$ac_seen"; then
18912         { echo "$as_me:18912: WARNING: datarootdir was used explicitly but not set:
18913 $ac_seen" >&5
18914 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18915 $ac_seen" >&2;}
18916         ac_warn_datarootdir=yes
18917       fi
18918     done
18919   fi
18920
18921 if test "x$ac_warn_datarootdir" = xyes; then
18922   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18923 fi
18924
18925 EOF
18926 cat >>"$CONFIG_STATUS" <<EOF
18927   sed "$ac_vpsub
18928 $extrasub
18929 EOF
18930 cat >>"$CONFIG_STATUS" <<\EOF
18931 :t
18932 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18933 s,@configure_input@,$configure_input,;t t
18934 s,@srcdir@,$ac_srcdir,;t t
18935 s,@top_srcdir@,$ac_top_srcdir,;t t
18936 s,@INSTALL@,$ac_INSTALL,;t t
18937 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18938   rm -f $tmp/stdin
18939   if test x"$ac_file" != x-; then
18940     cp "$tmp/out" "$ac_file"
18941
18942     for ac_name in prefix exec_prefix datarootdir
18943     do
18944         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18945         if test -n "$ac_seen"; then
18946             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18947             if test -z "$ac_init"; then
18948               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18949               { echo "$as_me:18949: WARNING: Variable $ac_name is used but was not set:
18950 $ac_seen" >&5
18951 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18952 $ac_seen" >&2;}
18953             fi
18954         fi
18955     done
18956     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18957     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18958     if test -s $tmp/out; then
18959       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18960       { echo "$as_me:18960: WARNING: Some variables may not be substituted:
18961 $ac_seen" >&5
18962 echo "$as_me: WARNING: Some variables may not be substituted:
18963 $ac_seen" >&2;}
18964     fi
18965   else
18966     cat $tmp/out
18967   fi
18968   rm -f $tmp/out
18969
18970 done
18971 EOF
18972 cat >>"$CONFIG_STATUS" <<\EOF
18973
18974 #
18975 # CONFIG_HEADER section.
18976 #
18977
18978 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18979 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18980 #
18981 # ac_d sets the value in "#define NAME VALUE" lines.
18982 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18983 ac_dB='[        ].*$,\1#\2'
18984 ac_dC=' '
18985 ac_dD=',;t'
18986 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18987 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18988 ac_iB='\([      ]\),\1#\2define\3'
18989 ac_iC=' '
18990 ac_iD='\4,;t'
18991 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18992 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18993 ac_uB='$,\1#\2define\3'
18994 ac_uC=' '
18995 ac_uD=',;t'
18996
18997 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18998   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18999   case "$ac_file" in
19000   - | *:- | *:-:* ) # input from stdin
19001         cat >$tmp/stdin
19002         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19003         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19004   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19005         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19006   * )   ac_file_in=$ac_file.in ;;
19007   esac
19008
19009   test x"$ac_file" != x- && { echo "$as_me:19009: creating $ac_file" >&5
19010 echo "$as_me: creating $ac_file" >&6;}
19011
19012   # First look for the input files in the build tree, otherwise in the
19013   # src tree.
19014   ac_file_inputs=`IFS=:
19015     for f in $ac_file_in; do
19016       case $f in
19017       -) echo $tmp/stdin ;;
19018       [\\/$]*)
19019          # Absolute (can't be DOS-style, as IFS=:)
19020          test -f "$f" || { { echo "$as_me:19020: error: cannot find input file: $f" >&5
19021 echo "$as_me: error: cannot find input file: $f" >&2;}
19022    { (exit 1); exit 1; }; }
19023          echo $f;;
19024       *) # Relative
19025          if test -f "$f"; then
19026            # Build tree
19027            echo $f
19028          elif test -f "$srcdir/$f"; then
19029            # Source tree
19030            echo "$srcdir/$f"
19031          else
19032            # /dev/null tree
19033            { { echo "$as_me:19033: error: cannot find input file: $f" >&5
19034 echo "$as_me: error: cannot find input file: $f" >&2;}
19035    { (exit 1); exit 1; }; }
19036          fi;;
19037       esac
19038     done` || { (exit 1); exit 1; }
19039   # Remove the trailing spaces.
19040   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19041
19042 EOF
19043
19044 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19045 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19046 # be either 'cat' or 'sort'.
19047 cat confdefs.h | uniq >conftest.vals
19048
19049 # Break up conftest.vals because some shells have a limit on
19050 # the size of here documents, and old seds have small limits too.
19051
19052 rm -f conftest.tail
19053 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19054 while grep . conftest.vals >/dev/null
19055 do
19056   # Write chunks of a limited-size here document to conftest.frag.
19057   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19058   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19059   echo 'CEOF' >> "$CONFIG_STATUS"
19060   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19061   rm -f conftest.vals
19062   mv conftest.tail conftest.vals
19063 done
19064 rm -f conftest.vals
19065
19066 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19067 # marker @DEFS@.
19068 echo '  cat >> conftest.edit <<CEOF
19069 /@DEFS@/r conftest.frag
19070 /@DEFS@/d
19071 CEOF
19072 sed -f conftest.edit $tmp/in > $tmp/out
19073 rm -f $tmp/in
19074 mv $tmp/out $tmp/in
19075 rm -f conftest.edit conftest.frag
19076 ' >> "$CONFIG_STATUS"
19077
19078 cat >>"$CONFIG_STATUS" <<\EOF
19079   # Let's still pretend it is `configure' which instantiates (i.e., don't
19080   # use $as_me), people would be surprised to read:
19081   #    /* config.h.  Generated automatically by config.status.  */
19082   if test x"$ac_file" = x-; then
19083     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19084   else
19085     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19086   fi
19087   cat $tmp/in >>$tmp/config.h
19088   rm -f $tmp/in
19089   if test x"$ac_file" != x-; then
19090     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19091       { echo "$as_me:19091: $ac_file is unchanged" >&5
19092 echo "$as_me: $ac_file is unchanged" >&6;}
19093     else
19094       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19095          X"$ac_file" : 'X\(//\)[^/]' \| \
19096          X"$ac_file" : 'X\(//\)$' \| \
19097          X"$ac_file" : 'X\(/\)' \| \
19098          .     : '\(.\)' 2>/dev/null ||
19099 echo X"$ac_file" |
19100     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19101           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19102           /^X\(\/\/\)$/{ s//\1/; q; }
19103           /^X\(\/\).*/{ s//\1/; q; }
19104           s/.*/./; q'`
19105       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19106         { case "$ac_dir" in
19107   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19108   *)                      as_incr_dir=.;;
19109 esac
19110 as_dummy="$ac_dir"
19111 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19112   case $as_mkdir_dir in
19113     # Skip DOS drivespec
19114     ?:) as_incr_dir=$as_mkdir_dir ;;
19115     *)
19116       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19117       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19118     ;;
19119   esac
19120 done; }
19121
19122       fi
19123       rm -f "$ac_file"
19124       mv "$tmp/config.h" "$ac_file"
19125     fi
19126   else
19127     cat $tmp/config.h
19128     rm -f $tmp/config.h
19129   fi
19130 done
19131 EOF
19132 cat >>"$CONFIG_STATUS" <<\EOF
19133 #
19134 # CONFIG_COMMANDS section.
19135 #
19136 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19137   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19138   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19139
19140   case "$ac_dest" in
19141     default )
19142 if test -z "$USE_OLD_MAKERULES" ; then
19143         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19144 fi
19145  ;;
19146   esac
19147 done
19148 EOF
19149
19150 cat >>"$CONFIG_STATUS" <<\EOF
19151
19152 { (exit 0); exit 0; }
19153 EOF
19154 chmod +x "$CONFIG_STATUS"
19155 ac_clean_files=$ac_clean_files_save
19156
19157 # configure is writing to config.log, and then calls config.status.
19158 # config.status does its own redirection, appending to config.log.
19159 # Unfortunately, on DOS this fails, as config.log is still kept open
19160 # by configure, so config.status won't be able to write to it; its
19161 # output is simply discarded.  So we exec the FD to /dev/null,
19162 # effectively closing config.log, so it can be properly (re)opened and
19163 # appended to by config.status.  When coming back to configure, we
19164 # need to make the FD available again.
19165 if test "$no_create" != yes; then
19166   ac_cs_success=:
19167   exec 5>/dev/null
19168   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19169   exec 5>>config.log
19170   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19171   # would make configure fail if this is the last instruction.
19172   "$ac_cs_success" || { (exit 1); exit 1; }
19173 fi
19174 ${MAKE:-make} preinstall